From 45cc199d7f7d322efdf7c880c4d28a933bbc46d4 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Thu, 8 Jun 2023 16:49:54 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=A0=B8=E5=BF=83=E5=BA=93=E4=BB=A3=E7=A0=81=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/full.js | 16 ++++---- simple-mind-map/index.js | 16 ++++---- simple-mind-map/package.json | 2 +- .../src/{utils => constants}/constant.js | 0 .../src/{ => core/command}/Command.js | 2 +- .../src/{ => core/command}/KeyCommand.js | 2 +- .../src/{utils => core/command}/keyMap.js | 0 simple-mind-map/src/{ => core/event}/Event.js | 2 +- .../src/{ => core/render}/Render.js | 20 +++++----- .../src/{ => core/render}/TextEdit.js | 2 +- .../src/{ => core/render/node}/Node.js | 12 +++--- .../src/{ => core/render/node}/Shape.js | 2 +- .../src/{ => core/render/node}/Style.js | 2 +- .../render/node}/nodeCommandWraps.js | 0 .../render/node}/nodeCreateContents.js | 6 +-- .../render/node}/nodeExpandBtn.js | 2 +- .../render/node}/nodeGeneralization.js | 2 +- simple-mind-map/src/{ => core/view}/View.js | 2 +- simple-mind-map/src/layouts/Base.js | 4 +- simple-mind-map/src/layouts/Fishbone.js | 2 +- simple-mind-map/src/layouts/Timeline.js | 2 +- .../src/{ => plugins}/AssociativeLine.js | 8 ++-- simple-mind-map/src/{ => plugins}/Drag.js | 4 +- simple-mind-map/src/{ => plugins}/Export.js | 6 +-- .../src/{ => plugins}/KeyboardNavigation.js | 4 +- simple-mind-map/src/{ => plugins}/MiniMap.js | 0 simple-mind-map/src/{ => plugins}/RichText.js | 4 +- simple-mind-map/src/{ => plugins}/Select.js | 2 +- .../src/{ => plugins}/Watermark.js | 2 +- .../associativeLineControls.js | 0 .../associativeLine}/associativeLineText.js | 2 +- .../associativeLine}/associativeLineUtils.js | 0 .../src/{ => utils}/BatchExecution.js | 2 +- web/src/pages/Doc/en/associativeLine/index.md | 3 +- .../pages/Doc/en/associativeLine/index.vue | 3 +- web/src/pages/Doc/en/changelog/index.md | 4 ++ web/src/pages/Doc/en/changelog/index.vue | 2 + web/src/pages/Doc/en/constructor/index.md | 14 +++---- web/src/pages/Doc/en/constructor/index.vue | 14 +++---- web/src/pages/Doc/en/doExport/index.md | 3 +- web/src/pages/Doc/en/doExport/index.vue | 3 +- web/src/pages/Doc/en/drag/index.md | 3 +- web/src/pages/Doc/en/drag/index.vue | 3 +- web/src/pages/Doc/en/introduction/index.md | 2 + web/src/pages/Doc/en/introduction/index.vue | 37 ++++++++++--------- web/src/pages/Doc/en/keyCommand/index.md | 2 +- web/src/pages/Doc/en/keyCommand/index.vue | 2 +- .../pages/Doc/en/keyboardNavigation/index.md | 3 +- .../pages/Doc/en/keyboardNavigation/index.vue | 3 +- web/src/pages/Doc/en/miniMap/index.md | 3 +- web/src/pages/Doc/en/miniMap/index.vue | 3 +- web/src/pages/Doc/en/richText/index.md | 3 +- web/src/pages/Doc/en/richText/index.vue | 3 +- web/src/pages/Doc/en/select/index.md | 3 +- web/src/pages/Doc/en/select/index.vue | 3 +- web/src/pages/Doc/en/watermark/index.md | 3 +- web/src/pages/Doc/en/watermark/index.vue | 3 +- web/src/pages/Doc/zh/associativeLine/index.md | 3 +- .../pages/Doc/zh/associativeLine/index.vue | 3 +- web/src/pages/Doc/zh/changelog/index.md | 4 ++ web/src/pages/Doc/zh/changelog/index.vue | 2 + web/src/pages/Doc/zh/constructor/index.md | 14 +++---- web/src/pages/Doc/zh/constructor/index.vue | 14 +++---- web/src/pages/Doc/zh/course10/index.md | 3 +- web/src/pages/Doc/zh/course10/index.vue | 3 +- web/src/pages/Doc/zh/course8/index.md | 3 +- web/src/pages/Doc/zh/course8/index.vue | 3 +- web/src/pages/Doc/zh/doExport/index.md | 3 +- web/src/pages/Doc/zh/doExport/index.vue | 3 +- web/src/pages/Doc/zh/drag/index.md | 3 +- web/src/pages/Doc/zh/drag/index.vue | 3 +- web/src/pages/Doc/zh/introduction/index.md | 2 + web/src/pages/Doc/zh/introduction/index.vue | 37 ++++++++++--------- web/src/pages/Doc/zh/keyCommand/index.md | 2 +- web/src/pages/Doc/zh/keyCommand/index.vue | 2 +- .../pages/Doc/zh/keyboardNavigation/index.md | 3 +- .../pages/Doc/zh/keyboardNavigation/index.vue | 3 +- web/src/pages/Doc/zh/miniMap/index.md | 3 +- web/src/pages/Doc/zh/miniMap/index.vue | 3 +- web/src/pages/Doc/zh/richText/index.md | 3 +- web/src/pages/Doc/zh/richText/index.vue | 3 +- web/src/pages/Doc/zh/select/index.md | 3 +- web/src/pages/Doc/zh/select/index.vue | 3 +- web/src/pages/Doc/zh/watermark/index.md | 3 +- web/src/pages/Doc/zh/watermark/index.vue | 3 +- web/src/pages/Edit/components/Edit.vue | 16 ++++---- web/src/pages/Edit/components/NodeTag.vue | 2 +- web/src/pages/Edit/components/Structure.vue | 2 +- web/src/pages/Edit/components/Theme.vue | 2 +- 89 files changed, 235 insertions(+), 181 deletions(-) rename simple-mind-map/src/{utils => constants}/constant.js (100%) rename simple-mind-map/src/{ => core/command}/Command.js (98%) rename simple-mind-map/src/{ => core/command}/KeyCommand.js (98%) rename simple-mind-map/src/{utils => core/command}/keyMap.js (100%) rename simple-mind-map/src/{ => core/event}/Event.js (98%) rename simple-mind-map/src/{ => core/render}/Render.js (98%) rename simple-mind-map/src/{ => core/render}/TextEdit.js (98%) rename simple-mind-map/src/{ => core/render/node}/Node.js (98%) rename simple-mind-map/src/{ => core/render/node}/Shape.js (99%) rename simple-mind-map/src/{ => core/render/node}/Style.js (98%) rename simple-mind-map/src/{utils => core/render/node}/nodeCommandWraps.js (100%) rename simple-mind-map/src/{utils => core/render/node}/nodeCreateContents.js (98%) rename simple-mind-map/src/{utils => core/render/node}/nodeExpandBtn.js (98%) rename simple-mind-map/src/{utils => core/render/node}/nodeGeneralization.js (99%) rename simple-mind-map/src/{ => core/view}/View.js (98%) rename simple-mind-map/src/{ => plugins}/AssociativeLine.js (98%) rename simple-mind-map/src/{ => plugins}/Drag.js (99%) rename simple-mind-map/src/{ => plugins}/Export.js (97%) rename simple-mind-map/src/{ => plugins}/KeyboardNavigation.js (98%) rename simple-mind-map/src/{ => plugins}/MiniMap.js (100%) rename simple-mind-map/src/{ => plugins}/RichText.js (99%) rename simple-mind-map/src/{ => plugins}/Select.js (99%) rename simple-mind-map/src/{ => plugins}/Watermark.js (98%) rename simple-mind-map/src/{utils => plugins/associativeLine}/associativeLineControls.js (100%) rename simple-mind-map/src/{utils => plugins/associativeLine}/associativeLineText.js (98%) rename simple-mind-map/src/{utils => plugins/associativeLine}/associativeLineUtils.js (100%) rename simple-mind-map/src/{ => utils}/BatchExecution.js (94%) diff --git a/simple-mind-map/full.js b/simple-mind-map/full.js index 80048f10..9171aecb 100644 --- a/simple-mind-map/full.js +++ b/simple-mind-map/full.js @@ -1,12 +1,12 @@ import MindMap from './index' -import MiniMap from './src/MiniMap.js' -import Watermark from './src/Watermark.js' -import KeyboardNavigation from './src/KeyboardNavigation.js' -import Export from './src/Export.js' -import Drag from './src/Drag.js' -import Select from './src/Select.js' -import AssociativeLine from './src/AssociativeLine' -import RichText from './src/RichText' +import MiniMap from './src/plugins/MiniMap.js' +import Watermark from './src/plugins/Watermark.js' +import KeyboardNavigation from './src/plugins/KeyboardNavigation.js' +import Export from './src/plugins/Export.js' +import Drag from './src/plugins/Drag.js' +import Select from './src/plugins/Select.js' +import AssociativeLine from './src/plugins/AssociativeLine' +import RichText from './src/plugins/RichText' import xmind from './src/parse/xmind.js' import markdown from './src/parse/markdown.js' import icons from './src/svg/icons.js' diff --git a/simple-mind-map/index.js b/simple-mind-map/index.js index 1b283f4c..224a0249 100644 --- a/simple-mind-map/index.js +++ b/simple-mind-map/index.js @@ -1,13 +1,13 @@ -import View from './src/View' -import Event from './src/Event' -import Render from './src/Render' +import View from './src/core/view/View' +import Event from './src/core/event/Event' +import Render from './src/core/render/Render' import merge from 'deepmerge' import theme from './src/themes' -import Style from './src/Style' -import KeyCommand from './src/KeyCommand' -import Command from './src/Command' -import BatchExecution from './src/BatchExecution' -import { layoutValueList, CONSTANTS } from './src/utils/constant' +import Style from './src/core/render/node/Style' +import KeyCommand from './src/core/command/KeyCommand' +import Command from './src/core/command/Command' +import BatchExecution from './src/utils/BatchExecution' +import { layoutValueList, CONSTANTS } from './src/constants/constant' import { SVG } from '@svgdotjs/svg.js' import { simpleDeepClone } from './src/utils' import defaultTheme, { checkIsNodeSizeIndependenceConfig } from './src/themes/default' diff --git a/simple-mind-map/package.json b/simple-mind-map/package.json index a5a08080..9c376248 100644 --- a/simple-mind-map/package.json +++ b/simple-mind-map/package.json @@ -1,6 +1,6 @@ { "name": "simple-mind-map", - "version": "0.5.11", + "version": "0.6.0", "description": "一个简单的web在线思维导图", "authors": [ { diff --git a/simple-mind-map/src/utils/constant.js b/simple-mind-map/src/constants/constant.js similarity index 100% rename from simple-mind-map/src/utils/constant.js rename to simple-mind-map/src/constants/constant.js diff --git a/simple-mind-map/src/Command.js b/simple-mind-map/src/core/command/Command.js similarity index 98% rename from simple-mind-map/src/Command.js rename to simple-mind-map/src/core/command/Command.js index b1c35c57..2a5f3115 100644 --- a/simple-mind-map/src/Command.js +++ b/simple-mind-map/src/core/command/Command.js @@ -1,4 +1,4 @@ -import { copyRenderTree, simpleDeepClone, nextTick } from './utils' +import { copyRenderTree, simpleDeepClone, nextTick } from '../../utils' // 命令类 class Command { diff --git a/simple-mind-map/src/KeyCommand.js b/simple-mind-map/src/core/command/KeyCommand.js similarity index 98% rename from simple-mind-map/src/KeyCommand.js rename to simple-mind-map/src/core/command/KeyCommand.js index 579e219a..cc7a772b 100644 --- a/simple-mind-map/src/KeyCommand.js +++ b/simple-mind-map/src/core/command/KeyCommand.js @@ -1,4 +1,4 @@ -import { keyMap } from './utils/keyMap' +import { keyMap } from './keyMap' // 快捷按键、命令处理类 export default class KeyCommand { // 构造函数 diff --git a/simple-mind-map/src/utils/keyMap.js b/simple-mind-map/src/core/command/keyMap.js similarity index 100% rename from simple-mind-map/src/utils/keyMap.js rename to simple-mind-map/src/core/command/keyMap.js diff --git a/simple-mind-map/src/Event.js b/simple-mind-map/src/core/event/Event.js similarity index 98% rename from simple-mind-map/src/Event.js rename to simple-mind-map/src/core/event/Event.js index daac439f..708209c4 100644 --- a/simple-mind-map/src/Event.js +++ b/simple-mind-map/src/core/event/Event.js @@ -1,5 +1,5 @@ import EventEmitter from 'eventemitter3' -import { CONSTANTS } from './utils/constant' +import { CONSTANTS } from '../../constants/constant' // 事件类 class Event extends EventEmitter { diff --git a/simple-mind-map/src/Render.js b/simple-mind-map/src/core/render/Render.js similarity index 98% rename from simple-mind-map/src/Render.js rename to simple-mind-map/src/core/render/Render.js index 92ea717e..bbf1a68d 100644 --- a/simple-mind-map/src/Render.js +++ b/simple-mind-map/src/core/render/Render.js @@ -1,15 +1,15 @@ import merge from 'deepmerge' -import LogicalStructure from './layouts/LogicalStructure' -import MindMap from './layouts/MindMap' -import CatalogOrganization from './layouts/CatalogOrganization' -import OrganizationStructure from './layouts/OrganizationStructure' -import Timeline from './layouts/Timeline' -import Fishbone from './layouts/Fishbone' +import LogicalStructure from '../../layouts/LogicalStructure' +import MindMap from '../../layouts/MindMap' +import CatalogOrganization from '../../layouts/CatalogOrganization' +import OrganizationStructure from '../../layouts/OrganizationStructure' +import Timeline from '../../layouts/Timeline' +import Fishbone from '../../layouts/Fishbone' import TextEdit from './TextEdit' -import { copyNodeTree, simpleDeepClone, walk } from './utils' -import { shapeList } from './Shape' -import { lineStyleProps } from './themes/default' -import { CONSTANTS } from './utils/constant' +import { copyNodeTree, simpleDeepClone, walk } from '../../utils' +import { shapeList } from './node/Shape' +import { lineStyleProps } from '../../themes/default' +import { CONSTANTS } from '../../constants/constant' // 布局列表 const layouts = { diff --git a/simple-mind-map/src/TextEdit.js b/simple-mind-map/src/core/render/TextEdit.js similarity index 98% rename from simple-mind-map/src/TextEdit.js rename to simple-mind-map/src/core/render/TextEdit.js index 80d7e90b..3ceda346 100644 --- a/simple-mind-map/src/TextEdit.js +++ b/simple-mind-map/src/core/render/TextEdit.js @@ -1,4 +1,4 @@ -import { getStrWithBrFromHtml, checkNodeOuter } from './utils' +import { getStrWithBrFromHtml, checkNodeOuter } from '../../utils' // 节点文字编辑类 export default class TextEdit { diff --git a/simple-mind-map/src/Node.js b/simple-mind-map/src/core/render/node/Node.js similarity index 98% rename from simple-mind-map/src/Node.js rename to simple-mind-map/src/core/render/node/Node.js index 789c00d5..8884ea69 100644 --- a/simple-mind-map/src/Node.js +++ b/simple-mind-map/src/core/render/node/Node.js @@ -1,12 +1,12 @@ import Style from './Style' import Shape from './Shape' -import { asyncRun } from './utils' +import { asyncRun } from '../../../utils' import { G, Rect } from '@svgdotjs/svg.js' -import nodeGeneralizationMethods from './utils/nodeGeneralization' -import nodeExpandBtnMethods from './utils/nodeExpandBtn' -import nodeCommandWrapsMethods from './utils/nodeCommandWraps' -import nodeCreateContentsMethods from './utils/nodeCreateContents' -import { CONSTANTS } from './utils/constant' +import nodeGeneralizationMethods from './nodeGeneralization' +import nodeExpandBtnMethods from './nodeExpandBtn' +import nodeCommandWrapsMethods from './nodeCommandWraps' +import nodeCreateContentsMethods from './nodeCreateContents' +import { CONSTANTS } from '../../../constants/constant' // 节点类 class Node { diff --git a/simple-mind-map/src/Shape.js b/simple-mind-map/src/core/render/node/Shape.js similarity index 99% rename from simple-mind-map/src/Shape.js rename to simple-mind-map/src/core/render/node/Shape.js index b0df207b..d53d8881 100644 --- a/simple-mind-map/src/Shape.js +++ b/simple-mind-map/src/core/render/node/Shape.js @@ -1,5 +1,5 @@ import { Rect, Polygon, Path } from '@svgdotjs/svg.js' -import { CONSTANTS } from './utils/constant' +import { CONSTANTS } from '../../../constants/constant' // 节点形状类 export default class Shape { diff --git a/simple-mind-map/src/Style.js b/simple-mind-map/src/core/render/node/Style.js similarity index 98% rename from simple-mind-map/src/Style.js rename to simple-mind-map/src/core/render/node/Style.js index 6f10526e..1dcf70de 100644 --- a/simple-mind-map/src/Style.js +++ b/simple-mind-map/src/core/render/node/Style.js @@ -1,4 +1,4 @@ -import { tagColorList } from './utils/constant' +import { tagColorList } from '../../../constants/constant' const rootProp = ['paddingX', 'paddingY'] // 样式类 diff --git a/simple-mind-map/src/utils/nodeCommandWraps.js b/simple-mind-map/src/core/render/node/nodeCommandWraps.js similarity index 100% rename from simple-mind-map/src/utils/nodeCommandWraps.js rename to simple-mind-map/src/core/render/node/nodeCommandWraps.js diff --git a/simple-mind-map/src/utils/nodeCreateContents.js b/simple-mind-map/src/core/render/node/nodeCreateContents.js similarity index 98% rename from simple-mind-map/src/utils/nodeCreateContents.js rename to simple-mind-map/src/core/render/node/nodeCreateContents.js index 866a4db3..c5231e71 100644 --- a/simple-mind-map/src/utils/nodeCreateContents.js +++ b/simple-mind-map/src/core/render/node/nodeCreateContents.js @@ -1,7 +1,7 @@ -import { measureText, resizeImgSize, getTextFromHtml } from '../utils' +import { measureText, resizeImgSize, getTextFromHtml } from '../../../utils' import { Image, SVG, A, G, Rect, Text, ForeignObject } from '@svgdotjs/svg.js' -import iconsSvg from '../svg/icons' -import { CONSTANTS } from './constant' +import iconsSvg from '../../../svg/icons' +import { CONSTANTS } from '../../../constants/constant' // 创建图片节点 function createImgNode() { diff --git a/simple-mind-map/src/utils/nodeExpandBtn.js b/simple-mind-map/src/core/render/node/nodeExpandBtn.js similarity index 98% rename from simple-mind-map/src/utils/nodeExpandBtn.js rename to simple-mind-map/src/core/render/node/nodeExpandBtn.js index 650417b5..5b2675cd 100644 --- a/simple-mind-map/src/utils/nodeExpandBtn.js +++ b/simple-mind-map/src/core/render/node/nodeExpandBtn.js @@ -1,4 +1,4 @@ -import btnsSvg from '../svg/btns' +import btnsSvg from '../../../svg/btns' import { SVG, Circle, G } from '@svgdotjs/svg.js' // 创建展开收起按钮的内容节点 diff --git a/simple-mind-map/src/utils/nodeGeneralization.js b/simple-mind-map/src/core/render/node/nodeGeneralization.js similarity index 99% rename from simple-mind-map/src/utils/nodeGeneralization.js rename to simple-mind-map/src/core/render/node/nodeGeneralization.js index 6521de97..2a2a585d 100644 --- a/simple-mind-map/src/utils/nodeGeneralization.js +++ b/simple-mind-map/src/core/render/node/nodeGeneralization.js @@ -1,4 +1,4 @@ -import Node from '../Node' +import Node from './Node' // 检查是否存在概要 function checkHasGeneralization () { diff --git a/simple-mind-map/src/View.js b/simple-mind-map/src/core/view/View.js similarity index 98% rename from simple-mind-map/src/View.js rename to simple-mind-map/src/core/view/View.js index ffe2599f..532424a1 100644 --- a/simple-mind-map/src/View.js +++ b/simple-mind-map/src/core/view/View.js @@ -1,4 +1,4 @@ -import { CONSTANTS } from './utils/constant' +import { CONSTANTS } from '../../constants/constant' // 视图操作类 class View { diff --git a/simple-mind-map/src/layouts/Base.js b/simple-mind-map/src/layouts/Base.js index e51b72d5..701fffbf 100644 --- a/simple-mind-map/src/layouts/Base.js +++ b/simple-mind-map/src/layouts/Base.js @@ -1,5 +1,5 @@ -import Node from '../Node' -import { CONSTANTS, initRootNodePositionMap } from '../utils/constant' +import Node from '../core/render/node/Node' +import { CONSTANTS, initRootNodePositionMap } from '../constants/constant' import Lru from '../utils/Lru' // 布局基类 diff --git a/simple-mind-map/src/layouts/Fishbone.js b/simple-mind-map/src/layouts/Fishbone.js index 58e70932..e8581852 100644 --- a/simple-mind-map/src/layouts/Fishbone.js +++ b/simple-mind-map/src/layouts/Fishbone.js @@ -1,6 +1,6 @@ import Base from './Base' import { walk, asyncRun, degToRad } from '../utils' -import { CONSTANTS } from '../utils/constant' +import { CONSTANTS } from '../constants/constant' import utils from './fishboneUtils' // 鱼骨图 diff --git a/simple-mind-map/src/layouts/Timeline.js b/simple-mind-map/src/layouts/Timeline.js index 0e426cf6..60a41db2 100644 --- a/simple-mind-map/src/layouts/Timeline.js +++ b/simple-mind-map/src/layouts/Timeline.js @@ -1,6 +1,6 @@ import Base from './Base' import { walk, asyncRun } from '../utils' -import { CONSTANTS } from '../utils/constant' +import { CONSTANTS } from '../constants/constant' // 时间轴 class Timeline extends Base { diff --git a/simple-mind-map/src/AssociativeLine.js b/simple-mind-map/src/plugins/AssociativeLine.js similarity index 98% rename from simple-mind-map/src/AssociativeLine.js rename to simple-mind-map/src/plugins/AssociativeLine.js index c365a8de..7d2626bc 100644 --- a/simple-mind-map/src/AssociativeLine.js +++ b/simple-mind-map/src/plugins/AssociativeLine.js @@ -1,4 +1,4 @@ -import { walk, bfsWalk, throttle } from './utils/' +import { walk, bfsWalk, throttle } from '../utils' import { v4 as uuid } from 'uuid' import { getAssociativeLineTargetIndex, @@ -7,9 +7,9 @@ import { getNodePoint, computeNodePoints, getNodeLinePath -} from './utils/associativeLineUtils' -import associativeLineControlsMethods from './utils/associativeLineControls' -import associativeLineTextMethods from './utils/associativeLineText' +} from './associativeLine/associativeLineUtils' +import associativeLineControlsMethods from './associativeLine/associativeLineControls' +import associativeLineTextMethods from './associativeLine/associativeLineText' // 关联线类 class AssociativeLine { diff --git a/simple-mind-map/src/Drag.js b/simple-mind-map/src/plugins/Drag.js similarity index 99% rename from simple-mind-map/src/Drag.js rename to simple-mind-map/src/plugins/Drag.js index ffadf0c5..d85ea667 100644 --- a/simple-mind-map/src/Drag.js +++ b/simple-mind-map/src/plugins/Drag.js @@ -1,5 +1,5 @@ -import { bfsWalk, throttle } from './utils' -import Base from './layouts/Base' +import { bfsWalk, throttle } from '../utils' +import Base from '../layouts/Base' // 节点拖动类 diff --git a/simple-mind-map/src/Export.js b/simple-mind-map/src/plugins/Export.js similarity index 97% rename from simple-mind-map/src/Export.js rename to simple-mind-map/src/plugins/Export.js index cbf3a639..ef74fe56 100644 --- a/simple-mind-map/src/Export.js +++ b/simple-mind-map/src/plugins/Export.js @@ -1,8 +1,8 @@ -import { imgToDataUrl, downloadFile, readBlob } from './utils' +import { imgToDataUrl, downloadFile, readBlob } from '../utils' import JsPDF from 'jspdf' import { SVG } from '@svgdotjs/svg.js' -import drawBackgroundImageToCanvas from './utils/simulateCSSBackgroundInCanvas' -import { transformToMarkdown } from './parse/toMarkdown' +import drawBackgroundImageToCanvas from '../utils/simulateCSSBackgroundInCanvas' +import { transformToMarkdown } from '../parse/toMarkdown' const URL = window.URL || window.webkitURL || window // 导出类 diff --git a/simple-mind-map/src/KeyboardNavigation.js b/simple-mind-map/src/plugins/KeyboardNavigation.js similarity index 98% rename from simple-mind-map/src/KeyboardNavigation.js rename to simple-mind-map/src/plugins/KeyboardNavigation.js index c5adf041..cdbf95f2 100644 --- a/simple-mind-map/src/KeyboardNavigation.js +++ b/simple-mind-map/src/plugins/KeyboardNavigation.js @@ -1,5 +1,5 @@ -import { bfsWalk } from './utils' -import { CONSTANTS } from './utils/constant' +import { bfsWalk } from '../utils' +import { CONSTANTS } from '../constants/constant' // 键盘导航类 class KeyboardNavigation { diff --git a/simple-mind-map/src/MiniMap.js b/simple-mind-map/src/plugins/MiniMap.js similarity index 100% rename from simple-mind-map/src/MiniMap.js rename to simple-mind-map/src/plugins/MiniMap.js diff --git a/simple-mind-map/src/RichText.js b/simple-mind-map/src/plugins/RichText.js similarity index 99% rename from simple-mind-map/src/RichText.js rename to simple-mind-map/src/plugins/RichText.js index 227f701e..a275baf6 100644 --- a/simple-mind-map/src/RichText.js +++ b/simple-mind-map/src/plugins/RichText.js @@ -1,8 +1,8 @@ import Quill from 'quill' import 'quill/dist/quill.snow.css' import html2canvas from 'html2canvas' -import { walk, getTextFromHtml } from './utils' -import { CONSTANTS } from './utils/constant' +import { walk, getTextFromHtml } from '../utils' +import { CONSTANTS } from '../constants/constant' let extended = false diff --git a/simple-mind-map/src/Select.js b/simple-mind-map/src/plugins/Select.js similarity index 99% rename from simple-mind-map/src/Select.js rename to simple-mind-map/src/plugins/Select.js index a8c847c9..5181fd0c 100644 --- a/simple-mind-map/src/Select.js +++ b/simple-mind-map/src/plugins/Select.js @@ -1,4 +1,4 @@ -import { bfsWalk, throttle } from './utils' +import { bfsWalk, throttle } from '../utils' // 选择节点类 diff --git a/simple-mind-map/src/Watermark.js b/simple-mind-map/src/plugins/Watermark.js similarity index 98% rename from simple-mind-map/src/Watermark.js rename to simple-mind-map/src/plugins/Watermark.js index 83bec10d..7d2ddaca 100644 --- a/simple-mind-map/src/Watermark.js +++ b/simple-mind-map/src/plugins/Watermark.js @@ -1,5 +1,5 @@ import { Text, G } from '@svgdotjs/svg.js' -import { degToRad, camelCaseToHyphen } from './utils' +import { degToRad, camelCaseToHyphen } from '../utils' import merge from 'deepmerge' // 水印类 diff --git a/simple-mind-map/src/utils/associativeLineControls.js b/simple-mind-map/src/plugins/associativeLine/associativeLineControls.js similarity index 100% rename from simple-mind-map/src/utils/associativeLineControls.js rename to simple-mind-map/src/plugins/associativeLine/associativeLineControls.js diff --git a/simple-mind-map/src/utils/associativeLineText.js b/simple-mind-map/src/plugins/associativeLine/associativeLineText.js similarity index 98% rename from simple-mind-map/src/utils/associativeLineText.js rename to simple-mind-map/src/plugins/associativeLine/associativeLineText.js index f761ab13..9d0722bb 100644 --- a/simple-mind-map/src/utils/associativeLineText.js +++ b/simple-mind-map/src/plugins/associativeLine/associativeLineText.js @@ -1,5 +1,5 @@ import { Text } from '@svgdotjs/svg.js' -import { getStrWithBrFromHtml } from './index' +import { getStrWithBrFromHtml } from '../../utils/index' // 创建文字节点 function createText(data) { diff --git a/simple-mind-map/src/utils/associativeLineUtils.js b/simple-mind-map/src/plugins/associativeLine/associativeLineUtils.js similarity index 100% rename from simple-mind-map/src/utils/associativeLineUtils.js rename to simple-mind-map/src/plugins/associativeLine/associativeLineUtils.js diff --git a/simple-mind-map/src/BatchExecution.js b/simple-mind-map/src/utils/BatchExecution.js similarity index 94% rename from simple-mind-map/src/BatchExecution.js rename to simple-mind-map/src/utils/BatchExecution.js index 4a92fbdc..fcdfb735 100644 --- a/simple-mind-map/src/BatchExecution.js +++ b/simple-mind-map/src/utils/BatchExecution.js @@ -1,4 +1,4 @@ -import { nextTick } from './utils' +import { nextTick } from '.' // 批量执行 class BatchExecution { diff --git a/web/src/pages/Doc/en/associativeLine/index.md b/web/src/pages/Doc/en/associativeLine/index.md index 9a726858..06685ee1 100644 --- a/web/src/pages/Doc/en/associativeLine/index.md +++ b/web/src/pages/Doc/en/associativeLine/index.md @@ -12,7 +12,8 @@ This plugin is used to support the addition of associative lines. ```js import MindMap from 'simple-mind-map' -import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' +import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js' +// import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' Use this path for versions below v0.6.0 MindMap.usePlugin(AssociativeLine) ``` diff --git a/web/src/pages/Doc/en/associativeLine/index.vue b/web/src/pages/Doc/en/associativeLine/index.vue index 4981edcc..bc39c6cf 100644 --- a/web/src/pages/Doc/en/associativeLine/index.vue +++ b/web/src/pages/Doc/en/associativeLine/index.vue @@ -13,7 +13,8 @@
This plugin is used to support the addition of associative lines.
import MindMap from 'simple-mind-map'
-import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js'
+import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
+// import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' Use this path for versions below v0.6.0
MindMap.usePlugin(AssociativeLine)
diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md
index 42236e0b..90c60425 100644
--- a/web/src/pages/Doc/en/changelog/index.md
+++ b/web/src/pages/Doc/en/changelog/index.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.6.0
+
+optimization: Optimize the directory structure of simple-mind-map source code
+
## 0.5.11
New: Supports associative text editing.
diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue
index 6ae87866..4ce12897 100644
--- a/web/src/pages/Doc/en/changelog/index.vue
+++ b/web/src/pages/Doc/en/changelog/index.vue
@@ -1,6 +1,8 @@
optimization: Optimize the directory structure of simple-mind-map source code
New: Supports associative text editing.
optimization: Optimizing theme configuration updates, changing configurations that do not involve node size does not trigger node recalculation.
diff --git a/web/src/pages/Doc/en/constructor/index.md b/web/src/pages/Doc/en/constructor/index.md index 8d4da242..d9cdf098 100644 --- a/web/src/pages/Doc/en/constructor/index.md +++ b/web/src/pages/Doc/en/constructor/index.md @@ -25,11 +25,11 @@ const mindMap = new MindMap({ | Field Name | Type | Default Value | Description | Required | | -------------------------------- | ------- | ---------------- | ------------------------------------------------------------ | -------- | | el | Element | | Container element, must be a DOM element | Yes | -| data | Object | {} | Mind map data, refer to: https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js | | +| data | Object | {} | Mind map data, refer to: [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) | | | layout | String | logicalStructure | Layout type, options: logicalStructure (logical structure diagram), mindMap (mind map), catalogOrganization (catalog organization diagram), organizationStructure (organization structure diagram)、timeline(v0.5.4+, timeline)、timeline2(v0.5.4+, up down alternating timeline)、fishbone(v0.5.4+, fishbone diagram) | | | fishboneDeg(v0.5.4+) | Number | 45 | Set the diagonal angle of the fishbone structure diagram | | | theme | String | default | Theme, options: default, classic, minions, pinkGrape, mint, gold, vitalityOrange, greenLeaf, dark2, skyGreen, classic2, classic3, classic4(v0.2.0+), classicGreen, classicBlue, blueSky, brainImpairedPink, dark, earthYellow, freshGreen, freshRed, romanticPurple, simpleBlack(v0.5.4+), courseGreen(v0.5.4+), coffee(v0.5.4+), redSpirit(v0.5.4+), blackHumour(v0.5.4+), lateNightOffice(v0.5.4+), blackGold(v0.5.4+)、、avocado(v.5.10-fix.2+)、autumn(v.5.10-fix.2+)、orangeJuice(v.5.10-fix.2+) | | -| themeConfig | Object | {} | Theme configuration, will be merged with the selected theme, available fields refer to: https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js | | +| themeConfig | Object | {} | Theme configuration, will be merged with the selected theme, available fields refer to: [default.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js) | | | scaleRatio | Number | 0.1 | The incremental scaling ratio | | | maxTag | Number | 5 | The maximum number of tags displayed in the node, any additional tags will be discarded | | | exportPadding | Number | 20 | The padding for exporting images | | @@ -301,8 +301,8 @@ redo. All commands are as follows: | SELECT_ALL | Select all | | | BACK | Go back a specified number of steps | step (the number of steps to go back, default is 1) | | FORWARD | Go forward a specified number of steps | step (the number of steps to go forward, default is 1) | -| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) ) | -| INSERT_CHILD_NODE | Insert a child node, the active node or appoint node will be the operation node | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`)、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) ) | +| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) ) | +| INSERT_CHILD_NODE | Insert a child node, the active node or appoint node will be the operation node | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`)、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) ) | | UP_NODE | Move node up, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the first node in the list will be invalid | | | DOWN_NODE | Move node down, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the last node in the list will be invalid | | | REMOVE_NODE | Remove node, the active node or appoint node will be the operation node | appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array) | @@ -317,10 +317,10 @@ redo. All commands are as follows: | SET_NODE_DATA | Update node data, that is, update the data in the data object of the node data object | node (the node to set), data (object, the data to update, e.g. `{expand: true}`) | | SET_NODE_TEXT | Set node text | node (the node to set), text (the new text for the node), richText(v0.4.0+, If you want to set a rich text character, you need to set it to `true`) | | SET_NODE_IMAGE | Set Node Image | node (node to set), imgData (object, image information, structured as: `{url, title, width, height}`, the width and height of the image must be passed) | -| SET_NODE_ICON | Set Node Icon | node (node to set), icons (array, predefined image names array, available icons can be obtained in the nodeIconList list in the [https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js) file, icon name is type_name, such as ['priority_1']) | +| SET_NODE_ICON | Set Node Icon | node (node to set), icons (array, predefined image names array, available icons can be obtained in the nodeIconList list in the [icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js) file, icon name is type_name, such as ['priority_1']) | | SET_NODE_HYPERLINK | Set Node Hyperlink | node (node to set), link (hyperlink address), title (hyperlink name, optional) | | SET_NODE_NOTE | Set Node Note | node (node to set), note (note text) | -| SET_NODE_TAG | Set Node Tag | node (node to set), tag (string array, built-in color information can be obtained in [https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/constant.js)) | +| SET_NODE_TAG | Set Node Tag | node (node to set), tag (string array, built-in color information can be obtained in [constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)) | | INSERT_AFTER (v0.1.5+) | Move Node to After Another Node | node (node to move), exist (target node) | | INSERT_BEFORE (v0.1.5+) | Move Node to Before Another Node | node (node to move), exist (target node) | | MOVE_NODE_TO (v0.1.5+) | Move a node as a child of another node | node (the node to move), toNode (the target node) | @@ -328,7 +328,7 @@ redo. All commands are as follows: | REMOVE_GENERALIZATION (v0.2.0+) | Remove a node summary | | | SET_NODE_CUSTOM_POSITION (v0.2.0+) | Set a custom position for a node | node (the node to set), left (custom x coordinate, default is undefined), top (custom y coordinate, default is undefined) | | RESET_LAYOUT (v0.2.0+) | Arrange layout with one click | | -| SET_NODE_SHAPE (v0.2.4+) | Set the shape of a node | node (the node to set), shape (the shape, all shapes: https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/Shape.js) | +| SET_NODE_SHAPE (v0.2.4+) | Set the shape of a node | node (the node to set), shape (the shape, all shapes: [Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js)) | ### setData(data) diff --git a/web/src/pages/Doc/en/constructor/index.vue b/web/src/pages/Doc/en/constructor/index.vue index 2edbc9f4..dca476d8 100644 --- a/web/src/pages/Doc/en/constructor/index.vue +++ b/web/src/pages/Doc/en/constructor/index.vue @@ -39,7 +39,7 @@true) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js )true) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to exampleData.js )true)、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js )true)、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to exampleData.js )The Export plugin provides the export function.
import MindMap from 'simple-mind-map'
-import Export from 'simple-mind-map/src/Export.js'
+import Export from 'simple-mind-map/src/plugins/Export.js'
+// import Export from 'simple-mind-map/src/Export.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Export)
diff --git a/web/src/pages/Doc/en/drag/index.md b/web/src/pages/Doc/en/drag/index.md
index dbfc65a7..45cc986c 100644
--- a/web/src/pages/Doc/en/drag/index.md
+++ b/web/src/pages/Doc/en/drag/index.md
@@ -12,7 +12,8 @@ Please refer to the [Instantiation Options](/mind-map/#/doc/zh/constructor) of t
```js
import MindMap from 'simple-mind-map'
-import Drag from 'simple-mind-map/src/Drag.js'
+import Drag from 'simple-mind-map/src/plugins/Drag.js'
+// import Drag from 'simple-mind-map/src/Drag.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Drag)
```
diff --git a/web/src/pages/Doc/en/drag/index.vue b/web/src/pages/Doc/en/drag/index.vue
index a43ecba4..4d77fba9 100644
--- a/web/src/pages/Doc/en/drag/index.vue
+++ b/web/src/pages/Doc/en/drag/index.vue
@@ -7,7 +7,8 @@
Please refer to the Instantiation Options of the MindMap class for configuration.
import MindMap from 'simple-mind-map'
-import Drag from 'simple-mind-map/src/Drag.js'
+import Drag from 'simple-mind-map/src/plugins/Drag.js'
+// import Drag from 'simple-mind-map/src/Drag.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Drag)
diff --git a/web/src/pages/Doc/en/introduction/index.md b/web/src/pages/Doc/en/introduction/index.md
index 672fa1be..c5df21fe 100644
--- a/web/src/pages/Doc/en/introduction/index.md
+++ b/web/src/pages/Doc/en/introduction/index.md
@@ -63,6 +63,8 @@ The folder containing the packaged resources for the `web` folder.
[How to simulate the background image style of css in canvas](https://juejin.cn/post/7204854015463538744)
+[My first Electron application](https://juejin.cn/post/7233012756314701884)
+
## Special Note
This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.
diff --git a/web/src/pages/Doc/en/introduction/index.vue b/web/src/pages/Doc/en/introduction/index.vue
index 0cae4e91..04fd3614 100644
--- a/web/src/pages/Doc/en/introduction/index.vue
+++ b/web/src/pages/Doc/en/introduction/index.vue
@@ -7,21 +7,21 @@
1.simple-mind-map
This is an online mind map built using the simple-mind-map library and based
on Vue2.x and ElementUI. Features include:
When you press the direction key, how does the TV find the next focus
How to simulate the background image style of css in canvas
+This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.
This project may not have fully tested every function point, so there may be bugs. In addition, when the number of nodes is very large, there may be some performance issues. Because everyone can accept different levels of congestion, you can test the maximum number of nodes yourself.
diff --git a/web/src/pages/Doc/en/keyCommand/index.md b/web/src/pages/Doc/en/keyCommand/index.md index d47f5186..2ea06cc9 100644 --- a/web/src/pages/Doc/en/keyCommand/index.md +++ b/web/src/pages/Doc/en/keyCommand/index.md @@ -11,7 +11,7 @@ includes some built-in shortcuts and can also be added manually. The Add a shortcut `key`: Shortcut key, key values can be viewed at -[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js) +[keyMap.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/command/keyMap.js) Example: ```js diff --git a/web/src/pages/Doc/en/keyCommand/index.vue b/web/src/pages/Doc/en/keyCommand/index.vue index 0c9643c2..48d83d0d 100644 --- a/web/src/pages/Doc/en/keyCommand/index.vue +++ b/web/src/pages/Doc/en/keyCommand/index.vue @@ -8,7 +8,7 @@ includes some built-in shortcuts and can also be added manually. TheAdd a shortcut
key: Shortcut key, key values can be viewed at
-https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js
+keyMap.js
Example:
// Single key
mindMap.keyCommand.addShortcut("Enter", () => {});
diff --git a/web/src/pages/Doc/en/keyboardNavigation/index.md b/web/src/pages/Doc/en/keyboardNavigation/index.md
index 09bb5f2d..dae4cd05 100644
--- a/web/src/pages/Doc/en/keyboardNavigation/index.md
+++ b/web/src/pages/Doc/en/keyboardNavigation/index.md
@@ -8,7 +8,8 @@
```js
import MindMap from 'simple-mind-map'
-import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js'
+import KeyboardNavigation from 'simple-mind-map/src/plugins/KeyboardNavigation.js'
+// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' Use this path for versions below v0.6.0
MindMap.usePlugin(KeyboardNavigation)
```
diff --git a/web/src/pages/Doc/en/keyboardNavigation/index.vue b/web/src/pages/Doc/en/keyboardNavigation/index.vue
index c45ae94f..a3a918bb 100644
--- a/web/src/pages/Doc/en/keyboardNavigation/index.vue
+++ b/web/src/pages/Doc/en/keyboardNavigation/index.vue
@@ -7,7 +7,8 @@
KeyboardNavigation plugin provides keyboard navigation function, that is, when you press the direction key, it will automatically find the next node and activate it.
Register
import MindMap from 'simple-mind-map'
-import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js'
+import KeyboardNavigation from 'simple-mind-map/src/plugins/KeyboardNavigation.js'
+// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' Use this path for versions below v0.6.0
MindMap.usePlugin(KeyboardNavigation)
diff --git a/web/src/pages/Doc/en/miniMap/index.md b/web/src/pages/Doc/en/miniMap/index.md
index 495ab5f8..1c42d08d 100644
--- a/web/src/pages/Doc/en/miniMap/index.md
+++ b/web/src/pages/Doc/en/miniMap/index.md
@@ -12,7 +12,8 @@ viewport location, and can be quickly positioned by dragging on the small map.
```js
import MindMap from 'simple-mind-map'
-import MiniMap from 'simple-mind-map/src/MiniMap.js'
+import MiniMap from 'simple-mind-map/src/plugins/MiniMap.js'
+// import MiniMap from 'simple-mind-map/src/MiniMap.js' Use this path for versions below v0.6.0
MindMap.usePlugin(MiniMap)
```
diff --git a/web/src/pages/Doc/en/miniMap/index.vue b/web/src/pages/Doc/en/miniMap/index.vue
index 75b18097..c5946cb9 100644
--- a/web/src/pages/Doc/en/miniMap/index.vue
+++ b/web/src/pages/Doc/en/miniMap/index.vue
@@ -11,7 +11,8 @@ part of the mind map content. The viewport frame can be used to view the current
viewport location, and can be quickly positioned by dragging on the small map.
Register
import MindMap from 'simple-mind-map'
-import MiniMap from 'simple-mind-map/src/MiniMap.js'
+import MiniMap from 'simple-mind-map/src/plugins/MiniMap.js'
+// import MiniMap from 'simple-mind-map/src/MiniMap.js' Use this path for versions below v0.6.0
MindMap.usePlugin(MiniMap)
diff --git a/web/src/pages/Doc/en/richText/index.md b/web/src/pages/Doc/en/richText/index.md
index e4f09294..2223ce35 100644
--- a/web/src/pages/Doc/en/richText/index.md
+++ b/web/src/pages/Doc/en/richText/index.md
@@ -20,7 +20,8 @@ The version of `v0.5.7+` directly uses `html2canvas` to convert the entire `svg`
```js
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' Use this path for versions below v0.6.0
MindMap.usePlugin(RichText, opt?)
```
diff --git a/web/src/pages/Doc/en/richText/index.vue b/web/src/pages/Doc/en/richText/index.vue
index 43db5c80..7b645bd8 100644
--- a/web/src/pages/Doc/en/richText/index.vue
+++ b/web/src/pages/Doc/en/richText/index.vue
@@ -17,7 +17,8 @@
The version of v0.5.7+ directly uses html2canvas to convert the entire svg, which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.
Register
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' Use this path for versions below v0.6.0
MindMap.usePlugin(RichText, opt?)
diff --git a/web/src/pages/Doc/en/select/index.md b/web/src/pages/Doc/en/select/index.md
index 1761d1d5..6eb7a088 100644
--- a/web/src/pages/Doc/en/select/index.md
+++ b/web/src/pages/Doc/en/select/index.md
@@ -6,7 +6,8 @@ The `Select` plugin provides the function of right-clicking to select multiple n
```js
import MindMap from 'simple-mind-map'
-import Select from 'simple-mind-map/src/Select.js'
+import Select from 'simple-mind-map/src/plugins/Select.js'
+// import Select from 'simple-mind-map/src/Select.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Select)
```
diff --git a/web/src/pages/Doc/en/select/index.vue b/web/src/pages/Doc/en/select/index.vue
index d174955d..aecb9235 100644
--- a/web/src/pages/Doc/en/select/index.vue
+++ b/web/src/pages/Doc/en/select/index.vue
@@ -4,7 +4,8 @@
The Select plugin provides the function of right-clicking to select multiple nodes.
Register
import MindMap from 'simple-mind-map'
-import Select from 'simple-mind-map/src/Select.js'
+import Select from 'simple-mind-map/src/plugins/Select.js'
+// import Select from 'simple-mind-map/src/Select.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Select)
diff --git a/web/src/pages/Doc/en/watermark/index.md b/web/src/pages/Doc/en/watermark/index.md
index 08e11aad..5c39043d 100644
--- a/web/src/pages/Doc/en/watermark/index.md
+++ b/web/src/pages/Doc/en/watermark/index.md
@@ -10,7 +10,8 @@ Please refer to the [Instantiation Options](/mind-map/#/doc/zh/constructor) of t
```js
import MindMap from 'simple-mind-map'
-import Watermark from 'simple-mind-map/src/Watermark.js'
+import Watermark from 'simple-mind-map/src/plugins/Watermark.js'
+// import Watermark from 'simple-mind-map/src/Watermark.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Watermark)
```
diff --git a/web/src/pages/Doc/en/watermark/index.vue b/web/src/pages/Doc/en/watermark/index.vue
index 8daf838b..19c899ec 100644
--- a/web/src/pages/Doc/en/watermark/index.vue
+++ b/web/src/pages/Doc/en/watermark/index.vue
@@ -8,7 +8,8 @@
Please refer to the Instantiation Options of the MindMap class for configuration.
Register
import MindMap from 'simple-mind-map'
-import Watermark from 'simple-mind-map/src/Watermark.js'
+import Watermark from 'simple-mind-map/src/plugins/Watermark.js'
+// import Watermark from 'simple-mind-map/src/Watermark.js' Use this path for versions below v0.6.0
MindMap.usePlugin(Watermark)
diff --git a/web/src/pages/Doc/zh/associativeLine/index.md b/web/src/pages/Doc/zh/associativeLine/index.md
index 72f692d3..1507e037 100644
--- a/web/src/pages/Doc/zh/associativeLine/index.md
+++ b/web/src/pages/Doc/zh/associativeLine/index.md
@@ -12,7 +12,8 @@
```js
import MindMap from 'simple-mind-map'
-import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js'
+import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
+// import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(AssociativeLine)
```
diff --git a/web/src/pages/Doc/zh/associativeLine/index.vue b/web/src/pages/Doc/zh/associativeLine/index.vue
index 4e5cda2b..8f4b704b 100644
--- a/web/src/pages/Doc/zh/associativeLine/index.vue
+++ b/web/src/pages/Doc/zh/associativeLine/index.vue
@@ -13,7 +13,8 @@
该插件用于支持添加关联线。
注册
import MindMap from 'simple-mind-map'
-import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js'
+import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
+// import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(AssociativeLine)
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 3fc6fc2d..f0c36f78 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.6.0
+
+优化:优化simple-mind-map源码目录结构
+
## 0.5.11
新增:支持关联性文本编辑。
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index e4e59f09..f6be2f3a 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -1,6 +1,8 @@
Changelog
+0.6.0
+优化:优化simple-mind-map源码目录结构
0.5.11
新增:支持关联性文本编辑。
优化:优化主题配置更新,改变不涉及节点大小的配置不触发节点重新计算。
diff --git a/web/src/pages/Doc/zh/constructor/index.md b/web/src/pages/Doc/zh/constructor/index.md
index 9b4240b7..490d0dda 100644
--- a/web/src/pages/Doc/zh/constructor/index.md
+++ b/web/src/pages/Doc/zh/constructor/index.md
@@ -25,11 +25,11 @@ const mindMap = new MindMap({
| 字段名称 | 类型 | 默认值 | 描述 | 是否必填 |
| -------------------------------- | ------- | ---------------- | ------------------------------------------------------------ | -------- |
| el | Element | | 容器元素,必须为DOM元素 | 是 |
-| data | Object | {} | 思维导图数据,可参考:[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) | |
+| data | Object | {} | 思维导图数据,可参考:[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) | |
| layout | String | logicalStructure | 布局类型,可选列表:logicalStructure(逻辑结构图)、mindMap(思维导图)、catalogOrganization(目录组织图)、organizationStructure(组织结构图)、timeline(v0.5.4+,时间轴)、timeline2(v0.5.4+,上下交替型时间轴)、fishbone(v0.5.4+,鱼骨图) | |
| fishboneDeg(v0.5.4+) | Number | 45 | 设置鱼骨结构图的斜线角度 | |
| theme | String | default | 主题,可选列表:default(默认)、classic(脑图经典)、minions(小黄人)、pinkGrape(粉红葡萄)、mint(薄荷)、gold(金色vip)、vitalityOrange(活力橙)、greenLeaf(绿叶)、dark2(暗色2)、skyGreen(天清绿)、classic2(脑图经典2)、classic3(脑图经典3)、classic4(脑图经典4,v0.2.0+)、classicGreen(经典绿)、classicBlue(经典蓝)、blueSky(天空蓝)、brainImpairedPink(脑残粉)、dark(暗色)、earthYellow(泥土黄)、freshGreen(清新绿)、freshRed(清新红)、romanticPurple(浪漫紫)、simpleBlack(v0.5.4+简约黑)、courseGreen(v0.5.4+课程绿)、coffee(v0.5.4+咖啡)、redSpirit(v0.5.4+红色精神)、blackHumour(v0.5.4+黑色幽默)、lateNightOffice(v0.5.4+深夜办公室)、blackGold(v0.5.4+黑金)、avocado(v.5.10-fix.2+牛油果)、autumn(v.5.10-fix.2+秋天)、orangeJuice(v.5.10-fix.2+橙汁) | |
-| themeConfig | Object | {} | 主题配置,会和所选择的主题进行合并,可用字段可参考:[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js) | |
+| themeConfig | Object | {} | 主题配置,会和所选择的主题进行合并,可用字段可参考:[default.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js) | |
| scaleRatio | Number | 0.1 | 放大缩小的增量比例 | |
| maxTag | Number | 5 | 节点里最多显示的标签数量,多余的会被丢弃 | |
| exportPadding | Number | 20 | 导出图片时的内边距 | |
@@ -293,8 +293,8 @@ mindMap.updateConfig({
| SELECT_ALL | 全选 | |
| BACK | 回退指定的步数 | step(要回退的步数,默认为1) |
| FORWARD | 前进指定的步数 | step(要前进的步数,默认为1) |
-| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)) |
-| INSERT_CHILD_NODE | 插入子节点,操作节点为当前激活的节点或指定节点 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)) |
+| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)) |
+| INSERT_CHILD_NODE | 插入子节点,操作节点为当前激活的节点或指定节点 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)) |
| UP_NODE | 上移节点,操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的第一个节点使用无效 | |
| DOWN_NODE | 操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的最后一个节点使用无效 | |
| REMOVE_NODE | 删除节点,操作节点为当前激活的节点或指定节点 | appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组) |
@@ -310,10 +310,10 @@ mindMap.updateConfig({
| SET_NODE_DATA | 更新节点数据,即更新节点数据对象里`data`对象的数据 | node(要设置的节点)、data(对象,要更新的数据,如`{expand: true}`) |
| SET_NODE_TEXT | 设置节点文本 | node(要设置的节点)、text(要设置的文本字符串,换行可以使用`\n`)、richText(v0.4.0+,如果要设置的是富文本字符,需要设为`true`) |
| SET_NODE_IMAGE | 设置节点图片 | node(要设置的节点)、imgData(对象,图片信息,结构为:`{url, title, width, height}`,图片的宽高必须要传) |
-| SET_NODE_ICON | 设置节点图标 | node(要设置的节点)、icons(数组,预定义的图片名称组成的数组,可用图标可在[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js)文件里的`nodeIconList`列表里获取到,图标名称为`type_name`,如`['priority_1']`) |
+| SET_NODE_ICON | 设置节点图标 | node(要设置的节点)、icons(数组,预定义的图片名称组成的数组,可用图标可在[icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js)文件里的`nodeIconList`列表里获取到,图标名称为`type_name`,如`['priority_1']`) |
| SET_NODE_HYPERLINK | 设置节点超链接 | node(要设置的节点)、link(超链接地址)、title(超链接名称,可选) |
| SET_NODE_NOTE | 设置节点备注 | node(要设置的节点)、note(备注文字) |
-| SET_NODE_TAG | 设置节点标签 | node(要设置的节点)、tag(字符串数组,内置颜色信息可在[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/constant.js)里获取到) |
+| SET_NODE_TAG | 设置节点标签 | node(要设置的节点)、tag(字符串数组,内置颜色信息可在[constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)里获取到) |
| INSERT_AFTER(v0.1.5+) | 将节点移动到另一个节点的后面 | node(要移动的节点)、 exist(目标节点) |
| INSERT_BEFORE(v0.1.5+) | 将节点移动到另一个节点的前面 | node(要移动的节点)、 exist(目标节点) |
| MOVE_NODE_TO(v0.1.5+) | 移动一个节点作为另一个节点的子节点 | node(要移动的节点)、 toNode(目标节点) |
@@ -321,7 +321,7 @@ mindMap.updateConfig({
| REMOVE_GENERALIZATION(v0.2.0+) | 删除节点概要 | |
| SET_NODE_CUSTOM_POSITION(v0.2.0+) | 设置节点自定义位置 | node(要设置的节点)、 left(自定义的x坐标,默认为undefined)、 top(自定义的y坐标,默认为undefined) |
| RESET_LAYOUT(v0.2.0+) | 一键整理布局 | |
-| SET_NODE_SHAPE(v0.2.4+) | 设置节点形状 | node(要设置的节点)、shape(形状,全部形状:https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/Shape.js) |
+| SET_NODE_SHAPE(v0.2.4+) | 设置节点形状 | node(要设置的节点)、shape(形状,全部形状:[Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js)) |
### setData(data)
diff --git a/web/src/pages/Doc/zh/constructor/index.vue b/web/src/pages/Doc/zh/constructor/index.vue
index 3ebd890d..df3d03c0 100644
--- a/web/src/pages/Doc/zh/constructor/index.vue
+++ b/web/src/pages/Doc/zh/constructor/index.vue
@@ -39,7 +39,7 @@
data
Object
{}
-思维导图数据,可参考:https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js
+思维导图数据,可参考:exampleData.js
@@ -67,7 +67,7 @@
themeConfig
Object
{}
-主题配置,会和所选择的主题进行合并,可用字段可参考:https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js
+主题配置,会和所选择的主题进行合并,可用字段可参考:default.js
@@ -690,12 +690,12 @@ mindMap.setTheme('主题名称')
INSERT_NODE
插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效
-openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为true)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)
+openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为true)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考exampleData.js)
INSERT_CHILD_NODE
插入子节点,操作节点为当前激活的节点或指定节点
-openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为true)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)
+openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为true)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考exampleData.js)
UP_NODE
@@ -775,7 +775,7 @@ mindMap.setTheme('主题名称')
SET_NODE_ICON
设置节点图标
-node(要设置的节点)、icons(数组,预定义的图片名称组成的数组,可用图标可在https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js文件里的nodeIconList列表里获取到,图标名称为type_name,如['priority_1'])
+node(要设置的节点)、icons(数组,预定义的图片名称组成的数组,可用图标可在icons.js文件里的nodeIconList列表里获取到,图标名称为type_name,如['priority_1'])
SET_NODE_HYPERLINK
@@ -790,7 +790,7 @@ mindMap.setTheme('主题名称')
SET_NODE_TAG
设置节点标签
-node(要设置的节点)、tag(字符串数组,内置颜色信息可在https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/constant.js里获取到)
+node(要设置的节点)、tag(字符串数组,内置颜色信息可在constant.js里获取到)
INSERT_AFTER(v0.1.5+)
@@ -830,7 +830,7 @@ mindMap.setTheme('主题名称')
SET_NODE_SHAPE(v0.2.4+)
设置节点形状
-node(要设置的节点)、shape(形状,全部形状:https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/Shape.js)
+node(要设置的节点)、shape(形状,全部形状:Shape.js)
diff --git a/web/src/pages/Doc/zh/course10/index.md b/web/src/pages/Doc/zh/course10/index.md
index 542350d1..9965345f 100644
--- a/web/src/pages/Doc/zh/course10/index.md
+++ b/web/src/pages/Doc/zh/course10/index.md
@@ -5,7 +5,8 @@
`simple-mind-map`内置了很多主题,可以通过如下方式获取到所有的内置主题列表:
```js
-import { themeList } from 'simple-mind-map/src/utils/constant'
+import { themeList } from 'simple-mind-map/src/constants/constant'
+// import { themeList } from 'simple-mind-map/src/utils/constant' v0.6.0以下版本使用该路径
```
可以在实例化`simple-mind-map`时指定使用的主题:
diff --git a/web/src/pages/Doc/zh/course10/index.vue b/web/src/pages/Doc/zh/course10/index.vue
index 99eae284..62efe472 100644
--- a/web/src/pages/Doc/zh/course10/index.vue
+++ b/web/src/pages/Doc/zh/course10/index.vue
@@ -3,7 +3,8 @@
主题
使用和切换主题
simple-mind-map内置了很多主题,可以通过如下方式获取到所有的内置主题列表:
-import { themeList } from 'simple-mind-map/src/utils/constant'
+import { themeList } from 'simple-mind-map/src/constants/constant'
+// import { themeList } from 'simple-mind-map/src/utils/constant' v0.6.0以下版本使用该路径
可以在实例化simple-mind-map时指定使用的主题:
new MindMap({
diff --git a/web/src/pages/Doc/zh/course8/index.md b/web/src/pages/Doc/zh/course8/index.md
index b9c866ba..73fd1857 100644
--- a/web/src/pages/Doc/zh/course8/index.md
+++ b/web/src/pages/Doc/zh/course8/index.md
@@ -8,7 +8,8 @@
```js
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径
// 动态开启富文本编辑
mindMap.addPlugin(RichText)
diff --git a/web/src/pages/Doc/zh/course8/index.vue b/web/src/pages/Doc/zh/course8/index.vue
index 89d9465d..5be90743 100644
--- a/web/src/pages/Doc/zh/course8/index.vue
+++ b/web/src/pages/Doc/zh/course8/index.vue
@@ -5,7 +5,8 @@
富文本编辑的优势就是可以对一个节点内的部分文本设置样式,所以通常来说还需要搭配一个悬浮的工具栏,这个功能默认也是没有的,涉及到UI的功能一般都不提供,所以也需要你自行开发,如何渲染这个悬浮工具栏可以阅读如何渲染富文本的悬浮工具栏。
如果也你需要动态切换是否开启富文本编辑的功能可以参考如下代码:
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径
// 动态开启富文本编辑
mindMap.addPlugin(RichText)
diff --git a/web/src/pages/Doc/zh/doExport/index.md b/web/src/pages/Doc/zh/doExport/index.md
index 14e753fa..740329c6 100644
--- a/web/src/pages/Doc/zh/doExport/index.md
+++ b/web/src/pages/Doc/zh/doExport/index.md
@@ -6,7 +6,8 @@
```js
import MindMap from 'simple-mind-map'
-import Export from 'simple-mind-map/src/Export.js'
+import Export from 'simple-mind-map/src/plugins/Export.js'
+// import Export from 'simple-mind-map/src/Export.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Export)
```
diff --git a/web/src/pages/Doc/zh/doExport/index.vue b/web/src/pages/Doc/zh/doExport/index.vue
index d3c0074b..806df38a 100644
--- a/web/src/pages/Doc/zh/doExport/index.vue
+++ b/web/src/pages/Doc/zh/doExport/index.vue
@@ -4,7 +4,8 @@
Export插件提供导出的功能。
注册
import MindMap from 'simple-mind-map'
-import Export from 'simple-mind-map/src/Export.js'
+import Export from 'simple-mind-map/src/plugins/Export.js'
+// import Export from 'simple-mind-map/src/Export.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Export)
diff --git a/web/src/pages/Doc/zh/drag/index.md b/web/src/pages/Doc/zh/drag/index.md
index 6bfa1241..fe47d493 100644
--- a/web/src/pages/Doc/zh/drag/index.md
+++ b/web/src/pages/Doc/zh/drag/index.md
@@ -12,7 +12,8 @@
```js
import MindMap from 'simple-mind-map'
-import Drag from 'simple-mind-map/src/Drag.js'
+import Drag from 'simple-mind-map/src/plugins/Drag.js'
+// import Drag from 'simple-mind-map/src/Drag.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Drag)
```
diff --git a/web/src/pages/Doc/zh/drag/index.vue b/web/src/pages/Doc/zh/drag/index.vue
index c31f23d4..56932b8f 100644
--- a/web/src/pages/Doc/zh/drag/index.vue
+++ b/web/src/pages/Doc/zh/drag/index.vue
@@ -7,7 +7,8 @@
配置请参考MindMap类的实例化选项。
注册
import MindMap from 'simple-mind-map'
-import Drag from 'simple-mind-map/src/Drag.js'
+import Drag from 'simple-mind-map/src/plugins/Drag.js'
+// import Drag from 'simple-mind-map/src/Drag.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Drag)
diff --git a/web/src/pages/Doc/zh/introduction/index.md b/web/src/pages/Doc/zh/introduction/index.md
index 2331bb2f..52a82856 100644
--- a/web/src/pages/Doc/zh/introduction/index.md
+++ b/web/src/pages/Doc/zh/introduction/index.md
@@ -52,6 +52,8 @@
[如何在canvas中模拟css的背景图片样式](https://juejin.cn/post/7204854015463538744)
+[我的第一个Electron应用](https://juejin.cn/post/7233012756314701884)
+
## 特别说明
本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。
diff --git a/web/src/pages/Doc/zh/introduction/index.vue b/web/src/pages/Doc/zh/introduction/index.vue
index 47ae9f16..82815062 100644
--- a/web/src/pages/Doc/zh/introduction/index.vue
+++ b/web/src/pages/Doc/zh/introduction/index.vue
@@ -7,19 +7,19 @@
特性
-
-
-
-
-
-
-
-
-
-
-json、png、svg、pdf、markdown,支持从json、xmind、markdown导入
-
-
+
+
+
+
+
+
+
+
+
+
+json、png、svg、pdf、markdown,支持从json、xmind、markdown导入
+
+
仓库目录介绍
1.simple-mind-map
@@ -27,11 +27,11 @@
2.web
使用simple-mind-map库,基于vue2.x、ElementUI搭建的在线思维导图。特性:
-
-
-
-
-
+
+
+
+
+
提供文档页面服务。
3.dist
@@ -41,6 +41,7 @@
只需百来行代码,为你的Web页面增加本地文件操作能力,确定不试试吗?
+
特别说明
本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。
本项目可能没有完整测试到每一个功能点,所以可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。
diff --git a/web/src/pages/Doc/zh/keyCommand/index.md b/web/src/pages/Doc/zh/keyCommand/index.md
index 8de93543..c332bff0 100644
--- a/web/src/pages/Doc/zh/keyCommand/index.md
+++ b/web/src/pages/Doc/zh/keyCommand/index.md
@@ -8,7 +8,7 @@
添加快捷键
-`key`:快捷键按键,按键值可以通过[https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js)查看。示例:
+`key`:快捷键按键,按键值可以通过[keyMap.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/command/keyMap.js)查看。示例:
```js
// 单个按键
diff --git a/web/src/pages/Doc/zh/keyCommand/index.vue b/web/src/pages/Doc/zh/keyCommand/index.vue
index 7b6b7efd..163180d4 100644
--- a/web/src/pages/Doc/zh/keyCommand/index.vue
+++ b/web/src/pages/Doc/zh/keyCommand/index.vue
@@ -5,7 +5,7 @@
方法
addShortcut(key, fn)
添加快捷键
-key:快捷键按键,按键值可以通过https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/utils/keyMap.js查看。示例:
+key:快捷键按键,按键值可以通过keyMap.js查看。示例:
// 单个按键
mindMap.keyCommand.addShortcut('Enter', () => {})
// 或
diff --git a/web/src/pages/Doc/zh/keyboardNavigation/index.md b/web/src/pages/Doc/zh/keyboardNavigation/index.md
index abe83fdd..5a7cd801 100644
--- a/web/src/pages/Doc/zh/keyboardNavigation/index.md
+++ b/web/src/pages/Doc/zh/keyboardNavigation/index.md
@@ -8,7 +8,8 @@
```js
import MindMap from 'simple-mind-map'
-import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js'
+import KeyboardNavigation from 'simple-mind-map/src/plugins/KeyboardNavigation.js'
+// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(KeyboardNavigation)
```
diff --git a/web/src/pages/Doc/zh/keyboardNavigation/index.vue b/web/src/pages/Doc/zh/keyboardNavigation/index.vue
index ea38b890..b51a9964 100644
--- a/web/src/pages/Doc/zh/keyboardNavigation/index.vue
+++ b/web/src/pages/Doc/zh/keyboardNavigation/index.vue
@@ -7,7 +7,8 @@
KeyboardNavigation插件提供键盘导航的功能,也就是当你按下方向键时会自动寻找下一个节点并激活
注册
import MindMap from 'simple-mind-map'
-import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js'
+import KeyboardNavigation from 'simple-mind-map/src/plugins/KeyboardNavigation.js'
+// import KeyboardNavigation from 'simple-mind-map/src/KeyboardNavigation.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(KeyboardNavigation)
diff --git a/web/src/pages/Doc/zh/miniMap/index.md b/web/src/pages/Doc/zh/miniMap/index.md
index 3c6939d7..ebd00303 100644
--- a/web/src/pages/Doc/zh/miniMap/index.md
+++ b/web/src/pages/Doc/zh/miniMap/index.md
@@ -8,7 +8,8 @@
```js
import MindMap from 'simple-mind-map'
-import MiniMap from 'simple-mind-map/src/MiniMap.js'
+import MiniMap from 'simple-mind-map/src/plugins/MiniMap.js'
+// import MiniMap from 'simple-mind-map/src/MiniMap.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(MiniMap)
```
diff --git a/web/src/pages/Doc/zh/miniMap/index.vue b/web/src/pages/Doc/zh/miniMap/index.vue
index ba3b686c..a5ed0271 100644
--- a/web/src/pages/Doc/zh/miniMap/index.vue
+++ b/web/src/pages/Doc/zh/miniMap/index.vue
@@ -7,7 +7,8 @@
用于帮助快速开发小地图功能,小地图由两部分组成,一个是当前的画布内容,一个是视口框,当缩放、移动、元素过多时画布上可能只显示了思维导图的部分内容,可以通过视口框来查看当前视口所在位置,以及可以通过在小地图上拖动来快速定位。
注册
import MindMap from 'simple-mind-map'
-import MiniMap from 'simple-mind-map/src/MiniMap.js'
+import MiniMap from 'simple-mind-map/src/plugins/MiniMap.js'
+// import MiniMap from 'simple-mind-map/src/MiniMap.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(MiniMap)
diff --git a/web/src/pages/Doc/zh/richText/index.md b/web/src/pages/Doc/zh/richText/index.md
index fe1496c0..dcca3e9d 100644
--- a/web/src/pages/Doc/zh/richText/index.md
+++ b/web/src/pages/Doc/zh/richText/index.md
@@ -20,7 +20,8 @@
```js
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(RichText, opt?)
```
diff --git a/web/src/pages/Doc/zh/richText/index.vue b/web/src/pages/Doc/zh/richText/index.vue
index 4fe77a03..510f1184 100644
--- a/web/src/pages/Doc/zh/richText/index.vue
+++ b/web/src/pages/Doc/zh/richText/index.vue
@@ -17,7 +17,8 @@
v0.5.7+的版本直接使用html2canvas转换整个svg,速度不再是问题,但是目前存在一个bug,就是节点的颜色导出后不生效。
注册
import MindMap from 'simple-mind-map'
-import RichText from 'simple-mind-map/src/RichText.js'
+import RichText from 'simple-mind-map/src/plugins/RichText.js'
+// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(RichText, opt?)
diff --git a/web/src/pages/Doc/zh/select/index.md b/web/src/pages/Doc/zh/select/index.md
index 1e725c67..a1767936 100644
--- a/web/src/pages/Doc/zh/select/index.md
+++ b/web/src/pages/Doc/zh/select/index.md
@@ -6,7 +6,8 @@
```js
import MindMap from 'simple-mind-map'
-import Select from 'simple-mind-map/src/Select.js'
+import Select from 'simple-mind-map/src/plugins/Select.js'
+// import Select from 'simple-mind-map/src/Select.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Select)
```
diff --git a/web/src/pages/Doc/zh/select/index.vue b/web/src/pages/Doc/zh/select/index.vue
index 4360db88..ddc0852e 100644
--- a/web/src/pages/Doc/zh/select/index.vue
+++ b/web/src/pages/Doc/zh/select/index.vue
@@ -4,7 +4,8 @@
Select插件提供鼠标右键多选节点的功能。
注册
import MindMap from 'simple-mind-map'
-import Select from 'simple-mind-map/src/Select.js'
+import Select from 'simple-mind-map/src/plugins/Select.js'
+// import Select from 'simple-mind-map/src/Select.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Select)
diff --git a/web/src/pages/Doc/zh/watermark/index.md b/web/src/pages/Doc/zh/watermark/index.md
index b4831109..46131553 100644
--- a/web/src/pages/Doc/zh/watermark/index.md
+++ b/web/src/pages/Doc/zh/watermark/index.md
@@ -10,7 +10,8 @@
```js
import MindMap from 'simple-mind-map'
-import Watermark from 'simple-mind-map/src/Watermark.js'
+import Watermark from 'simple-mind-map/src/plugins/Watermark.js'
+// import Watermark from 'simple-mind-map/src/Watermark.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Watermark)
```
diff --git a/web/src/pages/Doc/zh/watermark/index.vue b/web/src/pages/Doc/zh/watermark/index.vue
index a5bf7884..5b193f53 100644
--- a/web/src/pages/Doc/zh/watermark/index.vue
+++ b/web/src/pages/Doc/zh/watermark/index.vue
@@ -8,7 +8,8 @@
配置请参考MindMap类的实例化选项。
注册
import MindMap from 'simple-mind-map'
-import Watermark from 'simple-mind-map/src/Watermark.js'
+import Watermark from 'simple-mind-map/src/plugins/Watermark.js'
+// import Watermark from 'simple-mind-map/src/Watermark.js' v0.6.0以下版本使用该路径
MindMap.usePlugin(Watermark)
diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue
index 5210592d..d5183ac4 100644
--- a/web/src/pages/Edit/components/Edit.vue
+++ b/web/src/pages/Edit/components/Edit.vue
@@ -23,14 +23,14 @@
+
+
diff --git a/web/src/pages/Edit/components/NavigatorToolbar.vue b/web/src/pages/Edit/components/NavigatorToolbar.vue
index 76081fc1..e724b6d4 100644
--- a/web/src/pages/Edit/components/NavigatorToolbar.vue
+++ b/web/src/pages/Edit/components/NavigatorToolbar.vue
@@ -15,6 +15,9 @@
/>
+
+
+
{{
$t('navigatorToolbar.openMiniMap')
@@ -46,6 +49,7 @@
+
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js
index 5e7a4e5f..d024d5e5 100644
--- a/web/src/pages/Doc/routerList.js
+++ b/web/src/pages/Doc/routerList.js
@@ -44,7 +44,8 @@ export default [
{ path: 'watermark', title: 'Watermark插件' },
{ path: 'xmind', title: 'XMind解析' },
{ path: 'deploy', title: '部署' },
- { path: 'client', title: '客户端' }
+ { path: 'client', title: '客户端' },
+ { path: 'touchEvent', title: 'TouchEvent插件' }
]
},
{
@@ -72,7 +73,8 @@ export default [
{ path: 'view', title: 'View instance' },
{ path: 'watermark', title: 'Watermark plugin' },
{ path: 'xmind', title: 'XMind parse' },
- { path: 'deploy', title: 'Deploy' }
+ { path: 'deploy', title: 'Deploy' },
+ { path: 'touchEvent', title: 'TouchEvent plugin' }
]
}
]
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 8460412a..028d39bd 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -4,7 +4,7 @@
破坏性更新:调整了simple-mind-map源码的目录结构,主要影响:1.插件的引入路径需要修改。2.constant文件路径需要修改。
-新增:1.支持一键缩放至适应画布功能。 2.按住Ctrl键多选功能可通过配置按需开启。 3.支持设置为左键多选节点,右键拖动画布。 4.支持控制节点是否允许编辑。 5.新增销毁思维导图的方法。
+新增:1.支持一键缩放至适应画布功能。 2.按住Ctrl键多选功能可通过配置按需开启。 3.支持设置为左键多选节点,右键拖动画布。 4.支持控制节点是否允许编辑。 5.新增销毁思维导图的方法。 6.新增触摸事件支持插件。
修复:1.修复按住ctrl键多选节点时不会触发节点的click事件的问题。 2.修复清空一个节点后再输入文字时节点样式丢失的问题。
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index c0cd6daf..2a519d61 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -3,7 +3,7 @@
Changelog
0.6.0
破坏性更新:调整了simple-mind-map源码的目录结构,主要影响:1.插件的引入路径需要修改。2.constant文件路径需要修改。
-新增:1.支持一键缩放至适应画布功能。 2.按住Ctrl键多选功能可通过配置按需开启。 3.支持设置为左键多选节点,右键拖动画布。 4.支持控制节点是否允许编辑。 5.新增销毁思维导图的方法。
+新增:1.支持一键缩放至适应画布功能。 2.按住Ctrl键多选功能可通过配置按需开启。 3.支持设置为左键多选节点,右键拖动画布。 4.支持控制节点是否允许编辑。 5.新增销毁思维导图的方法。 6.新增触摸事件支持插件。
修复:1.修复按住ctrl键多选节点时不会触发节点的click事件的问题。 2.修复清空一个节点后再输入文字时节点样式丢失的问题。
0.5.11
新增:支持关联性文本编辑。
diff --git a/web/src/pages/Doc/zh/touchEvent/index.md b/web/src/pages/Doc/zh/touchEvent/index.md
new file mode 100644
index 00000000..cd0dabb5
--- /dev/null
+++ b/web/src/pages/Doc/zh/touchEvent/index.md
@@ -0,0 +1,18 @@
+# TouchEvent插件
+
+> v0.6.0+
+
+该插件用户支持移动端触摸事件。原理是监听移动端的`touchstart`、`touchmove`、`touchend`事件,然后派发对应的鼠标事件。
+
+目前支持单指触摸移动画布、点击激活节点,双指缩放画布,单指双击复位和编辑节点。
+
+## 注册
+
+```js
+import MindMap from 'simple-mind-map'
+import TouchEvent from 'simple-mind-map/src/plugins/TouchEvent.js'
+
+MindMap.usePlugin(TouchEvent)
+```
+
+注册完且实例化`MindMap`后可通过`mindMap.touchEvent`获取到该实例。
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/touchEvent/index.vue b/web/src/pages/Doc/zh/touchEvent/index.vue
new file mode 100644
index 00000000..02df092f
--- /dev/null
+++ b/web/src/pages/Doc/zh/touchEvent/index.vue
@@ -0,0 +1,28 @@
+
+
+ TouchEvent插件
+
+v0.6.0+
+
+该插件用户支持移动端触摸事件。原理是监听移动端的touchstart、touchmove、touchend事件,然后派发对应的鼠标事件。
+目前支持单指触摸移动画布、点击激活节点,双指缩放画布,单指双击复位和编辑节点。
+注册
+import MindMap from 'simple-mind-map'
+import TouchEvent from 'simple-mind-map/src/plugins/TouchEvent.js'
+
+MindMap.usePlugin(TouchEvent)
+
+注册完且实例化MindMap后可通过mindMap.touchEvent获取到该实例。
+
+
+
+
+
+
+
\ No newline at end of file
From 23f09f9b4d2486aede44df8c635afb500dd373cc Mon Sep 17 00:00:00 2001
From: wanglin2 <1013335014@qq.com>
Date: Mon, 12 Jun 2023 14:42:44 +0800
Subject: [PATCH 14/14] =?UTF-8?q?=E6=89=93=E5=8C=850.6.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index c14f7ebd..24207853 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-一个简单的web思维导图实现
\ No newline at end of file
+一个简单的web思维导图实现
\ No newline at end of file