@analogjs/content 1.21.0-beta.1 → 1.21.0-beta.3

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.
@@ -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';\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 bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["toReactElement"],"mappings":";;;;AAAA;AAQO,MAAM,aAAa,GAAG,OAC3B,OAAe,EACf,OAA6B,KAC3B;AACF,IAAA,MAAM,WAAW,GAAGA,IAAc,CAAC,OAAO,CAAC;AAC3C,IAAA,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAkB,EAAE;AAC3C,QAAA,KAAK,EAAE,OAAO,CAAC,KAAK,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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 bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["toReactElement"],"mappings":";;;;AAAA;AAQO,MAAM,aAAa,GAAG,OAC3B,OAAe,EACf,OAA6B,KAC3B;AACF,IAAA,MAAM,WAAW,GAAGA,IAAc,CAAC,OAAO,CAAC;AAC3C,IAAA,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAkB,EAAE;AAC3C,QAAA,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI;AAC5B,QAAA,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,GAAG;AAC7B,QAAA,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,EAAE;QACjD,cAAc,EAAE,OAAO,CAAC,cAAc;AACvC,KAAA,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAClC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;AAE7C,IAAA,MAAM,SAAS,GAAG,MAAM,GAAG;AAE3B,IAAA,OAAO,SAAS;AAClB,CAAC;AAEK,MAAO,aAAc,SAAQ,QAAQ,CAAA;IACzC,WAAA,CAAY,OAAe,EAAE,OAAA,GAAgC,EAAE,EAAA;AAC7D,QAAA,KAAK,EAAE;AAEP,QAAA,MAAM,IAAI,GAAG,IAAI,cAAc,CAAC;YAC9B,MAAM,KAAK,CAAC,UAAU,EAAA;gBACpB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC;AACpD,gBAAA,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC1B,UAAU,CAAC,KAAK,EAAE;aACnB;AACF,SAAA,CAAC;AAEF,QAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AACxB,YAAA,OAAO,EAAE;AACP,gBAAA,cAAc,EAAE,WAAW;gBAC3B,eAAe,EAAE,OAAO,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;;;;"}
@@ -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: "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 }); }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: PrismHighlighter, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: PrismHighlighter }); }
51
51
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PrismHighlighter, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", 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,\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,wBAA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EACtD,IAAI,CACL;aACF;AACF,SAAA,CAAC;;8GA9CO,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAhB,gBAAgB,EAAA,CAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B;;;;ACND,CAAC,YAAA;AACC,IAAA,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAChC;;AAGF,IAAA,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;AACzD,QAAA,OAAO,EACL,qEAAqE;AACvE,QAAA,QAAQ,EAAE,iBAAiB;AAC3B,QAAA,MAAM,EAAE;AACN,YAAA,OAAO,EAAE,oCAAoC;AAC7C,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EACL,qEAAqE;AACxE,SAAA;AACD,QAAA,QAAQ,EACN,mGAAmG;AACtG,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
+ {"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,CAAA,SAAA,EAAY,IAAI,CAAA,eAAA;cAChB,CAAA,SAAA,EAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,CAAE;AAC7C,QAAA,OAAO,eAAe,OAAO,CAAA,eAAA,EAAkB,OAAO,CAAA,EAAA,EAAK,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,YAAY;gBAE9D,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;oBACpC,IAAI,GAAG,KAAK;oBACZ,OAAO,CAAC,IAAI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OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;AACtE;;ACbA;;AAEG;;;;"}
@@ -0,0 +1,85 @@
1
+ import { resource, inject, computed } from '@angular/core';
2
+ import { injectContentListLoader, parseRawContentFile, injectContentFileLoader } from '@analogjs/content';
3
+ import { toSignal } from '@angular/core/rxjs-interop';
4
+ import { from } from 'rxjs';
5
+ import { ActivatedRoute } from '@angular/router';
6
+ import { map } from 'rxjs/operators';
7
+
8
+ function contentFilesResource(filterFn) {
9
+ const contentListLoader = injectContentListLoader();
10
+ const contentList = toSignal(from(contentListLoader().then((items) => filterFn ? items.filter(filterFn) : items)));
11
+ return resource({
12
+ params: contentList,
13
+ loader: async ({ params: list }) => list,
14
+ });
15
+ }
16
+
17
+ async function getContentFile(contentFiles, slug, fallback) {
18
+ const filePath = `/src/content/${slug}`;
19
+ const contentFile = contentFiles[`${filePath}.md`] ?? contentFiles[`${filePath}.agx`];
20
+ if (!contentFile) {
21
+ return {
22
+ filename: filePath,
23
+ attributes: {},
24
+ slug: '',
25
+ content: fallback,
26
+ };
27
+ }
28
+ return contentFile().then((contentFile) => {
29
+ if (typeof contentFile === 'string') {
30
+ const { content, attributes } = parseRawContentFile(contentFile);
31
+ return {
32
+ filename: filePath,
33
+ slug,
34
+ attributes,
35
+ content,
36
+ };
37
+ }
38
+ return {
39
+ filename: filePath,
40
+ slug,
41
+ attributes: contentFile.metadata,
42
+ content: contentFile.default,
43
+ };
44
+ });
45
+ }
46
+ /**
47
+ * Resource for requesting an individual content file
48
+ *
49
+ * @param params
50
+ * @param fallback
51
+ * @returns
52
+ */
53
+ function contentFileResource(params, fallback = 'No Content Found') {
54
+ const loaderPromise = injectContentFileLoader();
55
+ const contentFilesMap = toSignal(from(loaderPromise()));
56
+ const input = params ||
57
+ toSignal(inject(ActivatedRoute).paramMap.pipe(map((params) => params.get('slug'))), { requireSync: true });
58
+ return resource({
59
+ params: computed(() => ({ input: input(), files: contentFilesMap() })),
60
+ loader: async ({ params }) => {
61
+ const { input: param, files } = params;
62
+ if (typeof param === 'string') {
63
+ if (param) {
64
+ return getContentFile(files, param, fallback);
65
+ }
66
+ return {
67
+ filename: '',
68
+ slug: '',
69
+ attributes: {},
70
+ content: fallback,
71
+ };
72
+ }
73
+ else {
74
+ return getContentFile(files, param.customFilename, fallback);
75
+ }
76
+ },
77
+ });
78
+ }
79
+
80
+ /**
81
+ * Generated bundle index. Do not edit.
82
+ */
83
+
84
+ export { contentFileResource, contentFilesResource };
85
+ //# sourceMappingURL=analogjs-content-resources.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analogjs-content-resources.mjs","sources":["../../../../packages/content/resources/src/content-files-resource.ts","../../../../packages/content/resources/src/content-file-resource.ts","../../../../packages/content/resources/src/analogjs-content-resources.ts"],"sourcesContent":["import { resource } from '@angular/core';\nimport {\n injectContentListLoader,\n InjectContentFilesFilterFunction,\n} from '@analogjs/content';\n\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { from } from 'rxjs';\n\nexport function contentFilesResource<Attributes extends Record<string, any>>(\n filterFn?: InjectContentFilesFilterFunction<Attributes> | undefined,\n) {\n const contentListLoader = injectContentListLoader<Attributes>();\n const contentList = toSignal(\n from(\n contentListLoader().then((items) =>\n filterFn ? items.filter(filterFn) : items,\n ),\n ),\n );\n\n return resource({\n params: contentList,\n loader: async ({ params: list }) => list,\n });\n}\n","import { computed, inject, resource, Signal } from '@angular/core';\nimport {\n ContentFile,\n parseRawContentFile,\n injectContentFileLoader,\n} from '@analogjs/content';\nimport { ActivatedRoute } from '@angular/router';\n\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { from } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\ntype ContentFileParams = Signal<\n | string\n | {\n customFilename: string;\n }\n>;\n\nasync function getContentFile<\n Attributes extends Record<string, any> = Record<string, any>,\n>(\n contentFiles: Record<string, () => Promise<string>>,\n slug: string,\n fallback: string,\n): Promise<ContentFile<Attributes | Record<string, never>>> {\n const filePath = `/src/content/${slug}`;\n const contentFile =\n contentFiles[`${filePath}.md`] ?? contentFiles[`${filePath}.agx`];\n\n if (!contentFile) {\n return {\n filename: filePath,\n attributes: {},\n slug: '',\n content: fallback,\n } as ContentFile<Attributes | Record<string, never>>;\n }\n\n return contentFile().then(\n (contentFile: string | { default: any; metadata: any }) => {\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 } as ContentFile<Attributes | Record<string, never>>;\n }\n\n return {\n filename: filePath,\n slug,\n attributes: contentFile.metadata,\n content: contentFile.default,\n } as ContentFile<Attributes | Record<string, never>>;\n },\n );\n}\n\n/**\n * Resource for requesting an individual content file\n *\n * @param params\n * @param fallback\n * @returns\n */\nexport function contentFileResource<\n Attributes extends Record<string, any> = Record<string, any>,\n>(params?: ContentFileParams, fallback = 'No Content Found') {\n const loaderPromise = injectContentFileLoader();\n const contentFilesMap = toSignal(from(loaderPromise()));\n const input =\n params ||\n toSignal(\n inject(ActivatedRoute).paramMap.pipe(\n map((params) => params.get('slug') as string),\n ),\n { requireSync: true },\n );\n\n return resource({\n params: computed(() => ({ input: input(), files: contentFilesMap() })),\n loader: async ({ params }) => {\n const { input: param, files } = params;\n\n if (typeof param === 'string') {\n if (param) {\n return getContentFile<Attributes>(files!, param, fallback);\n }\n\n return {\n filename: '',\n slug: '',\n attributes: {},\n content: fallback,\n } as ContentFile<Attributes | Record<string, never>>;\n } else {\n return getContentFile<Attributes>(\n files!,\n param.customFilename,\n fallback,\n );\n }\n },\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AASM,SAAU,oBAAoB,CAClC,QAAmE,EAAA;AAEnE,IAAA,MAAM,iBAAiB,GAAG,uBAAuB,EAAc;AAC/D,IAAA,MAAM,WAAW,GAAG,QAAQ,CAC1B,IAAI,CACF,iBAAiB,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D,IAAA,MAAM,aAAa,GAAG,uBAAuB,EAAE;IAC/C,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;IACvD,MAAM,KAAK,GACT,MAAM;AACN,QAAA,QAAQ,CACN,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAClC,GAAG,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAW,CAAC,CAC9C,EACD,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB;AAEH,IAAA,OAAO,QAAQ,CAAC;AACd,QAAA,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;AACtE,QAAA,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAI;YAC3B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM;AAEtC,YAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,IAAI,KAAK,EAAE;oBACT,OAAO,cAAc,CAAa,KAAM,EAAE,KAAK,EAAE,QAAQ,CAAC;;gBAG5D,OAAO;AACL,oBAAA,QAAQ,EAAE,EAAE;AACZ,oBAAA,IAAI,EAAE,EAAE;AACR,oBAAA,UAAU,EAAE,EAAE;AACd,oBAAA,OAAO,EAAE,QAAQ;iBACiC;;iBAC/C;gBACL,OAAO,cAAc,CACnB,KAAM,EACN,KAAK,CAAC,cAAc,EACpB,QAAQ,CACT;;SAEJ;AACF,KAAA,CAAC;AACJ;;AC7GA;;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 = {},\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
+ {"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":";;AAsBM,SAAU,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, HostListener, Directive, InjectionToken, ɵPendingTasksInternal as _PendingTasksInternal, Injectable, TransferState, makeStateKey, Input, ViewEncapsulation, Component, NgZone, PLATFORM_ID, ViewContainerRef, ViewChild } from '@angular/core';
2
+ import { inject, HostListener, Directive, InjectionToken, signal, ɵ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: "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 }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnchorNavigationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
33
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.0", type: AnchorNavigationDirective, isStandalone: true, selector: "[analogAnchorNavigation]", host: { listeners: { "click": "handleNavigation($event.target)" } }, ngImport: i0 }); }
34
34
  }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnchorNavigationDirective, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnchorNavigationDirective, decorators: [{
36
36
  type: Directive,
37
37
  args: [{
38
38
  selector: '[analogAnchorNavigation]',
@@ -126,6 +126,12 @@ const CONTENT_FILES_TOKEN = new InjectionToken('@analogjs/content Content Files'
126
126
  return objectUsingSlugAttribute;
127
127
  },
128
128
  });
129
+ const CONTENT_FILES_MAP_TOKEN = new InjectionToken('@analogjs/content Content Files', {
130
+ providedIn: 'root',
131
+ factory() {
132
+ return signal(inject(CONTENT_FILES_TOKEN));
133
+ },
134
+ });
129
135
 
130
136
  function parseRawContentFile(rawContentFile) {
131
137
  const { body, attributes } = fm(rawContentFile);
@@ -159,10 +165,10 @@ class RenderTaskService {
159
165
  this.#pendingTasks.remove(clear);
160
166
  }
161
167
  }
162
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
163
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService }); }
168
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: RenderTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
169
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: RenderTaskService }); }
164
170
  }
