@analogjs/content 2.0.0-alpha.7 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/analogjs-content-og.mjs.map +1 -1
- package/fesm2022/analogjs-content-prism-highlighter.mjs +4 -4
- package/fesm2022/analogjs-content-prism-highlighter.mjs.map +1 -1
- package/fesm2022/analogjs-content-resources.mjs +85 -0
- package/fesm2022/analogjs-content-resources.mjs.map +1 -0
- package/fesm2022/analogjs-content-shiki-highlighter.mjs +1 -1
- package/fesm2022/analogjs-content-shiki-highlighter.mjs.map +1 -1
- package/fesm2022/analogjs-content.mjs +65 -33
- package/fesm2022/analogjs-content.mjs.map +1 -1
- package/index.d.ts +162 -12
- package/og/index.d.ts +19 -2
- package/package.json +18 -6
- package/plugin/migrations.json +2 -24
- package/prism-highlighter/index.d.ts +14 -7
- package/resources/README.md +3 -0
- package/resources/index.d.ts +20 -0
- package/resources/package.json +3 -0
- package/shiki-highlighter/index.d.ts +8 -4
- package/lib/anchor-navigation.directive.d.ts +0 -9
- package/lib/content-file.d.ts +0 -6
- package/lib/content-files-list-token.d.ts +0 -3
- package/lib/content-files-token.d.ts +0 -2
- package/lib/content-renderer.d.ts +0 -25
- package/lib/content.d.ts +0 -14
- package/lib/get-content-files.d.ts +0 -15
- package/lib/inject-content-files.d.ts +0 -3
- package/lib/markdown-content-renderer.service.d.ts +0 -13
- package/lib/markdown-route.component.d.ts +0 -15
- package/lib/markdown.component.d.ts +0 -29
- package/lib/marked-content-highlighter.d.ts +0 -19
- package/lib/marked-setup.service.d.ts +0 -10
- package/lib/parse-raw-content-file.d.ts +0 -4
- package/lib/provide-content.d.ts +0 -7
- package/lib/render-task.service.d.ts +0 -8
- package/lib/utils/zone-wait-for.d.ts +0 -2
- package/og/lib/og.d.ts +0 -5
- package/og/lib/options.d.ts +0 -11
- package/prism-highlighter/lib/prism/angular.d.ts +0 -0
- package/prism-highlighter/lib/prism-highlighter.d.ts +0 -8
package/index.d.ts
CHANGED
|
@@ -1,12 +1,162 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Provider, InjectionToken, AfterViewChecked, OnInit, OnChanges, ViewContainerRef, Type, AbstractType, ProviderToken } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import * as mermaid from 'mermaid';
|
|
5
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
6
|
+
import * as marked from 'marked';
|
|
7
|
+
import { marked as marked$1 } from 'marked';
|
|
8
|
+
|
|
9
|
+
declare class AnchorNavigationDirective {
|
|
10
|
+
private readonly document;
|
|
11
|
+
private readonly location;
|
|
12
|
+
private readonly router;
|
|
13
|
+
handleNavigation(element: HTMLElement): boolean;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnchorNavigationDirective, never>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AnchorNavigationDirective, "[analogAnchorNavigation]", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ContentFile<Attributes extends Record<string, any> = Record<string, any>> {
|
|
19
|
+
filename: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
content?: string | object;
|
|
22
|
+
attributes: Attributes;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the static content using the provided param and/or prefix.
|
|
27
|
+
*
|
|
28
|
+
* @param param route parameter (default: 'slug')
|
|
29
|
+
* @param fallback fallback text if content file is not found (default: 'No Content Found')
|
|
30
|
+
*/
|
|
31
|
+
declare function injectContent<Attributes extends Record<string, any> = Record<string, any>>(param?: string | {
|
|
32
|
+
param: string;
|
|
33
|
+
subdirectory: string;
|
|
34
|
+
} | {
|
|
35
|
+
customFilename: string;
|
|
36
|
+
}, fallback?: string): Observable<ContentFile<Attributes | Record<string, never>>>;
|
|
37
|
+
|
|
38
|
+
type TableOfContentItem = {
|
|
39
|
+
id: string;
|
|
40
|
+
level: number;
|
|
41
|
+
text: string;
|
|
42
|
+
};
|
|
43
|
+
declare abstract class ContentRenderer {
|
|
44
|
+
render(content: string): Promise<string>;
|
|
45
|
+
getContentHeadings(): Array<TableOfContentItem>;
|
|
46
|
+
enhance(): void;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContentRenderer, never>;
|
|
48
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ContentRenderer>;
|
|
49
|
+
}
|
|
50
|
+
declare class NoopContentRenderer implements ContentRenderer {
|
|
51
|
+
private readonly transferState;
|
|
52
|
+
private contentId;
|
|
53
|
+
/**
|
|
54
|
+
* Generates a hash from the content string
|
|
55
|
+
* to be used with the transfer state
|
|
56
|
+
*/
|
|
57
|
+
private generateHash;
|
|
58
|
+
render(content: string): Promise<string>;
|
|
59
|
+
enhance(): void;
|
|
60
|
+
getContentHeadings(): Array<TableOfContentItem>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare function injectContentFiles<Attributes extends Record<string, any>>(filterFn?: InjectContentFilesFilterFunction<Attributes>): ContentFile<Attributes>[];
|
|
64
|
+
type InjectContentFilesFilterFunction<T extends Record<string, any>> = (value: ContentFile<T>, index: number, array: ContentFile<T>[]) => boolean;
|
|
65
|
+
declare function injectContentFilesMap(): Record<string, () => Promise<string>>;
|
|
66
|
+
|
|
67
|
+
declare class MarkdownContentRendererService implements ContentRenderer {
|
|
68
|
+
#private;
|
|
69
|
+
render(content: string): Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* The method is meant to be called after `render()`
|
|
72
|
+
*/
|
|
73
|
+
getContentHeadings(): TableOfContentItem[];
|
|
74
|
+
enhance(): void;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownContentRendererService, never>;
|
|
76
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkdownContentRendererService>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface MarkdownRendererOptions {
|
|
80
|
+
loadMermaid?: () => Promise<typeof mermaid>;
|
|
81
|
+
}
|
|
82
|
+
declare function withMarkdownRenderer(options?: MarkdownRendererOptions): Provider;
|
|
83
|
+
declare function provideContent(...features: Provider[]): Provider[];
|
|
84
|
+
declare const MERMAID_IMPORT_TOKEN: InjectionToken<Promise<typeof mermaid>>;
|
|
85
|
+
|
|
86
|
+
declare class AnalogMarkdownRouteComponent implements AfterViewChecked {
|
|
87
|
+
private sanitizer;
|
|
88
|
+
private route;
|
|
89
|
+
contentRenderer: ContentRenderer;
|
|
90
|
+
protected content: SafeHtml;
|
|
91
|
+
classes: string;
|
|
92
|
+
ngAfterViewChecked(): void;
|
|
93
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownRouteComponent, never>;
|
|
94
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AnalogMarkdownRouteComponent, "analog-markdown-route", never, { "classes": { "alias": "classes"; "required": false; }; }, {}, never, never, true, [{ directive: typeof AnchorNavigationDirective; inputs: {}; outputs: {}; }]>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare class AnalogMarkdownComponent implements OnInit, OnChanges, AfterViewChecked {
|
|
98
|
+
private sanitizer;
|
|
99
|
+
private route;
|
|
100
|
+
private zone;
|
|
101
|
+
private readonly platformId;
|
|
102
|
+
private readonly mermaidImport;
|
|
103
|
+
private mermaid;
|
|
104
|
+
content$: Observable<SafeHtml>;
|
|
105
|
+
content: string | object | undefined | null;
|
|
106
|
+
classes: string;
|
|
107
|
+
container: ViewContainerRef;
|
|
108
|
+
contentRenderer: ContentRenderer;
|
|
109
|
+
constructor();
|
|
110
|
+
ngOnInit(): void;
|
|
111
|
+
ngOnChanges(): void;
|
|
112
|
+
updateContent(): void;
|
|
113
|
+
getContentSource(): Observable<string | SafeHtml>;
|
|
114
|
+
renderContent(content: string): Promise<string>;
|
|
115
|
+
ngAfterViewChecked(): void;
|
|
116
|
+
private loadMermaid;
|
|
117
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownComponent, never>;
|
|
118
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AnalogMarkdownComponent, "analog-markdown", never, { "content": { "alias": "content"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; }, {}, never, never, true, [{ directive: typeof AnchorNavigationDirective; inputs: {}; outputs: {}; }]>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare function parseRawContentFile<Attributes extends Record<string, any>>(rawContentFile: string): {
|
|
122
|
+
content: string;
|
|
123
|
+
attributes: Attributes;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare class MarkedSetupService {
|
|
127
|
+
private readonly marked;
|
|
128
|
+
private readonly highlighter;
|
|
129
|
+
constructor();
|
|
130
|
+
getMarkedInstance(): typeof marked$1;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedSetupService, never>;
|
|
132
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedSetupService>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface MarkedContentHighlighter {
|
|
136
|
+
augmentCodeBlock?(code: string, lang: string): string;
|
|
137
|
+
}
|
|
138
|
+
declare abstract class MarkedContentHighlighter {
|
|
139
|
+
abstract getHighlightExtension(): marked.MarkedExtension;
|
|
140
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedContentHighlighter, never>;
|
|
141
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedContentHighlighter>;
|
|
142
|
+
}
|
|
143
|
+
declare function withHighlighter(provider: ({
|
|
144
|
+
useValue: MarkedContentHighlighter;
|
|
145
|
+
} | {
|
|
146
|
+
useClass: Type<MarkedContentHighlighter> | AbstractType<MarkedContentHighlighter>;
|
|
147
|
+
} | {
|
|
148
|
+
useFactory: (...deps: any[]) => MarkedContentHighlighter;
|
|
149
|
+
}) & {
|
|
150
|
+
deps?: ProviderToken<any>[];
|
|
151
|
+
}): Provider;
|
|
152
|
+
|
|
153
|
+
type ContentListLoaderFunction<Attributes extends Record<string, any>> = () => Promise<ContentFile<Attributes>[]>;
|
|
154
|
+
declare function injectContentListLoader<Attributes extends Record<string, any>>(): ContentListLoaderFunction<Attributes>;
|
|
155
|
+
declare function withContentListLoader(): Provider;
|
|
156
|
+
|
|
157
|
+
type ContentFileLoaderFunction = () => Promise<Record<string, () => Promise<string>>>;
|
|
158
|
+
declare function injectContentFileLoader(): ContentFileLoaderFunction;
|
|
159
|
+
declare function withContentFileLoader(): Provider;
|
|
160
|
+
|
|
161
|
+
export { AnchorNavigationDirective, ContentRenderer, MERMAID_IMPORT_TOKEN, AnalogMarkdownComponent as MarkdownComponent, MarkdownContentRendererService, AnalogMarkdownRouteComponent as MarkdownRouteComponent, MarkedContentHighlighter, MarkedSetupService, NoopContentRenderer, injectContent, injectContentFileLoader, injectContentFiles, injectContentFilesMap, injectContentListLoader, parseRawContentFile, provideContent, withContentFileLoader, withContentListLoader, withHighlighter, withMarkdownRenderer };
|
|
162
|
+
export type { ContentFile, InjectContentFilesFilterFunction };
|
package/og/index.d.ts
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { SatoriOptions } from 'satori/wasm';
|
|
2
|
+
|
|
3
|
+
interface ImageResponseOptions {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
fonts?: SatoriOptions['fonts'];
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
status?: number;
|
|
9
|
+
statusText?: string;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
tailwindConfig?: SatoriOptions['tailwindConfig'];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare class ImageResponse extends Response {
|
|
15
|
+
constructor(element: string, options?: ImageResponseOptions);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { ImageResponse };
|
|
19
|
+
export type { ImageResponseOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@analogjs/content",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"description": "Content Rendering for Analog",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"url": "https://github.com/sponsors/brandonroberts"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
27
|
-
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
28
|
-
"@angular/platform-browser": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
29
|
-
"@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
30
|
-
"@nx/devkit": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
26
|
+
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
27
|
+
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
28
|
+
"@angular/platform-browser": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
29
|
+
"@angular/router": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
|
30
|
+
"@nx/devkit": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
31
31
|
"front-matter": "^4.0.2",
|
|
32
32
|
"marked": "^15.0.7",
|
|
33
33
|
"marked-gfm-heading-id": "^4.1.1",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"sharp": "^0.33.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
|
+
"@nx/devkit": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
43
46
|
"satori": {
|
|
44
47
|
"optional": true
|
|
45
48
|
},
|
|
@@ -58,12 +61,17 @@
|
|
|
58
61
|
"@analogjs/platform",
|
|
59
62
|
"@analogjs/content",
|
|
60
63
|
"@analogjs/router",
|
|
64
|
+
"@analogjs/storybook-angular",
|
|
61
65
|
"@analogjs/vite-plugin-angular",
|
|
62
66
|
"@analogjs/vite-plugin-nitro",
|
|
63
67
|
"@analogjs/vitest-angular"
|
|
64
68
|
],
|
|
65
69
|
"migrations": "./plugin/migrations.json"
|
|
66
70
|
},
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public",
|
|
73
|
+
"provenance": true
|
|
74
|
+
},
|
|
67
75
|
"module": "fesm2022/analogjs-content.mjs",
|
|
68
76
|
"typings": "index.d.ts",
|
|
69
77
|
"exports": {
|
|
@@ -82,6 +90,10 @@
|
|
|
82
90
|
"types": "./prism-highlighter/index.d.ts",
|
|
83
91
|
"default": "./fesm2022/analogjs-content-prism-highlighter.mjs"
|
|
84
92
|
},
|
|
93
|
+
"./resources": {
|
|
94
|
+
"types": "./resources/index.d.ts",
|
|
95
|
+
"default": "./fesm2022/analogjs-content-resources.mjs"
|
|
96
|
+
},
|
|
85
97
|
"./shiki-highlighter": {
|
|
86
98
|
"types": "./shiki-highlighter/index.d.ts",
|
|
87
99
|
"default": "./fesm2022/analogjs-content-shiki-highlighter.mjs"
|
package/plugin/migrations.json
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generators": {
|
|
3
|
-
|
|
4
|
-
"version": "1.5.0-beta.1",
|
|
5
|
-
"description": "Update withMarkdownRenderer feature with withPrismHighlighter",
|
|
6
|
-
"implementation": "./src/migrations/update-markdown-renderer-feature/update-markdown-renderer-feature"
|
|
7
|
-
},
|
|
8
|
-
"update-marked-version": {
|
|
9
|
-
"version": "1.15.0-beta.3",
|
|
10
|
-
"description": "Update marked version to 15.0.7",
|
|
11
|
-
"implementation": "./src/migrations/update-markdown-version/update-markdown-version"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"schematics": {
|
|
15
|
-
"update-markdown-renderer-feature": {
|
|
16
|
-
"version": "1.5.0-beta.1",
|
|
17
|
-
"description": "Update withMarkdownRenderer feature with withPrismHighlighter",
|
|
18
|
-
"factory": "./src/migrations/update-markdown-renderer-feature/compat"
|
|
19
|
-
},
|
|
20
|
-
"update-marked-version": {
|
|
21
|
-
"version": "1.15.0-beta.3",
|
|
22
|
-
"description": "Update marked version to 15.0.7",
|
|
23
|
-
"factory": "./src/migrations/update-markdown-version/compat"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
2
|
+
"generators": {},
|
|
3
|
+
"schematics": {},
|
|
26
4
|
"packageJsonUpdates": {
|
|
27
5
|
"0.2.0-beta.23": {
|
|
28
6
|
"version": "0.2.0-beta.19",
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
1
2
|
import { Provider } from '@angular/core';
|
|
2
|
-
import
|
|
3
|
-
import '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import * as marked from 'marked';
|
|
4
|
+
import { MarkedContentHighlighter } from '@analogjs/content';
|
|
5
|
+
|
|
6
|
+
declare class PrismHighlighter extends MarkedContentHighlighter {
|
|
7
|
+
augmentCodeBlock(code: string, lang: string): string;
|
|
8
|
+
getHighlightExtension(): marked.MarkedExtension;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PrismHighlighter, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PrismHighlighter>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare function withPrismHighlighter(): Provider[];
|
|
14
|
+
|
|
15
|
+
export { PrismHighlighter, withPrismHighlighter };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal } from '@angular/core';
|
|
3
|
+
import * as _analogjs_content from '@analogjs/content';
|
|
4
|
+
import { InjectContentFilesFilterFunction, ContentFile } from '@analogjs/content';
|
|
5
|
+
|
|
6
|
+
declare function contentFilesResource<Attributes extends Record<string, any>>(filterFn?: InjectContentFilesFilterFunction<Attributes> | undefined): _angular_core.ResourceRef<_analogjs_content.ContentFile<Attributes>[] | undefined>;
|
|
7
|
+
|
|
8
|
+
type ContentFileParams = Signal<string | {
|
|
9
|
+
customFilename: string;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Resource for requesting an individual content file
|
|
13
|
+
*
|
|
14
|
+
* @param params
|
|
15
|
+
* @param fallback
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
declare function contentFileResource<Attributes extends Record<string, any> = Record<string, any>>(params?: ContentFileParams, fallback?: string): _angular_core.ResourceRef<ContentFile<Record<string, never> | Attributes> | undefined>;
|
|
19
|
+
|
|
20
|
+
export { contentFileResource, contentFilesResource };
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Provider } from '@angular/core';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { CodeToHastOptionsCommon, BundledLanguage, CodeOptionsMeta, CodeOptionsSingleTheme, BundledTheme, CodeOptionsMultipleThemes } from 'shiki';
|
|
3
|
+
|
|
4
|
+
type ShikiHighlightOptions = Partial<Omit<CodeToHastOptionsCommon<BundledLanguage>, 'lang'>> & CodeOptionsMeta & Partial<CodeOptionsSingleTheme<BundledTheme>> & Partial<CodeOptionsMultipleThemes<BundledTheme>>;
|
|
5
|
+
type WithShikiHighlighterOptions = ShikiHighlightOptions & {
|
|
5
6
|
container?: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
declare function withShikiHighlighter(_opts?: WithShikiHighlighterOptions): Provider[];
|
|
9
|
+
|
|
10
|
+
export { withShikiHighlighter };
|
|
11
|
+
export type { ShikiHighlightOptions, WithShikiHighlighterOptions };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class AnchorNavigationDirective {
|
|
3
|
-
private readonly document;
|
|
4
|
-
private readonly location;
|
|
5
|
-
private readonly router;
|
|
6
|
-
handleNavigation(element: HTMLElement): boolean;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AnchorNavigationDirective, never>;
|
|
8
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AnchorNavigationDirective, "[analogAnchorNavigation]", never, {}, {}, never, never, true, never>;
|
|
9
|
-
}
|
package/lib/content-file.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export type TableOfContentItem = {
|
|
3
|
-
id: string;
|
|
4
|
-
level: number;
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
export declare abstract class ContentRenderer {
|
|
8
|
-
render(content: string): Promise<string>;
|
|
9
|
-
getContentHeadings(): Array<TableOfContentItem>;
|
|
10
|
-
enhance(): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ContentRenderer, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ContentRenderer>;
|
|
13
|
-
}
|
|
14
|
-
export declare class NoopContentRenderer implements ContentRenderer {
|
|
15
|
-
private readonly transferState;
|
|
16
|
-
private contentId;
|
|
17
|
-
/**
|
|
18
|
-
* Generates a hash from the content string
|
|
19
|
-
* to be used with the transfer state
|
|
20
|
-
*/
|
|
21
|
-
private generateHash;
|
|
22
|
-
render(content: string): Promise<string>;
|
|
23
|
-
enhance(): void;
|
|
24
|
-
getContentHeadings(): Array<TableOfContentItem>;
|
|
25
|
-
}
|
package/lib/content.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ContentFile } from './content-file';
|
|
3
|
-
/**
|
|
4
|
-
* Retrieves the static content using the provided param and/or prefix.
|
|
5
|
-
*
|
|
6
|
-
* @param param route parameter (default: 'slug')
|
|
7
|
-
* @param fallback fallback text if content file is not found (default: 'No Content Found')
|
|
8
|
-
*/
|
|
9
|
-
export declare function injectContent<Attributes extends Record<string, any> = Record<string, any>>(param?: string | {
|
|
10
|
-
param: string;
|
|
11
|
-
subdirectory: string;
|
|
12
|
-
} | {
|
|
13
|
-
customFilename: string;
|
|
14
|
-
}, fallback?: string): Observable<ContentFile<Attributes | Record<string, never>>>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the list of content files by filename with ?analog-content-list=true.
|
|
3
|
-
* We use the query param to transform the return into an array of
|
|
4
|
-
* just front matter attributes.
|
|
5
|
-
*
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const getContentFilesList: () => Record<string, Record<string, any>>;
|
|
9
|
-
/**
|
|
10
|
-
* Returns the lazy loaded content files for lookups.
|
|
11
|
-
*
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
export declare const getContentFiles: () => {};
|
|
15
|
-
export declare const getAgxFiles: () => {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ContentFile } from './content-file';
|
|
2
|
-
export declare function injectContentFiles<Attributes extends Record<string, any>>(filterFn?: InjectContentFilesFilterFunction<Attributes>): ContentFile<Attributes>[];
|
|
3
|
-
export type InjectContentFilesFilterFunction<T extends Record<string, any>> = (value: ContentFile<T>, index: number, array: ContentFile<T>[]) => boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ContentRenderer, TableOfContentItem } from './content-renderer';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MarkdownContentRendererService implements ContentRenderer {
|
|
4
|
-
#private;
|
|
5
|
-
render(content: string): Promise<string>;
|
|
6
|
-
/**
|
|
7
|
-
* The method is meant to be called after `render()`
|
|
8
|
-
*/
|
|
9
|
-
getContentHeadings(): TableOfContentItem[];
|
|
10
|
-
enhance(): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownContentRendererService, never>;
|
|
12
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MarkdownContentRendererService>;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AfterViewChecked } from '@angular/core';
|
|
2
|
-
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { ContentRenderer } from './content-renderer';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "./anchor-navigation.directive";
|
|
6
|
-
export default class AnalogMarkdownRouteComponent implements AfterViewChecked {
|
|
7
|
-
private sanitizer;
|
|
8
|
-
private route;
|
|
9
|
-
contentRenderer: ContentRenderer;
|
|
10
|
-
protected content: SafeHtml;
|
|
11
|
-
classes: string;
|
|
12
|
-
ngAfterViewChecked(): void;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownRouteComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AnalogMarkdownRouteComponent, "analog-markdown-route", never, { "classes": { "alias": "classes"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.AnchorNavigationDirective; inputs: {}; outputs: {}; }]>;
|
|
15
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AfterViewChecked, OnChanges, OnInit, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { SafeHtml } from '@angular/platform-browser';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { ContentRenderer } from './content-renderer';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "./anchor-navigation.directive";
|
|
7
|
-
export default class AnalogMarkdownComponent implements OnInit, OnChanges, AfterViewChecked {
|
|
8
|
-
private sanitizer;
|
|
9
|
-
private route;
|
|
10
|
-
private zone;
|
|
11
|
-
private readonly platformId;
|
|
12
|
-
private readonly mermaidImport;
|
|
13
|
-
private mermaid;
|
|
14
|
-
content$: Observable<SafeHtml>;
|
|
15
|
-
content: string | object | undefined | null;
|
|
16
|
-
classes: string;
|
|
17
|
-
container: ViewContainerRef;
|
|
18
|
-
contentRenderer: ContentRenderer;
|
|
19
|
-
constructor();
|
|
20
|
-
ngOnInit(): void;
|
|
21
|
-
ngOnChanges(): void;
|
|
22
|
-
updateContent(): void;
|
|
23
|
-
getContentSource(): Observable<string | SafeHtml>;
|
|
24
|
-
renderContent(content: string): Promise<string>;
|
|
25
|
-
ngAfterViewChecked(): void;
|
|
26
|
-
private loadMermaid;
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownComponent, never>;
|
|
28
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AnalogMarkdownComponent, "analog-markdown", never, { "content": { "alias": "content"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.AnchorNavigationDirective; inputs: {}; outputs: {}; }]>;
|
|
29
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractType, Provider, ProviderToken, Type } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export interface MarkedContentHighlighter {
|
|
4
|
-
augmentCodeBlock?(code: string, lang: string): string;
|
|
5
|
-
}
|
|
6
|
-
export declare abstract class MarkedContentHighlighter {
|
|
7
|
-
abstract getHighlightExtension(): import('marked').MarkedExtension;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedContentHighlighter, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedContentHighlighter>;
|
|
10
|
-
}
|
|
11
|
-
export declare function withHighlighter(provider: ({
|
|
12
|
-
useValue: MarkedContentHighlighter;
|
|
13
|
-
} | {
|
|
14
|
-
useClass: Type<MarkedContentHighlighter> | AbstractType<MarkedContentHighlighter>;
|
|
15
|
-
} | {
|
|
16
|
-
useFactory: (...deps: any[]) => MarkedContentHighlighter;
|
|
17
|
-
}) & {
|
|
18
|
-
deps?: ProviderToken<any>[];
|
|
19
|
-
}): Provider;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { marked } from 'marked';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class MarkedSetupService {
|
|
4
|
-
private readonly marked;
|
|
5
|
-
private readonly highlighter;
|
|
6
|
-
constructor();
|
|
7
|
-
getMarkedInstance(): typeof marked;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedSetupService, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedSetupService>;
|
|
10
|
-
}
|
package/lib/provide-content.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Provider, InjectionToken } from '@angular/core';
|
|
2
|
-
export interface MarkdownRendererOptions {
|
|
3
|
-
loadMermaid?: () => Promise<typeof import('mermaid')>;
|
|
4
|
-
}
|
|
5
|
-
export declare function withMarkdownRenderer(options?: MarkdownRendererOptions): Provider;
|
|
6
|
-
export declare function provideContent(...features: Provider[]): Provider[];
|
|
7
|
-
export declare const MERMAID_IMPORT_TOKEN: InjectionToken<Promise<typeof import("mermaid")>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class RenderTaskService {
|
|
3
|
-
#private;
|
|
4
|
-
addRenderTask(): number;
|
|
5
|
-
clearRenderTask(clear: number | Function): void;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<RenderTaskService, never>;
|
|
7
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<RenderTaskService>;
|
|
8
|
-
}
|
package/og/lib/og.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ImageResponseOptions } from './options.js';
|
|
2
|
-
export declare const generateImage: (element: string, options: ImageResponseOptions) => Promise<Buffer>;
|
|
3
|
-
export declare class ImageResponse extends Response {
|
|
4
|
-
constructor(element: string, options?: ImageResponseOptions);
|
|
5
|
-
}
|
package/og/lib/options.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SatoriOptions } from 'satori/wasm';
|
|
2
|
-
export interface ImageResponseOptions {
|
|
3
|
-
width?: number;
|
|
4
|
-
height?: number;
|
|
5
|
-
fonts?: SatoriOptions['fonts'];
|
|
6
|
-
debug?: boolean;
|
|
7
|
-
status?: number;
|
|
8
|
-
statusText?: string;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
tailwindConfig?: SatoriOptions['tailwindConfig'];
|
|
11
|
-
}
|
|
File without changes
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MarkedContentHighlighter } from '@analogjs/content';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class PrismHighlighter extends MarkedContentHighlighter {
|
|
4
|
-
augmentCodeBlock(code: string, lang: string): string;
|
|
5
|
-
getHighlightExtension(): import("marked").MarkedExtension;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PrismHighlighter, never>;
|
|
7
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PrismHighlighter>;
|
|
8
|
-
}
|