@analogjs/content 2.0.0-alpha.2 → 2.0.0-alpha.21
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-shiki-highlighter.mjs +1 -1
- package/fesm2022/analogjs-content-shiki-highlighter.mjs.map +1 -1
- package/fesm2022/analogjs-content.mjs +32 -38
- package/fesm2022/analogjs-content.mjs.map +1 -1
- package/index.d.ts +153 -12
- package/og/index.d.ts +19 -2
- package/package.json +14 -10
- package/plugin/migrations.json +32 -0
- package/plugin/src/migrations/update-markdown-version/compat.d.ts +2 -0
- package/plugin/src/migrations/update-markdown-version/compat.js +6 -0
- package/plugin/src/migrations/update-markdown-version/compat.js.map +1 -0
- package/plugin/src/migrations/update-markdown-version/update-markdown-version.d.ts +2 -0
- package/plugin/src/migrations/update-markdown-version/update-markdown-version.js +23 -0
- package/plugin/src/migrations/update-markdown-version/update-markdown-version.js.map +1 -0
- package/prism-highlighter/index.d.ts +14 -7
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-content-og.mjs","sources":["../../../../packages/content/og/src/lib/og.ts","../../../../packages/content/og/src/analogjs-content-og.ts"],"sourcesContent":["// Credit for modified source: https://github.com/etherCorps/sveltekit-og/blob/main/src/lib/api.ts\n\nimport satori from 'satori';\nimport { html as toReactElement } from 'satori-html';\nimport sharp from 'sharp';\n\nimport { ImageResponseOptions } from './options
|
|
1
|
+
{"version":3,"file":"analogjs-content-og.mjs","sources":["../../../../packages/content/og/src/lib/og.ts","../../../../packages/content/og/src/analogjs-content-og.ts"],"sourcesContent":["// Credit for modified source: https://github.com/etherCorps/sveltekit-og/blob/main/src/lib/api.ts\n\nimport satori from 'satori';\nimport { html as toReactElement } from 'satori-html';\nimport sharp from 'sharp';\n\nimport { ImageResponseOptions } from './options';\n\nexport const generateImage = async (\n element: string,\n options: ImageResponseOptions,\n) => {\n const elementHtml = toReactElement(element);\n const svg = await satori(elementHtml as any, {\n width: options.width || 1200,\n height: options.height || 630,\n fonts: options.fonts?.length ? options.fonts : [],\n tailwindConfig: options.tailwindConfig,\n });\n const svgBuffer = Buffer.from(svg);\n const png = sharp(svgBuffer).png().toBuffer();\n\n const pngBuffer = await png;\n\n return pngBuffer;\n};\n\nexport class ImageResponse extends Response {\n constructor(element: string, options: ImageResponseOptions = {}) {\n super();\n\n const body = new ReadableStream({\n async start(controller) {\n const buffer = await generateImage(element, options);\n controller.enqueue(buffer);\n controller.close();\n },\n });\n\n return new Response(body, {\n headers: {\n 'Content-Type': 'image/png',\n 'Cache-Control': options.debug\n ? 'no-cache, no-store'\n : 'public, immutable, no-transform, max-age=31536000',\n ...options.headers,\n },\n status: options.status || 200,\n statusText: options.statusText,\n });\n }\n}\n","/**\n * Generated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CAAC;AACvB,sBAAE;AACF,sBAAE,mDAAmD;gBACvD,GAAG,OAAO,CAAC,OAAO;AACnB,aAAA;AACD,YAAA,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,GAAG;YAC7B,UAAU,EAAE,OAAO,CAAC,UAAU;AAC/B,SAAA,CAAC;;AAEL;;ACnDD;;AAEG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarkedContentHighlighter,
|
|
1
|
+
import { MarkedContentHighlighter, NoopContentRenderer, ContentRenderer } from '@analogjs/content';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable } from '@angular/core';
|
|
4
4
|
import { markedHighlight } from 'marked-highlight';
|
|
@@ -46,10 +46,10 @@ class PrismHighlighter extends MarkedContentHighlighter {
|
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
50
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
49
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PrismHighlighter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
50
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PrismHighlighter }); }
|
|
51
51
|
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PrismHighlighter, decorators: [{
|
|
53
53
|
type: Injectable
|
|
54
54
|
}] });
|
|
55
55
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-content-prism-highlighter.mjs","sources":["../../../../packages/content/prism-highlighter/src/lib/prism-highlighter.ts","../../../../packages/content/prism-highlighter/src/lib/prism/angular.js","../../../../packages/content/prism-highlighter/src/index.ts","../../../../packages/content/prism-highlighter/src/analogjs-content-prism-highlighter.ts"],"sourcesContent":["import { MarkedContentHighlighter } from '@analogjs/content';\nimport { Injectable } from '@angular/core';\nimport { markedHighlight } from 'marked-highlight';\n\ndeclare const Prism: typeof import('prismjs');\n\n@Injectable()\nexport class PrismHighlighter extends MarkedContentHighlighter {\n override augmentCodeBlock(code: string, lang: string): string {\n const classes =\n lang.startsWith('diff') && Prism.languages['diff']\n ? `language-${lang} diff-highlight`\n : `language-${lang.replace('diff-', '')}`;\n return `<pre class=\"${classes}\"><code class=\"${classes}\">${code}</code></pre>`;\n }\n\n override getHighlightExtension() {\n return markedHighlight({\n async: true,\n highlight: (code: string, lang: string) => {\n let diff = lang?.startsWith('diff-');\n lang = diff ? lang.replace('diff-', '') : lang || 'typescript';\n\n if (diff && !Prism.languages['diff']) {\n diff = false;\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The \\`diff\\` language and plugin are not available in the provided setup.\n To enable it, add the following imports your \\`app.config.ts\\`:\n import 'prismjs/components/prism-diff';\n import 'prismjs/plugins/diff-highlight/prism-diff-highlight';\n ---------------------------------------------------------------------------------------\n `);\n }\n\n if (!Prism.languages[lang]) {\n if (lang !== 'mermaid') {\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The requested language '${lang}' is not available in the provided setup.\n To enable it, add the following import your \\`app.config.ts\\`:\n import 'prismjs/components/prism-${lang}';\n ---------------------------------------------------------------------------------------\n `);\n }\n return code;\n }\n return Prism.highlight(\n code,\n diff ? Prism.languages['diff'] : Prism.languages[lang],\n lang
|
|
1
|
+
{"version":3,"file":"analogjs-content-prism-highlighter.mjs","sources":["../../../../packages/content/prism-highlighter/src/lib/prism-highlighter.ts","../../../../packages/content/prism-highlighter/src/lib/prism/angular.js","../../../../packages/content/prism-highlighter/src/index.ts","../../../../packages/content/prism-highlighter/src/analogjs-content-prism-highlighter.ts"],"sourcesContent":["import { MarkedContentHighlighter } from '@analogjs/content';\nimport { Injectable } from '@angular/core';\nimport { markedHighlight } from 'marked-highlight';\n\ndeclare const Prism: typeof import('prismjs');\n\n@Injectable()\nexport class PrismHighlighter extends MarkedContentHighlighter {\n override augmentCodeBlock(code: string, lang: string): string {\n const classes =\n lang.startsWith('diff') && Prism.languages['diff']\n ? `language-${lang} diff-highlight`\n : `language-${lang.replace('diff-', '')}`;\n return `<pre class=\"${classes}\"><code class=\"${classes}\">${code}</code></pre>`;\n }\n\n override getHighlightExtension() {\n return markedHighlight({\n async: true,\n highlight: (code: string, lang: string) => {\n let diff = lang?.startsWith('diff-');\n lang = diff ? lang.replace('diff-', '') : lang || 'typescript';\n\n if (diff && !Prism.languages['diff']) {\n diff = false;\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The \\`diff\\` language and plugin are not available in the provided setup.\n To enable it, add the following imports your \\`app.config.ts\\`:\n import 'prismjs/components/prism-diff';\n import 'prismjs/plugins/diff-highlight/prism-diff-highlight';\n ---------------------------------------------------------------------------------------\n `);\n }\n\n if (!Prism.languages[lang]) {\n if (lang !== 'mermaid') {\n console.warn(`Notice:\n ---------------------------------------------------------------------------------------\n The requested language '${lang}' is not available in the provided setup.\n To enable it, add the following import your \\`app.config.ts\\`:\n import 'prismjs/components/prism-${lang}';\n ---------------------------------------------------------------------------------------\n `);\n }\n return code;\n }\n return Prism.highlight(\n code,\n diff ? Prism.languages['diff'] : Prism.languages[lang],\n lang,\n );\n },\n });\n }\n}\n","(function () {\n if (typeof Prism === 'undefined') {\n return;\n }\n\n Prism.languages.angular = Prism.languages.extend('markup', {\n keyword:\n /(?:@if|@for|@switch|@defer|@loading|@error|@placeholder|prefetch)\\b/,\n operator: /\\b(?:on|when)\\b/,\n number: {\n pattern: /\\b(minimum|after)\\s+\\d+(?:s|ms|)/gi,\n lookbehind: true,\n },\n builtin: {\n pattern:\n /\\b(?:viewport|timer|minimum|after|hover|idle|immediate|interaction)/,\n },\n function:\n /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n });\n\n Prism.languages.ng = Prism.languages.angular;\n})();\n","import { ContentRenderer, NoopContentRenderer } from '@analogjs/content';\nimport { Provider } from '@angular/core';\nimport { PrismHighlighter } from './lib/prism-highlighter';\n\nimport 'prismjs';\nimport 'prismjs/plugins/toolbar/prism-toolbar';\nimport 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard';\nimport './lib/prism/angular';\n\nexport { PrismHighlighter };\n\nexport function withPrismHighlighter(): Provider[] {\n return [{ provide: ContentRenderer, useClass: NoopContentRenderer }];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAOM,MAAO,gBAAiB,SAAQ,wBAAwB,CAAA;IACnD,gBAAgB,CAAC,IAAY,EAAE,IAAY,EAAA;AAClD,QAAA,MAAM,OAAO,GACX,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;cAC7C,CAAY,SAAA,EAAA,IAAI,CAAiB,eAAA;cACjC,CAAY,SAAA,EAAA,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,CAAE;AAC7C,QAAA,OAAO,eAAe,OAAO,CAAA,eAAA,EAAkB,OAAO,CAAK,EAAA,EAAA,IAAI,eAAe;;IAGvE,qBAAqB,GAAA;AAC5B,QAAA,OAAO,eAAe,CAAC;AACrB,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,SAAS,EAAE,CAAC,IAAY,EAAE,IAAY,KAAI;gBACxC,IAAI,IAAI,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;AACpC,gBAAA,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI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KAAA,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO;AAC9C,CAAC,GAAG;;SCXY,oBAAoB,GAAA;IAClC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;AACtE;;ACbA;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-content-shiki-highlighter.mjs","sources":["../../../../packages/content/shiki-highlighter/src/index.ts","../../../../packages/content/shiki-highlighter/src/analogjs-content-shiki-highlighter.ts"],"sourcesContent":["import { ContentRenderer, NoopContentRenderer } from '@analogjs/content';\nimport { Provider } from '@angular/core';\nimport type {\n BundledLanguage,\n BundledTheme,\n CodeOptionsMeta,\n CodeOptionsMultipleThemes,\n CodeOptionsSingleTheme,\n CodeToHastOptionsCommon,\n} from 'shiki';\n\nexport type ShikiHighlightOptions = Partial<\n Omit<CodeToHastOptionsCommon<BundledLanguage>, 'lang'>\n> &\n CodeOptionsMeta &\n Partial<CodeOptionsSingleTheme<BundledTheme>> &\n Partial<CodeOptionsMultipleThemes<BundledTheme>>;\n\nexport type WithShikiHighlighterOptions = ShikiHighlightOptions & {\n container?: string;\n};\n\nexport function withShikiHighlighter(\n _opts: WithShikiHighlighterOptions = {}
|
|
1
|
+
{"version":3,"file":"analogjs-content-shiki-highlighter.mjs","sources":["../../../../packages/content/shiki-highlighter/src/index.ts","../../../../packages/content/shiki-highlighter/src/analogjs-content-shiki-highlighter.ts"],"sourcesContent":["import { ContentRenderer, NoopContentRenderer } from '@analogjs/content';\nimport { Provider } from '@angular/core';\nimport type {\n BundledLanguage,\n BundledTheme,\n CodeOptionsMeta,\n CodeOptionsMultipleThemes,\n CodeOptionsSingleTheme,\n CodeToHastOptionsCommon,\n} from 'shiki';\n\nexport type ShikiHighlightOptions = Partial<\n Omit<CodeToHastOptionsCommon<BundledLanguage>, 'lang'>\n> &\n CodeOptionsMeta &\n Partial<CodeOptionsSingleTheme<BundledTheme>> &\n Partial<CodeOptionsMultipleThemes<BundledTheme>>;\n\nexport type WithShikiHighlighterOptions = ShikiHighlightOptions & {\n container?: string;\n};\n\nexport function withShikiHighlighter(\n _opts: WithShikiHighlighterOptions = {},\n): Provider[] {\n return [\n {\n provide: ContentRenderer,\n useClass: NoopContentRenderer,\n },\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAsBgB,SAAA,oBAAoB,CAClC,KAAA,GAAqC,EAAE,EAAA;IAEvC,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,QAAQ,EAAE,mBAAmB;AAC9B,SAAA;KACF;AACH;;AC/BA;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, HostListener, Directive, InjectionToken, ɵPendingTasksInternal as _PendingTasksInternal, Injectable, TransferState, makeStateKey, Input, ViewEncapsulation, Component, NgZone, PLATFORM_ID, ViewContainerRef, ViewChild } from '@angular/core';
|
|
3
3
|
import { DOCUMENT, Location, AsyncPipe, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
5
5
|
import { isObservable, firstValueFrom, of, Observable, from } from 'rxjs';
|
|
@@ -29,10 +29,10 @@ class AnchorNavigationDirective {
|
|
|
29
29
|
}
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
33
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnchorNavigationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
33
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: AnchorNavigationDirective, isStandalone: true, selector: "[analogAnchorNavigation]", host: { listeners: { "click": "handleNavigation($event.target)" } }, ngImport: i0 }); }
|
|
34
34
|
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnchorNavigationDirective, decorators: [{
|
|
36
36
|
type: Directive,
|
|
37
37
|
args: [{
|
|
38
38
|
selector: '[analogAnchorNavigation]',
|
|
@@ -73,10 +73,6 @@ const getContentFiles = () => {
|
|
|
73
73
|
let ANALOG_CONTENT_ROUTE_FILES = {};
|
|
74
74
|
return ANALOG_CONTENT_ROUTE_FILES;
|
|
75
75
|
};
|
|
76
|
-
const getAgxFiles = () => {
|
|
77
|
-
let ANALOG_AGX_FILES = {};
|
|
78
|
-
return ANALOG_AGX_FILES;
|
|
79
|
-
};
|
|
80
76
|
|
|
81
77
|
function getSlug(filename) {
|
|
82
78
|
const parts = filename.match(/^(\\|\/)(.+(\\|\/))*(.+)\.(.+)$/);
|
|
@@ -102,8 +98,7 @@ const CONTENT_FILES_TOKEN = new InjectionToken('@analogjs/content Content Files'
|
|
|
102
98
|
providedIn: 'root',
|
|
103
99
|
factory() {
|
|
104
100
|
const contentFiles = getContentFiles();
|
|
105
|
-
const
|
|
106
|
-
const allFiles = { ...contentFiles, ...agxFiles };
|
|
101
|
+
const allFiles = { ...contentFiles };
|
|
107
102
|
const contentFilesList = inject(CONTENT_FILES_LIST_TOKEN);
|
|
108
103
|
const lookup = {};
|
|
109
104
|
contentFilesList.forEach((item) => {
|
|
@@ -159,17 +154,17 @@ class RenderTaskService {
|
|
|
159
154
|
this.#pendingTasks.remove(clear);
|
|
160
155
|
}
|
|
161
156
|
}
|
|
162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
157
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
158
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService }); }
|
|
164
159
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService, decorators: [{
|
|
166
161
|
type: Injectable
|
|
167
162
|
}] });
|
|
168
163
|
|
|
169
164
|
/// <reference types="vite/client" />
|
|
170
165
|
function getContentFile(contentFiles, prefix, slug, fallback, renderTaskService) {
|
|
171
166
|
const filePath = `/src/content/${prefix}${slug}`;
|
|
172
|
-
const contentFile = contentFiles[`${filePath}.md`]
|
|
167
|
+
const contentFile = contentFiles[`${filePath}.md`];
|
|
173
168
|
if (!contentFile) {
|
|
174
169
|
return of({
|
|
175
170
|
filename: filePath,
|
|
@@ -253,10 +248,10 @@ class ContentRenderer {
|
|
|
253
248
|
}
|
|
254
249
|
// eslint-disable-next-line
|
|
255
250
|
enhance() { }
|
|
256
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
257
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
251
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
252
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer }); }
|
|
258
253
|
}
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer, decorators: [{
|
|
260
255
|
type: Injectable
|
|
261
256
|
}] });
|
|
262
257
|
class NoopContentRenderer {
|
|
@@ -306,10 +301,10 @@ function injectContentFiles(filterFn) {
|
|
|
306
301
|
}
|
|
307
302
|
|
|
308
303
|
class MarkedContentHighlighter {
|
|
309
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
310
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
304
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
305
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter }); }
|
|
311
306
|
}
|
|
312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter, decorators: [{
|
|
313
308
|
type: Injectable
|
|
314
309
|
}] });
|
|
315
310
|
function withHighlighter(provider) {
|
|
@@ -326,19 +321,19 @@ class MarkedSetupService {
|
|
|
326
321
|
optional: true,
|
|
327
322
|
});
|
|
328
323
|
const renderer = new marked.Renderer();
|
|
329
|
-
renderer.code = (
|
|
324
|
+
renderer.code = ({ text, lang }) => {
|
|
330
325
|
// Let's do a language based detection like on GitHub
|
|
331
326
|
// So we can still have non-interpreted mermaid code
|
|
332
327
|
if (lang === 'mermaid') {
|
|
333
|
-
return '<pre class="mermaid">' +
|
|
328
|
+
return '<pre class="mermaid">' + text + '</pre>';
|
|
334
329
|
}
|
|
335
330
|
if (!lang) {
|
|
336
|
-
return '<pre><code>' +
|
|
331
|
+
return '<pre><code>' + text + '</code></pre>';
|
|
337
332
|
}
|
|
338
333
|
if (this.highlighter?.augmentCodeBlock) {
|
|
339
|
-
return this.highlighter?.augmentCodeBlock(
|
|
334
|
+
return this.highlighter?.augmentCodeBlock(text, lang);
|
|
340
335
|
}
|
|
341
|
-
return `<pre class="language-${lang}"><code class="language-${lang}">${
|
|
336
|
+
return `<pre class="language-${lang}"><code class="language-${lang}">${text}</code></pre>`;
|
|
342
337
|
};
|
|
343
338
|
const extensions = [gfmHeadingId(), mangle()];
|
|
344
339
|
if (this.highlighter) {
|
|
@@ -349,17 +344,16 @@ class MarkedSetupService {
|
|
|
349
344
|
pedantic: false,
|
|
350
345
|
gfm: true,
|
|
351
346
|
breaks: false,
|
|
352
|
-
mangle: false,
|
|
353
347
|
});
|
|
354
348
|
this.marked = marked;
|
|
355
349
|
}
|
|
356
350
|
getMarkedInstance() {
|
|
357
351
|
return this.marked;
|
|
358
352
|
}
|
|
359
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
360
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
354
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService }); }
|
|
361
355
|
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService, decorators: [{
|
|
363
357
|
type: Injectable
|
|
364
358
|
}], ctorParameters: () => [] });
|
|
365
359
|
|
|
@@ -376,10 +370,10 @@ class MarkdownContentRendererService {
|
|
|
376
370
|
}
|
|
377
371
|
// eslint-disable-next-line
|
|
378
372
|
enhance() { }
|
|
379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
380
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
373
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
374
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService }); }
|
|
381
375
|
}
|
|
382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService, decorators: [{
|
|
383
377
|
type: Injectable
|
|
384
378
|
}] });
|
|
385
379
|
|
|
@@ -421,10 +415,10 @@ class AnalogMarkdownRouteComponent {
|
|
|
421
415
|
ngAfterViewChecked() {
|
|
422
416
|
this.contentRenderer.enhance();
|
|
423
417
|
}
|
|
424
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
425
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
419
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: AnalogMarkdownRouteComponent, isStandalone: true, selector: "analog-markdown-route", inputs: { classes: "classes" }, hostDirectives: [{ directive: AnchorNavigationDirective }], ngImport: i0, template: `<div [innerHTML]="content" [class]="classes"></div>`, isInline: true, encapsulation: i0.ViewEncapsulation.None, preserveWhitespaces: true }); }
|
|
426
420
|
}
|
|
427
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownRouteComponent, decorators: [{
|
|
428
422
|
type: Component,
|
|
429
423
|
args: [{
|
|
430
424
|
selector: 'analog-markdown-route',
|
|
@@ -496,14 +490,14 @@ class AnalogMarkdownComponent {
|
|
|
496
490
|
this.mermaid?.default.run();
|
|
497
491
|
}));
|
|
498
492
|
}
|
|
499
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
500
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
493
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
494
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: AnalogMarkdownComponent, isStandalone: true, selector: "analog-markdown", inputs: { content: "content", classes: "classes" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, hostDirectives: [{ directive: AnchorNavigationDirective }], ngImport: i0, template: `<div
|
|
501
495
|
#container
|
|
502
496
|
[innerHTML]="content$ | async"
|
|
503
497
|
[class]="classes"
|
|
504
498
|
></div>`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None, preserveWhitespaces: true }); }
|
|
505
499
|
}
|
|
506
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownComponent, decorators: [{
|
|
507
501
|
type: Component,
|
|
508
502
|
args: [{
|
|
509
503
|
selector: 'analog-markdown',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analogjs-content.mjs","sources":["../../../../packages/content/src/lib/anchor-navigation.directive.ts","../../../../packages/content/src/lib/get-content-files.ts","../../../../packages/content/src/lib/content-files-list-token.ts","../../../../packages/content/src/lib/content-files-token.ts","../../../../packages/content/src/lib/parse-raw-content-file.ts","../../../../packages/content/src/lib/utils/zone-wait-for.ts","../../../../packages/content/src/lib/render-task.service.ts","../../../../packages/content/src/lib/content.ts","../../../../packages/content/src/lib/content-renderer.ts","../../../../packages/content/src/lib/inject-content-files.ts","../../../../packages/content/src/lib/marked-content-highlighter.ts","../../../../packages/content/src/lib/marked-setup.service.ts","../../../../packages/content/src/lib/markdown-content-renderer.service.ts","../../../../packages/content/src/lib/provide-content.ts","../../../../packages/content/src/lib/markdown-route.component.ts","../../../../packages/content/src/lib/markdown.component.ts","../../../../packages/content/src/analogjs-content.ts"],"sourcesContent":["import { Directive, HostListener, inject } from '@angular/core';\nimport { DOCUMENT, Location } from '@angular/common';\nimport { Router } from '@angular/router';\n\n@Directive({\n selector: '[analogAnchorNavigation]',\n standalone: true,\n})\nexport class AnchorNavigationDirective {\n private readonly document = inject(DOCUMENT);\n private readonly location = inject(Location);\n private readonly router = inject(Router);\n\n @HostListener('click', ['$event.target'])\n handleNavigation(element: HTMLElement): boolean {\n if (\n element instanceof HTMLAnchorElement &&\n isInternalUrl(element, this.document) &&\n hasTargetSelf(element) &&\n !hasDownloadAttribute(element)\n ) {\n const { pathname, search, hash } = element;\n const url = this.location.normalize(`${pathname}${search}${hash}`);\n this.router.navigateByUrl(url);\n\n return false;\n }\n\n return true;\n }\n}\n\nfunction hasDownloadAttribute(anchorElement: HTMLAnchorElement): boolean {\n return anchorElement.getAttribute('download') !== null;\n}\n\nfunction hasTargetSelf(anchorElement: HTMLAnchorElement): boolean {\n return !anchorElement.target || anchorElement.target === '_self';\n}\n\nfunction isInternalUrl(\n anchorElement: HTMLAnchorElement,\n document: Document\n): boolean {\n return (\n anchorElement.host === document.location.host &&\n anchorElement.protocol === document.location.protocol\n );\n}\n","/**\n * Returns the list of content files by filename with ?analog-content-list=true.\n * We use the query param to transform the return into an array of\n * just front matter attributes.\n *\n * @returns\n */\nexport const getContentFilesList = () => {\n let ANALOG_CONTENT_FILE_LIST = {};\n\n return ANALOG_CONTENT_FILE_LIST as Record<string, Record<string, any>>;\n};\n\n/**\n * Returns the lazy loaded content files for lookups.\n *\n * @returns\n */\nexport const getContentFiles = () => {\n let ANALOG_CONTENT_ROUTE_FILES = {};\n\n return ANALOG_CONTENT_ROUTE_FILES;\n};\n\nexport const getAgxFiles = () => {\n let ANALOG_AGX_FILES = {};\n\n return ANALOG_AGX_FILES;\n};\n","import { InjectionToken } from '@angular/core';\nimport { ContentFile } from './content-file';\nimport { getContentFilesList } from './get-content-files';\n\nfunction getSlug(filename: string) {\n const parts = filename.match(/^(\\\\|\\/)(.+(\\\\|\\/))*(.+)\\.(.+)$/);\n return parts?.length ? parts[4] : '';\n}\n\nexport const CONTENT_FILES_LIST_TOKEN = new InjectionToken<ContentFile[]>(\n '@analogjs/content Content Files List',\n {\n providedIn: 'root',\n factory() {\n const contentFiles = getContentFilesList();\n\n return Object.keys(contentFiles).map((filename) => {\n const attributes = contentFiles[filename];\n const slug = attributes['slug'];\n\n return {\n filename,\n attributes,\n slug: slug ? encodeURI(slug) : encodeURI(getSlug(filename)),\n };\n });\n },\n }\n);\n","import { InjectionToken, inject } from '@angular/core';\n\nimport { getAgxFiles, getContentFiles } from './get-content-files';\nimport { CONTENT_FILES_LIST_TOKEN } from './content-files-list-token';\n\nexport const CONTENT_FILES_TOKEN = new InjectionToken<\n Record<string, () => Promise<string>>\n>('@analogjs/content Content Files', {\n providedIn: 'root',\n factory() {\n const contentFiles = getContentFiles();\n const agxFiles = getAgxFiles();\n const allFiles = { ...contentFiles, ...agxFiles };\n const contentFilesList = inject(CONTENT_FILES_LIST_TOKEN);\n\n const lookup: Record<string, string> = {};\n contentFilesList.forEach((item) => {\n const fileParts = item.filename.split('/');\n const filePath = fileParts.slice(0, fileParts.length - 1).join('/');\n const fileNameParts = fileParts[fileParts.length - 1].split('.');\n lookup[item.filename] = `${filePath}/${item.slug}.${\n fileNameParts[fileNameParts.length - 1]\n }`;\n });\n\n const objectUsingSlugAttribute: Record<string, () => Promise<string>> = {};\n Object.entries(allFiles).forEach((entry) => {\n const filename = entry[0];\n const value = entry[1];\n\n const newFilename = lookup[filename];\n if (newFilename !== undefined) {\n const objectFilename = newFilename.replace(\n /^\\/(.*?)\\/content/,\n '/src/content'\n );\n objectUsingSlugAttribute[objectFilename] =\n value as () => Promise<string>;\n }\n });\n\n return objectUsingSlugAttribute;\n },\n});\n","import fm from 'front-matter';\n\nexport function parseRawContentFile<Attributes extends Record<string, any>>(\n rawContentFile: string\n): { content: string; attributes: Attributes } {\n const { body, attributes } = fm<Attributes>(rawContentFile);\n return { content: body, attributes };\n}\n","import { firstValueFrom, isObservable, Observable } from 'rxjs';\n\ndeclare const Zone: any;\n\nexport async function waitFor<T>(prom: Promise<T> | Observable<T>): Promise<T> {\n if (isObservable(prom)) {\n prom = firstValueFrom(prom);\n }\n\n if (typeof Zone === 'undefined') {\n return prom;\n }\n\n const macroTask = Zone.current.scheduleMacroTask(\n `AnalogContentResolve-${Math.random()}`,\n () => {},\n {},\n () => {}\n );\n return prom.then((p: T) => {\n macroTask.invoke();\n return p;\n });\n}\n","import { Injectable, inject } from '@angular/core';\nimport { ɵPendingTasksInternal as ɵPendingTasks } from '@angular/core';\n\n@Injectable()\nexport class RenderTaskService {\n #pendingTasks = inject(ɵPendingTasks);\n\n addRenderTask() {\n return this.#pendingTasks.add();\n }\n\n clearRenderTask(clear: number | Function) {\n if (typeof clear === 'function') {\n clear();\n } else if (typeof (this.#pendingTasks as any).remove === 'function') {\n (this.#pendingTasks as any).remove(clear);\n }\n }\n}\n","/// <reference types=\"vite/client\" />\n\nimport { inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Observable, of } from 'rxjs';\nimport { map, switchMap, tap } from 'rxjs/operators';\n\nimport { ContentFile } from './content-file';\nimport { CONTENT_FILES_TOKEN } from './content-files-token';\nimport { parseRawContentFile } from './parse-raw-content-file';\nimport { waitFor } from './utils/zone-wait-for';\nimport { RenderTaskService } from './render-task.service';\n\nfunction getContentFile<\n Attributes extends Record<string, any> = Record<string, any>\n>(\n contentFiles: Record<string, () => Promise<string>>,\n prefix: string,\n slug: string,\n fallback: string,\n renderTaskService: RenderTaskService\n): Observable<ContentFile<Attributes | Record<string, never>>> {\n const filePath = `/src/content/${prefix}${slug}`;\n const contentFile =\n contentFiles[`${filePath}.md`] ?? contentFiles[`${filePath}.agx`];\n if (!contentFile) {\n return of({\n filename: filePath,\n attributes: {},\n slug: '',\n content: fallback,\n });\n }\n\n const contentTask = renderTaskService.addRenderTask();\n return new Observable<string | { default: any; metadata: any }>(\n (observer) => {\n const contentResolver = contentFile();\n\n if (import.meta.env.SSR === true) {\n waitFor(contentResolver).then((content) => {\n observer.next(content);\n observer.complete();\n\n setTimeout(() => renderTaskService.clearRenderTask(contentTask), 10);\n });\n } else {\n contentResolver.then((content) => {\n observer.next(content);\n observer.complete();\n });\n }\n }\n ).pipe(\n map((contentFile) => {\n if (typeof contentFile === 'string') {\n const { content, attributes } =\n parseRawContentFile<Attributes>(contentFile);\n\n return {\n filename: filePath,\n slug,\n attributes,\n content,\n };\n }\n return {\n filename: filePath,\n slug,\n attributes: contentFile.metadata,\n content: contentFile.default,\n };\n })\n );\n}\n\n/**\n * Retrieves the static content using the provided param and/or prefix.\n *\n * @param param route parameter (default: 'slug')\n * @param fallback fallback text if content file is not found (default: 'No Content Found')\n */\nexport function injectContent<\n Attributes extends Record<string, any> = Record<string, any>\n>(\n param:\n | string\n | {\n param: string;\n subdirectory: string;\n }\n | {\n customFilename: string;\n } = 'slug',\n fallback = 'No Content Found'\n): Observable<ContentFile<Attributes | Record<string, never>>> {\n const contentFiles = inject(CONTENT_FILES_TOKEN);\n const renderTaskService = inject(RenderTaskService);\n const task = renderTaskService.addRenderTask();\n\n if (typeof param === 'string' || 'param' in param) {\n const prefix = typeof param === 'string' ? '' : `${param.subdirectory}/`;\n const route = inject(ActivatedRoute);\n const paramKey = typeof param === 'string' ? param : param.param;\n return route.paramMap.pipe(\n map((params) => params.get(paramKey)),\n switchMap((slug) => {\n if (slug) {\n return getContentFile<Attributes>(\n contentFiles,\n prefix,\n slug,\n fallback,\n renderTaskService\n );\n }\n return of({\n filename: '',\n slug: '',\n attributes: {},\n content: fallback,\n });\n }),\n tap(() => renderTaskService.clearRenderTask(task))\n );\n } else {\n return getContentFile<Attributes>(\n contentFiles,\n '',\n param.customFilename,\n fallback,\n renderTaskService\n ).pipe(tap(() => renderTaskService.clearRenderTask(task)));\n }\n}\n","/// <reference types=\"vite/client\" />\n\nimport { Injectable, TransferState, inject, makeStateKey } from '@angular/core';\nimport { getHeadingList } from 'marked-gfm-heading-id';\n\nexport type TableOfContentItem = {\n id: string;\n level: number; // starts at 1\n text: string;\n};\n\n@Injectable()\nexport abstract class ContentRenderer {\n async render(content: string): Promise<string> {\n return content;\n }\n\n getContentHeadings(): Array<TableOfContentItem> {\n return [];\n }\n\n // eslint-disable-next-line\n enhance() {}\n}\n\nexport class NoopContentRenderer implements ContentRenderer {\n private readonly transferState = inject(TransferState);\n private contentId = 0;\n\n /**\n * Generates a hash from the content string\n * to be used with the transfer state\n */\n private generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n }\n\n async render(content: string) {\n this.contentId = this.generateHash(content);\n return content;\n }\n enhance() {}\n\n getContentHeadings(): Array<TableOfContentItem> {\n const key = makeStateKey<TableOfContentItem[]>(\n `content-headings-${this.contentId}`\n );\n\n if (import.meta.env.SSR === true) {\n const headings = getHeadingList();\n this.transferState.set(key, headings);\n return headings;\n }\n\n return this.transferState.get(key, []);\n }\n}\n","import { ContentFile } from './content-file';\nimport { inject } from '@angular/core';\nimport { CONTENT_FILES_LIST_TOKEN } from './content-files-list-token';\nimport { RenderTaskService } from './render-task.service';\n\nexport function injectContentFiles<Attributes extends Record<string, any>>(\n filterFn?: InjectContentFilesFilterFunction<Attributes>\n): ContentFile<Attributes>[] {\n const renderTaskService = inject(RenderTaskService);\n const task = renderTaskService.addRenderTask();\n const allContentFiles = inject(\n CONTENT_FILES_LIST_TOKEN\n ) as ContentFile<Attributes>[];\n renderTaskService.clearRenderTask(task);\n\n if (filterFn) {\n const filteredContentFiles = allContentFiles.filter(filterFn);\n\n return filteredContentFiles;\n }\n\n return allContentFiles;\n}\n\nexport type InjectContentFilesFilterFunction<T extends Record<string, any>> = (\n value: ContentFile<T>,\n index: number,\n array: ContentFile<T>[]\n) => boolean;\n","import {\n AbstractType,\n Injectable,\n Provider,\n ProviderToken,\n Type,\n} from '@angular/core';\n\nexport interface MarkedContentHighlighter {\n augmentCodeBlock?(code: string, lang: string): string;\n}\n\n@Injectable()\nexport abstract class MarkedContentHighlighter {\n abstract getHighlightExtension(): import('marked').marked.MarkedExtension;\n}\n\nexport function withHighlighter(\n provider: (\n | { useValue: MarkedContentHighlighter }\n | {\n useClass:\n | Type<MarkedContentHighlighter>\n | AbstractType<MarkedContentHighlighter>;\n }\n | { useFactory: (...deps: any[]) => MarkedContentHighlighter }\n ) & { deps?: ProviderToken<any>[] }\n): Provider {\n return { provide: MarkedContentHighlighter, ...provider } as Provider;\n}\n","/**\n * Credit goes to Scully for original implementation\n * https://github.com/scullyio/scully/blob/main/libs/scully/src/lib/fileHanderPlugins/markdown.ts\n */\nimport { inject, Injectable } from '@angular/core';\nimport { marked } from 'marked';\nimport { gfmHeadingId } from 'marked-gfm-heading-id';\nimport { mangle } from 'marked-mangle';\nimport { MarkedContentHighlighter } from './marked-content-highlighter';\n\n@Injectable()\nexport class MarkedSetupService {\n private readonly marked: typeof marked;\n private readonly highlighter = inject(MarkedContentHighlighter, {\n optional: true,\n });\n\n constructor() {\n const renderer = new marked.Renderer();\n renderer.code = (code: string, lang: string) => {\n // Let's do a language based detection like on GitHub\n // So we can still have non-interpreted mermaid code\n if (lang === 'mermaid') {\n return '<pre class=\"mermaid\">' + code + '</pre>';\n }\n\n if (!lang) {\n return '<pre><code>' + code + '</code></pre>';\n }\n\n if (this.highlighter?.augmentCodeBlock) {\n return this.highlighter?.augmentCodeBlock(code, lang);\n }\n\n return `<pre class=\"language-${lang}\"><code class=\"language-${lang}\">${code}</code></pre>`;\n };\n\n const extensions = [gfmHeadingId(), mangle()];\n\n if (this.highlighter) {\n extensions.push(this.highlighter.getHighlightExtension());\n }\n\n marked.use(...extensions, {\n renderer,\n pedantic: false,\n gfm: true,\n breaks: false,\n mangle: false,\n });\n\n this.marked = marked;\n }\n\n getMarkedInstance(): typeof marked {\n return this.marked;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { getHeadingList } from 'marked-gfm-heading-id';\n\nimport { ContentRenderer, TableOfContentItem } from './content-renderer';\nimport { MarkedSetupService } from './marked-setup.service';\n\n@Injectable()\nexport class MarkdownContentRendererService implements ContentRenderer {\n #marked = inject(MarkedSetupService, { self: true });\n\n async render(content: string): Promise<string> {\n return this.#marked.getMarkedInstance().parse(content);\n }\n\n /**\n * The method is meant to be called after `render()`\n */\n getContentHeadings(): TableOfContentItem[] {\n return getHeadingList();\n }\n\n // eslint-disable-next-line\n enhance() {}\n}\n","import { Provider, InjectionToken } from '@angular/core';\nimport { ContentRenderer, NoopContentRenderer } from './content-renderer';\nimport { RenderTaskService } from './render-task.service';\n\nexport interface MarkdownRendererOptions {\n loadMermaid?: () => Promise<typeof import('mermaid')>;\n}\n\nconst CONTENT_RENDERER_PROVIDERS: Provider[] = [\n {\n provide: ContentRenderer,\n useClass: NoopContentRenderer,\n },\n];\n\nexport function withMarkdownRenderer(\n options?: MarkdownRendererOptions\n): Provider {\n return [\n CONTENT_RENDERER_PROVIDERS,\n options?.loadMermaid\n ? [\n {\n provide: MERMAID_IMPORT_TOKEN,\n useFactory: options.loadMermaid,\n },\n ]\n : [],\n ];\n}\n\nexport function provideContent(...features: Provider[]) {\n return [\n { provide: RenderTaskService, useClass: RenderTaskService },\n ...features,\n ];\n}\n\nexport const MERMAID_IMPORT_TOKEN = new InjectionToken<\n Promise<typeof import('mermaid')>\n>('mermaid_import');\n","import { AsyncPipe } from '@angular/common';\nimport {\n AfterViewChecked,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ContentRenderer } from './content-renderer';\nimport { AnchorNavigationDirective } from './anchor-navigation.directive';\n\n@Component({\n selector: 'analog-markdown-route',\n standalone: true,\n imports: [AsyncPipe],\n hostDirectives: [AnchorNavigationDirective],\n preserveWhitespaces: true,\n encapsulation: ViewEncapsulation.None,\n template: `<div [innerHTML]=\"content\" [class]=\"classes\"></div>`,\n})\nexport default class AnalogMarkdownRouteComponent implements AfterViewChecked {\n private sanitizer = inject(DomSanitizer);\n private route = inject(ActivatedRoute);\n contentRenderer = inject(ContentRenderer);\n\n protected content: SafeHtml = this.sanitizer.bypassSecurityTrustHtml(\n this.route.snapshot.data['renderedAnalogContent']\n );\n\n @Input() classes = 'analog-markdown-route';\n\n ngAfterViewChecked() {\n this.contentRenderer.enhance();\n }\n}\n","import { AsyncPipe, isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewChecked,\n Component,\n Input,\n NgZone,\n OnChanges,\n OnInit,\n PLATFORM_ID,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, from, of } from 'rxjs';\nimport { catchError, map, mergeMap, filter } from 'rxjs/operators';\n\nimport { AnchorNavigationDirective } from './anchor-navigation.directive';\nimport { ContentRenderer } from './content-renderer';\nimport { MERMAID_IMPORT_TOKEN } from './provide-content';\n\n@Component({\n selector: 'analog-markdown',\n standalone: true,\n imports: [AsyncPipe],\n hostDirectives: [AnchorNavigationDirective],\n preserveWhitespaces: true,\n encapsulation: ViewEncapsulation.None,\n template: `<div\n #container\n [innerHTML]=\"content$ | async\"\n [class]=\"classes\"\n ></div>`,\n})\nexport default class AnalogMarkdownComponent\n implements OnInit, OnChanges, AfterViewChecked\n{\n private sanitizer = inject(DomSanitizer);\n private route = inject(ActivatedRoute);\n private zone = inject(NgZone);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly mermaidImport = inject(MERMAID_IMPORT_TOKEN, {\n optional: true,\n });\n private mermaid: typeof import('mermaid') | undefined;\n\n public content$: Observable<SafeHtml> = this.getContentSource();\n\n @Input() content!: string | object | undefined | null;\n @Input() classes = 'analog-markdown';\n\n @ViewChild('container', { static: true, read: ViewContainerRef })\n container!: ViewContainerRef;\n\n contentRenderer = inject(ContentRenderer);\n\n constructor() {\n if (isPlatformBrowser(this.platformId) && this.mermaidImport) {\n // Mermaid can only be loaded on client side\n this.loadMermaid(this.mermaidImport);\n }\n }\n\n ngOnInit(): void {\n this.updateContent();\n }\n\n ngOnChanges(): void {\n this.updateContent();\n }\n\n updateContent() {\n if (this.content && typeof this.content !== 'string') {\n this.container.clear();\n const componentRef = this.container.createComponent(this.content as any);\n componentRef.changeDetectorRef.detectChanges();\n } else {\n this.content$ = this.getContentSource();\n }\n }\n\n getContentSource() {\n return this.route.data.pipe(\n map<Data, string>((data) => this.content ?? data['_analogContent']),\n filter((content) => typeof content === 'string'),\n mergeMap((contentString) => this.renderContent(contentString)),\n map((content) => this.sanitizer.bypassSecurityTrustHtml(content)),\n catchError((e) => of(`There was an error ${e}`))\n );\n }\n\n async renderContent(content: string): Promise<string> {\n return this.contentRenderer.render(content);\n }\n\n ngAfterViewChecked() {\n this.contentRenderer.enhance();\n this.zone.runOutsideAngular(() => this.mermaid?.default.run());\n }\n\n private loadMermaid(mermaidImport: Promise<typeof import('mermaid')>) {\n this.zone.runOutsideAngular(() =>\n // Wrap into an observable to avoid redundant initialization once\n // the markdown component is destroyed before the promise is resolved.\n from(mermaidImport)\n .pipe(takeUntilDestroyed())\n .subscribe((mermaid) => {\n this.mermaid = mermaid;\n this.mermaid.default.initialize({ startOnLoad: false });\n // Explicitly running mermaid as ngAfterViewChecked\n // has probably already been called\n this.mermaid?.default.run();\n })\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵPendingTasks","i1.AnchorNavigationDirective"],"mappings":";;;;;;;;;;;;;MAQa,yBAAyB,CAAA;AAJtC,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAmBzC;AAhBC,IAAA,gBAAgB,CAAC,OAAoB,EAAA;QACnC,IACE,OAAO,YAAY,iBAAiB;AACpC,YAAA,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;YACrC,aAAa,CAAC,OAAO,CAAC;AACtB,YAAA,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAC9B;YACA,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO;AAC1C,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAG,EAAA,QAAQ,GAAG,MAAM,C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,iBAAiB,CAAC,IAAI;AACrC,oBAAA,QAAQ,EAAE,CAAA;;;;AAIF,SAAA,CAAA;AACT,iBAAA;wDAeU,OAAO,EAAA,CAAA;sBAAf;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBAGD,SAAS,EAAA,CAAA;sBADR,SAAS;uBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE;;;ACtDlE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"analogjs-content.mjs","sources":["../../../../packages/content/src/lib/anchor-navigation.directive.ts","../../../../packages/content/src/lib/get-content-files.ts","../../../../packages/content/src/lib/content-files-list-token.ts","../../../../packages/content/src/lib/content-files-token.ts","../../../../packages/content/src/lib/parse-raw-content-file.ts","../../../../packages/content/src/lib/utils/zone-wait-for.ts","../../../../packages/content/src/lib/render-task.service.ts","../../../../packages/content/src/lib/content.ts","../../../../packages/content/src/lib/content-renderer.ts","../../../../packages/content/src/lib/inject-content-files.ts","../../../../packages/content/src/lib/marked-content-highlighter.ts","../../../../packages/content/src/lib/marked-setup.service.ts","../../../../packages/content/src/lib/markdown-content-renderer.service.ts","../../../../packages/content/src/lib/provide-content.ts","../../../../packages/content/src/lib/markdown-route.component.ts","../../../../packages/content/src/lib/markdown.component.ts","../../../../packages/content/src/analogjs-content.ts"],"sourcesContent":["import { Directive, HostListener, inject } from '@angular/core';\nimport { DOCUMENT, Location } from '@angular/common';\nimport { Router } from '@angular/router';\n\n@Directive({\n selector: '[analogAnchorNavigation]',\n standalone: true,\n})\nexport class AnchorNavigationDirective {\n private readonly document = inject(DOCUMENT);\n private readonly location = inject(Location);\n private readonly router = inject(Router);\n\n @HostListener('click', ['$event.target'])\n handleNavigation(element: HTMLElement): boolean {\n if (\n element instanceof HTMLAnchorElement &&\n isInternalUrl(element, this.document) &&\n hasTargetSelf(element) &&\n !hasDownloadAttribute(element)\n ) {\n const { pathname, search, hash } = element;\n const url = this.location.normalize(`${pathname}${search}${hash}`);\n this.router.navigateByUrl(url);\n\n return false;\n }\n\n return true;\n }\n}\n\nfunction hasDownloadAttribute(anchorElement: HTMLAnchorElement): boolean {\n return anchorElement.getAttribute('download') !== null;\n}\n\nfunction hasTargetSelf(anchorElement: HTMLAnchorElement): boolean {\n return !anchorElement.target || anchorElement.target === '_self';\n}\n\nfunction isInternalUrl(\n anchorElement: HTMLAnchorElement,\n document: Document,\n): boolean {\n return (\n anchorElement.host === document.location.host &&\n anchorElement.protocol === document.location.protocol\n );\n}\n","/**\n * Returns the list of content files by filename with ?analog-content-list=true.\n * We use the query param to transform the return into an array of\n * just front matter attributes.\n *\n * @returns\n */\nexport const getContentFilesList = () => {\n let ANALOG_CONTENT_FILE_LIST = {};\n\n return ANALOG_CONTENT_FILE_LIST as Record<string, Record<string, any>>;\n};\n\n/**\n * Returns the lazy loaded content files for lookups.\n *\n * @returns\n */\nexport const getContentFiles = () => {\n let ANALOG_CONTENT_ROUTE_FILES = {};\n\n return ANALOG_CONTENT_ROUTE_FILES;\n};\n","import { InjectionToken } from '@angular/core';\nimport { ContentFile } from './content-file';\nimport { getContentFilesList } from './get-content-files';\n\nfunction getSlug(filename: string) {\n const parts = filename.match(/^(\\\\|\\/)(.+(\\\\|\\/))*(.+)\\.(.+)$/);\n return parts?.length ? parts[4] : '';\n}\n\nexport const CONTENT_FILES_LIST_TOKEN = new InjectionToken<ContentFile[]>(\n '@analogjs/content Content Files List',\n {\n providedIn: 'root',\n factory() {\n const contentFiles = getContentFilesList();\n\n return Object.keys(contentFiles).map((filename) => {\n const attributes = contentFiles[filename];\n const slug = attributes['slug'];\n\n return {\n filename,\n attributes,\n slug: slug ? encodeURI(slug) : encodeURI(getSlug(filename)),\n };\n });\n },\n },\n);\n","import { InjectionToken, inject } from '@angular/core';\n\nimport { getContentFiles } from './get-content-files';\nimport { CONTENT_FILES_LIST_TOKEN } from './content-files-list-token';\n\nexport const CONTENT_FILES_TOKEN = new InjectionToken<\n Record<string, () => Promise<string>>\n>('@analogjs/content Content Files', {\n providedIn: 'root',\n factory() {\n const contentFiles = getContentFiles();\n const allFiles = { ...contentFiles };\n const contentFilesList = inject(CONTENT_FILES_LIST_TOKEN);\n\n const lookup: Record<string, string> = {};\n contentFilesList.forEach((item) => {\n const fileParts = item.filename.split('/');\n const filePath = fileParts.slice(0, fileParts.length - 1).join('/');\n const fileNameParts = fileParts[fileParts.length - 1].split('.');\n lookup[item.filename] = `${filePath}/${item.slug}.${\n fileNameParts[fileNameParts.length - 1]\n }`;\n });\n\n const objectUsingSlugAttribute: Record<string, () => Promise<string>> = {};\n Object.entries(allFiles).forEach((entry) => {\n const filename = entry[0];\n const value = entry[1];\n\n const newFilename = lookup[filename];\n if (newFilename !== undefined) {\n const objectFilename = newFilename.replace(\n /^\\/(.*?)\\/content/,\n '/src/content',\n );\n objectUsingSlugAttribute[objectFilename] =\n value as () => Promise<string>;\n }\n });\n\n return objectUsingSlugAttribute;\n },\n});\n","import fm from 'front-matter';\n\nexport function parseRawContentFile<Attributes extends Record<string, any>>(\n rawContentFile: string,\n): { content: string; attributes: Attributes } {\n const { body, attributes } = fm<Attributes>(rawContentFile);\n return { content: body, attributes };\n}\n","import { firstValueFrom, isObservable, Observable } from 'rxjs';\n\ndeclare const Zone: any;\n\nexport async function waitFor<T>(prom: Promise<T> | Observable<T>): Promise<T> {\n if (isObservable(prom)) {\n prom = firstValueFrom(prom);\n }\n\n if (typeof Zone === 'undefined') {\n return prom;\n }\n\n const macroTask = Zone.current.scheduleMacroTask(\n `AnalogContentResolve-${Math.random()}`,\n () => {},\n {},\n () => {},\n );\n return prom.then((p: T) => {\n macroTask.invoke();\n return p;\n });\n}\n","import { Injectable, inject } from '@angular/core';\nimport { ɵPendingTasksInternal as ɵPendingTasks } from '@angular/core';\n\n@Injectable()\nexport class RenderTaskService {\n #pendingTasks = inject(ɵPendingTasks);\n\n addRenderTask() {\n return this.#pendingTasks.add();\n }\n\n clearRenderTask(clear: number | Function) {\n if (typeof clear === 'function') {\n clear();\n } else if (typeof (this.#pendingTasks as any).remove === 'function') {\n (this.#pendingTasks as any).remove(clear);\n }\n }\n}\n","/// <reference types=\"vite/client\" />\n\nimport { inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Observable, of } from 'rxjs';\nimport { map, switchMap, tap } from 'rxjs/operators';\n\nimport { ContentFile } from './content-file';\nimport { CONTENT_FILES_TOKEN } from './content-files-token';\nimport { parseRawContentFile } from './parse-raw-content-file';\nimport { waitFor } from './utils/zone-wait-for';\nimport { RenderTaskService } from './render-task.service';\n\nfunction getContentFile<\n Attributes extends Record<string, any> = Record<string, any>,\n>(\n contentFiles: Record<string, () => Promise<string>>,\n prefix: string,\n slug: string,\n fallback: string,\n renderTaskService: RenderTaskService,\n): Observable<ContentFile<Attributes | Record<string, never>>> {\n const filePath = `/src/content/${prefix}${slug}`;\n const contentFile = contentFiles[`${filePath}.md`];\n if (!contentFile) {\n return of({\n filename: filePath,\n attributes: {},\n slug: '',\n content: fallback,\n });\n }\n\n const contentTask = renderTaskService.addRenderTask();\n return new Observable<string | { default: any; metadata: any }>(\n (observer) => {\n const contentResolver = contentFile();\n\n if (import.meta.env.SSR === true) {\n waitFor(contentResolver).then((content) => {\n observer.next(content);\n observer.complete();\n\n setTimeout(() => renderTaskService.clearRenderTask(contentTask), 10);\n });\n } else {\n contentResolver.then((content) => {\n observer.next(content);\n observer.complete();\n });\n }\n },\n ).pipe(\n map((contentFile) => {\n if (typeof contentFile === 'string') {\n const { content, attributes } =\n parseRawContentFile<Attributes>(contentFile);\n\n return {\n filename: filePath,\n slug,\n attributes,\n content,\n };\n }\n return {\n filename: filePath,\n slug,\n attributes: contentFile.metadata,\n content: contentFile.default,\n };\n }),\n );\n}\n\n/**\n * Retrieves the static content using the provided param and/or prefix.\n *\n * @param param route parameter (default: 'slug')\n * @param fallback fallback text if content file is not found (default: 'No Content Found')\n */\nexport function injectContent<\n Attributes extends Record<string, any> = Record<string, any>,\n>(\n param:\n | string\n | {\n param: string;\n subdirectory: string;\n }\n | {\n customFilename: string;\n } = 'slug',\n fallback = 'No Content Found',\n): Observable<ContentFile<Attributes | Record<string, never>>> {\n const contentFiles = inject(CONTENT_FILES_TOKEN);\n const renderTaskService = inject(RenderTaskService);\n const task = renderTaskService.addRenderTask();\n\n if (typeof param === 'string' || 'param' in param) {\n const prefix = typeof param === 'string' ? '' : `${param.subdirectory}/`;\n const route = inject(ActivatedRoute);\n const paramKey = typeof param === 'string' ? param : param.param;\n return route.paramMap.pipe(\n map((params) => params.get(paramKey)),\n switchMap((slug) => {\n if (slug) {\n return getContentFile<Attributes>(\n contentFiles,\n prefix,\n slug,\n fallback,\n renderTaskService,\n );\n }\n return of({\n filename: '',\n slug: '',\n attributes: {},\n content: fallback,\n });\n }),\n tap(() => renderTaskService.clearRenderTask(task)),\n );\n } else {\n return getContentFile<Attributes>(\n contentFiles,\n '',\n param.customFilename,\n fallback,\n renderTaskService,\n ).pipe(tap(() => renderTaskService.clearRenderTask(task)));\n }\n}\n","/// <reference types=\"vite/client\" />\n\nimport { Injectable, TransferState, inject, makeStateKey } from '@angular/core';\nimport { getHeadingList } from 'marked-gfm-heading-id';\n\nexport type TableOfContentItem = {\n id: string;\n level: number; // starts at 1\n text: string;\n};\n\n@Injectable()\nexport abstract class ContentRenderer {\n async render(content: string): Promise<string> {\n return content;\n }\n\n getContentHeadings(): Array<TableOfContentItem> {\n return [];\n }\n\n // eslint-disable-next-line\n enhance() {}\n}\n\nexport class NoopContentRenderer implements ContentRenderer {\n private readonly transferState = inject(TransferState);\n private contentId = 0;\n\n /**\n * Generates a hash from the content string\n * to be used with the transfer state\n */\n private generateHash(str: string) {\n let hash = 0;\n for (let i = 0, len = str.length; i < len; i++) {\n let chr = str.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n }\n\n async render(content: string) {\n this.contentId = this.generateHash(content);\n return content;\n }\n enhance() {}\n\n getContentHeadings(): Array<TableOfContentItem> {\n const key = makeStateKey<TableOfContentItem[]>(\n `content-headings-${this.contentId}`,\n );\n\n if (import.meta.env.SSR === true) {\n const headings = getHeadingList();\n this.transferState.set(key, headings);\n return headings;\n }\n\n return this.transferState.get(key, []);\n }\n}\n","import { ContentFile } from './content-file';\nimport { inject } from '@angular/core';\nimport { CONTENT_FILES_LIST_TOKEN } from './content-files-list-token';\nimport { RenderTaskService } from './render-task.service';\n\nexport function injectContentFiles<Attributes extends Record<string, any>>(\n filterFn?: InjectContentFilesFilterFunction<Attributes>,\n): ContentFile<Attributes>[] {\n const renderTaskService = inject(RenderTaskService);\n const task = renderTaskService.addRenderTask();\n const allContentFiles = inject(\n CONTENT_FILES_LIST_TOKEN,\n ) as ContentFile<Attributes>[];\n renderTaskService.clearRenderTask(task);\n\n if (filterFn) {\n const filteredContentFiles = allContentFiles.filter(filterFn);\n\n return filteredContentFiles;\n }\n\n return allContentFiles;\n}\n\nexport type InjectContentFilesFilterFunction<T extends Record<string, any>> = (\n value: ContentFile<T>,\n index: number,\n array: ContentFile<T>[],\n) => boolean;\n","import {\n AbstractType,\n Injectable,\n Provider,\n ProviderToken,\n Type,\n} from '@angular/core';\n\nexport interface MarkedContentHighlighter {\n augmentCodeBlock?(code: string, lang: string): string;\n}\n\n@Injectable()\nexport abstract class MarkedContentHighlighter {\n abstract getHighlightExtension(): import('marked').MarkedExtension;\n}\n\nexport function withHighlighter(\n provider: (\n | { useValue: MarkedContentHighlighter }\n | {\n useClass:\n | Type<MarkedContentHighlighter>\n | AbstractType<MarkedContentHighlighter>;\n }\n | { useFactory: (...deps: any[]) => MarkedContentHighlighter }\n ) & { deps?: ProviderToken<any>[] },\n): Provider {\n return { provide: MarkedContentHighlighter, ...provider } as Provider;\n}\n","/**\n * Credit goes to Scully for original implementation\n * https://github.com/scullyio/scully/blob/main/libs/scully/src/lib/fileHanderPlugins/markdown.ts\n */\nimport { inject, Injectable } from '@angular/core';\nimport { marked } from 'marked';\nimport { gfmHeadingId } from 'marked-gfm-heading-id';\nimport { mangle } from 'marked-mangle';\nimport { MarkedContentHighlighter } from './marked-content-highlighter';\n\n@Injectable()\nexport class MarkedSetupService {\n private readonly marked: typeof marked;\n private readonly highlighter = inject(MarkedContentHighlighter, {\n optional: true,\n });\n\n constructor() {\n const renderer = new marked.Renderer();\n renderer.code = ({ text, lang }) => {\n // Let's do a language based detection like on GitHub\n // So we can still have non-interpreted mermaid code\n if (lang === 'mermaid') {\n return '<pre class=\"mermaid\">' + text + '</pre>';\n }\n\n if (!lang) {\n return '<pre><code>' + text + '</code></pre>';\n }\n\n if (this.highlighter?.augmentCodeBlock) {\n return this.highlighter?.augmentCodeBlock(text, lang);\n }\n\n return `<pre class=\"language-${lang}\"><code class=\"language-${lang}\">${text}</code></pre>`;\n };\n\n const extensions = [gfmHeadingId(), mangle()];\n\n if (this.highlighter) {\n extensions.push(this.highlighter.getHighlightExtension());\n }\n\n marked.use(...extensions, {\n renderer,\n pedantic: false,\n gfm: true,\n breaks: false,\n });\n\n this.marked = marked;\n }\n\n getMarkedInstance(): typeof marked {\n return this.marked;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { getHeadingList } from 'marked-gfm-heading-id';\n\nimport { ContentRenderer, TableOfContentItem } from './content-renderer';\nimport { MarkedSetupService } from './marked-setup.service';\n\n@Injectable()\nexport class MarkdownContentRendererService implements ContentRenderer {\n #marked = inject(MarkedSetupService, { self: true });\n\n async render(content: string): Promise<string> {\n return this.#marked.getMarkedInstance().parse(content);\n }\n\n /**\n * The method is meant to be called after `render()`\n */\n getContentHeadings(): TableOfContentItem[] {\n return getHeadingList();\n }\n\n // eslint-disable-next-line\n enhance() {}\n}\n","import { Provider, InjectionToken } from '@angular/core';\nimport { ContentRenderer, NoopContentRenderer } from './content-renderer';\nimport { RenderTaskService } from './render-task.service';\n\nexport interface MarkdownRendererOptions {\n loadMermaid?: () => Promise<typeof import('mermaid')>;\n}\n\nconst CONTENT_RENDERER_PROVIDERS: Provider[] = [\n {\n provide: ContentRenderer,\n useClass: NoopContentRenderer,\n },\n];\n\nexport function withMarkdownRenderer(\n options?: MarkdownRendererOptions,\n): Provider {\n return [\n CONTENT_RENDERER_PROVIDERS,\n options?.loadMermaid\n ? [\n {\n provide: MERMAID_IMPORT_TOKEN,\n useFactory: options.loadMermaid,\n },\n ]\n : [],\n ];\n}\n\nexport function provideContent(...features: Provider[]) {\n return [\n { provide: RenderTaskService, useClass: RenderTaskService },\n ...features,\n ];\n}\n\nexport const MERMAID_IMPORT_TOKEN = new InjectionToken<\n Promise<typeof import('mermaid')>\n>('mermaid_import');\n","import { AsyncPipe } from '@angular/common';\nimport {\n AfterViewChecked,\n Component,\n inject,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { ContentRenderer } from './content-renderer';\nimport { AnchorNavigationDirective } from './anchor-navigation.directive';\n\n@Component({\n selector: 'analog-markdown-route',\n standalone: true,\n imports: [AsyncPipe],\n hostDirectives: [AnchorNavigationDirective],\n preserveWhitespaces: true,\n encapsulation: ViewEncapsulation.None,\n template: `<div [innerHTML]=\"content\" [class]=\"classes\"></div>`,\n})\nexport default class AnalogMarkdownRouteComponent implements AfterViewChecked {\n private sanitizer = inject(DomSanitizer);\n private route = inject(ActivatedRoute);\n contentRenderer = inject(ContentRenderer);\n\n protected content: SafeHtml = this.sanitizer.bypassSecurityTrustHtml(\n this.route.snapshot.data['renderedAnalogContent'],\n );\n\n @Input() classes = 'analog-markdown-route';\n\n ngAfterViewChecked() {\n this.contentRenderer.enhance();\n }\n}\n","import { AsyncPipe, isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewChecked,\n Component,\n Input,\n NgZone,\n OnChanges,\n OnInit,\n PLATFORM_ID,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { ActivatedRoute, Data } from '@angular/router';\nimport { Observable, from, of } from 'rxjs';\nimport { catchError, map, mergeMap, filter } from 'rxjs/operators';\n\nimport { AnchorNavigationDirective } from './anchor-navigation.directive';\nimport { ContentRenderer } from './content-renderer';\nimport { MERMAID_IMPORT_TOKEN } from './provide-content';\n\n@Component({\n selector: 'analog-markdown',\n standalone: true,\n imports: [AsyncPipe],\n hostDirectives: [AnchorNavigationDirective],\n preserveWhitespaces: true,\n encapsulation: ViewEncapsulation.None,\n template: `<div\n #container\n [innerHTML]=\"content$ | async\"\n [class]=\"classes\"\n ></div>`,\n})\nexport default class AnalogMarkdownComponent\n implements OnInit, OnChanges, AfterViewChecked\n{\n private sanitizer = inject(DomSanitizer);\n private route = inject(ActivatedRoute);\n private zone = inject(NgZone);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly mermaidImport = inject(MERMAID_IMPORT_TOKEN, {\n optional: true,\n });\n private mermaid: typeof import('mermaid') | undefined;\n\n public content$: Observable<SafeHtml> = this.getContentSource();\n\n @Input() content!: string | object | undefined | null;\n @Input() classes = 'analog-markdown';\n\n @ViewChild('container', { static: true, read: ViewContainerRef })\n container!: ViewContainerRef;\n\n contentRenderer = inject(ContentRenderer);\n\n constructor() {\n if (isPlatformBrowser(this.platformId) && this.mermaidImport) {\n // Mermaid can only be loaded on client side\n this.loadMermaid(this.mermaidImport);\n }\n }\n\n ngOnInit(): void {\n this.updateContent();\n }\n\n ngOnChanges(): void {\n this.updateContent();\n }\n\n updateContent() {\n if (this.content && typeof this.content !== 'string') {\n this.container.clear();\n const componentRef = this.container.createComponent(this.content as any);\n componentRef.changeDetectorRef.detectChanges();\n } else {\n this.content$ = this.getContentSource();\n }\n }\n\n getContentSource() {\n return this.route.data.pipe(\n map<Data, string>((data) => this.content ?? data['_analogContent']),\n filter((content) => typeof content === 'string'),\n mergeMap((contentString) => this.renderContent(contentString)),\n map((content) => this.sanitizer.bypassSecurityTrustHtml(content)),\n catchError((e) => of(`There was an error ${e}`)),\n );\n }\n\n async renderContent(content: string): Promise<string> {\n return this.contentRenderer.render(content);\n }\n\n ngAfterViewChecked() {\n this.contentRenderer.enhance();\n this.zone.runOutsideAngular(() => this.mermaid?.default.run());\n }\n\n private loadMermaid(mermaidImport: Promise<typeof import('mermaid')>) {\n this.zone.runOutsideAngular(() =>\n // Wrap into an observable to avoid redundant initialization once\n // the markdown component is destroyed before the promise is resolved.\n from(mermaidImport)\n .pipe(takeUntilDestroyed())\n .subscribe((mermaid) => {\n this.mermaid = mermaid;\n this.mermaid.default.initialize({ startOnLoad: false });\n // Explicitly running mermaid as ngAfterViewChecked\n // has probably already been called\n this.mermaid?.default.run();\n }),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵPendingTasks","i1.AnchorNavigationDirective"],"mappings":";;;;;;;;;;;;;MAQa,yBAAyB,CAAA;AAJtC,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAmBzC;AAhBC,IAAA,gBAAgB,CAAC,OAAoB,EAAA;QACnC,IACE,OAAO,YAAY,iBAAiB;AACpC,YAAA,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC;YACrC,aAAa,CAAC,OAAO,CAAC;AACtB,YAAA,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAC9B;YACA,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO;AAC1C,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAG,EAAA,QAAQ,GAAG,MAAM,CAAA,EAAG,IAAI,CAAA,CAAE,CAAC;AAClE,YAAA,IAAI,CAAC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
CHANGED
|
@@ -1,12 +1,153 @@
|
|
|
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
|
+
|
|
66
|
+
declare class MarkdownContentRendererService implements ContentRenderer {
|
|
67
|
+
#private;
|
|
68
|
+
render(content: string): Promise<string>;
|
|
69
|
+
/**
|
|
70
|
+
* The method is meant to be called after `render()`
|
|
71
|
+
*/
|
|
72
|
+
getContentHeadings(): TableOfContentItem[];
|
|
73
|
+
enhance(): void;
|
|
74
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkdownContentRendererService, never>;
|
|
75
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkdownContentRendererService>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface MarkdownRendererOptions {
|
|
79
|
+
loadMermaid?: () => Promise<typeof mermaid>;
|
|
80
|
+
}
|
|
81
|
+
declare function withMarkdownRenderer(options?: MarkdownRendererOptions): Provider;
|
|
82
|
+
declare function provideContent(...features: Provider[]): Provider[];
|
|
83
|
+
declare const MERMAID_IMPORT_TOKEN: InjectionToken<Promise<typeof mermaid>>;
|
|
84
|
+
|
|
85
|
+
declare class AnalogMarkdownRouteComponent implements AfterViewChecked {
|
|
86
|
+
private sanitizer;
|
|
87
|
+
private route;
|
|
88
|
+
contentRenderer: ContentRenderer;
|
|
89
|
+
protected content: SafeHtml;
|
|
90
|
+
classes: string;
|
|
91
|
+
ngAfterViewChecked(): void;
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownRouteComponent, never>;
|
|
93
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AnalogMarkdownRouteComponent, "analog-markdown-route", never, { "classes": { "alias": "classes"; "required": false; }; }, {}, never, never, true, [{ directive: typeof AnchorNavigationDirective; inputs: {}; outputs: {}; }]>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class AnalogMarkdownComponent implements OnInit, OnChanges, AfterViewChecked {
|
|
97
|
+
private sanitizer;
|
|
98
|
+
private route;
|
|
99
|
+
private zone;
|
|
100
|
+
private readonly platformId;
|
|
101
|
+
private readonly mermaidImport;
|
|
102
|
+
private mermaid;
|
|
103
|
+
content$: Observable<SafeHtml>;
|
|
104
|
+
content: string | object | undefined | null;
|
|
105
|
+
classes: string;
|
|
106
|
+
container: ViewContainerRef;
|
|
107
|
+
contentRenderer: ContentRenderer;
|
|
108
|
+
constructor();
|
|
109
|
+
ngOnInit(): void;
|
|
110
|
+
ngOnChanges(): void;
|
|
111
|
+
updateContent(): void;
|
|
112
|
+
getContentSource(): Observable<string | SafeHtml>;
|
|
113
|
+
renderContent(content: string): Promise<string>;
|
|
114
|
+
ngAfterViewChecked(): void;
|
|
115
|
+
private loadMermaid;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AnalogMarkdownComponent, never>;
|
|
117
|
+
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: {}; }]>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare function parseRawContentFile<Attributes extends Record<string, any>>(rawContentFile: string): {
|
|
121
|
+
content: string;
|
|
122
|
+
attributes: Attributes;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare class MarkedSetupService {
|
|
126
|
+
private readonly marked;
|
|
127
|
+
private readonly highlighter;
|
|
128
|
+
constructor();
|
|
129
|
+
getMarkedInstance(): typeof marked$1;
|
|
130
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedSetupService, never>;
|
|
131
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedSetupService>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface MarkedContentHighlighter {
|
|
135
|
+
augmentCodeBlock?(code: string, lang: string): string;
|
|
136
|
+
}
|
|
137
|
+
declare abstract class MarkedContentHighlighter {
|
|
138
|
+
abstract getHighlightExtension(): marked.MarkedExtension;
|
|
139
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MarkedContentHighlighter, never>;
|
|
140
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MarkedContentHighlighter>;
|
|
141
|
+
}
|
|
142
|
+
declare function withHighlighter(provider: ({
|
|
143
|
+
useValue: MarkedContentHighlighter;
|
|
144
|
+
} | {
|
|
145
|
+
useClass: Type<MarkedContentHighlighter> | AbstractType<MarkedContentHighlighter>;
|
|
146
|
+
} | {
|
|
147
|
+
useFactory: (...deps: any[]) => MarkedContentHighlighter;
|
|
148
|
+
}) & {
|
|
149
|
+
deps?: ProviderToken<any>[];
|
|
150
|
+
}): Provider;
|
|
151
|
+
|
|
152
|
+
export { AnchorNavigationDirective, ContentRenderer, MERMAID_IMPORT_TOKEN, AnalogMarkdownComponent as MarkdownComponent, MarkdownContentRendererService, AnalogMarkdownRouteComponent as MarkdownRouteComponent, MarkedContentHighlighter, MarkedSetupService, NoopContentRenderer, injectContent, injectContentFiles, parseRawContentFile, provideContent, withHighlighter, withMarkdownRenderer };
|
|
153
|
+
export type { ContentFile };
|
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-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.21",
|
|
4
4
|
"description": "Content Rendering for Analog",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Roberts <robertsbt@gmail.com>",
|
|
@@ -23,16 +23,16 @@
|
|
|
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
|
-
"marked": "
|
|
33
|
-
"marked-gfm-heading-id": "^
|
|
34
|
-
"marked-highlight": "^2.
|
|
35
|
-
"marked-mangle": "^1.1.
|
|
32
|
+
"marked": "^15.0.7",
|
|
33
|
+
"marked-gfm-heading-id": "^4.1.1",
|
|
34
|
+
"marked-highlight": "^2.2.1",
|
|
35
|
+
"marked-mangle": "^1.1.10",
|
|
36
36
|
"rxjs": "^6.5.0 || ^7.5.0",
|
|
37
37
|
"prismjs": "^1.29.0",
|
|
38
38
|
"satori": "^0.10.14",
|
|
@@ -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,6 +61,7 @@
|
|
|
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"
|
package/plugin/migrations.json
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
"version": "1.5.0-beta.1",
|
|
5
5
|
"description": "Update withMarkdownRenderer feature with withPrismHighlighter",
|
|
6
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"
|
|
7
12
|
}
|
|
8
13
|
},
|
|
9
14
|
"schematics": {
|
|
@@ -11,6 +16,11 @@
|
|
|
11
16
|
"version": "1.5.0-beta.1",
|
|
12
17
|
"description": "Update withMarkdownRenderer feature with withPrismHighlighter",
|
|
13
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"
|
|
14
24
|
}
|
|
15
25
|
},
|
|
16
26
|
"packageJsonUpdates": {
|
|
@@ -60,6 +70,28 @@
|
|
|
60
70
|
"alwaysAddToPackageJson": true
|
|
61
71
|
}
|
|
62
72
|
}
|
|
73
|
+
},
|
|
74
|
+
"1.15.0-beta.3": {
|
|
75
|
+
"version": "1.14.1",
|
|
76
|
+
"description": "Adds marked dependency to support markdown rendering",
|
|
77
|
+
"packages": {
|
|
78
|
+
"marked": {
|
|
79
|
+
"version": "^15.0.7",
|
|
80
|
+
"alwaysAddToPackageJson": true
|
|
81
|
+
},
|
|
82
|
+
"marked-mangle": {
|
|
83
|
+
"version": "^1.1.10",
|
|
84
|
+
"alwaysAddToPackageJson": true
|
|
85
|
+
},
|
|
86
|
+
"marked-highlight": {
|
|
87
|
+
"version": "^2.2.1",
|
|
88
|
+
"alwaysAddToPackageJson": true
|
|
89
|
+
},
|
|
90
|
+
"marked-gfm-heading-id": {
|
|
91
|
+
"version": "^4.1.1",
|
|
92
|
+
"alwaysAddToPackageJson": true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
63
95
|
}
|
|
64
96
|
}
|
|
65
97
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const update_markdown_version_1 = require("./update-markdown-version");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(update_markdown_version_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../packages/content-plugin/src/migrations/update-markdown-version/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,uEAA8D;AAE9D,kBAAe,IAAA,2BAAkB,EAAC,iCAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
async function update(host) {
|
|
6
|
+
// NOTE: we only add the dependency if the project is an Angular project
|
|
7
|
+
// Nx projects can add the dependency from migrations.json
|
|
8
|
+
let dependencyAdded = false;
|
|
9
|
+
if (host.exists('/angular.json')) {
|
|
10
|
+
(0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
11
|
+
marked: '^15.0.7',
|
|
12
|
+
'marked-mangle': '^1.1.10',
|
|
13
|
+
'marked-highlight': '^2.2.1',
|
|
14
|
+
'marked-gfm-heading-id': '^4.1.1',
|
|
15
|
+
}, {});
|
|
16
|
+
dependencyAdded = true;
|
|
17
|
+
}
|
|
18
|
+
await (0, devkit_1.formatFiles)(host);
|
|
19
|
+
if (dependencyAdded) {
|
|
20
|
+
return () => (0, devkit_1.installPackagesTask)(host);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=update-markdown-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-markdown-version.js","sourceRoot":"","sources":["../../../../../../../packages/content-plugin/src/migrations/update-markdown-version/update-markdown-version.ts"],"names":[],"mappings":";;AAOA,yBAuBC;AA9BD,uCAKoB;AAEL,KAAK,UAAU,MAAM,CAAC,IAAU;IAC7C,wEAAwE;IACxE,2DAA2D;IAC3D,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;QACjC,IAAA,qCAA4B,EAC1B,IAAI,EACJ;YACE,MAAM,EAAE,SAAS;YACjB,eAAe,EAAE,SAAS;YAC1B,kBAAkB,EAAE,QAAQ;YAC5B,uBAAuB,EAAE,QAAQ;SAClC,EACD,EAAE,CACH,CAAC;QACF,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,GAAG,EAAE,CAAC,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -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 };
|
|
@@ -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').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").marked.MarkedExtension;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PrismHighlighter, never>;
|
|
7
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PrismHighlighter>;
|
|
8
|
-
}
|