From 8871d8727b6f673ba5c7318e0d2cfadbc483643f Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Mon, 24 Jul 2023 11:21:09 +0800 Subject: [PATCH] Doc: update --- web/src/pages/Doc/catalogList.js | 4 +-- web/src/pages/Doc/en/changelog/index.md | 8 +++++ web/src/pages/Doc/en/changelog/index.vue | 4 +++ web/src/pages/Doc/en/render/index.md | 20 +++++++++++- web/src/pages/Doc/en/render/index.vue | 15 +++++++++ web/src/pages/Doc/en/utils/index.md | 15 +++++++++ web/src/pages/Doc/en/utils/index.vue | 13 ++++++++ web/src/pages/Doc/routerList.js | 4 ++- web/src/pages/Doc/zh/changelog/index.md | 8 +++++ web/src/pages/Doc/zh/changelog/index.vue | 4 +++ web/src/pages/Doc/zh/course10/index.md | 2 ++ web/src/pages/Doc/zh/course10/index.vue | 3 ++ web/src/pages/Doc/zh/course20/index.md | 18 ++++++++++- web/src/pages/Doc/zh/course20/index.vue | 18 ++++++++++- web/src/pages/Doc/zh/course21/index.md | 40 +++++++++++++++++++++++ web/src/pages/Doc/zh/course21/index.vue | 41 ++++++++++++++++++++++++ web/src/pages/Doc/zh/help2/index.md | 26 +++++++++++++++ web/src/pages/Doc/zh/help2/index.vue | 28 ++++++++++++++++ web/src/pages/Doc/zh/render/index.md | 20 +++++++++++- web/src/pages/Doc/zh/render/index.vue | 15 +++++++++ web/src/pages/Doc/zh/utils/index.md | 15 +++++++++ web/src/pages/Doc/zh/utils/index.vue | 13 ++++++++ 22 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 web/src/pages/Doc/zh/course21/index.md create mode 100644 web/src/pages/Doc/zh/course21/index.vue create mode 100644 web/src/pages/Doc/zh/help2/index.md create mode 100644 web/src/pages/Doc/zh/help2/index.vue diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index ec15f6c1..c48114f6 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -11,7 +11,7 @@ let langList = [ } ] let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog'] -let CourseList = new Array(20).fill(0).map((_, index) => { +let CourseList = new Array(21).fill(0).map((_, index) => { return 'course' + (index + 1) }) let APIList = [ @@ -36,7 +36,7 @@ let APIList = [ 'markdown', 'utils' ] -let helpList = new Array(1).fill(0).map((_, index) => { +let helpList = new Array(2).fill(0).map((_, index) => { return 'help' + (index + 1) }) diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md index 509a39d9..46429b41 100644 --- a/web/src/pages/Doc/en/changelog/index.md +++ b/web/src/pages/Doc/en/changelog/index.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.8 + +Fix: 1.Change the shortcut key for inserting a summary to Ctrl+G to avoid conflicts with the save shortcut key. 2.Fix the issue of abnormal switching between rich text editing configuration input boxes while nodes are being edited. + +New: 1.Modify the copy, cut, and paste logic, and support pasting data from the clipboard. + +Demo: 1.Fix the issue of not saving the outer margin of the basic style setting node. 2.Supports automatic switching to dark mode based on the theme. + ## 0.6.7 Fix: 1.Fixed the issue of missing placeholder elements for the expand and collapse button after node collapse and expansion. 2.Fixed the issue of being able to scale images in read-only mode. diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue index 1ee49304..25fb9efb 100644 --- a/web/src/pages/Doc/en/changelog/index.vue +++ b/web/src/pages/Doc/en/changelog/index.vue @@ -1,6 +1,10 @@ diff --git a/web/src/pages/Doc/en/utils/index.md b/web/src/pages/Doc/en/utils/index.md index b6dd1037..a2610595 100644 --- a/web/src/pages/Doc/en/utils/index.md +++ b/web/src/pages/Doc/en/utils/index.md @@ -181,6 +181,21 @@ Get the size of image, return: } ``` +#### loadImage(imgFile) + +> v0.6.8+ + +- `imgFile`: File object of image type + +Load image, return: + +```js +{ + url,// DataUrl + size// { width, height } width and height of image +} +``` + ## Simulate CSS background in Canvas Import: diff --git a/web/src/pages/Doc/en/utils/index.vue b/web/src/pages/Doc/en/utils/index.vue index e09a2070..8d53434b 100644 --- a/web/src/pages/Doc/en/utils/index.vue +++ b/web/src/pages/Doc/en/utils/index.vue @@ -121,6 +121,19 @@ and copying the data of the data object, example:

