New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-richtext

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-richtext - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

.idea/workspace.xml

261

lib/EditorDemo.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

@@ -27,147 +27,132 @@

var styles = {
display: {
color: '#0585c8',
paddingTop: 10
},
row: {
height: 100,
width: '100%',
borderColor: '#ddd',
resize: 'none'
},
log: {
float: 'right',
marginTop: 10,
color: '#0585c8',
paddingRight: 5
}
var RichEditorDemo = function (_React$Component) {
_inherits(RichEditorDemo, _React$Component);
};
function RichEditorDemo(props, context) {
_classCallCheck(this, RichEditorDemo);
var EditorDemo = function (_React$Component) {
_inherits(EditorDemo, _React$Component);
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(RichEditorDemo).call(this, props, context));
function EditorDemo(props, context) {
_classCallCheck(this, EditorDemo);
_this.state = {
value: (0, _RichTextEditor.createEmptyValue)(),
format: 'html' }, _this.onChange = _this.onChange.bind(_this);
_this.onChangeFormat = _this.onChangeFormat.bind(_this);
_this.onChangeSource = _this.onChangeSource.bind(_this);
return _this;
}
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(EditorDemo).call(this, props, context));
_createClass(RichEditorDemo, [{
key: 'logState',
value: function logState() {
console.log(this.state.value); // eslint-disable-line
var editorState = this.state.value.getEditorState();
var contentState = window.contentState = editorState.getCurrentContent().toJS();
console.log(contentState); // eslint-disable-line
}
}, {
key: 'logStateRaw',
value: function logStateRaw() {
var editorState = this.state.value.getEditorState();
var contentState = editorState.getCurrentContent();
var rawContentState = window.rawContentState = (0, _draftJs.convertToRaw)(contentState);
console.log(JSON.stringify(rawContentState)); // eslint-disable-line
}
}, {
key: 'onChange',
value: function onChange() {
var value = arguments.length <= 0 || arguments[0] === undefined ? _RichTextEditor.EditorValue : arguments[0];
_this.state = {
value: (0, _RichTextEditor.createEmptyValue)(),
format: 'html'
};
return _this;
}
this.setState({ value: value });
}
}, {
key: 'onChangeSource',
value: function onChangeSource() {
var event = arguments.length <= 0 || arguments[0] === undefined ? Object : arguments[0];
_createClass(EditorDemo, [{
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
{ className: 'editor-demo' },
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement(_RichTextEditor2.default, {
value: this.state.value,
onChange: this.onChange.bind(this)
//toolbarColor={'#00FF00'}
, placeholder: 'Type here ...'
})
),
_react2.default.createElement(
'label',
{ className: 'radio-item' },
_react2.default.createElement('input', {
style: styles.display,
type: 'radio',
name: 'format',
value: 'html',
checked: this.state.format === 'html',
onChange: this.onChangeFormat.bind(this)
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'HTML'
)
),
_react2.default.createElement(
'label',
{ className: 'radio-item' },
_react2.default.createElement('input', {
style: styles.display,
type: 'radio',
name: 'format',
value: 'markdown',
checked: this.state.format === 'markdown',
onChange: this.onChangeFormat.bind(this)
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'Markdown'
)
),
_react2.default.createElement(
'span',
{ className: 'btn-row', style: styles.log, onClick: this.logState.bind(this) },
'Log State'
),
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement('textarea', {
className: 'source',
placeholder: 'Editor Source',
value: this.state.value.toString(this.state.format),
onChange: this.onChangeSource.bind(this),
style: styles.row
})
)
);
}
}, {
key: 'logState',
value: function logState() {
console.log(this.state.value);
var editorState = this.state.value.getEditorState();
var contentState = window.contentState = editorState.getCurrentContent().toJS();
console.log(contentState);
}
}, {
key: 'logStateRaw',
value: function logStateRaw() {
var editorState = this.state.value.getEditorState();
var contentState = editorState.getCurrentContent();
var rawContentState = window.rawContentState = (0, _draftJs.convertToRaw)(contentState);
console.log(JSON.stringify(rawContentState));
}
}, {
key: 'onChange',
value: function onChange(value) {
this.setState({ value: value });
}
}, {
key: 'onChangeSource',
value: function onChangeSource(event) {
var source = event.target.value;
var oldValue = this.state.value;
this.setState({
value: oldValue.setContentFromString(source, this.state.format)
});
}
}, {
key: 'onChangeFormat',
value: function onChangeFormat(event) {
this.setState({ format: event.target.value });
}
}]);
var source = event.target.value;
var oldValue = this.state.value;
this.setState({
value: oldValue.setContentFromString(source, this.state.format)
});
}
}, {
key: 'onChangeFormat',
value: function onChangeFormat() {
var event = arguments.length <= 0 || arguments[0] === undefined ? Object : arguments[0];
return EditorDemo;
this.setState({ format: event.target.value });
}
}, {
key: 'render',
value: function render() {
var value = this.state.value;
return _react2.default.createElement(
'div',
{ className: 'editor-demo' },
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement(_RichTextEditor2.default, {
value: value,
onChange: this.onChange,
placeholder: 'Type here ...'
})
),
_react2.default.createElement(
'label',
{ className: 'radio-item' },
_react2.default.createElement('input', {
className: 'display',
type: 'radio',
name: 'format',
value: 'html',
checked: this.state.format === 'html',
onChange: this.onChangeFormat
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'HTML'
)
),
_react2.default.createElement(
'label',
{ className: 'radio-item' },
_react2.default.createElement('input', {
className: 'display',
type: 'radio',
name: 'format',
value: 'markdown',
checked: this.state.format === 'markdown',
onChange: this.onChangeFormat
}),
_react2.default.createElement(
'span',
{ className: 'label' },
'Markdown'
)
),
_react2.default.createElement(
'span',
{ className: 'log', onClick: this.logState },
'Log State'
),
_react2.default.createElement(
'div',
{ className: 'row' },
_react2.default.createElement('textarea', {
className: 'source',
placeholder: 'Editor Source',
value: value.toString(this.state.format),
onChange: this.onChangeSource
})
)
);
}
}]);
return RichEditorDemo;
}(_react2.default.Component);
;
exports.default = EditorDemo;
exports.default = RichEditorDemo;

