Skip to content

Commit

Permalink
Bump version 9.3.1 -> 9.4 (#2658)
Browse files Browse the repository at this point in the history
* code suport

* markdown

* adjust

* demo site

* WIP

* fix code pen

* fix demo site

* Handle Tab key on whole table selection or last cell on Edit Plugin (#2536)

* Implement indent whole table

* implement tab on last cell new row

* add Table selection and single cell handling

* export clearSelectedCells

* undefined check, simplify

* add tests

* add test for list in table edge case

* Fix seelection on void element (#2551)

* port hyphen

* Implement movement with Tab key inside Table (#2529)

* implement tab movement, tests

* remove unused variable

* fix name, normalisation, add test

* fix wrong parethesis

* restore normalizePos

* fix tests

* add formatTextSegmentBeforeSelectionMarker

* Improve backspace on list (#2555)

* fix selection with ctrl+a

* refactor code using formatTextSegmentBeforeSelectionMarkerTest

* remove getLinkSegment

* Set default format in demo site (#2559)

* clean demo site

* clean

* Enable selecting image when the only element in the range is an Image (#2554)

* init

* Address comment

* Reuse isReverted from Range Selection

* Fix build

* Fix build

* Unselect image when Up or Down, or it remains selected

* remove unneeded changes and improve name of tests

* Update

---------

Co-authored-by: Julia Roldi <[email protected]>

* fix markdown plugin

* Port Hyperlink plugin (#2560)

* Port Hyperlink plugin

* improve

---------

Co-authored-by: Bryan Valverde U <[email protected]>

* export formatTextSegmentBeforeSelectionMarker

* fix build

* Prevent ScrollTop to be lost when the focus is done to the editor (#2564)

* init

* init

---------

Co-authored-by: Julia Roldi <[email protected]>

* Fix 265959: extra empty line generated when get plain text (#2566)

Co-authored-by: Bryan Valverde U <[email protected]>

* Fix #2500 Hyperlink misses color (#2570)

* Fix #2500

* fix test

* mac shortcuts

* fix test

* restore selection (#2577)

* fix: on webkit-based applications, when the selection is empty, focus will cause the window to scroll to the top (#2571)

Co-authored-by: Julia Roldi <[email protected]>
Co-authored-by: Jiuqing Song <[email protected]>

* Port PickerPlugin (#2569)

* Port PickerPlugin

* fix buid

* Improve

* fix build

* Improve

* Improve

* add test

* Improve

* adjust image

* fix test

* fixes

* remove

* Preserve reverted selection info in Content Model (#2580)

* Preserve reverted selection info in Content Model

* improve

* fix empty text

* trigger Events

* Allow Shift+Delete to Cut (#2585)

* Allow Shift+Delete to Cut

* improve

* change source

* fix build

* Fix #2584: Safari context menu event causes selection to be expanded (#2588)

* Fix #2584: Safari context menu event causes selection to be expanded

* fix test

* Port AnnouncePlugin step 1: refactor list number code (#2589)

* test

* refactor

* fix demo site

* Select image after inserting it (#2593)

* Focus image after insertion

* Revert "Focus image after insertion"

This reverts commit 887c9e5.

* Use setSelection

* Port AnnouncePlugin Step 2: Add announce core API (#2591)

* Port AnnouncePlugin step 1: refactor list number code

* Port AnnouncePlugin step 2

---------

Co-authored-by: Bryan Valverde U <[email protected]>

* WIP

* custom replace

* Fix table mover selector (#2596)

* fix edge case tables and trigger contentchanged

* revert event

* trigger autolink

* wip

* Port AnnouncePlugin step 3: Add announce features for list and table (#2592)

* Port AnnouncePlugin step 1: refactor list number code

* Port AnnouncePlugin step 2

* Port AnnouncePlugin ste 3

* add test

* Fix #2575 Entity delimiter cursor moving (#2581)

* Preserve reverted selection info in Content Model

* Entity delimiter cursor moving (#2575)

* improve

* Add test

* add test

* Allow customizability for table editors (#2603)

* init

* Simplify type callback

* Also allow using Ctrl-Shift-Z on Windows (#2607)

* Also allow using Ctrl-Shift-Z on Windows

* Fix failing test

* Fix broken test

* Fix failing test

* Keep and deprecate old ShortcutRedoMacOS

* Remove test not needed anymore

* Wip

* add span

* fix test

* changes

* remove code

* fixes

* fixes

* Hide watermark when input with IME (#2611)

* Updated watermark property access modifier to protected (#2614)

* Move Content Model type files into contentModel folder (#2602)

* Fix 262779 (#2600)

* Add undo snapshot when mouse down if there is new content after last undo snapshot (#2604)

* Fix #2601 allow customization when convert from content model to plain text (#2605)

* Fix #2601 allow customization when convert from content model to plain text

* Improve

* fix test

* fix build

* Scroll caret into view when call formatContentModel (#2617)

* Perf step 0: Do not allow getting connected model (#2615)

* Perf: Do not allow getting connected model

* fix build

* fix build

* debug firefox options (#2620)

* Updated isModelEmptyFast to consider changed indentation as not empty string (#2625)

* Updated isModelEmptyFast

* Tests fix

* Add parameter to Disable table edit features (#2624)

* disableFeatures, renaming

* Export Table Feature Ids

* Modify and create tests

* move Id to respective feature, add tests, cleanup

* export feature names

* TableEditFeatureName

* Implement Table Movement (#2599)

* isNodeEditor

* domHelper test

* implementation and test fix

* fix undefined

* isNodeEditor

* implement live focus, restore initial selection on cancel

* broswer drag and drop attempt

* use getNodePositionFromEvent, add move cursor while dragging

* restore class

* fix import

* restore DOMHelper

* remove unneeded snapshots and checks, add copy feature

* cleanup

* fix merge

* cursor change on copy,  remove onEditorCreated

* fix disposal issue

* removed unused forEach,

* export formatInsertPointWithContentModel

* use formatInsertPointWithContentModel for table movement

* reorder function

* Add tests for table movement

* optimisations and exports for testing

* restore final table selection after move

* added test

* fix and add more tests

* comments, remove copy feature, fix tests

* fix test

* fix test

* implement disable movement

* Do not apply Table selection if table is not editable (#2628)

* Fix #2633 `scrollCaretIntoView` causes unexpected scroll (#2634)

* Fix #2633

* add comment

* Added tableCellSelectionBackgroundColor option (#2640)

* Added tableCellSelectionBackgroundColor option

* Fixed a test

* Tests fix

* Tests fix

* Add dark color handling for table and image selection (#2647)

* Added tableCellSelectionBackgroundColor option

* Fixed a test

* Tests fix

* Tests fix

* Add dark color check

* Add more tests

* Updated login and tests

* Functionality update

* Update checks

* Added transparent options test

* Code review fixes

* Fix cursor jump issue when applying Gboard suggestions (#2638)

* fix cursor issue

* resolve comment

---------

Co-authored-by: Jiuqing Song <[email protected]>

* Content Model Cache improvement - Step 1: Introduce Readonly types and mutate utility (#2629)

* Readonly types (3rd try

* Improve

* fix build

* Improve

* improve

* Improve

* Add shallow mutable type

* improve

* Improve

* improve

* improve

* add test

* improve

* improve

* improve

* test

* test

* link preview

* remove auto format plugin code

* Content Model Cache improvement - Step 2: Prepare utility functions (#2641)

* Readonly types (3rd try

* Improve

* fix build

* Improve

* improve

* Improve

* Add shallow mutable type

* improve

* Improve

* improve

* improve

* add test

* Readonly types step 2

* add test

* Improve

* improve

* improve

* improve

* Improve

* fix test

* improve

* Content Model Cache improvement - Step 3: Let creators accept readonly types (#2642)

* Readonly types (3rd try

* Improve

* fix build

* Improve

* improve

* Improve

* Add shallow mutable type

* improve

* Improve

* improve

* improve

* add test

* Readonly types step 3

* improve

* improve

* improve

* Content Model Cache improvement - Step 4: Port "readonly" functions (#2643)

* Readonly types (3rd try

* Improve

* fix build

* Improve

* improve

* Improve

* Add shallow mutable type

* improve

* Improve

* improve

* improve

* add test

* Readonly types step 2

* Readonly types step 3

* Readonly type step 4

* add test

* Improve

* improve

* improve

* improve

* improve

* Improve

* improve

* fix test

* improve

* Fix Table first column (#2652)

* create Table Options button for demo

* fix setFirstColumnFormat

* fix dependency

* restore background color check for first column

* remove logs, move TableOptionsMenuItemStringKey, isHeader

* remove import

* Content Model Cache improvement - Step 5: Port roosterjs-content-model-dom package (#2648)

* Readonly types (3rd try

* Improve

* fix build

* Improve

* improve

* Improve

* Add shallow mutable type

* improve

* Improve

* improve

* improve

* add test

* Readonly types step 2

* Readonly types step 3

* Readonly type step 4

* add test

* Improve

* improve

* improve

* Readonly types step 5: dom package

* add change

* improve

* improve

* Improve

* improve

* fix test

* Improve

* fix build

* improve

* Optimise content model table fetching for Table Edit Plugins  (#2656)

* optimise cmTable fetching

* create getCMTableFromTable

* Fix normalisation and First Column issues (#2657)

* optimise cmTable fetching

* First Column not apply to very first cell

* fix normalisation

* fix first cell color for First Column

* fix and add test

* fix test

* fix tests

* fix test and hasHeaderRow case

* reorder rows

* bump

* bump

---------

Co-authored-by: Júlia Roldi <[email protected]>
Co-authored-by: Julia Roldi <[email protected]>
Co-authored-by: Jiuqing Song <[email protected]>
Co-authored-by: Bryan Valverde U <[email protected]>
Co-authored-by: Rain-Zheng <[email protected]>
Co-authored-by: 庄黛淳华 <[email protected]>
Co-authored-by: florian-msft <[email protected]>
Co-authored-by: vhuseinova-msft <[email protected]>
  • Loading branch information
9 people committed May 24, 2024
1 parent 5638d0e commit 10c1d9d
Show file tree
Hide file tree
Showing 161 changed files with 4,315 additions and 987 deletions.
13 changes: 0 additions & 13 deletions demo/scripts/controlsV2/demoButtons/setTableHeaderButton.ts

This file was deleted.

53 changes: 53 additions & 0 deletions demo/scripts/controlsV2/demoButtons/tableOptionsButton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { formatTable, getFormatState } from 'roosterjs-content-model-api';
import { TableMetadataFormat } from 'roosterjs-content-model-types';
import type { RibbonButton } from '../roosterjsReact/ribbon';

const TableEditOperationMap: Partial<Record<
TableOptionsMenuItemStringKey,
keyof TableMetadataFormat
>> = {
menuNameTableSetHeaderRow: 'hasHeaderRow',
menuNameTableSetFirstColumn: 'hasFirstColumn',
menuNameTableSetBandedColumns: 'hasBandedColumns',
menuNameTableSetBandedRows: 'hasBandedRows',
};

/**
* Key of localized strings of Table Options menu items
*/
type TableOptionsMenuItemStringKey =
| 'menuNameTableSetHeaderRow'
| 'menuNameTableSetFirstColumn'
| 'menuNameTableSetBandedColumns'
| 'menuNameTableSetBandedRows';

export const tableOptionsButton: RibbonButton<
'ribbonButtonTableOptions' | TableOptionsMenuItemStringKey
> = {
key: 'ribbonButtonTableOptions',
iconName: '',
unlocalizedText: 'Options',
isDisabled: formatState => !formatState.isInTable,
dropDownMenu: {
items: {
menuNameTableSetHeaderRow: 'Header Row',
menuNameTableSetFirstColumn: 'First Column',
menuNameTableSetBandedColumns: 'Banded Columns',
menuNameTableSetBandedRows: 'Banded Rows',
},
},
onClick: (editor, key) => {
if (key != 'ribbonButtonTableOptions') {
const format = getFormatState(editor);
const tableFormatProperty = TableEditOperationMap[key];
formatTable(
editor,
{ [tableFormatProperty]: !format.tableFormat[tableFormatProperty] },
true /*keepCellShade*/
);
}
},
commandBarProperties: {
iconOnly: false,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { ApiPaneProps } from '../ApiPaneProps';
import { insertEntity } from 'roosterjs-content-model-api';
import { trustedHTMLHandler } from '../../../../utils/trustedHTMLHandler';
import {
ContentModelBlockGroup,
ContentModelEntity,
InsertEntityOptions,
ReadonlyContentModelBlockGroup,
} from 'roosterjs-content-model-types';

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

function findAllEntities(group: ContentModelBlockGroup, result: ContentModelEntity[]) {
function findAllEntities(group: ReadonlyContentModelBlockGroup, result: ContentModelEntity[]) {
group.blocks.forEach(block => {
switch (block.blockType) {
case 'BlockGroup':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cloneModel } from 'roosterjs-content-model-dom';
import { ContentModelPane, ContentModelPaneProps } from './ContentModelPane';
import { createRibbonPlugin, RibbonButton, RibbonPlugin } from '../../roosterjsReact/ribbon';
import { getRefreshButton } from './buttons/refreshButton';
Expand Down Expand Up @@ -70,8 +71,9 @@ export class ContentModelPanePlugin extends SidePanePluginImpl<
this.getComponent(component => {
this.editor.formatContentModel(
model => {
component.setContentModel(model);
setCurrentContentModel(model);
const clonedModel = cloneModel(model);
component.setContentModel(clonedModel);
setCurrentContentModel(clonedModel);

return false;
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import * as React from 'react';
import { ContentModelWithDataset } from 'roosterjs-content-model-types';
import { FormatRenderer } from './utils/FormatRenderer';
import {
ContentModelWithDataset,
ShallowMutableContentModelWithDataset,
} from 'roosterjs-content-model-types';

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

export function MetadataView<T>(props: {
model: ContentModelWithDataset<T>;
renderers: FormatRenderer<T>[];
updater: (model: ContentModelWithDataset<T>, callback: (format: T | null) => T | null) => void;
updater: (
model: ShallowMutableContentModelWithDataset<T>,
callback: (format: T | null) => T | null
) => void;
}) {
const { model, renderers, updater } = props;
const metadata = React.useRef<T>(null);
Expand Down
6 changes: 3 additions & 3 deletions demo/scripts/controlsV2/tabs/ribbonButtons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { setBulletedListStyleButton } from '../demoButtons/setBulletedListStyleB
import { setHeadingLevelButton } from '../roosterjsReact/ribbon/buttons/setHeadingLevelButton';
import { setNumberedListStyleButton } from '../demoButtons/setNumberedListStyleButton';
import { setTableCellShadeButton } from '../demoButtons/setTableCellShadeButton';
import { setTableHeaderButton } from '../demoButtons/setTableHeaderButton';
import { spaceAfterButton, spaceBeforeButton } from '../demoButtons/spaceBeforeAfterButtons';
import { spacingButton } from '../demoButtons/spacingButton';
import { strikethroughButton } from '../roosterjsReact/ribbon/buttons/strikethroughButton';
Expand All @@ -47,6 +46,7 @@ import { tableBorderApplyButton } from '../demoButtons/tableBorderApplyButton';
import { tableBorderColorButton } from '../demoButtons/tableBorderColorButton';
import { tableBorderStyleButton } from '../demoButtons/tableBorderStyleButton';
import { tableBorderWidthButton } from '../demoButtons/tableBorderWidthButton';
import { tableOptionsButton } from '../demoButtons/tableOptionsButton';
import { tabNames } from './getTabs';
import { textColorButton } from '../roosterjsReact/ribbon/buttons/textColorButton';
import { underlineButton } from '../roosterjsReact/ribbon/buttons/underlineButton';
Expand Down Expand Up @@ -79,7 +79,7 @@ const tableButtons: RibbonButton<any>[] = [
insertTableButton,
formatTableButton,
setTableCellShadeButton,
setTableHeaderButton,
tableOptionsButton,
tableInsertButton,
tableDeleteButton,
tableBorderApplyButton,
Expand Down Expand Up @@ -169,7 +169,7 @@ const allButtons: RibbonButton<any>[] = [
listStartNumberButton,
formatTableButton,
setTableCellShadeButton,
setTableHeaderButton,
tableOptionsButton,
tableInsertButton,
tableDeleteButton,
tableMergeButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ import {
createListLevel,
getOperationalBlocks,
isBlockGroupOfType,
mutateBlock,
parseValueWithUnit,
updateListMetadata,
} from 'roosterjs-content-model-dom';
import type {
ContentModelBlock,
ContentModelBlockFormat,
ContentModelBlockGroup,
ContentModelDocument,
ContentModelListItem,
ContentModelListLevel,
FormatContentModelContext,
ReadonlyContentModelBlock,
ReadonlyContentModelBlockGroup,
ReadonlyContentModelDocument,
ReadonlyContentModelListItem,
} from 'roosterjs-content-model-types';

const IndentStepInPixel = 40;
Expand All @@ -26,7 +28,7 @@ const IndentStepInPixel = 40;
* Set indentation for selected list items or paragraphs
*/
export function setModelIndentation(
model: ContentModelDocument,
model: ReadonlyContentModelDocument,
indentation: 'indent' | 'outdent',
length: number = IndentStepInPixel,
context?: FormatContentModelContext
Expand All @@ -37,7 +39,7 @@ export function setModelIndentation(
['TableCell']
);
const isIndent = indentation == 'indent';
const modifiedBlocks: ContentModelBlock[] = [];
const modifiedBlocks: ReadonlyContentModelBlock[] = [];

paragraphOrListItem.forEach(({ block, parent, path }) => {
if (isBlockGroupOfType<ContentModelListItem>(block, 'ListItem')) {
Expand Down Expand Up @@ -89,12 +91,12 @@ export function setModelIndentation(
}
}
} else if (block) {
let currentBlock: ContentModelBlock = block;
let currentParent: ContentModelBlockGroup = parent;
let currentBlock: ReadonlyContentModelBlock = block;
let currentParent: ReadonlyContentModelBlockGroup = parent;

while (currentParent && modifiedBlocks.indexOf(currentBlock) < 0) {
const index = path.indexOf(currentParent);
const { format } = currentBlock;
const { format } = mutateBlock(currentBlock);
const newValue = calculateMarginValue(format, isIndent, length);

if (newValue !== null) {
Expand Down Expand Up @@ -124,7 +126,7 @@ export function setModelIndentation(
return paragraphOrListItem.length > 0;
}

function isSelected(listItem: ContentModelListItem) {
function isSelected(listItem: ReadonlyContentModelListItem) {
return listItem.blocks.some(block => {
if (block.blockType == 'Paragraph') {
return block.segments.some(segment => segment.isSelected);
Expand All @@ -137,9 +139,9 @@ function isSelected(listItem: ContentModelListItem) {
* Otherwise, the margin of the first item will be changed, and the sub list will be created, creating a unintentional margin difference between the list items.
*/
function isMultilevelSelection(
model: ContentModelDocument,
listItem: ContentModelListItem,
parent: ContentModelBlockGroup
model: ReadonlyContentModelDocument,
listItem: ReadonlyContentModelListItem,
parent: ReadonlyContentModelBlockGroup
) {
const listIndex = parent.blocks.indexOf(listItem);
for (let i = listIndex - 1; i >= 0; i--) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import {
deleteSelection,
getClosestAncestorBlockGroupIndex,
setSelection,
mutateBlock,
} from 'roosterjs-content-model-dom';
import type {
ContentModelBlock,
ContentModelBlockGroup,
ContentModelDocument,
ContentModelEntity,
ContentModelParagraph,
FormatContentModelContext,
InsertEntityPosition,
InsertPoint,
ReadonlyContentModelBlock,
ShallowMutableContentModelBlock,
ShallowMutableContentModelBlockGroup,
ShallowMutableContentModelParagraph,
} from 'roosterjs-content-model-types';

/**
Expand All @@ -30,7 +32,7 @@ export function insertEntityModel(
context?: FormatContentModelContext,
insertPointOverride?: InsertPoint
) {
let blockParent: ContentModelBlockGroup | undefined;
let blockParent: ShallowMutableContentModelBlockGroup | undefined;
let blockIndex = -1;
let insertPoint: InsertPoint | null;

Expand All @@ -57,9 +59,10 @@ export function insertEntityModel(
position == 'root'
? getClosestAncestorBlockGroupIndex(path, ['TableCell', 'Document'])
: 0;
blockParent = path[pathIndex];
blockParent = mutateBlock(path[pathIndex]);

const child = path[pathIndex - 1];
const directChild: ContentModelBlock =
const directChild: ReadonlyContentModelBlock =
child?.blockGroupType == 'FormatContainer' ||
child?.blockGroupType == 'General' ||
child?.blockGroupType == 'ListItem'
Expand All @@ -71,16 +74,16 @@ export function insertEntityModel(
}

if (blockIndex >= 0 && blockParent) {
const blocksToInsert: ContentModelBlock[] = [];
let nextParagraph: ContentModelParagraph | undefined;
const blocksToInsert: ShallowMutableContentModelBlock[] = [];
let nextParagraph: ShallowMutableContentModelParagraph | undefined;

if (isBlock) {
const nextBlock = blockParent.blocks[blockIndex];

blocksToInsert.push(entityModel);

if (nextBlock?.blockType == 'Paragraph') {
nextParagraph = nextBlock;
nextParagraph = mutateBlock(nextBlock);
} else if (!nextBlock || nextBlock.blockType == 'Entity' || focusAfterEntity) {
nextParagraph = createParagraph(false /*isImplicit*/, {}, model.format);
nextParagraph.segments.push(createBr(model.format));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
import type { ContentModelBlockGroup, ContentModelListItem } from 'roosterjs-content-model-types';
import type {
ContentModelBlockGroup,
ContentModelListItem,
ReadonlyContentModelBlockGroup,
ReadonlyContentModelListItem,
} from 'roosterjs-content-model-types';

/**
* Search for all list items in the same thread as the current list item
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/
export function findListItemsInSameThread(
group: ContentModelBlockGroup,
currentItem: ContentModelListItem
): ContentModelListItem[] {
): ContentModelListItem[];

/**
* Search for all list items in the same thread as the current list item (Readonly)
* @param model The content model
* @param currentItem The current list item
*/
export function findListItemsInSameThread(
group: ReadonlyContentModelBlockGroup,
currentItem: ReadonlyContentModelListItem
): ReadonlyContentModelListItem[];

export function findListItemsInSameThread(
group: ReadonlyContentModelBlockGroup,
currentItem: ReadonlyContentModelListItem
): ReadonlyContentModelListItem[] {
const items: (ContentModelListItem | null)[] = [];

findListItems(group, items);

return filterListItems(items, currentItem);
}

function findListItems(group: ContentModelBlockGroup, result: (ContentModelListItem | null)[]) {
function findListItems(
group: ReadonlyContentModelBlockGroup,
result: (ReadonlyContentModelListItem | null)[]
) {
group.blocks.forEach(block => {
switch (block.blockType) {
case 'BlockGroup':
Expand Down Expand Up @@ -56,7 +79,7 @@ function findListItems(group: ContentModelBlockGroup, result: (ContentModelListI
});
}

function pushNullIfNecessary(result: (ContentModelListItem | null)[]) {
function pushNullIfNecessary(result: (ReadonlyContentModelListItem | null)[]) {
const last = result[result.length - 1];

if (!last || last !== null) {
Expand All @@ -65,10 +88,10 @@ function pushNullIfNecessary(result: (ContentModelListItem | null)[]) {
}

function filterListItems(
items: (ContentModelListItem | null)[],
currentItem: ContentModelListItem
items: (ReadonlyContentModelListItem | null)[],
currentItem: ReadonlyContentModelListItem
) {
const result: ContentModelListItem[] = [];
const result: ReadonlyContentModelListItem[] = [];
const currentIndex = items.indexOf(currentItem);
const levelLength = currentItem.levels.length;
const isOrderedList = currentItem.levels[levelLength - 1]?.listType == 'OL';
Expand Down Expand Up @@ -131,7 +154,7 @@ function filterListItems(
}

function areListTypesCompatible(
listItems: (ContentModelListItem | null)[],
listItems: (ReadonlyContentModelListItem | null)[],
currentIndex: number,
compareToIndex: number
): boolean {
Expand All @@ -146,7 +169,7 @@ function areListTypesCompatible(
);
}

function hasStartNumberOverride(item: ContentModelListItem, levelLength: number): boolean {
function hasStartNumberOverride(item: ReadonlyContentModelListItem, levelLength: number): boolean {
return item.levels
.slice(0, levelLength)
.some(level => level.format.startNumberOverride !== undefined);
Expand Down
Loading

0 comments on commit 10c1d9d

Please sign in to comment.