芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/draft-js/lib/DraftEditorNode.react.js.flow
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow * @emails oncall+draft_js * * This is unstable and not part of the public API and should not be used by * production systems. This file may be update/removed without notice. */ 'use strict'; import type { BlockNodeRecord } from "./BlockNodeRecord"; import type ContentState from "./ContentState"; import type { DraftDecoratorType } from "./DraftDecoratorType"; import type SelectionState from "./SelectionState"; import type { BidiDirection } from "fbjs/lib/UnicodeBidiDirection"; const DraftEditorDecoratedLeaves = require("./DraftEditorDecoratedLeaves.react"); const DraftEditorLeaf = require("./DraftEditorLeaf.react"); const DraftOffsetKey = require("./DraftOffsetKey"); const Immutable = require("immutable"); const React = require("react"); const cx = require("fbjs/lib/cx"); const { List } = Immutable; type Props = { block: BlockNodeRecord, children: ?Array
, contentState: ContentState, customStyleFn: Function, customStyleMap: Object, decorator: ?DraftDecoratorType, direction: BidiDirection, forceSelection: boolean, hasSelection: boolean, selection: SelectionState, tree: List
, ... }; class DraftEditorNode extends React.Component
{ render(): React.Node { const { block, contentState, customStyleFn, customStyleMap, decorator, direction, forceSelection, hasSelection, selection, tree } = this.props; const blockKey = block.getKey(); const text = block.getText(); const lastLeafSet = tree.size - 1; const children = this.props.children || tree.map((leafSet, ii) => { const decoratorKey = leafSet.get('decoratorKey'); const leavesForLeafSet = leafSet.get('leaves'); const lastLeaf = leavesForLeafSet.size - 1; const Leaves = leavesForLeafSet.map((leaf, jj) => { const offsetKey = DraftOffsetKey.encode(blockKey, ii, jj); const start = leaf.get('start'); const end = leaf.get('end'); return
; }).toArray(); if (!decoratorKey || !decorator) { return Leaves; } return
; }).toArray(); return
{children}
; } } module.exports = DraftEditorNode;