165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RenderTaskService, decorators: [{
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: RenderTaskService, decorators: [{
166
172
  type: Injectable
167
173
  }] });
168
174
 
@@ -253,10 +259,10 @@ class ContentRenderer {
253
259
  }
254
260
  // eslint-disable-next-line
255
261
  enhance() { }
256
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
257
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer }); }
262
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ContentRenderer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
263
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ContentRenderer }); }
258
264
  }
259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ContentRenderer, decorators: [{
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: ContentRenderer, decorators: [{
260
266
  type: Injectable
261
267
  }] });
262
268
  class NoopContentRenderer {
@@ -304,12 +310,15 @@ function injectContentFiles(filterFn) {
304
310
  }
305
311
  return allContentFiles;
306
312
  }
313
+ function injectContentFilesMap() {
314
+ return inject(CONTENT_FILES_TOKEN);
315
+ }
307
316
 
308
317
  class MarkedContentHighlighter {
309
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
310
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter }); }
318
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedContentHighlighter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
319
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedContentHighlighter }); }
311
320
  }
312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedContentHighlighter, decorators: [{
321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedContentHighlighter, decorators: [{
313
322
  type: Injectable
314
323
  }] });
315
324
  function withHighlighter(provider) {
@@ -355,10 +364,10 @@ class MarkedSetupService {
355
364
  getMarkedInstance() {
356
365
  return this.marked;
357
366
  }
358
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
359
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService }); }
367
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedSetupService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
368
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedSetupService }); }
360
369
  }
