@ctzhian/tiptap 2.1.7 → 2.1.9

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.
@@ -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<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\" colwidth=\"361\" 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\" colwidth=\"361\" 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\" colwidth=\"361\" 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&lt;br/&gt;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<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<div class=\"tableWrapper\"><div class=\"table-container\"><table style=\"min-width: 500px;\"><colgroup><col style=\"min-width: 100px;\"><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>1</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p>2</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p>3</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p>a</p></th><th class=\"table-header\" colspan=\"1\" rowspan=\"1\" style=\"\"><p>B</p></th></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>4</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>5</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>6</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>C</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>D</p></td></tr><tr class=\"table-row\"><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>7</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>8</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>9</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>E</p></td><td colspan=\"1\" rowspan=\"1\" style=\"\"><p>F</p></td></tr></tbody></table></div><div class=\"table-controls\"></div><div class=\"table-selection-overlay-container\"></div></div>\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\" colwidth=\"361\" 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\" colwidth=\"361\" 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\" colwidth=\"361\" 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&lt;br/&gt;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== | ![](https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg) | <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
@@ -14,7 +14,6 @@ var UploadProgress = function UploadProgress(_ref) {
14
14
  py: 1,
15
15
  transform: 'translateX(-50%)',
16
16
  bgcolor: 'background.default',
17
- zIndex: 10,
18
17
  fontSize: 12,
19
18
  color: 'text.disabled',
20
19
  boxShadow: "0px 4px 20px ".concat(alpha(theme.palette.info.main, 0.25), ", 0px 0px 10px ").concat(alpha(theme.palette.info.main, 0.15)),
@@ -13,7 +13,7 @@ import { Box } from '@mui/material';
13
13
  import React, { useCallback, useEffect, useState } from 'react';
14
14
  import "../index.css";
15
15
  var Reader = function Reader() {
16
- var _useState = useState('![ss](/ss)'),
16
+ var _useState = useState("本文用以记录 Gitlab 相关问题及解答\n\n## 我在使用 `git@git.in.chaitin.net:ns/repo` 时可以访问仓库,但是 `https://git.in.chaitin.net/ns/repo` 无法访问\n\n问题通常出现 git clone 与其他依赖 git 进行的操作,如 `go get` 等,具体报错可能为 `Permission Denied`.\n\n在使用 curl 借助 `CI_JOB_TOKEN` 获取其他仓库 cicd job 产物或者 generic package 时,其具体报错为 `404 Not Found` 的问题.\n\n原因是在使用 `git@git.in.chaitin.net` 时,使用的是 ssh 协议,此时默认使用的是 `~/.ssh` 下的私钥进行认证你在 gitlab 中添加的 `SSH Keys`。而使用 `https://git.in.chaitin.net/ns/repo` 时,使用的是 http 协议,此时默认使用的是 `~/.netrc` 认证你在 gitlab 中申请的 `Access tokens`。部分软件如 `go get` 默认使用的便是 http 来拉取代码,因此需要额外配置。\n\n这里推荐两种解决方案:\n\n1. 配置 `~/.netrc` 文件(推荐)\n\n 在 ~/.netrc 文件中添加以下配置:\n\n ```text\n machine git.in.chaitin.net login git password <your access token>\n ```\n\n 在 gitlab cicd job 中遇到拉取其他仓库时遇到权限问题可以使用本配置,比如可以在 job 的 `before_script` 阶段添加以下命令:\n\n ```shell\n echo \"machine git.in.chaitin.net login git password $CI_JOB_TOKEN\" >> ~/.netrc\n ```\n\n 注意: 其中 `$CI_JOB_TOKEN` 是 job 运行期间生成的 token,其权限与 trigger 用户相同,详见 [CI Job Token](https://docs.gitlab.com/ci/jobs/ci_job_token/)。其 Token 权限由 `pipeline 触发者`权限以及`目标仓库权限`共同决定。因此被拉取的目标仓库也需要保证其 `Setting -> CI/CD -> Job token permissions` 配置正确,允许源仓库的 CI/CD 能够访问到该仓库,否则依然会出现如 `404 Not Found`, `403 Forbidden` 的权限问题。(如果你是 pipeline 触发者,可以手动在浏览器通过 gitlab api 访问目标仓库的 generic package 或者 job artifact 如果可以正常下载,说明是 `Job token permissions` 问题)\n\n2. 配置 `git url replace`\n\n 在 ~/.gitconfig 文件中添加以下配置:\n\n ```ini\n [url \"git@git.in.chaitin.net:\"]\n insteadOf = https://git.in.chaitin.net/\n ```\n\n 这个配置可以将所有 `https://git.in.chaitin.net/` 请求替换为 `git@git.in.chaitin.net:` 使用 ssh 来拉取代码仓库\n\n## 我在 clone gitlab 仓库时没问题,但是 lfs 遇到了 EOF 问题\n\nEOF 在大多数情况下由代理导致,如果代理不允许客户端访问某个网站,行为可能是提早结束连接,导致 `EOF` 错误。如\n\n> 在 ubunu 虚拟机里无法拉取 safeline-aliyun 项目里的 lfs 文件怎么处理?\n\n```bash\nroot@OPS-5108:~/proj/safeline-aliyun# git lfs fetch --all\nfetch: 34 object(s) found, done.\nfetch: Fetching all references...\nbatch response: Post https://git.in.chaitin.net/patronus/safeline-aliyun.git/info/lfs/objects/batch: EOF\nerror: failed to fetch some objects from 'https://git.in.chaitin.net/patronus/safeline-aliyun.git/info/lfs'\n```\n\n可以看到返回了 EOF 问题,经查代理未配置在 git config 中。从 `env` 中可以看到用户配置了 *_proxy 但其中发现 `no_proxy` 配置不正确:\n\n```shell\nroot@OPS-5108:~/proj/safeline-aliyun# env | grep pro\nno_proxy=localhost, 127.0.0.1, ::1\nPWD=/root/proj/safeline-aliyun\nftp_proxy=http://proxy.in.chaitin.net:8123\nhttps_proxy=http://proxy.in.chaitin.net:8123\nproxy=http://proxy.in.chaitin.net:8123\nhttp_proxy=http://proxy.in.chaitin.net:8123\nOLDPWD=/root/proj\n```\n\n需要按照 [代理配置](https://info.chaitin.net/colab-editor/page/%E7%A0%94%E5%8F%91%E4%BD%93%E7%B3%BB%2F%E7%A0%94%E5%8F%91%E6%94%AF%E6%8C%81%2F%E4%BB%A3%E7%90%86%E6%89%AB%E7%9B%B2) 进行正确配置后,重新执行操作,发现 EOF 问题被解决。\n\n## 我在访问公司内部服务时报错 `x509: certificate signed by unknown authority`\n\n公司部分内部服务采用自签名证书,导致客户端在访问这些服务时会遇到 `x509: certificate signed by unknown authority` 错误。为了确保客户端能够信任这些自签名证书,你需要配置信任自签名证书即 CA。\n\n以 debian 系系统举例:\n\n```shell\ncurl -o /usr/local/share/ca-certificates/chaitin_ca.crt -L https://chaitin-ops-public.cn-beijing.oss.aliyuncs.com/Chaitin_Ltd_Root_CA.pem\nupdate-ca-certificates\n```\n\n如果无法访问外网,可以尝试 `http://s3-ephemeral.in.chaitin.net/dev/Chaitin_Ltd_Root_CA.pem`\n\n其他系统 CA 证书安装请参考 [安装CA证书](https://info.chaitin.net/colab-editor/page/IT%E5%8A%9E%E5%85%AC/%E5%8A%9E%E5%85%AC%E7%BD%91%E7%BB%9C/windows%E7%94%A8%E6%88%B7/%E5%A4%87%E9%80%89%E6%96%B9%E6%A1%88%EF%BC%88Windows%EF%BC%89/%E8%AF%81%E4%B9%A6%E5%AE%89%E8%A3%85%28windows%29/%E9%95%BF%E4%BA%AD%E6%A0%B9%E8%AF%81%E4%B9%A6%E5%AE%89%E8%A3%85%28windows%29)\n"),
17
17
  _useState2 = _slicedToArray(_useState, 2),
18
18
  mdContent = _useState2[0],
19
19
  setMdContent = _useState2[1];
@@ -1,4 +1,4 @@
1
- @import 'highlight.js/styles/atom-one-dark.css';
1
+ @import 'highlight.js/styles/atom-one-light.css';
2
2
  @import 'katex/dist/katex.min.css';
3
3
 
4
4
  :root {
@@ -29,6 +29,17 @@
29
29
  text-decoration: none;
30
30
  }
31
31
 
32
+ .tiptap.ProseMirror *:not(pre)>code {
33
+ background-color: var(--mui-palette-background-paper3);
34
+ border: 1px solid var(--mui-palette-divider);
35
+ border-radius: 4px;
36
+ font-size: 90%;
37
+ white-space: break-spaces;
38
+ word-break: break-word;
39
+ overflow-wrap: break-word;
40
+ padding: 0.125rem 0.25rem;
41
+ }
42
+
32
43
  .tiptap.ProseMirror label:has(input[type="checkbox"]) {
33
44
  line-height: 1;
34
45
  padding-top: 0.5rem;
@@ -80,6 +91,10 @@
80
91
  border-color: var(--mui-palette-text-disabled);
81
92
  }
82
93
 
94
+ .tiptap.ProseMirror .react-renderer.node-flow {
95
+ line-height: normal;
96
+ }
97
+
83
98
  .tiptap.ProseMirror .react-renderer.node-image,
84
99
  .tiptap.ProseMirror .react-renderer.node-inlineLink,
85
100
  .tiptap.ProseMirror .react-renderer.node-inlineAttachment,
@@ -93,6 +108,8 @@
93
108
  user-select: none;
94
109
  }
95
110
 
111
+ .tiptap.ProseMirror .react-renderer.node-alert,
112
+ .tiptap.ProseMirror .react-renderer.node-codeBlock,
96
113
  .tiptap.ProseMirror .react-renderer.node-blockLink,
97
114
  .tiptap.ProseMirror .react-renderer.node-blockAttachment {
98
115
  display: block;
@@ -11,8 +11,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { FileCopyLineIcon } from "../../../component/Icons";
12
12
  import { Box, Divider, Stack } from '@mui/material';
13
13
  import { NodeViewContent, NodeViewWrapper } from '@tiptap/react';
14
- import React, { useCallback, useState } from 'react';
15
- var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
14
+ import React, { memo, useCallback, useState } from 'react';
15
+ var ReadonlyCodeBlock = /*#__PURE__*/memo(function (_ref) {
16
16
  var node = _ref.node,
17
17
  selected = _ref.selected;
18
18
  var _useState = useState('复制'),
@@ -26,7 +26,7 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
26
26
  var attrs = node.attrs;
27
27
  var handleCopy = useCallback( /*#__PURE__*/function () {
28
28
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
29
- var codeText;
29
+ var codeText, timer;
30
30
  return _regeneratorRuntime().wrap(function _callee$(_context) {
31
31
  while (1) switch (_context.prev = _context.next) {
32
32
  case 0:
@@ -38,20 +38,21 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
38
38
  return navigator.clipboard.writeText(codeText);
39
39
  case 6:
40
40
  setCopyText('复制成功');
41
- setTimeout(function () {
41
+ timer = setTimeout(function () {
42
42
  setCopyText('复制');
43
43
  }, 2000);
44
- _context.next = 13;
45
- break;
46
- case 10:
47
- _context.prev = 10;
44
+ return _context.abrupt("return", function () {
45
+ return clearTimeout(timer);
46
+ });
47
+ case 11:
48
+ _context.prev = 11;
48
49
  _context.t0 = _context["catch"](3);
49
50
  console.error('复制失败:', _context.t0);
50
- case 13:
51
+ case 14:
51
52
  case "end":
52
53
  return _context.stop();
53
54
  }
54
- }, _callee, null, [[3, 10]]);
55
+ }, _callee, null, [[3, 11]]);
55
56
  }));
56
57
  return function (_x) {
57
58
  return _ref2.apply(this, arguments);
@@ -67,11 +68,11 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
67
68
  return setIsHovering(false);
68
69
  }
69
70
  }, /*#__PURE__*/React.createElement(Box, {
70
- component: "pre",
71
71
  sx: {
72
- p: '0.75rem 1rem',
73
- m: 0,
74
- borderRadius: '6px',
72
+ position: 'relative',
73
+ border: '1px solid',
74
+ borderColor: 'divider',
75
+ borderRadius: 'var(--mui-shape-borderRadius)',
75
76
  overflow: 'hidden'
76
77
  }
77
78
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -80,26 +81,37 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
80
81
  justifyContent: "space-between",
81
82
  className: "codeblock-toolbar",
82
83
  sx: {
84
+ position: 'absolute',
85
+ top: 0,
86
+ left: 0,
87
+ right: 0,
88
+ height: '1.25rem',
89
+ lineHeight: '1.25rem',
90
+ px: 2.5,
91
+ py: 2,
83
92
  zIndex: 1,
84
- mb: 2
93
+ color: 'text.tertiary',
94
+ borderBottom: '1px solid',
95
+ borderColor: 'divider'
85
96
  }
86
97
  }, /*#__PURE__*/React.createElement(Box, {
87
98
  sx: {
88
99
  flex: 1,
89
100
  fontSize: '0.875rem',
90
- color: 'text.tertiary',
91
101
  letterSpacing: '0.01rem'
92
102
  }
93
103
  }, attrs.title || '代码块'), isHovering && /*#__PURE__*/React.createElement(Stack, {
94
104
  direction: "row",
95
105
  alignItems: "center",
96
- gap: 0.5
106
+ gap: 0.5,
107
+ sx: {
108
+ fontSize: '0.75rem'
109
+ }
97
110
  }, /*#__PURE__*/React.createElement(Box, null, attrs.language || 'Auto'), /*#__PURE__*/React.createElement(Divider, {
98
111
  orientation: "vertical",
99
112
  flexItem: true,
100
113
  sx: {
101
- height: '1rem',
102
- mr: 0.5,
114
+ height: '0.75rem',
103
115
  ml: 1,
104
116
  alignSelf: 'center',
105
117
  borderColor: 'divider'
@@ -111,6 +123,7 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
111
123
  onClick: handleCopy,
112
124
  sx: {
113
125
  px: 1,
126
+ py: 0.5,
114
127
  borderRadius: 'var(--mui-shape-borderRadius)',
115
128
  cursor: 'pointer',
116
129
  userSelect: 'none',
@@ -119,22 +132,29 @@ var ReadonlyCodeBlock = function ReadonlyCodeBlock(_ref) {
119
132
  }
120
133
  }, /*#__PURE__*/React.createElement(FileCopyLineIcon, {
121
134
  sx: {
122
- fontSize: '0.875rem',
135
+ fontSize: '0.75rem',
123
136
  color: 'inherit'
124
137
  }
125
138
  }), /*#__PURE__*/React.createElement(Box, {
126
139
  sx: {
127
- fontSize: '0.75rem',
128
140
  lineHeight: 1
129
141
  }
130
- }, copyText)))), /*#__PURE__*/React.createElement(NodeViewContent, {
142
+ }, copyText)))), /*#__PURE__*/React.createElement(Box, {
143
+ component: 'pre',
144
+ sx: {
145
+ m: 0
146
+ }
147
+ }, /*#__PURE__*/React.createElement(NodeViewContent, {
148
+ as: "code",
149
+ className: "hljs",
131
150
  style: {
132
- margin: 0,
151
+ padding: '3rem 1.25rem 0.75rem 1.25rem',
133
152
  fontSize: '0.875rem',
134
153
  lineHeight: '1.5',
135
154
  whiteSpace: 'pre-wrap',
136
155
  wordBreak: 'break-word'
137
156
  }
138
- })));
139
- };
157
+ }))));
158
+ });
159
+ ReadonlyCodeBlock.displayName = 'ReadonlyCodeBlock';
140
160
  export default ReadonlyCodeBlock;
