-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add tests for image edit * fix build * Move getPasteSource from Plugins to Dom (#1708) * init * try fix tests * Content Model minor fix: Change parameter type (#1720) * Content Model: Fix #1702 Hyperlinking a text doesnt trigger ChangeSource.CreateLink event (#1703) * Content Model: Fix #1702 * fix build * fix test * fix build * Fix #1713 (#1718) * Fix Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode') (#1725) * Fix Unhandled exception * fix test * remove unneeded changes * Decouple logic from Table Cell Selection into smaller files. (#1722) * Refactor * Add comment * Allow Content Model API to remove image border (#1733) * Modify API to allow accepting null * New demo button * Testing * Content Model: Fix #1684 (#1730) * Content Model: Improve edit plugin (#1728) * Content Model fidelity 1: Support lineHeight in list (#1731) * [1/3] Enable Strict mode in TableCellSelection Utils + Plugin (#1735) Enable Strict mode in Table Cell Selection Utils and the Plugin class * Content Model fidelity improvement 2: Support size in divider (#1732) * Content Model fidelity 2: Support size in divider * fix test * Content Model: Improve default format state (#1743) * Content Model: Improve default format state * add a test case * Add check for empty selectors, and empty CSS rule insertion (#1744) * add check for empty selectors, and empty cssRule * fix test case * Content Model: Fix #1738 delete space issue (#1740) * Content Model: Fix #1738 delete space issue * enable edit plugin in demo site by default * Fix space issue * fix cache behavior * Make additionalTagReplacements allow `null` value type. (#1745) * Fix additionalTagReplacements type in HtmlSanitizerOptions.ts * Make compiler happy * [2/3] Enable Strict mode on KeyDown Handler (#1736) * Table cell selection strict mode 1 * enable strict mode on handleKeyDown * [3/3] Enable Strict mode in Mouse Down Handler + Add Strict mode files (#1737) * Table cell selection strict mode 1 * enable strict mode on handleKeyDown * enable strict mode on mousedown * merge conflicts * Change from undefined to null * Revert "Paste as image feature" - convertPastedContentFromExcel (#1749) * revert only convertPastedContentFromExcel.ts * Leverage Content Model to insert the Pasted content from clipboard (#1716) In order to start using content model to insert clipboard content to the editor we need to do some refactor on some utilities: Move the createPasteFragment logic from roosterjs-editor-core package to roosterjs-editor-dom, so we can also use the logic in roosterjs-content-model. Add a new property to BeforePasteEvent to let other plugins modify the way we process elements in the paste fragment, this will be used later in another PR. Create a new core api createPasteModel that will use the PasteFragment to create and return a content model document. In the ContentModelEditor Class, override the paste function so, instead of using insertContent, use mergeModel function Bugs that may be fixes by leveraging Content Model with this change: #456 #1065 #1322 partially, only the paste part is fixed, copy needs to fixed in another PR. #920 * Don't return focus to editor when blur on image (#1742) * Don't return focus to editor when blur on image * Comment * Content Model fidelity improvement 3: Block format (#1751) * Content Model fidelity improvement 3: Block format * improve * fix test * Add a experimental feature for paste with ContentModel #1758 * 8.46.0 --------- Co-authored-by: Júlia Roldi <[email protected]> Co-authored-by: Bryan Valverde U <[email protected]> Co-authored-by: Julia Roldi <[email protected]> Co-authored-by: Ian Elizondo <[email protected]> Co-authored-by: Andres-CT98 <[email protected]> Co-authored-by: Ruijun Gao <[email protected]>
- Loading branch information
1 parent
a853b07
commit 6ebd1e8
Showing
190 changed files
with
6,721 additions
and
2,284 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
19 changes: 19 additions & 0 deletions
19
demo/scripts/controls/ribbonButtons/contentModel/imageBorderRemoveButton.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,19 @@ | ||
import { isContentModelEditor } from 'roosterjs-content-model'; | ||
import { RibbonButton } from 'roosterjs-react'; | ||
import { setImageBorder } from 'roosterjs-content-model'; | ||
|
||
/** | ||
* @internal | ||
* "Remove Image Border" button on the format ribbon | ||
*/ | ||
export const imageBorderRemoveButton: RibbonButton<'buttonNameImageBorderRemove'> = { | ||
key: 'buttonNameImageBorderRemove', | ||
unlocalizedText: 'Remove Image Border', | ||
iconName: 'Cancel', | ||
isDisabled: formatState => !formatState.canAddImageAltText, | ||
onClick: editor => { | ||
if (isContentModelEditor(editor)) { | ||
setImageBorder(editor, null); | ||
} | ||
}, | ||
}; |
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
21 changes: 21 additions & 0 deletions
21
packages/roosterjs-content-model/lib/domToModel/processors/blockDecoratorProcessor.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,21 @@ | ||
import { ContentModelSegmentFormat } from '../../publicTypes/format/ContentModelSegmentFormat'; | ||
import { createParagraphDecorator } from '../../modelApi/creators/createParagraphDecorator'; | ||
import { ElementProcessor } from '../../publicTypes/context/ElementProcessor'; | ||
import { knownElementProcessor } from './knownElementProcessor'; | ||
import { parseFormat } from '../utils/parseFormat'; | ||
import { stackFormat } from '../utils/stackFormat'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const blockDecoratorProcessor: ElementProcessor<HTMLElement> = (group, element, context) => { | ||
stackFormat(context, { blockDecorator: 'empty' }, () => { | ||
const segmentFormat: ContentModelSegmentFormat = {}; | ||
|
||
parseFormat(element, context.formatParsers.segmentOnBlock, segmentFormat, context); | ||
|
||
context.blockDecorator = createParagraphDecorator(element.tagName, segmentFormat); | ||
|
||
knownElementProcessor(group, element, context); | ||
}); | ||
}; |
15 changes: 15 additions & 0 deletions
15
packages/roosterjs-content-model/lib/domToModel/processors/codeProcessor.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,15 @@ | ||
import { ElementProcessor } from '../../publicTypes/context/ElementProcessor'; | ||
import { knownElementProcessor } from './knownElementProcessor'; | ||
import { parseFormat } from '../utils/parseFormat'; | ||
import { stackFormat } from '../utils/stackFormat'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export const codeProcessor: ElementProcessor<HTMLElement> = (group, element, context) => { | ||
stackFormat(context, { code: 'codeDefault' }, () => { | ||
parseFormat(element, context.formatParsers.code, context.code.format, context); | ||
|
||
knownElementProcessor(group, element, context); | ||
}); | ||
}; |
Oops, something went wrong.