@ng-doc/app 22.0.0-beta.2 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -29
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs +363 -0
- package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs +299 -0
- package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -0
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +51 -35
- package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes-search-engine.mjs.map +1 -1
- package/fesm2022/ng-doc-app-classes.mjs +2 -0
- package/fesm2022/ng-doc-app-classes.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-api-list.mjs +173 -69
- package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
- package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-code.mjs +152 -25
- package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
- package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
- package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
- package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
- package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-demo.mjs +129 -44
- package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
- package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
- package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
- package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-image-viewer.mjs +183 -89
- package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
- package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-link.mjs +12 -9
- package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-members.mjs +30 -0
- package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +61 -20
- package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
- package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
- package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
- package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
- package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
- package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-page.mjs +168 -24
- package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-playground.mjs +392 -263
- package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-root.mjs +48 -31
- package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
- package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-search.mjs +64 -33
- package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-sidebar.mjs +86 -61
- package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-tabs.mjs +18 -12
- package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
- package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components-toc.mjs +267 -90
- package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
- package/fesm2022/ng-doc-app-components.mjs +3 -1
- package/fesm2022/ng-doc-app-components.mjs.map +1 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
- package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +11 -5
- package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
- package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
- package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
- package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
- package/fesm2022/ng-doc-app-directives.mjs +1 -0
- package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
- package/fesm2022/ng-doc-app-helpers.mjs +285 -1
- package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
- package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
- package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
- package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
- package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
- package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs +12 -1
- package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
- package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
- package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
- package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
- package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-highlighter.mjs +83 -14
- package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-route-preloader.mjs +360 -0
- package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
- package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
- package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
- package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-store.mjs +8 -8
- package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
- package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
- package/fesm2022/ng-doc-app-services.mjs +143 -0
- package/fesm2022/ng-doc-app-services.mjs.map +1 -1
- package/fesm2022/ng-doc-app-tokens.mjs +7 -28
- package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
- package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
- package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +22 -16
- package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
- package/package.json +69 -28
- package/styles/global.css +1125 -201
- package/styles/main.css +1125 -201
- package/styles/themes/dark.css +78 -56
- package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
- package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
- package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
- package/types/ng-doc-app-classes-root-page.d.ts +6 -1
- package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
- package/types/ng-doc-app-classes.d.ts +2 -0
- package/types/ng-doc-app-components-api-list.d.ts +69 -20
- package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
- package/types/ng-doc-app-components-code.d.ts +46 -12
- package/types/ng-doc-app-components-command-palette.d.ts +147 -0
- package/types/ng-doc-app-components-copy-button.d.ts +18 -6
- package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
- package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
- package/types/ng-doc-app-components-demo.d.ts +62 -15
- package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
- package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
- package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
- package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
- package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
- package/types/ng-doc-app-components-link.d.ts +6 -2
- package/types/ng-doc-app-components-members.d.ts +13 -0
- package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
- package/types/ng-doc-app-components-navbar.d.ts +25 -15
- package/types/ng-doc-app-components-page-header.d.ts +28 -4
- package/types/ng-doc-app-components-page-link.d.ts +34 -15
- package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
- package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
- package/types/ng-doc-app-components-page.d.ts +57 -6
- package/types/ng-doc-app-components-playground.d.ts +146 -78
- package/types/ng-doc-app-components-root.d.ts +28 -7
- package/types/ng-doc-app-components-search-result.d.ts +14 -6
- package/types/ng-doc-app-components-search.d.ts +19 -7
- package/types/ng-doc-app-components-tabs.d.ts +13 -4
- package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
- package/types/ng-doc-app-components-toc.d.ts +76 -29
- package/types/ng-doc-app-components.d.ts +3 -1
- package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
- package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
- package/types/ng-doc-app-directives-route-active.d.ts +21 -7
- package/types/ng-doc-app-directives.d.ts +1 -0
- package/types/ng-doc-app-helpers.d.ts +124 -3
- package/types/ng-doc-app-interfaces.d.ts +48 -28
- package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
- package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
- package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
- package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
- package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
- package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
- package/types/ng-doc-app-processors-processors.d.ts +5 -1
- package/types/ng-doc-app-providers-ng-doc-app.d.ts +17 -0
- package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
- package/types/ng-doc-app-services-content-state.d.ts +40 -0
- package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
- package/types/ng-doc-app-services-highlighter.d.ts +40 -5
- package/types/ng-doc-app-services-route-preloader.d.ts +109 -0
- package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
- package/types/ng-doc-app-services-sidebar.d.ts +24 -4
- package/types/ng-doc-app-services-store.d.ts +24 -1
- package/types/ng-doc-app-services-theme.d.ts +19 -3
- package/types/ng-doc-app-services.d.ts +77 -0
- package/types/ng-doc-app-tokens.d.ts +10 -30
- package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
- package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
- package/types/ng-doc-app-type-controls-type-alias-control.d.ts +13 -6
- package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
- package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
- package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { InjectionToken, inject } from '@angular/core';
|
|
2
|
+
import { NgDocContentState } from '@ng-doc/app/services/content-state';
|
|
1
3
|
import { asArray } from '@ng-doc/core/helpers/as-array';
|
|
2
4
|
import { objectKeys } from '@ng-doc/core/helpers/object-keys';
|
|
3
5
|
|
|
@@ -16,6 +18,172 @@ function asBoolean(value) {
|
|
|
16
18
|
return !!value;
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
/** The key of the resolver that `ɵwithNgDocContent` adds to a generated page route. */
|
|
22
|
+
const RESOLVE_KEY = 'ɵngDocContent';
|
|
23
|
+
/** The loads started for each content source, so a source loads once however often it is asked. */
|
|
24
|
+
const preloads = new WeakMap();
|
|
25
|
+
/**
|
|
26
|
+
* The content source of each resolver made by `ɵwithNgDocContent`. The router copies route
|
|
27
|
+
* objects when it loads them, but it keeps their `resolve` maps and functions, so the source is
|
|
28
|
+
* found through the resolver.
|
|
29
|
+
*/
|
|
30
|
+
const routeSources = new WeakMap();
|
|
31
|
+
/** The wait of each navigation, by its root snapshot. */
|
|
32
|
+
const navigationWaits = new WeakMap();
|
|
33
|
+
/**
|
|
34
|
+
* How long the router waits for the content of a page before it shows the page anyway, in
|
|
35
|
+
* milliseconds. A stalled load must not freeze navigation: after this, the page opens and its
|
|
36
|
+
* content renders when it arrives, as without the wait.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
const ɵNG_DOC_CONTENT_WAIT = new InjectionToken('ɵNG_DOC_CONTENT_WAIT', {
|
|
40
|
+
factory: () => 8000,
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Loads a content source once and keeps its payload, so a page that renders it later shows it in
|
|
44
|
+
* its first render. A failed load is forgotten, so the next request tries again.
|
|
45
|
+
* @param source - The content source.
|
|
46
|
+
* @returns The loaded payload.
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
function ɵpreloadNgDocContent(source) {
|
|
50
|
+
const existing = preloads.get(source);
|
|
51
|
+
if (existing)
|
|
52
|
+
return existing.promise;
|
|
53
|
+
// Preloads are shared between navigations, so no navigation may abort them.
|
|
54
|
+
const promise = Promise.resolve()
|
|
55
|
+
.then(() => source.load(new AbortController().signal))
|
|
56
|
+
.then((payload) => {
|
|
57
|
+
if (preloads.get(source) === entry)
|
|
58
|
+
entry.payload = payload;
|
|
59
|
+
return payload;
|
|
60
|
+
}, (error) => {
|
|
61
|
+
if (preloads.get(source) === entry)
|
|
62
|
+
preloads.delete(source);
|
|
63
|
+
throw error;
|
|
64
|
+
});
|
|
65
|
+
const entry = { promise };
|
|
66
|
+
preloads.set(source, entry);
|
|
67
|
+
return promise;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, without waiting.
|
|
71
|
+
* @param source - The content source.
|
|
72
|
+
* @returns The payload, or `undefined` when the source has not finished loading.
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
function ɵpeekNgDocContent(source) {
|
|
76
|
+
return preloads.get(source)?.payload;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns the load of a source that `ɵpreloadNgDocContent` started and that has not finished,
|
|
80
|
+
* so a page that opens before it finishes waits for the same load instead of starting another.
|
|
81
|
+
* @param source - The content source.
|
|
82
|
+
* @returns The pending load, or `undefined`.
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
function ɵpendingNgDocContent(source) {
|
|
86
|
+
const entry = preloads.get(source);
|
|
87
|
+
return entry && !entry.payload ? entry.promise : undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Drops the preloaded payload of a source, for a source that reports a new revision.
|
|
91
|
+
* @param source - The content source.
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
function ɵforgetNgDocContent(source) {
|
|
95
|
+
preloads.delete(source);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Makes the router wait for the content of a generated page before it shows the page. Without
|
|
99
|
+
* it, the router removes the previous page as soon as the page's code has loaded, and an empty
|
|
100
|
+
* page shows until its content arrives.
|
|
101
|
+
*
|
|
102
|
+
* The resolver loads the content of every route of the navigation that has some, all at once,
|
|
103
|
+
* because the router runs the resolvers of nested routes one after another. A load that fails
|
|
104
|
+
* still lets the navigation finish: the page shows the error. A load that takes longer than
|
|
105
|
+
* `ɵNG_DOC_CONTENT_WAIT` lets it finish too: the page then renders its content when it arrives.
|
|
106
|
+
* @param route - The route of the page.
|
|
107
|
+
* @param source - The content source of the route's component.
|
|
108
|
+
* @returns A copy of the route with the resolver added.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
function ɵwithNgDocContent(route, source) {
|
|
112
|
+
const resolver = async (snapshot) => {
|
|
113
|
+
// The resolvers of one navigation share its root snapshot, and with it one wait: nested
|
|
114
|
+
// resolvers run one after another, and each must not start a wait of its own.
|
|
115
|
+
let wait = navigationWaits.get(snapshot.root);
|
|
116
|
+
if (!wait) {
|
|
117
|
+
const sources = new Set();
|
|
118
|
+
const add = (item) => {
|
|
119
|
+
ɵngDocRouteContentSources(item.routeConfig).forEach((found) => sources.add(found));
|
|
120
|
+
};
|
|
121
|
+
snapshot.pathFromRoot.forEach(add);
|
|
122
|
+
for (let child = snapshot.firstChild; child; child = child.firstChild)
|
|
123
|
+
add(child);
|
|
124
|
+
wait = waitFor([...sources], inject(ɵNG_DOC_CONTENT_WAIT));
|
|
125
|
+
navigationWaits.set(snapshot.root, wait);
|
|
126
|
+
}
|
|
127
|
+
await wait;
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
130
|
+
routeSources.set(resolver, source);
|
|
131
|
+
return { ...route, resolve: { ...route.resolve, [RESOLVE_KEY]: resolver } };
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Waits until the sources have loaded or failed, or for at most `limit` milliseconds.
|
|
135
|
+
* @param sources - The content sources.
|
|
136
|
+
* @param limit - The longest wait, in milliseconds.
|
|
137
|
+
* @returns A promise that settles when the wait is over; it never rejects.
|
|
138
|
+
*/
|
|
139
|
+
async function waitFor(sources, limit) {
|
|
140
|
+
let timer;
|
|
141
|
+
try {
|
|
142
|
+
await Promise.race([
|
|
143
|
+
Promise.all(sources.map((item) => ɵpreloadNgDocContent(item).catch(() => undefined))),
|
|
144
|
+
// The timer is cleared as soon as the content is in, so it never keeps a server render or
|
|
145
|
+
// a zone application from becoming stable.
|
|
146
|
+
new Promise((resolve) => (timer = setTimeout(resolve, limit))),
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
clearTimeout(timer);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Returns the content sources that `ɵwithNgDocContent` attached to a route.
|
|
155
|
+
* @param route - The route, as declared or as the router copied it.
|
|
156
|
+
* @returns The content sources of the route.
|
|
157
|
+
* @internal
|
|
158
|
+
*/
|
|
159
|
+
function ɵngDocRouteContentSources(route) {
|
|
160
|
+
return Object.values(route?.resolve ?? {})
|
|
161
|
+
.map((resolver) => routeSources.get(resolver))
|
|
162
|
+
.filter((source) => source !== undefined);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Waits for content loading and processing before returning an SSR application. */
|
|
166
|
+
function withNgDocContentReady(bootstrap) {
|
|
167
|
+
return async (...arguments_) => {
|
|
168
|
+
let application;
|
|
169
|
+
try {
|
|
170
|
+
application = await bootstrap(...arguments_);
|
|
171
|
+
await application.whenStable();
|
|
172
|
+
application.injector.get(NgDocContentState).throwIfFailed();
|
|
173
|
+
return application;
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
try {
|
|
177
|
+
application?.destroy();
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
// Preserve the load, processing, stability, or bootstrap failure.
|
|
181
|
+
}
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
19
187
|
/**
|
|
20
188
|
*
|
|
21
189
|
* @param viewContainer
|
|
@@ -80,6 +248,77 @@ function levelFromTagName(heading) {
|
|
|
80
248
|
return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);
|
|
81
249
|
}
|
|
82
250
|
|
|
251
|
+
/**
|
|
252
|
+
* The host attribute with which a component tells that its content loads asynchronously. The
|
|
253
|
+
* server renders it, so only such hosts are copied: a page with inline content costs nothing.
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
const ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE = 'data-ng-doc-async-content';
|
|
257
|
+
/** The NgDoc hosts that skip hydration and whose content loads asynchronously. */
|
|
258
|
+
const SKIPPED_ASYNC_HOSTS = ['ng-doc-page', 'ng-doc-page-header']
|
|
259
|
+
.map((tag) => `${tag}[ngskiphydration][${ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE}]`)
|
|
260
|
+
.join(', ');
|
|
261
|
+
/** The class of the element that holds a server-rendered copy. */
|
|
262
|
+
const SNAPSHOT_CLASS = 'ng-doc-hydration-snapshot';
|
|
263
|
+
/** The host attribute that hides the host's own content while the copy is shown. */
|
|
264
|
+
const SNAPSHOT_ATTRIBUTE = 'data-ng-doc-hydration-snapshot';
|
|
265
|
+
const snapshots = new WeakMap();
|
|
266
|
+
/**
|
|
267
|
+
* Copies the server-rendered content of the NgDoc hosts that skip hydration and load their
|
|
268
|
+
* content asynchronously.
|
|
269
|
+
*
|
|
270
|
+
* Angular empties such a host when it creates its component in the browser, and the page would
|
|
271
|
+
* stay blank until the content arrives, so the component shows this copy until its own content
|
|
272
|
+
* renders (`ɵrestoreNgDocHydrationSnapshot`). Call it in the browser before the application
|
|
273
|
+
* renders.
|
|
274
|
+
* @param document - The document that holds the server-rendered application.
|
|
275
|
+
* @internal
|
|
276
|
+
*/
|
|
277
|
+
function ɵcaptureNgDocHydrationSnapshots(document) {
|
|
278
|
+
for (const host of Array.from(document.querySelectorAll(SKIPPED_ASYNC_HOSTS))) {
|
|
279
|
+
if (!host.childNodes.length || snapshots.has(host))
|
|
280
|
+
continue;
|
|
281
|
+
const copy = document.createDocumentFragment();
|
|
282
|
+
host.childNodes.forEach((node) => copy.appendChild(node.cloneNode(true)));
|
|
283
|
+
snapshots.set(host, copy);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Shows the server-rendered copy of a host's content, taken by
|
|
288
|
+
* `ɵcaptureNgDocHydrationSnapshots`, in place of the host's own content until the returned
|
|
289
|
+
* function is called. Each copy is shown once; without one, nothing changes. The copy is inert
|
|
290
|
+
* and the host is busy while it is shown.
|
|
291
|
+
* @param host - The host element of the component.
|
|
292
|
+
* @returns A function that removes the copy and shows the host's own content; later calls do
|
|
293
|
+
* nothing.
|
|
294
|
+
* @internal
|
|
295
|
+
*/
|
|
296
|
+
function ɵrestoreNgDocHydrationSnapshot(host) {
|
|
297
|
+
const copy = snapshots.get(host);
|
|
298
|
+
if (!copy)
|
|
299
|
+
return () => undefined;
|
|
300
|
+
snapshots.delete(host);
|
|
301
|
+
let wrapper = host.ownerDocument.createElement('div');
|
|
302
|
+
wrapper.className = SNAPSHOT_CLASS;
|
|
303
|
+
// The copied nodes lay out as the host's own children did. Inline, because the wrapper has no
|
|
304
|
+
// encapsulation attribute for a component style to match.
|
|
305
|
+
wrapper.style.display = 'contents';
|
|
306
|
+
// A static copy: its demos, buttons and links do nothing until the real content replaces it.
|
|
307
|
+
wrapper.setAttribute('inert', '');
|
|
308
|
+
wrapper.appendChild(copy);
|
|
309
|
+
host.insertBefore(wrapper, host.firstChild);
|
|
310
|
+
host.setAttribute(SNAPSHOT_ATTRIBUTE, '');
|
|
311
|
+
host.setAttribute('aria-busy', 'true');
|
|
312
|
+
return () => {
|
|
313
|
+
if (!wrapper)
|
|
314
|
+
return;
|
|
315
|
+
wrapper.remove();
|
|
316
|
+
wrapper = undefined;
|
|
317
|
+
host.removeAttribute(SNAPSHOT_ATTRIBUTE);
|
|
318
|
+
host.removeAttribute('aria-busy');
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
|
|
83
322
|
/**
|
|
84
323
|
* Check if the OS theme is dark
|
|
85
324
|
*/
|
|
@@ -105,9 +344,54 @@ function isPlaygroundProperty(obj) {
|
|
|
105
344
|
return objectKeys(obj).includes('type');
|
|
106
345
|
}
|
|
107
346
|
|
|
347
|
+
/**
|
|
348
|
+
* Returns the current route as an absolute URL in path form: the route's path, query and fragment
|
|
349
|
+
* on the document's origin.
|
|
350
|
+
*
|
|
351
|
+
* With `PathLocationStrategy`, the default, it is the document's own URL. With
|
|
352
|
+
* `HashLocationStrategy` the route lives in the document's fragment (`/#/docs/page#section`), so
|
|
353
|
+
* `location.hash` and links resolved against `location.href` see the wrong part of the URL. This
|
|
354
|
+
* URL carries the route's own fragment, and relative links resolve against the route.
|
|
355
|
+
* @param locationStrategy - The location strategy of the application.
|
|
356
|
+
* @param documentUrl - The URL of the document, `location.href`.
|
|
357
|
+
* @returns The URL of the route.
|
|
358
|
+
* @internal
|
|
359
|
+
*/
|
|
360
|
+
function ɵngDocRouteUrl(locationStrategy, documentUrl) {
|
|
361
|
+
// A path that starts with `//` would be read as another host.
|
|
362
|
+
return new URL(locationStrategy.path(true).replace(/^\/*/, '/'), documentUrl);
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Returns the absolute URL of the current page, without its query, as the reader shares it: the
|
|
366
|
+
* route in the form the location strategy shows it (`/docs/page` or `/#/docs/page`).
|
|
367
|
+
* @param locationStrategy - The location strategy of the application.
|
|
368
|
+
* @param location - The location of the document.
|
|
369
|
+
* @param fragment - The fragment to link to, without `#`.
|
|
370
|
+
* @returns The URL of the page.
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
373
|
+
function ɵngDocPageUrl(locationStrategy, location, fragment) {
|
|
374
|
+
const route = ɵngDocRouteUrl(locationStrategy, location.href);
|
|
375
|
+
// `path()` includes the base href and `prepareExternalUrl()` adds it, so it is removed in
|
|
376
|
+
// between; the round trip gives back the document's own path with `PathLocationStrategy`.
|
|
377
|
+
const base = new URL(locationStrategy.getBaseHref() || '/', route).pathname.replace(/\/+$/, '');
|
|
378
|
+
const path = base && (route.pathname === base || route.pathname.startsWith(`${base}/`))
|
|
379
|
+
? route.pathname.slice(base.length) || '/'
|
|
380
|
+
: route.pathname;
|
|
381
|
+
const external = locationStrategy.prepareExternalUrl(fragment ? `${path}#${fragment}` : path);
|
|
382
|
+
if (external.startsWith('#')) {
|
|
383
|
+
// The route is the document's fragment: it follows the document's path, without its query.
|
|
384
|
+
return `${location.origin}${location.pathname}${external}`;
|
|
385
|
+
}
|
|
386
|
+
if (external.startsWith('/') && !external.startsWith('//')) {
|
|
387
|
+
return `${location.origin}${external}`;
|
|
388
|
+
}
|
|
389
|
+
return new URL(external, location.href).href;
|
|
390
|
+
}
|
|
391
|
+
|
|
108
392
|
/**
|
|
109
393
|
* Generated bundle index. Do not edit.
|
|
110
394
|
*/
|
|
111
395
|
|
|
112
|
-
export { asBoolean, createComponent, formatHtml, generateToc, isDarkOsTheme, isExternalLink, isPlaygroundProperty };
|
|
396
|
+
export { asBoolean, createComponent, formatHtml, generateToc, isDarkOsTheme, isExternalLink, isPlaygroundProperty, withNgDocContentReady, ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE, ɵNG_DOC_CONTENT_WAIT, ɵcaptureNgDocHydrationSnapshots, ɵforgetNgDocContent, ɵngDocPageUrl, ɵngDocRouteContentSources, ɵngDocRouteUrl, ɵpeekNgDocContent, ɵpendingNgDocContent, ɵpreloadNgDocContent, ɵrestoreNgDocHydrationSnapshot, ɵwithNgDocContent };
|
|
113
397
|
//# sourceMappingURL=ng-doc-app-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/create-component.ts","../../../../libs/app/helpers/format-html.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true'\n ? true\n : value.toLowerCase() === 'false'\n ? false\n : !!value;\n }\n return !!value;\n}\n","import { Type, ViewContainerRef } from '@angular/core';\n\n/**\n *\n * @param viewContainer\n * @param component\n * @param inputs\n */\nexport function createComponent<T>(\n viewContainer: ViewContainerRef,\n component: Type<T>,\n inputs?: object,\n): void {\n viewContainer.clear();\n\n const componentRef = viewContainer.createComponent(component);\n\n if (inputs) {\n Object.entries(inputs).forEach(([key, value]) => {\n componentRef.setInput(key, value);\n });\n }\n}\n","/**\n *\n * @param html\n */\nexport async function formatHtml(html: string): Promise<string> {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\tconst formatter = await import('esthetic');\n\n\treturn formatter.default.html(html.trim(), {\n\t\twrap: 50,\n\t\tmarkup: {\n\t\t\tforceIndent: true,\n\t\t},\n\t});\n}\n","import { NgDocTocItem } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocHeading } from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n const headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const headingElements: HTMLHeadingElement[] = Array.from(\n container.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n ).filter((heading: HTMLHeadingElement) => heading.id);\n\n const levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n return headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n const headingLevel: number = levelFromTagName(heading);\n const isHeadingLink = heading.getAttribute('headingLink') === 'true';\n\n if (isHeadingLink) {\n map.push({\n title: heading.textContent?.trim() ?? '',\n element: heading,\n path: heading.getAttribute('href') ?? '',\n hash: heading.id,\n level: levels.indexOf(headingLevel) + 1,\n });\n }\n\n return map;\n }, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { NgDocPlaygroundProperty } from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n return objectKeys(obj).includes('type');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACtC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK;AAC7B,cAAE;AACF,cAAE,KAAK,CAAC,WAAW,EAAE,KAAK;AACxB,kBAAE;AACF,kBAAE,CAAC,CAAC,KAAK;IACf;IACA,OAAO,CAAC,CAAC,KAAK;AAChB;;ACXA;;;;;AAKG;SACa,eAAe,CAC7B,aAA+B,EAC/B,SAAkB,EAClB,MAAe,EAAA;IAEf,aAAa,CAAC,KAAK,EAAE;IAErB,MAAM,YAAY,GAAG,aAAa,CAAC,eAAe,CAAC,SAAS,CAAC;IAE7D,IAAI,MAAM,EAAE;AACV,QAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;AAC9C,YAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;AACnC,QAAA,CAAC,CAAC;IACJ;AACF;;ACtBA;;;AAGG;AACI,eAAe,UAAU,CAAC,IAAY,EAAA;;;AAG5C,IAAA,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC;IAE1C,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;AAC1C,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,MAAM,EAAE;AACP,YAAA,WAAW,EAAE,IAAI;AACjB,SAAA;AACD,KAAA,CAAC;AACH;;ACXA;;;;AAIG;AACG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,IAAI,CAAC,CAAC;AAC1E;;AC1CA;;AAEG;SACa,aAAa,GAAA;IAC5B,OAAO,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO;AACjE;;ACLA;;;AAGG;AACG,SAAU,cAAc,CAAC,GAAW,EAAA;IACzC,MAAM,aAAa,GAAsB,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;AAEpE,IAAA,aAAa,CAAC,IAAI,GAAG,GAAG;IAExB,OAAO,aAAa,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,IAAI;AACnD;;ACPA;;;AAGG;AACG,SAAU,oBAAoB,CAAC,GAAwB,EAAA;IAC3D,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;AACzC;;ACTA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/content-preload.ts","../../../../libs/app/helpers/content-ready.ts","../../../../libs/app/helpers/create-component.ts","../../../../libs/app/helpers/format-html.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/hydration-snapshot.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/page-url.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true'\n ? true\n : value.toLowerCase() === 'false'\n ? false\n : !!value;\n }\n return !!value;\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport type { ActivatedRouteSnapshot, ResolveFn, Route } from '@angular/router';\nimport type { NgDocContentModule, NgDocContentSource } from '@ng-doc/core/interfaces';\n\n/** The key of the resolver that `ɵwithNgDocContent` adds to a generated page route. */\nconst RESOLVE_KEY = 'ɵngDocContent';\n\ninterface PreloadEntry {\n readonly promise: Promise<NgDocContentModule>;\n payload?: NgDocContentModule;\n}\n\n/** The loads started for each content source, so a source loads once however often it is asked. */\nconst preloads = new WeakMap<NgDocContentSource, PreloadEntry>();\n\n/**\n * The content source of each resolver made by `ɵwithNgDocContent`. The router copies route\n * objects when it loads them, but it keeps their `resolve` maps and functions, so the source is\n * found through the resolver.\n */\nconst routeSources = new WeakMap<ResolveFn<unknown>, NgDocContentSource>();\n\n/** The wait of each navigation, by its root snapshot. */\nconst navigationWaits = new WeakMap<ActivatedRouteSnapshot, Promise<void>>();\n\n/**\n * How long the router waits for the content of a page before it shows the page anyway, in\n * milliseconds. A stalled load must not freeze navigation: after this, the page opens and its\n * content renders when it arrives, as without the wait.\n * @internal\n */\nexport const ɵNG_DOC_CONTENT_WAIT = new InjectionToken<number>('ɵNG_DOC_CONTENT_WAIT', {\n factory: () => 8000,\n});\n\n/**\n * Loads a content source once and keeps its payload, so a page that renders it later shows it in\n * its first render. A failed load is forgotten, so the next request tries again.\n * @param source - The content source.\n * @returns The loaded payload.\n * @internal\n */\nexport function ɵpreloadNgDocContent(source: NgDocContentSource): Promise<NgDocContentModule> {\n const existing = preloads.get(source);\n\n if (existing) return existing.promise;\n\n // Preloads are shared between navigations, so no navigation may abort them.\n const promise = Promise.resolve()\n .then(() => source.load(new AbortController().signal))\n .then(\n (payload: NgDocContentModule) => {\n if (preloads.get(source) === entry) entry.payload = payload;\n return payload;\n },\n (error: unknown) => {\n if (preloads.get(source) === entry) preloads.delete(source);\n throw error;\n },\n );\n const entry: PreloadEntry = { promise };\n\n preloads.set(source, entry);\n\n return promise;\n}\n\n/**\n * Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, without waiting.\n * @param source - The content source.\n * @returns The payload, or `undefined` when the source has not finished loading.\n * @internal\n */\nexport function ɵpeekNgDocContent(source: NgDocContentSource): NgDocContentModule | undefined {\n return preloads.get(source)?.payload;\n}\n\n/**\n * Returns the load of a source that `ɵpreloadNgDocContent` started and that has not finished,\n * so a page that opens before it finishes waits for the same load instead of starting another.\n * @param source - The content source.\n * @returns The pending load, or `undefined`.\n * @internal\n */\nexport function ɵpendingNgDocContent(\n source: NgDocContentSource,\n): Promise<NgDocContentModule> | undefined {\n const entry = preloads.get(source);\n\n return entry && !entry.payload ? entry.promise : undefined;\n}\n\n/**\n * Drops the preloaded payload of a source, for a source that reports a new revision.\n * @param source - The content source.\n * @internal\n */\nexport function ɵforgetNgDocContent(source: NgDocContentSource): void {\n preloads.delete(source);\n}\n\n/**\n * Makes the router wait for the content of a generated page before it shows the page. Without\n * it, the router removes the previous page as soon as the page's code has loaded, and an empty\n * page shows until its content arrives.\n *\n * The resolver loads the content of every route of the navigation that has some, all at once,\n * because the router runs the resolvers of nested routes one after another. A load that fails\n * still lets the navigation finish: the page shows the error. A load that takes longer than\n * `ɵNG_DOC_CONTENT_WAIT` lets it finish too: the page then renders its content when it arrives.\n * @param route - The route of the page.\n * @param source - The content source of the route's component.\n * @returns A copy of the route with the resolver added.\n * @internal\n */\nexport function ɵwithNgDocContent(route: Route, source: NgDocContentSource): Route {\n const resolver: ResolveFn<boolean> = async (snapshot: ActivatedRouteSnapshot) => {\n // The resolvers of one navigation share its root snapshot, and with it one wait: nested\n // resolvers run one after another, and each must not start a wait of its own.\n let wait = navigationWaits.get(snapshot.root);\n\n if (!wait) {\n const sources = new Set<NgDocContentSource>();\n const add = (item: ActivatedRouteSnapshot): void => {\n ɵngDocRouteContentSources(item.routeConfig).forEach((found) => sources.add(found));\n };\n\n snapshot.pathFromRoot.forEach(add);\n for (let child = snapshot.firstChild; child; child = child.firstChild) add(child);\n wait = waitFor([...sources], inject(ɵNG_DOC_CONTENT_WAIT));\n navigationWaits.set(snapshot.root, wait);\n }\n await wait;\n\n return true;\n };\n\n routeSources.set(resolver, source);\n\n return { ...route, resolve: { ...route.resolve, [RESOLVE_KEY]: resolver } };\n}\n\n/**\n * Waits until the sources have loaded or failed, or for at most `limit` milliseconds.\n * @param sources - The content sources.\n * @param limit - The longest wait, in milliseconds.\n * @returns A promise that settles when the wait is over; it never rejects.\n */\nasync function waitFor(sources: NgDocContentSource[], limit: number): Promise<void> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n try {\n await Promise.race([\n Promise.all(sources.map((item) => ɵpreloadNgDocContent(item).catch(() => undefined))),\n // The timer is cleared as soon as the content is in, so it never keeps a server render or\n // a zone application from becoming stable.\n new Promise<void>((resolve) => (timer = setTimeout(resolve, limit))),\n ]);\n } finally {\n clearTimeout(timer);\n }\n}\n\n/**\n * Returns the content sources that `ɵwithNgDocContent` attached to a route.\n * @param route - The route, as declared or as the router copied it.\n * @returns The content sources of the route.\n * @internal\n */\nexport function ɵngDocRouteContentSources(route: Route | null | undefined): NgDocContentSource[] {\n return Object.values(route?.resolve ?? {})\n .map((resolver: unknown) => routeSources.get(resolver as ResolveFn<unknown>))\n .filter((source): source is NgDocContentSource => source !== undefined);\n}\n","import { ApplicationRef } from '@angular/core';\nimport { NgDocContentState } from '@ng-doc/app/services/content-state';\n\nexport type NgDocBootstrap<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n> = (...arguments_: TArguments) => Promise<TApplication>;\n\n/** Waits for content loading and processing before returning an SSR application. */\nexport function withNgDocContentReady<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n>(bootstrap: NgDocBootstrap<TArguments, TApplication>): NgDocBootstrap<TArguments, TApplication> {\n return async (...arguments_: TArguments): Promise<TApplication> => {\n let application: TApplication | undefined;\n try {\n application = await bootstrap(...arguments_);\n await application.whenStable();\n application.injector.get(NgDocContentState).throwIfFailed();\n return application;\n } catch (error) {\n try {\n application?.destroy();\n } catch {\n // Preserve the load, processing, stability, or bootstrap failure.\n }\n throw error;\n }\n };\n}\n","import { Type, ViewContainerRef } from '@angular/core';\n\n/**\n *\n * @param viewContainer\n * @param component\n * @param inputs\n */\nexport function createComponent<T>(\n viewContainer: ViewContainerRef,\n component: Type<T>,\n inputs?: object,\n): void {\n viewContainer.clear();\n\n const componentRef = viewContainer.createComponent(component);\n\n if (inputs) {\n Object.entries(inputs).forEach(([key, value]) => {\n componentRef.setInput(key, value);\n });\n }\n}\n","/**\n *\n * @param html\n */\nexport async function formatHtml(html: string): Promise<string> {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\tconst formatter = await import('esthetic');\n\n\treturn formatter.default.html(html.trim(), {\n\t\twrap: 50,\n\t\tmarkup: {\n\t\t\tforceIndent: true,\n\t\t},\n\t});\n}\n","import { NgDocTocItem } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocHeading } from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n const headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const headingElements: HTMLHeadingElement[] = Array.from(\n container.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n ).filter((heading: HTMLHeadingElement) => heading.id);\n\n const levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n return headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n const headingLevel: number = levelFromTagName(heading);\n const isHeadingLink = heading.getAttribute('headingLink') === 'true';\n\n if (isHeadingLink) {\n map.push({\n title: heading.textContent?.trim() ?? '',\n element: heading,\n path: heading.getAttribute('href') ?? '',\n hash: heading.id,\n level: levels.indexOf(headingLevel) + 1,\n });\n }\n\n return map;\n }, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * The host attribute with which a component tells that its content loads asynchronously. The\n * server renders it, so only such hosts are copied: a page with inline content costs nothing.\n * @internal\n */\nexport const ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE = 'data-ng-doc-async-content';\n\n/** The NgDoc hosts that skip hydration and whose content loads asynchronously. */\nconst SKIPPED_ASYNC_HOSTS = ['ng-doc-page', 'ng-doc-page-header']\n .map((tag: string) => `${tag}[ngskiphydration][${ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE}]`)\n .join(', ');\n/** The class of the element that holds a server-rendered copy. */\nconst SNAPSHOT_CLASS = 'ng-doc-hydration-snapshot';\n/** The host attribute that hides the host's own content while the copy is shown. */\nconst SNAPSHOT_ATTRIBUTE = 'data-ng-doc-hydration-snapshot';\n\nconst snapshots = new WeakMap<Element, DocumentFragment>();\n\n/**\n * Copies the server-rendered content of the NgDoc hosts that skip hydration and load their\n * content asynchronously.\n *\n * Angular empties such a host when it creates its component in the browser, and the page would\n * stay blank until the content arrives, so the component shows this copy until its own content\n * renders (`ɵrestoreNgDocHydrationSnapshot`). Call it in the browser before the application\n * renders.\n * @param document - The document that holds the server-rendered application.\n * @internal\n */\nexport function ɵcaptureNgDocHydrationSnapshots(document: Document): void {\n for (const host of Array.from(document.querySelectorAll(SKIPPED_ASYNC_HOSTS))) {\n if (!host.childNodes.length || snapshots.has(host)) continue;\n\n const copy = document.createDocumentFragment();\n\n host.childNodes.forEach((node: ChildNode) => copy.appendChild(node.cloneNode(true)));\n snapshots.set(host, copy);\n }\n}\n\n/**\n * Shows the server-rendered copy of a host's content, taken by\n * `ɵcaptureNgDocHydrationSnapshots`, in place of the host's own content until the returned\n * function is called. Each copy is shown once; without one, nothing changes. The copy is inert\n * and the host is busy while it is shown.\n * @param host - The host element of the component.\n * @returns A function that removes the copy and shows the host's own content; later calls do\n * nothing.\n * @internal\n */\nexport function ɵrestoreNgDocHydrationSnapshot(host: Element): () => void {\n const copy = snapshots.get(host);\n\n if (!copy) return () => undefined;\n\n snapshots.delete(host);\n\n let wrapper: HTMLElement | undefined = host.ownerDocument.createElement('div');\n\n wrapper.className = SNAPSHOT_CLASS;\n // The copied nodes lay out as the host's own children did. Inline, because the wrapper has no\n // encapsulation attribute for a component style to match.\n wrapper.style.display = 'contents';\n // A static copy: its demos, buttons and links do nothing until the real content replaces it.\n wrapper.setAttribute('inert', '');\n wrapper.appendChild(copy);\n host.insertBefore(wrapper, host.firstChild);\n host.setAttribute(SNAPSHOT_ATTRIBUTE, '');\n host.setAttribute('aria-busy', 'true');\n\n return () => {\n if (!wrapper) return;\n wrapper.remove();\n wrapper = undefined;\n host.removeAttribute(SNAPSHOT_ATTRIBUTE);\n host.removeAttribute('aria-busy');\n };\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { NgDocPlaygroundProperty } from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n return objectKeys(obj).includes('type');\n}\n","import type { LocationStrategy } from '@angular/common';\n\n/**\n * Returns the current route as an absolute URL in path form: the route's path, query and fragment\n * on the document's origin.\n *\n * With `PathLocationStrategy`, the default, it is the document's own URL. With\n * `HashLocationStrategy` the route lives in the document's fragment (`/#/docs/page#section`), so\n * `location.hash` and links resolved against `location.href` see the wrong part of the URL. This\n * URL carries the route's own fragment, and relative links resolve against the route.\n * @param locationStrategy - The location strategy of the application.\n * @param documentUrl - The URL of the document, `location.href`.\n * @returns The URL of the route.\n * @internal\n */\nexport function ɵngDocRouteUrl(locationStrategy: LocationStrategy, documentUrl: string): URL {\n // A path that starts with `//` would be read as another host.\n return new URL(locationStrategy.path(true).replace(/^\\/*/, '/'), documentUrl);\n}\n\n/**\n * Returns the absolute URL of the current page, without its query, as the reader shares it: the\n * route in the form the location strategy shows it (`/docs/page` or `/#/docs/page`).\n * @param locationStrategy - The location strategy of the application.\n * @param location - The location of the document.\n * @param fragment - The fragment to link to, without `#`.\n * @returns The URL of the page.\n * @internal\n */\nexport function ɵngDocPageUrl(\n locationStrategy: LocationStrategy,\n location: Pick<Location, 'href' | 'origin' | 'pathname'>,\n fragment?: string,\n): string {\n const route = ɵngDocRouteUrl(locationStrategy, location.href);\n // `path()` includes the base href and `prepareExternalUrl()` adds it, so it is removed in\n // between; the round trip gives back the document's own path with `PathLocationStrategy`.\n const base = new URL(locationStrategy.getBaseHref() || '/', route).pathname.replace(/\\/+$/, '');\n const path =\n base && (route.pathname === base || route.pathname.startsWith(`${base}/`))\n ? route.pathname.slice(base.length) || '/'\n : route.pathname;\n const external = locationStrategy.prepareExternalUrl(fragment ? `${path}#${fragment}` : path);\n\n if (external.startsWith('#')) {\n // The route is the document's fragment: it follows the document's path, without its query.\n return `${location.origin}${location.pathname}${external}`;\n }\n\n if (external.startsWith('/') && !external.startsWith('//')) {\n return `${location.origin}${external}`;\n }\n\n return new URL(external, location.href).href;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACtC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK;AAC7B,cAAE;AACF,cAAE,KAAK,CAAC,WAAW,EAAE,KAAK;AACxB,kBAAE;AACF,kBAAE,CAAC,CAAC,KAAK;IACf;IACA,OAAO,CAAC,CAAC,KAAK;AAChB;;ACTA;AACA,MAAM,WAAW,GAAG,eAAe;AAOnC;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAoC;AAEhE;;;;AAIG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAA0C;AAE1E;AACA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyC;AAE5E;;;;;AAKG;MACU,oBAAoB,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CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AACvE,UAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;AACvC,UAAE,KAAK,CAAC,QAAQ;IACpB,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,QAAQ,GAAG,GAAG,IAAI,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAE,GAAG,IAAI,CAAC;AAE7F,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;;QAE5B,OAAO,CAAA,EAAG,QAAQ,CAAC,MAAM,CAAA,EAAG,QAAQ,CAAC,QAAQ,CAAA,EAAG,QAAQ,CAAA,CAAE;IAC5D;AAEA,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC1D,QAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAA,EAAG,QAAQ,EAAE;IACxC;IAEA,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI;AAC9C;;ACtDA;;AAEG;;;;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Decodes a URI component, and returns the value unchanged when it is not a valid encoding.
|
|
6
|
+
*/
|
|
4
7
|
class NgDocDecodeUriComponentPipe {
|
|
5
8
|
transform(value) {
|
|
6
9
|
try {
|
|
@@ -10,14 +13,13 @@ class NgDocDecodeUriComponentPipe {
|
|
|
10
13
|
return value;
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
14
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, isStandalone: true, name: "decodeUriComponent" }); }
|
|
15
18
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, decorators: [{
|
|
17
20
|
type: Pipe,
|
|
18
21
|
args: [{
|
|
19
22
|
name: 'decodeUriComponent',
|
|
20
|
-
standalone: true,
|
|
21
23
|
}]
|
|
22
24
|
}] });
|
|
23
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-pipes-decode-uri-component.mjs","sources":["../../../../libs/app/pipes/decode-uri-component/decode-uri-component.pipe.ts","../../../../libs/app/pipes/decode-uri-component/ng-doc-app-pipes-decode-uri-component.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'decodeUriComponent',\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-pipes-decode-uri-component.mjs","sources":["../../../../libs/app/pipes/decode-uri-component/decode-uri-component.pipe.ts","../../../../libs/app/pipes/decode-uri-component/ng-doc-app-pipes-decode-uri-component.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Decodes a URI component, and returns the value unchanged when it is not a valid encoding.\n */\n@Pipe({\n name: 'decodeUriComponent',\n})\nexport class NgDocDecodeUriComponentPipe implements PipeTransform {\n transform(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;AAEG;MAIU,2BAA2B,CAAA;AACtC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI;AACF,YAAA,OAAO,kBAAkB,CAAC,KAAK,CAAC;QAClC;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,KAAK;QACd;IACF;8GAPW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,oBAAoB;AAC3B,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -2,18 +2,20 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
import { extractValue } from '@ng-doc/core/helpers/extract-value';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Parses the string form of a value (for example a default value of a playground property).
|
|
7
|
+
*/
|
|
5
8
|
class NgDocExtractValuePipe {
|
|
6
9
|
transform(value) {
|
|
7
10
|
return extractValue(value);
|
|
8
11
|
}
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
10
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
13
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, isStandalone: true, name: "ngDocExtractValue" }); }
|
|
11
14
|
}
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, decorators: [{
|
|
13
16
|
type: Pipe,
|
|
14
17
|
args: [{
|
|
15
18
|
name: 'ngDocExtractValue',
|
|
16
|
-
standalone: true,
|
|
17
19
|
}]
|
|
18
20
|
}] });
|
|
19
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-pipes-extract-value.mjs","sources":["../../../../libs/app/pipes/extract-value/extract-value.pipe.ts","../../../../libs/app/pipes/extract-value/ng-doc-app-pipes-extract-value.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { extractValue } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocExtractedValue } from '@ng-doc/core/types/extracted-value';\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-pipes-extract-value.mjs","sources":["../../../../libs/app/pipes/extract-value/extract-value.pipe.ts","../../../../libs/app/pipes/extract-value/ng-doc-app-pipes-extract-value.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { extractValue } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocExtractedValue } from '@ng-doc/core/types/extracted-value';\n\n/**\n * Parses the string form of a value (for example a default value of a playground property).\n */\n@Pipe({\n name: 'ngDocExtractValue',\n})\nexport class NgDocExtractValuePipe implements PipeTransform {\n transform(value: string): NgDocExtractedValue {\n return extractValue(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;AAEG;MAIU,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC;IAC5B;8GAHW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Keeps the items that match a search term. By default an item matches when its string form
|
|
6
|
+
* equals the term.
|
|
7
|
+
*/
|
|
4
8
|
class NgDocFilterByTextPipe {
|
|
5
9
|
transform(items, searchTerm, matcher = (item, s) => String(item) === s) {
|
|
6
10
|
return items?.filter((item) => matcher(item, searchTerm)) ?? [];
|
|
7
11
|
}
|
|
8
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
9
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
13
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, isStandalone: true, name: "ngDocFilterByText" }); }
|
|
10
14
|
}
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, decorators: [{
|
|
12
16
|
type: Pipe,
|
|
13
17
|
args: [{
|
|
14
18
|
name: 'ngDocFilterByText',
|
|
15
|
-
standalone: true,
|
|
16
19
|
}]
|
|
17
20
|
}] });
|
|
18
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-pipes-filter-by-text.mjs","sources":["../../../../libs/app/pipes/filter-by-text/filter-by-text.pipe.ts","../../../../libs/app/pipes/filter-by-text/ng-doc-app-pipes-filter-by-text.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-pipes-filter-by-text.mjs","sources":["../../../../libs/app/pipes/filter-by-text/filter-by-text.pipe.ts","../../../../libs/app/pipes/filter-by-text/ng-doc-app-pipes-filter-by-text.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Keeps the items that match a search term. By default an item matches when its string form\n * equals the term.\n */\n@Pipe({\n name: 'ngDocFilterByText',\n})\nexport class NgDocFilterByTextPipe<T> implements PipeTransform {\n transform(\n items: readonly T[],\n searchTerm: string,\n matcher: (item: T, searchTerm: string) => boolean = (item: T, s: string) => String(item) === s,\n ): readonly T[] {\n return items?.filter((item: T) => matcher(item, searchTerm)) ?? [];\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;MAIU,qBAAqB,CAAA;AAChC,IAAA,SAAS,CACP,KAAmB,EACnB,UAAkB,EAClB,OAAA,GAAoD,CAAC,IAAO,EAAE,CAAS,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;AAE9F,QAAA,OAAO,KAAK,EAAE,MAAM,CAAC,CAAC,IAAO,KAAK,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE;IACpE;8GAPW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -2,6 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, Pipe } from '@angular/core';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Marks HTML as trusted, so it can be bound to `innerHTML` without sanitization. Use it only for
|
|
7
|
+
* HTML that NgDoc generated.
|
|
8
|
+
*/
|
|
5
9
|
class NgDocSanitizeHtmlPipe {
|
|
6
10
|
constructor() {
|
|
7
11
|
this.sanitizer = inject(DomSanitizer);
|
|
@@ -9,16 +13,15 @@ class NgDocSanitizeHtmlPipe {
|
|
|
9
13
|
transform(value) {
|
|
10
14
|
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
11
15
|
}
|
|
12
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
13
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, isStandalone: true, name: "ngDocSanitizeHtml" }); }
|
|
14
18
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, decorators: [{
|
|
16
20
|
type: Pipe,
|
|
17
21
|
args: [{
|
|
18
22
|
name: 'ngDocSanitizeHtml',
|
|
19
|
-
standalone: true,
|
|
20
23
|
}]
|
|
21
|
-
}]
|
|
24
|
+
}] });
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-doc-app-pipes-sanitize-html.mjs","sources":["../../../../libs/app/pipes/sanitize-html/sanitize-html.pipe.ts","../../../../libs/app/pipes/sanitize-html/ng-doc-app-pipes-sanitize-html.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Pipe({\n name: 'ngDocSanitizeHtml',\n
|
|
1
|
+
{"version":3,"file":"ng-doc-app-pipes-sanitize-html.mjs","sources":["../../../../libs/app/pipes/sanitize-html/sanitize-html.pipe.ts","../../../../libs/app/pipes/sanitize-html/ng-doc-app-pipes-sanitize-html.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Marks HTML as trusted, so it can be bound to `innerHTML` without sanitization. Use it only for\n * HTML that NgDoc generated.\n */\n@Pipe({\n name: 'ngDocSanitizeHtml',\n})\nexport class NgDocSanitizeHtmlPipe implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n transform(value: string): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;AAGG;MAIU,qBAAqB,CAAA;AAHlC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;AAKlD,IAAA;AAHC,IAAA,SAAS,CAAC,KAAa,EAAA;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACtD;8GALW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACTD;;AAEG;;;;"}
|