Skip to content

[1/3] Enable Strict mode in TableCellSelection Utils + Plugin#1735

Merged
BryanValverdeU merged 7 commits into
masterfrom
u/bvalverde/tableSelection2
Apr 20, 2023
Merged

[1/3] Enable Strict mode in TableCellSelection Utils + Plugin#1735
BryanValverdeU merged 7 commits into
masterfrom
u/bvalverde/tableSelection2

Conversation

@BryanValverdeU

Copy link
Copy Markdown
Contributor

Enable Strict mode in Table Cell Selection Utils and the Plugin class


if (state.firstTable) {
editor.select(state.firstTable, null);
editor.select(state.firstTable, undefined);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the second parameter necessary here?

@BryanValverdeU BryanValverdeU Apr 19, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we should not pass undefined. Or it could be a conflict with the select(Node) overload if Node is a table. I will change it to null instead.

@BryanValverdeU
BryanValverdeU merged commit 86ad523 into master Apr 20, 2023
@BryanValverdeU
BryanValverdeU deleted the u/bvalverde/tableSelection2 branch April 20, 2023 16:51
JiuqingSong added a commit that referenced this pull request Apr 27, 2023
* 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 <juliaroldi@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Ian Elizondo <ianeli@microsoft.com>
Co-authored-by: Andres-CT98 <107568016+Andres-CT98@users.noreply.github.com>
Co-authored-by: Ruijun Gao <rckgao@gmail.com>
JiuqingSong added a commit that referenced this pull request Jun 16, 2023
* 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:

* 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 <juliaroldi@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Ian Elizondo <ianeli@microsoft.com>
Co-authored-by: Andres-CT98 <107568016+Andres-CT98@users.noreply.github.com>
Co-authored-by: Ruijun Gao <rckgao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants