ClassicEditorKit · Classic 基础装配
组合通用节点与 Classic 格式、剪贴板、查找和历史控件。它是产品中立基础,不会安装 Word schema 或 DOCX 文件服务。
组合通用节点与 Classic 格式、剪贴板、查找和历史控件。它是产品中立基础,不会安装 Word schema 或 DOCX 文件服务。
@quirekit/classic-editor · AGPL-3.0-only
编辑器适用范围
层次:Classic 产品适配
| 编辑器 | 状态 | 所需装配与边界 |
|---|---|---|
| Classic | 直接支持 | classicEditorPreset — 使用产品中立的 classicEditorPreset;已有能力由预设装配,不要重复追加。Word 预设会替换段落、标题和容器列表,不能把通用结构直接叠加到 Word 模型。 |
| Block | 未支持 | Block 不消费 Classic 产品 contribution、plugins 或分页装配。请使用共享能力和 Block 适配入口,不能直接复制此入口的 Classic 配置。 |
“直接支持”指已有上述产品装配;具体交互、宿主服务和格式支持仍有各自条件。状态与接入规则。许可独立显示。
接入
pnpm add @quirekit/classic-editor@alpha
先使用 Classic 基础装配。这里的单项适配器用于自定义预设或替换子项;不能向已有装配再追加同名扩展。
import { ClassicEditorKit } from '@quirekit/classic-editor'
安装时按包声明选择兼容版本,外部可用版本以分发源为准。本站使用工作区 Alpha;许可标签来自入口所属包,使用条件见支持与许可。
按编辑器接入
以下片段沿用已挂载的宿主元素 element,宿主负责容器尺寸与保存;退出页面时调用 instance.destroy()。已有预设装配的能力不要再重复追加;需要宿主端口的入口应先完成下方配置。
Classic · 直接支持
使用产品中立的 classicEditorPreset;已有能力由预设装配,不要重复追加。Word 预设会替换段落、标题和容器列表,不能把通用结构直接叠加到 Word 模型。
classicEditorPresetimport { createClassicEditor } from '@quirekit/classic-editor'
import '@quirekit/classic-editor/styles.css'
const instance = createClassicEditor({ element })Block · 未支持
Block 不消费 Classic 产品 contribution、plugins 或分页装配。请使用共享能力和 Block 适配入口,不能直接复制此入口的 Classic 配置。
配置
下面是扩展自身的默认选项。预设可以覆盖这些值;它们不等于当前文档属性。配置方法见配置插件。
historyExtension
替代普通历史的扩展,例如协作历史;产品仍保留标准历史控件。
类型:QuireAnyExtension
默认:undefined
blockInteraction
配置 BlockInteraction 子扩展;允许 false 时可关闭此项。
类型:false | Partial<BlockInteractionOptions>
默认:undefined
子扩展的具体选项见 BlockInteraction。是否可以设为 false,以本字段类型为准。
formatting
配置 Formatting 子扩展;允许 false 时可关闭此项。
类型:false | Partial<FormattingOptions>
默认:undefined
子扩展的具体选项见 Formatting。是否可以设为 false,以本字段类型为准。
search
配置 Search 子扩展;允许 false 时可关闭此项。
类型:false | Partial<SearchExtensionOptions>
默认:undefined
子扩展的具体选项见 Search。是否可以设为 false,以本字段类型为准。
textCase
配置 TextCase 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextCaseOptions>
默认:undefined
子扩展的具体选项见 TextCase。是否可以设为 false,以本字段类型为准。
clipboard
配置 ClassicEditorClipboard 子扩展;允许 false 时可关闭此项。
类型:false | Partial<ClassicEditorClipboardOptions>
默认:undefined
子扩展的具体选项见 ClassicEditorClipboard。是否可以设为 false,以本字段类型为准。
doubleStrike
配置 DoubleStrike 子扩展;允许 false 时可关闭此项。
类型:false | Partial<DoubleStrikeOptions>
默认:undefined
子扩展的具体选项见 DoubleStrike。是否可以设为 false,以本字段类型为准。
superscript
配置 Superscript 子扩展;允许 false 时可关闭此项。
类型:false | Partial<ScriptPositionOptions>
默认:undefined
子扩展的具体选项见 Superscript。是否可以设为 false,以本字段类型为准。
subscript
配置 Subscript 子扩展;允许 false 时可关闭此项。
类型:false | Partial<ScriptPositionOptions>
默认:undefined
子扩展的具体选项见 Subscript。是否可以设为 false,以本字段类型为准。
textStyle
配置 TextStyle 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleOptions>
默认:undefined
子扩展的具体选项见 TextStyle。是否可以设为 false,以本字段类型为准。
highlight
匹配结果与当前结果的展示颜色。Search 使用 match、active、activeOutline。
类型:false | Partial<HighlightOptions>
默认:undefined
子扩展的具体选项见 Highlight。是否可以设为 false,以本字段类型为准。
fontFamily
配置 FontFamily 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 FontFamily。是否可以设为 false,以本字段类型为准。
fontSize
配置 FontSize 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 FontSize。是否可以设为 false,以本字段类型为准。
letterSpacing
配置 LetterSpacing 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 LetterSpacing。是否可以设为 false,以本字段类型为准。
language
配置 Language 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 Language。是否可以设为 false,以本字段类型为准。
color
链接显示颜色;文字前景色扩展则通过命令设置具体颜色。此配置不改变链接目标。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 Color。是否可以设为 false,以本字段类型为准。
backgroundColor
配置 BackgroundColor 子扩展;允许 false 时可关闭此项。
类型:false | Partial<TextStyleAttributeExtensionOptions>
默认:undefined
子扩展的具体选项见 BackgroundColor。是否可以设为 false,以本字段类型为准。
document
配置 Document 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<object>
默认:undefined
子扩展的具体选项见 Document。是否可以设为 false,以本字段类型为准。
paragraph
配置 Paragraph 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<ParagraphOptions>
默认:undefined
子扩展的具体选项见 Paragraph。是否可以设为 false,以本字段类型为准。
text
配置 Text 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<object>
默认:undefined
子扩展的具体选项见 Text。是否可以设为 false,以本字段类型为准。
blockquote
配置 Blockquote 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<BlockquoteOptions>
默认:undefined
子扩展的具体选项见 Blockquote。是否可以设为 false,以本字段类型为准。
hardBreak
配置 HardBreak 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<HardBreakOptions>
默认:undefined
子扩展的具体选项见 HardBreak。是否可以设为 false,以本字段类型为准。
heading
配置 Heading 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<HeadingOptions>
默认:undefined
子扩展的具体选项见 Heading。是否可以设为 false,以本字段类型为准。
horizontalRule
配置 HorizontalRule 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<HorizontalRuleOptions>
默认:undefined
子扩展的具体选项见 HorizontalRule。是否可以设为 false,以本字段类型为准。
bold
配置 Bold 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<BoldOptions>
默认:undefined
子扩展的具体选项见 Bold。是否可以设为 false,以本字段类型为准。
code
配置 Code 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<CodeOptions>
默认:undefined
子扩展的具体选项见 Code。是否可以设为 false,以本字段类型为准。
codeBlock
配置 CodeBlock 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<CodeBlockOptions>
默认:undefined
子扩展的具体选项见 CodeBlock。是否可以设为 false,以本字段类型为准。
bulletList
配置 BulletList 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<BulletListOptions>
默认:undefined
子扩展的具体选项见 BulletList。是否可以设为 false,以本字段类型为准。
listItem
配置 ListItem 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<ListItemOptions>
默认:undefined
子扩展的具体选项见 ListItem。是否可以设为 false,以本字段类型为准。
listKeymap
配置 ListKeymap 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<ListKeymapOptions>
默认:undefined
子扩展的具体选项见 ListKeymap。是否可以设为 false,以本字段类型为准。
orderedList
配置 OrderedList 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<OrderedListOptions>
默认:undefined
子扩展的具体选项见 OrderedList。是否可以设为 false,以本字段类型为准。
italic
配置 Italic 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<ItalicOptions>
默认:undefined
子扩展的具体选项见 Italic。是否可以设为 false,以本字段类型为准。
strike
配置 Strike 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<StrikeOptions>
默认:undefined
子扩展的具体选项见 Strike。是否可以设为 false,以本字段类型为准。
underline
配置 Underline 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<UnderlineOptions>
默认:undefined
子扩展的具体选项见 Underline。是否可以设为 false,以本字段类型为准。
gapcursor
配置 Gapcursor 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<object>
默认:undefined
子扩展的具体选项见 Gapcursor。是否可以设为 false,以本字段类型为准。
trailingNode
配置 TrailingNode 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<TrailingNodeOptions>
默认:undefined
子扩展的具体选项见 TrailingNode。是否可以设为 false,以本字段类型为准。
baseKeymap
配置 BaseKeymap 子扩展;允许 false 时可关闭此项。
类型:boolean
默认:undefined
子扩展的具体选项见 BaseKeymap。是否可以设为 false,以本字段类型为准。
undoRedo
配置 UndoRedo 子扩展;允许 false 时可关闭此项。
类型:StarterKitExtensionOption<UndoRedoOptions>
默认:undefined
子扩展的具体选项见 UndoRedo。是否可以设为 false,以本字段类型为准。
命令与运行方式
此入口没有直接声明可枚举的命令。组合扩展的命令由子扩展提供;产品插件通过 contribution 或文件服务工作。不能把安装入口名称当作命令调用。
下一步
继续Classic 快速接入和配置与生命周期。开发自己的产品界面与服务时,见产品插件开发。