GithubHelp home page GithubHelp logo

omar331 / evoluttree Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 0.0 950 KB

React drag and drop tree structured content manager

JavaScript 60.28% HTML 1.97% TypeScript 28.82% CSS 7.29% Python 1.02% Dockerfile 0.62%

evoluttree's Introduction

Evoluttree

A ReactJs based, drag and drop, tree-structured content management system.

Built on top of ReactJs, Redux, Immutable, React dnd and other wonders of javascript's world.

Getting started

Installation and usage

npm install evoluttree
import * as React from 'react'
import * as ReactDOM from 'react-dom';

import { Evoluttree } from 'evoluttree'

// ---> general configuration for evoluttree
let myEvoluttreeConfig = {
    // --> called when anyone do changes in content thru frontend
    hookActionsToExternal: function(action) {
        console.log(' EXTERNAL HOOK action (redux style) = %o CALLED', action);
    },

    // --> this callback is invoked when one starts editing a page
    onStartEditPageBody: function(elementId, pageInfo) {
        console.log(' Started editing page dom elementId = %s  PageInfo = %o', elementId, pageInfo );

        // do what you want
        // ...
    }
};

// ---> the product being edited
let myEditingProduct = {
        general: {
            id: 123,
            title: 'Sample product'
        },
        pages: [
            {
                id: 1,
                title: 'Page One',
                pages: [
                    {id: 11,
                        title: 'Page One One'
                    }
                ]
            },
            {
                id: 2,
                title: 'Page Two',
                pages: [
                    {id: 21,
                        title: 'Page Two A'
                    }
                ]
            },
        ]
    }

class MyWebsiteManager extends React.Component<{}, {}> {
    constructor(props) {
        super(props);
    }
    render() {
        return(
            <div>
                <h1>My incredible website</h1>

                < Evoluttree config={myEvoluttreeConfig} editingProduct={myEditingProduct}/>
            </div>
        );
    }
}

ReactDOM.render(
    (
        <MyWebsiteManager />
    ),
    document.getElementById('content')
);

If everything is alright you gonna get something like this:

Sample product

You can drag and drop the pages, sort them as your want, add new pages, edit page and product titles (just click over them), edit and delete pages.

New features coming soon.

For developers

Some definitions

  • product a container for diferent types of contents like a main title, description and tree of nested pages.
  • page a node in content hierarchy. It contains a title and a body and can have a list of children pages.

API documentation

Evoluttree allows to change its state. Checkout out our API

Recipes

Contributing

Get involved. Welcome!

evoluttree's People

Contributors

felipearaujoh00d avatar marcbachmann avatar omar331 avatar samuelbartag avatar theoarena avatar ycaro-andre avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

evoluttree's Issues

Collapse / expand page tree state after QLM (quick level move)

In order to make the visual resulting changes of QLM more evident to the user, the following behaviour should happens:

  • when a page node is QLMed up, the origin page's parent should be collapsed
  • when a page node is QLMed down, the destination page's parent should be expanded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.