@analogjs/content 2.0.0-alpha.9 → 2.0.0-beta.2

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.
Files changed (39) hide show
  1. package/fesm2022/analogjs-content-og.mjs.map +1 -1
  2. package/fesm2022/analogjs-content-prism-highlighter.mjs +4 -4
  3. package/fesm2022/analogjs-content-prism-highlighter.mjs.map +1 -1
  4. package/fesm2022/analogjs-content-resources.mjs +85 -0
  5. package/fesm2022/analogjs-content-resources.mjs.map +1 -0
  6. package/fesm2022/analogjs-content-shiki-highlighter.mjs +1 -1
  7. package/fesm2022/analogjs-content-shiki-highlighter.mjs.map +1 -1
  8. package/fesm2022/analogjs-content.mjs +65 -33
  9. package/fesm2022/analogjs-content.mjs.map +1 -1
  10. package/index.d.ts +162 -12
  11. package/og/index.d.ts +19 -2
  12. package/package.json +17 -6
  13. package/plugin/migrations.json +2 -24
  14. package/prism-highlighter/index.d.ts +14 -7
  15. package/resources/README.md +3 -0
  16. package/resources/index.d.ts +20 -0
  17. package/resources/package.json +3 -0
  18. package/shiki-highlighter/index.d.ts +8 -4
  19. package/lib/anchor-navigation.directive.d.ts +0 -9
  20. package/lib/content-file.d.ts +0 -6
  21. package/lib/content-files-list-token.d.ts +0 -3
  22. package/lib/content-files-token.d.ts +0 -2
  23. package/lib/content-renderer.d.ts +0 -25
  24. package/lib/content.d.ts +0 -14
  25. package/lib/get-content-files.d.ts +0 -15
  26. package/lib/inject-content-files.d.ts +0 -3
  27. package/lib/markdown-content-renderer.service.d.ts +0 -13
  28. package/lib/markdown-route.component.d.ts +0 -15
  29. package/lib/markdown.component.d.ts +0 -29
  30. package/lib/marked-content-highlighter.d.ts +0 -19
  31. package/lib/marked-setup.service.d.ts +0 -10
  32. package/lib/parse-raw-content-file.d.ts +0 -4
  33. package/lib/provide-content.d.ts +0 -7
  34. package/lib/render-task.service.d.ts +0 -8
  35. package/lib/utils/zone-wait-for.d.ts +0 -2
  36. package/og/lib/og.d.ts +0 -5
  37. package/og/lib/options.d.ts +0 -11
  38. package/prism-highlighter/lib/prism/angular.d.ts +0 -0
  39. package/prism-highlighter/lib/prism-highlighter.d.ts +0 -8
package/index.d.ts CHANGED
@@ -1,12 +1,162 @@
1
- export { AnchorNavigationDirective } from './lib/anchor-navigation.directive';
2
- export { injectContent } from './lib/content';
3
- export { ContentFile } from './lib/content-file';
4
- export { ContentRenderer, NoopContentRenderer } from './lib/content-renderer';
5
- export { injectContentFiles } from './lib/inject-content-files';
6
- export { MarkdownContentRendererService } from './lib/markdown-content-renderer.service';
7
- export { provideContent, withMarkdownRenderer, MERMAID_IMPORT_TOKEN, } from './lib/provide-content';
8
- export { default as MarkdownRouteComponent } from './lib/markdown-route.component';
9
- export { default as MarkdownComponent } from './lib/markdown.component';
10
- export { parseRawContentFile } from './lib/parse-raw-content-file';
11
- export { MarkedSetupService } from './lib/marked-setup.service';
12
- export { MarkedContentHighlighter, withHighlighter, } from './lib/marked-content-highlighter';
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
- export { ImageResponse } from './lib/og';
2
- export { ImageResponseOptions } from './lib/options';
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-alpha.9",
3
+ "version": "2.0.0-beta.2",
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
  },
@@ -65,6 +68,10 @@
65
68
  ],
66
69
  "migrations": "./plugin/migrations.json"
67
70
  },
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "provenance": true
74
+ },
68
75
  "module": "fesm2022/analogjs-content.mjs",
69
76
  "typings": "index.d.ts",
70
77
  "exports": {
@@ -83,6 +90,10 @@
83
90
  "types": "./prism-highlighter/index.d.ts",
84
91
  "default": "./fesm2022/analogjs-content-prism-highlighter.mjs"
85
92
  },
93
+ "./resources": {
94
+ "types": "./resources/index.d.ts",
95
+ "default": "./fesm2022/analogjs-content-resources.mjs"
96
+ },
86
97
  "./shiki-highlighter": {
87
98
  "types": "./shiki-highlighter/index.d.ts",
88
99
  "default": "./fesm2022/analogjs-content-shiki-highlighter.mjs"
@@ -1,28 +1,6 @@
1
1
  {
2
- "generators": {
3
- "update-markdown-renderer-feature": {
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 { PrismHighlighter } from './lib/prism-highlighter';
3
- import 'prismjs';
4
- import 'prismjs/plugins/toolbar/prism-toolbar';
5
- import 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard';
6
- import './lib/prism/angular';
7
- export { PrismHighlighter };
8
- export declare function withPrismHighlighter(): Provider[];
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,3 @@
1
+ # @analogjs/content/resources
2
+
3
+ Secondary entry point of `@analogjs/content`. It can be used by importing from `@analogjs/content/resources`.
@@ -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 };
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/analogjs-content-resources.mjs"
3
+ }
@@ -1,7 +1,11 @@
1
1
  import { Provider } from '@angular/core';
2
- import type { BundledLanguage, BundledTheme, CodeOptionsMeta, CodeOptionsMultipleThemes, CodeOptionsSingleTheme, CodeToHastOptionsCommon } from 'shiki';
3
- export type ShikiHighlightOptions = Partial<Omit<CodeToHastOptionsCommon<BundledLanguage>, 'lang'>> & CodeOptionsMeta & Partial<CodeOptionsSingleTheme<BundledTheme>> & Partial<CodeOptionsMultipleThemes<BundledTheme>>;
4
- export type WithShikiHighlighterOptions = ShikiHighlightOptions & {
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
- export declare function withShikiHighlighter(_opts?: WithShikiHighlighterOptions): Provider[];
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
- }
@@ -1,6 +0,0 @@
1
- export interface ContentFile<Attributes extends Record<string, any> = Record<string, any>> {
2
- filename: string;
3
- slug: string;
4
- content?: string | object;
5
- attributes: Attributes;
6
- }
@@ -1,3 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ContentFile } from './content-file';
3
- export declare const CONTENT_FILES_LIST_TOKEN: InjectionToken<ContentFile<Record<string, any>>[]>;
@@ -1,2 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export declare const CONTENT_FILES_TOKEN: InjectionToken<Record<string, () => Promise<string>>>;
@@ -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
- }
@@ -1,4 +0,0 @@
1
- export declare function parseRawContentFile<Attributes extends Record<string, any>>(rawContentFile: string): {
2
- content: string;
3
- attributes: Attributes;
4
- };
@@ -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
- }
@@ -1,2 +0,0 @@
1
- import { Observable } from 'rxjs';
2
- export declare function waitFor<T>(prom: Promise<T> | Observable<T>): Promise<T>;
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
- }
@@ -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
- }