Você não pode selecionar mais de 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.
 
 
 
 

25 linhas
607 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. *
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. var getContentStateFragment = require("./getContentStateFragment");
  13. function getFragmentFromSelection(editorState) {
  14. var selectionState = editorState.getSelection();
  15. if (selectionState.isCollapsed()) {
  16. return null;
  17. }
  18. return getContentStateFragment(editorState.getCurrentContent(), selectionState);
  19. }
  20. module.exports = getFragmentFromSelection;