zammer / reactorstrap

drag&drop UI Kit for reactorstrap

Home Page:http://iorekz.github.io/reactorstrap/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reactorstrap

drag&drop UI Kit for reactorstrap and theorically any other one. demo Reactor

Implementation

There are 5 main components:

  • Reactor: the main component

    mainly sync all the children components Manage the app tree in its state with the form : {name: 'div', elem: DOM.div, props: {}, children: ['Hi']} Manage the selected component in the tree for the configurator. Link the drag and drop features between the Catalog and the Tree.

  • Catalog: the component list on the left

It takes a hashmap of components with the form {name -> React Component} so the original required react-bootstrap object is just fine. We add some classic React.DOM components like div, span ...

  • Tree Preview: the tree representation of the app

    It use the amazing chenglou/treeview to render the tree. We use some native html5 drag and drop to add or replace components. We mark the string children as contenteditable.

  • Preview: The preview of the app

    We just take the app tree and render it as is. 5 lines of code

  • Configurator: Props editor of selected node in the tree

    It takes the selected component as props. We then inspect the object to find props. We also fake render with bad props so we can guess the prop types from the message :/ and display revelant UI like checkbox for bools. We could use gcanti/tcomb-react-bootstrap to read prop types but it would only work for react bootstrap.

Libraries

Use the new Facebook Immutable library with cursors for deep tree updaptes. That's a feature I missed from Om. We can update and render deep in the tree quite elegantly.

About

drag&drop UI Kit for reactorstrap

http://iorekz.github.io/reactorstrap/


Languages

Language:JavaScript 94.8%Language:CSS 4.0%Language:HTML 1.2%