diff --git a/packages/core/src/dom_components/view/ComponentTextView.ts b/packages/core/src/dom_components/view/ComponentTextView.ts index 2c8c9bf029..adc9cc4a1c 100644 --- a/packages/core/src/dom_components/view/ComponentTextView.ts +++ b/packages/core/src/dom_components/view/ComponentTextView.ts @@ -71,7 +71,7 @@ export default class ComponentTextView { /** * If true, the returned HTML content will be parsed into Components, allowing @@ -11,16 +17,16 @@ export interface CustomRTE { /** * Create or enable the custom RTE. */ - enable: (el: HTMLElement, rte: T | undefined) => T | Promise; + enable: (el: HTMLElement, rte: T | undefined, opts: CustomRteOptions) => T | Promise; /** * Disable the custom RTE. */ - disable: (el: HTMLElement, rte: T) => any | Promise; + disable: (el: HTMLElement, rte: T, opts: CustomRteOptions) => any | Promise; /** * Get HTML content from the custom RTE. * If not specified, it will use the innerHTML of the element (passed also as `content` in options). */ - getContent?: (el: HTMLElement, rte: T | undefined) => string | Promise; + getContent?: (el: HTMLElement, rte: T | undefined, opts: CustomRteOptions) => string | Promise; /** * Destroy the custom RTE. * Will be triggered on editor destroy. diff --git a/packages/core/src/rich_text_editor/index.ts b/packages/core/src/rich_text_editor/index.ts index 05fe6fe93d..10e2460515 100644 --- a/packages/core/src/rich_text_editor/index.ts +++ b/packages/core/src/rich_text_editor/index.ts @@ -40,14 +40,14 @@ import { debounce, isFunction, isString } from 'underscore'; import { Module } from '../abstract'; import { Debounced, DisableOptions, Model } from '../common'; -import ComponentView from '../dom_components/view/ComponentView'; import EditorModel from '../editor/model/Editor'; import { createEl, cx, on, removeEl } from '../utils/dom'; import { hasWin, isDef } from '../utils/mixins'; -import defConfig, { CustomRTE, RichTextEditorConfig } from './config/config'; +import defConfig, { CustomRTE, CustomRteOptions, RichTextEditorConfig } from './config/config'; import RichTextEditor, { RichTextEditorAction } from './model/RichTextEditor'; import CanvasEvents from '../canvas/types'; import { ComponentsEvents } from '../dom_components/types'; +import ComponentTextView from '../dom_components/view/ComponentTextView'; export type RichTextEditorEvent = 'rte:enable' | 'rte:disable' | 'rte:custom'; @@ -64,7 +64,7 @@ const events = { }; interface ModelRTE { - currentView?: ComponentView; + currentView?: ComponentTextView; } export interface RteDisableResult { @@ -360,13 +360,13 @@ export default class RichTextEditorModule extends Module