roosterjs 9.58.0 → 9.60.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 -1
- 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 -1
- 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 +96 -8
- package/dist/rooster-amd.js +772 -290
- 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-min.js +1 -1
- package/dist/rooster-react-amd-min.js.map +1 -1
- package/dist/rooster-react-amd.d.ts +1 -1
- package/dist/rooster-react-amd.js +5 -7
- package/dist/rooster-react-amd.js.map +1 -1
- package/dist/rooster-react-min.js +1 -1
- package/dist/rooster-react-min.js.map +1 -1
- package/dist/rooster-react.d.ts +1 -1
- package/dist/rooster-react.js +58 -60
- package/dist/rooster-react.js.map +1 -1
- package/dist/rooster.d.ts +96 -8
- package/dist/rooster.js +772 -290
- 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.60.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -3910,10 +3910,6 @@ export type ExperimentalFeature = GraduatedExperimentalFeature
|
|
|
3910
3910
|
* the original formatting of the selection marker is kept to match the pending format.
|
|
3911
3911
|
*/
|
|
3912
3912
|
| 'KeepSelectionMarkerWhenEnteringTextNode'
|
|
3913
|
-
/**
|
|
3914
|
-
* Transform the table border colors when switching from light to dark mode
|
|
3915
|
-
*/
|
|
3916
|
-
| 'TransformTableBorderColors'
|
|
3917
3913
|
/**
|
|
3918
3914
|
* When the editor content div is inside a Shadow DOM, enable shadow root detection
|
|
3919
3915
|
* in DOMHelper so that selection, focus, and element appending work correctly within
|
|
@@ -3970,7 +3966,12 @@ export type GraduatedExperimentalFeature = /**
|
|
|
3970
3966
|
* @deprecated
|
|
3971
3967
|
* Allow caching list item elements.
|
|
3972
3968
|
*/
|
|
3973
|
-
| 'CacheList'
|
|
3969
|
+
| 'CacheList'
|
|
3970
|
+
/**
|
|
3971
|
+
* @deprecated
|
|
3972
|
+
* Transform the table border colors when switching from light to dark mode
|
|
3973
|
+
*/
|
|
3974
|
+
| 'TransformTableBorderColors';
|
|
3974
3975
|
|
|
3975
3976
|
/**
|
|
3976
3977
|
* Options for editor
|
|
@@ -4935,6 +4936,10 @@ export interface EditorEnvironment {
|
|
|
4935
4936
|
* Whether current browser is on mobile or a tablet
|
|
4936
4937
|
*/
|
|
4937
4938
|
readonly isMobileOrTablet?: boolean;
|
|
4939
|
+
/**
|
|
4940
|
+
* Whether current browser supports touch input
|
|
4941
|
+
*/
|
|
4942
|
+
readonly isTouchSupported?: boolean;
|
|
4938
4943
|
/**
|
|
4939
4944
|
* Settings used by DOM to Content Model conversion
|
|
4940
4945
|
*/
|
|
@@ -6045,7 +6050,9 @@ export interface LinkData {
|
|
|
6045
6050
|
*/
|
|
6046
6051
|
export interface MergeModelOption {
|
|
6047
6052
|
/**
|
|
6048
|
-
* When there is only a table to merge, whether merge this table into current table
|
|
6053
|
+
* When there is only a table to merge, whether to merge this table into the current table,
|
|
6054
|
+
* or into the table immediately before the insert position. Otherwise, insert it as a
|
|
6055
|
+
* separate or nested table.
|
|
6049
6056
|
* This is usually used when paste table inside a table
|
|
6050
6057
|
* @default false
|
|
6051
6058
|
*/
|
|
@@ -7029,6 +7036,49 @@ export interface FindResultChangedEvent extends BasePluginEvent<'findResultChang
|
|
|
7029
7036
|
readonly alternativeRange?: Range | null;
|
|
7030
7037
|
}
|
|
7031
7038
|
|
|
7039
|
+
/**
|
|
7040
|
+
* An optional global hook for developer tools (such as the RoosterJS DevTools browser extension) to
|
|
7041
|
+
* discover and inspect editor instances on a page.
|
|
7042
|
+
*
|
|
7043
|
+
* A developer tool installs an object implementing this interface on
|
|
7044
|
+
* `window.__ROOSTERJS_DEVTOOLS_HOOK__`. When present, each editor will call its callbacks on
|
|
7045
|
+
* creation, disposal and for every plugin event. This mirrors the React DevTools global hook
|
|
7046
|
+
* pattern: the editor only detects and calls the hook, while all developer-tools logic lives in the
|
|
7047
|
+
* tool that installs it.
|
|
7048
|
+
*
|
|
7049
|
+
* For tools that attach after editors are created (for example, a script pasted into the console),
|
|
7050
|
+
* the library also maintains the array of live editors on `window.__ROOSTERJS_DEVTOOLS_EDITORS__`.
|
|
7051
|
+
*
|
|
7052
|
+
* All members are optional so the contract can grow without breaking older tools. The editor calls
|
|
7053
|
+
* each callback defensively and swallows any error, so a faulty tool can never break editing.
|
|
7054
|
+
*/
|
|
7055
|
+
export interface RoosterJsDevToolsHook {
|
|
7056
|
+
/**
|
|
7057
|
+
* The contract version the editor was built against. The editor stamps this onto the hook when
|
|
7058
|
+
* it detects it, so a tool can read it to stay compatible across editor versions. The current
|
|
7059
|
+
* contract version is exported as `RoosterJsDevToolsHookVersion` from
|
|
7060
|
+
* `roosterjs-content-model-core`.
|
|
7061
|
+
*/
|
|
7062
|
+
version?: number;
|
|
7063
|
+
/**
|
|
7064
|
+
* Called right after an editor finishes initialization.
|
|
7065
|
+
* @param editor The editor that was created
|
|
7066
|
+
*/
|
|
7067
|
+
onEditorCreated?: (editor: IEditor) => void;
|
|
7068
|
+
/**
|
|
7069
|
+
* Called right before an editor is disposed.
|
|
7070
|
+
* @param editor The editor that is being disposed
|
|
7071
|
+
*/
|
|
7072
|
+
onEditorDisposed?: (editor: IEditor) => void;
|
|
7073
|
+
/**
|
|
7074
|
+
* Called for every plugin event dispatched by an editor, so a tool can react to content and
|
|
7075
|
+
* selection changes. Tools are expected to filter and debounce as needed.
|
|
7076
|
+
* @param editor The editor that dispatched the event
|
|
7077
|
+
* @param event The plugin event being dispatched
|
|
7078
|
+
*/
|
|
7079
|
+
onPluginEvent?: (editor: IEditor, event: PluginEvent) => void;
|
|
7080
|
+
}
|
|
7081
|
+
|
|
7032
7082
|
/**
|
|
7033
7083
|
* Create Content Model from DOM tree in this editor
|
|
7034
7084
|
* @param root Root element of DOM tree to create Content Model from
|
|
@@ -8216,6 +8266,16 @@ export function cloneModel(model: ReadonlyContentModelDocument, options?: CloneM
|
|
|
8216
8266
|
*/
|
|
8217
8267
|
export function cloneModelForPaste(model: ReadonlyContentModelDocument): ContentModelDocument;
|
|
8218
8268
|
|
|
8269
|
+
/**
|
|
8270
|
+
* Check whether the given range of table cells can be merged without splitting existing spans.
|
|
8271
|
+
* @param rows The table rows to check
|
|
8272
|
+
* @param firstRow The first row index of the range
|
|
8273
|
+
* @param firstCol The first column index of the range
|
|
8274
|
+
* @param lastRow The last row index of the range
|
|
8275
|
+
* @param lastCol The last column index of the range
|
|
8276
|
+
*/
|
|
8277
|
+
export function canMergeCells(rows: readonly ReadonlyContentModelTableRow[], firstRow: number, firstCol: number, lastRow: number, lastCol: number): boolean;
|
|
8278
|
+
|
|
8219
8279
|
/**
|
|
8220
8280
|
* Merge source model into target mode
|
|
8221
8281
|
* @param target Target Content Model that will merge content into
|
|
@@ -8998,6 +9058,17 @@ export function paste(editor: IEditor, clipboardData: ClipboardData, pasteTypeOr
|
|
|
8998
9058
|
*/
|
|
8999
9059
|
export function getContentForCopy(editor: IEditor, isCut: boolean, event: ClipboardEvent): TextAndHtmlContentForCopy | null;
|
|
9000
9060
|
|
|
9061
|
+
/**
|
|
9062
|
+
* The current version of the RoosterJS DevTools hook contract (see
|
|
9063
|
+
* {@link RoosterJsDevToolsHook}). The editor stamps this onto the installed hook so a developer
|
|
9064
|
+
* tool can adapt to the editor's capabilities. Bump this whenever the shape of the contract changes
|
|
9065
|
+
* in a way tools may need to detect.
|
|
9066
|
+
*
|
|
9067
|
+
* History:
|
|
9068
|
+
* - 1: onEditorCreated, onEditorDisposed, onPluginEvent
|
|
9069
|
+
*/
|
|
9070
|
+
export const RoosterJsDevToolsHookVersion: number;
|
|
9071
|
+
|
|
9001
9072
|
/**
|
|
9002
9073
|
* Insert table into editor at current selection
|
|
9003
9074
|
* @param editor The editor instance
|
|
@@ -9034,6 +9105,7 @@ export function editTable(editor: IEditor, operation: TableOperation): void;
|
|
|
9034
9105
|
|
|
9035
9106
|
/**
|
|
9036
9107
|
* Operations to apply border
|
|
9108
|
+
* Remove the targeted borders instead if they all already match the requested format.
|
|
9037
9109
|
* @param editor The editor instance
|
|
9038
9110
|
* @param border The border to apply
|
|
9039
9111
|
* @param operation The operation to apply
|
|
@@ -9470,6 +9542,12 @@ export function findListItemsInSameThread(group: ReadonlyContentModelBlockGroup,
|
|
|
9470
9542
|
*/
|
|
9471
9543
|
export function setModelIndentation(model: ReadonlyContentModelDocument, indentation: 'indent' | 'outdent', length?: number, context?: FormatContentModelContext): boolean;
|
|
9472
9544
|
|
|
9545
|
+
/**
|
|
9546
|
+
* Determine text direction from the first strong directional character
|
|
9547
|
+
* @param text Text to scan
|
|
9548
|
+
*/
|
|
9549
|
+
export function getTextDirection(text: string): 'ltr' | 'rtl' | undefined;
|
|
9550
|
+
|
|
9473
9551
|
/**
|
|
9474
9552
|
* Try to match a given string with link match rules, return matched link
|
|
9475
9553
|
* @param url Input url to match
|
|
@@ -9570,12 +9648,14 @@ export class TableEditPlugin implements EditorPlugin {
|
|
|
9570
9648
|
*/
|
|
9571
9649
|
onPluginEvent(e: PluginEvent): void;
|
|
9572
9650
|
private onMouseMove;
|
|
9651
|
+
private onTouchStart;
|
|
9652
|
+
private updateTableEditor;
|
|
9573
9653
|
/**
|
|
9574
9654
|
* @internal Public only for unit test
|
|
9575
9655
|
* @param entry Table to use when setting the Editors
|
|
9576
9656
|
* @param event (Optional) Mouse event
|
|
9577
9657
|
*/
|
|
9578
|
-
setTableEditor(entry: TableWithRoot | null, event?:
|
|
9658
|
+
setTableEditor(entry: TableWithRoot | null, event?: Event): void;
|
|
9579
9659
|
private invalidateTableRects;
|
|
9580
9660
|
private disposeTableEditor;
|
|
9581
9661
|
private ensureTableRects;
|
|
@@ -9798,6 +9878,7 @@ export interface HandleTabOptions {
|
|
|
9798
9878
|
export class AutoFormatPlugin implements EditorPlugin {
|
|
9799
9879
|
private options;
|
|
9800
9880
|
private editor;
|
|
9881
|
+
private blockDirections;
|
|
9801
9882
|
/**
|
|
9802
9883
|
* @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
|
|
9803
9884
|
* - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to false.
|
|
@@ -9811,6 +9892,7 @@ export class AutoFormatPlugin implements EditorPlugin {
|
|
|
9811
9892
|
* - autoTel: A boolean that enables or disables automatic hyperlink telephone numbers transformation. Defaults to false.
|
|
9812
9893
|
* - autoMailto: A boolean that enables or disables automatic hyperlink email address transformation. Defaults to false.
|
|
9813
9894
|
* - autoHorizontalLine: A boolean that enables or disables automatic horizontal line creation. Defaults to false.
|
|
9895
|
+
* - autoDirection: A boolean that enables or disables automatic text direction. Defaults to false.
|
|
9814
9896
|
*/
|
|
9815
9897
|
constructor(options?: AutoFormatOptions);
|
|
9816
9898
|
/**
|
|
@@ -9845,6 +9927,8 @@ export class AutoFormatPlugin implements EditorPlugin {
|
|
|
9845
9927
|
private enterFeatures;
|
|
9846
9928
|
private handleKeyboardEvents;
|
|
9847
9929
|
private handleEditorInputEvent;
|
|
9930
|
+
private handleCompositionEndEvent;
|
|
9931
|
+
private handleAutoDirection;
|
|
9848
9932
|
private handleKeyDownEvent;
|
|
9849
9933
|
private handleContentChangedEvent;
|
|
9850
9934
|
}
|
|
@@ -9881,6 +9965,10 @@ export interface AutoFormatOptions extends AutoLinkOptions {
|
|
|
9881
9965
|
* Auto Horizontal line
|
|
9882
9966
|
*/
|
|
9883
9967
|
autoHorizontalLine?: boolean;
|
|
9968
|
+
/**
|
|
9969
|
+
* Automatically update block direction based on the first strong directional character
|
|
9970
|
+
*/
|
|
9971
|
+
autoDirection?: boolean;
|
|
9884
9972
|
}
|
|
9885
9973
|
|
|
9886
9974
|
/**
|