-
Notifications
You must be signed in to change notification settings - Fork 183
Bump main version to 9.27.0 #3025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a6071da
Use FormatContainer to represent DIV with id (#3003)
JiuqingSong f2d2e3b
Fix #3005 (#3007)
JiuqingSong 83deda2
Fix a cache issue (#3006)
JiuqingSong 5bbab35
Refactor getStyleMetadata to not rely on DomCreator and only use Stri…
BryanValverdeU ab2bb52
Clean image edit when undo (#3015)
juliaroldi e103fd2
Add 'CustomCopyCut' experimental feature to fix some copy cut bugs (#…
BryanValverdeU e82f3a2
Demo site: Add preset content for undeleteable anchor (#3014)
JiuqingSong 32f47bf
Revert "Refactor getStyleMetadata to not rely on DomCreator and only …
BryanValverdeU 58c6514
Add API playground for createModelFromHTML (#3019)
JiuqingSong 4e94808
Do not copy div ID on Enter (#3011)
juliaroldi 8ba1938
Add image hidden marker (#3021)
juliaroldi 9a14db0
Include ImageMetadata in FormatState (#3023)
JiuqingSong ed226f0
Support List Pasting from PowerPoint Desktop (#3012)
BryanValverdeU d7760c1
Remove comments `<!--` and `-->` from styles and re apply fix for Wor…
BryanValverdeU f49c13e
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
BryanValverdeU 08d3399
Bump main version to 9.27.0 in versions.json
BryanValverdeU 2b7075d
insert link in the image (#3027)
juliaroldi 9eb2d29
square (#3029)
juliaroldi 489b802
Normalize default format (#3028)
JiuqingSong 612ffbd
auto link (#3026)
juliaroldi 1668f0b
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
BryanValverdeU 4a632ce
Add margin-inline-start to watermark styles for improved positioning …
BryanValverdeU 2b4bbdb
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
BryanValverdeU File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
5 changes: 5 additions & 0 deletions
5
...cripts/controlsV2/sidePane/apiPlayground/createModelFromHtml/CreateModelFromHtmlPane.scss
This file contains hidden or 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,5 @@ | ||
| .textarea { | ||
| outline: none; | ||
| min-height: 200px; | ||
| width: 90%; | ||
| } |
73 changes: 73 additions & 0 deletions
73
...scripts/controlsV2/sidePane/apiPlayground/createModelFromHtml/CreateModelFromHtmlPane.tsx
This file contains hidden or 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,73 @@ | ||
| import * as React from 'react'; | ||
| import { ApiPaneProps } from '../ApiPaneProps'; | ||
| import { cloneModel } from 'roosterjs-content-model-dom'; | ||
| import { ContentModelDocument } from 'roosterjs-content-model-types'; | ||
| import { ContentModelDocumentView } from '../../contentModel/components/model/ContentModelDocumentView'; | ||
| import { createModelFromHtml } from 'roosterjs-content-model-core'; | ||
|
|
||
| const styles = require('./CreateModelFromHtmlPane.scss'); | ||
|
|
||
| interface CreateModelFromHtmlPaneState { | ||
| model: ContentModelDocument | null; | ||
| } | ||
|
|
||
| export default class CreateModelFromHtmlPane extends React.Component< | ||
| ApiPaneProps, | ||
| CreateModelFromHtmlPaneState | ||
| > { | ||
| private html = React.createRef<HTMLTextAreaElement>(); | ||
|
|
||
| constructor(props: ApiPaneProps) { | ||
| super(props); | ||
| this.state = { | ||
| model: null, | ||
| }; | ||
| } | ||
|
|
||
| render() { | ||
| return ( | ||
| <> | ||
| <div>HTML:</div> | ||
| <div> | ||
| <textarea className={styles.textarea} ref={this.html}></textarea> | ||
| </div> | ||
| <div> | ||
| <button onClick={this.createModel}>Create Model</button> | ||
| </div> | ||
| <div> | ||
| {this.state.model ? <ContentModelDocumentView doc={this.state.model} /> : null} | ||
| </div> | ||
| <div> | ||
| <button onClick={this.setModel} disabled={!this.state.model}> | ||
| Set Model into Editor | ||
| </button> | ||
| </div> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| private createModel = () => { | ||
| const html = this.html.current?.value || ''; | ||
|
|
||
| if (html) { | ||
| const model = createModelFromHtml( | ||
| html, | ||
| undefined, | ||
| this.props.getEditor().getDOMCreator() | ||
| ); | ||
| this.setState({ model }); | ||
| } else { | ||
| this.setState({ model: null }); | ||
| } | ||
| }; | ||
|
|
||
| private setModel = () => { | ||
| if (this.state.model) { | ||
| this.props.getEditor().formatContentModel(model => { | ||
| model.blocks = cloneModel(this.state.model).blocks; | ||
|
|
||
| return true; | ||
| }); | ||
| } | ||
| }; | ||
| } |
13 changes: 13 additions & 0 deletions
13
...ts/controlsV2/sidePane/apiPlayground/insertCustomContainer/InsertCustomContainerPane.scss
This file contains hidden or 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,13 @@ | ||
| .textarea { | ||
| height: 200px; | ||
| } | ||
|
|
||
| .blockContent { | ||
| display: grid; | ||
| row-gap: 5px; | ||
| padding-bottom: 5px; | ||
| } | ||
|
|
||
| .results { | ||
| overflow-wrap: anywhere; | ||
| } |
103 changes: 103 additions & 0 deletions
103
...pts/controlsV2/sidePane/apiPlayground/insertCustomContainer/InsertCustomContainerPane.tsx
This file contains hidden or 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,103 @@ | ||
| import * as React from 'react'; | ||
| import { ApiPaneProps } from '../ApiPaneProps'; | ||
| import { createFormatContainer, mergeModel } from 'roosterjs-content-model-dom'; | ||
| import { createModelFromHtml } from 'roosterjs-content-model-core'; | ||
| import { trustedHTMLHandler } from '../../../../utils/trustedHTMLHandler'; | ||
| import { | ||
| ContentModelDocument, | ||
| ContentModelFormatContainer, | ||
| IEditor, | ||
| } from 'roosterjs-content-model-types'; | ||
|
|
||
| interface InsertCustomContainerPaneState { | ||
| containers: { | ||
| [id: string]: ContentModelFormatContainer; | ||
| }; | ||
| } | ||
|
|
||
| const styles = require('./InsertCustomContainerPane.scss'); | ||
|
|
||
| export default class InsertCustomContainerPane extends React.Component< | ||
| ApiPaneProps, | ||
| InsertCustomContainerPaneState | ||
| > { | ||
| public html = React.createRef<HTMLTextAreaElement>(); | ||
| private containerId = React.createRef<HTMLInputElement>(); | ||
| private searchId = React.createRef<HTMLInputElement>(); | ||
| private result = React.createRef<HTMLParagraphElement>(); | ||
|
|
||
| constructor(props: ApiPaneProps) { | ||
| super(props); | ||
| this.state = { | ||
| containers: {}, | ||
| }; | ||
| } | ||
|
|
||
| private insertCustomContainer = () => { | ||
| const model = createModelFromHtml(this.html.current.value, undefined, trustedHTMLHandler); | ||
| const container = createFormatContainer('div'); | ||
| const containerId = this.containerId.current.value; | ||
| container.format.id = containerId; | ||
| container.blocks = [...model.blocks]; | ||
| this.state.containers[containerId] = container; | ||
| model.blocks = [container]; | ||
| const editor = this.props.getEditor(); | ||
| insertContainer(editor, model); | ||
| }; | ||
|
|
||
| private getCustomContainer = () => { | ||
| const id = this.searchId.current.value; | ||
| const container = this.state.containers[id]; | ||
| if (container) { | ||
| this.result.current.innerText = JSON.stringify(container); | ||
| } else { | ||
| this.result.current.innerText = 'No container found'; | ||
| } | ||
| }; | ||
|
|
||
| render() { | ||
| return ( | ||
| <> | ||
| <div className={styles.blockContent}> | ||
| <label htmlFor="containerId"> Insert container</label> | ||
| <input | ||
| ref={this.containerId} | ||
| title="Container Id" | ||
| id="containerId" | ||
| type="text" | ||
| placeholder="Container Id" | ||
| /> | ||
| <textarea | ||
| ref={this.html} | ||
| className={styles.textarea} | ||
| title="Custom Content" | ||
| name="Content" | ||
| id="customContent" | ||
| placeholder="Insert HTML Content"></textarea> | ||
| <button onClick={this.insertCustomContainer} type="button"> | ||
| Insert container | ||
| </button> | ||
| </div> | ||
|
|
||
| <div className={styles.blockContent}> | ||
| <label htmlFor="containerId">Id:</label> | ||
| <input ref={this.searchId} title="Container Id" id="containerId" type="text" /> | ||
| <button onClick={this.getCustomContainer} type="button"> | ||
| Get Custom Container | ||
| </button> | ||
| <label htmlFor="results"> Results:</label> | ||
| <p className={styles.results} ref={this.result} id="results"></p> | ||
| </div> | ||
| </> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| function insertContainer(editor: IEditor, newModel: ContentModelDocument) { | ||
| editor.formatContentModel((model, context) => { | ||
| mergeModel(model, newModel, context, { | ||
| mergeFormat: 'mergeAll', | ||
| }); | ||
| return true; | ||
| }); | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
demo/scripts/controlsV2/sidePane/presets/allPresets/Preset.ts
This file contains hidden or 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,7 @@ | ||
| import { ContentModelDocument } from 'roosterjs-content-model-types'; | ||
|
|
||
| export type Preset = { | ||
| buttonName: string; | ||
| id: string; | ||
| content: ContentModelDocument; | ||
| }; |
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
demo/scripts/controlsV2/sidePane/presets/allPresets/imagePresets.ts
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
demo/scripts/controlsV2/sidePane/presets/allPresets/listPresets.ts
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
demo/scripts/controlsV2/sidePane/presets/allPresets/paragraphPresets.ts
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
demo/scripts/controlsV2/sidePane/presets/allPresets/tablePresets.ts
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.