height } +

loadImage(imgFile)

+
+

v0.6.8+

+
+ +

Load image, return:

+
{
+  url,// DataUrl
+  size// { width, height } width and height of image
+}
+

Simulate CSS background in Canvas

Import:

import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js
index cc378a54..b2a0fcb4 100644
--- a/web/src/pages/Doc/routerList.js
+++ b/web/src/pages/Doc/routerList.js
@@ -27,6 +27,7 @@ export default [
       { path: 'course18', title: '如何持久化数据' },
       { path: 'course19', title: '插入和扩展节点图标' },
       { path: 'course20', title: '如何自定义节点内容' },
+      { path: 'course21', title: '如何复制、剪切、粘贴' },
       { path: 'doExport', title: 'Export 插件' },
       { path: 'drag', title: 'Drag插件' },
       { path: 'introduction', title: '简介' },
@@ -48,7 +49,8 @@ export default [
       { path: 'client', title: '客户端' },
       { path: 'touchEvent', title: 'TouchEvent插件' },
       { path: 'nodeImgAdjust', title: 'NodeImgAdjust插件' },
-      { path: 'help1', title: '概要/关联线' }
+      { path: 'help1', title: '概要/关联线' },
+      { path: 'help2', title: '客户端' }
     ]
   },
   {
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 72584967..7e302272 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -1,5 +1,13 @@
 # Changelog
 
+## 0.6.8
+
+修复:1.修改插入概要的快捷键为Ctrl+G,避免和保存快捷键冲突。 2.修复节点正在编辑时切换富文本编辑配置输入框出现异常的问题。
+
+新增:1.修改复制、剪切、粘贴逻辑,支持粘贴剪切板中的数据。
+
+Demo:1.修复基础样式-设置节点外边距未保存的问题。 2.支持根据主题自动切换为暗黑模式。
+
 ## 0.6.7
 
 修复:1.修复节点收起再展开后展开收起按钮占位元素丢失的问题。 2.修复只读模式下可以缩放图片的问题。
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index 071e4cab..1652ac9f 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -1,6 +1,10 @@
 
diff --git a/web/src/pages/Doc/zh/course21/index.md b/web/src/pages/Doc/zh/course21/index.md
new file mode 100644
index 00000000..0a049f9d
--- /dev/null
+++ b/web/src/pages/Doc/zh/course21/index.md
@@ -0,0 +1,40 @@
+# 如何复制、剪切、粘贴
+
+## 使用快捷键
+
+核心库内部默认支持`Ctrl+c`、`Ctrl+x`、`Ctrl+v`三个快捷键来执行复制、剪切、粘贴操作。
+
+当激活了某个节点,按`Ctrl+c`会复制当前激活节点的数据,按`Ctrl+x`会删除当前激活节点,同时保存该节点的数据,这两个操作当同时存在多个激活节点,只会对第一个生效。
+
+当按了`Ctrl+c`或`Ctrl+x`后,按`Ctrl+v`会在当前激活的节点粘贴复制或剪切的数据,也就是被复制或剪切的节点会作为该节点的子节点。
+
+除了支持粘贴在画布中复制或剪切的节点数据外,如果你再其他地方复制了文本或图片,也支持进行粘贴,也就是会粘贴你当前剪贴板中的数据,如果你的剪切板中存在文本数据,那么会粘贴作为当前激活节点的子节点,如果存在图片数据,那么会直接给当前激活节点添加或替换图片。
+
+如果复制或剪切了画布数据,同时剪切板中也存在数据,那么默认会以最新的`Ctrl+c`或`Ctrl+x`操作为准,比如你先复制了节点,然后又复制了其他地方的文本,那么会粘贴最后一次的操作,也就是其他地方复制的文本数据。
+
+## 使用按钮触发
+
+一般会在右键菜单上下文中显然复制、剪切、粘贴三个按钮,当点击了这三个按钮也需要能执行复制、剪切、粘贴操作,这需要调用内部的一些方法来完成:
+
+```js
+// 点击了复制按钮
+const onCopyBtnClick = () => {
+    mindMap.renderer.copy()
+}
+
+// 点击了剪切按钮
+const onCutBtnClick = () => {
+    mindMap.renderer.cut()
+}
+
+// 点击了粘贴按钮
+const onPasteBtnClick = () => {
+    mindMap.renderer.paste()
+}
+```
+
+需要注意的是,这三个方法只能复制、剪切、粘贴画布中的节点数据,不支持操作用户的剪切板数据。
+
+### 完整示例
+
+