roosterjs 9.50.0 → 9.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rooster-adapter-amd-min.js +1 -1
- package/dist/rooster-adapter-amd-min.js.map +1 -1
- package/dist/rooster-adapter-amd.js +1 -3
- package/dist/rooster-adapter-amd.js.map +1 -1
- package/dist/rooster-adapter-min.js +1 -1
- package/dist/rooster-adapter-min.js.map +1 -1
- package/dist/rooster-adapter.js +1 -3
- package/dist/rooster-adapter.js.map +1 -1
- package/dist/rooster-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +33 -48
- package/dist/rooster-amd.js +50 -244
- package/dist/rooster-amd.js.map +1 -1
- package/dist/rooster-min.js +1 -1
- package/dist/rooster-min.js.map +1 -1
- package/dist/rooster-react-amd.js +55 -55
- package/dist/rooster-react-amd.js.map +1 -1
- package/dist/rooster.d.ts +33 -48
- package/dist/rooster.js +50 -244
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
package/dist/rooster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 9.
|
|
1
|
+
// Type definitions for roosterjs (Version 9.51.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -2976,6 +2976,7 @@ interface EditorContext {
|
|
|
2976
2976
|
*/
|
|
2977
2977
|
allowCacheElement?: boolean;
|
|
2978
2978
|
/**
|
|
2979
|
+
* @deprecated This is now always be treated as true
|
|
2979
2980
|
* Whether to allow caching list item elements separately.
|
|
2980
2981
|
*/
|
|
2981
2982
|
allowCacheListItem?: boolean;
|
|
@@ -3058,6 +3059,11 @@ interface DomToModelListFormat {
|
|
|
3058
3059
|
* Current list type stack
|
|
3059
3060
|
*/
|
|
3060
3061
|
levels: ContentModelListLevel[];
|
|
3062
|
+
/**
|
|
3063
|
+
* This is used for handling an abnormal case where list items are not inside a ul or ol tag
|
|
3064
|
+
* It is not common and against the HTML specification, but we need to handle it for robustness
|
|
3065
|
+
*/
|
|
3066
|
+
potentialListType?: 'OL' | 'UL';
|
|
3061
3067
|
}
|
|
3062
3068
|
|
|
3063
3069
|
/**
|
|
@@ -3812,11 +3818,6 @@ interface IEditor {
|
|
|
3812
3818
|
* when create editor
|
|
3813
3819
|
*/
|
|
3814
3820
|
type ExperimentalFeature = GraduatedExperimentalFeature
|
|
3815
|
-
/**
|
|
3816
|
-
* @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options
|
|
3817
|
-
* Use Content Model handle ENTER key
|
|
3818
|
-
*/
|
|
3819
|
-
| 'HandleEnterKey'
|
|
3820
3821
|
/**
|
|
3821
3822
|
* For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,
|
|
3822
3823
|
* the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the
|
|
@@ -3824,19 +3825,6 @@ type ExperimentalFeature = GraduatedExperimentalFeature
|
|
|
3824
3825
|
* the original formatting of the selection marker is kept to match the pending format.
|
|
3825
3826
|
*/
|
|
3826
3827
|
| 'KeepSelectionMarkerWhenEnteringTextNode'
|
|
3827
|
-
/**
|
|
3828
|
-
* Export editor content as HTML using HTMLFast option
|
|
3829
|
-
*/
|
|
3830
|
-
| 'ExportHTMLFast'
|
|
3831
|
-
/**
|
|
3832
|
-
* Get cloned root element from an independent HTML document instead of current document.
|
|
3833
|
-
* So any operation to the cloned root won't trigger network request for resources like images
|
|
3834
|
-
*/
|
|
3835
|
-
| 'CloneIndependentRoot'
|
|
3836
|
-
/**
|
|
3837
|
-
* Allow caching list item elements.
|
|
3838
|
-
*/
|
|
3839
|
-
| 'CacheList'
|
|
3840
3828
|
/**
|
|
3841
3829
|
* Transform the table border colors when switching from light to dark mode
|
|
3842
3830
|
*/
|
|
@@ -3860,7 +3848,28 @@ type GraduatedExperimentalFeature = /**
|
|
|
3860
3848
|
* Prevent default browser behavior for copy/cut event,
|
|
3861
3849
|
* and set the clipboard data with custom implementation.
|
|
3862
3850
|
*/
|
|
3863
|
-
| 'CustomCopyCut'
|
|
3851
|
+
| 'CustomCopyCut'
|
|
3852
|
+
/**
|
|
3853
|
+
* @deprecated
|
|
3854
|
+
* Export editor content as HTML using HTMLFast option
|
|
3855
|
+
*/
|
|
3856
|
+
| 'ExportHTMLFast'
|
|
3857
|
+
/**
|
|
3858
|
+
* @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options
|
|
3859
|
+
* Use Content Model handle ENTER key
|
|
3860
|
+
*/
|
|
3861
|
+
| 'HandleEnterKey'
|
|
3862
|
+
/**
|
|
3863
|
+
* @deprecated
|
|
3864
|
+
* Get cloned root element from an independent HTML document instead of current document.
|
|
3865
|
+
* So any operation to the cloned root won't trigger network request for resources like images
|
|
3866
|
+
*/
|
|
3867
|
+
| 'CloneIndependentRoot'
|
|
3868
|
+
/**
|
|
3869
|
+
* @deprecated
|
|
3870
|
+
* Allow caching list item elements.
|
|
3871
|
+
*/
|
|
3872
|
+
| 'CacheList';
|
|
3864
3873
|
|
|
3865
3874
|
/**
|
|
3866
3875
|
* Options for editor
|
|
@@ -7425,15 +7434,6 @@ function normalizeParagraph(paragraph: ReadonlyContentModelParagraph): void;
|
|
|
7425
7434
|
*/
|
|
7426
7435
|
function normalizeContentModel(group: ReadonlyContentModelBlockGroup): void;
|
|
7427
7436
|
|
|
7428
|
-
/**
|
|
7429
|
-
* Strip invisible Unicode characters from all text and link hrefs in a content model.
|
|
7430
|
-
* This sanitizes the model at initialization time to prevent hidden content in links
|
|
7431
|
-
* or text (e.g. zero-width chars, bidirectional marks, Unicode Tags).
|
|
7432
|
-
* For General segments, all Text nodes under the element are also sanitized.
|
|
7433
|
-
* @param model The content model document to sanitize in-place
|
|
7434
|
-
*/
|
|
7435
|
-
function sanitizeInvisibleUnicode(model: ContentModelDocument): void;
|
|
7436
|
-
|
|
7437
7437
|
/**
|
|
7438
7438
|
* Check if the given block group is a general segment
|
|
7439
7439
|
* @param group The group to check
|
|
@@ -7751,19 +7751,6 @@ function isSpace(char: string): boolean;
|
|
|
7751
7751
|
*/
|
|
7752
7752
|
function normalizeText(txt: string, isForward: boolean): string;
|
|
7753
7753
|
|
|
7754
|
-
/**
|
|
7755
|
-
* Strip invisible Unicode characters from a string.
|
|
7756
|
-
* This removes zero-width characters, bidirectional marks, Unicode Tags (U+E0001-U+E00FF),
|
|
7757
|
-
* interlinear annotation anchors, Mongolian free variation selectors,
|
|
7758
|
-
* and other invisible formatting characters that can be used to hide content in links.
|
|
7759
|
-
*
|
|
7760
|
-
* @remarks This function strips ZWJ (U+200D) which may affect emoji sequences.
|
|
7761
|
-
* It should only be applied to href attributes, not to visible text content.
|
|
7762
|
-
* @param value The string to strip invisible characters from
|
|
7763
|
-
* @returns The string with invisible characters removed
|
|
7764
|
-
*/
|
|
7765
|
-
function stripInvisibleUnicode(value: string): string;
|
|
7766
|
-
|
|
7767
7754
|
/**
|
|
7768
7755
|
* Parse a table into a two dimensions array of TD elements. For those merged cells, the value will be null.
|
|
7769
7756
|
* @param table Input HTML Table element
|
|
@@ -8767,7 +8754,7 @@ function createModelFromHtml(html: string, options?: Partial<DomToModelOptionFor
|
|
|
8767
8754
|
/**
|
|
8768
8755
|
* Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
|
|
8769
8756
|
* @param editor The editor to get content from
|
|
8770
|
-
* @param mode Specify HTML to get HTML.
|
|
8757
|
+
* @param mode Specify HTML to get HTML.
|
|
8771
8758
|
* @param options @optional Options for Model to DOM conversion
|
|
8772
8759
|
*/
|
|
8773
8760
|
function exportContent(editor: IEditor, mode?: 'HTML', options?: ModelToDomOption): string;
|
|
@@ -8776,9 +8763,9 @@ function exportContent(editor: IEditor, mode?: 'HTML', options?: ModelToDomOptio
|
|
|
8776
8763
|
* Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity.
|
|
8777
8764
|
* This is a fast version, it retrieve HTML content directly from editor without going through content model conversion.
|
|
8778
8765
|
* @param editor The editor to get content from
|
|
8779
|
-
* @param mode Specify HTMLFast to get HTML result.
|
|
8766
|
+
* @param mode Specify HTMLFast to get HTML result. This is the default option
|
|
8780
8767
|
*/
|
|
8781
|
-
function exportContent(editor: IEditor, mode
|
|
8768
|
+
function exportContent(editor: IEditor, mode?: 'HTMLFast'): string;
|
|
8782
8769
|
|
|
8783
8770
|
/**
|
|
8784
8771
|
* Export plain text content
|
|
@@ -9495,15 +9482,12 @@ class EditPlugin implements EditorPlugin {
|
|
|
9495
9482
|
private disposer;
|
|
9496
9483
|
private shouldHandleNextInputEvent;
|
|
9497
9484
|
private selectionAfterDelete;
|
|
9498
|
-
private handleNormalEnter;
|
|
9499
9485
|
private options;
|
|
9500
9486
|
/**
|
|
9501
9487
|
* @param options An optional parameter that takes in an object of type EditOptions, which includes the following properties:
|
|
9502
9488
|
* handleTabKey: A boolean or HandleTabOptions object that controls Tab key handling. When a boolean, true enables all features and false disables all. When an object, individual features can be controlled. Defaults to all enabled.
|
|
9503
9489
|
*/
|
|
9504
9490
|
constructor(options?: EditOptions);
|
|
9505
|
-
private createNormalEnterChecker;
|
|
9506
|
-
private getHandleNormalEnter;
|
|
9507
9491
|
/**
|
|
9508
9492
|
* Get name of this plugin
|
|
9509
9493
|
*/
|
|
@@ -9559,6 +9543,7 @@ type EditOptions = {
|
|
|
9559
9543
|
*/
|
|
9560
9544
|
handleExpandedSelectionOnDelete?: boolean;
|
|
9561
9545
|
/**
|
|
9546
|
+
* @deprecated This is always treated as true now
|
|
9562
9547
|
* Callback function to determine whether the Rooster should handle the Enter key press.
|
|
9563
9548
|
* If the function returns true, the Rooster will handle the Enter key press instead of the browser.
|
|
9564
9549
|
* @param editor - The editor instance.
|