-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
220 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from "react"; | ||
import MindMap from "./component/MindMap"; | ||
import Mindmap from "./component/mindmap"; | ||
import "./App.css"; | ||
|
||
function App() { | ||
return <MindMap />; | ||
return <Mindmap />; | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import cx from "classnames"; | ||
import { iconClassName } from "@blink-mind/renderer-react"; | ||
import { Menu, MenuDivider, MenuItem, Popover } from "@blueprintjs/core"; | ||
import React from "react"; | ||
import {downloadFile} from "../../utils"; | ||
|
||
export function ToolbarItemExport(props) { | ||
const onClickExportJson = e => { | ||
const { controller } = props; | ||
|
||
const json = controller.run("serializeModel", props); | ||
const jsonStr = JSON.stringify(json); | ||
const url = `data:text/plain,${encodeURIComponent(jsonStr)}`; | ||
downloadFile(url, "example.json"); | ||
}; | ||
|
||
return ( | ||
<div className={cx("bm-toolbar-item", iconClassName("export"))}> | ||
<Popover enforceFocus={false}> | ||
<div className="bm-toolbar-popover-target" /> | ||
<Menu> | ||
<MenuItem text="JSON(.json)" onClick={onClickExportJson} /> | ||
<MenuDivider /> | ||
</Menu> | ||
</Popover> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { DiagramLayoutType } from "@blink-mind/core"; | ||
import cx from "classnames"; | ||
import { Icon, iconClassName } from "@blink-mind/renderer-react"; | ||
import { Menu, MenuItem, Popover } from "@blueprintjs/core"; | ||
|
||
export function ToolbarItemLayout(props) { | ||
const layoutDirs = [ | ||
[ | ||
DiagramLayoutType.LEFT_AND_RIGHT, | ||
"Left And Right", | ||
"layout-left-and-right" | ||
], | ||
[DiagramLayoutType.LEFT_TO_RIGHT, "Only Right", "layout-right"], | ||
[DiagramLayoutType.RIGHT_TO_LEFT, "Only Left", "layout-left"] | ||
]; | ||
|
||
const onClickSetLayout = layoutDir => e => { | ||
const { controller } = props; | ||
controller.run("setLayoutDir", { ...props, layoutDir }); | ||
}; | ||
|
||
return ( | ||
<div | ||
className={cx("bm-toolbar-item", iconClassName("layout-left-and-right"))} | ||
> | ||
<Popover enforceFocus={false}> | ||
<div className="bm-toolbar-popover-target" /> | ||
<Menu> | ||
{layoutDirs.map(dir => ( | ||
<MenuItem | ||
key={dir[1]} | ||
icon={Icon(dir[2])} | ||
text={dir[1]} | ||
onClick={onClickSetLayout(dir[0])} | ||
/> | ||
))} | ||
</Menu> | ||
</Popover> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
export function ToolbarItemOpen(props) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import cx from "classnames"; | ||
import {iconClassName} from "@blink-mind/renderer-react"; | ||
import {Menu, MenuDivider, MenuItem, Popover} from "@blueprintjs/core"; | ||
import React from "react"; | ||
|
||
export function ToolbarItemSaveAs(props) { | ||
const { onClickExportJson } = props; | ||
return ( | ||
<div className={cx("bm-toolbar-item", iconClassName("saveas"))}> | ||
<Popover enforceFocus={false}> | ||
<div className="bm-toolbar-popover-target" /> | ||
<Menu> | ||
<MenuItem text="JSON(.json)" onClick={onClickExportJson} /> | ||
<MenuDivider /> | ||
</Menu> | ||
</Popover> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import defaultThemeImg from "../../images/default.jpg"; | ||
import theme1Img from "../../images/theme1.jpg"; | ||
import theme2Img from "../../images/theme2.jpg"; | ||
import theme3Img from "../../images/theme3.jpg"; | ||
import theme4Img from "../../images/theme4.jpg"; | ||
import cx from "classnames"; | ||
import { iconClassName } from "@blink-mind/renderer-react"; | ||
import { Popover } from "@blueprintjs/core"; | ||
import React from "react"; | ||
|
||
export function ToolbarItemTheme(props) { | ||
const onClickSetTheme = themeKey => e => { | ||
const { controller } = props; | ||
controller.run("setTheme", { ...props, themeKey }); | ||
}; | ||
const themes = [ | ||
["default", defaultThemeImg], | ||
["theme1", theme1Img], | ||
["theme2", theme2Img], | ||
["theme3", theme3Img], | ||
["theme4", theme4Img] | ||
]; | ||
|
||
return ( | ||
<div className={cx("bm-toolbar-item", iconClassName("theme"))}> | ||
<Popover enforceFocus={false}> | ||
<div className="bm-toolbar-popover-target" /> | ||
<div className="bm-popover-theme"> | ||
{themes.map(theme => ( | ||
<div className="bm-theme-item" onClick={onClickSetTheme(theme[0])}> | ||
<img className="bm-theme-img" src={theme[1]} alt={theme[0]} /> | ||
</div> | ||
))} | ||
</div> | ||
</Popover> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.