@ctzhian/tiptap 2.12.0 → 2.12.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 +2 -2
- package/dist/component/Icons/eye-line-icon.d.ts +6 -0
- package/dist/component/Icons/eye-line-icon.js +13 -0
- package/dist/extension/component/Attachment/AttachmentContent.d.ts +1 -0
- package/dist/extension/component/Attachment/AttachmentContent.js +48 -77
- package/dist/extension/component/Attachment/index.d.ts +1 -0
- package/dist/extension/component/Attachment/index.js +106 -62
- package/dist/extension/node/Attachment.d.ts +1 -0
- package/dist/extension/node/Attachment.js +51 -7
- package/dist/extension/node/FileHandler.d.ts +1 -1
- package/dist/extension/node/Table.d.ts +1 -1
- package/package.json +1 -1
package/dist/Editor/demo.js
CHANGED
|
@@ -6,9 +6,9 @@ import { Editor, EditorThemeProvider, EditorToolbar, useTiptap } from "./..";
|
|
|
6
6
|
import { Box } from '@mui/material';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import "../index.css";
|
|
9
|
-
var EDITABLE =
|
|
9
|
+
var EDITABLE = false;
|
|
10
10
|
var DEFAULT_CONTENT_TYPE = 'html';
|
|
11
|
-
var DEFAULT_HTML_CONTENT = "<p></p>\n<p>PandaWiki \u662F\u4E00\u6B3E <span data-tooltip=\"\u6A21\u578B\">AI</span> \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://pandawiki.dev.baizhi.cloud/static-file/95651441-d695-4e50-8086-2f5075dd8361/0150fbd1-a465-4082-b419-21e49cfd621e.pdf\" data-title=\"\u957F\u4EAD\u79D1\u6280\u516C\u53F8\u4ECB\u7ECDPPT-25.07.007_\u526F\u672C.pdf\" 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 <span data-tooltip=\"\u6A21\u578B\">AI</span> \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\n<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>\n<span data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://pandawiki.dev.baizhi.cloud/static-file/95651441-d695-4e50-8086-2f5075dd8361/0150fbd1-a465-4082-b419-21e49cfd621e.pdf\" data-title=\"\u96F7\u6C60\u9879\u76EE\u8BBE\u8BA1\u65B9\u6848.pdf\" data-size=\"635.74 KB\"></span>\n</p>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://pandawiki.dev.baizhi.cloud/static-file/95651441-d695-4e50-8086-2f5075dd8361/0150fbd1-a465-4082-b419-21e49cfd621e.pdf\" data-title=\"b0f4a3e0-639f-4c09-ab33-ea9417939f87.pdf\" data-size=\"3.03 MB\"></div>\n<div data-tag=\"attachment\" url=\"\" title=\"\" size=\"0\" data-url=\"https://pandawiki.dev.baizhi.cloud/static-file/95651441-d695-4e50-8086-2f5075dd8361/0150fbd1-a465-4082-b419-21e49cfd621e.pdf\" data-view=\"1\" data-title=\"\u957F\u4EAD\u79D1\u6280\u516C\u53F8\u4ECB\u7ECDPPT-25.07.007_\u526F\u672C.pdf\" 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
|
|
@@ -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 EyeLineIcon = function EyeLineIcon(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: "M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
EyeLineIcon.displayName = 'icon-eye-line';
|
|
@@ -12,19 +12,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12
12
|
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; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import { Download2LineIcon, FileIcon } from "../../../component/Icons";
|
|
15
|
+
import { EyeLineIcon } from "../../../component/Icons/eye-line-icon";
|
|
15
16
|
import { Box, IconButton, Stack } from "@mui/material";
|
|
16
17
|
import React, { useState } from "react";
|
|
17
|
-
/**
|
|
18
|
-
* 判断附件是否为 PDF 格式
|
|
19
|
-
*/
|
|
20
|
-
var isPdfFile = function isPdfFile(attrs) {
|
|
21
|
-
var _attrs$title, _attrs$type, _attrs$url;
|
|
22
|
-
var title = ((_attrs$title = attrs.title) === null || _attrs$title === void 0 ? void 0 : _attrs$title.toLowerCase()) || '';
|
|
23
|
-
var type = ((_attrs$type = attrs.type) === null || _attrs$type === void 0 ? void 0 : _attrs$type.toLowerCase()) || '';
|
|
24
|
-
var url = ((_attrs$url = attrs.url) === null || _attrs$url === void 0 ? void 0 : _attrs$url.toLowerCase()) || '';
|
|
25
|
-
return title.endsWith('.pdf') || type.includes('pdf') || type === 'application/pdf' || url.includes('.pdf');
|
|
26
|
-
};
|
|
27
|
-
|
|
28
18
|
/**
|
|
29
19
|
* 附件内容组件
|
|
30
20
|
* 用于渲染附件的实际内容,支持编辑和只读模式
|
|
@@ -32,13 +22,13 @@ var isPdfFile = function isPdfFile(attrs) {
|
|
|
32
22
|
export var AttachmentContent = function AttachmentContent(_ref) {
|
|
33
23
|
var attrs = _ref.attrs,
|
|
34
24
|
type = _ref.type,
|
|
25
|
+
isPdf = _ref.isPdf,
|
|
35
26
|
_ref$editable = _ref.editable,
|
|
36
27
|
editable = _ref$editable === void 0 ? false : _ref$editable;
|
|
37
28
|
var _useState = useState(false),
|
|
38
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
30
|
isHovered = _useState2[0],
|
|
40
31
|
setIsHovered = _useState2[1];
|
|
41
|
-
var isPdf = isPdfFile(attrs);
|
|
42
32
|
var blockStyles = editable ? {
|
|
43
33
|
display: 'flex',
|
|
44
34
|
border: '1px solid',
|
|
@@ -51,6 +41,18 @@ export var AttachmentContent = function AttachmentContent(_ref) {
|
|
|
51
41
|
':hover': {
|
|
52
42
|
borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main'
|
|
53
43
|
}
|
|
44
|
+
} : attrs.view === '1' ? {
|
|
45
|
+
display: 'flex',
|
|
46
|
+
border: '1px solid',
|
|
47
|
+
borderColor: attrs.url === 'error' ? 'error.main' : 'divider',
|
|
48
|
+
cursor: 'pointer',
|
|
49
|
+
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
50
|
+
bgcolor: 'background.paper',
|
|
51
|
+
p: 2,
|
|
52
|
+
color: 'inherit',
|
|
53
|
+
':hover': {
|
|
54
|
+
borderColor: attrs.url === 'error' ? 'error.main' : 'primary.main'
|
|
55
|
+
}
|
|
54
56
|
} : {
|
|
55
57
|
display: 'block'
|
|
56
58
|
};
|
|
@@ -84,70 +86,22 @@ export var AttachmentContent = function AttachmentContent(_ref) {
|
|
|
84
86
|
color: 'primary.main',
|
|
85
87
|
cursor: 'pointer'
|
|
86
88
|
};
|
|
87
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'block' ? isPdf && attrs.url && attrs.url !== 'error' ? /*#__PURE__*/React.createElement(Box, _extends({
|
|
88
|
-
|
|
89
|
-
return setIsHovered(true);
|
|
90
|
-
},
|
|
91
|
-
onMouseLeave: function onMouseLeave() {
|
|
92
|
-
return setIsHovered(false);
|
|
93
|
-
},
|
|
94
|
-
sx: _objectSpread(_objectSpread({}, blockInnerStyles), {}, {
|
|
89
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'block' ? attrs.view === '1' && isPdf && attrs.url && attrs.url !== 'error' ? /*#__PURE__*/React.createElement(Box, _extends({
|
|
90
|
+
sx: _objectSpread(_objectSpread({}, blockStyles), {}, {
|
|
95
91
|
p: 0,
|
|
96
|
-
overflow: 'hidden'
|
|
97
|
-
border: '1px solid',
|
|
98
|
-
borderRadius: 'var(--mui-shape-borderRadius)',
|
|
99
|
-
borderColor: attrs.url === 'error' ? 'error.main' : 'divider'
|
|
92
|
+
overflow: 'hidden'
|
|
100
93
|
})
|
|
101
94
|
}, !editable && {
|
|
102
95
|
'data-title': attrs.title,
|
|
103
96
|
'data-type': type
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
gap: 2,
|
|
108
|
-
sx: {
|
|
109
|
-
p: 2
|
|
110
|
-
}
|
|
111
|
-
}, !editable && {
|
|
112
|
-
'data-title': attrs.title,
|
|
113
|
-
'data-type': type
|
|
114
|
-
}), /*#__PURE__*/React.createElement(FileIcon, {
|
|
115
|
-
sx: {
|
|
116
|
-
fontSize: '1.625rem',
|
|
117
|
-
color: attrs.url === 'error' ? 'error.main' : 'primary.main',
|
|
118
|
-
alignSelf: 'center'
|
|
119
|
-
}
|
|
120
|
-
}), /*#__PURE__*/React.createElement(Stack, {
|
|
121
|
-
sx: {
|
|
122
|
-
flex: 1
|
|
97
|
+
}, {
|
|
98
|
+
onMouseEnter: function onMouseEnter() {
|
|
99
|
+
return setIsHovered(true);
|
|
123
100
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
sx: {
|
|
127
|
-
fontSize: '0.875rem',
|
|
128
|
-
fontWeight: 'bold'
|
|
129
|
-
}
|
|
130
|
-
}, attrs.title), Number(attrs.size) > 0 && /*#__PURE__*/React.createElement(Box, {
|
|
131
|
-
sx: {
|
|
132
|
-
fontSize: '0.75rem',
|
|
133
|
-
color: 'text.secondary'
|
|
134
|
-
}
|
|
135
|
-
}, attrs.size)), isHovered && /*#__PURE__*/React.createElement(Box, {
|
|
136
|
-
component: "a",
|
|
137
|
-
href: attrs.url,
|
|
138
|
-
download: attrs.title,
|
|
139
|
-
target: "_blank"
|
|
140
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
141
|
-
size: "small",
|
|
142
|
-
sx: {
|
|
143
|
-
color: attrs.url === 'error' ? 'error.main' : 'text.disabled',
|
|
144
|
-
alignSelf: 'center'
|
|
145
|
-
}
|
|
146
|
-
}, /*#__PURE__*/React.createElement(Download2LineIcon, {
|
|
147
|
-
sx: {
|
|
148
|
-
fontSize: '1rem'
|
|
101
|
+
onMouseLeave: function onMouseLeave() {
|
|
102
|
+
return setIsHovered(false);
|
|
149
103
|
}
|
|
150
|
-
})
|
|
104
|
+
}), /*#__PURE__*/React.createElement("iframe", {
|
|
151
105
|
src: attrs.url + '#navpanes=0&toolbar=1',
|
|
152
106
|
width: "100%",
|
|
153
107
|
height: "300px",
|
|
@@ -157,12 +111,7 @@ export var AttachmentContent = function AttachmentContent(_ref) {
|
|
|
157
111
|
display: 'block'
|
|
158
112
|
},
|
|
159
113
|
title: attrs.title
|
|
160
|
-
})) : /*#__PURE__*/React.createElement(Box, _extends({
|
|
161
|
-
component: "a",
|
|
162
|
-
href: attrs.url,
|
|
163
|
-
target: "_blank",
|
|
164
|
-
download: attrs.title
|
|
165
|
-
}, !editable && {
|
|
114
|
+
})) : /*#__PURE__*/React.createElement(Box, _extends({}, !editable && {
|
|
166
115
|
'data-title': attrs.title,
|
|
167
116
|
'data-type': attrs.type
|
|
168
117
|
}, {
|
|
@@ -202,7 +151,29 @@ export var AttachmentContent = function AttachmentContent(_ref) {
|
|
|
202
151
|
fontSize: '0.75rem',
|
|
203
152
|
color: 'text.secondary'
|
|
204
153
|
}
|
|
205
|
-
}, attrs.size)), isHovered && /*#__PURE__*/React.createElement(
|
|
154
|
+
}, attrs.size)), isHovered && /*#__PURE__*/React.createElement(Stack, {
|
|
155
|
+
direction: 'row',
|
|
156
|
+
gap: 0.5
|
|
157
|
+
}, isPdf && /*#__PURE__*/React.createElement(Box, {
|
|
158
|
+
component: "a",
|
|
159
|
+
href: attrs.url,
|
|
160
|
+
target: "_blank"
|
|
161
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
162
|
+
size: "small",
|
|
163
|
+
sx: {
|
|
164
|
+
color: attrs.url === 'error' ? 'error.main' : 'text.disabled',
|
|
165
|
+
alignSelf: 'center'
|
|
166
|
+
}
|
|
167
|
+
}, /*#__PURE__*/React.createElement(EyeLineIcon, {
|
|
168
|
+
sx: {
|
|
169
|
+
fontSize: '1rem'
|
|
170
|
+
}
|
|
171
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
172
|
+
component: "a",
|
|
173
|
+
href: attrs.url,
|
|
174
|
+
target: "_blank",
|
|
175
|
+
download: attrs.title
|
|
176
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
206
177
|
size: "small",
|
|
207
178
|
sx: {
|
|
208
179
|
color: attrs.url === 'error' ? 'error.main' : 'text.disabled',
|
|
@@ -212,7 +183,7 @@ export var AttachmentContent = function AttachmentContent(_ref) {
|
|
|
212
183
|
sx: {
|
|
213
184
|
fontSize: '1rem'
|
|
214
185
|
}
|
|
215
|
-
})))) : /*#__PURE__*/React.createElement(Box, _extends({
|
|
186
|
+
})))))) : /*#__PURE__*/React.createElement(Box, _extends({
|
|
216
187
|
component: "a",
|
|
217
188
|
href: attrs.url,
|
|
218
189
|
target: "_blank",
|
|
@@ -7,12 +7,23 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
import { ActionDropdown, FloatingPopover, HoverPopover } from "../../../component";
|
|
9
9
|
import { CarouselViewIcon, DeleteLineIcon, DownloadLineIcon, EditLineIcon, ScrollToBottomLineIcon } from "../../../component/Icons";
|
|
10
|
+
import { EyeLineIcon } from "../../../component/Icons/eye-line-icon";
|
|
10
11
|
import { ToolbarItem } from "../../../component/Toolbar";
|
|
11
12
|
import { Box, Button, Divider, Stack, TextField } from "@mui/material";
|
|
12
13
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
13
14
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
14
15
|
import { AttachmentContent } from "./AttachmentContent";
|
|
15
16
|
import InsertAttachment from "./Insert";
|
|
17
|
+
/**
|
|
18
|
+
* 判断附件是否为 PDF 格式
|
|
19
|
+
*/
|
|
20
|
+
var isPdfFile = function isPdfFile(attrs) {
|
|
21
|
+
var _attrs$title, _attrs$type, _attrs$url;
|
|
22
|
+
var title = ((_attrs$title = attrs.title) === null || _attrs$title === void 0 ? void 0 : _attrs$title.toLowerCase()) || '';
|
|
23
|
+
var type = ((_attrs$type = attrs.type) === null || _attrs$type === void 0 ? void 0 : _attrs$type.toLowerCase()) || '';
|
|
24
|
+
var url = ((_attrs$url = attrs.url) === null || _attrs$url === void 0 ? void 0 : _attrs$url.toLowerCase()) || '';
|
|
25
|
+
return title.endsWith('.pdf') || type.includes('pdf') || type === 'application/pdf' || url.includes('.pdf');
|
|
26
|
+
};
|
|
16
27
|
var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
17
28
|
var editor = _ref.editor,
|
|
18
29
|
node = _ref.node,
|
|
@@ -39,6 +50,7 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
39
50
|
anchorEl = _useState6[0],
|
|
40
51
|
setAnchorEl = _useState6[1];
|
|
41
52
|
var attachmentContentRef = useRef(null);
|
|
53
|
+
var isPdf = isPdfFile(attrs);
|
|
42
54
|
useEffect(function () {
|
|
43
55
|
var title = attrs.title || '';
|
|
44
56
|
setTitle(title.split('.').slice(0, -1).join('.'));
|
|
@@ -51,41 +63,91 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
51
63
|
return setAnchorEl(null);
|
|
52
64
|
};
|
|
53
65
|
var handleConvertAttachmentType = function handleConvertAttachmentType(newType) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
66
|
+
var pos = getPos();
|
|
67
|
+
if (typeof pos !== 'number') return;
|
|
68
|
+
var isBlockType = attachmentDisplayType === 'block';
|
|
69
|
+
var isInlineType = attachmentDisplayType === 'icon';
|
|
70
|
+
var isNewBlockType = newType === 'block' || newType === 'view';
|
|
71
|
+
var isNewInlineType = newType === 'icon';
|
|
72
|
+
if (isBlockType && isNewInlineType) {
|
|
73
|
+
editor.chain().focus().deleteRange({
|
|
74
|
+
from: pos,
|
|
75
|
+
to: pos + node.nodeSize
|
|
76
|
+
}).insertContentAt(pos, {
|
|
77
|
+
type: 'inlineAttachment',
|
|
78
|
+
attrs: {
|
|
79
|
+
url: attrs.url,
|
|
80
|
+
title: attrs.title,
|
|
81
|
+
type: 'icon',
|
|
82
|
+
size: attrs.size
|
|
83
|
+
}
|
|
84
|
+
}).run();
|
|
85
|
+
} else if (isInlineType && isNewBlockType) {
|
|
86
|
+
editor.chain().focus().deleteRange({
|
|
87
|
+
from: pos,
|
|
88
|
+
to: pos + node.nodeSize
|
|
89
|
+
}).insertContentAt(pos, {
|
|
90
|
+
type: 'blockAttachment',
|
|
91
|
+
attrs: {
|
|
92
|
+
url: attrs.url,
|
|
93
|
+
title: attrs.title,
|
|
94
|
+
type: 'block',
|
|
95
|
+
size: attrs.size,
|
|
96
|
+
view: newType === 'view' ? '1' : '0'
|
|
97
|
+
}
|
|
98
|
+
}).run();
|
|
99
|
+
} else if (isBlockType && newType === 'view') {
|
|
100
|
+
updateAttributes === null || updateAttributes === void 0 || updateAttributes({
|
|
101
|
+
view: '1'
|
|
102
|
+
});
|
|
103
|
+
} else if (isBlockType && newType === 'block' && attrs.view === '1') {
|
|
104
|
+
updateAttributes === null || updateAttributes === void 0 || updateAttributes({
|
|
105
|
+
view: '0'
|
|
106
|
+
});
|
|
86
107
|
}
|
|
87
108
|
};
|
|
88
109
|
var renderOperationActions = function renderOperationActions() {
|
|
110
|
+
var typeOptions = [{
|
|
111
|
+
key: 'icon',
|
|
112
|
+
label: '图标文字',
|
|
113
|
+
icon: /*#__PURE__*/React.createElement(ScrollToBottomLineIcon, {
|
|
114
|
+
sx: {
|
|
115
|
+
transform: 'rotate(90deg)',
|
|
116
|
+
fontSize: '1rem'
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
return handleConvertAttachmentType('icon');
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: 'block',
|
|
124
|
+
label: '文字卡片',
|
|
125
|
+
icon: /*#__PURE__*/React.createElement(CarouselViewIcon, {
|
|
126
|
+
sx: {
|
|
127
|
+
transform: 'rotate(90deg)',
|
|
128
|
+
fontSize: '1rem'
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
onClick: function onClick() {
|
|
132
|
+
return handleConvertAttachmentType('block');
|
|
133
|
+
}
|
|
134
|
+
}];
|
|
135
|
+
|
|
136
|
+
// 只有 PDF 文件才显示预览卡片选项
|
|
137
|
+
if (isPdf) {
|
|
138
|
+
typeOptions.push({
|
|
139
|
+
key: 'view',
|
|
140
|
+
label: '预览卡片',
|
|
141
|
+
icon: /*#__PURE__*/React.createElement(CarouselViewIcon, {
|
|
142
|
+
sx: {
|
|
143
|
+
fontSize: '1rem'
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
onClick: function onClick() {
|
|
147
|
+
return handleConvertAttachmentType('view');
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
89
151
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
90
152
|
direction: 'row',
|
|
91
153
|
alignItems: 'center',
|
|
@@ -101,12 +163,16 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
101
163
|
tip: "\u7F16\u8F91",
|
|
102
164
|
onClick: handleShowPopover
|
|
103
165
|
}), /*#__PURE__*/React.createElement(ToolbarItem, {
|
|
104
|
-
icon: /*#__PURE__*/React.createElement(
|
|
166
|
+
icon: isPdf ? /*#__PURE__*/React.createElement(EyeLineIcon, {
|
|
167
|
+
sx: {
|
|
168
|
+
fontSize: '1rem'
|
|
169
|
+
}
|
|
170
|
+
}) : /*#__PURE__*/React.createElement(DownloadLineIcon, {
|
|
105
171
|
sx: {
|
|
106
172
|
fontSize: '1rem'
|
|
107
173
|
}
|
|
108
174
|
}),
|
|
109
|
-
tip:
|
|
175
|
+
tip: isPdf ? '新标签页预览' : '下载',
|
|
110
176
|
onClick: handleDownload
|
|
111
177
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
112
178
|
orientation: "vertical",
|
|
@@ -119,32 +185,8 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
119
185
|
}
|
|
120
186
|
}), /*#__PURE__*/React.createElement(ActionDropdown, {
|
|
121
187
|
id: "attachment-type-dropdown",
|
|
122
|
-
selected: attachmentDisplayType,
|
|
123
|
-
list:
|
|
124
|
-
key: 'icon',
|
|
125
|
-
label: '图标文字',
|
|
126
|
-
icon: /*#__PURE__*/React.createElement(ScrollToBottomLineIcon, {
|
|
127
|
-
sx: {
|
|
128
|
-
transform: 'rotate(90deg)',
|
|
129
|
-
fontSize: '1rem'
|
|
130
|
-
}
|
|
131
|
-
}),
|
|
132
|
-
onClick: function onClick() {
|
|
133
|
-
return handleConvertAttachmentType('icon');
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: 'block',
|
|
137
|
-
label: '卡片',
|
|
138
|
-
icon: /*#__PURE__*/React.createElement(CarouselViewIcon, {
|
|
139
|
-
sx: {
|
|
140
|
-
transform: 'rotate(90deg)',
|
|
141
|
-
fontSize: '1rem'
|
|
142
|
-
}
|
|
143
|
-
}),
|
|
144
|
-
onClick: function onClick() {
|
|
145
|
-
return handleConvertAttachmentType('block');
|
|
146
|
-
}
|
|
147
|
-
}]
|
|
188
|
+
selected: attrs.view === '1' ? 'view' : attachmentDisplayType,
|
|
189
|
+
list: typeOptions
|
|
148
190
|
}), /*#__PURE__*/React.createElement(Divider, {
|
|
149
191
|
orientation: "vertical",
|
|
150
192
|
flexItem: true,
|
|
@@ -189,8 +231,9 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
189
231
|
className: "attachment-wrapper ".concat(attachmentDisplayType === 'block' ? 'block-attachment-wrapper' : ''),
|
|
190
232
|
as: attachmentDisplayType === 'block' ? 'div' : 'span'
|
|
191
233
|
}, /*#__PURE__*/React.createElement(AttachmentContent, {
|
|
234
|
+
isPdf: isPdf,
|
|
192
235
|
attrs: attrs,
|
|
193
|
-
type: attachmentDisplayType,
|
|
236
|
+
type: attachmentDisplayType === 'block' ? 'block' : 'icon',
|
|
194
237
|
editable: false
|
|
195
238
|
}));
|
|
196
239
|
}
|
|
@@ -217,8 +260,9 @@ var AttachmentViewWrapper = function AttachmentViewWrapper(_ref) {
|
|
|
217
260
|
hoverDelay: 500,
|
|
218
261
|
placement: "top"
|
|
219
262
|
}, /*#__PURE__*/React.createElement(AttachmentContent, {
|
|
263
|
+
isPdf: isPdf,
|
|
220
264
|
attrs: attrs,
|
|
221
|
-
type: attachmentDisplayType,
|
|
265
|
+
type: attachmentDisplayType === 'block' ? 'block' : 'icon',
|
|
222
266
|
editable: true
|
|
223
267
|
}))), /*#__PURE__*/React.createElement(FloatingPopover, {
|
|
224
268
|
open: Boolean(anchorEl),
|
|
@@ -51,6 +51,17 @@ export var InlineAttachmentExtension = function InlineAttachmentExtension(props)
|
|
|
51
51
|
'data-size': attributes.size
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
default: 'icon',
|
|
57
|
+
parseHTML: function parseHTML(element) {
|
|
58
|
+
return element.getAttribute('data-type') || 'icon';
|
|
59
|
+
},
|
|
60
|
+
renderHTML: function renderHTML(attributes) {
|
|
61
|
+
return {
|
|
62
|
+
'data-type': attributes.type || 'icon'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
54
65
|
}
|
|
55
66
|
};
|
|
56
67
|
},
|
|
@@ -81,7 +92,8 @@ export var InlineAttachmentExtension = function InlineAttachmentExtension(props)
|
|
|
81
92
|
return {
|
|
82
93
|
url: href,
|
|
83
94
|
title: title,
|
|
84
|
-
size: '0'
|
|
95
|
+
size: '0',
|
|
96
|
+
type: 'icon'
|
|
85
97
|
};
|
|
86
98
|
}
|
|
87
99
|
}];
|
|
@@ -122,7 +134,8 @@ export var InlineAttachmentExtension = function InlineAttachmentExtension(props)
|
|
|
122
134
|
attrs: {
|
|
123
135
|
url: options.url || '',
|
|
124
136
|
title: options.title || '',
|
|
125
|
-
size: options.size || '0'
|
|
137
|
+
size: options.size || '0',
|
|
138
|
+
type: 'icon'
|
|
126
139
|
}
|
|
127
140
|
});
|
|
128
141
|
};
|
|
@@ -151,6 +164,17 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
151
164
|
selectable: true,
|
|
152
165
|
addAttributes: function addAttributes() {
|
|
153
166
|
return {
|
|
167
|
+
view: {
|
|
168
|
+
default: '0',
|
|
169
|
+
parseHTML: function parseHTML(element) {
|
|
170
|
+
return element.getAttribute('data-view') || '0';
|
|
171
|
+
},
|
|
172
|
+
renderHTML: function renderHTML(attributes) {
|
|
173
|
+
return {
|
|
174
|
+
'data-view': attributes.view
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
},
|
|
154
178
|
url: {
|
|
155
179
|
default: '',
|
|
156
180
|
parseHTML: function parseHTML(element) {
|
|
@@ -184,6 +208,17 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
184
208
|
'data-size': attributes.size
|
|
185
209
|
};
|
|
186
210
|
}
|
|
211
|
+
},
|
|
212
|
+
type: {
|
|
213
|
+
default: 'block',
|
|
214
|
+
parseHTML: function parseHTML(element) {
|
|
215
|
+
return element.getAttribute('data-type') || 'block';
|
|
216
|
+
},
|
|
217
|
+
renderHTML: function renderHTML(attributes) {
|
|
218
|
+
return {
|
|
219
|
+
'data-type': attributes.type || 'block'
|
|
220
|
+
};
|
|
221
|
+
}
|
|
187
222
|
}
|
|
188
223
|
};
|
|
189
224
|
},
|
|
@@ -192,10 +227,13 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
192
227
|
tag: 'div[data-tag="attachment"]',
|
|
193
228
|
getAttrs: function getAttrs(dom) {
|
|
194
229
|
if (!(dom instanceof HTMLElement)) return false;
|
|
230
|
+
var viewAttr = dom.getAttribute('data-view');
|
|
195
231
|
return {
|
|
232
|
+
view: viewAttr !== null ? viewAttr : '0',
|
|
196
233
|
url: dom.getAttribute('data-url') || '',
|
|
197
234
|
title: dom.getAttribute('data-title') || '',
|
|
198
|
-
size: dom.getAttribute('data-size') || '0'
|
|
235
|
+
size: dom.getAttribute('data-size') || '0',
|
|
236
|
+
type: dom.getAttribute('data-type') || 'block'
|
|
199
237
|
};
|
|
200
238
|
}
|
|
201
239
|
}, {
|
|
@@ -204,6 +242,7 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
204
242
|
if (!(dom instanceof HTMLElement)) return false;
|
|
205
243
|
var download = dom.getAttribute('download');
|
|
206
244
|
var type = dom.getAttribute('type');
|
|
245
|
+
var view = dom.getAttribute('data-view') || '0';
|
|
207
246
|
|
|
208
247
|
// 只解析 type="block" 的带 download 的 <a> 标签
|
|
209
248
|
if (download === null || type !== 'block') {
|
|
@@ -212,9 +251,11 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
212
251
|
var href = dom.getAttribute('href') || '';
|
|
213
252
|
var title = dom.textContent || dom.getAttribute('title') || dom.getAttribute('download') || '';
|
|
214
253
|
return {
|
|
254
|
+
view: view,
|
|
215
255
|
url: href,
|
|
216
256
|
title: title,
|
|
217
|
-
size: '0'
|
|
257
|
+
size: '0',
|
|
258
|
+
type: 'block'
|
|
218
259
|
};
|
|
219
260
|
}
|
|
220
261
|
}];
|
|
@@ -228,9 +269,10 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
228
269
|
renderMarkdown: function renderMarkdown(node) {
|
|
229
270
|
var _ref5 = node.attrs,
|
|
230
271
|
url = _ref5.url,
|
|
231
|
-
title = _ref5.title
|
|
272
|
+
title = _ref5.title,
|
|
273
|
+
view = _ref5.view;
|
|
232
274
|
if (!url) return '';
|
|
233
|
-
return "<a href=\"".concat(url, "\" type=\"block\" target=\"_blank\" download=\"").concat(title, "\">").concat(title, "</a>");
|
|
275
|
+
return "<a href=\"".concat(url, "\" data-view=\"").concat(view, "\" type=\"block\" target=\"_blank\" download=\"").concat(title, "\">").concat(title, "</a>");
|
|
234
276
|
},
|
|
235
277
|
addCommands: function addCommands() {
|
|
236
278
|
var _this3 = this;
|
|
@@ -241,9 +283,11 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
241
283
|
return commands.insertContent({
|
|
242
284
|
type: _this3.name,
|
|
243
285
|
attrs: {
|
|
286
|
+
view: options.view || '0',
|
|
244
287
|
url: options.url || '',
|
|
245
288
|
title: options.title || '',
|
|
246
|
-
size: options.size || '0'
|
|
289
|
+
size: options.size || '0',
|
|
290
|
+
type: 'block'
|
|
247
291
|
}
|
|
248
292
|
});
|
|
249
293
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UploadFunction } from "../../type";
|
|
2
2
|
export declare const FileHandlerExtension: (props: {
|
|
3
3
|
onUpload?: UploadFunction;
|
|
4
|
-
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "
|
|
4
|
+
}) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "key" | "editor">, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
|
2
2
|
export declare const TableExtension: ({ editable }: {
|
|
3
3
|
editable: boolean;
|
|
4
|
-
}) => (import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>
|
|
4
|
+
}) => (Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>)[];
|
|
5
5
|
export default TableExtension;
|