@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,13 +1,16 @@
|
|
|
1
|
-
import { NgDocBlockquoteComponent, NgDocIconComponent
|
|
1
|
+
import { NgDocBlockquoteComponent, NgDocIconComponent } from '@ng-doc/ui-kit';
|
|
2
2
|
import { NgDocCodeComponent } from '@ng-doc/app/components/code';
|
|
3
3
|
import { NgDocDemoComponent } from '@ng-doc/app/components/demo';
|
|
4
4
|
import { NgDocDemoPaneComponent } from '@ng-doc/app/components/demo-pane';
|
|
5
|
-
import {
|
|
5
|
+
import { NgDocHeadingAnchorComponent } from '@ng-doc/app/components/heading-anchor';
|
|
6
|
+
import { Renderer2 } from '@angular/core';
|
|
7
|
+
import { NgDocImageViewerComponent } from '@ng-doc/app/components/image-viewer';
|
|
8
|
+
import { NgDocMermaidViewerComponent } from '@ng-doc/app/components/mermaid-viewer';
|
|
6
9
|
import { NgDocPlaygroundComponent } from '@ng-doc/app/components/playground';
|
|
7
|
-
import { isPresent } from '@ng-doc/core';
|
|
8
|
-
import * as i0 from '@angular/core';
|
|
9
|
-
import { Renderer2, ElementRef, Component, ChangeDetectionStrategy, Input, ViewChild } from '@angular/core';
|
|
10
|
+
import { isPresent } from '@ng-doc/core/helpers/is-present';
|
|
10
11
|
import { NgDocTabsComponent } from '@ng-doc/app/components/tabs';
|
|
12
|
+
export * from '@ng-doc/app/processors/processors/link';
|
|
13
|
+
export * from '@ng-doc/app/processors/processors/tooltip';
|
|
11
14
|
|
|
12
15
|
const blockquoteProcessor = {
|
|
13
16
|
component: NgDocBlockquoteComponent,
|
|
@@ -16,6 +19,7 @@ const blockquoteProcessor = {
|
|
|
16
19
|
content: [Array.from(element.childNodes)],
|
|
17
20
|
inputs: {
|
|
18
21
|
type: element.getAttribute('type') || 'default',
|
|
22
|
+
icon: element.getAttribute('icon') ?? undefined,
|
|
19
23
|
},
|
|
20
24
|
}),
|
|
21
25
|
};
|
|
@@ -26,10 +30,8 @@ const codeProcessor = {
|
|
|
26
30
|
nodeToReplace: (element) => element.closest('pre') ?? element,
|
|
27
31
|
extractOptions: (element) => ({
|
|
28
32
|
inputs: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
icon: element.getAttribute('icon') || undefined,
|
|
32
|
-
lineNumbers: element.getAttribute('lineNumbers') !== 'false',
|
|
33
|
+
name: element.parentElement?.getAttribute('name') || undefined,
|
|
34
|
+
icon: element.parentElement?.getAttribute('icon') || undefined,
|
|
33
35
|
},
|
|
34
36
|
content: [[element.closest('pre') ?? element]],
|
|
35
37
|
}),
|
|
@@ -41,7 +43,7 @@ const demoProcessor = {
|
|
|
41
43
|
extractOptions: (element) => ({
|
|
42
44
|
inputs: {
|
|
43
45
|
componentName: element.getAttribute('componentName') || undefined,
|
|
44
|
-
options: JSON.parse(element.querySelector('#options')?.textContent ?? '')
|
|
46
|
+
options: JSON.parse(element.querySelector('#options')?.textContent ?? '{}'),
|
|
45
47
|
},
|
|
46
48
|
}),
|
|
47
49
|
};
|
|
@@ -57,6 +59,17 @@ const demoPaneProcessor = {
|
|
|
57
59
|
}),
|
|
58
60
|
};
|
|
59
61
|
|
|
62
|
+
const headingAnchorProcessor = {
|
|
63
|
+
component: NgDocHeadingAnchorComponent,
|
|
64
|
+
selector: 'ng-doc-heading-anchor',
|
|
65
|
+
extractOptions: (element) => ({
|
|
66
|
+
inputs: {
|
|
67
|
+
classes: element.getAttribute('class')?.split(' ') || [],
|
|
68
|
+
anchor: element.getAttribute('anchor') || '',
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
|
|
60
73
|
const iconProcessor = {
|
|
61
74
|
component: NgDocIconComponent,
|
|
62
75
|
selector: 'ng-doc-icon',
|
|
@@ -68,15 +81,30 @@ const iconProcessor = {
|
|
|
68
81
|
}),
|
|
69
82
|
};
|
|
70
83
|
|
|
71
|
-
const
|
|
72
|
-
component:
|
|
73
|
-
selector: '
|
|
84
|
+
const imageProcessor = {
|
|
85
|
+
component: NgDocImageViewerComponent,
|
|
86
|
+
selector: 'img:not([zoom="false"])',
|
|
87
|
+
nodeToReplace: (element, injector) => {
|
|
88
|
+
const renderer = injector.get(Renderer2);
|
|
89
|
+
const anchor = renderer.createElement('div');
|
|
90
|
+
return element.parentNode?.insertBefore(anchor, element) ?? element;
|
|
91
|
+
},
|
|
74
92
|
extractOptions: (element) => ({
|
|
75
93
|
inputs: {
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
src: element.getAttribute('src') ?? '',
|
|
95
|
+
alt: element.getAttribute('alt') ?? '',
|
|
96
|
+
},
|
|
97
|
+
content: [[element]],
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const mermaidProcessor = {
|
|
102
|
+
component: NgDocMermaidViewerComponent,
|
|
103
|
+
selector: 'pre.mermaid',
|
|
104
|
+
extractOptions: (element) => ({
|
|
105
|
+
inputs: {
|
|
106
|
+
graph: element.textContent ?? '',
|
|
78
107
|
},
|
|
79
|
-
content: [Array.from(element.childNodes)],
|
|
80
108
|
}),
|
|
81
109
|
};
|
|
82
110
|
|
|
@@ -124,62 +152,9 @@ const tabsProcessor = {
|
|
|
124
152
|
},
|
|
125
153
|
};
|
|
126
154
|
|
|
127
|
-
class NgDocTooltipWrapperComponent {
|
|
128
|
-
constructor(changeDetectorRef) {
|
|
129
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
130
|
-
this.tooltipElement = null;
|
|
131
|
-
}
|
|
132
|
-
ngAfterViewInit() {
|
|
133
|
-
if (this.contentProjection) {
|
|
134
|
-
const element = this.contentProjection.nativeElement.querySelector('[ngDocTooltip]');
|
|
135
|
-
this.tooltipElement = element instanceof HTMLElement ? element : null;
|
|
136
|
-
this.changeDetectorRef.detectChanges();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgDocTooltipWrapperComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: NgDocTooltipWrapperComponent, isStandalone: true, selector: "ng-doc-tooltip-wrapper", inputs: { content: "content" }, viewQueries: [{ propertyName: "contentProjection", first: true, predicate: ["contentProjection"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: `
|
|
141
|
-
<div
|
|
142
|
-
class="content-projection"
|
|
143
|
-
[ngDocTooltip]="content ?? ''"
|
|
144
|
-
[displayOrigin]="tooltipElement ?? contentProjection"
|
|
145
|
-
[pointerOrigin]="tooltipElement ?? contentProjection"
|
|
146
|
-
#contentProjection>
|
|
147
|
-
<ng-content></ng-content>
|
|
148
|
-
</div>
|
|
149
|
-
`, 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 }); }
|
|
150
|
-
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgDocTooltipWrapperComponent, decorators: [{
|
|
152
|
-
type: Component,
|
|
153
|
-
args: [{ selector: 'ng-doc-tooltip-wrapper', template: `
|
|
154
|
-
<div
|
|
155
|
-
class="content-projection"
|
|
156
|
-
[ngDocTooltip]="content ?? ''"
|
|
157
|
-
[displayOrigin]="tooltipElement ?? contentProjection"
|
|
158
|
-
[pointerOrigin]="tooltipElement ?? contentProjection"
|
|
159
|
-
#contentProjection>
|
|
160
|
-
<ng-content></ng-content>
|
|
161
|
-
</div>
|
|
162
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgDocTooltipDirective], styles: [".content-projection{display:unset}\n"] }]
|
|
163
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { content: [{
|
|
164
|
-
type: Input
|
|
165
|
-
}], contentProjection: [{
|
|
166
|
-
type: ViewChild,
|
|
167
|
-
args: ['contentProjection', { read: ElementRef, static: true }]
|
|
168
|
-
}] } });
|
|
169
|
-
const tooltipProcessor = {
|
|
170
|
-
component: NgDocTooltipWrapperComponent,
|
|
171
|
-
selector: '[ngDocTooltip]',
|
|
172
|
-
extractOptions: (element) => ({
|
|
173
|
-
inputs: {
|
|
174
|
-
content: element.getAttribute('ngDocTooltip') ?? '',
|
|
175
|
-
},
|
|
176
|
-
content: [[element.cloneNode(true)]],
|
|
177
|
-
}),
|
|
178
|
-
};
|
|
179
|
-
|
|
180
155
|
/**
|
|
181
156
|
* Generated bundle index. Do not edit.
|
|
182
157
|
*/
|
|
183
158
|
|
|
184
|
-
export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, iconProcessor,
|
|
159
|
+
export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, headingAnchorProcessor, iconProcessor, imageProcessor, mermaidProcessor, playgroundProcessor, tabsProcessor };
|
|
185
160
|
//# sourceMappingURL=ng-doc-app-processors-processors.mjs.map
|
|
@@ -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:\n\t\t\t\tJSON.parse(element.querySelector('#data')?.textContent?.replace(/\\n/g, '\\\\n') ?? '') ||\n\t\t\t\tundefined,\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 { Injector, Renderer2 } from '@angular/core';\nimport { 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, injector: Injector) => {\n\t\tconst renderer: Renderer2 = injector.get(Renderer2);\n\t\tconst anchor: Element = renderer.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,OA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AM;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/heading-anchor.processor.ts","../../../../libs/app/processors/processors/icon.processor.ts","../../../../libs/app/processors/processors/image.processor.ts","../../../../libs/app/processors/processors/mermaid.processor.ts","../../../../libs/app/processors/processors/playground.processor.ts","../../../../libs/app/processors/processors/tabs.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 component: NgDocBlockquoteComponent,\n selector: 'ng-doc-blockquote',\n extractOptions: (element: Element) => ({\n content: [Array.from(element.childNodes)],\n inputs: {\n type: (element.getAttribute('type') as NgDocBlockquoteType) || 'default',\n icon: element.getAttribute('icon') ?? undefined,\n },\n }),\n};\n","import { NgDocCodeComponent } from '@ng-doc/app/components/code';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\n\nexport const codeProcessor: NgDocPageProcessor<NgDocCodeComponent> = {\n component: NgDocCodeComponent,\n selector: 'pre code',\n nodeToReplace: (element: Element) => element.closest('pre') ?? element,\n extractOptions: (element: Element) => ({\n inputs: {\n name: element.parentElement?.getAttribute('name') || undefined,\n icon: element.parentElement?.getAttribute('icon') || undefined,\n },\n content: [[element.closest('pre') ?? element]],\n }),\n};\n","import { NgDocDemoComponent } from '@ng-doc/app/components/demo';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\n\nexport const demoProcessor: NgDocPageProcessor<NgDocDemoComponent> = {\n component: NgDocDemoComponent,\n selector: 'ng-doc-demo',\n extractOptions: (element: Element) => ({\n inputs: {\n componentName: element.getAttribute('componentName') || undefined,\n options: JSON.parse(element.querySelector('#options')?.textContent ?? '{}'),\n },\n }),\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 { NgDocHeadingAnchorComponent } from '@ng-doc/app/components/heading-anchor';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\n\nexport const headingAnchorProcessor: NgDocPageProcessor<NgDocHeadingAnchorComponent> = {\n component: NgDocHeadingAnchorComponent,\n selector: 'ng-doc-heading-anchor',\n extractOptions: (element: Element) => ({\n inputs: {\n classes: element.getAttribute('class')?.split(' ') || [],\n anchor: element.getAttribute('anchor') || '',\n },\n }),\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 { Injector, Renderer2 } from '@angular/core';\nimport { NgDocImageViewerComponent } from '@ng-doc/app/components/image-viewer';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\n\nexport const imageProcessor: NgDocPageProcessor<NgDocImageViewerComponent> = {\n component: NgDocImageViewerComponent,\n selector: 'img:not([zoom=\"false\"])',\n nodeToReplace: (element: Element, injector: Injector) => {\n const renderer: Renderer2 = injector.get(Renderer2);\n const anchor: Element = renderer.createElement('div');\n\n return element.parentNode?.insertBefore(anchor, element) ?? element;\n },\n extractOptions: (element: Element) => ({\n inputs: {\n src: element.getAttribute('src') ?? '',\n alt: element.getAttribute('alt') ?? '',\n },\n content: [[element]],\n }),\n};\n","import { NgDocMermaidViewerComponent } from '@ng-doc/app/components/mermaid-viewer';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\n\nexport const mermaidProcessor: NgDocPageProcessor<NgDocMermaidViewerComponent> = {\n component: NgDocMermaidViewerComponent,\n selector: 'pre.mermaid',\n extractOptions: (element: Element) => ({\n inputs: {\n graph: element.textContent ?? '',\n },\n }),\n};\n","import { NgDocPlaygroundComponent } from '@ng-doc/app/components/playground';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { isPresent } from '@ng-doc/core/helpers/is-present';\n\nexport const playgroundProcessor: NgDocPageProcessor<NgDocPlaygroundComponent> = {\n component: NgDocPlaygroundComponent,\n selector: 'ng-doc-playground',\n extractOptions: (element: Element) => ({\n inputs: {\n id: element.getAttribute('id') || undefined,\n properties:\n JSON.parse(element.querySelector('#data')?.textContent?.replace(/\\n/g, '\\\\n') ?? '') ||\n undefined,\n pipeName: element.querySelector('#pipeName')?.textContent || undefined,\n selectors: (element.querySelector('#selectors')?.textContent || '')\n .split(',')\n .map((selector: string) => selector.trim())\n .filter(isPresent),\n options: JSON.parse(element.querySelector('#options')?.textContent ?? '') || {},\n },\n }),\n};\n","import { Injector, Renderer2 } from '@angular/core';\nimport { 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, injector: Injector) => {\n\t\tconst renderer: Renderer2 = injector.get(Renderer2);\n\t\tconst anchor: Element = renderer.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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAGa,MAAA,mBAAmB,GAAiD;AAC/E,IAAA,SAAS,EAAE,wBAAwB;AACnC,IAAA,QAAQ,EAAE,mBAAmB;AAC7B,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;QACrC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AACzC,QAAA,MAAM,EAAE;YACN,IAAI,EAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAyB,IAAI,SAAS;YACxE,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS;AAChD,SAAA;KACF,CAAC;;;ACTS,MAAA,aAAa,GAA2C;AACnE,IAAA,SAAS,EAAE,kBAAkB;AAC7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
|
+
import mermaid from 'mermaid';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Provides Mermaid instance.
|
|
6
|
+
* @param config
|
|
7
|
+
*/
|
|
8
|
+
function provideMermaid(config) {
|
|
9
|
+
return {
|
|
10
|
+
provide: NG_DOC_MERMAID,
|
|
11
|
+
useFactory: () => {
|
|
12
|
+
mermaid.initialize({ ...config, startOnLoad: false });
|
|
13
|
+
return mermaid;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Generated bundle index. Do not edit.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export { provideMermaid };
|
|
23
|
+
//# sourceMappingURL=ng-doc-app-providers-mermaid.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers-mermaid.mjs","sources":["../../../../libs/app/providers/mermaid/provide-mermaid.ts","../../../../libs/app/providers/mermaid/ng-doc-app-providers-mermaid.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { NG_DOC_MERMAID } from '@ng-doc/app/tokens';\nimport mermaid, { MermaidConfig } from 'mermaid';\n\n/**\n * Provides Mermaid instance.\n * @param config\n */\nexport function provideMermaid(config?: MermaidConfig): Provider {\n return {\n provide: NG_DOC_MERMAID,\n useFactory: () => {\n mermaid.initialize({ ...config, startOnLoad: false });\n\n return mermaid;\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIA;;;AAGG;AACG,SAAU,cAAc,CAAC,MAAsB,EAAA;IACnD,OAAO;AACL,QAAA,OAAO,EAAE,cAAc;QACvB,UAAU,EAAE,MAAK;AACf,YAAA,OAAO,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;AAEtD,YAAA,OAAO,OAAO,CAAC;SAChB;KACF,CAAC;AACJ;;ACjBA;;AAEG;;;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ViewportScroller } from '@angular/common';
|
|
2
|
-
import { APP_INITIALIZER,
|
|
3
|
-
import {
|
|
4
|
-
import { NgDocThemeService, NgDocStoreService } from '@ng-doc/app/services';
|
|
5
|
-
import { NG_DOC_THEME, NG_DOC_DEFAULT_THEME_ID } from '@ng-doc/app/tokens';
|
|
6
|
-
import { asArray, isBrowser } from '@ng-doc/core';
|
|
2
|
+
import { APP_INITIALIZER, inject } from '@angular/core';
|
|
3
|
+
import { NgDocHighlighterService } from '@ng-doc/app/services/highlighter';
|
|
7
4
|
import { provideNgDocUiKitConfig } from '@ng-doc/ui-kit';
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -12,42 +9,22 @@ import { provideNgDocUiKitConfig } from '@ng-doc/ui-kit';
|
|
|
12
9
|
*/
|
|
13
10
|
function provideNgDocApp(config) {
|
|
14
11
|
return [
|
|
15
|
-
/* ---
|
|
16
|
-
{ provide: NG_DOC_THEME, useValue: NG_DOC_NIGHT_THEME, multi: true },
|
|
17
|
-
...asArray(config?.themes).map((theme) => ({
|
|
18
|
-
provide: NG_DOC_THEME,
|
|
19
|
-
useValue: theme,
|
|
20
|
-
multi: true,
|
|
21
|
-
})),
|
|
22
|
-
...asArray(config?.defaultThemeId).map((themeId) => ({
|
|
23
|
-
provide: NG_DOC_DEFAULT_THEME_ID,
|
|
24
|
-
useValue: themeId,
|
|
25
|
-
})),
|
|
26
|
-
/* --- Theme Initializer--- */
|
|
12
|
+
/* --- Viewport Scroller --- */
|
|
27
13
|
{
|
|
28
14
|
provide: APP_INITIALIZER,
|
|
29
|
-
useFactory: (themeService, store, defaultThemeId) => {
|
|
30
|
-
return async () => {
|
|
31
|
-
const savedThemeId = isBrowser ? store.get(NG_DOC_STORE_THEME_KEY) : null;
|
|
32
|
-
if ((defaultThemeId === 'auto' && !savedThemeId) ||
|
|
33
|
-
savedThemeId === NgDocThemeService.autoThemeId) {
|
|
34
|
-
return themeService.enableAutoTheme(undefined, NG_DOC_NIGHT_THEME);
|
|
35
|
-
}
|
|
36
|
-
else if (isBrowser) {
|
|
37
|
-
return themeService.set(savedThemeId ?? defaultThemeId, false);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
15
|
multi: true,
|
|
42
|
-
deps: [
|
|
16
|
+
deps: [ViewportScroller],
|
|
17
|
+
useFactory: (viewportScroller) => {
|
|
18
|
+
return () => viewportScroller.setOffset([0, 120]);
|
|
19
|
+
},
|
|
43
20
|
},
|
|
44
|
-
|
|
21
|
+
/** --- Shiki --- */
|
|
45
22
|
{
|
|
46
23
|
provide: APP_INITIALIZER,
|
|
47
24
|
multi: true,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return () =>
|
|
25
|
+
useFactory: () => {
|
|
26
|
+
const highlighter = inject(NgDocHighlighterService);
|
|
27
|
+
return () => highlighter.initialize(config?.shiki);
|
|
51
28
|
},
|
|
52
29
|
},
|
|
53
30
|
/* --- UiKit --- */
|
|
@@ -1 +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,
|
|
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, inject, Provider } from '@angular/core';\nimport { NgDocHighlighterConfig, NgDocHighlighterService } from '@ng-doc/app/services/highlighter';\nimport { NgDocUiConfig, provideNgDocUiKitConfig } from '@ng-doc/ui-kit';\n\n/**\n * NgDoc application config.\n */\nexport interface NgDocApplicationConfig {\n /**\n * UI Kit configuration.\n */\n uiKit?: NgDocUiConfig;\n /**\n * Shiki theme.\n */\n shiki?: NgDocHighlighterConfig;\n}\n\n/**\n * Provides the NgDoc application configuration.\n * @param config - The optional application configuration.\n */\nexport function provideNgDocApp(config?: NgDocApplicationConfig): Provider[] {\n return [\n /* --- Viewport Scroller --- */\n {\n provide: APP_INITIALIZER,\n multi: true,\n deps: [ViewportScroller],\n useFactory: (viewportScroller: ViewportScroller) => {\n return () => viewportScroller.setOffset([0, 120]);\n },\n },\n /** --- Shiki --- */\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: () => {\n const highlighter = inject(NgDocHighlighterService);\n\n return () => highlighter.initialize(config?.shiki);\n },\n },\n\n /* --- UiKit --- */\n ...provideNgDocUiKitConfig(config?.uiKit),\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAmBA;;;AAGG;AACG,SAAU,eAAe,CAAC,MAA+B,EAAA;IAC7D,OAAO;;AAEL,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,CAAC,gBAAgB,CAAC;AACxB,YAAA,UAAU,EAAE,CAAC,gBAAkC,KAAI;AACjD,gBAAA,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;aACnD;AACF,SAAA;;AAED,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,MAAK;AACf,gBAAA,MAAM,WAAW,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;gBAEpD,OAAO,MAAM,WAAW,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;aACpD;AACF,SAAA;;AAGD,QAAA,GAAG,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC;KAC1C,CAAC;AACJ;;AChDA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-providers-playground-demo.mjs","sources":["../../../../libs/app/providers/playground-demo/provide-playground-demo.ts","../../../../libs/app/providers/playground-demo/ng-doc-app-providers-playground-demo.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport { Constructor } from '@ng-doc/core';\n\nconst tokenStore: Map<string, InjectionToken<unknown>> = new Map<string, InjectionToken<unknown>>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n * @param playgroundId\n * @param selector\n * @param component\n */\nexport function providePlaygroundDemo(\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers-playground-demo.mjs","sources":["../../../../libs/app/providers/playground-demo/provide-playground-demo.ts","../../../../libs/app/providers/playground-demo/ng-doc-app-providers-playground-demo.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport { Constructor } from '@ng-doc/core/types';\n\nconst tokenStore: Map<string, InjectionToken<unknown>> = new Map<string, InjectionToken<unknown>>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n * @param playgroundId\n * @param selector\n * @param component\n */\nexport function providePlaygroundDemo(\n playgroundId: string,\n component: Constructor<unknown>,\n): Provider {\n const token: InjectionToken<unknown> =\n tokenStore.get(playgroundId) ??\n new InjectionToken<unknown>(`NG_DOC_PLAYGROUND_DEMO_${playgroundId}`);\n\n tokenStore.set(playgroundId, token);\n\n return {\n provide: token,\n useValue: component,\n multi: true,\n };\n}\n\n/**\n * Returns the token for the given playground id.\n * @param playgroundId\n */\nexport function getPlaygroundDemoToken<T>(playgroundId: string): InjectionToken<T[]> | undefined {\n return tokenStore.get(playgroundId) as InjectionToken<T[]> | undefined;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAGA,MAAM,UAAU,GAAyC,IAAI,GAAG,EAAmC,CAAC;AAEpG;;;;;;;;AAQG;AACa,SAAA,qBAAqB,CACnC,YAAoB,EACpB,SAA+B,EAAA;AAE/B,IAAA,MAAM,KAAK,GACT,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;AAC5B,QAAA,IAAI,cAAc,CAAU,CAAA,uBAAA,EAA0B,YAAY,CAAA,CAAE,CAAC,CAAC;AAExE,IAAA,UAAU,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAEpC,OAAO;AACL,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,QAAQ,EAAE,SAAS;AACnB,QAAA,KAAK,EAAE,IAAI;KACZ,CAAC;AACJ,CAAC;AAED;;;AAGG;AACG,SAAU,sBAAsB,CAAI,YAAoB,EAAA;AAC5D,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,YAAY,CAAoC,CAAC;AACzE;;ACrCA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-providers-search-engine.mjs","sources":["../../../../libs/app/providers/search-engine/provide-search-engine.ts","../../../../libs/app/providers/search-engine/ng-doc-app-providers-search-engine.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { NgDocSearchEngine } from '@ng-doc/app/classes/search-engine';\nimport { Constructor } from '@ng-doc/core';\n\n/**\n * Provides the `NgDocSearchEngine` to enable search in the documentation.\n *\n * You can create and provide your own `NgDocSearchEngine` if you want to handle the search yourself.\n * @param engine - The search engine class.\n * @param args - The arguments for the search engine class.\n * @returns The provider for the search engine.\n */\nexport function provideSearchEngine<E extends Constructor<NgDocSearchEngine>>(\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers-search-engine.mjs","sources":["../../../../libs/app/providers/search-engine/provide-search-engine.ts","../../../../libs/app/providers/search-engine/ng-doc-app-providers-search-engine.ts"],"sourcesContent":["import { Provider } from '@angular/core';\nimport { NgDocSearchEngine } from '@ng-doc/app/classes/search-engine';\nimport { Constructor } from '@ng-doc/core/types';\n\n/**\n * Provides the `NgDocSearchEngine` to enable search in the documentation.\n *\n * You can create and provide your own `NgDocSearchEngine` if you want to handle the search yourself.\n * @param engine - The search engine class.\n * @param args - The arguments for the search engine class.\n * @returns The provider for the search engine.\n */\nexport function provideSearchEngine<E extends Constructor<NgDocSearchEngine>>(\n engine: E,\n ...args: ConstructorParameters<E>\n): Provider {\n return {\n provide: NgDocSearchEngine,\n useFactory: () => new engine(...args),\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;;;;;;;AAOG;SACa,mBAAmB,CACjC,MAAS,EACT,GAAG,IAA8B,EAAA;IAEjC,OAAO;AACL,QAAA,OAAO,EAAE,iBAAiB;QAC1B,UAAU,EAAE,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC;KACtC,CAAC;AACJ;;ACpBA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-providers-type-control.mjs","sources":["../../../../libs/app/providers/type-control/provide-type-control.ts","../../../../libs/app/providers/type-control/ng-doc-app-providers-type-control.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport {\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers-type-control.mjs","sources":["../../../../libs/app/providers/type-control/provide-type-control.ts","../../../../libs/app/providers/type-control/ng-doc-app-providers-type-control.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\nimport {\n NgDocProvidedTypeControl,\n NgDocTypeControl,\n NgDocTypeControlProviderOptions,\n} from '@ng-doc/app/interfaces';\nimport { Constructor } from '@ng-doc/core/types';\n\nconst tokenStore: Map<string, InjectionToken<NgDocProvidedTypeControl>> = new Map<\n string,\n InjectionToken<NgDocProvidedTypeControl>\n>();\n\n/**\n *\n * @param type\n * @param control\n * @param options\n */\nexport function provideTypeControl(\n type: string,\n control: Constructor<NgDocTypeControl>,\n options?: NgDocTypeControlProviderOptions,\n): Provider {\n const token: InjectionToken<NgDocProvidedTypeControl> =\n new InjectionToken<NgDocProvidedTypeControl>(`NG_DOC_TYPE_CONTROL_${type}`, {\n providedIn: 'root',\n factory: () => {\n return {\n control,\n options,\n };\n },\n });\n tokenStore.set(type, token);\n\n return {\n provide: 'nothing',\n useValue: null,\n };\n}\n\n/**\n * Returns token for type control based on provided type\n * @param type - type for searched control (e.g. `string`)\n */\nexport function getTokenForType(\n type: string,\n): InjectionToken<NgDocProvidedTypeControl> | undefined {\n return tokenStore.get(type);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAQA,MAAM,UAAU,GAA0D,IAAI,GAAG,EAG9E,CAAC;AAEJ;;;;;AAKG;SACa,kBAAkB,CAChC,IAAY,EACZ,OAAsC,EACtC,OAAyC,EAAA;IAEzC,MAAM,KAAK,GACT,IAAI,cAAc,CAA2B,CAAuB,oBAAA,EAAA,IAAI,EAAE,EAAE;AAC1E,QAAA,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE,MAAK;YACZ,OAAO;gBACL,OAAO;gBACP,OAAO;aACR,CAAC;SACH;AACF,KAAA,CAAC,CAAC;AACL,IAAA,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAE5B,OAAO;AACL,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC;AAED;;;AAGG;AACG,SAAU,eAAe,CAC7B,IAAY,EAAA;AAEZ,IAAA,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC9B;;AClDA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-providers.mjs","sources":["../../../../libs/app/providers/ng-doc-app-providers.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ng-doc-app-providers.mjs","sources":["../../../../libs/app/providers/ng-doc-app-providers.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { NG_DOC_SHIKI_THEME } from '@ng-doc/app/tokens';
|
|
4
|
+
import { createHighlighterCore } from 'shiki/core';
|
|
5
|
+
import getWasm from 'shiki/wasm';
|
|
6
|
+
|
|
7
|
+
class NgDocHighlighterService {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.theme = inject(NG_DOC_SHIKI_THEME);
|
|
10
|
+
}
|
|
11
|
+
async initialize(config) {
|
|
12
|
+
this.highlighter = (await createHighlighterCore({
|
|
13
|
+
themes: [
|
|
14
|
+
import('shiki/themes/github-light.mjs'),
|
|
15
|
+
import('shiki/themes/ayu-dark.mjs'),
|
|
16
|
+
...(config?.themes ?? []),
|
|
17
|
+
],
|
|
18
|
+
langs: [import('shiki/langs/angular-html.mjs')],
|
|
19
|
+
loadWasm: getWasm,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
highlight(code) {
|
|
23
|
+
return this.highlighter.codeToHtml(code, {
|
|
24
|
+
lang: 'angular-html',
|
|
25
|
+
themes: {
|
|
26
|
+
light: this.theme.light || 'github-light',
|
|
27
|
+
dark: this.theme.dark || 'ayu-dark',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocHighlighterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocHighlighterService, providedIn: 'root' }); }
|
|
33
|
+
}
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocHighlighterService, decorators: [{
|
|
35
|
+
type: Injectable,
|
|
36
|
+
args: [{
|
|
37
|
+
providedIn: 'root',
|
|
38
|
+
}]
|
|
39
|
+
}] });
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generated bundle index. Do not edit.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
export { NgDocHighlighterService };
|
|
46
|
+
//# sourceMappingURL=ng-doc-app-services-highlighter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-doc-app-services-highlighter.mjs","sources":["../../../../libs/app/services/highlighter/highlighter.service.ts","../../../../libs/app/services/highlighter/ng-doc-app-services-highlighter.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { NG_DOC_SHIKI_THEME } from '@ng-doc/app/tokens';\nimport { HighlighterGeneric } from '@shikijs/core/types';\nimport { ThemeInput } from 'shiki';\nimport { createHighlighterCore } from 'shiki/core';\nimport getWasm from 'shiki/wasm';\n\nexport interface NgDocHighlighterConfig {\n /**\n * Themes sources.\n */\n themes?: ThemeInput[];\n /**\n * Theme that will be used for rendering the code blocks.\n */\n theme?: {\n light: string;\n dark: string;\n };\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgDocHighlighterService {\n highlighter?: HighlighterGeneric<string, string>;\n\n protected readonly theme = inject(NG_DOC_SHIKI_THEME);\n\n async initialize(config?: NgDocHighlighterConfig): Promise<void> {\n this.highlighter = (await createHighlighterCore({\n themes: [\n import('shiki/themes/github-light.mjs'),\n import('shiki/themes/ayu-dark.mjs'),\n ...(config?.themes ?? []),\n ],\n langs: [import('shiki/langs/angular-html.mjs')],\n loadWasm: getWasm,\n })) as HighlighterGeneric<string, string>;\n }\n\n highlight(code: string): string {\n return this.highlighter!.codeToHtml(code, {\n lang: 'angular-html',\n themes: {\n light: this.theme.light || 'github-light',\n dark: this.theme.dark || 'ayu-dark',\n },\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\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AAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -1,51 +1,42 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
|
-
import * as i1 from '@angular/cdk/layout';
|
|
3
|
-
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
|
|
4
2
|
import { DOCUMENT } from '@angular/common';
|
|
5
3
|
import * as i0 from '@angular/core';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
4
|
+
import { inject, Injectable } from '@angular/core';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { Router, NavigationEnd } from '@angular/router';
|
|
7
|
+
import { ngDocZoneOptimize } from '@ng-doc/ui-kit';
|
|
10
8
|
import { NgDocScrollService } from '@ng-doc/ui-kit/services/scroll';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { WINDOW } from '@ng-web-apis/common';
|
|
10
|
+
import { UntilDestroy } from '@ngneat/until-destroy';
|
|
11
|
+
import { BehaviorSubject, fromEvent, share } from 'rxjs';
|
|
12
|
+
import { startWith, filter } from 'rxjs/operators';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Service for sidebar, it can be used to hide/show sidebar or to check if sidebar is collapsable.
|
|
17
16
|
*/
|
|
18
17
|
let NgDocSidebarService = class NgDocSidebarService {
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
.pipe(filter((
|
|
18
|
+
constructor() {
|
|
19
|
+
this.expanded = new BehaviorSubject(false);
|
|
20
|
+
this.document = inject(DOCUMENT);
|
|
21
|
+
this.window = inject(WINDOW);
|
|
22
|
+
this.router = inject(Router);
|
|
23
|
+
this.scroll = inject(NgDocScrollService);
|
|
24
|
+
const windowResize = fromEvent(this.window, 'resize').pipe(takeUntilDestroyed(), startWith(null), share());
|
|
25
|
+
windowResize
|
|
26
|
+
.pipe(filter(() => this.expanded.value && this.isMobile), ngDocZoneOptimize(), takeUntilDestroyed())
|
|
27
|
+
.subscribe(() => this.hide());
|
|
28
|
+
windowResize
|
|
29
|
+
.pipe(filter(() => !this.expanded.value && !this.isMobile), ngDocZoneOptimize(), takeUntilDestroyed())
|
|
30
|
+
.subscribe(() => this.show());
|
|
31
|
+
windowResize
|
|
32
|
+
.pipe(filter(() => this.expanded.value && !this.isMobile), ngDocZoneOptimize(), takeUntilDestroyed())
|
|
33
|
+
.subscribe(() => this.scroll.unblock());
|
|
34
|
+
this.router.events
|
|
35
|
+
.pipe(filter((event) => event instanceof NavigationEnd && this.expanded.value && this.isMobile), takeUntilDestroyed())
|
|
31
36
|
.subscribe(() => this.hide());
|
|
32
|
-
this.isMobileMode()
|
|
33
|
-
.pipe(untilDestroyed(this))
|
|
34
|
-
.subscribe((isMobileMode) => {
|
|
35
|
-
if (isMobileMode) {
|
|
36
|
-
this.hide();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.show();
|
|
40
|
-
this.scroll.unblock();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*/
|
|
47
|
-
isMobileMode() {
|
|
48
|
-
return this.observer;
|
|
38
|
+
get isMobile() {
|
|
39
|
+
return this.window.innerWidth < 1024;
|
|
49
40
|
}
|
|
50
41
|
/**
|
|
51
42
|
* Indicates if sidebar is visible, based on the show/hide methods.
|
|
@@ -59,7 +50,7 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
59
50
|
show() {
|
|
60
51
|
if (!this.expanded.value) {
|
|
61
52
|
this.expanded.next(true);
|
|
62
|
-
this.scroll.block();
|
|
53
|
+
this.isMobile && this.scroll.block();
|
|
63
54
|
}
|
|
64
55
|
}
|
|
65
56
|
/**
|
|
@@ -68,7 +59,7 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
68
59
|
hide() {
|
|
69
60
|
if (this.expanded.value) {
|
|
70
61
|
this.expanded.next(false);
|
|
71
|
-
this.scroll.unblock();
|
|
62
|
+
this.isMobile && this.scroll.unblock();
|
|
72
63
|
}
|
|
73
64
|
}
|
|
74
65
|
/**
|
|
@@ -77,25 +68,19 @@ let NgDocSidebarService = class NgDocSidebarService {
|
|
|
77
68
|
toggle() {
|
|
78
69
|
this.expanded.value ? this.hide() : this.show();
|
|
79
70
|
}
|
|
80
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.
|
|
81
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocSidebarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
72
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocSidebarService, providedIn: 'root' }); }
|
|
82
73
|
};
|
|
83
74
|
NgDocSidebarService = __decorate([
|
|
84
75
|
UntilDestroy(),
|
|
85
|
-
__metadata("design:paramtypes", [
|
|
86
|
-
BreakpointObserver,
|
|
87
|
-
Router,
|
|
88
|
-
NgDocScrollService])
|
|
76
|
+
__metadata("design:paramtypes", [])
|
|
89
77
|
], NgDocSidebarService);
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgDocSidebarService, decorators: [{
|
|
91
79
|
type: Injectable,
|
|
92
80
|
args: [{
|
|
93
81
|
providedIn: 'root',
|
|
94
82
|
}]
|
|
95
|
-
}], ctorParameters: () => [
|
|
96
|
-
type: Inject,
|
|
97
|
-
args: [DOCUMENT]
|
|
98
|
-
}] }, { type: i1.BreakpointObserver }, { type: i2.Router }, { type: i3.NgDocScrollService }] });
|
|
83
|
+
}], ctorParameters: () => [] });
|
|
99
84
|
|
|
100
85
|
/**
|
|
101
86
|
* Generated bundle index. Do not edit.
|