@@ -36,3 +36,3 @@ "use strict";

{ width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
_react2.default.createElement("path", { "class": "st0", d: "M7.1,17.5l-3.2,3.2c0,0-0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-0.2,0-0.2,0-0.4c0-0.2,0.2-0.4,0.4-0.8C8.2,7.8,8.6,7.8,9,7.8c0.2,0,0.2,0,0.4,0s0.2,0,0.4,0.2\r c0,0.2,0,0.2,0.2,0.2l0.2,0.2c0.2,0.2,0.2,0.2,0.2,0.2C10.7,8.6,10.9,8.2,10.9,7.8L10.9,7.8z M1.8,8.6C1.4,8.2,1.4,7.6,1.4,7.1\r c0-0.9,0.4-1.9,1.1-2.7l1.9-1.9c0.8-0.8,1.5-1.1,2.7-1.1C8,1.4,9,1.8,9.7,2.5l2.7,2.7c0.8,0.8,1.1,1.5,1.1,2.7s-0.4,1.9-1.1,2.7\r l1.1,1.1c0.8-0.8,1.7-1.1,2.7-1.1c0.9,0,1.9,0.4,2.7,1.1l2.7,2.7c0.8,0.8,1.1,1.5,1.1,2.7c0,0.9-0.4,1.9-1.1,2.7l-1.9,1.9\r c-0.8,0.8-1.5,1.1-2.7,1.1c-0.9,0-1.9-0.4-2.7-1.1l-2.7-2.7c-0.8-0.8-1.1-1.5-1.1-2.7c0-1.1,0.4-1.9,1.1-2.7l-1.3-1.1\r c-0.6,0.8-1.5,1.1-2.7,1.1c-0.9,0-1.9-0.4-2.7-1.1L2.5,9.7C2.1,9.3,2,9,1.8,8.6" })

@@ -39,0 +39,0 @@ );

{
"name": "react-richtext",
"version": "1.0.5",
"version": "1.0.6",
"description": "React Rich Text Editor",

@@ -25,4 +25,3 @@ "main": "dist/react-rte.js",

"draft-js-utils": "0.1.4",
"immutable": "3.8.1",
"react-bootstrap": "0.29.4"
"immutable": "3.8.1"
},

@@ -29,0 +28,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc