-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1990 from microsoft/romasha/versionbump728
Version Bump on 7/28
- Loading branch information
Showing
190 changed files
with
4,020 additions
and
1,325 deletions.
There are no files selected for viewing
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
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
10 changes: 0 additions & 10 deletions
10
demo/scripts/controls/contentModel/components/format/formatPart/ListTypeFormatRenderer.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...ripts/controls/contentModel/components/format/formatPart/TableCellMetadataFormatRender.ts
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...ipts/controls/contentModel/components/format/formatPart/TableCellMetadataFormatRenders.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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createCheckboxFormatRenderer } from '../utils/createCheckboxFormatRenderer'; | ||
import { FormatRenderer } from '../utils/FormatRenderer'; | ||
import { TableCellMetadataFormat } from 'roosterjs-editor-types'; | ||
|
||
export const TableCellMetadataFormatRenders: FormatRenderer<TableCellMetadataFormat>[] = [ | ||
createCheckboxFormatRenderer<TableCellMetadataFormat>( | ||
'BgColorOverride', | ||
format => format.bgColorOverride, | ||
(format, value) => (format.bgColorOverride = value) | ||
), | ||
createCheckboxFormatRenderer<TableCellMetadataFormat>( | ||
'VAlignOverride', | ||
format => format.vAlignOverride, | ||
(format, value) => (format.vAlignOverride = value) | ||
), | ||
]; |
4 changes: 0 additions & 4 deletions
4
demo/scripts/controls/contentModel/components/model/ContentModelListItemView.scss
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,7 +1,3 @@ | ||
.modelListItem { | ||
background-color: #fb7; | ||
} | ||
|
||
.hr { | ||
width: 100%; | ||
} |
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
3 changes: 3 additions & 0 deletions
3
demo/scripts/controls/contentModel/components/model/ContentModelListLevelView.scss
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.modelListLevel { | ||
background-color: #38a; | ||
} |
80 changes: 80 additions & 0 deletions
80
demo/scripts/controls/contentModel/components/model/ContentModelListLevelView.tsx
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import * as React from 'react'; | ||
import { ContentModelView } from '../ContentModelView'; | ||
import { DirectionFormatRenderer } from '../format/formatPart/DirectionFormatRenderer'; | ||
import { FormatRenderer } from '../format/utils/FormatRenderer'; | ||
import { FormatView } from '../format/FormatView'; | ||
import { ListMetadataFormatRenderers } from '../format/formatPart/ListMetadataFormatRenderers'; | ||
import { ListStylePositionFormatRenderer } from '../format/formatPart/ListStylePositionFormatRenderer'; | ||
import { ListThreadFormatRenderers } from '../format/formatPart/ListThreadFormatRenderer'; | ||
import { MarginFormatRenderer } from '../format/formatPart/MarginFormatRenderer'; | ||
import { MetadataView } from '../format/MetadataView'; | ||
import { PaddingFormatRenderer } from '../format/formatPart/PaddingFormatRenderer'; | ||
import { TextAlignFormatRenderer } from '../format/formatPart/TextAlignFormatRenderer'; | ||
import { updateListMetadata } from 'roosterjs-content-model-dom'; | ||
import { useProperty } from '../../hooks/useProperty'; | ||
import { | ||
ContentModelListItemLevelFormat, | ||
ContentModelListLevel, | ||
} from 'roosterjs-content-model-types'; | ||
|
||
const styles = require('./ContentModelListLevelView.scss'); | ||
|
||
const ListLevelFormatRenders: FormatRenderer<ContentModelListItemLevelFormat>[] = [ | ||
...ListThreadFormatRenderers, | ||
DirectionFormatRenderer, | ||
TextAlignFormatRenderer, | ||
MarginFormatRenderer, | ||
PaddingFormatRenderer, | ||
ListStylePositionFormatRenderer, | ||
]; | ||
|
||
export function ContentModelListLevelView(props: { level: ContentModelListLevel }) { | ||
const { level } = props; | ||
const [listType, setListType] = useProperty(level.listType); | ||
const listTypeInput = React.useRef<HTMLSelectElement>(null); | ||
const onListTypeChanged = React.useCallback(() => { | ||
const newValue = listTypeInput.current.value as 'OL' | 'UL'; | ||
|
||
level.listType = newValue; | ||
setListType(newValue); | ||
}, [setListType, level]); | ||
|
||
const getContent = React.useCallback(() => { | ||
return ( | ||
<div> | ||
ListType:{' '} | ||
<select value={listType} onChange={onListTypeChanged} ref={listTypeInput}> | ||
<option value="OL">OL</option> | ||
<option value="UL">UL</option> | ||
</select> | ||
</div> | ||
); | ||
}, [level, listType]); | ||
|
||
const getFormat = React.useCallback(() => { | ||
return <FormatView format={level.format} renderers={ListLevelFormatRenders} />; | ||
}, [level, listType]); | ||
|
||
const getMetadata = React.useCallback(() => { | ||
return ( | ||
<MetadataView | ||
model={level} | ||
renderers={ListMetadataFormatRenderers} | ||
updater={updateListMetadata} | ||
/> | ||
); | ||
}, [level]); | ||
|
||
return ( | ||
<ContentModelView | ||
title="ListLevel" | ||
subTitle={listType} | ||
isExpanded={false} | ||
className={styles.modelListLevel} | ||
jsonSource={level} | ||
getContent={getContent} | ||
getFormat={getFormat} | ||
getMetadata={getMetadata} | ||
/> | ||
); | ||
} |
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
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
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
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.