@ctzhian/tiptap 1.7.4 → 1.7.5-beta.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/dist/Editor/demo.js +2 -2
- package/dist/extension/index.js +7 -7
- package/dist/extension/node/Table.d.ts +1 -1
- package/package.json +32 -31
package/dist/Editor/demo.js
CHANGED
|
@@ -11,7 +11,7 @@ var Reader = function Reader() {
|
|
|
11
11
|
editable: true,
|
|
12
12
|
exclude: ['invisibleCharacters'],
|
|
13
13
|
onSave: function onSave(editor) {
|
|
14
|
-
console.log(editor.getHTML());
|
|
14
|
+
console.log(editor.getHTML(), editor.getMarkdown());
|
|
15
15
|
editor.commands.setContent(editor.getHTML());
|
|
16
16
|
},
|
|
17
17
|
onAiWritingGetSuggestion: function () {
|
|
@@ -102,7 +102,7 @@ var Reader = function Reader() {
|
|
|
102
102
|
}
|
|
103
103
|
return onUpload;
|
|
104
104
|
}(),
|
|
105
|
-
content:
|
|
105
|
+
content: ''
|
|
106
106
|
}),
|
|
107
107
|
editor = _useTiptap.editor;
|
|
108
108
|
return /*#__PURE__*/React.createElement(EditorThemeProvider, {
|
package/dist/extension/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import Superscript from '@tiptap/extension-superscript';
|
|
|
11
11
|
import TextAlign from '@tiptap/extension-text-align';
|
|
12
12
|
import { TextStyleKit } from '@tiptap/extension-text-style';
|
|
13
13
|
import { CharacterCount, Placeholder } from '@tiptap/extensions';
|
|
14
|
+
import { Markdown } from '@tiptap/markdown';
|
|
14
15
|
import StarterKit from '@tiptap/starter-kit';
|
|
15
16
|
import { PLACEHOLDER } from "../contants/placeholder";
|
|
16
17
|
import { AiWritingExtension, SlashCommands, StructuredDiffExtension } from "./extension";
|
|
@@ -49,17 +50,16 @@ export var getExtensions = function getExtensions(_ref) {
|
|
|
49
50
|
}), CodeBlockLowlightExtension, CharacterCount.configure({
|
|
50
51
|
limit: limit !== null && limit !== void 0 ? limit : null
|
|
51
52
|
}), Subscript, Superscript, TextStyleKit, Indent.configure({
|
|
52
|
-
types: [
|
|
53
|
-
// 常见块级与项目中定义的节点
|
|
54
|
-
'paragraph', 'heading', 'blockquote', 'alert', 'codeBlock', 'horizontalRule', 'orderedList', 'bulletList', 'taskList', 'taskItem', 'listItem', 'details', 'detailsContent', 'detailsSummary', 'table', 'image', 'video', 'audio', 'iframe', 'blockAttachment', 'inlineAttachment', 'blockLink',
|
|
55
|
-
// 公式
|
|
56
|
-
'blockMath', 'inlineMath'
|
|
57
|
-
// 扩展里还有:youtube 等,如需也可开启
|
|
58
|
-
],
|
|
53
|
+
types: ['paragraph', 'heading', 'blockquote', 'alert', 'codeBlock', 'horizontalRule', 'orderedList', 'bulletList', 'taskList', 'taskItem', 'listItem', 'details', 'detailsContent', 'detailsSummary', 'table', 'image', 'video', 'audio', 'iframe', 'blockAttachment', 'inlineAttachment', 'blockLink', 'blockMath', 'inlineMath'],
|
|
59
54
|
maxLevel: 8,
|
|
60
55
|
indentPx: 32
|
|
61
56
|
}), CodeExtension, AlertExtension, Highlight.configure({
|
|
62
57
|
multicolor: true
|
|
58
|
+
}), Markdown.configure({
|
|
59
|
+
indentation: {
|
|
60
|
+
style: 'space',
|
|
61
|
+
size: 2
|
|
62
|
+
}
|
|
63
63
|
}), Placeholder.configure({
|
|
64
64
|
emptyNodeClass: 'custom-placeholder-node',
|
|
65
65
|
showOnlyWhenEditable: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
export declare const TableExtension: ({ editable }: {
|
|
3
3
|
editable: boolean;
|
|
4
|
-
}) => (
|
|
4
|
+
}) => (import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any> | Extension<any, any>)[];
|
|
5
5
|
export default TableExtension;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctzhian/tiptap",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5-beta.0",
|
|
4
4
|
"description": "基于 Tiptap 二次开发的编辑器组件",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -81,36 +81,37 @@
|
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@floating-ui/dom": "^1.7.2",
|
|
84
|
-
"@tiptap/core": "3.
|
|
85
|
-
"@tiptap/extension-bubble-menu": "3.
|
|
86
|
-
"@tiptap/extension-code": "3.
|
|
87
|
-
"@tiptap/extension-code-block-lowlight": "3.
|
|
88
|
-
"@tiptap/extension-details": "3.
|
|
89
|
-
"@tiptap/extension-drag-handle-react": "3.
|
|
90
|
-
"@tiptap/extension-emoji": "3.
|
|
91
|
-
"@tiptap/extension-file-handler": "3.
|
|
92
|
-
"@tiptap/extension-highlight": "3.
|
|
93
|
-
"@tiptap/extension-image": "3.
|
|
94
|
-
"@tiptap/extension-invisible-characters": "3.
|
|
95
|
-
"@tiptap/extension-link": "3.
|
|
96
|
-
"@tiptap/extension-list": "3.
|
|
97
|
-
"@tiptap/extension-mathematics": "3.
|
|
98
|
-
"@tiptap/extension-mention": "3.
|
|
99
|
-
"@tiptap/extension-subscript": "3.
|
|
100
|
-
"@tiptap/extension-superscript": "3.
|
|
101
|
-
"@tiptap/extension-table": "3.
|
|
102
|
-
"@tiptap/extension-table-of-contents": "3.
|
|
103
|
-
"@tiptap/extension-text-align": "3.
|
|
104
|
-
"@tiptap/extension-text-style": "3.
|
|
105
|
-
"@tiptap/extension-unique-id": "3.
|
|
106
|
-
"@tiptap/extension-youtube": "3.
|
|
107
|
-
"@tiptap/extensions": "3.
|
|
108
|
-
"@tiptap/html": "3.
|
|
109
|
-
"@tiptap/
|
|
110
|
-
"@tiptap/
|
|
111
|
-
"@tiptap/
|
|
112
|
-
"@tiptap/
|
|
113
|
-
"@tiptap/
|
|
84
|
+
"@tiptap/core": "3.7.1",
|
|
85
|
+
"@tiptap/extension-bubble-menu": "3.7.1",
|
|
86
|
+
"@tiptap/extension-code": "3.7.1",
|
|
87
|
+
"@tiptap/extension-code-block-lowlight": "3.7.1",
|
|
88
|
+
"@tiptap/extension-details": "3.7.1",
|
|
89
|
+
"@tiptap/extension-drag-handle-react": "3.7.1",
|
|
90
|
+
"@tiptap/extension-emoji": "3.7.1",
|
|
91
|
+
"@tiptap/extension-file-handler": "3.7.1",
|
|
92
|
+
"@tiptap/extension-highlight": "3.7.1",
|
|
93
|
+
"@tiptap/extension-image": "3.7.1",
|
|
94
|
+
"@tiptap/extension-invisible-characters": "3.7.1",
|
|
95
|
+
"@tiptap/extension-link": "3.7.1",
|
|
96
|
+
"@tiptap/extension-list": "3.7.1",
|
|
97
|
+
"@tiptap/extension-mathematics": "3.7.1",
|
|
98
|
+
"@tiptap/extension-mention": "3.7.1",
|
|
99
|
+
"@tiptap/extension-subscript": "3.7.1",
|
|
100
|
+
"@tiptap/extension-superscript": "3.7.1",
|
|
101
|
+
"@tiptap/extension-table": "3.7.1",
|
|
102
|
+
"@tiptap/extension-table-of-contents": "3.7.1",
|
|
103
|
+
"@tiptap/extension-text-align": "3.7.1",
|
|
104
|
+
"@tiptap/extension-text-style": "3.7.1",
|
|
105
|
+
"@tiptap/extension-unique-id": "3.7.1",
|
|
106
|
+
"@tiptap/extension-youtube": "3.7.1",
|
|
107
|
+
"@tiptap/extensions": "3.7.1",
|
|
108
|
+
"@tiptap/html": "3.7.1",
|
|
109
|
+
"@tiptap/markdown": "^3.7.2",
|
|
110
|
+
"@tiptap/pm": "3.7.1",
|
|
111
|
+
"@tiptap/react": "3.7.1",
|
|
112
|
+
"@tiptap/starter-kit": "3.7.1",
|
|
113
|
+
"@tiptap/static-renderer": "3.7.1",
|
|
114
|
+
"@tiptap/suggestion": "3.7.1",
|
|
114
115
|
"core-js": "^3.46.0",
|
|
115
116
|
"diff-match-patch": "^1.0.5",
|
|
116
117
|
"highlight.js": "^11.11.1",
|