361
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkedSetupService, decorators: [{
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkedSetupService, decorators: [{
362
371
  type: Injectable
363
372
  }], ctorParameters: () => [] });
364
373
 
@@ -375,18 +384,46 @@ class MarkdownContentRendererService {
375
384
  }
376
385
  // eslint-disable-next-line
377
386
  enhance() { }
378
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
379
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService }); }
387
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkdownContentRendererService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
388
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkdownContentRendererService }); }
380
389
  }
381
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MarkdownContentRendererService, decorators: [{
390
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: MarkdownContentRendererService, decorators: [{
382
391
  type: Injectable
383
392
  }] });
384
393
 
394
+ const CONTENT_FILE_LOADER = new InjectionToken('@analogjs/content/resource File Loader');
395
+ function injectContentFileLoader() {
396
+ return inject(CONTENT_FILE_LOADER);
397
+ }
398
+ function withContentFileLoader() {
399
+ return {
400
+ provide: CONTENT_FILE_LOADER,
401
+ useFactory() {
402
+ return async () => injectContentFilesMap();
403
+ },
404
+ };
405
+ }
406
+
407
+ const CONTENT_LIST_LOADER = new InjectionToken('@analogjs/content/resource List Loader');
408
+ function injectContentListLoader() {
409
+ return inject(CONTENT_LIST_LOADER);
410
+ }
411
+ function withContentListLoader() {
412
+ return {
413
+ provide: CONTENT_LIST_LOADER,
414
+ useFactory() {
415
+ return async () => injectContentFiles();
416
+ },
417
+ };
418
+ }
419
+
385
420
  const CONTENT_RENDERER_PROVIDERS = [
386
421
  {
387
422
  provide: ContentRenderer,
388
423
  useClass: NoopContentRenderer,
389
424
  },
425
+ withContentFileLoader(),
426
+ withContentListLoader(),
390
427
  ];
