Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

28 linhas
744 B

  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. * @flow strict-local
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type { BlockMap } from "./BlockMap";
  13. import type EditorState from "./EditorState";
  14. const getContentStateFragment = require("./getContentStateFragment");
  15. function getFragmentFromSelection(editorState: EditorState): ?BlockMap {
  16. const selectionState = editorState.getSelection();
  17. if (selectionState.isCollapsed()) {
  18. return null;
  19. }
  20. return getContentStateFragment(editorState.getCurrentContent(), selectionState);
  21. }
  22. module.exports = getFragmentFromSelection;