@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
59 lines (57 loc) • 2.27 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _extends from "@babel/runtime/helpers/extends";
// Disable no-re-export rule for entry point files
/* eslint-disable @atlaskit/editor/no-re-export */
/**
* @jsxRuntime classic
* @jsx jsx
*/
import React from 'react';
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
import { jsx } from '@emotion/react';
import { ComposableEditor } from './composable-editor';
import useUniversalPreset from './presets/useUniversalPreset';
import editorDeprecationWarnings from './utils/editorDeprecationWarnings';
const ComposableEditorWrapper = ({
props,
initialPluginConfiguration
}) => {
const preset = useUniversalPreset({
props,
initialPluginConfiguration
});
// Ignored via go/ees005
// eslint-disable-next-line react/jsx-props-no-spreading
return jsx(ComposableEditor, _extends({
preset: preset
}, props));
};
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
/**
* @deprecated - Please use the `ComposableEditor` component instead.
* We strongly encourage the use of custom presets, however your easiest migration path is to use the `useUniversalPreset` hook.
* The `ComposableEditor` component is a more flexible and customizable alternative to the `Editor` component.
* It allows you to create an editor with a custom set of plugins and configurations.
* For more information, see the documentation for the `ComposableEditor` component here: https://atlaskit.atlassian.com/packages/editor/editor-core
*/
// Ignored via go/ees005
// eslint-disable-next-line @repo/internal/react/no-class-components
export default class Editor extends React.Component {
constructor(props) {
super(props);
editorDeprecationWarnings(props);
}
render() {
return jsx(ComposableEditorWrapper, {
props: this.props,
initialPluginConfiguration: this.props.initialPluginConfiguration
});
}
}
_defineProperty(Editor, "defaultProps", {
appearance: 'comment',
disabled: false,
extensionHandlers: {},
allowHelpDialog: true,
quickInsert: true
});