@atlaskit/editor-plugin-width
Version:
Width plugin for @atlaskit/editor-core
20 lines (19 loc) • 642 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setEditorWidth = void 0;
var _pluginKey = require("../../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.
*/
var setEditorWidth = exports.setEditorWidth = function setEditorWidth(props) {
return function (editorView) {
var dispatch = editorView.dispatch,
tr = editorView.state.tr;
tr.setMeta(_pluginKey.pluginKey, props);
dispatch(tr);
};
};