From 9fe94bfc214244e92397f244e6d50e6a2ed73eec Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Tue, 5 Dec 2023 09:34:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=850.9.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +-- simple-mind-map/package.json | 2 +- simple-mind-map/types/index.d.ts | 7 +++++ .../types/src/constants/constant.d.ts | 6 ++++ .../types/src/constants/defaultOptions.d.ts | 8 ++++++ .../types/src/core/command/KeyCommand.d.ts | 2 ++ .../types/src/core/render/Render.d.ts | 12 +++++++- .../types/src/core/render/TextEdit.d.ts | 17 +++++++++-- .../types/src/core/render/node/Node.d.ts | 17 +++++++++-- .../core/render/node/nodeCreateContents.d.ts | 5 ++++ .../core/render/node/nodeGeneralization.d.ts | 28 +++++++++++-------- simple-mind-map/types/src/layouts/Base.d.ts | 16 +++++++++++ .../types/src/utils/BatchExecution.d.ts | 1 + simple-mind-map/types/src/utils/index.d.ts | 4 +++ 14 files changed, 110 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index 61f69091..3b744fa6 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ 思绪思维导图
\ No newline at end of file + } \ No newline at end of file diff --git a/simple-mind-map/package.json b/simple-mind-map/package.json index cdc21d24..e891c782 100644 --- a/simple-mind-map/package.json +++ b/simple-mind-map/package.json @@ -1,6 +1,6 @@ { "name": "simple-mind-map", - "version": "0.9.0", + "version": "0.9.1", "description": "一个简单的web在线思维导图", "authors": [ { diff --git a/simple-mind-map/types/index.d.ts b/simple-mind-map/types/index.d.ts index e357d95b..58391454 100644 --- a/simple-mind-map/types/index.d.ts +++ b/simple-mind-map/types/index.d.ts @@ -74,6 +74,7 @@ declare class MindMap { richTextEditFakeInPlace: boolean; customHandleClipboardText: any; disableMouseWheelZoom: boolean; + disableTouchZoom: boolean; errorHandler: (code: any, error: any) => void; resetCss: string; enableDblclickBackToRootNode: boolean; @@ -103,6 +104,12 @@ declare class MindMap { defaultGeneralizationText: string; handleIsSplitByWrapOnPasteCreateNewNode: any; addHistoryTime: number; + isDisableDrag: boolean; + highlightNodeBoxStyle: { + stroke: string; + fill: string; + }; + createNewNodeBehavior: string; }); opt: any; el: any; diff --git a/simple-mind-map/types/src/constants/constant.d.ts b/simple-mind-map/types/src/constants/constant.d.ts index 3ac64ae7..e69cd23f 100644 --- a/simple-mind-map/types/src/constants/constant.d.ts +++ b/simple-mind-map/types/src/constants/constant.d.ts @@ -80,6 +80,11 @@ export namespace CONSTANTS { const VERTICAL: string; const HORIZONTAL: string; } + namespace CREATE_NEW_NODE_BEHAVIOR { + const DEFAULT: string; + const NOT_ACTIVE: string; + const ACTIVE_ONLY: string; + } } export const initRootNodePositionMap: { [x: string]: number; @@ -107,3 +112,4 @@ export namespace a4Size { const height: number; } export const cssContent: "\n /* 鼠标hover和激活时渲染的矩形 */\n .smm-hover-node{\n display: none;\n opacity: 0.6;\n stroke-width: 1;\n }\n\n .smm-node:not(.smm-node-dragging):hover .smm-hover-node{\n display: block;\n }\n\n .smm-node.active .smm-hover-node{\n display: block;\n opacity: 1;\n stroke-width: 2;\n }\n"; +export const selfCloseTagList: string[]; diff --git a/simple-mind-map/types/src/constants/defaultOptions.d.ts b/simple-mind-map/types/src/constants/defaultOptions.d.ts index 2541f2a6..b046c71c 100644 --- a/simple-mind-map/types/src/constants/defaultOptions.d.ts +++ b/simple-mind-map/types/src/constants/defaultOptions.d.ts @@ -70,6 +70,7 @@ export namespace defaultOpt { const richTextEditFakeInPlace: boolean; const customHandleClipboardText: any; const disableMouseWheelZoom: boolean; + const disableTouchZoom: boolean; function errorHandler(code: any, error: any): void; const resetCss: string; const enableDblclickBackToRootNode: boolean; @@ -101,4 +102,11 @@ export namespace defaultOpt { const defaultGeneralizationText: string; const handleIsSplitByWrapOnPasteCreateNewNode: any; const addHistoryTime: number; + const isDisableDrag: boolean; + namespace highlightNodeBoxStyle { + export const stroke: string; + const fill_2: string; + export { fill_2 as fill }; + } + const createNewNodeBehavior: string; } diff --git a/simple-mind-map/types/src/core/command/KeyCommand.d.ts b/simple-mind-map/types/src/core/command/KeyCommand.d.ts index 4a51eb8d..b400917d 100644 --- a/simple-mind-map/types/src/core/command/KeyCommand.d.ts +++ b/simple-mind-map/types/src/core/command/KeyCommand.d.ts @@ -11,6 +11,8 @@ export default class KeyCommand { save(): void; restore(): void; bindEvent(): void; + onKeydown(e: any): void; + unBindEvent(): void; checkKey(e: any, key: any): boolean; getOriginEventCodeArr(e: any): any[]; hasCombinationKey(e: any): any; diff --git a/simple-mind-map/types/src/core/render/Render.d.ts b/simple-mind-map/types/src/core/render/Render.d.ts index fe0bf10f..82623ec3 100644 --- a/simple-mind-map/types/src/core/render/Render.d.ts +++ b/simple-mind-map/types/src/core/render/Render.d.ts @@ -20,6 +20,9 @@ declare class Render { beingPasteText: string; beingPasteImgSize: number; currentBeingPasteType: string; + highlightBoxNode: any; + lastActiveNode: any; + lastActiveNodeList: any[]; setLayout(): void; layout: MindMap | CatalogOrganization | OrganizationStructure | Timeline | VerticalTimeline; setData(data: any): void; @@ -66,6 +69,7 @@ declare class Render { goTargetNode(node: any, callback?: () => void): void; registerShortcutKeys(): void; toggleActiveExpand(): void; + emitNodeActiveEvent(node?: any, activeNodeList?: any[]): void; clearActiveNodeListOnDrawClick(e: any, eventType: any): void; startTextEdit(): void; endTextEdit(): void; @@ -75,12 +79,17 @@ declare class Render { removeNodeFromActiveList(node: any): void; findActiveNodeIndex(node: any): any; backForward(type: any, step: any): void; + getNewNodeBehavior(openEdit?: boolean, handleMultiNodes?: boolean): { + focusNewNode: boolean; + inserting: boolean; + }; copy(): void; cut(): void; paste(): void; onPaste(): Promise; insertTo(node: any, exist: any, dir?: string): void; checkNodeLayerChange(node: any, toNode: any): void; + deleteNodeGeneralization(node: any): void; getNextActiveNode(): any; copyNode(): any; toggleNodeExpand(node: any): void; @@ -89,7 +98,8 @@ declare class Render { setRootNodeCenter(): void; expandToNodeUid(uid: any, callback?: () => void): void; findNodeByUid(uid: any): any; - emitNodeActiveEvent(): void; + highlightNode(node: any, range: any): void; + closeHighlightNode(): void; } import TextEdit from "./TextEdit"; import MindMap from "../../layouts/MindMap"; diff --git a/simple-mind-map/types/src/core/render/TextEdit.d.ts b/simple-mind-map/types/src/core/render/TextEdit.d.ts index b0e85633..1a888793 100644 --- a/simple-mind-map/types/src/core/render/TextEdit.d.ts +++ b/simple-mind-map/types/src/core/render/TextEdit.d.ts @@ -7,11 +7,24 @@ export default class TextEdit { showTextEdit: boolean; cacheEditingText: string; bindEvent(): void; - show(node: any, e: any, isInserting?: boolean, isFromKeyDown?: boolean): Promise; + show({ node, isInserting, isFromKeyDown, isFromScale }: { + node: any; + isInserting?: boolean; + isFromKeyDown?: boolean; + isFromScale?: boolean; + }): Promise; onScale(): void; + onKeydown(e: any): void; + unBindEvent(): void; checkIsAutoEnterTextEditKey(e: any): boolean; registerTmpShortcut(): void; - showEditTextBox(node: any, rect: any, isInserting: any, isFromKeyDown: any): void; + showEditTextBox({ node, rect, isInserting, isFromKeyDown, isFromScale }: { + node: any; + rect: any; + isInserting: any; + isFromKeyDown: any; + isFromScale: any; + }): void; getEditText(): any; hideEditTextBox(): any; } diff --git a/simple-mind-map/types/src/core/render/node/Node.d.ts b/simple-mind-map/types/src/core/render/node/Node.d.ts index 332fc6b8..3052ea0e 100644 --- a/simple-mind-map/types/src/core/render/node/Node.d.ts +++ b/simple-mind-map/types/src/core/render/node/Node.d.ts @@ -39,6 +39,7 @@ declare class Node { _tagData: any; _noteData: any; noteEl: any; + noteContentIsShow: boolean; _expandBtn: any; _lastExpandBtnType: any; _showExpandBtn: boolean; @@ -47,8 +48,7 @@ declare class Node { _fillExpandNode: any; _userListGroup: any; _lines: any[]; - _generalizationLine: any; - _generalizationNode: any; + _generalizationList: any[]; _unVisibleRectRegionNode: any; _isMouseenter: boolean; _rectInfo: { @@ -102,11 +102,14 @@ declare class Node { getShape(): any; hasCustomPosition(): boolean; ancestorHasCustomPosition(): boolean; + ancestorHasGeneralization(): boolean; addChildren(node: any): void; styleLine(line: any, node: any): void; removeLine(): void; + isAncestor(node: any): boolean; isParent(node: any): boolean; isBrother(node: any): any; + getIndexInBrothers(): any; getPaddingVale(): { paddingX: any; paddingY: any; @@ -117,7 +120,17 @@ declare class Node { getSelfInhertStyle(prop: any): any; getBorderWidth(): any; getData(key: any): any; + getPureData(removeActiveState?: boolean, removeId?: boolean): any; hasCustomStyle(): boolean; + getRect(): any; + getRectInSvg(): { + left: any; + right: any; + top: any; + bottom: any; + width: number; + height: number; + }; } import Style from "./Style"; import Shape from "./Shape"; diff --git a/simple-mind-map/types/src/core/render/node/nodeCreateContents.d.ts b/simple-mind-map/types/src/core/render/node/nodeCreateContents.d.ts index 9f74a320..9b7ce43c 100644 --- a/simple-mind-map/types/src/core/render/node/nodeCreateContents.d.ts +++ b/simple-mind-map/types/src/core/render/node/nodeCreateContents.d.ts @@ -7,6 +7,7 @@ declare namespace _default { export { createHyperlinkNode }; export { createTagNode }; export { createNoteNode }; + export { getNoteContentPosition }; export { measureCustomNodeContentSize }; export { isUseCustomNodeContent }; } @@ -38,6 +39,10 @@ declare function createNoteNode(): { declare class createNoteNode { noteEl: HTMLDivElement; } +declare function getNoteContentPosition(): { + left: any; + top: any; +}; declare function measureCustomNodeContentSize(content: any): { width: any; height: any; diff --git a/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts b/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts index 7dc71a37..9ec0ab82 100644 --- a/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts +++ b/simple-mind-map/types/src/core/render/node/nodeGeneralization.d.ts @@ -1,32 +1,38 @@ declare namespace _default { + export { formatGetGeneralization }; export { checkHasGeneralization }; + export { checkHasSelfGeneralization }; + export { getGeneralizationNodeIndex }; export { createGeneralizationNode }; export { updateGeneralization }; + export { updateGeneralizationData }; export { renderGeneralization }; export { removeGeneralization }; export { hideGeneralization }; export { showGeneralization }; + export { setGeneralizationOpacity }; + export { handleGeneralizationMouseenter }; + export { handleGeneralizationMouseleave }; } export default _default; +declare function formatGetGeneralization(): any[]; declare function checkHasGeneralization(): boolean; +declare function checkHasSelfGeneralization(): boolean; +declare function getGeneralizationNodeIndex(node: any): any; declare function createGeneralizationNode(): void; declare class createGeneralizationNode { - _generalizationLine: any; - _generalizationNode: Node; - _generalizationNodeWidth: any; - _generalizationNodeHeight: any; -} -declare function updateGeneralization(): void; -declare function renderGeneralization(): void; -declare class renderGeneralization { _generalizationNodeWidth: number; _generalizationNodeHeight: number; } +declare function updateGeneralization(): void; +declare function updateGeneralizationData(): void; +declare function renderGeneralization(): void; declare function removeGeneralization(): void; declare class removeGeneralization { - _generalizationLine: any; - _generalizationNode: any; + _generalizationList: any[]; } declare function hideGeneralization(): void; declare function showGeneralization(): void; -import Node from "./Node"; +declare function setGeneralizationOpacity(val: any): void; +declare function handleGeneralizationMouseenter(): void; +declare function handleGeneralizationMouseleave(): void; diff --git a/simple-mind-map/types/src/layouts/Base.d.ts b/simple-mind-map/types/src/layouts/Base.d.ts index 8919b4be..2a3502e8 100644 --- a/simple-mind-map/types/src/layouts/Base.d.ts +++ b/simple-mind-map/types/src/layouts/Base.d.ts @@ -39,6 +39,22 @@ declare class Base { generalizationLineMargin: any; generalizationNodeMargin: any; }; + getChildrenBoundaries(node: any, dir: any, startIndex: number, endIndex: any): { + left: number; + right: number; + top: number; + bottom: number; + generalizationLineMargin: any; + generalizationNodeMargin: any; + }; + getNodeGeneralizationRenderBoundaries(item: any, dir: any): { + left: any; + right: any; + top: any; + bottom: any; + generalizationLineMargin: any; + generalizationNodeMargin: any; + }; getNodeActChildrenLength(node: any): any; } import Lru from "../utils/Lru"; diff --git a/simple-mind-map/types/src/utils/BatchExecution.d.ts b/simple-mind-map/types/src/utils/BatchExecution.d.ts index 453eda55..62b161db 100644 --- a/simple-mind-map/types/src/utils/BatchExecution.d.ts +++ b/simple-mind-map/types/src/utils/BatchExecution.d.ts @@ -4,5 +4,6 @@ declare class BatchExecution { queue: any[]; nextTick: any; push(name: any, fn: any): void; + replaceTask(name: any, fn: any): void; flush(): void; } diff --git a/simple-mind-map/types/src/utils/index.d.ts b/simple-mind-map/types/src/utils/index.d.ts index dc06f807..63d1acc9 100644 --- a/simple-mind-map/types/src/utils/index.d.ts +++ b/simple-mind-map/types/src/utils/index.d.ts @@ -58,6 +58,8 @@ export function getObjectChangedProps(oldObject: any, newObject: any): {}; export function checkIsNodeStyleDataKey(key: any): boolean; export function mergerIconList(list: any): any; export function getTopAncestorsFomNodeList(list: any): any[]; +export function checkHasSupSubRelation(list: any): boolean; +export function parseAddGeneralizationNodeList(list: any): any[]; export function checkTwoRectIsOverlap(minx1: any, maxx1: any, miny1: any, maxy1: any, minx2: any, maxx2: any, miny2: any, maxy2: any): boolean; export function focusInput(el: any): void; export function selectAllInput(el: any): void; @@ -75,3 +77,5 @@ export function getDataFromClipboard(): Promise<{ img: any; }>; export function removeFromParentNodeData(node: any): void; +export function handleSelfCloseTags(str: any): any; +export function checkNodeListIsEqual(list1: any, list2: any): boolean;