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

Bump main version to 9.2.0 #2608

Merged
merged 108 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
ba053e7
code suport
juliaroldi Mar 26, 2024
48f2fae
markdown
juliaroldi Mar 26, 2024
f9a11a0
conflicts
juliaroldi Apr 1, 2024
1f105ff
adjust
juliaroldi Apr 1, 2024
02ecb84
Merge branch 'master' into u/juliaroldi/port-markdown-plugin-2
juliaroldi Apr 1, 2024
287a8df
demo site
juliaroldi Apr 1, 2024
716f914
Merge branch 'u/juliaroldi/port-markdown-plugin-2' of https://github.…
juliaroldi Apr 1, 2024
c712f3b
WIP
juliaroldi Apr 1, 2024
34ac350
fix code pen
juliaroldi Apr 1, 2024
7489c6d
fix demo site
juliaroldi Apr 1, 2024
1c276af
Merge pull request #2527 from microsoft/u/juliaroldi/port-markdown-pl…
juliaroldi Apr 1, 2024
a5967fb
fix conflixts
juliaroldi Apr 1, 2024
f362e01
Handle Tab key on whole table selection or last cell on Edit Plugin (…
Andres-CT98 Apr 1, 2024
13543b9
Merge branch 'master' into u/juliaroldi/auto-format-demo-site
juliaroldi Apr 2, 2024
9460c0c
Merge pull request #2549 from microsoft/u/juliaroldi/auto-format-demo…
juliaroldi Apr 2, 2024
ef49253
Fix seelection on void element (#2551)
JiuqingSong Apr 2, 2024
498a9f4
port hyphen
juliaroldi Apr 2, 2024
259a94c
Merge branch 'master' into u/juliaroldi/auto-hypen-port
juliaroldi Apr 2, 2024
182ed16
Implement movement with Tab key inside Table (#2529)
Andres-CT98 Apr 2, 2024
28ecdae
fix tests
juliaroldi Apr 3, 2024
f9514d6
Merge branch 'u/juliaroldi/auto-hypen-port' of https://github.com/mic…
juliaroldi Apr 3, 2024
aa92ec3
Merge branch 'master' into u/juliaroldi/auto-hypen-port
juliaroldi Apr 3, 2024
80f1eca
add formatTextSegmentBeforeSelectionMarker
juliaroldi Apr 3, 2024
7995f21
Merge branch 'u/juliaroldi/auto-hypen-port' of https://github.com/mic…
juliaroldi Apr 3, 2024
154d72d
Improve backspace on list (#2555)
JiuqingSong Apr 3, 2024
4ace57a
fix selection with ctrl+a
juliaroldi Apr 3, 2024
1377277
Merge branch 'master' into u/juliaroldi/adjust-image-selection
juliaroldi Apr 3, 2024
12dc692
Merge pull request #2556 from microsoft/u/juliaroldi/adjust-image-sel…
juliaroldi Apr 4, 2024
b1b398e
refactor code using formatTextSegmentBeforeSelectionMarkerTest
juliaroldi Apr 4, 2024
c1b2a9d
remove getLinkSegment
juliaroldi Apr 4, 2024
4bb65d7
Merge branch 'master' into u/juliaroldi/format-segment-before-text
juliaroldi Apr 4, 2024
f34b360
Merge pull request #2557 from microsoft/u/juliaroldi/format-segment-b…
juliaroldi Apr 4, 2024
35c3a33
Set default format in demo site (#2559)
JiuqingSong Apr 4, 2024
35e08b3
clean demo site
juliaroldi Apr 5, 2024
3b4c904
clean
juliaroldi Apr 5, 2024
b7d50b4
Enable selecting image when the only element in the range is an Image…
BryanValverdeU Apr 5, 2024
1072c05
fix markdown plugin
juliaroldi Apr 5, 2024
39cd6c0
Merge branch 'master' into u/juliaroldi/add-markdown-options
juliaroldi Apr 5, 2024
bea0bd7
Port Hyperlink plugin (#2560)
JiuqingSong Apr 5, 2024
1958eab
conflicts
juliaroldi Apr 5, 2024
99a3bbf
Merge pull request #2562 from microsoft/u/juliaroldi/clean-content-edit
juliaroldi Apr 5, 2024
a8982cd
fix conflicts
juliaroldi Apr 5, 2024
4065ba6
Merge branch 'u/juliaroldi/add-markdown-options' of https://github.co…
juliaroldi Apr 5, 2024
31037a1
Merge pull request #2563 from microsoft/u/juliaroldi/add-markdown-opt…
juliaroldi Apr 5, 2024
7d865b9
export formatTextSegmentBeforeSelectionMarker
juliaroldi Apr 5, 2024
b55fe2c
fix build
juliaroldi Apr 5, 2024
53f1f4d
Prevent ScrollTop to be lost when the focus is done to the editor (#2…
BryanValverdeU Apr 5, 2024
29d5315
Merge branch 'master' into u/juliaroldi/export-formatSegment
BryanValverdeU Apr 5, 2024
86cc784
Merge pull request #2565 from microsoft/u/juliaroldi/export-formatSeg…
juliaroldi Apr 5, 2024
a4457db
Fix 265959: extra empty line generated when get plain text (#2566)
JiuqingSong Apr 5, 2024
2088aa5
Fix #2500 Hyperlink misses color (#2570)
JiuqingSong Apr 9, 2024
4ffd535
mac shortcuts
juliaroldi Apr 12, 2024
7ea28f9
fix test
juliaroldi Apr 12, 2024
25f0296
Merge pull request #2574 from microsoft/u/juliaroldi/mac-shortucuts
juliaroldi Apr 12, 2024
d598652
restore selection (#2577)
Rain-Zheng Apr 16, 2024
70684a4
fix: on webkit-based applications, when the selection is empty, focus…
miku1958 Apr 16, 2024
74bc863
Port PickerPlugin (#2569)
JiuqingSong Apr 16, 2024
09fbd0f
adjust image
juliaroldi Apr 16, 2024
b3be12d
fix test
juliaroldi Apr 16, 2024
26f3524
fixes
juliaroldi Apr 17, 2024
a3306fe
remove
juliaroldi Apr 17, 2024
a3e1508
Preserve reverted selection info in Content Model (#2580)
JiuqingSong Apr 17, 2024
8ae1f58
Merge branch 'master' into u/juliaroldi/image-width
juliaroldi Apr 17, 2024
4227e2f
Merge pull request #2579 from microsoft/u/juliaroldi/image-width
juliaroldi Apr 17, 2024
027cb4e
fix empty text
juliaroldi Apr 17, 2024
2250692
Merge branch 'master' into u/juliaroldi/fix-markdown
juliaroldi Apr 17, 2024
705eb09
Merge pull request #2582 from microsoft/u/juliaroldi/fix-markdown
juliaroldi Apr 17, 2024
7e77e4e
trigger Events
juliaroldi Apr 17, 2024
5425f02
Merge branch 'master' into u/juliaroldi/auto-format-api-name
juliaroldi Apr 17, 2024
29045a5
Allow Shift+Delete to Cut (#2585)
JiuqingSong Apr 18, 2024
c3dff00
Merge branch 'master' into u/juliaroldi/auto-format-api-name
juliaroldi Apr 18, 2024
692d221
change source
juliaroldi Apr 18, 2024
e368c85
fix build
juliaroldi Apr 18, 2024
1269238
Merge pull request #2583 from microsoft/u/juliaroldi/auto-format-api-…
juliaroldi Apr 18, 2024
b0cbd9a
Fix #2584: Safari context menu event causes selection to be expanded …
JiuqingSong Apr 20, 2024
4aa8ad2
Port AnnouncePlugin step 1: refactor list number code (#2589)
JiuqingSong Apr 20, 2024
e989c38
test
juliaroldi Apr 22, 2024
2ef7218
refactor
juliaroldi Apr 22, 2024
42dde83
Merge branch 'master' into u/juliaroldi/custom-replace-plugin
juliaroldi Apr 22, 2024
f49c201
fix demo site
juliaroldi Apr 22, 2024
a5b9456
Select image after inserting it (#2593)
BryanValverdeU Apr 22, 2024
49866d5
Merge branch 'master' into u/juliaroldi/custom-replace-plugin
BryanValverdeU Apr 22, 2024
a05e659
Port AnnouncePlugin Step 2: Add announce core API (#2591)
JiuqingSong Apr 22, 2024
4eb25b3
Merge branch 'master' into u/juliaroldi/custom-replace-plugin
juliaroldi Apr 22, 2024
dc5ffde
WIP
juliaroldi Apr 22, 2024
059f39d
custom replace
juliaroldi Apr 22, 2024
924ff2f
Merge branch 'u/juliaroldi/custom-replace-plugin' of https://github.c…
juliaroldi Apr 22, 2024
55b81d3
Fix table mover selector (#2596)
Andres-CT98 Apr 23, 2024
bf0766c
Merge branch 'master' into u/juliaroldi/custom-replace-plugin
juliaroldi Apr 23, 2024
7a42901
Merge pull request #2594 from microsoft/u/juliaroldi/custom-replace-p…
juliaroldi Apr 23, 2024
337cf7c
trigger autolink
juliaroldi Apr 23, 2024
2d38c17
Merge branch 'master' into u/juliaroldi/autoformat-numbers
juliaroldi Apr 23, 2024
7e5f1f5
Merge pull request #2598 from microsoft/u/juliaroldi/trigger-auto-link
juliaroldi Apr 23, 2024
57cd8af
wip
juliaroldi Apr 23, 2024
162b4e3
conflicts'
juliaroldi Apr 23, 2024
af63a38
Port AnnouncePlugin step 3: Add announce features for list and table …
JiuqingSong Apr 24, 2024
2396a39
Merge branch 'master' into u/juliaroldi/autoformat-numbers
juliaroldi Apr 24, 2024
e3cc9e8
Merge pull request #2595 from microsoft/u/juliaroldi/autoformat-numbers
juliaroldi Apr 24, 2024
b69795f
Fix #2575 Entity delimiter cursor moving (#2581)
JiuqingSong Apr 24, 2024
3aad9b8
Merge branch 'master' into u/ianeli/bump
ianeli1 Apr 26, 2024
c6afdc3
update main version
ianeli1 Apr 26, 2024
c77651c
Fix difference with master
ianeli1 Apr 26, 2024
e944971
Allow customizability for table editors (#2603)
BryanValverdeU Apr 26, 2024
657542f
Also allow using Ctrl-Shift-Z on Windows (#2607)
florian-msft Apr 26, 2024
bcebc94
Fix test
ianeli1 Apr 26, 2024
fcae4f0
Merge branch 'master' into u/ianeli/bump
ianeli1 Apr 26, 2024
3a5c5c7
Try fix setFormatTest
ianeli1 Apr 26, 2024
2d0d148
Fix merge issues
ianeli1 Apr 26, 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
36 changes: 31 additions & 5 deletions demo/scripts/controlsV2/mainPane/MainPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import SampleEntityPlugin from '../plugins/SampleEntityPlugin';
import { ApiPlaygroundPlugin } from '../sidePane/apiPlayground/ApiPlaygroundPlugin';
import { Border, ContentModelDocument, EditorOptions } from 'roosterjs-content-model-types';
import { Colors, EditorPlugin, IEditor, Snapshots } from 'roosterjs-content-model-types';
import { ContentModelPanePlugin } from '../sidePane/contentModel/ContentModelPanePlugin';
import { createEmojiPlugin } from '../roosterjsReact/emoji';
import { createImageEditMenuProvider } from '../roosterjsReact/contextMenu/menus/createImageEditMenuProvider';
Expand All @@ -30,6 +28,7 @@ import { PresetPlugin } from '../sidePane/presets/PresetPlugin';
import { redoButton } from '../roosterjsReact/ribbon/buttons/redoButton';
import { registerWindowForCss, unregisterWindowForCss } from '../../utils/cssMonitor';
import { Rooster } from '../roosterjsReact/rooster';
import { SamplePickerPlugin } from '../plugins/SamplePickerPlugin';
import { SidePane } from '../sidePane/SidePane';
import { SidePanePlugin } from '../sidePane/SidePanePlugin';
import { SnapshotPlugin } from '../sidePane/snapshot/SnapshotPlugin';
Expand All @@ -41,11 +40,18 @@ import { UpdateContentPlugin } from '../plugins/UpdateContentPlugin';
import { WindowProvider } from '@fluentui/react/lib/WindowProvider';
import { zoomButton } from '../demoButtons/zoomButton';
import {
createContextMenuPlugin,
createTableEditMenuProvider,
} from '../roosterjsReact/contextMenu';
Border,
Colors,
ContentModelDocument,
EditorOptions,
EditorPlugin,
IEditor,
KnownAnnounceStrings,
Snapshots,
} from 'roosterjs-content-model-types';
import {
AutoFormatPlugin,
CustomReplacePlugin,
EditPlugin,
HyperlinkPlugin,
MarkdownPlugin,
Expand All @@ -54,6 +60,10 @@ import {
TableEditPlugin,
WatermarkPlugin,
} from 'roosterjs-content-model-plugins';
import {
createContextMenuPlugin,
createTableEditMenuProvider,
} from '../roosterjsReact/contextMenu';

const styles = require('./MainPane.scss');

Expand Down Expand Up @@ -88,6 +98,7 @@ export class MainPane extends React.Component<{}, MainPaneState> {
private ribbonPlugin: RibbonPlugin;
private snapshotPlugin: SnapshotPlugin;
private formatPainterPlugin: FormatPainterPlugin;
private samplePickerPlugin: SamplePickerPlugin;
private snapshots: Snapshots;

protected sidePane = React.createRef<SidePane>();
Expand Down Expand Up @@ -125,6 +136,7 @@ export class MainPane extends React.Component<{}, MainPaneState> {
this.presetPlugin = new PresetPlugin();
this.ribbonPlugin = createRibbonPlugin();
this.formatPainterPlugin = new FormatPainterPlugin();
this.samplePickerPlugin = new SamplePickerPlugin();

this.state = {
showSidePane: window.location.hash != '',
Expand Down Expand Up @@ -327,6 +339,7 @@ export class MainPane extends React.Component<{}, MainPaneState> {
const plugins: EditorPlugin[] = [
this.ribbonPlugin,
this.formatPainterPlugin,
this.samplePickerPlugin,
...this.getToggleablePlugins(),
this.contentModelPanePlugin.getInnerRibbonPlugin(),
this.updateContentPlugin,
Expand Down Expand Up @@ -356,6 +369,7 @@ export class MainPane extends React.Component<{}, MainPaneState> {
dir={this.state.isRtl ? 'rtl' : 'ltr'}
knownColors={this.knownColors}
disableCache={this.state.initState.disableCache}
announcerStringGetter={getAnnouncingString}
/>
)}
</div>
Expand Down Expand Up @@ -478,6 +492,7 @@ export class MainPane extends React.Component<{}, MainPaneState> {
markdownOptions,
autoFormatOptions,
linkTitle,
customReplacements,
} = this.state.initState;
return [
pluginList.autoFormat && new AutoFormatPlugin(autoFormatOptions),
Expand All @@ -500,10 +515,21 @@ export class MainPane extends React.Component<{}, MainPaneState> {
? url => linkTitle.replace(UrlPlaceholder, url)
: linkTitle
),
pluginList.customReplace && new CustomReplacePlugin(customReplacements),
].filter(x => !!x);
}
}

const AnnounceStringMap: Record<KnownAnnounceStrings, string> = {
announceListItemBullet: 'Auto corrected Bullet',
announceListItemNumbering: 'Auto corrected {0}',
announceOnFocusLastCell: 'Warning, pressing tab here adds an extra row.',
};

function getAnnouncingString(key: KnownAnnounceStrings) {
return AnnounceStringMap[key];
}

export function mount(parent: HTMLElement) {
ReactDOM.render(<MainPane />, parent);
}
206 changes: 206 additions & 0 deletions demo/scripts/controlsV2/plugins/SamplePickerPlugin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
import * as React from 'react';
import { Callout } from '@fluentui/react/lib/Callout';
import { DOMInsertPoint } from 'roosterjs-content-model-types';
import { IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu';
import { mergeStyles } from '@fluentui/react/lib/Styling';
import { ReactEditorPlugin, UIUtilities } from '../roosterjsReact/common';
import {
PickerDirection,
PickerHandler,
PickerHelper,
PickerPlugin,
PickerSelectionChangMode,
getDOMInsertPointRect,
} from 'roosterjs-content-model-plugins';
import {
createContentModelDocument,
createEntity,
createParagraph,
} from 'roosterjs-content-model-dom';

const itemStyle = mergeStyles({
height: '20px',
margin: '4px',
padding: '4px',
minWidth: '200px',
});

const selectedItemStyle = mergeStyles({
backgroundColor: 'blue',
color: 'white',
fontWeight: 'bold',
});

export class SamplePickerPlugin extends PickerPlugin implements ReactEditorPlugin {
private pickerHandler: SamplePickerHandler;

constructor() {
const pickerHandler = new SamplePickerHandler();
super('@', pickerHandler);

this.pickerHandler = pickerHandler;
}

setUIUtilities(uiUtilities: UIUtilities): void {
this.pickerHandler.setUIUtilities(uiUtilities);
}
}

class SamplePickerHandler implements PickerHandler {
private uiUtilities: UIUtilities;
private index = 0;
private ref: IPickerMenu | null = null;
private queryString: string;
private items: IContextualMenuItem[] = [];
private onClose: (() => void) | null = null;
private helper: PickerHelper | null = null;

onInitialize(helper: PickerHelper) {
this.helper = helper;
}

onDispose() {
this.helper = null;
}

setUIUtilities(uiUtilities: UIUtilities): void {
this.uiUtilities = uiUtilities;
}

onTrigger(queryString: string, pos: DOMInsertPoint): PickerDirection | null {
this.index = 0;
this.queryString = queryString;
this.items = buildItems(queryString, this.index);

const rect = getDOMInsertPointRect(this.helper.editor.getDocument(), pos);

if (rect) {
this.onClose = this.uiUtilities.renderComponent(
<PickerMenu
x={rect.left}
y={(rect.bottom + rect.top) / 2}
ref={ref => (this.ref = ref)}
items={this.items}
/>
);
return 'vertical';
} else {
return null;
}
}

onClosePicker() {
this.onClose?.();
this.onClose = null;
}

onSelectionChanged(mode: PickerSelectionChangMode): void {
switch (mode) {
case 'first':
case 'firstInRow':
case 'previousPage':
this.index = 0;
break;

case 'last':
case 'lastInRow':
case 'nextPage':
this.index = 4;
break;

case 'previous':
this.index = this.index - 1;

if (this.index < 0) {
this.index = 4;
}

break;

case 'next':
this.index = (this.index + 1) % 5;
break;
}

this.items = buildItems(this.queryString, this.index);
this.ref?.setMenuItems(this.items);
}

onSelect(): void {
const text = this.items[this.index]?.text;

if (text) {
const span = this.helper.editor.getDocument().createElement('span');
span.textContent = '@' + text;
span.style.textDecoration = 'underline';
span.style.color = 'blue';

const entity = createEntity(span, true /*isReadonly*/, {}, 'TEST_ENTITY');
const paragraph = createParagraph();
const doc = createContentModelDocument();

paragraph.segments.push(entity);
doc.blocks.push(paragraph);

this.helper.replaceQueryString(
doc,
{
changeSource: 'SamplePicker',
},
true /*canUndoByBackspace*/
);
}

this.onClose?.();
this.onClose = null;
this.ref = null;
this.helper.closePicker();
}

onQueryStringChanged(queryString: string): void {
this.queryString = queryString;

if (queryString.length > 100 || queryString.split(' ').length > 4) {
// Querystring is too long, so close picker
this.helper.closePicker();
} else {
this.items = buildItems(this.queryString, this.index);
this.ref?.setMenuItems(this.items);
}
}
}

function buildItems(queryString: string, index: number): IContextualMenuItem[] {
return [1, 2, 3, 4, 5].map((x, i) => ({
key: 'item' + i,
text: queryString.substring(1) + ' item ' + x,
checked: i == index,
}));
}

interface IPickerMenu {
setMenuItems: (items: IContextualMenuItem[]) => void;
}

const PickerMenu = React.forwardRef(
(
props: { x: number; y: number; items: IContextualMenuItem[] },
ref: React.Ref<IPickerMenu>
) => {
const [items, setItems] = React.useState<IContextualMenuItem[]>(props.items);

React.useImperativeHandle(ref, () => ({
setMenuItems: setItems,
}));

return (
<Callout target={{ left: props.x, top: props.y }} isBeakVisible={false} gapSpace={10}>
{items.map(item => (
<div className={itemStyle + (item.checked ? ' ' + selectedItemStyle : '')}>
{item.text}
</div>
))}
</Callout>
);
}
);
17 changes: 2 additions & 15 deletions demo/scripts/controlsV2/plugins/createLegacyPlugins.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Announce, CustomReplace, ImageEdit } from 'roosterjs-editor-plugins';
import { EditorPlugin as LegacyEditorPlugin, KnownAnnounceStrings } from 'roosterjs-editor-types';
import { EditorPlugin as LegacyEditorPlugin } from 'roosterjs-editor-types';
import { ImageEdit } from 'roosterjs-editor-plugins';
import { LegacyPluginList, OptionState } from '../sidePane/editorOptions/OptionState';

export function createLegacyPlugins(initState: OptionState): LegacyEditorPlugin[] {
Expand All @@ -12,20 +12,7 @@ export function createLegacyPlugins(initState: OptionState): LegacyEditorPlugin[
applyChangesOnMouseUp: initState.applyChangesOnMouseUp,
})
: null,
customReplace: pluginList.customReplace ? new CustomReplace() : null,
announce: pluginList.announce ? new Announce(getDefaultStringsMap()) : null,
};

return Object.values(plugins).filter(x => !!x);
}

function getDefaultStringsMap(): Map<KnownAnnounceStrings, string> {
return new Map<KnownAnnounceStrings, string>([
[KnownAnnounceStrings.AnnounceListItemBullet, 'Autocorrected Bullet'],
[KnownAnnounceStrings.AnnounceListItemNumbering, 'Autocorrected {0}'],
[
KnownAnnounceStrings.AnnounceOnFocusLastCell,
'Warning, pressing tab here adds an extra row.',
],
]);
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import * as React from 'react';
import { ButtonKeys, Buttons } from '../utils/buttons';
import { Callout, DirectionalHint } from '@fluentui/react/lib/Callout';
import { getDOMInsertPointRect } from 'roosterjs-content-model-plugins';
import { getLocalizedString } from '../../common/index';
import { getObjectKeys } from 'roosterjs-content-model-dom';
import { getPositionRect } from '../utils/getPositionRect';
import { Icon } from '@fluentui/react/lib/Icon';
import { IconButton } from '@fluentui/react/lib/Button';
import { memoizeFunction } from '@fluentui/react/lib/Utilities';
import { mergeStyleSets } from '@fluentui/react/lib/Styling';
import { renderReactComponent } from '../../common/utils/renderReactComponent';
import { useTheme } from '@fluentui/react/lib/Theme';
import { useWindow } from '@fluentui/react/lib/WindowProvider';
import type { LocalizedStrings, UIUtilities } from '../../common/index';
import type { Theme } from '@fluentui/react/lib/Theme';
import type { PasteOptionButtonKeys, PasteOptionStringKeys } from '../type/PasteOptionStringKeys';
Expand Down Expand Up @@ -106,7 +107,7 @@ const PasteOptionComponent = React.forwardRef(function PasteOptionFunc(
const classNames = getPasteOptionClassNames(theme);
const [selectedKey, setSelectedKey] = React.useState<PasteOptionButtonKeys | null>(null);

const rect = getPositionRect(container, offset);
const rect = getDOMInsertPointRect(useWindow().document, { node: container, offset });
const target = rect && { x: props.isRtl ? rect.left : rect.right, y: rect.bottom };

React.useImperativeHandle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ export function Rooster(props: RoosterProps) {
}, [inDarkMode]);

const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(props, divProperties);
return <div ref={editorDiv} tabIndex={0} {...(divProps || {})}></div>;
return (
<div
ref={editorDiv}
tabIndex={0}
role="textbox"
aria-multiline="true"
{...(divProps || {})}></div>
);
}

function defaultEditorCreator(div: HTMLDivElement, options: EditorOptions) {
Expand Down
Loading
Loading