Skip to content

Conversation

@BryanValverdeU
Copy link
Contributor

@BryanValverdeU BryanValverdeU commented May 8, 2025

JiuqingSong and others added 16 commits April 21, 2025 10:20
…ng handling (#3010)

* Refactor paste plugin to remove unused DOMCreator parameter and enhance style extraction logic

* fix test

* Change search string to lowercase
* undo image

* undo image

* undo image
…3000)

* Add 'CustomCopyCut' experimental feature to enhance copy/cut behavior

* Implement pruneUnselectedModel utility for optimizing copy/paste behavior

* Try fix iuld

* Address comment and fix broken tests

* Revert unneeded change

* Refactor pruneUnselectedModel

---------

Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
* Add API playground for createModelFromHTML

* imporve

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
* wip

* insertCustom

* refactor

* formatKeys
Instead of using a dataset to store the isEditing property, a hidden property is now used. To support this, get/set functions and the ImageMarkerFormat were introduced. The imageMarker property can now be accessed through the format property of the image.
This change eliminates the need to manually remove the dataset from the image element when extracting content from the DOM.
* Refactor paste parsers: add removeNegativeTextIndentParser and deprecatedBorderColorParser; update imports and constants for bullet list types

* Update packages/roosterjs-content-model-plugins/lib/paste/PowerPoint/processPastedContentFromPowerPoint.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor bullet list constants and improve format parser signatures

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…d Desktop Pasting (#3024)

* Update dependencies and enhance paste functionality by cleaning HTML comments in style tags

* Reapply "Refactor getStyleMetadata to not rely on DomCreator and only use Stri…" (#3020)

This reverts commit 32f47bf.

* Enhance cleanHtmlComments to handle both HTML comment formats in style tags

* Set original DOMPurify

* Update packages/roosterjs-content-model-plugins/lib/paste/WordDesktop/getStyleMetadata.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Ensure headEndIndex is valid

* address comment

* Address comments

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR bumps the project’s main version to 9.27.0 while consolidating Preset imports and extending functionality in various UI and API playground components.

  • Updated preset files to import the common Preset type from a new module.
  • Added new experimental feature options (e.g. Enter Key and CustomCopyCut) and corresponding UI controls.
  • Enhanced API playground components with new custom container insertion and improved sanitization in popout windows.

Reviewed Changes

Copilot reviewed 83 out of 83 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
demo/scripts/controlsV2/sidePane/presets/allPresets/undeleteablePresets.ts Added a new undeleteable preset using the exported DemoUndeletableName.
demo/scripts/controlsV2/sidePane/presets/allPresets/textPresets.ts Updated import path to the common Preset module.
demo/scripts/controlsV2/sidePane/presets/allPresets/tablePresets.ts Updated import path to the common Preset module.
demo/scripts/controlsV2/sidePane/presets/allPresets/paragraphPresets.ts Updated import path to the common Preset module.
demo/scripts/controlsV2/sidePane/presets/allPresets/listPresets.ts Updated import path to the common Preset module.
demo/scripts/controlsV2/sidePane/presets/allPresets/imagePresets.ts Updated import path to the common Preset module.
demo/scripts/controlsV2/sidePane/presets/allPresets/allPresets.ts Consolidated preset imports and added the undeleteableText preset.
demo/scripts/controlsV2/sidePane/presets/allPresets/Preset.ts New common definition of the Preset type.
demo/scripts/controlsV2/sidePane/presets/PresetPane.tsx Updated imports to align with the new preset structure.
demo/scripts/controlsV2/sidePane/editorOptions/Plugins.tsx Added support for handling Enter key events in plugin options.
demo/scripts/controlsV2/sidePane/editorOptions/ExperimentalFeatures.tsx Added a new experimental feature: CustomCopyCut.
demo/scripts/controlsV2/sidePane/editorOptions/EditorOptionsPlugin.ts Updated initial state to include the new CustomCopyCut feature.
demo/scripts/controlsV2/sidePane/apiPlayground/insertEntity/InsertEntityPane.tsx Modified entity insertion to use moveChildNodes for HTML sanitization.
demo/scripts/controlsV2/sidePane/apiPlayground/insertCustomContainer/InsertCustomContainerPane.tsx Added new API playground pane for inserting custom containers.
demo/scripts/controlsV2/sidePane/apiPlayground/createModelFromHtml/CreateModelFromHtmlPane.tsx New pane for creating and setting a content model from HTML input.
demo/scripts/controlsV2/sidePane/apiPlayground/apiEntries.ts Registered the new CreateModelFromHtml and custom container API entries.
demo/scripts/controlsV2/options/demoUndeletableAnchorParser.ts Changed DemoUndeletableName export to be publicly accessible.
demo/scripts/controlsV2/mainPane/MainPane.tsx Updated popout functionality to use DOMPurify for sanitizing HTML with additional options.
Comments suppressed due to low confidence (1)

demo/scripts/controlsV2/mainPane/MainPane.tsx:194

  • [nitpick] The use of type assertions to convert the sanitized output to a string may obscure potential type mismatches. Consider verifying the return type or using a safer conversion method to ensure the output is indeed a string.
win.document.write((DOMPurify.sanitize(POPOUT_HTML, { ... }) as any) as string);

juliaroldi and others added 5 commits May 8, 2025 16:35
When the image is selected, do not replace the image with the link, add the link to image segment.
Instead of using a square character, this change updates the square style to use the 'square' style.
* Normalize default format

* improve

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
JiuqingSong
JiuqingSong previously approved these changes May 8, 2025
@BryanValverdeU BryanValverdeU merged commit 4c0c12a into release May 8, 2025
7 checks passed
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.

4 participants