prosemirror-highlight 0.12.1 → 0.13.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/README.md +1 -1
- package/dist/refractor.d.ts +1 -1
- package/dist/refractor.js +1 -2
- package/dist/shiki.d.ts +2 -2
- package/dist/shiki.js +0 -1
- package/dist/sugar-high.js +2 -14
- package/package.json +18 -17
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ export const lowlightPlugin = createHighlightPlugin({ parser })
|
|
|
122
122
|
<summary>Static loading of all languages</summary>
|
|
123
123
|
|
|
124
124
|
```ts
|
|
125
|
-
import { refractor } from 'refractor/
|
|
125
|
+
import { refractor } from 'refractor/all'
|
|
126
126
|
|
|
127
127
|
import { createHighlightPlugin } from 'prosemirror-highlight'
|
|
128
128
|
import { createParser } from 'prosemirror-highlight/refractor'
|
package/dist/refractor.d.ts
CHANGED
package/dist/refractor.js
CHANGED
|
@@ -8,8 +8,7 @@ function createParser(refractor) {
|
|
|
8
8
|
const root = refractor.highlight(content, language || "");
|
|
9
9
|
const decorations = [];
|
|
10
10
|
const from = pos + 1;
|
|
11
|
-
|
|
12
|
-
fillFromRoot(decorations, hastRoot, from);
|
|
11
|
+
fillFromRoot(decorations, root, from);
|
|
13
12
|
return decorations;
|
|
14
13
|
};
|
|
15
14
|
}
|
package/dist/shiki.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HighlighterGeneric, CodeToTokensOptions } from '@shikijs/types';
|
|
2
2
|
import { P as Parser } from './types-BIUZQh-P.js';
|
|
3
3
|
import 'prosemirror-model';
|
|
4
4
|
import 'prosemirror-view';
|
|
5
5
|
|
|
6
|
-
declare function createParser(highlighter:
|
|
6
|
+
declare function createParser<Language extends string = string, Theme extends string = string>(highlighter: HighlighterGeneric<Language, Theme>, options?: CodeToTokensOptions<Language, Theme>): Parser;
|
|
7
7
|
|
|
8
8
|
export { Parser, createParser };
|
package/dist/shiki.js
CHANGED
package/dist/sugar-high.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
// src/sugar-high.ts
|
|
2
2
|
import { Decoration } from "prosemirror-view";
|
|
3
|
-
import { tokenize } from "sugar-high";
|
|
4
|
-
var types =
|
|
5
|
-
"identifier",
|
|
6
|
-
"keyword",
|
|
7
|
-
"string",
|
|
8
|
-
"class",
|
|
9
|
-
"property",
|
|
10
|
-
"entity",
|
|
11
|
-
"jsxliterals",
|
|
12
|
-
"sign",
|
|
13
|
-
"comment",
|
|
14
|
-
"break",
|
|
15
|
-
"space"
|
|
16
|
-
];
|
|
3
|
+
import { tokenize, SugarHigh } from "sugar-high";
|
|
4
|
+
var types = SugarHigh.TokenTypes;
|
|
17
5
|
function createParser() {
|
|
18
6
|
return function parser({ content, pos }) {
|
|
19
7
|
const decorations = [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prosemirror-highlight",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"description": "A ProseMirror plugin to highlight code blocks",
|
|
6
6
|
"author": "ocavue <ocavue@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"dist"
|
|
52
52
|
],
|
|
53
53
|
"peerDependencies": {
|
|
54
|
+
"@shikijs/types": "^1.29.2 || ^2.0.0 || ^3.0.0",
|
|
54
55
|
"@types/hast": "^3.0.0",
|
|
55
56
|
"highlight.js": "^11.9.0",
|
|
56
57
|
"lowlight": "^3.1.0",
|
|
@@ -58,9 +59,8 @@
|
|
|
58
59
|
"prosemirror-state": "^1.4.3",
|
|
59
60
|
"prosemirror-transform": "^1.8.0",
|
|
60
61
|
"prosemirror-view": "^1.32.4",
|
|
61
|
-
"refractor": "^
|
|
62
|
-
"
|
|
63
|
-
"sugar-high": "^0.6.1 || ^0.7.0 || ^0.8.0"
|
|
62
|
+
"refractor": "^5.0.0",
|
|
63
|
+
"sugar-high": "^0.6.1 || ^0.7.0 || ^0.8.0 || ^0.9.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"@types/hast": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"refractor": {
|
|
88
88
|
"optional": true
|
|
89
89
|
},
|
|
90
|
-
"
|
|
90
|
+
"@shikijs/types": {
|
|
91
91
|
"optional": true
|
|
92
92
|
},
|
|
93
93
|
"sugar-high": {
|
|
@@ -95,28 +95,29 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@antfu/ni": "^
|
|
99
|
-
"@ocavue/eslint-config": "^2.12.
|
|
98
|
+
"@antfu/ni": "^23.3.1",
|
|
99
|
+
"@ocavue/eslint-config": "^2.12.5",
|
|
100
100
|
"@types/hast": "^3.0.4",
|
|
101
101
|
"@types/node": "^20.17.5",
|
|
102
|
-
"eslint": "^9.
|
|
102
|
+
"eslint": "^9.19.0",
|
|
103
103
|
"highlight.js": "^11.11.1",
|
|
104
104
|
"jsdom": "^25.0.1",
|
|
105
105
|
"lowlight": "^3.3.0",
|
|
106
|
-
"
|
|
106
|
+
"pkg-pr-new": "^0.0.41",
|
|
107
|
+
"prettier": "^3.5.2",
|
|
107
108
|
"prosemirror-example-setup": "^1.2.3",
|
|
108
109
|
"prosemirror-model": "^1.24.1",
|
|
109
110
|
"prosemirror-schema-basic": "^1.2.3",
|
|
110
111
|
"prosemirror-state": "^1.4.3",
|
|
111
112
|
"prosemirror-transform": "^1.10.2",
|
|
112
|
-
"prosemirror-view": "^1.
|
|
113
|
-
"refractor": "^
|
|
114
|
-
"shiki": "^2.1
|
|
115
|
-
"sugar-high": "^0.
|
|
116
|
-
"tsup": "^8.
|
|
117
|
-
"typescript": "^5.7.
|
|
118
|
-
"vite": "^6.0
|
|
119
|
-
"vitest": "^
|
|
113
|
+
"prosemirror-view": "^1.38.0",
|
|
114
|
+
"refractor": "^5.0.0",
|
|
115
|
+
"shiki": "^3.2.1",
|
|
116
|
+
"sugar-high": "^0.9.3",
|
|
117
|
+
"tsup": "^8.4.0",
|
|
118
|
+
"typescript": "^5.7.3",
|
|
119
|
+
"vite": "^6.2.0",
|
|
120
|
+
"vitest": "^3.0.5"
|
|
120
121
|
},
|
|
121
122
|
"renovate": {
|
|
122
123
|
"dependencyDashboard": true,
|