@tiptap/extension-code-block 2.0.0-beta.213 → 2.0.0-beta.214
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/dist/index.cjs +3637 -178
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +3634 -182
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +3652 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/{index.d.ts → packages/extension-code-block/src/code-block.d.ts} +43 -46
- package/dist/packages/extension-code-block/src/index.d.ts +3 -0
- package/package.json +8 -17
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
declare const
|
|
43
|
-
declare const
|
|
44
|
-
declare const CodeBlock: Node<CodeBlockOptions, any>;
|
|
45
|
-
|
|
46
|
-
export { CodeBlock, CodeBlockOptions, backtickInputRegex, CodeBlock as default, tildeInputRegex };
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export interface CodeBlockOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Adds a prefix to language classes that are applied to code tags.
|
|
5
|
+
* Defaults to `'language-'`.
|
|
6
|
+
*/
|
|
7
|
+
languageClassPrefix: string;
|
|
8
|
+
/**
|
|
9
|
+
* Define whether the node should be exited on triple enter.
|
|
10
|
+
* Defaults to `true`.
|
|
11
|
+
*/
|
|
12
|
+
exitOnTripleEnter: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Define whether the node should be exited on arrow down if there is no node after it.
|
|
15
|
+
* Defaults to `true`.
|
|
16
|
+
*/
|
|
17
|
+
exitOnArrowDown: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Custom HTML attributes that should be added to the rendered HTML tag.
|
|
20
|
+
*/
|
|
21
|
+
HTMLAttributes: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
declare module '@tiptap/core' {
|
|
24
|
+
interface Commands<ReturnType> {
|
|
25
|
+
codeBlock: {
|
|
26
|
+
/**
|
|
27
|
+
* Set a code block
|
|
28
|
+
*/
|
|
29
|
+
setCodeBlock: (attributes?: {
|
|
30
|
+
language: string;
|
|
31
|
+
}) => ReturnType;
|
|
32
|
+
/**
|
|
33
|
+
* Toggle a code block
|
|
34
|
+
*/
|
|
35
|
+
toggleCodeBlock: (attributes?: {
|
|
36
|
+
language: string;
|
|
37
|
+
}) => ReturnType;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export declare const backtickInputRegex: RegExp;
|
|
42
|
+
export declare const tildeInputRegex: RegExp;
|
|
43
|
+
export declare const CodeBlock: Node<CodeBlockOptions, any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-code-block",
|
|
3
3
|
"description": "code block extension for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.214",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -15,14 +15,15 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
18
|
+
"types": "./dist/packages/extension-code-block/src/index.d.ts",
|
|
19
19
|
"import": "./dist/index.js",
|
|
20
20
|
"require": "./dist/index.cjs"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"main": "dist/index.cjs",
|
|
24
24
|
"module": "dist/index.js",
|
|
25
|
-
"
|
|
25
|
+
"umd": "dist/index.umd.js",
|
|
26
|
+
"types": "dist/packages/extension-code-block/src/index.d.ts",
|
|
26
27
|
"files": [
|
|
27
28
|
"src",
|
|
28
29
|
"dist"
|
|
@@ -32,8 +33,8 @@
|
|
|
32
33
|
"@tiptap/pm": "^2.0.0-beta.209"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@tiptap/core": "^2.0.0-beta.
|
|
36
|
-
"@tiptap/pm": "^2.0.0-beta.
|
|
36
|
+
"@tiptap/core": "^2.0.0-beta.214",
|
|
37
|
+
"@tiptap/pm": "^2.0.0-beta.214"
|
|
37
38
|
},
|
|
38
39
|
"repository": {
|
|
39
40
|
"type": "git",
|
|
@@ -41,17 +42,7 @@
|
|
|
41
42
|
"directory": "packages/extension-code-block"
|
|
42
43
|
},
|
|
43
44
|
"scripts": {
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"tsup": {
|
|
47
|
-
"entry": [
|
|
48
|
-
"src/index.ts"
|
|
49
|
-
],
|
|
50
|
-
"dts": true,
|
|
51
|
-
"splitting": true,
|
|
52
|
-
"format": [
|
|
53
|
-
"esm",
|
|
54
|
-
"cjs"
|
|
55
|
-
]
|
|
45
|
+
"clean": "rm -rf dist",
|
|
46
|
+
"build": "npm run clean && rollup -c"
|
|
56
47
|
}
|
|
57
48
|
}
|