@memberjunction/ng-markdown 0.0.1 → 2.126.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.types.js","sourceRoot":"","sources":["../../../src/lib/types/markdown.types.ts"],"names":[],"mappings":"AAkJA;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAyF;IAC3H,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,yBAAyB,EAAE,KAAK;IAChC,uBAAuB,EAAE,CAAC;IAC1B,0BAA0B,EAAE,IAAI;IAChC,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,EAAE;IAClB,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,IAAI;CACf,CAAC","sourcesContent":["/**\n * Configuration options for the markdown component\n */\nexport interface MarkdownConfig {\n /**\n * Enable Prism.js syntax highlighting for code blocks\n * @default true\n */\n enableHighlight?: boolean;\n\n /**\n * Enable Mermaid diagram rendering\n * @default true\n */\n enableMermaid?: boolean;\n\n /**\n * Enable copy-to-clipboard button on code blocks\n * @default true\n */\n enableCodeCopy?: boolean;\n\n /**\n * Enable collapsible heading sections\n * @default false\n */\n enableCollapsibleHeadings?: boolean;\n\n /**\n * Heading level at which to start collapsing (1-6)\n * Only applies when enableCollapsibleHeadings is true\n * @default 2\n */\n collapsibleHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n\n /**\n * Whether collapsible sections should be expanded by default\n * @default true\n */\n collapsibleDefaultExpanded?: boolean;\n\n /**\n * Specify which heading levels should start expanded.\n * Array of heading levels (2-6) that should be expanded by default.\n * Takes precedence over collapsibleDefaultExpanded for specified levels.\n *\n * Examples:\n * - [2] = Only h2 expanded, h3-h6 collapsed\n * - [2, 3] = h2 and h3 expanded, h4-h6 collapsed\n * - [] = All collapsed (same as collapsibleDefaultExpanded: false)\n * - undefined = Uses collapsibleDefaultExpanded for all levels\n *\n * @default undefined (uses collapsibleDefaultExpanded)\n */\n autoExpandLevels?: number[];\n\n /**\n * Enable GitHub-style alerts ([!NOTE], [!WARNING], etc.)\n * @default true\n */\n enableAlerts?: boolean;\n\n /**\n * Enable smartypants for typography (curly quotes, em/en dashes, ellipses)\n * Converts:\n * - \"quotes\" to \"curly quotes\"\n * - -- to en-dash (–)\n * - --- to em-dash (—)\n * - ... to ellipsis (…)\n * @default true\n */\n enableSmartypants?: boolean;\n\n /**\n * Enable SVG code block rendering\n * When enabled, ```svg code blocks are rendered as actual SVG images\n * @default true\n */\n enableSvgRenderer?: boolean;\n\n /**\n * Enable raw HTML passthrough in markdown content.\n * When enabled, HTML tags in the markdown are rendered as actual HTML\n * instead of being sanitized/stripped.\n *\n * Note: Even with enableHtml=true, scripts and event handlers are stripped\n * unless enableJavaScript is also true.\n *\n * @default false\n */\n enableHtml?: boolean;\n\n /**\n * Enable JavaScript execution in HTML content.\n * When enabled, <script> tags and on* event handlers are allowed.\n *\n * WARNING: This is a major security risk. Only enable for fully trusted content.\n * In most cases, you want enableHtml=true with enableJavaScript=false.\n *\n * @default false\n */\n enableJavaScript?: boolean;\n\n /**\n * Enable GitHub-style heading IDs for anchor links\n * @default true\n */\n enableHeadingIds?: boolean;\n\n /**\n * Prefix for heading IDs to avoid conflicts\n * @default ''\n */\n headingIdPrefix?: string;\n\n /**\n * Enable line numbers in code blocks\n * @default false\n */\n enableLineNumbers?: boolean;\n\n /**\n * Custom CSS class to apply to the markdown container\n */\n containerClass?: string;\n\n /**\n * Prism.js theme to use (must be loaded in angular.json or via CSS import)\n * Common themes: 'prism', 'prism-dark', 'prism-okaidia', 'prism-tomorrow', 'prism-coy'\n */\n prismTheme?: string;\n\n /**\n * Mermaid theme configuration\n * @default 'default'\n */\n mermaidTheme?: 'default' | 'dark' | 'forest' | 'neutral' | 'base';\n\n /**\n * Whether to sanitize HTML output\n * Set to false only if you trust the markdown source completely\n * @default true\n */\n sanitize?: boolean;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_MARKDOWN_CONFIG: Required<Omit<MarkdownConfig, 'autoExpandLevels'>> & { autoExpandLevels?: number[] } = {\n enableHighlight: true,\n enableMermaid: true,\n enableCodeCopy: true,\n enableCollapsibleHeadings: false,\n collapsibleHeadingLevel: 2,\n collapsibleDefaultExpanded: true,\n autoExpandLevels: undefined,\n enableAlerts: true,\n enableSmartypants: true,\n enableSvgRenderer: true,\n enableHtml: false,\n enableJavaScript: false,\n enableHeadingIds: true,\n headingIdPrefix: '',\n enableLineNumbers: false,\n containerClass: '',\n prismTheme: 'prism-okaidia',\n mermaidTheme: 'default',\n sanitize: true\n};\n\n/**\n * Event emitted when markdown rendering is complete\n */\nexport interface MarkdownRenderEvent {\n /**\n * The rendered HTML string\n */\n html: string;\n\n /**\n * Time taken to render in milliseconds\n */\n renderTime: number;\n\n /**\n * Whether mermaid diagrams were rendered\n */\n hasMermaid: boolean;\n\n /**\n * Whether code blocks were highlighted\n */\n hasCodeBlocks: boolean;\n\n /**\n * List of heading IDs generated (for TOC building)\n */\n headingIds: HeadingInfo[];\n}\n\n/**\n * Information about a heading in the document\n */\nexport interface HeadingInfo {\n /**\n * The heading ID (for anchor links)\n */\n id: string;\n\n /**\n * The heading text content\n */\n text: string;\n\n /**\n * The heading level (1-6)\n */\n level: number;\n\n /**\n * The raw markdown text\n */\n raw: string;\n}\n\n/**\n * Alert types supported by marked-alert\n */\nexport type AlertType = 'note' | 'tip' | 'important' | 'warning' | 'caution';\n\n/**\n * Configuration for a custom alert variant\n */\nexport interface AlertVariant {\n type: string;\n icon: string;\n titleClassName?: string;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export * from './lib/markdown.module';
2
+ export * from './lib/components/markdown.component';
3
+ export * from './lib/services/markdown.service';
4
+ export * from './lib/extensions/collapsible-headings.extension';
5
+ export * from './lib/extensions/code-copy.extension';
6
+ export * from './lib/extensions/svg-renderer.extension';
7
+ export * from './lib/types/markdown.types';
@@ -0,0 +1,14 @@
1
+ // Public API Surface of @memberjunction/ng-markdown
2
+ // Module
3
+ export * from './lib/markdown.module';
4
+ // Components
5
+ export * from './lib/components/markdown.component';
6
+ // Services
7
+ export * from './lib/services/markdown.service';
8
+ // Extensions (for advanced customization)
9
+ export * from './lib/extensions/collapsible-headings.extension';
10
+ export * from './lib/extensions/code-copy.extension';
11
+ export * from './lib/extensions/svg-renderer.extension';
12
+ // Types
13
+ export * from './lib/types/markdown.types';
14
+ //# sourceMappingURL=public-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,SAAS;AACT,cAAc,uBAAuB,CAAC;AAEtC,aAAa;AACb,cAAc,qCAAqC,CAAC;AAEpD,WAAW;AACX,cAAc,iCAAiC,CAAC;AAEhD,0CAA0C;AAC1C,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AAExD,QAAQ;AACR,cAAc,4BAA4B,CAAC","sourcesContent":["// Public API Surface of @memberjunction/ng-markdown\n\n// Module\nexport * from './lib/markdown.module';\n\n// Components\nexport * from './lib/components/markdown.component';\n\n// Services\nexport * from './lib/services/markdown.service';\n\n// Extensions (for advanced customization)\nexport * from './lib/extensions/collapsible-headings.extension';\nexport * from './lib/extensions/code-copy.extension';\nexport * from './lib/extensions/svg-renderer.extension';\n\n// Types\nexport * from './lib/types/markdown.types';\n"]}
package/package.json CHANGED
@@ -1,10 +1,48 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-markdown",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @memberjunction/ng-markdown",
3
+ "version": "2.126.0",
4
+ "description": "MemberJunction: Lightweight Angular markdown component with Prism.js highlighting, Mermaid diagrams, and extensible features",
5
+ "main": "./dist/public-api.js",
6
+ "typings": "./dist/public-api.d.ts",
7
+ "files": [
8
+ "/dist"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "ngc"
13
+ },
5
14
  "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
15
+ "angular",
16
+ "markdown",
17
+ "marked",
18
+ "prism",
19
+ "mermaid",
20
+ "memberjunction"
21
+ ],
22
+ "author": "MemberJunction",
23
+ "license": "ISC",
24
+ "devDependencies": {
25
+ "@angular/compiler": "18.0.2",
26
+ "@angular/compiler-cli": "18.0.2"
27
+ },
28
+ "peerDependencies": {
29
+ "@angular/common": "18.0.2",
30
+ "@angular/core": "18.0.2",
31
+ "@angular/platform-browser": "18.0.2"
32
+ },
33
+ "dependencies": {
34
+ "marked": "^14.0.0",
35
+ "marked-alert": "^2.0.0",
36
+ "marked-gfm-heading-id": "^4.0.0",
37
+ "marked-highlight": "^2.0.0",
38
+ "marked-smartypants": "^1.1.11",
39
+ "prismjs": "^1.29.0",
40
+ "mermaid": "^11.0.0",
41
+ "tslib": "^2.3.0"
42
+ },
43
+ "sideEffects": false,
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/MemberJunction/MJ"
47
+ }
10
48
  }