roosterjs 8.40.2 → 8.41.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-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +89 -9
- package/dist/rooster-amd.js +338 -194
- 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.d.ts +89 -9
- package/dist/rooster.js +338 -194
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 8.
|
|
1
|
+
// Type definitions for roosterjs (Version 8.41.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -395,8 +395,10 @@ function getBrowserInfo(userAgent: string, appVersion: string, vendor?: string):
|
|
|
395
395
|
* Apply format to an HTML element
|
|
396
396
|
* @param element The HTML element to apply format to
|
|
397
397
|
* @param format The format to apply
|
|
398
|
+
* @param isDarkMode Whether the content should be formatted in dark mode
|
|
399
|
+
* @param darkColorHandler An optional dark color handler object. When it is passed, we will use this handler to do variable-based dark color instead of original dataset base dark color
|
|
398
400
|
*/
|
|
399
|
-
function applyFormat(element: HTMLElement, format: DefaultFormat, isDarkMode?: boolean): void;
|
|
401
|
+
function applyFormat(element: HTMLElement, format: DefaultFormat, isDarkMode?: boolean, darkColorHandler?: DarkColorHandler | null): void;
|
|
400
402
|
|
|
401
403
|
/**
|
|
402
404
|
* Change tag of an HTML Element to a new one, and replace it from DOM tree
|
|
@@ -684,9 +686,9 @@ function getInnerHTML(node: HTMLElement | DocumentFragment): string;
|
|
|
684
686
|
* @param isBackgroundColor Whether set background color or text color
|
|
685
687
|
* @param isDarkMode Whether current mode is dark mode. @default false
|
|
686
688
|
* @param shouldAdaptTheFontColor Whether the font color needs to be adapted to be visible in a dark or bright background color. @default false
|
|
687
|
-
* @param
|
|
689
|
+
* @param darkColorHandler An optional dark color handler object. When it is passed, we will use this handler to do variable-based dark color instead of original dataset base dark color
|
|
688
690
|
*/
|
|
689
|
-
function setColor(element: HTMLElement, color: string | ModeIndependentColor, isBackgroundColor: boolean, isDarkMode?: boolean, shouldAdaptTheFontColor?: boolean): void;
|
|
691
|
+
function setColor(element: HTMLElement, color: string | ModeIndependentColor, isBackgroundColor: boolean, isDarkMode?: boolean, shouldAdaptTheFontColor?: boolean, darkColorHandler?: DarkColorHandler | null): void;
|
|
690
692
|
|
|
691
693
|
/**
|
|
692
694
|
* A wrapper function of Element.matches
|
|
@@ -2237,6 +2239,10 @@ class Editor implements IEditor {
|
|
|
2237
2239
|
* @param node The node to transform
|
|
2238
2240
|
*/
|
|
2239
2241
|
transformToDarkColor(node: Node): void;
|
|
2242
|
+
/**
|
|
2243
|
+
* Get a darkColorHandler object for this editor. It will return null if experimental feature "VariableBasedDarkColor" is not enabled
|
|
2244
|
+
*/
|
|
2245
|
+
getDarkColorHandler(): DarkColorHandler | null;
|
|
2240
2246
|
/**
|
|
2241
2247
|
* Make the editor in "Shadow Edit" mode.
|
|
2242
2248
|
* In Shadow Edit mode, all format change will finally be ignored.
|
|
@@ -3686,7 +3692,13 @@ const enum ExperimentalFeatures {
|
|
|
3686
3692
|
* When apply default format when initialize or user type, apply the format on a SPAN element rather than
|
|
3687
3693
|
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
3688
3694
|
*/
|
|
3689
|
-
DefaultFormatInSpan = "DefaultFormatInSpan"
|
|
3695
|
+
DefaultFormatInSpan = "DefaultFormatInSpan",
|
|
3696
|
+
/**
|
|
3697
|
+
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
3698
|
+
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
3699
|
+
* if you need them work for dark mode
|
|
3700
|
+
*/
|
|
3701
|
+
VariableBasedDarkColor = "VariableBasedDarkColor"
|
|
3690
3702
|
}
|
|
3691
3703
|
|
|
3692
3704
|
/**
|
|
@@ -5286,6 +5298,10 @@ interface ElementBasedFormatState {
|
|
|
5286
5298
|
* Whether the text is in block quote
|
|
5287
5299
|
*/
|
|
5288
5300
|
isBlockQuote?: boolean;
|
|
5301
|
+
/**
|
|
5302
|
+
* Whether the text is in Code block
|
|
5303
|
+
*/
|
|
5304
|
+
isCodeBlock?: boolean;
|
|
5289
5305
|
/**
|
|
5290
5306
|
* Whether unlink command can be called to the text
|
|
5291
5307
|
*/
|
|
@@ -5314,6 +5330,10 @@ interface ElementBasedFormatState {
|
|
|
5314
5330
|
* If there is a table, whether the table has header row
|
|
5315
5331
|
*/
|
|
5316
5332
|
tableHasHeader?: boolean;
|
|
5333
|
+
/**
|
|
5334
|
+
* Whether we can execute table cell merge operation
|
|
5335
|
+
*/
|
|
5336
|
+
canMergeTableCell?: boolean;
|
|
5317
5337
|
}
|
|
5318
5338
|
|
|
5319
5339
|
/**
|
|
@@ -6536,6 +6556,10 @@ interface IEditor {
|
|
|
6536
6556
|
* @param node The node to transform
|
|
6537
6557
|
*/
|
|
6538
6558
|
transformToDarkColor(node: Node): void;
|
|
6559
|
+
/**
|
|
6560
|
+
* Get a darkColorHandler object for this editor. It will return null if experimental feature "VariableBasedDarkColor" is not enabled
|
|
6561
|
+
*/
|
|
6562
|
+
getDarkColorHandler(): DarkColorHandler | null;
|
|
6539
6563
|
/**
|
|
6540
6564
|
* Make the editor in "Shadow Edit" mode.
|
|
6541
6565
|
* In Shadow Edit mode, all format change will finally be ignored.
|
|
@@ -6588,6 +6612,48 @@ interface IEditor {
|
|
|
6588
6612
|
getVisibleViewport(): Rect | null;
|
|
6589
6613
|
}
|
|
6590
6614
|
|
|
6615
|
+
/**
|
|
6616
|
+
* A handler object for dark color, used for variable-based dark color solution
|
|
6617
|
+
*/
|
|
6618
|
+
interface DarkColorHandler {
|
|
6619
|
+
/**
|
|
6620
|
+
* Given a light mode color value and an optional dark mode color value, register this color
|
|
6621
|
+
* so that editor can handle it, then return the CSS color value for current color mode.
|
|
6622
|
+
* @param lightModeColor Light mode color value
|
|
6623
|
+
* @param isDarkMode Whether current color mode is dark mode
|
|
6624
|
+
* @param darkModeColor Optional dark mode color value. If not passed, we will calculate one.
|
|
6625
|
+
*/
|
|
6626
|
+
registerColor(lightModeColor: string, isDarkMode: boolean, darkModeColor?: string): string;
|
|
6627
|
+
/**
|
|
6628
|
+
* Reset known color record, clean up registered color variables.
|
|
6629
|
+
*/
|
|
6630
|
+
reset(): void;
|
|
6631
|
+
/**
|
|
6632
|
+
* Parse an existing color value, if it is in variable-based color format, extract color key,
|
|
6633
|
+
* light color and query related dark color if any
|
|
6634
|
+
* @param color The color string to parse
|
|
6635
|
+
*/
|
|
6636
|
+
parseColorValue(color: string | null | undefined): ColorKeyAndValue;
|
|
6637
|
+
}
|
|
6638
|
+
|
|
6639
|
+
/**
|
|
6640
|
+
* Represents a combination of color key, light color and dark color, parsed from existing color value
|
|
6641
|
+
*/
|
|
6642
|
+
interface ColorKeyAndValue {
|
|
6643
|
+
/**
|
|
6644
|
+
* Key of color, if found, otherwise undefined
|
|
6645
|
+
*/
|
|
6646
|
+
key?: string;
|
|
6647
|
+
/**
|
|
6648
|
+
* Light mode color value
|
|
6649
|
+
*/
|
|
6650
|
+
lightModeColor: string;
|
|
6651
|
+
/**
|
|
6652
|
+
* Dark mode color value, if found, otherwise undefined
|
|
6653
|
+
*/
|
|
6654
|
+
darkModeColor?: string;
|
|
6655
|
+
}
|
|
6656
|
+
|
|
6591
6657
|
/**
|
|
6592
6658
|
* ContentEditFeature interface that handles keyboard event
|
|
6593
6659
|
*/
|
|
@@ -6811,6 +6877,11 @@ interface EditorCore extends PluginState {
|
|
|
6811
6877
|
* Color of the border of a selectedImage. Default color: '#DB626C'
|
|
6812
6878
|
*/
|
|
6813
6879
|
imageSelectionBorderColor?: string;
|
|
6880
|
+
/**
|
|
6881
|
+
* Dark model handler for the editor, used for variable-based solution.
|
|
6882
|
+
* If keep it null, editor will still use original dataset-based dark mode solution.
|
|
6883
|
+
*/
|
|
6884
|
+
darkColorHandler?: DarkColorHandler;
|
|
6814
6885
|
}
|
|
6815
6886
|
|
|
6816
6887
|
/**
|
|
@@ -8139,7 +8210,13 @@ enum CompatibleExperimentalFeatures {
|
|
|
8139
8210
|
* When apply default format when initialize or user type, apply the format on a SPAN element rather than
|
|
8140
8211
|
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
8141
8212
|
*/
|
|
8142
|
-
DefaultFormatInSpan = "DefaultFormatInSpan"
|
|
8213
|
+
DefaultFormatInSpan = "DefaultFormatInSpan",
|
|
8214
|
+
/**
|
|
8215
|
+
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
8216
|
+
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
8217
|
+
* if you need them work for dark mode
|
|
8218
|
+
*/
|
|
8219
|
+
VariableBasedDarkColor = "VariableBasedDarkColor"
|
|
8143
8220
|
}
|
|
8144
8221
|
|
|
8145
8222
|
/**
|
|
@@ -9749,9 +9826,13 @@ class ImageEdit implements EditorPlugin {
|
|
|
9749
9826
|
*/
|
|
9750
9827
|
private wasResized;
|
|
9751
9828
|
/**
|
|
9752
|
-
*
|
|
9829
|
+
* The span element that wraps the image and opens shadow dom
|
|
9830
|
+
*/
|
|
9831
|
+
private shadowSpan;
|
|
9832
|
+
/**
|
|
9833
|
+
* The span element that wraps the image and opens shadow dom
|
|
9753
9834
|
*/
|
|
9754
|
-
private
|
|
9835
|
+
private isCropping;
|
|
9755
9836
|
/**
|
|
9756
9837
|
* Create a new instance of ImageEdit
|
|
9757
9838
|
* @param options Image editing options
|
|
@@ -9806,7 +9887,6 @@ class ImageEdit implements EditorPlugin {
|
|
|
9806
9887
|
* Create editing wrapper for the image
|
|
9807
9888
|
*/
|
|
9808
9889
|
private createWrapper;
|
|
9809
|
-
private toggleImageVisibility;
|
|
9810
9890
|
private insertImageWrapper;
|
|
9811
9891
|
/**
|
|
9812
9892
|
* Remove the temp wrapper of the image
|