@atlaskit/编辑 - presets
公共编辑器为Atlassian编辑器预设,包含Conculation和其他产品的基础配置.
概览
这个软件包为Atlassian编辑器提供了标准化的,开源的,并易于消耗的预设. 它能够快速原型化、实验和融入外部环境.
可用预设
组合完整页面基础预设
这个 confluenceFullPagePresetBase 包含 Copulation 全页编辑器使用的所有公共插件和配置.
import { confluenceFullPagePresetBase } from '@atlaskit/editor-presets';
const preset = confluenceFullPagePresetBase({
intl,
providers,
enabledOptionalPlugins,
pluginOptions,
});
使用量
基本设置
import React from 'react';
import { ComposableEditor } from '@atlaskit/editor-core/composable-editor';
import { confluenceFullPagePresetBase } from '@atlaskit/editor-presets';
import { useIntl } from 'react-intl';
function MyEditor() {
const intl = useIntl();
const preset = confluenceFullPagePresetBase({
intl,
providers: {
// Provide necessary services
},
enabledOptionalPlugins: {
// Configure optional features
},
pluginOptions: {
// Plugin-specific options
},
});
return <ComposableEditor preset={preset} />;
}
扩展预设
您可以用额外的插件来扩展基础预设 :
import { confluenceFullPagePresetBase } from '@atlaskit/editor-presets';
import { myCustomPlugin } from './my-custom-plugin';
const customPreset = confluenceFullPagePresetBase(options)
.add([myCustomPlugin, myCustomPluginOptions]);
插件选项
预设中包含的每个插件都可以通过 pluginOptions 对象。 可选选项参考单个插件文档 .
API 密码
confluenceFullPagePresetBase(options: ConfluenceFullPageBasePresetOptions): EditorPresetBuilder
创建一个带有所有公共插件的库名 Conclusive Full Page 编辑器 .
参数:
intl: IntlShape- 国际化的反作用干预providers: Providers- 所需服务提供者enabledOptionalPlugins: EnabledOptionalPlugins- 可选插件的配置pluginOptions: AllPluginOptions- 插件特定配置选项
回返情况: EditorPresetBuilder - 可用额外插件扩展的预设构建器
建筑
公共预设只包含 @atlaskit/editor-plugin-* 软件包。 私有或产品专用的插件应当被添加到单独的预设包中(例如, editor-presets-confluence (c) 与具体效应有关的特性.
捐款
当在此预设中添加新的公共插件时, 确保 :
- 此插件来自
@atlaskit/editor-plugin-*或类似的公共软件包 - 添加插件选项到
pluginOptions类型 - 插件顺序得到维护( 有些插件有依赖性)
- 测试更新以反映新插件
许可证
Apache 许可证 2.0