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