@@ -16,7 +16,7 @@ import { ArrowDownSLineIcon, FileCopyLineIcon } from "../../../component/Icons";
16
16
  import { languages } from "../../../contants/highlight";
17
17
  import { Box, Divider, ListSubheader, MenuItem, Select, Stack, TextField } from '@mui/material';
18
18
  import { NodeViewContent, NodeViewWrapper } from '@tiptap/react';
19
- import React, { useCallback, useState } from 'react';
19
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
20
20
  import ReadonlyCodeBlock from "./Readonly";
21
21
  var CodeBlockView = function CodeBlockView(props) {
22
22
  var node = props.node,
@@ -39,9 +39,9 @@ var CodeBlockView = function CodeBlockView(props) {
39
39
  _useState8 = _slicedToArray(_useState7, 2),
40
40
  searchText = _useState8[0],
41
41
  setSearchText = _useState8[1];
42
- var menuListRef = React.useRef(null);
42
+ var menuListRef = useRef(null);
43
43
  var attrs = node.attrs;
44
- var filteredLanguages = React.useMemo(function () {
44
+ var filteredLanguages = useMemo(function () {
45
45
  if (!searchText) return languages;
46
46
  var lowerSearch = searchText.toLowerCase();
47
47
  return languages.filter(function (lang) {
@@ -50,7 +50,7 @@ var CodeBlockView = function CodeBlockView(props) {
50
50
  }, [searchText]);
51
51
 
52
52
  // 当搜索文本改变时,重置滚动位置
53
- React.useEffect(function () {
53
+ useEffect(function () {
54
54
  if (menuListRef.current) {
55
55
  menuListRef.current.scrollTop = 0;
56
56
  }
@@ -62,7 +62,7 @@ var CodeBlockView = function CodeBlockView(props) {
62
62
  }, [updateAttributes]);
63
63
  var handleCopy = useCallback( /*#__PURE__*/function () {
64
64
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
65
- var codeText;
65
+ var codeText, timer;
66
66
  return _regeneratorRuntime().wrap(function _callee$(_context) {
67
67
  while (1) switch (_context.prev = _context.next) {
68
68
  case 0:
@@ -74,20 +74,21 @@ var CodeBlockView = function CodeBlockView(props) {
74
74
  return navigator.clipboard.writeText(codeText);
75
75
  case 6:
76
76
  setCopyText('复制成功');
77
- setTimeout(function () {
77
+ timer = setTimeout(function () {
78
78
  setCopyText('复制');
79
79
  }, 2000);
80
- _context.next = 13;
81
- break;
82
- case 10:
83
- _context.prev = 10;
80
+ return _context.abrupt("return", function () {
81
+ return clearTimeout(timer);
82
+ });
83
+ case 11:
84
+ _context.prev = 11;
84
85
  _context.t0 = _context["catch"](3);
85
86
  console.error('复制失败:', _context.t0);
86
- case 13:
87
+ case 14:
87
88
  case "end":
88
89
  return _context.stop();
89
90
  }
90
- }, _callee, null, [[3, 10]]);
91
+ }, _callee, null, [[3, 11]]);
91
92
  }));
92
93
  return function (_x) {
93
94
  return _ref.apply(this, arguments);
@@ -109,8 +110,10 @@ var CodeBlockView = function CodeBlockView(props) {
109
110
  }, [titleValue, updateAttributes]);
110
111
  var handleTitleKeyDown = useCallback(function (event) {
111
112
  if (event.key === 'Enter') {
113
+ event.preventDefault();
112
114
  handleTitleSubmit();
113
115
  } else if (event.key === 'Escape') {
116
+ event.preventDefault();
114
117
  setTitleValue(attrs.title || '');
115
118
  setShowTitleInput(false);
116
119
  }
@@ -122,11 +125,11 @@ var CodeBlockView = function CodeBlockView(props) {
122
125
  className: "codeblock-wrapper ".concat(selected ? 'ProseMirror-selectednode' : ''),
123
126
  "data-drag-handle": true
124
127
  }, /*#__PURE__*/React.createElement(Box, {
125
- component: "pre",
126
128
  sx: {
127
- p: '0.75rem 1rem',
128
- m: 0,
129
- borderRadius: showTitleInput ? '6px 6px 0 0 !important' : '6px',
129
+ position: 'relative',
130
+ border: '1px solid',
131
+ borderColor: 'divider',
132
+ borderRadius: 'var(--mui-shape-borderRadius)',
130
133
  overflow: 'hidden'
131
134
  }
132
135
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -135,14 +138,25 @@ var CodeBlockView = function CodeBlockView(props) {
135
138
  justifyContent: "space-between",
136
139
  className: "codeblock-toolbar",
137
140
  sx: {
141
+ position: 'absolute',
142
+ top: 0,
143
+ left: 0,
144
+ right: 0,
145
+ height: '1.25rem',
146
+ lineHeight: '1.25rem',
147
+ px: 2.5,
148
+ py: 2,
138
149
  zIndex: 1,
139
- mb: 2
150
+ color: 'text.tertiary',
151
+ borderBottom: '1px solid',
152
+ borderColor: 'divider'
140
153
  }
141
154
  }, showTitleInput ? /*#__PURE__*/React.createElement(Box, {
142
155
  sx: {
143
- py: 0.5,
144
156
  flex: 1,
145
- borderRadius: '0 0 4px 4px',
157
+ height: '1.25rem',
158
+ lineHeight: '1.25rem',
159
+ borderRadius: '4px',
146
160
  bgcolor: 'background.paper3',
147
161
  boxSizing: 'border-box',
148
162
  letterSpacing: '0.01rem'
@@ -159,8 +173,8 @@ var CodeBlockView = function CodeBlockView(props) {
159
173
  sx: {
160
174
  '& .MuiInputBase-input': {
161
175
  p: 0,
162
- height: '0.875rem',
163
- lineHeight: 1,
176
+ height: '1.25rem',
177
+ lineHeight: '1.25rem',
164
178
  fontSize: '0.875rem',
165
179
  color: 'text.tertiary'
166
180
  },
@@ -179,7 +193,6 @@ var CodeBlockView = function CodeBlockView(props) {
179
193
  sx: {
180
194
  flex: 1,
181
195
  fontSize: '0.875rem',
182
- color: 'text.tertiary',
183
196
  letterSpacing: '0.01rem'
184
197
  },
185
198
  onClick: handleTitleToggle
@@ -187,6 +200,7 @@ var CodeBlockView = function CodeBlockView(props) {
187
200
  direction: "row",
188
201
  alignItems: "center",
189
202
  sx: {
203
+ fontSize: '0.75rem',
190
204
  flexShrink: 0
191
205
  }
192
206
  }, /*#__PURE__*/React.createElement(Select, {
@@ -298,7 +312,7 @@ var CodeBlockView = function CodeBlockView(props) {
298
312
  orientation: "vertical",
299
313
  flexItem: true,
300
314
  sx: {
301
- height: '1.25rem',
315
+ height: '1rem',
302
316
  alignSelf: 'center',
303
317
  borderColor: 'divider'
304
318
  }
@@ -312,27 +326,34 @@ var CodeBlockView = function CodeBlockView(props) {
312
326
  py: 0.5,
313
327
  borderRadius: 'var(--mui-shape-borderRadius)',
314
328
  cursor: 'pointer',
315
- '&:hover': {
316
- bgcolor: 'action.hover'
317
- }
329
+ userSelect: 'none',
330
+ bgcolor: 'inherit',
331
+ color: 'inherit'
318
332
  }
319
333
  }, /*#__PURE__*/React.createElement(FileCopyLineIcon, {
320
334
  sx: {
321
- fontSize: '0.875rem',
335
+ fontSize: '0.75rem',
322
336
  color: 'inherit'
323
337
  }
324
338
  }), /*#__PURE__*/React.createElement(Box, {
325
339
  sx: {
326
- fontSize: '0.75rem',
327
340
  lineHeight: 1
328
341
  }
329
- }, copyText)))), /*#__PURE__*/React.createElement(NodeViewContent, {
342
+ }, copyText)))), /*#__PURE__*/React.createElement(Box, {
343
+ component: 'pre',
344
+ sx: {
345
+ m: 0
346
+ }
347
+ }, /*#__PURE__*/React.createElement(NodeViewContent, {
348
+ as: "code",
349
+ className: "hljs",
330
350
  style: {
331
- margin: 0,
351
+ padding: '3rem 1.25rem 0.75rem 1.25rem',
332
352
  fontSize: '0.875rem',
353
+ lineHeight: '1.5',
333
354
  whiteSpace: 'pre-wrap',
334
355
  wordBreak: 'break-word'
335
356
  }
336
- })));
357
+ }))));
337
358
  };
338
359
  export default CodeBlockView;
@@ -228,8 +228,7 @@ var FlowViewWrapper = function FlowViewWrapper(_ref) {
228
228
  '&:hover': {
229
229
  borderColor: 'primary.main'
230
230
  },
231
- transition: 'background-color 0.2s ease',
232
- zIndex: 10
231
+ transition: 'background-color 0.2s ease'
233
232
  }
234
233
  }), /*#__PURE__*/React.createElement(Box, {
235
234
  onMouseDown: function onMouseDown(e) {
@@ -249,8 +248,7 @@ var FlowViewWrapper = function FlowViewWrapper(_ref) {
249
248
  '&:hover': {
250
249
  borderColor: 'primary.main'
251
250
  },
252
- transition: 'background-color 0.2s ease',
253
- zIndex: 10
251
+ transition: 'background-color 0.2s ease'
254
252
  }
255
253
  }), /*#__PURE__*/React.createElement(Box, {
256
254
  onMouseDown: function onMouseDown(e) {
@@ -270,8 +268,7 @@ var FlowViewWrapper = function FlowViewWrapper(_ref) {
270
268
  '&:hover': {
271
269
  borderColor: 'primary.main'
272
270
  },
273
- transition: 'background-color 0.2s ease',
274
- zIndex: 10
271
+ transition: 'background-color 0.2s ease'
275
272
  }
276
273
  }), /*#__PURE__*/React.createElement(Box, {
277
274
  onMouseDown: function onMouseDown(e) {
@@ -291,8 +288,7 @@ var FlowViewWrapper = function FlowViewWrapper(_ref) {
291
288
  '&:hover': {
292
289
  borderColor: 'primary.main'
293
290
  },
294
- transition: 'background-color 0.2s ease',
295
- zIndex: 10
291
+ transition: 'background-color 0.2s ease'
296
292
  }
297
293
  }))))), isEditing && /*#__PURE__*/React.createElement(EditFlow, {
298
294
  anchorEl: editButtonRef.current,
@@ -223,8 +223,7 @@ var IframeViewWrapper = function IframeViewWrapper(_ref) {
223
223
  '&:hover': {
224
224
  bgcolor: 'primary.main'
225
225
  },
226
- transition: 'background-color 0.2s ease',
227
- zIndex: 10
226
+ transition: 'background-color 0.2s ease'
228
227
  }
229
228
  }), (isHovering || isDraggingHeight) && /*#__PURE__*/React.createElement(Box, {
230
229
  onMouseDown: handleMouseDownHeight,
@@ -241,8 +240,7 @@ var IframeViewWrapper = function IframeViewWrapper(_ref) {
241
240
  '&:hover': {
242
241
  bgcolor: 'primary.main'
243
242
  },
244
- transition: 'background-color 0.2s ease',
245
- zIndex: 10
243
+ transition: 'background-color 0.2s ease'
246
244
  }
247
245
  }), (isHovering || !!anchorEl) && /*#__PURE__*/React.createElement(Box, {
248
246
  className: "iframe-controls",
@@ -444,8 +444,7 @@ var ImageViewWrapper = function ImageViewWrapper(_ref) {
444
444
  '&:hover': {
445
445
  borderColor: 'primary.main'
446
446
  },
447
- transition: 'background-color 0.2s ease',
448
- zIndex: 10
447
+ transition: 'background-color 0.2s ease'
449
448
  }
450
449
  }), /*#__PURE__*/React.createElement(Box, {
451
450
  onMouseDown: function onMouseDown(e) {
@@ -465,8 +464,7 @@ var ImageViewWrapper = function ImageViewWrapper(_ref) {
465
464
  '&:hover': {
466
465
  borderColor: 'primary.main'
467
466
  },
468
- transition: 'background-color 0.2s ease',
469
- zIndex: 10
467
+ transition: 'background-color 0.2s ease'
470
468
  }
471
469
  }), /*#__PURE__*/React.createElement(Box, {
472
470
  onMouseDown: function onMouseDown(e) {
@@ -486,8 +484,7 @@ var ImageViewWrapper = function ImageViewWrapper(_ref) {
486
484
  '&:hover': {
487
485
  borderColor: 'primary.main'
488
486
  },
489
- transition: 'background-color 0.2s ease',
490
- zIndex: 10
487
+ transition: 'background-color 0.2s ease'
491
488
  }
492
489
  }), /*#__PURE__*/React.createElement(Box, {
493
490
  onMouseDown: function onMouseDown(e) {
@@ -507,8 +504,7 @@ var ImageViewWrapper = function ImageViewWrapper(_ref) {
507
504
  '&:hover': {
508
505
  borderColor: 'primary.main'
509
506
  },
510
- transition: 'background-color 0.2s ease',
511
- zIndex: 10
507
+ transition: 'background-color 0.2s ease'
512
508
  }
513
509
  }))), attrs.title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Box, {
514
510
  component: "span",
@@ -1,6 +1,5 @@
1
1
  import { SkipDownIcon, SkipLeftIcon, SkipRightIcon, SkipUpIcon } from "../../../component/Icons";
2
2
  import { Box } from '@mui/material';
3
- import { TableMap } from '@tiptap/pm/tables';
4
3
  import React, { useCallback } from 'react';
5
4
  import { selectCellsByCoords } from "../../../util/table-utils";
6
5
  export var TableHandleAddButton = function TableHandleAddButton(_ref) {
@@ -15,32 +14,17 @@ export var TableHandleAddButton = function TableHandleAddButton(_ref) {
15
14
  return;
16
15
  }
17
16
  try {
18
- // 先选中当前行/列
19
- var _TableMap$get = TableMap.get(tableNode),
20
- width = _TableMap$get.width,
21
- height = _TableMap$get.height;
22
- var start = orientation === 'row' ? {
17
+ var cellCoord = orientation === 'row' ? {
23
18
  row: index,
24
19
  col: 0
25
20
  } : {
26
21
  row: 0,
27
22
  col: index
28
23
  };
29
- var end = orientation === 'row' ? {
30
- row: index,
31
- col: width - 1
32
- } : {
33
- row: height - 1,
34
- col: index
35
- };
36
-
37
- // 选中行/列
38
- selectCellsByCoords(editor, tablePos, [start, end], {
24
+ selectCellsByCoords(editor, tablePos, [cellCoord], {
39
25
  mode: 'dispatch',
40
26
  dispatch: editor.view.dispatch.bind(editor.view)
41
27
  });
42
-
43
- // 执行插入操作
44
28
  if (orientation === 'row') {
45
29
  editor.chain().focus()[direction === 'before' ? 'addRowBefore' : 'addRowAfter']().run();
46
30
  } else {
@@ -51,11 +35,6 @@ export var TableHandleAddButton = function TableHandleAddButton(_ref) {
51
35
  }
52
36
  }, [editor, orientation, index, tableNode, tablePos, direction]);
53
37
  if (!(editor !== null && editor !== void 0 && editor.isEditable)) return null;
54
- var iconStyle = {
55
- width: '0.75rem',
56
- height: '0.75rem',
57
- flexShrink: 0
58
- };
59
38
  var Icon = orientation === 'row' ? direction === 'before' ? SkipUpIcon : SkipDownIcon : direction === 'before' ? SkipLeftIcon : SkipRightIcon;
60
39
  var ariaLabel = orientation === 'row' ? direction === 'before' ? '上方插入行' : '下方插入行' : direction === 'before' ? '左侧插入列' : '右侧插入列';
61
40
  return /*#__PURE__*/React.createElement(Box, {
@@ -82,6 +61,10 @@ export var TableHandleAddButton = function TableHandleAddButton(_ref) {
82
61
  },
83
62
  "aria-label": ariaLabel
84
63
  }, /*#__PURE__*/React.createElement(Icon, {
85
- sx: iconStyle
64
+ sx: {
65
+ width: '0.75rem',
66
+ height: '0.75rem',
67
+ flexShrink: 0
68
+ }
86
69
  }));
87
70
  };
@@ -207,6 +207,19 @@ export var TableHandleMenu = function TableHandleMenu(_ref) {
207
207
  }
208
208
  }),
209
209
  onClick: function onClick() {
210
+ if (typeof index === 'number' && typeof tablePos === 'number') {
211
+ var cellCoord = orientation === 'row' ? {
212
+ row: index,
213
+ col: 0
214
+ } : {
215
+ row: 0,
216
+ col: index
217
+ };
218
+ selectCellsByCoords(editor, tablePos, [cellCoord], {
219
+ mode: 'dispatch',
220
+ dispatch: editor.view.dispatch.bind(editor.view)
221
+ });
222
+ }
210
223
  if (orientation === 'row') {
211
224
  editor.chain().focus().addRowBefore().run();
212
225
  } else {
@@ -226,6 +239,19 @@ export var TableHandleMenu = function TableHandleMenu(_ref) {
226
239
  }
227
240
  }),
228
241
  onClick: function onClick() {
242
+ if (typeof index === 'number' && typeof tablePos === 'number') {
243
+ var cellCoord = orientation === 'row' ? {
244
+ row: index,
245
+ col: 0
246
+ } : {
247
+ row: 0,
248
+ col: index
249
+ };
250
+ selectCellsByCoords(editor, tablePos, [cellCoord], {
251
+ mode: 'dispatch',
252
+ dispatch: editor.view.dispatch.bind(editor.view)
253
+ });
254
+ }
229
255
  if (orientation === 'row') {
230
256
  editor.chain().focus().addRowAfter().run();
231
257
  } else {
@@ -130,8 +130,7 @@ var createHandleStyles = function createHandleStyles() {
130
130
  alignItems: 'center',
131
131
  justifyContent: 'center',
132
132
  background: 'transparent',
133
- pointerEvents: 'auto',
134
- zIndex: 10
133
+ pointerEvents: 'auto'
135
134
  };
136
135
  };
137
136
  var createCornerHandleStyles = function createCornerHandleStyles(position, isActiveHandle) {
@@ -409,8 +408,7 @@ export var TableSelectionOverlay = function TableSelectionOverlay(_ref2) {
409
408
  }, /*#__PURE__*/React.createElement("div", {
410
409
  ref: refs.setFloating,
411
410
  style: _objectSpread(_objectSpread({}, floatingStyles), {}, {
412
- pointerEvents: 'none',
413
- zIndex: 10
411
+ pointerEvents: 'none'
414
412
  })
415
413
  }, /*#__PURE__*/React.createElement("div", {
416
414
  className: "tiptap-table-selection-overlay"
@@ -444,8 +444,7 @@ var VideoViewWrapper = function VideoViewWrapper(_ref) {
444
444
  '&:hover': {
445
445
  borderColor: 'primary.main'
446
446
  },
447
- transition: 'background-color 0.2s ease',
448
- zIndex: 10
447
+ transition: 'background-color 0.2s ease'
449
448
  }
450
449
  }), /*#__PURE__*/React.createElement(Box, {
451
450
  onMouseDown: function onMouseDown(e) {
@@ -465,8 +464,7 @@ var VideoViewWrapper = function VideoViewWrapper(_ref) {
465
464
  '&:hover': {
466
465
  borderColor: 'primary.main'
467
466
  },
468
- transition: 'background-color 0.2s ease',
469
- zIndex: 10
467
+ transition: 'background-color 0.2s ease'
470
468
  }
471
469
  }), /*#__PURE__*/React.createElement(Box, {
472
470
  onMouseDown: function onMouseDown(e) {
@@ -486,8 +484,7 @@ var VideoViewWrapper = function VideoViewWrapper(_ref) {
486
484
  '&:hover': {
487
485
  borderColor: 'primary.main'
488
486
  },
489
- transition: 'background-color 0.2s ease',
490
- zIndex: 10
487
+ transition: 'background-color 0.2s ease'
491
488
  }
492
489
  }), /*#__PURE__*/React.createElement(Box, {
493
490
  onMouseDown: function onMouseDown(e) {
@@ -507,8 +504,7 @@ var VideoViewWrapper = function VideoViewWrapper(_ref) {
507
504
  '&:hover': {
508
505
  borderColor: 'primary.main'
509
506
  },
510
- transition: 'background-color 0.2s ease',
511
- zIndex: 10
507
+ transition: 'background-color 0.2s ease'
512
508
  }
513
509
  }))))), /*#__PURE__*/React.createElement(FloatingPopover, {
514
510
  open: Boolean(anchorEl),
@@ -11,6 +11,7 @@ import { ReactNodeViewRenderer } from "@tiptap/react";
11
11
  import { all, createLowlight } from 'lowlight';
12
12
  import CodeBlockView from "../component/CodeBlock";
13
13
  var lowlight = createLowlight(all);
14
+ console.log(lowlight.listLanguages());
14
15
  var CustomCodeBlock = CodeBlockLowlight.configure({
15
16
  enableTabIndentation: true,
16
17
  tabSize: 1,
@@ -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, "key" | "editor">, any>;
4
+ }) => import("@tiptap/core").Extension<Omit<import("@tiptap/extension-file-handler").FileHandlePluginOptions, "editor" | "key">, any>;
package/dist/index.css CHANGED
@@ -137,12 +137,15 @@
137
137
  }
138
138
 
139
139
  .tiptap.ProseMirror ul:not([data-type='taskList']) li::before {
140
- content: '' !important;
140
+ content: '' !important;
141
+ display: inline-block;
142
+ width: 8px;
143
+ height: 8px !important;
141
144
  position: absolute;
142
- top: 0;
145
+ top: 0.5rem;
143
146
  left: -24px;
144
- font-size: 20px;
145
- color: var(--mui-palette-primary-main);
147
+ background: var(--mui-palette-primary-main);
148
+ border-radius: 50%;
146
149
  }
147
150
 
148
151
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul {
@@ -150,18 +153,27 @@
150
153
  }
151
154
 
152
155
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul li::before {
153
- content: '◦' !important;
154
- font-size: 15px;
156
+ width: 5px;
157
+ height: 5px !important;
158
+ background: transparent;
159
+ border: 1.5px solid var(--mui-palette-primary-main);
160
+ border-radius: 50%;
155
161
  }
156
162
 
157
163
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul li::before {
158
- content: '▪' !important;
159
- font-size: 20px;
164
+ width: 4px;
165
+ height: 4px !important;
166
+ background: var(--mui-palette-primary-main);
167
+ border-radius: 0;
160
168
  }
161
169
 
162
170
  .tiptap.ProseMirror ul:not([data-type='taskList']) ul ul ul li::before {
163
- content: '•' !important;
164
- font-size: 20px;
171
+ width: 4px;
172
+ height: 4px !important;
173
+ background: transparent;
174
+ border: 1.5px solid var(--mui-palette-primary-main);
175
+ border-radius: 0;
176
+ transform: rotate(45deg);
165
177
  }
166
178
 
167
179
  .tiptap.ProseMirror ul[data-type='taskList'] {
@@ -190,7 +202,7 @@
190
202
  flex-grow: 1;
191
203
  }
192
204
 
193
- .tiptap.ProseMirror ul[data-type='taskList'] li[data-checked='true']>div {
205
+ .tiptap.ProseMirror ul[data-type='taskList'] li[data-checked='true']>div>*:not(ul) {
194
206
  color: var(--mui-palette-text-tertiary);
195
207
  opacity: 0.7;
196
208
  text-decoration: line-through;
@@ -208,53 +220,6 @@
208
220
  margin: 0;
209
221
  }
210
222
 
211
- /* code */
212
- .tiptap.ProseMirror .codeblock-wrapper {
213
- margin: 20px 0;
214
- }
215
-
216
- .tiptap.ProseMirror pre {
217
- position: relative;
218
- border: 1px solid;
219
- border-color: var(--mui-palette-divider);
220
- border-radius: var(--mui-shape-borderRadius);
221
- color: var(--mui-palette-text-tertiary);
222
- background-color: var(--mui-palette-background-paper3);
223
- }
224
-
225
- .tiptap.ProseMirror pre[data-type="yaml-frontmatter"] {
226
- margin-bottom: 20px;
227
- border-radius: var(--mui-shape-borderRadius);
228
- color: var(--mui-palette-text-disabled);
229
- background-color: transparent;
230
- }
231
-
232
- .tiptap.ProseMirror code {
233
- padding: 2px 8px;
234
- margin: 0 4px;
235
- word-break: break-all;
236
- /* font-weight: 500; */
237
- border: 1px solid;
238
- border-color: var(--mui-palette-divider);
239
- background-color: var(--mui-palette-background-paper3);
240
- border-radius: 6px;
241
- }
242
-
243
- .tiptap.ProseMirror pre[data-type="yaml-frontmatter"] code {
244
- border: none;
245
- margin: 0;
246
- display: inline-block;
247
- }
248
-
249
- .tiptap.ProseMirror pre code {
250
- color: inherit;
251
- padding: 0;
252
- font-weight: normal;
253
- border-radius: 0;
254
- background-color: transparent;
255
- -webkit-text-fill-color: inherit;
256
- }
257
-
258
223
  /* details */
259
224
  .tiptap.ProseMirror .cq-details {
260
225
  display: flex;
@@ -495,7 +460,6 @@
495
460
  position: relative;
496
461
  overflow: visible;
497
462
  pointer-events: none;
498
- z-index: 10;
499
463
  }
500
464
 
501
465
  .tiptap.ProseMirror .table-controls>* {
@@ -506,7 +470,6 @@
506
470
  position: relative;
507
471
  overflow: visible;
508
472
  pointer-events: none;
509
- z-index: 10;
510
473
  }
511
474
 
512
475
  .tiptap.ProseMirror .table-selection-overlay-container>* {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { default as EditorDiff } from './EditorDiff';
4
4
  export { default as EditorMarkdown, type MarkdownEditorRef } from './EditorMarkdown';
5
5
  export { default as EditorThemeProvider } from './EditorThemeProvider';
6
6
  export { default as EditorToolbar } from './EditorToolbar';
7
+ export { getExtensions } from './extension';
7
8
  export { default as useTiptap } from './hook';
8
9
  export { useFn } from './hook/fn';
9
10
  export * from './type';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export { default as EditorDiff } from "./EditorDiff";
4
4
  export { default as EditorMarkdown } from "./EditorMarkdown";
5
5
  export { default as EditorThemeProvider } from "./EditorThemeProvider";
6
6
  export { default as EditorToolbar } from "./EditorToolbar";
7
+ export { getExtensions } from "./extension";
7
8
  export { default as useTiptap } from "./hook";
8
9
  export { useFn } from "./hook/fn";
9
10
  export * from "./type";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctzhian/tiptap",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "基于 Tiptap 二次开发的编辑器组件",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",