@atlaskit/editor-presets
v2.0.13
Published
Public editor presets for Atlassian Editor containing base configurations for Confluence and other products
Readme
@atlaskit/editor-presets
Public editor presets for Atlassian Editor containing base configurations for Confluence and other products.
Overview
This package provides standardized, open-source, and easily consumable presets for the Atlassian Editor. It enables rapid prototyping, experimentation, and integration in external environments such as Replit, Figma Make, and other designer and developer tools.
Available Presets
Confluence Full Page Base Preset
The confluenceFullPagePresetBase contains all public plugins and configurations used by the Confluence Full Page Editor.
import { confluenceFullPagePresetBase } from '@atlaskit/editor-presets';
const preset = confluenceFullPagePresetBase({
intl,
providers,
enabledOptionalPlugins,
pluginOptions,
});Usage
Basic Setup
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} />;
}Extending the Preset
You can extend the base preset with additional plugins:
import { confluenceFullPagePresetBase } from '@atlaskit/editor-presets';
import { myCustomPlugin } from './my-custom-plugin';
const customPreset = confluenceFullPagePresetBase(options)
.add([myCustomPlugin, myCustomPluginOptions]);Plugin Options
Each plugin included in the preset can be configured through the pluginOptions object. Refer to individual plugin documentation for available options.
API
confluenceFullPagePresetBase(options: ConfluenceFullPageBasePresetOptions): EditorPresetBuilder
Creates a base Confluence Full Page Editor preset with all public plugins.
Parameters:
intl: IntlShape- React Intl instance for internationalizationproviders: Providers- Required service providersenabledOptionalPlugins: EnabledOptionalPlugins- Configuration for optional pluginspluginOptions: AllPluginOptions- Plugin-specific configuration options
Returns: EditorPresetBuilder - A preset builder that can be extended with additional plugins
Architecture
The public preset contains only @atlaskit/editor-plugin-* packages. Private or product-specific plugins should be added in separate preset packages (e.g., editor-presets-confluence for Confluence-specific features).
Contributing
When adding new public plugins to this preset, ensure:
- The plugin is from
@atlaskit/editor-plugin-*or similar public packages - Plugin options are added to the
pluginOptionstype - Plugin order is maintained (some plugins have dependencies)
- Tests are updated to reflect the new plugin
License
Apache License 2.0
