@memberjunction/ng-markdown 4.1.0 → 4.3.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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ describe('@memberjunction/ng-markdown', () => {
3
+ it('should have a passing test', () => {
4
+ expect(true).toBe(true);
5
+ });
6
+ });
7
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\n\ndescribe('@memberjunction/ng-markdown', () => {\n it('should have a passing test', () => {\n expect(true).toBe(true);\n });\n});\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=markdown-types.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/markdown-types.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,78 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { DEFAULT_MARKDOWN_CONFIG } from '../lib/types/markdown.types';
3
+ describe('DEFAULT_MARKDOWN_CONFIG', () => {
4
+ it('should enable syntax highlighting', () => {
5
+ expect(DEFAULT_MARKDOWN_CONFIG.enableHighlight).toBe(true);
6
+ });
7
+ it('should enable mermaid', () => {
8
+ expect(DEFAULT_MARKDOWN_CONFIG.enableMermaid).toBe(true);
9
+ });
10
+ it('should enable code copy', () => {
11
+ expect(DEFAULT_MARKDOWN_CONFIG.enableCodeCopy).toBe(true);
12
+ });
13
+ it('should disable collapsible headings by default', () => {
14
+ expect(DEFAULT_MARKDOWN_CONFIG.enableCollapsibleHeadings).toBe(false);
15
+ });
16
+ it('should set collapsible heading level to 2', () => {
17
+ expect(DEFAULT_MARKDOWN_CONFIG.collapsibleHeadingLevel).toBe(2);
18
+ });
19
+ it('should have collapsible default expanded true', () => {
20
+ expect(DEFAULT_MARKDOWN_CONFIG.collapsibleDefaultExpanded).toBe(true);
21
+ });
22
+ it('should enable alerts', () => {
23
+ expect(DEFAULT_MARKDOWN_CONFIG.enableAlerts).toBe(true);
24
+ });
25
+ it('should enable smartypants', () => {
26
+ expect(DEFAULT_MARKDOWN_CONFIG.enableSmartypants).toBe(true);
27
+ });
28
+ it('should enable SVG renderer', () => {
29
+ expect(DEFAULT_MARKDOWN_CONFIG.enableSvgRenderer).toBe(true);
30
+ });
31
+ it('should disable HTML passthrough by default', () => {
32
+ expect(DEFAULT_MARKDOWN_CONFIG.enableHtml).toBe(false);
33
+ });
34
+ it('should disable JavaScript by default', () => {
35
+ expect(DEFAULT_MARKDOWN_CONFIG.enableJavaScript).toBe(false);
36
+ });
37
+ it('should enable heading IDs', () => {
38
+ expect(DEFAULT_MARKDOWN_CONFIG.enableHeadingIds).toBe(true);
39
+ });
40
+ it('should enable sanitization', () => {
41
+ expect(DEFAULT_MARKDOWN_CONFIG.sanitize).toBe(true);
42
+ });
43
+ it('should use default mermaid theme', () => {
44
+ expect(DEFAULT_MARKDOWN_CONFIG.mermaidTheme).toBe('default');
45
+ });
46
+ });
47
+ describe('HeadingInfo', () => {
48
+ it('should construct heading info', () => {
49
+ const heading = {
50
+ id: 'introduction',
51
+ text: 'Introduction',
52
+ level: 1,
53
+ raw: '# Introduction'
54
+ };
55
+ expect(heading.level).toBe(1);
56
+ expect(heading.id).toBe('introduction');
57
+ });
58
+ });
59
+ describe('MarkdownRenderEvent', () => {
60
+ it('should construct render event', () => {
61
+ const event = {
62
+ html: '<h1>Hello</h1>',
63
+ renderTime: 5.2,
64
+ hasMermaid: false,
65
+ hasCodeBlocks: true,
66
+ headingIds: [{ id: 'hello', text: 'Hello', level: 1, raw: '# Hello' }]
67
+ };
68
+ expect(event.renderTime).toBeCloseTo(5.2);
69
+ expect(event.headingIds).toHaveLength(1);
70
+ });
71
+ });
72
+ describe('AlertType', () => {
73
+ it('should support all alert types', () => {
74
+ const types = ['note', 'tip', 'important', 'warning', 'caution'];
75
+ expect(types).toHaveLength(5);
76
+ });
77
+ });
78
+ //# sourceMappingURL=markdown-types.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-types.test.js","sourceRoot":"","sources":["../../src/__tests__/markdown-types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,I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AE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;SACvE,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,KAAK,GAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9E,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport { DEFAULT_MARKDOWN_CONFIG } from '../lib/types/markdown.types';\nimport type { MarkdownConfig, HeadingInfo, MarkdownRenderEvent, AlertType } from '../lib/types/markdown.types';\n\ndescribe('DEFAULT_MARKDOWN_CONFIG', () => {\n it('should enable syntax highlighting', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHighlight).toBe(true);\n });\n\n it('should enable mermaid', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableMermaid).toBe(true);\n });\n\n it('should enable code copy', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableCodeCopy).toBe(true);\n });\n\n it('should disable collapsible headings by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableCollapsibleHeadings).toBe(false);\n });\n\n it('should set collapsible heading level to 2', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.collapsibleHeadingLevel).toBe(2);\n });\n\n it('should have collapsible default expanded true', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.collapsibleDefaultExpanded).toBe(true);\n });\n\n it('should enable alerts', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableAlerts).toBe(true);\n });\n\n it('should enable smartypants', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableSmartypants).toBe(true);\n });\n\n it('should enable SVG renderer', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableSvgRenderer).toBe(true);\n });\n\n it('should disable HTML passthrough by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHtml).toBe(false);\n });\n\n it('should disable JavaScript by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableJavaScript).toBe(false);\n });\n\n it('should enable heading IDs', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHeadingIds).toBe(true);\n });\n\n it('should enable sanitization', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.sanitize).toBe(true);\n });\n\n it('should use default mermaid theme', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.mermaidTheme).toBe('default');\n });\n});\n\ndescribe('HeadingInfo', () => {\n it('should construct heading info', () => {\n const heading: HeadingInfo = {\n id: 'introduction',\n text: 'Introduction',\n level: 1,\n raw: '# Introduction'\n };\n expect(heading.level).toBe(1);\n expect(heading.id).toBe('introduction');\n });\n});\n\ndescribe('MarkdownRenderEvent', () => {\n it('should construct render event', () => {\n const event: MarkdownRenderEvent = {\n html: '<h1>Hello</h1>',\n renderTime: 5.2,\n hasMermaid: false,\n hasCodeBlocks: true,\n headingIds: [{ id: 'hello', text: 'Hello', level: 1, raw: '# Hello' }]\n };\n expect(event.renderTime).toBeCloseTo(5.2);\n expect(event.headingIds).toHaveLength(1);\n });\n});\n\ndescribe('AlertType', () => {\n it('should support all alert types', () => {\n const types: AlertType[] = ['note', 'tip', 'important', 'warning', 'caution'];\n expect(types).toHaveLength(5);\n });\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-markdown",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "MemberJunction: Lightweight Angular markdown component with Prism.js highlighting, Mermaid diagrams, and extensible features",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -8,8 +8,9 @@
8
8
  "/dist"
9
9
  ],
10
10
  "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1",
12
- "build": "ngc"
11
+ "test": "echo \"No tests configured yet\"",
12
+ "build": "ngc",
13
+ "test:watch": "vitest"
13
14
  },
14
15
  "keywords": [
15
16
  "angular",
@@ -23,7 +24,8 @@
23
24
  "license": "ISC",
24
25
  "devDependencies": {
25
26
  "@angular/compiler": "21.1.3",
26
- "@angular/compiler-cli": "21.1.3"
27
+ "@angular/compiler-cli": "21.1.3",
28
+ "vitest": "^4.0.18"
27
29
  },
28
30
  "peerDependencies": {
29
31
  "@angular/common": "21.1.3",