Skip to content

Build your personal knowledge base with Trilium Notes

feat(mind-map): take over the bar that says which way a map runs

Elian Doran9ffb1def59fe
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index bb9991093f..3c56ee4665 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -3579,7 +3579,10 @@
"zoom-out": "Zoom out",
"center-map": "Center the map",
"fullscreen": "Fullscreen",
- "exit-fullscreen": "Exit fullscreen"
+ "exit-fullscreen": "Exit fullscreen",
+ "direction-left": "Branches to the left",
+ "direction-right": "Branches to the right",
+ "direction-side": "Branches to both sides"
},
"llm": {
"disabled_placeholder": "AI features are turned off. Enable them to configure providers and MCP.",
diff --git a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.css b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.css
index 7f6fa633c4..e0cff96ef3 100644
--- a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.css
+++ b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.css
@@ -1,13 +1,11 @@
/*
- * The bar is dressed as the node panel standing above it is (see NodePanel.css): the same surface,
- * the same border and the same blur, so that the two read as one piece of furniture in that corner
- * rather than as two things that happen to be there. Where they stand and how much room the one
- * leaves the other is settled between them in MindMap.css.
+ * The bars are dressed as the node panel is (see NodePanel.css): the same surface, the same border
+ * and the same blur, so that everything standing over a map reads as one family rather than as
+ * pieces from three places. Where they stand and how much room they leave the panel is settled
+ * between them in MindMap.css.
*/
.mind-map-container .mind-map-toolbar {
position: absolute;
- bottom: var(--mind-map-inset-bottom);
- inset-inline-end: var(--mind-map-inset);
display: flex;
align-items: center;
gap: 4px;
@@ -20,9 +18,32 @@
backdrop-filter: blur(10px);
}
-/* The buttons are on the bar's own surface rather than on the shell's, so they take their color
- from it — as the ones inside a menu do. */
+/* What is done with the view stands at the foot of the map, out of the way of its root. */
+.mind-map-container .mind-map-view-toolbar {
+ bottom: var(--mind-map-inset-bottom);
+ inset-inline-end: var(--mind-map-inset);
+}
+
+/* The way the map is laid out stands in the corner opposite, where Mind Elixir kept it. */
+.mind-map-container .mind-map-direction-toolbar {
+ top: var(--mind-map-inset-top);
+ inset-inline-start: var(--mind-map-inset);
+}
+
+/*
+ * The buttons are on the bar's own surface rather than on the shell's, so they take their color
+ * from it — as the ones inside a menu do.
+ *
+ * Their marks are centred by the button rather than by the text inside them, which is what a button
+ * does of its own accord and what the theme leans on: `text-align` centres the glyph a font icon
+ * paints, and has nothing to grip on a mark drawn as a box with a width of its own (see the
+ * direction marks below), leaving that one against the leading edge. Centring the box itself holds
+ * for both, so the seven marks sit alike whichever kind each is.
+ */
.mind-map-container .mind-map-toolbar .tn-tool-button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
color: inherit;
}
@@ -32,3 +53,56 @@
opacity: .4;
pointer-events: none;
}
+
+/*
+ * The direction the map is laid out by is a choice among three rather than three things to do, so
+ * the one in force is shown held down. It is dressed in the fill the app marks a chosen thing with
+ * rather than in the button group's raised chip: that chip is only told apart from its neighbours by
+ * the recessed track behind it, and there is no track here — a bar of glass is what these stand on.
+ * Held through a hover as well, so that pointing at the one already chosen does not lower it.
+ */
+.mind-map-container .mind-map-toolbar .tn-tool-button.active,
+.mind-map-container .mind-map-toolbar .tn-tool-button.active:hover {
+ background: var(--active-item-background-color);
+ color: var(--active-item-text-color);
+}
+
+/*
+ * The three marks a direction is chosen by, which are Mind Elixir's own (MIT, © 2019 DjZhou): each
+ * draws the very layout it sets, and Trilium's icon set has nothing that says it. They are drawn as
+ * a mask filled with the button's own color rather than as pictures, so that they take the color a
+ * boxicon would — including the one a pressed or hovered button lends its icon.
+ *
+ * Sized in `em` against the font size the theme gives an icon button's mark, so that the three sit
+ * at the size the four beside them do and follow that setting wherever it is changed.
+ */
+.mind-map-container .mind-map-direction-icon::before {
+ content: "";
+ width: 1em;
+ height: 1em;
+ background-color: currentColor;
+ -webkit-mask-position: center;
+ mask-position: center;
+ -webkit-mask-size: contain;
+ mask-size: contain;
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+}
+
+/* Each mark names its own file rather than handing one to a shared rule through a custom property:
+ a relative `url()` in a variable is resolved from wherever the variable is *used*, which the CSS
+ compiler refuses to guess at. */
+.mind-map-container .mind-map-direction-left::before {
+ -webkit-mask-image: url("./direction-left.svg");
+ mask-image: url("./direction-left.svg");
+}
+
+.mind-map-container .mind-map-direction-right::before {
+ -webkit-mask-image: url("./direction-right.svg");
+ mask-image: url("./direction-right.svg");
+}
+
+.mind-map-container .mind-map-direction-side::before {
+ -webkit-mask-image: url("./direction-side.svg");
+ mask-image: url("./direction-side.svg");
+}
diff --git a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.spec.tsx b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.spec.tsx
index cb7143e5d8..b03f291b1e 100644
--- a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.spec.tsx
+++ b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.spec.tsx
@@ -1,23 +1,35 @@
+import type { ComponentChild } from "preact";
import type { MindElixirInstance } from "mind-elixir";
import { act } from "preact/test-utils";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { renderInto } from "../../../test/render";
-import MapToolbar from "./MapToolbar";
+import MapToolbar, { DirectionToolbar } from "./MapToolbar";
/**
- * A stand-in for the Mind Elixir instance exposing only what the toolbar touches: the scale and its
- * range, the element that goes fullscreen, the map's own transform, and the ways it is moved.
+ * A stand-in for the Mind Elixir instance exposing only what the bars touch: the scale and its
+ * range, the element that goes fullscreen, the map's own transform, the direction it is laid out
+ * by, and the ways it is moved and relaid.
*/
-function buildMind({ scaleVal = 1 } = {}) {
+function buildMind({ scaleVal = 1, direction = 1 } = {}) {
const el = document.createElement("div");
el.requestFullscreen = vi.fn(async () => {});
document.body.appendChild(el);
const listeners = new Map<string, ((...args: unknown[]) => void)[]>();
+ const fire = (type: string, ...payload: unknown[]) => {
+ for (const listener of listeners.get(type) ?? []) listener(...payload);
+ };
+
const scale = vi.fn((value: number) => {
mind.scaleVal = value;
- for (const listener of listeners.get("scale") ?? []) listener(value);
+ fire("scale", value);
+ });
+
+ // As the map does: it is laid out afresh, and says only that its branches have been drawn.
+ const relayOut = (value: 0 | 1 | 2) => vi.fn(() => {
+ mind.direction = value;
+ fire("linkDiv");
});
const mind = {
@@ -28,10 +40,15 @@ function buildMind({ scaleVal = 1 } = {}) {
scaleSensitivity: 0.1,
scaleMin: 0.2,
scaleMax: 1.4,
+ direction,
scale,
toCenter: vi.fn(),
move: vi.fn(),
+ initLeft: relayOut(0),
+ initRight: relayOut(1),
+ initSide: relayOut(2),
bus: {
+ fire,
addListener: (type: string, listener: (...args: unknown[]) => void) => {
listeners.set(type, [ ...(listeners.get(type) ?? []), listener ]);
},
@@ -44,20 +61,28 @@ function buildMind({ scaleVal = 1 } = {}) {
return mind;
}
-/** The order the toolbar lays its buttons out in. */
+/** The order the view bar lays its buttons out in. */
const ZOOM_IN = 0;
const ZOOM_OUT = 1;
const CENTER = 2;
const FULLSCREEN = 3;
-/** Builds the bar and settles it, so that what it listens to is listened to before it is spoken to. */
-function renderToolbar(mind: MindElixirInstance) {
+/** The order the direction bar lays its buttons out in. */
+const LEFT = 0;
+const RIGHT = 1;
+const SIDE = 2;
+
+/** Builds a bar and settles it, so that what it listens to is listened to before it is spoken to. */
+function renderBar(bar: ComponentChild) {
let container: HTMLElement | undefined;
- act(() => { container = renderInto(<MapToolbar mind={mind} />); });
+ act(() => { container = renderInto(bar); });
if (!container) throw new Error("the toolbar was not rendered");
return container;
}
+const renderToolbar = (mind: MindElixirInstance) => renderBar(<MapToolbar mind={mind} />);
+const renderDirections = (mind: MindElixirInstance) => renderBar(<DirectionToolbar mind={mind} />);
+
function buttons(container: HTMLElement) {
return [ ...container.querySelectorAll<HTMLButtonElement>(".mind-map-toolbar button") ];
}
@@ -167,3 +192,54 @@ describe("MapToolbar", () => {
expect(buttons(container)[FULLSCREEN].className).toContain("bx-fullscreen");
});
});
+
+describe("DirectionToolbar", () => {
+ it("offers the three layouts the map's own bar did, each wearing its own mark", () => {
+ const container = renderDirections(buildMind());
+
+ expect(buttons(container).map((button) => button.className)).toEqual([
+ expect.stringContaining("mind-map-direction-left"),
+ expect.stringContaining("mind-map-direction-right"),
+ expect.stringContaining("mind-map-direction-side")
+ ]);
+ });
+
+ it("lays the map out the way the button pressed stands for", () => {
+ const mind = buildMind();
+ const container = renderDirections(mind);
+
+ press(container, LEFT);
+ expect(mind.initLeft).toHaveBeenCalled();
+
+ press(container, SIDE);
+ expect(mind.initSide).toHaveBeenCalled();
+
+ press(container, RIGHT);
+ expect(mind.initRight).toHaveBeenCalled();
+ });
+
+ it("shows the layout in force held down, and follows it as it changes", () => {
+ const mind = buildMind({ direction: 1 });
+ const container = renderDirections(mind);
+
+ expect(buttons(container).map((button) => button.classList.contains("active")))
+ .toEqual([ false, true, false ]);
+
+ press(container, SIDE);
+
+ expect(buttons(container).map((button) => button.classList.contains("active")))
+ .toEqual([ false, false, true ]);
+ });
+
+ it("catches up with a map that took a direction from the content it was filled with", () => {
+ const mind = buildMind({ direction: 1 });
+ const container = renderDirections(mind);
+
+ // As loading a map does: the direction is taken silently, and only the layout is announced.
+ mind.direction = 0;
+ act(() => mind.bus.fire("linkDiv"));
+
+ expect(buttons(container).map((button) => button.classList.contains("active")))
+ .toEqual([ true, false, false ]);
+ });
+});
diff --git a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.tsx b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.tsx
index 460626c30a..432b9161a9 100644
--- a/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.tsx
+++ b/apps/client/src/widgets/type_widgets/mind_map/MapToolbar.tsx
@@ -1,6 +1,7 @@
import "./MapToolbar.css";
import type { MindElixirInstance } from "mind-elixir";
+import type { ComponentChildren } from "preact";
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../../services/i18n";
@@ -15,10 +16,11 @@ interface MapToolbarProps {
* The bar standing in the bottom corner of a mind map: the scale the map is drawn at, where it
* stands, and how much of the screen it is given.
*
- * Mind Elixir puts a bar of its own in that corner, which is hidden (see MindMap.css). It is the one
- * piece of furniture the library lays over the map, and it was dressed in neither Trilium's buttons
- * nor Trilium's colors — it kept its own icons and its own surface next to the node panel above it.
- * Everything it did is done here, over the same instance.
+ * Mind Elixir lays two bars of its own over a map — this corner and the one opposite (see
+ * {@link DirectionToolbar}) — which are left out entirely (`toolBar: false`, see MindMap.tsx). They
+ * were dressed in neither Trilium's buttons nor Trilium's colors, standing on a surface of their own
+ * beside the node panel they share the map with. Everything they did is done here, over the same
+ * instance.
*/
export default function MapToolbar({ mind }: MapToolbarProps) {
const scale = useMapScale(mind);
@@ -29,12 +31,7 @@ export default function MapToolbar({ mind }: MapToolbarProps) {
const zoomedOut = stepZoom(scale, -1, limits);
return (
- <div
- className="mind-map-toolbar"
- /* Keep interactions inside the bar from reaching the map underneath, which would
- otherwise take a press on a button for the start of a drag or a selection. */
- onMouseDown={(e) => e.stopPropagation()}
- >
+ <Toolbar className="mind-map-view-toolbar">
<ToolbarButton
icon="bx bx-zoom-in"
text={t("mind-map.zoom-in")}
@@ -60,18 +57,89 @@ export default function MapToolbar({ mind }: MapToolbarProps) {
text={isFullscreen ? t("mind-map.exit-fullscreen") : t("mind-map.fullscreen")}
onClick={toggleFullscreen}
/>
+ </Toolbar>
+ );
+}
+
+/**
+ * The bar standing in the top corner opposite: which way the map's branches run from its root —
+ * to the left of it, to the right of it, or to either side.
+ *
+ * The three are a choice rather than three things to do, so the one the map is laid out by is shown
+ * pressed. Their marks are Mind Elixir's own, kept because they draw the very thing they set and
+ * nothing in Trilium's icon set says it (see MapToolbar.css).
+ */
+export function DirectionToolbar({ mind }: MapToolbarProps) {
+ const direction = useMapDirection(mind);
+
+ return (
+ <Toolbar className="mind-map-direction-toolbar">
+ {buildDirections().map(({ value, icon, label, apply }) => (
+ <ToolbarButton
+ key={value}
+ icon={`mind-map-direction-icon ${icon}`}
+ text={label}
+ active={direction === value}
+ // The bar stands at the head of the map, where a tooltip over it would fall off.
+ titlePosition="bottom"
+ onClick={() => apply(mind)}
+ />
+ ))}
+ </Toolbar>
+ );
+}
+
+/**
+ * The ways a map is laid out, in the order Mind Elixir offered them: each with the value
+ * `mind.direction` reads as, the mark it wears, and the call that lays the map out that way.
+ *
+ * Named afresh on every render, which follows a change of locale.
+ */
+function buildDirections() {
+ return [
+ {
+ value: 0,
+ icon: "mind-map-direction-left",
+ label: t("mind-map.direction-left"),
+ apply: (mind: MindElixirInstance) => mind.initLeft()
+ },
+ {
+ value: 1,
+ icon: "mind-map-direction-right",
+ label: t("mind-map.direction-right"),
+ apply: (mind: MindElixirInstance) => mind.initRight()
+ },
+ {
+ value: 2,
+ icon: "mind-map-direction-side",
+ label: t("mind-map.direction-side"),
+ apply: (mind: MindElixirInstance) => mind.initSide()
+ }
+ ];
+}
+
+/** The surface both bars stand on, and the reach of the map they are kept out of. */
+function Toolbar({ className, children }: { className: string, children: ComponentChildren }) {
+ return (
+ <div
+ className={`mind-map-toolbar ${className}`}
+ /* Keep interactions inside the bar from reaching the map underneath, which would
+ otherwise take a press on a button for the start of a drag or a selection. */
+ onMouseDown={(e) => e.stopPropagation()}
+ >
+ {children}
</div>
);
}
/** Dressed as the buttons floating over a rendered diagram are (see SplitEditor's `PreviewButton`). */
-function ToolbarButton(props: Omit<ActionButtonProps, "titlePosition">) {
+function ToolbarButton({ titlePosition, ...props }: ActionButtonProps) {
return <ActionButton
{...props}
className="tn-tool-button"
noIconActionClass
- // The bar sits at the foot of the map, where a tooltip under it would fall off the edge.
- titlePosition="top"
+ // Away from the edge of the map the bar stands at, where a tooltip would fall off it.
+ titlePosition={titlePosition ?? "top"}
/>;
}
@@ -94,6 +162,29 @@ function useMapScale(mind: MindElixirInstance) {
return scale;
}
+/**
+ * The way the map is laid out, followed as it changes.
+ *
+ * A map says so when it is laid out afresh, but not when it is first filled: content carrying a
+ * direction of its own is taken silently, and a map built and then filled would leave the bar
+ * showing the direction it was born with. What every layout of a map does say is that its branches
+ * have been drawn, which is asked after instead — it costs a read of a number, and it is the one
+ * word that comes however the direction was arrived at.
+ */
+function useMapDirection(mind: MindElixirInstance) {
+ const [ direction, setDirection ] = useState(mind.direction);
+
+ useEffect(() => {
+ const report = () => setDirection(mind.direction);
+
+ report();
+ mind.bus.addListener("linkDiv", report);
+ return () => mind.bus.removeListener("linkDiv", report);
+ }, [ mind ]);
+
+ return direction;
+}
+
/**
* Whether the map has the screen to itself, and the way to give it or take it back.
*
diff --git a/apps/client/src/widgets/type_widgets/mind_map/MindMap.css b/apps/client/src/widgets/type_widgets/mind_map/MindMap.css
index 3f701b8e89..cad5201345 100644
--- a/apps/client/src/widgets/type_widgets/mind_map/MindMap.css
+++ b/apps/client/src/widgets/type_widgets/mind_map/MindMap.css
@@ -8,10 +8,10 @@
}
/*
- * The corner the map's own furniture stands in: the toolbar at the foot of it (see MapToolbar.css)
- * and the node panel above (see NodePanel.css). Both are placed from here, so that the two agree on
- * where the one ends and the other may begin — including in fullscreen, where the edges of the map
- * are the edges of the screen and part of them may not be the screen's to draw on.
+ * How far everything standing over a map is held off its edges: the two bars (see MapToolbar.css)
+ * and the node panel between them (see NodePanel.css). All three are placed from here, so that they
+ * agree on where the one ends and the next may begin — including in fullscreen, where the edges of
+ * the map are the edges of the screen and part of them may not be the screen's to draw on.
*/
.mind-map-container {
--mind-map-inset: 20px;
@@ -22,15 +22,6 @@
--mind-map-toolbar-height: 42px;
}
-/*
- * Replaced by our own, which stands in the same corner and does the same four things (see
- * MapToolbar.tsx). Hidden rather than left out: the map offers no way to drop the one bar without
- * the other, and the bar of direction buttons in the opposite corner is still the library's.
- */
-.mind-map-container .mind-elixir-toolbar.rb {
- display: none;
-}
-
/* Hosts our own floating UI on top of the map, without interfering with the DOM managed by Mind Elixir. */
.mind-map-container .mind-map-overlay {
position: absolute;
@@ -87,9 +78,4 @@
.mind-map-container:fullscreen {
--mind-map-inset-top: calc(var(--mind-map-inset) + env(safe-area-inset-top));
--mind-map-inset-bottom: calc(var(--mind-map-inset) + env(safe-area-inset-bottom));
-
- /* The library's own bar of direction buttons, which its stylesheet pins to the top corner. */
- .lt {
- top: var(--mind-map-inset-top);
- }
}
diff --git a/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx b/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx
index 003438cbff..3a13160bee 100644
--- a/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx
+++ b/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx
@@ -18,7 +18,7 @@ import { TypeWidgetProps } from "../type_widget";
import { renderMindMapPreviewSvg } from "./export";
import { renderIconClasses } from "./icons";
import { renderNodeLinks } from "./links";
-import MapToolbar from "./MapToolbar";
+import MapToolbar, { DirectionToolbar } from "./MapToolbar";
import NodePanel from "./NodePanel";
/**
@@ -197,6 +197,7 @@ export default function MindMap({ note, ntxId, noteContext }: TypeWidgetProps) {
}}
>
{(mind) => <>
+ <DirectionToolbar mind={mind} />
<MapToolbar mind={mind} />
{/* Offered on a read-only map as well: Mind Elixir still selects a node there, and
@@ -226,6 +227,8 @@ function MindElixir({ children, containerRef: externalContainerRef, containerPro
el: containerRef.current,
editable,
contextMenu: { locale: buildMindElixirLangPack() },
+ // Both of the bars the library lays over a map are Trilium's instead (see MapToolbar).
+ toolBar: false,
// The name every node added to the map is born with, which Mind Elixir would otherwise
// give in English. Read afresh on every build, which follows a change of locale.
newTopicName: t("mind-map.new-node"),
diff --git a/apps/client/src/widgets/type_widgets/mind_map/direction-left.svg b/apps/client/src/widgets/type_widgets/mind_map/direction-left.svg
new file mode 100644
index 0000000000..2ed03afff2
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/mind_map/direction-left.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z"/></svg>
diff --git a/apps/client/src/widgets/type_widgets/mind_map/direction-right.svg b/apps/client/src/widgets/type_widgets/mind_map/direction-right.svg
new file mode 100644
index 0000000000..4bb4a01341
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/mind_map/direction-right.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z"/></svg>
diff --git a/apps/client/src/widgets/type_widgets/mind_map/direction-side.svg b/apps/client/src/widgets/type_widgets/mind_map/direction-side.svg
new file mode 100644
index 0000000000..72f3a2b56a
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/mind_map/direction-side.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z"/></svg>