diff --git a/package.json b/package.json index e3afaa2b..87bf2273 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mind-elixir", - "version": "3.0.1", + "version": "3.0.2", "type": "module", "description": "Mind elixir is a free open source mind map core.", "keywords": [ diff --git a/src/index.ts b/src/index.ts index 02bb5f89..3dfac727 100644 --- a/src/index.ts +++ b/src/index.ts @@ -130,7 +130,7 @@ MindElixir.DARK_THEME = DARK_THEME * @memberof MindElixir * @static */ -MindElixir.version = '3.0.1' +MindElixir.version = '3.0.2' /** * @function * @memberof MindElixir diff --git a/src/interact.ts b/src/interact.ts index e649e064..fc2521ee 100644 --- a/src/interact.ts +++ b/src/interact.ts @@ -319,9 +319,8 @@ export const expandNode = function (this: MindElixirInstance, el: Topic, isExpan * @param {TargetElement} data mind elixir data */ export const refresh = function (this: MindElixirInstance, data?: MindElixirData) { - data = JSON.parse(JSON.stringify(data)) // it shouldn't contanimate the original data - // add parent property to every node if (data) { + data = JSON.parse(JSON.stringify(data)) as MindElixirData // it shouldn't contanimate the original data this.nodeData = data.nodeData this.linkData = data.linkData || {} } diff --git a/src/utils/index.ts b/src/utils/index.ts index 026a0997..5d9a78e2 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -21,6 +21,9 @@ export const getObjById = function (id: string, data: NodeObj): NodeObj | null { } } +/** + * Add parent property to every node + */ export const fillParent = (data: NodeObj, parent?: NodeObj) => { data.parent = parent if (data.children) {