UNPKG

848 BJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 *
9 * @emails oncall+draft_js
10 */
11'use strict';
12
13var invariant = require("fbjs/lib/invariant");
14
15var isHTMLElement = require("./isHTMLElement");
16
17function getContentEditableContainer(editor) {
18 var editorNode = editor.editorContainer;
19 !editorNode ? process.env.NODE_ENV !== "production" ? invariant(false, 'Missing editorNode') : invariant(false) : void 0;
20 !isHTMLElement(editorNode.firstChild) ? process.env.NODE_ENV !== "production" ? invariant(false, 'editorNode.firstChild is not an HTMLElement') : invariant(false) : void 0;
21 var htmlElement = editorNode.firstChild;
22 return htmlElement;
23}
24
25module.exports = getContentEditableContainer;
\No newline at end of file