From 1083138d8c32244e640ba1eff370e927659d7f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Fri, 26 Jan 2024 11:41:34 +0800 Subject: [PATCH] Doc: update --- web/src/pages/Doc/en/changelog/index.md | 2 +- web/src/pages/Doc/en/changelog/index.vue | 5 ++ web/src/pages/Doc/en/utils/index.vue | 13 ++++ web/src/pages/Doc/zh/changelog/index.md | 2 +- web/src/pages/Doc/zh/changelog/index.vue | 7 +- web/src/pages/Doc/zh/utils/index.vue | 98 +++++++++++++++--------- 6 files changed, 89 insertions(+), 38 deletions(-) diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md index 77cce048..d4442a16 100644 --- a/web/src/pages/Doc/en/changelog/index.md +++ b/web/src/pages/Doc/en/changelog/index.md @@ -32,7 +32,7 @@ Demo: > > 4.Add two new themes; > -> 5.Fix the issue of text wrapping not taking effect in the outline and displaying the br tag; +> 5.Fix the issue of text wrapping not taking effect in the outline and displaying the br tag; ## 0.9.5 diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue index cb9f2a05..27d30671 100644 --- a/web/src/pages/Doc/en/changelog/index.vue +++ b/web/src/pages/Doc/en/changelog/index.vue @@ -5,6 +5,9 @@

Fix:

1.Fix the issue where the style of the collapsed nodes remains unchanged when switching themes;

+

2.Fix the issue of losing the new text style when switching themes for text wrapping;

+

3.Fix the issue where the style of the newline text remains unchanged when switching themes;

+

4.Fixed the issue of adding mathematical formulas to nodes and not changing the text style when switching themes;

New:

@@ -18,6 +21,8 @@

1.The outline supports pressing Shift+Tab to move nodes up one level;

2.Support setting the position of node arrow display;

3.Support setting the starting position of root node connections;

+

4.Add two new themes;

+

5.Fix the issue of text wrapping not taking effect in the outline and displaying the br tag;

0.9.5

Fix:

diff --git a/web/src/pages/Doc/en/utils/index.vue b/web/src/pages/Doc/en/utils/index.vue index 57346e13..8a63c7c6 100644 --- a/web/src/pages/Doc/en/utils/index.vue +++ b/web/src/pages/Doc/en/utils/index.vue @@ -389,6 +389,19 @@ and copying the data of the data object, example:

v0.9.3+

Convert flat objects into a tree structure. Reverse operation of the transformTreeDataToObject method.

+

removeHtmlNodeByClass(html, selector)

+
+

v0.9.6+

+
+ +

Remove the node of the specified selector from the specified HTML string, and then return the processed HTML string.

Simulate CSS background in Canvas

Import:

import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 43860719..db1aae8e 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -20,7 +20,7 @@
 >
 > 3.Mac 双指触摸事件移动画布增加一点灵敏度;
 >
-> 4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;
+> 4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;
 
 Demo:
 
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index a364eb90..af0e9c52 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -5,19 +5,24 @@
 

修复:

1.修复切换主题时,被收起的节点样式没有改变的问题;

+

2.修复切换主题后进行文本换行时,新换行的文本样式会丢失的问题;

+

3.修复切换主题时,换行的文本样式没有改变的问题;

+

4.修复添加了数学公式的节点,切换主题时文本样式没有改变的问题;

新增:

1.主题新增字段,用于设置节点连线箭头的显示位置,头部或者尾部;

2.主题新增字段,用于设置曲线连接时,根节点连线的起始位置;

3.Mac 双指触摸事件移动画布增加一点灵敏度;

-

4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;

+

4.新增 MOVE_UP_ONE_LEVEL 命令,用于将节点上移一个层级;

Demo:

1.大纲支持按 Shift+Tab 键将节点上移一个层级;

2.支持设置节点箭头显示的位置;

3.支持设置根节点连线的起始位置;

+

4.新增两个主题;

+

5.修复大纲中文本换行不生效,显示br标签的问题;

0.9.5

修复:

diff --git a/web/src/pages/Doc/zh/utils/index.vue b/web/src/pages/Doc/zh/utils/index.vue index d14ca51e..42e7eb44 100644 --- a/web/src/pages/Doc/zh/utils/index.vue +++ b/web/src/pages/Doc/zh/utils/index.vue @@ -25,7 +25,15 @@

layerIndex:节点层级

index:节点在同级节点里的索引

示例:

-
walk(tree, null, () => {}, () => {}, false, 0, 0)
+
walk(
+  tree,
+  null,
+  () => {},
+  () => {},
+  false,
+  0,
+  0
+)
 

bfsWalk(root, callback)

广度优先遍历树

@@ -50,7 +58,7 @@

