Skip to content

Commit

Permalink
v0.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJSchoen committed Apr 4, 2022
1 parent ae9abcb commit 57b2993
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 20 deletions.
10 changes: 6 additions & 4 deletions dist/components/Block/VisualBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ var VisualBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
isCollapsed: isCollapsed,
isSelected: selected,
isDebugging: isDebugging,
setIsEditing: data.ref ? function (v) {
setIsEditing: data.dataType === _Constants.DATA_TYPES.REFERENCE || data.dataType === _Constants.DATA_TYPES.CALL ? function (v) {
return setIsEditing(data.ref, v);
} : function (v) {
return setIsEditing(data.id, v);
},
setIsSelected: data.ref ? function (v) {
return setIsSelected(data.ref, v);
setIsSelected: data.dataType === _Constants.DATA_TYPES.REFERENCE || data.dataType === _Constants.DATA_TYPES.CALL ? function (v) {
console.log(data);
setIsSelected(data.ref, v);
} : function (v) {
return setIsSelected(data.id, v);
console.log(data);
setIsSelected(data.id, v);
},
setIsCollapsed: setIsCollapsed,
setIsDebugging: setIsDebugging
Expand Down
3 changes: 2 additions & 1 deletion dist/components/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var CanvasNode = function CanvasNode(_ref) {
var data = _ref.data;
var highlightColor = data.highlightColor,
rest = (0, _objectWithoutProperties2.default)(data, _excluded);
console.log(rest);
return /*#__PURE__*/_react.default.createElement(_Block.VisualBlock, {
data: rest,
x: 0,
Expand All @@ -59,7 +60,7 @@ var Canvas = function Canvas(_ref2) {
var blockType = data.dataType === _Constants.DATA_TYPES.INSTANCE ? 'instanceBlock' : data.dataType === _Constants.DATA_TYPES.CALL ? 'callBlock' : data.dataType === _Constants.DATA_TYPES.REFERENCE ? 'referenceBlock' : 'nullBlock';
var color = (_state$programSpec$ob = state.programSpec.objectTypes[data.type][blockType]) === null || _state$programSpec$ob === void 0 ? void 0 : _state$programSpec$ob.color;
var onCanvas = (_state$programSpec$ob2 = state.programSpec.objectTypes[data.type][blockType]) === null || _state$programSpec$ob2 === void 0 ? void 0 : _state$programSpec$ob2.onCanvas;
var ref = data.ref ? state.programData[data.ref] : {};
var ref = data.ref ? state.programData[data.ref] : null;
var argumentBlocks = data !== null && data !== void 0 && data.arguments ? data.arguments : ref !== null && ref !== void 0 && ref.arguments ? ref.arguments : [];
var argumentBlockData = argumentBlocks.map(function (instanceId) {
var inst = state.programData[instanceId];
Expand Down
2 changes: 1 addition & 1 deletion dist/components/Generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ var combinedBlockData = function combinedBlockData(state, staticData, id) {
referenceBlock: {},
callBlock: {}
};
var refData = data !== null && data !== void 0 && data.ref ? state.programData[data === null || data === void 0 ? void 0 : data.ref] : {};
var refData = data !== null && data !== void 0 && data.ref ? state.programData[data === null || data === void 0 ? void 0 : data.ref] : null;
var selected = (data === null || data === void 0 ? void 0 : data.selected) || (refData === null || refData === void 0 ? void 0 : refData.selected);
var editing = (data === null || data === void 0 ? void 0 : data.editing) || (refData === null || refData === void 0 ? void 0 : refData.editing);
var argumentBlocks = data !== null && data !== void 0 && data.arguments ? data.arguments : refData !== null && refData !== void 0 && refData.arguments ? refData.arguments : [];
Expand Down
8 changes: 4 additions & 4 deletions dist/stories/Environment.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Fullscreen.args = {
}, {
icon: _fi.FiMoreHorizontal,
type: _components.EXTRA_TYPES.DROPDOWN,
contents: [_components.EXTRA_TYPES.NAME_EDIT_TOGGLE, _components.EXTRA_TYPES.LOCKED_INDICATOR, {
contents: [_components.EXTRA_TYPES.NAME_EDIT_TOGGLE, _components.EXTRA_TYPES.LOCKED_INDICATOR, _components.EXTRA_TYPES.SELECTION_TOGGLE, {
icon: _fi.FiMoreHorizontal,
label: 'More Options',
type: _components.EXTRA_TYPES.DROPDOWN,
Expand Down Expand Up @@ -226,7 +226,7 @@ Fullscreen.args = {
extras: [_components.EXTRA_TYPES.LOCKED_INDICATOR, {
icon: _fi.FiMoreHorizontal,
type: _components.EXTRA_TYPES.DROPDOWN,
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE]
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE, _components.EXTRA_TYPES.SELECTION_TOGGLE]
}],
hideNewPrefix: true
},
Expand Down Expand Up @@ -285,7 +285,7 @@ Fullscreen.args = {
extras: [_components.EXTRA_TYPES.LOCKED_INDICATOR, {
icon: _fi.FiMoreHorizontal,
type: _components.EXTRA_TYPES.DROPDOWN,
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE, _components.EXTRA_TYPES.NAME_EDIT_TOGGLE]
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE, _components.EXTRA_TYPES.NAME_EDIT_TOGGLE, _components.EXTRA_TYPES.SELECTION_TOGGLE]
}]
}
},
Expand All @@ -300,7 +300,7 @@ Fullscreen.args = {
extras: [_components.EXTRA_TYPES.LOCKED_INDICATOR, {
icon: _fi.FiMoreHorizontal,
type: _components.EXTRA_TYPES.DROPDOWN,
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE]
contents: [_components.EXTRA_TYPES.DELETE_BUTTON, _components.EXTRA_TYPES.DEBUG_TOGGLE, _components.EXTRA_TYPES.SELECTION_TOGGLE]
}]
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@



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.20f6998a.iframe.bundle.js"></script><script src="839.cfae045b.iframe.bundle.js"></script><script src="main.23a4b8f0.iframe.bundle.js"></script></body></html>
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.20f6998a.iframe.bundle.js"></script><script src="839.cfae045b.iframe.bundle.js"></script><script src="main.c0e5772e.iframe.bundle.js"></script></body></html>
1 change: 0 additions & 1 deletion docs/main.23a4b8f0.iframe.bundle.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/main.c0e5772e.iframe.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-vp",
"version": "0.1.16",
"version": "0.1.17",
"main": "dist/index.js",
"private": false,
"files": [
Expand Down
4 changes: 2 additions & 2 deletions src/components/Block/VisualBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const VisualBlock = forwardRef(
isCollapsed={isCollapsed}
isSelected={selected}
isDebugging={isDebugging}
setIsEditing={ data.ref ? (v)=>setIsEditing(data.ref,v) : (v)=>setIsEditing(data.id,v)}
setIsSelected={ data.ref ? (v)=>setIsSelected(data.ref,v) : (v)=>setIsSelected(data.id,v)}
setIsEditing={ data.dataType === DATA_TYPES.REFERENCE || data.dataType === DATA_TYPES.CALL ? (v)=>setIsEditing(data.ref,v) : (v)=>setIsEditing(data.id,v)}
setIsSelected={ data.dataType === DATA_TYPES.REFERENCE || data.dataType === DATA_TYPES.CALL ? (v)=>{console.log(data);setIsSelected(data.ref,v)} : (v)=>{console.log(data);setIsSelected(data.id,v)}}
setIsCollapsed={setIsCollapsed}
setIsDebugging={setIsDebugging} />
)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Canvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import useMeasure from 'react-use-measure';

const CanvasNode = ({ data }) => {
const { highlightColor, ...rest } = data;
console.log(rest)
return (
<VisualBlock data={rest} x={0} y={0} typeSpec={rest.typeSpec} onCanvas highlightColor={highlightColor} context={rest.context} />
)
Expand All @@ -35,7 +36,7 @@ export const Canvas = ({ highlightColor, drawerWidth }) => {
: 'nullBlock'
const color = state.programSpec.objectTypes[data.type][blockType]?.color;
const onCanvas = state.programSpec.objectTypes[data.type][blockType]?.onCanvas;
const ref = data.ref ? state.programData[data.ref] : {};
const ref = data.ref ? state.programData[data.ref] : null;
const argumentBlocks = data?.arguments ? data.arguments : ref?.arguments ? ref.arguments : [];
const argumentBlockData = argumentBlocks.map((instanceId) => {
const inst = state.programData[instanceId];
Expand Down
2 changes: 1 addition & 1 deletion src/components/Generators.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const callTemplateFromSpec = (type, functionReference, objectSpec) => {
export const combinedBlockData = (state,staticData,id) => {
const data = staticData ? staticData : state.programData[id] ? state.programData[id] : null;
const typeSpec = state.programSpec.objectTypes[data?.type] ? state.programSpec.objectTypes[data?.type] : {instanceBlock:{},referenceBlock:{},callBlock:{}};
const refData = data?.ref ? state.programData[data?.ref] : {};
const refData = data?.ref ? state.programData[data?.ref] : null;
const selected = data?.selected || refData?.selected;
const editing = data?.editing || refData?.editing;
const argumentBlocks = data?.arguments ? data.arguments : refData?.arguments ? refData.arguments: [];
Expand Down
10 changes: 7 additions & 3 deletions src/stories/Environment.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Fullscreen.args = {
contents: [
EXTRA_TYPES.NAME_EDIT_TOGGLE,
EXTRA_TYPES.LOCKED_INDICATOR,
EXTRA_TYPES.SELECTION_TOGGLE,
{
icon: FiMoreHorizontal,
label: 'More Options',
Expand Down Expand Up @@ -200,7 +201,8 @@ Fullscreen.args = {
type: EXTRA_TYPES.DROPDOWN,
contents: [
EXTRA_TYPES.DELETE_BUTTON,
EXTRA_TYPES.DEBUG_TOGGLE
EXTRA_TYPES.DEBUG_TOGGLE,
EXTRA_TYPES.SELECTION_TOGGLE
]
}
],
Expand Down Expand Up @@ -260,7 +262,8 @@ Fullscreen.args = {
contents: [
EXTRA_TYPES.DELETE_BUTTON,
EXTRA_TYPES.DEBUG_TOGGLE,
EXTRA_TYPES.NAME_EDIT_TOGGLE
EXTRA_TYPES.NAME_EDIT_TOGGLE,
EXTRA_TYPES.SELECTION_TOGGLE
]
}
]
Expand All @@ -281,7 +284,8 @@ Fullscreen.args = {
type: EXTRA_TYPES.DROPDOWN,
contents: [
EXTRA_TYPES.DELETE_BUTTON,
EXTRA_TYPES.DEBUG_TOGGLE
EXTRA_TYPES.DEBUG_TOGGLE,
EXTRA_TYPES.SELECTION_TOGGLE
]
}
]
Expand Down

0 comments on commit 57b2993

Please sign in to comment.