
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-designer-core
Advanced tools
React-designer-core is a set of core components for easy content creation.
React-designer-core is a set of core components for react-designer. This is WYSIWYG editor for easy content creation (legal contracts, business forms, marketing leaflets, technical guides, visual reports, rich dashboards, tutorials and other content, etc.).
Live demos
It comes with core components typical for WYSIWYG designers
Document definition is done in JSON - uses PTT
The PPT format is framework agnostic document description. It enables to dynamically render pages in different sizes (A4,A3,Letter,...),in various formats (html,pdf,...) and for various visual media (screen, papers).
It is a simple component tree that consists of these two nodes
There is an minimal 'Hello world' example. The PTT consists of one container and one box with TextBox element.
{
"name": "Hello World Example",
"elementName": "PTTv1",
"containers": [
{
"name": "My first container",
"elementName": "Container",
"style": { "top": 0, "left": 0, "height": 200, "width": 740, "position": "relative" },
"boxes": [{
"name": "My first text",
"elementName": "TextContent",
"style": { "top": 0, "left": 0 },
"props":{
"content": "Hello world"
}
}]
}]
}
See the full PTT specification.
To render react components specifies in react is really simple
render:{
{this.props.boxes.map(function (box, i) {
var component = React.createElement(widget,box, box.content!== undefined?React.DOM.span(null, box.content):undefined);
return (
<div style={box.style}>
{component}
</div>
);
}, this)}
}
To build the examples locally, run:
npm install
gulp dev
Then open localhost:8000 in a browser.
The easiest way to use this component is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).
You can also use the standalone build by including dist/react-designer-core.js in your page. If you use this, make sure you have already included React, and it is available as a global variable.
npm install react-designer-core --save
import {Workplace,ObjectBrowser} from 'react-designer-core';
import React from 'react';
import Freezer from 'freezer-js';
import Designer from './Designer';
// Create a Freezer store
var freezer = new Freezer({
schema: {
elementName: 'ObjectSchema',
name: 'New Document',
containers: []
}
})
export default class AppContainer extends React.Component {
componentDidMount() {
var me = this;
// 2. Your app get re-rendered on any state change
freezer.on('update', function () {
me.forceUpdate()
});
}
render() {
// 1. Your app receives the state
var state = freezer.get();
return <Designer state={ state } />;
}
}
import React from 'react';
import {Workplace,ObjectBrowser} from 'react-designer-core';
import Widgets from './Widgets';
import WidgetRenderer from './WidgetRenderer';
export default class Designer extends React.Component {
constructor(props) {
super(props);
this.state = {
current: {
node: props.state.schema
},
snapGrid: [10, 10]
}
}
currentChanged(currentNode, path) {
if (currentNode === undefined) return;
this.setState({
current: {
node: currentNode,
path: path === undefined ? this.state.current && this.state.current.path : path
}
}
);
}
render() {
var schema = this.props.state.schema;
return
<div className="index">
<Workplace schema={schema} current={this.state.current}
currentChanged={this.currentChanged.bind(this)} widgets={Widgets}
widgetRenderer={WidgetRenderer} snapGrid={this.state.snapGrid}/>
<ObjectBrowser rootNode={schema} current={this.state.current}
currentChanged={this.currentChanged.bind(this)}/>
</div>
}
}
See the example folder to see more features.
MIT. Copyright (c) 2015 Roman Samec
FAQs
React-designer-core is a set of core components for easy content creation.
We found that react-designer-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.