rc-editor-core
Advanced tools
Comparing version 0.8.6 to 0.8.7
@@ -9,3 +9,3 @@ import React from 'react'; | ||
name: string; | ||
decorators?: Array<any>; | ||
decorators?: any[]; | ||
component?: Function; | ||
@@ -27,7 +27,7 @@ onChange: (editorState: EditorState) => EditorState; | ||
multiLines: boolean; | ||
plugins: Array<Plugin>; | ||
plugins: Plugin[]; | ||
pluginConfig?: Object; | ||
prefixCls: string; | ||
onChange?: (editorState: EditorState) => EditorState; | ||
toolbars: Array<any>; | ||
toolbars: any[]; | ||
splitLine: String; | ||
@@ -50,3 +50,3 @@ onKeyDown?: (ev: any) => boolean; | ||
toolbarPlugins?: List<Plugin>; | ||
plugins?: Array<Plugin>; | ||
plugins?: Plugin[]; | ||
compositeDecorator?: CompositeDecorator; | ||
@@ -68,3 +68,3 @@ } | ||
refs: { | ||
[string: string]: any; | ||
[str: string]: any; | ||
editor?: any; | ||
@@ -86,5 +86,5 @@ }; | ||
getEditorState: (needFocus?: boolean) => any; | ||
setEditorState: (editorState: any, focusEditor?: boolean) => void; | ||
setEditorState: (editorState: any, focusEditor?: boolean, triggerChange?: boolean) => void; | ||
}; | ||
reloadPlugins(): Array<Plugin>; | ||
reloadPlugins(): Plugin[]; | ||
componentWillMount(): void; | ||
@@ -97,10 +97,10 @@ componentWillReceiveProps(nextProps: any): void; | ||
setStyleMap(customStyleMap: any): void; | ||
initPlugins(): Array<any>; | ||
initPlugins(): any[]; | ||
private focusEditor(ev); | ||
private _focus(ev); | ||
focus(ev: any): void; | ||
getPlugins(): Array<Plugin>; | ||
getPlugins(): Plugin[]; | ||
getEventHandler(): Object; | ||
getEditorState(needFocus?: boolean): EditorState; | ||
setEditorState(editorState: EditorState, focusEditor?: boolean): void; | ||
setEditorState(editorState: EditorState, focusEditor?: boolean, triggerChange?: boolean): void; | ||
handleKeyBinding(ev: any): any; | ||
@@ -107,0 +107,0 @@ handleKeyCommand(command: String): DraftHandleValue; |
@@ -9,2 +9,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
/* tslint:disable:member-ordering interface-name */ | ||
import React from 'react'; | ||
@@ -123,3 +124,3 @@ import PropTypes from 'prop-types'; | ||
return this.plugins && this.plugins.size ? this.plugins.map(function (plugin) { | ||
// 如果插件有 callbacks 方法,则认为插件已经加载。 | ||
// 如果插件有 callbacks 方法,则认为插件已经加载。 | ||
if (plugin.callbacks) { | ||
@@ -203,3 +204,3 @@ return plugin; | ||
}); | ||
this.setEditorState(EditorState.set(this.state.editorState, { decorator: compositeDecorator })); | ||
this.setEditorState(EditorState.set(this.state.editorState, { decorator: compositeDecorator }), false, false); | ||
}; | ||
@@ -223,3 +224,3 @@ | ||
}; | ||
// 处理 value | ||
// 处理 value | ||
@@ -328,2 +329,3 @@ | ||
var focusEditor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
var triggerChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -339,3 +341,3 @@ var newEditorState = editorState; | ||
}); | ||
if (this.props.onChange) { | ||
if (this.props.onChange && triggerChange) { | ||
this.props.onChange(newEditorState); | ||
@@ -342,0 +344,0 @@ // close this issue https://github.com/ant-design/ant-design/issues/5788 |
@@ -7,7 +7,7 @@ import Toolbar from './Toolbar'; | ||
onChange: (editorState: any) => void; | ||
onUpArrow: (args: any) => any; | ||
onDownArrow: (args: any) => any; | ||
getEditorState: (args: any) => any; | ||
setEditorState: (args: any) => any; | ||
handleReturn: (args: any) => any; | ||
onUpArrow: (_: any) => any; | ||
onDownArrow: (_: any) => any; | ||
getEditorState: (_: any) => any; | ||
setEditorState: (_: any) => any; | ||
handleReturn: (_: any) => any; | ||
}; | ||
@@ -14,0 +14,0 @@ onChange(editorState: any): any; |
import Toolbar from './Toolbar'; | ||
function noop(args) {} | ||
function noop(_) {} | ||
; | ||
@@ -4,0 +4,0 @@ export function createToolbar() { |
@@ -7,3 +7,3 @@ import React from 'react'; | ||
plugins: List<Plugin>; | ||
toolbars: Array<any>; | ||
toolbars: any[]; | ||
prefixCls: string; | ||
@@ -10,0 +10,0 @@ className: string; |
@@ -7,2 +7,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
/* tslint:disable:interface-name */ | ||
import React from 'react'; | ||
@@ -9,0 +10,0 @@ import { Map } from 'immutable'; |
@@ -9,3 +9,3 @@ import React from 'react'; | ||
name: string; | ||
decorators?: Array<any>; | ||
decorators?: any[]; | ||
component?: Function; | ||
@@ -27,7 +27,7 @@ onChange: (editorState: EditorState) => EditorState; | ||
multiLines: boolean; | ||
plugins: Array<Plugin>; | ||
plugins: Plugin[]; | ||
pluginConfig?: Object; | ||
prefixCls: string; | ||
onChange?: (editorState: EditorState) => EditorState; | ||
toolbars: Array<any>; | ||
toolbars: any[]; | ||
splitLine: String; | ||
@@ -50,3 +50,3 @@ onKeyDown?: (ev: any) => boolean; | ||
toolbarPlugins?: List<Plugin>; | ||
plugins?: Array<Plugin>; | ||
plugins?: Plugin[]; | ||
compositeDecorator?: CompositeDecorator; | ||
@@ -68,3 +68,3 @@ } | ||
refs: { | ||
[string: string]: any; | ||
[str: string]: any; | ||
editor?: any; | ||
@@ -86,5 +86,5 @@ }; | ||
getEditorState: (needFocus?: boolean) => any; | ||
setEditorState: (editorState: any, focusEditor?: boolean) => void; | ||
setEditorState: (editorState: any, focusEditor?: boolean, triggerChange?: boolean) => void; | ||
}; | ||
reloadPlugins(): Array<Plugin>; | ||
reloadPlugins(): Plugin[]; | ||
componentWillMount(): void; | ||
@@ -97,10 +97,10 @@ componentWillReceiveProps(nextProps: any): void; | ||
setStyleMap(customStyleMap: any): void; | ||
initPlugins(): Array<any>; | ||
initPlugins(): any[]; | ||
private focusEditor(ev); | ||
private _focus(ev); | ||
focus(ev: any): void; | ||
getPlugins(): Array<Plugin>; | ||
getPlugins(): Plugin[]; | ||
getEventHandler(): Object; | ||
getEditorState(needFocus?: boolean): EditorState; | ||
setEditorState(editorState: EditorState, focusEditor?: boolean): void; | ||
setEditorState(editorState: EditorState, focusEditor?: boolean, triggerChange?: boolean): void; | ||
handleKeyBinding(ev: any): any; | ||
@@ -107,0 +107,0 @@ handleKeyCommand(command: String): DraftHandleValue; |
@@ -49,4 +49,5 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* tslint:disable:member-ordering interface-name */ | ||
var hasCommandModifier = _draftJs.KeyBindingUtil.hasCommandModifier; | ||
@@ -154,3 +155,3 @@ | ||
return this.plugins && this.plugins.size ? this.plugins.map(function (plugin) { | ||
// 如果插件有 callbacks 方法,则认为插件已经加载。 | ||
// 如果插件有 callbacks 方法,则认为插件已经加载。 | ||
if (plugin.callbacks) { | ||
@@ -234,3 +235,3 @@ return plugin; | ||
}); | ||
this.setEditorState(_draftJs.EditorState.set(this.state.editorState, { decorator: compositeDecorator })); | ||
this.setEditorState(_draftJs.EditorState.set(this.state.editorState, { decorator: compositeDecorator }), false, false); | ||
}; | ||
@@ -254,3 +255,3 @@ | ||
}; | ||
// 处理 value | ||
// 处理 value | ||
@@ -359,2 +360,3 @@ | ||
var focusEditor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
var triggerChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -370,3 +372,3 @@ var newEditorState = editorState; | ||
}); | ||
if (this.props.onChange) { | ||
if (this.props.onChange && triggerChange) { | ||
this.props.onChange(newEditorState); | ||
@@ -373,0 +375,0 @@ // close this issue https://github.com/ant-design/ant-design/issues/5788 |
@@ -7,7 +7,7 @@ import Toolbar from './Toolbar'; | ||
onChange: (editorState: any) => void; | ||
onUpArrow: (args: any) => any; | ||
onDownArrow: (args: any) => any; | ||
getEditorState: (args: any) => any; | ||
setEditorState: (args: any) => any; | ||
handleReturn: (args: any) => any; | ||
onUpArrow: (_: any) => any; | ||
onDownArrow: (_: any) => any; | ||
getEditorState: (_: any) => any; | ||
setEditorState: (_: any) => any; | ||
handleReturn: (_: any) => any; | ||
}; | ||
@@ -14,0 +14,0 @@ onChange(editorState: any): any; |
@@ -12,3 +12,3 @@ 'use strict'; | ||
function noop(args) {} | ||
function noop(_) {} | ||
; | ||
@@ -15,0 +15,0 @@ function createToolbar() { |
@@ -7,3 +7,3 @@ import React from 'react'; | ||
plugins: List<Plugin>; | ||
toolbars: Array<any>; | ||
toolbars: any[]; | ||
prefixCls: string; | ||
@@ -10,0 +10,0 @@ className: string; |
@@ -21,4 +21,5 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* tslint:disable:interface-name */ | ||
function noop() {} | ||
@@ -25,0 +26,0 @@ |
{ | ||
"name": "rc-editor-core", | ||
"version": "0.8.6", | ||
"version": "0.8.7", | ||
"description": "editor-core ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115272
2584
1