Skip to content

Commit 289aa4d

Browse files
committed
0.4.1
1 parent fe699bc commit 289aa4d

File tree

10 files changed

+14
-11
lines changed

10 files changed

+14
-11
lines changed

dist/components/Canvas.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var CanvasNode = function CanvasNode(_ref) {
5555

5656
var Canvas = function Canvas(_ref2) {
5757
var highlightColor = _ref2.highlightColor,
58-
drawerWidth = _ref2.drawerWidth;
58+
snapToGrid = _ref2.snapToGrid;
5959
var locked = (0, _ProgrammingContext.useProgrammingStore)(function (state) {
6060
return state.locked;
6161
});
@@ -173,7 +173,7 @@ var Canvas = function Canvas(_ref2) {
173173
onNodesChange: moveNode,
174174
defaultZoom: 1,
175175
fitView: true,
176-
snapToGrid: true,
176+
snapToGrid: snapToGrid,
177177
snapGrid: [30, 30]
178178
}, /*#__PURE__*/_react.default.createElement(_reactFlowRenderer.MiniMap, {
179179
maskColor: "#1a192b44",

dist/components/Environment.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ function Environment(_ref) {
3535
highlightColor = _ref.highlightColor,
3636
height = _ref.height,
3737
width = _ref.width,
38-
drawerWidth = _ref.drawerWidth;
38+
drawerWidth = _ref.drawerWidth,
39+
snapToGrid = _ref.snapToGrid;
3940
var theme = (0, _theme.getTheme)(highlightColor);
4041
return /*#__PURE__*/_react.default.createElement(_grommet.Grommet, {
4142
theme: theme
@@ -57,7 +58,7 @@ function Environment(_ref) {
5758
drawerWidth: drawerWidth ? drawerWidth : 235
5859
}), /*#__PURE__*/_react.default.createElement(_reactFlowRenderer.ReactFlowProvider, null, /*#__PURE__*/_react.default.createElement(_Canvas.Canvas, {
5960
highlightColor: highlightColor,
60-
drawerWidth: drawerWidth ? drawerWidth : 235
61+
snapToGrid: snapToGrid
6162
}))), /*#__PURE__*/_react.default.createElement(_DragLayer.DragLayer, {
6263
highlightColor: highlightColor
6364
}))));

dist/stories/Environment.stories.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ exports.Fullscreen = Fullscreen;
8686
Fullscreen.args = {
8787
highlightColor: '#ff00ff',
8888
drawerWidth: 235,
89+
snapToGrid: true,
8990
drawers: [{
9091
title: "Structures",
9192
dataType: _components.DATA_TYPES.INSTANCE,

docs/iframe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,4 +345,4 @@
345345

346346

347347

348-
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.568ca8e6.iframe.bundle.js"></script><script src="939.71356641.iframe.bundle.js"></script><script src="main.01f1ae31.iframe.bundle.js"></script></body></html>
348+
window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx))$"}];</script><script src="runtime~main.568ca8e6.iframe.bundle.js"></script><script src="939.71356641.iframe.bundle.js"></script><script src="main.1dcd8afd.iframe.bundle.js"></script></body></html>

docs/main.01f1ae31.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/main.1dcd8afd.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-vp",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"main": "dist/index.js",
55
"private": false,
66
"files": [

src/components/Canvas.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const CanvasNode = ({ data }) => {
2323
)
2424
};
2525

26-
export const Canvas = ({ highlightColor, drawerWidth }) => {
26+
export const Canvas = ({ highlightColor, snapToGrid }) => {
2727
const locked = useProgrammingStore(state=>state.locked);
2828
const setLocked = useProgrammingStore(state=>state.setLocked);
2929
const nodes = useProgrammingStore((state) =>
@@ -103,7 +103,7 @@ export const Canvas = ({ highlightColor, drawerWidth }) => {
103103
onNodesChange={moveNode}
104104
defaultZoom={1}
105105
fitView
106-
snapToGrid={true}
106+
snapToGrid={snapToGrid}
107107
snapGrid={[30, 30]}
108108
>
109109
<MiniMap

src/components/Environment.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Grommet } from "grommet";
1111
import {ReactFlowProvider} from "react-flow-renderer";
1212
import { getTheme } from './theme';
1313

14-
export default function Environment({ store, highlightColor, height, width, drawerWidth }) {
14+
export default function Environment({ store, highlightColor, height, width, drawerWidth, snapToGrid }) {
1515

1616
const theme = getTheme(highlightColor);
1717

@@ -30,7 +30,7 @@ export default function Environment({ store, highlightColor, height, width, draw
3030
>
3131
<Drawer highlightColor={highlightColor} drawerWidth={drawerWidth ? drawerWidth : 235}/>
3232
<ReactFlowProvider>
33-
<Canvas highlightColor={highlightColor} drawerWidth={drawerWidth ? drawerWidth : 235}/>
33+
<Canvas highlightColor={highlightColor} snapToGrid={snapToGrid}/>
3434
</ReactFlowProvider>
3535
</div>
3636
<DragLayer highlightColor={highlightColor}/>

src/stories/Environment.stories.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const Fullscreen = Template.bind({});
3636
Fullscreen.args = {
3737
highlightColor: '#ff00ff',
3838
drawerWidth: 235,
39+
snapToGrid: true,
3940
drawers: [
4041
{ title: "Structures", dataType: DATA_TYPES.INSTANCE, objectTypes: ["functionType", "operationType", "blockType"], icon: FiClipboard },
4142
{ title: "Functions", dataType: DATA_TYPES.CALL, objectType: 'functionType', icon: FiLogOut },

0 commit comments

Comments
 (0)