roosterjs 8.35.2 → 8.36.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 +64 -36
- package/dist/rooster-amd.js +421 -347
- 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 +64 -36
- package/dist/rooster.js +421 -347
- package/dist/rooster.js.map +1 -1
- package/package.json +8 -8
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster.js
CHANGED
|
@@ -2155,12 +2155,14 @@ Object.defineProperty(exports, "getDarkColor", { enumerable: true, get: function
|
|
|
2155
2155
|
|
|
2156
2156
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2157
2157
|
var Color = __webpack_require__(/*! color */ "./node_modules/color/index.js");
|
|
2158
|
-
var
|
|
2158
|
+
var DefaultBaseLValue = 21.247; // L-value of #333333
|
|
2159
2159
|
/**
|
|
2160
2160
|
* Get dark mode color for a given color
|
|
2161
2161
|
* @param color The color to calculate from
|
|
2162
|
+
* @param baseLValue The Light value for base dark color in LAB format. @default the Light value for #333333
|
|
2162
2163
|
*/
|
|
2163
|
-
function getDarkColor(color) {
|
|
2164
|
+
function getDarkColor(color, baseLValue) {
|
|
2165
|
+
if (baseLValue === void 0) { baseLValue = DefaultBaseLValue; }
|
|
2164
2166
|
try {
|
|
2165
2167
|
var computedColor = Color(color || undefined);
|
|
2166
2168
|
var colorLab = computedColor.lab().array();
|
|
@@ -3084,8 +3086,7 @@ function setAlignment(editor, alignment) {
|
|
|
3084
3086
|
var selection = editor.getSelectionRangeEx();
|
|
3085
3087
|
var isATable = selection && selection.type === 1 /* TableSelection */;
|
|
3086
3088
|
var elementAtCursor = editor.getElementAtCursor();
|
|
3087
|
-
if (
|
|
3088
|
-
isATable &&
|
|
3089
|
+
if (isATable &&
|
|
3089
3090
|
(0, roosterjs_editor_dom_1.isWholeTableSelected)(new roosterjs_editor_dom_1.VTable(selection.table), selection.coordinates)) {
|
|
3090
3091
|
alignTable(selection, alignment);
|
|
3091
3092
|
}
|
|
@@ -4196,7 +4197,9 @@ function applyInlineStyle(editor, callback, apiName) {
|
|
|
4196
4197
|
else if (editor.isFeatureEnabled("PendingStyleBasedFormat" /* PendingStyleBasedFormat */)) {
|
|
4197
4198
|
editor.triggerPluginEvent(13 /* PendingFormatStateChanged */, {
|
|
4198
4199
|
formatState: {},
|
|
4199
|
-
|
|
4200
|
+
// Here we use callback instead of safeCallback because we know it's contentEditable.
|
|
4201
|
+
// In addition, for elements that are not added to the DOM tree, isContentEditable always returns false on Safari.
|
|
4202
|
+
formatCallback: callback,
|
|
4200
4203
|
});
|
|
4201
4204
|
editor.triggerContentChangedEvent("Format" /* Format */);
|
|
4202
4205
|
}
|
|
@@ -5097,7 +5100,7 @@ var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./
|
|
|
5097
5100
|
* When typing goes directly under content div, many things can go wrong
|
|
5098
5101
|
* We fix it by wrapping it with a div and reposition cursor within the div
|
|
5099
5102
|
*/
|
|
5100
|
-
var ensureTypeInContainer = function (core, position, keyboardEvent) {
|
|
5103
|
+
var ensureTypeInContainer = function (core, position, keyboardEvent, applyFormatToSpan) {
|
|
5101
5104
|
var table = (0, roosterjs_editor_dom_1.findClosestElementAncestor)(position.node, core.contentDiv, 'table');
|
|
5102
5105
|
var td;
|
|
5103
5106
|
if (table && (td = table.querySelector('td,th'))) {
|
|
@@ -5118,20 +5121,28 @@ var ensureTypeInContainer = function (core, position, keyboardEvent) {
|
|
|
5118
5121
|
var shouldSetNodeStyles = (0, roosterjs_editor_dom_1.isNodeEmpty)(formatNode) ||
|
|
5119
5122
|
(keyboardEvent && wasNodeJustCreatedByKeyboardEvent(keyboardEvent, formatNode));
|
|
5120
5123
|
formatNode = formatNode && shouldSetNodeStyles ? formatNode : null;
|
|
5124
|
+
if (formatNode && core.lifecycle.defaultFormat && applyFormatToSpan) {
|
|
5125
|
+
var firstChild = formatNode.firstChild;
|
|
5126
|
+
formatNode = (0, roosterjs_editor_dom_1.safeInstanceOf)(firstChild, 'HTMLSpanElement')
|
|
5127
|
+
? firstChild
|
|
5128
|
+
: (0, roosterjs_editor_dom_1.wrap)((0, roosterjs_editor_dom_1.toArray)(formatNode.childNodes), 'span');
|
|
5129
|
+
position = new roosterjs_editor_dom_1.Position(formatNode, 0 /* Begin */);
|
|
5130
|
+
}
|
|
5121
5131
|
}
|
|
5122
5132
|
else {
|
|
5123
5133
|
// Only reason we don't get the selection block is that we have an empty content div
|
|
5124
5134
|
// which can happen when users removes everything (i.e. select all and DEL, or backspace from very end to begin)
|
|
5125
5135
|
// The fix is to add a DIV wrapping, apply default format and move cursor over
|
|
5126
|
-
|
|
5127
|
-
core.api.insertNode(core,
|
|
5136
|
+
var newNode = (0, roosterjs_editor_dom_1.createElement)(1 /* EmptyLine */, core.contentDiv.ownerDocument);
|
|
5137
|
+
core.api.insertNode(core, newNode, {
|
|
5128
5138
|
position: 1 /* End */,
|
|
5129
5139
|
updateCursor: false,
|
|
5130
5140
|
replaceSelection: false,
|
|
5131
5141
|
insertOnNewLine: false,
|
|
5132
5142
|
});
|
|
5143
|
+
formatNode = newNode.firstChild;
|
|
5133
5144
|
// element points to a wrapping node we added "<div><br></div>". We should move the selection left to <br>
|
|
5134
|
-
position = new roosterjs_editor_dom_1.Position(formatNode
|
|
5145
|
+
position = new roosterjs_editor_dom_1.Position(formatNode, 0 /* Begin */);
|
|
5135
5146
|
}
|
|
5136
5147
|
if (formatNode && core.lifecycle.defaultFormat) {
|
|
5137
5148
|
(0, roosterjs_editor_dom_1.applyFormat)(formatNode, core.lifecycle.defaultFormat, core.lifecycle.isDarkMode);
|
|
@@ -5850,7 +5861,6 @@ exports.restoreUndoSnapshot = restoreUndoSnapshot;
|
|
|
5850
5861
|
|
|
5851
5862
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5852
5863
|
exports.selectImage = void 0;
|
|
5853
|
-
var addSelectionStyle_1 = __webpack_require__(/*! ./utils/addSelectionStyle */ "./packages/roosterjs-editor-core/lib/coreApi/utils/addSelectionStyle.ts");
|
|
5854
5864
|
var addUniqueId_1 = __webpack_require__(/*! ./utils/addUniqueId */ "./packages/roosterjs-editor-core/lib/coreApi/utils/addUniqueId.ts");
|
|
5855
5865
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
5856
5866
|
var IMAGE_ID = 'imageSelected';
|
|
@@ -5885,7 +5895,7 @@ exports.selectImage = selectImage;
|
|
|
5885
5895
|
var select = function (core, image) {
|
|
5886
5896
|
(0, roosterjs_editor_dom_1.removeImportantStyleRule)(image, ['border', 'margin']);
|
|
5887
5897
|
var borderCSS = buildBorderCSS(core, image.id);
|
|
5888
|
-
(0,
|
|
5898
|
+
(0, roosterjs_editor_dom_1.setGlobalCssStyles)(core.contentDiv.ownerDocument, borderCSS, STYLE_ID + core.contentDiv.id);
|
|
5889
5899
|
};
|
|
5890
5900
|
var buildBorderCSS = function (core, imageId) {
|
|
5891
5901
|
var divId = core.contentDiv.id;
|
|
@@ -5894,10 +5904,7 @@ var buildBorderCSS = function (core, imageId) {
|
|
|
5894
5904
|
};
|
|
5895
5905
|
var unselect = function (core) {
|
|
5896
5906
|
var doc = core.contentDiv.ownerDocument;
|
|
5897
|
-
|
|
5898
|
-
if (styleTag) {
|
|
5899
|
-
doc.head.removeChild(styleTag);
|
|
5900
|
-
}
|
|
5907
|
+
(0, roosterjs_editor_dom_1.removeGlobalCssStyle)(doc, STYLE_ID + core.contentDiv.id);
|
|
5901
5908
|
};
|
|
5902
5909
|
|
|
5903
5910
|
|
|
@@ -5979,7 +5986,6 @@ function restorePendingFormatState(core) {
|
|
|
5979
5986
|
|
|
5980
5987
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5981
5988
|
exports.selectTable = void 0;
|
|
5982
|
-
var addSelectionStyle_1 = __webpack_require__(/*! ./utils/addSelectionStyle */ "./packages/roosterjs-editor-core/lib/coreApi/utils/addSelectionStyle.ts");
|
|
5983
5989
|
var addUniqueId_1 = __webpack_require__(/*! ./utils/addUniqueId */ "./packages/roosterjs-editor-core/lib/coreApi/utils/addUniqueId.ts");
|
|
5984
5990
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
5985
5991
|
var TABLE_ID = 'tableSelected';
|
|
@@ -6080,19 +6086,13 @@ function buildCss(table, coordinates, contentDivSelector) {
|
|
|
6080
6086
|
function select(core, table, coordinates) {
|
|
6081
6087
|
var contentDivSelector = '#' + core.contentDiv.id;
|
|
6082
6088
|
var _a = buildCss(table, coordinates, contentDivSelector), css = _a.css, ranges = _a.ranges;
|
|
6083
|
-
(0,
|
|
6089
|
+
(0, roosterjs_editor_dom_1.setGlobalCssStyles)(core.contentDiv.ownerDocument, css, STYLE_ID + core.contentDiv.id);
|
|
6084
6090
|
return ranges;
|
|
6085
6091
|
}
|
|
6086
|
-
function
|
|
6087
|
-
var
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
if ((_a = styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
|
|
6091
|
-
while (styleElement.sheet.cssRules.length > 0) {
|
|
6092
|
-
styleElement.sheet.deleteRule(0);
|
|
6093
|
-
}
|
|
6094
|
-
}
|
|
6095
|
-
}
|
|
6092
|
+
var unselect = function (core) {
|
|
6093
|
+
var doc = core.contentDiv.ownerDocument;
|
|
6094
|
+
(0, roosterjs_editor_dom_1.removeGlobalCssStyle)(doc, STYLE_ID + core.contentDiv.id);
|
|
6095
|
+
};
|
|
6096
6096
|
function generateCssFromCell(contentDivSelector, tableId, middleElSelector, rowIndex, cellTag, index) {
|
|
6097
6097
|
return (contentDivSelector +
|
|
6098
6098
|
' #' +
|
|
@@ -6487,39 +6487,6 @@ function handledExclusively(event, plugin) {
|
|
|
6487
6487
|
}
|
|
6488
6488
|
|
|
6489
6489
|
|
|
6490
|
-
/***/ }),
|
|
6491
|
-
|
|
6492
|
-
/***/ "./packages/roosterjs-editor-core/lib/coreApi/utils/addSelectionStyle.ts":
|
|
6493
|
-
/*!*******************************************************************************!*\
|
|
6494
|
-
!*** ./packages/roosterjs-editor-core/lib/coreApi/utils/addSelectionStyle.ts ***!
|
|
6495
|
-
\*******************************************************************************/
|
|
6496
|
-
/*! no static exports found */
|
|
6497
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
6498
|
-
|
|
6499
|
-
"use strict";
|
|
6500
|
-
|
|
6501
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6502
|
-
/**
|
|
6503
|
-
* Add style to selected elements
|
|
6504
|
-
* @param core The Editor core object
|
|
6505
|
-
* @param cssRule The css rule that must added to the selection
|
|
6506
|
-
* @param styleId the ID of the style tag
|
|
6507
|
-
*/
|
|
6508
|
-
function addSelectionStyle(core, cssRule, styleId) {
|
|
6509
|
-
var _a;
|
|
6510
|
-
var styleTagId = styleId + core.contentDiv.id;
|
|
6511
|
-
var doc = core.contentDiv.ownerDocument;
|
|
6512
|
-
var styleTag = doc.getElementById(styleTagId);
|
|
6513
|
-
if (!styleTag) {
|
|
6514
|
-
styleTag = doc.createElement('style');
|
|
6515
|
-
styleTag.id = styleTagId;
|
|
6516
|
-
doc.head.appendChild(styleTag);
|
|
6517
|
-
}
|
|
6518
|
-
(_a = styleTag.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(cssRule);
|
|
6519
|
-
}
|
|
6520
|
-
exports.default = addSelectionStyle;
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
6490
|
/***/ }),
|
|
6524
6491
|
|
|
6525
6492
|
/***/ "./packages/roosterjs-editor-core/lib/coreApi/utils/addUniqueId.ts":
|
|
@@ -6672,6 +6639,9 @@ var CopyPastePlugin = /** @class */ (function () {
|
|
|
6672
6639
|
var image = tempDiv_1.querySelector('#' + selection_1.image.id);
|
|
6673
6640
|
if (image) {
|
|
6674
6641
|
newRange = (0, roosterjs_editor_dom_1.createRange)(image);
|
|
6642
|
+
if (isCut) {
|
|
6643
|
+
this.deleteImage(this.editor, selection_1.image.id);
|
|
6644
|
+
}
|
|
6675
6645
|
}
|
|
6676
6646
|
}
|
|
6677
6647
|
else {
|
|
@@ -6781,6 +6751,11 @@ var CopyPastePlugin = /** @class */ (function () {
|
|
|
6781
6751
|
table.style.removeProperty('height');
|
|
6782
6752
|
}
|
|
6783
6753
|
};
|
|
6754
|
+
CopyPastePlugin.prototype.deleteImage = function (editor, imageId) {
|
|
6755
|
+
editor.queryElements('#' + imageId, function (node) {
|
|
6756
|
+
editor.deleteNode(node);
|
|
6757
|
+
});
|
|
6758
|
+
};
|
|
6784
6759
|
return CopyPastePlugin;
|
|
6785
6760
|
}());
|
|
6786
6761
|
exports.default = CopyPastePlugin;
|
|
@@ -7480,6 +7455,95 @@ var workaroundSelectionIssueForIE = roosterjs_editor_dom_1.Browser.isIE
|
|
|
7480
7455
|
: function () { };
|
|
7481
7456
|
|
|
7482
7457
|
|
|
7458
|
+
/***/ }),
|
|
7459
|
+
|
|
7460
|
+
/***/ "./packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts":
|
|
7461
|
+
/*!**************************************************************************!*\
|
|
7462
|
+
!*** ./packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts ***!
|
|
7463
|
+
\**************************************************************************/
|
|
7464
|
+
/*! no static exports found */
|
|
7465
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
7466
|
+
|
|
7467
|
+
"use strict";
|
|
7468
|
+
|
|
7469
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7470
|
+
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
7471
|
+
var Escape = 'Escape';
|
|
7472
|
+
var mouseRightButton = 2;
|
|
7473
|
+
var mouseLeftButton = 0;
|
|
7474
|
+
/**
|
|
7475
|
+
* Detect image selection and help highlight the image
|
|
7476
|
+
*/
|
|
7477
|
+
var ImageSelection = /** @class */ (function () {
|
|
7478
|
+
function ImageSelection() {
|
|
7479
|
+
this.editor = null;
|
|
7480
|
+
}
|
|
7481
|
+
/**
|
|
7482
|
+
* Get a friendly name of this plugin
|
|
7483
|
+
*/
|
|
7484
|
+
ImageSelection.prototype.getName = function () {
|
|
7485
|
+
return 'ImageSelection';
|
|
7486
|
+
};
|
|
7487
|
+
/**
|
|
7488
|
+
* Initialize this plugin. This should only be called from Editor
|
|
7489
|
+
* @param editor Editor instance
|
|
7490
|
+
*/
|
|
7491
|
+
ImageSelection.prototype.initialize = function (editor) {
|
|
7492
|
+
this.editor = editor;
|
|
7493
|
+
};
|
|
7494
|
+
/**
|
|
7495
|
+
* Dispose this plugin
|
|
7496
|
+
*/
|
|
7497
|
+
ImageSelection.prototype.dispose = function () {
|
|
7498
|
+
var _a;
|
|
7499
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.select(null);
|
|
7500
|
+
this.editor = null;
|
|
7501
|
+
};
|
|
7502
|
+
ImageSelection.prototype.onPluginEvent = function (event) {
|
|
7503
|
+
var _a;
|
|
7504
|
+
if (this.editor) {
|
|
7505
|
+
switch (event.eventType) {
|
|
7506
|
+
case 17 /* EnteredShadowEdit */:
|
|
7507
|
+
case 18 /* LeavingShadowEdit */:
|
|
7508
|
+
var selection = this.editor.getSelectionRangeEx();
|
|
7509
|
+
if (selection.type == 2 /* ImageSelection */) {
|
|
7510
|
+
this.editor.select(selection.image);
|
|
7511
|
+
}
|
|
7512
|
+
break;
|
|
7513
|
+
case 6 /* MouseUp */:
|
|
7514
|
+
var target = event.rawEvent.target;
|
|
7515
|
+
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(target, 'HTMLImageElement')) {
|
|
7516
|
+
if (event.rawEvent.button === mouseRightButton) {
|
|
7517
|
+
var imageRange = (0, roosterjs_editor_dom_1.createRange)(target);
|
|
7518
|
+
this.editor.select(imageRange);
|
|
7519
|
+
}
|
|
7520
|
+
else if (event.rawEvent.button === mouseLeftButton) {
|
|
7521
|
+
this.editor.select(target);
|
|
7522
|
+
}
|
|
7523
|
+
}
|
|
7524
|
+
break;
|
|
7525
|
+
case 2 /* KeyUp */:
|
|
7526
|
+
var key = event.rawEvent.key;
|
|
7527
|
+
var keyDownSelection = this.editor.getSelectionRangeEx();
|
|
7528
|
+
if (keyDownSelection.type === 2 /* ImageSelection */) {
|
|
7529
|
+
if (key === Escape) {
|
|
7530
|
+
this.editor.select(keyDownSelection.image, -2 /* Before */);
|
|
7531
|
+
(_a = this.editor.getSelectionRange()) === null || _a === void 0 ? void 0 : _a.collapse();
|
|
7532
|
+
event.rawEvent.stopPropagation();
|
|
7533
|
+
}
|
|
7534
|
+
else {
|
|
7535
|
+
this.editor.select(keyDownSelection.ranges[0]);
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
break;
|
|
7539
|
+
}
|
|
7540
|
+
}
|
|
7541
|
+
};
|
|
7542
|
+
return ImageSelection;
|
|
7543
|
+
}());
|
|
7544
|
+
exports.default = ImageSelection;
|
|
7545
|
+
|
|
7546
|
+
|
|
7483
7547
|
/***/ }),
|
|
7484
7548
|
|
|
7485
7549
|
/***/ "./packages/roosterjs-editor-core/lib/corePlugins/LifecyclePlugin.ts":
|
|
@@ -8422,6 +8486,7 @@ var CopyPastePlugin_1 = __webpack_require__(/*! ./CopyPastePlugin */ "./packages
|
|
|
8422
8486
|
var DOMEventPlugin_1 = __webpack_require__(/*! ./DOMEventPlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/DOMEventPlugin.ts");
|
|
8423
8487
|
var EditPlugin_1 = __webpack_require__(/*! ./EditPlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/EditPlugin.ts");
|
|
8424
8488
|
var EntityPlugin_1 = __webpack_require__(/*! ./EntityPlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/EntityPlugin.ts");
|
|
8489
|
+
var ImageSelection_1 = __webpack_require__(/*! ./ImageSelection */ "./packages/roosterjs-editor-core/lib/corePlugins/ImageSelection.ts");
|
|
8425
8490
|
var LifecyclePlugin_1 = __webpack_require__(/*! ./LifecyclePlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/LifecyclePlugin.ts");
|
|
8426
8491
|
var MouseUpPlugin_1 = __webpack_require__(/*! ./MouseUpPlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/MouseUpPlugin.ts");
|
|
8427
8492
|
var NormalizeTablePlugin_1 = __webpack_require__(/*! ./NormalizeTablePlugin */ "./packages/roosterjs-editor-core/lib/corePlugins/NormalizeTablePlugin.ts");
|
|
@@ -8449,6 +8514,7 @@ function createCorePlugins(contentDiv, options) {
|
|
|
8449
8514
|
mouseUp: map.mouseUp || new MouseUpPlugin_1.default(),
|
|
8450
8515
|
copyPaste: map.copyPaste || new CopyPastePlugin_1.default(options),
|
|
8451
8516
|
entity: map.entity || new EntityPlugin_1.default(),
|
|
8517
|
+
imageSelection: map.imageSelection || new ImageSelection_1.default(),
|
|
8452
8518
|
normalizeTable: map.normalizeTable || new NormalizeTablePlugin_1.default(),
|
|
8453
8519
|
lifecycle: map.lifecycle || new LifecyclePlugin_1.default(options, contentDiv),
|
|
8454
8520
|
};
|
|
@@ -8894,9 +8960,7 @@ var Editor = /** @class */ (function () {
|
|
|
8894
8960
|
coordinates: arg2,
|
|
8895
8961
|
};
|
|
8896
8962
|
}
|
|
8897
|
-
else if (
|
|
8898
|
-
(0, roosterjs_editor_dom_1.safeInstanceOf)(arg1, 'HTMLImageElement') &&
|
|
8899
|
-
typeof arg2 == 'undefined') {
|
|
8963
|
+
else if ((0, roosterjs_editor_dom_1.safeInstanceOf)(arg1, 'HTMLImageElement') && typeof arg2 == 'undefined') {
|
|
8900
8964
|
rangeEx = {
|
|
8901
8965
|
type: 2 /* ImageSelection */,
|
|
8902
8966
|
ranges: [],
|
|
@@ -12262,8 +12326,8 @@ exports.isCssVariable = isCssVariable;
|
|
|
12262
12326
|
|
|
12263
12327
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12264
12328
|
exports.getIntersectedRect = exports.moveChildNodes = exports.KnownCreateElementData = exports.createElement = exports.matchesSelector = exports.setColor = exports.getInnerHTML = exports.readFile = exports.safeInstanceOf = exports.normalizeRect = exports.splitTextNode = exports.getLastLeafNode = exports.getFirstLeafNode = exports.getPreviousLeafSibling = exports.getNextLeafSibling = exports.wrap = exports.unwrap = exports.splitBalancedNodeRange = exports.splitParentNode = exports.queryElements = exports.matchLink = exports.isVoidHtmlElement = exports.isNodeEmpty = exports.isBlockElement = exports.getTagOfNode = exports.PendableFormatCommandMap = exports.getPendableFormatState = exports.getComputedStyle = exports.getComputedStyles = exports.fromHtml = exports.findClosestElementAncestor = exports.contains = exports.collapseNodes = exports.changeElementTag = exports.applyFormat = exports.getBrowserInfo = exports.Browser = exports.extractClipboardItemsForIE = exports.extractClipboardItems = exports.extractClipboardEvent = exports.applyTextStyle = exports.PartialInlineElement = exports.NodeInlineElement = exports.LinkInlineElement = exports.ImageInlineElement = exports.getInlineElementAtNode = exports.PositionContentSearcher = exports.ContentTraverser = exports.getFirstLastBlockElement = exports.getBlockElementAtNode = void 0;
|
|
12265
|
-
exports.
|
|
12266
|
-
exports.toArray = exports.getObjectKeys = exports.arrayPush = exports.removeMetadata = exports.setMetadata = exports.getMetadata = exports.createObjectDefinition = exports.createArrayDefinition = exports.createStringDefinition = exports.createBooleanDefinition = exports.createNumberDefinition = exports.validate = exports.getTextContent = exports.deleteSelectedContent = void 0;
|
|
12329
|
+
exports.setGlobalCssStyles = exports.removeImportantStyleRule = exports.setStyles = exports.getStyles = exports.isCtrlOrMetaPressed = exports.isCharacterValue = exports.isModifierKey = exports.clearEventDataCache = exports.cacheGetEventData = exports.getEntitySelector = exports.getEntityFromElement = exports.commitEntity = exports.chainSanitizerCallback = exports.createDefaultHtmlSanitizerOptions = exports.getInheritableStyles = exports.HtmlSanitizer = exports.canUndoAutoComplete = exports.createSnapshots = exports.moveCurrentSnapsnot = exports.moveCurrentSnapshot = exports.clearProceedingSnapshotsV2 = exports.clearProceedingSnapshots = exports.canMoveCurrentSnapshot = exports.addSnapshotV2 = exports.addSnapshot = exports.addRangeToSelection = exports.setHtmlWithMetadata = exports.setHtmlWithSelectionPath = exports.getHtmlWithSelectionPath = exports.getSelectionPath = exports.isPositionAtBeginningOf = exports.getPositionRect = exports.createRange = exports.Position = exports.mergeBlocksInRegion = exports.getSelectionRangeInRegion = exports.isNodeInRegion = exports.collapseNodesInRegion = exports.getSelectedBlockElementsInRegion = exports.getRegionsFromRange = exports.saveTableCellMetadata = exports.getTableFormatInfo = exports.setListItemStyle = exports.VListChain = exports.createVListFromRegion = exports.VListItem = exports.VList = exports.isWholeTableSelected = exports.VTable = exports.isNodeAfter = void 0;
|
|
12330
|
+
exports.toArray = exports.getObjectKeys = exports.arrayPush = exports.removeMetadata = exports.setMetadata = exports.getMetadata = exports.createObjectDefinition = exports.createArrayDefinition = exports.createStringDefinition = exports.createBooleanDefinition = exports.createNumberDefinition = exports.validate = exports.getTextContent = exports.deleteSelectedContent = exports.adjustInsertPosition = exports.removeGlobalCssStyle = void 0;
|
|
12267
12331
|
var getBlockElementAtNode_1 = __webpack_require__(/*! ./blockElements/getBlockElementAtNode */ "./packages/roosterjs-editor-dom/lib/blockElements/getBlockElementAtNode.ts");
|
|
12268
12332
|
Object.defineProperty(exports, "getBlockElementAtNode", { enumerable: true, get: function () { return getBlockElementAtNode_1.default; } });
|
|
12269
12333
|
var getFirstLastBlockElement_1 = __webpack_require__(/*! ./blockElements/getFirstLastBlockElement */ "./packages/roosterjs-editor-dom/lib/blockElements/getFirstLastBlockElement.ts");
|
|
@@ -12451,6 +12515,10 @@ var setStyles_1 = __webpack_require__(/*! ./style/setStyles */ "./packages/roost
|
|
|
12451
12515
|
Object.defineProperty(exports, "setStyles", { enumerable: true, get: function () { return setStyles_1.default; } });
|
|
12452
12516
|
var removeImportantStyleRule_1 = __webpack_require__(/*! ./style/removeImportantStyleRule */ "./packages/roosterjs-editor-dom/lib/style/removeImportantStyleRule.ts");
|
|
12453
12517
|
Object.defineProperty(exports, "removeImportantStyleRule", { enumerable: true, get: function () { return removeImportantStyleRule_1.default; } });
|
|
12518
|
+
var setGlobalCssStyles_1 = __webpack_require__(/*! ./style/setGlobalCssStyles */ "./packages/roosterjs-editor-dom/lib/style/setGlobalCssStyles.ts");
|
|
12519
|
+
Object.defineProperty(exports, "setGlobalCssStyles", { enumerable: true, get: function () { return setGlobalCssStyles_1.default; } });
|
|
12520
|
+
var removeGlobalCssStyle_1 = __webpack_require__(/*! ./style/removeGlobalCssStyle */ "./packages/roosterjs-editor-dom/lib/style/removeGlobalCssStyle.ts");
|
|
12521
|
+
Object.defineProperty(exports, "removeGlobalCssStyle", { enumerable: true, get: function () { return removeGlobalCssStyle_1.default; } });
|
|
12454
12522
|
var adjustInsertPosition_1 = __webpack_require__(/*! ./edit/adjustInsertPosition */ "./packages/roosterjs-editor-dom/lib/edit/adjustInsertPosition.ts");
|
|
12455
12523
|
Object.defineProperty(exports, "adjustInsertPosition", { enumerable: true, get: function () { return adjustInsertPosition_1.default; } });
|
|
12456
12524
|
var deleteSelectedContent_1 = __webpack_require__(/*! ./edit/deleteSelectedContent */ "./packages/roosterjs-editor-dom/lib/edit/deleteSelectedContent.ts");
|
|
@@ -13811,6 +13879,17 @@ function createListChainName() {
|
|
|
13811
13879
|
|
|
13812
13880
|
"use strict";
|
|
13813
13881
|
|
|
13882
|
+
var __assign = (this && this.__assign) || function () {
|
|
13883
|
+
__assign = Object.assign || function(t) {
|
|
13884
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
13885
|
+
s = arguments[i];
|
|
13886
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
13887
|
+
t[p] = s[p];
|
|
13888
|
+
}
|
|
13889
|
+
return t;
|
|
13890
|
+
};
|
|
13891
|
+
return __assign.apply(this, arguments);
|
|
13892
|
+
};
|
|
13814
13893
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13815
13894
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
13816
13895
|
if (ar || !(i in from)) {
|
|
@@ -13824,6 +13903,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13824
13903
|
exports.ListStyleDefinitionMetadata = void 0;
|
|
13825
13904
|
var contains_1 = __webpack_require__(/*! ../utils/contains */ "./packages/roosterjs-editor-dom/lib/utils/contains.ts");
|
|
13826
13905
|
var getListTypeFromNode_1 = __webpack_require__(/*! ./getListTypeFromNode */ "./packages/roosterjs-editor-dom/lib/list/getListTypeFromNode.ts");
|
|
13906
|
+
var getStyles_1 = __webpack_require__(/*! ../style/getStyles */ "./packages/roosterjs-editor-dom/lib/style/getStyles.ts");
|
|
13827
13907
|
var getTagOfNode_1 = __webpack_require__(/*! ../utils/getTagOfNode */ "./packages/roosterjs-editor-dom/lib/utils/getTagOfNode.ts");
|
|
13828
13908
|
var isBlockElement_1 = __webpack_require__(/*! ../utils/isBlockElement */ "./packages/roosterjs-editor-dom/lib/utils/isBlockElement.ts");
|
|
13829
13909
|
var moveChildNodes_1 = __webpack_require__(/*! ../utils/moveChildNodes */ "./packages/roosterjs-editor-dom/lib/utils/moveChildNodes.ts");
|
|
@@ -13831,6 +13911,7 @@ var safeInstanceOf_1 = __webpack_require__(/*! ../utils/safeInstanceOf */ "./pac
|
|
|
13831
13911
|
var setBulletListMarkers_1 = __webpack_require__(/*! ./setBulletListMarkers */ "./packages/roosterjs-editor-dom/lib/list/setBulletListMarkers.ts");
|
|
13832
13912
|
var setListItemStyle_1 = __webpack_require__(/*! ./setListItemStyle */ "./packages/roosterjs-editor-dom/lib/list/setListItemStyle.ts");
|
|
13833
13913
|
var setNumberingListMarkers_1 = __webpack_require__(/*! ./setNumberingListMarkers */ "./packages/roosterjs-editor-dom/lib/list/setNumberingListMarkers.ts");
|
|
13914
|
+
var setStyles_1 = __webpack_require__(/*! ../style/setStyles */ "./packages/roosterjs-editor-dom/lib/style/setStyles.ts");
|
|
13834
13915
|
var toArray_1 = __webpack_require__(/*! ../jsUtils/toArray */ "./packages/roosterjs-editor-dom/lib/jsUtils/toArray.ts");
|
|
13835
13916
|
var unwrap_1 = __webpack_require__(/*! ../utils/unwrap */ "./packages/roosterjs-editor-dom/lib/utils/unwrap.ts");
|
|
13836
13917
|
var wrap_1 = __webpack_require__(/*! ../utils/wrap */ "./packages/roosterjs-editor-dom/lib/utils/wrap.ts");
|
|
@@ -14101,7 +14182,29 @@ var VListItem = /** @class */ (function () {
|
|
|
14101
14182
|
}
|
|
14102
14183
|
// 5. If this is not a list item now, need to unwrap the LI node and do proper handling
|
|
14103
14184
|
if (this.listTypes.length <= 1) {
|
|
14104
|
-
|
|
14185
|
+
// If original <LI> node has styles for font and color, we need to apply it to new parent
|
|
14186
|
+
var isLi = (0, getTagOfNode_1.default)(this.node) == 'LI';
|
|
14187
|
+
var stylesToApply = isLi
|
|
14188
|
+
? {
|
|
14189
|
+
'font-family': this.node.style.fontFamily,
|
|
14190
|
+
'font-size': this.node.style.fontSize,
|
|
14191
|
+
color: this.node.style.color,
|
|
14192
|
+
}
|
|
14193
|
+
: undefined;
|
|
14194
|
+
var childNodes = isLi ? getChildrenAndUnwrap(this.node) : [this.node];
|
|
14195
|
+
if (stylesToApply) {
|
|
14196
|
+
for (var i = 0; i < childNodes.length; i++) {
|
|
14197
|
+
if ((0, safeInstanceOf_1.default)(childNodes[i], 'Text')) {
|
|
14198
|
+
childNodes[i] = (0, wrap_1.default)(childNodes[i], 'span');
|
|
14199
|
+
}
|
|
14200
|
+
var node = childNodes[i];
|
|
14201
|
+
if ((0, safeInstanceOf_1.default)(node, 'HTMLElement')) {
|
|
14202
|
+
var styles = __assign(__assign({}, stylesToApply), (0, getStyles_1.default)(node));
|
|
14203
|
+
(0, setStyles_1.default)(node, styles);
|
|
14204
|
+
}
|
|
14205
|
+
}
|
|
14206
|
+
}
|
|
14207
|
+
wrapIfNotBlockNode(childNodes, true /*checkFirst*/, true /*checkLast*/);
|
|
14105
14208
|
}
|
|
14106
14209
|
};
|
|
14107
14210
|
/**
|
|
@@ -14574,27 +14677,31 @@ function setListItemStyle(element, styles) {
|
|
|
14574
14677
|
}
|
|
14575
14678
|
exports.default = setListItemStyle;
|
|
14576
14679
|
function getInlineChildElementsStyle(element, styles) {
|
|
14577
|
-
var _a;
|
|
14680
|
+
var _a, _b;
|
|
14578
14681
|
var result = [];
|
|
14579
14682
|
var contentTraverser = ContentTraverser_1.default.createBodyTraverser(element);
|
|
14580
14683
|
var currentInlineElement = null;
|
|
14581
14684
|
var _loop_1 = function () {
|
|
14582
14685
|
currentInlineElement = contentTraverser.currentInlineElement;
|
|
14583
14686
|
var currentNode = (currentInlineElement === null || currentInlineElement === void 0 ? void 0 : currentInlineElement.getContainerNode()) || null;
|
|
14584
|
-
var currentStyle =
|
|
14687
|
+
var currentStyle = null;
|
|
14585
14688
|
currentNode = currentNode ? (0, findClosestElementAncestor_1.default)(currentNode) : null;
|
|
14586
|
-
// we should consider of when it is the single
|
|
14689
|
+
// we should consider of when it is the single child node of element, the parentNode's style should add
|
|
14587
14690
|
// such as the "i", "b", "span" node in <li><span><b><i>aa</i></b></span></li>
|
|
14588
14691
|
while (currentNode &&
|
|
14589
14692
|
currentNode !== element &&
|
|
14590
|
-
(0, safeInstanceOf_1.default)(currentNode, 'HTMLElement')
|
|
14693
|
+
(0, safeInstanceOf_1.default)(currentNode, 'HTMLElement') &&
|
|
14694
|
+
(result.length == 0 || (((_a = currentNode.textContent) === null || _a === void 0 ? void 0 : _a.trim().length) || 0) > 0)) {
|
|
14591
14695
|
styles.forEach(function (styleName) {
|
|
14592
14696
|
var styleValue = currentNode.style.getPropertyValue(styleName);
|
|
14697
|
+
if (!currentStyle) {
|
|
14698
|
+
currentStyle = {};
|
|
14699
|
+
}
|
|
14593
14700
|
if (styleValue && !currentStyle[styleName]) {
|
|
14594
14701
|
currentStyle[styleName] = styleValue;
|
|
14595
14702
|
}
|
|
14596
14703
|
});
|
|
14597
|
-
if (((
|
|
14704
|
+
if (((_b = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _b === void 0 ? void 0 : _b.childNodes.length) === 1) {
|
|
14598
14705
|
currentNode = currentNode.parentNode;
|
|
14599
14706
|
}
|
|
14600
14707
|
else {
|
|
@@ -16304,6 +16411,33 @@ function getStyles(element) {
|
|
|
16304
16411
|
exports.default = getStyles;
|
|
16305
16412
|
|
|
16306
16413
|
|
|
16414
|
+
/***/ }),
|
|
16415
|
+
|
|
16416
|
+
/***/ "./packages/roosterjs-editor-dom/lib/style/removeGlobalCssStyle.ts":
|
|
16417
|
+
/*!*************************************************************************!*\
|
|
16418
|
+
!*** ./packages/roosterjs-editor-dom/lib/style/removeGlobalCssStyle.ts ***!
|
|
16419
|
+
\*************************************************************************/
|
|
16420
|
+
/*! no static exports found */
|
|
16421
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
16422
|
+
|
|
16423
|
+
"use strict";
|
|
16424
|
+
|
|
16425
|
+
/**
|
|
16426
|
+
* Remove a css rule style from a style sheet
|
|
16427
|
+
* @param doc The document object
|
|
16428
|
+
* @param styleId the ID of the style tag
|
|
16429
|
+
*/
|
|
16430
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16431
|
+
function removeGlobalCssStyle(doc, styleId) {
|
|
16432
|
+
var _a;
|
|
16433
|
+
var styleTag = doc.getElementById(styleId);
|
|
16434
|
+
if (styleTag) {
|
|
16435
|
+
(_a = styleTag.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(styleTag);
|
|
16436
|
+
}
|
|
16437
|
+
}
|
|
16438
|
+
exports.default = removeGlobalCssStyle;
|
|
16439
|
+
|
|
16440
|
+
|
|
16307
16441
|
/***/ }),
|
|
16308
16442
|
|
|
16309
16443
|
/***/ "./packages/roosterjs-editor-dom/lib/style/removeImportantStyleRule.ts":
|
|
@@ -16341,6 +16475,38 @@ function removeImportantStyleRule(element, styleProperties) {
|
|
|
16341
16475
|
exports.default = removeImportantStyleRule;
|
|
16342
16476
|
|
|
16343
16477
|
|
|
16478
|
+
/***/ }),
|
|
16479
|
+
|
|
16480
|
+
/***/ "./packages/roosterjs-editor-dom/lib/style/setGlobalCssStyles.ts":
|
|
16481
|
+
/*!***********************************************************************!*\
|
|
16482
|
+
!*** ./packages/roosterjs-editor-dom/lib/style/setGlobalCssStyles.ts ***!
|
|
16483
|
+
\***********************************************************************/
|
|
16484
|
+
/*! no static exports found */
|
|
16485
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
16486
|
+
|
|
16487
|
+
"use strict";
|
|
16488
|
+
|
|
16489
|
+
/**
|
|
16490
|
+
* Add global css styles
|
|
16491
|
+
* @param doc The document object
|
|
16492
|
+
* @param cssRule The css rule that must added to the selection
|
|
16493
|
+
* @param editorId Te id of the editor
|
|
16494
|
+
* @param styleId the ID of the style tag
|
|
16495
|
+
*/
|
|
16496
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16497
|
+
function setGlobalCssStyles(doc, cssRule, styleId) {
|
|
16498
|
+
var _a;
|
|
16499
|
+
var styleTag = doc.getElementById(styleId);
|
|
16500
|
+
if (!styleTag) {
|
|
16501
|
+
styleTag = doc.createElement('style');
|
|
16502
|
+
styleTag.id = styleId;
|
|
16503
|
+
doc.head.appendChild(styleTag);
|
|
16504
|
+
}
|
|
16505
|
+
(_a = styleTag.sheet) === null || _a === void 0 ? void 0 : _a.insertRule(cssRule);
|
|
16506
|
+
}
|
|
16507
|
+
exports.default = setGlobalCssStyles;
|
|
16508
|
+
|
|
16509
|
+
|
|
16344
16510
|
/***/ }),
|
|
16345
16511
|
|
|
16346
16512
|
/***/ "./packages/roosterjs-editor-dom/lib/style/setStyles.ts":
|
|
@@ -17908,7 +18074,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17908
18074
|
exports.KnownCreateElementData = void 0;
|
|
17909
18075
|
var getObjectKeys_1 = __webpack_require__(/*! ../jsUtils/getObjectKeys */ "./packages/roosterjs-editor-dom/lib/jsUtils/getObjectKeys.ts");
|
|
17910
18076
|
var safeInstanceOf_1 = __webpack_require__(/*! ./safeInstanceOf */ "./packages/roosterjs-editor-dom/lib/utils/safeInstanceOf.ts");
|
|
17911
|
-
var Browser_1 = __webpack_require__(/*! ./Browser */ "./packages/roosterjs-editor-dom/lib/utils/Browser.ts");
|
|
17912
18077
|
/**
|
|
17913
18078
|
* All known CreateElementData used by roosterjs to create elements
|
|
17914
18079
|
*/
|
|
@@ -17916,9 +18081,10 @@ exports.KnownCreateElementData = (_a = {},
|
|
|
17916
18081
|
_a[0 /* None */] = { tag: '' },
|
|
17917
18082
|
// Edge can sometimes lose current format when Enter to new line.
|
|
17918
18083
|
// So here we add an extra SPAN for Edge to workaround this bug
|
|
17919
|
-
_a[1 /* EmptyLine */] =
|
|
17920
|
-
|
|
17921
|
-
: { tag: '
|
|
18084
|
+
_a[1 /* EmptyLine */] = {
|
|
18085
|
+
tag: 'div',
|
|
18086
|
+
children: [{ tag: 'span', children: [{ tag: 'br' }] }],
|
|
18087
|
+
},
|
|
17922
18088
|
_a[2 /* BlockquoteWrapper */] = {
|
|
17923
18089
|
tag: 'blockquote',
|
|
17924
18090
|
style: 'margin-top:0;margin-bottom:0',
|
|
@@ -17936,8 +18102,14 @@ exports.KnownCreateElementData = (_a = {},
|
|
|
17936
18102
|
style: 'position: fixed; width: 0; height: 0',
|
|
17937
18103
|
},
|
|
17938
18104
|
_a[6 /* ImageEditWrapper */] = {
|
|
17939
|
-
tag: '
|
|
17940
|
-
style: 'width:100%;
|
|
18105
|
+
tag: 'span',
|
|
18106
|
+
style: 'max-width:100%;position:fixed',
|
|
18107
|
+
children: [
|
|
18108
|
+
{
|
|
18109
|
+
tag: 'div',
|
|
18110
|
+
style: 'width:100%;height:100%;position:relative;overflow:hidden',
|
|
18111
|
+
},
|
|
18112
|
+
],
|
|
17941
18113
|
},
|
|
17942
18114
|
_a[7 /* TableHorizontalResizer */] = {
|
|
17943
18115
|
tag: 'div',
|
|
@@ -19514,31 +19686,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19514
19686
|
__exportStar(__webpack_require__(/*! ./plugins/ImageResize/index */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageResize/index.ts"), exports);
|
|
19515
19687
|
|
|
19516
19688
|
|
|
19517
|
-
/***/ }),
|
|
19518
|
-
|
|
19519
|
-
/***/ "./packages/roosterjs-editor-plugins/lib/ImageSelection.ts":
|
|
19520
|
-
/*!*****************************************************************!*\
|
|
19521
|
-
!*** ./packages/roosterjs-editor-plugins/lib/ImageSelection.ts ***!
|
|
19522
|
-
\*****************************************************************/
|
|
19523
|
-
/*! no static exports found */
|
|
19524
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
19525
|
-
|
|
19526
|
-
"use strict";
|
|
19527
|
-
|
|
19528
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19529
|
-
if (k2 === undefined) k2 = k;
|
|
19530
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
19531
|
-
}) : (function(o, m, k, k2) {
|
|
19532
|
-
if (k2 === undefined) k2 = k;
|
|
19533
|
-
o[k2] = m[k];
|
|
19534
|
-
}));
|
|
19535
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19536
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19537
|
-
};
|
|
19538
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19539
|
-
__exportStar(__webpack_require__(/*! ./plugins/ImageSelection/index */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/index.ts"), exports);
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
19689
|
/***/ }),
|
|
19543
19690
|
|
|
19544
19691
|
/***/ "./packages/roosterjs-editor-plugins/lib/Paste.ts":
|
|
@@ -19699,7 +19846,6 @@ __exportStar(__webpack_require__(/*! ./TableResize */ "./packages/roosterjs-edit
|
|
|
19699
19846
|
__exportStar(__webpack_require__(/*! ./Watermark */ "./packages/roosterjs-editor-plugins/lib/Watermark.ts"), exports);
|
|
19700
19847
|
__exportStar(__webpack_require__(/*! ./TableCellSelection */ "./packages/roosterjs-editor-plugins/lib/TableCellSelection.ts"), exports);
|
|
19701
19848
|
__exportStar(__webpack_require__(/*! ./AutoFormat */ "./packages/roosterjs-editor-plugins/lib/AutoFormat.ts"), exports);
|
|
19702
|
-
__exportStar(__webpack_require__(/*! ./ImageSelection */ "./packages/roosterjs-editor-plugins/lib/ImageSelection.ts"), exports);
|
|
19703
19849
|
|
|
19704
19850
|
|
|
19705
19851
|
/***/ }),
|
|
@@ -20360,6 +20506,8 @@ var getAutoBulletListStyle_1 = __webpack_require__(/*! ../utils/getAutoBulletLis
|
|
|
20360
20506
|
var getAutoNumberingListStyle_1 = __webpack_require__(/*! ../utils/getAutoNumberingListStyle */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/utils/getAutoNumberingListStyle.ts");
|
|
20361
20507
|
var roosterjs_editor_api_1 = __webpack_require__(/*! roosterjs-editor-api */ "./packages/roosterjs-editor-api/lib/index.ts");
|
|
20362
20508
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
20509
|
+
var PREVIOUS_BLOCK_CACHE_KEY = 'previousBlock';
|
|
20510
|
+
var NEXT_BLOCK_CACHE_KEY = 'nextBlock';
|
|
20363
20511
|
var ListStyleDefinitionMetadata = (0, roosterjs_editor_dom_1.createObjectDefinition)({
|
|
20364
20512
|
orderedStyleType: (0, roosterjs_editor_dom_1.createNumberDefinition)(true /** isOptional */, undefined /** value **/, 1 /* Min */, 20 /* Max */),
|
|
20365
20513
|
unorderedStyleType: (0, roosterjs_editor_dom_1.createNumberDefinition)(true /** isOptional */, undefined /** value **/, 1 /* Min */, 9 /* Max */),
|
|
@@ -20694,6 +20842,57 @@ function shouldTriggerList(event, editor, getListStyle, listType) {
|
|
|
20694
20842
|
listStyle &&
|
|
20695
20843
|
shouldTriggerNewListStyle);
|
|
20696
20844
|
}
|
|
20845
|
+
/**
|
|
20846
|
+
* MergeListOnBackspaceAfterList edit feature, provides the ability to merge list on backspace on block after a list.
|
|
20847
|
+
*/
|
|
20848
|
+
var MergeListOnBackspaceAfterList = {
|
|
20849
|
+
keys: [8 /* BACKSPACE */],
|
|
20850
|
+
shouldHandleEvent: function (event, editor) {
|
|
20851
|
+
var _a, _b;
|
|
20852
|
+
var target = editor.getElementAtCursor();
|
|
20853
|
+
if (target) {
|
|
20854
|
+
var cursorBlock = (_a = editor.getBlockElementAtNode(target)) === null || _a === void 0 ? void 0 : _a.getStartNode();
|
|
20855
|
+
var previousBlock_1 = (_b = cursorBlock === null || cursorBlock === void 0 ? void 0 : cursorBlock.previousElementSibling) !== null && _b !== void 0 ? _b : null;
|
|
20856
|
+
if (isList(previousBlock_1)) {
|
|
20857
|
+
var range = editor.getSelectionRange();
|
|
20858
|
+
var searcher = editor.getContentSearcherOfCursor(event);
|
|
20859
|
+
var textBeforeCursor = searcher === null || searcher === void 0 ? void 0 : searcher.getSubStringBefore(4);
|
|
20860
|
+
var nearestInline = searcher === null || searcher === void 0 ? void 0 : searcher.getNearestNonTextInlineElement();
|
|
20861
|
+
if (range && range.collapsed && textBeforeCursor === '' && !nearestInline) {
|
|
20862
|
+
var tempBlock = cursorBlock === null || cursorBlock === void 0 ? void 0 : cursorBlock.nextElementSibling;
|
|
20863
|
+
var nextBlock_1 = isList(tempBlock) ? tempBlock : tempBlock === null || tempBlock === void 0 ? void 0 : tempBlock.firstChild;
|
|
20864
|
+
if (isList(nextBlock_1) &&
|
|
20865
|
+
(0, roosterjs_editor_dom_1.getTagOfNode)(previousBlock_1) == (0, roosterjs_editor_dom_1.getTagOfNode)(nextBlock_1)) {
|
|
20866
|
+
var element = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, PREVIOUS_BLOCK_CACHE_KEY, function () { return previousBlock_1; });
|
|
20867
|
+
var nextElement = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, NEXT_BLOCK_CACHE_KEY, function () { return nextBlock_1; });
|
|
20868
|
+
return !!element && !!nextElement;
|
|
20869
|
+
}
|
|
20870
|
+
}
|
|
20871
|
+
}
|
|
20872
|
+
}
|
|
20873
|
+
return false;
|
|
20874
|
+
},
|
|
20875
|
+
handleEvent: function (event, editor) {
|
|
20876
|
+
editor.runAsync(function (editor) {
|
|
20877
|
+
var previousList = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, PREVIOUS_BLOCK_CACHE_KEY, function () { return null; });
|
|
20878
|
+
var targetBlock = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, NEXT_BLOCK_CACHE_KEY, function () { return null; });
|
|
20879
|
+
var rangeBeforeWriteBack = editor.getSelectionRange();
|
|
20880
|
+
if (previousList && targetBlock && rangeBeforeWriteBack) {
|
|
20881
|
+
var fvList = new roosterjs_editor_dom_1.VList(previousList);
|
|
20882
|
+
fvList.mergeVList(new roosterjs_editor_dom_1.VList(targetBlock));
|
|
20883
|
+
var span = editor.getDocument().createElement('span');
|
|
20884
|
+
span.id = 'restoreRange';
|
|
20885
|
+
rangeBeforeWriteBack.insertNode(span);
|
|
20886
|
+
fvList.writeBack();
|
|
20887
|
+
span = editor.queryElements('#restoreRange')[0];
|
|
20888
|
+
if (span.parentElement) {
|
|
20889
|
+
editor.select(new roosterjs_editor_dom_1.Position(span, -3 /* After */));
|
|
20890
|
+
span.parentElement.removeChild(span);
|
|
20891
|
+
}
|
|
20892
|
+
}
|
|
20893
|
+
});
|
|
20894
|
+
},
|
|
20895
|
+
};
|
|
20697
20896
|
/**
|
|
20698
20897
|
* @internal
|
|
20699
20898
|
*/
|
|
@@ -20708,7 +20907,12 @@ exports.ListFeatures = {
|
|
|
20708
20907
|
maintainListChainWhenDelete: MaintainListChainWhenDelete,
|
|
20709
20908
|
autoNumberingList: AutoNumberingList,
|
|
20710
20909
|
autoBulletList: AutoBulletList,
|
|
20910
|
+
mergeListOnBackspaceAfterList: MergeListOnBackspaceAfterList,
|
|
20711
20911
|
};
|
|
20912
|
+
function isList(element) {
|
|
20913
|
+
return (!!element &&
|
|
20914
|
+
((0, roosterjs_editor_dom_1.safeInstanceOf)(element, 'HTMLOListElement') || (0, roosterjs_editor_dom_1.safeInstanceOf)(element, 'HTMLUListElement')));
|
|
20915
|
+
}
|
|
20712
20916
|
|
|
20713
20917
|
|
|
20714
20918
|
/***/ }),
|
|
@@ -22313,12 +22517,8 @@ var getGeneratedImageSize_1 = __webpack_require__(/*! ./editInfoUtils/getGenerat
|
|
|
22313
22517
|
var Cropper_1 = __webpack_require__(/*! ./imageEditors/Cropper */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/imageEditors/Cropper.ts");
|
|
22314
22518
|
var editInfo_1 = __webpack_require__(/*! ./editInfoUtils/editInfo */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/editInfoUtils/editInfo.ts");
|
|
22315
22519
|
var Rotator_1 = __webpack_require__(/*! ./imageEditors/Rotator */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/imageEditors/Rotator.ts");
|
|
22316
|
-
var roosterjs_editor_api_1 = __webpack_require__(/*! roosterjs-editor-api */ "./packages/roosterjs-editor-api/lib/index.ts");
|
|
22317
22520
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
22318
22521
|
var Resizer_1 = __webpack_require__(/*! ./imageEditors/Resizer */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageEdit/imageEditors/Resizer.ts");
|
|
22319
|
-
var SHIFT_KEYCODE = 16;
|
|
22320
|
-
var CTRL_KEYCODE = 17;
|
|
22321
|
-
var ALT_KEYCODE = 18;
|
|
22322
22522
|
var DIRECTIONS = 8;
|
|
22323
22523
|
var DirectionRad = (Math.PI * 2) / DIRECTIONS;
|
|
22324
22524
|
var DirectionOrder = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
|
|
@@ -22347,10 +22547,6 @@ var ImageEditHTMLMap = (_a = {},
|
|
|
22347
22547
|
_a[4 /* Rotate */] = Rotator_1.getRotateHTML,
|
|
22348
22548
|
_a[8 /* Crop */] = Cropper_1.getCropHTML,
|
|
22349
22549
|
_a);
|
|
22350
|
-
/**
|
|
22351
|
-
* Image edit entity name
|
|
22352
|
-
*/
|
|
22353
|
-
var IMAGE_EDIT_WRAPPER_ENTITY_TYPE = 'IMAGE_EDIT_WRAPPER';
|
|
22354
22550
|
/**
|
|
22355
22551
|
* Default background colors for rotate handle
|
|
22356
22552
|
*/
|
|
@@ -22378,35 +22574,31 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22378
22574
|
* quit editing mode when editor lose focus
|
|
22379
22575
|
*/
|
|
22380
22576
|
this.onBlur = function () {
|
|
22381
|
-
_this.setEditingImage(null);
|
|
22577
|
+
_this.setEditingImage(null, true);
|
|
22382
22578
|
};
|
|
22383
22579
|
/**
|
|
22384
22580
|
* Remove the temp wrapper of the image
|
|
22385
|
-
* @param wrapper The wrapper object to remove. If not specified, remove all existing wrappers.
|
|
22386
22581
|
*/
|
|
22387
|
-
this.removeWrapper = function (
|
|
22388
|
-
var
|
|
22389
|
-
var
|
|
22390
|
-
if (
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
img.style.textAlign = null;
|
|
22394
|
-
parent.insertBefore(img, wrapper);
|
|
22395
|
-
parent.removeChild(wrapper);
|
|
22582
|
+
this.removeWrapper = function () {
|
|
22583
|
+
var _a, _b;
|
|
22584
|
+
var doc = _this.editor.getDocument();
|
|
22585
|
+
if (_this.zoomWrapper && ((_a = doc.body) === null || _a === void 0 ? void 0 : _a.contains(_this.zoomWrapper))) {
|
|
22586
|
+
(_b = doc.body) === null || _b === void 0 ? void 0 : _b.removeChild(_this.zoomWrapper);
|
|
22587
|
+
_this.toggleImageVisibility(_this.image, true /** showImage */);
|
|
22396
22588
|
}
|
|
22589
|
+
_this.wrapper = null;
|
|
22590
|
+
_this.zoomWrapper = null;
|
|
22397
22591
|
};
|
|
22398
22592
|
/**
|
|
22399
22593
|
* Update image edit elements to reflect current editing result
|
|
22400
22594
|
* @param context
|
|
22401
22595
|
*/
|
|
22402
22596
|
this.updateWrapper = function (context) {
|
|
22403
|
-
var wrapper = _this.
|
|
22597
|
+
var wrapper = _this.wrapper;
|
|
22404
22598
|
if (wrapper) {
|
|
22405
22599
|
// Prepare: get related editing elements
|
|
22406
22600
|
var cropContainers = getEditElements(wrapper, "r_cropC" /* CropContainer */);
|
|
22407
22601
|
var cropOverlays = getEditElements(wrapper, "r_cropO" /* CropOverlay */);
|
|
22408
|
-
var rotateCenter = getEditElements(wrapper, "r_rotateC" /* RotateCenter */)[0];
|
|
22409
|
-
var rotateHandle = getEditElements(wrapper, "r_rotateH" /* RotateHandle */)[0];
|
|
22410
22602
|
var resizeHandles = getEditElements(wrapper, "r_resizeH" /* ResizeHandle */);
|
|
22411
22603
|
var cropHandles = getEditElements(wrapper, "r_cropH" /* CropHandle */);
|
|
22412
22604
|
// Cropping and resizing will show different UI, so check if it is cropping here first
|
|
@@ -22425,12 +22617,14 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22425
22617
|
wrapper.style.height = getPx(visibleHeight);
|
|
22426
22618
|
wrapper.style.margin = marginVertical + "px " + marginHorizontal + "px";
|
|
22427
22619
|
wrapper.style.transform = "rotate(" + angleRad + "rad)";
|
|
22620
|
+
_this.zoomWrapper.style.width = getPx(visibleWidth);
|
|
22621
|
+
_this.zoomWrapper.style.height = getPx(visibleHeight);
|
|
22428
22622
|
// Update the text-alignment to avoid the image to overflow if the parent element have align center or right
|
|
22429
22623
|
// or if the direction is Right To Left
|
|
22430
22624
|
wrapper.style.textAlign = isRtl(wrapper.parentNode) ? 'right' : 'left';
|
|
22431
22625
|
// Update size of the image
|
|
22432
|
-
_this.
|
|
22433
|
-
_this.
|
|
22626
|
+
_this.clonedImage.style.width = getPx(originalWidth);
|
|
22627
|
+
_this.clonedImage.style.height = getPx(originalHeight);
|
|
22434
22628
|
if (isCropping) {
|
|
22435
22629
|
// For crop, we also need to set position of the overlays
|
|
22436
22630
|
setSize(cropContainers[0], cropLeftPx, cropTopPx, cropRightPx, cropBottomPx, undefined, undefined);
|
|
@@ -22442,7 +22636,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22442
22636
|
}
|
|
22443
22637
|
else {
|
|
22444
22638
|
// For rotate/resize, set the margin of the image so that cropped part won't be visible
|
|
22445
|
-
_this.
|
|
22639
|
+
_this.clonedImage.style.margin = -cropTopPx + "px 0 0 " + -cropLeftPx + "px";
|
|
22446
22640
|
// Double check resize
|
|
22447
22641
|
if ((context === null || context === void 0 ? void 0 : context.elementClass) == "r_resizeH" /* ResizeHandle */) {
|
|
22448
22642
|
var clientWidth = wrapper.clientWidth;
|
|
@@ -22451,7 +22645,6 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22451
22645
|
(0, Resizer_1.doubleCheckResize)(_this.editInfo, _this.options.preserveRatio, clientWidth, clientHeight);
|
|
22452
22646
|
_this.updateWrapper();
|
|
22453
22647
|
}
|
|
22454
|
-
(0, Rotator_1.updateRotateHandlePosition)(_this.editInfo, _this.editor.getRelativeDistanceToEditor(wrapper, true /*addScroll*/), marginVertical, rotateCenter, rotateHandle);
|
|
22455
22648
|
updateHandleCursor(resizeHandles, angleRad);
|
|
22456
22649
|
}
|
|
22457
22650
|
}
|
|
@@ -22488,56 +22681,26 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22488
22681
|
};
|
|
22489
22682
|
/**
|
|
22490
22683
|
* Handle events triggered from editor
|
|
22491
|
-
* @param
|
|
22684
|
+
* @param e PluginEvent object
|
|
22492
22685
|
*/
|
|
22493
22686
|
ImageEdit.prototype.onPluginEvent = function (e) {
|
|
22494
22687
|
switch (e.eventType) {
|
|
22688
|
+
case 22 /* SelectionChanged */:
|
|
22689
|
+
if (e.selectionRangeEx &&
|
|
22690
|
+
e.selectionRangeEx.type === 2 /* ImageSelection */) {
|
|
22691
|
+
this.setEditingImage(e.selectionRangeEx.image, 7 /* ResizeAndRotate */);
|
|
22692
|
+
}
|
|
22693
|
+
break;
|
|
22495
22694
|
case 5 /* MouseDown */:
|
|
22496
22695
|
this.setEditingImage(null);
|
|
22497
22696
|
break;
|
|
22498
|
-
case 6 /* MouseUp */:
|
|
22499
|
-
var target = e.rawEvent.target;
|
|
22500
|
-
if (e.isClicking &&
|
|
22501
|
-
e.rawEvent.button == 0 &&
|
|
22502
|
-
(0, roosterjs_editor_dom_1.safeInstanceOf)(target, 'HTMLImageElement') &&
|
|
22503
|
-
target.isContentEditable &&
|
|
22504
|
-
(0, roosterjs_editor_dom_1.matchesSelector)(target, this.options.imageSelector)) {
|
|
22505
|
-
this.setEditingImage(target, 7 /* ResizeAndRotate */);
|
|
22506
|
-
}
|
|
22507
|
-
break;
|
|
22508
22697
|
case 0 /* KeyDown */:
|
|
22509
|
-
|
|
22510
|
-
if (key == 46 /* DELETE */ || key == 8 /* BACKSPACE */) {
|
|
22511
|
-
// Set current editing image to null and select the image if any, and do not prevent default of the event
|
|
22512
|
-
// so that browser will delete the selected image for us
|
|
22513
|
-
this.setEditingImage(null, true /*selectImage*/);
|
|
22514
|
-
}
|
|
22515
|
-
else if (key == 27 /* ESCAPE */ && this.image) {
|
|
22516
|
-
// Press ESC should cancel current editing operation, resume back to original edit info
|
|
22517
|
-
this.editInfo = (0, editInfo_1.getEditInfoFromImage)(this.image);
|
|
22518
|
-
this.setEditingImage(null);
|
|
22519
|
-
e.rawEvent.preventDefault();
|
|
22520
|
-
}
|
|
22521
|
-
else if (key != SHIFT_KEYCODE && key != CTRL_KEYCODE && key != ALT_KEYCODE) {
|
|
22522
|
-
// For other key, just unselect current image and select it. If this is an input key, the image will be replaced
|
|
22523
|
-
this.setEditingImage(null, true /*selectImage*/);
|
|
22524
|
-
}
|
|
22698
|
+
this.setEditingImage(null);
|
|
22525
22699
|
break;
|
|
22526
22700
|
case 7 /* ContentChanged */:
|
|
22527
|
-
if (e.source
|
|
22528
|
-
e.data.type != IMAGE_EDIT_WRAPPER_ENTITY_TYPE) {
|
|
22701
|
+
if (e.source !== "Format" /* Format */) {
|
|
22529
22702
|
// After contentChanged event, the current image wrapper may not be valid any more, remove all of them if any
|
|
22530
|
-
this.
|
|
22531
|
-
}
|
|
22532
|
-
break;
|
|
22533
|
-
case 15 /* EntityOperation */:
|
|
22534
|
-
if (e.entity.type == IMAGE_EDIT_WRAPPER_ENTITY_TYPE) {
|
|
22535
|
-
if (e.operation == 8 /* ReplaceTemporaryContent */) {
|
|
22536
|
-
this.removeWrapper(e.entity.wrapper);
|
|
22537
|
-
}
|
|
22538
|
-
else if (e.operation == 1 /* Click */) {
|
|
22539
|
-
e.rawEvent.preventDefault();
|
|
22540
|
-
}
|
|
22703
|
+
this.removeWrapper();
|
|
22541
22704
|
}
|
|
22542
22705
|
break;
|
|
22543
22706
|
case 8 /* ExtractContentWithDom */:
|
|
@@ -22546,10 +22709,13 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22546
22709
|
(0, editInfo_1.deleteEditInfo)(img);
|
|
22547
22710
|
});
|
|
22548
22711
|
break;
|
|
22712
|
+
case 14 /* Scroll */:
|
|
22713
|
+
this.setEditingImage(null);
|
|
22714
|
+
break;
|
|
22549
22715
|
}
|
|
22550
22716
|
};
|
|
22551
22717
|
/**
|
|
22552
|
-
* Check if the given image edit operation is allowed by this
|
|
22718
|
+
* Check if the given image edit operation is allowed by this plugin
|
|
22553
22719
|
* @param operation The image edit operation to check
|
|
22554
22720
|
* @returns True means it is allowed, otherwise false
|
|
22555
22721
|
*/
|
|
@@ -22560,16 +22726,13 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22560
22726
|
var _this = this;
|
|
22561
22727
|
var operation = typeof operationOrSelect === 'number' ? operationOrSelect : 0 /* None */;
|
|
22562
22728
|
var selectImage = typeof operationOrSelect === 'number' ? false : !!operationOrSelect;
|
|
22563
|
-
if (this.image) {
|
|
22729
|
+
if (!image && this.image) {
|
|
22564
22730
|
// When there is image in editing, clean up any cached objects and elements
|
|
22565
22731
|
this.clearDndHelpers();
|
|
22566
22732
|
// Apply the changes, and add undo snapshot if necessary
|
|
22567
|
-
(0, applyChange_1.default)(this.editor, this.image, this.editInfo, this.lastSrc, this.wasResized);
|
|
22733
|
+
(0, applyChange_1.default)(this.editor, this.image, this.editInfo, this.lastSrc, this.wasResized, this.clonedImage);
|
|
22568
22734
|
// Remove editing wrapper
|
|
22569
|
-
|
|
22570
|
-
if (wrapper) {
|
|
22571
|
-
this.removeWrapper(wrapper);
|
|
22572
|
-
}
|
|
22735
|
+
this.removeWrapper();
|
|
22573
22736
|
this.editor.addUndoSnapshot(function () { return _this.image; }, "ImageResize" /* ImageResize */);
|
|
22574
22737
|
if (selectImage) {
|
|
22575
22738
|
this.editor.select(this.image);
|
|
@@ -22577,6 +22740,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22577
22740
|
this.image = null;
|
|
22578
22741
|
this.editInfo = null;
|
|
22579
22742
|
this.lastSrc = null;
|
|
22743
|
+
this.clonedImage = null;
|
|
22580
22744
|
}
|
|
22581
22745
|
if (!this.image && (image === null || image === void 0 ? void 0 : image.isContentEditable)) {
|
|
22582
22746
|
// If there is new image to edit, enter editing mode for this image
|
|
@@ -22590,12 +22754,12 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22590
22754
|
((0, canRegenerateImage_1.default)(image) ? operation : 3 /* Resize */) &
|
|
22591
22755
|
this.allowedOperations;
|
|
22592
22756
|
// Create and update editing wrapper and elements
|
|
22593
|
-
|
|
22757
|
+
this.createWrapper(operation);
|
|
22594
22758
|
this.updateWrapper();
|
|
22595
22759
|
// Init drag and drop
|
|
22596
22760
|
this.dndHelpers = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], this.createDndHelpers("r_resizeH" /* ResizeHandle */, Resizer_1.Resizer), true), this.createDndHelpers("r_rotateH" /* RotateHandle */, Rotator_1.Rotator), true), this.createDndHelpers("r_cropH" /* CropHandle */, Cropper_1.Cropper), true), this.createDndHelpers("r_cropC" /* CropContainer */, Cropper_1.Cropper), true);
|
|
22597
|
-
|
|
22598
|
-
this.
|
|
22761
|
+
this.editor.select(this.image);
|
|
22762
|
+
this.toggleImageVisibility(this.image, false /** showImage */);
|
|
22599
22763
|
}
|
|
22600
22764
|
};
|
|
22601
22765
|
/**
|
|
@@ -22603,25 +22767,22 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22603
22767
|
*/
|
|
22604
22768
|
ImageEdit.prototype.createWrapper = function (operation) {
|
|
22605
22769
|
var _this = this;
|
|
22606
|
-
//
|
|
22607
|
-
|
|
22608
|
-
wrapper
|
|
22609
|
-
wrapper.
|
|
22770
|
+
//Clone the image and insert the clone in a entity
|
|
22771
|
+
this.clonedImage = this.image.cloneNode(true);
|
|
22772
|
+
this.wrapper = (0, roosterjs_editor_dom_1.createElement)(6 /* ImageEditWrapper */, this.image.ownerDocument);
|
|
22773
|
+
this.wrapper.firstChild.appendChild(this.clonedImage);
|
|
22610
22774
|
// keep the same vertical align
|
|
22611
|
-
var originalVerticalAlign = this.image
|
|
22612
|
-
.getComputedStyle(this.image)
|
|
22613
|
-
.getPropertyValue('vertical-align');
|
|
22775
|
+
var originalVerticalAlign = this.getStylePropertyValue(this.image, 'vertical-align');
|
|
22614
22776
|
if (originalVerticalAlign) {
|
|
22615
|
-
wrapper.style.verticalAlign = originalVerticalAlign;
|
|
22777
|
+
this.wrapper.style.verticalAlign = originalVerticalAlign;
|
|
22616
22778
|
}
|
|
22617
|
-
wrapper.style.display = roosterjs_editor_dom_1.Browser.isSafari ? 'inline-block' : 'inline-flex';
|
|
22779
|
+
this.wrapper.style.display = roosterjs_editor_dom_1.Browser.isSafari ? 'inline-block' : 'inline-flex';
|
|
22618
22780
|
// Cache current src so that we can compare it after edit see if src is changed
|
|
22619
22781
|
this.lastSrc = this.image.getAttribute('src');
|
|
22620
22782
|
// Set image src to original src to help show editing UI, also it will be used when regenerate image dataURL after editing
|
|
22621
|
-
this.
|
|
22622
|
-
this.
|
|
22623
|
-
this.
|
|
22624
|
-
var isExperimentalHandlesEnabled = this.editor.isFeatureEnabled("AdaptiveHandlesResizer" /* AdaptiveHandlesResizer */);
|
|
22783
|
+
this.clonedImage.src = this.editInfo.src;
|
|
22784
|
+
this.clonedImage.style.position = 'absolute';
|
|
22785
|
+
this.clonedImage.style.maxWidth = null;
|
|
22625
22786
|
// Get HTML for all edit elements (resize handle, rotate handle, crop handle and overlay, ...) and create HTML element
|
|
22626
22787
|
var options = {
|
|
22627
22788
|
borderColor: getColorString(this.options.borderColor, this.editor.isDarkMode()),
|
|
@@ -22629,8 +22790,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22629
22790
|
rotateHandleBackColor: this.editor.isDarkMode()
|
|
22630
22791
|
? DARK_MODE_BGCOLOR
|
|
22631
22792
|
: LIGHT_MODE_BGCOLOR,
|
|
22632
|
-
isSmallImage: isASmallImage(this.editInfo
|
|
22633
|
-
handlesExperimentalFeatures: isExperimentalHandlesEnabled,
|
|
22793
|
+
isSmallImage: isASmallImage(this.editInfo),
|
|
22634
22794
|
};
|
|
22635
22795
|
var htmlData = [(0, Resizer_1.getResizeBordersHTML)(options)];
|
|
22636
22796
|
(0, roosterjs_editor_dom_1.getObjectKeys)(ImageEditHTMLMap).forEach(function (thisOperation) {
|
|
@@ -22641,20 +22801,47 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22641
22801
|
htmlData.forEach(function (data) {
|
|
22642
22802
|
var element = (0, roosterjs_editor_dom_1.createElement)(data, _this.image.ownerDocument);
|
|
22643
22803
|
if (element) {
|
|
22644
|
-
wrapper.appendChild(element);
|
|
22804
|
+
_this.wrapper.appendChild(element);
|
|
22645
22805
|
}
|
|
22646
22806
|
});
|
|
22647
|
-
|
|
22807
|
+
this.insertImageWrapper(this.image, this.wrapper, this.editor.getZoomScale());
|
|
22648
22808
|
};
|
|
22649
|
-
|
|
22650
|
-
|
|
22651
|
-
|
|
22652
|
-
|
|
22653
|
-
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22809
|
+
ImageEdit.prototype.toggleImageVisibility = function (image, showImage) {
|
|
22810
|
+
var editorId = this.editor.getEditorDomAttribute('id');
|
|
22811
|
+
var doc = this.editor.getDocument();
|
|
22812
|
+
var editingId = 'editingId' + editorId;
|
|
22813
|
+
if (showImage) {
|
|
22814
|
+
(0, roosterjs_editor_dom_1.removeGlobalCssStyle)(doc, editingId);
|
|
22815
|
+
}
|
|
22816
|
+
else {
|
|
22817
|
+
var cssRule = "#" + editorId + " #" + image.id + " {visibility: hidden}";
|
|
22818
|
+
(0, roosterjs_editor_dom_1.setGlobalCssStyles)(doc, cssRule, editingId);
|
|
22819
|
+
}
|
|
22820
|
+
};
|
|
22821
|
+
ImageEdit.prototype.createZoomWrapper = function (wrapper, scale) {
|
|
22822
|
+
var zoomWrapper = this.editor.getDocument().createElement('div');
|
|
22823
|
+
zoomWrapper.style.transform = "scale(" + (scale || 1) + ")";
|
|
22824
|
+
zoomWrapper.style.transformOrigin = 'top left';
|
|
22825
|
+
zoomWrapper.style.position = 'fixed';
|
|
22826
|
+
zoomWrapper.appendChild(wrapper);
|
|
22827
|
+
return zoomWrapper;
|
|
22828
|
+
};
|
|
22829
|
+
ImageEdit.prototype.copyImageSize = function (image, element) {
|
|
22830
|
+
var _a = image.getBoundingClientRect(), top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom;
|
|
22831
|
+
element.style.top = top + "px";
|
|
22832
|
+
element.style.bottom = bottom + "px";
|
|
22833
|
+
element.style.right = right + "px";
|
|
22834
|
+
element.style.left = left + "px";
|
|
22835
|
+
return element;
|
|
22836
|
+
};
|
|
22837
|
+
ImageEdit.prototype.insertImageWrapper = function (image, wrapper, scale) {
|
|
22838
|
+
this.zoomWrapper = this.copyImageSize(image, this.createZoomWrapper(wrapper, scale));
|
|
22839
|
+
this.editor.getDocument().body.appendChild(this.zoomWrapper);
|
|
22840
|
+
};
|
|
22841
|
+
ImageEdit.prototype.getStylePropertyValue = function (element, property) {
|
|
22842
|
+
return element.ownerDocument.defaultView
|
|
22843
|
+
.getComputedStyle(this.image)
|
|
22844
|
+
.getPropertyValue(property);
|
|
22658
22845
|
};
|
|
22659
22846
|
/**
|
|
22660
22847
|
* Create drag and drop helpers
|
|
@@ -22669,7 +22856,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
22669
22856
|
options: this.options,
|
|
22670
22857
|
elementClass: elementClass,
|
|
22671
22858
|
};
|
|
22672
|
-
var wrapper = this.
|
|
22859
|
+
var wrapper = this.wrapper;
|
|
22673
22860
|
return wrapper
|
|
22674
22861
|
? getEditElements(wrapper, elementClass).map(function (element) {
|
|
22675
22862
|
return new DragAndDropHelper_1.default(element, __assign(__assign({}, commonContext), { x: element.dataset.x, y: element.dataset.y }), _this.updateWrapper, dragAndDrop, _this.editor.getZoomScale());
|
|
@@ -22750,9 +22937,9 @@ function isFixedNumberValue(value) {
|
|
|
22750
22937
|
var numberValue = typeof value === 'string' ? parseInt(value) : value;
|
|
22751
22938
|
return !isNaN(numberValue);
|
|
22752
22939
|
}
|
|
22753
|
-
function isASmallImage(editInfo
|
|
22940
|
+
function isASmallImage(editInfo) {
|
|
22754
22941
|
var widthPx = editInfo.widthPx, heightPx = editInfo.heightPx;
|
|
22755
|
-
return widthPx && heightPx && widthPx * widthPx < MAX_SMALL_SIZE_IMAGE
|
|
22942
|
+
return widthPx && heightPx && widthPx * widthPx < MAX_SMALL_SIZE_IMAGE;
|
|
22756
22943
|
}
|
|
22757
22944
|
function getColorString(color, isDarkMode) {
|
|
22758
22945
|
if (typeof color === 'string') {
|
|
@@ -22939,10 +23126,11 @@ var editInfo_1 = __webpack_require__(/*! ./editInfo */ "./packages/roosterjs-edi
|
|
|
22939
23126
|
* @param image The image to apply the change
|
|
22940
23127
|
* @param editInfo Edit info that contains the changed information of the image
|
|
22941
23128
|
* @param previousSrc Last src value of the image before the change was made
|
|
23129
|
+
* @param editingImage (optional) Image in editing state
|
|
22942
23130
|
*/
|
|
22943
|
-
function applyChange(editor, image, editInfo, previousSrc, wasResized) {
|
|
23131
|
+
function applyChange(editor, image, editInfo, previousSrc, wasResized, editingImage) {
|
|
22944
23132
|
var newSrc = '';
|
|
22945
|
-
var initEditInfo = (0, editInfo_1.getEditInfoFromImage)(image);
|
|
23133
|
+
var initEditInfo = (0, editInfo_1.getEditInfoFromImage)(editingImage !== null && editingImage !== void 0 ? editingImage : image);
|
|
22946
23134
|
var state = (0, checkEditInfoState_1.default)(editInfo, initEditInfo);
|
|
22947
23135
|
switch (state) {
|
|
22948
23136
|
case 1 /* ResizeOnly */:
|
|
@@ -22956,7 +23144,7 @@ function applyChange(editor, image, editInfo, previousSrc, wasResized) {
|
|
|
22956
23144
|
break;
|
|
22957
23145
|
case 3 /* FullyChanged */:
|
|
22958
23146
|
// For other cases (cropped, rotated, ...) we need to create a new image to reflect the change
|
|
22959
|
-
newSrc = (0, generateDataURL_1.default)(image, editInfo);
|
|
23147
|
+
newSrc = (0, generateDataURL_1.default)(editingImage !== null && editingImage !== void 0 ? editingImage : image, editInfo);
|
|
22960
23148
|
break;
|
|
22961
23149
|
}
|
|
22962
23150
|
var srcChanged = newSrc != previousSrc;
|
|
@@ -23508,14 +23696,12 @@ exports.doubleCheckResize = doubleCheckResize;
|
|
|
23508
23696
|
* Get HTML for resize handles at the corners
|
|
23509
23697
|
*/
|
|
23510
23698
|
function getCornerResizeHTML(_a, onShowResizeHandle) {
|
|
23511
|
-
var resizeBorderColor = _a.borderColor
|
|
23699
|
+
var resizeBorderColor = _a.borderColor;
|
|
23512
23700
|
var result = [];
|
|
23513
23701
|
Xs.forEach(function (x) {
|
|
23514
23702
|
return Ys.forEach(function (y) {
|
|
23515
23703
|
var elementData = (x == '') == (y == '')
|
|
23516
|
-
? getResizeHandleHTML(x, y, resizeBorderColor,
|
|
23517
|
-
? 1 /* CircularHandlesCorner */
|
|
23518
|
-
: 0 /* SquareHandles */)
|
|
23704
|
+
? getResizeHandleHTML(x, y, resizeBorderColor, 1 /* CircularHandlesCorner */)
|
|
23519
23705
|
: null;
|
|
23520
23706
|
if (onShowResizeHandle) {
|
|
23521
23707
|
onShowResizeHandle(elementData, x, y);
|
|
@@ -23531,7 +23717,7 @@ exports.getCornerResizeHTML = getCornerResizeHTML;
|
|
|
23531
23717
|
* Get HTML for resize handles on the sides
|
|
23532
23718
|
*/
|
|
23533
23719
|
function getSideResizeHTML(_a, onShowResizeHandle) {
|
|
23534
|
-
var resizeBorderColor = _a.borderColor, isSmallImage = _a.isSmallImage
|
|
23720
|
+
var resizeBorderColor = _a.borderColor, isSmallImage = _a.isSmallImage;
|
|
23535
23721
|
if (isSmallImage) {
|
|
23536
23722
|
return null;
|
|
23537
23723
|
}
|
|
@@ -23539,9 +23725,7 @@ function getSideResizeHTML(_a, onShowResizeHandle) {
|
|
|
23539
23725
|
Xs.forEach(function (x) {
|
|
23540
23726
|
return Ys.forEach(function (y) {
|
|
23541
23727
|
var elementData = (x == '') != (y == '')
|
|
23542
|
-
? getResizeHandleHTML(x, y, resizeBorderColor,
|
|
23543
|
-
? 1 /* CircularHandlesCorner */
|
|
23544
|
-
: 0 /* SquareHandles */)
|
|
23728
|
+
? getResizeHandleHTML(x, y, resizeBorderColor, 1 /* CircularHandlesCorner */)
|
|
23545
23729
|
: null;
|
|
23546
23730
|
if (onShowResizeHandle) {
|
|
23547
23731
|
onShowResizeHandle(elementData, x, y);
|
|
@@ -23618,7 +23802,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23618
23802
|
return __assign.apply(this, arguments);
|
|
23619
23803
|
};
|
|
23620
23804
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23621
|
-
exports.getRotateHTML = exports.
|
|
23805
|
+
exports.getRotateHTML = exports.Rotator = void 0;
|
|
23622
23806
|
var ROTATE_SIZE = 32;
|
|
23623
23807
|
var ROTATE_GAP = 15;
|
|
23624
23808
|
var DEG_PER_RAD = 180 / Math.PI;
|
|
@@ -23653,26 +23837,6 @@ exports.Rotator = {
|
|
|
23653
23837
|
}
|
|
23654
23838
|
},
|
|
23655
23839
|
};
|
|
23656
|
-
/**
|
|
23657
|
-
* @internal
|
|
23658
|
-
* Move rotate handle. When image is very close to the border of editor, rotate handle may not be visible.
|
|
23659
|
-
* Fix it by reduce the distance from image to rotate handle
|
|
23660
|
-
*/
|
|
23661
|
-
function updateRotateHandlePosition(editInfo, distance, marginVertical, rotateCenter, rotateHandle) {
|
|
23662
|
-
if (rotateCenter && rotateHandle && distance) {
|
|
23663
|
-
var angleRad = editInfo.angleRad, heightPx = editInfo.heightPx;
|
|
23664
|
-
var cosAngle = Math.cos(angleRad);
|
|
23665
|
-
var adjustedDistance = cosAngle <= 0
|
|
23666
|
-
? Number.MAX_SAFE_INTEGER
|
|
23667
|
-
: (distance[1] + heightPx / 2 + marginVertical) / cosAngle - heightPx / 2;
|
|
23668
|
-
var rotateGap = Math.max(Math.min(ROTATE_GAP, adjustedDistance), 0);
|
|
23669
|
-
var rotateTop = Math.max(Math.min(ROTATE_SIZE, adjustedDistance - rotateGap), 0);
|
|
23670
|
-
rotateCenter.style.top = -rotateGap + 'px';
|
|
23671
|
-
rotateCenter.style.height = rotateGap + 'px';
|
|
23672
|
-
rotateHandle.style.top = -rotateTop + 'px';
|
|
23673
|
-
}
|
|
23674
|
-
}
|
|
23675
|
-
exports.updateRotateHandlePosition = updateRotateHandlePosition;
|
|
23676
23840
|
/**
|
|
23677
23841
|
* @internal
|
|
23678
23842
|
* Get HTML for rotate elements, including the rotate handle with icon, and a line between the handle and the image
|
|
@@ -23684,12 +23848,12 @@ function getRotateHTML(_a) {
|
|
|
23684
23848
|
{
|
|
23685
23849
|
tag: 'div',
|
|
23686
23850
|
className: "r_rotateC" /* RotateCenter */,
|
|
23687
|
-
style: "position:absolute;left:50%;width:1px;background-color:" + borderColor,
|
|
23851
|
+
style: "position:absolute;left:50%;width:1px;background-color:" + borderColor + ";top:" + -ROTATE_GAP + "px;height:" + ROTATE_GAP + "px;",
|
|
23688
23852
|
children: [
|
|
23689
23853
|
{
|
|
23690
23854
|
tag: 'div',
|
|
23691
23855
|
className: "r_rotateH" /* RotateHandle */,
|
|
23692
|
-
style: "position:absolute;background-color:" + rotateHandleBackColor + ";border:solid 1px " + borderColor + ";border-radius:50%;width:" + ROTATE_SIZE + "px;height:" + ROTATE_SIZE + "px;left:-" + handleLeft + "px;cursor:move",
|
|
23856
|
+
style: "position:absolute;background-color:" + rotateHandleBackColor + ";border:solid 1px " + borderColor + ";border-radius:50%;width:" + ROTATE_SIZE + "px;height:" + ROTATE_SIZE + "px;left:-" + handleLeft + "px;cursor:move;top:" + -ROTATE_SIZE + "px;",
|
|
23693
23857
|
children: [getRotateIconHTML(borderColor)],
|
|
23694
23858
|
},
|
|
23695
23859
|
],
|
|
@@ -23843,111 +24007,6 @@ var ImageResize_1 = __webpack_require__(/*! ./ImageResize */ "./packages/rooster
|
|
|
23843
24007
|
Object.defineProperty(exports, "ImageResize", { enumerable: true, get: function () { return ImageResize_1.default; } });
|
|
23844
24008
|
|
|
23845
24009
|
|
|
23846
|
-
/***/ }),
|
|
23847
|
-
|
|
23848
|
-
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/ImageSelection.ts":
|
|
23849
|
-
/*!****************************************************************************************!*\
|
|
23850
|
-
!*** ./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/ImageSelection.ts ***!
|
|
23851
|
-
\****************************************************************************************/
|
|
23852
|
-
/*! no static exports found */
|
|
23853
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
23854
|
-
|
|
23855
|
-
"use strict";
|
|
23856
|
-
|
|
23857
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23858
|
-
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
23859
|
-
var Escape = 'Escape';
|
|
23860
|
-
var mouseRightButton = 2;
|
|
23861
|
-
var mouseLeftButton = 0;
|
|
23862
|
-
/**
|
|
23863
|
-
* Requires @see ExperimentalFeatures.ImageSelection to be enabled.
|
|
23864
|
-
* Detect image selection and help highlight the image
|
|
23865
|
-
*/
|
|
23866
|
-
var ImageSelection = /** @class */ (function () {
|
|
23867
|
-
function ImageSelection() {
|
|
23868
|
-
this.editor = null;
|
|
23869
|
-
}
|
|
23870
|
-
/**
|
|
23871
|
-
* Get a friendly name of this plugin
|
|
23872
|
-
*/
|
|
23873
|
-
ImageSelection.prototype.getName = function () {
|
|
23874
|
-
return 'ImageSelection';
|
|
23875
|
-
};
|
|
23876
|
-
/**
|
|
23877
|
-
* Initialize this plugin. This should only be called from Editor
|
|
23878
|
-
* @param editor Editor instance
|
|
23879
|
-
*/
|
|
23880
|
-
ImageSelection.prototype.initialize = function (editor) {
|
|
23881
|
-
this.editor = editor;
|
|
23882
|
-
};
|
|
23883
|
-
/**
|
|
23884
|
-
* Dispose this plugin
|
|
23885
|
-
*/
|
|
23886
|
-
ImageSelection.prototype.dispose = function () {
|
|
23887
|
-
this.editor.select(null);
|
|
23888
|
-
this.editor = null;
|
|
23889
|
-
};
|
|
23890
|
-
ImageSelection.prototype.onPluginEvent = function (event) {
|
|
23891
|
-
if (this.editor && this.editor.isFeatureEnabled("ImageSelection" /* ImageSelection */)) {
|
|
23892
|
-
switch (event.eventType) {
|
|
23893
|
-
case 17 /* EnteredShadowEdit */:
|
|
23894
|
-
case 18 /* LeavingShadowEdit */:
|
|
23895
|
-
var selection = this.editor.getSelectionRangeEx();
|
|
23896
|
-
if (selection.type == 2 /* ImageSelection */) {
|
|
23897
|
-
this.editor.select(selection.image);
|
|
23898
|
-
}
|
|
23899
|
-
break;
|
|
23900
|
-
case 5 /* MouseDown */:
|
|
23901
|
-
var target = event.rawEvent.target;
|
|
23902
|
-
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(target, 'HTMLImageElement')) {
|
|
23903
|
-
if (event.rawEvent.button === mouseRightButton) {
|
|
23904
|
-
var imageRange = (0, roosterjs_editor_dom_1.createRange)(target);
|
|
23905
|
-
this.editor.select(imageRange);
|
|
23906
|
-
}
|
|
23907
|
-
else if (event.rawEvent.button === mouseLeftButton) {
|
|
23908
|
-
this.editor.select(target);
|
|
23909
|
-
}
|
|
23910
|
-
}
|
|
23911
|
-
break;
|
|
23912
|
-
case 0 /* KeyDown */:
|
|
23913
|
-
var key = event.rawEvent.key;
|
|
23914
|
-
var keyDownSelection = this.editor.getSelectionRangeEx();
|
|
23915
|
-
if (keyDownSelection.type === 2 /* ImageSelection */) {
|
|
23916
|
-
if (key === Escape) {
|
|
23917
|
-
this.editor.select(keyDownSelection.image, -2 /* Before */);
|
|
23918
|
-
this.editor.getSelectionRange().collapse();
|
|
23919
|
-
event.rawEvent.stopPropagation();
|
|
23920
|
-
}
|
|
23921
|
-
else {
|
|
23922
|
-
this.editor.select(keyDownSelection.ranges[0]);
|
|
23923
|
-
}
|
|
23924
|
-
}
|
|
23925
|
-
break;
|
|
23926
|
-
}
|
|
23927
|
-
}
|
|
23928
|
-
};
|
|
23929
|
-
return ImageSelection;
|
|
23930
|
-
}());
|
|
23931
|
-
exports.default = ImageSelection;
|
|
23932
|
-
|
|
23933
|
-
|
|
23934
|
-
/***/ }),
|
|
23935
|
-
|
|
23936
|
-
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/index.ts":
|
|
23937
|
-
/*!*******************************************************************************!*\
|
|
23938
|
-
!*** ./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/index.ts ***!
|
|
23939
|
-
\*******************************************************************************/
|
|
23940
|
-
/*! no static exports found */
|
|
23941
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
23942
|
-
|
|
23943
|
-
"use strict";
|
|
23944
|
-
|
|
23945
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23946
|
-
exports.ImageSelection = void 0;
|
|
23947
|
-
var ImageSelection_1 = __webpack_require__(/*! ./ImageSelection */ "./packages/roosterjs-editor-plugins/lib/plugins/ImageSelection/ImageSelection.ts");
|
|
23948
|
-
Object.defineProperty(exports, "ImageSelection", { enumerable: true, get: function () { return ImageSelection_1.default; } });
|
|
23949
|
-
|
|
23950
|
-
|
|
23951
24010
|
/***/ }),
|
|
23952
24011
|
|
|
23953
24012
|
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Paste/Paste.ts":
|
|
@@ -25921,6 +25980,13 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
25921
25980
|
*/
|
|
25922
25981
|
PickerPlugin.prototype.dispose = function () {
|
|
25923
25982
|
this.editor = null;
|
|
25983
|
+
this.isSuggesting = null;
|
|
25984
|
+
this.blockSuggestions = null;
|
|
25985
|
+
this.eventHandledOnKeyDown = null;
|
|
25986
|
+
this.lastKnownRange = null;
|
|
25987
|
+
this.isPendingInputEventHandling = null;
|
|
25988
|
+
this.currentInputLength = null;
|
|
25989
|
+
this.newInputLength = null;
|
|
25924
25990
|
this.dataProvider.onDispose();
|
|
25925
25991
|
};
|
|
25926
25992
|
/**
|
|
@@ -29020,6 +29086,7 @@ var CompatibleExperimentalFeatures;
|
|
|
29020
29086
|
*/
|
|
29021
29087
|
CompatibleExperimentalFeatures["ConvertSingleImageBody"] = "ConvertSingleImageBody";
|
|
29022
29088
|
/**
|
|
29089
|
+
* @deprecated This feature is always enabled
|
|
29023
29090
|
* Align table elements to left, center and right using setAlignment API
|
|
29024
29091
|
*/
|
|
29025
29092
|
CompatibleExperimentalFeatures["TableAlignment"] = "TableAlignment";
|
|
@@ -29028,6 +29095,7 @@ var CompatibleExperimentalFeatures;
|
|
|
29028
29095
|
*/
|
|
29029
29096
|
CompatibleExperimentalFeatures["TabKeyTextFeatures"] = "TabKeyTextFeatures";
|
|
29030
29097
|
/**
|
|
29098
|
+
* @deprecated this feature is always enabled
|
|
29031
29099
|
* Provide a circular resize handles that adaptive the number od handles to the size of the image
|
|
29032
29100
|
*/
|
|
29033
29101
|
CompatibleExperimentalFeatures["AdaptiveHandlesResizer"] = "AdaptiveHandlesResizer";
|
|
@@ -29056,6 +29124,7 @@ var CompatibleExperimentalFeatures;
|
|
|
29056
29124
|
*/
|
|
29057
29125
|
CompatibleExperimentalFeatures["NormalizeList"] = "NormalizeList";
|
|
29058
29126
|
/**
|
|
29127
|
+
* @deprecated this feature is always enabled
|
|
29059
29128
|
* When a html image is selected, the selected image data will be stored by editor core.
|
|
29060
29129
|
*/
|
|
29061
29130
|
CompatibleExperimentalFeatures["ImageSelection"] = "ImageSelection";
|
|
@@ -29066,6 +29135,11 @@ var CompatibleExperimentalFeatures;
|
|
|
29066
29135
|
* is the one closest to the item.
|
|
29067
29136
|
*/
|
|
29068
29137
|
CompatibleExperimentalFeatures["ReuseAllAncestorListElements"] = "ReuseAllAncestorListElements";
|
|
29138
|
+
/**
|
|
29139
|
+
* When apply default format when initialize or user type, apply the format on a SPAN element rather than
|
|
29140
|
+
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
29141
|
+
*/
|
|
29142
|
+
CompatibleExperimentalFeatures["DefaultFormatInSpan"] = "DefaultFormatInSpan";
|
|
29069
29143
|
})(CompatibleExperimentalFeatures = exports.CompatibleExperimentalFeatures || (exports.CompatibleExperimentalFeatures = {}));
|
|
29070
29144
|
|
|
29071
29145
|
|