From 164d1b2d998bdcd3b937e234cb19bc633b045eb8 Mon Sep 17 00:00:00 2001
From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com>
Date: Wed, 24 Apr 2024 17:30:06 +0800
Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96markdown=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=E7=A6=BB=E7=BA=BF=E9=83=A8=E7=BD=B2(#231)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ui/env.d.ts | 1 +
ui/package.json | 4 ++
.../markdown-editor/assets/font_prouiefeic.js | 1 +
ui/src/components/markdown-editor/index.vue | 52 +++++++++++++++++++
.../paragraph/component/ParagraphForm.vue | 5 +-
5 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 ui/src/components/markdown-editor/assets/font_prouiefeic.js
create mode 100644 ui/src/components/markdown-editor/index.vue
diff --git a/ui/env.d.ts b/ui/env.d.ts
index 2e05630d0..ba311a842 100644
--- a/ui/env.d.ts
+++ b/ui/env.d.ts
@@ -7,6 +7,7 @@ declare module 'markdown-it-footnote'
declare module 'markdown-it-sub'
declare module 'markdown-it-sup'
declare module 'markdown-it-toc-done-right'
+declare module 'katex'
interface ImportMeta {
readonly env: ImportMetaEnv
}
diff --git a/ui/package.json b/ui/package.json
index 07c70038f..0ac8d5a23 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -14,9 +14,11 @@
},
"dependencies": {
"axios": "^0.28.0",
+ "cropperjs": "^1.6.2",
"echarts": "^5.5.0",
"element-plus": "^2.5.6",
"install": "^0.13.0",
+ "katex": "^0.16.10",
"lodash": "^4.17.21",
"markdown-it": "^13.0.2",
"markdown-it-abbr": "^1.0.4",
@@ -29,12 +31,14 @@
"markdown-it-toc-done-right": "^4.2.0",
"md-editor-v3": "^4.12.1",
"medium-zoom": "^1.1.0",
+ "mermaid": "^10.9.0",
"mitt": "^3.0.0",
"moment": "^2.30.1",
"npm": "^10.2.4",
"nprogress": "^0.2.0",
"pinia": "^2.1.6",
"pinyin-pro": "^3.18.2",
+ "screenfull": "^6.0.2",
"vue": "^3.3.4",
"vue-clipboard3": "^2.0.0",
"vue-router": "^4.2.4"
diff --git a/ui/src/components/markdown-editor/assets/font_prouiefeic.js b/ui/src/components/markdown-editor/assets/font_prouiefeic.js
new file mode 100644
index 000000000..6b8505f21
--- /dev/null
+++ b/ui/src/components/markdown-editor/assets/font_prouiefeic.js
@@ -0,0 +1 @@
+window._iconfont_svg_string_2605852='',function(l){var a=(a=document.getElementsByTagName("script"))[a.length-1],c=a.getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var o,t,i,e,h,d=function(a,c){c.parentNode.insertBefore(a,c)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}o=function(){var a,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_2605852,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(a=document.body).firstChild?d(c,a.firstChild):a.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(o,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),o()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=o,e=l.document,h=!1,v(),e.onreadystatechange=function(){"complete"==e.readyState&&(e.onreadystatechange=null,m())})}function m(){h||(h=!0,i())}function v(){try{e.documentElement.doScroll("left")}catch(a){return void setTimeout(v,50)}m()}}(window);
\ No newline at end of file
diff --git a/ui/src/components/markdown-editor/index.vue b/ui/src/components/markdown-editor/index.vue
new file mode 100644
index 000000000..c5efbc2c7
--- /dev/null
+++ b/ui/src/components/markdown-editor/index.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
diff --git a/ui/src/views/paragraph/component/ParagraphForm.vue b/ui/src/views/paragraph/component/ParagraphForm.vue
index b3d0becfb..33ecfa1d2 100644
--- a/ui/src/views/paragraph/component/ParagraphForm.vue
+++ b/ui/src/views/paragraph/component/ParagraphForm.vue
@@ -22,7 +22,7 @@
type="textarea"
>
-->
-
import { ref, reactive, onUnmounted, watch, nextTick } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
-import { MdEditor, MdPreview } from 'md-editor-v3'
+import { MdPreview } from 'md-editor-v3'
+import MarkdownEditor from '@/components/markdown-editor/index.vue'
import imageApi from '@/api/image'
const props = defineProps({
data: {