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