@atlaskit/editor-plugin-width
Version:
Width plugin for @atlaskit/editor-core
15 lines (14 loc) • 501 B
JavaScript
import { pluginKey } from '../../pm-plugins/plugin-key';
/**
* Copy of the helper in `useResizeWidthObserver`, so that file stays untouched while
* `platform_editor_reduce_forced_layout` is running. On cleanup, delete that file and this becomes
* the only definition.
*/
export var setEditorWidth = function setEditorWidth(props) {
return function (editorView) {
var dispatch = editorView.dispatch,
tr = editorView.state.tr;
tr.setMeta(pluginKey, props);
dispatch(tr);
};
};