forked from microsoft/roosterjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into xiaozhe/test/model2dom-in-batches
- Loading branch information
Showing
77 changed files
with
45,088 additions
and
39,285 deletions.
There are no files selected for viewing
59 changes: 29 additions & 30 deletions
59
demo/scripts/controlsV2/demoButtons/setBulletedListStyleButton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
import { BulletListType } from 'roosterjs-content-model-dom'; | ||
import { setListStyle } from 'roosterjs-content-model-api'; | ||
import type { RibbonButton } from 'roosterjs-react'; | ||
|
||
const dropDownMenuItems = { | ||
[BulletListType.Disc]: 'Disc', | ||
[BulletListType.Dash]: 'Dash', | ||
[BulletListType.Square]: 'Square', | ||
[BulletListType.ShortArrow]: 'ShortArrow', | ||
[BulletListType.LongArrow]: 'LongArrow', | ||
[BulletListType.UnfilledArrow]: 'UnfilledArrow', | ||
[BulletListType.Hyphen]: 'Hyphen', | ||
[BulletListType.DoubleLongArrow]: 'DoubleLongArrow', | ||
[BulletListType.Circle]: 'Circle', | ||
}; | ||
|
||
export const setBulletedListStyleButton: RibbonButton<'ribbonButtonBulletedListStyle'> = { | ||
key: 'ribbonButtonBulletedListStyle', | ||
dropDownMenu: { items: dropDownMenuItems }, | ||
unlocalizedText: 'Set unordered list style', | ||
iconName: 'BulletedList', | ||
isDisabled: formatState => !formatState.isBullet, | ||
onClick: (editor, key) => { | ||
const value = parseInt(key); | ||
|
||
setListStyle(editor, { | ||
unorderedStyleType: value, | ||
}); | ||
}, | ||
}; | ||
import { BulletListType } from 'roosterjs-content-model-dom'; | ||
import { setListStyle } from 'roosterjs-content-model-api'; | ||
import type { RibbonButton } from 'roosterjs-react'; | ||
|
||
const dropDownMenuItems = { | ||
[BulletListType.Disc]: 'Disc', | ||
[BulletListType.Dash]: 'Dash', | ||
[BulletListType.Square]: 'Square', | ||
[BulletListType.ShortArrow]: 'ShortArrow', | ||
[BulletListType.LongArrow]: 'LongArrow', | ||
[BulletListType.UnfilledArrow]: 'UnfilledArrow', | ||
[BulletListType.Hyphen]: 'Hyphen', | ||
[BulletListType.Circle]: 'Circle', | ||
}; | ||
|
||
export const setBulletedListStyleButton: RibbonButton<'ribbonButtonBulletedListStyle'> = { | ||
key: 'ribbonButtonBulletedListStyle', | ||
dropDownMenu: { items: dropDownMenuItems }, | ||
unlocalizedText: 'Set unordered list style', | ||
iconName: 'BulletedList', | ||
isDisabled: formatState => !formatState.isBullet, | ||
onClick: (editor, key) => { | ||
const value = parseInt(key); | ||
|
||
setListStyle(editor, { | ||
unorderedStyleType: value, | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.