-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version bump 8.35.2 to 8.36.0 (#1403)
* WIP * WIP * enable flight * adapt Image Edit to Image Selection * typo * compare files * add image selection * remove alignment * typo * if click in image, select it * remove check * picker plugin tests * setEditing * change variable names * WIP * WIP * WIP * change to mouse up * remove comment * remove comment * fix copy/paste * dispose properties * add test * Enable strict mode for color utils (#1319) * use queryelements * Change the order of karma plugins (#1371) * Remove empty div Between list when backspacing. (#1365) * init * Check if prevElement is List, to avoid perf issue * remove debugger * Fix dependency iss * Do not merge if lists have different type * use Editor Document * Make strings constant * add checker * Content Model Bug fix: part 1 (#1370) * Bug bash bug fix * fix test * improve * WIP * new update wrapper * Content Model bug fix part 2: Support hyperlink and better support align (#1376) * Bug bash bug fix * fix test * improve * Bug bash bug fix 2: Better support align * Fix test * Improve hyper link * improve * add null check * add const to metadata * add null check and list chain * refactor image edit * Apply default format on SPAN instead of DIV (#1380) * Apply default format in SPAN * Enable in demo site by default * fix test * refactor * Fix changing font size doesn't work for empty selections (#1384) Co-authored-by: Ying Zhong <[email protected]> * refactor * Content Model Bug bash fix part 3: More content fidelity fixes (#1378) * Bug bash bug fix * fix test * improve * Bug bash bug fix 2: Better support align * Fix test * Improve hyper link * improve * Content Model bug fix part 3: More content fidelity fix * Fix more bugs * add more test * use remove global styles * use clone to applay changes * refactor * Content Model Bug bash fix part 4: More content fidelity fixes (#1386) * Bug bash bug fix * fix test * improve * Bug bash bug fix 2: Better support align * Fix test * Improve hyper link * improve * Content Model bug fix part 3: More content fidelity fix * Fix more bugs * add more test * More fidelity fixes * fix test * Content Model: Better support dataset and metadata step 1 of 5: New dataset and metadata API, and apply to image (#1388) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model: Better support dataset and metadata step 2 of 5: Port Table Cell metadata (#1389) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model metadata step 2 * Content Model: Better support dataset and metadata step 3 of 5: Port Table metadata (#1390) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model metadata step 2 * Content Model Metadata step 3 * fix build * Content Model: Better support dataset and metadata step 4 of 5: Port list metadata (#1391) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model metadata step 2 * Content Model Metadata step 3 * fix build * Content Model metadata step 4 * fix test * Content Model: Better support dataset and metadata step 5 of 5: Port hyperlink dataset (#1393) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model metadata step 2 * Content Model Metadata step 3 * fix build * Content Model metadata step 4 * fix test * Content Model metadata step 5 * fix build * Fix image zoom scale while editing (#1383) * fix zoom sacle * WIP * fix zoom * remove scale property Co-authored-by: Jiuqing Song <[email protected]> * Graduate experimental features (#1385) * graduate experimental features * graduate experimental features * deprecate Co-authored-by: Jiuqing Song <[email protected]> * More ImageSelection plugin into core plugin (#1395) * Content Model: Provide default settings in context so overriding functions can call it (#1396) * Provide default settings in context so overriding functions can call it * fix build * Remove unused code * Content Model: reorganize some code (#1394) * Content Model: Better support dataset and metadata step 1: New dataset and metadata API, and apply to image * fix build * Content Model metadata step 2 * Content Model Metadata step 3 * fix build * Content Model metadata step 4 * fix test * Content Model metadata step 5 * fix build * Reorg Content Model code * Bump socket.io-parser from 4.0.4 to 4.0.5 (#1397) Bumps [socket.io-parser](https://github.com/socketio/socket.io-parser) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/socketio/socket.io-parser/releases) - [Changelog](https://github.com/socketio/socket.io-parser/blob/main/CHANGELOG.md) - [Commits](socketio/socket.io-parser@4.0.4...4.0.5) --- updated-dependencies: - dependency-name: socket.io-parser dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix list style issue (#1399) * Fix list style issue * fix bug and test cases * Bump minimatch from 3.0.4 to 3.1.2 (#1398) Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2. - [Release notes](https://github.com/isaacs/minimatch/releases) - [Commits](isaacs/minimatch@v3.0.4...v3.1.2) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiuqing Song <[email protected]> * Content Model: Fix two list issues (#1400) * Content Model: Fix two list issues * Fix implicit * Apply default format on SPAN instead of DIV (#1380) * Apply default format in SPAN * Enable in demo site by default * fix test * version bump 8.36.0 * bumped Content model version too. Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Júlia Roldi <[email protected]> Co-authored-by: Julia Roldi <[email protected]> Co-authored-by: Jiuqing Song <[email protected]> Co-authored-by: Bryan Valverde U <[email protected]> Co-authored-by: Gnohz Gniy <[email protected]> Co-authored-by: Ying Zhong <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f6d6a75
commit 2156518
Showing
58 changed files
with
2,164 additions
and
390 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
demo/scripts/controls/contentModel/components/ContentModelView.tsx
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
8 changes: 7 additions & 1 deletion
8
demo/scripts/controls/contentModel/components/format/formatPart/TextColorFormatRenderer.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
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
36 changes: 0 additions & 36 deletions
36
packages/roosterjs-content-model/lib/domToModel/context/defaultStyles.ts
This file was deleted.
Oops, something went wrong.
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
70 changes: 0 additions & 70 deletions
70
packages/roosterjs-content-model/lib/domToModel/processors/tempContainerProcessor.ts
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
packages/roosterjs-content-model/lib/domUtils/hasSpacesOnly.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,10 @@ | ||
// A regex to match text that only has space and CR | ||
// We use real space char " " (\u0020) here but not "\s" since "\s" will also match " " (\u00A0) which is something we need to keep | ||
const SPACE_TEXT_REGEX = /^[\r\n\t ]*$/; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function hasSpacesOnly(txt: string): boolean { | ||
return SPACE_TEXT_REGEX.test(txt); | ||
} |
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
8 changes: 4 additions & 4 deletions
8
packages/roosterjs-content-model/lib/modelApi/block/indent.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
6 changes: 3 additions & 3 deletions
6
packages/roosterjs-content-model/lib/modelApi/block/outdent.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
14 changes: 14 additions & 0 deletions
14
packages/roosterjs-content-model/lib/modelApi/common/addLink.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,14 @@ | ||
import { ContentModelLink } from '../../publicTypes/decorator/ContentModelLink'; | ||
import { ContentModelSegment } from '../../publicTypes/segment/ContentModelSegment'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function addLink(segment: ContentModelSegment, link: ContentModelLink) { | ||
if (link.format.href) { | ||
segment.link = { | ||
format: { ...link.format }, | ||
dataset: { ...link.dataset }, | ||
}; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/roosterjs-content-model/lib/modelApi/common/getOperationalBlocks.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
4 changes: 2 additions & 2 deletions
4
packages/roosterjs-content-model/lib/modelApi/list/getFirstFocusedListItem.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
37 changes: 37 additions & 0 deletions
37
packages/roosterjs-content-model/lib/modelApi/metadata/updateListMetadata.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,37 @@ | ||
import { BulletListType, NumberingListType } from 'roosterjs-editor-types'; | ||
import { ContentModelWithDataset } from '../../publicTypes/format/ContentModelWithDataset'; | ||
import { createNumberDefinition, createObjectDefinition } from 'roosterjs-editor-dom'; | ||
import { ListMetadataFormat } from '../../publicTypes/format/formatParts/ListMetadataFormat'; | ||
import { updateMetadata } from './updateMetadata'; | ||
|
||
const ListStyleDefinitionMetadata = createObjectDefinition<ListMetadataFormat>( | ||
{ | ||
orderedStyleType: createNumberDefinition( | ||
true /** isOptional */, | ||
undefined /** value **/, | ||
NumberingListType.Min, | ||
NumberingListType.Max | ||
), | ||
unorderedStyleType: createNumberDefinition( | ||
true /** isOptional */, | ||
undefined /** value **/, | ||
BulletListType.Min, | ||
BulletListType.Max | ||
), | ||
}, | ||
true /** isOptional */, | ||
true /** allowNull */ | ||
); | ||
|
||
/** | ||
* @internal | ||
* Update list metadata with a callback | ||
* @param list The list Content Model (metadata holder) | ||
* @param callback The callback function used for updating metadata | ||
*/ | ||
export function updateListMetadata( | ||
list: ContentModelWithDataset<ListMetadataFormat>, | ||
callback: (format: ListMetadataFormat | null) => ListMetadataFormat | null | ||
) { | ||
updateMetadata(list, callback, ListStyleDefinitionMetadata); | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/roosterjs-content-model/lib/modelApi/metadata/updateMetadata.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,40 @@ | ||
import { ContentModelWithDataset } from '../../publicTypes/format/ContentModelWithDataset'; | ||
import { Definition } from 'roosterjs-editor-types'; | ||
import { validate } from 'roosterjs-editor-dom'; | ||
|
||
const EditingInfoDatasetName = 'editingInfo'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function updateMetadata<T>( | ||
model: ContentModelWithDataset<T>, | ||
callback: (metadata: T | null) => T | null, | ||
definition?: Definition<T> | ||
) { | ||
const metadataString = model.dataset[EditingInfoDatasetName]; | ||
let obj: T | null = null; | ||
|
||
try { | ||
obj = JSON.parse(metadataString) as T; | ||
} catch {} | ||
|
||
if (definition && !validate(obj, definition)) { | ||
obj = null; | ||
} | ||
|
||
obj = callback(obj); | ||
|
||
if (!obj) { | ||
delete model.dataset[EditingInfoDatasetName]; | ||
} else if (!definition || validate(obj, definition)) { | ||
model.dataset[EditingInfoDatasetName] = JSON.stringify(obj); | ||
} | ||
} | ||
|
||
/** | ||
* @internal Check if the given model has metadata | ||
*/ | ||
export function hasMetadata<T>(model: ContentModelWithDataset<T>): boolean { | ||
return !!model.dataset[EditingInfoDatasetName]; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/roosterjs-content-model/lib/modelApi/metadata/updateTableCellMetadata.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,25 @@ | ||
import { ContentModelTableCell } from '../../publicTypes/group/ContentModelTableCell'; | ||
import { createBooleanDefinition, createObjectDefinition } from 'roosterjs-editor-dom'; | ||
import { TableCellMetadataFormat } from 'roosterjs-editor-types'; | ||
import { updateMetadata } from './updateMetadata'; | ||
|
||
const TableCellMetadataFormatDefinition = createObjectDefinition<Required<TableCellMetadataFormat>>( | ||
{ | ||
bgColorOverride: createBooleanDefinition(true /** isOptional */), | ||
}, | ||
false /* isOptional */, | ||
true /** allowNull */ | ||
); | ||
|
||
/** | ||
* @internal | ||
* Update table cell metadata with a callback | ||
* @param cell The table cell Content Model | ||
* @param callback The callback function used for updating metadata | ||
*/ | ||
export function updateTableCellMetadata( | ||
cell: ContentModelTableCell, | ||
callback: (format: TableCellMetadataFormat | null) => TableCellMetadataFormat | null | ||
) { | ||
updateMetadata(cell, callback, TableCellMetadataFormatDefinition); | ||
} |
Oops, something went wrong.