mirror of
https://github.com/codex-team/editor.js
synced 2024-05-07 17:06:48 +02:00
2d89105670
* Add internal wrappers for tools classes * FIx lint * Change tools collections to map * Apply some more refactoring * Make tool instance private field * Add some docs * Fix eslint * Basic implementation for Block Tunes * Small fix for demo * Review changes * Fix * Add common tunes and ToolsCollection class * Fixes after review * Rename tools collections * Readonly fix * Some fixes after review * Apply suggestions from code review Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Fixes after review * Add docs and changelog * Update docs/block-tunes.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Apply suggestions from code review Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Update src/components/block/index.ts Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com> * [Dev] Tools utils tests (#1602) * Add tests for tools utils and coverage report * Fix eslint * Adjust test * Add more tests * Update after code review * Fix test & bump version Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com>
104 lines
2.1 KiB
TypeScript
104 lines
2.1 KiB
TypeScript
import {ToolConstructable, ToolSettings} from '../tools';
|
|
import {API, LogLevels, OutputData} from '../index';
|
|
import {SanitizerConfig} from './sanitizer-config';
|
|
import {I18nConfig} from './i18n-config';
|
|
|
|
export interface EditorConfig {
|
|
/**
|
|
* Element where Editor will be append
|
|
* @deprecated property will be removed in the next major release, use holder instead
|
|
*/
|
|
holderId?: string | HTMLElement;
|
|
|
|
/**
|
|
* Element where Editor will be appended
|
|
*/
|
|
holder?: string | HTMLElement;
|
|
|
|
/**
|
|
* If true, set caret at the first Block after Editor is ready
|
|
*/
|
|
autofocus?: boolean;
|
|
|
|
/**
|
|
* This Tool will be used as default
|
|
* Name should be equal to one of Tool`s keys of passed tools
|
|
* If not specified, Paragraph Tool will be used
|
|
*/
|
|
defaultBlock?: string;
|
|
|
|
/**
|
|
* @deprecated
|
|
* This property will be deprecated in the next major release.
|
|
* Use the 'defaultBlock' property instead.
|
|
*/
|
|
initialBlock?: string;
|
|
|
|
/**
|
|
* First Block placeholder
|
|
*/
|
|
placeholder?: string|false;
|
|
|
|
/**
|
|
* Define default sanitizer configuration
|
|
* @see {@link sanitizer}
|
|
*/
|
|
sanitizer?: SanitizerConfig;
|
|
|
|
/**
|
|
* If true, toolbar won't be shown
|
|
*/
|
|
hideToolbar?: boolean;
|
|
|
|
/**
|
|
* Map of Tools to use
|
|
*/
|
|
tools?: {[toolName: string]: ToolConstructable|ToolSettings};
|
|
|
|
/**
|
|
* Data to render on Editor start
|
|
*/
|
|
data?: OutputData;
|
|
|
|
/**
|
|
* Height of Editor's bottom area that allows to set focus on the last Block
|
|
*/
|
|
minHeight?: number;
|
|
|
|
/**
|
|
* Editors log level (how many logs you want to see)
|
|
*/
|
|
logLevel?: LogLevels;
|
|
|
|
/**
|
|
* Enable read-only mode
|
|
*/
|
|
readOnly?: boolean;
|
|
|
|
/**
|
|
* Internalization config
|
|
*/
|
|
i18n?: I18nConfig;
|
|
|
|
/**
|
|
* Fires when Editor is ready to work
|
|
*/
|
|
onReady?(): void;
|
|
|
|
/**
|
|
* Fires when something changed in DOM
|
|
* @param {API} api - editor.js api
|
|
*/
|
|
onChange?(api: API): void;
|
|
|
|
/**
|
|
* Defines default toolbar for all tools.
|
|
*/
|
|
inlineToolbar?: string[]|boolean;
|
|
|
|
/**
|
|
* Common Block Tunes list. Will be added to all the blocks which do not specify their own 'tunes' set
|
|
*/
|
|
tunes?: string[];
|
|
}
|