roosterjs 8.46.0 → 8.47.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 +128 -28
- package/dist/rooster-amd.js +210 -251
- 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 +128 -28
- package/dist/rooster.js +210 -251
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster.js
CHANGED
|
@@ -2908,6 +2908,7 @@ var canMergeTableCell = function (editor) {
|
|
|
2908
2908
|
|
|
2909
2909
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2910
2910
|
var commitListChains_1 = __webpack_require__(/*! ../utils/commitListChains */ "./packages/roosterjs-editor-api/lib/utils/commitListChains.ts");
|
|
2911
|
+
var getFormatState_1 = __webpack_require__(/*! ./getFormatState */ "./packages/roosterjs-editor-api/lib/format/getFormatState.ts");
|
|
2911
2912
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
2912
2913
|
/**
|
|
2913
2914
|
* Insert an entity into editor.
|
|
@@ -2920,10 +2921,13 @@ var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./
|
|
|
2920
2921
|
* If isBlock is true, entity will be insert below this position
|
|
2921
2922
|
* @param insertToRegionRoot @optional When pass true, insert the entity at the root level of current region.
|
|
2922
2923
|
* Parent nodes will be split if need
|
|
2924
|
+
* @param focusAfterEntity @optional When pass true, focus will be moved next to the entity. For inline entity,
|
|
2925
|
+
* focus will be after right after the entity (and the delimiter if exist). For block entity, focus will be in
|
|
2926
|
+
* the new empty line below the entity
|
|
2923
2927
|
*/
|
|
2924
|
-
function insertEntity(editor, type, contentNode, isBlock, isReadonly, position, insertToRegionRoot) {
|
|
2928
|
+
function insertEntity(editor, type, contentNode, isBlock, isReadonly, position, insertToRegionRoot, focusAfterEntity) {
|
|
2925
2929
|
var _a;
|
|
2926
|
-
var wrapper = (0, roosterjs_editor_dom_1.wrap)(contentNode, isBlock ? '
|
|
2930
|
+
var wrapper = (0, roosterjs_editor_dom_1.wrap)(contentNode, isBlock ? 'div' : 'span');
|
|
2927
2931
|
// For inline & readonly entity, we need to set display to "inline-block" otherwise
|
|
2928
2932
|
// there will be some weird behavior when move cursor around the entity node.
|
|
2929
2933
|
// And we should only do this for readonly entity since "inline-block" has some side effect
|
|
@@ -2934,6 +2938,7 @@ function insertEntity(editor, type, contentNode, isBlock, isReadonly, position,
|
|
|
2934
2938
|
wrapper.style.display = 'inline-block';
|
|
2935
2939
|
}
|
|
2936
2940
|
(0, roosterjs_editor_dom_1.commitEntity)(wrapper, type, isReadonly);
|
|
2941
|
+
var currentFormat = (0, getFormatState_1.default)(editor);
|
|
2937
2942
|
if (!editor.contains(wrapper)) {
|
|
2938
2943
|
var currentRange = null;
|
|
2939
2944
|
var contentPosition = void 0;
|
|
@@ -2976,15 +2981,36 @@ function insertEntity(editor, type, contentNode, isBlock, isReadonly, position,
|
|
|
2976
2981
|
}
|
|
2977
2982
|
}
|
|
2978
2983
|
}
|
|
2984
|
+
var entity = (0, roosterjs_editor_dom_1.getEntityFromElement)(wrapper);
|
|
2979
2985
|
if (isBlock) {
|
|
2980
2986
|
// Insert an extra empty line for block entity to make sure
|
|
2981
2987
|
// user can still put cursor below the entity.
|
|
2982
|
-
var
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
+
var formatOnSpan = editor.isFeatureEnabled("DefaultFormatInSpan" /* DefaultFormatInSpan */);
|
|
2989
|
+
var newLine = (0, roosterjs_editor_dom_1.createElement)(formatOnSpan
|
|
2990
|
+
? 12 /* EmptyLineFormatInSpan */
|
|
2991
|
+
: 1 /* EmptyLine */, editor.getDocument());
|
|
2992
|
+
(_a = wrapper.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newLine, wrapper.nextSibling);
|
|
2993
|
+
var formatNode = formatOnSpan ? newLine === null || newLine === void 0 ? void 0 : newLine.querySelector('span') : newLine;
|
|
2994
|
+
if (formatNode) {
|
|
2995
|
+
(0, roosterjs_editor_dom_1.applyFormat)(formatNode, {
|
|
2996
|
+
backgroundColor: currentFormat.backgroundColor,
|
|
2997
|
+
textColor: currentFormat.textColor,
|
|
2998
|
+
bold: currentFormat.isBold,
|
|
2999
|
+
fontFamily: currentFormat.fontName,
|
|
3000
|
+
fontSize: currentFormat.fontSize,
|
|
3001
|
+
italic: currentFormat.isItalic,
|
|
3002
|
+
underline: currentFormat.isUnderline,
|
|
3003
|
+
}, editor.isDarkMode(), editor.getDarkColorHandler());
|
|
3004
|
+
}
|
|
3005
|
+
if (focusAfterEntity) {
|
|
3006
|
+
var br = newLine === null || newLine === void 0 ? void 0 : newLine.querySelector('br');
|
|
3007
|
+
var pos = br && new roosterjs_editor_dom_1.Position(br, -2 /* Before */);
|
|
3008
|
+
if (pos) {
|
|
3009
|
+
editor.select(pos);
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
else if (isReadonly &&
|
|
2988
3014
|
editor.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */)) {
|
|
2989
3015
|
(0, roosterjs_editor_dom_1.addDelimiters)(entity.wrapper);
|
|
2990
3016
|
if (entity.wrapper.nextElementSibling) {
|
|
@@ -3186,9 +3212,7 @@ function setAlignment(editor, alignment) {
|
|
|
3186
3212
|
(0, roosterjs_editor_dom_1.isWholeTableSelected)(new roosterjs_editor_dom_1.VTable(selection.table), selection.coordinates)) {
|
|
3187
3213
|
alignTable(selection, alignment);
|
|
3188
3214
|
}
|
|
3189
|
-
else if (elementAtCursor &&
|
|
3190
|
-
isList(elementAtCursor) &&
|
|
3191
|
-
editor.isFeatureEnabled("ListItemAlignment" /* ListItemAlignment */)) {
|
|
3215
|
+
else if (elementAtCursor && isList(elementAtCursor)) {
|
|
3192
3216
|
alignList(editor, alignment);
|
|
3193
3217
|
}
|
|
3194
3218
|
else {
|
|
@@ -5050,12 +5074,13 @@ var createPasteFragment = function (core, clipboardData, position, pasteAsText,
|
|
|
5050
5074
|
if (!clipboardData) {
|
|
5051
5075
|
return null;
|
|
5052
5076
|
}
|
|
5077
|
+
var pasteType = getPasteType(pasteAsText, applyCurrentStyle, pasteAsImage);
|
|
5053
5078
|
// Step 1: Prepare BeforePasteEvent object
|
|
5054
|
-
var event = createBeforePasteEvent(core, clipboardData);
|
|
5079
|
+
var event = createBeforePasteEvent(core, clipboardData, pasteType);
|
|
5055
5080
|
return (0, roosterjs_editor_dom_1.createFragmentFromClipboardData)(core, clipboardData, position, pasteAsText, applyCurrentStyle, pasteAsImage, event);
|
|
5056
5081
|
};
|
|
5057
5082
|
exports.createPasteFragment = createPasteFragment;
|
|
5058
|
-
function createBeforePasteEvent(core, clipboardData) {
|
|
5083
|
+
function createBeforePasteEvent(core, clipboardData, pasteType) {
|
|
5059
5084
|
var options = (0, roosterjs_editor_dom_1.createDefaultHtmlSanitizerOptions)();
|
|
5060
5085
|
// Remove "caret-color" style generated by Safari to make sure caret shows in right color after paste
|
|
5061
5086
|
options.cssStyleCallbacks['caret-color'] = function () { return false; };
|
|
@@ -5067,8 +5092,23 @@ function createBeforePasteEvent(core, clipboardData) {
|
|
|
5067
5092
|
htmlBefore: '',
|
|
5068
5093
|
htmlAfter: '',
|
|
5069
5094
|
htmlAttributes: {},
|
|
5095
|
+
pasteType: pasteType,
|
|
5070
5096
|
};
|
|
5071
5097
|
}
|
|
5098
|
+
function getPasteType(pasteAsText, applyCurrentStyle, pasteAsImage) {
|
|
5099
|
+
if (pasteAsText) {
|
|
5100
|
+
return 1 /* AsPlainText */;
|
|
5101
|
+
}
|
|
5102
|
+
else if (applyCurrentStyle) {
|
|
5103
|
+
return 2 /* MergeFormat */;
|
|
5104
|
+
}
|
|
5105
|
+
else if (pasteAsImage) {
|
|
5106
|
+
return 3 /* AsImage */;
|
|
5107
|
+
}
|
|
5108
|
+
else {
|
|
5109
|
+
return 0 /* Normal */;
|
|
5110
|
+
}
|
|
5111
|
+
}
|
|
5072
5112
|
|
|
5073
5113
|
|
|
5074
5114
|
/***/ }),
|
|
@@ -5232,7 +5272,7 @@ var getContent = function (core, mode) {
|
|
|
5232
5272
|
else if (mode == 3 /* PlainText */) {
|
|
5233
5273
|
content = (0, roosterjs_editor_dom_1.getTextContent)(root);
|
|
5234
5274
|
}
|
|
5235
|
-
else
|
|
5275
|
+
else {
|
|
5236
5276
|
var clonedRoot = cloneNode(root);
|
|
5237
5277
|
clonedRoot.normalize();
|
|
5238
5278
|
var originalRange = core.api.getSelectionRange(core, true /*tryGetFromCache*/);
|
|
@@ -5244,9 +5284,7 @@ var getContent = function (core, mode) {
|
|
|
5244
5284
|
? (0, roosterjs_editor_dom_1.getSelectionPath)(core.contentDiv, originalRange)
|
|
5245
5285
|
: null;
|
|
5246
5286
|
var range = path && (0, roosterjs_editor_dom_1.createRange)(clonedRoot, path.start, path.end);
|
|
5247
|
-
|
|
5248
|
-
core.api.transformColor(core, clonedRoot, false /*includeSelf*/, null /*callback*/, 1 /* DarkToLight */, !!core.darkColorHandler, core.lifecycle.isDarkMode);
|
|
5249
|
-
}
|
|
5287
|
+
core.api.transformColor(core, clonedRoot, false /*includeSelf*/, null /*callback*/, 1 /* DarkToLight */, true /*forceTransform*/, core.lifecycle.isDarkMode);
|
|
5250
5288
|
if (triggerExtractContentEvent) {
|
|
5251
5289
|
core.api.triggerEvent(core, {
|
|
5252
5290
|
eventType: 8 /* ExtractContentWithDom */,
|
|
@@ -5262,11 +5300,6 @@ var getContent = function (core, mode) {
|
|
|
5262
5300
|
content = clonedRoot.innerHTML;
|
|
5263
5301
|
}
|
|
5264
5302
|
}
|
|
5265
|
-
else {
|
|
5266
|
-
content = (0, roosterjs_editor_dom_1.getHtmlWithSelectionPath)(root, includeSelectionMarker
|
|
5267
|
-
? core.api.getSelectionRange(core, true /*tryGetFromCache*/)
|
|
5268
|
-
: null);
|
|
5269
|
-
}
|
|
5270
5303
|
return content !== null && content !== void 0 ? content : '';
|
|
5271
5304
|
};
|
|
5272
5305
|
exports.getContent = getContent;
|
|
@@ -5536,8 +5569,6 @@ function checkAllCollapsed(ranges) {
|
|
|
5536
5569
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5537
5570
|
exports.getStyleBasedFormatState = void 0;
|
|
5538
5571
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
5539
|
-
var ORIGINAL_STYLE_COLOR_SELECTOR = "[data-" + "ogsc" /* OriginalStyleColor */ + "],[data-" + "ogac" /* OriginalAttributeColor */ + "]";
|
|
5540
|
-
var ORIGINAL_STYLE_BACK_COLOR_SELECTOR = "[data-" + "ogsb" /* OriginalStyleBackgroundColor */ + "],[data-" + "ogab" /* OriginalAttributeBackgroundColor */ + "]";
|
|
5541
5572
|
/**
|
|
5542
5573
|
* @internal
|
|
5543
5574
|
* Get style based format state from current selection, including font name/size and colors
|
|
@@ -5571,86 +5602,48 @@ var getStyleBasedFormatState = function (core, node) {
|
|
|
5571
5602
|
'direction',
|
|
5572
5603
|
])
|
|
5573
5604
|
: [];
|
|
5574
|
-
var contentDiv = core.contentDiv, darkColorHandler = core.darkColorHandler
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
styleBackColor =
|
|
5585
|
-
styleBackColor || element.style.getPropertyValue('background-color');
|
|
5586
|
-
}
|
|
5587
|
-
node = node.parentNode;
|
|
5588
|
-
}
|
|
5589
|
-
if (!core.lifecycle.isDarkMode && node == core.contentDiv) {
|
|
5590
|
-
styleTextColor = styleTextColor || styles[2];
|
|
5591
|
-
styleBackColor = styleBackColor || styles[3];
|
|
5605
|
+
var contentDiv = core.contentDiv, darkColorHandler = core.darkColorHandler;
|
|
5606
|
+
var styleTextColor;
|
|
5607
|
+
var styleBackColor;
|
|
5608
|
+
while (node &&
|
|
5609
|
+
(0, roosterjs_editor_dom_1.contains)(contentDiv, node, true /*treatSameNodeAsContain*/) &&
|
|
5610
|
+
!(styleTextColor && styleBackColor)) {
|
|
5611
|
+
if (node.nodeType == 1 /* Element */) {
|
|
5612
|
+
var element = node;
|
|
5613
|
+
styleTextColor = styleTextColor || element.style.getPropertyValue('color');
|
|
5614
|
+
styleBackColor = styleBackColor || element.style.getPropertyValue('background-color');
|
|
5592
5615
|
}
|
|
5593
|
-
|
|
5594
|
-
var backColor = darkColorHandler.parseColorValue(override[3] || styleBackColor);
|
|
5595
|
-
return {
|
|
5596
|
-
fontName: override[0] || styles[0],
|
|
5597
|
-
fontSize: override[1] || styles[1],
|
|
5598
|
-
textColor: textColor.lightModeColor,
|
|
5599
|
-
backgroundColor: backColor.lightModeColor,
|
|
5600
|
-
textColors: textColor.darkModeColor
|
|
5601
|
-
? {
|
|
5602
|
-
lightModeColor: textColor.lightModeColor,
|
|
5603
|
-
darkModeColor: textColor.darkModeColor,
|
|
5604
|
-
}
|
|
5605
|
-
: undefined,
|
|
5606
|
-
backgroundColors: backColor.darkModeColor
|
|
5607
|
-
? {
|
|
5608
|
-
lightModeColor: backColor.lightModeColor,
|
|
5609
|
-
darkModeColor: backColor.darkModeColor,
|
|
5610
|
-
}
|
|
5611
|
-
: undefined,
|
|
5612
|
-
lineHeight: styles[4],
|
|
5613
|
-
marginTop: styles[5],
|
|
5614
|
-
marginBottom: styles[6],
|
|
5615
|
-
textAlign: styles[7],
|
|
5616
|
-
direction: styles[8],
|
|
5617
|
-
};
|
|
5616
|
+
node = node.parentNode;
|
|
5618
5617
|
}
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
? pendableFormatSpan
|
|
5623
|
-
: (0, roosterjs_editor_dom_1.findClosestElementAncestor)(node, contentDiv, ORIGINAL_STYLE_COLOR_SELECTOR));
|
|
5624
|
-
var ogBackgroundColorNode = isDarkMode &&
|
|
5625
|
-
(override[3]
|
|
5626
|
-
? pendableFormatSpan
|
|
5627
|
-
: (0, roosterjs_editor_dom_1.findClosestElementAncestor)(node, contentDiv, ORIGINAL_STYLE_BACK_COLOR_SELECTOR));
|
|
5628
|
-
return {
|
|
5629
|
-
fontName: override[0] || styles[0],
|
|
5630
|
-
fontSize: override[1] || styles[1],
|
|
5631
|
-
textColor: override[2] || styles[2],
|
|
5632
|
-
backgroundColor: override[3] || styles[3],
|
|
5633
|
-
textColors: ogTextColorNode
|
|
5634
|
-
? {
|
|
5635
|
-
darkModeColor: override[2] || styles[2],
|
|
5636
|
-
lightModeColor: ogTextColorNode.dataset["ogsc" /* OriginalStyleColor */] ||
|
|
5637
|
-
ogTextColorNode.dataset["ogac" /* OriginalAttributeColor */] ||
|
|
5638
|
-
styles[2],
|
|
5639
|
-
}
|
|
5640
|
-
: undefined,
|
|
5641
|
-
backgroundColors: ogBackgroundColorNode
|
|
5642
|
-
? {
|
|
5643
|
-
darkModeColor: override[3] || styles[3],
|
|
5644
|
-
lightModeColor: ogBackgroundColorNode.dataset["ogsb" /* OriginalStyleBackgroundColor */] ||
|
|
5645
|
-
ogBackgroundColorNode.dataset["ogab" /* OriginalAttributeBackgroundColor */] ||
|
|
5646
|
-
styles[3],
|
|
5647
|
-
}
|
|
5648
|
-
: undefined,
|
|
5649
|
-
lineHeight: styles[4],
|
|
5650
|
-
textAlign: styles[7],
|
|
5651
|
-
direction: styles[8],
|
|
5652
|
-
};
|
|
5618
|
+
if (!core.lifecycle.isDarkMode && node == core.contentDiv) {
|
|
5619
|
+
styleTextColor = styleTextColor || styles[2];
|
|
5620
|
+
styleBackColor = styleBackColor || styles[3];
|
|
5653
5621
|
}
|
|
5622
|
+
var textColor = darkColorHandler.parseColorValue(override[2] || styleTextColor);
|
|
5623
|
+
var backColor = darkColorHandler.parseColorValue(override[3] || styleBackColor);
|
|
5624
|
+
return {
|
|
5625
|
+
fontName: override[0] || styles[0],
|
|
5626
|
+
fontSize: override[1] || styles[1],
|
|
5627
|
+
textColor: textColor.lightModeColor,
|
|
5628
|
+
backgroundColor: backColor.lightModeColor,
|
|
5629
|
+
textColors: textColor.darkModeColor
|
|
5630
|
+
? {
|
|
5631
|
+
lightModeColor: textColor.lightModeColor,
|
|
5632
|
+
darkModeColor: textColor.darkModeColor,
|
|
5633
|
+
}
|
|
5634
|
+
: undefined,
|
|
5635
|
+
backgroundColors: backColor.darkModeColor
|
|
5636
|
+
? {
|
|
5637
|
+
lightModeColor: backColor.lightModeColor,
|
|
5638
|
+
darkModeColor: backColor.darkModeColor,
|
|
5639
|
+
}
|
|
5640
|
+
: undefined,
|
|
5641
|
+
lineHeight: styles[4],
|
|
5642
|
+
marginTop: styles[5],
|
|
5643
|
+
marginBottom: styles[6],
|
|
5644
|
+
textAlign: styles[7],
|
|
5645
|
+
direction: styles[8],
|
|
5646
|
+
};
|
|
5654
5647
|
};
|
|
5655
5648
|
exports.getStyleBasedFormatState = getStyleBasedFormatState;
|
|
5656
5649
|
|
|
@@ -5892,11 +5885,9 @@ var restoreUndoSnapshot = function (core, step) {
|
|
|
5892
5885
|
core.api.setContent(core, snapshot.html, true /*triggerContentChangedEvent*/, (_a = snapshot.metadata) !== null && _a !== void 0 ? _a : undefined);
|
|
5893
5886
|
var darkColorHandler_1 = core.darkColorHandler;
|
|
5894
5887
|
var isDarkModel_1 = core.lifecycle.isDarkMode;
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
});
|
|
5899
|
-
}
|
|
5888
|
+
snapshot.knownColors.forEach(function (color) {
|
|
5889
|
+
darkColorHandler_1.registerColor(color.lightModeColor, isDarkModel_1, color.darkModeColor);
|
|
5890
|
+
});
|
|
5900
5891
|
}
|
|
5901
5892
|
finally {
|
|
5902
5893
|
core.undo.isRestoring = false;
|
|
@@ -6510,14 +6501,10 @@ var ColorAttributeName = [
|
|
|
6510
6501
|
(_a = {},
|
|
6511
6502
|
_a[0 /* CssColor */] = 'color',
|
|
6512
6503
|
_a[1 /* HtmlColor */] = 'color',
|
|
6513
|
-
_a[2 /* CssDataSet */] = "ogsc" /* OriginalStyleColor */,
|
|
6514
|
-
_a[3 /* HtmlDataSet */] = "ogac" /* OriginalAttributeColor */,
|
|
6515
6504
|
_a),
|
|
6516
6505
|
(_b = {},
|
|
6517
6506
|
_b[0 /* CssColor */] = 'background-color',
|
|
6518
6507
|
_b[1 /* HtmlColor */] = 'bgcolor',
|
|
6519
|
-
_b[2 /* CssDataSet */] = "ogsb" /* OriginalStyleBackgroundColor */,
|
|
6520
|
-
_b[3 /* HtmlDataSet */] = "ogab" /* OriginalAttributeBackgroundColor */,
|
|
6521
6508
|
_b),
|
|
6522
6509
|
];
|
|
6523
6510
|
/**
|
|
@@ -6537,20 +6524,7 @@ var transformColor = function (core, rootNode, includeSelf, callback, direction,
|
|
|
6537
6524
|
? getAll(rootNode, includeSelf)
|
|
6538
6525
|
: [];
|
|
6539
6526
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
6540
|
-
|
|
6541
|
-
transformV2(elements, darkColorHandler, !!fromDarkMode, direction == 0 /* LightToDark */);
|
|
6542
|
-
}
|
|
6543
|
-
else {
|
|
6544
|
-
if (direction == 1 /* DarkToLight */) {
|
|
6545
|
-
transformToLightMode(elements);
|
|
6546
|
-
}
|
|
6547
|
-
else if (core.lifecycle.onExternalContentTransform) {
|
|
6548
|
-
elements.forEach(function (element) { return core.lifecycle.onExternalContentTransform(element); });
|
|
6549
|
-
}
|
|
6550
|
-
else {
|
|
6551
|
-
transformToDarkMode(elements, core.lifecycle.getDarkColor);
|
|
6552
|
-
}
|
|
6553
|
-
}
|
|
6527
|
+
transformV2(elements, darkColorHandler, !!fromDarkMode, direction == 0 /* LightToDark */);
|
|
6554
6528
|
};
|
|
6555
6529
|
exports.transformColor = transformColor;
|
|
6556
6530
|
function transformV2(elements, darkColorHandler, fromDark, toDark) {
|
|
@@ -6566,66 +6540,6 @@ function transformV2(elements, darkColorHandler, fromDark, toDark) {
|
|
|
6566
6540
|
});
|
|
6567
6541
|
});
|
|
6568
6542
|
}
|
|
6569
|
-
function transformToLightMode(elements) {
|
|
6570
|
-
elements.forEach(function (element) {
|
|
6571
|
-
ColorAttributeName.forEach(function (names) {
|
|
6572
|
-
// Reset color styles based on the content of the ogsc/ogsb data element.
|
|
6573
|
-
// If those data properties are empty or do not exist, set them anyway to clear the content.
|
|
6574
|
-
element.style.setProperty(names[0 /* CssColor */], getValueOrDefault(element.dataset[names[2 /* CssDataSet */]], ''));
|
|
6575
|
-
delete element.dataset[names[2 /* CssDataSet */]];
|
|
6576
|
-
// Some elements might have set attribute colors. We need to reset these as well.
|
|
6577
|
-
var value = getValueOrDefault(element.dataset[names[3 /* HtmlDataSet */]], null);
|
|
6578
|
-
if (value) {
|
|
6579
|
-
element.setAttribute(names[1 /* HtmlColor */], value);
|
|
6580
|
-
}
|
|
6581
|
-
else {
|
|
6582
|
-
element.removeAttribute(names[1 /* HtmlColor */]);
|
|
6583
|
-
}
|
|
6584
|
-
delete element.dataset[names[3 /* HtmlDataSet */]];
|
|
6585
|
-
});
|
|
6586
|
-
});
|
|
6587
|
-
}
|
|
6588
|
-
function transformToDarkMode(elements, getDarkColor) {
|
|
6589
|
-
ColorAttributeName.forEach(function (names) {
|
|
6590
|
-
elements
|
|
6591
|
-
.map(function (element) {
|
|
6592
|
-
var styleColor = element.style.getPropertyValue(names[0 /* CssColor */]);
|
|
6593
|
-
var attrColor = element.getAttribute(names[1 /* HtmlColor */]);
|
|
6594
|
-
var existingDataSetCssValue = element.dataset[names[2 /* CssDataSet */]];
|
|
6595
|
-
var existingDataSetHtmlValue = element.dataset[names[3 /* HtmlDataSet */]];
|
|
6596
|
-
var needProcess = (!existingDataSetCssValue || existingDataSetCssValue == styleColor) &&
|
|
6597
|
-
(!existingDataSetHtmlValue || existingDataSetHtmlValue == attrColor) &&
|
|
6598
|
-
(styleColor || attrColor) &&
|
|
6599
|
-
styleColor != 'inherit'; // For inherit style, no need to change it and let it keep inherit from parent element
|
|
6600
|
-
return needProcess
|
|
6601
|
-
? {
|
|
6602
|
-
element: element,
|
|
6603
|
-
styleColor: styleColor,
|
|
6604
|
-
attrColor: attrColor,
|
|
6605
|
-
newColor: styleColor || attrColor
|
|
6606
|
-
? getDarkColor((styleColor || attrColor))
|
|
6607
|
-
: null,
|
|
6608
|
-
}
|
|
6609
|
-
: null;
|
|
6610
|
-
})
|
|
6611
|
-
.filter(function (x) { return !!x; })
|
|
6612
|
-
.forEach(function (entry) {
|
|
6613
|
-
if (!entry) {
|
|
6614
|
-
return;
|
|
6615
|
-
}
|
|
6616
|
-
var element = entry.element, styleColor = entry.styleColor, attrColor = entry.attrColor, newColor = entry.newColor;
|
|
6617
|
-
element.style.setProperty(names[0 /* CssColor */], newColor, 'important');
|
|
6618
|
-
element.dataset[names[2 /* CssDataSet */]] = styleColor || '';
|
|
6619
|
-
if (attrColor && newColor) {
|
|
6620
|
-
element.setAttribute(names[1 /* HtmlColor */], newColor);
|
|
6621
|
-
element.dataset[names[3 /* HtmlDataSet */]] = attrColor;
|
|
6622
|
-
}
|
|
6623
|
-
});
|
|
6624
|
-
});
|
|
6625
|
-
}
|
|
6626
|
-
function getValueOrDefault(value, defaultValue) {
|
|
6627
|
-
return value && value != 'undefined' && value != 'null' ? value : defaultValue;
|
|
6628
|
-
}
|
|
6629
6543
|
function getAll(rootNode, includeSelf) {
|
|
6630
6544
|
var result = [];
|
|
6631
6545
|
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(rootNode, 'HTMLElement')) {
|
|
@@ -8607,6 +8521,9 @@ var UndoPlugin = /** @class */ (function () {
|
|
|
8607
8521
|
case 7 /* ContentChanged */:
|
|
8608
8522
|
this.onContentChanged(event);
|
|
8609
8523
|
break;
|
|
8524
|
+
case 23 /* BeforeKeyboardEditing */:
|
|
8525
|
+
this.onBeforeKeyboardEditing(event.rawEvent);
|
|
8526
|
+
break;
|
|
8610
8527
|
}
|
|
8611
8528
|
};
|
|
8612
8529
|
UndoPlugin.prototype.onKeyDown = function (evt) {
|
|
@@ -8621,7 +8538,7 @@ var UndoPlugin = /** @class */ (function () {
|
|
|
8621
8538
|
this.state.autoCompletePosition = null;
|
|
8622
8539
|
this.lastKeyPress = evt.which;
|
|
8623
8540
|
}
|
|
8624
|
-
else {
|
|
8541
|
+
else if (!evt.defaultPrevented) {
|
|
8625
8542
|
var selectionRange = (_b = this.editor) === null || _b === void 0 ? void 0 : _b.getSelectionRange();
|
|
8626
8543
|
// Add snapshot when
|
|
8627
8544
|
// 1. Something has been selected (not collapsed), or
|
|
@@ -8669,22 +8586,21 @@ var UndoPlugin = /** @class */ (function () {
|
|
|
8669
8586
|
}
|
|
8670
8587
|
this.lastKeyPress = evt.which;
|
|
8671
8588
|
};
|
|
8672
|
-
UndoPlugin.prototype.
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
if (event.data != this.lastKeyPress) {
|
|
8679
|
-
this.addUndoSnapshot();
|
|
8680
|
-
}
|
|
8681
|
-
this.lastKeyPress = event.data;
|
|
8682
|
-
this.state.hasNewContent = true;
|
|
8683
|
-
}
|
|
8589
|
+
UndoPlugin.prototype.onBeforeKeyboardEditing = function (event) {
|
|
8590
|
+
// For keyboard event (triggered from Content Model), we can get its keycode from event.data
|
|
8591
|
+
// And when user is keep pressing the same key, mark editor with "hasNewContent" so that next time user
|
|
8592
|
+
// do some other action or press a different key, we will add undo snapshot
|
|
8593
|
+
if (event.which != this.lastKeyPress) {
|
|
8594
|
+
this.addUndoSnapshot();
|
|
8684
8595
|
}
|
|
8685
|
-
|
|
8596
|
+
this.lastKeyPress = event.which;
|
|
8597
|
+
this.state.hasNewContent = true;
|
|
8598
|
+
};
|
|
8599
|
+
UndoPlugin.prototype.onContentChanged = function (event) {
|
|
8600
|
+
if (!(this.state.isRestoring ||
|
|
8686
8601
|
event.source == "SwitchToDarkMode" /* SwitchToDarkMode */ ||
|
|
8687
|
-
event.source == "SwitchToLightMode" /* SwitchToLightMode */
|
|
8602
|
+
event.source == "SwitchToLightMode" /* SwitchToLightMode */ ||
|
|
8603
|
+
event.source == "Keyboard" /* Keyboard */)) {
|
|
8688
8604
|
this.clearRedoForInput();
|
|
8689
8605
|
}
|
|
8690
8606
|
};
|
|
@@ -9352,12 +9268,11 @@ var EditorBase = /** @class */ (function () {
|
|
|
9352
9268
|
* Dispose this editor, dispose all plugins and custom data
|
|
9353
9269
|
*/
|
|
9354
9270
|
EditorBase.prototype.dispose = function () {
|
|
9355
|
-
var _a;
|
|
9356
9271
|
var core = this.getCore();
|
|
9357
9272
|
for (var i = core.plugins.length - 1; i >= 0; i--) {
|
|
9358
9273
|
core.plugins[i].dispose();
|
|
9359
9274
|
}
|
|
9360
|
-
|
|
9275
|
+
core.darkColorHandler.reset();
|
|
9361
9276
|
this.core = null;
|
|
9362
9277
|
};
|
|
9363
9278
|
/**
|
|
@@ -9997,10 +9912,10 @@ var EditorBase = /** @class */ (function () {
|
|
|
9997
9912
|
core.api.transformColor(core, node, true /*includeSelf*/, null /*callback*/, 0 /* LightToDark */);
|
|
9998
9913
|
};
|
|
9999
9914
|
/**
|
|
10000
|
-
* Get a darkColorHandler object for this editor.
|
|
9915
|
+
* Get a darkColorHandler object for this editor.
|
|
10001
9916
|
*/
|
|
10002
9917
|
EditorBase.prototype.getDarkColorHandler = function () {
|
|
10003
|
-
return this.getCore().darkColorHandler
|
|
9918
|
+
return this.getCore().darkColorHandler;
|
|
10004
9919
|
};
|
|
10005
9920
|
/**
|
|
10006
9921
|
* Make the editor in "Shadow Edit" mode.
|
|
@@ -10126,7 +10041,6 @@ var createCorePlugins_1 = __webpack_require__(/*! ../corePlugins/createCorePlugi
|
|
|
10126
10041
|
var DarkColorHandlerImpl_1 = __webpack_require__(/*! ./DarkColorHandlerImpl */ "./packages/roosterjs-editor-core/lib/editor/DarkColorHandlerImpl.ts");
|
|
10127
10042
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
10128
10043
|
var coreApiMap_1 = __webpack_require__(/*! ../coreApi/coreApiMap */ "./packages/roosterjs-editor-core/lib/coreApi/coreApiMap.ts");
|
|
10129
|
-
var isFeatureEnabled_1 = __webpack_require__(/*! ./isFeatureEnabled */ "./packages/roosterjs-editor-core/lib/editor/isFeatureEnabled.ts");
|
|
10130
10044
|
/**
|
|
10131
10045
|
* Create a new instance of Editor Core
|
|
10132
10046
|
* @param contentDiv The DIV HTML element which will be the container element of editor
|
|
@@ -10155,9 +10069,7 @@ var createEditorCore = function (contentDiv, options) {
|
|
|
10155
10069
|
? [scrollContainer]
|
|
10156
10070
|
: [scrollContainer, core.contentDiv]);
|
|
10157
10071
|
});
|
|
10158
|
-
var core = __assign(__assign({ contentDiv: contentDiv, api: __assign(__assign({}, coreApiMap_1.coreApiMap), (options.coreApiOverride || {})), originalApi: coreApiMap_1.coreApiMap, plugins: plugins.filter(function (x) { return !!x; }) }, pluginState), { trustedHTMLHandler: options.trustedHTMLHandler || (function (html) { return html; }), zoomScale: zoomScale, sizeTransformer: options.sizeTransformer || (function (size) { return size / zoomScale; }), getVisibleViewport: getVisibleViewport, imageSelectionBorderColor: options.imageSelectionBorderColor, darkColorHandler: (
|
|
10159
|
-
? new DarkColorHandlerImpl_1.default(contentDiv, pluginState.lifecycle.getDarkColor)
|
|
10160
|
-
: undefined });
|
|
10072
|
+
var core = __assign(__assign({ contentDiv: contentDiv, api: __assign(__assign({}, coreApiMap_1.coreApiMap), (options.coreApiOverride || {})), originalApi: coreApiMap_1.coreApiMap, plugins: plugins.filter(function (x) { return !!x; }) }, pluginState), { trustedHTMLHandler: options.trustedHTMLHandler || (function (html) { return html; }), zoomScale: zoomScale, sizeTransformer: options.sizeTransformer || (function (size) { return size / zoomScale; }), getVisibleViewport: getVisibleViewport, imageSelectionBorderColor: options.imageSelectionBorderColor, darkColorHandler: new DarkColorHandlerImpl_1.default(contentDiv, pluginState.lifecycle.getDarkColor) });
|
|
10161
10073
|
return core;
|
|
10162
10074
|
};
|
|
10163
10075
|
exports.createEditorCore = createEditorCore;
|
|
@@ -14564,6 +14476,7 @@ var VList = /** @class */ (function () {
|
|
|
14564
14476
|
}
|
|
14565
14477
|
item.writeBack(listStack, _this.rootList, shouldReuseAllAncestorListElements);
|
|
14566
14478
|
var topList = listStack[1];
|
|
14479
|
+
item.applyListStyle(_this.rootList, start);
|
|
14567
14480
|
if ((0, safeInstanceOf_1.default)(topList, 'HTMLOListElement')) {
|
|
14568
14481
|
if (lastList != topList) {
|
|
14569
14482
|
if (start == 1) {
|
|
@@ -14577,8 +14490,6 @@ var VList = /** @class */ (function () {
|
|
|
14577
14490
|
start++;
|
|
14578
14491
|
}
|
|
14579
14492
|
}
|
|
14580
|
-
var itemIndex = _this.getListItemIndex(item.getNode());
|
|
14581
|
-
item.applyListStyle(_this.rootList, itemIndex);
|
|
14582
14493
|
lastList = topList;
|
|
14583
14494
|
});
|
|
14584
14495
|
// Restore the content to the position of placeholder
|
|
@@ -14947,7 +14858,13 @@ var VListChain = /** @class */ (function () {
|
|
|
14947
14858
|
var lastNumber = 0;
|
|
14948
14859
|
for (var i = 0; i < lists.length; i++) {
|
|
14949
14860
|
var list = lists[i];
|
|
14950
|
-
|
|
14861
|
+
//If there is a list chain sequence, ensure the list chain keep increasing correctly
|
|
14862
|
+
if (list.start > 1) {
|
|
14863
|
+
list.start = list.start === lastNumber ? lastNumber + 1 : list.start;
|
|
14864
|
+
}
|
|
14865
|
+
else {
|
|
14866
|
+
list.start = lastNumber + 1;
|
|
14867
|
+
}
|
|
14951
14868
|
var vlist = new VList_1.default(list);
|
|
14952
14869
|
lastNumber = vlist.getLastItemNumber() || 0;
|
|
14953
14870
|
delete list.dataset[CHAIN_DATASET_NAME];
|
|
@@ -20618,7 +20535,6 @@ var TRANSPARENT = 'transparent';
|
|
|
20618
20535
|
var DARK_COLORS_LIGHTNESS = 20;
|
|
20619
20536
|
//If the value of the lightness is more than 80, the color is bright
|
|
20620
20537
|
var BRIGHT_COLORS_LIGHTNESS = 80;
|
|
20621
|
-
var TRANSPARENT_COLOR = 'transparent';
|
|
20622
20538
|
/**
|
|
20623
20539
|
* Set text color or background color to the given element
|
|
20624
20540
|
* @param element The element to set color to
|
|
@@ -20626,7 +20542,8 @@ var TRANSPARENT_COLOR = 'transparent';
|
|
|
20626
20542
|
* @param isBackgroundColor Whether set background color or text color
|
|
20627
20543
|
* @param isDarkMode Whether current mode is dark mode. @default false
|
|
20628
20544
|
* @param shouldAdaptTheFontColor Whether the font color needs to be adapted to be visible in a dark or bright background color. @default false
|
|
20629
|
-
* @param darkColorHandler
|
|
20545
|
+
* @param darkColorHandler A dark color handler object. This is now required.
|
|
20546
|
+
* We keep it optional only for backward compatibility. If it is not passed, color will not be set.
|
|
20630
20547
|
*/
|
|
20631
20548
|
function setColor(element, color, isBackgroundColor, isDarkMode, shouldAdaptTheFontColor, darkColorHandler) {
|
|
20632
20549
|
var colorString = typeof color === 'string' ? color.trim() : '';
|
|
@@ -20637,22 +20554,6 @@ function setColor(element, color, isBackgroundColor, isDarkMode, shouldAdaptTheF
|
|
|
20637
20554
|
var colorValue = darkColorHandler.registerColor((modeIndependentColor === null || modeIndependentColor === void 0 ? void 0 : modeIndependentColor.lightModeColor) || colorString, !!isDarkMode, modeIndependentColor === null || modeIndependentColor === void 0 ? void 0 : modeIndependentColor.darkModeColor);
|
|
20638
20555
|
element.style.setProperty(cssName, colorValue);
|
|
20639
20556
|
}
|
|
20640
|
-
else {
|
|
20641
|
-
element.style.setProperty(cssName, (isDarkMode
|
|
20642
|
-
? modeIndependentColor === null || modeIndependentColor === void 0 ? void 0 : modeIndependentColor.darkModeColor
|
|
20643
|
-
: modeIndependentColor === null || modeIndependentColor === void 0 ? void 0 : modeIndependentColor.lightModeColor) || colorString);
|
|
20644
|
-
if (element.dataset) {
|
|
20645
|
-
var dataSetName = isBackgroundColor
|
|
20646
|
-
? "ogsb" /* OriginalStyleBackgroundColor */
|
|
20647
|
-
: "ogsc" /* OriginalStyleColor */;
|
|
20648
|
-
if (!isDarkMode || color == TRANSPARENT_COLOR) {
|
|
20649
|
-
delete element.dataset[dataSetName];
|
|
20650
|
-
}
|
|
20651
|
-
else if (modeIndependentColor) {
|
|
20652
|
-
element.dataset[dataSetName] = modeIndependentColor.lightModeColor;
|
|
20653
|
-
}
|
|
20654
|
-
}
|
|
20655
|
-
}
|
|
20656
20557
|
if (isBackgroundColor && shouldAdaptTheFontColor) {
|
|
20657
20558
|
adaptFontColorToBackgroundColor(element, (modeIndependentColor === null || modeIndependentColor === void 0 ? void 0 : modeIndependentColor.lightModeColor) || colorString, isDarkMode, darkColorHandler);
|
|
20658
20559
|
}
|
|
@@ -20664,7 +20565,8 @@ exports.default = setColor;
|
|
|
20664
20565
|
* @param element The element that contains text.
|
|
20665
20566
|
* @param lightModeBackgroundColor Existing background color in light mode
|
|
20666
20567
|
* @param isDarkMode Whether the content is in dark mode
|
|
20667
|
-
* @param darkColorHandler
|
|
20568
|
+
* @param darkColorHandler A dark color handler object. This is now required.
|
|
20569
|
+
* We keep it optional only for backward compatibility. If it is not passed, color will not be set.
|
|
20668
20570
|
*/
|
|
20669
20571
|
function adaptFontColorToBackgroundColor(element, lightModeBackgroundColor, isDarkMode, darkColorHandler) {
|
|
20670
20572
|
if (!lightModeBackgroundColor || lightModeBackgroundColor === TRANSPARENT) {
|
|
@@ -26238,8 +26140,11 @@ var Paste = /** @class */ (function () {
|
|
|
26238
26140
|
break;
|
|
26239
26141
|
case 1 /* ExcelDesktop */:
|
|
26240
26142
|
case 2 /* ExcelOnline */:
|
|
26241
|
-
|
|
26242
|
-
|
|
26143
|
+
if (event.pasteType === 0 /* Normal */ ||
|
|
26144
|
+
event.pasteType === 2 /* MergeFormat */) {
|
|
26145
|
+
// Handle HTML copied from Excel
|
|
26146
|
+
(0, convertPastedContentFromExcel_1.default)(event, trustedHTMLHandler);
|
|
26147
|
+
}
|
|
26243
26148
|
break;
|
|
26244
26149
|
case 3 /* PowerPointDesktop */:
|
|
26245
26150
|
(0, convertPastedContentFromPowerPoint_1.default)(event, trustedHTMLHandler);
|
|
@@ -27054,9 +26959,7 @@ exports.default = sanitizeHtmlColorsFromPastedContent;
|
|
|
27054
26959
|
|
|
27055
26960
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27056
26961
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
27057
|
-
var
|
|
27058
|
-
var HTTPS = 'https:';
|
|
27059
|
-
var NOTES = 'notes:';
|
|
26962
|
+
var SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];
|
|
27060
26963
|
/**
|
|
27061
26964
|
* @internal
|
|
27062
26965
|
* Clear local paths and remove link
|
|
@@ -27074,10 +26977,8 @@ function validateLink(link, htmlElement) {
|
|
|
27074
26977
|
catch (_a) {
|
|
27075
26978
|
url = undefined;
|
|
27076
26979
|
}
|
|
27077
|
-
|
|
27078
|
-
|
|
27079
|
-
url.protocol === HTTPS ||
|
|
27080
|
-
url.protocol === NOTES) /* whitelist Notes protocol */) {
|
|
26980
|
+
/* whitelist supported protocols */
|
|
26981
|
+
if (url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) > -1) {
|
|
27081
26982
|
return link;
|
|
27082
26983
|
}
|
|
27083
26984
|
htmlElement.removeAttribute('href');
|
|
@@ -28312,13 +28213,17 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
28312
28213
|
};
|
|
28313
28214
|
PickerPlugin.prototype.tryRemoveNode = function (event) {
|
|
28314
28215
|
var searcher = this.editor.getContentSearcherOfCursor(event);
|
|
28216
|
+
if (!searcher) {
|
|
28217
|
+
return false;
|
|
28218
|
+
}
|
|
28315
28219
|
var inlineElementBefore = searcher.getInlineElementBefore();
|
|
28316
28220
|
var nodeBeforeCursor = inlineElementBefore
|
|
28317
28221
|
? inlineElementBefore.getContainerNode()
|
|
28318
28222
|
: null;
|
|
28319
28223
|
var nodeId = nodeBeforeCursor ? this.getIdValue(nodeBeforeCursor) : null;
|
|
28320
28224
|
var inlineElementAfter = searcher.getInlineElementAfter();
|
|
28321
|
-
if (
|
|
28225
|
+
if (nodeBeforeCursor &&
|
|
28226
|
+
nodeId &&
|
|
28322
28227
|
nodeId.indexOf(this.pickerOptions.elementIdPrefix) == 0 &&
|
|
28323
28228
|
(inlineElementAfter == null || !(inlineElementAfter instanceof roosterjs_editor_dom_1.PartialInlineElement))) {
|
|
28324
28229
|
var replacementNode_1 = this.dataProvider.onRemove(nodeBeforeCursor, true);
|
|
@@ -28332,11 +28237,13 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
28332
28237
|
else {
|
|
28333
28238
|
this.editor.select(replacementNode_1, -3 /* After */);
|
|
28334
28239
|
}
|
|
28240
|
+
return true;
|
|
28335
28241
|
}
|
|
28336
28242
|
else {
|
|
28337
|
-
|
|
28243
|
+
// Select the node then let browser delete it
|
|
28244
|
+
this.editor.select(nodeBeforeCursor);
|
|
28245
|
+
return false;
|
|
28338
28246
|
}
|
|
28339
|
-
return true;
|
|
28340
28247
|
}
|
|
28341
28248
|
return false;
|
|
28342
28249
|
};
|
|
@@ -30941,6 +30848,7 @@ var CompatibleContentType;
|
|
|
30941
30848
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30942
30849
|
exports.CompatibleDarkModeDatasetNames = void 0;
|
|
30943
30850
|
/**
|
|
30851
|
+
* @deprecated
|
|
30944
30852
|
* Constants string for dataset names used by dark mode
|
|
30945
30853
|
*/
|
|
30946
30854
|
var CompatibleDarkModeDatasetNames;
|
|
@@ -31558,15 +31466,23 @@ var CompatibleExperimentalFeatures;
|
|
|
31558
31466
|
* When a html image is selected, the selected image data will be stored by editor core.
|
|
31559
31467
|
*/
|
|
31560
31468
|
CompatibleExperimentalFeatures["ImageSelection"] = "ImageSelection";
|
|
31561
|
-
//#endregion
|
|
31562
31469
|
/**
|
|
31563
|
-
*
|
|
31470
|
+
* @deprecated this feature is always enabled
|
|
31471
|
+
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
31472
|
+
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
31473
|
+
* if you need them work for dark mode
|
|
31564
31474
|
*/
|
|
31565
|
-
CompatibleExperimentalFeatures["
|
|
31475
|
+
CompatibleExperimentalFeatures["VariableBasedDarkColor"] = "VariableBasedDarkColor";
|
|
31566
31476
|
/**
|
|
31477
|
+
* @deprecated this feature is always enabled
|
|
31567
31478
|
* Align list elements elements to left, center and right using setAlignment API
|
|
31568
31479
|
*/
|
|
31569
31480
|
CompatibleExperimentalFeatures["ListItemAlignment"] = "ListItemAlignment";
|
|
31481
|
+
//#endregion
|
|
31482
|
+
/**
|
|
31483
|
+
* Provide additional Tab Key Features. Requires Text Features Content Editable Features
|
|
31484
|
+
*/
|
|
31485
|
+
CompatibleExperimentalFeatures["TabKeyTextFeatures"] = "TabKeyTextFeatures";
|
|
31570
31486
|
/**
|
|
31571
31487
|
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
31572
31488
|
*/
|
|
@@ -31583,16 +31499,14 @@ var CompatibleExperimentalFeatures;
|
|
|
31583
31499
|
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
31584
31500
|
*/
|
|
31585
31501
|
CompatibleExperimentalFeatures["DefaultFormatInSpan"] = "DefaultFormatInSpan";
|
|
31586
|
-
/**
|
|
31587
|
-
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
31588
|
-
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
31589
|
-
* if you need them work for dark mode
|
|
31590
|
-
*/
|
|
31591
|
-
CompatibleExperimentalFeatures["VariableBasedDarkColor"] = "VariableBasedDarkColor";
|
|
31592
31502
|
/**
|
|
31593
31503
|
* Reuse existing DOM structure if possible when convert Content Model back to DOM tree
|
|
31594
31504
|
*/
|
|
31595
31505
|
CompatibleExperimentalFeatures["ReusableContentModel"] = "ReusableContentModel";
|
|
31506
|
+
/**
|
|
31507
|
+
* Handle keyboard editing event with Content Model
|
|
31508
|
+
*/
|
|
31509
|
+
CompatibleExperimentalFeatures["EditWithContentModel"] = "EditWithContentModel";
|
|
31596
31510
|
/**
|
|
31597
31511
|
* Apply default format on editor container
|
|
31598
31512
|
*/
|
|
@@ -32142,6 +32056,43 @@ var CompatibleNumberingListType;
|
|
|
32142
32056
|
})(CompatibleNumberingListType = exports.CompatibleNumberingListType || (exports.CompatibleNumberingListType = {}));
|
|
32143
32057
|
|
|
32144
32058
|
|
|
32059
|
+
/***/ }),
|
|
32060
|
+
|
|
32061
|
+
/***/ "./packages/roosterjs-editor-types/lib/compatibleEnum/PasteType.ts":
|
|
32062
|
+
/*!*************************************************************************!*\
|
|
32063
|
+
!*** ./packages/roosterjs-editor-types/lib/compatibleEnum/PasteType.ts ***!
|
|
32064
|
+
\*************************************************************************/
|
|
32065
|
+
/*! no static exports found */
|
|
32066
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
32067
|
+
|
|
32068
|
+
"use strict";
|
|
32069
|
+
|
|
32070
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32071
|
+
exports.CompatiblePasteType = void 0;
|
|
32072
|
+
/**
|
|
32073
|
+
* Enum for paste options
|
|
32074
|
+
*/
|
|
32075
|
+
var CompatiblePasteType;
|
|
32076
|
+
(function (CompatiblePasteType) {
|
|
32077
|
+
/**
|
|
32078
|
+
* Default paste behavior
|
|
32079
|
+
*/
|
|
32080
|
+
CompatiblePasteType[CompatiblePasteType["Normal"] = 0] = "Normal";
|
|
32081
|
+
/**
|
|
32082
|
+
* Paste only the plain text
|
|
32083
|
+
*/
|
|
32084
|
+
CompatiblePasteType[CompatiblePasteType["AsPlainText"] = 1] = "AsPlainText";
|
|
32085
|
+
/**
|
|
32086
|
+
* Apply the current style to pasted content
|
|
32087
|
+
*/
|
|
32088
|
+
CompatiblePasteType[CompatiblePasteType["MergeFormat"] = 2] = "MergeFormat";
|
|
32089
|
+
/**
|
|
32090
|
+
* If there is a image uri in the clipboard, paste the content as image element
|
|
32091
|
+
*/
|
|
32092
|
+
CompatiblePasteType[CompatiblePasteType["AsImage"] = 3] = "AsImage";
|
|
32093
|
+
})(CompatiblePasteType = exports.CompatiblePasteType || (exports.CompatiblePasteType = {}));
|
|
32094
|
+
|
|
32095
|
+
|
|
32145
32096
|
/***/ }),
|
|
32146
32097
|
|
|
32147
32098
|
/***/ "./packages/roosterjs-editor-types/lib/compatibleEnum/PluginEventType.ts":
|
|
@@ -32257,6 +32208,12 @@ var CompatiblePluginEventType;
|
|
|
32257
32208
|
* Editor changed the selection.
|
|
32258
32209
|
*/
|
|
32259
32210
|
CompatiblePluginEventType[CompatiblePluginEventType["SelectionChanged"] = 22] = "SelectionChanged";
|
|
32211
|
+
/**
|
|
32212
|
+
* EXPERIMENTAL FEATURE
|
|
32213
|
+
* Editor content is about to be changed by keyboard event.
|
|
32214
|
+
* This is only used by Content Model editing
|
|
32215
|
+
*/
|
|
32216
|
+
CompatiblePluginEventType[CompatiblePluginEventType["BeforeKeyboardEditing"] = 23] = "BeforeKeyboardEditing";
|
|
32260
32217
|
})(CompatiblePluginEventType = exports.CompatiblePluginEventType || (exports.CompatiblePluginEventType = {}));
|
|
32261
32218
|
|
|
32262
32219
|
|
|
@@ -32603,7 +32560,7 @@ var CompatibleTableOperation;
|
|
|
32603
32560
|
"use strict";
|
|
32604
32561
|
|
|
32605
32562
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32606
|
-
exports.CompatibleTableOperation = exports.CompatibleTableBorderFormat = exports.CompatibleSelectionRangeTypes = exports.CompatibleRegionType = exports.CompatibleQueryScope = exports.CompatiblePositionType = exports.CompatiblePluginEventType = exports.CompatibleNumberingListType = exports.CompatibleNodeType = exports.CompatibleListType = exports.CompatibleKnownPasteSourceType = exports.CompatibleKnownCreateElementDataIndex = exports.CompatibleKeys = exports.CompatibleIndentation = exports.CompatibleImageEditOperation = exports.CompatibleGetContentMode = exports.CompatibleFontSizeChange = exports.CompatibleExperimentalFeatures = exports.CompatibleEntityOperation = exports.CompatibleEntityClasses = exports.CompatibleDocumentPosition = exports.CompatibleDocumentCommand = exports.CompatibleDirection = exports.CompatibleDelimiterClasses = exports.CompatibleDefinitionType = exports.CompatibleDarkModeDatasetNames = exports.CompatibleContentType = exports.CompatibleContentTypePrefix = exports.CompatibleContentPosition = exports.CompatibleColorTransformDirection = exports.CompatibleClearFormatMode = exports.CompatibleChangeSource = exports.CompatibleCapitalization = exports.CompatibleBulletListType = exports.CompatibleAlignment = void 0;
|
|
32563
|
+
exports.CompatibleTableOperation = exports.CompatibleTableBorderFormat = exports.CompatibleSelectionRangeTypes = exports.CompatibleRegionType = exports.CompatibleQueryScope = exports.CompatiblePositionType = exports.CompatiblePluginEventType = exports.CompatiblePasteType = exports.CompatibleNumberingListType = exports.CompatibleNodeType = exports.CompatibleListType = exports.CompatibleKnownPasteSourceType = exports.CompatibleKnownCreateElementDataIndex = exports.CompatibleKeys = exports.CompatibleIndentation = exports.CompatibleImageEditOperation = exports.CompatibleGetContentMode = exports.CompatibleFontSizeChange = exports.CompatibleExperimentalFeatures = exports.CompatibleEntityOperation = exports.CompatibleEntityClasses = exports.CompatibleDocumentPosition = exports.CompatibleDocumentCommand = exports.CompatibleDirection = exports.CompatibleDelimiterClasses = exports.CompatibleDefinitionType = exports.CompatibleDarkModeDatasetNames = exports.CompatibleContentType = exports.CompatibleContentTypePrefix = exports.CompatibleContentPosition = exports.CompatibleColorTransformDirection = exports.CompatibleClearFormatMode = exports.CompatibleChangeSource = exports.CompatibleCapitalization = exports.CompatibleBulletListType = exports.CompatibleAlignment = void 0;
|
|
32607
32564
|
var Alignment_1 = __webpack_require__(/*! ./Alignment */ "./packages/roosterjs-editor-types/lib/compatibleEnum/Alignment.ts");
|
|
32608
32565
|
Object.defineProperty(exports, "CompatibleAlignment", { enumerable: true, get: function () { return Alignment_1.CompatibleAlignment; } });
|
|
32609
32566
|
var BulletListType_1 = __webpack_require__(/*! ./BulletListType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/BulletListType.ts");
|
|
@@ -32659,6 +32616,8 @@ var NodeType_1 = __webpack_require__(/*! ./NodeType */ "./packages/roosterjs-edi
|
|
|
32659
32616
|
Object.defineProperty(exports, "CompatibleNodeType", { enumerable: true, get: function () { return NodeType_1.CompatibleNodeType; } });
|
|
32660
32617
|
var NumberingListType_1 = __webpack_require__(/*! ./NumberingListType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/NumberingListType.ts");
|
|
32661
32618
|
Object.defineProperty(exports, "CompatibleNumberingListType", { enumerable: true, get: function () { return NumberingListType_1.CompatibleNumberingListType; } });
|
|
32619
|
+
var PasteType_1 = __webpack_require__(/*! ./PasteType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/PasteType.ts");
|
|
32620
|
+
Object.defineProperty(exports, "CompatiblePasteType", { enumerable: true, get: function () { return PasteType_1.CompatiblePasteType; } });
|
|
32662
32621
|
var PluginEventType_1 = __webpack_require__(/*! ./PluginEventType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/PluginEventType.ts");
|
|
32663
32622
|
Object.defineProperty(exports, "CompatiblePluginEventType", { enumerable: true, get: function () { return PluginEventType_1.CompatiblePluginEventType; } });
|
|
32664
32623
|
var PositionType_1 = __webpack_require__(/*! ./PositionType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/PositionType.ts");
|