mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-13 15:52:55 +01:00
Initial commit
Co-Authored-By: Eric Tuvesson <eric.tuvesson@gmail.com> Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com> Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com> Co-Authored-By: Anders Larsson <64838990+anders-topp@users.noreply.github.com> Co-Authored-By: Johan <4934465+joolsus@users.noreply.github.com> Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com> Co-Authored-By: victoratndl <99176179+victoratndl@users.noreply.github.com>
This commit is contained in:
45
packages/noodl-viewer-react/src/nodes/visual/icon.js
Normal file
45
packages/noodl-viewer-react/src/nodes/visual/icon.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { Icon } from '../../components/visual/Icon';
|
||||
import NodeSharedPortDefinitions from '../../node-shared-port-definitions';
|
||||
import { createNodeFromReactComponent } from '../../react-component-node';
|
||||
|
||||
const IconNode = {
|
||||
name: 'net.noodl.visual.icon',
|
||||
displayName: 'Icon',
|
||||
docs: 'https://docs.noodl.net/nodes/basic-elements/icon',
|
||||
allowChildren: false,
|
||||
noodlNodeAsProp: true,
|
||||
connectionPanel: {
|
||||
groupPriority: [
|
||||
'General',
|
||||
'Style',
|
||||
'Actions',
|
||||
'Events',
|
||||
'States',
|
||||
'Mounted',
|
||||
'Hover Events',
|
||||
'Pointer Events',
|
||||
'Focus Events'
|
||||
]
|
||||
},
|
||||
getReactComponent() {
|
||||
return Icon;
|
||||
}
|
||||
};
|
||||
NodeSharedPortDefinitions.addAlignInputs(IconNode);
|
||||
NodeSharedPortDefinitions.addTransformInputs(IconNode);
|
||||
NodeSharedPortDefinitions.addPaddingInputs(IconNode, {
|
||||
defaults: {
|
||||
paddingTop: 5,
|
||||
paddingRight: 5,
|
||||
paddingBottom: 5,
|
||||
paddingLeft: 5
|
||||
}
|
||||
});
|
||||
NodeSharedPortDefinitions.addMarginInputs(IconNode);
|
||||
NodeSharedPortDefinitions.addIconInputs(IconNode, {
|
||||
hideEnableIconInput: true,
|
||||
defaults: { useIcon: true }
|
||||
});
|
||||
NodeSharedPortDefinitions.addSharedVisualInputs(IconNode);
|
||||
|
||||
export default createNodeFromReactComponent(IconNode);
|
||||
Reference in New Issue
Block a user