-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Content Model List step 5: Add model format API (#1298) * Content Model: improve demo * add more fix * Refactor create content model interfaces * Remove duplicated TableCellMetadataFormat * Add List types and views * Add format handlers for list * Add list processors and test * Add handlers for list * fix test * fix test * bug fix * remove unnecessary change * improve * merge and fix * Content Model List step 5: Add model format API * Content Model List step 6: Public API (#1299) * Content Model: improve demo * add more fix * Refactor create content model interfaces * Remove duplicated TableCellMetadataFormat * Add List types and views * Add format handlers for list * Add list processors and test * Add handlers for list * fix test * fix test * bug fix * remove unnecessary change * improve * merge and fix * Content Model List step 5: Add model format API * Content Model List step 6: Public API * Content Model Table bug fixes (#1305) * Content Model Table bug fixes * fix test * Content Model List: Support "type" attribute of OL element (#1307) * Content Model List: support "type" property of OL * fix test * Enable strict mode for "roosterjs-editor-core/lib/corePlugins" (#1287) * Enable strict mode * Fix tests * Revert remove typeAfterLink * Remove optional chaining * editor's contains and select can take null * Update getDarkColor typings * Fix context menu not working issue (#1309) * Fix context menu not working issue * fix build * Update getSelectionRangeEx typings to match desc (#1312) * Update getSelectionRangeEx typings to match desc * Fix build * Revert "Update getSelectionRangeEx typings to match desc (#1312)" (#1317) This reverts commit a260017. * Finish strict mode change for core package (#1318) * Content Model Entity step 1 (#1313) * trigger selection when click * Content Model Entity step 2: Add implementation code (#1314) * Content Model Entity step 1 * Content Model Entity step 2 * Content Model List bug fix (#1320) * Content Model List bug fix * add test case * Support block format in Content Model step 1 (#1323) * Support block format in Content Model step 1 * fix build * Enable strict mode on "roosterjs-editor-plugins" - Phase 1 (#1289) * Strict AutoFormat & ContextMenu * Strict CustomReplace * CutPasteListChain plugin * Allow nullish dom attribute value * Strict HyperLink * Strict Watermark * Use individual tsconfigs * Check this.editor at start of onPluginEvent * Support block format in Content Model step 2 (#1324) * Support block format in Content Model step 1 * Support block format in Content Model step 2 * fix build * fix test * Allow insert entity on region root (#1316) * Allow insert entity on region root * improve * fix comment * Change version * 8.34.0 Co-authored-by: Jiuqing Song <jisong@microsoft.com> Co-authored-by: Júlia Roldi <juliaroldi@microsoft.com> Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
- Loading branch information
1 parent
fd08bb5
commit e71c96b
Showing
143 changed files
with
2,247 additions
and
546 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
demo/scripts/controls/contentModel/components/format/formatPart/DirectionFormatRenderers.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,17 @@ | ||
import { createDropDownFormatRenderer } from '../utils/createDropDownFormatRenderer'; | ||
import { DirectionFormat } from 'roosterjs-content-model'; | ||
|
||
export const DirectionFormatRenderers = [ | ||
createDropDownFormatRenderer<DirectionFormat, 'ltr' | 'rtl'>( | ||
'Direction', | ||
['ltr', 'rtl'], | ||
format => format.direction, | ||
(format, value) => (format.direction = value) | ||
), | ||
createDropDownFormatRenderer<DirectionFormat, 'start' | 'center' | 'end'>( | ||
'Text align', | ||
['start', 'center', 'end'], | ||
format => format.textAlign, | ||
(format, value) => (format.textAlign = value) | ||
), | ||
]; |
12 changes: 0 additions & 12 deletions
12
demo/scripts/controls/contentModel/components/format/formatPart/TextAlignFormatRenderer.ts
This file was deleted.
Oops, something went wrong.
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/ContentModelEntityView.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 @@ | ||
.modelEntity { | ||
background-color: #3b2; | ||
} |
67 changes: 67 additions & 0 deletions
67
demo/scripts/controls/contentModel/components/model/ContentModelEntityView.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,67 @@ | ||
import * as React from 'react'; | ||
import { ContentModelEntity } from 'roosterjs-content-model'; | ||
import { ContentModelView } from '../ContentModelView'; | ||
import { useProperty } from '../../hooks/useProperty'; | ||
|
||
const styles = require('./ContentModelEntityView.scss'); | ||
|
||
export function ContentModelEntityView(props: { entity: ContentModelEntity }) { | ||
const { entity } = props; | ||
|
||
const [id, setId] = useProperty(entity.id); | ||
const [isReadonly, setIsReadonly] = useProperty(entity.isReadonly); | ||
const [type, setType] = useProperty(entity.type); | ||
|
||
const idTextBox = React.useRef<HTMLInputElement>(null); | ||
const isReadonlyCheckBox = React.useRef<HTMLInputElement>(null); | ||
const typeTextBox = React.useRef<HTMLInputElement>(null); | ||
|
||
const onIdChange = React.useCallback(() => { | ||
const newValue = idTextBox.current.value; | ||
entity.id = newValue; | ||
setId(newValue); | ||
}, [id, setId]); | ||
const onTypeChange = React.useCallback(() => { | ||
const newValue = typeTextBox.current.value; | ||
entity.type = newValue; | ||
setType(newValue); | ||
}, [type, setType]); | ||
const onReadonlyChange = React.useCallback(() => { | ||
const newValue = isReadonlyCheckBox.current.checked; | ||
entity.isReadonly = newValue; | ||
setIsReadonly(newValue); | ||
}, [id, setId]); | ||
|
||
const getContent = React.useCallback(() => { | ||
return ( | ||
<> | ||
<div> | ||
Id: <input type="text" value={id} ref={idTextBox} onChange={onIdChange} /> | ||
</div> | ||
<div> | ||
Type: | ||
<input type="text" value={type} ref={typeTextBox} onChange={onTypeChange} /> | ||
</div> | ||
<div> | ||
IsReadonly: | ||
<input | ||
type="checkbox" | ||
checked={isReadonly} | ||
ref={isReadonlyCheckBox} | ||
onChange={onReadonlyChange} | ||
/> | ||
</div> | ||
</> | ||
); | ||
}, [type, isReadonly, id]); | ||
|
||
return ( | ||
<ContentModelView | ||
title="Entity" | ||
subTitle={id} | ||
className={styles.modelEntity} | ||
jsonSource={entity} | ||
getContent={getContent} | ||
/> | ||
); | ||
} |
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
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
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.