@ctzhian/tiptap 1.13.8 → 2.0.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 +3 -5
- package/dist/Editor/index.js +17 -0
- package/dist/component/CustomBubbleMenu/index.js +1 -1
- package/dist/component/CustomDragHandle/index.js +3 -59
- package/dist/component/Icons/delete-back-2-line-icon.d.ts +6 -0
- package/dist/component/Icons/delete-back-2-line-icon.js +13 -0
- package/dist/component/Menu/index.js +5 -1
- package/dist/contants/enums.d.ts +9 -0
- package/dist/contants/enums.js +61 -1
- package/dist/extension/component/Link/Insert.js +1 -1
- package/dist/extension/component/TableCellHandleMenu/index.d.ts +9 -0
- package/dist/extension/component/TableCellHandleMenu/index.js +443 -0
- package/dist/extension/component/TableExtendButton/TableExtendButton.css +30 -0
- package/dist/extension/component/TableExtendButton/index.d.ts +23 -0
- package/dist/extension/component/TableExtendButton/index.js +201 -0
- package/dist/extension/component/TableExtendButton/use-table-extend-row-column.d.ts +15 -0
- package/dist/extension/component/TableExtendButton/use-table-extend-row-column.js +87 -0
- package/dist/extension/component/TableHandle/TableHandleMenu.css +36 -0
- package/dist/extension/component/TableHandle/TableHandleMenu.d.ts +17 -0
- package/dist/extension/component/TableHandle/TableHandleMenu.js +685 -0
- package/dist/extension/component/TableHandle/index.d.ts +28 -0
- package/dist/extension/component/TableHandle/index.js +93 -0
- package/dist/extension/component/TableHandle/use-table-handle-positioning.d.ts +40 -0
- package/dist/extension/component/TableHandle/use-table-handle-positioning.js +193 -0
- package/dist/extension/component/TableHandle/use-table-handle-state.d.ts +22 -0
- package/dist/extension/component/TableHandle/use-table-handle-state.js +45 -0
- package/dist/extension/component/TableSelectionOverlay/index.d.ts +16 -0
- package/dist/extension/component/TableSelectionOverlay/index.js +460 -0
- package/dist/extension/node/FileHandler.d.ts +1 -1
- package/dist/extension/node/Link/index.js +4 -4
- package/dist/extension/node/Table.js +226 -43
- package/dist/extension/node/TableHandler/create-image.d.ts +9 -0
- package/dist/extension/node/TableHandler/create-image.js +235 -0
- package/dist/extension/node/TableHandler/index.d.ts +15 -0
- package/dist/extension/node/TableHandler/index.js +33 -0
- package/dist/extension/node/TableHandler/plugin.d.ts +49 -0
- package/dist/extension/node/TableHandler/plugin.js +1030 -0
- package/dist/index.css +29 -10
- package/dist/type/index.d.ts +2 -0
- package/dist/util/table-utils.d.ts +161 -0
- package/dist/util/table-utils.js +605 -0
- package/package.json +34 -33
- package/dist/extension/component/Table/ContextMenu.d.ts +0 -11
- package/dist/extension/component/Table/ContextMenu.js +0 -186
- package/dist/extension/component/Table/TableContextMenuPlugin.d.ts +0 -9
- package/dist/extension/component/Table/TableContextMenuPlugin.js +0 -336
- package/dist/extension/component/Table/index.d.ts +0 -2
- package/dist/extension/component/Table/index.js +0 -2
package/dist/Editor/demo.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Editor, EditorThemeProvider, EditorToolbar, useTiptap } from "./..";
|
|
|
6
6
|
import { Box } from '@mui/material';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import "../index.css";
|
|
9
|
-
var defaultContent = "";
|
|
9
|
+
var defaultContent = "<h6 id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\" data-toc-id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\"><span data-name=\"watch\" data-type=\"emoji\">\u231A</span> \u8868\u683C\u64CD\u4F5C</h6><div class=\"tableWrapper\"><table style=\"min-width: 400px;\"><colgroup><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>1</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>2</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>3</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\"><p>4</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>5</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>6</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>7</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>8</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>9</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>10</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>11</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>12</p></td></tr></tbody></table></div><p></p>";
|
|
10
10
|
var Reader = function Reader() {
|
|
11
11
|
var handleTocUpdate = function handleTocUpdate(toc) {
|
|
12
12
|
console.log('toc', toc);
|
|
@@ -14,6 +14,7 @@ var Reader = function Reader() {
|
|
|
14
14
|
var _useTiptap = useTiptap({
|
|
15
15
|
editable: true,
|
|
16
16
|
exclude: ['invisibleCharacters'],
|
|
17
|
+
contentType: 'markdown',
|
|
17
18
|
onError: function onError(error) {
|
|
18
19
|
alert(error.message);
|
|
19
20
|
},
|
|
@@ -66,11 +67,8 @@ var Reader = function Reader() {
|
|
|
66
67
|
return onValidateUrl;
|
|
67
68
|
}(),
|
|
68
69
|
onSave: function onSave(editor) {
|
|
69
|
-
var value = editor.
|
|
70
|
+
var value = editor.getMarkdown();
|
|
70
71
|
console.log(value);
|
|
71
|
-
editor.chain().focus().setContent(value, {
|
|
72
|
-
contentType: 'html'
|
|
73
|
-
}).run();
|
|
74
72
|
},
|
|
75
73
|
onAiWritingGetSuggestion: function () {
|
|
76
74
|
var _onAiWritingGetSuggestion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref) {
|
package/dist/Editor/index.js
CHANGED
|
@@ -4,6 +4,10 @@ import React from 'react';
|
|
|
4
4
|
import { PhotoProvider } from 'react-photo-view';
|
|
5
5
|
import CustomBubbleMenu from "../component/CustomBubbleMenu";
|
|
6
6
|
import CustomDragHandle from "../component/CustomDragHandle";
|
|
7
|
+
import { TableCellHandleMenu } from "../extension/component/TableCellHandleMenu";
|
|
8
|
+
import { TableExtendRowColumnButtons } from "../extension/component/TableExtendButton";
|
|
9
|
+
import { TableHandle } from "../extension/component/TableHandle";
|
|
10
|
+
import { TableSelectionOverlay } from "../extension/component/TableSelectionOverlay";
|
|
7
11
|
|
|
8
12
|
// fix: https://github.com/ueberdosis/tiptap/issues/6785
|
|
9
13
|
|
|
@@ -63,6 +67,19 @@ var Editor = function Editor(_ref) {
|
|
|
63
67
|
onTip: onTip
|
|
64
68
|
}), /*#__PURE__*/React.createElement(EditorContent, {
|
|
65
69
|
editor: editor
|
|
70
|
+
}), /*#__PURE__*/React.createElement(TableHandle, {
|
|
71
|
+
editor: editor
|
|
72
|
+
}), /*#__PURE__*/React.createElement(TableExtendRowColumnButtons, {
|
|
73
|
+
editor: editor
|
|
74
|
+
}), /*#__PURE__*/React.createElement(TableSelectionOverlay, {
|
|
75
|
+
editor: editor,
|
|
76
|
+
showResizeHandles: true,
|
|
77
|
+
cellMenu: function cellMenu(props) {
|
|
78
|
+
return /*#__PURE__*/React.createElement(TableCellHandleMenu, {
|
|
79
|
+
editor: props.editor,
|
|
80
|
+
onResizeStart: props.onResizeStart
|
|
81
|
+
});
|
|
82
|
+
}
|
|
66
83
|
}));
|
|
67
84
|
};
|
|
68
85
|
export default Editor;
|
|
@@ -84,7 +84,7 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
84
84
|
// return cellSelection.$anchorCell.pos !== cellSelection.$headCell.pos;
|
|
85
85
|
// }
|
|
86
86
|
// }
|
|
87
|
-
if (editor.state.selection.empty || editor.isActive('image') || editor.isActive('video') || editor.isActive('audio') || editor.isActive('emoji') || editor.isActive('codeBlock') || editor.isActive('blockMath') || editor.isActive('inlineMath') || editor.isActive('blockLink') || editor.isActive('inlineLink') || editor.isActive('blockAttachment') || editor.isActive('inlineAttachment') || editor.isActive('horizontalRule') || editor.isActive('iframe') || editor.isActive('yamlFormat') || editor.isActive('flow')) {
|
|
87
|
+
if (editor.state.selection.empty || editor.isActive('image') || editor.isActive('video') || editor.isActive('audio') || editor.isActive('emoji') || editor.isActive('codeBlock') || editor.isActive('blockMath') || editor.isActive('inlineMath') || editor.isActive('blockLink') || editor.isActive('inlineLink') || editor.isActive('blockAttachment') || editor.isActive('inlineAttachment') || editor.isActive('horizontalRule') || editor.isActive('iframe') || editor.isActive('yamlFormat') || editor.isActive('flow') || editor.isActive('table')) {
|
|
88
88
|
return false;
|
|
89
89
|
}
|
|
90
90
|
return true;
|
|
@@ -18,7 +18,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
18
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
import { AddLineIcon, AlignBottomIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AlignTopIcon, ArrowDownSLineIcon, AttachmentLineIcon, BrushLineIcon, DeleteLineIcon, DownloadLineIcon, DraggableIcon, EraserLineIcon, FileCopyLineIcon, FontSizeIcon, H1Icon, H2Icon, H3Icon, ImageLineIcon, IndentDecreaseIcon, IndentIncreaseIcon, Information2LineIcon, ListCheck3Icon, ListOrdered2Icon, ListUnorderedIcon, MovieLineIcon, Music2LineIcon, QuoteTextIcon, Repeat2LineIcon, ScissorsCutLineIcon, TextIcon, TextWrapIcon } from "../Icons";
|
|
21
|
-
import { NODE_TYPE_LABEL, NodeTypeEnum } from "../../contants/enums";
|
|
21
|
+
import { getThemeTextBgColor, getThemeTextColor, NODE_TYPE_LABEL, NodeTypeEnum } from "../../contants/enums";
|
|
22
22
|
import { Box, Divider, Stack, Typography, useTheme } from '@mui/material';
|
|
23
23
|
import DragHandle from '@tiptap/extension-drag-handle-react';
|
|
24
24
|
import { Fragment, Slice } from '@tiptap/pm/model';
|
|
@@ -122,62 +122,6 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
122
122
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
123
123
|
hasMarks = _useState8[0],
|
|
124
124
|
setHasMarks = _useState8[1];
|
|
125
|
-
var THEME_TEXT_COLOR = [{
|
|
126
|
-
label: '默认色',
|
|
127
|
-
value: theme.palette.text.primary
|
|
128
|
-
}, {
|
|
129
|
-
label: '主题色',
|
|
130
|
-
value: theme.palette.primary.main
|
|
131
|
-
}, {
|
|
132
|
-
label: '成功色',
|
|
133
|
-
value: theme.palette.success.main
|
|
134
|
-
}, {
|
|
135
|
-
label: '警告色',
|
|
136
|
-
value: theme.palette.warning.main
|
|
137
|
-
}, {
|
|
138
|
-
label: '错误色',
|
|
139
|
-
value: theme.palette.error.main
|
|
140
|
-
}, {
|
|
141
|
-
label: '黑色',
|
|
142
|
-
value: theme.palette.common.black
|
|
143
|
-
}, {
|
|
144
|
-
label: '灰色',
|
|
145
|
-
value: theme.palette.text.disabled
|
|
146
|
-
}, {
|
|
147
|
-
label: '白色',
|
|
148
|
-
value: theme.palette.common.white
|
|
149
|
-
}];
|
|
150
|
-
var THEME_TEXT_BG_COLOR = [{
|
|
151
|
-
label: '默认背景',
|
|
152
|
-
value: theme.palette.background.paper
|
|
153
|
-
}, {
|
|
154
|
-
label: '灰色背景',
|
|
155
|
-
value: '#f8f8f7'
|
|
156
|
-
}, {
|
|
157
|
-
label: '棕色背景',
|
|
158
|
-
value: '#f4eeee'
|
|
159
|
-
}, {
|
|
160
|
-
label: '橙色背景',
|
|
161
|
-
value: '#fbecdd'
|
|
162
|
-
}, {
|
|
163
|
-
label: '黄色背景',
|
|
164
|
-
value: '#fef9c3'
|
|
165
|
-
}, {
|
|
166
|
-
label: '绿色背景',
|
|
167
|
-
value: '#dcfce7'
|
|
168
|
-
}, {
|
|
169
|
-
label: '蓝色背景',
|
|
170
|
-
value: '#e0f2fe'
|
|
171
|
-
}, {
|
|
172
|
-
label: '紫色背景',
|
|
173
|
-
value: '#f3e8ff'
|
|
174
|
-
}, {
|
|
175
|
-
label: '粉色背景',
|
|
176
|
-
value: '#fcf1f6'
|
|
177
|
-
}, {
|
|
178
|
-
label: '红色背景',
|
|
179
|
-
value: '#ffe4e6'
|
|
180
|
-
}];
|
|
181
125
|
var cancelNodeType = function cancelNodeType() {
|
|
182
126
|
var _current$node;
|
|
183
127
|
var type = (_current$node = current.node) === null || _current$node === void 0 ? void 0 : _current$node.type.name;
|
|
@@ -557,7 +501,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
557
501
|
}
|
|
558
502
|
}, "\u6587\u5B57\u989C\u8272"),
|
|
559
503
|
key: 'text-color'
|
|
560
|
-
}].concat(_toConsumableArray(
|
|
504
|
+
}].concat(_toConsumableArray(getThemeTextColor(theme).map(function (it) {
|
|
561
505
|
return {
|
|
562
506
|
label: it.label,
|
|
563
507
|
key: it.value,
|
|
@@ -593,7 +537,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
593
537
|
}
|
|
594
538
|
}, "\u6587\u5B57\u80CC\u666F\u989C\u8272"),
|
|
595
539
|
key: 'background-color'
|
|
596
|
-
}], _toConsumableArray(
|
|
540
|
+
}], _toConsumableArray(getThemeTextBgColor(theme).map(function (it) {
|
|
597
541
|
return {
|
|
598
542
|
label: it.label,
|
|
599
543
|
key: it.value,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import { SvgIcon } from "@mui/material";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export var DeleteBack2LineIcon = function DeleteBack2LineIcon(props) {
|
|
5
|
+
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
version: "1.1",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
d: "M6.53451 3H20.9993C21.5516 3 21.9993 3.44772 21.9993 4V20C21.9993 20.5523 21.5516 21 20.9993 21H6.53451C6.20015 21 5.88792 20.8329 5.70246 20.5547L0.369122 12.5547C0.145189 12.2188 0.145189 11.7812 0.369122 11.4453L5.70246 3.4453C5.88792 3.1671 6.20015 3 6.53451 3ZM7.06969 5L2.40302 12L7.06969 19H19.9993V5H7.06969ZM12.9993 10.5858L15.8277 7.75736L17.242 9.17157L14.4135 12L17.242 14.8284L15.8277 16.2426L12.9993 13.4142L10.1709 16.2426L8.75668 14.8284L11.5851 12L8.75668 9.17157L10.1709 7.75736L12.9993 10.5858Z"
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
DeleteBack2LineIcon.displayName = 'icon-delete-back-2-line';
|
|
@@ -38,7 +38,9 @@ var Menu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
38
38
|
horizontal: 'left'
|
|
39
39
|
}
|
|
40
40
|
} : _ref$childrenProps,
|
|
41
|
-
zIndex = _ref.zIndex
|
|
41
|
+
zIndex = _ref.zIndex,
|
|
42
|
+
onOpen = _ref.onOpen,
|
|
43
|
+
onClose = _ref.onClose;
|
|
42
44
|
var _React$useState = React.useState(null),
|
|
43
45
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
44
46
|
anchorEl = _React$useState2[0],
|
|
@@ -49,9 +51,11 @@ var Menu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
49
51
|
context.props.onClick(event);
|
|
50
52
|
}
|
|
51
53
|
setAnchorEl(event.currentTarget);
|
|
54
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
52
55
|
};
|
|
53
56
|
var handleClose = function handleClose() {
|
|
54
57
|
setAnchorEl(null);
|
|
58
|
+
onClose === null || onClose === void 0 || onClose();
|
|
55
59
|
};
|
|
56
60
|
React.useImperativeHandle(ref, function () {
|
|
57
61
|
return {
|
package/dist/contants/enums.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from "@mui/material";
|
|
1
2
|
export declare enum NodeTypeEnum {
|
|
2
3
|
Alert = "alert",
|
|
3
4
|
BlockAttachment = "blockAttachment",
|
|
@@ -30,3 +31,11 @@ export declare const NODE_TYPE_LABEL: Record<NodeTypeEnum, {
|
|
|
30
31
|
download?: boolean;
|
|
31
32
|
[key: string]: any;
|
|
32
33
|
}>;
|
|
34
|
+
export declare const getThemeTextColor: (theme: Theme) => {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[];
|
|
38
|
+
export declare const getThemeTextBgColor: (theme: Theme) => {
|
|
39
|
+
label: string;
|
|
40
|
+
value: string;
|
|
41
|
+
}[];
|
package/dist/contants/enums.js
CHANGED
|
@@ -105,4 +105,64 @@ export var NODE_TYPE_LABEL = (_NODE_TYPE_LABEL = {}, _defineProperty(_defineProp
|
|
|
105
105
|
label: '附件'
|
|
106
106
|
}), _defineProperty(_NODE_TYPE_LABEL, NodeTypeEnum.HorizontalRule, {
|
|
107
107
|
label: '分割线'
|
|
108
|
-
}));
|
|
108
|
+
}));
|
|
109
|
+
export var getThemeTextColor = function getThemeTextColor(theme) {
|
|
110
|
+
return [{
|
|
111
|
+
label: '默认色',
|
|
112
|
+
value: theme.palette.text.primary
|
|
113
|
+
}, {
|
|
114
|
+
label: '主题色',
|
|
115
|
+
value: theme.palette.primary.main
|
|
116
|
+
}, {
|
|
117
|
+
label: '成功色',
|
|
118
|
+
value: theme.palette.success.main
|
|
119
|
+
}, {
|
|
120
|
+
label: '警告色',
|
|
121
|
+
value: theme.palette.warning.main
|
|
122
|
+
}, {
|
|
123
|
+
label: '错误色',
|
|
124
|
+
value: theme.palette.error.main
|
|
125
|
+
}, {
|
|
126
|
+
label: '黑色',
|
|
127
|
+
value: theme.palette.common.black
|
|
128
|
+
}, {
|
|
129
|
+
label: '灰色',
|
|
130
|
+
value: theme.palette.text.disabled
|
|
131
|
+
}, {
|
|
132
|
+
label: '白色',
|
|
133
|
+
value: theme.palette.common.white
|
|
134
|
+
}];
|
|
135
|
+
};
|
|
136
|
+
export var getThemeTextBgColor = function getThemeTextBgColor(theme) {
|
|
137
|
+
return [{
|
|
138
|
+
label: '默认背景',
|
|
139
|
+
value: theme.palette.background.paper
|
|
140
|
+
}, {
|
|
141
|
+
label: '灰色背景',
|
|
142
|
+
value: '#f8f8f7'
|
|
143
|
+
}, {
|
|
144
|
+
label: '棕色背景',
|
|
145
|
+
value: '#f4eeee'
|
|
146
|
+
}, {
|
|
147
|
+
label: '橙色背景',
|
|
148
|
+
value: '#fbecdd'
|
|
149
|
+
}, {
|
|
150
|
+
label: '黄色背景',
|
|
151
|
+
value: '#fef9c3'
|
|
152
|
+
}, {
|
|
153
|
+
label: '绿色背景',
|
|
154
|
+
value: '#dcfce7'
|
|
155
|
+
}, {
|
|
156
|
+
label: '蓝色背景',
|
|
157
|
+
value: '#e0f2fe'
|
|
158
|
+
}, {
|
|
159
|
+
label: '紫色背景',
|
|
160
|
+
value: '#f3e8ff'
|
|
161
|
+
}, {
|
|
162
|
+
label: '粉色背景',
|
|
163
|
+
value: '#fcf1f6'
|
|
164
|
+
}, {
|
|
165
|
+
label: '红色背景',
|
|
166
|
+
value: '#ffe4e6'
|
|
167
|
+
}];
|
|
168
|
+
};
|
|
@@ -23,7 +23,7 @@ var InsertLink = function InsertLink(_ref) {
|
|
|
23
23
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
24
24
|
href = _useState4[0],
|
|
25
25
|
setHref = _useState4[1];
|
|
26
|
-
var _useState5 = useState(
|
|
26
|
+
var _useState5 = useState(attrs.type || 'icon'),
|
|
27
27
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
28
28
|
type = _useState6[0],
|
|
29
29
|
setType = _useState6[1];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface TableCellHandleMenuProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
4
|
+
editor?: Editor | null;
|
|
5
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
6
|
+
onResizeStart?: (handle: 'br') => (event: React.MouseEvent) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableCellHandleMenu: React.ForwardRefExoticComponent<TableCellHandleMenuProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export {};
|