roosterjs 9.49.0 → 9.50.1
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-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +63 -25
- package/dist/rooster-amd.js +257 -198
- 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.js +53 -53
- package/dist/rooster-react.js.map +1 -1
- package/dist/rooster.d.ts +63 -25
- package/dist/rooster.js +257 -198
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
package/dist/rooster-amd.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 9.
|
|
1
|
+
// Type definitions for roosterjs (Version 9.50.1)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -6261,6 +6261,12 @@ export interface BeforeCutCopyEvent extends BasePluginDomEvent<'beforeCutCopy',
|
|
|
6261
6261
|
export interface BeforeDisposeEvent extends BasePluginEvent<'beforeDispose'> {
|
|
6262
6262
|
}
|
|
6263
6263
|
|
|
6264
|
+
/**
|
|
6265
|
+
* Data of BeforeDropEvent
|
|
6266
|
+
*/
|
|
6267
|
+
export interface BeforeDropEvent extends BasePluginDomEvent<'beforeDrop', DragEvent> {
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6264
6270
|
/**
|
|
6265
6271
|
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
6266
6272
|
*/
|
|
@@ -6615,7 +6621,7 @@ export interface DoubleClickEvent extends BasePluginDomEvent<'doubleClick', Mous
|
|
|
6615
6621
|
/**
|
|
6616
6622
|
* Editor plugin event interface
|
|
6617
6623
|
*/
|
|
6618
|
-
export type PluginEvent = BeforeAddUndoSnapshotEvent | BeforeCutCopyEvent | BeforeDisposeEvent | BeforeKeyboardEditingEvent | BeforeLogicalRootChangeEvent | BeforePasteEvent | BeforeSetContentEvent | CompositionEndEvent | ContentChangedEvent | ContextMenuEvent | RewriteFromModelEvent | EditImageEvent | EditorReadyEvent | EnterShadowEditEvent | EntityOperationEvent | ExtractContentWithDomEvent | EditorInputEvent | KeyDownEvent | KeyPressEvent | KeyUpEvent | LeaveShadowEditEvent | LogicalRootChangedEvent | MouseDownEvent | MouseUpEvent | ScrollEvent | SelectionChangedEvent | ZoomChangedEvent | PointerDownEvent | PointerUpEvent | DoubleClickEvent | FindResultChangedEvent;
|
|
6624
|
+
export type PluginEvent = BeforeAddUndoSnapshotEvent | BeforeCutCopyEvent | BeforeDisposeEvent | BeforeDropEvent | BeforeKeyboardEditingEvent | BeforeLogicalRootChangeEvent | BeforePasteEvent | BeforeSetContentEvent | CompositionEndEvent | ContentChangedEvent | ContextMenuEvent | RewriteFromModelEvent | EditImageEvent | EditorReadyEvent | EnterShadowEditEvent | EntityOperationEvent | ExtractContentWithDomEvent | EditorInputEvent | KeyDownEvent | KeyPressEvent | KeyUpEvent | LeaveShadowEditEvent | LogicalRootChangedEvent | MouseDownEvent | MouseUpEvent | ScrollEvent | SelectionChangedEvent | ZoomChangedEvent | PointerDownEvent | PointerUpEvent | DoubleClickEvent | FindResultChangedEvent;
|
|
6619
6625
|
|
|
6620
6626
|
/**
|
|
6621
6627
|
* A type to extract data part of a plugin event type. Data part is the plugin event without eventType field.
|
|
@@ -6776,7 +6782,11 @@ export type PluginEventType = /**
|
|
|
6776
6782
|
/**
|
|
6777
6783
|
* Find result changed event
|
|
6778
6784
|
*/
|
|
6779
|
-
| 'findResultChanged'
|
|
6785
|
+
| 'findResultChanged'
|
|
6786
|
+
/**
|
|
6787
|
+
* Let plugin know when a content will be dropped
|
|
6788
|
+
*/
|
|
6789
|
+
| 'beforeDrop';
|
|
6780
6790
|
|
|
6781
6791
|
/**
|
|
6782
6792
|
* This interface represents a PluginEvent wrapping native scroll event
|
|
@@ -7414,15 +7424,6 @@ export function normalizeParagraph(paragraph: ReadonlyContentModelParagraph): vo
|
|
|
7414
7424
|
*/
|
|
7415
7425
|
export function normalizeContentModel(group: ReadonlyContentModelBlockGroup): void;
|
|
7416
7426
|
|
|
7417
|
-
/**
|
|
7418
|
-
* Strip invisible Unicode characters from all text and link hrefs in a content model.
|
|
7419
|
-
* This sanitizes the model at initialization time to prevent hidden content in links
|
|
7420
|
-
* or text (e.g. zero-width chars, bidirectional marks, Unicode Tags).
|
|
7421
|
-
* For General segments, all Text nodes under the element are also sanitized.
|
|
7422
|
-
* @param model The content model document to sanitize in-place
|
|
7423
|
-
*/
|
|
7424
|
-
export function sanitizeInvisibleUnicode(model: ContentModelDocument): void;
|
|
7425
|
-
|
|
7426
7427
|
/**
|
|
7427
7428
|
* Check if the given block group is a general segment
|
|
7428
7429
|
* @param group The group to check
|
|
@@ -7740,19 +7741,6 @@ export function isSpace(char: string): boolean;
|
|
|
7740
7741
|
*/
|
|
7741
7742
|
export function normalizeText(txt: string, isForward: boolean): string;
|
|
7742
7743
|
|
|
7743
|
-
/**
|
|
7744
|
-
* Strip invisible Unicode characters from a string.
|
|
7745
|
-
* This removes zero-width characters, bidirectional marks, Unicode Tags (U+E0001-U+E00FF),
|
|
7746
|
-
* interlinear annotation anchors, Mongolian free variation selectors,
|
|
7747
|
-
* and other invisible formatting characters that can be used to hide content in links.
|
|
7748
|
-
*
|
|
7749
|
-
* @remarks This function strips ZWJ (U+200D) which may affect emoji sequences.
|
|
7750
|
-
* It should only be applied to href attributes, not to visible text content.
|
|
7751
|
-
* @param value The string to strip invisible characters from
|
|
7752
|
-
* @returns The string with invisible characters removed
|
|
7753
|
-
*/
|
|
7754
|
-
export function stripInvisibleUnicode(value: string): string;
|
|
7755
|
-
|
|
7756
7744
|
/**
|
|
7757
7745
|
* Parse a table into a two dimensions array of TD elements. For those merged cells, the value will be null.
|
|
7758
7746
|
* @param table Input HTML Table element
|
|
@@ -10803,6 +10791,56 @@ export class AnnouncePlugin implements EditorPlugin {
|
|
|
10803
10791
|
onPluginEvent(event: PluginEvent): void;
|
|
10804
10792
|
}
|
|
10805
10793
|
|
|
10794
|
+
/**
|
|
10795
|
+
* DragAndDrop plugin, handles ContentChanged event when change source is "Drop"
|
|
10796
|
+
* to sanitize dropped content, similar to how PastePlugin sanitizes pasted content.
|
|
10797
|
+
*/
|
|
10798
|
+
export class DragAndDropPlugin implements EditorPlugin {
|
|
10799
|
+
private editor;
|
|
10800
|
+
private forbiddenElements;
|
|
10801
|
+
private isInternalDragging;
|
|
10802
|
+
private disposer;
|
|
10803
|
+
/**
|
|
10804
|
+
* Construct a new instance of DragAndDropPlugin
|
|
10805
|
+
*/
|
|
10806
|
+
constructor(options?: DragAndDropOptions);
|
|
10807
|
+
/**
|
|
10808
|
+
* Get name of this plugin
|
|
10809
|
+
*/
|
|
10810
|
+
getName(): string;
|
|
10811
|
+
/**
|
|
10812
|
+
* The first method that editor will call to a plugin when editor is initializing.
|
|
10813
|
+
* It will pass in the editor instance, plugin should take this chance to save the
|
|
10814
|
+
* editor reference so that it can call to any editor method or format API later.
|
|
10815
|
+
* @param editor The editor object
|
|
10816
|
+
*/
|
|
10817
|
+
initialize(editor: IEditor): void;
|
|
10818
|
+
/**
|
|
10819
|
+
* The last method that editor will call to a plugin before it is disposed.
|
|
10820
|
+
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
10821
|
+
* called, plugin should not call to any editor method since it will result in error.
|
|
10822
|
+
*/
|
|
10823
|
+
dispose(): void;
|
|
10824
|
+
/**
|
|
10825
|
+
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
10826
|
+
* method of each plugin to handle the event as long as the event is not handled
|
|
10827
|
+
* exclusively by another plugin.
|
|
10828
|
+
* @param event The event to handle:
|
|
10829
|
+
*/
|
|
10830
|
+
onPluginEvent(event: PluginEvent): void;
|
|
10831
|
+
}
|
|
10832
|
+
|
|
10833
|
+
/**
|
|
10834
|
+
* Options for DragAndDrop plugin
|
|
10835
|
+
*/
|
|
10836
|
+
export interface DragAndDropOptions {
|
|
10837
|
+
/**
|
|
10838
|
+
* Forbidden elements that cannot be dropped in the editor
|
|
10839
|
+
* @default ['iframe']
|
|
10840
|
+
*/
|
|
10841
|
+
forbiddenElements?: string[];
|
|
10842
|
+
}
|
|
10843
|
+
|
|
10806
10844
|
/**
|
|
10807
10845
|
* Get dark mode color for a given color
|
|
10808
10846
|
* @param color The color to calculate from
|