@ctzhian/tiptap 1.7.4 → 1.7.5-beta.1
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 +11 -4
- package/dist/Editor/index.js +2 -2
- package/dist/EditorToolbar/index.js +17 -3
- package/dist/component/CustomBubbleMenu/index.d.ts +9 -0
- package/dist/component/CustomBubbleMenu/index.js +209 -0
- package/dist/component/CustomDragHandle/index.js +16 -6
- package/dist/component/Icons/index.d.ts +1 -0
- package/dist/component/Icons/index.js +1 -0
- package/dist/component/Icons/mark-pen-line-icon.d.ts +6 -0
- package/dist/component/Icons/mark-pen-line-icon.js +13 -0
- package/dist/component/Toolbar/EditorFontSize.js +5 -2
- package/dist/extension/component/Alert/index.js +1 -0
- package/dist/extension/index.js +14 -10
- package/dist/index.css +4 -9
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +13 -0
- package/package.json +32 -31
- package/dist/component/CustomBubbleMenu/SelectionText.d.ts +0 -9
- package/dist/component/CustomBubbleMenu/SelectionText.js +0 -301
package/dist/Editor/demo.js
CHANGED
|
@@ -3,7 +3,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import { Editor, EditorThemeProvider, EditorToolbar, useTiptap } from "./..";
|
|
6
|
-
import { Box } from '@mui/material';
|
|
6
|
+
import { Box, Button } from '@mui/material';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import "../index.css";
|
|
9
9
|
var Reader = function Reader() {
|
|
@@ -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,12 +102,19 @@ 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: "<blockquote><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></blockquote><audio src=\"/static-file/323483d4-f74a-4d2f-beb4-591dc4da2624/240c283e-7c08-47f5-a0a9-708346e887fe.mp4\" poster=\"/static-file/4f149d6f-dc3b-4b2b-9c30-4c74cfb61030/219e2d4d-cc69-4549-81a5-7787580ffcce.jpeg\" controls=\"true\"></audio><hr><h1 id=\"62b48c1c-70cd-4231-bb98-06a50856fd68\">\u8FD9\u662F\u4E00\u6BB5\u4E00\u7EA7\u6807\u9898</h1><p><span style=\"background-color: rgb(255, 204, 188);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F<code>\u6709\u6548</code>\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A 123203^<sup>1313 </sup>\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981<sub>1</sub>\u3002</span></p><p style=\"text-align: center;\"><img src=\"/static-file/1bc14ef9-751a-4ddb-88d8-ed012bc311d4/d1caf813-9d82-439c-810b-5a27f01ddde3.webp\" width=\"180\"></p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></li><li><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<code>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</code>\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p><span style=\"color: rgb(246, 78, 84);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<a target=\"_blank\" type=\"icon\" href=\"https://www.baidu.com\" title=\"\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</a>\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<strong>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801</strong>\uFF0C<span style=\"background-color: rgb(248, 187, 208);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</span>\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0<u>\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587</u>\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></li><li><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<a target=\"_blank\" type=\"text\" href=\"http://localhost:5173/doc/editor/0198ea54-7b17-753d-ba0b-ede4145645b5\" title=\"\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</a>\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<span style=\"background-color: rgb(220, 237, 200);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801</span>\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<span data-latex=\"int_{-infty}^{infty} e^{-x^2} dx = sqrt{pi}\" data-type=\"inline-math\"></span>\u3002</p></li><li><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<span style=\"background-color: rgb(220, 237, 200);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</span>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></li></ol></li><li><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185<span style=\"color: rgb(130, 221, 175);\">\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709</span>\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<s>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</s>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<span style=\"color: rgb(115, 181, 240);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></li></ol><h2 id=\"f983b68f-31d3-4997-95e9-206cccf67ca7\">\u8FD9\u4E2A\u662F\u4E00\u4E2A\u4E8C\u7EA7\u6807\u9898</h2><div data-id=\"alert_glbsomkw6q\" data-variant=\"info\" data-type=\"icon\" data-node=\"alert\"><p>\u4E8C\u7EA7\u6807\u9898\u7684\u8B66\u544A\u63D0\u793A\u6846\uFF0C\u5355\u884C\u5185\u5BB9\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></div><p><span style=\"color: rgb(63, 68, 65);\"><em>\u53D1\u751F\u7684\u53D1\u4E86\u5723\u8BDE\u8282\u9022\u5C71\u5F00\u8DEF\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</em></span></p><video class=\"video-wrapper\" src=\"/static-file/aa8fc65a-bea8-4106-a653-619e4daf5367/b9c9ca65-7412-4e09-b739-ed6f9360d8e0.mp4\" controls=\"true\" width=\"1375\"></video><h2 id=\"e3ceabee-1c6b-42dd-92a3-65a530b42cd8\">\u8FD8\u662F\u4E00\u4E2A\u4E8C\u7EA7\u6807\u9898\uFF01</h2><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p><details class=\"cq-details\" open=\"\"><summary class=\"cq-details-summary\">\u6298\u53E0\u9762\u677F\u6807\u9898\uFF1A\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</summary><div class=\"cq-details-content\" data-type=\"detailsContent\"><h6 id=\"059a31bb-de5b-42a3-a035-6afcb537c83d\">\u516D\u7EA7\u6807\u9898 H6</h6><p>\u6B64\u5904\u4E3A\u5185\u5BB9\u533A\u57DF\uFF0C\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p><p><img src=\"/static-file/9134bd1e-8568-48b0-88f9-42027a98c200/84fec93d-43d3-4891-a9a7-244a201cf738.gif\" width=\"300\"><img src=\"/static-file/634d2b46-feef-455d-92f2-07f97073db98/16467c5e-7509-4707-a97b-3bdfaf270b97.gif\" width=\"300\"><img src=\"/static-file/39e7c942-194f-4149-a735-9584d664b691/e1ec5a4a-fdc5-43ae-b13f-bf9000598690.gif\" width=\"300\"></p><hr><h6 id=\"1690714a-8b2b-4294-8b04-8bc1158269b2\">\u516D\u7EA7\u6807\u9898 h6</h6><p><span style=\"background-color: rgb(231, 189, 255);\">\u5427\u5566\u5427\u963F\u91CC\u6B64\u5904\u4E3A\u5185\u5BB9\u533A\u57DF\uFF0C</span><span style=\"background-color: rgb(255, 224, 178);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</span><span style=\"background-color: rgb(248, 187, 208);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span><span style=\"background-color: rgb(240, 236, 179);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</span><span style=\"background-color: rgb(255, 204, 188);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<span style=\"background-color: rgb(179, 229, 252);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<span style=\"background-color: rgb(200, 230, 201);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<span style=\"background-color: rgb(187, 222, 251);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6B64\u5904\u4E3A\u5185\u5BB9\u533A\u57DF\uFF0C<span style=\"background-color: rgb(220, 237, 200);\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</span>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C<span style=\"background-color: rgba(42, 123, 83, 0.67); color: rgb(255, 255, 255);\">\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</span>\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</p><div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"/static-file/cb70d61c-3aeb-43b9-ad5f-128974eff555/db4b6a53-730d-461a-8488-11b7e528d7dd.md\" data-title=\"\u96F7\u6C60\u793E\u533A\u7248\u81EA\u52A8SSL.md\" data-size=\"2.85 KB\"></div><div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"/static-file/14d6c511-e942-4664-92eb-32b6b8ee0ccf/ad8e0b68-cf19-4fb9-becc-cb10333c7d03.md\" data-title=\"\u8EAB\u4EFD\u8BA4\u8BC1 - CAS.md\" data-size=\"2.79 KB\"></div><p>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<span style=\"vertical-align: bottom; font-size: 24px;\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</span>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002<span style=\"vertical-align: top; font-size: 10px;\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</span>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6B64\u5904\u4E3A\u5185\u5BB9\u533A\u57DF\uFF0C\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p><iframe class=\"iframe-wrapper\" width=\"1261\" height=\"743\" src=\"https://47.104.180.36:2443/\" frameborder=\"0\" allowfullscreen=\"true\" autoplay=\"0\" loop=\"0\"></iframe><p>\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6B64\u5904\u4E3A\u5185\u5BB9\u533A\u57DF\uFF0C\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C</p><div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"/static-file/e919dac5-f275-468e-b52b-ca7dc4b46030/270b9ee9-bc19-4dbe-b619-e04186fbc09d.md\" data-title=\"\u767E\u5DDD\u7F51\u7AD9\u76D1\u6D4B.md\" data-size=\"1.14 KB\"></div><p>\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p><div class=\"tableWrapper\"><table style=\"width: 1146px;\"><colgroup><col style=\"width: 571px;\"><col style=\"width: 165px;\"><col style=\"width: 196px;\"><col style=\"width: 214px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"571\"><p style=\"text-align: center;\">fasdjklf</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"165\"><p style=\"text-align: center;\">fsdajkl</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"196\"><p style=\"text-align: center;\">fjklsdajfl</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"214\"><p style=\"text-align: center;\">fjdsakljk</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"571\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">\u53D1\u5927\u5BB6\u6492\u5FEB\u4E50\u98DE\u673A\u554A\u6536\u5230\u5566\u5F00\u53D1\u5EFA\u8BBE\u5361\u5FB7\u7F57\u592B\u5C31\u554A\u6570\u91CF\u7684\u98DE\u673A\u963F\u91CC\u65AF\u987F\u8FDB\u6765\u770B</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"165\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">12</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"196\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">2342</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"214\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">239</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"571\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002\u6587\u6863\u5185\u5BB9\u4E3A\u65E0\u610F\u4E49\u4E71\u7801\uFF0C\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981\u3002</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"165\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">2332</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"196\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">232</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"214\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p style=\"text-align: center;\">9438</p></td></tr></tbody></table></div></div></details><h2 id=\"84cd9c21-dd66-418b-997d-1c9024e23d99\">\u53C8\u4E00\u4E2A\u4E8C\u7EA7\u6807\u9898</h2><h3 id=\"f21105ce-61ff-4542-98e6-9a6bbe1c3350\">\u4E09\u7EA7\u6807\u9898 1\uFF1A\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</h3><div data-latex=\"int_{-infty}^{infty} e^{-x^2} dx = sqrt{pi}\" data-type=\"block-math\"></div><h3 id=\"b8e6c105-1131-4c69-9251-256679f6bcca\">\u4E09\u7EA7\u6807\u9898 2\uFF1A\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</h3><pre><code><!doctype html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/logo.png\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>PandaWiki</title>\n <link rel=\"stylesheet\" href=\"/panda-wiki.css\">\n</head>\n\n<body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n</body>\n\n</html></code></pre><h3 id=\"c3c5e4b3-1827-4583-8099-0d1ff0c87af6\">\u4E09\u7EA7\u6807\u9898 3\uFF1A\u65E0\u6CD5\u751F\u6210\u6709\u6548\u6458\u8981</h3><div class=\"tableWrapper\"><table style=\"width: 1739px;\"><colgroup><col style=\"width: 188px;\"><col style=\"width: 207px;\"><col style=\"width: 162px;\"><col style=\"width: 198px;\"><col style=\"width: 202px;\"><col style=\"width: 141px;\"><col style=\"width: 132px;\"><col style=\"width: 172px;\"><col style=\"width: 178px;\"><col style=\"width: 159px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"188\"><p>\u5C06\u5723\u8BDE\u5FEB\u4E50</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"207\"><p>\u98DE\u673A\u5566\u6DF1\u523B\u7684\u53D1</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"162\"><p>\u98DE\u673A\u901F\u5EA6\u5FEB\u5566 </p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"198\"><p>\u53D1\u6492\u5C3D\u91CF\u5206\u5F00\u7684</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"202\"><p>\u98DE\u673A\u7684\u5FEB\u4E50\u6492</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"141\"><p>\u98DE\u673A\u6536\u5230\u4E86\u5361</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"132\"><p>\u98DE\u673A\u7684\u65F6\u7A7A\u8DDD\u79BB</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"172\"><p>\u53D1\u5927\u6C34\u5566\u5FEB\u5C31\u53D1\u751F\u4E86\u7A7A\u95F4\u6D6A\u8D39</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"178\"><p>\u98DE\u673A\u7684\u7D22\u79D1\u6D1B\u592B\u5C31\u6765\u5237\u5361\u89E3\u653E\u5FEB\u4E50\u6492</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" colwidth=\"159\"><p>\u53D1\u751F\u5C3D\u91CF\u5FEB\u70B9</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"188\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6EF4\u6F0F\u5F0F\u5496\u5561\u673A\u963F\u91CC\u98DE\u673A\u6EF4\u6F0F\u5F0F\u5496\u5561\u673A\u6536\u5230\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"207\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u98DE\u673A\u5566\u5F00\u59CB\u51CF\u80A5\u4E86\u4E0A\u98DE\u673A\u4E86\u6492\u98DE\u673A\u963F\u675C\u91CC\u65AF\u98DE\u673A\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"162\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u5FEB\u4E09\u5927\u89E3\u653E\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"198\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u5230\u4E86\u6492\u770B\u89E3\u653E\u8DEF\u53E3</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"202\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u770B\u5230\u6492\u5A07\u53D1\u6765\u7684\u5FEB\u6492\u89E3\u653E\u62C9\u5361\u5723\u8BDE\u8282\u53D1\u4E86\u7761\u89C9\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"141\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u5C31\u770B\u5230\u6492\u5A07\u53D1\u4E86\u5FEB</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"132\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u8FDB\u6765\u770B\u53D1\u5566\u6DF1\u523B\u7684\u89E3\u653E</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"172\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u5C31\u5F00\u59CB\u6253</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"178\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u5361\u5723\u8BDE\u8282\u53D1\u5566\u65F6\u4EE3\u5CF0\u5CFB\u7684\u62C9\u5361\u4E0A\u98DE\u673A\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"159\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u8DEF\u53E3\u53D1\u6492\u51E0\u70B9\u4E86\u5496\u5561</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"188\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u624B\u673A\u5361\u7684\u89E3\u653E\u5566\u5723\u8BDE\u8282\u53D1\u4E86\u5FEB\u6492\u98DE\u673A\u963F\u91CC\u4E0A\u98DE\u673A\u554A\u4E0A\u6765\u7684\u5FEB</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"207\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u4E86\u5FEB\u5927\u6C34\u89E3\u653E\u8DEF\u53E3</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"162\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u5C31\u53D1\u4E86\u770B\u5230\u6492\u5A07\u5FEB\u75AF\u4E86\u5723\u8BDE\u8282\u53D1\u4E86\u6492\u53D1</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"198\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u4E86\u98DE\u673A\u7684\u6492\u5F00\u5C31\u53D1\u4E86\u75AF\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"202\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u5F17\u8428\u7684\u5FEB\u4E50\u98DE\u673A\u4E86\u5723\u8BDE\u8282\u53D1\u4E86\u6492\u5927\u89E3\u653E\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"141\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6492\u5C3D\u91CF\u5FEB\u70B9</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"132\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u98DE\u673A\u5566\u6DF1\u523B\u7684</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"172\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u4E66\u6CD5\u5BB6</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"178\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u98DE\u673A\u4E0A\u770B\u5566\u5927\u5BB6</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"159\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u5230\u624B\u673A\u5361</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" colwidth=\"188\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u98DE\u673A\u770B\u5566\u5723\u8BDE\u8282\u53D1</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"207\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u89E3\u653E\u5566\u6DF1\u523B</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"162\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u526F\u4E66\u8BB0</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"198\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u751F\u7B80\u5355\u5566\u5FEB\u653E\u5047\u4E86\u7684\u6492</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"202\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u751F\u7684\u63A5\u53E3</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"141\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u6492\u5230\u5BB6\u4E50\u798F</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"132\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6492\u5C3D\u91CF\u5FEB</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"172\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6492\u6765\u7684\u5FEB\u653E\u5047\u4E86\u5FEB\u6492\u5927\u5E45\u62C9\u5347\u8DEF\u53E3\u98DE\u673A\u554A\u6536\u5230\u4E86</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"178\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6492\u8DEF\u53E3\u5C31\u5230</p></td><td colspan=\"1\" rowspan=\"1\" colwidth=\"159\" data-background-color=\"transparent\" style=\"background-color: transparent;\"><p>\u53D1\u6492\u7684\u5FEB\u4E50\u98DE\u673A\u963F\u91CC\u65AF\u987F\u5F00\u98DE\u673A\u5927\u6C34\u8DEF\u53E3\u98DE\u673A\u554A\u4E0A\u4E86</p></td></tr></tbody></table></div><p></p>"
|
|
106
106
|
}),
|
|
107
107
|
editor = _useTiptap.editor;
|
|
108
108
|
return /*#__PURE__*/React.createElement(EditorThemeProvider, {
|
|
109
109
|
mode: "light"
|
|
110
|
-
}, /*#__PURE__*/React.createElement(
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
111
|
+
variant: "contained",
|
|
112
|
+
onClick: function onClick() {
|
|
113
|
+
editor.commands.extendMarkRange('code', {
|
|
114
|
+
multiselect: true
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}, "\u6D4B\u8BD5\u4E00\u4E0B"), /*#__PURE__*/React.createElement(Box, {
|
|
111
118
|
sx: {
|
|
112
119
|
border: '1px solid #eee',
|
|
113
120
|
borderRadius: '10px',
|
package/dist/Editor/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "core-js/modules/es.array.find-last.js";
|
|
|
2
2
|
import { EditorContent } from '@tiptap/react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { PhotoProvider } from 'react-photo-view';
|
|
5
|
-
import
|
|
5
|
+
import CustomBubbleMenu from "../component/CustomBubbleMenu";
|
|
6
6
|
import CustomDragHandle from "../component/CustomDragHandle";
|
|
7
7
|
|
|
8
8
|
// fix: https://github.com/ueberdosis/tiptap/issues/6785
|
|
@@ -54,7 +54,7 @@ var Editor = function Editor(_ref) {
|
|
|
54
54
|
d: "M565.5 202.5l75-75v225h-225l103.5-103.5c-34.5-34.5-82.5-57-135-57-106.5 0-192 85.5-192 192s85.5 192 192 192c84 0 156-52.5 181.5-127.5h66c-28.5 111-127.5 192-247.5 192-141 0-255-115.5-255-256.5s114-256.5 255-256.5c70.5 0 135 28.5 181.5 75z"
|
|
55
55
|
})));
|
|
56
56
|
}
|
|
57
|
-
}, /*#__PURE__*/React.createElement(
|
|
57
|
+
}, /*#__PURE__*/React.createElement(CustomBubbleMenu, {
|
|
58
58
|
editor: editor,
|
|
59
59
|
more: menuInBubbleMenu
|
|
60
60
|
}), /*#__PURE__*/React.createElement(CustomDragHandle, {
|
|
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { Box, Divider, Stack } from '@mui/material';
|
|
8
8
|
import React, { useEffect, useState } from 'react';
|
|
9
|
-
import { AiGenerate2Icon, ArrowGoBackLineIcon, ArrowGoForwardLineIcon, BoldIcon, EraserLineIcon, ItalicIcon, LinkIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, UnderlineIcon } from "../component/Icons";
|
|
9
|
+
import { AiGenerate2Icon, ArrowGoBackLineIcon, ArrowGoForwardLineIcon, BoldIcon, EraserLineIcon, ItalicIcon, LinkIcon, MarkPenLineIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, UnderlineIcon } from "../component/Icons";
|
|
10
10
|
import { EditorAlignSelect, EditorFontBgColor, EditorFontColor, EditorFontSize, EditorHeading, EditorInsert, EditorListSelect, EditorMore, EditorVerticalAlignSelect, ToolbarItem } from "../component/Toolbar";
|
|
11
11
|
var EditorToolbar = function EditorToolbar(_ref) {
|
|
12
12
|
var editor = _ref.editor,
|
|
@@ -27,7 +27,8 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
27
27
|
link: false,
|
|
28
28
|
alert: false,
|
|
29
29
|
iframe: false,
|
|
30
|
-
aiWriting: false
|
|
30
|
+
aiWriting: false,
|
|
31
|
+
highlight: false
|
|
31
32
|
}),
|
|
32
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
33
34
|
active = _useState2[0],
|
|
@@ -50,7 +51,8 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
50
51
|
link: editor.isActive('link'),
|
|
51
52
|
alert: editor.isActive('alert'),
|
|
52
53
|
iframe: editor.isActive('iframe'),
|
|
53
|
-
aiWriting: !!((_editor$storage = editor.storage) !== null && _editor$storage !== void 0 && (_editor$storage = _editor$storage.aiWriting) !== null && _editor$storage !== void 0 && _editor$storage.enabled)
|
|
54
|
+
aiWriting: !!((_editor$storage = editor.storage) !== null && _editor$storage !== void 0 && (_editor$storage = _editor$storage.aiWriting) !== null && _editor$storage !== void 0 && _editor$storage.enabled),
|
|
55
|
+
highlight: editor.isActive('highlight')
|
|
54
56
|
});
|
|
55
57
|
};
|
|
56
58
|
useEffect(function () {
|
|
@@ -221,6 +223,18 @@ var EditorToolbar = function EditorToolbar(_ref) {
|
|
|
221
223
|
return editor.chain().focus().toggleUnderline().run();
|
|
222
224
|
},
|
|
223
225
|
className: active.underline ? 'tool-active' : ''
|
|
226
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
227
|
+
tip: '高亮',
|
|
228
|
+
shortcutKey: ['ctrl', 'shift', 'H'],
|
|
229
|
+
icon: /*#__PURE__*/React.createElement(MarkPenLineIcon, {
|
|
230
|
+
sx: {
|
|
231
|
+
fontSize: '1rem'
|
|
232
|
+
}
|
|
233
|
+
}),
|
|
234
|
+
onClick: function onClick() {
|
|
235
|
+
return editor.chain().focus().toggleHighlight().run();
|
|
236
|
+
},
|
|
237
|
+
className: active.highlight ? 'tool-active' : ''
|
|
224
238
|
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
225
239
|
tip: '上标',
|
|
226
240
|
shortcutKey: ['ctrl', '.'],
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MenuItem } from "../../type";
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface CustomBubbleMenuProps {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
more?: MenuItem[];
|
|
7
|
+
}
|
|
8
|
+
declare const CustomBubbleMenu: ({ editor, more }: CustomBubbleMenuProps) => React.JSX.Element | null;
|
|
9
|
+
export default CustomBubbleMenu;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { BoldIcon, CodeLineIcon, EraserLineIcon, ItalicIcon, LinkIcon, MarkPenLineIcon, StrikethroughIcon, UnderlineIcon } from "../Icons";
|
|
2
|
+
import { hasMarksInSelection } from "../../util";
|
|
3
|
+
import { Paper, Stack } from '@mui/material';
|
|
4
|
+
import { useEditorState } from '@tiptap/react';
|
|
5
|
+
import { BubbleMenu } from '@tiptap/react/menus';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { ToolbarItem } from "../Toolbar";
|
|
8
|
+
var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
9
|
+
var editor = _ref.editor,
|
|
10
|
+
more = _ref.more;
|
|
11
|
+
// const theme = useTheme()
|
|
12
|
+
|
|
13
|
+
// const THEME_TEXT_COLOR = [
|
|
14
|
+
// theme.palette.primary.main,
|
|
15
|
+
// theme.palette.success.main,
|
|
16
|
+
// theme.palette.warning.main,
|
|
17
|
+
// theme.palette.error.main,
|
|
18
|
+
// '#D8A47F',
|
|
19
|
+
// '#73B5F0',
|
|
20
|
+
// '#CDDFA0',
|
|
21
|
+
// theme.palette.text.primary,
|
|
22
|
+
// theme.palette.text.secondary,
|
|
23
|
+
// theme.palette.text.disabled,
|
|
24
|
+
// theme.palette.common.white,
|
|
25
|
+
// ]
|
|
26
|
+
|
|
27
|
+
// const THEME_TEXT_BG_COLOR = [
|
|
28
|
+
// '#e7bdff',
|
|
29
|
+
// '#FFE0B2',
|
|
30
|
+
// '#F8BBD0',
|
|
31
|
+
// '#FFCDD2',
|
|
32
|
+
// '#FFECB3',
|
|
33
|
+
// '#FFCCBC',
|
|
34
|
+
// '#B3E5FC',
|
|
35
|
+
// '#C8E6C9',
|
|
36
|
+
// '#B2EBF2',
|
|
37
|
+
// '#BBDEFB',
|
|
38
|
+
// '#DCEDC8',
|
|
39
|
+
// ]
|
|
40
|
+
|
|
41
|
+
var _useEditorState = useEditorState({
|
|
42
|
+
editor: editor,
|
|
43
|
+
selector: function selector(ctx) {
|
|
44
|
+
return {
|
|
45
|
+
isBold: ctx.editor.isActive('bold'),
|
|
46
|
+
isItalic: ctx.editor.isActive('italic'),
|
|
47
|
+
isStrike: ctx.editor.isActive('strike'),
|
|
48
|
+
isUnderline: ctx.editor.isActive('underline'),
|
|
49
|
+
isCode: ctx.editor.isActive('code'),
|
|
50
|
+
isHighlight: ctx.editor.isActive('highlight'),
|
|
51
|
+
hasAnyMarks: ctx.editor.state.selection.empty ? ctx.editor.state.selection.$from.marks().length > 0 : hasMarksInSelection(ctx.editor.state)
|
|
52
|
+
// isSuperscript: ctx.editor.isActive('superscript'),
|
|
53
|
+
// isSubscript: ctx.editor.isActive('subscript'),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
isBold = _useEditorState.isBold,
|
|
58
|
+
isItalic = _useEditorState.isItalic,
|
|
59
|
+
isStrike = _useEditorState.isStrike,
|
|
60
|
+
isUnderline = _useEditorState.isUnderline,
|
|
61
|
+
isCode = _useEditorState.isCode,
|
|
62
|
+
isHighlight = _useEditorState.isHighlight,
|
|
63
|
+
hasAnyMarks = _useEditorState.hasAnyMarks;
|
|
64
|
+
if (editor && !editor.isEditable) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/React.createElement(BubbleMenu, {
|
|
68
|
+
editor: editor,
|
|
69
|
+
pluginKey: 'bubble-menu',
|
|
70
|
+
updateDelay: 750,
|
|
71
|
+
options: {
|
|
72
|
+
placement: 'bottom',
|
|
73
|
+
offset: 8,
|
|
74
|
+
flip: true
|
|
75
|
+
},
|
|
76
|
+
shouldShow: function shouldShow() {
|
|
77
|
+
// 表格多选单元格时禁止弹出气泡菜单
|
|
78
|
+
// if (editor.state.selection.constructor.name === '_CellSelection') {
|
|
79
|
+
// const cellSelection = editor.state.selection as any;
|
|
80
|
+
// if (cellSelection.ranges.length > 1) {
|
|
81
|
+
// return false
|
|
82
|
+
// }
|
|
83
|
+
// if (cellSelection.$anchorCell && cellSelection.$headCell) {
|
|
84
|
+
// return cellSelection.$anchorCell.pos !== cellSelection.$headCell.pos;
|
|
85
|
+
// }
|
|
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')) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Paper, {
|
|
93
|
+
sx: {
|
|
94
|
+
p: 0.5,
|
|
95
|
+
borderRadius: 'var(--mui-shape-borderRadius)'
|
|
96
|
+
}
|
|
97
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
98
|
+
direction: 'row',
|
|
99
|
+
alignItems: 'center'
|
|
100
|
+
}, /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
101
|
+
tip: "\u52A0\u7C97",
|
|
102
|
+
shortcutKey: ['ctrl', 'B'],
|
|
103
|
+
icon: /*#__PURE__*/React.createElement(BoldIcon, {
|
|
104
|
+
sx: {
|
|
105
|
+
fontSize: '1rem'
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
onClick: function onClick() {
|
|
109
|
+
return editor.chain().focus().toggleBold().run();
|
|
110
|
+
},
|
|
111
|
+
className: isBold ? "tool-active" : ""
|
|
112
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
113
|
+
tip: "\u659C\u4F53",
|
|
114
|
+
shortcutKey: ['ctrl', 'I'],
|
|
115
|
+
icon: /*#__PURE__*/React.createElement(ItalicIcon, {
|
|
116
|
+
sx: {
|
|
117
|
+
fontSize: '1rem'
|
|
118
|
+
}
|
|
119
|
+
}),
|
|
120
|
+
onClick: function onClick() {
|
|
121
|
+
return editor.chain().focus().toggleItalic().run();
|
|
122
|
+
},
|
|
123
|
+
className: isItalic ? "tool-active" : ""
|
|
124
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
125
|
+
tip: "\u5220\u9664\u7EBF",
|
|
126
|
+
shortcutKey: ['ctrl', 'shift', 'S'],
|
|
127
|
+
icon: /*#__PURE__*/React.createElement(StrikethroughIcon, {
|
|
128
|
+
sx: {
|
|
129
|
+
fontSize: '1rem'
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
onClick: function onClick() {
|
|
133
|
+
return editor.chain().focus().toggleStrike().run();
|
|
134
|
+
},
|
|
135
|
+
className: isStrike ? "tool-active" : ""
|
|
136
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
137
|
+
tip: "\u4E0B\u5212\u7EBF",
|
|
138
|
+
shortcutKey: ['ctrl', 'U'],
|
|
139
|
+
icon: /*#__PURE__*/React.createElement(UnderlineIcon, {
|
|
140
|
+
sx: {
|
|
141
|
+
fontSize: '1rem'
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
onClick: function onClick() {
|
|
145
|
+
return editor.chain().focus().toggleUnderline().run();
|
|
146
|
+
},
|
|
147
|
+
className: isUnderline ? "tool-active" : ""
|
|
148
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
149
|
+
tip: "\u9AD8\u4EAE",
|
|
150
|
+
shortcutKey: ['ctrl', 'shift', 'H'],
|
|
151
|
+
icon: /*#__PURE__*/React.createElement(MarkPenLineIcon, {
|
|
152
|
+
sx: {
|
|
153
|
+
fontSize: '1rem'
|
|
154
|
+
}
|
|
155
|
+
}),
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
return editor.chain().focus().toggleHighlight().run();
|
|
158
|
+
},
|
|
159
|
+
className: isHighlight ? "tool-active" : ""
|
|
160
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
161
|
+
tip: "\u884C\u5185\u4EE3\u7801",
|
|
162
|
+
shortcutKey: ['ctrl', 'E'],
|
|
163
|
+
icon: /*#__PURE__*/React.createElement(CodeLineIcon, {
|
|
164
|
+
sx: {
|
|
165
|
+
fontSize: '1rem'
|
|
166
|
+
}
|
|
167
|
+
}),
|
|
168
|
+
onClick: function onClick() {
|
|
169
|
+
return editor.chain().focus().toggleCode().run();
|
|
170
|
+
},
|
|
171
|
+
className: isCode ? "tool-active" : ""
|
|
172
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
173
|
+
tip: "\u6587\u672C\u683C\u5F0F\u5316",
|
|
174
|
+
icon: /*#__PURE__*/React.createElement(EraserLineIcon, {
|
|
175
|
+
sx: {
|
|
176
|
+
fontSize: '1rem'
|
|
177
|
+
}
|
|
178
|
+
}),
|
|
179
|
+
onClick: function onClick() {
|
|
180
|
+
return editor.chain().focus().unsetAllMarks().run();
|
|
181
|
+
},
|
|
182
|
+
disabled: !hasAnyMarks
|
|
183
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
184
|
+
tip: "\u63D2\u5165\u94FE\u63A5",
|
|
185
|
+
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
186
|
+
sx: {
|
|
187
|
+
fontSize: '1rem'
|
|
188
|
+
}
|
|
189
|
+
}),
|
|
190
|
+
onClick: function onClick() {
|
|
191
|
+
var selection = editor.state.selection;
|
|
192
|
+
var start = selection.from;
|
|
193
|
+
var end = selection.to;
|
|
194
|
+
var text = editor.state.doc.textBetween(start, end, '');
|
|
195
|
+
editor.chain().focus().setInlineLink({
|
|
196
|
+
href: '',
|
|
197
|
+
title: text
|
|
198
|
+
}).run();
|
|
199
|
+
}
|
|
200
|
+
}), more === null || more === void 0 ? void 0 : more.map(function (item) {
|
|
201
|
+
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
202
|
+
key: item.key,
|
|
203
|
+
tip: item.label,
|
|
204
|
+
icon: item.icon || /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
205
|
+
onClick: item.onClick
|
|
206
|
+
});
|
|
207
|
+
}))));
|
|
208
|
+
};
|
|
209
|
+
export default CustomBubbleMenu;
|
|
@@ -24,7 +24,7 @@ import DragHandle from '@tiptap/extension-drag-handle-react';
|
|
|
24
24
|
import { Fragment, Slice } from '@tiptap/pm/model';
|
|
25
25
|
import { NodeSelection } from '@tiptap/pm/state';
|
|
26
26
|
import React, { useCallback, useState } from 'react';
|
|
27
|
-
import { convertNodeAt, downloadFiles, filterResourcesByType, getAllResources, getShortcutKeyText } from "../../util";
|
|
27
|
+
import { convertNodeAt, downloadFiles, filterResourcesByType, getAllResources, getShortcutKeyText, hasMarksInSelection } from "../../util";
|
|
28
28
|
import Menu from "../Menu";
|
|
29
29
|
import { ToolbarItem } from "../Toolbar";
|
|
30
30
|
var DragIcon = function DragIcon(_ref) {
|
|
@@ -243,7 +243,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
243
243
|
var updateNodeChange = useCallback(function (data) {
|
|
244
244
|
var _data$node, _current$node2;
|
|
245
245
|
if ((data.pos !== current.pos || ((_data$node = data.node) === null || _data$node === void 0 ? void 0 : _data$node.type.name) !== ((_current$node2 = current.node) === null || _current$node2 === void 0 ? void 0 : _current$node2.type.name)) && data.pos !== -1 || data.node === null && data.pos >= 0) {
|
|
246
|
-
var _data$node2
|
|
246
|
+
var _data$node2;
|
|
247
247
|
var allResources = data.node ? getAllResources(data.node) : [];
|
|
248
248
|
var videos = filterResourcesByType(allResources, [NodeTypeEnum.Video]);
|
|
249
249
|
var audios = filterResourcesByType(allResources, [NodeTypeEnum.Audio]);
|
|
@@ -257,7 +257,8 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
257
257
|
images: images,
|
|
258
258
|
attachments: attachments
|
|
259
259
|
});
|
|
260
|
-
|
|
260
|
+
var hasMarks = hasMarksInSelection(current.editor.state);
|
|
261
|
+
setShowFormat(!hasMarks);
|
|
261
262
|
}
|
|
262
263
|
}, [current.pos, current.node]);
|
|
263
264
|
return /*#__PURE__*/React.createElement(DragHandle, {
|
|
@@ -594,7 +595,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
594
595
|
color: 'text.secondary',
|
|
595
596
|
fontWeight: 'bold'
|
|
596
597
|
}
|
|
597
|
-
}, "\u80CC\u666F\u989C\u8272"),
|
|
598
|
+
}, "\u6587\u5B57\u80CC\u666F\u989C\u8272"),
|
|
598
599
|
key: 'background-color'
|
|
599
600
|
}], _toConsumableArray(THEME_TEXT_BG_COLOR.map(function (it) {
|
|
600
601
|
return {
|
|
@@ -614,7 +615,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
614
615
|
if (current.node && current.pos !== undefined) {
|
|
615
616
|
var from = current.pos;
|
|
616
617
|
var to = current.pos + current.node.nodeSize;
|
|
617
|
-
current.editor.chain().setTextSelection({
|
|
618
|
+
current.editor.chain().focus().setTextSelection({
|
|
618
619
|
from: from,
|
|
619
620
|
to: to
|
|
620
621
|
}).setBackgroundColor(it.value).run();
|
|
@@ -1387,7 +1388,16 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
1387
1388
|
}
|
|
1388
1389
|
}),
|
|
1389
1390
|
onClick: function onClick() {
|
|
1390
|
-
current.
|
|
1391
|
+
if (current.node && current.pos !== undefined) {
|
|
1392
|
+
var _current$node18;
|
|
1393
|
+
var selection = current.editor.commands.setTextSelection({
|
|
1394
|
+
from: current.pos,
|
|
1395
|
+
to: current.pos + ((_current$node18 = current.node) === null || _current$node18 === void 0 ? void 0 : _current$node18.nodeSize)
|
|
1396
|
+
});
|
|
1397
|
+
if (selection) {
|
|
1398
|
+
current.editor.chain().unsetAllMarks().focus(current.pos - 1).run();
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1391
1401
|
}
|
|
1392
1402
|
}] : []))
|
|
1393
1403
|
}) : /*#__PURE__*/React.createElement(DragIcon, null)));
|
|
@@ -83,6 +83,7 @@ export { ListCheck2Icon } from './list-check-2-icon';
|
|
|
83
83
|
export { ListCheck3Icon } from './list-check-3-icon';
|
|
84
84
|
export { ListOrdered2Icon } from './list-ordered-2-icon';
|
|
85
85
|
export { ListUnorderedIcon } from './list-unordered-icon';
|
|
86
|
+
export { MarkPenLineIcon } from './mark-pen-line-icon';
|
|
86
87
|
export { MarkdownLineIcon } from './markdown-line-icon';
|
|
87
88
|
export { MarkupLineIcon } from './markup-line-icon';
|
|
88
89
|
export { MenuFold2FillIcon } from './menu-fold-2-fill-icon';
|
|
@@ -86,6 +86,7 @@ export { ListCheck2Icon } from "./list-check-2-icon";
|
|
|
86
86
|
export { ListCheck3Icon } from "./list-check-3-icon";
|
|
87
87
|
export { ListOrdered2Icon } from "./list-ordered-2-icon";
|
|
88
88
|
export { ListUnorderedIcon } from "./list-unordered-icon";
|
|
89
|
+
export { MarkPenLineIcon } from "./mark-pen-line-icon";
|
|
89
90
|
export { MarkdownLineIcon } from "./markdown-line-icon";
|
|
90
91
|
export { MarkupLineIcon } from "./markup-line-icon";
|
|
91
92
|
export { MenuFold2FillIcon } from "./menu-fold-2-fill-icon";
|
|
@@ -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 MarkPenLineIcon = function MarkPenLineIcon(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: "M15.2427 4.5115L8.50547 11.2487L7.79836 13.37L6.7574 14.411L9.58583 17.2394L10.6268 16.1985L12.7481 15.4914L19.4853 8.75414L15.2427 4.5115ZM21.6066 8.04704C21.9972 8.43756 21.9972 9.07073 21.6066 9.46125L13.8285 17.2394L11.7071 17.9465L10.2929 19.3607C9.90241 19.7513 9.26925 19.7513 8.87872 19.3607L4.63608 15.1181C4.24556 14.7276 4.24556 14.0944 4.63608 13.7039L6.0503 12.2897L6.7574 10.1684L14.5356 2.39018C14.9261 1.99966 15.5593 1.99966 15.9498 2.39018L21.6066 8.04704ZM15.2427 7.33993L16.6569 8.75414L11.7071 13.7039L10.2929 12.2897L15.2427 7.33993ZM4.28253 16.8859L7.11096 19.7143L5.69674 21.1285L1.4541 19.7143L4.28253 16.8859Z"
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
MarkPenLineIcon.displayName = 'icon-mark-pen-line';
|
|
@@ -23,9 +23,12 @@ var EditorFontSize = function EditorFontSize(_ref) {
|
|
|
23
23
|
return it.toString();
|
|
24
24
|
});
|
|
25
25
|
var updateFontSize = function updateFontSize() {
|
|
26
|
-
var _attrs$fontSize;
|
|
26
|
+
var _attrs$fontSize, _attrs$fontSize2;
|
|
27
27
|
var attrs = editor.getAttributes('textStyle');
|
|
28
|
-
var fontSize = (_attrs$fontSize = attrs.fontSize) === null || _attrs$fontSize === void 0 ? void 0 : _attrs$fontSize.replace('px', '').replace('pt', '');
|
|
28
|
+
var fontSize = ((_attrs$fontSize = attrs.fontSize) === null || _attrs$fontSize === void 0 ? void 0 : _attrs$fontSize.replace('px', '').replace('pt', '')) || '';
|
|
29
|
+
if (fontSize.length > 0 && (_attrs$fontSize2 = attrs.fontSize) !== null && _attrs$fontSize2 !== void 0 && _attrs$fontSize2.includes('pt')) {
|
|
30
|
+
fontSize = fontSize * 4 / 3;
|
|
31
|
+
}
|
|
29
32
|
if (fontSize) {
|
|
30
33
|
setSelectedValue(fontSize);
|
|
31
34
|
return;
|
|
@@ -102,6 +102,7 @@ var AlertView = function AlertView(_ref) {
|
|
|
102
102
|
}, variantData.icon), /*#__PURE__*/React.createElement(Box, {
|
|
103
103
|
sx: {
|
|
104
104
|
flex: 1,
|
|
105
|
+
width: 0,
|
|
105
106
|
'code': {
|
|
106
107
|
borderColor: attrs.variant === 'default' ? '' : "color-mix(in srgb, ".concat(variantData.color, " 30%, transparent) !important"),
|
|
107
108
|
bgcolor: attrs.variant === 'default' ? '' : "color-mix(in srgb, ".concat(variantData.color, " 10%, transparent) !important")
|
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";
|
|
@@ -41,25 +42,28 @@ export var getExtensions = function getExtensions(_ref) {
|
|
|
41
42
|
color: 'var(--mui-palette-primary-main)',
|
|
42
43
|
width: 2
|
|
43
44
|
}
|
|
44
|
-
}),
|
|
45
|
+
}), TextAlign.configure({
|
|
45
46
|
types: ['heading', 'paragraph']
|
|
46
47
|
}), VerticalAlign.configure({
|
|
47
48
|
types: ['textStyle'],
|
|
48
49
|
defaultAlignment: null
|
|
49
|
-
}),
|
|
50
|
+
}), TextStyleKit.configure({
|
|
51
|
+
backgroundColor: {
|
|
52
|
+
types: ['textStyle']
|
|
53
|
+
}
|
|
54
|
+
}), ListExtension, CodeBlockLowlightExtension, CharacterCount.configure({
|
|
50
55
|
limit: limit !== null && limit !== void 0 ? limit : null
|
|
51
|
-
}), Subscript, Superscript,
|
|
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
|
-
],
|
|
56
|
+
}), Subscript, Superscript, Indent.configure({
|
|
57
|
+
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
58
|
maxLevel: 8,
|
|
60
59
|
indentPx: 32
|
|
61
60
|
}), CodeExtension, AlertExtension, Highlight.configure({
|
|
62
61
|
multicolor: true
|
|
62
|
+
}), Markdown.configure({
|
|
63
|
+
indentation: {
|
|
64
|
+
style: 'space',
|
|
65
|
+
size: 2
|
|
66
|
+
}
|
|
63
67
|
}), Placeholder.configure({
|
|
64
68
|
emptyNodeClass: 'custom-placeholder-node',
|
|
65
69
|
showOnlyWhenEditable: true,
|
package/dist/index.css
CHANGED
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
.tiptap.ProseMirror blockquote p,
|
|
66
66
|
.tiptap.ProseMirror .node-alert p {
|
|
67
|
-
margin:
|
|
67
|
+
margin: 10px;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/* blockquote */
|
|
@@ -236,6 +236,7 @@
|
|
|
236
236
|
width: 1.25rem;
|
|
237
237
|
height: 1.5rem;
|
|
238
238
|
margin-top: 0.1rem;
|
|
239
|
+
flex-shrink: 0;
|
|
239
240
|
padding: 0;
|
|
240
241
|
}
|
|
241
242
|
|
|
@@ -258,10 +259,11 @@
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
.tiptap.ProseMirror .cq-details>div {
|
|
262
|
+
width: 0;
|
|
263
|
+
flex: 1;
|
|
261
264
|
display: flex;
|
|
262
265
|
flex-direction: column;
|
|
263
266
|
gap: 1rem;
|
|
264
|
-
width: 100%;
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
.tiptap.ProseMirror .cq-details>div>[data-type='detailsContent']> :last-child {
|
|
@@ -360,7 +362,6 @@
|
|
|
360
362
|
table-layout: fixed;
|
|
361
363
|
overflow: hidden;
|
|
362
364
|
caption-side: top;
|
|
363
|
-
background-color: var(--mui-palette-background-paper);
|
|
364
365
|
border-left: 1px dotted var(--mui-palette-divider);
|
|
365
366
|
}
|
|
366
367
|
|
|
@@ -399,17 +400,12 @@
|
|
|
399
400
|
|
|
400
401
|
/* 表格表头样式 */
|
|
401
402
|
.tiptap.ProseMirror table th {
|
|
402
|
-
background-color: var(--mui-palette-background-paper3);
|
|
403
403
|
font-weight: 600;
|
|
404
404
|
text-transform: uppercase;
|
|
405
405
|
letter-spacing: 0.5px;
|
|
406
406
|
text-align: left;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
.tiptap.ProseMirror table td {
|
|
410
|
-
background-color: var(--mui-palette-background-default);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
409
|
.tiptap.ProseMirror[contenteditable="true"] table .selectedCell * {
|
|
414
410
|
pointer-events: none;
|
|
415
411
|
user-select: none;
|
|
@@ -430,7 +426,6 @@
|
|
|
430
426
|
|
|
431
427
|
/* 表格列调整手柄 */
|
|
432
428
|
.tiptap.ProseMirror[contenteditable="true"] table .column-resize-handle {
|
|
433
|
-
background-color: transparent;
|
|
434
429
|
border-right: 2px dotted var(--mui-palette-primary-main);
|
|
435
430
|
bottom: -2px;
|
|
436
431
|
pointer-events: none;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ export * from './linewiseConvert';
|
|
|
5
5
|
export * from './migrateMathStrings';
|
|
6
6
|
export * from './resourceExtractor';
|
|
7
7
|
export * from './shortcutKey';
|
|
8
|
+
import { EditorState } from '@tiptap/pm/state';
|
|
8
9
|
import { Editor } from '@tiptap/react';
|
|
9
10
|
export declare const formatFileSize: (bytes: number) => string;
|
|
10
11
|
export declare const insertNodeAfterPosition: (editor: Editor, pos: number, nodeContent: any) => void;
|
|
12
|
+
export declare const hasMarksInSelection: (state: EditorState) => boolean;
|
|
11
13
|
export declare function addOpacityToColor(color: string, opacity: number): string;
|
|
12
14
|
export declare const getLinkTitle: (href: string) => string;
|
package/dist/util/index.js
CHANGED
|
@@ -15,6 +15,19 @@ export var formatFileSize = function formatFileSize(bytes) {
|
|
|
15
15
|
export var insertNodeAfterPosition = function insertNodeAfterPosition(editor, pos, nodeContent) {
|
|
16
16
|
editor.chain().focus().insertContentAt(pos, nodeContent).run();
|
|
17
17
|
};
|
|
18
|
+
export var hasMarksInSelection = function hasMarksInSelection(state) {
|
|
19
|
+
var _state$selection = state.selection,
|
|
20
|
+
from = _state$selection.from,
|
|
21
|
+
to = _state$selection.to;
|
|
22
|
+
var hasMarks = false;
|
|
23
|
+
state.doc.nodesBetween(from, to, function (node) {
|
|
24
|
+
if (node.marks && node.marks.length > 0) {
|
|
25
|
+
hasMarks = true;
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return hasMarks;
|
|
30
|
+
};
|
|
18
31
|
export function addOpacityToColor(color, opacity) {
|
|
19
32
|
var red, green, blue;
|
|
20
33
|
if (color.startsWith("#")) {
|
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.1",
|
|
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",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MenuItem } from "../../type";
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
export interface SelectionTextProps {
|
|
5
|
-
editor: Editor;
|
|
6
|
-
more?: MenuItem[];
|
|
7
|
-
}
|
|
8
|
-
declare const SelectionText: ({ editor, more }: SelectionTextProps) => React.JSX.Element | null;
|
|
9
|
-
export default SelectionText;
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
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; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { BoldIcon, CodeLineIcon, ItalicIcon, LinkIcon, ResetLeftFillIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, UnderlineIcon } from "../Icons";
|
|
8
|
-
import { Box, IconButton, Paper, Stack, useTheme } from '@mui/material';
|
|
9
|
-
import { BubbleMenu } from '@tiptap/react/menus';
|
|
10
|
-
import React, { useEffect, useState } from 'react';
|
|
11
|
-
import { ToolbarItem } from "../Toolbar";
|
|
12
|
-
var SelectionText = function SelectionText(_ref) {
|
|
13
|
-
var editor = _ref.editor,
|
|
14
|
-
more = _ref.more;
|
|
15
|
-
var theme = useTheme();
|
|
16
|
-
var THEME_TEXT_COLOR = [theme.palette.primary.main, theme.palette.success.main, theme.palette.warning.main, theme.palette.error.main, '#D8A47F', '#73B5F0', '#CDDFA0', theme.palette.text.primary, theme.palette.text.secondary, theme.palette.text.disabled, theme.palette.common.white];
|
|
17
|
-
var THEME_TEXT_BG_COLOR = ['#e7bdff', '#FFE0B2', '#F8BBD0', '#FFCDD2', '#FFECB3', '#FFCCBC', '#B3E5FC', '#C8E6C9', '#B2EBF2', '#BBDEFB', '#DCEDC8'];
|
|
18
|
-
var _useState = useState({
|
|
19
|
-
quote: false,
|
|
20
|
-
bold: false,
|
|
21
|
-
italic: false,
|
|
22
|
-
strike: false,
|
|
23
|
-
underline: false,
|
|
24
|
-
code: false,
|
|
25
|
-
superscript: false,
|
|
26
|
-
subscript: false
|
|
27
|
-
}),
|
|
28
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
-
active = _useState2[0],
|
|
30
|
-
setActive = _useState2[1];
|
|
31
|
-
var updateSelection = function updateSelection() {
|
|
32
|
-
setActive({
|
|
33
|
-
quote: editor.isActive('blockquote'),
|
|
34
|
-
bold: editor.isActive('bold'),
|
|
35
|
-
italic: editor.isActive('italic'),
|
|
36
|
-
strike: editor.isActive('strike'),
|
|
37
|
-
underline: editor.isActive('underline'),
|
|
38
|
-
code: editor.isActive('code'),
|
|
39
|
-
superscript: editor.isActive('superscript'),
|
|
40
|
-
subscript: editor.isActive('subscript')
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
useEffect(function () {
|
|
44
|
-
editor.on('selectionUpdate', updateSelection);
|
|
45
|
-
editor.on('transaction', updateSelection);
|
|
46
|
-
return function () {
|
|
47
|
-
editor.off('selectionUpdate', updateSelection);
|
|
48
|
-
editor.off('transaction', updateSelection);
|
|
49
|
-
};
|
|
50
|
-
}, [editor]);
|
|
51
|
-
if (!editor.isEditable) {
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
return /*#__PURE__*/React.createElement(BubbleMenu, {
|
|
55
|
-
editor: editor,
|
|
56
|
-
pluginKey: 'bubble-menu',
|
|
57
|
-
updateDelay: 750,
|
|
58
|
-
options: {
|
|
59
|
-
placement: 'bottom',
|
|
60
|
-
offset: 8
|
|
61
|
-
},
|
|
62
|
-
shouldShow: function shouldShow(_ref2) {
|
|
63
|
-
var editorProps = _ref2.editor;
|
|
64
|
-
// 表格多选单元格时禁止弹出气泡菜单
|
|
65
|
-
if (editorProps.state.selection.constructor.name === '_CellSelection') {
|
|
66
|
-
var cellSelection = editorProps.state.selection;
|
|
67
|
-
if (cellSelection.ranges.length > 1) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
if (cellSelection.$anchorCell && cellSelection.$headCell) {
|
|
71
|
-
return cellSelection.$anchorCell.pos !== cellSelection.$headCell.pos;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (editorProps.state.selection.empty || editorProps.isActive('image') || editorProps.isActive('video') || editorProps.isActive('audio') || editorProps.isActive('emoji') || editorProps.isActive('codeBlock') || editorProps.isActive('blockMath') || editorProps.isActive('inlineMath') || editorProps.isActive('blockLink') || editorProps.isActive('inlineLink') || editorProps.isActive('blockAttachment') || editorProps.isActive('inlineAttachment') || editorProps.isActive('horizontalRule') || editorProps.isActive('iframe')) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
}, /*#__PURE__*/React.createElement(Paper, {
|
|
80
|
-
sx: {
|
|
81
|
-
p: 0.5,
|
|
82
|
-
borderRadius: 'var(--mui-shape-borderRadius)'
|
|
83
|
-
}
|
|
84
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
85
|
-
direction: 'row',
|
|
86
|
-
alignItems: 'center'
|
|
87
|
-
}, /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
88
|
-
tip: "\u52A0\u7C97",
|
|
89
|
-
icon: /*#__PURE__*/React.createElement(BoldIcon, {
|
|
90
|
-
sx: {
|
|
91
|
-
fontSize: '1rem'
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
onClick: function onClick() {
|
|
95
|
-
return editor.chain().focus().toggleBold().run();
|
|
96
|
-
},
|
|
97
|
-
className: active.bold ? "tool-active" : ""
|
|
98
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
99
|
-
tip: "\u659C\u4F53",
|
|
100
|
-
icon: /*#__PURE__*/React.createElement(ItalicIcon, {
|
|
101
|
-
sx: {
|
|
102
|
-
fontSize: '1rem'
|
|
103
|
-
}
|
|
104
|
-
}),
|
|
105
|
-
onClick: function onClick() {
|
|
106
|
-
return editor.chain().focus().toggleItalic().run();
|
|
107
|
-
},
|
|
108
|
-
className: active.italic ? "tool-active" : ""
|
|
109
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
110
|
-
tip: "\u5220\u9664\u7EBF",
|
|
111
|
-
icon: /*#__PURE__*/React.createElement(StrikethroughIcon, {
|
|
112
|
-
sx: {
|
|
113
|
-
fontSize: '1rem'
|
|
114
|
-
}
|
|
115
|
-
}),
|
|
116
|
-
onClick: function onClick() {
|
|
117
|
-
return editor.chain().focus().toggleStrike().run();
|
|
118
|
-
},
|
|
119
|
-
className: active.strike ? "tool-active" : ""
|
|
120
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
121
|
-
tip: "\u4E0B\u5212\u7EBF",
|
|
122
|
-
icon: /*#__PURE__*/React.createElement(UnderlineIcon, {
|
|
123
|
-
sx: {
|
|
124
|
-
fontSize: '1rem'
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
onClick: function onClick() {
|
|
128
|
-
return editor.chain().focus().toggleUnderline().run();
|
|
129
|
-
},
|
|
130
|
-
className: active.underline ? "tool-active" : ""
|
|
131
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
132
|
-
tip: "\u4E0A\u6807",
|
|
133
|
-
icon: /*#__PURE__*/React.createElement(SuperscriptIcon, {
|
|
134
|
-
sx: {
|
|
135
|
-
fontSize: '1rem'
|
|
136
|
-
}
|
|
137
|
-
}),
|
|
138
|
-
onClick: function onClick() {
|
|
139
|
-
return editor.chain().focus().toggleSuperscript().run();
|
|
140
|
-
},
|
|
141
|
-
className: active.superscript ? "tool-active" : ""
|
|
142
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
143
|
-
tip: "\u4E0B\u6807",
|
|
144
|
-
icon: /*#__PURE__*/React.createElement(SubscriptIcon, {
|
|
145
|
-
sx: {
|
|
146
|
-
fontSize: '1rem'
|
|
147
|
-
}
|
|
148
|
-
}),
|
|
149
|
-
onClick: function onClick() {
|
|
150
|
-
return editor.chain().focus().toggleSubscript().run();
|
|
151
|
-
},
|
|
152
|
-
className: active.subscript ? "tool-active" : ""
|
|
153
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
154
|
-
tip: "\u884C\u5185\u4EE3\u7801",
|
|
155
|
-
icon: /*#__PURE__*/React.createElement(CodeLineIcon, {
|
|
156
|
-
sx: {
|
|
157
|
-
fontSize: '1rem'
|
|
158
|
-
}
|
|
159
|
-
}),
|
|
160
|
-
onClick: function onClick() {
|
|
161
|
-
return editor.chain().focus().toggleCode().run();
|
|
162
|
-
},
|
|
163
|
-
className: active.code ? "tool-active" : ""
|
|
164
|
-
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
165
|
-
tip: "\u63D2\u5165\u94FE\u63A5",
|
|
166
|
-
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
167
|
-
sx: {
|
|
168
|
-
fontSize: '1rem'
|
|
169
|
-
}
|
|
170
|
-
}),
|
|
171
|
-
onClick: function onClick() {
|
|
172
|
-
var selection = editor.state.selection;
|
|
173
|
-
var start = selection.from;
|
|
174
|
-
var end = selection.to;
|
|
175
|
-
var text = editor.state.doc.textBetween(start, end, '');
|
|
176
|
-
editor.chain().focus().setInlineLink({
|
|
177
|
-
href: '',
|
|
178
|
-
title: text
|
|
179
|
-
}).run();
|
|
180
|
-
}
|
|
181
|
-
}), more === null || more === void 0 ? void 0 : more.map(function (item) {
|
|
182
|
-
return /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
183
|
-
key: item.key,
|
|
184
|
-
tip: item.label,
|
|
185
|
-
icon: item.icon || /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
186
|
-
onClick: item.onClick
|
|
187
|
-
});
|
|
188
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
189
|
-
sx: {
|
|
190
|
-
mt: 0.5,
|
|
191
|
-
p: 1.5,
|
|
192
|
-
borderTop: '1px solid',
|
|
193
|
-
borderColor: 'divider',
|
|
194
|
-
boxSizing: 'border-box'
|
|
195
|
-
}
|
|
196
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
197
|
-
direction: 'row',
|
|
198
|
-
alignItems: 'center',
|
|
199
|
-
sx: {
|
|
200
|
-
fontSize: 14,
|
|
201
|
-
mb: 0.5
|
|
202
|
-
}
|
|
203
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
204
|
-
sx: {
|
|
205
|
-
color: 'text.secondary'
|
|
206
|
-
}
|
|
207
|
-
}, "\u6587\u5B57\u989C\u8272"), /*#__PURE__*/React.createElement(IconButton, {
|
|
208
|
-
size: "small",
|
|
209
|
-
onClick: function onClick() {
|
|
210
|
-
editor.chain().focus().setColor('').run();
|
|
211
|
-
},
|
|
212
|
-
sx: {
|
|
213
|
-
color: 'text.disabled',
|
|
214
|
-
':hover': {
|
|
215
|
-
color: 'primary.main'
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, /*#__PURE__*/React.createElement(ResetLeftFillIcon, {
|
|
219
|
-
sx: {
|
|
220
|
-
fontSize: '1rem'
|
|
221
|
-
}
|
|
222
|
-
}))), /*#__PURE__*/React.createElement(Stack, {
|
|
223
|
-
direction: 'row',
|
|
224
|
-
flexWrap: 'wrap',
|
|
225
|
-
gap: 0.5
|
|
226
|
-
}, THEME_TEXT_COLOR.map(function (c) {
|
|
227
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
228
|
-
key: c,
|
|
229
|
-
sx: {
|
|
230
|
-
width: '1.5rem',
|
|
231
|
-
height: '1.5rem',
|
|
232
|
-
cursor: 'pointer',
|
|
233
|
-
border: '1px solid',
|
|
234
|
-
borderColor: c === theme.palette.common.white ? 'divider' : c,
|
|
235
|
-
boxSizing: 'border-box',
|
|
236
|
-
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
237
|
-
bgcolor: c,
|
|
238
|
-
transition: 'transform 0.3s',
|
|
239
|
-
'&:hover': {
|
|
240
|
-
transform: 'scale(1.05)'
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
onClick: function onClick() {
|
|
244
|
-
editor.chain().focus().setColor(c).run();
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
})), /*#__PURE__*/React.createElement(Stack, {
|
|
248
|
-
direction: 'row',
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
sx: {
|
|
251
|
-
fontSize: 14,
|
|
252
|
-
mb: 0.5,
|
|
253
|
-
mt: 2
|
|
254
|
-
}
|
|
255
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
256
|
-
sx: {
|
|
257
|
-
color: 'text.secondary'
|
|
258
|
-
}
|
|
259
|
-
}, "\u80CC\u666F\u989C\u8272"), /*#__PURE__*/React.createElement(IconButton, {
|
|
260
|
-
size: "small",
|
|
261
|
-
onClick: function onClick() {
|
|
262
|
-
editor.chain().focus().setBackgroundColor('').run();
|
|
263
|
-
},
|
|
264
|
-
sx: {
|
|
265
|
-
color: 'text.disabled',
|
|
266
|
-
':hover': {
|
|
267
|
-
color: 'primary.main'
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}, /*#__PURE__*/React.createElement(ResetLeftFillIcon, {
|
|
271
|
-
sx: {
|
|
272
|
-
fontSize: '1rem'
|
|
273
|
-
}
|
|
274
|
-
}))), /*#__PURE__*/React.createElement(Stack, {
|
|
275
|
-
direction: 'row',
|
|
276
|
-
flexWrap: 'wrap',
|
|
277
|
-
gap: 0.5
|
|
278
|
-
}, THEME_TEXT_BG_COLOR.map(function (c) {
|
|
279
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
280
|
-
key: c,
|
|
281
|
-
sx: {
|
|
282
|
-
width: '1.5rem',
|
|
283
|
-
height: '1.5rem',
|
|
284
|
-
cursor: 'pointer',
|
|
285
|
-
border: '1px solid',
|
|
286
|
-
borderColor: c === theme.palette.common.white ? 'divider' : c,
|
|
287
|
-
boxSizing: 'border-box',
|
|
288
|
-
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
289
|
-
bgcolor: c,
|
|
290
|
-
transition: 'transform 0.3s',
|
|
291
|
-
'&:hover': {
|
|
292
|
-
transform: 'scale(1.05)'
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
onClick: function onClick() {
|
|
296
|
-
editor.chain().focus().setBackgroundColor(c).run();
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
})))));
|
|
300
|
-
};
|
|
301
|
-
export default SelectionText;
|