@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.
@@ -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: "<div class=\"tableWrapper\"><table style=\"min-width: 423px;\"><colgroup><col style=\"width: 100px;\"><col style=\"width: 123px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"100\"><p>fasdfklj</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"123\"><p>fjkldsajflk</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>jlfjdlskajfl</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>kflasdjflk</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"100\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>flfjladsjflkf</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"123\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>lfjlaskdjfkl</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>lkasdjfkl</p></td><td colspan=\"1\" rowspan=\"2\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>jklfjalsdfjl</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"100\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>fflkasdlfj</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"123\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>lfjldksajfl</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>flajdslfkj</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"100\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>lfjadsjflds</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"123\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>dfjlajflsk</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>lkfdjajkdls</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>flasjflk</p></td></tr></tbody></table></div><p></p>"
105
+ content: ''
106
106
  }),
107
107
  editor = _useTiptap.editor;
108
108
  return /*#__PURE__*/React.createElement(EditorThemeProvider, {
@@ -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
- }) => (Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>)[];
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.4",
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.5.3",
85
- "@tiptap/extension-bubble-menu": "3.5.3",
86
- "@tiptap/extension-code": "3.5.3",
87
- "@tiptap/extension-code-block-lowlight": "3.5.3",
88
- "@tiptap/extension-details": "3.5.3",
89
- "@tiptap/extension-drag-handle-react": "3.5.3",
90
- "@tiptap/extension-emoji": "3.5.3",
91
- "@tiptap/extension-file-handler": "3.5.3",
92
- "@tiptap/extension-highlight": "3.5.3",
93
- "@tiptap/extension-image": "3.5.3",
94
- "@tiptap/extension-invisible-characters": "3.5.3",
95
- "@tiptap/extension-link": "3.5.3",
96
- "@tiptap/extension-list": "3.5.3",
97
- "@tiptap/extension-mathematics": "3.5.3",
98
- "@tiptap/extension-mention": "3.5.3",
99
- "@tiptap/extension-subscript": "3.5.3",
100
- "@tiptap/extension-superscript": "3.5.3",
101
- "@tiptap/extension-table": "3.5.3",
102
- "@tiptap/extension-table-of-contents": "3.5.3",
103
- "@tiptap/extension-text-align": "3.5.3",
104
- "@tiptap/extension-text-style": "3.5.3",
105
- "@tiptap/extension-unique-id": "3.5.3",
106
- "@tiptap/extension-youtube": "3.5.3",
107
- "@tiptap/extensions": "3.5.3",
108
- "@tiptap/html": "3.5.3",
109
- "@tiptap/pm": "3.5.3",
110
- "@tiptap/react": "3.5.3",
111
- "@tiptap/starter-kit": "3.5.3",
112
- "@tiptap/static-renderer": "3.5.3",
113
- "@tiptap/suggestion": "3.5.3",
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",