@ng-doc/app 17.6.16 → 18.0.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/classes/root-page/root-page.d.ts +4 -7
- package/components/api-list/api-list.component.d.ts +13 -11
- package/components/breadcrumb/breadcrumb.component.d.ts +0 -1
- package/components/code/code.component.d.ts +2 -7
- package/components/copy-button/copy-button.component.d.ts +12 -0
- package/components/copy-button/index.d.ts +1 -0
- package/components/demo-displayer/demo-displayer.component.d.ts +0 -5
- package/components/heading-anchor/heading-anchor.component.d.ts +9 -0
- package/components/heading-anchor/index.d.ts +1 -0
- package/components/image-viewer/image-viewer.component.d.ts +16 -0
- package/components/image-viewer/index.d.ts +1 -0
- package/components/index.d.ts +7 -0
- package/components/kind-icon/kind-icon.component.d.ts +2 -1
- package/components/mermaid-viewer/index.d.ts +1 -0
- package/components/mermaid-viewer/mermaid-viewer.component.d.ts +17 -0
- package/components/navbar/navbar.component.d.ts +3 -16
- package/components/page/page.component.d.ts +6 -14
- package/components/page-header/index.d.ts +1 -0
- package/components/page-header/page-header.component.d.ts +6 -0
- package/components/page-wrapper/index.d.ts +1 -0
- package/components/page-wrapper/page-wrapper.component.d.ts +22 -0
- package/components/playground/base-playground.d.ts +1 -1
- package/components/playground/playground-demo/playground-demo.component.d.ts +5 -6
- package/components/root/root.component.d.ts +4 -13
- package/components/search/search.component.d.ts +11 -17
- package/components/search-dialog/index.d.ts +1 -0
- package/components/search-dialog/search-dialog.component.d.ts +24 -0
- package/components/sidebar/sidebar-category/sidebar-category.component.d.ts +9 -10
- package/components/sidebar/sidebar-item/sidebar-item.component.d.ts +7 -2
- package/components/sidebar/sidebar.component.d.ts +5 -3
- package/components/theme-toggle/theme-toggle.component.d.ts +4 -5
- package/constants/index.d.ts +0 -1
- package/directives/code-highlighter/code-highlighter.directive.d.ts +11 -10
- package/esm2022/classes/default-search-engine/default-search-engine.mjs +10 -4
- package/esm2022/classes/root-page/root-page.mjs +1 -1
- package/esm2022/components/api-list/api-list.component.mjs +46 -64
- package/esm2022/components/breadcrumb/breadcrumb.component.mjs +7 -9
- package/esm2022/components/code/code.component.mjs +16 -19
- package/esm2022/components/copy-button/copy-button.component.mjs +61 -0
- package/esm2022/components/copy-button/index.mjs +2 -0
- package/esm2022/components/copy-button/ng-doc-app-components-copy-button.mjs +5 -0
- package/esm2022/components/demo/demo.component.mjs +5 -5
- package/esm2022/components/demo-displayer/demo-displayer.component.mjs +9 -14
- package/esm2022/components/demo-pane/demo-pane.component.mjs +5 -5
- package/esm2022/components/fullscreen-button/fullscreen-button.component.mjs +3 -3
- package/esm2022/components/heading-anchor/heading-anchor.component.mjs +38 -0
- package/esm2022/components/heading-anchor/index.mjs +2 -0
- package/esm2022/components/heading-anchor/ng-doc-app-components-heading-anchor.mjs +5 -0
- package/esm2022/components/image-viewer/image-viewer.component.mjs +80 -0
- package/esm2022/components/image-viewer/index.mjs +2 -0
- package/esm2022/components/image-viewer/ng-doc-app-components-image-viewer.mjs +5 -0
- package/esm2022/components/index.mjs +8 -1
- package/esm2022/components/kind-icon/kind-icon.component.mjs +11 -5
- package/esm2022/components/link/link.component.mjs +3 -3
- package/esm2022/components/mermaid-viewer/index.mjs +2 -0
- package/esm2022/components/mermaid-viewer/mermaid-viewer.component.mjs +55 -0
- package/esm2022/components/mermaid-viewer/ng-doc-app-components-mermaid-viewer.mjs +5 -0
- package/esm2022/components/navbar/navbar.component.mjs +12 -32
- package/esm2022/components/page/page.component.mjs +20 -72
- package/esm2022/components/page-header/index.mjs +2 -0
- package/esm2022/components/page-header/ng-doc-app-components-page-header.mjs +5 -0
- package/esm2022/components/page-header/page-header.component.mjs +19 -0
- package/esm2022/components/page-link/page-link.component.mjs +5 -5
- package/esm2022/components/page-navigation/page-navigation.component.mjs +5 -5
- package/esm2022/components/page-wrapper/index.mjs +2 -0
- package/esm2022/components/page-wrapper/ng-doc-app-components-page-wrapper.mjs +5 -0
- package/esm2022/components/page-wrapper/page-wrapper.component.mjs +87 -0
- package/esm2022/components/playground/base-playground.mjs +8 -8
- package/esm2022/components/playground/playground-demo/playground-demo.component.mjs +22 -21
- package/esm2022/components/playground/playground-properties/playground-properties.component.mjs +8 -6
- package/esm2022/components/playground/playground-property/playground-property.component.mjs +4 -4
- package/esm2022/components/playground/playground.component.mjs +6 -6
- package/esm2022/components/root/root.component.mjs +20 -37
- package/esm2022/components/search/search.component.mjs +31 -49
- package/esm2022/components/search-dialog/index.mjs +2 -0
- package/esm2022/components/search-dialog/ng-doc-app-components-search-dialog.mjs +5 -0
- package/esm2022/components/search-dialog/search-dialog.component.mjs +74 -0
- package/esm2022/components/search-result/search-result.component.mjs +4 -4
- package/esm2022/components/sidebar/sidebar-category/sidebar-category.component.mjs +22 -27
- package/esm2022/components/sidebar/sidebar-item/sidebar-item.component.mjs +18 -10
- package/esm2022/components/sidebar/sidebar.component.mjs +14 -13
- package/esm2022/components/tabs/tabs.component.mjs +4 -4
- package/esm2022/components/theme-toggle/theme-toggle.component.mjs +18 -53
- package/esm2022/components/toc/toc-element/toc-element.component.mjs +5 -5
- package/esm2022/components/toc/toc.component.mjs +37 -35
- package/esm2022/constants/index.mjs +1 -2
- package/esm2022/defaults/default-processors/default-processors.mjs +7 -4
- package/esm2022/directives/code-highlighter/code-highlighter.directive.mjs +18 -36
- package/esm2022/directives/route-active/route-active.directive.mjs +3 -3
- package/esm2022/helpers/as-boolean.mjs +1 -1
- package/esm2022/helpers/create-component.mjs +1 -1
- package/esm2022/helpers/generate-toc.mjs +5 -5
- package/esm2022/interfaces/navigation.mjs +1 -1
- package/esm2022/interfaces/processor-options.mjs +1 -1
- package/esm2022/interfaces/toc-item.mjs +1 -1
- package/esm2022/interfaces/type-control.mjs +1 -1
- package/esm2022/pipes/decode-uri-component/decode-uri-component.pipe.mjs +4 -4
- package/esm2022/pipes/extract-value/extract-value.pipe.mjs +3 -3
- package/esm2022/pipes/filter-by-text/filter-by-text.pipe.mjs +3 -3
- package/esm2022/pipes/sanitize-html/sanitize-html.pipe.mjs +3 -3
- package/esm2022/processors/page-processor/index.mjs +2 -2
- package/esm2022/processors/page-processor/page-processor.component.mjs +74 -0
- package/esm2022/processors/processors/blockquote.processor.mjs +2 -1
- package/esm2022/processors/processors/code.processor.mjs +3 -5
- package/esm2022/processors/processors/demo.processor.mjs +2 -2
- package/esm2022/processors/processors/heading-anchor.processor.mjs +12 -0
- package/esm2022/processors/processors/image.processor.mjs +19 -0
- package/esm2022/processors/processors/index.mjs +6 -3
- package/esm2022/processors/processors/link/index.mjs +2 -0
- package/esm2022/processors/processors/link/link.processor.mjs +13 -0
- package/esm2022/processors/processors/link/ng-doc-app-processors-processors-link.mjs +5 -0
- package/esm2022/processors/processors/mermaid.processor.mjs +11 -0
- package/esm2022/processors/processors/playground.processor.mjs +2 -2
- package/esm2022/processors/processors/tooltip/index.mjs +2 -0
- package/esm2022/processors/processors/tooltip/ng-doc-app-processors-processors-tooltip.mjs +5 -0
- package/esm2022/processors/processors/tooltip/tooltip.processor.mjs +56 -0
- package/esm2022/providers/index.mjs +2 -1
- package/esm2022/providers/mermaid/index.mjs +2 -0
- package/esm2022/providers/mermaid/ng-doc-app-providers-mermaid.mjs +5 -0
- package/esm2022/providers/mermaid/provide-mermaid.mjs +16 -0
- package/esm2022/providers/ng-doc-app/provide-ng-doc-app.mjs +12 -35
- package/esm2022/providers/playground-demo/provide-playground-demo.mjs +1 -1
- package/esm2022/providers/search-engine/provide-search-engine.mjs +2 -2
- package/esm2022/providers/type-control/provide-type-control.mjs +1 -1
- package/esm2022/services/highlighter/highlighter.service.mjs +39 -0
- package/esm2022/services/highlighter/index.mjs +2 -0
- package/esm2022/services/highlighter/ng-doc-app-services-highlighter.mjs +5 -0
- package/esm2022/services/index.mjs +2 -2
- package/esm2022/services/sidebar/sidebar.service.mjs +35 -50
- package/esm2022/services/store/store.service.mjs +3 -3
- package/esm2022/services/theme/theme.service.mjs +28 -127
- package/esm2022/tokens/index.mjs +4 -2
- package/esm2022/tokens/mermaid.mjs +3 -0
- package/esm2022/tokens/page-processor.mjs +2 -2
- package/esm2022/tokens/route-prefix.mjs +3 -0
- package/esm2022/tokens/shiki-theme.mjs +3 -0
- package/esm2022/type-controls/boolean-control/boolean-control.component.mjs +3 -3
- package/esm2022/type-controls/number-control/number-control.component.mjs +5 -5
- package/esm2022/type-controls/string-control/string-control.component.mjs +5 -5
- package/esm2022/type-controls/type-alias-control/type-alias-control.component.mjs +5 -5
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +10 -4
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +47 -64
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +6 -8
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +16 -18
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-copy-button.mjs +68 -0
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +8 -12
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +4 -4
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +4 -4
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +3 -3
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs +45 -0
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-image-viewer.mjs +87 -0
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-kind-icon.mjs +10 -4
- package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +3 -3
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +62 -0
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-navbar.mjs +12 -32
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-header.mjs +26 -0
- package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-page-link.mjs +4 -4
- package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +4 -4
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +94 -0
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-page.mjs +19 -71
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +43 -38
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +18 -35
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-dialog.mjs +81 -0
- package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-search-result.mjs +3 -3
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +30 -48
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +49 -44
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +3 -3
- package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +17 -51
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +40 -38
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +7 -0
- package/fesm2022/ng-doc-app-components.mjs.map +1 -1
- package/fesm2022/ng-doc-app-constants.mjs +1 -37
- package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs +6 -3
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +17 -35
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-route-active.mjs +3 -3
- package/fesm2022/ng-doc-app-helpers.mjs +4 -4
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +3 -3
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs +3 -3
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +3 -3
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +3 -3
- package/fesm2022/ng-doc-app-processors-page-processor.mjs +20 -14
- package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors-link.mjs +20 -0
- package/fesm2022/ng-doc-app-processors-processors-link.mjs.map +1 -0
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +63 -0
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -0
- package/fesm2022/ng-doc-app-processors-processors.mjs +45 -70
- package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-mermaid.mjs +23 -0
- package/fesm2022/ng-doc-app-providers-mermaid.mjs.map +1 -0
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +11 -34
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-playground-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-search-engine.mjs +1 -1
- package/fesm2022/ng-doc-app-providers-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-type-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers.mjs +1 -0
- package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-highlighter.mjs +46 -0
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-sidebar.mjs +35 -50
- package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-store.mjs +3 -3
- package/fesm2022/ng-doc-app-services-theme.mjs +27 -126
- package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services.mjs +1 -1
- package/fesm2022/ng-doc-app-tokens.mjs +8 -4
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +3 -3
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs +4 -4
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs +4 -4
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +4 -4
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/interfaces/navigation.d.ts +7 -1
- package/interfaces/processor-options.d.ts +4 -1
- package/package.json +93 -27
- package/processors/page-processor/index.d.ts +1 -1
- package/processors/page-processor/{page-processor.directive.d.ts → page-processor.component.d.ts} +7 -6
- package/processors/processors/heading-anchor.processor.d.ts +3 -0
- package/processors/processors/image.processor.d.ts +3 -0
- package/processors/processors/index.d.ts +5 -2
- package/processors/processors/link/index.d.ts +1 -0
- package/processors/processors/mermaid.processor.d.ts +3 -0
- package/processors/processors/tooltip/index.d.ts +1 -0
- package/providers/index.d.ts +1 -0
- package/providers/mermaid/index.d.ts +1 -0
- package/providers/mermaid/provide-mermaid.d.ts +7 -0
- package/providers/ng-doc-app/provide-ng-doc-app.d.ts +5 -10
- package/providers/playground-demo/provide-playground-demo.d.ts +1 -1
- package/providers/search-engine/provide-search-engine.d.ts +1 -1
- package/providers/type-control/provide-type-control.d.ts +1 -1
- package/services/highlighter/highlighter.service.d.ts +24 -0
- package/services/highlighter/index.d.ts +1 -0
- package/services/index.d.ts +1 -1
- package/services/sidebar/sidebar.service.d.ts +4 -10
- package/services/theme/theme.service.d.ts +9 -37
- package/styles/global.css +161 -132
- package/styles/main.css +150 -106
- package/styles/themes/dark.css +71 -0
- package/tokens/index.d.ts +3 -1
- package/tokens/mermaid.d.ts +3 -0
- package/tokens/page-processor.d.ts +1 -1
- package/tokens/route-prefix.d.ts +2 -0
- package/tokens/shiki-theme.d.ts +6 -0
- package/assets/themes/ng-doc-night.css +0 -111
- package/constants/themes.d.ts +0 -33
- package/esm2022/constants/themes.mjs +0 -36
- package/esm2022/processors/page-processor/page-processor.directive.mjs +0 -68
- package/esm2022/processors/processors/link.processor.mjs +0 -13
- package/esm2022/processors/processors/tooltip.processor.mjs +0 -56
- package/esm2022/tokens/api-list.mjs +0 -3
- package/tokens/api-list.d.ts +0 -3
- /package/processors/processors/{link.processor.d.ts → link/link.processor.d.ts} +0 -0
- /package/processors/processors/{tooltip.processor.d.ts → tooltip/tooltip.processor.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport {\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tHostBinding,\n\tInput,\n\tOnInit,\n} from '@angular/core';\nimport { Event, NavigationEnd, Router } from '@angular/router';\nimport { NgDocRouteActiveDirective } from '@ng-doc/app/directives/route-active';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n\tNgDocDotComponent,\n\tNgDocExpanderComponent,\n\tNgDocIconComponent,\n\tNgDocRotatorDirective,\n\tNgDocTextComponent,\n\tNgDocTextLeftDirective,\n} from '@ng-doc/ui-kit';\nimport { NgDocContent } from '@ng-doc/ui-kit/types';\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\nimport { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';\nimport { filter, startWith } from 'rxjs/operators';\n\n@Component({\n\tselector: 'ng-doc-sidebar-category',\n\ttemplateUrl: './sidebar-category.component.html',\n\tstyleUrls: ['./sidebar-category.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [\n\t\tNgDocRouteActiveDirective,\n\t\tNgIf,\n\t\tNgDocDotComponent,\n\t\tNgDocTextComponent,\n\t\tNgDocIconComponent,\n\t\tNgDocTextLeftDirective,\n\t\tNgDocRotatorDirective,\n\t\tNgDocExpanderComponent,\n\t\tPolymorpheusModule,\n\t],\n})\n@UntilDestroy()\nexport class NgDocSidebarCategoryComponent implements OnInit {\n\t@Input()\n\tcategory?: NgDocNavigation;\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-is-root')\n\tisRoot: boolean = false;\n\n\t@Input()\n\tcontent: NgDocContent = '';\n\n\t@Input()\n\t@HostBinding('attr.data-ng-doc-expandable')\n\texpandable: boolean = true;\n\n\t@Input()\n\texpanded: boolean = true;\n\n\tconstructor(\n\t\tprivate readonly router: Router,\n\t\tprivate readonly changeDetectorRef: ChangeDetectorRef,\n\t) {}\n\n\tngOnInit(): void {\n\t\t/**\n\t\t * We need to update this component every time a navigation occurs to expand the category if its child node is currently rendered\n\t\t */\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event: Event) => event instanceof NavigationEnd),\n\t\t\t\tstartWith(null),\n\t\t\t\tfilter(() => this.router.url.includes(this.category?.route ?? '', 0)),\n\t\t\t\tuntilDestroyed(this),\n\t\t\t)\n\t\t\t.subscribe(() => this.expand());\n\t}\n\n\ttoggle(): void {\n\t\tthis.expanded ? this.collapse() : this.expand();\n\t}\n\n\texpand(): void {\n\t\tif (this.category?.expandable) {\n\t\t\tthis.expanded = true;\n\t\t\tthis.changeDetectorRef.markForCheck();\n\t\t}\n\t}\n\n\tcollapse(): void {\n\t\tif (this.category?.expandable) {\n\t\t\tthis.expanded = false;\n\t\t\tthis.changeDetectorRef.markForCheck();\n\t\t}\n\t}\n}\n","<div class=\"ng-doc-sidebar-category-wrapper\">\n\t<div class=\"ng-doc-sidebar-category-button\" (click)=\"toggle()\">\n\t\t<div\n\t\t\tclass=\"ng-doc-sidebar-category\"\n\t\t\t[ngDocRouteActive]=\"category?.route ?? ''\"\n\t\t\tactiveClass=\"active\">\n\t\t\t<ng-doc-dot *ngIf=\"!expandable\"></ng-doc-dot>\n\t\t\t<span ng-doc-text [color]=\"expandable ? 'normal' : 'muted'\">\n\t\t\t\t<ng-doc-icon\n\t\t\t\t\ticon=\"chevron-right\"\n\t\t\t\t\t*ngIf=\"category?.expandable\"\n\t\t\t\t\t[ngDocRotator]=\"expanded\"\n\t\t\t\t\tngDocTextLeft>\n\t\t\t\t</ng-doc-icon>\n\t\t\t\t{{ category?.title }}\n\t\t\t</span>\n\t\t</div>\n\t\t<!--\t\t<div ng-doc-text color=\"muted\" size=\"small\">Some description</div>-->\n\t</div>\n\t<ng-doc-expander [expanded]=\"expanded\" [content]=\"contentTemplate\">\n\t\t<ng-template #contentTemplate>\n\t\t\t<div class=\"ng-doc-sidebar-category-children\">\n\t\t\t\t<!--We wrap content via ng-template to save state of the child components -->\n\t\t\t\t<ng-content></ng-content>\n\t\t\t\t<ng-container *polymorpheusOutlet=\"content\"></ng-container>\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-doc-expander>\n</div>\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NgDocDotComponent, NgDocTextComponent } from '@ng-doc/ui-kit';\n\n@Component({\n\tselector: 'ng-doc-sidebar-item',\n\ttemplateUrl: './sidebar-item.component.html',\n\tstyleUrls: ['./sidebar-item.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [RouterLinkActive, RouterLink, NgDocDotComponent, NgDocTextComponent],\n})\nexport class NgDocSidebarItemComponent {\n\t@Input()\n\titem?: NgDocNavigation;\n}\n","<a class=\"ng-doc-sidebar-link\" [routerLink]=\"[item?.route ?? '']\" routerLinkActive=\"active\">\n\t<ng-doc-dot></ng-doc-dot>\n\t<span ng-doc-text [absoluteContent]=\"true\">\n\t\t{{ item?.title }}\n\t</span>\n</a>\n","import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Inject } from '@angular/core';\nimport { NgDocContext, NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n\tselector: 'ng-doc-sidebar',\n\ttemplateUrl: './sidebar.component.html',\n\tstyleUrls: ['./sidebar.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n\timports: [\n\t\tNgFor,\n\t\tNgTemplateOutlet,\n\t\tNgIf,\n\t\tNgDocSidebarCategoryComponent,\n\t\tNgDocSidebarItemComponent,\n\t\tNgDocExecutePipe,\n\t\tNgDocBindPipe,\n\t],\n\thost: { ngSkipHydration: 'true' },\n})\nexport class NgDocSidebarComponent {\n\tconstructor(\n\t\t@Inject(NG_DOC_CONTEXT)\n\t\treadonly context: NgDocContext,\n\t) {}\n\n\tgetNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n\t\treturn nav ? nav.children ?? [] : this.context.navigation;\n\t}\n}\n","<div class=\"ng-doc-side-bar-wrapper\">\n\t<ng-container *ngFor=\"let item of getNavigation | bind: this | execute\">\n\t\t<ng-container\n\t\t\t*ngTemplateOutlet=\"sidebarTemplate; context: { item: this.item, root: true }\"></ng-container>\n\t</ng-container>\n\n\t<ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n\t\t<ng-container *ngIf=\"item.children?.length; else itemTemplate\">\n\t\t\t<ng-doc-sidebar-category\n\t\t\t\t*ngIf=\"!item.hidden\"\n\t\t\t\t[category]=\"item\"\n\t\t\t\t[expandable]=\"!!item?.expandable\"\n\t\t\t\t[expanded]=\"!!item?.expanded || !item?.expandable\"\n\t\t\t\t[isRoot]=\"!!root\"\n\t\t\t\t[content]=\"categoryContent\">\n\t\t\t\t<ng-template #categoryContent>\n\t\t\t\t\t<ng-container *ngFor=\"let child of getNavigation | bind: this | execute: item\">\n\t\t\t\t\t\t<ng-container\n\t\t\t\t\t\t\t*ngTemplateOutlet=\"\n\t\t\t\t\t\t\t\tsidebarTemplate;\n\t\t\t\t\t\t\t\tcontext: { item: child, root: false }\n\t\t\t\t\t\t\t\"></ng-container>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</ng-template>\n\t\t\t</ng-doc-sidebar-category>\n\t\t</ng-container>\n\n\t\t<ng-template #itemTemplate>\n\t\t\t<ng-doc-sidebar-item [item]=\"item\" *ngIf=\"!item.hidden\"></ng-doc-sidebar-item>\n\t\t</ng-template>\n\t</ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA4CO,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B,CAAA;IAkBzC,WACkB,CAAA,MAAc,EACd,iBAAoC,EAAA;QADpC,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAmB;QAdtD,IAAM,CAAA,MAAA,GAAY,KAAK,CAAC;QAGxB,IAAO,CAAA,OAAA,GAAiB,EAAE,CAAC;QAI3B,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAG3B,IAAQ,CAAA,QAAA,GAAY,IAAI,CAAC;KAKrB;IAEJ,QAAQ,GAAA;AACP;;AAEG;QACH,IAAI,CAAC,MAAM,CAAC,MAAM;aAChB,IAAI,CACJ,MAAM,CAAC,CAAC,KAAY,KAAK,KAAK,YAAY,aAAa,CAAC,EACxD,SAAS,CAAC,IAAI,CAAC,EACf,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EACrE,cAAc,CAAC,IAAI,CAAC,CACpB;aACA,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;KACjC;IAED,MAAM,GAAA;AACL,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;KAChD;IAED,MAAM,GAAA;AACL,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE;AAC9B,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;AACrB,YAAA,IAAI,CAAC,iBAAiB,CAAC,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IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACJ,6BAA6B,EAC7B,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,yBAAyB,EACzB,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,gBAAgB,2CAChB,aAAa,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FAIF,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAjBjC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACR,KAAK;wBACL,gBAAgB;wBAChB,IAAI;wBACJ,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACb,qBAAA,EAAA,IAAA,EACK,EAAE,eAAe,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,svCAAA,EAAA,MAAA,EAAA,CAAA,iaAAA,CAAA,EAAA,CAAA;;0BAI/B,MAAM;2BAAC,cAAc,CAAA;;;AE5BxB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-sidebar.mjs","sources":["../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.ts","../../../../libs/app/components/sidebar/sidebar-category/sidebar-category.component.html","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.ts","../../../../libs/app/components/sidebar/sidebar-item/sidebar-item.component.html","../../../../libs/app/components/sidebar/sidebar.component.ts","../../../../libs/app/components/sidebar/sidebar.component.html","../../../../libs/app/components/sidebar/ng-doc-app-components-sidebar.ts"],"sourcesContent":["import { Location, NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n inject,\n Input,\n} from '@angular/core';\nimport { NgDocRouteActiveDirective } from '@ng-doc/app/directives/route-active';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocContent,\n NgDocDotComponent,\n NgDocExpanderComponent,\n NgDocIconComponent,\n NgDocRotatorDirective,\n NgDocTextComponent,\n NgDocTextLeftDirective,\n} from '@ng-doc/ui-kit';\nimport { UntilDestroy } from '@ngneat/until-destroy';\nimport { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';\n\n@Component({\n selector: 'ng-doc-sidebar-category',\n templateUrl: './sidebar-category.component.html',\n styleUrls: ['./sidebar-category.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n NgDocRouteActiveDirective,\n NgIf,\n NgDocDotComponent,\n NgDocTextComponent,\n NgDocIconComponent,\n NgDocTextLeftDirective,\n NgDocRotatorDirective,\n NgDocExpanderComponent,\n PolymorpheusModule,\n NgTemplateOutlet,\n ],\n})\n@UntilDestroy()\nexport class NgDocSidebarCategoryComponent {\n @Input({ required: true })\n category!: NgDocNavigation;\n\n @Input()\n @HostBinding('attr.data-ng-doc-is-root')\n isRoot: boolean = false;\n\n @Input()\n content: NgDocContent = '';\n\n @Input()\n @HostBinding('attr.data-ng-doc-expandable')\n expandable: boolean = true;\n\n @Input()\n expanded: boolean = true;\n\n protected readonly location = inject(Location);\n protected readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n constructor() {\n this.location.onUrlChange(() => {\n if (this.location.path().includes(this.category.route ?? '', 0)) {\n this.expand();\n }\n });\n }\n\n toggle(): void {\n this.expanded ? this.collapse() : this.expand();\n }\n\n expand(): void {\n if (this.category?.expandable) {\n this.expanded = true;\n this.changeDetectorRef.markForCheck();\n }\n }\n\n collapse(): void {\n if (this.category?.expandable) {\n this.expanded = false;\n this.changeDetectorRef.markForCheck();\n }\n }\n}\n","<div class=\"ng-doc-sidebar-category-wrapper\">\n <div class=\"ng-doc-sidebar-category-button\" (click)=\"toggle()\">\n <div class=\"ng-doc-sidebar-category\" [ngDocRouteActive]=\"category.route\" activeClass=\"active\">\n <ng-doc-dot *ngIf=\"!expandable\"></ng-doc-dot>\n <span ng-doc-text>\n <ng-doc-icon\n icon=\"chevron-right\"\n *ngIf=\"category.expandable\"\n [ngDocRotator]=\"expanded\"\n ngDocTextLeft>\n </ng-doc-icon>\n {{ category.title }}\n </span>\n </div>\n <!--\t\t<div ng-doc-text color=\"muted\" size=\"small\">Some description</div>-->\n </div>\n <ng-doc-expander [expanded]=\"expanded\" [content]=\"contentTemplate\" />\n <ng-template #contentTemplate>\n <div class=\"ng-doc-sidebar-category-children\">\n <!--We wrap content via ng-template to save state of the child components -->\n <ng-content></ng-content>\n <ng-container *polymorpheusOutlet=\"content as text\">{{ text }}</ng-container>\n </div>\n </ng-template>\n</div>\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport {\n NgDocColor,\n NgDocDotComponent,\n NgDocTagComponent,\n NgDocTextComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-sidebar-item',\n templateUrl: './sidebar-item.component.html',\n styleUrls: ['./sidebar-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [RouterLinkActive, RouterLink, NgDocDotComponent, NgDocTextComponent, NgDocTagComponent],\n})\nexport class NgDocSidebarItemComponent {\n item = input.required<NgDocNavigation>();\n statuses = computed(() => {\n const statuses = this.item().metadata?.tags['status'] ?? [];\n\n return statuses.map((status) => {\n const [type, text] = status.split(/\\s+(.+)/);\n\n return { type: type.replace(/^:/, '') as NgDocColor, text };\n });\n });\n}\n","<a class=\"ng-doc-sidebar-link\" [routerLink]=\"[item().route]\" routerLinkActive=\"active\">\n <ng-doc-dot></ng-doc-dot>\n <span ng-doc-text [absoluteContent]=\"true\">\n {{ item().title }}\n @for (status of statuses(); track status) {\n <ng-doc-tag size=\"small\" [color]=\"status.type || 'success'\" mod=\"light\">{{\n status.text\n }}</ng-doc-tag>\n }\n </span>\n</a>\n","import { Location, NgFor, NgIf, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocNavigation } from '@ng-doc/app/interfaces';\nimport { NG_DOC_CONTEXT } from '@ng-doc/app/tokens';\nimport { NgDocBindPipe, NgDocExecutePipe } from '@ng-doc/ui-kit';\n\nimport { NgDocSidebarCategoryComponent } from './sidebar-category/sidebar-category.component';\nimport { NgDocSidebarItemComponent } from './sidebar-item/sidebar-item.component';\n\n@Component({\n selector: 'ng-doc-sidebar',\n templateUrl: './sidebar.component.html',\n styleUrls: ['./sidebar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n NgFor,\n NgTemplateOutlet,\n NgIf,\n NgDocSidebarCategoryComponent,\n NgDocSidebarItemComponent,\n NgDocExecutePipe,\n NgDocBindPipe,\n ],\n})\nexport class NgDocSidebarComponent {\n protected readonly location = inject(Location);\n protected readonly context = inject(NG_DOC_CONTEXT);\n\n getNavigation(nav?: NgDocNavigation): NgDocNavigation[] {\n return nav ? nav.children ?? [] : this.context.navigation;\n }\n\n matchRoute(route: string): boolean {\n return this.location.path().includes(route ?? '', 0);\n }\n}\n","<div class=\"ng-doc-side-bar-wrapper\">\n <ng-container *ngFor=\"let item of getNavigation | bind: this | execute\">\n <ng-container\n *ngTemplateOutlet=\"sidebarTemplate; context: { item: this.item, root: true }\"></ng-container>\n </ng-container>\n\n <ng-template let-item=\"item\" let-root=\"root\" #sidebarTemplate>\n <ng-container *ngIf=\"item.children?.length; else itemTemplate\">\n <ng-doc-sidebar-category\n *ngIf=\"!item.hidden\"\n [category]=\"item\"\n [expandable]=\"!!item?.expandable\"\n [expanded]=\"\n !!item?.expanded || !item?.expandable || (matchRoute | bind: this | execute: item.route)\n \"\n [isRoot]=\"!!root\"\n [content]=\"categoryContent\">\n </ng-doc-sidebar-category>\n <ng-template #categoryContent>\n <ng-container *ngFor=\"let child of getNavigation | bind: this | execute: item\">\n <ng-container\n *ngTemplateOutlet=\"\n sidebarTemplate;\n context: { item: child, root: false }\n \"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n\n <ng-template #itemTemplate>\n <ng-doc-sidebar-item [item]=\"item\" *ngIf=\"!item.hidden\"></ng-doc-sidebar-item>\n </ng-template>\n </ng-template>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CO,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B,CAAA;AAqBxC,IAAA,WAAA,GAAA;QAfA,IAAM,CAAA,MAAA,GAAY,KAAK,CAAC;QAGxB,IAAO,CAAA,OAAA,GAAiB,EAAE,CAAC;QAI3B,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAG3B,IAAQ,CAAA,QAAA,GAAY,IAAI,CAAC;AAEN,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC5B,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAG/D,QAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAK;YAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE;gBAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;aACf;A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AA,EAAA,0BAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAChB,IAAI,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACJ,6BAA6B,EAC7B,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,YAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,yBAAyB,EACzB,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,gBAAgB,2CAChB,aAAa,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FAGJ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,mBAGT,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EACP,OAAA,EAAA;wBACP,KAAK;wBACL,gBAAgB;wBAChB,IAAI;wBACJ,6BAA6B;wBAC7B,yBAAyB;wBACzB,gBAAgB;wBAChB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,6yCAAA,EAAA,MAAA,EAAA,CAAA,iaAAA,CAAA,EAAA,CAAA;;;AEvBH;;AAEG;;;;"}
|
|
@@ -15,10 +15,10 @@ class NgDocTabsComponent {
|
|
|
15
15
|
appendElement(element, parent) {
|
|
16
16
|
parent.appendChild(element);
|
|
17
17
|
}
|
|
18
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.
|
|
19
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.
|
|
18
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: NgDocTabsComponent, isStandalone: true, selector: "ng-doc-tabs", inputs: { tabs: "tabs" }, ngImport: i0, template: "<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n\t<ng-doc-tab *ngFor=\"let tab of tabs; let i = index\" [label]=\"label\" [content]=\"content\" [id]=\"i\">\n\t\t<ng-template #label>\n\t\t\t<ng-doc-icon [customIcon]=\"tab.icon\" *ngIf=\"tab.icon\"></ng-doc-icon>\n\t\t\t{{ tab.title }}\n\t\t</ng-template>\n\t\t<ng-template #content>\n\t\t\t<div #element>\n\t\t\t\t{{ appendElement | execute: tab.content:element }}\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-doc-tab>\n</ng-doc-tab-group>\n", styles: [":host{display:block;border-radius:var(--ng-doc-tabs-border-radius);border:var(--ng-doc-tabs-border);margin:var(--ng-doc-tabs-margin);overflow:hidden;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-header-background: var(--ng-doc-base-2)}:host ng-doc-icon{margin-right:calc(var(--ng-doc-base-gutter) / 2)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: "pipe", type: NgDocExecutePipe, name: "execute" }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTabsComponent, decorators: [{
|
|
22
22
|
type: Component,
|
|
23
23
|
args: [{ selector: 'ng-doc-tabs', standalone: true, imports: [
|
|
24
24
|
CommonModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { NgDocTab } from '@ng-doc/app/interfaces';\nimport { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';\nimport {\n\tNgDocBindPipe,\n\tNgDocExecutePipe,\n\tNgDocIconComponent,\n\tNgDocTabComponent,\n\tNgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n\tselector: 'ng-doc-tabs',\n\tstandalone: true,\n\timports: [\n\t\tCommonModule,\n\t\tNgDocTabGroupComponent,\n\t\tNgDocTabComponent,\n\t\tNgDocSanitizeHtmlPipe,\n\t\tNgDocExecutePipe,\n\t\tNgDocBindPipe,\n\t\tNgDocIconComponent,\n\t],\n\ttemplateUrl: './tabs.component.html',\n\tstyleUrls: ['./tabs.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabsComponent {\n\t@Input()\n\ttabs: NgDocTab[] = [];\n\n\tgetActiveIndex(tabs: NgDocTab[]): number {\n\t\treturn Math.max(\n\t\t\ttabs.findIndex((tab: NgDocTab) => tab.active),\n\t\t\t0,\n\t\t);\n\t}\n\n\tappendElement(element: Element, parent: Element): void {\n\t\tparent.appendChild(element);\n\t}\n}\n","<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n\t<ng-doc-tab *ngFor=\"let tab of tabs; let i = index\" [label]=\"label\" [content]=\"content\" [id]=\"i\">\n\t\t<ng-template #label>\n\t\t\t<ng-doc-icon [customIcon]=\"tab.icon\" *ngIf=\"tab.icon\"></ng-doc-icon>\n\t\t\t{{ tab.title }}\n\t\t</ng-template>\n\t\t<ng-template #content>\n\t\t\t<div #element>\n\t\t\t\t{{ appendElement | execute: tab.content:element }}\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-doc-tab>\n</ng-doc-tab-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA4Ba,kBAAkB,CAAA;AAhB/B,IAAA,WAAA,GAAA;QAkBC,IAAI,CAAA,IAAA,GAAe,EAAE,CAAC;AAYtB,KAAA;AAVA,IAAA,cAAc,CAAC,IAAgB,EAAA;QAC9B,OAAO,IAAI,CAAC,GAAG,CACd,IAAI,CAAC,SAAS,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,MAAM,CAAC,EAC7C,CAAC,CACD,CAAC;KACF;IAED,aAAa,CAAC,OAAgB,EAAE,MAAe,EAAA;AAC9C,QAAA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC5B;8GAbW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC5B/B,6fAaA,EAAA,MAAA,EAAA,CAAA,yWAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDGE,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACZ,sBAAsB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACtB,iBAAiB,EAAA,QAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-tabs.mjs","sources":["../../../../libs/app/components/tabs/tabs.component.ts","../../../../libs/app/components/tabs/tabs.component.html","../../../../libs/app/components/tabs/ng-doc-app-components-tabs.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { NgDocTab } from '@ng-doc/app/interfaces';\nimport { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';\nimport {\n\tNgDocBindPipe,\n\tNgDocExecutePipe,\n\tNgDocIconComponent,\n\tNgDocTabComponent,\n\tNgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n@Component({\n\tselector: 'ng-doc-tabs',\n\tstandalone: true,\n\timports: [\n\t\tCommonModule,\n\t\tNgDocTabGroupComponent,\n\t\tNgDocTabComponent,\n\t\tNgDocSanitizeHtmlPipe,\n\t\tNgDocExecutePipe,\n\t\tNgDocBindPipe,\n\t\tNgDocIconComponent,\n\t],\n\ttemplateUrl: './tabs.component.html',\n\tstyleUrls: ['./tabs.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocTabsComponent {\n\t@Input()\n\ttabs: NgDocTab[] = [];\n\n\tgetActiveIndex(tabs: NgDocTab[]): number {\n\t\treturn Math.max(\n\t\t\ttabs.findIndex((tab: NgDocTab) => tab.active),\n\t\t\t0,\n\t\t);\n\t}\n\n\tappendElement(element: Element, parent: Element): void {\n\t\tparent.appendChild(element);\n\t}\n}\n","<ng-doc-tab-group [openedTab]=\"getActiveIndex | execute: tabs\">\n\t<ng-doc-tab *ngFor=\"let tab of tabs; let i = index\" [label]=\"label\" [content]=\"content\" [id]=\"i\">\n\t\t<ng-template #label>\n\t\t\t<ng-doc-icon [customIcon]=\"tab.icon\" *ngIf=\"tab.icon\"></ng-doc-icon>\n\t\t\t{{ tab.title }}\n\t\t</ng-template>\n\t\t<ng-template #content>\n\t\t\t<div #element>\n\t\t\t\t{{ appendElement | execute: tab.content:element }}\n\t\t\t</div>\n\t\t</ng-template>\n\t</ng-doc-tab>\n</ng-doc-tab-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA4Ba,kBAAkB,CAAA;AAhB/B,IAAA,WAAA,GAAA;QAkBC,IAAI,CAAA,IAAA,GAAe,EAAE,CAAC;AAYtB,KAAA;AAVA,IAAA,cAAc,CAAC,IAAgB,EAAA;QAC9B,OAAO,IAAI,CAAC,GAAG,CACd,IAAI,CAAC,SAAS,CAAC,CAAC,GAAa,KAAK,GAAG,CAAC,MAAM,CAAC,EAC7C,CAAC,CACD,CAAC;KACF;IAED,aAAa,CAAC,OAAgB,EAAE,MAAe,EAAA;AAC9C,QAAA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC5B;8GAbW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EA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;;2FAMP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhB9B,SAAS;+BACC,aAAa,EAAA,UAAA,EACX,IAAI,EACP,OAAA,EAAA;wBACR,YAAY;wBACZ,sBAAsB;wBACtB,iBAAiB;wBACjB,qBAAqB;wBACrB,gBAAgB;wBAChB,aAAa;wBACb,kBAAkB;qBAClB,EAGgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6fAAA,EAAA,MAAA,EAAA,CAAA,yWAAA,CAAA,EAAA,CAAA;8BAI/C,IAAI,EAAA,CAAA;sBADH,KAAK;;;AE7BP;;AAEG;;;;"}
|
|
@@ -1,78 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NgIf } from '@angular/common';
|
|
1
|
+
import { DOCUMENT, NgIf } from '@angular/common';
|
|
3
2
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
5
|
-
import {
|
|
6
|
-
import * as i1 from '@ng-doc/app/services';
|
|
3
|
+
import { inject, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
4
|
+
import { NgDocThemeService } from '@ng-doc/app/services/theme';
|
|
7
5
|
import { NgDocButtonIconComponent, NgDocTooltipDirective, NgDocIconComponent, NgDocSmoothResizeComponent } from '@ng-doc/ui-kit';
|
|
8
6
|
|
|
9
7
|
class NgDocThemeToggleComponent {
|
|
10
|
-
constructor(
|
|
11
|
-
this.themeService = themeService;
|
|
8
|
+
constructor() {
|
|
12
9
|
this.themes = [
|
|
13
10
|
{ name: 'Auto', theme: 'auto' },
|
|
14
|
-
{ name: 'Light', theme:
|
|
15
|
-
{ name: 'Dark', theme:
|
|
11
|
+
{ name: 'Light', theme: null },
|
|
12
|
+
{ name: 'Dark', theme: 'dark' },
|
|
16
13
|
];
|
|
14
|
+
this.documentElement = inject(DOCUMENT).documentElement;
|
|
15
|
+
this.themeService = inject(NgDocThemeService);
|
|
17
16
|
}
|
|
18
17
|
get currentTheme() {
|
|
19
|
-
|
|
20
|
-
return this.themes[0];
|
|
21
|
-
}
|
|
22
|
-
const theme = this.themeService.currentTheme;
|
|
18
|
+
const theme = this.documentElement.getAttribute('data-theme');
|
|
23
19
|
return this.themes.find(({ theme: t }) => t === theme) ?? this.themes[0];
|
|
24
20
|
}
|
|
25
21
|
get nextTheme() {
|
|
26
|
-
|
|
27
|
-
return this.themes[1];
|
|
28
|
-
}
|
|
29
|
-
const index = this.themes.findIndex(({ theme }) => theme === this.themeService.currentTheme);
|
|
22
|
+
const index = this.themes.findIndex(({ theme }) => theme === this.currentTheme.theme);
|
|
30
23
|
return this.themes[(index + 1) % this.themes.length];
|
|
31
24
|
}
|
|
32
25
|
toggleTheme() {
|
|
33
26
|
const { theme } = this.nextTheme;
|
|
34
|
-
|
|
35
|
-
this.themeService.enableAutoTheme(undefined, NG_DOC_NIGHT_THEME);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.themeService.set(theme?.id);
|
|
39
|
-
}
|
|
27
|
+
this.themeService.set(theme ?? undefined);
|
|
40
28
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.
|
|
42
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
43
|
-
trigger('switchIcon', [
|
|
44
|
-
transition(':enter', [
|
|
45
|
-
style({ transform: 'translateX({{from}})', position: 'absolute', opacity: 0 }),
|
|
46
|
-
animate('225ms cubic-bezier(0.4,0.0,0.2,1)', style({ transform: 'translateX(0%)', position: 'absolute', opacity: 1 })),
|
|
47
|
-
], { params: { from: '-100%' } }),
|
|
48
|
-
transition(':leave', [
|
|
49
|
-
style({ transform: 'translateX(0%)', position: 'absolute', opacity: 1 }),
|
|
50
|
-
animate('225ms cubic-bezier(0.4,0.0,0.2,1)', style({ transform: 'translateX({{to}})', position: 'absolute', opacity: 0 })),
|
|
51
|
-
], { params: { to: '-100%' } }),
|
|
52
|
-
]),
|
|
53
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.1", type: NgDocThemeToggleComponent, isStandalone: true, selector: "ng-doc-theme-toggle", ngImport: i0, template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent>\n <ng-doc-smooth-resize [trigger]=\"currentTheme.name\">\n \"{{ currentTheme.name }}\" theme\n </ng-doc-smooth-resize>\n </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}:host .letter{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);--ng-doc-font-size: 26px;--ng-doc-font-weight: 600}\n"], dependencies: [{ 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: "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"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "component", type: NgDocSmoothResizeComponent, selector: "ng-doc-smooth-resize", inputs: ["trigger", "animateOpacity"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
54
31
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocThemeToggleComponent, decorators: [{
|
|
56
33
|
type: Component,
|
|
57
|
-
args: [{
|
|
58
|
-
trigger('switchIcon', [
|
|
59
|
-
transition(':enter', [
|
|
60
|
-
style({ transform: 'translateX({{from}})', position: 'absolute', opacity: 0 }),
|
|
61
|
-
animate('225ms cubic-bezier(0.4,0.0,0.2,1)', style({ transform: 'translateX(0%)', position: 'absolute', opacity: 1 })),
|
|
62
|
-
], { params: { from: '-100%' } }),
|
|
63
|
-
transition(':leave', [
|
|
64
|
-
style({ transform: 'translateX(0%)', position: 'absolute', opacity: 1 }),
|
|
65
|
-
animate('225ms cubic-bezier(0.4,0.0,0.2,1)', style({ transform: 'translateX({{to}})', position: 'absolute', opacity: 0 })),
|
|
66
|
-
], { params: { to: '-100%' } }),
|
|
67
|
-
]),
|
|
68
|
-
], selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
34
|
+
args: [{ selector: 'ng-doc-theme-toggle', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
69
35
|
NgDocButtonIconComponent,
|
|
70
36
|
NgDocTooltipDirective,
|
|
71
37
|
NgIf,
|
|
72
38
|
NgDocIconComponent,
|
|
73
39
|
NgDocSmoothResizeComponent,
|
|
74
|
-
], template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n
|
|
75
|
-
}]
|
|
40
|
+
], template: "<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent>\n <ng-doc-smooth-resize [trigger]=\"currentTheme.name\">\n \"{{ currentTheme.name }}\" theme\n </ng-doc-smooth-resize>\n </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n", styles: [":host{display:inline-block;height:40px;width:40px}:host .letter{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);--ng-doc-font-size: 26px;--ng-doc-font-weight: 600}\n"] }]
|
|
41
|
+
}] });
|
|
76
42
|
|
|
77
43
|
/**
|
|
78
44
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-components-theme-toggle.mjs","sources":["../../../../libs/app/components/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ng-doc-app-components-theme-toggle.mjs","sources":["../../../../libs/app/components/theme-toggle/theme-toggle.component.ts","../../../../libs/app/components/theme-toggle/theme-toggle.component.html","../../../../libs/app/components/theme-toggle/ng-doc-app-components-theme-toggle.ts"],"sourcesContent":["import { DOCUMENT, NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport {\n NgDocButtonIconComponent,\n NgDocIconComponent,\n NgDocSmoothResizeComponent,\n NgDocTooltipDirective,\n} from '@ng-doc/ui-kit';\n\ninterface ToggleTheme {\n name: string;\n theme: string | null;\n}\n\n@Component({\n selector: 'ng-doc-theme-toggle',\n templateUrl: './theme-toggle.component.html',\n styleUrls: ['./theme-toggle.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [\n NgDocButtonIconComponent,\n NgDocTooltipDirective,\n NgIf,\n NgDocIconComponent,\n NgDocSmoothResizeComponent,\n ],\n})\nexport class NgDocThemeToggleComponent {\n protected readonly themes: ToggleTheme[] = [\n { name: 'Auto', theme: 'auto' },\n { name: 'Light', theme: null },\n { name: 'Dark', theme: 'dark' },\n ];\n protected readonly documentElement = inject(DOCUMENT).documentElement;\n protected readonly themeService = inject(NgDocThemeService);\n\n get currentTheme(): ToggleTheme {\n const theme = this.documentElement.getAttribute('data-theme');\n\n return this.themes.find(({ theme: t }) => t === theme) ?? this.themes[0];\n }\n\n get nextTheme(): ToggleTheme {\n const index = this.themes.findIndex(({ theme }) => theme === this.currentTheme.theme);\n\n return this.themes[(index + 1) % this.themes.length];\n }\n\n toggleTheme(): void {\n const { theme } = this.nextTheme;\n\n this.themeService.set(theme ?? undefined);\n }\n}\n","<button ng-doc-button-icon size=\"large\" (click)=\"toggleTheme()\" [ngDocTooltip]=\"tooltipContent\">\n <ng-template #tooltipContent>\n <ng-doc-smooth-resize [trigger]=\"currentTheme.name\">\n \"{{ currentTheme.name }}\" theme\n </ng-doc-smooth-resize>\n </ng-template>\n\n @if (currentTheme === themes[0]) {\n <div class=\"letter\">A</div>\n } @else if (currentTheme === themes[1]) {\n <ng-doc-icon icon=\"sun\" size=\"24\"></ng-doc-icon>\n } @else {\n <ng-doc-icon icon=\"moon\" size=\"24\"></ng-doc-icon>\n }\n</button>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MA6Ba,yBAAyB,CAAA;AAdtC,IAAA,WAAA,GAAA;AAeqB,QAAA,IAAA,CAAA,MAAM,GAAkB;AACzC,YAAA,EAAE,IAAI,EA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A,CAAA;;;AE3BH;;AAEG;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { DOCUMENT, NgFor } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, ElementRef, Component, ChangeDetectionStrategy, Input, HostBinding, QueryList, signal, NgZone, ChangeDetectorRef, Renderer2, afterNextRender,
|
|
4
|
+
import { inject, ElementRef, Component, ChangeDetectionStrategy, Input, HostBinding, QueryList, signal, NgZone, ChangeDetectorRef, Renderer2, afterNextRender, ViewChild, ViewChildren } from '@angular/core';
|
|
5
5
|
import { RouterLink, Router, Scroll } from '@angular/router';
|
|
6
6
|
import { isPresent } from '@ng-doc/core/helpers/is-present';
|
|
7
|
-
import { ngDocZoneOptimize
|
|
7
|
+
import { ngDocZoneOptimize } from '@ng-doc/ui-kit';
|
|
8
8
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
|
9
9
|
import { fromEvent, merge } from 'rxjs';
|
|
10
10
|
import { filter, map, startWith, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
|
@@ -18,12 +18,12 @@ class NgDocTocElementComponent {
|
|
|
18
18
|
this.level = 1;
|
|
19
19
|
this.elementRef = inject(ElementRef);
|
|
20
20
|
}
|
|
21
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.
|
|
22
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTocElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.1", type: NgDocTocElementComponent, isStandalone: true, selector: "li[ng-doc-toc-element]", inputs: { path: "path", hash: "hash", selected: "selected", level: "level" }, host: { properties: { "attr.data-ng-doc-selected": "this.selected", "attr.data-ng-doc-level": "this.level" } }, ngImport: i0, template: "<a\n [routerLink]=\"[]\"\n [fragment]=\"hash | decodeUriComponent\"\n [style.padding-left]=\"'calc(var(--ng-doc-toc-indent) * ' + level + ')'\">\n <ng-content></ng-content>\n</a>\n", styles: [":host{display:flex;margin:0;color:var(--ng-doc-text)}:host[data-ng-doc-level=\"1\"] a{padding-left:var(--ng-doc-base-gutter)}:host[data-ng-doc-selected=true]{color:var(--ng-doc-primary)}:host:hover{cursor:pointer;color:var(--ng-doc-primary)}:host a{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);padding:calc(var(--ng-doc-base-gutter) / 2);color:inherit;width:100%;text-decoration:none;word-break:break-word;--ng-doc-font-size: 14px}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: NgDocDecodeUriComponentPipe, name: "decodeUriComponent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTocElementComponent, decorators: [{
|
|
25
25
|
type: Component,
|
|
26
|
-
args: [{ selector: 'li[ng-doc-toc-element]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [RouterLink, NgDocDecodeUriComponentPipe], template: "<a\n
|
|
26
|
+
args: [{ selector: 'li[ng-doc-toc-element]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [RouterLink, NgDocDecodeUriComponentPipe], template: "<a\n [routerLink]=\"[]\"\n [fragment]=\"hash | decodeUriComponent\"\n [style.padding-left]=\"'calc(var(--ng-doc-toc-indent) * ' + level + ')'\">\n <ng-content></ng-content>\n</a>\n", styles: [":host{display:flex;margin:0;color:var(--ng-doc-text)}:host[data-ng-doc-level=\"1\"] a{padding-left:var(--ng-doc-base-gutter)}:host[data-ng-doc-selected=true]{color:var(--ng-doc-primary)}:host:hover{cursor:pointer;color:var(--ng-doc-primary)}:host a{font-family:var(--ng-doc-font-family);font-variant:no-contextual;color:var(--ng-doc-text);line-height:var(--ng-doc-line-height);font-size:var(--ng-doc-font-size);font-weight:var(--ng-doc-font-weight);padding:calc(var(--ng-doc-base-gutter) / 2);color:inherit;width:100%;text-decoration:none;word-break:break-word;--ng-doc-font-size: 14px}\n"] }]
|
|
27
27
|
}], propDecorators: { path: [{
|
|
28
28
|
type: Input
|
|
29
29
|
}], hash: [{
|
|
@@ -50,35 +50,37 @@ let NgDocTocComponent = class NgDocTocComponent {
|
|
|
50
50
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
51
51
|
this.renderer = inject(Renderer2);
|
|
52
52
|
this.router = inject(Router);
|
|
53
|
-
afterNextRender(
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
afterNextRender({
|
|
54
|
+
write: () => {
|
|
55
|
+
const scrollSelection = fromEvent(this.document, 'scroll').pipe(filter(() => !!this.tableOfContent.length), map((event) => event.target.scrollingElement), startWith(this.document.scrollingElement), map((target) => {
|
|
56
|
+
const percentage = (target.scrollTop * 100) / (target.scrollHeight - target.offsetHeight);
|
|
57
|
+
const selectionLine = target.scrollTop + (target.offsetHeight * percentage) / 100;
|
|
58
|
+
if (!this.tableOfContent.length) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return this.tableOfContent.reduce((pTarget, cTarget) => {
|
|
62
|
+
const pTop = pTarget.element.getBoundingClientRect().top + target.scrollTop;
|
|
63
|
+
const cTop = cTarget.element.getBoundingClientRect().top + target.scrollTop;
|
|
64
|
+
return Math.abs(cTop - selectionLine) < Math.abs(pTop - selectionLine)
|
|
65
|
+
? cTarget
|
|
66
|
+
: pTarget;
|
|
67
|
+
});
|
|
68
|
+
}), filter(isPresent));
|
|
69
|
+
const routerSelection = this.router.events.pipe(map((event) => {
|
|
70
|
+
if (event instanceof Scroll) {
|
|
71
|
+
const item = this.tableOfContent.find((item) => item.path.includes(event.routerEvent.url));
|
|
72
|
+
if (item) {
|
|
73
|
+
return item;
|
|
74
|
+
}
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
76
|
+
return null;
|
|
77
|
+
}), filter(isPresent), debounceTime(20));
|
|
78
|
+
const elementsChanges = this.elements.changes.pipe(map(() => this.activeItem()), filter(isPresent));
|
|
79
|
+
merge(merge(scrollSelection, routerSelection).pipe(distinctUntilChanged()), elementsChanges)
|
|
80
|
+
.pipe(debounceTime(0), ngDocZoneOptimize(this.ngZone), untilDestroyed(this))
|
|
81
|
+
.subscribe(this.select.bind(this));
|
|
82
|
+
},
|
|
83
|
+
});
|
|
82
84
|
}
|
|
83
85
|
ngOnInit() {
|
|
84
86
|
this.activeItem.set(this.tableOfContent[0]);
|
|
@@ -99,16 +101,16 @@ let NgDocTocComponent = class NgDocTocComponent {
|
|
|
99
101
|
}
|
|
100
102
|
this.activeItem.set(item);
|
|
101
103
|
}
|
|
102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.
|
|
103
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTocComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
105
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.1", type: NgDocTocComponent, isStandalone: true, selector: "ng-doc-toc", inputs: { tableOfContent: "tableOfContent" }, viewQueries: [{ propertyName: "selection", first: true, predicate: ["selection"], descendants: true, read: ElementRef }, { propertyName: "elements", predicate: NgDocTocElementComponent, descendants: true }], ngImport: i0, template: "<div class=\"ng-doc-toc-wrapper\">\n <div class=\"ng-doc-toc-container\">\n <div class=\"ng-doc-toc-selection\" #selection></div>\n <ul class=\"ng-doc-toc\">\n @for (item of tableOfContent; track item) {\n <li\n ng-doc-toc-element\n [path]=\"item.path\"\n [hash]=\"item.hash\"\n [level]=\"item.level\"\n [selected]=\"item === activeItem()\">\n {{ item.title }}\n </li>\n }\n </ul>\n </div>\n</div>\n", styles: [":host .ng-doc-toc-wrapper{position:relative;width:var(--ng-doc-toc-width)}:host .ng-doc-toc-wrapper .ng-doc-toc-container{position:fixed;top:calc(var(--ng-doc-navbar-height) + var(--ng-doc-toc-top-padding));overflow-y:auto;height:calc(100% - var(--ng-doc-navbar-height) - var(--ng-doc-base-gutter) * 5);width:var(--ng-doc-toc-width)}:host .ng-doc-toc-wrapper .ng-doc-toc-selection{position:absolute;transform:translate(-50%);width:3px;border-radius:calc(var(--ng-doc-base-gutter) / 2);background-color:var(--ng-doc-primary);left:calc(var(--ng-doc-toc-margin) + 1px);transition:var(--ng-doc-transition)}:host .ng-doc-toc-wrapper .ng-doc-toc{list-style:none;margin:0 0 0 var(--ng-doc-toc-margin);border-left:1px solid var(--ng-doc-base-3);padding:0 0 0 var(--ng-doc-base-gutter)}@media (max-width: 1200px){:host .ng-doc-toc-wrapper{display:none}}\n"], dependencies: [{ kind: "component", type: NgDocTocElementComponent, selector: "li[ng-doc-toc-element]", inputs: ["path", "hash", "selected", "level"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
104
106
|
};
|
|
105
107
|
NgDocTocComponent = __decorate([
|
|
106
108
|
UntilDestroy(),
|
|
107
109
|
__metadata("design:paramtypes", [])
|
|
108
110
|
], NgDocTocComponent);
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.
|
|
111
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocTocComponent, decorators: [{
|
|
110
112
|
type: Component,
|
|
111
|
-
args: [{ selector: 'ng-doc-toc', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgFor, NgDocTocElementComponent
|
|
113
|
+
args: [{ selector: 'ng-doc-toc', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgFor, NgDocTocElementComponent], template: "<div class=\"ng-doc-toc-wrapper\">\n <div class=\"ng-doc-toc-container\">\n <div class=\"ng-doc-toc-selection\" #selection></div>\n <ul class=\"ng-doc-toc\">\n @for (item of tableOfContent; track item) {\n <li\n ng-doc-toc-element\n [path]=\"item.path\"\n [hash]=\"item.hash\"\n [level]=\"item.level\"\n [selected]=\"item === activeItem()\">\n {{ item.title }}\n </li>\n }\n </ul>\n </div>\n</div>\n", styles: [":host .ng-doc-toc-wrapper{position:relative;width:var(--ng-doc-toc-width)}:host .ng-doc-toc-wrapper .ng-doc-toc-container{position:fixed;top:calc(var(--ng-doc-navbar-height) + var(--ng-doc-toc-top-padding));overflow-y:auto;height:calc(100% - var(--ng-doc-navbar-height) - var(--ng-doc-base-gutter) * 5);width:var(--ng-doc-toc-width)}:host .ng-doc-toc-wrapper .ng-doc-toc-selection{position:absolute;transform:translate(-50%);width:3px;border-radius:calc(var(--ng-doc-base-gutter) / 2);background-color:var(--ng-doc-primary);left:calc(var(--ng-doc-toc-margin) + 1px);transition:var(--ng-doc-transition)}:host .ng-doc-toc-wrapper .ng-doc-toc{list-style:none;margin:0 0 0 var(--ng-doc-toc-margin);border-left:1px solid var(--ng-doc-base-3);padding:0 0 0 var(--ng-doc-base-gutter)}@media (max-width: 1200px){:host .ng-doc-toc-wrapper{display:none}}\n"] }]
|
|
112
114
|
}], ctorParameters: () => [], propDecorators: { tableOfContent: [{
|
|
113
115
|
type: Input
|
|
114
116
|
}], selection: [{
|
|
@@ -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 {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tHostBinding,\n\tinject,\n\tInput,\n} from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NgDocDecodeUriComponentPipe } from '@ng-doc/app/pipes/decode-uri-component';\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\timports: [RouterLink, NgDocDecodeUriComponentPipe],\n})\nexport class NgDocTocElementComponent {\n\t@Input()\n\tpath: string = '';\n\n\t@Input()\n\thash: 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\treadonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n}\n","<a\n\t[routerLink]=\"[]\"\n\t[fragment]=\"hash | decodeUriComponent\"\n\t[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\tafterNextRender,\n\tAfterRenderPhase,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tinject,\n\tInput,\n\tNgZone,\n\tOnInit,\n\tQueryList,\n\tRenderer2,\n\tsignal,\n\tViewChild,\n\tViewChildren,\n\tWritableSignal,\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 NgDocPageToc, OnInit {\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: WritableSignal<NgDocTocItem | undefined> = signal(undefined);\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\tconstructor() {\n\t\tafterNextRender(\n\t\t\t() => {\n\t\t\t\tconst scrollSelection: Observable<NgDocTocItem> = fromEvent(this.document, 'scroll').pipe(\n\t\t\t\t\tfilter(() => !!this.tableOfContent.length),\n\t\t\t\t\tmap((event: Event) => (event.target as Document).scrollingElement as HTMLElement),\n\t\t\t\t\tstartWith(this.document.scrollingElement as HTMLElement),\n\t\t\t\t\tmap((target: HTMLElement) => {\n\t\t\t\t\t\tconst percentage: number =\n\t\t\t\t\t\t\t(target.scrollTop * 100) / (target.scrollHeight - target.offsetHeight);\n\t\t\t\t\t\tconst selectionLine: number =\n\t\t\t\t\t\t\ttarget.scrollTop + (target.offsetHeight * percentage) / 100;\n\n\t\t\t\t\t\tif (!this.tableOfContent.length) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn this.tableOfContent.reduce((pTarget: NgDocTocItem, cTarget: NgDocTocItem) => {\n\t\t\t\t\t\t\tconst pTop: number = pTarget.element.getBoundingClientRect().top + target.scrollTop;\n\t\t\t\t\t\t\tconst cTop: number = cTarget.element.getBoundingClientRect().top + target.scrollTop;\n\n\t\t\t\t\t\t\treturn Math.abs(cTop - selectionLine) < Math.abs(pTop - selectionLine)\n\t\t\t\t\t\t\t\t? cTarget\n\t\t\t\t\t\t\t\t: pTarget;\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\t\tfilter(isPresent),\n\t\t\t\t);\n\n\t\t\t\tconst routerSelection: Observable<NgDocTocItem> = this.router.events.pipe(\n\t\t\t\t\tmap((event: REvent) => {\n\t\t\t\t\t\tif (event instanceof Scroll) {\n\t\t\t\t\t\t\tconst item: NgDocTocItem | undefined = this.tableOfContent.find(\n\t\t\t\t\t\t\t\t(item: NgDocTocItem) => item.path.includes(event.routerEvent.url),\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (item) {\n\t\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}),\n\t\t\t\t\tfilter(isPresent),\n\t\t\t\t\tdebounceTime(20),\n\t\t\t\t);\n\n\t\t\t\tconst elementsChanges = this.elements.changes.pipe(\n\t\t\t\t\tmap(() => this.activeItem()),\n\t\t\t\t\tfilter(isPresent),\n\t\t\t\t);\n\n\t\t\t\tmerge(merge(scrollSelection, routerSelection).pipe(distinctUntilChanged()), elementsChanges)\n\t\t\t\t\t.pipe(debounceTime(0), ngDocZoneOptimize(this.ngZone), untilDestroyed(this))\n\t\t\t\t\t.subscribe(this.select.bind(this));\n\t\t\t},\n\t\t\t{ phase: AfterRenderPhase.Write },\n\t\t);\n\t}\n\n\tngOnInit(): void {\n\t\tthis.activeItem.set(this.tableOfContent[0]);\n\t}\n\n\t/**\n\t * Selects the item in the table of content.\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.set(item);\n\t}\n}\n","<div class=\"ng-doc-toc-wrapper\">\n\t<div class=\"ng-doc-toc-container\">\n\t\t<div class=\"ng-doc-toc-selection\" #selection></div>\n\t\t<ul class=\"ng-doc-toc\">\n\t\t\t@for (item of tableOfContent; track item) {\n\t\t\t\t<li\n\t\t\t\t\tng-doc-toc-element\n\t\t\t\t\t[path]=\"item.path\"\n\t\t\t\t\t[hash]=\"item.hash\"\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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AAA;;AAG7B,iBAAiB,GAAA,UAAA,CAAA;AAD7B,IAAA,YAAY,EAAE;;AACF,CAAA,EAAA,iBAAiB,CAuG7B,CAAA;2FAvGY,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,0eAAA,EAAA,MAAA,EAAA,CAAA,0yBAAA,CAAA,EAAA,CAAA;wDAKpE,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;;;AE7CvC;;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 {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n} from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { NgDocDecodeUriComponentPipe } from '@ng-doc/app/pipes/decode-uri-component';\n\n@Component({\n selector: 'li[ng-doc-toc-element]',\n templateUrl: './toc-element.component.html',\n styleUrls: ['./toc-element.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [RouterLink, NgDocDecodeUriComponentPipe],\n})\nexport class NgDocTocElementComponent {\n @Input()\n path: string = '';\n\n @Input()\n hash: string = '';\n\n @Input()\n @HostBinding('attr.data-ng-doc-selected')\n selected: boolean = false;\n\n @Input()\n @HostBinding('attr.data-ng-doc-level')\n level: number = 1;\n\n readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n}\n","<a\n [routerLink]=\"[]\"\n [fragment]=\"hash | decodeUriComponent\"\n [style.padding-left]=\"'calc(var(--ng-doc-toc-indent) * ' + level + ')'\">\n <ng-content></ng-content>\n</a>\n","import { DOCUMENT, NgFor } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n Input,\n NgZone,\n OnInit,\n QueryList,\n Renderer2,\n signal,\n ViewChild,\n ViewChildren,\n WritableSignal,\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 { 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 selector: 'ng-doc-toc',\n templateUrl: './toc.component.html',\n styleUrls: ['./toc.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n imports: [NgFor, NgDocTocElementComponent],\n})\n@UntilDestroy()\nexport class NgDocTocComponent implements NgDocPageToc, OnInit {\n @Input()\n tableOfContent: NgDocTocItem[] = [];\n\n @ViewChild('selection', { read: ElementRef })\n selection?: ElementRef<HTMLElement>;\n\n @ViewChildren(NgDocTocElementComponent)\n elements: QueryList<NgDocTocElementComponent> = new QueryList<NgDocTocElementComponent>();\n\n activeItem: WritableSignal<NgDocTocItem | undefined> = signal(undefined);\n\n protected readonly document: Document = inject(DOCUMENT);\n protected readonly ngZone: NgZone = inject(NgZone);\n protected readonly changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n protected readonly renderer: Renderer2 = inject(Renderer2);\n protected readonly router: Router = inject(Router);\n\n constructor() {\n afterNextRender({\n write: () => {\n const scrollSelection: Observable<NgDocTocItem> = fromEvent(this.document, 'scroll').pipe(\n filter(() => !!this.tableOfContent.length),\n map((event: Event) => (event.target as Document).scrollingElement as HTMLElement),\n startWith(this.document.scrollingElement as HTMLElement),\n map((target: HTMLElement) => {\n const percentage: number =\n (target.scrollTop * 100) / (target.scrollHeight - target.offsetHeight);\n const selectionLine: number =\n target.scrollTop + (target.offsetHeight * percentage) / 100;\n if (!this.tableOfContent.length) {\n return null;\n }\n return this.tableOfContent.reduce((pTarget: NgDocTocItem, cTarget: NgDocTocItem) => {\n const pTop: number = pTarget.element.getBoundingClientRect().top + target.scrollTop;\n const cTop: number = cTarget.element.getBoundingClientRect().top + target.scrollTop;\n return Math.abs(cTop - selectionLine) < Math.abs(pTop - selectionLine)\n ? cTarget\n : pTarget;\n });\n }),\n filter(isPresent),\n );\n const routerSelection: Observable<NgDocTocItem> = this.router.events.pipe(\n map((event: REvent) => {\n if (event instanceof Scroll) {\n const item: NgDocTocItem | undefined = this.tableOfContent.find(\n (item: NgDocTocItem) => item.path.includes(event.routerEvent.url),\n );\n if (item) {\n return item;\n }\n }\n return null;\n }),\n filter(isPresent),\n debounceTime(20),\n );\n const elementsChanges = this.elements.changes.pipe(\n map(() => this.activeItem()),\n filter(isPresent),\n );\n merge(merge(scrollSelection, routerSelection).pipe(distinctUntilChanged()), elementsChanges)\n .pipe(debounceTime(0), ngDocZoneOptimize(this.ngZone), untilDestroyed(this))\n .subscribe(this.select.bind(this));\n },\n });\n }\n\n ngOnInit(): void {\n this.activeItem.set(this.tableOfContent[0]);\n }\n\n /**\n * Selects the item in the table of content.\n * @param item - Item to select.\n */\n protected select(item: NgDocTocItem): void {\n const index: number = this.tableOfContent.indexOf(item);\n\n if (this.selection) {\n const element: HTMLElement | undefined =\n this.elements.toArray()[index]?.elementRef.nativeElement;\n\n if (element) {\n this.renderer.setStyle(this.selection.nativeElement, 'top', `${element.offsetTop}px`);\n this.renderer.setStyle(this.selection.nativeElement, 'height', `${element.offsetHeight}px`);\n\n element.scrollIntoView({ block: 'nearest' });\n }\n }\n\n this.activeItem.set(item);\n }\n}\n","<div class=\"ng-doc-toc-wrapper\">\n <div class=\"ng-doc-toc-container\">\n <div class=\"ng-doc-toc-selection\" #selection></div>\n <ul class=\"ng-doc-toc\">\n @for (item of tableOfContent; track item) {\n <li\n ng-doc-toc-element\n [path]=\"item.path\"\n [hash]=\"item.hash\"\n [level]=\"item.level\"\n [selected]=\"item === activeItem()\">\n {{ item.title }}\n </li>\n }\n </ul>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;MAmBa,wBAAwB,CAAA;AARrC,IAAA,WAAA,GAAA;QAUE,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAGlB,IAAI,CAAA,IAAA,GAAW,EAAE,CAAC;QAIlB,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAI1B,IAAK,CAAA,KAAA,GAAW,CAAC,CAAC;AAET,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;AACnE,KAAA;8GAhBY,wBAAwB,EAAA,IAAA,EAAA,EAAA,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,ECnBrC,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAA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AA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,uMAII,UAAU,EAAA,EAAA,EAAA,YAAA,EAAA,UAAA,EAAA,SAAA,EAG5B,wBAAwB,EC5CxC,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,0eAiBA,w4BDiBmB,wBAAwB,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;AAG9B,iBAAiB,GAAA,UAAA,CAAA;AAD7B,IAAA,YAAY,EAAE;;AACF,CAAA,EAAA,iBAAiB,CA8F7B,CAAA;2FA9FY,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;+BACE,YAAY,EAAA,eAAA,EAGL,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,OAAA,EACP,CAAC,KAAK,EAAE,wBAAwB,CAAC,EAAA,QAAA,EAAA,0eAAA,EAAA,MAAA,EAAA,CAAA,g1BAAA,CAAA,EAAA,CAAA;wDAK1C,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;;;AE5CxC;;AAEG;;;;"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
export * from '@ng-doc/app/components/api-list';
|
|
2
2
|
export * from '@ng-doc/app/components/breadcrumb';
|
|
3
3
|
export * from '@ng-doc/app/components/code';
|
|
4
|
+
export * from '@ng-doc/app/components/copy-button';
|
|
4
5
|
export * from '@ng-doc/app/components/demo';
|
|
5
6
|
export * from '@ng-doc/app/components/demo-displayer';
|
|
6
7
|
export * from '@ng-doc/app/components/demo-pane';
|
|
7
8
|
export * from '@ng-doc/app/components/fullscreen-button';
|
|
9
|
+
export * from '@ng-doc/app/components/heading-anchor';
|
|
10
|
+
export * from '@ng-doc/app/components/image-viewer';
|
|
8
11
|
export * from '@ng-doc/app/components/kind-icon';
|
|
9
12
|
export * from '@ng-doc/app/components/link';
|
|
13
|
+
export * from '@ng-doc/app/components/mermaid-viewer';
|
|
10
14
|
export * from '@ng-doc/app/components/navbar';
|
|
11
15
|
export * from '@ng-doc/app/components/page';
|
|
16
|
+
export * from '@ng-doc/app/components/page-header';
|
|
12
17
|
export * from '@ng-doc/app/components/page-link';
|
|
13
18
|
export * from '@ng-doc/app/components/page-navigation';
|
|
19
|
+
export * from '@ng-doc/app/components/page-wrapper';
|
|
14
20
|
export * from '@ng-doc/app/components/playground';
|
|
15
21
|
export * from '@ng-doc/app/components/root';
|
|
16
22
|
export * from '@ng-doc/app/components/search';
|
|
23
|
+
export * from '@ng-doc/app/components/search-dialog';
|
|
17
24
|
export * from '@ng-doc/app/components/search-result';
|
|
18
25
|
export * from '@ng-doc/app/components/sidebar';
|
|
19
26
|
export * from '@ng-doc/app/components/tabs';
|
|
@@ -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"}
|
|
@@ -1,44 +1,8 @@
|
|
|
1
1
|
const NG_DOC_STORE_THEME_KEY = 'ng-doc-theme-id';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Dark theme. You can set it manually by calling `NgDocThemeService.set` method.
|
|
5
|
-
*
|
|
6
|
-
* ```typescript
|
|
7
|
-
* import {Component} from '@angular/core';
|
|
8
|
-
* import {NgDocThemeService, NG_DOC_NIGHT_THEME} from '@ng-doc/app';
|
|
9
|
-
*
|
|
10
|
-
* @Component()
|
|
11
|
-
* export class AppComponent {
|
|
12
|
-
* constructor(
|
|
13
|
-
* private readonly themeService: NgDocThemeService,
|
|
14
|
-
* ) {
|
|
15
|
-
* this.themeService.setTheme(NG_DOC_NIGHT_THEME.id);
|
|
16
|
-
* }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* Or you can set it as default theme in your app module:
|
|
21
|
-
* ```typescript
|
|
22
|
-
* import {NgModule} from '@angular/core';
|
|
23
|
-
* import {NgDocModule, NG_DOC_NIGHT_THEME} from '@ng-doc/app';
|
|
24
|
-
* import {AppComponent} from './app.component';
|
|
25
|
-
*
|
|
26
|
-
* @NgModule({
|
|
27
|
-
* declarations: [AppComponent],
|
|
28
|
-
* imports: [NgDocModule.forRoot({defaultTheme: NG_DOC_NIGHT_THEME.id})],
|
|
29
|
-
* bootstrap: [AppComponent],
|
|
30
|
-
* })
|
|
31
|
-
* export class AppModule {}
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
const NG_DOC_NIGHT_THEME = {
|
|
35
|
-
id: 'ng-doc-night',
|
|
36
|
-
path: 'assets/ng-doc/app/themes/ng-doc-night.css',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
3
|
/**
|
|
40
4
|
* Generated bundle index. Do not edit.
|
|
41
5
|
*/
|
|
42
6
|
|
|
43
|
-
export {
|
|
7
|
+
export { NG_DOC_STORE_THEME_KEY };
|
|
44
8
|
//# sourceMappingURL=ng-doc-app-constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/
|
|
1
|
+
{"version":3,"file":"ng-doc-app-constants.mjs","sources":["../../../../libs/app/constants/store-keys.ts","../../../../libs/app/constants/ng-doc-app-constants.ts"],"sourcesContent":["export const NG_DOC_STORE_THEME_KEY: string = 'ng-doc-theme-id';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAO,MAAM,sBAAsB,GAAW;;ACA9C;;AAEG;;;;"}
|