@foblex/m-render 2.5.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/LICENSE +21 -0
- package/README.md +33 -0
- package/assets/fonts/inter-italic-latin-ext.woff2 +0 -0
- package/assets/fonts/inter-italic-latin.woff2 +0 -0
- package/assets/fonts/inter-roman-latin-ext.woff2 +0 -0
- package/assets/fonts/inter-roman-latin.woff2 +0 -0
- package/assets/styles/_alert.scss +50 -0
- package/assets/styles/_badge.scss +63 -0
- package/assets/styles/_button.scss +42 -0
- package/assets/styles/_code-group.scss +45 -0
- package/assets/styles/_code-highlight.scss +96 -0
- package/assets/styles/_code-view.scss +91 -0
- package/assets/styles/_doc-text.scss +124 -0
- package/assets/styles/_fonts.scss +41 -0
- package/assets/styles/_icons.scss +158 -0
- package/assets/styles/_preview-group.scss +11 -0
- package/assets/styles/_variables.scss +287 -0
- package/assets/styles/styles.scss +75 -0
- package/esm2022/foblex-m-render.mjs +5 -0
- package/esm2022/lib/common-services/analytics/f-accept-cookies-key.mjs +2 -0
- package/esm2022/lib/common-services/analytics/f-analytics.service.mjs +52 -0
- package/esm2022/lib/common-services/analytics/i-window-with-analytics.mjs +2 -0
- package/esm2022/lib/common-services/analytics/index.mjs +5 -0
- package/esm2022/lib/common-services/analytics/set-cookie-consent.mjs +32 -0
- package/esm2022/lib/common-services/f-head-tag.service.mjs +52 -0
- package/esm2022/lib/common-services/index.mjs +4 -0
- package/esm2022/lib/common-services/json-ld/f-json-ld.service.mjs +51 -0
- package/esm2022/lib/common-services/json-ld/i-json-ld-creator.mjs +2 -0
- package/esm2022/lib/common-services/json-ld/i-json-ld-entity-of-page.mjs +2 -0
- package/esm2022/lib/common-services/json-ld/i-json-ld.mjs +2 -0
- package/esm2022/lib/common-services/json-ld/index.mjs +5 -0
- package/esm2022/lib/domain/f-environment.service.mjs +66 -0
- package/esm2022/lib/domain/f-meta.service.mjs +77 -0
- package/esm2022/lib/domain/f-popover.service.mjs +25 -0
- package/esm2022/lib/domain/f-state.service.mjs +27 -0
- package/esm2022/lib/domain/features/get-version-handler/get-version.handler.mjs +27 -0
- package/esm2022/lib/domain/features/get-version-handler/get-version.request.mjs +6 -0
- package/esm2022/lib/domain/features/get-version-handler/index.mjs +3 -0
- package/esm2022/lib/domain/features/handle-navigation-links/handle-navigation-links.handler.mjs +51 -0
- package/esm2022/lib/domain/features/handle-navigation-links/handle-navigation-links.request.mjs +6 -0
- package/esm2022/lib/domain/features/handle-navigation-links/index.mjs +3 -0
- package/esm2022/lib/domain/features/index.mjs +3 -0
- package/esm2022/lib/domain/i-docs-component.mjs +2 -0
- package/esm2022/lib/domain/i-docs-environment.mjs +2 -0
- package/esm2022/lib/domain/i-docs-footer-navigation.mjs +2 -0
- package/esm2022/lib/domain/i-docs-header-navigation-item.mjs +2 -0
- package/esm2022/lib/domain/i-docs-social-link.mjs +2 -0
- package/esm2022/lib/domain/i-docs-table-of-content.mjs +2 -0
- package/esm2022/lib/domain/i-docs-version.mjs +2 -0
- package/esm2022/lib/domain/i-meta-data.mjs +2 -0
- package/esm2022/lib/domain/index.mjs +15 -0
- package/esm2022/lib/domain/providers.mjs +3 -0
- package/esm2022/lib/domain/router.mjs +13 -0
- package/esm2022/lib/f-documentation/f-badge/f-badge.component.mjs +22 -0
- package/esm2022/lib/f-documentation/f-badge/index.mjs +2 -0
- package/esm2022/lib/f-documentation/f-checkbox/f-checkbox.component.mjs +70 -0
- package/esm2022/lib/f-documentation/f-cookie-popup/f-cookie-popup.component.mjs +33 -0
- package/esm2022/lib/f-documentation/f-documentation.component.mjs +56 -0
- package/esm2022/lib/f-documentation/f-hamburger-button/f-hamburger-button.component.mjs +24 -0
- package/esm2022/lib/f-documentation/f-header/f-header.component.mjs +30 -0
- package/esm2022/lib/f-documentation/f-header-menu/f-header-menu.component.mjs +29 -0
- package/esm2022/lib/f-documentation/f-preview/f-preview.component.mjs +58 -0
- package/esm2022/lib/f-documentation/f-social-links/f-social-links.component.mjs +18 -0
- package/esm2022/lib/f-documentation/f-theme-button/f-theme-button.component.mjs +41 -0
- package/esm2022/lib/f-documentation/f-version/f-version.component.mjs +19 -0
- package/esm2022/lib/f-documentation/i-documentation-component.mjs +3 -0
- package/esm2022/lib/f-documentation/index.mjs +13 -0
- package/esm2022/lib/f-navigation-panel/domain/i-navigation-group.mjs +2 -0
- package/esm2022/lib/f-navigation-panel/domain/i-navigation-item-badge.mjs +2 -0
- package/esm2022/lib/f-navigation-panel/domain/i-navigation-item.mjs +2 -0
- package/esm2022/lib/f-navigation-panel/domain/index.mjs +4 -0
- package/esm2022/lib/f-navigation-panel/f-navigation-group/f-navigation-group.component.mjs +22 -0
- package/esm2022/lib/f-navigation-panel/f-navigation-header/f-navigation-header.component.mjs +24 -0
- package/esm2022/lib/f-navigation-panel/f-navigation-item/f-navigation-item.component.mjs +11 -0
- package/esm2022/lib/f-navigation-panel/f-navigation-panel.component.mjs +94 -0
- package/esm2022/lib/f-navigation-panel/index.mjs +6 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-dynamic-components/handle-dynamic-components.handler.mjs +102 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-dynamic-components/handle-dynamic-components.request.mjs +6 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-dynamic-components/index.mjs +3 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/handle-parsed-containers.handler.mjs +34 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/handle-parsed-containers.request.mjs +6 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/i-parsed-container.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/index.mjs +5 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/clipboard/copy-to-clipboard.mjs +15 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/clipboard/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-async-code-view-handler.mjs +46 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/f-code-group.handler.mjs +51 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/i-code-group-view.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/index.mjs +3 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group-body.handler.mjs +45 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-view-handler.mjs +60 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-example-view-handler.mjs +9 -0
- package/esm2022/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/index.mjs +7 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/change-code-focused-syntax.pre-processor.mjs +23 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/highlight.service.mjs +54 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/index.mjs +6 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/mark-code-focused-blocks.post-processor.mjs +52 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/modify-punctuation-highlight.post-processor.mjs +22 -0
- package/esm2022/lib/f-page/f-markdown/domain/highlight/separate-code-by-lines.post-processor.mjs +28 -0
- package/esm2022/lib/f-page/f-markdown/domain/index.mjs +5 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/index.mjs +4 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/markdown.service.mjs +65 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/e-markdown-container-type.mjs +13 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/i-markdown-it-token.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/index.mjs +8 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-alerts.mjs +19 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-code-group.mjs +54 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-code-view.mjs +15 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-example-group.mjs +92 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-preview-group.mjs +49 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/utils/get-content.mjs +17 -0
- package/esm2022/lib/f-page/f-markdown/domain/markdown/utils/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown/f-markdown-renderer.component.mjs +80 -0
- package/esm2022/lib/f-page/f-markdown/index.mjs +3 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.handler.mjs +36 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.request.mjs +6 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.response.mjs +7 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/index.mjs +4 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/features/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/i-page-link.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/domain/index.mjs +3 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-information.component.mjs +11 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-link/f-footer-edit-link.component.mjs +11 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-link/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-last-updated/f-footer-last-updated.component.mjs +11 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-last-updated/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-edit-information/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation-button/f-footer-navigation-button.component.mjs +17 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation-button/index.mjs +2 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation.component.mjs +11 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-footer-navigation/index.mjs +3 -0
- package/esm2022/lib/f-page/f-markdown-footer/f-markdown-footer.component.mjs +82 -0
- package/esm2022/lib/f-page/f-markdown-footer/index.mjs +5 -0
- package/esm2022/lib/f-page/f-page.component.mjs +18 -0
- package/esm2022/lib/f-page/f-table-of-content/f-table-of-content-items/f-table-of-content-items.component.mjs +16 -0
- package/esm2022/lib/f-page/f-table-of-content/f-table-of-content-items/index.mjs +2 -0
- package/esm2022/lib/f-page/f-table-of-content/f-table-of-content.component.mjs +63 -0
- package/esm2022/lib/f-page/f-table-of-content/index.mjs +3 -0
- package/esm2022/lib/f-page/index.mjs +5 -0
- package/esm2022/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/calculate-hash-from-scroll-position.handler.mjs +51 -0
- package/esm2022/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/calculate-hash-from-scroll-position.request.mjs +6 -0
- package/esm2022/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/index.mjs +3 -0
- package/esm2022/lib/f-scrollable-container/domain/get-absolute-top-to-container/get-absolute-top-to-container.handler.mjs +14 -0
- package/esm2022/lib/f-scrollable-container/domain/get-absolute-top-to-container/get-absolute-top-to-container.request.mjs +7 -0
- package/esm2022/lib/f-scrollable-container/domain/get-absolute-top-to-container/index.mjs +3 -0
- package/esm2022/lib/f-scrollable-container/domain/get-table-of-content-data/get-table-of-content-data.handler.mjs +52 -0
- package/esm2022/lib/f-scrollable-container/domain/get-table-of-content-data/get-table-of-content-data.request.mjs +7 -0
- package/esm2022/lib/f-scrollable-container/domain/get-table-of-content-data/index.mjs +3 -0
- package/esm2022/lib/f-scrollable-container/domain/i-table-of-content-item.mjs +2 -0
- package/esm2022/lib/f-scrollable-container/domain/index.mjs +7 -0
- package/esm2022/lib/f-scrollable-container/domain/scroll-to-element-in-container.mjs +34 -0
- package/esm2022/lib/f-scrollable-container/domain/table-of-content-data.mjs +7 -0
- package/esm2022/lib/f-scrollable-container/f-scrollable-container.component.mjs +30 -0
- package/esm2022/lib/f-scrollable-container/f-scrollable.service.mjs +57 -0
- package/esm2022/lib/f-scrollable-container/index.mjs +3 -0
- package/esm2022/lib/index.mjs +7 -0
- package/esm2022/public-api.mjs +2 -0
- package/fesm2022/foblex-m-render.mjs +2405 -0
- package/fesm2022/foblex-m-render.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/common-services/analytics/f-accept-cookies-key.d.ts +1 -0
- package/lib/common-services/analytics/f-analytics.service.d.ts +10 -0
- package/lib/common-services/analytics/i-window-with-analytics.d.ts +5 -0
- package/lib/common-services/analytics/index.d.ts +4 -0
- package/lib/common-services/analytics/set-cookie-consent.d.ts +6 -0
- package/lib/common-services/f-head-tag.service.d.ts +20 -0
- package/lib/common-services/index.d.ts +3 -0
- package/lib/common-services/json-ld/f-json-ld.service.d.ts +12 -0
- package/lib/common-services/json-ld/i-json-ld-creator.d.ts +7 -0
- package/lib/common-services/json-ld/i-json-ld-entity-of-page.d.ts +3 -0
- package/lib/common-services/json-ld/i-json-ld.d.ts +9 -0
- package/lib/common-services/json-ld/index.d.ts +4 -0
- package/lib/domain/f-environment.service.d.ts +23 -0
- package/lib/domain/f-meta.service.d.ts +20 -0
- package/lib/domain/f-popover.service.d.ts +10 -0
- package/lib/domain/f-state.service.d.ts +13 -0
- package/lib/domain/features/get-version-handler/get-version.handler.d.ts +13 -0
- package/lib/domain/features/get-version-handler/get-version.request.d.ts +5 -0
- package/lib/domain/features/get-version-handler/index.d.ts +2 -0
- package/lib/domain/features/handle-navigation-links/handle-navigation-links.handler.d.ts +19 -0
- package/lib/domain/features/handle-navigation-links/handle-navigation-links.request.d.ts +4 -0
- package/lib/domain/features/handle-navigation-links/index.d.ts +2 -0
- package/lib/domain/features/index.d.ts +2 -0
- package/lib/domain/i-docs-component.d.ts +5 -0
- package/lib/domain/i-docs-environment.d.ts +21 -0
- package/lib/domain/i-docs-footer-navigation.d.ts +8 -0
- package/lib/domain/i-docs-header-navigation-item.d.ts +5 -0
- package/lib/domain/i-docs-social-link.d.ts +4 -0
- package/lib/domain/i-docs-table-of-content.d.ts +7 -0
- package/lib/domain/i-docs-version.d.ts +4 -0
- package/lib/domain/i-meta-data.d.ts +12 -0
- package/lib/domain/index.d.ts +14 -0
- package/lib/domain/providers.d.ts +3 -0
- package/lib/domain/router.d.ts +2 -0
- package/lib/f-documentation/f-badge/f-badge.component.d.ts +7 -0
- package/lib/f-documentation/f-badge/index.d.ts +1 -0
- package/lib/f-documentation/f-checkbox/f-checkbox.component.d.ts +22 -0
- package/lib/f-documentation/f-cookie-popup/f-cookie-popup.component.d.ts +9 -0
- package/lib/f-documentation/f-documentation.component.d.ts +18 -0
- package/lib/f-documentation/f-hamburger-button/f-hamburger-button.component.d.ts +9 -0
- package/lib/f-documentation/f-header/f-header.component.d.ts +9 -0
- package/lib/f-documentation/f-header-menu/f-header-menu.component.d.ts +17 -0
- package/lib/f-documentation/f-preview/f-preview.component.d.ts +29 -0
- package/lib/f-documentation/f-social-links/f-social-links.component.d.ts +9 -0
- package/lib/f-documentation/f-theme-button/f-theme-button.component.d.ts +15 -0
- package/lib/f-documentation/f-version/f-version.component.d.ts +10 -0
- package/lib/f-documentation/i-documentation-component.d.ts +5 -0
- package/lib/f-documentation/index.d.ts +12 -0
- package/lib/f-navigation-panel/domain/i-navigation-group.d.ts +5 -0
- package/lib/f-navigation-panel/domain/i-navigation-item-badge.d.ts +4 -0
- package/lib/f-navigation-panel/domain/i-navigation-item.d.ts +13 -0
- package/lib/f-navigation-panel/domain/index.d.ts +3 -0
- package/lib/f-navigation-panel/f-navigation-group/f-navigation-group.component.d.ts +8 -0
- package/lib/f-navigation-panel/f-navigation-header/f-navigation-header.component.d.ts +12 -0
- package/lib/f-navigation-panel/f-navigation-item/f-navigation-item.component.d.ts +5 -0
- package/lib/f-navigation-panel/f-navigation-panel.component.d.ts +29 -0
- package/lib/f-navigation-panel/index.d.ts +5 -0
- package/lib/f-page/f-markdown/domain/handle-dynamic-components/handle-dynamic-components.handler.d.ts +26 -0
- package/lib/f-page/f-markdown/domain/handle-dynamic-components/handle-dynamic-components.request.d.ts +4 -0
- package/lib/f-page/f-markdown/domain/handle-dynamic-components/index.d.ts +2 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/handle-parsed-containers.handler.d.ts +16 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/handle-parsed-containers.request.d.ts +4 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/i-parsed-container.d.ts +3 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/index.d.ts +4 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/clipboard/copy-to-clipboard.d.ts +2 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/clipboard/index.d.ts +1 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-async-code-view-handler.d.ts +10 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/f-code-group.handler.d.ts +18 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/i-code-group-view.d.ts +3 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group/index.d.ts +2 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-group-body.handler.d.ts +15 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-code-view-handler.d.ts +21 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/f-example-view-handler.d.ts +6 -0
- package/lib/f-page/f-markdown/domain/handle-parsed-containers/pseudo-components/index.d.ts +6 -0
- package/lib/f-page/f-markdown/domain/highlight/change-code-focused-syntax.pre-processor.d.ts +7 -0
- package/lib/f-page/f-markdown/domain/highlight/highlight.service.d.ts +15 -0
- package/lib/f-page/f-markdown/domain/highlight/index.d.ts +5 -0
- package/lib/f-page/f-markdown/domain/highlight/mark-code-focused-blocks.post-processor.d.ts +14 -0
- package/lib/f-page/f-markdown/domain/highlight/modify-punctuation-highlight.post-processor.d.ts +6 -0
- package/lib/f-page/f-markdown/domain/highlight/separate-code-by-lines.post-processor.d.ts +9 -0
- package/lib/f-page/f-markdown/domain/index.d.ts +4 -0
- package/lib/f-page/f-markdown/domain/markdown/index.d.ts +3 -0
- package/lib/f-page/f-markdown/domain/markdown/markdown.service.d.ts +22 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/e-markdown-container-type.d.ts +11 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/i-markdown-it-token.d.ts +15 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/index.d.ts +7 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-alerts.d.ts +9 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-code-group.d.ts +17 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-code-view.d.ts +5 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-example-group.d.ts +21 -0
- package/lib/f-page/f-markdown/domain/markdown/parse-markdown/parse-preview-group.d.ts +17 -0
- package/lib/f-page/f-markdown/domain/markdown/utils/get-content.d.ts +2 -0
- package/lib/f-page/f-markdown/domain/markdown/utils/index.d.ts +1 -0
- package/lib/f-page/f-markdown/f-markdown-renderer.component.d.ts +25 -0
- package/lib/f-page/f-markdown/index.d.ts +2 -0
- package/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.handler.d.ts +9 -0
- package/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.request.d.ts +4 -0
- package/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/get-previous-next-page-navigation.response.d.ts +6 -0
- package/lib/f-page/f-markdown-footer/domain/features/get-previous-next-page-navigation/index.d.ts +3 -0
- package/lib/f-page/f-markdown-footer/domain/features/index.d.ts +1 -0
- package/lib/f-page/f-markdown-footer/domain/i-page-link.d.ts +4 -0
- package/lib/f-page/f-markdown-footer/domain/index.d.ts +2 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-information.component.d.ts +5 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-link/f-footer-edit-link.component.d.ts +5 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-edit-link/index.d.ts +1 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-last-updated/f-footer-last-updated.component.d.ts +5 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/f-footer-last-updated/index.d.ts +1 -0
- package/lib/f-page/f-markdown-footer/f-footer-edit-information/index.d.ts +1 -0
- package/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation-button/f-footer-navigation-button.component.d.ts +8 -0
- package/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation-button/index.d.ts +1 -0
- package/lib/f-page/f-markdown-footer/f-footer-navigation/f-footer-navigation.component.d.ts +5 -0
- package/lib/f-page/f-markdown-footer/f-footer-navigation/index.d.ts +2 -0
- package/lib/f-page/f-markdown-footer/f-markdown-footer.component.d.ts +29 -0
- package/lib/f-page/f-markdown-footer/index.d.ts +4 -0
- package/lib/f-page/f-page.component.d.ts +5 -0
- package/lib/f-page/f-table-of-content/f-table-of-content-items/f-table-of-content-items.component.d.ts +7 -0
- package/lib/f-page/f-table-of-content/f-table-of-content-items/index.d.ts +1 -0
- package/lib/f-page/f-table-of-content/f-table-of-content.component.d.ts +28 -0
- package/lib/f-page/f-table-of-content/index.d.ts +2 -0
- package/lib/f-page/index.d.ts +4 -0
- package/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/calculate-hash-from-scroll-position.handler.d.ts +15 -0
- package/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/calculate-hash-from-scroll-position.request.d.ts +5 -0
- package/lib/f-scrollable-container/domain/calculate-hash-from-scroll-position/index.d.ts +2 -0
- package/lib/f-scrollable-container/domain/get-absolute-top-to-container/get-absolute-top-to-container.handler.d.ts +5 -0
- package/lib/f-scrollable-container/domain/get-absolute-top-to-container/get-absolute-top-to-container.request.d.ts +5 -0
- package/lib/f-scrollable-container/domain/get-absolute-top-to-container/index.d.ts +2 -0
- package/lib/f-scrollable-container/domain/get-table-of-content-data/get-table-of-content-data.handler.d.ts +11 -0
- package/lib/f-scrollable-container/domain/get-table-of-content-data/get-table-of-content-data.request.d.ts +11 -0
- package/lib/f-scrollable-container/domain/get-table-of-content-data/index.d.ts +2 -0
- package/lib/f-scrollable-container/domain/i-table-of-content-item.d.ts +7 -0
- package/lib/f-scrollable-container/domain/index.d.ts +6 -0
- package/lib/f-scrollable-container/domain/scroll-to-element-in-container.d.ts +12 -0
- package/lib/f-scrollable-container/domain/table-of-content-data.d.ts +6 -0
- package/lib/f-scrollable-container/f-scrollable-container.component.d.ts +13 -0
- package/lib/f-scrollable-container/f-scrollable.service.d.ts +25 -0
- package/lib/f-scrollable-container/index.d.ts +2 -0
- package/lib/index.d.ts +6 -0
- package/package.json +49 -0
- package/public-api.d.ts +1 -0
@@ -0,0 +1,2405 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, Injectable, Inject, Optional, InjectionToken, Component, ChangeDetectionStrategy, Input, EventEmitter, booleanAttribute, Output, ViewChild, HostListener, signal, ViewChildren, ViewContainerRef, ElementRef } from '@angular/core';
|
3
|
+
import * as i2 from '@foblex/platform';
|
4
|
+
import { F_LOCAL_STORAGE } from '@foblex/platform';
|
5
|
+
import { DOCUMENT, ɵgetDOM as _getDOM, AsyncPipe, NgOptimizedImage, JsonPipe } from '@angular/common';
|
6
|
+
import { of, map, startWith, filter, BehaviorSubject, Subject, Subscription, fromEvent, debounceTime, from, switchMap, Observable } from 'rxjs';
|
7
|
+
import { catchError, filter as filter$1, take, tap } from 'rxjs/operators';
|
8
|
+
import * as i1 from '@angular/router';
|
9
|
+
import { NavigationEnd, RouterLink, RouterOutlet, Router, ActivatedRoute } from '@angular/router';
|
10
|
+
import * as i1$1 from '@angular/common/http';
|
11
|
+
import { HttpClient } from '@angular/common/http';
|
12
|
+
import { deepClone } from '@foblex/utils';
|
13
|
+
import container from 'markdown-it-container';
|
14
|
+
import MarkdownIt from 'markdown-it';
|
15
|
+
import * as i2$1 from '@angular/platform-browser';
|
16
|
+
|
17
|
+
const F_ACCEPT_COOKIES_KEY = 'm-render-accepts-cookies';
|
18
|
+
|
19
|
+
const setCookieConsent = (state) => {
|
20
|
+
try {
|
21
|
+
if (window.gtag) {
|
22
|
+
const consentOptions = {
|
23
|
+
ad_user_data: state,
|
24
|
+
ad_personalization: state,
|
25
|
+
ad_storage: state,
|
26
|
+
analytics_storage: state,
|
27
|
+
};
|
28
|
+
if (state === 'denied') {
|
29
|
+
window.gtag('consent', 'default', {
|
30
|
+
...consentOptions,
|
31
|
+
wait_for_update: 500,
|
32
|
+
});
|
33
|
+
}
|
34
|
+
else if (state === 'granted') {
|
35
|
+
window.gtag('consent', 'update', {
|
36
|
+
...consentOptions,
|
37
|
+
});
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
catch {
|
42
|
+
if (state === 'denied') {
|
43
|
+
console.error('Unable to set default cookie consent.');
|
44
|
+
}
|
45
|
+
else if (state === 'granted') {
|
46
|
+
console.error('Unable to grant cookie consent.');
|
47
|
+
}
|
48
|
+
}
|
49
|
+
};
|
50
|
+
|
51
|
+
class FAnalyticsService {
|
52
|
+
constructor() {
|
53
|
+
this.fLocalStorage = inject(F_LOCAL_STORAGE);
|
54
|
+
this.document = inject(DOCUMENT);
|
55
|
+
}
|
56
|
+
initialize(analyticsId) {
|
57
|
+
this.installGlobalSiteTag(analyticsId);
|
58
|
+
}
|
59
|
+
installGlobalSiteTag(analyticsId) {
|
60
|
+
const window = this.document.defaultView;
|
61
|
+
window.dataLayer = window.dataLayer || [];
|
62
|
+
window.gtag = function () {
|
63
|
+
window.dataLayer?.push(arguments);
|
64
|
+
};
|
65
|
+
if (this.fLocalStorage) {
|
66
|
+
if (this.fLocalStorage.getItem(F_ACCEPT_COOKIES_KEY) === 'true') {
|
67
|
+
setCookieConsent('granted');
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
setCookieConsent('denied');
|
71
|
+
}
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
setCookieConsent('denied');
|
75
|
+
}
|
76
|
+
window.gtag('js', new Date());
|
77
|
+
window.gtag('config', analyticsId);
|
78
|
+
if (this.document.querySelector('#gtag-script') === null) {
|
79
|
+
this.document.head.appendChild(this.getGtmScript(analyticsId));
|
80
|
+
}
|
81
|
+
}
|
82
|
+
getGtmScript(analyticsId) {
|
83
|
+
const gtmScript = this.document.createElement('script');
|
84
|
+
gtmScript.async = true;
|
85
|
+
gtmScript.src = `https://www.googletagmanager.com/gtag/js?id=${analyticsId}`;
|
86
|
+
gtmScript.id = 'gtag-script';
|
87
|
+
return gtmScript;
|
88
|
+
}
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FAnalyticsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
90
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FAnalyticsService, providedIn: 'root' }); }
|
91
|
+
}
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FAnalyticsService, decorators: [{
|
93
|
+
type: Injectable,
|
94
|
+
args: [{ providedIn: 'root' }]
|
95
|
+
}] });
|
96
|
+
|
97
|
+
class FJsonLdService {
|
98
|
+
constructor(_document) {
|
99
|
+
this._document = _document;
|
100
|
+
this._dom = _getDOM();
|
101
|
+
}
|
102
|
+
update(data) {
|
103
|
+
this.cleanup();
|
104
|
+
const script = this.createScript();
|
105
|
+
script.type = 'application/ld+json';
|
106
|
+
script.text = JSON.stringify({
|
107
|
+
"@context": "https://schema.org",
|
108
|
+
"@type": "WebSite",
|
109
|
+
"name": data.name,
|
110
|
+
"url": data.url,
|
111
|
+
"description": data.description,
|
112
|
+
"creator": {
|
113
|
+
"@type": "Organization",
|
114
|
+
"name": data.creator.name,
|
115
|
+
"url": data.creator.url,
|
116
|
+
"logo": data.creator.logo,
|
117
|
+
"sameAs": data.creator.sameAs
|
118
|
+
},
|
119
|
+
"mainEntityOfPage": {
|
120
|
+
"@type": "WebPage",
|
121
|
+
"@id": data.mainEntityOfPage.id
|
122
|
+
}
|
123
|
+
});
|
124
|
+
}
|
125
|
+
cleanup() {
|
126
|
+
this._document.querySelectorAll(`script[type="application/ld+json"]`).forEach((x) => x.remove());
|
127
|
+
}
|
128
|
+
createScript() {
|
129
|
+
const element = this._dom.createElement('script');
|
130
|
+
const head = this._document.getElementsByTagName('head')[0];
|
131
|
+
head.appendChild(element);
|
132
|
+
return element;
|
133
|
+
}
|
134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FJsonLdService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
135
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FJsonLdService, providedIn: 'root' }); }
|
136
|
+
}
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FJsonLdService, decorators: [{
|
138
|
+
type: Injectable,
|
139
|
+
args: [{ providedIn: 'root' }]
|
140
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
141
|
+
type: Inject,
|
142
|
+
args: [DOCUMENT]
|
143
|
+
}] }] });
|
144
|
+
|
145
|
+
class FHeadTagService {
|
146
|
+
constructor(_document) {
|
147
|
+
this._document = _document;
|
148
|
+
this._dom = _getDOM();
|
149
|
+
}
|
150
|
+
setTitle(title) {
|
151
|
+
this._document.title = title || '';
|
152
|
+
}
|
153
|
+
setDescription(description) {
|
154
|
+
const meta = this.getDescription() || this.createElement('meta');
|
155
|
+
meta.setAttribute('name', 'description');
|
156
|
+
meta.setAttribute('content', description);
|
157
|
+
}
|
158
|
+
getDescription() {
|
159
|
+
return this._document.querySelector(`meta[name="description"]`) || null;
|
160
|
+
}
|
161
|
+
setCanonical(url) {
|
162
|
+
const link = this.getCanonical() || this.createElement('link');
|
163
|
+
link.setAttribute('rel', 'canonical');
|
164
|
+
link.setAttribute('href', url);
|
165
|
+
}
|
166
|
+
getCanonical() {
|
167
|
+
return this._document.querySelector(`link[rel="canonical"]`) || null;
|
168
|
+
}
|
169
|
+
updateTag(tag) {
|
170
|
+
const meta = this.getMetaTag(tag) || this.createElement('meta');
|
171
|
+
meta.setAttribute('property', tag.property);
|
172
|
+
meta.setAttribute('content', tag.content);
|
173
|
+
}
|
174
|
+
getMetaTag(tag) {
|
175
|
+
return this._document.querySelector(`meta[property="${tag.property}"]`) || null;
|
176
|
+
}
|
177
|
+
createElement(tag) {
|
178
|
+
const element = this._dom.createElement(tag);
|
179
|
+
const head = this._document.getElementsByTagName('head')[0];
|
180
|
+
head.appendChild(element);
|
181
|
+
return element;
|
182
|
+
}
|
183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeadTagService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
184
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeadTagService, providedIn: 'root' }); }
|
185
|
+
}
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeadTagService, decorators: [{
|
187
|
+
type: Injectable,
|
188
|
+
args: [{ providedIn: 'root' }]
|
189
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
190
|
+
type: Inject,
|
191
|
+
args: [DOCUMENT]
|
192
|
+
}] }] });
|
193
|
+
|
194
|
+
class GetVersionRequest {
|
195
|
+
constructor(version) {
|
196
|
+
this.version = version;
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
class GetVersionHandler {
|
201
|
+
constructor(http) {
|
202
|
+
this.http = http;
|
203
|
+
}
|
204
|
+
handle(request) {
|
205
|
+
return this.getLocalVersion(request.version) || this.getNpmVersion(request.version);
|
206
|
+
}
|
207
|
+
getLocalVersion(version) {
|
208
|
+
return !!version?.value ? of(version?.value) : undefined;
|
209
|
+
}
|
210
|
+
getNpmPackage(version) {
|
211
|
+
return version?.npmPackage;
|
212
|
+
}
|
213
|
+
getNpmVersion(version) {
|
214
|
+
const packageName = this.getNpmPackage(version);
|
215
|
+
if (!packageName) {
|
216
|
+
return of(undefined);
|
217
|
+
}
|
218
|
+
return this.http.get(this.getNpmRegistry(packageName)).pipe(map((response) => response['dist-tags']?.latest), catchError(() => of(undefined)));
|
219
|
+
}
|
220
|
+
getNpmRegistry(name) {
|
221
|
+
return `https://registry.npmjs.org/${encodeURIComponent(name)}`;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
class HandleNavigationLinksHandler {
|
226
|
+
constructor(router, fBrowser) {
|
227
|
+
this.router = router;
|
228
|
+
this.fBrowser = fBrowser;
|
229
|
+
}
|
230
|
+
handle(request) {
|
231
|
+
const target = request.event.target;
|
232
|
+
if (this.isAnchorTag(target) && this.hasHref(target)) {
|
233
|
+
const href = target.getAttribute('href');
|
234
|
+
request.event.preventDefault();
|
235
|
+
if (!this.isExternalLink(href)) {
|
236
|
+
this.navigateInternalLink(href);
|
237
|
+
}
|
238
|
+
else {
|
239
|
+
this.openExternalLink(href);
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}
|
243
|
+
isAnchorTag(element) {
|
244
|
+
return element.tagName === 'A';
|
245
|
+
}
|
246
|
+
hasHref(element) {
|
247
|
+
return element.hasAttribute('href');
|
248
|
+
}
|
249
|
+
isExternalLink(href) {
|
250
|
+
return href.startsWith('www') || href.startsWith('http');
|
251
|
+
}
|
252
|
+
navigateInternalLink(href) {
|
253
|
+
if (href.startsWith('/')) {
|
254
|
+
href = href.substring(1);
|
255
|
+
}
|
256
|
+
this.router.navigate([href]).then();
|
257
|
+
}
|
258
|
+
replaceAfterLastSlash(input, replacement) {
|
259
|
+
const lastSlashIndex = input.lastIndexOf('/');
|
260
|
+
return lastSlashIndex !== -1 ? input.substring(0, lastSlashIndex + 1) + replacement : input;
|
261
|
+
}
|
262
|
+
openExternalLink(href) {
|
263
|
+
this.fBrowser.window.open(href, '_blank');
|
264
|
+
}
|
265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleNavigationLinksHandler, deps: [{ token: i1.Router }, { token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
266
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleNavigationLinksHandler }); }
|
267
|
+
}
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleNavigationLinksHandler, decorators: [{
|
269
|
+
type: Injectable
|
270
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.BrowserService }] });
|
271
|
+
|
272
|
+
class HandleNavigationLinksRequest {
|
273
|
+
constructor(event) {
|
274
|
+
this.event = event;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
class FEnvironmentService {
|
279
|
+
constructor(environment, http) {
|
280
|
+
this.environment = environment;
|
281
|
+
this.http = http;
|
282
|
+
}
|
283
|
+
getMarkdownUrl(markdown) {
|
284
|
+
if (!markdown || !this.isMarkdownExist(markdown)) {
|
285
|
+
return this.environment.notFoundMD;
|
286
|
+
}
|
287
|
+
let url = this.environment.docsDir + markdown;
|
288
|
+
url = url.replace(/(\/en\/guides)+/g, '/en/guides');
|
289
|
+
url = url.replace(/(\/en\/examples)+/g, '/en/examples');
|
290
|
+
if (!url.endsWith('.md')) {
|
291
|
+
url += '.md';
|
292
|
+
}
|
293
|
+
return url;
|
294
|
+
}
|
295
|
+
isMarkdownExist(id) {
|
296
|
+
return !!this.environment.navigation.find((x) => x.items.some((i) => i.link === id));
|
297
|
+
}
|
298
|
+
getLogo() {
|
299
|
+
return this.environment.logo;
|
300
|
+
}
|
301
|
+
getTitle() {
|
302
|
+
return this.environment.title;
|
303
|
+
}
|
304
|
+
getHeaderNavigation() {
|
305
|
+
return this.environment.headerNavigation || [];
|
306
|
+
}
|
307
|
+
getVersion() {
|
308
|
+
return new GetVersionHandler(this.http).handle(new GetVersionRequest(this.environment.version));
|
309
|
+
}
|
310
|
+
getComponents() {
|
311
|
+
return this.environment.components || [];
|
312
|
+
}
|
313
|
+
getNavigation() {
|
314
|
+
return this.environment.navigation;
|
315
|
+
}
|
316
|
+
getFooterNavigation() {
|
317
|
+
return this.environment.footerNavigation || {};
|
318
|
+
}
|
319
|
+
getSocialLinks() {
|
320
|
+
return this.environment.socialLinks || [];
|
321
|
+
}
|
322
|
+
getToC() {
|
323
|
+
return this.environment.toC || {
|
324
|
+
title: 'In this article',
|
325
|
+
range: { start: 2, end: 6 },
|
326
|
+
};
|
327
|
+
}
|
328
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FEnvironmentService, deps: [{ token: F_ENVIRONMENT, optional: true }, { token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
329
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FEnvironmentService }); }
|
330
|
+
}
|
331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FEnvironmentService, decorators: [{
|
332
|
+
type: Injectable
|
333
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
334
|
+
type: Optional
|
335
|
+
}, {
|
336
|
+
type: Inject,
|
337
|
+
args: [F_ENVIRONMENT]
|
338
|
+
}] }, { type: i1$1.HttpClient }] });
|
339
|
+
|
340
|
+
class FMetaService {
|
341
|
+
constructor(router, fHeadTag, fBrowser) {
|
342
|
+
this.router = router;
|
343
|
+
this.fHeadTag = fHeadTag;
|
344
|
+
this.fBrowser = fBrowser;
|
345
|
+
this.navigation = [];
|
346
|
+
}
|
347
|
+
subscribeOnRouteChanges(defaultData, environments) {
|
348
|
+
this.navigation = environments.reduce((result, e) => result.concat(...e.navigation), []);
|
349
|
+
return this.router.events.pipe(startWith(new NavigationEnd(1, '', '')), filter(event => event instanceof NavigationEnd)).subscribe((x) => {
|
350
|
+
let data = {
|
351
|
+
...defaultData,
|
352
|
+
};
|
353
|
+
const item = this.findDocItemByUrl(this.findDocGroupByUrl(this.router.url), this.router.url);
|
354
|
+
if (item) {
|
355
|
+
data.title = `${item.text} - ${defaultData.app_name}`;
|
356
|
+
data.url = this.fBrowser.window.location.href;
|
357
|
+
data.description = item.description || defaultData.description;
|
358
|
+
data.image = item.image || defaultData.image;
|
359
|
+
data.image_width = item.image_width || defaultData.image_width;
|
360
|
+
data.image_height = item.image_height || defaultData.image_height;
|
361
|
+
data.image_type = item.image_type || defaultData.image_type;
|
362
|
+
}
|
363
|
+
if (!data.url) {
|
364
|
+
data.url = this.fBrowser.window.location.origin + this.router.url;
|
365
|
+
}
|
366
|
+
if (!data.image.startsWith('http') && !data.image.startsWith('www')) {
|
367
|
+
if (data.image.startsWith('.')) {
|
368
|
+
data.image = this.fBrowser.window.location.origin + data.image.slice(1);
|
369
|
+
}
|
370
|
+
else {
|
371
|
+
data.image = this.fBrowser.window.location.origin + data.image;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
if (!data.url.endsWith('/')) {
|
375
|
+
data.url += '/';
|
376
|
+
}
|
377
|
+
this.updateMetaTags(data);
|
378
|
+
});
|
379
|
+
}
|
380
|
+
findDocGroupByUrl(url) {
|
381
|
+
return this.navigation.find((g) => g.items.find((i) => url.endsWith(i.link)));
|
382
|
+
}
|
383
|
+
findDocItemByUrl(group, url) {
|
384
|
+
return (group?.items || []).find((i) => url.endsWith(i.link));
|
385
|
+
}
|
386
|
+
updateMetaTags(item) {
|
387
|
+
this.fHeadTag.setTitle(item.title);
|
388
|
+
this.fHeadTag.setDescription(item.description);
|
389
|
+
this.fHeadTag.setCanonical(item.url);
|
390
|
+
this.fHeadTag.updateTag({ property: 'og:url', content: item.url });
|
391
|
+
this.fHeadTag.updateTag({ property: 'og:type', content: item.type });
|
392
|
+
this.fHeadTag.updateTag({ property: 'og:title', content: item.title });
|
393
|
+
this.fHeadTag.updateTag({ property: 'og:site_name', content: item.title });
|
394
|
+
this.fHeadTag.updateTag({ property: 'og:locale', content: item.locale });
|
395
|
+
this.fHeadTag.updateTag({ property: 'og:description', content: item.description });
|
396
|
+
this.fHeadTag.updateTag({ property: 'og:image', content: item.image });
|
397
|
+
this.fHeadTag.updateTag({ property: 'og:image:secure_url', content: item.image });
|
398
|
+
this.fHeadTag.updateTag({ property: 'og:image:type', content: item.image_type });
|
399
|
+
this.fHeadTag.updateTag({ property: 'og:image:width', content: item.image_width.toString() });
|
400
|
+
this.fHeadTag.updateTag({ property: 'og:image:height', content: item.image_height.toString() });
|
401
|
+
}
|
402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMetaService, deps: [{ token: i1.Router }, { token: FHeadTagService }, { token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
403
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMetaService, providedIn: 'root' }); }
|
404
|
+
}
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMetaService, decorators: [{
|
406
|
+
type: Injectable,
|
407
|
+
args: [{ providedIn: 'root' }]
|
408
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: FHeadTagService }, { type: i2.BrowserService }] });
|
409
|
+
|
410
|
+
class FPopoverService {
|
411
|
+
constructor() {
|
412
|
+
this.popover = new BehaviorSubject(null);
|
413
|
+
}
|
414
|
+
get popover$() {
|
415
|
+
return this.popover.asObservable();
|
416
|
+
}
|
417
|
+
show(message) {
|
418
|
+
this.popover.next(message);
|
419
|
+
setTimeout(() => this.popover.next(null), 2000);
|
420
|
+
}
|
421
|
+
dispose() {
|
422
|
+
this.popover.next(null);
|
423
|
+
this.popover.complete();
|
424
|
+
}
|
425
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
426
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPopoverService }); }
|
427
|
+
}
|
428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPopoverService, decorators: [{
|
429
|
+
type: Injectable
|
430
|
+
}] });
|
431
|
+
|
432
|
+
const F_ENVIRONMENT = new InjectionToken('F_ENVIRONMENT');
|
433
|
+
|
434
|
+
const F_DOCUMENTATION_ROUTES = [
|
435
|
+
{
|
436
|
+
path: '',
|
437
|
+
loadComponent: () => Promise.resolve().then(function () { return index$1; }).then(m => m.FDocumentationComponent),
|
438
|
+
children: [
|
439
|
+
{
|
440
|
+
path: '**',
|
441
|
+
loadComponent: () => Promise.resolve().then(function () { return index; }).then(m => m.FPageComponent)
|
442
|
+
}
|
443
|
+
]
|
444
|
+
}
|
445
|
+
];
|
446
|
+
|
447
|
+
class FBadgeComponent {
|
448
|
+
constructor() {
|
449
|
+
this.text = '';
|
450
|
+
this.type = 'tip';
|
451
|
+
}
|
452
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
453
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FBadgeComponent, isStandalone: true, selector: "span[f-badge]", inputs: { text: "text", type: "type" }, host: { properties: { "class": "type" }, classAttribute: "f-badge" }, ngImport: i0, template: "{{ text }}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
454
|
+
}
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FBadgeComponent, decorators: [{
|
456
|
+
type: Component,
|
457
|
+
args: [{ selector: 'span[f-badge]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
458
|
+
'class': 'f-badge',
|
459
|
+
'[class]': 'type',
|
460
|
+
}, template: "{{ text }}\n" }]
|
461
|
+
}], propDecorators: { text: [{
|
462
|
+
type: Input
|
463
|
+
}], type: [{
|
464
|
+
type: Input
|
465
|
+
}] } });
|
466
|
+
|
467
|
+
let uniqueId = 0;
|
468
|
+
class FCheckboxComponent {
|
469
|
+
get checked() {
|
470
|
+
return this.isChecked;
|
471
|
+
}
|
472
|
+
set checked(value) {
|
473
|
+
if (value != this.checked) {
|
474
|
+
this.isChecked = value;
|
475
|
+
this.changeDetectorRef.markForCheck();
|
476
|
+
}
|
477
|
+
}
|
478
|
+
constructor(changeDetectorRef) {
|
479
|
+
this.changeDetectorRef = changeDetectorRef;
|
480
|
+
this.id = `f-checkbox-${uniqueId++}`;
|
481
|
+
this.change = new EventEmitter();
|
482
|
+
this.isChecked = false;
|
483
|
+
}
|
484
|
+
onInputClick() {
|
485
|
+
this.handleInputClick();
|
486
|
+
}
|
487
|
+
onTouchTargetClick() {
|
488
|
+
this.handleInputClick();
|
489
|
+
this.inputElement?.nativeElement.focus();
|
490
|
+
}
|
491
|
+
handleInputClick() {
|
492
|
+
this.isChecked = !this.isChecked;
|
493
|
+
this.emitChangeEvent();
|
494
|
+
}
|
495
|
+
emitChangeEvent() {
|
496
|
+
this.change.emit(this.isChecked);
|
497
|
+
if (this.inputElement) {
|
498
|
+
this.inputElement.nativeElement.checked = this.isChecked;
|
499
|
+
}
|
500
|
+
}
|
501
|
+
onInteractionEvent(event) {
|
502
|
+
event.stopPropagation();
|
503
|
+
}
|
504
|
+
preventBubblingFromLabel(event) {
|
505
|
+
if (!!event.target && this.labelElement?.nativeElement.contains(event.target)) {
|
506
|
+
event.stopPropagation();
|
507
|
+
}
|
508
|
+
}
|
509
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FCheckboxComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
510
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.12", type: FCheckboxComponent, isStandalone: true, selector: "f-checkbox", inputs: { id: "id", checked: ["checked", "checked", booleanAttribute] }, outputs: { change: "change" }, host: { listeners: { "click": "preventBubblingFromLabel($event)" }, properties: { "class.f-checkbox-checked": "checked" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true }, { propertyName: "labelElement", first: true, predicate: ["label"], descendants: true }], ngImport: i0, template: "<input #input\n [id]=\"id\"\n type=\"checkbox\"\n [checked]=\"checked\"\n (click)=\"onInputClick()\"\n (change)=\"onInteractionEvent($event)\"/>\n<div class=\"f-checkbox-container\" (click)=\"onTouchTargetClick()\">\n <svg class=\"f-checkbox-checkmark\" focusable=\"false\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path class=\"f-checkbox-checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n </svg>\n</div>\n<label [for]=\"id\" #label>\n <ng-content></ng-content>\n</label>\n", styles: [":host{position:relative;display:flex;align-items:center;font-weight:400;white-space:nowrap;font-size:14px;cursor:pointer;background-color:var(--checkbox-container-background);border-radius:var(--checkbox-border-radius);padding:0 8px;color:var(--checkbox-text);transition:color .25s,background-color .25s}:host input{position:absolute;inset:0;opacity:0;cursor:pointer}:host .f-checkbox-container{position:relative;display:flex;align-items:center;justify-content:center;width:var(--checkbox-size);height:var(--checkbox-size);margin-right:6px;border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background);padding:2px}:host .f-checkbox-container .f-checkbox-checkmark{position:absolute;top:calc(var(--checkbox-size) / 8);right:calc(var(--checkbox-size) / 8);bottom:calc(var(--checkbox-size) / 8);left:calc(var(--checkbox-size) / 8);opacity:0}:host .f-checkbox-container .f-checkbox-checkmark .f-checkbox-checkmark-path{stroke:currentColor;stroke-width:3}:host label{-webkit-user-select:none;user-select:none}:host.f-checkbox-checked .f-checkbox-container{background-color:var(--checkbox-checked-background)}:host.f-checkbox-checked .f-checkbox-container .f-checkbox-checkmark{color:var(--checkbox-checkmark-color);opacity:1}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
511
|
+
}
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FCheckboxComponent, decorators: [{
|
513
|
+
type: Component,
|
514
|
+
args: [{ selector: 'f-checkbox', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
515
|
+
'[class.f-checkbox-checked]': 'checked',
|
516
|
+
}, template: "<input #input\n [id]=\"id\"\n type=\"checkbox\"\n [checked]=\"checked\"\n (click)=\"onInputClick()\"\n (change)=\"onInteractionEvent($event)\"/>\n<div class=\"f-checkbox-container\" (click)=\"onTouchTargetClick()\">\n <svg class=\"f-checkbox-checkmark\" focusable=\"false\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path class=\"f-checkbox-checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n </svg>\n</div>\n<label [for]=\"id\" #label>\n <ng-content></ng-content>\n</label>\n", styles: [":host{position:relative;display:flex;align-items:center;font-weight:400;white-space:nowrap;font-size:14px;cursor:pointer;background-color:var(--checkbox-container-background);border-radius:var(--checkbox-border-radius);padding:0 8px;color:var(--checkbox-text);transition:color .25s,background-color .25s}:host input{position:absolute;inset:0;opacity:0;cursor:pointer}:host .f-checkbox-container{position:relative;display:flex;align-items:center;justify-content:center;width:var(--checkbox-size);height:var(--checkbox-size);margin-right:6px;border-radius:var(--checkbox-border-radius);background-color:var(--checkbox-background);padding:2px}:host .f-checkbox-container .f-checkbox-checkmark{position:absolute;top:calc(var(--checkbox-size) / 8);right:calc(var(--checkbox-size) / 8);bottom:calc(var(--checkbox-size) / 8);left:calc(var(--checkbox-size) / 8);opacity:0}:host .f-checkbox-container .f-checkbox-checkmark .f-checkbox-checkmark-path{stroke:currentColor;stroke-width:3}:host label{-webkit-user-select:none;user-select:none}:host.f-checkbox-checked .f-checkbox-container{background-color:var(--checkbox-checked-background)}:host.f-checkbox-checked .f-checkbox-container .f-checkbox-checkmark{color:var(--checkbox-checkmark-color);opacity:1}\n"] }]
|
517
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
518
|
+
type: Input
|
519
|
+
}], change: [{
|
520
|
+
type: Output
|
521
|
+
}], inputElement: [{
|
522
|
+
type: ViewChild,
|
523
|
+
args: ['input']
|
524
|
+
}], labelElement: [{
|
525
|
+
type: ViewChild,
|
526
|
+
args: ['label']
|
527
|
+
}], checked: [{
|
528
|
+
type: Input,
|
529
|
+
args: [{ transform: booleanAttribute }]
|
530
|
+
}], preventBubblingFromLabel: [{
|
531
|
+
type: HostListener,
|
532
|
+
args: ['click', ['$event']]
|
533
|
+
}] } });
|
534
|
+
|
535
|
+
class CookiePopup {
|
536
|
+
constructor() {
|
537
|
+
this.fLocalStorage = inject(F_LOCAL_STORAGE);
|
538
|
+
this.hasAccepted = signal(false);
|
539
|
+
try {
|
540
|
+
this.hasAccepted.set(this.fLocalStorage?.getItem(F_ACCEPT_COOKIES_KEY) === 'true');
|
541
|
+
}
|
542
|
+
catch {
|
543
|
+
this.hasAccepted.set(false);
|
544
|
+
}
|
545
|
+
}
|
546
|
+
accept() {
|
547
|
+
try {
|
548
|
+
this.fLocalStorage?.setItem(F_ACCEPT_COOKIES_KEY, 'true');
|
549
|
+
}
|
550
|
+
catch {
|
551
|
+
}
|
552
|
+
this.hasAccepted.set(true);
|
553
|
+
setCookieConsent('granted');
|
554
|
+
}
|
555
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CookiePopup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
556
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: CookiePopup, isStandalone: true, selector: "f-cookie-popup", ngImport: i0, template: "@if (!hasAccepted()) {\n <div class=\"docs-cookies-popup docs-invert-mode\">\n <p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>\n\n <div>\n <a href=\"https://policies.google.com/technologies/cookies\" target=\"_blank\" rel=\"noopener\">\n <button class=\"f-button\" [attr.text]=\"'Learn more'\" aria-label=\"Learn More\">\n Learn more\n </button>\n </a>\n <button\n (click)=\"accept()\"\n class=\"f-button\"\n [attr.text]=\"'Ok, Got it'\"\n aria-label=\"Ok, Got it\">\n Ok, Got it\n </button>\n </div>\n </div>\n}\n", styles: [":host{position:fixed;bottom:16px;right:16px;z-index:99999;opacity:0;visibility:hidden;animation:1s linear forwards .5s fadeIn}.docs-cookies-popup{padding:1rem;background-color:var(--background-color);border:1px solid var(--divider-color);color:var(--primary-text);border-radius:var(--border-radius);font-size:14px;max-width:310px;transition:background-color .3s ease,border-color .3s ease,color .3s ease;box-shadow:var(--shadow-3)}.docs-cookies-popup>div{display:flex;gap:8px;align-items:center;width:100%;margin-block-start:1rem}.f-button{outline:none;border:none;height:unset;line-height:26px;font-size:14px;font-weight:500;border-radius:var(--border-radius)}@keyframes fadeIn{to{opacity:100%;visibility:visible}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
557
|
+
}
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CookiePopup, decorators: [{
|
559
|
+
type: Component,
|
560
|
+
args: [{ selector: 'f-cookie-popup', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!hasAccepted()) {\n <div class=\"docs-cookies-popup docs-invert-mode\">\n <p>This site uses cookies from Google to deliver its services and to analyze traffic.</p>\n\n <div>\n <a href=\"https://policies.google.com/technologies/cookies\" target=\"_blank\" rel=\"noopener\">\n <button class=\"f-button\" [attr.text]=\"'Learn more'\" aria-label=\"Learn More\">\n Learn more\n </button>\n </a>\n <button\n (click)=\"accept()\"\n class=\"f-button\"\n [attr.text]=\"'Ok, Got it'\"\n aria-label=\"Ok, Got it\">\n Ok, Got it\n </button>\n </div>\n </div>\n}\n", styles: [":host{position:fixed;bottom:16px;right:16px;z-index:99999;opacity:0;visibility:hidden;animation:1s linear forwards .5s fadeIn}.docs-cookies-popup{padding:1rem;background-color:var(--background-color);border:1px solid var(--divider-color);color:var(--primary-text);border-radius:var(--border-radius);font-size:14px;max-width:310px;transition:background-color .3s ease,border-color .3s ease,color .3s ease;box-shadow:var(--shadow-3)}.docs-cookies-popup>div{display:flex;gap:8px;align-items:center;width:100%;margin-block-start:1rem}.f-button{outline:none;border:none;height:unset;line-height:26px;font-size:14px;font-weight:500;border-radius:var(--border-radius)}@keyframes fadeIn{to{opacity:100%;visibility:visible}}\n"] }]
|
561
|
+
}], ctorParameters: () => [] });
|
562
|
+
|
563
|
+
const F_DOCUMENTATION_COMPONENT = new InjectionToken('F_DOCUMENTATION_COMPONENT');
|
564
|
+
|
565
|
+
class FHamburgerButtonComponent {
|
566
|
+
constructor(fDocumentation) {
|
567
|
+
this.fDocumentation = fDocumentation;
|
568
|
+
}
|
569
|
+
onShowNavigation() {
|
570
|
+
this.fDocumentation.onToggleNavigation(true);
|
571
|
+
}
|
572
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHamburgerButtonComponent, deps: [{ token: F_DOCUMENTATION_COMPONENT }], target: i0.ɵɵFactoryTarget.Component }); }
|
573
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FHamburgerButtonComponent, isStandalone: true, selector: "button[f-hamburger-button]", host: { listeners: { "click": "onShowNavigation()" } }, ngImport: i0, template: "<span class=\"f-icon hamburger\"></span>\n\n", styles: [":host{background-color:transparent;border:0;display:flex;padding:0;margin-right:16px;color:var(--secondary-text);cursor:pointer}@media (min-width: 960px){:host{display:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
574
|
+
}
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHamburgerButtonComponent, decorators: [{
|
576
|
+
type: Component,
|
577
|
+
args: [{ selector: 'button[f-hamburger-button]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"f-icon hamburger\"></span>\n\n", styles: [":host{background-color:transparent;border:0;display:flex;padding:0;margin-right:16px;color:var(--secondary-text);cursor:pointer}@media (min-width: 960px){:host{display:none}}\n"] }]
|
578
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
579
|
+
type: Inject,
|
580
|
+
args: [F_DOCUMENTATION_COMPONENT]
|
581
|
+
}] }], propDecorators: { onShowNavigation: [{
|
582
|
+
type: HostListener,
|
583
|
+
args: ['click']
|
584
|
+
}] } });
|
585
|
+
|
586
|
+
class FVersionComponent {
|
587
|
+
constructor(fEnvironmentService) {
|
588
|
+
this.fEnvironmentService = fEnvironmentService;
|
589
|
+
this.version$ = this.fEnvironmentService.getVersion();
|
590
|
+
}
|
591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FVersionComponent, deps: [{ token: FEnvironmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
592
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FVersionComponent, isStandalone: true, selector: "f-version", ngImport: i0, template: "@if (version$ | async;as version) {\n <span class=\"version\">v{{ version }}</span>\n}\n", styles: [".version{margin-left:8px;margin-right:8px;display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--primary-text)}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
593
|
+
}
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FVersionComponent, decorators: [{
|
595
|
+
type: Component,
|
596
|
+
args: [{ selector: 'f-version', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
597
|
+
AsyncPipe
|
598
|
+
], template: "@if (version$ | async;as version) {\n <span class=\"version\">v{{ version }}</span>\n}\n", styles: [".version{margin-left:8px;margin-right:8px;display:flex;align-items:center;font-size:14px;font-weight:500;color:var(--primary-text)}\n"] }]
|
599
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }] });
|
600
|
+
|
601
|
+
class FSocialLinksComponent {
|
602
|
+
get links() {
|
603
|
+
return this.fEnvironmentService.getSocialLinks();
|
604
|
+
}
|
605
|
+
constructor(fEnvironmentService) {
|
606
|
+
this.fEnvironmentService = fEnvironmentService;
|
607
|
+
}
|
608
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FSocialLinksComponent, deps: [{ token: FEnvironmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
609
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FSocialLinksComponent, isStandalone: true, selector: "f-social-links", ngImport: i0, template: "@for (link of links; track link.link) {\n <a href=\"{{ link.link }}\" class=\"header-link\">\n <div class=\"f-icon {{ link.icon }}\"></div>\n </a>\n}\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center}.header-link{width:36px;height:36px;padding:7.5px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
610
|
+
}
|
611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FSocialLinksComponent, decorators: [{
|
612
|
+
type: Component,
|
613
|
+
args: [{ selector: 'f-social-links', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (link of links; track link.link) {\n <a href=\"{{ link.link }}\" class=\"header-link\">\n <div class=\"f-icon {{ link.icon }}\"></div>\n </a>\n}\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center}.header-link{width:36px;height:36px;padding:7.5px}\n"] }]
|
614
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }] });
|
615
|
+
|
616
|
+
class FStateService {
|
617
|
+
constructor(fBrowser) {
|
618
|
+
this.fBrowser = fBrowser;
|
619
|
+
this.theme = new Subject();
|
620
|
+
}
|
621
|
+
get theme$() {
|
622
|
+
return this.theme.asObservable();
|
623
|
+
}
|
624
|
+
updateTheme() {
|
625
|
+
this.theme.next();
|
626
|
+
}
|
627
|
+
getPreferredTheme() {
|
628
|
+
return this.fBrowser.localStorage.getItem('preferred-theme')
|
629
|
+
|| (this.fBrowser.window.isMediaQuery('(prefers-color-scheme: dark)') ? 'dark' : 'light');
|
630
|
+
}
|
631
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FStateService, deps: [{ token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
632
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FStateService, providedIn: 'root' }); }
|
633
|
+
}
|
634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FStateService, decorators: [{
|
635
|
+
type: Injectable,
|
636
|
+
args: [{ providedIn: 'root' }]
|
637
|
+
}], ctorParameters: () => [{ type: i2.BrowserService }] });
|
638
|
+
|
639
|
+
class FThemeButtonComponent {
|
640
|
+
constructor(renderer, fState, fBrowser) {
|
641
|
+
this.renderer = renderer;
|
642
|
+
this.fState = fState;
|
643
|
+
this.fBrowser = fBrowser;
|
644
|
+
}
|
645
|
+
ngOnInit() {
|
646
|
+
if (this.fState.getPreferredTheme() === 'dark' && !this.isDocumentContainsDarkTheme()) {
|
647
|
+
this.renderer.addClass(this.fBrowser.document.documentElement, 'dark');
|
648
|
+
this.fBrowser.localStorage.setItem('preferred-theme', 'dark');
|
649
|
+
}
|
650
|
+
}
|
651
|
+
isDocumentContainsDarkTheme() {
|
652
|
+
return this.fBrowser.document.documentElement.classList.contains('dark');
|
653
|
+
}
|
654
|
+
onClick() {
|
655
|
+
if (this.fState.getPreferredTheme() === 'light' && !this.isDocumentContainsDarkTheme()) {
|
656
|
+
this.renderer.addClass(this.fBrowser.document.documentElement, 'dark');
|
657
|
+
this.fBrowser.localStorage.setItem('preferred-theme', 'dark');
|
658
|
+
}
|
659
|
+
else {
|
660
|
+
this.renderer.removeClass(this.fBrowser.document.documentElement, 'dark');
|
661
|
+
this.fBrowser.localStorage.setItem('preferred-theme', 'light');
|
662
|
+
}
|
663
|
+
this.fState.updateTheme();
|
664
|
+
}
|
665
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FThemeButtonComponent, deps: [{ token: i0.Renderer2 }, { token: FStateService }, { token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Component }); }
|
666
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FThemeButtonComponent, isStandalone: true, selector: "button[f-theme-button]", host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: "<div class=\"f-icon-container\">\n <div class=\"f-icon moon\"></div>\n <div class=\"f-icon sun\"></div>\n</div>\n", styles: [":host{margin:0 8px;position:relative;border-radius:11px;display:block;width:44px;min-width:44px;height:22px;border:1px solid var(--theme-button-border-color);background-color:var(--theme-button-background);cursor:pointer}:host:hover{border-color:var(--theme-button-hovered-border-color)}.f-icon-container{position:absolute;top:1px;left:1px;width:18px;height:18px;padding:3px;border-radius:50%;background-color:var(--theme-button-icon-background);transition:transform .4s}.f-icon-container .f-icon{position:absolute;top:3px;left:3px;width:12px;height:12px}.f-icon-container .sun{display:block}.f-icon-container .moon{display:none}.dark :host .f-icon-container{transform:translate(22px)}.dark :host .f-icon-container .sun{display:none}.dark :host .f-icon-container .moon{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
667
|
+
}
|
668
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FThemeButtonComponent, decorators: [{
|
669
|
+
type: Component,
|
670
|
+
args: [{ selector: 'button[f-theme-button]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"f-icon-container\">\n <div class=\"f-icon moon\"></div>\n <div class=\"f-icon sun\"></div>\n</div>\n", styles: [":host{margin:0 8px;position:relative;border-radius:11px;display:block;width:44px;min-width:44px;height:22px;border:1px solid var(--theme-button-border-color);background-color:var(--theme-button-background);cursor:pointer}:host:hover{border-color:var(--theme-button-hovered-border-color)}.f-icon-container{position:absolute;top:1px;left:1px;width:18px;height:18px;padding:3px;border-radius:50%;background-color:var(--theme-button-icon-background);transition:transform .4s}.f-icon-container .f-icon{position:absolute;top:3px;left:3px;width:12px;height:12px}.f-icon-container .sun{display:block}.f-icon-container .moon{display:none}.dark :host .f-icon-container{transform:translate(22px)}.dark :host .f-icon-container .sun{display:none}.dark :host .f-icon-container .moon{display:block}\n"] }]
|
671
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: FStateService }, { type: i2.BrowserService }], propDecorators: { onClick: [{
|
672
|
+
type: HostListener,
|
673
|
+
args: ['click']
|
674
|
+
}] } });
|
675
|
+
|
676
|
+
class FHeaderMenuComponent {
|
677
|
+
constructor(fEnvironmentService, router) {
|
678
|
+
this.fEnvironmentService = fEnvironmentService;
|
679
|
+
this.router = router;
|
680
|
+
this.navigation = [];
|
681
|
+
}
|
682
|
+
ngOnInit() {
|
683
|
+
this.navigation = this.fEnvironmentService.getHeaderNavigation().map((x) => {
|
684
|
+
return {
|
685
|
+
...x,
|
686
|
+
isActive: this.router.url.startsWith(x.link)
|
687
|
+
};
|
688
|
+
});
|
689
|
+
}
|
690
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeaderMenuComponent, deps: [{ token: FEnvironmentService }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
691
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FHeaderMenuComponent, isStandalone: true, selector: "f-header-menu", ngImport: i0, template: "@for (item of navigation; track item.link) {\n <a class=\"header-link\" [routerLink]=\"item.link\" [class.active]=\"item.isActive\">\n <span>{{ item.text }}</span>\n </a>\n}\n\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center}.header-link{display:flex;align-items:center;padding:0 12px;line-height:var(--header-height);font-size:14px;font-weight:500;color:var(--primary-text);cursor:pointer}.header-link:hover,.header-link.active{color:var(--primary-1)}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
692
|
+
}
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeaderMenuComponent, decorators: [{
|
694
|
+
type: Component,
|
695
|
+
args: [{ selector: 'f-header-menu', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
696
|
+
RouterLink
|
697
|
+
], template: "@for (item of navigation; track item.link) {\n <a class=\"header-link\" [routerLink]=\"item.link\" [class.active]=\"item.isActive\">\n <span>{{ item.text }}</span>\n </a>\n}\n\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center}.header-link{display:flex;align-items:center;padding:0 12px;line-height:var(--header-height);font-size:14px;font-weight:500;color:var(--primary-text);cursor:pointer}.header-link:hover,.header-link.active{color:var(--primary-1)}\n"] }]
|
698
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: i1.Router }] });
|
699
|
+
|
700
|
+
class FHeaderComponent {
|
701
|
+
constructor(fEnvironmentService) {
|
702
|
+
this.fEnvironmentService = fEnvironmentService;
|
703
|
+
this.title = '';
|
704
|
+
this.title = this.fEnvironmentService.getTitle();
|
705
|
+
}
|
706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeaderComponent, deps: [{ token: FEnvironmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
707
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FHeaderComponent, isStandalone: true, selector: "f-header", ngImport: i0, template: "<button f-hamburger-button></button>\n<div class=\"title text-ellipsis\">{{ title }}</div>\n<div class=\"flex-space\"></div>\n<f-header-menu></f-header-menu>\n<f-version></f-version>\n<div class=\"divider\"></div>\n<button f-theme-button></button>\n<div class=\"divider\"></div>\n<f-social-links></f-social-links>\n\n", styles: [":host{position:sticky;width:100%;top:0;display:flex;justify-content:flex-start;align-items:center;padding:20px 32px;font-weight:600;color:var(--primary-text);height:calc(var(--header-height) + 1px);background-color:var(--background-color);border-bottom:1px solid var(--divider-color);z-index:var(--z-index-header)}@media (min-width: 1280px){:host{padding-right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 3);padding-left:max(var(--page-padding),(100vw - var(--layout-max-width)) / 4)}}.title{display:none;justify-content:flex-start;align-items:center;padding:20px 0;font-weight:600;color:var(--primary-text);height:var(--header-height)}@media (min-width: 460px){.title{display:block}}@media (min-width: 960px){.title{display:none}}.divider{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--divider-color);content:\"\"}\n"], dependencies: [{ kind: "component", type: FHamburgerButtonComponent, selector: "button[f-hamburger-button]" }, { kind: "component", type: FVersionComponent, selector: "f-version" }, { kind: "component", type: FSocialLinksComponent, selector: "f-social-links" }, { kind: "component", type: FThemeButtonComponent, selector: "button[f-theme-button]" }, { kind: "component", type: FHeaderMenuComponent, selector: "f-header-menu" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
708
|
+
}
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FHeaderComponent, decorators: [{
|
710
|
+
type: Component,
|
711
|
+
args: [{ selector: 'f-header', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
712
|
+
NgOptimizedImage,
|
713
|
+
FHamburgerButtonComponent,
|
714
|
+
FVersionComponent,
|
715
|
+
FSocialLinksComponent,
|
716
|
+
FThemeButtonComponent,
|
717
|
+
FHeaderMenuComponent
|
718
|
+
], template: "<button f-hamburger-button></button>\n<div class=\"title text-ellipsis\">{{ title }}</div>\n<div class=\"flex-space\"></div>\n<f-header-menu></f-header-menu>\n<f-version></f-version>\n<div class=\"divider\"></div>\n<button f-theme-button></button>\n<div class=\"divider\"></div>\n<f-social-links></f-social-links>\n\n", styles: [":host{position:sticky;width:100%;top:0;display:flex;justify-content:flex-start;align-items:center;padding:20px 32px;font-weight:600;color:var(--primary-text);height:calc(var(--header-height) + 1px);background-color:var(--background-color);border-bottom:1px solid var(--divider-color);z-index:var(--z-index-header)}@media (min-width: 1280px){:host{padding-right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 3);padding-left:max(var(--page-padding),(100vw - var(--layout-max-width)) / 4)}}.title{display:none;justify-content:flex-start;align-items:center;padding:20px 0;font-weight:600;color:var(--primary-text);height:var(--header-height)}@media (min-width: 460px){.title{display:block}}@media (min-width: 960px){.title{display:none}}.divider{margin-right:8px;margin-left:8px;width:1px;height:24px;background-color:var(--divider-color);content:\"\"}\n"] }]
|
719
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }] });
|
720
|
+
|
721
|
+
class FPreviewComponent {
|
722
|
+
constructor(fEnvironment, fState, router, changeDetectorRef) {
|
723
|
+
this.fEnvironment = fEnvironment;
|
724
|
+
this.fState = fState;
|
725
|
+
this.router = router;
|
726
|
+
this.changeDetectorRef = changeDetectorRef;
|
727
|
+
this.subscriptions$ = new Subscription();
|
728
|
+
}
|
729
|
+
initialize() {
|
730
|
+
this.viewModel = this.getNavigationItem(this.getNavigationGroup());
|
731
|
+
this.url = this.normalizeLink(this.viewModel.link, this.getUrlPrefix());
|
732
|
+
this.subscriptions$.add(this.fState.theme$.pipe(startWith(null)).subscribe(() => this.updateTheme()));
|
733
|
+
}
|
734
|
+
getNavigationGroup() {
|
735
|
+
return this.fEnvironment.getNavigation().find((x) => x.text === this.group);
|
736
|
+
}
|
737
|
+
getNavigationItem(group) {
|
738
|
+
return group.items.find((x) => x.link === this.item);
|
739
|
+
}
|
740
|
+
updateTheme() {
|
741
|
+
this.src = this.fState.getPreferredTheme() === 'dark' ? this.viewModel?.image_dark : this.viewModel?.image;
|
742
|
+
if (!this.src) {
|
743
|
+
this.src = this.viewModel?.image;
|
744
|
+
}
|
745
|
+
this.changeDetectorRef.markForCheck();
|
746
|
+
}
|
747
|
+
normalizeLink(link, prefix) {
|
748
|
+
if (!this.isExternalLink(link)) {
|
749
|
+
return link.startsWith('/') ? `${prefix}${link}` : `${prefix}/${link}`;
|
750
|
+
}
|
751
|
+
return link;
|
752
|
+
}
|
753
|
+
getUrlPrefix() {
|
754
|
+
return this.router.url.substring(0, this.router.url.lastIndexOf('/'));
|
755
|
+
}
|
756
|
+
isExternalLink(href) {
|
757
|
+
return href.startsWith('www') || href.startsWith('http');
|
758
|
+
}
|
759
|
+
ngOnDestroy() {
|
760
|
+
this.subscriptions$.unsubscribe();
|
761
|
+
}
|
762
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPreviewComponent, deps: [{ token: FEnvironmentService }, { token: FStateService }, { token: i1.Router }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
763
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FPreviewComponent, isStandalone: true, selector: "a[f-preview]", host: { properties: { "attr.href": "url", "attr.title": "viewModel?.text" } }, ngImport: i0, template: "@if (viewModel) {\n <img [src]=\"src\" [alt]=\"viewModel.description\" [title]=\"viewModel.text\">\n <div class=\"title\">{{ viewModel.text }}</div>\n <div class=\"description\">{{ viewModel.description }}</div>\n}\n\n\n\n", styles: [":host{display:block;border-radius:4px;background-color:var(--soft-background);padding:24px;width:100%;text-decoration:none!important;color:inherit!important;line-height:24px;font-size:14px;cursor:pointer}:host:hover img{transform:scale(1.1)}:host img{display:block;margin-bottom:16px;width:100%;height:180px;border-radius:4px;object-fit:cover;transition:transform .3s}:host .title{line-height:inherit;font-weight:600;text-transform:uppercase;color:var(--primary-text)}:host .description{margin:8px 0!important;line-height:inherit;color:var(--secondary-text);width:100%;word-wrap:break-word;white-space:normal;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}@media (min-width: 640px){:host{width:calc((100% - 32px)/2)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
764
|
+
}
|
765
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPreviewComponent, decorators: [{
|
766
|
+
type: Component,
|
767
|
+
args: [{ selector: 'a[f-preview]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
768
|
+
'[attr.href]': 'url',
|
769
|
+
'[attr.title]': 'viewModel?.text',
|
770
|
+
}, template: "@if (viewModel) {\n <img [src]=\"src\" [alt]=\"viewModel.description\" [title]=\"viewModel.text\">\n <div class=\"title\">{{ viewModel.text }}</div>\n <div class=\"description\">{{ viewModel.description }}</div>\n}\n\n\n\n", styles: [":host{display:block;border-radius:4px;background-color:var(--soft-background);padding:24px;width:100%;text-decoration:none!important;color:inherit!important;line-height:24px;font-size:14px;cursor:pointer}:host:hover img{transform:scale(1.1)}:host img{display:block;margin-bottom:16px;width:100%;height:180px;border-radius:4px;object-fit:cover;transition:transform .3s}:host .title{line-height:inherit;font-weight:600;text-transform:uppercase;color:var(--primary-text)}:host .description{margin:8px 0!important;line-height:inherit;color:var(--secondary-text);width:100%;word-wrap:break-word;white-space:normal;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}@media (min-width: 640px){:host{width:calc((100% - 32px)/2)}}\n"] }]
|
771
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: FStateService }, { type: i1.Router }, { type: i0.ChangeDetectorRef }] });
|
772
|
+
|
773
|
+
class FNavigationGroupComponent {
|
774
|
+
constructor() {
|
775
|
+
this.isCollapsed = false;
|
776
|
+
}
|
777
|
+
toggle() {
|
778
|
+
this.isCollapsed = !this.isCollapsed;
|
779
|
+
}
|
780
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
781
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FNavigationGroupComponent, isStandalone: true, selector: "f-navigation-group", inputs: { title: "title" }, host: { properties: { "class.collapsed": "isCollapsed", "class.no-title": "!title" } }, ngImport: i0, template: "@if (title) {\n <header (click)=\"toggle()\">\n <span>{{ title }}</span>\n <div class=\"flex-space\"></div>\n <div class=\"caret\">\n <span class=\"chevron-right caret-icon\"></span>\n </div>\n </header>\n}\n@if (!isCollapsed) {\n <ng-content></ng-content>\n}\n\n\n\n", styles: [":host{padding-top:10px;padding-bottom:24px;border-top:1px solid var(--divider-color);display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:100%;max-width:240px;margin-left:auto}:host.collapsed,:host.no-title{padding-top:10px;padding-bottom:10px}header{font-weight:600;color:var(--primary-text);flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;cursor:pointer;display:flex;justify-content:flex-start;align-items:center;width:100%}.caret{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--tertiary-text);cursor:pointer;transition:color .25s;flex-shrink:0}:host:hover .caret{color:var(--secondary-text)}:host:hover .caret:hover{color:var(--primary-text)}:host .caret-icon{font-size:18px;transform:rotate(90deg);transition:transform .25s;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:18px;height:18px}:host.collapsed .caret-icon{transform:rotate(0)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
782
|
+
}
|
783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationGroupComponent, decorators: [{
|
784
|
+
type: Component,
|
785
|
+
args: [{ selector: 'f-navigation-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
786
|
+
'[class.collapsed]': 'isCollapsed',
|
787
|
+
'[class.no-title]': '!title'
|
788
|
+
}, template: "@if (title) {\n <header (click)=\"toggle()\">\n <span>{{ title }}</span>\n <div class=\"flex-space\"></div>\n <div class=\"caret\">\n <span class=\"chevron-right caret-icon\"></span>\n </div>\n </header>\n}\n@if (!isCollapsed) {\n <ng-content></ng-content>\n}\n\n\n\n", styles: [":host{padding-top:10px;padding-bottom:24px;border-top:1px solid var(--divider-color);display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;width:100%;max-width:240px;margin-left:auto}:host.collapsed,:host.no-title{padding-top:10px;padding-bottom:10px}header{font-weight:600;color:var(--primary-text);flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;cursor:pointer;display:flex;justify-content:flex-start;align-items:center;width:100%}.caret{display:flex;justify-content:center;align-items:center;margin-right:-7px;width:32px;height:32px;color:var(--tertiary-text);cursor:pointer;transition:color .25s;flex-shrink:0}:host:hover .caret{color:var(--secondary-text)}:host:hover .caret:hover{color:var(--primary-text)}:host .caret-icon{font-size:18px;transform:rotate(90deg);transition:transform .25s;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:18px;height:18px}:host.collapsed .caret-icon{transform:rotate(0)}\n"] }]
|
789
|
+
}], propDecorators: { title: [{
|
790
|
+
type: Input
|
791
|
+
}] } });
|
792
|
+
|
793
|
+
class FNavigationHeaderComponent {
|
794
|
+
constructor(router, fEnvironmentService) {
|
795
|
+
this.router = router;
|
796
|
+
this.fEnvironmentService = fEnvironmentService;
|
797
|
+
this.title = '';
|
798
|
+
this.image = '';
|
799
|
+
this.title = this.fEnvironmentService.getTitle();
|
800
|
+
this.image = this.fEnvironmentService.getLogo();
|
801
|
+
}
|
802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationHeaderComponent, deps: [{ token: i1.Router }, { token: FEnvironmentService }], target: i0.ɵɵFactoryTarget.Component }); }
|
803
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FNavigationHeaderComponent, isStandalone: true, selector: "a[f-navigation-header]", ngImport: i0, template: "<img [src]=\"image\" width=\"24\" height=\"24\" alt=\"logo\" class=\"logo\"/> {{ title }}\n\n\n\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center;padding:20px 0;font-weight:600;color:var(--primary-text);height:var(--header-height);width:100%;max-width:240px;margin-left:auto;cursor:pointer}:host img{margin-right:8px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
804
|
+
}
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationHeaderComponent, decorators: [{
|
806
|
+
type: Component,
|
807
|
+
args: [{ selector: 'a[f-navigation-header]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
808
|
+
RouterLink
|
809
|
+
], template: "<img [src]=\"image\" width=\"24\" height=\"24\" alt=\"logo\" class=\"logo\"/> {{ title }}\n\n\n\n", styles: [":host{display:flex;justify-content:flex-start;align-items:center;padding:20px 0;font-weight:600;color:var(--primary-text);height:var(--header-height);width:100%;max-width:240px;margin-left:auto;cursor:pointer}:host img{margin-right:8px}\n"] }]
|
810
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: FEnvironmentService }] });
|
811
|
+
|
812
|
+
class FNavigationItemComponent {
|
813
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
814
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FNavigationItemComponent, isStandalone: true, selector: "a[f-navigation-item]", ngImport: i0, template: "<ng-content></ng-content>\n\n\n\n", styles: [":host{font-weight:500;color:var(--secondary-text);flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;cursor:pointer;width:100%;display:flex;align-items:center;justify-content:flex-start;gap:2px}:host:hover{text-decoration:none;color:var(--primary-1)}:host.active{color:var(--primary-1)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
815
|
+
}
|
816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationItemComponent, decorators: [{
|
817
|
+
type: Component,
|
818
|
+
args: [{ selector: 'a[f-navigation-item]', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n\n\n\n", styles: [":host{font-weight:500;color:var(--secondary-text);flex-grow:1;padding:4px 0;line-height:24px;font-size:14px;cursor:pointer;width:100%;display:flex;align-items:center;justify-content:flex-start;gap:2px}:host:hover{text-decoration:none;color:var(--primary-1)}:host.active{color:var(--primary-1)}\n"] }]
|
819
|
+
}] });
|
820
|
+
|
821
|
+
class FNavigationPanelComponent {
|
822
|
+
constructor(fEnvironmentService, fDocumentation, router, injector, changeDetectorRef) {
|
823
|
+
this.fEnvironmentService = fEnvironmentService;
|
824
|
+
this.fDocumentation = fDocumentation;
|
825
|
+
this.router = router;
|
826
|
+
this.injector = injector;
|
827
|
+
this.changeDetectorRef = changeDetectorRef;
|
828
|
+
this.subscription = new Subscription();
|
829
|
+
this.navigation = [];
|
830
|
+
this.navigation = this.fEnvironmentService.getNavigation();
|
831
|
+
}
|
832
|
+
ngOnInit() {
|
833
|
+
const currentPath = this.router.url;
|
834
|
+
const prefix = currentPath.substring(0, currentPath.lastIndexOf('/'));
|
835
|
+
const navigation = deepClone(this.fEnvironmentService.getNavigation());
|
836
|
+
navigation.forEach((group) => {
|
837
|
+
group.items.forEach((item) => {
|
838
|
+
this.normalizeLink(item, prefix);
|
839
|
+
});
|
840
|
+
});
|
841
|
+
this.navigation = navigation;
|
842
|
+
}
|
843
|
+
normalizeLink(item, prefix) {
|
844
|
+
if (item.link && !this.isExternalLink(item.link)) {
|
845
|
+
item.link = item.link.startsWith('/') ? `${prefix}${item.link}` : `${prefix}/${item.link}`;
|
846
|
+
}
|
847
|
+
}
|
848
|
+
isExternalLink(href) {
|
849
|
+
return href.startsWith('www') || href.startsWith('http');
|
850
|
+
}
|
851
|
+
ngAfterViewInit() {
|
852
|
+
this.subscription.add(this.subscribeOnRouteChanges());
|
853
|
+
}
|
854
|
+
subscribeOnRouteChanges() {
|
855
|
+
return this.router.events.pipe(startWith(new NavigationEnd(1, '', '')), filter$1(event => event instanceof NavigationEnd)).subscribe(() => {
|
856
|
+
this.highlightLink(this.router.url);
|
857
|
+
this.fDocumentation.onToggleNavigation(false);
|
858
|
+
this.changeDetectorRef.detectChanges();
|
859
|
+
});
|
860
|
+
}
|
861
|
+
highlightLink(url) {
|
862
|
+
this.value = undefined;
|
863
|
+
this.navigation.forEach((group) => {
|
864
|
+
this.value = group.items.find((x) => {
|
865
|
+
return url.endsWith(x.link);
|
866
|
+
})?.link || this.value;
|
867
|
+
});
|
868
|
+
}
|
869
|
+
onDocumentClick(event) {
|
870
|
+
this.injector.get(HandleNavigationLinksHandler).handle(new HandleNavigationLinksRequest(event));
|
871
|
+
}
|
872
|
+
ngOnDestroy() {
|
873
|
+
this.subscription.unsubscribe();
|
874
|
+
}
|
875
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationPanelComponent, deps: [{ token: FEnvironmentService }, { token: F_DOCUMENTATION_COMPONENT }, { token: i1.Router }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
876
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FNavigationPanelComponent, isStandalone: true, selector: "f-navigation-panel", host: { listeners: { "click": "onDocumentClick($event)" } }, providers: [
|
877
|
+
HandleNavigationLinksHandler
|
878
|
+
], viewQueries: [{ propertyName: "items", predicate: FNavigationItemComponent, descendants: true }], ngImport: i0, template: "<a f-navigation-header routerLink></a>\n\n@for (group of navigation; track group) {\n <f-navigation-group [title]=\"group.text\">\n @for (item of group.items; track item.link) {\n <a f-navigation-item [href]=\"item.link\" [class.active]=\"item.link === value\">\n <div class=\"text-ellipsis\">{{ item.text }}</div>\n @if (item.badge) {\n <span f-badge [text]=\"item.badge.text\" [type]=\"item.badge.type\"></span>\n }\n </a>\n }\n </f-navigation-group>\n}\n", styles: [":host{height:100%;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:0 var(--navigation-panel-padding);background-color:var(--navigation-panel-background);overflow:hidden;overflow-y:auto;position:fixed;width:var(--navigation-panel-width);top:0;left:calc(-1 * var(--navigation-panel-width));transition:transform .2s ease-in-out;z-index:var(--z-index-navigation);transform:none}@media (min-width: 960px){:host{position:unset;display:flex;min-width:var(--navigation-panel-width);width:fit-content;transform:none!important}}@media (min-width: 1440px){:host{min-width:calc((100% - (var(--layout-max-width) - 64px)) / 3 + var(--navigation-panel-width) - var(--navigation-panel-padding))}}:host.visible{transform:translate(var(--navigation-panel-width))}\n"], dependencies: [{ kind: "component", type: FNavigationHeaderComponent, selector: "a[f-navigation-header]" }, { kind: "component", type: FNavigationItemComponent, selector: "a[f-navigation-item]" }, { kind: "component", type: FNavigationGroupComponent, selector: "f-navigation-group", inputs: ["title"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: FBadgeComponent, selector: "span[f-badge]", inputs: ["text", "type"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
879
|
+
}
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FNavigationPanelComponent, decorators: [{
|
881
|
+
type: Component,
|
882
|
+
args: [{ selector: 'f-navigation-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
883
|
+
HandleNavigationLinksHandler
|
884
|
+
], imports: [
|
885
|
+
FNavigationHeaderComponent,
|
886
|
+
FNavigationItemComponent,
|
887
|
+
FNavigationGroupComponent,
|
888
|
+
RouterLink,
|
889
|
+
FBadgeComponent,
|
890
|
+
], template: "<a f-navigation-header routerLink></a>\n\n@for (group of navigation; track group) {\n <f-navigation-group [title]=\"group.text\">\n @for (item of group.items; track item.link) {\n <a f-navigation-item [href]=\"item.link\" [class.active]=\"item.link === value\">\n <div class=\"text-ellipsis\">{{ item.text }}</div>\n @if (item.badge) {\n <span f-badge [text]=\"item.badge.text\" [type]=\"item.badge.type\"></span>\n }\n </a>\n }\n </f-navigation-group>\n}\n", styles: [":host{height:100%;flex-direction:column;justify-content:flex-start;align-items:flex-start;padding:0 var(--navigation-panel-padding);background-color:var(--navigation-panel-background);overflow:hidden;overflow-y:auto;position:fixed;width:var(--navigation-panel-width);top:0;left:calc(-1 * var(--navigation-panel-width));transition:transform .2s ease-in-out;z-index:var(--z-index-navigation);transform:none}@media (min-width: 960px){:host{position:unset;display:flex;min-width:var(--navigation-panel-width);width:fit-content;transform:none!important}}@media (min-width: 1440px){:host{min-width:calc((100% - (var(--layout-max-width) - 64px)) / 3 + var(--navigation-panel-width) - var(--navigation-panel-padding))}}:host.visible{transform:translate(var(--navigation-panel-width))}\n"] }]
|
891
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: undefined, decorators: [{
|
892
|
+
type: Inject,
|
893
|
+
args: [F_DOCUMENTATION_COMPONENT]
|
894
|
+
}] }, { type: i1.Router }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { items: [{
|
895
|
+
type: ViewChildren,
|
896
|
+
args: [FNavigationItemComponent]
|
897
|
+
}], onDocumentClick: [{
|
898
|
+
type: HostListener,
|
899
|
+
args: ['click', ['$event']]
|
900
|
+
}] } });
|
901
|
+
|
902
|
+
class GetAbsoluteTopToContainerHandler {
|
903
|
+
handle(request) {
|
904
|
+
let element = request.element;
|
905
|
+
let result = 0;
|
906
|
+
while (element !== request.container) {
|
907
|
+
if (!element)
|
908
|
+
return NaN;
|
909
|
+
result += element.offsetTop;
|
910
|
+
element = element.offsetParent;
|
911
|
+
}
|
912
|
+
return result;
|
913
|
+
}
|
914
|
+
}
|
915
|
+
|
916
|
+
class GetAbsoluteTopToContainerRequest {
|
917
|
+
constructor(element, container) {
|
918
|
+
this.element = element;
|
919
|
+
this.container = container;
|
920
|
+
}
|
921
|
+
}
|
922
|
+
|
923
|
+
class TableOfContentData {
|
924
|
+
constructor(flat, tree) {
|
925
|
+
this.flat = flat;
|
926
|
+
this.tree = tree;
|
927
|
+
}
|
928
|
+
}
|
929
|
+
|
930
|
+
class GetTableOfContentDataHandler {
|
931
|
+
handle(request) {
|
932
|
+
const flat = [];
|
933
|
+
const tree = [];
|
934
|
+
const stack = [];
|
935
|
+
this.getNavigationSelectors(request.fMarkdownPage, request.tocRange).forEach((element) => {
|
936
|
+
const tocItem = this.createItem(element);
|
937
|
+
this.insertItemIntoTree(tocItem, tree, stack);
|
938
|
+
flat.push(tocItem);
|
939
|
+
});
|
940
|
+
return new TableOfContentData(flat, tree);
|
941
|
+
}
|
942
|
+
getNavigationSelectors(fMarkdownPage, tocRange) {
|
943
|
+
if (!tocRange || tocRange.start < 1 || tocRange.end > 6) {
|
944
|
+
tocRange = { start: 1, end: 6 };
|
945
|
+
}
|
946
|
+
let selectors = [];
|
947
|
+
for (let i = tocRange.start; i <= tocRange.end; i++) {
|
948
|
+
selectors.push(`h${i}`);
|
949
|
+
}
|
950
|
+
return Array.from(fMarkdownPage.querySelectorAll(selectors.join(', ')));
|
951
|
+
}
|
952
|
+
createItem(element) {
|
953
|
+
element.id = this.createNavigationId(element);
|
954
|
+
return {
|
955
|
+
hash: `#${element.id}`,
|
956
|
+
title: element.innerHTML,
|
957
|
+
element,
|
958
|
+
children: []
|
959
|
+
};
|
960
|
+
}
|
961
|
+
createNavigationId(element) {
|
962
|
+
return element.innerHTML.toLowerCase().replaceAll(' ', '-');
|
963
|
+
}
|
964
|
+
getLevel(element) {
|
965
|
+
return parseInt(element.tagName.substring(1));
|
966
|
+
}
|
967
|
+
insertItemIntoTree(tocItem, tree, stack) {
|
968
|
+
while (stack.length > 0 && this.getLevel(stack[stack.length - 1].element) >= this.getLevel(tocItem.element)) {
|
969
|
+
stack.pop();
|
970
|
+
}
|
971
|
+
if (stack.length === 0) {
|
972
|
+
tree.push(tocItem);
|
973
|
+
}
|
974
|
+
else {
|
975
|
+
stack[stack.length - 1].children.push(tocItem);
|
976
|
+
}
|
977
|
+
stack.push(tocItem);
|
978
|
+
}
|
979
|
+
}
|
980
|
+
|
981
|
+
class GetTableOfContentDataRequest {
|
982
|
+
constructor(fMarkdownPage, tocRange) {
|
983
|
+
this.fMarkdownPage = fMarkdownPage;
|
984
|
+
this.tocRange = tocRange;
|
985
|
+
}
|
986
|
+
}
|
987
|
+
|
988
|
+
class CalculateHashFromScrollPositionHandler {
|
989
|
+
constructor(scrollableContainer, fBrowser) {
|
990
|
+
this.scrollableContainer = scrollableContainer;
|
991
|
+
this.fBrowser = fBrowser;
|
992
|
+
}
|
993
|
+
handle(request) {
|
994
|
+
let result;
|
995
|
+
const containerScrollTop = this.getContainerScrollTop();
|
996
|
+
const elementsWithTopPosition = this.calculateElementsTopPositions(request.tocData);
|
997
|
+
if (elementsWithTopPosition.length) {
|
998
|
+
if (this.isScrollAtBottom(containerScrollTop)) {
|
999
|
+
result = elementsWithTopPosition[elementsWithTopPosition.length - 1].hash;
|
1000
|
+
}
|
1001
|
+
else {
|
1002
|
+
result = this.findTargetHashByPosition(containerScrollTop, elementsWithTopPosition);
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
return result;
|
1006
|
+
}
|
1007
|
+
getContainerScrollTop() {
|
1008
|
+
return this.scrollableContainer.scrollTop + this.getHeaderHeight();
|
1009
|
+
}
|
1010
|
+
getHeaderHeight() {
|
1011
|
+
return parseInt(this.fBrowser.window.getComputedStyle(this.fBrowser.document.documentElement).getPropertyValue('--header-height'), 10);
|
1012
|
+
}
|
1013
|
+
calculateElementsTopPositions(items) {
|
1014
|
+
return items.map((x) => {
|
1015
|
+
return {
|
1016
|
+
hash: x.hash,
|
1017
|
+
top: this.getAbsoluteTopToContainer(x.element)
|
1018
|
+
};
|
1019
|
+
}).filter((x) => !Number.isNaN(x.top));
|
1020
|
+
}
|
1021
|
+
getAbsoluteTopToContainer(element) {
|
1022
|
+
return new GetAbsoluteTopToContainerHandler().handle(new GetAbsoluteTopToContainerRequest(element, this.scrollableContainer));
|
1023
|
+
}
|
1024
|
+
isScrollAtBottom(containerScrollTop) {
|
1025
|
+
return Math.abs(containerScrollTop - this.getHeaderHeight() + this.scrollableContainer.clientHeight - this.scrollableContainer.scrollHeight) < 1;
|
1026
|
+
}
|
1027
|
+
findTargetHashByPosition(containerScrollTop, elementsWithTopPosition) {
|
1028
|
+
let result = elementsWithTopPosition[0].hash;
|
1029
|
+
for (const { hash, top } of elementsWithTopPosition) {
|
1030
|
+
if (top > containerScrollTop)
|
1031
|
+
break;
|
1032
|
+
result = hash;
|
1033
|
+
}
|
1034
|
+
return result;
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
class CalculateHashFromScrollPositionRequest {
|
1039
|
+
constructor(tocData) {
|
1040
|
+
this.tocData = tocData;
|
1041
|
+
}
|
1042
|
+
}
|
1043
|
+
|
1044
|
+
class ScrollToElementInContainer {
|
1045
|
+
constructor(container) {
|
1046
|
+
this.container = container;
|
1047
|
+
}
|
1048
|
+
handle(hash) {
|
1049
|
+
this.container.scrollTo({
|
1050
|
+
top: this.getScrollTo(this.getScrollToElement(hash)) - 64,
|
1051
|
+
behavior: 'smooth'
|
1052
|
+
});
|
1053
|
+
}
|
1054
|
+
getScrollToElement(hash) {
|
1055
|
+
const element = this.container.querySelector(hash);
|
1056
|
+
if (!element) {
|
1057
|
+
throw new Error(`Element ${hash} not found`);
|
1058
|
+
}
|
1059
|
+
return element;
|
1060
|
+
}
|
1061
|
+
getScrollTo(element) {
|
1062
|
+
return this.isFirstElementInContainer(element) ? 0 : this.calculateScrollTo(element);
|
1063
|
+
}
|
1064
|
+
isFirstElementInContainer(element) {
|
1065
|
+
return element.parentElement.children[0] === element;
|
1066
|
+
}
|
1067
|
+
calculateScrollTo(element) {
|
1068
|
+
return this.getElementTop(element) - this.getContainerTop() + this.container.scrollTop;
|
1069
|
+
}
|
1070
|
+
getElementTop(element) {
|
1071
|
+
return element.getBoundingClientRect().top;
|
1072
|
+
}
|
1073
|
+
getContainerTop() {
|
1074
|
+
return this.container.getBoundingClientRect().top;
|
1075
|
+
}
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
class FScrollableService {
|
1079
|
+
get onToc$() {
|
1080
|
+
return this.onTocChanged$.asObservable().pipe(map(() => this.tocData));
|
1081
|
+
}
|
1082
|
+
constructor(fEnvironmentService, fBrowser) {
|
1083
|
+
this.fEnvironmentService = fEnvironmentService;
|
1084
|
+
this.fBrowser = fBrowser;
|
1085
|
+
this.tocData = new TableOfContentData([], []);
|
1086
|
+
this.onTocChanged$ = new Subject();
|
1087
|
+
this.onScrollSubscription$ = Subscription.EMPTY;
|
1088
|
+
}
|
1089
|
+
setContainer(fScrollableContainer) {
|
1090
|
+
this.fScrollableContainer = fScrollableContainer;
|
1091
|
+
this.onScrollSubscription$ = this.subscribeOnScroll();
|
1092
|
+
}
|
1093
|
+
subscribeOnScroll() {
|
1094
|
+
return fromEvent(this.fScrollableContainer, 'scroll').pipe(debounceTime(100)).subscribe((event) => {
|
1095
|
+
this.calculateHashAndActivate();
|
1096
|
+
});
|
1097
|
+
}
|
1098
|
+
scrollTo(hash) {
|
1099
|
+
if (!this.fScrollableContainer) {
|
1100
|
+
throw new Error('Scrollable container is not set');
|
1101
|
+
}
|
1102
|
+
this.activateHash(hash);
|
1103
|
+
new ScrollToElementInContainer(this.fScrollableContainer).handle(hash);
|
1104
|
+
}
|
1105
|
+
setOnPageNavigation(fMarkdownPage) {
|
1106
|
+
this.tocData = new GetTableOfContentDataHandler().handle(new GetTableOfContentDataRequest(fMarkdownPage, this.fEnvironmentService.getToC().range));
|
1107
|
+
this.calculateHashAndActivate();
|
1108
|
+
}
|
1109
|
+
calculateHashAndActivate() {
|
1110
|
+
this.activateHash(this.calculateHashFromScrollPosition());
|
1111
|
+
}
|
1112
|
+
calculateHashFromScrollPosition() {
|
1113
|
+
return new CalculateHashFromScrollPositionHandler(this.fScrollableContainer, this.fBrowser).handle(new CalculateHashFromScrollPositionRequest(this.tocData.flat));
|
1114
|
+
}
|
1115
|
+
activateHash(hash) {
|
1116
|
+
this.tocData.flat.forEach(x => x.isActive = x.hash === hash);
|
1117
|
+
this.onTocChanged$.next();
|
1118
|
+
}
|
1119
|
+
dispose() {
|
1120
|
+
this.onScrollSubscription$.unsubscribe();
|
1121
|
+
}
|
1122
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FScrollableService, deps: [{ token: FEnvironmentService }, { token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1123
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FScrollableService }); }
|
1124
|
+
}
|
1125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FScrollableService, decorators: [{
|
1126
|
+
type: Injectable
|
1127
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: i2.BrowserService }] });
|
1128
|
+
|
1129
|
+
class FScrollableContainerComponent {
|
1130
|
+
get hostElement() {
|
1131
|
+
return this.elementRef.nativeElement;
|
1132
|
+
}
|
1133
|
+
constructor(elementRef, fScrollableService) {
|
1134
|
+
this.elementRef = elementRef;
|
1135
|
+
this.fScrollableService = fScrollableService;
|
1136
|
+
}
|
1137
|
+
ngOnInit() {
|
1138
|
+
this.fScrollableService.setContainer(this.hostElement);
|
1139
|
+
}
|
1140
|
+
ngOnDestroy() {
|
1141
|
+
this.fScrollableService.dispose();
|
1142
|
+
}
|
1143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FScrollableContainerComponent, deps: [{ token: i0.ElementRef }, { token: FScrollableService }], target: i0.ɵɵFactoryTarget.Component }); }
|
1144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FScrollableContainerComponent, isStandalone: true, selector: "f-scrollable-container", providers: [
|
1145
|
+
FScrollableService
|
1146
|
+
], ngImport: i0, template: "<ng-content></ng-content>\n\n\n\n", styles: [":host{position:relative;width:100%;height:100%;overflow:hidden;overflow-y:auto}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1147
|
+
}
|
1148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FScrollableContainerComponent, decorators: [{
|
1149
|
+
type: Component,
|
1150
|
+
args: [{ selector: 'f-scrollable-container', providers: [
|
1151
|
+
FScrollableService
|
1152
|
+
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n\n\n\n", styles: [":host{position:relative;width:100%;height:100%;overflow:hidden;overflow-y:auto}\n"] }]
|
1153
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: FScrollableService }] });
|
1154
|
+
|
1155
|
+
class FDocumentationComponent {
|
1156
|
+
constructor(fPopoverService, changeDetectorRef) {
|
1157
|
+
this.fPopoverService = fPopoverService;
|
1158
|
+
this.changeDetectorRef = changeDetectorRef;
|
1159
|
+
this.subscriptions$ = new Subscription();
|
1160
|
+
this.isNavigationVisible = false;
|
1161
|
+
this.popoverMessage = null;
|
1162
|
+
}
|
1163
|
+
ngOnInit() {
|
1164
|
+
this.subscriptions$.add(this.subscribeOnPopover());
|
1165
|
+
}
|
1166
|
+
subscribeOnPopover() {
|
1167
|
+
return this.fPopoverService.popover$.subscribe((x) => {
|
1168
|
+
this.popoverMessage = x;
|
1169
|
+
this.changeDetectorRef.markForCheck();
|
1170
|
+
});
|
1171
|
+
}
|
1172
|
+
onToggleNavigation(value) {
|
1173
|
+
this.isNavigationVisible = value;
|
1174
|
+
this.changeDetectorRef.markForCheck();
|
1175
|
+
}
|
1176
|
+
ngOnDestroy() {
|
1177
|
+
this.fPopoverService.dispose();
|
1178
|
+
this.subscriptions$.unsubscribe();
|
1179
|
+
}
|
1180
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FDocumentationComponent, deps: [{ token: FPopoverService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
1181
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FDocumentationComponent, isStandalone: true, selector: "f-documentation", providers: [
|
1182
|
+
FEnvironmentService,
|
1183
|
+
FPopoverService,
|
1184
|
+
{ provide: F_DOCUMENTATION_COMPONENT, useExisting: FDocumentationComponent }
|
1185
|
+
], ngImport: i0, template: "<div class=\"f-backdrop\" [class.visible]=\"isNavigationVisible\" (click)=\"onToggleNavigation(false)\"></div>\n<f-navigation-panel [class.visible]=\"isNavigationVisible\"></f-navigation-panel>\n\n<f-scrollable-container>\n <f-header></f-header>\n <router-outlet></router-outlet>\n</f-scrollable-container>\n@if (popoverMessage) {\n <div class=\"popover\">{{ popoverMessage }}</div>\n}\n", styles: [":host{display:flex;justify-content:flex-start;align-items:flex-start;height:100%;gap:10px}.f-backdrop{position:fixed;inset:0;opacity:0;z-index:var(--z-index-backdrop);background:var(--backdrop-color);transition:opacity .2s ease-in-out;pointer-events:none}.f-backdrop.visible{opacity:1;pointer-events:all}@media (min-width: 960px){.f-backdrop{position:unset}}.popover{position:fixed;min-width:120px;bottom:50%;left:50%;text-align:center;transform:translate(-50%,-50%);background-color:var(--code-view-copy-button-hover-background);border:1px solid var(--code-view-copy-button-border-color);color:var(--primary-text);font-size:14px;padding:4px 8px;border-radius:4px;z-index:var(--z-index-popover);opacity:1}\n"], dependencies: [{ kind: "component", type: FNavigationPanelComponent, selector: "f-navigation-panel" }, { kind: "component", type: FHeaderComponent, selector: "f-header" }, { kind: "component", type: FScrollableContainerComponent, selector: "f-scrollable-container" }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1186
|
+
}
|
1187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FDocumentationComponent, decorators: [{
|
1188
|
+
type: Component,
|
1189
|
+
args: [{ selector: 'f-documentation', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
1190
|
+
FEnvironmentService,
|
1191
|
+
FPopoverService,
|
1192
|
+
{ provide: F_DOCUMENTATION_COMPONENT, useExisting: FDocumentationComponent }
|
1193
|
+
], imports: [
|
1194
|
+
FNavigationPanelComponent,
|
1195
|
+
FHeaderComponent,
|
1196
|
+
FScrollableContainerComponent,
|
1197
|
+
RouterOutlet
|
1198
|
+
], template: "<div class=\"f-backdrop\" [class.visible]=\"isNavigationVisible\" (click)=\"onToggleNavigation(false)\"></div>\n<f-navigation-panel [class.visible]=\"isNavigationVisible\"></f-navigation-panel>\n\n<f-scrollable-container>\n <f-header></f-header>\n <router-outlet></router-outlet>\n</f-scrollable-container>\n@if (popoverMessage) {\n <div class=\"popover\">{{ popoverMessage }}</div>\n}\n", styles: [":host{display:flex;justify-content:flex-start;align-items:flex-start;height:100%;gap:10px}.f-backdrop{position:fixed;inset:0;opacity:0;z-index:var(--z-index-backdrop);background:var(--backdrop-color);transition:opacity .2s ease-in-out;pointer-events:none}.f-backdrop.visible{opacity:1;pointer-events:all}@media (min-width: 960px){.f-backdrop{position:unset}}.popover{position:fixed;min-width:120px;bottom:50%;left:50%;text-align:center;transform:translate(-50%,-50%);background-color:var(--code-view-copy-button-hover-background);border:1px solid var(--code-view-copy-button-border-color);color:var(--primary-text);font-size:14px;padding:4px 8px;border-radius:4px;z-index:var(--z-index-popover);opacity:1}\n"] }]
|
1199
|
+
}], ctorParameters: () => [{ type: FPopoverService }, { type: i0.ChangeDetectorRef }] });
|
1200
|
+
|
1201
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
1202
|
+
__proto__: null,
|
1203
|
+
CookiePopup: CookiePopup,
|
1204
|
+
FBadgeComponent: FBadgeComponent,
|
1205
|
+
FCheckboxComponent: FCheckboxComponent,
|
1206
|
+
FDocumentationComponent: FDocumentationComponent,
|
1207
|
+
FHamburgerButtonComponent: FHamburgerButtonComponent,
|
1208
|
+
FHeaderComponent: FHeaderComponent,
|
1209
|
+
FHeaderMenuComponent: FHeaderMenuComponent,
|
1210
|
+
FPreviewComponent: FPreviewComponent,
|
1211
|
+
FSocialLinksComponent: FSocialLinksComponent,
|
1212
|
+
FThemeButtonComponent: FThemeButtonComponent,
|
1213
|
+
FVersionComponent: FVersionComponent,
|
1214
|
+
F_DOCUMENTATION_COMPONENT: F_DOCUMENTATION_COMPONENT
|
1215
|
+
});
|
1216
|
+
|
1217
|
+
class HandleDynamicComponentsHandler {
|
1218
|
+
constructor(fEnvironmentService, injector) {
|
1219
|
+
this.fEnvironmentService = fEnvironmentService;
|
1220
|
+
this.injector = injector;
|
1221
|
+
this.componentRefs = [];
|
1222
|
+
}
|
1223
|
+
handle(request) {
|
1224
|
+
this.dispose();
|
1225
|
+
const components = [
|
1226
|
+
{
|
1227
|
+
tag: 'f-preview', component: FPreviewComponent
|
1228
|
+
},
|
1229
|
+
...this.fEnvironmentService.getComponents()
|
1230
|
+
];
|
1231
|
+
components.forEach((data) => {
|
1232
|
+
const elements = this.getDynamicElements(request.hostElement, data.tag);
|
1233
|
+
if (elements.length) {
|
1234
|
+
if (this.isPromise(data.component)) {
|
1235
|
+
data.component.then(module => {
|
1236
|
+
const component = this.extractComponent(module);
|
1237
|
+
if (component) {
|
1238
|
+
this.replaceElementsWithComponent(elements, component, data.tag);
|
1239
|
+
}
|
1240
|
+
else {
|
1241
|
+
this.logComponentResolutionError(data.tag);
|
1242
|
+
}
|
1243
|
+
}).catch(error => this.logComponentLoadingError(data.tag, error));
|
1244
|
+
}
|
1245
|
+
else {
|
1246
|
+
this.replaceElementsWithComponent(elements, data.component, data.tag);
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
});
|
1250
|
+
}
|
1251
|
+
getDynamicElements(hostElement, tag) {
|
1252
|
+
return Array.from(hostElement.querySelectorAll(tag));
|
1253
|
+
}
|
1254
|
+
isPromise(value) {
|
1255
|
+
return value && typeof value.then === 'function';
|
1256
|
+
}
|
1257
|
+
extractComponent(module) {
|
1258
|
+
return module && module.default ? module.default : Object.values(module)[0];
|
1259
|
+
}
|
1260
|
+
replaceElementsWithComponent(elements, component, tag) {
|
1261
|
+
elements.forEach((x) => {
|
1262
|
+
try {
|
1263
|
+
this.changeElementToComponent(x, component);
|
1264
|
+
}
|
1265
|
+
catch (error) {
|
1266
|
+
this.logComponentInsertionError(tag, error);
|
1267
|
+
}
|
1268
|
+
});
|
1269
|
+
}
|
1270
|
+
changeElementToComponent(element, component) {
|
1271
|
+
try {
|
1272
|
+
const componentRef = this.getComponentReference(component);
|
1273
|
+
this.componentRefs.push(componentRef);
|
1274
|
+
if (!element.dataset) {
|
1275
|
+
return;
|
1276
|
+
}
|
1277
|
+
Object.keys(element.dataset).forEach((key) => componentRef.instance[key] = element.dataset[key]);
|
1278
|
+
componentRef.instance?.initialize?.();
|
1279
|
+
element.parentElement.replaceChild(this.getComponentElement(componentRef), element);
|
1280
|
+
}
|
1281
|
+
catch (error) {
|
1282
|
+
console.error(`Error while inserting component: ${component.name}`, error);
|
1283
|
+
}
|
1284
|
+
}
|
1285
|
+
getComponentReference(component) {
|
1286
|
+
return this.injector.get(ViewContainerRef).createComponent(component);
|
1287
|
+
}
|
1288
|
+
getComponentElement(componentRef) {
|
1289
|
+
this.requestComponentRedraw(componentRef);
|
1290
|
+
return componentRef.hostView.rootNodes[0];
|
1291
|
+
}
|
1292
|
+
requestComponentRedraw(componentRef) {
|
1293
|
+
componentRef.changeDetectorRef.markForCheck();
|
1294
|
+
}
|
1295
|
+
logComponentResolutionError(tag, error) {
|
1296
|
+
console.error(`Component for tag "${tag}" could not be resolved.`, error);
|
1297
|
+
}
|
1298
|
+
logComponentLoadingError(tag, error) {
|
1299
|
+
console.error(`Error while loading component for tag "${tag}":`, error);
|
1300
|
+
}
|
1301
|
+
logComponentInsertionError(tag, error) {
|
1302
|
+
console.error(`Error while inserting component for tag "${tag}":`, error);
|
1303
|
+
}
|
1304
|
+
dispose() {
|
1305
|
+
this.componentRefs.forEach((ref) => ref.destroy());
|
1306
|
+
this.componentRefs = [];
|
1307
|
+
}
|
1308
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleDynamicComponentsHandler, deps: [{ token: FEnvironmentService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1309
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleDynamicComponentsHandler }); }
|
1310
|
+
}
|
1311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleDynamicComponentsHandler, decorators: [{
|
1312
|
+
type: Injectable
|
1313
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: i0.Injector }] });
|
1314
|
+
|
1315
|
+
class HandleDynamicComponentsRequest {
|
1316
|
+
constructor(hostElement) {
|
1317
|
+
this.hostElement = hostElement;
|
1318
|
+
}
|
1319
|
+
}
|
1320
|
+
|
1321
|
+
function copyToClipboard(value) {
|
1322
|
+
const blob = new Blob([value], { type: 'text/plain' });
|
1323
|
+
const data = [new ClipboardItem({ [blob.type]: blob })];
|
1324
|
+
// @ts-ignore
|
1325
|
+
return from(window?.navigator.permissions.query({ name: 'clipboard-write' })).pipe(map((permission) => {
|
1326
|
+
return permission.state !== 'denied';
|
1327
|
+
}), switchMap((isGranted) => {
|
1328
|
+
if (isGranted) {
|
1329
|
+
return from(navigator.clipboard.write(data));
|
1330
|
+
}
|
1331
|
+
return of(undefined);
|
1332
|
+
}));
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
//To prevent replacing the focus syntax (Prism) in the code blocks, we need to change from the default syntax to a custom one.
|
1336
|
+
class ChangeCodeFocusedSyntaxPreProcessor {
|
1337
|
+
handle(element) {
|
1338
|
+
this.getCodeBlocks(element).forEach((block) => {
|
1339
|
+
block.innerHTML = this.replaceFocus(block.innerHTML);
|
1340
|
+
});
|
1341
|
+
return of(element);
|
1342
|
+
}
|
1343
|
+
getCodeBlocks(element) {
|
1344
|
+
return Array.from(element.querySelectorAll('pre code'));
|
1345
|
+
}
|
1346
|
+
replaceFocus(text) {
|
1347
|
+
return text.replace(RULE$2.regex, RULE$2.replacer);
|
1348
|
+
}
|
1349
|
+
}
|
1350
|
+
const RULE$2 = {
|
1351
|
+
regex: /\|:\|(.*?)\|:\|/g,
|
1352
|
+
replacer: (match, p1) => {
|
1353
|
+
return `|foc-|${p1}|-foc|`;
|
1354
|
+
}
|
1355
|
+
};
|
1356
|
+
|
1357
|
+
class SeparateCodeByLinesPostProcessor {
|
1358
|
+
handle(element) {
|
1359
|
+
element.querySelectorAll("pre code").forEach((code) => {
|
1360
|
+
code.innerHTML = this.getCodeDividedByLines(code);
|
1361
|
+
});
|
1362
|
+
return of(element);
|
1363
|
+
}
|
1364
|
+
getCodeDividedByLines(code) {
|
1365
|
+
let result = '';
|
1366
|
+
this.getLines(code).forEach(line => {
|
1367
|
+
if (!this.isLineEmpty(line)) {
|
1368
|
+
result += this.getLine(line);
|
1369
|
+
}
|
1370
|
+
});
|
1371
|
+
return result;
|
1372
|
+
}
|
1373
|
+
getLines(code) {
|
1374
|
+
return code.innerHTML.split('\n');
|
1375
|
+
}
|
1376
|
+
isLineEmpty(line) {
|
1377
|
+
return line.trim() === '';
|
1378
|
+
}
|
1379
|
+
getLine(content) {
|
1380
|
+
return `<line class="line">${content}</line>\n`;
|
1381
|
+
}
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
class ModifyPunctuationHighlightPostProcessor {
|
1385
|
+
handle(element) {
|
1386
|
+
element.querySelectorAll('span.token.attr-name').forEach((node) => {
|
1387
|
+
const text = node.textContent;
|
1388
|
+
if (text && text.startsWith('[') && text.endsWith(']')) {
|
1389
|
+
node.innerHTML = this.replacePunctuation(text);
|
1390
|
+
}
|
1391
|
+
});
|
1392
|
+
return of(element);
|
1393
|
+
}
|
1394
|
+
replacePunctuation(text) {
|
1395
|
+
return text.replace(RULE$1.regex, RULE$1.replacer);
|
1396
|
+
}
|
1397
|
+
}
|
1398
|
+
const RULE$1 = {
|
1399
|
+
regex: /(\[|\])/g,
|
1400
|
+
replacer: (match) => {
|
1401
|
+
return `<span class="token punctuation">${match}</span>`;
|
1402
|
+
}
|
1403
|
+
};
|
1404
|
+
|
1405
|
+
class MarkCodeFocusedBlocksPostProcessor {
|
1406
|
+
constructor(fBrowser) {
|
1407
|
+
this.fBrowser = fBrowser;
|
1408
|
+
}
|
1409
|
+
handle(element) {
|
1410
|
+
this.getCodeBlocks(element).forEach((block) => {
|
1411
|
+
block.innerHTML = this.replaceFocus(block.innerHTML);
|
1412
|
+
if (block.querySelector('.focused')) {
|
1413
|
+
this.applyOpacity(block.parentElement);
|
1414
|
+
}
|
1415
|
+
});
|
1416
|
+
return of(element);
|
1417
|
+
}
|
1418
|
+
getCodeBlocks(element) {
|
1419
|
+
return Array.from(element.querySelectorAll('pre code'));
|
1420
|
+
}
|
1421
|
+
replaceFocus(text) {
|
1422
|
+
return text.replace(RULE.regex, RULE.replacer);
|
1423
|
+
}
|
1424
|
+
applyOpacity(element) {
|
1425
|
+
if (!element.classList.contains('focused')) {
|
1426
|
+
element.style.color = this.createRgbaString(this.getElementColor(element), 0.5);
|
1427
|
+
element.childNodes.forEach((child) => {
|
1428
|
+
if (child.nodeType === Node.ELEMENT_NODE) {
|
1429
|
+
this.applyOpacity(child);
|
1430
|
+
}
|
1431
|
+
});
|
1432
|
+
}
|
1433
|
+
else {
|
1434
|
+
element.style.color = this.createRgbaString(this.getElementColor(element), 1, true);
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
getElementColor(element) {
|
1438
|
+
return this.fBrowser.window.getComputedStyle(element).color;
|
1439
|
+
}
|
1440
|
+
createRgbaString(color, opacity, isRgb = false) {
|
1441
|
+
const [r, g, b, a] = this.getRgbValues(color);
|
1442
|
+
const alpha = Number(a) || 1;
|
1443
|
+
return isRgb ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${opacity * alpha})`;
|
1444
|
+
}
|
1445
|
+
getRgbValues(color) {
|
1446
|
+
return color.match(/\d+/g);
|
1447
|
+
}
|
1448
|
+
}
|
1449
|
+
const RULE = {
|
1450
|
+
regex: /\|foc-\|(.*?)\|-foc\|/g,
|
1451
|
+
replacer: (match, p1) => {
|
1452
|
+
return `<focus class="focused">${p1}</focus>`;
|
1453
|
+
}
|
1454
|
+
};
|
1455
|
+
|
1456
|
+
class HighlightService {
|
1457
|
+
constructor(fBrowser) {
|
1458
|
+
this.fBrowser = fBrowser;
|
1459
|
+
}
|
1460
|
+
highlight(element) {
|
1461
|
+
return this.fBrowser.isBrowser() ? this.markNoneLanguage(element).pipe(switchMap((x) => new ChangeCodeFocusedSyntaxPreProcessor().handle(x)), switchMap((x) => this.highlightCodeWithPrism(x)), switchMap((x) => new ModifyPunctuationHighlightPostProcessor().handle(x)), switchMap((x) => new SeparateCodeByLinesPostProcessor().handle(x)), switchMap((x) => new MarkCodeFocusedBlocksPostProcessor(this.fBrowser).handle(x))) : of(element);
|
1462
|
+
}
|
1463
|
+
highlightCodeWithPrism(element) {
|
1464
|
+
return new Observable((observer) => {
|
1465
|
+
setTimeout(() => {
|
1466
|
+
this.loadPrism().then((x) => {
|
1467
|
+
this.highlightAllUnder(x, observer, element);
|
1468
|
+
});
|
1469
|
+
});
|
1470
|
+
});
|
1471
|
+
}
|
1472
|
+
highlightAllUnder(prism, observer, element) {
|
1473
|
+
try {
|
1474
|
+
prism?.highlightAllUnder(element);
|
1475
|
+
}
|
1476
|
+
catch (e) {
|
1477
|
+
}
|
1478
|
+
observer.next(element);
|
1479
|
+
observer.complete();
|
1480
|
+
}
|
1481
|
+
async loadPrism() {
|
1482
|
+
if (!this.Prism) {
|
1483
|
+
this.Prism = await import('prismjs');
|
1484
|
+
await Promise.all([
|
1485
|
+
// @ts-ignore
|
1486
|
+
import('prismjs/components/prism-bash'), import('prismjs/components/prism-css'), import('prismjs/components/prism-typescript')
|
1487
|
+
]);
|
1488
|
+
}
|
1489
|
+
return this.Prism;
|
1490
|
+
}
|
1491
|
+
markNoneLanguage(element) {
|
1492
|
+
element.querySelectorAll('pre code:not([class*="language-"])').forEach((x) => x.classList.add('language-none'));
|
1493
|
+
return of(element);
|
1494
|
+
}
|
1495
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HighlightService, deps: [{ token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1496
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HighlightService }); }
|
1497
|
+
}
|
1498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HighlightService, decorators: [{
|
1499
|
+
type: Injectable
|
1500
|
+
}], ctorParameters: () => [{ type: i2.BrowserService }] });
|
1501
|
+
|
1502
|
+
class FCodeViewHandler {
|
1503
|
+
constructor(element, injector) {
|
1504
|
+
this.element = element;
|
1505
|
+
this.injector = injector;
|
1506
|
+
this.subscriptions$ = new Subscription();
|
1507
|
+
this.fDocument = this.injector.get(DOCUMENT);
|
1508
|
+
this.initialize();
|
1509
|
+
}
|
1510
|
+
initialize() {
|
1511
|
+
if (this.isServer())
|
1512
|
+
return;
|
1513
|
+
this.createCopyButton();
|
1514
|
+
this.createLanguageBadge();
|
1515
|
+
this.injector.get(HighlightService).highlight(this.element).pipe(take(1)).subscribe(() => {
|
1516
|
+
this.subscriptions$.add(this.subscribeOnCopyButtonClick());
|
1517
|
+
});
|
1518
|
+
}
|
1519
|
+
isServer() {
|
1520
|
+
return typeof window === 'undefined';
|
1521
|
+
}
|
1522
|
+
createCopyButton() {
|
1523
|
+
const button = this.fDocument.createElement('button');
|
1524
|
+
button.classList.add('f-copy-button');
|
1525
|
+
this.element.appendChild(button);
|
1526
|
+
return button;
|
1527
|
+
}
|
1528
|
+
createLanguageBadge() {
|
1529
|
+
const badge = this.fDocument.createElement('span');
|
1530
|
+
badge.classList.add('f-code-language');
|
1531
|
+
badge.textContent = this.getLanguage();
|
1532
|
+
this.element.appendChild(badge);
|
1533
|
+
}
|
1534
|
+
getLanguage() {
|
1535
|
+
return this.getCodeBlock().classList[0].replace('language-', '');
|
1536
|
+
}
|
1537
|
+
getCopyButton() {
|
1538
|
+
return this.element.querySelector('.f-copy-button');
|
1539
|
+
}
|
1540
|
+
getCodeBlock() {
|
1541
|
+
return this.element.querySelector('code');
|
1542
|
+
}
|
1543
|
+
setDisplay(value) {
|
1544
|
+
this.element.style.display = value;
|
1545
|
+
}
|
1546
|
+
subscribeOnCopyButtonClick() {
|
1547
|
+
return fromEvent(this.getCopyButton(), 'click').pipe(switchMap(() => copyToClipboard(this.getCodeBlock().textContent))).subscribe(() => {
|
1548
|
+
this.injector.get(FPopoverService).show('Copied!');
|
1549
|
+
});
|
1550
|
+
}
|
1551
|
+
dispose() {
|
1552
|
+
this.subscriptions$.unsubscribe();
|
1553
|
+
}
|
1554
|
+
}
|
1555
|
+
|
1556
|
+
class FExampleViewHandler {
|
1557
|
+
constructor(element) {
|
1558
|
+
this.element = element;
|
1559
|
+
}
|
1560
|
+
setDisplay(value) {
|
1561
|
+
this.element.style.display = value;
|
1562
|
+
}
|
1563
|
+
}
|
1564
|
+
|
1565
|
+
class FAsyncCodeViewHandler extends FCodeViewHandler {
|
1566
|
+
constructor(element, injector) {
|
1567
|
+
super(element, injector);
|
1568
|
+
}
|
1569
|
+
initialize() {
|
1570
|
+
if (this.isServer())
|
1571
|
+
return;
|
1572
|
+
const language = this.getFileExtension(this.element.innerHTML);
|
1573
|
+
this.subscribeOnLoadFile(this.element.innerHTML).pipe(take(1), catchError((err, data) => of(''))).subscribe((content) => {
|
1574
|
+
this.element.innerHTML = '';
|
1575
|
+
this.element.appendChild(this.createPreView(language));
|
1576
|
+
this.getCodeBlock().textContent = content;
|
1577
|
+
super.initialize();
|
1578
|
+
});
|
1579
|
+
}
|
1580
|
+
getFileExtension(url) {
|
1581
|
+
const match = url.match(/\.([0-9a-z]+)(?:[\?#]|$)/i);
|
1582
|
+
if (match) {
|
1583
|
+
let extension = match[1];
|
1584
|
+
if (extension === 'scss') {
|
1585
|
+
extension = 'css';
|
1586
|
+
}
|
1587
|
+
return extension;
|
1588
|
+
}
|
1589
|
+
return '';
|
1590
|
+
}
|
1591
|
+
subscribeOnLoadFile(src) {
|
1592
|
+
return this.injector.get(HttpClient).get(src, { responseType: 'text' });
|
1593
|
+
}
|
1594
|
+
createCodeView(container, language) {
|
1595
|
+
const code = document.createElement('code');
|
1596
|
+
code.classList.add(`language-${language}`);
|
1597
|
+
container.appendChild(code);
|
1598
|
+
}
|
1599
|
+
createPreView(language) {
|
1600
|
+
const pre = document.createElement('pre');
|
1601
|
+
this.element.appendChild(pre);
|
1602
|
+
this.createCodeView(pre, language);
|
1603
|
+
return pre;
|
1604
|
+
}
|
1605
|
+
}
|
1606
|
+
|
1607
|
+
class FCodeGroupBodyHandler {
|
1608
|
+
constructor(element, injector) {
|
1609
|
+
this.element = element;
|
1610
|
+
this.injector = injector;
|
1611
|
+
this.fContainerHandlers = this.getCodeViews();
|
1612
|
+
this.initialize();
|
1613
|
+
}
|
1614
|
+
initialize() {
|
1615
|
+
this.toggle(0);
|
1616
|
+
}
|
1617
|
+
getCodeViews() {
|
1618
|
+
return this.getGroupBodyChildren().map((x) => {
|
1619
|
+
if (this.isCodeView(x)) {
|
1620
|
+
return new FCodeViewHandler(x, this.injector);
|
1621
|
+
}
|
1622
|
+
else if (this.isAsyncCodeView(x)) {
|
1623
|
+
return new FAsyncCodeViewHandler(x, this.injector);
|
1624
|
+
}
|
1625
|
+
else {
|
1626
|
+
return new FExampleViewHandler(x);
|
1627
|
+
}
|
1628
|
+
});
|
1629
|
+
}
|
1630
|
+
getGroupBodyChildren() {
|
1631
|
+
return Array.from(this.element.querySelector('.f-code-group-body').children);
|
1632
|
+
}
|
1633
|
+
isCodeView(element) {
|
1634
|
+
return element.classList.contains('f-code-view');
|
1635
|
+
}
|
1636
|
+
isAsyncCodeView(element) {
|
1637
|
+
return element.classList.contains('f-async-code-view');
|
1638
|
+
}
|
1639
|
+
toggle(index) {
|
1640
|
+
this.fContainerHandlers.forEach((fContainer, tabIndex) => {
|
1641
|
+
fContainer.setDisplay(tabIndex === index ? 'block' : 'none');
|
1642
|
+
});
|
1643
|
+
}
|
1644
|
+
dispose() {
|
1645
|
+
this.fContainerHandlers.forEach((x) => x.dispose?.());
|
1646
|
+
}
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
class FCodeGroupHandler {
|
1650
|
+
get tabs() {
|
1651
|
+
return Array.from(this.element.querySelectorAll('.f-tab-button'));
|
1652
|
+
}
|
1653
|
+
get firstTab() {
|
1654
|
+
const tabs = this.tabs;
|
1655
|
+
if (!tabs.length) {
|
1656
|
+
return undefined;
|
1657
|
+
}
|
1658
|
+
return tabs[0];
|
1659
|
+
}
|
1660
|
+
constructor(element, injector) {
|
1661
|
+
this.element = element;
|
1662
|
+
this.injector = injector;
|
1663
|
+
this.subscriptions$ = new Subscription();
|
1664
|
+
this.body = new FCodeGroupBodyHandler(this.element, this.injector);
|
1665
|
+
this.initialize();
|
1666
|
+
}
|
1667
|
+
initialize() {
|
1668
|
+
this.subscribeOnTabsClick();
|
1669
|
+
this.onTabClick(this.firstTab);
|
1670
|
+
}
|
1671
|
+
subscribeOnTabsClick() {
|
1672
|
+
this.tabs.forEach((tab) => {
|
1673
|
+
this.subscriptions$.add(this.subscribeOnTabClick(tab));
|
1674
|
+
});
|
1675
|
+
}
|
1676
|
+
subscribeOnTabClick(tab) {
|
1677
|
+
return fromEvent(tab, 'click').subscribe(() => this.onTabClick(tab));
|
1678
|
+
}
|
1679
|
+
onTabClick(targetTab) {
|
1680
|
+
if (targetTab) {
|
1681
|
+
this.markActiveTab(targetTab);
|
1682
|
+
this.body.toggle(this.getTargetTabIndex(targetTab));
|
1683
|
+
}
|
1684
|
+
}
|
1685
|
+
markActiveTab(target) {
|
1686
|
+
this.tabs.forEach(tab => tab.classList.remove('active'));
|
1687
|
+
target.classList.add('active');
|
1688
|
+
}
|
1689
|
+
getTargetTabIndex(target) {
|
1690
|
+
return this.tabs.indexOf(target);
|
1691
|
+
}
|
1692
|
+
dispose() {
|
1693
|
+
this.body.dispose();
|
1694
|
+
this.subscriptions$.unsubscribe();
|
1695
|
+
}
|
1696
|
+
}
|
1697
|
+
|
1698
|
+
class HandleParsedContainersHandler {
|
1699
|
+
constructor(injector) {
|
1700
|
+
this.injector = injector;
|
1701
|
+
this.fCodeGroupHandler = [];
|
1702
|
+
this.fCodeViewHandler = [];
|
1703
|
+
}
|
1704
|
+
handle(request) {
|
1705
|
+
this.dispose();
|
1706
|
+
this.fCodeGroupHandler = this.getCodeGroups(request.hostElement);
|
1707
|
+
this.fCodeViewHandler = this.getCodeViews(request.hostElement);
|
1708
|
+
}
|
1709
|
+
getCodeGroups(hostElement) {
|
1710
|
+
return Array.from(hostElement.querySelectorAll('.f-code-group'))
|
1711
|
+
.map((x) => new FCodeGroupHandler(x, this.injector));
|
1712
|
+
}
|
1713
|
+
getCodeViews(hostElement) {
|
1714
|
+
return Array.from(hostElement.querySelectorAll('.f-code-view'))
|
1715
|
+
.filter((x) => !x.parentElement?.classList.contains('f-code-group-body'))
|
1716
|
+
.map((x) => new FCodeViewHandler(x, this.injector));
|
1717
|
+
}
|
1718
|
+
dispose() {
|
1719
|
+
this.fCodeGroupHandler.forEach((x) => x.dispose?.());
|
1720
|
+
this.fCodeViewHandler.forEach((x) => x.dispose?.());
|
1721
|
+
}
|
1722
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleParsedContainersHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1723
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleParsedContainersHandler }); }
|
1724
|
+
}
|
1725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HandleParsedContainersHandler, decorators: [{
|
1726
|
+
type: Injectable
|
1727
|
+
}], ctorParameters: () => [{ type: i0.Injector }] });
|
1728
|
+
|
1729
|
+
class HandleParsedContainersRequest {
|
1730
|
+
constructor(hostElement) {
|
1731
|
+
this.hostElement = hostElement;
|
1732
|
+
}
|
1733
|
+
}
|
1734
|
+
|
1735
|
+
var EMarkdownContainerType;
|
1736
|
+
(function (EMarkdownContainerType) {
|
1737
|
+
EMarkdownContainerType["CODE_GROUP"] = "code-group";
|
1738
|
+
EMarkdownContainerType["EXAMPLE_GROUP"] = "ng-component";
|
1739
|
+
EMarkdownContainerType["PREVIEW_GROUP"] = "preview-group";
|
1740
|
+
EMarkdownContainerType["CODE_VIEW"] = "code-view";
|
1741
|
+
EMarkdownContainerType["ALERT_TIP"] = "tip";
|
1742
|
+
EMarkdownContainerType["ALERT_INFO"] = "info";
|
1743
|
+
EMarkdownContainerType["ALERT_WARNING"] = "warning";
|
1744
|
+
EMarkdownContainerType["ALERT_DANGER"] = "danger";
|
1745
|
+
EMarkdownContainerType["ALERT_SUCCESS"] = "success";
|
1746
|
+
})(EMarkdownContainerType || (EMarkdownContainerType = {}));
|
1747
|
+
|
1748
|
+
class ParseAlerts {
|
1749
|
+
render(type, markdown) {
|
1750
|
+
return [container, type, {
|
1751
|
+
render: (tokens, index) => {
|
1752
|
+
const token = tokens[index];
|
1753
|
+
const info = token.info.trim().slice(type.length).trim();
|
1754
|
+
if (token.nesting === 1) {
|
1755
|
+
const title = markdown.renderInline(info);
|
1756
|
+
return `<div class="f-alert ${type}"><p class="f-alert-title">${title}</p>\n`;
|
1757
|
+
}
|
1758
|
+
else {
|
1759
|
+
return `</div>\n`;
|
1760
|
+
}
|
1761
|
+
}
|
1762
|
+
}];
|
1763
|
+
}
|
1764
|
+
}
|
1765
|
+
|
1766
|
+
const F_CONTAINER_CLOSE_TAG = 'container_code-group_close';
|
1767
|
+
class ParseCodeGroup {
|
1768
|
+
render() {
|
1769
|
+
return [container, EMarkdownContainerType.CODE_GROUP, {
|
1770
|
+
render: (tokens, index) => {
|
1771
|
+
if (this.isOpeningToken(tokens, index)) {
|
1772
|
+
return this.openingGroupHTML(this.generateTabs(tokens, index));
|
1773
|
+
}
|
1774
|
+
return this.closingGroupHTML();
|
1775
|
+
}
|
1776
|
+
}];
|
1777
|
+
}
|
1778
|
+
isOpeningToken(tokens, index) {
|
1779
|
+
return tokens[index].nesting === 1;
|
1780
|
+
}
|
1781
|
+
generateTabs(tokens, index) {
|
1782
|
+
let result = '';
|
1783
|
+
for (let i = index + 1; !this.isClosingToken(tokens, i); i++) {
|
1784
|
+
if (this.isCodeFenceToken(tokens[i])) {
|
1785
|
+
const title = this.getCodeBlockTitle(tokens[i].info);
|
1786
|
+
if (title) {
|
1787
|
+
result += this.generateTabButton(title);
|
1788
|
+
}
|
1789
|
+
}
|
1790
|
+
}
|
1791
|
+
return result;
|
1792
|
+
}
|
1793
|
+
isClosingToken(token, index) {
|
1794
|
+
return token[index].nesting === -1 && token[index].type === F_CONTAINER_CLOSE_TAG;
|
1795
|
+
}
|
1796
|
+
isCodeFenceToken(token) {
|
1797
|
+
return token.type === 'fence' && token.tag === 'code';
|
1798
|
+
}
|
1799
|
+
generateTabButton(title) {
|
1800
|
+
return `<button class="f-tab-button">${title}</button>`;
|
1801
|
+
}
|
1802
|
+
openingGroupHTML(tabs) {
|
1803
|
+
return `<div class="f-code-group"><div class="f-code-group-tabs">${tabs}</div><div class="f-code-group-body">\n`;
|
1804
|
+
}
|
1805
|
+
closingGroupHTML() {
|
1806
|
+
return `</div></div>\n`;
|
1807
|
+
}
|
1808
|
+
getCodeBlockTitle(data) {
|
1809
|
+
return data.match(/\[(.*)\]/)?.[1] || this.getCodeLanguage(data) || 'txt';
|
1810
|
+
}
|
1811
|
+
getCodeLanguage(data) {
|
1812
|
+
return data.trim()
|
1813
|
+
.replace(/=(\d*)/, '')
|
1814
|
+
.replace(/^ansi$/, '');
|
1815
|
+
}
|
1816
|
+
}
|
1817
|
+
|
1818
|
+
class ParseCodeView {
|
1819
|
+
render(markdown) {
|
1820
|
+
const fence = markdown.renderer.rules.fence;
|
1821
|
+
if (!fence) {
|
1822
|
+
throw new Error('Markdown renderer does not have a fence rule.');
|
1823
|
+
}
|
1824
|
+
markdown.renderer.rules.fence = (tokens, index, ...rest) => {
|
1825
|
+
return (`<div class="f-code-view">${fence(tokens, index, ...rest)}</div>`);
|
1826
|
+
};
|
1827
|
+
}
|
1828
|
+
cleanTokenInfo(info) {
|
1829
|
+
return info.replace(/\[.*\]/, '');
|
1830
|
+
}
|
1831
|
+
}
|
1832
|
+
|
1833
|
+
function getContent(tokens, index, eContainerType) {
|
1834
|
+
let result;
|
1835
|
+
for (let i = index + 1; i < tokens.length; i++) {
|
1836
|
+
if (tokens[i].type === `container_${eContainerType}_close`) {
|
1837
|
+
break;
|
1838
|
+
}
|
1839
|
+
if (isInlineToken(tokens[i])) {
|
1840
|
+
result = tokens[i].content;
|
1841
|
+
break;
|
1842
|
+
}
|
1843
|
+
}
|
1844
|
+
return result;
|
1845
|
+
}
|
1846
|
+
function isInlineToken(token) {
|
1847
|
+
return token.type === 'inline' && !token.tag;
|
1848
|
+
}
|
1849
|
+
|
1850
|
+
class ParseExampleGroup {
|
1851
|
+
render() {
|
1852
|
+
return [container, EMarkdownContainerType.EXAMPLE_GROUP, {
|
1853
|
+
render: (tokens, index) => {
|
1854
|
+
if (this.isOpeningToken(tokens, index)) {
|
1855
|
+
return this.openingExampleGroupHTML(this.generateData(tokens, index));
|
1856
|
+
}
|
1857
|
+
return this.closingExampleGroupHTML();
|
1858
|
+
}
|
1859
|
+
}];
|
1860
|
+
}
|
1861
|
+
isNgComponent(token) {
|
1862
|
+
return token.info.trim().startsWith(EMarkdownContainerType.EXAMPLE_GROUP);
|
1863
|
+
}
|
1864
|
+
isOpeningToken(tokens, index) {
|
1865
|
+
return tokens[index].nesting === 1;
|
1866
|
+
}
|
1867
|
+
generateData(tokens, index) {
|
1868
|
+
let tabs = '';
|
1869
|
+
let views = '';
|
1870
|
+
const component = this.parseComponentTags(tokens[index]);
|
1871
|
+
if (component) {
|
1872
|
+
tabs += this.generateTabButton('Example');
|
1873
|
+
views += this.generateExampleView(component);
|
1874
|
+
}
|
1875
|
+
const content = getContent(tokens, index, EMarkdownContainerType.EXAMPLE_GROUP);
|
1876
|
+
if (content) {
|
1877
|
+
this.parseData(content).forEach((x) => {
|
1878
|
+
tabs += this.generateTabButton(x.fileName);
|
1879
|
+
views += this.generateAsyncCodeView(x.url);
|
1880
|
+
});
|
1881
|
+
}
|
1882
|
+
else {
|
1883
|
+
tabs = '';
|
1884
|
+
}
|
1885
|
+
return { tabs, views };
|
1886
|
+
}
|
1887
|
+
parseComponentTags(token) {
|
1888
|
+
if (!this.isNgComponent(token)) {
|
1889
|
+
return { tag: '', height: '' };
|
1890
|
+
}
|
1891
|
+
let cleanedInput = token.info.replace(/ng-component\s*/, '');
|
1892
|
+
const tagMatch = cleanedInput.match(/<([a-zA-Z0-9-]+)>.*<\/\1>/);
|
1893
|
+
const heightMatch = cleanedInput.match(/\[height\]="(\d+)"/);
|
1894
|
+
if (!tagMatch) {
|
1895
|
+
throw new Error("Invalid input: no valid tag found");
|
1896
|
+
}
|
1897
|
+
const tag = tagMatch[0];
|
1898
|
+
const height = heightMatch ? heightMatch[1] : undefined;
|
1899
|
+
return { tag, height };
|
1900
|
+
}
|
1901
|
+
parseData(data) {
|
1902
|
+
return data.split('\n').map(this.extractFileData).filter(Boolean);
|
1903
|
+
}
|
1904
|
+
extractFileData(line) {
|
1905
|
+
const match = line.match(/\[(.+?)\] <<< (.+)/);
|
1906
|
+
return match ? { fileName: match[1], url: match[2] } : null;
|
1907
|
+
}
|
1908
|
+
openingExampleGroupHTML(data) {
|
1909
|
+
return `<div class="f-code-group">${this.groupTabsHTML(data.tabs)}${this.groupBodyHTML(data.views)}`;
|
1910
|
+
}
|
1911
|
+
groupTabsHTML(content) {
|
1912
|
+
let result = `<div class="f-code-group-tabs">${content}</div>`;
|
1913
|
+
if (!content) {
|
1914
|
+
result = '';
|
1915
|
+
}
|
1916
|
+
return result;
|
1917
|
+
}
|
1918
|
+
generateTabButton(content) {
|
1919
|
+
return `<button class="f-tab-button">${content}</button>`;
|
1920
|
+
}
|
1921
|
+
groupBodyHTML(content) {
|
1922
|
+
return `<div class="f-code-group-body">${content}`;
|
1923
|
+
}
|
1924
|
+
generateExampleView(content) {
|
1925
|
+
let height = '';
|
1926
|
+
if (content.height) {
|
1927
|
+
height = `style="height: ${content.height}px"`;
|
1928
|
+
}
|
1929
|
+
return `<div class="f-example-view" ${height}>${content.tag}</div>`;
|
1930
|
+
}
|
1931
|
+
generateAsyncCodeView(content) {
|
1932
|
+
return `<div class="f-async-code-view">${content}</div>`;
|
1933
|
+
}
|
1934
|
+
closingExampleGroupHTML() {
|
1935
|
+
return `</div></div>\n`;
|
1936
|
+
}
|
1937
|
+
}
|
1938
|
+
|
1939
|
+
class ParsePreviewGroup {
|
1940
|
+
constructor(navigation) {
|
1941
|
+
this.navigation = navigation;
|
1942
|
+
}
|
1943
|
+
render() {
|
1944
|
+
return [container, EMarkdownContainerType.PREVIEW_GROUP, {
|
1945
|
+
render: (tokens, index) => {
|
1946
|
+
if (this.isOpeningToken(tokens, index)) {
|
1947
|
+
return this.getGroupsHTML(this.generateData(tokens, index));
|
1948
|
+
}
|
1949
|
+
return '';
|
1950
|
+
}
|
1951
|
+
}];
|
1952
|
+
}
|
1953
|
+
isOpeningToken(tokens, index) {
|
1954
|
+
return tokens[index].nesting === 1;
|
1955
|
+
}
|
1956
|
+
generateData(tokens, index) {
|
1957
|
+
const groups = [];
|
1958
|
+
this.parseData(getContent(tokens, index, EMarkdownContainerType.PREVIEW_GROUP) || '').forEach((x) => {
|
1959
|
+
const group = this.navigation.find((g) => g.text === x);
|
1960
|
+
if (group) {
|
1961
|
+
groups.push(group);
|
1962
|
+
}
|
1963
|
+
});
|
1964
|
+
return groups;
|
1965
|
+
}
|
1966
|
+
parseData(data) {
|
1967
|
+
return data.split('\n').map(this.extractFileData).filter(Boolean);
|
1968
|
+
}
|
1969
|
+
extractFileData(line) {
|
1970
|
+
const match = line.match(/\[(.+?)\]/);
|
1971
|
+
return match ? match[1] : null;
|
1972
|
+
}
|
1973
|
+
getGroupsHTML(groups) {
|
1974
|
+
return (groups || []).map((x) => {
|
1975
|
+
return `<h2>${x.text}</h2><div class="f-preview-group">${this.getItemsHTML(x)}</div>`;
|
1976
|
+
}).join('');
|
1977
|
+
}
|
1978
|
+
getItemsHTML(group) {
|
1979
|
+
return group.items.map((item) => {
|
1980
|
+
return `<f-preview data-group="${group.text}" data-item="${item.link}"></f-preview>`;
|
1981
|
+
}).join('');
|
1982
|
+
}
|
1983
|
+
}
|
1984
|
+
|
1985
|
+
class MarkdownService {
|
1986
|
+
constructor(httpClient, domSanitizer, fEnvironment, router) {
|
1987
|
+
this.httpClient = httpClient;
|
1988
|
+
this.domSanitizer = domSanitizer;
|
1989
|
+
this.fEnvironment = fEnvironment;
|
1990
|
+
this.router = router;
|
1991
|
+
this.markdown = new MarkdownIt({ html: true, linkify: true });
|
1992
|
+
this.markdown
|
1993
|
+
.use((x) => new ParseCodeView().render(x))
|
1994
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_TIP, this.markdown))
|
1995
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_INFO, this.markdown))
|
1996
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_WARNING, this.markdown))
|
1997
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_DANGER, this.markdown))
|
1998
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_DANGER, this.markdown))
|
1999
|
+
.use(...new ParseAlerts().render(EMarkdownContainerType.ALERT_SUCCESS, this.markdown))
|
2000
|
+
.use(...new ParseCodeGroup().render())
|
2001
|
+
.use(...new ParsePreviewGroup(this.fEnvironment.getNavigation()).render())
|
2002
|
+
.use(...new ParseExampleGroup().render());
|
2003
|
+
}
|
2004
|
+
parse(src) {
|
2005
|
+
return this.httpClient.get(src, { responseType: 'text' }).pipe(take(1), catchError(() => of(''))).pipe(switchMap((text) => of(this.markdown.render(text))), switchMap((x) => of(this.cleanupEmptyParagraphs(x))), switchMap((x) => of(this.cleanupWasteParagraphFromExampleView(x))), switchMap((x) => of(this.cleanupWasteParagraphFromPreviewGroup(x))), switchMap((x) => of(this.normalizeLinks(x))), switchMap((x) => of(this.domSanitizer.bypassSecurityTrustHtml(x))));
|
2006
|
+
}
|
2007
|
+
normalizeLinks(html) {
|
2008
|
+
const currentPath = this.router.url;
|
2009
|
+
const prefix = currentPath.substring(0, currentPath.lastIndexOf('/'));
|
2010
|
+
return html.replace(/<a\s+href="([^"]*)"/g, (match, href) => {
|
2011
|
+
if (!this.isExternalLink(href)) {
|
2012
|
+
let newHref = href.substring(0);
|
2013
|
+
if (!href.startsWith('./')) {
|
2014
|
+
newHref = href.startsWith('/') ? `${prefix}${href}` : `${prefix}/${href}`;
|
2015
|
+
}
|
2016
|
+
return `<a href="${newHref}"`;
|
2017
|
+
}
|
2018
|
+
return match;
|
2019
|
+
});
|
2020
|
+
}
|
2021
|
+
isExternalLink(href) {
|
2022
|
+
return href.startsWith('www') || href.startsWith('http');
|
2023
|
+
}
|
2024
|
+
cleanupEmptyParagraphs(html) {
|
2025
|
+
return html.replace(/<p>\s*<\/p>/g, '');
|
2026
|
+
}
|
2027
|
+
cleanupWasteParagraphFromExampleView(html) {
|
2028
|
+
return html.replace(/<div class="f-code-group-body">\s*<p>[^<]*<\/p>/g, '<div class="f-code-group-body">');
|
2029
|
+
}
|
2030
|
+
cleanupWasteParagraphFromPreviewGroup(html) {
|
2031
|
+
return html.replace(/<p>(\[[^\]]+\](\s*\[[^\]]+\])*)<\/p>/g, '');
|
2032
|
+
}
|
2033
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MarkdownService, deps: [{ token: i1$1.HttpClient }, { token: i2$1.DomSanitizer }, { token: FEnvironmentService }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2034
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MarkdownService }); }
|
2035
|
+
}
|
2036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MarkdownService, decorators: [{
|
2037
|
+
type: Injectable
|
2038
|
+
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: i2$1.DomSanitizer }, { type: FEnvironmentService }, { type: i1.Router }] });
|
2039
|
+
|
2040
|
+
class GetPreviousNextPageNavigationResponse {
|
2041
|
+
constructor(previousLink, nextLink) {
|
2042
|
+
this.previousLink = previousLink;
|
2043
|
+
this.nextLink = nextLink;
|
2044
|
+
}
|
2045
|
+
}
|
2046
|
+
|
2047
|
+
class GetPreviousNextPageNavigationHandler {
|
2048
|
+
constructor(fEnvironmentService) {
|
2049
|
+
this.fEnvironmentService = fEnvironmentService;
|
2050
|
+
}
|
2051
|
+
handle(request) {
|
2052
|
+
let previous = undefined;
|
2053
|
+
let next = undefined;
|
2054
|
+
this.fEnvironmentService.getNavigation().forEach((group, groupIndex) => {
|
2055
|
+
(group.items || []).forEach((item, index) => {
|
2056
|
+
if (item.link === request.currentLink) {
|
2057
|
+
if (index > 0) {
|
2058
|
+
previous = { ...group.items[index - 1] };
|
2059
|
+
}
|
2060
|
+
else {
|
2061
|
+
if (groupIndex > 0) {
|
2062
|
+
const previousGroup = this.fEnvironmentService.getNavigation()[groupIndex - 1];
|
2063
|
+
previous = { ...previousGroup.items[previousGroup.items.length - 1] };
|
2064
|
+
}
|
2065
|
+
}
|
2066
|
+
if (index < group.items.length - 1) {
|
2067
|
+
next = { ...group.items[index + 1] };
|
2068
|
+
}
|
2069
|
+
else {
|
2070
|
+
if (groupIndex < this.fEnvironmentService.getNavigation().length - 1) {
|
2071
|
+
const nextGroup = this.fEnvironmentService.getNavigation()[groupIndex + 1];
|
2072
|
+
next = { ...nextGroup.items[0] };
|
2073
|
+
}
|
2074
|
+
}
|
2075
|
+
}
|
2076
|
+
});
|
2077
|
+
});
|
2078
|
+
return new GetPreviousNextPageNavigationResponse(previous, next);
|
2079
|
+
}
|
2080
|
+
}
|
2081
|
+
|
2082
|
+
class GetPreviousNextPageNavigationRequest {
|
2083
|
+
constructor(currentLink) {
|
2084
|
+
this.currentLink = currentLink;
|
2085
|
+
}
|
2086
|
+
}
|
2087
|
+
|
2088
|
+
class FFooterEditInformationComponent {
|
2089
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterEditInformationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2090
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FFooterEditInformationComponent, isStandalone: true, selector: "f-footer-edit-information", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{padding-bottom:18px}@media (min-width: 640px){:host{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2091
|
+
}
|
2092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterEditInformationComponent, decorators: [{
|
2093
|
+
type: Component,
|
2094
|
+
args: [{ selector: 'f-footer-edit-information', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{padding-bottom:18px}@media (min-width: 640px){:host{display:flex;justify-content:space-between;align-items:center;padding-bottom:14px}}\n"] }]
|
2095
|
+
}] });
|
2096
|
+
|
2097
|
+
class FFooterNavigationButtonComponent {
|
2098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterNavigationButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FFooterNavigationButtonComponent, isStandalone: true, selector: "a[f-footer-navigation-button]", inputs: { description: "description", link: "link" }, ngImport: i0, template: "<span class=\"description\">{{ description }}</span>\n<span class=\"page-title\">{{ link.text }}</span>\n", styles: [":host{display:block;border:1px solid var(--divider-color);border-radius:2px;padding:12px 16px;flex:1;max-width:50%;min-width:260px;text-decoration:none!important;cursor:pointer;pointer-events:all}:host:hover{border-color:var(--dark-divider-color)}:host:active{border-color:var(--primary-1)}:host.next{margin-left:auto;text-align:right}:host .description{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--secondary-text);pointer-events:none}:host .page-title{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--primary-1);pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2100
|
+
}
|
2101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterNavigationButtonComponent, decorators: [{
|
2102
|
+
type: Component,
|
2103
|
+
args: [{ selector: 'a[f-footer-navigation-button]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<span class=\"description\">{{ description }}</span>\n<span class=\"page-title\">{{ link.text }}</span>\n", styles: [":host{display:block;border:1px solid var(--divider-color);border-radius:2px;padding:12px 16px;flex:1;max-width:50%;min-width:260px;text-decoration:none!important;cursor:pointer;pointer-events:all}:host:hover{border-color:var(--dark-divider-color)}:host:active{border-color:var(--primary-1)}:host.next{margin-left:auto;text-align:right}:host .description{display:block;line-height:20px;font-size:12px;font-weight:500;color:var(--secondary-text);pointer-events:none}:host .page-title{display:block;line-height:20px;font-size:14px;font-weight:500;color:var(--primary-1);pointer-events:none}\n"] }]
|
2104
|
+
}], propDecorators: { description: [{
|
2105
|
+
type: Input,
|
2106
|
+
args: [{ required: true }]
|
2107
|
+
}], link: [{
|
2108
|
+
type: Input,
|
2109
|
+
args: [{ required: true }]
|
2110
|
+
}] } });
|
2111
|
+
|
2112
|
+
class FFooterNavigationComponent {
|
2113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FFooterNavigationComponent, isStandalone: true, selector: "nav[f-footer-navigation]", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{border-top:1px solid var(--divider-color);padding-top:24px;display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;gap:16px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2115
|
+
}
|
2116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterNavigationComponent, decorators: [{
|
2117
|
+
type: Component,
|
2118
|
+
args: [{ selector: 'nav[f-footer-navigation]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{border-top:1px solid var(--divider-color);padding-top:24px;display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;gap:16px}\n"] }]
|
2119
|
+
}] });
|
2120
|
+
|
2121
|
+
class FFooterEditLinkComponent {
|
2122
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterEditLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2123
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FFooterEditLinkComponent, isStandalone: true, selector: "a[f-footer-edit-link]", ngImport: i0, template: "<span class=\"edit-link-icon f-icon edit\"></span>\n<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--primary-1);cursor:pointer}:host .edit-link-icon{margin-right:8px;width:14px;height:14px;color:inherit}:host:hover{color:var(--primary-2)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2124
|
+
}
|
2125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterEditLinkComponent, decorators: [{
|
2126
|
+
type: Component,
|
2127
|
+
args: [{ selector: 'a[f-footer-edit-link]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<span class=\"edit-link-icon f-icon edit\"></span>\n<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center;border:0;line-height:32px;font-size:14px;font-weight:500;color:var(--primary-1);cursor:pointer}:host .edit-link-icon{margin-right:8px;width:14px;height:14px;color:inherit}:host:hover{color:var(--primary-2)}\n"] }]
|
2128
|
+
}] });
|
2129
|
+
|
2130
|
+
class FFooterLastUpdatedComponent {
|
2131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterLastUpdatedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2132
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FFooterLastUpdatedComponent, isStandalone: true, selector: "f-footer-last-updated", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{line-height:24px;font-size:14px;font-weight:500;color:var(--secondary-text)}@media (min-width: 640px){:host{line-height:32px;font-size:14px;font-weight:500}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2133
|
+
}
|
2134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FFooterLastUpdatedComponent, decorators: [{
|
2135
|
+
type: Component,
|
2136
|
+
args: [{ selector: 'f-footer-last-updated', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-content></ng-content>\n", styles: [":host{line-height:24px;font-size:14px;font-weight:500;color:var(--secondary-text)}@media (min-width: 640px){:host{line-height:32px;font-size:14px;font-weight:500}}\n"] }]
|
2137
|
+
}] });
|
2138
|
+
|
2139
|
+
class FMarkdownFooterComponent {
|
2140
|
+
constructor(injector, fEnvironmentService, router, changeDetectorRef) {
|
2141
|
+
this.injector = injector;
|
2142
|
+
this.fEnvironmentService = fEnvironmentService;
|
2143
|
+
this.router = router;
|
2144
|
+
this.changeDetectorRef = changeDetectorRef;
|
2145
|
+
this.subscriptions$ = new Subscription();
|
2146
|
+
this.navigation = {};
|
2147
|
+
}
|
2148
|
+
ngOnInit() {
|
2149
|
+
this.subscriptions$.add(this.subscribeOnRouteChanges());
|
2150
|
+
}
|
2151
|
+
subscribeOnRouteChanges() {
|
2152
|
+
return this.getRouterEvents().pipe(startWith(null), debounceTime(10)).subscribe(() => this.updateData());
|
2153
|
+
}
|
2154
|
+
getRouterEvents() {
|
2155
|
+
return this.injector.get(Router).events;
|
2156
|
+
}
|
2157
|
+
updateData() {
|
2158
|
+
const currentPath = this.router.url;
|
2159
|
+
const prefix = currentPath.substring(0, currentPath.lastIndexOf('/'));
|
2160
|
+
this.navigation = JSON.parse(JSON.stringify(this.fEnvironmentService.getFooterNavigation()));
|
2161
|
+
if (this.navigation.editLink) {
|
2162
|
+
this.editLink = this.getEditLink();
|
2163
|
+
}
|
2164
|
+
const previousNext = new GetPreviousNextPageNavigationHandler(this.fEnvironmentService).handle(new GetPreviousNextPageNavigationRequest(this.getCurrentLink()));
|
2165
|
+
this.previousLink = previousNext.previousLink;
|
2166
|
+
this.normalizeLink(this.previousLink, prefix);
|
2167
|
+
this.nextLink = previousNext.nextLink;
|
2168
|
+
this.normalizeLink(this.nextLink, prefix);
|
2169
|
+
this.changeDetectorRef.markForCheck();
|
2170
|
+
}
|
2171
|
+
normalizeLink(item, prefix) {
|
2172
|
+
if (item?.link && !this.isExternalLink(item.link)) {
|
2173
|
+
item.link = item.link.startsWith('/') ? `${prefix}${item.link}` : `${prefix}/${item.link}`;
|
2174
|
+
}
|
2175
|
+
}
|
2176
|
+
isExternalLink(href) {
|
2177
|
+
return href.startsWith('www') || href.startsWith('http');
|
2178
|
+
}
|
2179
|
+
getEditLink() {
|
2180
|
+
return this.navigation.editLink.pattern + this.getCurrentLink() + '.md';
|
2181
|
+
}
|
2182
|
+
getCurrentLink() {
|
2183
|
+
return this.injector.get(ActivatedRoute).snapshot.url.map((x) => x.path).join('/');
|
2184
|
+
}
|
2185
|
+
onDocumentClick(event) {
|
2186
|
+
this.injector.get(HandleNavigationLinksHandler).handle(new HandleNavigationLinksRequest(event));
|
2187
|
+
}
|
2188
|
+
ngOnDestroy() {
|
2189
|
+
this.subscriptions$.unsubscribe();
|
2190
|
+
}
|
2191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMarkdownFooterComponent, deps: [{ token: i0.Injector }, { token: FEnvironmentService }, { token: i1.Router }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
2192
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FMarkdownFooterComponent, isStandalone: true, selector: "footer [f-markdown-footer]", host: { listeners: { "click": "onDocumentClick($event)" } }, ngImport: i0, template: "@if (editLink) {\n <f-footer-edit-information>\n <a f-footer-edit-link [href]=\"editLink\">\n {{ navigation.editLink?.text || 'Edit this page on GitHub' }}\n </a>\n\n <!-- <f-footer-last-updated>-->\n <!-- Last updated: <span>{{ lastUpdated.datetime }}</span>-->\n <!-- </f-footer-last-updated>-->\n </f-footer-edit-information>\n}\n\n@if (previousLink || nextLink) {\n <nav f-footer-navigation>\n @if (previousLink) {\n <a f-footer-navigation-button\n [href]=\"previousLink.link\"\n [description]=\"navigation.previous\"\n [link]=\"previousLink\">\n </a>\n }\n @if (nextLink) {\n <a f-footer-navigation-button class=\"next\"\n [href]=\"nextLink.link\"\n [description]=\"navigation.next\"\n [link]=\"nextLink\">\n </a>\n }\n </nav>\n}\n\n", styles: [":host{display:block;margin-top:64px}\n"], dependencies: [{ kind: "component", type: FFooterNavigationComponent, selector: "nav[f-footer-navigation]" }, { kind: "component", type: FFooterNavigationButtonComponent, selector: "a[f-footer-navigation-button]", inputs: ["description", "link"] }, { kind: "component", type: FFooterEditInformationComponent, selector: "f-footer-edit-information" }, { kind: "component", type: FFooterEditLinkComponent, selector: "a[f-footer-edit-link]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2193
|
+
}
|
2194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMarkdownFooterComponent, decorators: [{
|
2195
|
+
type: Component,
|
2196
|
+
args: [{ selector: 'footer [f-markdown-footer]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
2197
|
+
FFooterNavigationComponent,
|
2198
|
+
FFooterNavigationButtonComponent,
|
2199
|
+
FFooterEditInformationComponent,
|
2200
|
+
FFooterEditLinkComponent,
|
2201
|
+
FFooterLastUpdatedComponent,
|
2202
|
+
RouterLink,
|
2203
|
+
], standalone: true, template: "@if (editLink) {\n <f-footer-edit-information>\n <a f-footer-edit-link [href]=\"editLink\">\n {{ navigation.editLink?.text || 'Edit this page on GitHub' }}\n </a>\n\n <!-- <f-footer-last-updated>-->\n <!-- Last updated: <span>{{ lastUpdated.datetime }}</span>-->\n <!-- </f-footer-last-updated>-->\n </f-footer-edit-information>\n}\n\n@if (previousLink || nextLink) {\n <nav f-footer-navigation>\n @if (previousLink) {\n <a f-footer-navigation-button\n [href]=\"previousLink.link\"\n [description]=\"navigation.previous\"\n [link]=\"previousLink\">\n </a>\n }\n @if (nextLink) {\n <a f-footer-navigation-button class=\"next\"\n [href]=\"nextLink.link\"\n [description]=\"navigation.next\"\n [link]=\"nextLink\">\n </a>\n }\n </nav>\n}\n\n", styles: [":host{display:block;margin-top:64px}\n"] }]
|
2204
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: FEnvironmentService }, { type: i1.Router }, { type: i0.ChangeDetectorRef }], propDecorators: { onDocumentClick: [{
|
2205
|
+
type: HostListener,
|
2206
|
+
args: ['click', ['$event']]
|
2207
|
+
}] } });
|
2208
|
+
|
2209
|
+
class FMarkdownRendererComponent {
|
2210
|
+
constructor(injector, changeDetectorRef) {
|
2211
|
+
this.injector = injector;
|
2212
|
+
this.changeDetectorRef = changeDetectorRef;
|
2213
|
+
this.subscriptions$ = new Subscription();
|
2214
|
+
this.hostElement = inject(ElementRef).nativeElement;
|
2215
|
+
this.fScrollableService = inject(FScrollableService);
|
2216
|
+
this.fContainersHandler = inject(HandleParsedContainersHandler);
|
2217
|
+
this.fDynamicComponentsHandler = inject(HandleDynamicComponentsHandler);
|
2218
|
+
this.isMarkdownChanged = false;
|
2219
|
+
}
|
2220
|
+
ngOnInit() {
|
2221
|
+
this.subscriptions$.add(this.subscribeOnRouteChanges());
|
2222
|
+
}
|
2223
|
+
subscribeOnRouteChanges() {
|
2224
|
+
return this.getRouterEvents().pipe(startWith(null), debounceTime(50), switchMap(() => this.injector.get(MarkdownService).parse(this.injector.get(FEnvironmentService).getMarkdownUrl(this.markdownPath))), tap((x) => this.renderMarkdown(x)), catchError((e, data) => data)).subscribe();
|
2225
|
+
}
|
2226
|
+
getRouterEvents() {
|
2227
|
+
return this.injector.get(Router).events;
|
2228
|
+
}
|
2229
|
+
get markdownPath() {
|
2230
|
+
return this.injector.get(ActivatedRoute).snapshot.url.map((x) => x.path).join('/');
|
2231
|
+
}
|
2232
|
+
renderMarkdown(value) {
|
2233
|
+
this.value = value;
|
2234
|
+
this.isMarkdownChanged = true;
|
2235
|
+
this.changeDetectorRef.markForCheck();
|
2236
|
+
}
|
2237
|
+
ngAfterViewChecked() {
|
2238
|
+
if (this.isMarkdownChanged) {
|
2239
|
+
this.isMarkdownChanged = false;
|
2240
|
+
this.fScrollableService.setOnPageNavigation(this.hostElement);
|
2241
|
+
this.fContainersHandler.handle(new HandleParsedContainersRequest(this.hostElement));
|
2242
|
+
this.fDynamicComponentsHandler.handle(new HandleDynamicComponentsRequest(this.hostElement));
|
2243
|
+
}
|
2244
|
+
}
|
2245
|
+
onDocumentClick(event) {
|
2246
|
+
this.injector.get(HandleNavigationLinksHandler).handle(new HandleNavigationLinksRequest(event));
|
2247
|
+
}
|
2248
|
+
ngOnDestroy() {
|
2249
|
+
this.fContainersHandler.dispose();
|
2250
|
+
this.fDynamicComponentsHandler.dispose();
|
2251
|
+
this.subscriptions$.unsubscribe();
|
2252
|
+
}
|
2253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMarkdownRendererComponent, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
2254
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FMarkdownRendererComponent, isStandalone: true, selector: "f-markdown-renderer", host: { listeners: { "click": "onDocumentClick($event)" }, classAttribute: "m-render" }, providers: [
|
2255
|
+
MarkdownService,
|
2256
|
+
HighlightService,
|
2257
|
+
HandleNavigationLinksHandler,
|
2258
|
+
HandleParsedContainersHandler,
|
2259
|
+
HandleDynamicComponentsHandler
|
2260
|
+
], ngImport: i0, template: "<div [innerHTML]=\"value\"></div>\n<footer f-markdown-footer></footer>\n", styles: [":host{display:block;width:100%}@media (min-width: 1280px){:host{width:calc(100% - var(--on-page-navigation-width) - var(--page-padding))}}\n"], dependencies: [{ kind: "component", type: FMarkdownFooterComponent, selector: "footer [f-markdown-footer]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2261
|
+
}
|
2262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FMarkdownRendererComponent, decorators: [{
|
2263
|
+
type: Component,
|
2264
|
+
args: [{ selector: 'f-markdown-renderer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
2265
|
+
MarkdownService,
|
2266
|
+
HighlightService,
|
2267
|
+
HandleNavigationLinksHandler,
|
2268
|
+
HandleParsedContainersHandler,
|
2269
|
+
HandleDynamicComponentsHandler
|
2270
|
+
], imports: [
|
2271
|
+
FMarkdownFooterComponent
|
2272
|
+
], host: {
|
2273
|
+
class: 'm-render'
|
2274
|
+
}, template: "<div [innerHTML]=\"value\"></div>\n<footer f-markdown-footer></footer>\n", styles: [":host{display:block;width:100%}@media (min-width: 1280px){:host{width:calc(100% - var(--on-page-navigation-width) - var(--page-padding))}}\n"] }]
|
2275
|
+
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }], propDecorators: { onDocumentClick: [{
|
2276
|
+
type: HostListener,
|
2277
|
+
args: ['click', ['$event']]
|
2278
|
+
}] } });
|
2279
|
+
|
2280
|
+
class FTableOfContentItemsComponent {
|
2281
|
+
constructor() {
|
2282
|
+
this.items = [];
|
2283
|
+
}
|
2284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FTableOfContentItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2285
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FTableOfContentItemsComponent, isStandalone: true, selector: "ul[f-table-of-content-items]", inputs: { items: "items" }, ngImport: i0, template: "@for (item of items;track item.hash) {\n <li [class.active]=\"item.isActive\"><a class=\"text-ellipsis\" [href]=\"item.hash\">{{ item.title }}</a></li>\n @if (item.children) {\n <ul f-table-of-content-items [items]=\"item.children\"></ul>\n }\n}\n", styles: [":host{list-style:none;margin:0;padding:0}:host li{overflow-wrap:break-word;color:var(--secondary-text);max-width:180px}:host li a{display:block;line-height:var(--on-page-navigation-item-height);font-size:14px;color:inherit;font-weight:400}:host li.active{color:var(--primary-text)}:host li+ul{padding:0 16px}\n"], dependencies: [{ kind: "component", type: FTableOfContentItemsComponent, selector: "ul[f-table-of-content-items]", inputs: ["items"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
2286
|
+
}
|
2287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FTableOfContentItemsComponent, decorators: [{
|
2288
|
+
type: Component,
|
2289
|
+
args: [{ selector: 'ul[f-table-of-content-items]', changeDetection: ChangeDetectionStrategy.Default, standalone: true, template: "@for (item of items;track item.hash) {\n <li [class.active]=\"item.isActive\"><a class=\"text-ellipsis\" [href]=\"item.hash\">{{ item.title }}</a></li>\n @if (item.children) {\n <ul f-table-of-content-items [items]=\"item.children\"></ul>\n }\n}\n", styles: [":host{list-style:none;margin:0;padding:0}:host li{overflow-wrap:break-word;color:var(--secondary-text);max-width:180px}:host li a{display:block;line-height:var(--on-page-navigation-item-height);font-size:14px;color:inherit;font-weight:400}:host li.active{color:var(--primary-text)}:host li+ul{padding:0 16px}\n"] }]
|
2290
|
+
}], propDecorators: { items: [{
|
2291
|
+
type: Input
|
2292
|
+
}] } });
|
2293
|
+
|
2294
|
+
class FTableOfContentComponent {
|
2295
|
+
get onToc$() {
|
2296
|
+
return this.fScrollableService.onToc$;
|
2297
|
+
}
|
2298
|
+
constructor(fEnvironmentService, elementRef, fScrollableService, changeDetectorRef, fBrowser) {
|
2299
|
+
this.fEnvironmentService = fEnvironmentService;
|
2300
|
+
this.elementRef = elementRef;
|
2301
|
+
this.fScrollableService = fScrollableService;
|
2302
|
+
this.changeDetectorRef = changeDetectorRef;
|
2303
|
+
this.fBrowser = fBrowser;
|
2304
|
+
this.subscriptions$ = new Subscription();
|
2305
|
+
this.tocData = new TableOfContentData([], []);
|
2306
|
+
this.activeMarkerPosition = 0;
|
2307
|
+
this.title = this.fEnvironmentService.getToC().title;
|
2308
|
+
}
|
2309
|
+
ngOnInit() {
|
2310
|
+
this.subscriptions$.add(this.subscribeOnPageNavigation());
|
2311
|
+
}
|
2312
|
+
subscribeOnPageNavigation() {
|
2313
|
+
return this.onToc$.subscribe((data) => {
|
2314
|
+
this.tocData = data;
|
2315
|
+
this.activeMarkerPosition = this.getActiveMarkerPosition();
|
2316
|
+
this.changeDetectorRef.detectChanges();
|
2317
|
+
});
|
2318
|
+
}
|
2319
|
+
getActiveMarkerPosition() {
|
2320
|
+
const index = this.tocData.flat.findIndex((x) => x.isActive) || 0;
|
2321
|
+
const itemHeight = parseInt(this.getComputedStyle(this.elementRef.nativeElement).getPropertyValue('--on-page-navigation-item-height'));
|
2322
|
+
return (index + 1) * itemHeight + itemHeight / 4;
|
2323
|
+
}
|
2324
|
+
getComputedStyle(element) {
|
2325
|
+
return this.fBrowser.window.getComputedStyle(element);
|
2326
|
+
}
|
2327
|
+
onDocumentClick(event) {
|
2328
|
+
const target = event.target;
|
2329
|
+
if (target.tagName === 'A') {
|
2330
|
+
event.preventDefault();
|
2331
|
+
this.fScrollableService.scrollTo(target.getAttribute('href'));
|
2332
|
+
}
|
2333
|
+
}
|
2334
|
+
ngOnDestroy() {
|
2335
|
+
this.subscriptions$.unsubscribe();
|
2336
|
+
}
|
2337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FTableOfContentComponent, deps: [{ token: FEnvironmentService }, { token: i0.ElementRef }, { token: FScrollableService }, { token: i0.ChangeDetectorRef }, { token: i2.BrowserService }], target: i0.ɵɵFactoryTarget.Component }); }
|
2338
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FTableOfContentComponent, isStandalone: true, selector: "aside[f-table-of-content]", host: { listeners: { "click": "onDocumentClick($event)" } }, ngImport: i0, template: "<div class=\"title\">{{ title || 'In this article' }}</div>\n<ul f-table-of-content-items [items]=\"tocData.tree\"></ul>\n<div class=\"active-marker\" [style.top]=\"activeMarkerPosition + 'px'\"></div>\n", styles: [":host{--on-page-navigation-item-height: 32px;display:none;padding-left:16px;border-left:1px solid var(--divider-color);font-size:13px;font-weight:500;position:relative}:host .title{line-height:32px;font-size:14px;font-weight:600}@media (min-width: 1280px){:host{display:block;width:var(--on-page-navigation-width);position:fixed;top:calc(var(--header-height) + 48px);right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 3)}}:host .active-marker{position:absolute;top:0;left:0;width:2px;height:calc(var(--on-page-navigation-item-height) / 2);border-radius:2px;background-color:var(--primary-1);transition:top .25s cubic-bezier(0,1,.5,1),opacity .25s}\n"], dependencies: [{ kind: "component", type: FTableOfContentItemsComponent, selector: "ul[f-table-of-content-items]", inputs: ["items"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2339
|
+
}
|
2340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FTableOfContentComponent, decorators: [{
|
2341
|
+
type: Component,
|
2342
|
+
args: [{ selector: 'aside[f-table-of-content]', standalone: true, imports: [AsyncPipe, JsonPipe, FTableOfContentItemsComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"title\">{{ title || 'In this article' }}</div>\n<ul f-table-of-content-items [items]=\"tocData.tree\"></ul>\n<div class=\"active-marker\" [style.top]=\"activeMarkerPosition + 'px'\"></div>\n", styles: [":host{--on-page-navigation-item-height: 32px;display:none;padding-left:16px;border-left:1px solid var(--divider-color);font-size:13px;font-weight:500;position:relative}:host .title{line-height:32px;font-size:14px;font-weight:600}@media (min-width: 1280px){:host{display:block;width:var(--on-page-navigation-width);position:fixed;top:calc(var(--header-height) + 48px);right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 3)}}:host .active-marker{position:absolute;top:0;left:0;width:2px;height:calc(var(--on-page-navigation-item-height) / 2);border-radius:2px;background-color:var(--primary-1);transition:top .25s cubic-bezier(0,1,.5,1),opacity .25s}\n"] }]
|
2343
|
+
}], ctorParameters: () => [{ type: FEnvironmentService }, { type: i0.ElementRef }, { type: FScrollableService }, { type: i0.ChangeDetectorRef }, { type: i2.BrowserService }], propDecorators: { onDocumentClick: [{
|
2344
|
+
type: HostListener,
|
2345
|
+
args: ['click', ['$event']]
|
2346
|
+
}] } });
|
2347
|
+
|
2348
|
+
class FPageComponent {
|
2349
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2350
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FPageComponent, isStandalone: true, selector: "f-page", host: { attributes: { "ngSkipHydration": "" } }, ngImport: i0, template: "<f-markdown-renderer></f-markdown-renderer>\n<aside f-table-of-content></aside>\n\n", styles: [":host{display:block;width:100%;padding:48px var(--page-padding) 140px}:host [fMarkdownRenderer]{width:100%}@media (min-width: 1280px){:host{padding-right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 2);padding-left:max(var(--page-padding),(100vw - var(--layout-max-width)) / 4)}:host [fMarkdownRenderer]{width:calc(100% - var(--on-page-navigation-width) - var(--page-padding))}}\n"], dependencies: [{ kind: "component", type: FTableOfContentComponent, selector: "aside[f-table-of-content]" }, { kind: "component", type: FMarkdownRendererComponent, selector: "f-markdown-renderer" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2351
|
+
}
|
2352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FPageComponent, decorators: [{
|
2353
|
+
type: Component,
|
2354
|
+
args: [{ selector: 'f-page', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
2355
|
+
FTableOfContentComponent,
|
2356
|
+
FMarkdownRendererComponent
|
2357
|
+
], host: {
|
2358
|
+
'ngSkipHydration': ''
|
2359
|
+
}, template: "<f-markdown-renderer></f-markdown-renderer>\n<aside f-table-of-content></aside>\n\n", styles: [":host{display:block;width:100%;padding:48px var(--page-padding) 140px}:host [fMarkdownRenderer]{width:100%}@media (min-width: 1280px){:host{padding-right:max(var(--page-padding),(100vw - var(--layout-max-width)) / 2);padding-left:max(var(--page-padding),(100vw - var(--layout-max-width)) / 4)}:host [fMarkdownRenderer]{width:calc(100% - var(--on-page-navigation-width) - var(--page-padding))}}\n"] }]
|
2360
|
+
}] });
|
2361
|
+
|
2362
|
+
var index = /*#__PURE__*/Object.freeze({
|
2363
|
+
__proto__: null,
|
2364
|
+
ChangeCodeFocusedSyntaxPreProcessor: ChangeCodeFocusedSyntaxPreProcessor,
|
2365
|
+
get EMarkdownContainerType () { return EMarkdownContainerType; },
|
2366
|
+
FAsyncCodeViewHandler: FAsyncCodeViewHandler,
|
2367
|
+
FCodeGroupBodyHandler: FCodeGroupBodyHandler,
|
2368
|
+
FCodeGroupHandler: FCodeGroupHandler,
|
2369
|
+
FCodeViewHandler: FCodeViewHandler,
|
2370
|
+
FExampleViewHandler: FExampleViewHandler,
|
2371
|
+
FFooterEditInformationComponent: FFooterEditInformationComponent,
|
2372
|
+
FFooterNavigationButtonComponent: FFooterNavigationButtonComponent,
|
2373
|
+
FFooterNavigationComponent: FFooterNavigationComponent,
|
2374
|
+
FMarkdownFooterComponent: FMarkdownFooterComponent,
|
2375
|
+
FMarkdownRendererComponent: FMarkdownRendererComponent,
|
2376
|
+
FPageComponent: FPageComponent,
|
2377
|
+
FTableOfContentComponent: FTableOfContentComponent,
|
2378
|
+
FTableOfContentItemsComponent: FTableOfContentItemsComponent,
|
2379
|
+
GetPreviousNextPageNavigationHandler: GetPreviousNextPageNavigationHandler,
|
2380
|
+
GetPreviousNextPageNavigationRequest: GetPreviousNextPageNavigationRequest,
|
2381
|
+
GetPreviousNextPageNavigationResponse: GetPreviousNextPageNavigationResponse,
|
2382
|
+
HandleDynamicComponentsHandler: HandleDynamicComponentsHandler,
|
2383
|
+
HandleDynamicComponentsRequest: HandleDynamicComponentsRequest,
|
2384
|
+
HandleParsedContainersHandler: HandleParsedContainersHandler,
|
2385
|
+
HandleParsedContainersRequest: HandleParsedContainersRequest,
|
2386
|
+
HighlightService: HighlightService,
|
2387
|
+
MarkCodeFocusedBlocksPostProcessor: MarkCodeFocusedBlocksPostProcessor,
|
2388
|
+
MarkdownService: MarkdownService,
|
2389
|
+
ModifyPunctuationHighlightPostProcessor: ModifyPunctuationHighlightPostProcessor,
|
2390
|
+
ParseAlerts: ParseAlerts,
|
2391
|
+
ParseCodeGroup: ParseCodeGroup,
|
2392
|
+
ParseCodeView: ParseCodeView,
|
2393
|
+
ParseExampleGroup: ParseExampleGroup,
|
2394
|
+
ParsePreviewGroup: ParsePreviewGroup,
|
2395
|
+
SeparateCodeByLinesPostProcessor: SeparateCodeByLinesPostProcessor,
|
2396
|
+
copyToClipboard: copyToClipboard,
|
2397
|
+
getContent: getContent
|
2398
|
+
});
|
2399
|
+
|
2400
|
+
/**
|
2401
|
+
* Generated bundle index. Do not edit.
|
2402
|
+
*/
|
2403
|
+
|
2404
|
+
export { CalculateHashFromScrollPositionHandler, CalculateHashFromScrollPositionRequest, ChangeCodeFocusedSyntaxPreProcessor, CookiePopup, EMarkdownContainerType, FAnalyticsService, FAsyncCodeViewHandler, FBadgeComponent, FCheckboxComponent, FCodeGroupBodyHandler, FCodeGroupHandler, FCodeViewHandler, FDocumentationComponent, FEnvironmentService, FExampleViewHandler, FFooterEditInformationComponent, FFooterNavigationButtonComponent, FFooterNavigationComponent, FHamburgerButtonComponent, FHeadTagService, FHeaderComponent, FHeaderMenuComponent, FJsonLdService, FMarkdownFooterComponent, FMarkdownRendererComponent, FMetaService, FNavigationGroupComponent, FNavigationHeaderComponent, FNavigationItemComponent, FNavigationPanelComponent, FPageComponent, FPopoverService, FPreviewComponent, FScrollableContainerComponent, FSocialLinksComponent, FTableOfContentComponent, FTableOfContentItemsComponent, FThemeButtonComponent, FVersionComponent, F_ACCEPT_COOKIES_KEY, F_DOCUMENTATION_COMPONENT, F_DOCUMENTATION_ROUTES, F_ENVIRONMENT, GetAbsoluteTopToContainerHandler, GetAbsoluteTopToContainerRequest, GetPreviousNextPageNavigationHandler, GetPreviousNextPageNavigationRequest, GetPreviousNextPageNavigationResponse, GetTableOfContentDataHandler, GetTableOfContentDataRequest, GetVersionHandler, GetVersionRequest, HandleDynamicComponentsHandler, HandleDynamicComponentsRequest, HandleNavigationLinksHandler, HandleNavigationLinksRequest, HandleParsedContainersHandler, HandleParsedContainersRequest, HighlightService, MarkCodeFocusedBlocksPostProcessor, MarkdownService, ModifyPunctuationHighlightPostProcessor, ParseAlerts, ParseCodeGroup, ParseCodeView, ParseExampleGroup, ParsePreviewGroup, ScrollToElementInContainer, SeparateCodeByLinesPostProcessor, TableOfContentData, copyToClipboard, getContent, setCookieConsent };
|
2405
|
+
//# sourceMappingURL=foblex-m-render.mjs.map
|