391
428
  function withMarkdownRenderer(options) {
392
429
  return [
@@ -420,10 +457,10 @@ class AnalogMarkdownRouteComponent {
420
457
  ngAfterViewChecked() {
421
458
  this.contentRenderer.enhance();
422
459
  }
423
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
424
- 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 }); }
460
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnalogMarkdownRouteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
461
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", 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 }); }
425
462
  }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownRouteComponent, decorators: [{
463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnalogMarkdownRouteComponent, decorators: [{
427
464
  type: Component,
428
465
  args: [{
429
466
  selector: 'analog-markdown-route',
@@ -495,14 +532,14 @@ class AnalogMarkdownComponent {
495
532
  this.mermaid?.default.run();
496
533
  }));
497
534
  }
498
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
499
- 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
535
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnalogMarkdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
536
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", 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
500
537
  #container
501
538
  [innerHTML]="content$ | async"
502
539
  [class]="classes"
503
540
  ></div>`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None, preserveWhitespaces: true }); }
504
541
  }
505
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: AnalogMarkdownComponent, decorators: [{
542
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: AnalogMarkdownComponent, decorators: [{
506
543
  type: Component,
507
544
  args: [{
508
545
  selector: 'analog-markdown',
@@ -530,5 +567,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
530
567
  * Generated bundle index. Do not edit.
531
568
  */
532
569
 
533
- export { AnchorNavigationDirective, ContentRenderer, MERMAID_IMPORT_TOKEN, AnalogMarkdownComponent as MarkdownComponent, MarkdownContentRendererService, AnalogMarkdownRouteComponent as MarkdownRouteComponent, MarkedContentHighlighter, MarkedSetupService, NoopContentRenderer, injectContent, injectContentFiles, parseRawContentFile, provideContent, withHighlighter, withMarkdownRenderer };
570
+ export { AnchorNavigationDirective, ContentRenderer, MERMAID_IMPORT_TOKEN, AnalogMarkdownComponent as MarkdownComponent, MarkdownContentRendererService, AnalogMarkdownRouteComponent as MarkdownRouteComponent, MarkedContentHighlighter, MarkedSetupService, NoopContentRenderer, injectContent, injectContentFileLoader, injectContentFiles, injectContentFilesMap, injectContentListLoader, parseRawContentFile, provideContent, withContentFileLoader, withContentListLoader, withHighlighter, withMarkdownRenderer };
534
571
  //# sourceMappingURL=analogjs-content.mjs.map
@@ -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').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,I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AA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EARE,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,mBAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAUA,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAb3C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,SAAS,CAAC;oBACpB,cAAc,EAAE,CAAC,yBAAyB,CAAC;AAC3C,oBAAA,mBAAmB,EAAE,IAAI;oBACzB,aAAa,EAAE,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/content-file-loader.ts","../../../../packages/content/src/lib/content-list-loader.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, Signal, inject, signal } 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\nexport const CONTENT_FILES_MAP_TOKEN = new InjectionToken<\n Signal<Record<string, () => Promise<string>>>\n>('@analogjs/content Content Files', {\n providedIn: 'root',\n factory() {\n return signal(inject(CONTENT_FILES_TOKEN));\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 { inject } from '@angular/core';\n\nimport { ContentFile } from './content-file';\nimport { CONTENT_FILES_LIST_TOKEN } from './content-files-list-token';\nimport { CONTENT_FILES_TOKEN } from './content-files-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\nexport function injectContentFilesMap() {\n return inject(CONTENT_FILES_TOKEN);\n}\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 { InjectionToken, Provider } from '@angular/core';\nimport { inject } from '@angular/core';\n\nimport { injectContentFilesMap } from './inject-content-files';\n\ntype ContentFileLoaderFunction = () => Promise<\n Record<string, () => Promise<string>>\n>;\n\nexport const CONTENT_FILE_LOADER =\n new InjectionToken<ContentFileLoaderFunction>(\n '@analogjs/content/resource File Loader',\n );\n\nexport function injectContentFileLoader() {\n return inject(CONTENT_FILE_LOADER) as ContentFileLoaderFunction;\n}\n\nexport function withContentFileLoader(): Provider {\n return {\n provide: CONTENT_FILE_LOADER,\n useFactory() {\n return async () => injectContentFilesMap();\n },\n };\n}\n","import { InjectionToken, Provider } from '@angular/core';\nimport { inject } from '@angular/core';\n\nimport { ContentFile } from './content-file';\nimport { injectContentFiles } from './inject-content-files';\n\ntype ContentListLoaderFunction<Attributes extends Record<string, any>> =\n () => Promise<ContentFile<Attributes>[]>;\n\nexport const CONTENT_LIST_LOADER = new InjectionToken<\n ContentListLoaderFunction<any>\n>('@analogjs/content/resource List Loader');\n\nexport function injectContentListLoader<\n Attributes extends Record<string, any>,\n>() {\n return inject(CONTENT_LIST_LOADER) as ContentListLoaderFunction<Attributes>;\n}\n\nexport function withContentListLoader(): Provider {\n return {\n provide: CONTENT_LIST_LOADER,\n useFactory() {\n return async () => injectContentFiles();\n },\n };\n}\n","import { Provider, InjectionToken } from '@angular/core';\nimport { ContentRenderer, NoopContentRenderer } from './content-renderer';\nimport { RenderTaskService } from './render-task.service';\nimport { withContentFileLoader } from './content-file-loader';\nimport { withContentListLoader } from './content-list-loader';\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 withContentFileLoader(),\n withContentListLoader(),\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;AAC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BAChB,OAAO,EAAE,CAAC,SAAS,CAAC;oBACpB,cAAc,EAAE,CAAC,yBAAyB,CAAC;AAC3C,oBAAA,mBAAmB,EAAE,IAAI;oBACzB,aAAa,EAAE,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;;;;"}
package/index.d.ts CHANGED
@@ -62,6 +62,7 @@ declare class NoopContentRenderer implements ContentRenderer {
62
62
 
63
63
  declare function injectContentFiles<Attributes extends Record<string, any>>(filterFn?: InjectContentFilesFilterFunction<Attributes>): ContentFile<Attributes>[];
64
64
  type InjectContentFilesFilterFunction<T extends Record<string, any>> = (value: ContentFile<T>, index: number, array: ContentFile<T>[]) => boolean;
65
+ declare function injectContentFilesMap(): Record<string, () => Promise<string>>;
65
66
 
66
67
  declare class MarkdownContentRendererService implements ContentRenderer {
67
68
  #private;
@@ -149,5 +150,13 @@ declare function withHighlighter(provider: ({
149
150
  deps?: ProviderToken<any>[];
150
151
  }): Provider;
151
152
 
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 };
153
+ type ContentListLoaderFunction<Attributes extends Record<string, any>> = () => Promise<ContentFile<Attributes>[]>;
154
+ declare function injectContentListLoader<Attributes extends Record<string, any>>(): ContentListLoaderFunction<Attributes>;
155
+ declare function withContentListLoader(): Provider;
156
+
157
+ type ContentFileLoaderFunction = () => Promise<Record<string, () => Promise<string>>>;
158
+ declare function injectContentFileLoader(): ContentFileLoaderFunction;
159
+ declare function withContentFileLoader(): Provider;
160
+
161
+ export { AnchorNavigationDirective, ContentRenderer, MERMAID_IMPORT_TOKEN, AnalogMarkdownComponent as MarkdownComponent, MarkdownContentRendererService, AnalogMarkdownRouteComponent as MarkdownRouteComponent, MarkedContentHighlighter, MarkedSetupService, NoopContentRenderer, injectContent, injectContentFileLoader, injectContentFiles, injectContentFilesMap, injectContentListLoader, parseRawContentFile, provideContent, withContentFileLoader, withContentListLoader, withHighlighter, withMarkdownRenderer };
162
+ export type { ContentFile, InjectContentFilesFilterFunction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@analogjs/content",
3
- "version": "1.21.0-beta.1",
3
+ "version": "1.21.0-beta.3",
4
4
  "description": "Content Rendering for Analog",
5
5
  "type": "module",
6
6
  "author": "Brandon Roberts <robertsbt@gmail.com>",
@@ -86,6 +86,10 @@
86
86
  "types": "./prism-highlighter/index.d.ts",
87
87
  "default": "./fesm2022/analogjs-content-prism-highlighter.mjs"
88
88
  },
89
+ "./resources": {
90
+ "types": "./resources/index.d.ts",
91
+ "default": "./fesm2022/analogjs-content-resources.mjs"
92
+ },
89
93
  "./shiki-highlighter": {
90
94
  "types": "./shiki-highlighter/index.d.ts",
91
95
  "default": "./fesm2022/analogjs-content-shiki-highlighter.mjs"
@@ -0,0 +1,3 @@
1
+ # @analogjs/content/resources
2
+
3
+ Secondary entry point of `@analogjs/content`. It can be used by importing from `@analogjs/content/resources`.
@@ -0,0 +1,20 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import * as _analogjs_content from '@analogjs/content';
4
+ import { InjectContentFilesFilterFunction, ContentFile } from '@analogjs/content';
5
+
6
+ declare function contentFilesResource<Attributes extends Record<string, any>>(filterFn?: InjectContentFilesFilterFunction<Attributes> | undefined): _angular_core.ResourceRef<_analogjs_content.ContentFile<Attributes>[] | undefined>;
7
+
8
+ type ContentFileParams = Signal<string | {
9
+ customFilename: string;
10
+ }>;
11
+ /**
12
+ * Resource for requesting an individual content file
13
+ *
14
+ * @param params
15
+ * @param fallback
16
+ * @returns
17
+ */
18
+ declare function contentFileResource<Attributes extends Record<string, any> = Record<string, any>>(params?: ContentFileParams, fallback?: string): _angular_core.ResourceRef<ContentFile<Record<string, never> | Attributes> | undefined>;
19
+
20
+ export { contentFileResource, contentFilesResource };
@@ -0,0 +1,3 @@
1
+ {
2
+ "module": "../fesm2022/analogjs-content-resources.mjs"
3
+ }