@ng-doc/app 16.12.1 → 16.13.0-beta.1
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.
- package/README.md +1 -0
- package/components/api-list/index.d.ts +0 -1
- package/components/breadcrumb/breadcrumb.component.d.ts +4 -8
- package/components/index.d.ts +1 -0
- package/components/navbar/index.d.ts +0 -1
- package/components/page/page.component.d.ts +14 -9
- package/components/page-navigation/index.d.ts +1 -0
- package/components/page-navigation/page-navigation.component.d.ts +8 -0
- package/components/search/index.d.ts +0 -1
- package/components/sidebar/index.d.ts +0 -1
- package/components/tabs/index.d.ts +1 -1
- package/components/toc/toc.component.d.ts +16 -14
- package/defaults/default-processors/default-processors.d.ts +2 -0
- package/defaults/default-processors/index.d.ts +1 -0
- package/defaults/default-skeleton/default-skeleton.d.ts +2 -0
- package/defaults/default-skeleton/index.d.ts +1 -0
- package/defaults/index.d.ts +2 -0
- package/esm2022/classes/default-search-engine/default-search-engine.mjs +2 -2
- package/esm2022/components/api-list/api-list.component.mjs +3 -3
- package/esm2022/components/api-list/index.mjs +1 -2
- package/esm2022/components/breadcrumb/breadcrumb.component.mjs +11 -18
- package/esm2022/components/code/code.component.mjs +3 -3
- package/esm2022/components/demo/demo.component.mjs +3 -3
- package/esm2022/components/demo-displayer/demo-displayer.component.mjs +3 -3
- package/esm2022/components/demo-pane/demo-pane.component.mjs +3 -3
- package/esm2022/components/index.mjs +2 -1
- package/esm2022/components/link/link.component.mjs +3 -3
- package/esm2022/components/navbar/index.mjs +1 -2
- package/esm2022/components/navbar/navbar.component.mjs +4 -4
- package/esm2022/components/page/page.component.mjs +62 -24
- package/esm2022/components/page-navigation/index.mjs +2 -0
- package/esm2022/components/page-navigation/ng-doc-app-components-page-navigation.mjs +5 -0
- package/esm2022/components/page-navigation/page-navigation.component.mjs +29 -0
- package/esm2022/components/playground/base-playground.mjs +2 -2
- package/esm2022/components/playground/playground-demo/playground-demo.component.mjs +5 -4
- package/esm2022/components/playground/playground-properties/playground-properties.component.mjs +5 -4
- package/esm2022/components/playground/playground-property/playground-property.component.mjs +3 -3
- package/esm2022/components/playground/playground.component.mjs +3 -3
- package/esm2022/components/root/root.component.mjs +4 -4
- package/esm2022/components/search/index.mjs +1 -2
- package/esm2022/components/search/search.component.mjs +3 -3
- package/esm2022/components/search-result/search-result.component.mjs +3 -3
- package/esm2022/components/sidebar/index.mjs +1 -2
- package/esm2022/components/sidebar/sidebar-category/sidebar-category.component.mjs +3 -3
- package/esm2022/components/sidebar/sidebar.component.mjs +12 -3
- package/esm2022/components/tabs/index.mjs +2 -2
- package/esm2022/components/tabs/tabs.component.mjs +4 -4
- package/esm2022/components/theme-toggle/theme-toggle.component.mjs +3 -3
- package/esm2022/components/toc/toc-element/toc-element.component.mjs +3 -3
- package/esm2022/components/toc/toc.component.mjs +34 -50
- package/esm2022/constants/themes.mjs +5 -2
- package/esm2022/defaults/default-processors/default-processors.mjs +17 -0
- package/esm2022/defaults/default-processors/index.mjs +2 -0
- package/esm2022/defaults/default-processors/ng-doc-app-defaults-default-processors.mjs +5 -0
- package/esm2022/defaults/default-skeleton/default-skeleton.mjs +7 -0
- package/esm2022/defaults/default-skeleton/index.mjs +2 -0
- package/esm2022/defaults/default-skeleton/ng-doc-app-defaults-default-skeleton.mjs +5 -0
- package/esm2022/defaults/index.mjs +3 -0
- package/esm2022/defaults/ng-doc-app-defaults.mjs +5 -0
- package/esm2022/helpers/create-component.mjs +16 -0
- package/esm2022/helpers/format-html.mjs +2 -2
- package/esm2022/helpers/index.mjs +2 -4
- package/esm2022/index.mjs +3 -2
- package/esm2022/interfaces/index.mjs +2 -2
- package/esm2022/interfaces/page-processor.mjs +1 -1
- package/esm2022/interfaces/page-skeleton.mjs +2 -0
- package/esm2022/processors/index.mjs +1 -2
- package/esm2022/processors/page-processor/page-processor.directive.mjs +7 -4
- package/esm2022/processors/processors/blockquote.processor.mjs +1 -1
- package/esm2022/processors/processors/tooltip.processor.mjs +3 -5
- package/esm2022/providers/index.mjs +6 -0
- package/esm2022/providers/ng-doc-app/index.mjs +2 -0
- package/esm2022/providers/ng-doc-app/ng-doc-app-providers-ng-doc-app.mjs +5 -0
- package/esm2022/providers/ng-doc-app/provide-ng-doc-app.mjs +56 -0
- package/esm2022/providers/ng-doc-app-providers.mjs +5 -0
- package/esm2022/providers/page-skeleton/index.mjs +2 -0
- package/esm2022/providers/page-skeleton/ng-doc-app-providers-page-skeleton.mjs +5 -0
- package/esm2022/providers/page-skeleton/provide-page-skeleton.mjs +10 -0
- package/esm2022/providers/playground-demo/index.mjs +2 -0
- package/esm2022/providers/playground-demo/ng-doc-app-providers-playground-demo.mjs +5 -0
- package/esm2022/providers/playground-demo/provide-playground-demo.mjs +30 -0
- package/esm2022/providers/search-engine/index.mjs +2 -0
- package/esm2022/providers/search-engine/ng-doc-app-providers-search-engine.mjs +5 -0
- package/esm2022/providers/search-engine/provide-search-engine.mjs +17 -0
- package/esm2022/providers/type-control/index.mjs +2 -0
- package/esm2022/providers/type-control/ng-doc-app-providers-type-control.mjs +5 -0
- package/esm2022/providers/type-control/provide-type-control.mjs +33 -0
- package/esm2022/services/theme/theme.service.mjs +1 -1
- package/esm2022/tokens/index.mjs +2 -1
- package/esm2022/tokens/page-processor.mjs +6 -5
- package/esm2022/tokens/page-skeleton.mjs +3 -0
- package/esm2022/type-controls/number-control/number-control.component.mjs +3 -3
- package/esm2022/type-controls/string-control/string-control.component.mjs +3 -3
- package/esm2022/type-controls/type-alias-control/type-alias-control.component.mjs +3 -3
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +1 -1
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +7 -20
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +10 -16
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +2 -2
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +2 -2
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +2 -2
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +2 -2
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +2 -2
- package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +4 -17
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +35 -0
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-page.mjs +62 -23
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +11 -9
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +2 -2
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-result.mjs +2 -2
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +7 -20
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +15 -20
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +2 -2
- package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +2 -2
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +37 -53
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +1 -0
- package/fesm2022/ng-doc-app-components.mjs.map +1 -1
- package/fesm2022/ng-doc-app-constants.mjs +4 -1
- package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs +24 -0
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -0
- package/fesm2022/ng-doc-app-defaults-default-skeleton.mjs +14 -0
- package/fesm2022/ng-doc-app-defaults-default-skeleton.mjs.map +1 -0
- package/fesm2022/ng-doc-app-defaults.mjs +7 -0
- package/fesm2022/ng-doc-app-defaults.mjs.map +1 -0
- package/fesm2022/ng-doc-app-helpers.mjs +18 -80
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-page-processor.mjs +5 -2
- package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs +2 -4
- package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors.mjs +1 -21
- package/fesm2022/ng-doc-app-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +63 -0
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers-page-skeleton.mjs +17 -0
- package/fesm2022/ng-doc-app-providers-page-skeleton.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers-playground-demo.mjs +37 -0
- package/fesm2022/ng-doc-app-providers-playground-demo.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers-search-engine.mjs +24 -0
- package/fesm2022/ng-doc-app-providers-search-engine.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers-type-control.mjs +40 -0
- package/fesm2022/ng-doc-app-providers-type-control.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers.mjs +10 -0
- package/fesm2022/ng-doc-app-providers.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2022/ng-doc-app-tokens.mjs +8 -5
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs +2 -2
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs +2 -2
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +2 -2
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app.mjs +2 -1
- package/fesm2022/ng-doc-app.mjs.map +1 -1
- package/helpers/create-component.d.ts +8 -0
- package/helpers/index.d.ts +1 -3
- package/index.d.ts +2 -1
- package/interfaces/index.d.ts +1 -1
- package/interfaces/page-processor.d.ts +1 -1
- package/interfaces/page-skeleton.d.ts +53 -0
- package/package.json +63 -15
- package/processors/index.d.ts +0 -1
- package/providers/index.d.ts +5 -0
- package/providers/ng-doc-app/index.d.ts +1 -0
- package/providers/ng-doc-app/provide-ng-doc-app.d.ts +27 -0
- package/providers/page-skeleton/index.d.ts +1 -0
- package/providers/page-skeleton/provide-page-skeleton.d.ts +10 -0
- package/providers/playground-demo/index.d.ts +1 -0
- package/{helpers → providers/playground-demo}/provide-playground-demo.d.ts +1 -1
- package/providers/search-engine/index.d.ts +1 -0
- package/providers/type-control/index.d.ts +1 -0
- package/{helpers → providers/type-control}/provide-type-control.d.ts +1 -1
- package/styles/global.css +58 -45
- package/styles/main.css +58 -45
- package/tokens/index.d.ts +1 -0
- package/tokens/page-processor.d.ts +2 -2
- package/tokens/page-skeleton.d.ts +3 -0
- package/components/api-list/api-list.module.d.ts +0 -11
- package/components/navbar/navbar.module.d.ts +0 -7
- package/components/search/search.module.d.ts +0 -11
- package/components/sidebar/sidebar.module.d.ts +0 -7
- package/esm2022/components/api-list/api-list.module.mjs +0 -21
- package/esm2022/components/navbar/navbar.module.mjs +0 -17
- package/esm2022/components/search/search.module.mjs +0 -21
- package/esm2022/components/sidebar/sidebar.module.mjs +0 -17
- package/esm2022/helpers/provide-playground-demo.mjs +0 -29
- package/esm2022/helpers/provide-search-engine.mjs +0 -17
- package/esm2022/helpers/provide-type-control.mjs +0 -33
- package/esm2022/interfaces/application-config.mjs +0 -2
- package/esm2022/modules/index.mjs +0 -2
- package/esm2022/modules/ng-doc-app-modules.mjs +0 -5
- package/esm2022/modules/root/index.mjs +0 -2
- package/esm2022/modules/root/ng-doc-app-modules-root.mjs +0 -5
- package/esm2022/modules/root/ng-doc.module.mjs +0 -61
- package/esm2022/processors/default-processors.mjs +0 -18
- package/fesm2022/ng-doc-app-modules-root.mjs +0 -67
- package/fesm2022/ng-doc-app-modules-root.mjs.map +0 -1
- package/fesm2022/ng-doc-app-modules.mjs +0 -6
- package/fesm2022/ng-doc-app-modules.mjs.map +0 -1
- package/interfaces/application-config.d.ts +0 -15
- package/modules/index.d.ts +0 -1
- package/modules/root/index.d.ts +0 -1
- package/modules/root/ng-doc.module.d.ts +0 -13
- package/processors/default-processors.d.ts +0 -2
- /package/{helpers → providers/search-engine}/provide-search-engine.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-toc.mjs","sources":["../../../../libs/app/components/toc/toc-element/toc-element.component.ts","../../../../libs/app/components/toc/toc-element/toc-element.component.html","../../../../libs/app/components/toc/toc.component.ts","../../../../libs/app/components/toc/toc.component.html","../../../../libs/app/components/toc/ng-doc-app-components-toc.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input} from '@angular/core';\n\n@Component({\n\tselector: 'li[ng-doc-toc-element]',\n\ttemplateUrl: './toc-element.component.html',\n\tstyleUrls: ['./toc-element.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class NgDocTocElementComponent {\n\t@Input()\n\thref: string = '';\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-selected')\n\tselected: boolean = false;\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-level')\n\tlevel: number = 1;\n\n\tconstructor(readonly elementRef: ElementRef<HTMLElement>) {}\n}\n","<a [href]=\"href\" [style.padding-left]=\"'calc(var(--ng-doc-toc-indent) * ' + level + ')'\"><ng-content></ng-content></a>\n","import {DOCUMENT, NgFor} from '@angular/common';\nimport {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInject,\n\tInput,\n\tNgZone,\n\tOnChanges,\n\tQueryList,\n\tRenderer2,\n\tViewChild,\n\tViewChildren,\n} from '@angular/core';\nimport {Event as REvent, Router, Scroll} from '@angular/router';\nimport {generateToc} from '@ng-doc/app/helpers';\nimport {NgDocTocItem} from '@ng-doc/app/interfaces';\nimport {isPresent} from '@ng-doc/core/helpers/is-present';\nimport {ngDocZoneOptimize} from '@ng-doc/ui-kit';\nimport {UntilDestroy} from '@ngneat/until-destroy';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {debounceTime, distinctUntilChanged, filter, map, startWith} from 'rxjs/operators';\n\nimport {NgDocTocElementComponent} from './toc-element/toc-element.component';\n\n@Component({\n\tselector: 'ng-doc-toc',\n\ttemplateUrl: './toc.component.html',\n\tstyleUrls: ['./toc.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [NgFor, NgDocTocElementComponent],\n})\n@UntilDestroy()\nexport class NgDocTocComponent implements OnChanges, AfterViewInit {\n\t@Input()\n\tpageContainer?: HTMLElement;\n\n\t@ViewChild('selection', {static: true, read: ElementRef})\n\tselection?: ElementRef<HTMLElement>;\n\n\t@ViewChildren(NgDocTocElementComponent)\n\telements: QueryList<NgDocTocElementComponent> = new QueryList<NgDocTocElementComponent>();\n\n\tmap: NgDocTocItem[] = [];\n\tactiveItem?: NgDocTocItem;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT)\n\t\tprivate readonly document: Document,\n\t\tprivate readonly ngZone: NgZone,\n\t\tprivate readonly changeDetectorRef: ChangeDetectorRef,\n\t\tprivate readonly renderer: Renderer2,\n\t\tprivate readonly router: Router,\n\t) {}\n\n\tngOnChanges(): void {\n\t\t/**\n\t\t * We need to use `Promise.resolve().then()` here because we need to wait for the `pageContainer` to be rendered\n\t\t * and processed by the processors\n\t\t */\n\t\tPromise.resolve().then(() => {\n\t\t\tif (this.pageContainer) {\n\t\t\t\tthis.map = generateToc(this.pageContainer);\n\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t}\n\t\t});\n\t}\n\n\tngAfterViewInit(): void {\n\t\tconst scrollSelection: Observable<NgDocTocItem> = fromEvent(this.document, 'scroll').pipe(\n\t\t\tmap((event: Event) => (event.target as Document).scrollingElement as HTMLElement),\n\t\t\tstartWith(this.document.scrollingElement as HTMLElement),\n\t\t\tfilter(() => !!this.map.length),\n\t\t\tmap((target: HTMLElement) => {\n\t\t\t\tconst percentage: number = (target.scrollTop * 100) / (target.scrollHeight - target.offsetHeight);\n\t\t\t\tconst selectionLine: number = target.scrollTop + (target.offsetHeight * percentage) / 100;\n\n\t\t\t\treturn this.map.reduce((pTarget: NgDocTocItem, cTarget: NgDocTocItem) => {\n\t\t\t\t\tconst pTop: number = pTarget.element.getBoundingClientRect().top + target.scrollTop;\n\t\t\t\t\tconst cTop: number = cTarget.element.getBoundingClientRect().top + target.scrollTop;\n\n\t\t\t\t\treturn Math.abs(cTop - selectionLine) < Math.abs(pTop - selectionLine) ? cTarget : pTarget;\n\t\t\t\t});\n\t\t\t}),\n\t\t);\n\t\tconst routerSelection: Observable<NgDocTocItem> = this.router.events.pipe(\n\t\t\tmap((event: REvent) => {\n\t\t\t\tif (event instanceof Scroll) {\n\t\t\t\t\tconst item: NgDocTocItem | undefined = this.map.find((item: NgDocTocItem) =>\n\t\t\t\t\t\titem.path.includes(event.routerEvent.url),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}),\n\t\t\tfilter(isPresent),\n\t\t\tdebounceTime(20),\n\t\t);\n\n\t\tPromise.resolve().then(() => {\n\t\t\tmerge(scrollSelection, routerSelection)\n\t\t\t\t.pipe(distinctUntilChanged(), ngDocZoneOptimize(this.ngZone))\n\t\t\t\t.subscribe(this.select.bind(this));\n\t\t});\n\t}\n\n\tprivate select(item: NgDocTocItem): void {\n\t\tconst index: number = this.map.indexOf(item);\n\n\t\tif (this.selection) {\n\t\t\tconst element: HTMLElement | undefined = this.elements.toArray()[index]?.elementRef.nativeElement;\n\n\t\t\tif (element) {\n\t\t\t\tthis.renderer.setStyle(this.selection.nativeElement, 'top', `${element.offsetTop}px`);\n\t\t\t\tthis.renderer.setStyle(this.selection.nativeElement, 'height', `${element.offsetHeight}px`);\n\n\t\t\t\telement.scrollIntoView({block: 'nearest'});\n\t\t\t}\n\t\t}\n\n\t\tthis.activeItem = item;\n\t\tthis.changeDetectorRef.detectChanges();\n\t}\n}\n","<div class=\"ng-doc-toc-wrapper\">\n\t<div class=\"ng-doc-toc-selection\" #selection></div>\n\t<ul class=\"ng-doc-toc\">\n\t\t<li\n\t\t\t*ngFor=\"let item of map\"\n\t\t\tng-doc-toc-element\n\t\t\t[href]=\"item.path\"\n\t\t\t[level]=\"item.level\"\n\t\t\t[selected]=\"item === activeItem\"\n\t\t>\n\t\t\t{{ item.title }}\n\t\t</li>\n\t</ul>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,MAOa,wBAAwB,CAAA;AAYpC,IAAA,WAAA,CAAqB,UAAmC,EAAA;QAAnC,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QAVxD,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAIlB,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAI1B,IAAK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AAA;sBADZ,KAAK;gBAIN,SAAS,EAAA,CAAA;sBADR,SAAS;uBAAC,WAAW,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAC,CAAA;gBAIxD,QAAQ,EAAA,CAAA;sBADP,YAAY;uBAAC,wBAAwB,CAAA;;;AE3CvC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-toc.mjs","sources":["../../../../libs/app/components/toc/toc-element/toc-element.component.ts","../../../../libs/app/components/toc/toc-element/toc-element.component.html","../../../../libs/app/components/toc/toc.component.ts","../../../../libs/app/components/toc/toc.component.html","../../../../libs/app/components/toc/ng-doc-app-components-toc.ts"],"sourcesContent":["import {ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input} from '@angular/core';\n\n@Component({\n\tselector: 'li[ng-doc-toc-element]',\n\ttemplateUrl: './toc-element.component.html',\n\tstyleUrls: ['./toc-element.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class NgDocTocElementComponent {\n\t@Input()\n\thref: string = '';\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-selected')\n\tselected: boolean = false;\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-level')\n\tlevel: number = 1;\n\n\tconstructor(readonly elementRef: ElementRef<HTMLElement>) {}\n}\n","<a [href]=\"href\" [style.padding-left]=\"'calc(var(--ng-doc-toc-indent) * ' + level + ')'\">\n\t<ng-content></ng-content>\n</a>\n","import { DOCUMENT, NgFor } from '@angular/common';\nimport {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tinject,\n\tInput,\n\tNgZone,\n\tQueryList,\n\tRenderer2,\n\tViewChild,\n\tViewChildren,\n} from '@angular/core';\nimport { Event as REvent, Router, Scroll } from '@angular/router';\nimport { NgDocPageToc, NgDocTocItem } from '@ng-doc/app/interfaces';\nimport { isPresent } from '@ng-doc/core/helpers/is-present';\nimport { NgDocMediaQueryDirective, ngDocZoneOptimize } from '@ng-doc/ui-kit';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { fromEvent, merge, Observable } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, filter, map, startWith } from 'rxjs/operators';\n\nimport { NgDocTocElementComponent } from './toc-element/toc-element.component';\n\n@Component({\n\tselector: 'ng-doc-toc',\n\ttemplateUrl: './toc.component.html',\n\tstyleUrls: ['./toc.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [NgFor, NgDocTocElementComponent, NgDocMediaQueryDirective],\n})\n@UntilDestroy()\nexport class NgDocTocComponent implements AfterViewInit, NgDocPageToc {\n\t@Input()\n\ttableOfContent: NgDocTocItem[] = [];\n\n\t@ViewChild('selection', { read: ElementRef })\n\tselection?: ElementRef<HTMLElement>;\n\n\t@ViewChildren(NgDocTocElementComponent)\n\telements: QueryList<NgDocTocElementComponent> = new QueryList<NgDocTocElementComponent>();\n\n\tactiveItem?: NgDocTocItem;\n\n\tprotected readonly document: Document = inject(DOCUMENT);\n\tprotected readonly ngZone: NgZone = inject(NgZone);\n\tprotected readonly changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n\tprotected readonly renderer: Renderer2 = inject(Renderer2);\n\tprotected readonly router: Router = inject(Router);\n\n\tngAfterViewInit(): void {\n\t\tconst scrollSelection: Observable<NgDocTocItem> = fromEvent(this.document, 'scroll').pipe(\n\t\t\tfilter(() => !!this.tableOfContent.length),\n\t\t\tmap((event: Event) => (event.target as Document).scrollingElement as HTMLElement),\n\t\t\tstartWith(this.document.scrollingElement as HTMLElement),\n\t\t\tmap((target: HTMLElement) => {\n\t\t\t\tconst percentage: number =\n\t\t\t\t\t(target.scrollTop * 100) / (target.scrollHeight - target.offsetHeight);\n\t\t\t\tconst selectionLine: number = target.scrollTop + (target.offsetHeight * percentage) / 100;\n\n\t\t\t\treturn this.tableOfContent.reduce((pTarget: NgDocTocItem, cTarget: NgDocTocItem) => {\n\t\t\t\t\tconst pTop: number = pTarget.element.getBoundingClientRect().top + target.scrollTop;\n\t\t\t\t\tconst cTop: number = cTarget.element.getBoundingClientRect().top + target.scrollTop;\n\n\t\t\t\t\treturn Math.abs(cTop - selectionLine) < Math.abs(pTop - selectionLine)\n\t\t\t\t\t\t? cTarget\n\t\t\t\t\t\t: pTarget;\n\t\t\t\t});\n\t\t\t}),\n\t\t);\n\n\t\tconst routerSelection: Observable<NgDocTocItem> = this.router.events.pipe(\n\t\t\tmap((event: REvent) => {\n\t\t\t\tif (event instanceof Scroll) {\n\t\t\t\t\tconst item: NgDocTocItem | undefined = this.tableOfContent.find((item: NgDocTocItem) =>\n\t\t\t\t\t\titem.path.includes(event.routerEvent.url),\n\t\t\t\t\t);\n\n\t\t\t\t\tif (item) {\n\t\t\t\t\t\treturn item;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}),\n\t\t\tfilter(isPresent),\n\t\t\tdebounceTime(20),\n\t\t);\n\n\t\tconst elementsChanges = this.elements.changes.pipe(\n\t\t\tmap(() => this.activeItem),\n\t\t\tfilter(isPresent),\n\t\t);\n\n\t\tmerge(merge(scrollSelection, routerSelection).pipe(distinctUntilChanged()), elementsChanges)\n\t\t\t.pipe(ngDocZoneOptimize(this.ngZone), untilDestroyed(this))\n\t\t\t.subscribe(this.select.bind(this));\n\t}\n\n\t/**\n\t * Selects the item in the table of content.\n\t *\n\t * @param item - Item to select.\n\t */\n\tprotected select(item: NgDocTocItem): void {\n\t\tconst index: number = this.tableOfContent.indexOf(item);\n\n\t\tif (this.selection) {\n\t\t\tconst element: HTMLElement | undefined =\n\t\t\t\tthis.elements.toArray()[index]?.elementRef.nativeElement;\n\n\t\t\tif (element) {\n\t\t\t\tthis.renderer.setStyle(this.selection.nativeElement, 'top', `${element.offsetTop}px`);\n\t\t\t\tthis.renderer.setStyle(this.selection.nativeElement, 'height', `${element.offsetHeight}px`);\n\n\t\t\t\telement.scrollIntoView({ block: 'nearest' });\n\t\t\t}\n\t\t}\n\n\t\tthis.activeItem = item;\n\t\tthis.changeDetectorRef.detectChanges();\n\t}\n}\n","<ng-template\n\t[ngDocMediaQuery]=\"[mediaQuery.breakpoints.Large, mediaQuery.breakpoints.XLarge]\"\n\t#mediaQuery=\"ngDocMediaQuery\">\n\t<div class=\"ng-doc-toc-wrapper\">\n\t\t<div class=\"ng-doc-toc-container\">\n\t\t\t<div class=\"ng-doc-toc-selection\" #selection></div>\n\t\t\t<ul class=\"ng-doc-toc\">\n\t\t\t\t<li\n\t\t\t\t\t*ngFor=\"let item of tableOfContent\"\n\t\t\t\t\tng-doc-toc-element\n\t\t\t\t\t[href]=\"item.path\"\n\t\t\t\t\t[level]=\"item.level\"\n\t\t\t\t\t[selected]=\"item === activeItem\">\n\t\t\t\t\t{{ item.title }}\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAOa,wBAAwB,CAAA;AAYpC,IAAA,WAAA,CAAqB,UAAmC,EAAA;QAAnC,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QAVxD,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAIlB,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAI1B,IAAK,CAAA,KAAA,GAAW,CAAC,CAAC;KAE0C;8GAZhD,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,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AA,IAAA,EAAE,wBAAwB,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;AAGvD,iBAAiB,GAAA,UAAA,CAAA;AAD7B,IAAA,YAAY,EAAE;AACF,CAAA,EAAA,iBAAiB,CA0F7B,CAAA;2FA1FY,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAGL,eAAA,EAAA,uBAAuB,CAAC,MAAM,EACnC,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,CAAC,EAAA,QAAA,EAAA,omBAAA,EAAA,MAAA,EAAA,CAAA,uuBAAA,CAAA,EAAA,CAAA;8BAKpE,cAAc,EAAA,CAAA;sBADb,KAAK;gBAIN,SAAS,EAAA,CAAA;sBADR,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;gBAI5C,QAAQ,EAAA,CAAA;sBADP,YAAY;uBAAC,wBAAwB,CAAA;;;AEzCvC;;AAEG;;;;"}
|
|
@@ -9,6 +9,7 @@ export * from '@ng-doc/app/components/link';
|
|
|
9
9
|
export * from '@ng-doc/app/components/navbar';
|
|
10
10
|
export * from '@ng-doc/app/components/page';
|
|
11
11
|
export * from '@ng-doc/app/components/page-link';
|
|
12
|
+
export * from '@ng-doc/app/components/page-navigation';
|
|
12
13
|
export * from '@ng-doc/app/components/playground';
|
|
13
14
|
export * from '@ng-doc/app/components/root';
|
|
14
15
|
export * from '@ng-doc/app/components/search';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components.mjs","sources":["../../../../libs/app/components/ng-doc-app-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components.mjs","sources":["../../../../libs/app/components/ng-doc-app-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
|
@@ -31,7 +31,10 @@ const NG_DOC_STORE_THEME_KEY = 'ng-doc-theme-id';
|
|
|
31
31
|
* export class AppModule {}
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
const NG_DOC_NIGHT_THEME = {
|
|
34
|
+
const NG_DOC_NIGHT_THEME = {
|
|
35
|
+
id: 'ng-doc-night',
|
|
36
|
+
path: 'assets/ng-doc/app/themes/ng-doc-night.css',
|
|
37
|
+
};
|
|
35
38
|
/**
|
|
36
39
|
* Dark purple theme. You can set it manually by calling `NgDocThemeService.set` method.
|
|
37
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/themes.ts","../../../../libs/app/constants/ng-doc-app-constants.ts"],"sourcesContent":["export const NG_DOC_STORE_THEME_KEY: string = 'ng-doc-theme-id';\n","import {NgDocTheme} from '@ng-doc/app/interfaces';\n\n/**\n * Dark theme. You can set it manually by calling `NgDocThemeService.set` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_NIGHT_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_NIGHT_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_NIGHT_THEME: NgDocTheme = {
|
|
1
|
+
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/themes.ts","../../../../libs/app/constants/ng-doc-app-constants.ts"],"sourcesContent":["export const NG_DOC_STORE_THEME_KEY: string = 'ng-doc-theme-id';\n","import { NgDocTheme } from '@ng-doc/app/interfaces';\n\n/**\n * Dark theme. You can set it manually by calling `NgDocThemeService.set` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_NIGHT_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_NIGHT_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_NIGHT_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_NIGHT_THEME: NgDocTheme = {\n\tid: 'ng-doc-night',\n\tpath: 'assets/ng-doc/app/themes/ng-doc-night.css',\n};\n\n/**\n * Dark purple theme. You can set it manually by calling `NgDocThemeService.set` method.\n *\n * ```typescript\n * import {Component} from '@angular/core';\n * import {NgDocThemeService, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n *\n * @Component()\n * export class AppComponent {\n * \tconstructor(\n * \t private readonly themeService: NgDocThemeService,\n * \t) {\n * \t this.themeService.setTheme(NG_DOC_DARK_PURPLE_THEME.id);\n * \t}\n * }\n * ```\n *\n * Or you can set it as default theme in your app module:\n * ```typescript\n * import {NgModule} from '@angular/core';\n * import {NgDocModule, NG_DOC_DARK_PURPLE_THEME} from '@ng-doc/app';\n * import {AppComponent} from './app.component';\n *\n * @NgModule({\n * \tdeclarations: [AppComponent],\n * \timports: [NgDocModule.forRoot({defaultTheme: NG_DOC_DARK_PURPLE_THEME.id})],\n * \tbootstrap: [AppComponent],\n * })\n * export class AppModule {}\n * ```\n */\nexport const NG_DOC_DARK_PURPLE_THEME: NgDocTheme = {\n\tid: 'ng-doc-dark-purple',\n\tpath: 'assets/ng-doc/app/themes/ng-doc-dark-purple.css',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAW;;ACE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACU,MAAA,kBAAkB,GAAe;AAC7C,IAAA,EAAE,EAAE,cAAc;AAClB,IAAA,IAAI,EAAE,2CAA2C;EAChD;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACU,MAAA,wBAAwB,GAAe;AACnD,IAAA,EAAE,EAAE,oBAAoB;AACxB,IAAA,IAAI,EAAE,iDAAiD;;;ACvExD;;AAEG;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { blockquoteProcessor, iconProcessor, tooltipProcessor, linkProcessor, codeProcessor, demoProcessor, demoPaneProcessor, playgroundProcessor, tabsProcessor } from '@ng-doc/app/processors/processors';
|
|
2
|
+
|
|
3
|
+
const NG_DOC_DEFAULT_PAGE_PROCESSORS = [
|
|
4
|
+
/**
|
|
5
|
+
* The order of the directives is important.
|
|
6
|
+
* The higher the directive is in the list, the earlier it will be run.
|
|
7
|
+
*/
|
|
8
|
+
blockquoteProcessor,
|
|
9
|
+
iconProcessor,
|
|
10
|
+
tooltipProcessor,
|
|
11
|
+
linkProcessor,
|
|
12
|
+
codeProcessor,
|
|
13
|
+
demoProcessor,
|
|
14
|
+
demoPaneProcessor,
|
|
15
|
+
playgroundProcessor,
|
|
16
|
+
tabsProcessor,
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Generated bundle index. Do not edit.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export { NG_DOC_DEFAULT_PAGE_PROCESSORS };
|
|
24
|
+
//# sourceMappingURL=ng-doc-app-defaults-default-processors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-defaults-default-processors.mjs","sources":["../../../../libs/app/defaults/default-processors/default-processors.ts","../../../../libs/app/defaults/default-processors/ng-doc-app-defaults-default-processors.ts"],"sourcesContent":["import { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport {\n\tblockquoteProcessor,\n\tcodeProcessor,\n\tdemoPaneProcessor,\n\tdemoProcessor,\n\ticonProcessor,\n\tlinkProcessor,\n\tplaygroundProcessor,\n\ttabsProcessor,\n\ttooltipProcessor,\n} from '@ng-doc/app/processors/processors';\n\nexport const NG_DOC_DEFAULT_PAGE_PROCESSORS: NgDocPageProcessor[] = [\n\t/**\n\t * The order of the directives is important.\n\t * The higher the directive is in the list, the earlier it will be run.\n\t */\n\tblockquoteProcessor,\n\ticonProcessor,\n\ttooltipProcessor,\n\tlinkProcessor,\n\tcodeProcessor,\n\tdemoProcessor,\n\tdemoPaneProcessor,\n\tplaygroundProcessor,\n\ttabsProcessor,\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAaa,MAAA,8BAA8B,GAAyB;AACnE;;;AAGG;IACH,mBAAmB;IACnB,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,aAAa;;;AC1Bd;;AAEG;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NgDocBreadcrumbComponent, NgDocPageNavigationComponent, NgDocTocComponent } from '@ng-doc/app/components';
|
|
2
|
+
|
|
3
|
+
const NG_DOC_DEFAULT_PAGE_SKELETON = {
|
|
4
|
+
breadcrumbs: NgDocBreadcrumbComponent,
|
|
5
|
+
navigation: NgDocPageNavigationComponent,
|
|
6
|
+
toc: NgDocTocComponent,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Generated bundle index. Do not edit.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export { NG_DOC_DEFAULT_PAGE_SKELETON };
|
|
14
|
+
//# sourceMappingURL=ng-doc-app-defaults-default-skeleton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-defaults-default-skeleton.mjs","sources":["../../../../libs/app/defaults/default-skeleton/default-skeleton.ts","../../../../libs/app/defaults/default-skeleton/ng-doc-app-defaults-default-skeleton.ts"],"sourcesContent":["import {\n\tNgDocBreadcrumbComponent,\n\tNgDocPageNavigationComponent,\n\tNgDocTocComponent,\n} from '@ng-doc/app/components';\nimport { NgDocPageSkeleton } from '@ng-doc/app/interfaces';\n\nexport const NG_DOC_DEFAULT_PAGE_SKELETON: NgDocPageSkeleton = {\n\tbreadcrumbs: NgDocBreadcrumbComponent,\n\tnavigation: NgDocPageNavigationComponent,\n\ttoc: NgDocTocComponent,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAOa,MAAA,4BAA4B,GAAsB;AAC9D,IAAA,WAAW,EAAE,wBAAwB;AACrC,IAAA,UAAU,EAAE,4BAA4B;AACxC,IAAA,GAAG,EAAE,iBAAiB;;;ACVvB;;AAEG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-defaults.mjs","sources":["../../../../libs/app/defaults/ng-doc-app-defaults.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;AAEG"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { asArray } from '@ng-doc/core/helpers/as-array';
|
|
2
2
|
import { objectKeys } from '@ng-doc/core/helpers/object-keys';
|
|
3
|
-
import { InjectionToken } from '@angular/core';
|
|
4
|
-
import { NgDocSearchEngine } from '@ng-doc/app/classes/search-engine';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
*
|
|
@@ -14,6 +12,22 @@ function asBoolean(value) {
|
|
|
14
12
|
return !!value;
|
|
15
13
|
}
|
|
16
14
|
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param viewContainer
|
|
18
|
+
* @param component
|
|
19
|
+
* @param inputs
|
|
20
|
+
*/
|
|
21
|
+
function createComponent(viewContainer, component, inputs) {
|
|
22
|
+
const componentRef = viewContainer.createComponent(component);
|
|
23
|
+
if (inputs) {
|
|
24
|
+
Object.entries(inputs).forEach(([key, value]) => {
|
|
25
|
+
componentRef.setInput(key, value);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
/**
|
|
18
32
|
*
|
|
19
33
|
* @param html
|
|
@@ -26,7 +40,7 @@ async function formatHtml(html) {
|
|
|
26
40
|
wrap: 50,
|
|
27
41
|
markup: {
|
|
28
42
|
forceIndent: true,
|
|
29
|
-
}
|
|
43
|
+
},
|
|
30
44
|
});
|
|
31
45
|
}
|
|
32
46
|
|
|
@@ -87,85 +101,9 @@ function isPlaygroundProperty(obj) {
|
|
|
87
101
|
return objectKeys(obj).includes('type');
|
|
88
102
|
}
|
|
89
103
|
|
|
90
|
-
const tokenStore$1 = new Map();
|
|
91
|
-
/**
|
|
92
|
-
*
|
|
93
|
-
* @param type
|
|
94
|
-
* @param control
|
|
95
|
-
* @param options
|
|
96
|
-
* @param playgroundId
|
|
97
|
-
* @param selector
|
|
98
|
-
* @param component
|
|
99
|
-
*/
|
|
100
|
-
function providePlaygroundDemo(playgroundId, component) {
|
|
101
|
-
const token = tokenStore$1.get(playgroundId) ?? new InjectionToken(`NG_DOC_PLAYGROUND_DEMO_${playgroundId}`);
|
|
102
|
-
tokenStore$1.set(playgroundId, token);
|
|
103
|
-
return {
|
|
104
|
-
provide: token,
|
|
105
|
-
useValue: component,
|
|
106
|
-
multi: true,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Returns the token for the given playground id.
|
|
111
|
-
*
|
|
112
|
-
* @param playgroundId
|
|
113
|
-
*/
|
|
114
|
-
function getPlaygroundDemoToken(playgroundId) {
|
|
115
|
-
return tokenStore$1.get(playgroundId);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Provides the `NgDocSearchEngine` to enable search in the documentation.
|
|
120
|
-
*
|
|
121
|
-
* You can create and provide your own `NgDocSearchEngine` if you want to handle the search yourself.
|
|
122
|
-
*
|
|
123
|
-
* @param engine - The search engine class.
|
|
124
|
-
* @param args - The arguments for the search engine class.
|
|
125
|
-
* @returns The provider for the search engine.
|
|
126
|
-
*/
|
|
127
|
-
function provideSearchEngine(engine, ...args) {
|
|
128
|
-
return {
|
|
129
|
-
provide: NgDocSearchEngine,
|
|
130
|
-
useValue: new engine(...args),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const tokenStore = new Map();
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @param type
|
|
138
|
-
* @param control
|
|
139
|
-
* @param options
|
|
140
|
-
*/
|
|
141
|
-
function provideTypeControl(type, control, options) {
|
|
142
|
-
const token = new InjectionToken(`NG_DOC_TYPE_CONTROL_${type}`, {
|
|
143
|
-
providedIn: 'root',
|
|
144
|
-
factory: () => {
|
|
145
|
-
return {
|
|
146
|
-
control,
|
|
147
|
-
options,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
tokenStore.set(type, token);
|
|
152
|
-
return {
|
|
153
|
-
provide: 'nothing',
|
|
154
|
-
useValue: null,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Returns token for type control based on provided type
|
|
159
|
-
*
|
|
160
|
-
* @param type - type for searched control (e.g. `string`)
|
|
161
|
-
*/
|
|
162
|
-
function getTokenForType(type) {
|
|
163
|
-
return tokenStore.get(type);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
104
|
/**
|
|
167
105
|
* Generated bundle index. Do not edit.
|
|
168
106
|
*/
|
|
169
107
|
|
|
170
|
-
export { asBoolean, formatHtml, generateToc,
|
|
108
|
+
export { asBoolean, createComponent, formatHtml, generateToc, isDarkOsTheme, isExternalLink, isPlaygroundProperty };
|
|
171
109
|
//# sourceMappingURL=ng-doc-app-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/
|
|
1
|
+
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/create-component.ts","../../../../libs/app/helpers/format-html.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n\tif (typeof value === 'string') {\n\t\treturn value.toLowerCase() === 'true' ? true : value.toLowerCase() === 'false' ? false : !!value;\n\t}\n\treturn !!value;\n}\n","import { Type, ViewContainerRef } from '@angular/core';\n\n/**\n *\n * @param viewContainer\n * @param component\n * @param inputs\n */\nexport function createComponent<T>(\n\tviewContainer: ViewContainerRef,\n\tcomponent: Type<T>,\n\tinputs?: object,\n): void {\n\tconst componentRef = viewContainer.createComponent(component);\n\n\tif (inputs) {\n\t\tObject.entries(inputs).forEach(([key, value]) => {\n\t\t\tcomponentRef.setInput(key, value);\n\t\t});\n\t}\n\n\tcomponentRef.changeDetectorRef.detectChanges();\n}\n","/**\n *\n * @param html\n */\nexport async function formatHtml(html: string): Promise<string> {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\tconst formatter = await import('esthetic');\n\n\treturn formatter.default.html(html.trim(), {\n\t\twrap: 50,\n\t\tmarkup: {\n\t\t\tforceIndent: true,\n\t\t},\n\t});\n}\n","import {NgDocTocItem} from '@ng-doc/app/interfaces';\nimport {asArray} from '@ng-doc/core/helpers/as-array';\nimport {NgDocHeading} from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n *\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n\tconst headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n\tconst headingElements: HTMLHeadingElement[] = Array.from(\n\t\tcontainer.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n\t).filter((heading: HTMLHeadingElement) => heading.id);\n\n\tconst levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n\treturn headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n\t\tconst headingLevel: number = levelFromTagName(heading);\n\t\tconst anchor: HTMLAnchorElement | null = heading.querySelector<HTMLAnchorElement>('a.ng-doc-header-link');\n\n\t\tif (anchor) {\n\t\t\tmap.push({\n\t\t\t\ttitle: heading.textContent?.trim() ?? '',\n\t\t\t\telement: heading,\n\t\t\t\tpath: anchor.pathname + anchor.hash,\n\t\t\t\tlevel: levels.indexOf(headingLevel) + 1,\n\t\t\t});\n\t\t}\n\n\t\treturn map;\n\t}, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n\treturn Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import {objectKeys} from '@ng-doc/core/helpers/object-keys';\nimport {NgDocPlaygroundProperty} from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n\treturn objectKeys(obj).includes('type');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACvC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AACjG,KAAA;IACD,OAAO,CAAC,CAAC,KAAK,CAAC;AAChB;;ACPA;;;;;AAKG;SACa,eAAe,CAC9B,aAA+B,EAC/B,SAAkB,EAClB,MAAe,EAAA;IAEf,MAAM,YAAY,GAAG,aAAa,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAE9D,IAAA,IAAI,MAAM,EAAE;AACX,QAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC/C,YAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACnC,SAAC,CAAC,CAAC;AACH,KAAA;AAED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EAAE,OAAO;AAChB,gBAAA,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI;gBACnC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC;AACvC,aAAA,CAAC,CAAC;AACH,SAAA;AAED,QAAA,OAAO,GAAG,CAAC;KACX,EAAE,EAAE,CAAC,CAAC;AACR,CAAC;AAED;;;AAGG;AACH,SAAS,gBAAgB,CAAC,OAA2B,EAAA;AACpD,IAAA,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E;;AC1CA;;AAEG;SACa,aAAa,GAAA;IAC5B,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC;AAClE;;ACLA;;;AAGG;AACG,SAAU,cAAc,CAAC,GAAW,EAAA;IACzC,MAAM,aAAa,GAAsB,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAErE,IAAA,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IAEzB,OAAO,aAAa,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACpD;;ACPA;;;AAGG;AACG,SAAU,oBAAoB,CAAC,GAAwB,EAAA;IAC5D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzC;;ACTA;;AAEG;;;;"}
|
|
@@ -12,14 +12,17 @@ class NgDocPageProcessorDirective {
|
|
|
12
12
|
this.elementRef = elementRef;
|
|
13
13
|
this.viewContainerRef = viewContainerRef;
|
|
14
14
|
this.processors = inject(NG_DOC_PAGE_PROCESSOR, { optional: true }) ?? [];
|
|
15
|
-
this.customProcessors = inject(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??
|
|
15
|
+
this.customProcessors = inject(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??
|
|
16
|
+
[];
|
|
16
17
|
this.injector = inject(Injector);
|
|
17
18
|
}
|
|
18
19
|
ngOnInit() {
|
|
19
20
|
asArray(this.processors, this.customProcessors).forEach(this.process.bind(this));
|
|
20
21
|
}
|
|
21
22
|
process(processor) {
|
|
22
|
-
this.elementRef.nativeElement
|
|
23
|
+
this.elementRef.nativeElement
|
|
24
|
+
.querySelectorAll(processor.selector)
|
|
25
|
+
.forEach((elementNode) => {
|
|
23
26
|
// check if element node has a parent node because it can be removed by another processor
|
|
24
27
|
if (elementNode.parentNode) {
|
|
25
28
|
const replaceElement = (processor.nodeToReplace && processor.nodeToReplace(elementNode)) ?? elementNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-processors-page-processor.mjs","sources":["../../../../libs/app/processors/page-processor/page-processor.directive.ts","../../../../libs/app/processors/page-processor/ng-doc-app-processors-page-processor.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ng-doc-app-processors-page-processor.mjs","sources":["../../../../libs/app/processors/page-processor/page-processor.directive.ts","../../../../libs/app/processors/page-processor/ng-doc-app-processors-page-processor.ts"],"sourcesContent":["import {\n\tComponentRef,\n\tDirective,\n\tElementRef,\n\tinject,\n\tInjector,\n\tOnInit,\n\tViewContainerRef,\n} from '@angular/core';\nimport { NgDocPageProcessor, NgDocProcessorOptions } from '@ng-doc/app/interfaces';\nimport { NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR } from '@ng-doc/app/tokens';\nimport { asArray, objectKeys } from '@ng-doc/core';\n\n/**\n * Base processor class to create a processor directive that will be used to replace\n * html nodes with an Angular component.\n */\n@Directive({\n\tselector: '[ngDocPageProcessor]',\n\tstandalone: true,\n})\nexport class NgDocPageProcessorDirective implements OnInit {\n\tprocessors: Array<NgDocPageProcessor<unknown>> =\n\t\tinject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_PROCESSOR, { optional: true }) ?? [];\n\tcustomProcessors: Array<NgDocPageProcessor<unknown>> =\n\t\tinject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??\n\t\t[];\n\tinjector: Injector = inject(Injector);\n\n\tconstructor(\n\t\tprotected readonly elementRef: ElementRef<HTMLElement>,\n\t\tprotected readonly viewContainerRef: ViewContainerRef,\n\t) {}\n\n\tngOnInit(): void {\n\t\tasArray(this.processors, this.customProcessors).forEach(this.process.bind(this));\n\t}\n\n\tprivate process<T>(processor: NgDocPageProcessor<T>): void {\n\t\tthis.elementRef.nativeElement\n\t\t\t.querySelectorAll(processor.selector)\n\t\t\t.forEach((elementNode: Element) => {\n\t\t\t\t// check if element node has a parent node because it can be removed by another processor\n\t\t\t\tif (elementNode.parentNode) {\n\t\t\t\t\tconst replaceElement: Element =\n\t\t\t\t\t\t(processor.nodeToReplace && processor.nodeToReplace(elementNode)) ?? elementNode;\n\t\t\t\t\tconst options: NgDocProcessorOptions<T> = processor.extractOptions(\n\t\t\t\t\t\telementNode,\n\t\t\t\t\t\tthis.elementRef.nativeElement,\n\t\t\t\t\t);\n\n\t\t\t\t\t// create component\n\t\t\t\t\tconst componentRef: ComponentRef<T> = this.viewContainerRef.createComponent(\n\t\t\t\t\t\tprocessor.component,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprojectableNodes: options.content,\n\t\t\t\t\t\t\tinjector: this.injector,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\t// set component options\n\t\t\t\t\tif (options.inputs) {\n\t\t\t\t\t\tobjectKeys(options.inputs).forEach(\n\t\t\t\t\t\t\t(key: keyof T) =>\n\t\t\t\t\t\t\t\toptions.inputs && componentRef.setInput(key as string, options.inputs[key]),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// replace element node with component node\n\t\t\t\t\treplaceElement.parentNode?.replaceChild(\n\t\t\t\t\t\tcomponentRef.location.nativeElement,\n\t\t\t\t\t\treplaceElement,\n\t\t\t\t\t);\n\n\t\t\t\t\tcomponentRef.changeDetectorRef.markForCheck();\n\t\t\t\t}\n\t\t\t});\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAaA;;;AAGG;AACH,MAIa,2BAA2B,CAAA;IAQvC,WACoB,CAAA,UAAmC,EACnC,gBAAkC,EAAA;QADlC,IAAU,CAAA,UAAA,GAAV,UAAU,CAAyB;QACnC,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;AATtD,QAAA,IAAA,CAAA,UAAU,GACT,MAAM,CAAqC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7F,IAAgB,CAAA,gBAAA,GACf,MAAM,CAAqC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5F,YAAA,EAAE,CAAC;AACJ,QAAA,IAAA,CAAA,QAAQ,GAAa,MAAM,CAAC,QAAQ,CAAC,CAAC;KAKlC;IAEJ,QAAQ,GAAA;QACP,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACjF;AAEO,IAAA,OAAO,CAAI,SAAgC,EAAA;QAClD,IAAI,CAAC,UAAU,CAAC,aAAa;AAC3B,aAAA,gBAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC;AACpC,aAAA,OAAO,CAAC,CAAC,WAAoB,KAAI;;YAEjC,IAAI,WAAW,CAAC,UAAU,EAAE;AAC3B,gBAAA,MAAM,cAAc,GACnB,CAAC,SAAS,CAAC,aAAa,IAAI,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,WAAW,CAAC;AAClF,gBAAA,MAAM,OAAO,GAA6B,SAAS,CAAC,cAA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
|
|
@@ -141,8 +141,7 @@ class NgDocTooltipWrapperComponent {
|
|
|
141
141
|
[ngDocTooltip]="content ?? ''"
|
|
142
142
|
[displayOrigin]="tooltipElement ?? contentProjection"
|
|
143
143
|
[pointerOrigin]="tooltipElement ?? contentProjection"
|
|
144
|
-
#contentProjection
|
|
145
|
-
>
|
|
144
|
+
#contentProjection>
|
|
146
145
|
<ng-content></ng-content>
|
|
147
146
|
</div>
|
|
148
147
|
`, isInline: true, styles: [".content-projection{display:unset}\n"], dependencies: [{ kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -155,8 +154,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
|
|
|
155
154
|
[ngDocTooltip]="content ?? ''"
|
|
156
155
|
[displayOrigin]="tooltipElement ?? contentProjection"
|
|
157
156
|
[pointerOrigin]="tooltipElement ?? contentProjection"
|
|
158
|
-
#contentProjection
|
|
159
|
-
>
|
|
157
|
+
#contentProjection>
|
|
160
158
|
<ng-content></ng-content>
|
|
161
159
|
</div>
|
|
162
160
|
`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgDocTooltipDirective], styles: [".content-projection{display:unset}\n"] }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-processors-processors.mjs","sources":["../../../../libs/app/processors/processors/blockquote.processor.ts","../../../../libs/app/processors/processors/code.processor.ts","../../../../libs/app/processors/processors/demo.processor.ts","../../../../libs/app/processors/processors/demo-pane.processor.ts","../../../../libs/app/processors/processors/icon.processor.ts","../../../../libs/app/processors/processors/link.processor.ts","../../../../libs/app/processors/processors/playground.processor.ts","../../../../libs/app/processors/processors/tabs.processor.ts","../../../../libs/app/processors/processors/tooltip.processor.ts","../../../../libs/app/processors/processors/ng-doc-app-processors-processors.ts"],"sourcesContent":["import {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {NgDocBlockquoteComponent, NgDocBlockquoteType} from '@ng-doc/ui-kit';\n\nexport const blockquoteProcessor: NgDocPageProcessor<NgDocBlockquoteComponent> = {\n\tcomponent: NgDocBlockquoteComponent,\n\tselector: 'ng-doc-blockquote',\n\textractOptions: (element: Element) => ({\n\t\tcontent: [Array.from(element.childNodes)],\n\t\tinputs: {\n\t\t\ttype: (element.getAttribute('type') as NgDocBlockquoteType) || 'default',\n\t\t},\n\t}),\n}\n","import {NgDocCodeComponent} from '@ng-doc/app/components/code';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const codeProcessor: NgDocPageProcessor<NgDocCodeComponent> = {\n\tcomponent: NgDocCodeComponent,\n\tselector: 'pre code',\n\tnodeToReplace: (element: Element) => element.closest('pre') ?? element,\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcopyButton: element.getAttribute('copyButton') !== 'false',\n\t\t\tname: element.getAttribute('name') || undefined,\n\t\t\ticon: element.getAttribute('icon') || undefined,\n\t\t\tlineNumbers: element.getAttribute('lineNumbers') !== 'false',\n\t\t},\n\t\tcontent: [[element.closest('pre') ?? element]],\n\t}),\n};\n","import {NgDocDemoComponent} from '@ng-doc/app/components/demo';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const demoProcessor: NgDocPageProcessor<NgDocDemoComponent> = {\n\tcomponent: NgDocDemoComponent,\n\tselector: 'ng-doc-demo',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcomponentName: element.getAttribute('componentName') || undefined,\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocDemoPaneComponent} from '@ng-doc/app/components/demo-pane';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const demoPaneProcessor: NgDocPageProcessor<NgDocDemoPaneComponent> = {\n\tcomponent: NgDocDemoPaneComponent,\n\tselector: 'ng-doc-demo-pane',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcomponentName: element.getAttribute('componentName') || undefined,\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {NgDocIconComponent, NgDocIconSize} from '@ng-doc/ui-kit';\n\nexport const iconProcessor: NgDocPageProcessor<NgDocIconComponent> = {\n\tcomponent: NgDocIconComponent,\n\tselector: 'ng-doc-icon',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\ticon: element.getAttribute('icon') ?? '',\n\t\t\tsize: (Number(element.getAttribute('size')) as NgDocIconSize) ?? 16,\n\t\t},\n\t}),\n};\n","import {NgDocPageLinkComponent} from '@ng-doc/app/components/page-link';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const linkProcessor: NgDocPageProcessor<NgDocPageLinkComponent> = {\n\tcomponent: NgDocPageLinkComponent,\n\tselector: 'a',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\thref: element.getAttribute('href') ?? '',\n\t\t\tclasses: element.getAttribute('class') ?? '',\n\t\t},\n\t\tcontent: [Array.from(element.childNodes)],\n\t}),\n};\n","import {NgDocPlaygroundComponent} from '@ng-doc/app/components/playground';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {isPresent} from '@ng-doc/core';\n\nexport const playgroundProcessor: NgDocPageProcessor<NgDocPlaygroundComponent> = {\n\tcomponent: NgDocPlaygroundComponent,\n\tselector: 'ng-doc-playground',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tid: element.getAttribute('id') || undefined,\n\t\t\tproperties: JSON.parse(element.querySelector('#data')?.textContent?.replace(/\\n/g, '\\\\n') ?? '') || undefined,\n\t\t\tpipeName: element.querySelector('#pipeName')?.textContent || undefined,\n\t\t\tselectors: (element.querySelector('#selectors')?.textContent || '')\n\t\t\t\t.split(',')\n\t\t\t\t.map((selector: string) => selector.trim())\n\t\t\t\t.filter(isPresent),\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocTabsComponent} from '@ng-doc/app/components/tabs';\nimport {NgDocPageProcessor, NgDocTab} from '@ng-doc/app/interfaces';\n\nexport const tabsProcessor: NgDocPageProcessor<NgDocTabsComponent> = {\n\tcomponent: NgDocTabsComponent,\n\tselector: 'ng-doc-tab',\n\tnodeToReplace: (element: Element) => {\n\t\tconst anchor: Element = document.createElement('div');\n\n\t\treturn element.parentNode?.insertBefore(anchor, element) ?? element;\n\t},\n\textractOptions: (element: Element, root: Element) => {\n\t\tconst group: string | null = element.getAttribute('group') ?? '';\n\t\tconst tabs: Element[] = Array.from(root.querySelectorAll(`ng-doc-tab[group=\"${group}\"]`));\n\t\tconst mappedTabs: NgDocTab[] = tabs.map((tab: Element) => ({\n\t\t\ttitle: tab.getAttribute('name') ?? '',\n\t\t\tcontent: tab,\n\t\t\ticon: tab.getAttribute('icon') || undefined,\n\t\t\tactive: tab.hasAttribute('active'),\n\t\t}));\n\n\t\ttabs.forEach((tab: Element) => tab.remove());\n\n\t\treturn {\n\t\t\tinputs: {\n\t\t\t\ttabs: mappedTabs,\n\t\t\t},\n\t\t};\n\t},\n};\n","import {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInput,\n\tViewChild,\n} from '@angular/core';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {NgDocTooltipDirective} from '@ng-doc/ui-kit';\n\n@Component({\n\tselector: 'ng-doc-tooltip-wrapper',\n\ttemplate: `\n\t\t<div\n\t\t\tclass=\"content-projection\"\n\t\t\t[ngDocTooltip]=\"content ?? ''\"\n\t\t\t[displayOrigin]=\"tooltipElement ?? contentProjection\"\n\t\t\t[pointerOrigin]=\"tooltipElement ?? contentProjection\"\n\t\t\t#contentProjection\n\t\t>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t`,\n\tstyles: [\n\t\t`\n\t\t\t.content-projection {\n\t\t\t\tdisplay: unset;\n\t\t\t}\n\t\t`,\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [NgDocTooltipDirective],\n})\nclass NgDocTooltipWrapperComponent implements AfterViewInit {\n\t@Input()\n\tcontent?: string;\n\n\tprotected tooltipElement: HTMLElement | null = null;\n\n\t@ViewChild('contentProjection', {read: ElementRef, static: true})\n\tprivate contentProjection?: ElementRef<HTMLElement>;\n\n\tconstructor(private readonly changeDetectorRef: ChangeDetectorRef) {}\n\n\tngAfterViewInit(): void {\n\t\tif (this.contentProjection) {\n\t\t\tconst element: Element | null = this.contentProjection.nativeElement.querySelector('[ngDocTooltip]');\n\n\t\t\tthis.tooltipElement = element instanceof HTMLElement ? element : null;\n\n\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t}\n\t}\n}\n\nexport const tooltipProcessor: NgDocPageProcessor<NgDocTooltipWrapperComponent> = {\n\tcomponent: NgDocTooltipWrapperComponent,\n\tselector: '[ngDocTooltip]',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcontent: element.getAttribute('ngDocTooltip') ?? '',\n\t\t},\n\t\tcontent: [[element.cloneNode(true)]],\n\t}),\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAGa,MAAA,mBAAmB,GAAiD;AAChF,IAAA,SAAS,EAAE,wBAAwB;AACnC,IAAA,QAAQ,EAAE,mBAAmB;AAC7B,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;QACtC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO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C,mBAAmB,EAAE,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAC,CAAA;;AAgBpD,MAAA,gBAAgB,GAAqD;AACjF,IAAA,SAAS,EAAE,4BAA4B;AACvC,IAAA,QAAQ,EAAE,gBAAgB;AAC1B,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;AACtC,QAAA,MAAM,EAAE;YACP,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE;AACnD,SAAA;QACD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;KACpC,CAAC;;;AClEH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-processors-processors.mjs","sources":["../../../../libs/app/processors/processors/blockquote.processor.ts","../../../../libs/app/processors/processors/code.processor.ts","../../../../libs/app/processors/processors/demo.processor.ts","../../../../libs/app/processors/processors/demo-pane.processor.ts","../../../../libs/app/processors/processors/icon.processor.ts","../../../../libs/app/processors/processors/link.processor.ts","../../../../libs/app/processors/processors/playground.processor.ts","../../../../libs/app/processors/processors/tabs.processor.ts","../../../../libs/app/processors/processors/tooltip.processor.ts","../../../../libs/app/processors/processors/ng-doc-app-processors-processors.ts"],"sourcesContent":["import { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { NgDocBlockquoteComponent, NgDocBlockquoteType } from '@ng-doc/ui-kit';\n\nexport const blockquoteProcessor: NgDocPageProcessor<NgDocBlockquoteComponent> = {\n\tcomponent: NgDocBlockquoteComponent,\n\tselector: 'ng-doc-blockquote',\n\textractOptions: (element: Element) => ({\n\t\tcontent: [Array.from(element.childNodes)],\n\t\tinputs: {\n\t\t\ttype: (element.getAttribute('type') as NgDocBlockquoteType) || 'default',\n\t\t},\n\t}),\n};\n","import {NgDocCodeComponent} from '@ng-doc/app/components/code';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const codeProcessor: NgDocPageProcessor<NgDocCodeComponent> = {\n\tcomponent: NgDocCodeComponent,\n\tselector: 'pre code',\n\tnodeToReplace: (element: Element) => element.closest('pre') ?? element,\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcopyButton: element.getAttribute('copyButton') !== 'false',\n\t\t\tname: element.getAttribute('name') || undefined,\n\t\t\ticon: element.getAttribute('icon') || undefined,\n\t\t\tlineNumbers: element.getAttribute('lineNumbers') !== 'false',\n\t\t},\n\t\tcontent: [[element.closest('pre') ?? element]],\n\t}),\n};\n","import {NgDocDemoComponent} from '@ng-doc/app/components/demo';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const demoProcessor: NgDocPageProcessor<NgDocDemoComponent> = {\n\tcomponent: NgDocDemoComponent,\n\tselector: 'ng-doc-demo',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcomponentName: element.getAttribute('componentName') || undefined,\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocDemoPaneComponent} from '@ng-doc/app/components/demo-pane';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const demoPaneProcessor: NgDocPageProcessor<NgDocDemoPaneComponent> = {\n\tcomponent: NgDocDemoPaneComponent,\n\tselector: 'ng-doc-demo-pane',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcomponentName: element.getAttribute('componentName') || undefined,\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {NgDocIconComponent, NgDocIconSize} from '@ng-doc/ui-kit';\n\nexport const iconProcessor: NgDocPageProcessor<NgDocIconComponent> = {\n\tcomponent: NgDocIconComponent,\n\tselector: 'ng-doc-icon',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\ticon: element.getAttribute('icon') ?? '',\n\t\t\tsize: (Number(element.getAttribute('size')) as NgDocIconSize) ?? 16,\n\t\t},\n\t}),\n};\n","import {NgDocPageLinkComponent} from '@ng-doc/app/components/page-link';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\n\nexport const linkProcessor: NgDocPageProcessor<NgDocPageLinkComponent> = {\n\tcomponent: NgDocPageLinkComponent,\n\tselector: 'a',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\thref: element.getAttribute('href') ?? '',\n\t\t\tclasses: element.getAttribute('class') ?? '',\n\t\t},\n\t\tcontent: [Array.from(element.childNodes)],\n\t}),\n};\n","import {NgDocPlaygroundComponent} from '@ng-doc/app/components/playground';\nimport {NgDocPageProcessor} from '@ng-doc/app/interfaces';\nimport {isPresent} from '@ng-doc/core';\n\nexport const playgroundProcessor: NgDocPageProcessor<NgDocPlaygroundComponent> = {\n\tcomponent: NgDocPlaygroundComponent,\n\tselector: 'ng-doc-playground',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tid: element.getAttribute('id') || undefined,\n\t\t\tproperties: JSON.parse(element.querySelector('#data')?.textContent?.replace(/\\n/g, '\\\\n') ?? '') || undefined,\n\t\t\tpipeName: element.querySelector('#pipeName')?.textContent || undefined,\n\t\t\tselectors: (element.querySelector('#selectors')?.textContent || '')\n\t\t\t\t.split(',')\n\t\t\t\t.map((selector: string) => selector.trim())\n\t\t\t\t.filter(isPresent),\n\t\t\toptions: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n\t\t},\n\t}),\n};\n","import {NgDocTabsComponent} from '@ng-doc/app/components/tabs';\nimport {NgDocPageProcessor, NgDocTab} from '@ng-doc/app/interfaces';\n\nexport const tabsProcessor: NgDocPageProcessor<NgDocTabsComponent> = {\n\tcomponent: NgDocTabsComponent,\n\tselector: 'ng-doc-tab',\n\tnodeToReplace: (element: Element) => {\n\t\tconst anchor: Element = document.createElement('div');\n\n\t\treturn element.parentNode?.insertBefore(anchor, element) ?? element;\n\t},\n\textractOptions: (element: Element, root: Element) => {\n\t\tconst group: string | null = element.getAttribute('group') ?? '';\n\t\tconst tabs: Element[] = Array.from(root.querySelectorAll(`ng-doc-tab[group=\"${group}\"]`));\n\t\tconst mappedTabs: NgDocTab[] = tabs.map((tab: Element) => ({\n\t\t\ttitle: tab.getAttribute('name') ?? '',\n\t\t\tcontent: tab,\n\t\t\ticon: tab.getAttribute('icon') || undefined,\n\t\t\tactive: tab.hasAttribute('active'),\n\t\t}));\n\n\t\ttabs.forEach((tab: Element) => tab.remove());\n\n\t\treturn {\n\t\t\tinputs: {\n\t\t\t\ttabs: mappedTabs,\n\t\t\t},\n\t\t};\n\t},\n};\n","import {\n\tAfterViewInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInput,\n\tViewChild,\n} from '@angular/core';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { NgDocTooltipDirective } from '@ng-doc/ui-kit';\n\n@Component({\n\tselector: 'ng-doc-tooltip-wrapper',\n\ttemplate: `\n\t\t<div\n\t\t\tclass=\"content-projection\"\n\t\t\t[ngDocTooltip]=\"content ?? ''\"\n\t\t\t[displayOrigin]=\"tooltipElement ?? contentProjection\"\n\t\t\t[pointerOrigin]=\"tooltipElement ?? contentProjection\"\n\t\t\t#contentProjection>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t`,\n\tstyles: [\n\t\t`\n\t\t\t.content-projection {\n\t\t\t\tdisplay: unset;\n\t\t\t}\n\t\t`,\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [NgDocTooltipDirective],\n})\nclass NgDocTooltipWrapperComponent implements AfterViewInit {\n\t@Input()\n\tcontent?: string;\n\n\tprotected tooltipElement: HTMLElement | null = null;\n\n\t@ViewChild('contentProjection', { read: ElementRef, static: true })\n\tprivate contentProjection?: ElementRef<HTMLElement>;\n\n\tconstructor(private readonly changeDetectorRef: ChangeDetectorRef) {}\n\n\tngAfterViewInit(): void {\n\t\tif (this.contentProjection) {\n\t\t\tconst element: Element | null =\n\t\t\t\tthis.contentProjection.nativeElement.querySelector('[ngDocTooltip]');\n\n\t\t\tthis.tooltipElement = element instanceof HTMLElement ? element : null;\n\n\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t}\n\t}\n}\n\nexport const tooltipProcessor: NgDocPageProcessor<NgDocTooltipWrapperComponent> = {\n\tcomponent: NgDocTooltipWrapperComponent,\n\tselector: '[ngDocTooltip]',\n\textractOptions: (element: Element) => ({\n\t\tinputs: {\n\t\t\tcontent: element.getAttribute('ngDocTooltip') ?? '',\n\t\t},\n\t\tcontent: [[element.cloneNode(true)]],\n\t}),\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAGa,MAAA,mBAAmB,GAAiD;AAChF,IAAA,SAAS,EAAE,wBAAwB;AACnC,IAAA,QAAQ,EAAE,mBAAmB;AAC7B,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;QACtC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACzC,QAAA,MAAM,EAAE;YACP,IAAI,EAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAyB,IAAI,SAAS;AACxE,SAAA;KACD,CAAC;;;ACRU,MAAA,aAAa,GAA2C;AACpE,IAAA,SAAS,EAAE,kBAAkB;AAC7B,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,aAAa,EAAE,CAAC,OAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO;AACtE,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;AACtC,QAAA,MAAM,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,OAAO;YAC1D,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS;YAC/C,IAAI,EAAE,OAAO,CAAC,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or } from '@ng-doc/app/processors/processors';
|
|
2
|
-
export * from '@ng-doc/app/processors/processors';
|
|
3
|
-
import { providePageProcessor } from '@ng-doc/app/tokens';
|
|
4
1
|
export * from '@ng-doc/app/processors/page-processor';
|
|
5
|
-
|
|
6
|
-
const NG_DOC_DEFAULT_PAGE_PROCESSORS = [
|
|
7
|
-
/**
|
|
8
|
-
* The order of the directives is important.
|
|
9
|
-
* The higher the directive is in the list, the earlier it will be run.
|
|
10
|
-
*/
|
|
11
|
-
providePageProcessor(blockquoteProcessor, true),
|
|
12
|
-
providePageProcessor(iconProcessor, true),
|
|
13
|
-
providePageProcessor(tooltipProcessor, true),
|
|
14
|
-
providePageProcessor(linkProcessor, true),
|
|
15
|
-
providePageProcessor(codeProcessor, true),
|
|
16
|
-
providePageProcessor(demoProcessor, true),
|
|
17
|
-
providePageProcessor(demoPaneProcessor, true),
|
|
18
|
-
providePageProcessor(playgroundProcessor, true),
|
|
19
|
-
providePageProcessor(tabsProcessor, true),
|
|
20
|
-
];
|
|
2
|
+
export * from '@ng-doc/app/processors/processors';
|
|
21
3
|
|
|
22
4
|
/**
|
|
23
5
|
* Generated bundle index. Do not edit.
|
|
24
6
|
*/
|
|
25
|
-
|
|
26
|
-
export { NG_DOC_DEFAULT_PAGE_PROCESSORS };
|
|
27
7
|
//# sourceMappingURL=ng-doc-app-processors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-processors.mjs","sources":["../../../../libs/app/processors/
|
|
1
|
+
{"version":3,"file":"ng-doc-app-processors.mjs","sources":["../../../../libs/app/processors/ng-doc-app-processors.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;AAEG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ViewportScroller } from '@angular/common';
|
|
2
|
+
import { APP_INITIALIZER, Optional } from '@angular/core';
|
|
3
|
+
import { NG_DOC_NIGHT_THEME, NG_DOC_DARK_PURPLE_THEME, NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';
|
|
4
|
+
import { isDarkOsTheme } from '@ng-doc/app/helpers';
|
|
5
|
+
import { NgDocThemeService, NgDocStoreService } from '@ng-doc/app/services';
|
|
6
|
+
import { NG_DOC_THEME, NG_DOC_DEFAULT_THEME_ID } from '@ng-doc/app/tokens';
|
|
7
|
+
import { asArray } from '@ng-doc/core';
|
|
8
|
+
import { provideNgDocUiKitConfig } from '@ng-doc/ui-kit';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Provides the NgDoc application configuration.
|
|
12
|
+
*
|
|
13
|
+
* @param config - The optional application configuration.
|
|
14
|
+
*/
|
|
15
|
+
function provideNgDocApp(config) {
|
|
16
|
+
return [
|
|
17
|
+
/* --- Themes --- */
|
|
18
|
+
{ provide: NG_DOC_THEME, useValue: NG_DOC_NIGHT_THEME, multi: true },
|
|
19
|
+
{ provide: NG_DOC_THEME, useValue: NG_DOC_DARK_PURPLE_THEME, multi: true },
|
|
20
|
+
...asArray(config?.themes).map((theme) => ({
|
|
21
|
+
provide: NG_DOC_THEME,
|
|
22
|
+
useValue: theme,
|
|
23
|
+
multi: true,
|
|
24
|
+
})),
|
|
25
|
+
...asArray(config?.defaultThemeId).map((themeId) => ({
|
|
26
|
+
provide: NG_DOC_DEFAULT_THEME_ID,
|
|
27
|
+
useValue: themeId,
|
|
28
|
+
})),
|
|
29
|
+
/* --- Theme Initializer--- */
|
|
30
|
+
{
|
|
31
|
+
provide: APP_INITIALIZER,
|
|
32
|
+
useFactory: (themeService, store, defaultThemeId) => {
|
|
33
|
+
return () => {
|
|
34
|
+
const themeId = store.get(NG_DOC_STORE_THEME_KEY);
|
|
35
|
+
if (defaultThemeId === 'auto' && !themeId) {
|
|
36
|
+
return themeService.set(isDarkOsTheme() ? NG_DOC_NIGHT_THEME.id : undefined, false);
|
|
37
|
+
}
|
|
38
|
+
return themeService.set(themeId ?? defaultThemeId, false);
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
multi: true,
|
|
42
|
+
deps: [NgDocThemeService, NgDocStoreService, [new Optional(), NG_DOC_DEFAULT_THEME_ID]],
|
|
43
|
+
},
|
|
44
|
+
/* --- Viewport Scroller --- */
|
|
45
|
+
{
|
|
46
|
+
provide: APP_INITIALIZER,
|
|
47
|
+
multi: true,
|
|
48
|
+
deps: [ViewportScroller],
|
|
49
|
+
useFactory: (viewportScroller) => {
|
|
50
|
+
return () => viewportScroller.setOffset([0, 64]);
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
/* --- UiKit --- */
|
|
54
|
+
...provideNgDocUiKitConfig(config?.uiKit),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Generated bundle index. Do not edit.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
export { provideNgDocApp };
|
|
63
|
+
//# sourceMappingURL=ng-doc-app-providers-ng-doc-app.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers-ng-doc-app.mjs","sources":["../../../../libs/app/providers/ng-doc-app/provide-ng-doc-app.ts","../../../../libs/app/providers/ng-doc-app/ng-doc-app-providers-ng-doc-app.ts"],"sourcesContent":["import { ViewportScroller } from '@angular/common';\nimport { APP_INITIALIZER, Optional, Provider } from '@angular/core';\nimport {\n\tNG_DOC_DARK_PURPLE_THEME,\n\tNG_DOC_NIGHT_THEME,\n\tNG_DOC_STORE_THEME_KEY,\n} from '@ng-doc/app/constants';\nimport { isDarkOsTheme } from '@ng-doc/app/helpers';\nimport { NgDocTheme } from '@ng-doc/app/interfaces';\nimport { NgDocStoreService, NgDocThemeService } from '@ng-doc/app/services';\nimport { NG_DOC_DEFAULT_THEME_ID, NG_DOC_THEME } from '@ng-doc/app/tokens';\nimport { asArray } from '@ng-doc/core';\nimport { NgDocUiConfig, provideNgDocUiKitConfig } from '@ng-doc/ui-kit';\n\n/**\n * NgDoc application config.\n */\nexport interface NgDocApplicationConfig {\n\t/**\n\t * List of themes that will be registered in the application and can be used via `NgDocThemeService`.\n\t */\n\tthemes?: NgDocTheme[];\n\n\t/**\n\t * Default theme id.\n\t * You can use `auto` to automatically select the theme based on the user's operating system settings.\n\t */\n\tdefaultThemeId?: string | 'auto';\n\n\t/**\n\t * UI Kit configuration.\n\t */\n\tuiKit?: NgDocUiConfig;\n}\n\n/**\n * Provides the NgDoc application configuration.\n *\n * @param config - The optional application configuration.\n */\nexport function provideNgDocApp(config?: NgDocApplicationConfig): Provider[] {\n\treturn [\n\t\t/* --- Themes --- */\n\t\t{ provide: NG_DOC_THEME, useValue: NG_DOC_NIGHT_THEME, multi: true },\n\t\t{ provide: NG_DOC_THEME, useValue: NG_DOC_DARK_PURPLE_THEME, multi: true },\n\t\t...asArray(config?.themes).map((theme: NgDocTheme) => ({\n\t\t\tprovide: NG_DOC_THEME,\n\t\t\tuseValue: theme,\n\t\t\tmulti: true,\n\t\t})),\n\t\t...asArray(config?.defaultThemeId).map((themeId: string) => ({\n\t\t\tprovide: NG_DOC_DEFAULT_THEME_ID,\n\t\t\tuseValue: themeId,\n\t\t})),\n\n\t\t/* --- Theme Initializer--- */\n\t\t{\n\t\t\tprovide: APP_INITIALIZER,\n\t\t\tuseFactory: (\n\t\t\t\tthemeService: NgDocThemeService,\n\t\t\t\tstore: NgDocStoreService,\n\t\t\t\tdefaultThemeId: string | 'auto',\n\t\t\t) => {\n\t\t\t\treturn () => {\n\t\t\t\t\tconst themeId: string | null = store.get(NG_DOC_STORE_THEME_KEY);\n\n\t\t\t\t\tif (defaultThemeId === 'auto' && !themeId) {\n\t\t\t\t\t\treturn themeService.set(isDarkOsTheme() ? NG_DOC_NIGHT_THEME.id : undefined, false);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn themeService.set(themeId ?? defaultThemeId, false);\n\t\t\t\t};\n\t\t\t},\n\t\t\tmulti: true,\n\t\t\tdeps: [NgDocThemeService, NgDocStoreService, [new Optional(), NG_DOC_DEFAULT_THEME_ID]],\n\t\t},\n\n\t\t/* --- Viewport Scroller --- */\n\t\t{\n\t\t\tprovide: APP_INITIALIZER,\n\t\t\tmulti: true,\n\t\t\tdeps: [ViewportScroller],\n\t\t\tuseFactory: (viewportScroller: ViewportScroller) => {\n\t\t\t\treturn () => viewportScroller.setOffset([0, 64]);\n\t\t\t},\n\t\t},\n\n\t\t/* --- UiKit --- */\n\t\t...provideNgDocUiKitConfig(config?.uiKit),\n\t];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAmCA;;;;AAIG;AACG,SAAU,eAAe,CAAC,MAA+B,EAAA;IAC9D,OAAO;;QAEN,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE;QACpE,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,wBAAwB,EAAE,KAAK,EAAE,IAAI,EAAE;AAC1E,QAAA,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAiB,MAAM;AACtD,YAAA,OAAO,EAAE,YAAY;AACrB,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,KAAK,EAAE,IAAI;AACX,SAAA,CAAC,CAAC;AACH,QAAA,GAAG,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,OAAe,MAAM;AAC5D,YAAA,OAAO,EAAE,uBAAuB;AAChC,YAAA,QAAQ,EAAE,OAAO;AACjB,SAAA,CAAC,CAAC;;AAGH,QAAA;AACC,YAAA,OAAO,EAAE,eAAe;YACxB,UAAU,EAAE,CACX,YAA+B,EAC/B,KAAwB,EACxB,cAA+B,KAC5B;AACH,gBAAA,OAAO,MAAK;oBACX,MAAM,OAAO,GAAkB,KAAK,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEjE,oBAAA,IAAI,cAAc,KAAK,MAAM,IAAI,CAAC,OAAO,EAAE;AAC1C,wBAAA,OAAO,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,kBAAkB,CAAC,EAAE,GAAG,SAAS,EAAE,KAAK,CAAC,CAAC;AACpF,qBAAA;oBAED,OAAO,YAAY,CAAC,GAAG,CAAC,OAAO,IAAI,cAAc,EAAE,KAAK,CAAC,CAAC;AAC3D,iBAAC,CAAC;aACF;AACD,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,IAAI,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,CAAC,IAAI,QAAQ,EAAE,EAAE,uBAAuB,CAAC,CAAC;AACvF,SAAA;;AAGD,QAAA;AACC,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,CAAC,gBAAgB,CAAC;AACxB,YAAA,UAAU,EAAE,CAAC,gBAAkC,KAAI;AAClD,gBAAA,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aACjD;AACD,SAAA;;AAGD,QAAA,GAAG,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC;KACzC,CAAC;AACH;;AC1FA;;AAEG;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NG_DOC_PAGE_SKELETON } from '@ng-doc/app/tokens';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provides the skeleton components for the page.
|
|
5
|
+
*
|
|
6
|
+
* @param skeleton - The skeleton for the page.
|
|
7
|
+
*/
|
|
8
|
+
function providePageSkeleton(skeleton) {
|
|
9
|
+
return [{ provide: NG_DOC_PAGE_SKELETON, useValue: skeleton }];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generated bundle index. Do not edit.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export { providePageSkeleton };
|
|
17
|
+
//# sourceMappingURL=ng-doc-app-providers-page-skeleton.mjs.map
|