Skip to content
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

Bump packages to 9.11.0 #2814

Merged
merged 69 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
06d57be
image-selection
juliaroldi Aug 16, 2024
aab1058
fixes
juliaroldi Aug 16, 2024
43f3287
Merge branch 'master' into u/juliaroldi/image-fixes
juliaroldi Aug 16, 2024
8b52988
safari fix
juliaroldi Aug 16, 2024
f6bb152
Merge branch 'u/juliaroldi/image-fixes' of https://github.com/microso…
juliaroldi Aug 16, 2024
13ba45a
Merge pull request #2768 from microsoft/u/juliaroldi/image-fixes
juliaroldi Aug 19, 2024
9c0db6e
fix drag and drop
juliaroldi Aug 21, 2024
45fe9ff
conflicts
juliaroldi Aug 22, 2024
21efdc8
fixes
juliaroldi Aug 22, 2024
7b4b9c8
fixes
juliaroldi Aug 22, 2024
e97ff6e
Add `<del>` elements to default processors and use knownElementProces…
BryanValverdeU Aug 22, 2024
4348117
Merge branch 'master' into u/juliaroldi/drag-image
BryanValverdeU Aug 22, 2024
70bec5a
Merge pull request #2772 from microsoft/u/juliaroldi/drag-image
juliaroldi Aug 23, 2024
b3111df
Dont remove the MarginTop/Bottom from lists when pasting from Word On…
BryanValverdeU Aug 28, 2024
5b07b94
Reconcile table and image selection for cache (#2714)
JiuqingSong Aug 29, 2024
1af04a3
Set segmentFormat text color to black when creating the model of the …
BryanValverdeU Aug 29, 2024
63010b9
fixes image in tables
juliaroldi Aug 30, 2024
c8ce33e
Merge branch 'master' into u/juliaroldi/find-images-on-tables
juliaroldi Sep 2, 2024
8faa8e0
Bump webpack from 5.84.1 to 5.94.0 (#2780)
dependabot[bot] Sep 3, 2024
ffc0685
Merge branch 'master' into u/juliaroldi/find-images-on-tables
juliaroldi Sep 3, 2024
ab11e03
Merge pull request #2781 from microsoft/u/juliaroldi/find-images-on-t…
juliaroldi Sep 3, 2024
92de0a6
Resolve null sheet in convertInlineCss (#2784)
BryanValverdeU Sep 4, 2024
f496042
Update paste code to add a paragraph when the clipboard contains atle…
BryanValverdeU Sep 4, 2024
a419832
Fix 300391: [Mail] The numbers will become a continuous sequence afte…
JiuqingSong Sep 4, 2024
865fdc7
Pressing Tab inside a table should select all node contents of the ne…
Andres-CT98 Sep 5, 2024
dda3102
fix list
juliaroldi Sep 9, 2024
281a456
safari selection
juliaroldi Sep 10, 2024
b4796e3
comment
juliaroldi Sep 10, 2024
0640f45
Merge pull request #2791 from microsoft/u/julairoldi/list-style-demo-ste
juliaroldi Sep 10, 2024
c1124e9
Merge branch 'master' into u/juliaroldi/safari-image-selection
juliaroldi Sep 10, 2024
c9edd47
image pasted
juliaroldi Sep 11, 2024
1c20684
Merge pull request #2794 from microsoft/u/juliaroldi/pasted-images
juliaroldi Sep 12, 2024
1f1b92b
WIP
juliaroldi Sep 12, 2024
cb81038
Merge branch 'master' into u/juliaroldi/safari-image-selection
juliaroldi Sep 13, 2024
c872e31
Merge pull request #2792 from microsoft/u/juliaroldi/safari-image-sel…
juliaroldi Sep 13, 2024
5480a82
Fix #2755 (#2795)
JiuqingSong Sep 13, 2024
697e35a
auto-link enhacements
juliaroldi Sep 13, 2024
07640af
links
juliaroldi Sep 13, 2024
8b4b891
Merge branch 'master' into u/juliaroldi/link-enhancements
juliaroldi Sep 13, 2024
7ef8730
Use a different change source for keyboard formatting event (#2799)
JiuqingSong Sep 16, 2024
de654a3
Bump dompurify from 2.3.0 to 2.5.4 (#2800)
dependabot[bot] Sep 16, 2024
63747b9
Bump express from 4.19.2 to 4.21.0 (#2801)
dependabot[bot] Sep 16, 2024
f37e9de
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
juliaroldi Sep 23, 2024
a13c33c
fixes
juliaroldi Sep 23, 2024
cd35c3f
fix build
juliaroldi Sep 23, 2024
f2ffdab
Fix #2699 (#2797)
JiuqingSong Sep 23, 2024
5d08bab
Bump body-parser from 1.20.1 to 1.20.3 (#2802)
dependabot[bot] Sep 23, 2024
1424e67
Merge branch 'master' into u/juliaroldi/link-enhancements
juliaroldi Sep 23, 2024
e3bc1f3
Merge pull request #2798 from microsoft/u/juliaroldi/link-enhancements
juliaroldi Sep 23, 2024
84957c8
protected
juliaroldi Sep 26, 2024
fd00989
Let DOM Helper return a cloned root (#2805)
JiuqingSong Sep 26, 2024
9d3deb2
Fix mergeTable when pasting #2810
BryanValverdeU Sep 26, 2024
135ad5b
Merge branch 'master' into u/juliaroldi/image-edit-protected
juliaroldi Sep 26, 2024
33531e1
Fix #2807 (#2809)
JiuqingSong Sep 26, 2024
a6b302a
Merge branch 'master' into u/juliaroldi/image-edit-protected
juliaroldi Sep 26, 2024
f74c18f
caret color
juliaroldi Sep 26, 2024
33def51
caret color
juliaroldi Sep 26, 2024
a20c7bc
bump
BryanValverdeU Sep 27, 2024
f56fd8e
update version.json
BryanValverdeU Sep 27, 2024
da9c80f
update
BryanValverdeU Sep 27, 2024
12d27df
Use a separate experimental feature for Enter key (#2811)
JiuqingSong Sep 27, 2024
c3b2948
test
juliaroldi Sep 27, 2024
06358cc
Merge branch 'master' into u/juliaroldi/image-text-ip
juliaroldi Sep 27, 2024
0350b30
Merge pull request #2815 from microsoft/u/juliaroldi/image-text-ip
juliaroldi Sep 27, 2024
da47dfe
Merge pull request #2815 from microsoft/u/juliaroldi/image-text-ip
juliaroldi Sep 27, 2024
006014c
Merge branch 'master' into u/bvalverde/bumpRoosterJs
JiuqingSong Sep 27, 2024
1590e46
Merge branch 'master' into u/juliaroldi/image-edit-protected
juliaroldi Sep 27, 2024
092c04b
Merge pull request #2812 from microsoft/u/juliaroldi/image-edit-prote…
juliaroldi Sep 27, 2024
566e562
Merge branch 'master' of https://github.com/microsoft/roosterjs into …
juliaroldi Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const dropDownMenuItems = {
[BulletListType.LongArrow]: 'LongArrow',
[BulletListType.UnfilledArrow]: 'UnfilledArrow',
[BulletListType.Hyphen]: 'Hyphen',
[BulletListType.DoubleLongArrow]: 'DoubleLongArrow',
[BulletListType.Circle]: 'Circle',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const initialState: OptionState = {
autoHyphen: true,
autoFraction: true,
autoOrdinals: true,
autoMailto: true,
autoTel: true,
},
markdownOptions: {
bold: true,
Expand All @@ -56,7 +58,7 @@ const initialState: OptionState = {
handleTabKey: true,
},
customReplacements: emojiReplacements,
experimentalFeatures: new Set<ExperimentalFeature>(['PersistCache']),
experimentalFeatures: new Set<ExperimentalFeature>(['PersistCache', 'HandleEnterKey']),
};

export class EditorOptionsPlugin extends SidePanePluginImpl<OptionsPane, OptionPaneProps> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ export interface DefaultFormatProps {

export class ExperimentalFeatures extends React.Component<DefaultFormatProps, {}> {
render() {
return this.renderFeature('PersistCache');
return (
<>
{this.renderFeature('PersistCache')}
{this.renderFeature('HandleEnterKey')}
{this.renderFeature('LegacyImageSelection')}
</>
);
}

private renderFeature(featureName: ExperimentalFeature): JSX.Element {
Expand Down
14 changes: 14 additions & 0 deletions demo/scripts/controlsV2/sidePane/editorOptions/Plugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export class Plugins extends PluginsBase<keyof BuildInPluginList> {
private autoHyphen = React.createRef<HTMLInputElement>();
private autoFraction = React.createRef<HTMLInputElement>();
private autoOrdinals = React.createRef<HTMLInputElement>();
private autoTel = React.createRef<HTMLInputElement>();
private autoMailto = React.createRef<HTMLInputElement>();
private markdownBold = React.createRef<HTMLInputElement>();
private markdownItalic = React.createRef<HTMLInputElement>();
private markdownStrikethrough = React.createRef<HTMLInputElement>();
Expand Down Expand Up @@ -166,6 +168,18 @@ export class Plugins extends PluginsBase<keyof BuildInPluginList> {
this.props.state.autoFormatOptions.autoOrdinals,
(state, value) => (state.autoFormatOptions.autoOrdinals = value)
)}
{this.renderCheckBox(
'Telephone',
this.autoTel,
this.props.state.autoFormatOptions.autoTel,
(state, value) => (state.autoFormatOptions.autoTel = value)
)}
{this.renderCheckBox(
'Email',
this.autoMailto,
this.props.state.autoFormatOptions.autoMailto,
(state, value) => (state.autoFormatOptions.autoMailto = value)
)}
</>
)}
{this.renderPluginItem(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"coverage-istanbul-loader": "3.0.5",
"css-loader": "3.5.3",
"detect-port": "^1.3.0",
"dompurify": "2.3.0",
"dompurify": "2.5.4",
"eslint": "^8.50.0",
"eslint-plugin-etc": "^2.0.3",
"eslint-plugin-react": "^7.33.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,19 @@ export function setModelIndentation(
//if block has only one level, there is not need to check if it is multilevel selection
} else if (block.levels.length == 1 || !isMultilevelSelection(model, block, parent)) {
if (isIndent) {
const lastLevel = block.levels[block.levels.length - 1];
const threadIdx = thread.indexOf(block);
const previousItem = thread[threadIdx - 1];
const nextItem = thread[threadIdx + 1];
const levelLength = block.levels.length;
const lastLevel = block.levels[levelLength - 1];
const newLevel: ContentModelListLevel = createListLevel(
lastLevel?.listType || 'UL',
lastLevel?.format
lastLevel?.format,
previousItem && previousItem.levels.length > levelLength
? previousItem.levels[levelLength].dataset
: nextItem && nextItem.levels.length > levelLength
? nextItem.levels[levelLength].dataset
: undefined
);

updateListMetadata(newLevel, metadata => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function clearModelFormat(
blocksToClear: [ReadonlyContentModelBlockGroup[], ShallowMutableContentModelBlock][],
segmentsToClear: ShallowMutableContentModelSegment[],
tablesToClear: [ContentModelTable, boolean][]
) {
): boolean {
let pendingStructureChange = false;

iterateSelections(
model,
(path, tableContext, block, segments) => {
Expand Down Expand Up @@ -75,14 +77,14 @@ export function clearModelFormat(
blocksToClear.length == 1
) {
segmentsToClear.splice(0, segmentsToClear.length, ...adjustWordSelection(model, marker));
clearListFormat(blocksToClear[0][0]);
pendingStructureChange = clearListFormat(blocksToClear[0][0]) || pendingStructureChange;
} else if (blocksToClear.length > 1 || blocksToClear.some(x => isWholeBlockSelected(x[1]))) {
// 2. If a full block or multiple blocks are selected, clear block format
for (let i = blocksToClear.length - 1; i >= 0; i--) {
const [path, block] = blocksToClear[i];

clearBlockFormat(path, block);
clearListFormat(path);
pendingStructureChange = clearListFormat(path) || pendingStructureChange;
clearContainerFormat(path, block);
}
}
Expand All @@ -92,6 +94,8 @@ export function clearModelFormat(

// 4. Clear format for table if any
createTablesFormat(tablesToClear);

return pendingStructureChange;
}

function createTablesFormat(tablesToClear: [ContentModelTable, boolean][]) {
Expand Down Expand Up @@ -191,6 +195,10 @@ function clearListFormat(path: ReadonlyContentModelBlockGroup[]) {

if (listItem) {
mutateBlock(listItem).levels = [];

return true;
} else {
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import type {
ContentModelTable,
} from 'roosterjs-content-model-types';

const MAX_TRY = 3;

/**
* Clear format of selection
* @param editor The editor to clear format from
Expand All @@ -17,17 +19,27 @@ export function clearFormat(editor: IEditor) {

editor.formatContentModel(
model => {
const blocksToClear: [ContentModelBlockGroup[], ContentModelBlock][] = [];
const segmentsToClear: ContentModelSegment[] = [];
const tablesToClear: [ContentModelTable, boolean][] = [];
let changed = false;
let needtoRun = true;
let triedTimes = 0;

while (needtoRun && triedTimes++ < MAX_TRY) {
const blocksToClear: [ContentModelBlockGroup[], ContentModelBlock][] = [];
const segmentsToClear: ContentModelSegment[] = [];
const tablesToClear: [ContentModelTable, boolean][] = [];

needtoRun = clearModelFormat(model, blocksToClear, segmentsToClear, tablesToClear);

clearModelFormat(model, blocksToClear, segmentsToClear, tablesToClear);
normalizeContentModel(model);

normalizeContentModel(model);
changed =
changed ||
blocksToClear.length > 0 ||
segmentsToClear.length > 0 ||
tablesToClear.length > 0;
}

return (
blocksToClear.length > 0 || segmentsToClear.length > 0 || tablesToClear.length > 0
);
return changed;
},
{
apiName: 'clearFormat',
Expand Down
Loading
Loading