@mrsf/markdown-it-mrsf 0.1.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.
- package/LICENSE +21 -0
- package/README.md +178 -0
- package/dist/browser.d.ts +23 -0
- package/dist/browser.js +39 -0
- package/dist/controller.d.ts +26 -0
- package/dist/controller.js +40 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +87 -0
- package/dist/rules/core.d.ts +27 -0
- package/dist/rules/core.js +149 -0
- package/dist/rules/renderer.d.ts +16 -0
- package/dist/rules/renderer.js +159 -0
- package/dist/shared.d.ts +29 -0
- package/dist/shared.js +86 -0
- package/dist/style.css +356 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.js +5 -0
- package/package.json +77 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MRSF markdown-it plugin — type definitions.
|
|
3
|
+
*/
|
|
4
|
+
import type { MrsfDocument } from "@mrsf/cli";
|
|
5
|
+
/** Options for the MRSF markdown-it plugin. */
|
|
6
|
+
export interface MrsfPluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the Markdown document on disk.
|
|
9
|
+
* Used for auto-discovery of the sidecar file via `@mrsf/cli`.
|
|
10
|
+
*/
|
|
11
|
+
documentPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit path to the `.review.yaml` or `.review.json` sidecar file.
|
|
14
|
+
* Takes precedence over auto-discovery.
|
|
15
|
+
*/
|
|
16
|
+
sidecarPath?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Pre-loaded MRSF sidecar data.
|
|
19
|
+
* Takes precedence over `loader`, `sidecarPath`, and `documentPath`.
|
|
20
|
+
* Enables browser use, custom pipelines, and testing.
|
|
21
|
+
*/
|
|
22
|
+
comments?: MrsfDocument;
|
|
23
|
+
/**
|
|
24
|
+
* Custom loader function that returns sidecar data.
|
|
25
|
+
* Takes precedence over `sidecarPath` and `documentPath`.
|
|
26
|
+
* Useful for integrations that manage their own sidecar state.
|
|
27
|
+
*/
|
|
28
|
+
loader?: () => MrsfDocument | null;
|
|
29
|
+
/** Whether to show resolved comments (default: true). */
|
|
30
|
+
showResolved?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Enable interactive mode — adds action buttons with `data-mrsf-action`
|
|
33
|
+
* attributes for host applications to hook into (default: false).
|
|
34
|
+
*/
|
|
35
|
+
interactive?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Position of the gutter badge relative to the line content.
|
|
38
|
+
* - `'left'`: badge in a left margin gutter, outside the content area
|
|
39
|
+
* - `'tight'`: badge inline, immediately before the text
|
|
40
|
+
* - `'right'`: badge floated to the right of the content (default)
|
|
41
|
+
*/
|
|
42
|
+
gutterPosition?: "left" | "tight" | "right";
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show the gutter badge on lines that have inline-highlighted
|
|
45
|
+
* comments (i.e. comments with `selected_text`). When false, lines where
|
|
46
|
+
* ALL comments have inline highlights will not get a gutter badge — the
|
|
47
|
+
* inline tooltip is the only way to view the comment. Default: true.
|
|
48
|
+
*/
|
|
49
|
+
gutterForInline?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to render inline text highlights for comments that have
|
|
52
|
+
* `selected_text`. When false, only gutter badges are shown.
|
|
53
|
+
* Default: true.
|
|
54
|
+
*/
|
|
55
|
+
inlineHighlights?: boolean;
|
|
56
|
+
/** Color scheme hint (default: 'auto'). */
|
|
57
|
+
theme?: "light" | "dark" | "auto";
|
|
58
|
+
/** Working directory for sidecar discovery (default: process.cwd()). */
|
|
59
|
+
cwd?: string;
|
|
60
|
+
}
|
|
61
|
+
/** Slim comment shape used internally after loading. */
|
|
62
|
+
export interface SlimComment {
|
|
63
|
+
id: string;
|
|
64
|
+
author: string;
|
|
65
|
+
text: string;
|
|
66
|
+
line: number | null;
|
|
67
|
+
end_line: number | null;
|
|
68
|
+
start_column: number | null;
|
|
69
|
+
end_column: number | null;
|
|
70
|
+
selected_text: string | null;
|
|
71
|
+
resolved: boolean;
|
|
72
|
+
reply_to: string | null;
|
|
73
|
+
severity: string | null;
|
|
74
|
+
type: string | null;
|
|
75
|
+
timestamp: string | null;
|
|
76
|
+
}
|
|
77
|
+
/** A root comment with its threaded replies. */
|
|
78
|
+
export interface CommentThread {
|
|
79
|
+
comment: SlimComment;
|
|
80
|
+
replies: SlimComment[];
|
|
81
|
+
}
|
|
82
|
+
/** Comments grouped by their anchored source line. */
|
|
83
|
+
export type LineMap = Map<number, CommentThread[]>;
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mrsf/markdown-it-mrsf",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "markdown-it plugin for rendering Sidemark/MRSF (Markdown Review Sidecar Format) review comments",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"browser": {
|
|
11
|
+
"import": "./dist/browser.js",
|
|
12
|
+
"types": "./dist/browser.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./browser": {
|
|
18
|
+
"import": "./dist/browser.js",
|
|
19
|
+
"types": "./dist/browser.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./style.css": "./dist/style.css",
|
|
22
|
+
"./controller": {
|
|
23
|
+
"import": "./dist/controller.js",
|
|
24
|
+
"types": "./dist/controller.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc && cp src/style.css dist/style.css",
|
|
32
|
+
"dev": "tsc --watch",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"lint": "tsc --noEmit",
|
|
36
|
+
"prepublishOnly": "cp ../LICENSE . && npm run build && npm test",
|
|
37
|
+
"postpublish": "rm -f LICENSE"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"markdown-it",
|
|
41
|
+
"markdown-it-plugin",
|
|
42
|
+
"markdown",
|
|
43
|
+
"review",
|
|
44
|
+
"sidecar",
|
|
45
|
+
"mrsf",
|
|
46
|
+
"sidemark",
|
|
47
|
+
"comments"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"author": "Wictor Wilén (https://github.com/wictorwilen)",
|
|
51
|
+
"homepage": "https://github.com/wictorwilen/MRSF/tree/main/markdown-it#readme",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/wictorwilen/MRSF/issues"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/wictorwilen/MRSF.git",
|
|
58
|
+
"directory": "markdown-it"
|
|
59
|
+
},
|
|
60
|
+
"files": [
|
|
61
|
+
"dist/**/*.js",
|
|
62
|
+
"dist/**/*.d.ts",
|
|
63
|
+
"dist/style.css",
|
|
64
|
+
"README.md",
|
|
65
|
+
"LICENSE"
|
|
66
|
+
],
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@mrsf/cli": "file:../cli"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@types/markdown-it": "^14.1.2",
|
|
72
|
+
"@types/node": "^22.13.10",
|
|
73
|
+
"markdown-it": "^14.1.0",
|
|
74
|
+
"typescript": "^5.8.2",
|
|
75
|
+
"vitest": "^3.0.9"
|
|
76
|
+
}
|
|
77
|
+
}
|