# ClassicEditorKit · Classic 基础装配

组合通用节点与 Classic 格式、剪贴板、查找和历史控件。它是产品中立基础，不会安装 Word schema 或 DOCX 文件服务。

组合通用节点与 Classic 格式、剪贴板、查找和历史控件。它是产品中立基础，不会安装 Word schema 或 DOCX 文件服务。

`@quirekit/classic-editor` · **AGPL-3.0-only**

## 编辑器适用范围
层次：**Classic 产品适配**
| 编辑器 | 状态 | 所需装配与边界 |
| --- | --- | --- |
| Classic | 直接支持 | [classicEditorPreset](/plugins/reference/classic-editor-preset) — 使用产品中立的 classicEditorPreset；已有能力由预设装配，不要重复追加。Word 预设会替换段落、标题和容器列表，不能把通用结构直接叠加到 Word 模型。 |
| Block | 未支持 | Block 不消费 Classic 产品 contribution、plugins 或分页装配。请使用共享能力和 Block 适配入口，不能直接复制此入口的 Classic 配置。 |

“直接支持”指已有上述产品装配；具体交互、宿主服务和格式支持仍有各自条件。[状态与接入规则](/plugins/compatibility)。许可独立显示。

## 接入

```sh
pnpm add @quirekit/classic-editor@alpha
```

先使用 [Classic 基础装配](/plugins/reference/classic-editor-kit)。这里的单项适配器用于自定义预设或替换子项；不能向已有装配再追加同名扩展。

```ts
import { ClassicEditorKit } from '@quirekit/classic-editor'
```

安装时按包声明选择兼容版本，外部可用版本以分发源为准。本站使用工作区 Alpha；许可标签来自入口所属包，使用条件见[支持与许可](/support)。

## 按编辑器接入

以下片段沿用已挂载的宿主元素 `element`，宿主负责容器尺寸与保存；退出页面时调用 `instance.destroy()`。已有预设装配的能力不要再重复追加；需要宿主端口的入口应先完成下方配置。

### Classic

使用产品中立的 classicEditorPreset；已有能力由预设装配，不要重复追加。Word 预设会替换段落、标题和容器列表，不能把通用结构直接叠加到 Word 模型。

[classicEditorPreset](/plugins/reference/classic-editor-preset)

```ts
import { createClassicEditor } from '@quirekit/classic-editor'
import '@quirekit/classic-editor/styles.css'

const instance = createClassicEditor({ element })
```

### Block

Block 不消费 Classic 产品 contribution、plugins 或分页装配。请使用共享能力和 Block 适配入口，不能直接复制此入口的 Classic 配置。

## 配置

下面是扩展自身的默认选项。预设可以覆盖这些值；它们不等于当前文档属性。配置方法见[配置插件](/plugins/configuration)。

### historyExtension

替代普通历史的扩展，例如协作历史；产品仍保留标准历史控件。

类型：`QuireAnyExtension`

默认：`undefined`

### blockInteraction

配置 BlockInteraction 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<BlockInteractionOptions>`

默认：`undefined`

子扩展的具体选项见 [BlockInteraction](/plugins/reference/block-interaction)。是否可以设为 false，以本字段类型为准。

### formatting

配置 Formatting 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<FormattingOptions>`

默认：`undefined`

子扩展的具体选项见 [Formatting](/plugins/reference/formatting)。是否可以设为 false，以本字段类型为准。

### search

配置 Search 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<SearchExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [Search](/plugins/reference/search)。是否可以设为 false，以本字段类型为准。

### textCase

配置 TextCase 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextCaseOptions>`

默认：`undefined`

子扩展的具体选项见 [TextCase](/plugins/reference/text-case)。是否可以设为 false，以本字段类型为准。

### clipboard

配置 ClassicEditorClipboard 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<ClassicEditorClipboardOptions>`

默认：`undefined`

子扩展的具体选项见 [ClassicEditorClipboard](/plugins/reference/classic-editor-clipboard)。是否可以设为 false，以本字段类型为准。

### doubleStrike

配置 DoubleStrike 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<DoubleStrikeOptions>`

默认：`undefined`

子扩展的具体选项见 [DoubleStrike](/plugins/reference/double-strike)。是否可以设为 false，以本字段类型为准。

### superscript

配置 Superscript 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<ScriptPositionOptions>`

默认：`undefined`

子扩展的具体选项见 [Superscript](/plugins/reference/superscript)。是否可以设为 false，以本字段类型为准。

### subscript

配置 Subscript 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<ScriptPositionOptions>`

默认：`undefined`

子扩展的具体选项见 [Subscript](/plugins/reference/subscript)。是否可以设为 false，以本字段类型为准。

### textStyle

配置 TextStyle 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleOptions>`

默认：`undefined`

子扩展的具体选项见 [TextStyle](/plugins/reference/text-style)。是否可以设为 false，以本字段类型为准。

### highlight

匹配结果与当前结果的展示颜色。Search 使用 match、active、activeOutline。

类型：`false | Partial<HighlightOptions>`

默认：`undefined`

子扩展的具体选项见 [Highlight](/plugins/reference/highlight)。是否可以设为 false，以本字段类型为准。

### fontFamily

配置 FontFamily 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [FontFamily](/plugins/reference/font-family)。是否可以设为 false，以本字段类型为准。

### fontSize

配置 FontSize 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [FontSize](/plugins/reference/font-size)。是否可以设为 false，以本字段类型为准。

### letterSpacing

