EditorChangeType 编辑器变更类型

EditorChangeType is an enum that lists the possible set of change operations that can be handled the Draft model. It is represented as a Flow type, as a union of strings.

EditorChangeType 是一个列出了所有可能的,可以被 Draft 模型处理的变更操作的设置的枚举。它表现为一个 Flow 类型,作为一个字符串集合。

It is passed as a parameter to EditorState.push, and denotes the type of change operation that is being performed by transitioning to the new ContentState.

它被作为 EditorState.push的一个参数传递,表示正在被执行过渡到新 ContentState 的变更操作的类型。

Behind the scenes, this value is used to determine appropriate undo/redo handling, spellcheck behavior, and more. Therefore, while it is possible to provide an arbitrary string value as the changeType parameter here, you should avoid doing so.

在后台,这个值被用来决定合适的撤销/重做处理,拼写检查行为等。因此,即便随便提供一个字符串值作为 changeType 的参数也是可以的,但你最好避免这样做。

We highly recommend that you install Flow to perform static typechecking on your project. Flow will enforce the use of an appropriate EditorChangeType value.

我们强烈建议你在你的项目里安装 Flow 来执行静态类型检查。Flow 会强制使用一个合适的 EditorChangeType 值。

Values

adjust-depth

The depth value of one or more ContentBlock objects is being changed.

正在改变一个或多个 ContentBlock 对象的 depth 值。

apply-entity

An entity is being applied (or removed via null) to one or more characters.

一个实体正在被应用(或者通过 null 移除)到一个或多个字符上。

backspace-character

A single character is being backward-removed.

一个单独的字符串正在被向后删除。(比如使用退格键删除)

change-block-data

The data value of one or more ContentBlock objects is being changed.

一个或多个 ContentBlock 对象的 data 值正在被改变。

change-block-type

The type value of one or more ContentBlock objects is being changed.

一个或多个 ContentBlock 对象的 type 值正在被改变。

change-inline-style

An inline style is being applied or removed for one or more characters.

一个内联样式正在被应用或移除到一个或多个字符上。

move-block

A block is being moved within the BlockMap.

一个 block 在 BlockMap 中正在被移动。

delete-character

A single character is being forward-removed.

一个单独的字符串正在被向前删除。(比如使用 del 键删除)

insert-characters

One or more characters is being inserted at a selection state.

在选中的状态下,一个或多个字符正被插入。

insert-fragment

A "fragment" of content (i.e. a BlockMap) is being inserted at a selection state.

在选中的状态下,一个内容的“片段”(即一个 BlockMap )正被插入。

redo

A redo operation is being performed. Since redo behavior is handled by the Draft core, it is unlikely that you will need to use this explicitly.

一个重做操作正被执行。因为重做行为是被 Draft 代码所处理的,所以你可能不太需要明确的使用这个值。

remove-range

Multiple characters or blocks are being removed.

多个字符或 block 正被移除。

spellcheck-change

A spellcheck or autocorrect change is being performed. This is used to inform the core editor whether to try to allow native undo behavior.

一个拼写检查或者自动修正的变更正被执行。它被用来通知编辑器代码是否要尝试允许原生的撤销操作。

split-block

A single ContentBlock is being split into two, for instance when the user presses return.

一个单独的 ContentBlock 正被一分为二,比如用户按下回车时。

undo

An undo operation is being performed. Since undo behavior is handled by the Draft core, it is unlikely that you will need to use this explicitly.

一个撤销操作正被执行。因为撤销行为是被 Draft 代码所处理的,所以你可能不太需要明确的使用这个值。

results matching ""

    No results matching ""