SSShooter / SSShooter/mind-elixir-core

Attach a sub item to the root of a mindmap.

Open
#361 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch mind-elixir@5.3.7 for the project I'm working on.

It was not possible to attach a sub item to the root of the mindmap.

Here is the diff that solved my problem:

diff --git a/node_modules/mind-elixir/dist/MindElixir.js b/node_modules/mind-elixir/dist/MindElixir.js
index fda8cf9..cfd11b0 100644
--- a/node_modules/mind-elixir/dist/MindElixir.js
+++ b/node_modules/mind-elixir/dist/MindElixir.js
@@ -922,7 +922,7 @@ const me = document, Dt = function(e, t) {
 }, He = function(e, t) {
   for (const n of t) {
     const o = n.parentElement.parentElement.contains(e);
-    if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent)) return !1;
+    if (!(e && e.tagName === "ME-TPC" && e !== n && !o)) return !1;
   }
   return !0;
 }, Pt = function(e) {
@@ -1680,7 +1680,7 @@ function ln(e, t) {
   n !== void 0 && (n[o] = t, t.children = [e]);
 }
 function ot(e, t, n) {
-  if (nt(t), n.parent?.parent || (t.direction = n.direction), e === "in")
+  if (nt(t), !n.parent ? (t.direction = t.direction !== void 0 ? t.direction : 0) : n.parent?.parent || (t.direction = n.direction), e === "in")
     n.children ? n.children.push(t) : n.children = [t];
   else {
     t.direction !== void 0 && (t.direction = n.direction);

This issue body was partially generated by patch-package.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported changes in dist/MindElixir.js, especially the He and ot functions, and locate their source counterparts in the TypeScript project. Verify the root-attachment path and direction handling, then confirm that a sub item can be attached to the mindmap root without breaking other attachments.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.