removeActiveStateBoolean,默认为false,是否移除节点的激活状态

  • -

    removeId:v0.7.3-fix.1+,是否移除节点数据中的uid,默认为true

    +

    removeId:v0.7.3-fix.1+,是否移除节点数据中的 uid,默认为true

  • @@ -62,7 +70,7 @@
    copyNodeTree({}, node)
     

    imgToDataUrl(src)

    -

    图片转成dataURL

    +

    图片转成 dataURL

    downloadFile(file, fileName)

    下载文件

    throttle(fn, time = 300, ctx)

    @@ -89,10 +97,12 @@

    v0.3.4+

    测量文本的宽高,返回值:

    -
    { width, height }
    +
    {
    +  width, height
    +}
     

    getTextFromHtml(html)

    -

    提取html字符串里的纯文本内容。

    +

    提取 html 字符串里的纯文本内容。

    readBlob(blob)

    v0.5.9+

    @@ -104,8 +114,8 @@

    解析data:url数据,返回:

    {
    -  type,// 数据的文件类型
    -  base64// base64数据
    +  type, // 数据的文件类型
    +    base64 // base64数据
     }
     

    getImageSize(src)

    @@ -113,12 +123,11 @@

    v0.6.6+

      -
    • src:图片的url
    • +
    • src:图片的 url

    获取图片的大小。返回:

    {
    -  width,
    -  height
    +  width, height
     }
     

    loadImage(imgFile)

    @@ -126,12 +135,12 @@

    v0.6.8+

      -
    • imgFile:图片类型的File对象
    • +
    • imgFile:图片类型的 File 对象

    加载图片,返回:

    {
    -  url,// DataUrl
    -  size// { width, height } 图片宽高
    +  url, // DataUrl
    +    size // { width, height } 图片宽高
     }
     

    getType(data)

    @@ -143,12 +152,12 @@

    v0.6.10+

    -

    移除html字符串中节点的内联样式。

    +

    移除 html 字符串中节点的内联样式。

    addHtmlStyle(html, tag, style)

    v0.6.10+

    -

    给html标签中指定的标签添加内联样式。

    +

    给 html 标签中指定的标签添加内联样式。

    checkIsRichText(str)

    v0.6.10+

    @@ -198,7 +207,7 @@

    v0.7.2+

      -
    • el:DOM节点,可聚焦的元素,一般为输入框元素。
    • +
    • el:DOM 节点,可聚焦的元素,一般为输入框元素。

    聚焦指定输入框。

    selectAllInput(el)

    @@ -206,7 +215,7 @@

    v0.7.2+

      -
    • el:DOM节点,可聚焦的元素,一般为输入框元素。
    • +
    • el:DOM 节点,可聚焦的元素,一般为输入框元素。

    聚焦并全选指定输入框。

    addDataToAppointNodes(appointNodes, data = {})

    @@ -234,7 +243,7 @@

    createNewId:v0.7.3-fix.1+,Boolean,默认为false,即如果节点不存在uid的话,会创建新的uid。如果传true,那么无论节点数据原来是否存在uid,都会创建新的uid

    -

    给指定的节点列表树数据添加uid(如果uid不存在的话),会修改原数据。

    +

    给指定的节点列表树数据添加 uid(如果 uid 不存在的话),会修改原数据。

    getNodeIndex(node)

    v0.7.2+

    @@ -314,8 +323,7 @@

    从用户剪贴板中读取文字和图片,返回:

    {
    -  text,
    -  img
    +  text, img
     }
     

    removeFromParentNodeData(node)

    @@ -333,9 +341,9 @@

    v0.9.1+

      -
    • str:html字符串
    • +
    • str:html 字符串
    -

    给html自闭合标签添加闭合状态,<div><img src="xxx"></div> -> <div><img src="xxx" /></div>

    +

    给 html 自闭合标签添加闭合状态,<div><img src="xxx"></div> -> <div><img src="xxx" /></div>

    checkNodeListIsEqual(list1, list2)

    v0.9.1+

    @@ -383,8 +391,21 @@

    v0.9.3+

    -

    将平级对象转树结构。transformTreeDataToObject方法的反向操作。

    -

    在canvas中模拟css的背景属性

    +

    将平级对象转树结构。transformTreeDataToObject 方法的反向操作。

    +

    removeHtmlNodeByClass(html, selector)

    +
    +

    v0.9.6+

    +
    +
      +
    • +

      html:html 字符串

      +
    • +
    • +

      selector:节点选择器,比如类选择器,id 选择器

      +
    • +
    +

    去除指定 html 字符串中指定选择器的节点,然后返回处理后的 html 字符串。

    +

    在 canvas 中模拟 css 的背景属性

    引入:

    import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
     
    @@ -395,19 +416,26 @@ let canvas = document.createElement('canvas') canvas.width = width canvas.height = height -drawBackgroundImageToCanvas(ctx, width, height, img, { - backgroundRepeat: 'repeat-y', - backgroundSize: '60%', - backgroundPosition: 'center center' -}, (err) => { - if (err) { - // 失败 - } else { - // 成功 +drawBackgroundImageToCanvas( + ctx, + width, + height, + img, + { + backgroundRepeat: 'repeat-y', + backgroundSize: '60%', + backgroundPosition: 'center center' + }, + err => { + if (err) { + // 失败 + } else { + // 成功 + } } -}) +)
    -

    LRU缓存类

    +

    LRU 缓存类

    v0.5.10+