prosemirror-highlight 0.0.1

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,20 @@
1
+ import { Node } from 'prosemirror-model';
2
+ import { Decoration } from 'prosemirror-view';
3
+
4
+ type Parser = (options: {
5
+ /**
6
+ * The text content of the code block node.
7
+ */
8
+ content: string;
9
+ /**
10
+ * The start position of the code block node.
11
+ */
12
+ pos: number;
13
+ /**
14
+ * The language of the code block node.
15
+ */
16
+ language?: string;
17
+ }) => Decoration[];
18
+ type LanguageExtractor = (node: Node) => string | undefined;
19
+
20
+ export type { LanguageExtractor as L, Parser as P };
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "prosemirror-highlight",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "packageManager": "pnpm@8.10.0",
6
+ "description": "A ProseMirror plugin to highlight code blocks",
7
+ "author": "ocavue <ocavue@gmail.com>",
8
+ "license": "MIT",
9
+ "funding": "https://github.com/sponsors/ocavue",
10
+ "homepage": "https://github.com/ocavue/prosemirror-highlight#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/ocavue/prosemirror-highlight.git"
14
+ },
15
+ "bugs": "https://github.com/ocavue/prosemirror-highlight/issues",
16
+ "keywords": [],
17
+ "sideEffects": false,
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./lowlight": {
27
+ "types": "./dist/lowlight.d.ts",
28
+ "default": "./dist/lowlight.js"
29
+ },
30
+ "./shiki": {
31
+ "types": "./dist/shiki.d.ts",
32
+ "default": "./dist/shiki.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "peerDependencies": {
39
+ "@types/hast": "^3.0.0",
40
+ "highlight.js": "^11.9.0",
41
+ "prosemirror-model": "^1.19.3",
42
+ "prosemirror-state": "^1.4.3",
43
+ "prosemirror-transform": "^1.8.0",
44
+ "prosemirror-view": "^1.32.4"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "prosemirror-model": {
48
+ "optional": true
49
+ },
50
+ "prosemirror-state": {
51
+ "optional": true
52
+ },
53
+ "prosemirror-transform": {
54
+ "optional": true
55
+ },
56
+ "prosemirror-view": {
57
+ "optional": true
58
+ },
59
+ "highlight.js": {
60
+ "optional": true
61
+ },
62
+ "@types/hast": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "devDependencies": {
67
+ "@antfu/ni": "^0.21.8",
68
+ "@ocavue/eslint-config": "^1.4.0",
69
+ "@types/hast": "^3.0.3",
70
+ "@types/node": "^20.9.1",
71
+ "eslint": "^8.52.0",
72
+ "highlight.js": "^11.9.0",
73
+ "jsdom": "^23.0.1",
74
+ "lowlight": "^3.1.0",
75
+ "prettier": "^3.0.3",
76
+ "prosemirror-example-setup": "^1.2.2",
77
+ "prosemirror-model": "^1.19.3",
78
+ "prosemirror-schema-basic": "^1.2.2",
79
+ "prosemirror-state": "^1.4.3",
80
+ "prosemirror-transform": "^1.8.0",
81
+ "prosemirror-view": "^1.32.4",
82
+ "shiki": "^0.14.6",
83
+ "tsup": "^8.0.1",
84
+ "typescript": "^5.2.2",
85
+ "vite": "^4.5.0",
86
+ "vitest": "^1.0.3"
87
+ },
88
+ "renovate": {
89
+ "extends": [
90
+ "github>ocavue/config-renovate"
91
+ ]
92
+ },
93
+ "scripts": {
94
+ "dev": "vite",
95
+ "build": "tsup",
96
+ "lint": "eslint .",
97
+ "fix": "eslint --fix . && prettier --write .",
98
+ "start": "esno src/index.ts",
99
+ "test": "vitest",
100
+ "typecheck": "tsc --noEmit"
101
+ },
102
+ "typesVersions": {
103
+ "*": {
104
+ "*": [
105
+ "./dist/*",
106
+ "./dist/index.d.ts"
107
+ ]
108
+ }
109
+ }
110
+ }