@atlaskit/editor-plugin-width
Version:
Width plugin for @atlaskit/editor-core
17 lines (16 loc) • 451 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 const setEditorWidth = props => editorView => {
const {
dispatch,
state: {
tr
}
} = editorView;
tr.setMeta(pluginKey, props);
dispatch(tr);
};