@ctzhian/tiptap 2.5.1 → 2.5.2
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/EditorMarkdown/index.js +7 -3
- package/dist/component/CustomBubbleMenu/index.js +2 -67
- package/dist/component/Icons/{flip-horizontal-2-line-icon.d.ts → flip-grid-icon.d.ts} +1 -1
- package/dist/component/Icons/{flip-horizontal-2-line-icon.js → flip-grid-icon.js} +3 -3
- package/dist/component/Icons/index.d.ts +1 -1
- package/dist/component/Icons/index.js +1 -1
- package/dist/component/Toolbar/EditorInsert/index.js +63 -56
- package/dist/extension/node/Alert.js +2 -3
- package/dist/extension/node/FileHandler.d.ts +1 -1
- package/dist/extension/node/Table.d.ts +1 -1
- package/package.json +15 -16
|
@@ -375,10 +375,14 @@ var EditorMarkdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
375
375
|
var textarea = (_aceEditor$textInput = aceEditor.textInput) === null || _aceEditor$textInput === void 0 ? void 0 : _aceEditor$textInput.getElement();
|
|
376
376
|
if (!textarea) return;
|
|
377
377
|
var handleCompositionStart = function handleCompositionStart() {
|
|
378
|
-
|
|
378
|
+
setTimeout(function () {
|
|
379
|
+
return setIsComposing(true);
|
|
380
|
+
}, 0);
|
|
379
381
|
};
|
|
380
382
|
var handleCompositionEnd = function handleCompositionEnd() {
|
|
381
|
-
|
|
383
|
+
setTimeout(function () {
|
|
384
|
+
return setIsComposing(false);
|
|
385
|
+
}, 0);
|
|
382
386
|
};
|
|
383
387
|
textarea.addEventListener('compositionstart', handleCompositionStart);
|
|
384
388
|
textarea.addEventListener('compositionend', handleCompositionEnd);
|
|
@@ -386,7 +390,7 @@ var EditorMarkdown = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
386
390
|
textarea.removeEventListener('compositionstart', handleCompositionStart);
|
|
387
391
|
textarea.removeEventListener('compositionend', handleCompositionEnd);
|
|
388
392
|
};
|
|
389
|
-
}, [
|
|
393
|
+
}, []);
|
|
390
394
|
return /*#__PURE__*/React.createElement(Box, {
|
|
391
395
|
sx: _objectSpread({
|
|
392
396
|
position: 'relative',
|
|
@@ -3,35 +3,11 @@ import { hasMarksInSelection } from "../../util";
|
|
|
3
3
|
import { Divider, Paper, Stack } from '@mui/material';
|
|
4
4
|
import { useEditorState } from '@tiptap/react';
|
|
5
5
|
import { BubbleMenu } from '@tiptap/react/menus';
|
|
6
|
-
import React
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import { ToolbarItem } from "../Toolbar";
|
|
8
8
|
var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
9
9
|
var editor = _ref.editor,
|
|
10
10
|
more = _ref.more;
|
|
11
|
-
// 跟踪编辑器是否已经完全初始化
|
|
12
|
-
var isInitializedRef = useRef(false);
|
|
13
|
-
var initTimeoutRef = useRef(null);
|
|
14
|
-
|
|
15
|
-
// 当编辑器挂载后,延迟一段时间标记为已初始化
|
|
16
|
-
useEffect(function () {
|
|
17
|
-
if (editor && editor.view) {
|
|
18
|
-
// 清除之前的定时器
|
|
19
|
-
if (initTimeoutRef.current) {
|
|
20
|
-
clearTimeout(initTimeoutRef.current);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// 延迟标记为已初始化,确保编辑器状态稳定
|
|
24
|
-
initTimeoutRef.current = setTimeout(function () {
|
|
25
|
-
isInitializedRef.current = true;
|
|
26
|
-
}, 100);
|
|
27
|
-
}
|
|
28
|
-
return function () {
|
|
29
|
-
if (initTimeoutRef.current) {
|
|
30
|
-
clearTimeout(initTimeoutRef.current);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}, [editor]);
|
|
34
|
-
|
|
35
11
|
// const theme = useTheme()
|
|
36
12
|
|
|
37
13
|
// const THEME_TEXT_COLOR = [
|
|
@@ -99,49 +75,8 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
99
75
|
},
|
|
100
76
|
shouldShow: function shouldShow(_ref2) {
|
|
101
77
|
var editor = _ref2.editor;
|
|
102
|
-
// 确保编辑器已初始化
|
|
103
|
-
if (!editor || !editor.state || !editor.view) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// 如果编辑器还没有完全初始化,不显示
|
|
108
|
-
if (!isInitializedRef.current) {
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
var _editor$state = editor.state,
|
|
112
|
-
selection = _editor$state.selection,
|
|
113
|
-
doc = _editor$state.doc;
|
|
114
|
-
|
|
115
|
-
// 如果没有选中文本(选择为空或起始和结束位置相同),不显示
|
|
116
|
-
if (selection.empty || selection.from === selection.to) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// 检查选中的文本内容是否真的有意义(不是空白字符)
|
|
121
|
-
// 使用 textBetween 获取选中范围内的文本,排除空白字符
|
|
122
|
-
var selectedText = doc.textBetween(selection.from, selection.to, ' ', ' ');
|
|
123
|
-
if (!selectedText || selectedText.trim().length === 0) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// 如果文档为空(只有默认段落且无内容),不显示
|
|
128
|
-
if (editor.isEmpty) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// 表格多选单元格时禁止弹出气泡菜单
|
|
133
|
-
// if (editor.state.selection.constructor.name === '_CellSelection') {
|
|
134
|
-
// const cellSelection = editor.state.selection as any;
|
|
135
|
-
// if (cellSelection.ranges.length > 1) {
|
|
136
|
-
// return false
|
|
137
|
-
// }
|
|
138
|
-
// if (cellSelection.$anchorCell && cellSelection.$headCell) {
|
|
139
|
-
// return cellSelection.$anchorCell.pos !== cellSelection.$headCell.pos;
|
|
140
|
-
// }
|
|
141
|
-
// }
|
|
142
|
-
|
|
143
78
|
// 在某些特定节点类型时不显示
|
|
144
|
-
if (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')) {
|
|
79
|
+
if (editor.state.selection.empty || editor.isEmpty || 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')) {
|
|
145
80
|
return false;
|
|
146
81
|
}
|
|
147
82
|
return true;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
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
2
|
import { SvgIcon } from "@mui/material";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
export var
|
|
4
|
+
export var FlipGridIcon = function FlipGridIcon(props) {
|
|
5
5
|
return /*#__PURE__*/React.createElement(SvgIcon, _extends({
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
version: "1.1",
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg"
|
|
9
9
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
-
d: "
|
|
10
|
+
d: "M7 6V18H4L4 6H7ZM4 4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H7C8.10457 20 9 19.1046 9 18V6C9 4.89543 8.10457 4 7 4H4ZM11 2V22H13V2H11ZM20 6V18H17V6H20ZM17 4C15.8954 4 15 4.89543 15 6V18C15 19.1046 15.8954 20 17 20H20C21.1046 20 22 19.1046 22 18V6C22 4.89543 21.1046 4 20 4H17Z"
|
|
11
11
|
}));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
FlipGridIcon.displayName = 'icon-flip-grid';
|
|
@@ -54,7 +54,7 @@ export { ExportLineIcon } from './export-line-icon';
|
|
|
54
54
|
export { FileCopyLineIcon } from './file-copy-line-icon';
|
|
55
55
|
export { FileIcon } from './file-icon';
|
|
56
56
|
export { FileUploadLineIcon } from './file-upload-line-icon';
|
|
57
|
-
export {
|
|
57
|
+
export { FlipGridIcon } from './flip-grid-icon';
|
|
58
58
|
export { FlowChartIcon } from './flow-chart-icon';
|
|
59
59
|
export { Folder2LineIcon } from './folder-2-line-icon';
|
|
60
60
|
export { FontColorIcon } from './font-color-icon';
|
|
@@ -57,7 +57,7 @@ export { ExportLineIcon } from "./export-line-icon";
|
|
|
57
57
|
export { FileCopyLineIcon } from "./file-copy-line-icon";
|
|
58
58
|
export { FileIcon } from "./file-icon";
|
|
59
59
|
export { FileUploadLineIcon } from "./file-upload-line-icon";
|
|
60
|
-
export {
|
|
60
|
+
export { FlipGridIcon } from "./flip-grid-icon";
|
|
61
61
|
export { FlowChartIcon } from "./flow-chart-icon";
|
|
62
62
|
export { Folder2LineIcon } from "./folder-2-line-icon";
|
|
63
63
|
export { FontColorIcon } from "./font-color-icon";
|
|
@@ -145,43 +145,6 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
145
145
|
size: '0'
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
}, {
|
|
149
|
-
label: '流程图',
|
|
150
|
-
key: 'flow',
|
|
151
|
-
icon: /*#__PURE__*/React.createElement(FlowChartIcon, {
|
|
152
|
-
sx: {
|
|
153
|
-
fontSize: '1rem'
|
|
154
|
-
}
|
|
155
|
-
}),
|
|
156
|
-
onClick: function onClick() {
|
|
157
|
-
return editor.commands.setFlow({});
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
label: '表格',
|
|
161
|
-
key: 'table',
|
|
162
|
-
icon: /*#__PURE__*/React.createElement(Table2Icon, {
|
|
163
|
-
sx: {
|
|
164
|
-
fontSize: '1rem'
|
|
165
|
-
}
|
|
166
|
-
}),
|
|
167
|
-
extra: /*#__PURE__*/React.createElement(Typography, {
|
|
168
|
-
sx: {
|
|
169
|
-
fontSize: '12px',
|
|
170
|
-
color: 'text.disabled'
|
|
171
|
-
}
|
|
172
|
-
}, getShortcutKeyText(['ctrl', '9'], '+')),
|
|
173
|
-
children: [{
|
|
174
|
-
key: 'table-size-picker',
|
|
175
|
-
customLabel: /*#__PURE__*/React.createElement(TableSizePicker, {
|
|
176
|
-
onConfirm: function onConfirm(cols, rows) {
|
|
177
|
-
editor.commands.insertTable({
|
|
178
|
-
rows: rows,
|
|
179
|
-
cols: cols,
|
|
180
|
-
withHeaderRow: false
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
})
|
|
184
|
-
}]
|
|
185
148
|
}, {
|
|
186
149
|
customLabel: /*#__PURE__*/React.createElement(Typography, {
|
|
187
150
|
sx: {
|
|
@@ -192,17 +155,6 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
192
155
|
}
|
|
193
156
|
}, "\u6A21\u5757"),
|
|
194
157
|
key: 'style'
|
|
195
|
-
}, {
|
|
196
|
-
label: '分割线',
|
|
197
|
-
key: 'separator',
|
|
198
|
-
icon: /*#__PURE__*/React.createElement(SeparatorIcon, {
|
|
199
|
-
sx: {
|
|
200
|
-
fontSize: '1rem'
|
|
201
|
-
}
|
|
202
|
-
}),
|
|
203
|
-
onClick: function onClick() {
|
|
204
|
-
return editor.chain().focus().setHorizontalRule().run();
|
|
205
|
-
}
|
|
206
158
|
}, {
|
|
207
159
|
label: '引用',
|
|
208
160
|
key: 'blockquote',
|
|
@@ -220,10 +172,17 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
220
172
|
onClick: function onClick() {
|
|
221
173
|
return editor.chain().focus().toggleBlockquote().run();
|
|
222
174
|
}
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
175
|
+
},
|
|
176
|
+
// {
|
|
177
|
+
// label: '分栏',
|
|
178
|
+
// key: 'flipGrid',
|
|
179
|
+
// icon: <FlipGridIcon sx={{ fontSize: '1rem' }} />,
|
|
180
|
+
// onClick: () => editor.chain().focus().setFlipGrid().run(),
|
|
181
|
+
// },
|
|
182
|
+
{
|
|
183
|
+
label: '表格',
|
|
184
|
+
key: 'table',
|
|
185
|
+
icon: /*#__PURE__*/React.createElement(Table2Icon, {
|
|
227
186
|
sx: {
|
|
228
187
|
fontSize: '1rem'
|
|
229
188
|
}
|
|
@@ -233,10 +192,19 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
233
192
|
fontSize: '12px',
|
|
234
193
|
color: 'text.disabled'
|
|
235
194
|
}
|
|
236
|
-
}, getShortcutKeyText(['ctrl', '
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
195
|
+
}, getShortcutKeyText(['ctrl', '9'], '+')),
|
|
196
|
+
children: [{
|
|
197
|
+
key: 'table-size-picker',
|
|
198
|
+
customLabel: /*#__PURE__*/React.createElement(TableSizePicker, {
|
|
199
|
+
onConfirm: function onConfirm(cols, rows) {
|
|
200
|
+
editor.commands.insertTable({
|
|
201
|
+
rows: rows,
|
|
202
|
+
cols: cols,
|
|
203
|
+
withHeaderRow: false
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
}]
|
|
240
208
|
}, {
|
|
241
209
|
label: '警告块',
|
|
242
210
|
key: 'highlight',
|
|
@@ -321,6 +289,34 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
321
289
|
}).run();
|
|
322
290
|
}
|
|
323
291
|
}]
|
|
292
|
+
}, {
|
|
293
|
+
label: '折叠面板',
|
|
294
|
+
key: 'details',
|
|
295
|
+
icon: /*#__PURE__*/React.createElement(MenuFold2FillIcon, {
|
|
296
|
+
sx: {
|
|
297
|
+
fontSize: '1rem'
|
|
298
|
+
}
|
|
299
|
+
}),
|
|
300
|
+
extra: /*#__PURE__*/React.createElement(Typography, {
|
|
301
|
+
sx: {
|
|
302
|
+
fontSize: '12px',
|
|
303
|
+
color: 'text.disabled'
|
|
304
|
+
}
|
|
305
|
+
}, getShortcutKeyText(['ctrl', '8'], '+')),
|
|
306
|
+
onClick: function onClick() {
|
|
307
|
+
return editor.chain().focus().setDetails().run();
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
label: '分割线',
|
|
311
|
+
key: 'separator',
|
|
312
|
+
icon: /*#__PURE__*/React.createElement(SeparatorIcon, {
|
|
313
|
+
sx: {
|
|
314
|
+
fontSize: '1rem'
|
|
315
|
+
}
|
|
316
|
+
}),
|
|
317
|
+
onClick: function onClick() {
|
|
318
|
+
return editor.chain().focus().setHorizontalRule().run();
|
|
319
|
+
}
|
|
324
320
|
}, {
|
|
325
321
|
customLabel: /*#__PURE__*/React.createElement(Typography, {
|
|
326
322
|
sx: {
|
|
@@ -331,6 +327,17 @@ var EditorInsert = function EditorInsert(_ref) {
|
|
|
331
327
|
}
|
|
332
328
|
}, "\u4E13\u4E1A"),
|
|
333
329
|
key: 'programmer'
|
|
330
|
+
}, {
|
|
331
|
+
label: '流程图',
|
|
332
|
+
key: 'flow',
|
|
333
|
+
icon: /*#__PURE__*/React.createElement(FlowChartIcon, {
|
|
334
|
+
sx: {
|
|
335
|
+
fontSize: '1rem'
|
|
336
|
+
}
|
|
337
|
+
}),
|
|
338
|
+
onClick: function onClick() {
|
|
339
|
+
return editor.commands.setFlow({});
|
|
340
|
+
}
|
|
334
341
|
}, {
|
|
335
342
|
label: '代码',
|
|
336
343
|
key: 'code',
|
|
@@ -6,6 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { createBlockMarkdownSpec, mergeAttributes, Node } from '@tiptap/core';
|
|
8
8
|
import { ReactNodeViewRenderer } from '@tiptap/react';
|
|
9
|
+
import { v4 as uuid } from 'uuid';
|
|
9
10
|
import AlertView from "../component/Alert";
|
|
10
11
|
export var AlertExtension = Node.create(_objectSpread(_objectSpread({
|
|
11
12
|
name: 'alert',
|
|
@@ -76,7 +77,7 @@ export var AlertExtension = Node.create(_objectSpread(_objectSpread({
|
|
|
76
77
|
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
77
78
|
return function (_ref2) {
|
|
78
79
|
var commands = _ref2.commands;
|
|
79
|
-
var id = "alert_".concat(
|
|
80
|
+
var id = "alert_".concat(uuid());
|
|
80
81
|
var variant = attrs.variant || 'default';
|
|
81
82
|
var type = attrs.type || 'icon';
|
|
82
83
|
return commands.wrapIn(_this.name, {
|
|
@@ -106,11 +107,9 @@ export var AlertExtension = Node.create(_objectSpread(_objectSpread({
|
|
|
106
107
|
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
107
108
|
return function (_ref5) {
|
|
108
109
|
var commands = _ref5.commands;
|
|
109
|
-
var id = "alert_".concat(Math.random().toString(36).slice(2));
|
|
110
110
|
var variant = attrs.variant || 'default';
|
|
111
111
|
var type = attrs.type || 'icon';
|
|
112
112
|
return commands.toggleWrap(_this.name, {
|
|
113
|
-
id: id,
|
|
114
113
|
variant: variant,
|
|
115
114
|
type: type
|
|
116
115
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UploadFunction } from "../../type";
|
|
2
2
|
export declare const FileHandlerExtension: (props: {
|
|
3
3
|
onUpload?: UploadFunction;
|
|
4
|
-
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "
|
|
4
|
+
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "key" | "editor">, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
export declare const TableExtension: ({ editable }: {
|
|
3
3
|
editable: boolean;
|
|
4
|
-
}) => (import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>
|
|
4
|
+
}) => (Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>)[];
|
|
5
5
|
export default TableExtension;
|
package/package.json
CHANGED
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctzhian/tiptap",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "基于 Tiptap 二次开发的编辑器组件",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"start": "npm run dev",
|
|
10
|
-
"dev": "dumi dev",
|
|
11
|
-
"build": "rm -rf dist && father build",
|
|
12
|
-
"build:watch": "father dev",
|
|
13
|
-
"docs:build": "dumi build",
|
|
14
|
-
"docs:preview": "dumi preview",
|
|
15
|
-
"prepare": "husky install && dumi setup",
|
|
16
|
-
"doctor": "father doctor",
|
|
17
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
18
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
19
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
20
|
-
"pre": "pnpm build && pnpm link --global"
|
|
21
|
-
},
|
|
22
8
|
"authors": [
|
|
23
9
|
"ky.kyy@qq.com"
|
|
24
10
|
],
|
|
@@ -142,5 +128,18 @@
|
|
|
142
128
|
"react-image-crop": "^11.0.10",
|
|
143
129
|
"react-photo-view": "^1.2.7",
|
|
144
130
|
"uuid": "^11.1.0"
|
|
131
|
+
},
|
|
132
|
+
"scripts": {
|
|
133
|
+
"start": "npm run dev",
|
|
134
|
+
"dev": "dumi dev",
|
|
135
|
+
"build": "rm -rf dist && father build",
|
|
136
|
+
"build:watch": "father dev",
|
|
137
|
+
"docs:build": "dumi build",
|
|
138
|
+
"docs:preview": "dumi preview",
|
|
139
|
+
"doctor": "father doctor",
|
|
140
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
141
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
142
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
143
|
+
"pre": "pnpm build && pnpm link --global"
|
|
145
144
|
}
|
|
146
|
-
}
|
|
145
|
+
}
|