配置 LetterSpacing 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [LetterSpacing](/plugins/reference/letter-spacing)。是否可以设为 false，以本字段类型为准。

### language

配置 Language 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [Language](/plugins/reference/language)。是否可以设为 false，以本字段类型为准。

### color

链接显示颜色；文字前景色扩展则通过命令设置具体颜色。此配置不改变链接目标。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [Color](/plugins/reference/color)。是否可以设为 false，以本字段类型为准。

### backgroundColor

配置 BackgroundColor 子扩展；允许 false 时可关闭此项。

类型：`false | Partial<TextStyleAttributeExtensionOptions>`

默认：`undefined`

子扩展的具体选项见 [BackgroundColor](/plugins/reference/background-color)。是否可以设为 false，以本字段类型为准。

### document

配置 Document 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Document](/plugins/reference/document)。是否可以设为 false，以本字段类型为准。

### paragraph

配置 Paragraph 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ParagraphOptions>`

默认：`undefined`

子扩展的具体选项见 [Paragraph](/plugins/reference/paragraph)。是否可以设为 false，以本字段类型为准。

### text

配置 Text 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Text](/plugins/reference/text)。是否可以设为 false，以本字段类型为准。

### blockquote

配置 Blockquote 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BlockquoteOptions>`

默认：`undefined`

子扩展的具体选项见 [Blockquote](/plugins/reference/blockquote)。是否可以设为 false，以本字段类型为准。

### hardBreak

配置 HardBreak 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HardBreakOptions>`

默认：`undefined`

子扩展的具体选项见 [HardBreak](/plugins/reference/hard-break)。是否可以设为 false，以本字段类型为准。

### heading

配置 Heading 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HeadingOptions>`

默认：`undefined`

子扩展的具体选项见 [Heading](/plugins/reference/heading)。是否可以设为 false，以本字段类型为准。

### horizontalRule

配置 HorizontalRule 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HorizontalRuleOptions>`

默认：`undefined`

子扩展的具体选项见 [HorizontalRule](/plugins/reference/horizontal-rule)。是否可以设为 false，以本字段类型为准。

### bold

配置 Bold 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BoldOptions>`

默认：`undefined`

子扩展的具体选项见 [Bold](/plugins/reference/bold)。是否可以设为 false，以本字段类型为准。

### code

配置 Code 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<CodeOptions>`

默认：`undefined`

子扩展的具体选项见 [Code](/plugins/reference/code)。是否可以设为 false，以本字段类型为准。

### codeBlock

配置 CodeBlock 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<CodeBlockOptions>`

默认：`undefined`

子扩展的具体选项见 [CodeBlock](/plugins/reference/code-block)。是否可以设为 false，以本字段类型为准。

### bulletList

配置 BulletList 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BulletListOptions>`

默认：`undefined`

子扩展的具体选项见 [BulletList](/plugins/reference/bullet-list)。是否可以设为 false，以本字段类型为准。

### listItem

配置 ListItem 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ListItemOptions>`

默认：`undefined`

子扩展的具体选项见 [ListItem](/plugins/reference/list-item)。是否可以设为 false，以本字段类型为准。

### listKeymap

配置 ListKeymap 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ListKeymapOptions>`

默认：`undefined`

子扩展的具体选项见 [ListKeymap](/plugins/reference/list-keymap)。是否可以设为 false，以本字段类型为准。

### orderedList

配置 OrderedList 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<OrderedListOptions>`

默认：`undefined`

子扩展的具体选项见 [OrderedList](/plugins/reference/ordered-list)。是否可以设为 false，以本字段类型为准。

### italic

配置 Italic 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ItalicOptions>`

默认：`undefined`

子扩展的具体选项见 [Italic](/plugins/reference/italic)。是否可以设为 false，以本字段类型为准。

### strike

配置 Strike 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<StrikeOptions>`

默认：`undefined`

子扩展的具体选项见 [Strike](/plugins/reference/strike)。是否可以设为 false，以本字段类型为准。

### underline

配置 Underline 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<UnderlineOptions>`

默认：`undefined`

子扩展的具体选项见 [Underline](/plugins/reference/underline)。是否可以设为 false，以本字段类型为准。

### gapcursor

配置 Gapcursor 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Gapcursor](/plugins/reference/gapcursor)。是否可以设为 false，以本字段类型为准。

### trailingNode

配置 TrailingNode 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<TrailingNodeOptions>`

默认：`undefined`

子扩展的具体选项见 [TrailingNode](/plugins/reference/trailing-node)。是否可以设为 false，以本字段类型为准。

### baseKeymap

配置 BaseKeymap 子扩展；允许 false 时可关闭此项。

类型：`boolean`

默认：`undefined`

子扩展的具体选项见 [BaseKeymap](/plugins/reference/base-keymap)。是否可以设为 false，以本字段类型为准。

### undoRedo

配置 UndoRedo 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<UndoRedoOptions>`

默认：`undefined`

子扩展的具体选项见 [UndoRedo](/plugins/reference/undo-redo)。是否可以设为 false，以本字段类型为准。

## 命令与运行方式

此入口没有直接声明可枚举的命令。组合扩展的命令由子扩展提供；产品插件通过 contribution 或文件服务工作。不能把安装入口名称当作命令调用。

## 下一步

返回[全部插件](/plugins)，或阅读[配置插件](/plugins/configuration)区分配置、文档属性与命令。

继续[Classic 快速接入](/classic/quick-start)和[配置与生命周期](/classic/configuration)。开发自己的产品界面与服务时，见[产品插件开发](/build/product-plugin)。
