Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version bump: 8.61 & content model 0.27 #2460

Merged
merged 57 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5f00694
fix collapsed
juliaroldi Feb 15, 2024
3daf442
conflicts
juliaroldi Feb 15, 2024
a45988d
remove test
juliaroldi Feb 15, 2024
8e1cc2f
fix list
juliaroldi Feb 16, 2024
ba29812
Merge branch 'master' into u/juliaroldi/list-bugs
juliaroldi Feb 16, 2024
8f3f0da
remove margins
juliaroldi Feb 19, 2024
41eb153
Workaround for no mouseUp event (#2423)
ianeli1 Feb 20, 2024
26fd80d
Rename StandaloneEditor to Editor (#2416)
JiuqingSong Feb 20, 2024
f63a0c9
add parameter
juliaroldi Feb 20, 2024
2a323ae
Merge branch 'master' into u/juliaroldi/list-bugs
juliaroldi Feb 20, 2024
4894d7e
Merge branch 'master' into u/juliaroldi/list-margins
juliaroldi Feb 20, 2024
b5a925b
fix conflicts
juliaroldi Feb 20, 2024
3574ab7
Merge pull request #2425 from microsoft/u/juliaroldi/list-margins
juliaroldi Feb 20, 2024
da1862e
fix selection
juliaroldi Feb 20, 2024
5949c10
Merge branch 'master' into u/juliaroldi/list-bugs
juliaroldi Feb 20, 2024
0bade6c
Fix insertNode: Do not reselect if updateCursor is false (#2431)
JiuqingSong Feb 20, 2024
ac262d8
Bump ip from 1.1.5 to 1.1.9 (#2433)
dependabot[bot] Feb 20, 2024
9cec478
Outdent indented empty paragraph when pressing Backspace. (#2429)
BryanValverdeU Feb 20, 2024
3b8be25
Merge branch 'master' into u/juliaroldi/list-bugs
JiuqingSong Feb 21, 2024
1b33f5f
Merge pull request #2420 from microsoft/u/juliaroldi/list-bugs
juliaroldi Feb 21, 2024
53441ee
handle Tab key for paragraph
juliaroldi Feb 22, 2024
55bc451
fix build
juliaroldi Feb 22, 2024
6b1b9a8
fix build
juliaroldi Feb 22, 2024
34c735a
remove /lib
juliaroldi Feb 22, 2024
77f0a7c
disable list features
juliaroldi Feb 26, 2024
c1debd1
Merge pull request #2439 from microsoft/u/juliaroldi/disable-list-fea…
juliaroldi Feb 26, 2024
abfae44
save last focus
juliaroldi Feb 26, 2024
a296e4c
Merge branch 'master' into u/juliaroldi/restore-focus
juliaroldi Feb 26, 2024
6a832c2
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
juliaroldi Feb 26, 2024
68643be
Support adding options for exportContent (#2443)
JiuqingSong Feb 27, 2024
1f78802
Set RootFontSize to SanitizingContext (#2445)
BryanValverdeU Feb 27, 2024
44f6c07
refactor
juliaroldi Feb 27, 2024
a692c39
fix build
juliaroldi Feb 27, 2024
2c2e833
Fix #2435 (#2442)
JiuqingSong Feb 27, 2024
a04f9f0
format with content model
juliaroldi Feb 27, 2024
44e84bd
Merge branch 'u/juliaroldi/restore-focus' of https://github.com/micro…
juliaroldi Feb 27, 2024
ac25fcf
remove empty line
juliaroldi Feb 27, 2024
b49784c
Merge branch 'master' into u/juliaroldi/restore-focus
juliaroldi Feb 27, 2024
b8fd5f3
Split contentDiv into physicalRoot and logicalRoot (#2441)
florian-msft Feb 27, 2024
f70fcbd
Merge branch 'master' into u/juliaroldi/tab-paragraph
juliaroldi Feb 28, 2024
a0f6536
Merge pull request #2436 from microsoft/u/juliaroldi/tab-paragraph
juliaroldi Feb 28, 2024
c0ff665
add unit test
juliaroldi Feb 28, 2024
eae992c
Fix dispose plugin issus in EditorAdapter (#2452)
JiuqingSong Feb 28, 2024
5534dc0
Merge branch 'master' into u/juliaroldi/restore-focus
JiuqingSong Feb 29, 2024
cb6c80b
Merge pull request #2440 from microsoft/u/juliaroldi/restore-focus
juliaroldi Feb 29, 2024
743de92
Fix #2202 again (#2450)
JiuqingSong Feb 29, 2024
78b498a
Improve Entity State related API (#2444)
JiuqingSong Feb 29, 2024
c950e5b
Port Table edit plugin (#2358)
Andres-CT98 Feb 29, 2024
e9ae3a3
Port ShortcutPlugin (#2427)
JiuqingSong Feb 29, 2024
2397f7b
Add option to configure the default paste type (#2457)
BryanValverdeU Feb 29, 2024
caded2c
Merge branch 'master' into u/ianeli/bump-8-61
ianeli1 Mar 1, 2024
1ad3a8a
Bump Versions
ianeli1 Mar 1, 2024
144981f
Remove Space
ianeli1 Mar 1, 2024
9b1c0f8
Fix 258837 and 257626 (#2459)
JiuqingSong Mar 1, 2024
8693be8
Remove Bg Color from block on Merge Paste (#2458)
BryanValverdeU Mar 1, 2024
9dfcab8
Fix Version Numbers
ianeli1 Mar 1, 2024
22fae8d
Merge branch 'master' into u/ianeli/bump-8-61
ianeli1 Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion demo/scripts/controls/BuildInPluginState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface BuildInPluginList {
imageEdit: boolean;
cutPasteListChain: boolean;
tableCellSelection: boolean;
tableResize: boolean;
customReplace: boolean;
listEditMenu: boolean;
imageEditMenu: boolean;
Expand Down
16 changes: 10 additions & 6 deletions demo/scripts/controls/ContentModelEditorMainPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { alignJustifyButton } from './ribbonButtons/contentModel/alignJustifyBut
import { alignLeftButton } from './ribbonButtons/contentModel/alignLeftButton';
import { alignRightButton } from './ribbonButtons/contentModel/alignRightButton';
import { arrayPush } from 'roosterjs-editor-dom';
import { AutoFormatPlugin, EditPlugin, PastePlugin } from 'roosterjs-content-model-plugins';
import { backgroundColorButton } from './ribbonButtons/contentModel/backgroundColorButton';
import { blockQuoteButton } from './ribbonButtons/contentModel/blockQuoteButton';
import { boldButton } from './ribbonButtons/contentModel/boldButton';
Expand Down Expand Up @@ -80,11 +79,13 @@ import { trustedHTMLHandler } from '../utils/trustedHTMLHandler';
import { underlineButton } from './ribbonButtons/contentModel/underlineButton';
import { undoButton } from './ribbonButtons/contentModel/undoButton';
import { zoom } from './ribbonButtons/contentModel/zoom';
import { ContentModelSegmentFormat, IEditor, Snapshots } from 'roosterjs-content-model-types';
import {
ContentModelSegmentFormat,
IStandaloneEditor,
Snapshots,
} from 'roosterjs-content-model-types';
AutoFormatPlugin,
EditPlugin,
PastePlugin,
TableEditPlugin,
} from 'roosterjs-content-model-plugins';
import {
spaceAfterButton,
spaceBeforeButton,
Expand Down Expand Up @@ -155,7 +156,7 @@ const DarkTheme: PartialTheme = {
};

interface ContentModelMainPaneState extends MainPaneBaseState {
editorCreator: (div: HTMLDivElement, options: EditorAdapterOptions) => IStandaloneEditor;
editorCreator: (div: HTMLDivElement, options: EditorAdapterOptions) => IEditor;
}

class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState> {
Expand All @@ -174,6 +175,7 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
private formatPainterPlugin: ContentModelFormatPainterPlugin;
private pastePlugin: PastePlugin;
private sampleEntityPlugin: SampleEntityPlugin;
private tableEditPlugin: TableEditPlugin;
private snapshots: Snapshots;
private buttons: ContentModelRibbonButton<any>[] = [
formatPainterButton,
Expand Down Expand Up @@ -263,6 +265,7 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
this.pasteOptionPlugin = createPasteOptionPlugin();
this.emojiPlugin = createEmojiPlugin();
this.formatPainterPlugin = new ContentModelFormatPainterPlugin();
this.tableEditPlugin = new TableEditPlugin();
this.pastePlugin = new PastePlugin();
this.sampleEntityPlugin = new SampleEntityPlugin();
this.state = {
Expand Down Expand Up @@ -382,6 +385,7 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
this.contentModelRibbonPlugin,
this.formatPainterPlugin,
this.pastePlugin,
this.tableEditPlugin,
this.contentModelAutoFormatPlugin,
this.contentModelEditPlugin,
this.contentModelPanePlugin.getInnerRibbonPlugin(),
Expand Down
25 changes: 18 additions & 7 deletions demo/scripts/controls/StandaloneEditorMainPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { alignCenterButton } from './ribbonButtons/contentModel/alignCenterButto
import { alignJustifyButton } from './ribbonButtons/contentModel/alignJustifyButton';
import { alignLeftButton } from './ribbonButtons/contentModel/alignLeftButton';
import { alignRightButton } from './ribbonButtons/contentModel/alignRightButton';
import { AutoFormatPlugin, EditPlugin } from 'roosterjs-content-model-plugins';
import { backgroundColorButton } from './ribbonButtons/contentModel/backgroundColorButton';
import { blockQuoteButton } from './ribbonButtons/contentModel/blockQuoteButton';
import { boldButton } from './ribbonButtons/contentModel/boldButton';
Expand All @@ -30,6 +29,7 @@ import { ContentModelRibbonPlugin } from './ribbonButtons/contentModel/ContentMo
import { darkMode } from './ribbonButtons/contentModel/darkMode';
import { decreaseFontSizeButton } from './ribbonButtons/contentModel/decreaseFontSizeButton';
import { decreaseIndentButton } from './ribbonButtons/contentModel/decreaseIndentButton';
import { Editor } from 'roosterjs-content-model-core';
import { exportContent } from './ribbonButtons/contentModel/export';
import { fontButton } from './ribbonButtons/contentModel/fontButton';
import { fontSizeButton } from './ribbonButtons/contentModel/fontSizeButton';
Expand Down Expand Up @@ -63,7 +63,6 @@ import { setTableCellShadeButton } from './ribbonButtons/contentModel/setTableCe
import { setTableHeaderButton } from './ribbonButtons/contentModel/setTableHeaderButton';
import { Snapshots } from 'roosterjs-editor-types';
import { spacingButton } from './ribbonButtons/contentModel/spacingButton';
import { StandaloneEditor } from 'roosterjs-content-model-core';
import { strikethroughButton } from './ribbonButtons/contentModel/strikethroughButton';
import { subscriptButton } from './ribbonButtons/contentModel/subscriptButton';
import { superscriptButton } from './ribbonButtons/contentModel/superscriptButton';
Expand All @@ -76,11 +75,17 @@ import { trustedHTMLHandler } from '../utils/trustedHTMLHandler';
import { underlineButton } from './ribbonButtons/contentModel/underlineButton';
import { undoButton } from './ribbonButtons/contentModel/undoButton';
import { zoom } from './ribbonButtons/contentModel/zoom';
import {
AutoFormatPlugin,
EditPlugin,
ShortcutPlugin,
TableEditPlugin,
} from 'roosterjs-content-model-plugins';
import {
ContentModelSegmentFormat,
IStandaloneEditor,
IEditor,
Snapshot,
StandaloneEditorOptions,
EditorOptions,
} from 'roosterjs-content-model-types';
import {
spaceAfterButton,
Expand Down Expand Up @@ -152,7 +157,7 @@ const DarkTheme: PartialTheme = {
};

interface ContentModelMainPaneState extends MainPaneBaseState {
editorCreator: (div: HTMLDivElement, options: StandaloneEditorOptions) => IStandaloneEditor;
editorCreator: (div: HTMLDivElement, options: EditorOptions) => IEditor;
}

class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState> {
Expand All @@ -165,7 +170,9 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
private contentModelRibbonPlugin: RibbonPlugin;
private contentAutoFormatPlugin: AutoFormatPlugin;
private snapshotPlugin: ContentModelSnapshotPlugin;
private shortcutPlugin: ShortcutPlugin;
private formatPainterPlugin: ContentModelFormatPainterPlugin;
private tableEditPlugin: TableEditPlugin;
private snapshots: Snapshots<Snapshot>;
private buttons: ContentModelRibbonButton<any>[] = [
formatPainterButton,
Expand Down Expand Up @@ -251,8 +258,10 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
this.contentModelPanePlugin = new ContentModelPanePlugin();
this.contentModelEditPlugin = new EditPlugin();
this.contentAutoFormatPlugin = new AutoFormatPlugin();
this.shortcutPlugin = new ShortcutPlugin();
this.contentModelRibbonPlugin = new ContentModelRibbonPlugin();
this.formatPainterPlugin = new ContentModelFormatPainterPlugin();
this.tableEditPlugin = new TableEditPlugin();
this.state = {
showSidePane: window.location.hash != '',
popoutWindow: null,
Expand Down Expand Up @@ -305,8 +314,8 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>

resetEditor() {
this.setState({
editorCreator: (div: HTMLDivElement, options: StandaloneEditorOptions) =>
new StandaloneEditor(div, {
editorCreator: (div: HTMLDivElement, options: EditorOptions) =>
new Editor(div, {
...options,
cacheModel: this.state.initState.cacheModel,
}),
Expand Down Expand Up @@ -345,8 +354,10 @@ class ContentModelEditorMainPane extends MainPaneBase<ContentModelMainPaneState>
plugins={[
this.contentModelRibbonPlugin,
this.formatPainterPlugin,
this.tableEditPlugin,
this.contentModelEditPlugin,
this.contentAutoFormatPlugin,
this.shortcutPlugin,
]}
defaultSegmentFormat={defaultFormat}
inDarkMode={this.state.isDarkMode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ import * as React from 'react';
import { createUIUtilities, ReactEditorPlugin, UIUtilities } from 'roosterjs-react';
import { divProperties, getNativeProps } from '@fluentui/react/lib/Utilities';
import { EditorAdapter, EditorAdapterOptions } from 'roosterjs-editor-adapter';
import { EditorOptions, EditorPlugin, IEditor } from 'roosterjs-content-model-types';
import { useTheme } from '@fluentui/react/lib/Theme';
import {
EditorPlugin,
IStandaloneEditor,
StandaloneEditorOptions,
} from 'roosterjs-content-model-types';
import type { EditorPlugin as LegacyEditorPlugin } from 'roosterjs-editor-types';

/**
Expand All @@ -20,7 +16,7 @@ export interface ContentModelRoosterProps
* Creator function used for creating the instance of roosterjs editor.
* Use this callback when you have your own sub class of roosterjs Editor or force trigging a reset of editor
*/
editorCreator?: (div: HTMLDivElement, options: StandaloneEditorOptions) => IStandaloneEditor;
editorCreator?: (div: HTMLDivElement, options: EditorOptions) => IEditor;

/**
* Whether editor should get focus once it is created
Expand All @@ -36,7 +32,7 @@ export interface ContentModelRoosterProps
*/
export default function ContentModelRooster(props: ContentModelRoosterProps) {
const editorDiv = React.useRef<HTMLDivElement>(null);
const editor = React.useRef<IStandaloneEditor | null>(null);
const editor = React.useRef<IEditor | null>(null);
const theme = useTheme();

const { focusOnInit, editorCreator, inDarkMode, plugins, legacyPlugins } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { applySegmentFormat, getFormatState } from 'roosterjs-content-model-api'
import {
ContentModelSegmentFormat,
EditorPlugin,
IStandaloneEditor,
IEditor,
PluginEvent,
} from 'roosterjs-content-model-types';

const FORMATPAINTERCURSOR_SVG = require('./formatpaintercursor.svg');
const FORMATPAINTERCURSOR_STYLE = `cursor: url("${FORMATPAINTERCURSOR_SVG}") 8.5 16, auto`;

export default class ContentModelFormatPainterPlugin implements EditorPlugin {
private editor: IStandaloneEditor | null = null;
private editor: IEditor | null = null;
private styleNode: HTMLStyleElement | null = null;
private painterFormat: ContentModelSegmentFormat | null = null;
private static instance: ContentModelFormatPainterPlugin | undefined;
Expand All @@ -24,7 +24,7 @@ export default class ContentModelFormatPainterPlugin implements EditorPlugin {
return 'FormatPainter';
}

initialize(editor: IStandaloneEditor) {
initialize(editor: IEditor) {
this.editor = editor;

const doc = this.editor.getDocument();
Expand Down Expand Up @@ -77,7 +77,7 @@ export default class ContentModelFormatPainterPlugin implements EditorPlugin {
}
}

function getSegmentFormat(editor: IStandaloneEditor): ContentModelSegmentFormat {
function getSegmentFormat(editor: IEditor): ContentModelSegmentFormat {
const formatState = getFormatState(editor);

return {
Expand Down
4 changes: 0 additions & 4 deletions demo/scripts/controls/getToggleablePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { HyperLink } from 'roosterjs-editor-plugins/lib/HyperLink';
import { ImageEdit } from 'roosterjs-editor-plugins/lib/ImageEdit';
import { Paste } from 'roosterjs-editor-plugins/lib/Paste';
import { TableCellSelection } from 'roosterjs-editor-plugins/lib/TableCellSelection';
import { TableResize } from 'roosterjs-editor-plugins/lib/TableResize';
import { Watermark } from 'roosterjs-editor-plugins/lib/Watermark';
import {
createContextMenuPlugin,
Expand Down Expand Up @@ -43,9 +42,6 @@ export default function getToggleablePlugins(initState: BuildInPluginState) {
imageEdit,
cutPasteListChain: pluginList.cutPasteListChain ? new CutPasteListChain() : null,
tableCellSelection: pluginList.tableCellSelection ? new TableCellSelection() : null,
tableResize: pluginList.tableResize
? new TableResize(undefined, initState.tableFeaturesContainerSelector)
: null,
customReplace: pluginList.customReplace ? new CustomReplacePlugin() : null,
autoFormat: pluginList.autoFormat ? new AutoFormat() : null,
listEditMenu:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LocalizedStrings, RibbonButtonDropDown, UIUtilities } from 'roosterjs-react';
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
import type { FormatState } from 'roosterjs-editor-types';
import type { ICommandBarItemProps } from '@fluentui/react/lib/CommandBar';

Expand Down Expand Up @@ -35,7 +35,7 @@ export default interface ContentModelRibbonButton<T extends string> {
* @param uiUtilities a utilities object to help render addition UI elements
*/
onClick: (
editor: IStandaloneEditor,
editor: IEditor,
key: T,
strings: LocalizedStrings<T> | undefined,
uiUtilities: UIUtilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ import { FormatState } from 'roosterjs-editor-types';
import { getFormatState } from 'roosterjs-content-model-api';
import { getObjectKeys } from 'roosterjs-editor-dom';
import { LocalizedStrings, UIUtilities } from 'roosterjs-react';
import {
ContentModelFormatState,
IStandaloneEditor,
PluginEvent,
} from 'roosterjs-content-model-types';
import { ContentModelFormatState, IEditor, PluginEvent } from 'roosterjs-content-model-types';

export class ContentModelRibbonPlugin implements RibbonPlugin {
private editor: IStandaloneEditor | null = null;
private editor: IEditor | null = null;
private onFormatChanged: ((formatState: FormatState) => void) | null = null;
private timer = 0;
private formatState: ContentModelFormatState | null = null;
Expand All @@ -34,7 +30,7 @@ export class ContentModelRibbonPlugin implements RibbonPlugin {
* Initialize this plugin
* @param editor The editor instance
*/
initialize(editor: IStandaloneEditor) {
initialize(editor: IEditor) {
this.editor = editor;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ContentModelPane, { ContentModelPaneProps } from './ContentModelPane';
import SidePanePluginImpl from '../SidePanePluginImpl';
import { ContentModelRibbonPlugin } from '../../ribbonButtons/contentModel/ContentModelRibbonPlugin';
import { IEditor, PluginEvent, PluginEventType } from 'roosterjs-editor-types';
import { IStandaloneEditor } from 'roosterjs-content-model-types';
import { IEditor as ILegacyEditor, PluginEvent, PluginEventType } from 'roosterjs-editor-types';
import { IEditor } from 'roosterjs-content-model-types';
import { setCurrentContentModel } from './currentModel';
import { SidePaneElementProps } from '../SidePaneElement';

Expand All @@ -17,10 +17,10 @@ export default class ContentModelPanePlugin extends SidePanePluginImpl<
this.contentModelRibbon = new ContentModelRibbonPlugin();
}

initialize(editor: IEditor): void {
initialize(editor: ILegacyEditor): void {
super.initialize(editor);

this.contentModelRibbon.initialize(editor as IEditor & IStandaloneEditor); // TODO: Port side pane to use IStandaloneEditor
this.contentModelRibbon.initialize(editor as ILegacyEditor & IEditor); // TODO: Port side pane to use IStandaloneEditor
editor.getDocument().addEventListener('selectionchange', this.onModelChangeFromSelection);
}

Expand All @@ -36,8 +36,7 @@ export default class ContentModelPanePlugin extends SidePanePluginImpl<
onPluginEvent(e: PluginEvent) {
if (e.eventType == PluginEventType.ContentChanged && e.source == 'RefreshModel') {
this.getComponent(component => {
// TODO: Port to use IStandaloneEditor and remove type cast here
const model = (this.editor as IEditor & IStandaloneEditor).getContentModelCopy(
const model = (this.editor as ILegacyEditor & IEditor).getContentModelCopy(
'connected'
);
component.setContentModel(model);
Expand Down Expand Up @@ -74,9 +73,7 @@ export default class ContentModelPanePlugin extends SidePanePluginImpl<
private onModelChange = () => {
this.getComponent(component => {
// TODO: Port to use IStandaloneEditor and remove type cast here
const model = (this.editor as IEditor & IStandaloneEditor).getContentModelCopy(
'connected'
);
const model = (this.editor as ILegacyEditor & IEditor).getContentModelCopy('connected');
component.setContentModel(model);
setCurrentContentModel(model);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';
import ApiPaneProps from '../ApiPaneProps';
import { Entity, IEditor } from 'roosterjs-editor-types';
import { Entity, IEditor as ILegacyEditor } from 'roosterjs-editor-types';
import { getEntityFromElement, getEntitySelector } from 'roosterjs-editor-dom';
import { IEditor, InsertEntityOptions } from 'roosterjs-content-model-types';
import { insertEntity } from 'roosterjs-content-model-api';
import { InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
import { trustedHTMLHandler } from '../../../../utils/trustedHTMLHandler';

const styles = require('./InsertEntityPane.scss');
Expand Down Expand Up @@ -114,7 +114,7 @@ export default class InsertEntityPane extends React.Component<ApiPaneProps, Inse

if (isBlock) {
insertEntity(
editor as IStandaloneEditor & IEditor,
editor as IEditor & ILegacyEditor,
entityType,
true,
insertAtRoot
Expand All @@ -128,7 +128,7 @@ export default class InsertEntityPane extends React.Component<ApiPaneProps, Inse
);
} else {
insertEntity(
editor as IStandaloneEditor & IEditor,
editor as IEditor & ILegacyEditor,
entityType,
isBlock,
insertAtTop ? 'begin' : insertAtBottom ? 'end' : 'focus',
Expand Down
Loading
Loading