@ctzhian/tiptap 2.7.5 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/demo.js +1 -1
- package/dist/EditorMarkdown/Toolbar.js +15 -15
- package/dist/asset/css/index.css +17 -12
- package/dist/component/CustomBubbleMenu/TooltipInputPopover.d.ts +11 -0
- package/dist/component/CustomBubbleMenu/TooltipInputPopover.js +80 -0
- package/dist/component/CustomBubbleMenu/index.js +39 -36
- package/dist/component/CustomDragHandle/index.js +65 -18
- package/dist/component/Icons/index.d.ts +1 -0
- package/dist/component/Icons/index.js +1 -0
- package/dist/component/Icons/tooltip-line-icon.d.ts +6 -0
- package/dist/component/Icons/tooltip-line-icon.js +13 -0
- package/dist/component/Toolbar/EditorInsert/index.js +1 -1
- package/dist/contants/slash-commands.js +1 -1
- package/dist/extension/component/CodeBlock/index.js +18 -5
- package/dist/extension/component/Flow/FlowDiagram.d.ts +7 -0
- package/dist/extension/component/Flow/FlowDiagram.js +52 -0
- package/dist/extension/component/Flow/Insert.js +1 -1
- package/dist/extension/component/Flow/Readonly.js +6 -2
- package/dist/extension/component/Flow/index.d.ts +1 -0
- package/dist/extension/component/Flow/index.js +133 -68
- package/dist/extension/component/Flow/useMermaidRender.js +2 -2
- package/dist/extension/component/Flow/utils.d.ts +10 -1
- package/dist/extension/component/Flow/utils.js +45 -10
- package/dist/extension/component/Image/index.js +57 -46
- package/dist/extension/component/Tooltip/index.d.ts +4 -0
- package/dist/extension/component/Tooltip/index.js +19 -0
- package/dist/extension/index.d.ts +1 -1
- package/dist/extension/index.js +6 -7
- package/dist/extension/mark/Tooltip.d.ts +24 -0
- package/dist/extension/mark/Tooltip.js +141 -0
- package/dist/extension/node/Flow/index.d.ts +8 -1
- package/dist/extension/node/Flow/index.js +41 -4
- package/dist/index.css +1 -1
- package/dist/themes/index.d.ts +1 -1
- package/dist/type/index.d.ts +2 -0
- package/package.json +2 -2
package/dist/Editor/demo.js
CHANGED
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import "../index.css";
|
|
9
9
|
var EDITABLE = true;
|
|
10
10
|
var DEFAULT_CONTENT_TYPE = 'html';
|
|
11
|
-
var DEFAULT_HTML_CONTENT = "<p></p>\n<table style=\"--default-cell-min-width: 100px; min-width: 700px;\"><colgroup><col><col><col><col><col><col><col></colgroup><tbody><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>1</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>2</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>3</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>4</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>5</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>6</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>7</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>q</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>w</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>e</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>r</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>t</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>y</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>u</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>a</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>s</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>d</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>f</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>g</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>h</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>j</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>z</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>x</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>c</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>v</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>b</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>n</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>m</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>i</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>o</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>p</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>k</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>l</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>8</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>9</p></td></tr></tbody></table>\n<hr />\n<div data-type=\"flip-grid\" class=\"flip-grid\"><div data-type=\"flip-grid-column\" data-width=\"42.99\" style=\"width: 42.99%;\"><p><span>PandaWiki \u662F\u4E00\u6B3E AI \u5927\u6A21<code>\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D</code>\u5EFA\u7CFB\u7EDF\uFF0CF<strong>AQ \u3001 \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI </strong>\u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u501F</span><span style=\"color: rgb(90, 141, 218);\">\u52A9\u5927\u6A21\u578B\u7684</span><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B\u91CF\u4E3A\u4F60\u63D0</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B AI \u521B</span><span>\u4F5C\u80FD\u529B\u3002PandaWiki \u662F<u>\u4E00\u6B3E AI \u5927\u6A21\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D\u5EFA\u7CFB\u7EDF\uFF0C\u5E2E</u>\u52A9\u4F60\u5FEB\u901F\u6784\u5EFA\u667A\u80FD\u5316\u7684 <s><u>\u4EA7\u54C1\u6587\u6863\u3001\u6280\u672F</u></s>\u6587\u6863\u3001FAQ \u3001<s> \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684</s>\u529B\u91CF\u7CFB\u7EDF \uFF0C</span><span style=\"background-color: rgb(172, 84, 84);\">\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE</span><span>\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u7684\u529B\u91CF\u4E3A<mark>\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001</mark> AI \u641C\u7D22\u3002</span></p></div><div data-type=\"flip-grid-column\" data-width=\"38.92\" style=\"width: 38.92%;\"><pre><code>var a = 1;\nvar b = 2;\n\nfunction sum(a, b) {\n return a + b\n}</code></pre></div><div data-type=\"flip-grid-column\" data-width=\"18.09\" style=\"width: 18.09%;\"><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u653E\u5047\u554A\u4F46\u662F\u53EF</p></li><li><p>\u653E\u7684\u65F6\u95F4\u653E\u5047</p></li><li><p>\u53EF\u53C2\u8003</p></li><li><p>\u987A\u4E30\u6253\u5361\u5566</p></li></ul></div></div>\n<div data-type=\"flip-grid\" class=\"flip-grid\" style=\"display: flex;\">\n<div data-type=\"flip-grid-column\" class=\"flip-grid-column\" data-width=\"25.2\" style=\"position: relative; padding: 8px; width: 25.2%;\">\n<div class=\"flip-grid-column-inner\"><p>\u53D1\u5BB6\u53F2\u6EF4\u6F0F\u5496\u5561\u5C31\u662F\u90A3\u4EFD\u72EC\u5B88\u7A7A\u623F\u653E\u5047\u554A sd \u5361\u96F7\u950B\u7CBE\u795E\u5927\u8054\u8003\u653E\u5047\u554A\u4F46\u662F\u6D6A\u8D39\u653E\u5047\u5361\u7684\u79C1\u4EBA\u98DE\u673A\u53EF\u80FD\u5565\u5730\u65B9\u5C31\u662F\u4E86\u5FEB\u9012\u8D39\u5C31\u662F\u90A3\u5BA2\u670D\u53D1\u4E0A\u6765\u7684\u5496\u5561\u53EB\u5565\u4E86\u7684\u770B\u6CD5\u5C31\u5F00\u59CB\u5927\u6DA6\u53D1\u5065\u5EB7\u5565\u7684\u53D1\u94FE\u63A5\u6C99\u53D1\u90A3\u662F\u5730\u65B9\u53D1\u70E7\u7684\u51CF\u80A5\u5F00\u59CB\u4F60\u7684\u623F\u95F4\u6740\u4EBA\u72AF\u770B\u89C1\u5565\u4E86\u5F00\u623F\u95F4\u5361\u6B7B\u4E86\u653E\u5047\u5565\u4E86</p></div></div>\n<div data-type=\"flip-grid-column\" class=\"flip-grid-column\" data-width=\"74.8\" style=\"position: relative; padding: 8px; width: 74.8%;\">\n<div class=\"flip-grid-column-inner\"><p>\u653E\u5047\u5565\u4F60\u7684\u770B\u6CD5\u5C31\u662F\u90A3\u80AF\u5B9A\u89E3\u5C01\u4E86\u5237\u5361\u7684\u5C31\u5206\u5F00\u4E86\u715E\u98CE\u666F\u53EF\u80FD\u6C99\u53D1\u4ECA\u5E74\u662F\u7684\u6D6A\u8D39\u7A7A\u95F4\u6536\u5230\u90A3\u5C31\u6CD5\u62C9\u7B2C\u4F1A\u8BA1\u5206\u5F55\u6DF1\u5496\u5561\u5C31\u662F\u4F60\u7684\u653E\u5047\u4E86\u5237\u5361\u53D1\u5BB6\u53F2\u4F10\u5730\u90A3\u975E\u4ECA\u5E74\u5F00\u59CB\u653E\u5047\u4E86\u770B\u7535\u89C6\u5267\u83F2\u5C3C\u514B\u65AF\u5927\u59D0\u592B\u5E74\u5361\u662F fsa.f\uFF0C\u624B\u673A\u8F90\u5C04\u90FD\u653E\u5047\u4E86\u5361\u8428\u5E1D\u89E3\u5C01\u4E86\u6C99\u53D1\u5C31\u662F\u90A3\u5BA2\u670D\u5C31\u662F\u90A3\u5730\u65B9\u5C31\u554A\u8212\u670D\u4E86\u5565\u53D1\u70E7\u90A3\u5757\u5730\u65B9\u5065\u5EB7\u90A3\u662F\u653E\u5047\u554A\u4F60</p></div></div></div>\n<table style=\"min-width: 400px;\"><colgroup><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\">\n <table style=\"min-width: 200px;\"><colgroup><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr></tbody></table>\n</td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr></tbody></table>\n<ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u653E\u5047\u6740\u4EBA\u7684\u65B9\u5F0F\u963F\u51E1\u8FBE</p></li><li><p>\u53D1\u70E7\u5927\u6DA6\u53D1\u770B\u89C1</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u53D1\u5C31\u7B97\u4E86\u5FEB\u9012\u8D39</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u653E\u5047\u554A\u4F46\u662F\u4F60\u770B\u653E\u5047\u554A\u867D\u7136\u653E</p></li></ol></li></ol></li></ol>\n<ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u5BB6\u53F2\u4F60\u7684\u770B\u6CD5</p></li><li><p>\u53D1\u751F\u7684\u6FC0\u70C8\u53CD\u6297\u5565\u7684\u5C31\u53D1\u7684\u662F\u653E\u5047\u4E86</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u70E7\u7684\u798F\u5229\u80AF\u5B9A\u6492\u9152\u75AF\u90A3\u53EF\u662F\u6253\u98DE\u673A\u554A\u662F\u4F60\u7684\u5BA2\u670D\u5C31\u662F\u5927\u6DA6\u53D1</p></li><li><p>\u53D1\u751F\u7684\u6D6A\u8D39\u7A7A\u95F4\u5565\u7684\u5357\u65B9\u5DE8\u517D\u9F99\u7684\u770B\u6CD5\u9759\u5B89\u5BFA\u5E97\u7406\u53D1\u5E08\u89E3\u653E\u4E1C\u8DEF</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u751F\u7684\u53D1\u53D1\u987A\u4E30\u90A3\u53EF\u662F\u6253\u98DE\u673A\u554A\u867D\u7136\u5BA2\u670D</p></li></ul></li></ul></li></ul>\n<ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u5565\u7684</p></div></li><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"true\"><label><input type=\"checkbox\" checked=\"checked\"><span></span></label><div><p>\u53D1\u5565\u5446\u4F60</p><ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u5927\u4E86</p><ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u7684\u65F6\u95F4\u6765\u770B</p></div></li></ul></div></li></ul></div></li></ul>\n<pre data-title=\"\u5B89\u88C5\u76EE\u5F55\"><code>var a = 1;</code></pre>\n<p><img src=\"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg\" width=\"100\"></p>\n<p><img src=\"https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg\" width=\"100\"></p>\n<h6 id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\" data-toc-id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\"><span data-name=\"watch\" data-type=\"emoji\">\u231A</span> \u8868\u683C\u64CD\u4F5C</h6>\n<table><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u94FE\u63A5</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u590D\u6742\u6587\u672C</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u56FE\u7247</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u9644\u4EF6</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><a target=\"_blank\" class=\"MuiBox-root css-1ivg9gg\" type=\"icon\" rel=\"noopener noreferrer\" title=\"\u70B9\u51FB\u6B64\u5904\u8DF3\u8F6C\" href=\"http://localhost:8000/components/editor\">\u70B9\u51FB\u6B64\u5904\u8DF3\u8F6C</a></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><code>\u77E5</code><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B</span><sup>\u5386</sup><sub>\u53F2</sub><u>\u52A8</u><s>\u5927</s><span style=\"background-color: rgb(172, 84, 84);\">\u501F</span><mark>\u7B54</mark></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><img src=\"https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg\" width=\"100\"></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA.txt\" data-size=\"18.27 KB\"></span></p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" controls=\"true\" width=\"75%\"></video></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p><audio src=\"http://vjs.zencdn.net/v/oceans.mp4\" controls=\"true\"></audio></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p></td></tr></tbody></table>\n<p><img src=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" width=\"100\"></p>\n<h6 id=\"a025f782-910f-4f17-9d0b-8f31f9cde175\" data-toc-id=\"a025f782-910f-4f17-9d0b-8f31f9cde175\"><span data-name=\"page_facing_up\" data-type=\"emoji\">\uD83D\uDCC4</span> \u6587\u672C\u5904\u7406</h6>\n<p>PandaWiki \u662F\u4E00\u6B3E AI \u5927\u6A21<code>\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D</code>\u5EFA\u7CFB\u7EDF\uFF0CF<strong>AQ \u3001 \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI </strong>\u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u501F<span style=\"color: rgb(90, 141, 218);\">\u52A9\u5927\u6A21\u578B\u7684</span><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B\u91CF\u4E3A\u4F60\u63D0</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B AI \u521B</span>\u4F5C\u80FD\u529B\u3002PandaWiki \u662F<u>\u4E00\u6B3E AI \u5927\u6A21\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D\u5EFA\u7CFB\u7EDF\uFF0C\u5E2E</u>\u52A9\u4F60\u5FEB\u901F\u6784\u5EFA\u667A\u80FD\u5316\u7684 <s><u>\u4EA7\u54C1\u6587\u6863\u3001\u6280\u672F</u></s>\u6587\u6863\u3001FAQ \u3001<s> \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684</s>\u529B\u91CF\u7CFB\u7EDF \uFF0C<span style=\"background-color: rgb(172, 84, 84);\">\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE</span>\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u7684\u529B\u91CF\u4E3A<mark>\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001</mark> AI \u641C\u7D22\u3002</p>\n<a target=\"_blank\" type=\"block\" href=\"http://localhost:8000/components/editor\" title=\"\u770B\u98CE\u666F\">\u770B\u98CE\u666F</a>\n<h6>\uD83D\uDCCE \u9644\u4EF6</h6>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA\uFF1F\u8C01\u662F\u6211\u4EEC\u7684\u670B\u53CB\uFF1F\u8FD9\u4E2A\u95EE\u9898\u662F\u9769\u547D\u7684\u9996\u8981\u95EE\u9898\u3002\u4E2D\u56FD\u8FC7\u53BB\u4E00\u5207\u9769\u547D\u6597\u4E89\u6210.txt\" data-size=\"18.27 KB\"></div>\n<p>\u884C\u5185\u9644\u4EF6\uFF1A<span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"font_4856251_qynqqohzdp.js\" data-size=\"412.34 KB\"></span><span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u96F7\u6C60\u9879\u76EE\u8BBE\u8BA1\u65B9\u6848.docx\" data-size=\"635.74 KB\"></span></p>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"b0f4a3e0-639f-4c09-ab33-ea9417939f87.tiff\" data-size=\"3.03 MB\"></div>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u957F\u4EAD\u79D1\u6280\u516C\u53F8\u4ECB\u7ECDPPT-25.07.007_\u526F\u672C.pptx\" data-size=\"40.18 MB\"></div>\n<h6><span data-name=\"loudspeaker\" data-type=\"emoji\">\uD83D\uDCE2</span> \u97F3\u9891</h6>\n<audio src=\"http://vjs.zencdn.net/v/oceans.mp4\" controls=\"true\"></audio>\n<h6 id=\"1739ed5e-f03c-4c2f-b763-37505601c935\" data-toc-id=\"1739ed5e-f03c-4c2f-b763-37505601c935\"><span data-name=\"video_camera\" data-type=\"emoji\">\uD83D\uDCF9</span> \u89C6\u9891</h6>\n<video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" controls=\"true\" width=\"400\" data-align=\"center\"></video>\n<h6 id=\"746ea233-0e30-44a6-849a-090202217299\" data-toc-id=\"746ea233-0e30-44a6-849a-090202217299\">\u26A0\uFE0F \u8B66\u544A\u5757</h6>\n<div data-id=\"alert_5ysakwbhvqv\" data-variant=\"warning\" data-type=\"icon\" data-node=\"alert\"><p>\u6B64\u65F6\u8FD9\u662F\u4E00\u4E2A\u8B66\u544A\u5757\u3002</p></div>\n<h6 id=\"ebb64062-9efb-4de8-887f-7f8b7f9e54ca\" data-toc-id=\"ebb64062-9efb-4de8-887f-7f8b7f9e54ca\"><span data-name=\"bar_chart\" data-type=\"emoji\">\uD83D\uDCCA</span> \u6D41\u7A0B\u56FE\u64CD\u4F5C</h6>\n<div data-type=\"flow\" data-code=\"mindmap\n root((mindmap))\n Origins\n Long history\n ::icon(fa fa-book)\n Popularisation\n British popular psychology author Tony Buzan\n Research\n On effectiveness<br/>and features\n On Automatic creation\n Uses\n Creative techniques\n Strategic planning\n Argument mapping\n Tools\n Pen and paper\n Mermaid\" data-width=\"246px\"></div>\n";
|
|
11
|
+
var DEFAULT_HTML_CONTENT = "<p></p>\n<p>PandaWiki \u662F\u4E00\u6B3E AI \u5927\u6A21<code>\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D</code>\u5EFA\u7CFB\u7EDF\uFF0CF<strong>AQ \u3001 \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI </strong>\u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u501F<span style=\"color: rgb(90, 141, 218);\">\u52A9\u5927\u6A21\u578B\u7684</span><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B\u91CF\u4E3A\u4F60\u63D0</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B AI \u521B</span>\u4F5C\u80FD\u529B\u3002PandaWiki \u662F<u>\u4E00\u6B3E AI \u5927\u6A21\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D\u5EFA\u7CFB\u7EDF\uFF0C\u5E2E</u>\u52A9\u4F60\u5FEB\u901F\u6784\u5EFA\u667A\u80FD\u5316\u7684 <s><u>\u4EA7\u54C1\u6587\u6863\u3001\u6280\u672F</u></s>\u6587\u6863\u3001FAQ \u3001<s> \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684</s>\u529B\u91CF\u7CFB\u7EDF \uFF0C<span style=\"background-color: rgb(172, 84, 84);\">\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE</span>\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u7684\u529B\u91CF\u4E3A<mark>\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001</mark> AI \u641C\u7D22\u3002</p>\n<table style=\"--default-cell-min-width: 100px; min-width: 700px;\"><colgroup><col><col><col><col><col><col><col></colgroup><tbody><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>1</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>2</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>3</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>4</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>5</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>6</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>7</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>q</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>w</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>e</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>r</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>t</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>y</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>u</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>a</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>s</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>d</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>f</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>g</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>h</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>j</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>z</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>x</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>c</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>v</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>b</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>n</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>m</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>i</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>o</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>p</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>k</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>l</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>8</p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" style=\"\"><p>9</p></td></tr></tbody></table>\n<hr />\n<div data-type=\"flip-grid\" class=\"flip-grid\"><div data-type=\"flip-grid-column\" data-width=\"42.99\" style=\"width: 42.99%;\"><p><span>PandaWiki \u662F\u4E00\u6B3E AI \u5927\u6A21<code>\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D</code>\u5EFA\u7CFB\u7EDF\uFF0CF<strong>AQ \u3001 \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI </strong>\u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u501F</span><span style=\"color: rgb(90, 141, 218);\">\u52A9\u5927\u6A21\u578B\u7684</span><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B\u91CF\u4E3A\u4F60\u63D0</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B AI \u521B</span><span>\u4F5C\u80FD\u529B\u3002PandaWiki \u662F<u>\u4E00\u6B3E AI \u5927\u6A21\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D\u5EFA\u7CFB\u7EDF\uFF0C\u5E2E</u>\u52A9\u4F60\u5FEB\u901F\u6784\u5EFA\u667A\u80FD\u5316\u7684 <s><u>\u4EA7\u54C1\u6587\u6863\u3001\u6280\u672F</u></s>\u6587\u6863\u3001FAQ \u3001<s> \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684</s>\u529B\u91CF\u7CFB\u7EDF \uFF0C</span><span style=\"background-color: rgb(172, 84, 84);\">\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE</span><span>\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u7684\u529B\u91CF\u4E3A<mark>\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001</mark> AI \u641C\u7D22\u3002</span></p></div><div data-type=\"flip-grid-column\" data-width=\"38.92\" style=\"width: 38.92%;\"><pre><code>var a = 1;\nvar b = 2;\n\nfunction sum(a, b) {\n return a + b\n}</code></pre></div><div data-type=\"flip-grid-column\" data-width=\"18.09\" style=\"width: 18.09%;\"><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u653E\u5047\u554A\u4F46\u662F\u53EF</p></li><li><p>\u653E\u7684\u65F6\u95F4\u653E\u5047</p></li><li><p>\u53EF\u53C2\u8003</p></li><li><p>\u987A\u4E30\u6253\u5361\u5566</p></li></ul></div></div>\n<div data-type=\"flip-grid\" class=\"flip-grid\" style=\"display: flex;\">\n<div data-type=\"flip-grid-column\" class=\"flip-grid-column\" data-width=\"25.2\" style=\"position: relative; padding: 8px; width: 25.2%;\">\n<div class=\"flip-grid-column-inner\"><p>\u53D1\u5BB6\u53F2\u6EF4\u6F0F\u5496\u5561\u5C31\u662F\u90A3\u4EFD\u72EC\u5B88\u7A7A\u623F\u653E\u5047\u554A sd \u5361\u96F7\u950B\u7CBE\u795E\u5927\u8054\u8003\u653E\u5047\u554A\u4F46\u662F\u6D6A\u8D39\u653E\u5047\u5361\u7684\u79C1\u4EBA\u98DE\u673A\u53EF\u80FD\u5565\u5730\u65B9\u5C31\u662F\u4E86\u5FEB\u9012\u8D39\u5C31\u662F\u90A3\u5BA2\u670D\u53D1\u4E0A\u6765\u7684\u5496\u5561\u53EB\u5565\u4E86\u7684\u770B\u6CD5\u5C31\u5F00\u59CB\u5927\u6DA6\u53D1\u5065\u5EB7\u5565\u7684\u53D1\u94FE\u63A5\u6C99\u53D1\u90A3\u662F\u5730\u65B9\u53D1\u70E7\u7684\u51CF\u80A5\u5F00\u59CB\u4F60\u7684\u623F\u95F4\u6740\u4EBA\u72AF\u770B\u89C1\u5565\u4E86\u5F00\u623F\u95F4\u5361\u6B7B\u4E86\u653E\u5047\u5565\u4E86</p></div></div>\n<div data-type=\"flip-grid-column\" class=\"flip-grid-column\" data-width=\"74.8\" style=\"position: relative; padding: 8px; width: 74.8%;\">\n<div class=\"flip-grid-column-inner\"><p>\u653E\u5047\u5565\u4F60\u7684\u770B\u6CD5\u5C31\u662F\u90A3\u80AF\u5B9A\u89E3\u5C01\u4E86\u5237\u5361\u7684\u5C31\u5206\u5F00\u4E86\u715E\u98CE\u666F\u53EF\u80FD\u6C99\u53D1\u4ECA\u5E74\u662F\u7684\u6D6A\u8D39\u7A7A\u95F4\u6536\u5230\u90A3\u5C31\u6CD5\u62C9\u7B2C\u4F1A\u8BA1\u5206\u5F55\u6DF1\u5496\u5561\u5C31\u662F\u4F60\u7684\u653E\u5047\u4E86\u5237\u5361\u53D1\u5BB6\u53F2\u4F10\u5730\u90A3\u975E\u4ECA\u5E74\u5F00\u59CB\u653E\u5047\u4E86\u770B\u7535\u89C6\u5267\u83F2\u5C3C\u514B\u65AF\u5927\u59D0\u592B\u5E74\u5361\u662F fsa.f\uFF0C\u624B\u673A\u8F90\u5C04\u90FD\u653E\u5047\u4E86\u5361\u8428\u5E1D\u89E3\u5C01\u4E86\u6C99\u53D1\u5C31\u662F\u90A3\u5BA2\u670D\u5C31\u662F\u90A3\u5730\u65B9\u5C31\u554A\u8212\u670D\u4E86\u5565\u53D1\u70E7\u90A3\u5757\u5730\u65B9\u5065\u5EB7\u90A3\u662F\u653E\u5047\u554A\u4F60</p></div></div></div>\n<table style=\"min-width: 400px;\"><colgroup><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\">\n <table style=\"min-width: 200px;\"><colgroup><col style=\"min-width: 100px;\"><col style=\"min-width: 100px;\"></colgroup><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr></tbody></table>\n</td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p></p></td></tr></tbody></table>\n<ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u653E\u5047\u6740\u4EBA\u7684\u65B9\u5F0F\u963F\u51E1\u8FBE</p></li><li><p>\u53D1\u70E7\u5927\u6DA6\u53D1\u770B\u89C1</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u53D1\u5C31\u7B97\u4E86\u5FEB\u9012\u8D39</p><ol class=\"ordered-list\" data-type=\"orderedList\"><li><p>\u653E\u5047\u554A\u4F46\u662F\u4F60\u770B\u653E\u5047\u554A\u867D\u7136\u653E</p></li></ol></li></ol></li></ol>\n<ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u5BB6\u53F2\u4F60\u7684\u770B\u6CD5</p></li><li><p>\u53D1\u751F\u7684\u6FC0\u70C8\u53CD\u6297\u5565\u7684\u5C31\u53D1\u7684\u662F\u653E\u5047\u4E86</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u70E7\u7684\u798F\u5229\u80AF\u5B9A\u6492\u9152\u75AF\u90A3\u53EF\u662F\u6253\u98DE\u673A\u554A\u662F\u4F60\u7684\u5BA2\u670D\u5C31\u662F\u5927\u6DA6\u53D1</p></li><li><p>\u53D1\u751F\u7684\u6D6A\u8D39\u7A7A\u95F4\u5565\u7684\u5357\u65B9\u5DE8\u517D\u9F99\u7684\u770B\u6CD5\u9759\u5B89\u5BFA\u5E97\u7406\u53D1\u5E08\u89E3\u653E\u4E1C\u8DEF</p><ul class=\"bullet-list\" data-type=\"bulletList\"><li><p>\u53D1\u751F\u7684\u53D1\u53D1\u987A\u4E30\u90A3\u53EF\u662F\u6253\u98DE\u673A\u554A\u867D\u7136\u5BA2\u670D</p></li></ul></li></ul></li></ul>\n<ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u5565\u7684</p></div></li><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"true\"><label><input type=\"checkbox\" checked=\"checked\"><span></span></label><div><p>\u53D1\u5565\u5446\u4F60</p><ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u5927\u4E86</p><ul data-type=\"taskList\"><li class=\"task-item\" data-type=\"taskItem\" data-checked=\"false\"><label><input type=\"checkbox\"><span></span></label><div><p>\u53D1\u7684\u65F6\u95F4\u6765\u770B</p></div></li></ul></div></li></ul></div></li></ul>\n<pre data-title=\"\u5B89\u88C5\u76EE\u5F55\"><code>var a = 1;</code></pre>\n<p><img src=\"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg\" width=\"100\"></p>\n<p><img src=\"https://fuss10.elemecdn.com/3/28/bbf893f792f03a54408b3b7a7ebf0jpeg.jpeg\" width=\"100\"></p>\n<h6 id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\" data-toc-id=\"4b8d8c4e-29dc-4674-928b-b9ded0e363ae\"><span data-name=\"watch\" data-type=\"emoji\">\u231A</span> \u8868\u683C\u64CD\u4F5C</h6>\n<table><tbody><tr class=\"table-row\"><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u94FE\u63A5</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u590D\u6742\u6587\u672C</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u56FE\u7247</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p>\u9644\u4EF6</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><a target=\"_blank\" class=\"MuiBox-root css-1ivg9gg\" type=\"icon\" rel=\"noopener noreferrer\" title=\"\u70B9\u51FB\u6B64\u5904\u8DF3\u8F6C\" href=\"http://localhost:8000/components/editor\">\u70B9\u51FB\u6B64\u5904\u8DF3\u8F6C</a></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><code>\u77E5</code><span style=\"background-color: rgb(255, 204, 188); color: rgb(90, 141, 218);\">\u529B</span><span style=\"color: rgb(90, 141, 218);\">\u4F9B</span><sup>\u5386</sup><sub>\u53F2</sub><u>\u52A8</u><s>\u5927</s><span style=\"background-color: rgb(172, 84, 84);\">\u501F</span><mark>\u7B54</mark></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><img src=\"https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg\" width=\"100\"></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" data-vertical-align=\"middle\" style=\"text-align: center; vertical-align: middle;\"><p><span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA.txt\" data-size=\"18.27 KB\"></span></p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" controls=\"true\" width=\"75%\"></video></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p><audio src=\"http://vjs.zencdn.net/v/oceans.mp4\" controls=\"true\"></audio></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p></td><td colspan=\"1\" rowspan=\"1\" data-background-color=\"\" data-text-align=\"center\" style=\"text-align: center;\"><p></p></td></tr></tbody></table>\n<p><img src=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" width=\"100\"></p>\n<h6 id=\"a025f782-910f-4f17-9d0b-8f31f9cde175\" data-toc-id=\"a025f782-910f-4f17-9d0b-8f31f9cde175\"><span data-name=\"page_facing_up\" data-type=\"emoji\">\uD83D\uDCC4</span> \u6587\u672C\u5904\u7406</h6>\n<a target=\"_blank\" type=\"block\" href=\"http://localhost:8000/components/editor\" title=\"\u770B\u98CE\u666F\">\u770B\u98CE\u666F</a>\n<h6>\uD83D\uDCCE \u9644\u4EF6</h6>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA\uFF1F\u8C01\u662F\u6211\u4EEC\u7684\u670B\u53CB\uFF1F\u8FD9\u4E2A\u95EE\u9898\u662F\u9769\u547D\u7684\u9996\u8981\u95EE\u9898\u3002\u4E2D\u56FD\u8FC7\u53BB\u4E00\u5207\u9769\u547D\u6597\u4E89\u6210.txt\" data-size=\"18.27 KB\"></div>\n<p>\u884C\u5185\u9644\u4EF6\uFF1A<span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"font_4856251_qynqqohzdp.js\" data-size=\"412.34 KB\"></span><span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u96F7\u6C60\u9879\u76EE\u8BBE\u8BA1\u65B9\u6848.docx\" data-size=\"635.74 KB\"></span></p>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"b0f4a3e0-639f-4c09-ab33-ea9417939f87.tiff\" data-size=\"3.03 MB\"></div>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" data-title=\"\u957F\u4EAD\u79D1\u6280\u516C\u53F8\u4ECB\u7ECDPPT-25.07.007_\u526F\u672C.pptx\" data-size=\"40.18 MB\"></div>\n<h6><span data-name=\"loudspeaker\" data-type=\"emoji\">\uD83D\uDCE2</span> \u97F3\u9891</h6>\n<audio src=\"http://vjs.zencdn.net/v/oceans.mp4\" controls=\"true\"></audio>\n<h6 id=\"1739ed5e-f03c-4c2f-b763-37505601c935\" data-toc-id=\"1739ed5e-f03c-4c2f-b763-37505601c935\"><span data-name=\"video_camera\" data-type=\"emoji\">\uD83D\uDCF9</span> \u89C6\u9891</h6>\n<video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" controls=\"true\" width=\"400\" data-align=\"center\"></video>\n<h6 id=\"746ea233-0e30-44a6-849a-090202217299\" data-toc-id=\"746ea233-0e30-44a6-849a-090202217299\">\u26A0\uFE0F \u8B66\u544A\u5757</h6>\n<div data-id=\"alert_5ysakwbhvqv\" data-variant=\"warning\" data-type=\"icon\" data-node=\"alert\"><p>\u6B64\u65F6\u8FD9\u662F\u4E00\u4E2A\u8B66\u544A\u5757\u3002</p></div>\n<h6 id=\"ebb64062-9efb-4de8-887f-7f8b7f9e54ca\" data-toc-id=\"ebb64062-9efb-4de8-887f-7f8b7f9e54ca\"><span data-name=\"bar_chart\" data-type=\"emoji\">\uD83D\uDCCA</span> \u6D41\u7A0B\u56FE\u64CD\u4F5C</h6>\n<div data-type=\"flow\" data-code=\"mindmap\n root((mindmap))\n Origins\n Long history\n ::icon(fa fa-book)\n Popularisation\n British popular psychology author Tony Buzan\n Research\n On effectiveness<br/>and features\n On Automatic creation\n Uses\n Creative techniques\n Strategic planning\n Argument mapping\n Tools\n Pen and paper\n Mermaid\" data-width=\"246px\"></div>\n";
|
|
12
12
|
var DEFAULT_MARKDOWN_CONTENT = "###### :page_facing_up: \u6587\u672C\u5904\u7406\n\nPandaWiki \u662F\u4E00\u6B3E AI \u5927\u6A21`\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D`\u5EFA\u7CFB\u7EDF\uFF0CF**AQ \u3001 \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI **\u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C\u80FD\u529B\u3002PandaWiki \u662F++\u4E00\u6B3E AI \u5927\u6A21\u578B\u9A71\u52A8\u7684\u5F00\u6E90\u77E5\u8BC6\u5E93\u642D\u5EFA\u7CFB\u7EDF\uFF0C\u5E2E++\u52A9\u4F60\u5FEB\u901F\u6784\u5EFA\u667A\u80FD\u5316\u7684 ++~~\u4EA7\u54C1\u6587\u6863\u3001\u6280\u672F~~++\u6587\u6863\u3001FAQ \u3001~~ \u535A\u5BA2\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684~~\u529B\u91CF\u7CFB\u7EDF \uFF0C\u501F\u52A9\u5927\u6A21\u578B\u7684\u529B\u91CF\u4E3A\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001 AI \u641C\u7D22 \u7B49\u80FD\u529B\u3002\u7684\u529B\u91CF\u4E3A==\u4F60\u63D0\u4F9B AI \u521B\u4F5C \u3001 AI \u95EE\u7B54 \u3001== AI \u641C\u7D22\u3002\n\n###### :video_camera: \u89C6\u9891\n\n<video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" width=\"400\" controls ></video>\n\n###### \u26A0\uFE0F \u8B66\u544A\u5757\n\n:::alert {#alert_5ysakwbhvqv indent=\"0\" variant=\"warning\" type=\"icon\"}\n\n\u6B64\u65F6\u8FD9\u662F\u4E00\u4E2A\u8B66\u544A\u5757\u3002\n\n:::\n\n###### :bar_chart: \u6D41\u7A0B\u56FE\u64CD\u4F5C\n\n```mermaid\nmindmap\n root((mindmap))\n Origins\n Long history\n ::icon(fa fa-book)\n Popularisation\n British popular psychology author Tony Buzan\n Research\n On effectiveness<br/>and features\n On Automatic creation\n Uses\n Creative techniques\n Strategic planning\n Argument mapping\n Tools\n Pen and paper\n Mermaid\n```\n\n###### :watch: \u8868\u683C\u64CD\u4F5C\n\n\n| \u94FE\u63A5 | \u590D\u6742\u6587\u672C | \u56FE\u7247 | \u9644\u4EF6 |\n| ------------------------------------------------------------------------------------------- | --------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |\n| [\u70B9\u51FB\u6B64\u5904\u8DF3\u8F6C](http://localhost:8000/components/editor) | `\u77E5`\u529B\u4F9B^\u5386^~\u53F2~++\u52A8++~~\u5927~~\u501F==\u7B54== |  | <a href=\"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg\" target=\"_blank\" download=\"\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA.txt\">\u8C01\u662F\u6211\u4EEC\u7684\u654C\u4EBA.txt</a> |\n| <video src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\" width=\"75%\" controls ></video> | \x1F | | |\n\n\n";
|
|
13
13
|
var Reader = function Reader() {
|
|
14
14
|
// @ts-ignore
|
|
@@ -676,21 +676,6 @@ var EditorMarkdownToolbar = function EditorMarkdownToolbar(_ref) {
|
|
|
676
676
|
}
|
|
677
677
|
}, "\u4E13\u4E1A"),
|
|
678
678
|
key: 'professional'
|
|
679
|
-
}, {
|
|
680
|
-
label: '流程图',
|
|
681
|
-
key: 'flowchart',
|
|
682
|
-
icon: /*#__PURE__*/React.createElement(FlowChartIcon, {
|
|
683
|
-
sx: {
|
|
684
|
-
fontSize: '1rem'
|
|
685
|
-
}
|
|
686
|
-
}),
|
|
687
|
-
onClick: function onClick() {
|
|
688
|
-
return handleInsertBlock({
|
|
689
|
-
text: '```mermaid\n\n```',
|
|
690
|
-
row: 1,
|
|
691
|
-
wrap: true
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
679
|
}, {
|
|
695
680
|
label: '代码',
|
|
696
681
|
key: 'code',
|
|
@@ -765,6 +750,21 @@ var EditorMarkdownToolbar = function EditorMarkdownToolbar(_ref) {
|
|
|
765
750
|
});
|
|
766
751
|
}
|
|
767
752
|
}]
|
|
753
|
+
}, {
|
|
754
|
+
label: 'Mermaid 流程图',
|
|
755
|
+
key: 'flowchart',
|
|
756
|
+
icon: /*#__PURE__*/React.createElement(FlowChartIcon, {
|
|
757
|
+
sx: {
|
|
758
|
+
fontSize: '1rem'
|
|
759
|
+
}
|
|
760
|
+
}),
|
|
761
|
+
onClick: function onClick() {
|
|
762
|
+
return handleInsertBlock({
|
|
763
|
+
text: '```mermaid\n\n```',
|
|
764
|
+
row: 1,
|
|
765
|
+
wrap: true
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
768
|
}]
|
|
769
769
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
770
770
|
sx: {
|
package/dist/asset/css/index.css
CHANGED
|
@@ -115,6 +115,10 @@
|
|
|
115
115
|
.tiptap.ProseMirror .react-renderer.node-codeBlock,
|
|
116
116
|
.tiptap.ProseMirror .react-renderer.node-blockLink,
|
|
117
117
|
.tiptap.ProseMirror .react-renderer.node-flipGrid,
|
|
118
|
+
.tiptap.ProseMirror .react-renderer.node-audio,
|
|
119
|
+
.tiptap.ProseMirror .react-renderer.node-video,
|
|
120
|
+
.tiptap.ProseMirror .react-renderer.node-flow,
|
|
121
|
+
.tiptap.ProseMirror .react-renderer.node-blockMath,
|
|
118
122
|
.tiptap.ProseMirror .react-renderer.node-blockAttachment {
|
|
119
123
|
display: block;
|
|
120
124
|
margin: 1rem 0;
|
|
@@ -125,27 +129,28 @@
|
|
|
125
129
|
margin-left: 0;
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
.tiptap.ProseMirror .audio-wrapper,
|
|
129
|
-
.tiptap.ProseMirror .video-wrapper,
|
|
130
|
-
.tiptap.ProseMirror .image-wrapper {
|
|
131
|
-
line-height: 0;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
132
|
.tiptap.ProseMirror .react-renderer.node-iframe,
|
|
135
|
-
.tiptap.ProseMirror .
|
|
136
|
-
.tiptap.ProseMirror .
|
|
133
|
+
.tiptap.ProseMirror .react-renderer.node-image,
|
|
134
|
+
.tiptap.ProseMirror .react-renderer.node-audio,
|
|
135
|
+
.tiptap.ProseMirror .react-renderer.node-video,
|
|
136
|
+
.tiptap.ProseMirror .react-renderer.node-blockAttachment,
|
|
137
|
+
.tiptap.ProseMirror .react-renderer.node-inlineAttachment,
|
|
138
|
+
.tiptap.ProseMirror .react-renderer.node-blockLink,
|
|
139
|
+
.tiptap.ProseMirror .react-renderer.node-inlineLink,
|
|
140
|
+
.tiptap.ProseMirror .react-renderer.node-blockMath,
|
|
141
|
+
.tiptap.ProseMirror .react-renderer.node-inlineMath {
|
|
137
142
|
box-sizing: border-box;
|
|
138
143
|
line-height: 1;
|
|
139
144
|
}
|
|
140
145
|
|
|
141
|
-
.tiptap.ProseMirror .image-wrapper {
|
|
142
|
-
display: inline-block;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
146
|
.tiptap.ProseMirror .image-wrapper img {
|
|
146
147
|
line-height: 0;
|
|
147
148
|
}
|
|
148
149
|
|
|
150
|
+
.tiptap.ProseMirror .image-wrapper {
|
|
151
|
+
display: inline-block;
|
|
152
|
+
}
|
|
153
|
+
|
|
149
154
|
.tiptap.ProseMirror .codeblock-wrapper.ProseMirror-selectednode>pre,
|
|
150
155
|
.tiptap.ProseMirror .audio-wrapper.ProseMirror-selectednode>div,
|
|
151
156
|
.tiptap.ProseMirror .video-wrapper.ProseMirror-selectednode>div,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Editor } from "@tiptap/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
interface TooltipInputPopoverProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
anchorEl: HTMLElement | null;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
editor: Editor;
|
|
8
|
+
currentTooltip?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const TooltipInputPopover: React.FC<TooltipInputPopoverProps>;
|
|
11
|
+
export default TooltipInputPopover;
|
|
@@ -0,0 +1,80 @@
|
|
|
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 { FloatingPopover } from "../FloatingPopover";
|
|
8
|
+
import { Box, Button, Stack, TextField } from "@mui/material";
|
|
9
|
+
import React, { useState } from "react";
|
|
10
|
+
var TooltipInputPopover = function TooltipInputPopover(_ref) {
|
|
11
|
+
var open = _ref.open,
|
|
12
|
+
anchorEl = _ref.anchorEl,
|
|
13
|
+
onClose = _ref.onClose,
|
|
14
|
+
editor = _ref.editor,
|
|
15
|
+
_ref$currentTooltip = _ref.currentTooltip,
|
|
16
|
+
currentTooltip = _ref$currentTooltip === void 0 ? '' : _ref$currentTooltip;
|
|
17
|
+
var _useState = useState(currentTooltip),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
tooltipText = _useState2[0],
|
|
20
|
+
setTooltipText = _useState2[1];
|
|
21
|
+
var handleConfirm = function handleConfirm() {
|
|
22
|
+
if (tooltipText.trim()) {
|
|
23
|
+
editor.chain().focus().setTooltip(tooltipText.trim()).run();
|
|
24
|
+
} else {
|
|
25
|
+
editor.chain().focus().unsetTooltip().run();
|
|
26
|
+
}
|
|
27
|
+
onClose();
|
|
28
|
+
};
|
|
29
|
+
var handleCancel = function handleCancel() {
|
|
30
|
+
setTooltipText(currentTooltip);
|
|
31
|
+
onClose();
|
|
32
|
+
};
|
|
33
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
34
|
+
if (event.key === 'Enter') {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
handleConfirm();
|
|
37
|
+
} else if (event.key === 'Escape') {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
handleCancel();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/React.createElement(FloatingPopover, {
|
|
43
|
+
open: open,
|
|
44
|
+
anchorEl: anchorEl,
|
|
45
|
+
onClose: handleCancel,
|
|
46
|
+
placement: "bottom"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
48
|
+
gap: 2,
|
|
49
|
+
sx: {
|
|
50
|
+
p: 2,
|
|
51
|
+
width: 350
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
54
|
+
fullWidth: true,
|
|
55
|
+
size: "small",
|
|
56
|
+
value: tooltipText,
|
|
57
|
+
onChange: function onChange(e) {
|
|
58
|
+
return setTooltipText(e.target.value);
|
|
59
|
+
},
|
|
60
|
+
placeholder: "\u8F93\u5165\u9F20\u6807\u60AC\u505C\u65F6\u663E\u793A\u7684\u63D0\u793A\u6587\u672C",
|
|
61
|
+
required: true,
|
|
62
|
+
error: tooltipText.length > 0 && !tooltipText.trim(),
|
|
63
|
+
helperText: tooltipText.length > 0 && !tooltipText.trim() ? "请输入有效的提示文本" : ""
|
|
64
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
65
|
+
sx: {
|
|
66
|
+
display: 'flex',
|
|
67
|
+
gap: 1,
|
|
68
|
+
justifyContent: 'flex-end'
|
|
69
|
+
}
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
71
|
+
size: "small",
|
|
72
|
+
onClick: handleCancel
|
|
73
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
74
|
+
size: "small",
|
|
75
|
+
variant: "contained",
|
|
76
|
+
onClick: handleConfirm,
|
|
77
|
+
disabled: !tooltipText.trim() && !currentTooltip
|
|
78
|
+
}, tooltipText.trim() ? '应用' : '移除'))));
|
|
79
|
+
};
|
|
80
|
+
export default TooltipInputPopover;
|
|
@@ -1,46 +1,28 @@
|
|
|
1
|
-
|
|
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, EraserLineIcon, ItalicIcon, MarkPenLineIcon, StrikethroughIcon, TooltipLineIcon, UnderlineIcon } from "../Icons";
|
|
2
8
|
import { hasMarksInSelection } from "../../util";
|
|
3
9
|
import { Divider, Paper, Stack } from '@mui/material';
|
|
4
10
|
import { useEditorState } from '@tiptap/react';
|
|
5
11
|
import { BubbleMenu } from '@tiptap/react/menus';
|
|
6
|
-
import React from 'react';
|
|
12
|
+
import React, { useState } from 'react';
|
|
7
13
|
import { ToolbarItem } from "../Toolbar";
|
|
14
|
+
import TooltipInputPopover from "./TooltipInputPopover";
|
|
8
15
|
var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
9
16
|
var editor = _ref.editor,
|
|
10
17
|
more = _ref.more;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
+
var _useState = useState(null),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
tooltipAnchorEl = _useState2[0],
|
|
21
|
+
setTooltipAnchorEl = _useState2[1];
|
|
41
22
|
var _useEditorState = useEditorState({
|
|
42
23
|
editor: editor,
|
|
43
24
|
selector: function selector(ctx) {
|
|
25
|
+
var _ctx$editor$getAttrib;
|
|
44
26
|
return {
|
|
45
27
|
isBold: ctx.editor.isActive('bold'),
|
|
46
28
|
isItalic: ctx.editor.isActive('italic'),
|
|
@@ -48,9 +30,9 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
48
30
|
isUnderline: ctx.editor.isActive('underline'),
|
|
49
31
|
isCode: ctx.editor.isActive('code'),
|
|
50
32
|
isHighlight: ctx.editor.isActive('highlight'),
|
|
33
|
+
isTooltip: ctx.editor.isActive('tooltip'),
|
|
34
|
+
currentTooltip: ((_ctx$editor$getAttrib = ctx.editor.getAttributes('tooltip')) === null || _ctx$editor$getAttrib === void 0 ? void 0 : _ctx$editor$getAttrib.tooltip) || '',
|
|
51
35
|
hasAnyMarks: hasMarksInSelection(ctx.editor.state)
|
|
52
|
-
// isSuperscript: ctx.editor.isActive('superscript'),
|
|
53
|
-
// isSubscript: ctx.editor.isActive('subscript'),
|
|
54
36
|
};
|
|
55
37
|
}
|
|
56
38
|
}),
|
|
@@ -60,11 +42,13 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
60
42
|
isUnderline = _useEditorState.isUnderline,
|
|
61
43
|
isCode = _useEditorState.isCode,
|
|
62
44
|
isHighlight = _useEditorState.isHighlight,
|
|
45
|
+
isTooltip = _useEditorState.isTooltip,
|
|
46
|
+
currentTooltip = _useEditorState.currentTooltip,
|
|
63
47
|
hasAnyMarks = _useEditorState.hasAnyMarks;
|
|
64
48
|
if (editor && !editor.isEditable) {
|
|
65
49
|
return null;
|
|
66
50
|
}
|
|
67
|
-
return /*#__PURE__*/React.createElement(BubbleMenu, {
|
|
51
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BubbleMenu, {
|
|
68
52
|
editor: editor,
|
|
69
53
|
pluginKey: 'bubble-menu',
|
|
70
54
|
updateDelay: 750,
|
|
@@ -149,6 +133,17 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
149
133
|
return editor.chain().focus().toggleCode().run();
|
|
150
134
|
},
|
|
151
135
|
className: isCode ? "tool-active" : ""
|
|
136
|
+
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
137
|
+
icon: /*#__PURE__*/React.createElement(TooltipLineIcon, {
|
|
138
|
+
sx: {
|
|
139
|
+
fontSize: '1rem'
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
onClick: function onClick(event) {
|
|
143
|
+
return setTooltipAnchorEl(event.currentTarget);
|
|
144
|
+
},
|
|
145
|
+
className: isTooltip ? "tool-active" : "",
|
|
146
|
+
tip: "\u6DFB\u52A0\u63D0\u793A\u6587\u672C"
|
|
152
147
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
153
148
|
orientation: "vertical",
|
|
154
149
|
flexItem: true,
|
|
@@ -175,6 +170,14 @@ var CustomBubbleMenu = function CustomBubbleMenu(_ref) {
|
|
|
175
170
|
icon: item.icon || /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
176
171
|
onClick: item.onClick
|
|
177
172
|
});
|
|
178
|
-
}))))
|
|
173
|
+
})))), /*#__PURE__*/React.createElement(TooltipInputPopover, {
|
|
174
|
+
open: Boolean(tooltipAnchorEl),
|
|
175
|
+
anchorEl: tooltipAnchorEl,
|
|
176
|
+
onClose: function onClose() {
|
|
177
|
+
return setTooltipAnchorEl(null);
|
|
178
|
+
},
|
|
179
|
+
editor: editor,
|
|
180
|
+
currentTooltip: currentTooltip
|
|
181
|
+
}));
|
|
179
182
|
};
|
|
180
183
|
export default CustomBubbleMenu;
|
|
@@ -23,7 +23,7 @@ import { Box, Divider, Stack, Typography, useTheme } from '@mui/material';
|
|
|
23
23
|
import DragHandle from '@tiptap/extension-drag-handle-react';
|
|
24
24
|
import { Fragment, Slice } from '@tiptap/pm/model';
|
|
25
25
|
import { NodeSelection } from '@tiptap/pm/state';
|
|
26
|
-
import React, { useCallback, useState } from 'react';
|
|
26
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
27
27
|
import { convertNodeAt, downloadFiles, filterResourcesByType, getAllResources, getShortcutKeyText, hasMarksInBlock } from "../../util";
|
|
28
28
|
import Menu from "../Menu";
|
|
29
29
|
import { ToolbarItem } from "../Toolbar";
|
|
@@ -196,6 +196,46 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}, [current.pos, current.node]);
|
|
199
|
+
useEffect(function () {
|
|
200
|
+
if (!editor) return;
|
|
201
|
+
var handleUpdate = function handleUpdate() {
|
|
202
|
+
var state = editor.state;
|
|
203
|
+
var selection = state.selection;
|
|
204
|
+
|
|
205
|
+
// 获取当前光标位置的节点
|
|
206
|
+
var pos = selection.$head.pos;
|
|
207
|
+
var node = null;
|
|
208
|
+
|
|
209
|
+
// 向上查找最近的块级节点
|
|
210
|
+
for (var depth = selection.$head.depth; depth >= 0; depth--) {
|
|
211
|
+
var _currentNode = selection.$head.node(depth);
|
|
212
|
+
if (_currentNode && _currentNode.isBlock) {
|
|
213
|
+
node = _currentNode;
|
|
214
|
+
pos = selection.$head.before(depth + 1);
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// 如果没找到块级节点,使用根节点
|
|
220
|
+
if (!node) {
|
|
221
|
+
node = state.doc.firstChild;
|
|
222
|
+
pos = 0;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// 更新状态
|
|
226
|
+
if (node) {
|
|
227
|
+
updateNodeChange({
|
|
228
|
+
editor: editor,
|
|
229
|
+
node: node,
|
|
230
|
+
pos: pos
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
editor.on('update', handleUpdate);
|
|
235
|
+
return function () {
|
|
236
|
+
editor.off('update', handleUpdate);
|
|
237
|
+
};
|
|
238
|
+
}, [editor, updateNodeChange]);
|
|
199
239
|
return /*#__PURE__*/React.createElement(DragHandle, {
|
|
200
240
|
editor: editor,
|
|
201
241
|
onNodeChange: updateNodeChange
|
|
@@ -360,13 +400,14 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
360
400
|
while (1) switch (_context.prev = _context.next) {
|
|
361
401
|
case 0:
|
|
362
402
|
if (!(current.node && current.pos !== undefined)) {
|
|
363
|
-
_context.next =
|
|
403
|
+
_context.next = 22;
|
|
364
404
|
break;
|
|
365
405
|
}
|
|
366
406
|
content = new Slice(Fragment.from(current.node), 0, 0);
|
|
367
407
|
textContent = current.node.textContent;
|
|
368
408
|
htmlContent = editor.view.serializeForClipboard(content).dom.innerHTML;
|
|
369
409
|
_context.prev = 4;
|
|
410
|
+
_context.prev = 5;
|
|
370
411
|
if (!(htmlContent && navigator.clipboard && "write" in navigator.clipboard)) {
|
|
371
412
|
_context.next = 11;
|
|
372
413
|
break;
|
|
@@ -377,23 +418,28 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
377
418
|
clipboardItem = new ClipboardItem({
|
|
378
419
|
"text/html": blob
|
|
379
420
|
});
|
|
380
|
-
_context.next =
|
|
421
|
+
_context.next = 11;
|
|
381
422
|
return navigator.clipboard.write([clipboardItem]);
|
|
382
|
-
case 10:
|
|
383
|
-
onTip === null || onTip === void 0 || onTip('success', '复制成功');
|
|
384
423
|
case 11:
|
|
385
424
|
_context.next = 17;
|
|
386
425
|
break;
|
|
387
426
|
case 13:
|
|
388
427
|
_context.prev = 13;
|
|
389
|
-
_context.t0 = _context["catch"](
|
|
428
|
+
_context.t0 = _context["catch"](5);
|
|
390
429
|
_context.next = 17;
|
|
391
430
|
return navigator.clipboard.writeText(textContent);
|
|
392
431
|
case 17:
|
|
432
|
+
_context.next = 22;
|
|
433
|
+
break;
|
|
434
|
+
case 19:
|
|
435
|
+
_context.prev = 19;
|
|
436
|
+
_context.t1 = _context["catch"](4);
|
|
437
|
+
onTip === null || onTip === void 0 || onTip('error', '复制失败');
|
|
438
|
+
case 22:
|
|
393
439
|
case "end":
|
|
394
440
|
return _context.stop();
|
|
395
441
|
}
|
|
396
|
-
}, _callee, null, [[4, 13]]);
|
|
442
|
+
}, _callee, null, [[4, 19], [5, 13]]);
|
|
397
443
|
})),
|
|
398
444
|
icon: /*#__PURE__*/React.createElement(FileCopyLineIcon, {
|
|
399
445
|
sx: {
|
|
@@ -1038,7 +1084,7 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
1038
1084
|
}
|
|
1039
1085
|
}
|
|
1040
1086
|
}]
|
|
1041
|
-
}] : []), _toConsumableArray(currentNode !== null && currentNode !== void 0 && currentNode.download && ((_current$node16 = current.node) !== null && _current$node16 !== void 0 && _current$node16.attrs.src || (_current$node17 = current.node) !== null && _current$node17 !== void 0 && _current$node17.attrs.
|
|
1087
|
+
}] : []), _toConsumableArray(currentNode !== null && currentNode !== void 0 && currentNode.download && ((_current$node16 = current.node) !== null && _current$node16 !== void 0 && _current$node16.attrs.src || (_current$node17 = current.node) !== null && _current$node17 !== void 0 && _current$node17.attrs.url) ? [{
|
|
1042
1088
|
label: "\u4E0B\u8F7D".concat(currentNode === null || currentNode === void 0 ? void 0 : currentNode.label),
|
|
1043
1089
|
key: 'download',
|
|
1044
1090
|
icon: /*#__PURE__*/React.createElement(DownloadLineIcon, {
|
|
@@ -1048,35 +1094,36 @@ var CustomDragHandle = function CustomDragHandle(_ref3) {
|
|
|
1048
1094
|
}),
|
|
1049
1095
|
onClick: function () {
|
|
1050
1096
|
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1051
|
-
var _current$node18, node, nodeFile, nodeBlob, nodeUrl, nodeName, a;
|
|
1097
|
+
var _current$node18, node, srcUrl, nodeFile, nodeBlob, nodeUrl, nodeName, a;
|
|
1052
1098
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1053
1099
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1054
1100
|
case 0:
|
|
1055
1101
|
if (!(current.node && current.pos !== undefined)) {
|
|
1056
|
-
_context3.next =
|
|
1102
|
+
_context3.next = 17;
|
|
1057
1103
|
break;
|
|
1058
1104
|
}
|
|
1059
1105
|
if (![NodeTypeEnum.Video, NodeTypeEnum.Audio, NodeTypeEnum.BlockAttachment].includes((_current$node18 = current.node) === null || _current$node18 === void 0 ? void 0 : _current$node18.type.name)) {
|
|
1060
|
-
_context3.next =
|
|
1106
|
+
_context3.next = 17;
|
|
1061
1107
|
break;
|
|
1062
1108
|
}
|
|
1063
1109
|
node = current.node;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1110
|
+
srcUrl = node.attrs.src || node.attrs.url;
|
|
1111
|
+
_context3.next = 6;
|
|
1112
|
+
return fetch(srcUrl);
|
|
1113
|
+
case 6:
|
|
1067
1114
|
nodeFile = _context3.sent;
|
|
1068
|
-
_context3.next =
|
|
1115
|
+
_context3.next = 9;
|
|
1069
1116
|
return nodeFile.blob();
|
|
1070
|
-
case
|
|
1117
|
+
case 9:
|
|
1071
1118
|
nodeBlob = _context3.sent;
|
|
1072
1119
|
nodeUrl = URL.createObjectURL(nodeBlob);
|
|
1073
|
-
nodeName = node.attrs.title || "".concat(node.type.name, ".").concat(
|
|
1120
|
+
nodeName = node.attrs.title || "".concat(node.type.name, ".").concat(srcUrl.split('.').pop());
|
|
1074
1121
|
a = document.createElement('a');
|
|
1075
1122
|
a.href = nodeUrl;
|
|
1076
1123
|
a.download = nodeName;
|
|
1077
1124
|
a.click();
|
|
1078
1125
|
URL.revokeObjectURL(nodeUrl);
|
|
1079
|
-
case
|
|
1126
|
+
case 17:
|
|
1080
1127
|
case "end":
|
|
1081
1128
|
return _context3.stop();
|
|
1082
1129
|
}
|
|
@@ -137,6 +137,7 @@ export { TableViewIcon } from './table-view-icon';
|
|
|
137
137
|
export { TextIcon } from './text-icon';
|
|
138
138
|
export { TextWrapIcon } from './text-wrap-icon';
|
|
139
139
|
export { TitleIcon } from './title-icon';
|
|
140
|
+
export { TooltipLineIcon } from './tooltip-line-icon';
|
|
140
141
|
export { UnderlineIcon } from './underline-icon';
|
|
141
142
|
export { UploadCloud2LineIcon } from './upload-cloud-2-line-icon';
|
|
142
143
|
export { UploadIcon } from './upload-icon';
|
|
@@ -140,6 +140,7 @@ export { TableViewIcon } from "./table-view-icon";
|
|
|
140
140
|
export { TextIcon } from "./text-icon";
|
|
141
141
|
export { TextWrapIcon } from "./text-wrap-icon";
|
|
142
142
|
export { TitleIcon } from "./title-icon";
|
|
143
|
+
export { TooltipLineIcon } from "./tooltip-line-icon";
|
|
143
144
|
export { UnderlineIcon } from "./underline-icon";
|
|
144
145
|
export { UploadCloud2LineIcon } from "./upload-cloud-2-line-icon";
|
|
145
146
|
export { UploadIcon } from "./upload-icon";
|