roosterjs 9.32.0 → 9.34.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 +11 -4
- 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 +11 -4
- 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 +94 -9
- package/dist/rooster-amd.js +385 -69
- 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 +94 -9
- package/dist/rooster.js +385 -69
- 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.34.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -41,7 +41,7 @@ interface ReadonlyContentModelWithFormat<T extends ContentModelFormatBase> {
|
|
|
41
41
|
/**
|
|
42
42
|
* Format of Table
|
|
43
43
|
*/
|
|
44
|
-
type ContentModelTableFormat = ContentModelBlockFormat & IdFormat & AriaFormat & BorderFormat & BorderBoxFormat & SpacingFormat & MarginFormat & DisplayFormat & TableLayoutFormat & SizeFormat;
|
|
44
|
+
type ContentModelTableFormat = ContentModelBlockFormat & IdFormat & AriaFormat & BorderFormat & BorderBoxFormat & DirectionFormat & SpacingFormat & MarginFormat & DisplayFormat & TableLayoutFormat & SizeFormat;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Represents base format of an element that supports dataset and/or metadata
|
|
@@ -2560,6 +2560,33 @@ interface ModelToDomSettings {
|
|
|
2560
2560
|
* Map of metadata appliers
|
|
2561
2561
|
*/
|
|
2562
2562
|
metadataAppliers: MetadataAppliers;
|
|
2563
|
+
/**
|
|
2564
|
+
* Default format for each tag name used for generating DOM tree from content model.
|
|
2565
|
+
*
|
|
2566
|
+
* This map defines the default implicit formats for specific HTML tag names. It is used during
|
|
2567
|
+
* the conversion of a content model to a DOM tree to ensure that elements are styled correctly
|
|
2568
|
+
* based on their tag name. Each entry in the map associates a tag name (in lowercase) with a
|
|
2569
|
+
* combination of segment and block formats.
|
|
2570
|
+
*
|
|
2571
|
+
* Example:
|
|
2572
|
+
* {
|
|
2573
|
+
* "p": {
|
|
2574
|
+
* fontSize: "12px",
|
|
2575
|
+
* lineHeight: "1.5",
|
|
2576
|
+
* marginTop: "10px",
|
|
2577
|
+
* marginBottom: "10px"
|
|
2578
|
+
* },
|
|
2579
|
+
* "h1": {
|
|
2580
|
+
* fontSize: "24px",
|
|
2581
|
+
* fontWeight: "bold",
|
|
2582
|
+
* marginTop: "20px",
|
|
2583
|
+
* marginBottom: "20px"
|
|
2584
|
+
* }
|
|
2585
|
+
* }
|
|
2586
|
+
*/
|
|
2587
|
+
defaultContentModelFormatMap: {
|
|
2588
|
+
[tagName: string]: ContentModelSegmentFormat & ContentModelBlockFormat;
|
|
2589
|
+
};
|
|
2563
2590
|
/**
|
|
2564
2591
|
* Default Content Model to DOM handlers before overriding.
|
|
2565
2592
|
* This provides a way to call original handler from an overridden handler function
|
|
@@ -2732,6 +2759,10 @@ interface DomToModelSettings {
|
|
|
2732
2759
|
* This provides a way to call original format parser from an overridden parser function
|
|
2733
2760
|
*/
|
|
2734
2761
|
defaultFormatParsers: Readonly<FormatParsers>;
|
|
2762
|
+
/**
|
|
2763
|
+
* If true elements that has display:none style will be processed
|
|
2764
|
+
*/
|
|
2765
|
+
processNonVisibleElements?: boolean;
|
|
2735
2766
|
}
|
|
2736
2767
|
|
|
2737
2768
|
/**
|
|
@@ -3070,6 +3101,10 @@ interface DomToModelOption {
|
|
|
3070
3101
|
* Provide additional format parsers for each format type
|
|
3071
3102
|
*/
|
|
3072
3103
|
additionalFormatParsers?: Partial<FormatParsersPerCategory>;
|
|
3104
|
+
/**
|
|
3105
|
+
* If true elements that has display:none style will be processed
|
|
3106
|
+
*/
|
|
3107
|
+
processNonVisibleElements?: boolean;
|
|
3073
3108
|
}
|
|
3074
3109
|
|
|
3075
3110
|
/**
|
|
@@ -3137,6 +3172,31 @@ interface ModelToDomOption {
|
|
|
3137
3172
|
* When set to true, selection from content model will not be applied
|
|
3138
3173
|
*/
|
|
3139
3174
|
ignoreSelection?: boolean;
|
|
3175
|
+
/**
|
|
3176
|
+
* Overrides the default content model formats for specific HTML tags.
|
|
3177
|
+
*
|
|
3178
|
+
* This property allows you to specify custom formats for both segment and block-level
|
|
3179
|
+
* content models for specific tags. The key is the tag name (e.g., 'div', 'span'),
|
|
3180
|
+
* and the value is an object containing both segment and block format overrides.
|
|
3181
|
+
*
|
|
3182
|
+
* Example:
|
|
3183
|
+
* ```
|
|
3184
|
+
* defaultContentModelFormatOverride: {
|
|
3185
|
+
* div: {
|
|
3186
|
+
* fontSize: '16px',
|
|
3187
|
+
* textAlign: 'center',
|
|
3188
|
+
* backgroundColor: 'lightblue',
|
|
3189
|
+
* },
|
|
3190
|
+
* span: {
|
|
3191
|
+
* fontWeight: 'bold',
|
|
3192
|
+
* color: 'red',
|
|
3193
|
+
* },
|
|
3194
|
+
* }
|
|
3195
|
+
* ```
|
|
3196
|
+
*/
|
|
3197
|
+
defaultContentModelFormatOverride?: {
|
|
3198
|
+
[tagName: string]: ContentModelSegmentFormat & ContentModelBlockFormat;
|
|
3199
|
+
};
|
|
3140
3200
|
}
|
|
3141
3201
|
|
|
3142
3202
|
/**
|
|
@@ -3624,7 +3684,11 @@ type ExperimentalFeature = /**
|
|
|
3624
3684
|
* selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures
|
|
3625
3685
|
* the original formatting of the selection marker is kept to match the pending format.
|
|
3626
3686
|
*/
|
|
3627
|
-
| 'KeepSelectionMarkerWhenEnteringTextNode'
|
|
3687
|
+
| 'KeepSelectionMarkerWhenEnteringTextNode'
|
|
3688
|
+
/**
|
|
3689
|
+
* Export editor content as HTML using HTMLFast option
|
|
3690
|
+
*/
|
|
3691
|
+
| 'ExportHTMLFast';
|
|
3628
3692
|
|
|
3629
3693
|
/**
|
|
3630
3694
|
* Options for editor
|
|
@@ -5210,6 +5274,10 @@ interface DOMEventRecord<E = Event> {
|
|
|
5210
5274
|
* when correlated DOM event is fired
|
|
5211
5275
|
*/
|
|
5212
5276
|
beforeDispatch?: DOMEventHandlerFunction<E> | null;
|
|
5277
|
+
/**
|
|
5278
|
+
* Whether the event should be captured in the capturing phase.
|
|
5279
|
+
*/
|
|
5280
|
+
capture?: boolean;
|
|
5213
5281
|
}
|
|
5214
5282
|
|
|
5215
5283
|
/**
|
|
@@ -5482,8 +5550,10 @@ interface DOMHelper {
|
|
|
5482
5550
|
getClonedRoot(): HTMLElement;
|
|
5483
5551
|
/**
|
|
5484
5552
|
* Get format of the container element
|
|
5553
|
+
* @param isInDarkMode Optional flag to indicate if the environment is in dark mode
|
|
5554
|
+
* @param darkColorHandler Optional DarkColorHandler to retrieve dark mode colors
|
|
5485
5555
|
*/
|
|
5486
|
-
getContainerFormat(): ContentModelSegmentFormat;
|
|
5556
|
+
getContainerFormat(isInDarkMode?: boolean, darkColorHandler?: DarkColorHandler): ContentModelSegmentFormat;
|
|
5487
5557
|
}
|
|
5488
5558
|
|
|
5489
5559
|
/**
|
|
@@ -6504,7 +6574,6 @@ function handleRegularSelection(index: number, context: DomToModelContext, group
|
|
|
6504
6574
|
* @param group The parent block group
|
|
6505
6575
|
* @param parent Parent DOM node to process
|
|
6506
6576
|
* @param context DOM to Content Model context
|
|
6507
|
-
*
|
|
6508
6577
|
*/
|
|
6509
6578
|
function processChildNode(group: ContentModelBlockGroup, child: Node, context: DomToModelContext): void;
|
|
6510
6579
|
|
|
@@ -7144,8 +7213,9 @@ const DeprecatedColors: string[];
|
|
|
7144
7213
|
* @param isBackground True to get background color, false to get text color
|
|
7145
7214
|
* @param isDarkMode Whether element is in dark mode now
|
|
7146
7215
|
* @param darkColorHandler @optional The dark color handler object to help manager dark mode color
|
|
7216
|
+
* @param fallback @optional Fallback color to use if no color is found from the element
|
|
7147
7217
|
*/
|
|
7148
|
-
function getColor(element: HTMLElement, isBackground: boolean, isDarkMode: boolean, darkColorHandler?: DarkColorHandler): string | undefined;
|
|
7218
|
+
function getColor(element: HTMLElement, isBackground: boolean, isDarkMode: boolean, darkColorHandler?: DarkColorHandler, fallback?: string): string | undefined;
|
|
7149
7219
|
|
|
7150
7220
|
/**
|
|
7151
7221
|
* Set color to given HTML element
|
|
@@ -7639,8 +7709,12 @@ function setTableCellBackgroundColor(cell: ShallowMutableContentModelTableCell,
|
|
|
7639
7709
|
* @param pendingFormat Existing pending format, if any
|
|
7640
7710
|
* @param formatState Existing format state object, used for receiving the result
|
|
7641
7711
|
* @param conflictSolution The strategy for handling format conflicts
|
|
7712
|
+
* @param domHelper Optional DOMHelper to retrieve container format
|
|
7713
|
+
* @param isInDarkMode Optional flag to indicate if the environment is in dark mode
|
|
7714
|
+
* @param colorHandler Optional DarkColorHandler to handle dark mode colors
|
|
7715
|
+
*
|
|
7642
7716
|
*/
|
|
7643
|
-
function retrieveModelFormatState(model: ReadonlyContentModelDocument, pendingFormat: ContentModelSegmentFormat | null, formatState: ContentModelFormatState, conflictSolution?: ConflictFormatSolution, domHelper?: DOMHelper): void;
|
|
7717
|
+
function retrieveModelFormatState(model: ReadonlyContentModelDocument, pendingFormat: ContentModelSegmentFormat | null, formatState: ContentModelFormatState, conflictSolution?: ConflictFormatSolution, domHelper?: DOMHelper, isInDarkMode?: boolean, colorHandler?: DarkColorHandler): void;
|
|
7644
7718
|
|
|
7645
7719
|
/**
|
|
7646
7720
|
* Gets the list style type that the bullet is part of, using the Constant record
|
|
@@ -8247,11 +8321,19 @@ function createModelFromHtml(html: string, options?: Partial<DomToModelOptionFor
|
|
|
8247
8321
|
/**
|
|
8248
8322
|
* Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
|
|
8249
8323
|
* @param editor The editor to get content from
|
|
8250
|
-
* @param mode Specify HTML to get
|
|
8324
|
+
* @param mode Specify HTML to get HTML. This is the default option
|
|
8251
8325
|
* @param options @optional Options for Model to DOM conversion
|
|
8252
8326
|
*/
|
|
8253
8327
|
function exportContent(editor: IEditor, mode?: 'HTML', options?: ModelToDomOption): string;
|
|
8254
8328
|
|
|
8329
|
+
/**
|
|
8330
|
+
* Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity.
|
|
8331
|
+
* This is a fast version, it retrieve HTML content directly from editor without going through content model conversion.
|
|
8332
|
+
* @param editor The editor to get content from
|
|
8333
|
+
* @param mode Specify HTMLFast to get HTML result.
|
|
8334
|
+
*/
|
|
8335
|
+
function exportContent(editor: IEditor, mode: 'HTMLFast'): string;
|
|
8336
|
+
|
|
8255
8337
|
/**
|
|
8256
8338
|
* Export plain text content
|
|
8257
8339
|
* @param editor The editor to get content from
|
|
@@ -9786,7 +9868,6 @@ interface CustomReplace {
|
|
|
9786
9868
|
* - Flip image
|
|
9787
9869
|
*/
|
|
9788
9870
|
class ImageEditPlugin implements ImageEditor, EditorPlugin {
|
|
9789
|
-
protected options: ImageEditOptions;
|
|
9790
9871
|
protected editor: IEditor | null;
|
|
9791
9872
|
private shadowSpan;
|
|
9792
9873
|
private selectedImage;
|
|
@@ -9804,6 +9885,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
|
|
|
9804
9885
|
private zoomScale;
|
|
9805
9886
|
private disposer;
|
|
9806
9887
|
protected isEditing: boolean;
|
|
9888
|
+
protected options: ImageEditOptions;
|
|
9807
9889
|
constructor(options?: ImageEditOptions);
|
|
9808
9890
|
/**
|
|
9809
9891
|
* Get name of this plugin
|
|
@@ -9844,7 +9926,10 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
|
|
|
9844
9926
|
*/
|
|
9845
9927
|
protected applyFormatWithContentModel(editor: IEditor, isCropMode: boolean, shouldSelectImage: boolean, isApiOperation?: boolean): void;
|
|
9846
9928
|
private startEditing;
|
|
9929
|
+
private updateImageDimensionsIfZero;
|
|
9930
|
+
private startEditingInternal;
|
|
9847
9931
|
startRotateAndResize(editor: IEditor, image: HTMLImageElement): void;
|
|
9932
|
+
private updateResizeHandleDirection;
|
|
9848
9933
|
private updateRotateHandleState;
|
|
9849
9934
|
isOperationAllowed(operation: ImageEditOperation): boolean;
|
|
9850
9935
|
canRegenerateImage(image: HTMLImageElement): boolean;
|