roosterjs 8.56.0 → 8.58.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/README.md +21 -66
- package/dist/rooster-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +199 -18
- package/dist/rooster-amd.js +563 -140
- 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 +199 -18
- package/dist/rooster.js +563 -140
- package/dist/rooster.js.map +1 -1
- package/lib/createEditor.d.ts +1 -1
- package/lib/createEditor.js +1 -1
- package/lib/createEditor.js.map +1 -1
- package/lib-amd/createEditor.d.ts +1 -1
- package/lib-amd/createEditor.js +1 -1
- package/lib-amd/createEditor.js.map +1 -1
- package/lib-mjs/createEditor.d.ts +1 -1
- package/lib-mjs/createEditor.js +1 -1
- package/lib-mjs/createEditor.js.map +1 -1
- package/package.json +7 -7
package/dist/rooster-amd.js
CHANGED
|
@@ -2896,10 +2896,9 @@ function insertEntity(editor, type, contentNode, isBlock, isReadonly, position,
|
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
2898
|
}
|
|
2899
|
-
else if (isReadonly
|
|
2900
|
-
editor.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */)) {
|
|
2899
|
+
else if (isReadonly) {
|
|
2901
2900
|
(0, roosterjs_editor_dom_1.addDelimiters)(entity.wrapper);
|
|
2902
|
-
if (entity.wrapper.nextElementSibling) {
|
|
2901
|
+
if (entity.wrapper.nextElementSibling && editor.hasFocus()) {
|
|
2903
2902
|
editor.select(new roosterjs_editor_dom_1.Position(entity.wrapper.nextElementSibling, -3 /* After */));
|
|
2904
2903
|
}
|
|
2905
2904
|
}
|
|
@@ -5481,6 +5480,7 @@ var getStyleBasedFormatState = function (core, node) {
|
|
|
5481
5480
|
'margin-bottom',
|
|
5482
5481
|
'text-align',
|
|
5483
5482
|
'direction',
|
|
5483
|
+
'font-weight',
|
|
5484
5484
|
])
|
|
5485
5485
|
: [];
|
|
5486
5486
|
var contentDiv = core.contentDiv, darkColorHandler = core.darkColorHandler;
|
|
@@ -5524,6 +5524,7 @@ var getStyleBasedFormatState = function (core, node) {
|
|
|
5524
5524
|
marginBottom: styles[6],
|
|
5525
5525
|
textAlign: styles[7],
|
|
5526
5526
|
direction: styles[8],
|
|
5527
|
+
fontWeight: styles[9],
|
|
5527
5528
|
};
|
|
5528
5529
|
};
|
|
5529
5530
|
exports.getStyleBasedFormatState = getStyleBasedFormatState;
|
|
@@ -7216,7 +7217,6 @@ var EntityPlugin = /** @class */ (function () {
|
|
|
7216
7217
|
* @param event PluginEvent object
|
|
7217
7218
|
*/
|
|
7218
7219
|
EntityPlugin.prototype.onPluginEvent = function (event) {
|
|
7219
|
-
var _a;
|
|
7220
7220
|
switch (event.eventType) {
|
|
7221
7221
|
case 6 /* MouseUp */:
|
|
7222
7222
|
this.handleMouseUpEvent(event);
|
|
@@ -7248,7 +7248,7 @@ var EntityPlugin = /** @class */ (function () {
|
|
|
7248
7248
|
this.handleEntityOperationEvent(event);
|
|
7249
7249
|
break;
|
|
7250
7250
|
}
|
|
7251
|
-
if (
|
|
7251
|
+
if (this.editor) {
|
|
7252
7252
|
(0, inlineEntityOnPluginEvent_1.inlineEntityOnPluginEvent)(event, this.editor);
|
|
7253
7253
|
}
|
|
7254
7254
|
};
|
|
@@ -7297,7 +7297,6 @@ var EntityPlugin = /** @class */ (function () {
|
|
|
7297
7297
|
};
|
|
7298
7298
|
EntityPlugin.prototype.handleContentChangedEvent = function (event) {
|
|
7299
7299
|
var _this = this;
|
|
7300
|
-
var _a;
|
|
7301
7300
|
var shouldNormalizeDelimiters = false;
|
|
7302
7301
|
// 1. find removed entities
|
|
7303
7302
|
(0, roosterjs_editor_dom_1.getObjectKeys)(this.state.entityMap).forEach(function (id) {
|
|
@@ -7327,8 +7326,7 @@ var EntityPlugin = /** @class */ (function () {
|
|
|
7327
7326
|
(0, roosterjs_editor_dom_1.commitEntity)(wrapper, type, isReadonly, entity.id); // Use entity.id here because it is newly updated
|
|
7328
7327
|
_this.handleNewEntity(entity);
|
|
7329
7328
|
});
|
|
7330
|
-
if (shouldNormalizeDelimiters &&
|
|
7331
|
-
((_a = this.editor) === null || _a === void 0 ? void 0 : _a.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */))) {
|
|
7329
|
+
if (shouldNormalizeDelimiters && this.editor) {
|
|
7332
7330
|
(0, inlineEntityOnPluginEvent_1.normalizeDelimitersInEditor)(this.editor);
|
|
7333
7331
|
}
|
|
7334
7332
|
};
|
|
@@ -7487,13 +7485,6 @@ var ImageSelection = /** @class */ (function () {
|
|
|
7487
7485
|
var _a;
|
|
7488
7486
|
if (this.editor) {
|
|
7489
7487
|
switch (event.eventType) {
|
|
7490
|
-
case 17 /* EnteredShadowEdit */:
|
|
7491
|
-
case 18 /* LeavingShadowEdit */:
|
|
7492
|
-
var selection = this.editor.getSelectionRangeEx();
|
|
7493
|
-
if (selection.type == 2 /* ImageSelection */) {
|
|
7494
|
-
this.editor.select(selection.image);
|
|
7495
|
-
}
|
|
7496
|
-
break;
|
|
7497
7488
|
case 6 /* MouseUp */:
|
|
7498
7489
|
var target = event.rawEvent.target;
|
|
7499
7490
|
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(target, 'HTMLImageElement') &&
|
|
@@ -7511,10 +7502,15 @@ var ImageSelection = /** @class */ (function () {
|
|
|
7511
7502
|
this.editor.select(null);
|
|
7512
7503
|
}
|
|
7513
7504
|
break;
|
|
7514
|
-
case
|
|
7515
|
-
var
|
|
7505
|
+
case 0 /* KeyDown */:
|
|
7506
|
+
var rawEvent = event.rawEvent;
|
|
7507
|
+
var key = rawEvent.key;
|
|
7516
7508
|
var keyDownSelection = this.editor.getSelectionRangeEx();
|
|
7517
|
-
if (
|
|
7509
|
+
if (!rawEvent.ctrlKey &&
|
|
7510
|
+
!rawEvent.altKey &&
|
|
7511
|
+
!rawEvent.shiftKey &&
|
|
7512
|
+
!rawEvent.metaKey &&
|
|
7513
|
+
keyDownSelection.type === 2 /* ImageSelection */) {
|
|
7518
7514
|
if (key === Escape) {
|
|
7519
7515
|
this.editor.select(keyDownSelection.image, -2 /* Before */);
|
|
7520
7516
|
(_a = this.editor.getSelectionRange()) === null || _a === void 0 ? void 0 : _a.collapse();
|
|
@@ -7525,7 +7521,8 @@ var ImageSelection = /** @class */ (function () {
|
|
|
7525
7521
|
event.rawEvent.preventDefault();
|
|
7526
7522
|
}
|
|
7527
7523
|
else {
|
|
7528
|
-
|
|
7524
|
+
var position = new roosterjs_editor_dom_1.Position(keyDownSelection.image, -2 /* Before */);
|
|
7525
|
+
this.editor.select(position);
|
|
7529
7526
|
}
|
|
7530
7527
|
}
|
|
7531
7528
|
break;
|
|
@@ -7555,29 +7552,10 @@ exports["default"] = ImageSelection;
|
|
|
7555
7552
|
|
|
7556
7553
|
"use strict";
|
|
7557
7554
|
|
|
7558
|
-
var _a, _b;
|
|
7559
7555
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7560
7556
|
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
|
|
7561
7557
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
7562
7558
|
var CONTENT_EDITABLE_ATTRIBUTE_NAME = 'contenteditable';
|
|
7563
|
-
var COMMANDS = roosterjs_editor_dom_1.Browser.isFirefox
|
|
7564
|
-
? (_a = {},
|
|
7565
|
-
/**
|
|
7566
|
-
* Disable these object resizing for firefox since other browsers don't have these behaviors
|
|
7567
|
-
*/
|
|
7568
|
-
_a["enableObjectResizing" /* EnableObjectResizing */] = false,
|
|
7569
|
-
_a["enableInlineTableEditing" /* EnableInlineTableEditing */] = false,
|
|
7570
|
-
_a) : roosterjs_editor_dom_1.Browser.isIE
|
|
7571
|
-
? (_b = {},
|
|
7572
|
-
/**
|
|
7573
|
-
* Change the default paragraph separator to DIV. This is mainly for IE since its default setting is P
|
|
7574
|
-
*/
|
|
7575
|
-
_b["defaultParagraphSeparator" /* DefaultParagraphSeparator */] = 'div',
|
|
7576
|
-
/**
|
|
7577
|
-
* Disable auto link feature in IE since we have our own implementation
|
|
7578
|
-
*/
|
|
7579
|
-
_b["AutoUrlDetect" /* AutoUrlDetect */] = false,
|
|
7580
|
-
_b) : {};
|
|
7581
7559
|
var DARK_MODE_DEFAULT_FORMAT = {
|
|
7582
7560
|
backgroundColors: {
|
|
7583
7561
|
darkModeColor: 'rgb(51,51,51)',
|
|
@@ -7610,11 +7588,9 @@ var LifecyclePlugin = /** @class */ (function () {
|
|
|
7610
7588
|
this.initializer = function () {
|
|
7611
7589
|
contentDiv.contentEditable = 'true';
|
|
7612
7590
|
contentDiv.style.userSelect = 'text';
|
|
7613
|
-
contentDiv.style.webkitUserSelect = 'text';
|
|
7614
7591
|
};
|
|
7615
7592
|
this.disposer = function () {
|
|
7616
7593
|
contentDiv.style.userSelect = '';
|
|
7617
|
-
contentDiv.style.webkitUserSelect = '';
|
|
7618
7594
|
contentDiv.removeAttribute(CONTENT_EDITABLE_ATTRIBUTE_NAME);
|
|
7619
7595
|
};
|
|
7620
7596
|
}
|
|
@@ -7679,8 +7655,6 @@ var LifecyclePlugin = /** @class */ (function () {
|
|
|
7679
7655
|
(_a = this.initializer) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
7680
7656
|
// Set editor background color for dark mode
|
|
7681
7657
|
this.adjustColor();
|
|
7682
|
-
// Do proper change for browsers to disable some browser-specified behaviors.
|
|
7683
|
-
this.adjustBrowserBehavior();
|
|
7684
7658
|
// Let other plugins know that we are ready
|
|
7685
7659
|
this.editor.triggerPluginEvent(11 /* EditorReady */, {}, true /*broadcast*/);
|
|
7686
7660
|
};
|
|
@@ -7723,17 +7697,6 @@ var LifecyclePlugin = /** @class */ (function () {
|
|
|
7723
7697
|
this.adjustColor();
|
|
7724
7698
|
}
|
|
7725
7699
|
};
|
|
7726
|
-
LifecyclePlugin.prototype.adjustBrowserBehavior = function () {
|
|
7727
|
-
var _this = this;
|
|
7728
|
-
(0, roosterjs_editor_dom_1.getObjectKeys)(COMMANDS).forEach(function (command) {
|
|
7729
|
-
var _a;
|
|
7730
|
-
// Catch any possible exception since this should not block the initialization of editor
|
|
7731
|
-
try {
|
|
7732
|
-
(_a = _this.editor) === null || _a === void 0 ? void 0 : _a.getDocument().execCommand(command, false, COMMANDS[command]);
|
|
7733
|
-
}
|
|
7734
|
-
catch (_b) { }
|
|
7735
|
-
});
|
|
7736
|
-
};
|
|
7737
7700
|
return LifecyclePlugin;
|
|
7738
7701
|
}());
|
|
7739
7702
|
exports["default"] = LifecyclePlugin;
|
|
@@ -9104,9 +9067,17 @@ var EditorBase = /** @class */ (function () {
|
|
|
9104
9067
|
* Dispose this editor, dispose all plugins and custom data
|
|
9105
9068
|
*/
|
|
9106
9069
|
EditorBase.prototype.dispose = function () {
|
|
9070
|
+
var _a;
|
|
9107
9071
|
var core = this.getCore();
|
|
9108
9072
|
for (var i = core.plugins.length - 1; i >= 0; i--) {
|
|
9109
|
-
core.plugins[i]
|
|
9073
|
+
var plugin = core.plugins[i];
|
|
9074
|
+
try {
|
|
9075
|
+
plugin.dispose();
|
|
9076
|
+
}
|
|
9077
|
+
catch (e) {
|
|
9078
|
+
// Cache the error and pass it out, then keep going since dispose should always succeed
|
|
9079
|
+
(_a = core.disposeErrorHandler) === null || _a === void 0 ? void 0 : _a.call(core, plugin, e);
|
|
9080
|
+
}
|
|
9110
9081
|
}
|
|
9111
9082
|
core.darkColorHandler.reset();
|
|
9112
9083
|
this.core = null;
|
|
@@ -9897,7 +9868,7 @@ var createEditorCore = function (contentDiv, options) {
|
|
|
9897
9868
|
? [scrollContainer]
|
|
9898
9869
|
: [scrollContainer, core.contentDiv]);
|
|
9899
9870
|
});
|
|
9900
|
-
var core = (0, tslib_1.__assign)((0, tslib_1.__assign)({ contentDiv: contentDiv, api: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, coreApiMap_1.coreApiMap), (options.coreApiOverride || {})), originalApi: coreApiMap_1.coreApiMap, plugins: plugins.filter(function (x) { return !!x; }) }, pluginState), { trustedHTMLHandler: options.trustedHTMLHandler || (function (html) { return html; }), zoomScale: zoomScale, sizeTransformer: options.sizeTransformer || (function (size) { return size / zoomScale; }), getVisibleViewport: getVisibleViewport, imageSelectionBorderColor: options.imageSelectionBorderColor, darkColorHandler: new DarkColorHandlerImpl_1.default(contentDiv, pluginState.lifecycle.getDarkColor) });
|
|
9871
|
+
var core = (0, tslib_1.__assign)((0, tslib_1.__assign)({ contentDiv: contentDiv, api: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, coreApiMap_1.coreApiMap), (options.coreApiOverride || {})), originalApi: coreApiMap_1.coreApiMap, plugins: plugins.filter(function (x) { return !!x; }) }, pluginState), { trustedHTMLHandler: options.trustedHTMLHandler || (function (html) { return html; }), zoomScale: zoomScale, sizeTransformer: options.sizeTransformer || (function (size) { return size / zoomScale; }), getVisibleViewport: getVisibleViewport, imageSelectionBorderColor: options.imageSelectionBorderColor, darkColorHandler: new DarkColorHandlerImpl_1.default(contentDiv, pluginState.lifecycle.getDarkColor), disposeErrorHandler: options.disposeErrorHandler });
|
|
9901
9872
|
return core;
|
|
9902
9873
|
};
|
|
9903
9874
|
exports.createEditorCore = createEditorCore;
|
|
@@ -13216,8 +13187,8 @@ exports.isCssVariable = isCssVariable;
|
|
|
13216
13187
|
|
|
13217
13188
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13218
13189
|
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.getPasteType = exports.sanitizePasteContent = exports.retrieveMetadataFromClipboard = exports.handleTextPaste = exports.handleImagePaste = exports.extractClipboardItemsForIE = exports.extractClipboardItems = exports.extractClipboardEvent = exports.applyTextStyle = exports.PartialInlineElement = exports.NodeInlineElement = exports.LinkInlineElement = exports.ImageInlineElement = exports.getInlineElementAtNode = exports.getDelimiterFromElement = exports.addDelimiterBefore = exports.addDelimiterAfter = exports.addDelimiters = exports.PositionContentSearcher = exports.ContentTraverser = exports.getFirstLastBlockElement = exports.getBlockElementAtNode = void 0;
|
|
13219
|
-
exports.
|
|
13220
|
-
exports.getPasteSource = 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 = exports.setGlobalCssStyles = exports.removeImportantStyleRule = exports.setStyles = exports.getStyles = exports.isCtrlOrMetaPressed = exports.isCharacterValue = exports.isModifierKey = exports.clearEventDataCache = exports.cacheGetEventData = exports.restoreContentWithEntityPlaceholder = exports.moveContentWithEntityPlaceholders = exports.createEntityPlaceholder = exports.getEntitySelector = exports.getEntityFromElement = exports.commitEntity = void 0;
|
|
13190
|
+
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.extractContentMetadata = 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.getTableCellMetadata = exports.saveTableCellMetadata = exports.getTableFormatInfo = exports.setListItemStyle = exports.convertDecimalsToRoman = exports.convertDecimalsToAlpha = exports.VListChain = exports.createVListFromRegion = exports.VListItem = exports.VList = exports.isWholeTableSelected = exports.VTable = exports.parseColor = exports.isNodeAfter = exports.getIntersectedRect = exports.moveChildNodes = exports.KnownCreateElementData = exports.createElement = exports.matchesSelector = exports.setColor = exports.getInnerHTML = exports.readFile = exports.safeInstanceOf = void 0;
|
|
13191
|
+
exports.getPasteSource = 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 = exports.setGlobalCssStyles = exports.removeImportantStyleRule = exports.setStyles = exports.getStyles = exports.isCtrlOrMetaPressed = exports.isCharacterValue = exports.isModifierKey = exports.clearEventDataCache = exports.cacheGetEventData = exports.restoreContentWithEntityPlaceholder = exports.moveContentWithEntityPlaceholders = exports.createEntityPlaceholder = exports.getEntitySelector = exports.getEntityFromElement = exports.commitEntity = exports.chainSanitizerCallback = exports.createDefaultHtmlSanitizerOptions = void 0;
|
|
13221
13192
|
var getBlockElementAtNode_1 = __webpack_require__(/*! ./blockElements/getBlockElementAtNode */ "./packages/roosterjs-editor-dom/lib/blockElements/getBlockElementAtNode.ts");
|
|
13222
13193
|
Object.defineProperty(exports, "getBlockElementAtNode", ({ enumerable: true, get: function () { return getBlockElementAtNode_1.default; } }));
|
|
13223
13194
|
var getFirstLastBlockElement_1 = __webpack_require__(/*! ./blockElements/getFirstLastBlockElement */ "./packages/roosterjs-editor-dom/lib/blockElements/getFirstLastBlockElement.ts");
|
|
@@ -13343,6 +13314,10 @@ var createVListFromRegion_1 = __webpack_require__(/*! ./list/createVListFromRegi
|
|
|
13343
13314
|
Object.defineProperty(exports, "createVListFromRegion", ({ enumerable: true, get: function () { return createVListFromRegion_1.default; } }));
|
|
13344
13315
|
var VListChain_1 = __webpack_require__(/*! ./list/VListChain */ "./packages/roosterjs-editor-dom/lib/list/VListChain.ts");
|
|
13345
13316
|
Object.defineProperty(exports, "VListChain", ({ enumerable: true, get: function () { return VListChain_1.default; } }));
|
|
13317
|
+
var convertDecimalsToAlpha_1 = __webpack_require__(/*! ./list/convertDecimalsToAlpha */ "./packages/roosterjs-editor-dom/lib/list/convertDecimalsToAlpha.ts");
|
|
13318
|
+
Object.defineProperty(exports, "convertDecimalsToAlpha", ({ enumerable: true, get: function () { return convertDecimalsToAlpha_1.default; } }));
|
|
13319
|
+
var convertDecimalsToRomans_1 = __webpack_require__(/*! ./list/convertDecimalsToRomans */ "./packages/roosterjs-editor-dom/lib/list/convertDecimalsToRomans.ts");
|
|
13320
|
+
Object.defineProperty(exports, "convertDecimalsToRoman", ({ enumerable: true, get: function () { return convertDecimalsToRomans_1.default; } }));
|
|
13346
13321
|
var setListItemStyle_1 = __webpack_require__(/*! ./list/setListItemStyle */ "./packages/roosterjs-editor-dom/lib/list/setListItemStyle.ts");
|
|
13347
13322
|
Object.defineProperty(exports, "setListItemStyle", ({ enumerable: true, get: function () { return setListItemStyle_1.default; } }));
|
|
13348
13323
|
var tableFormatInfo_1 = __webpack_require__(/*! ./table/tableFormatInfo */ "./packages/roosterjs-editor-dom/lib/table/tableFormatInfo.ts");
|
|
@@ -13828,11 +13803,11 @@ exports["default"] = PartialInlineElement;
|
|
|
13828
13803
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13829
13804
|
var getTagOfNode_1 = __webpack_require__(/*! ../utils/getTagOfNode */ "./packages/roosterjs-editor-dom/lib/utils/getTagOfNode.ts");
|
|
13830
13805
|
var Position_1 = __webpack_require__(/*! ../selection/Position */ "./packages/roosterjs-editor-dom/lib/selection/Position.ts");
|
|
13806
|
+
var safeInstanceOf_1 = __webpack_require__(/*! ../utils/safeInstanceOf */ "./packages/roosterjs-editor-dom/lib/utils/safeInstanceOf.ts");
|
|
13831
13807
|
var splitTextNode_1 = __webpack_require__(/*! ../utils/splitTextNode */ "./packages/roosterjs-editor-dom/lib/utils/splitTextNode.ts");
|
|
13832
13808
|
var wrap_1 = __webpack_require__(/*! ../utils/wrap */ "./packages/roosterjs-editor-dom/lib/utils/wrap.ts");
|
|
13833
13809
|
var getLeafSibling_1 = __webpack_require__(/*! ../utils/getLeafSibling */ "./packages/roosterjs-editor-dom/lib/utils/getLeafSibling.ts");
|
|
13834
13810
|
var splitParentNode_1 = __webpack_require__(/*! ../utils/splitParentNode */ "./packages/roosterjs-editor-dom/lib/utils/splitParentNode.ts");
|
|
13835
|
-
var safeInstanceOf_1 = __webpack_require__(/*! ../utils/safeInstanceOf */ "./packages/roosterjs-editor-dom/lib/utils/safeInstanceOf.ts");
|
|
13836
13811
|
var STYLET_AGS = 'SPAN,B,I,U,EM,STRONG,STRIKE,S,SMALL,SUP,SUB'.split(',');
|
|
13837
13812
|
/**
|
|
13838
13813
|
* Apply style using a styler function to the given container node in the given range
|
|
@@ -13959,7 +13934,9 @@ var NodeInlineElement_1 = __webpack_require__(/*! ./NodeInlineElement */ "./pack
|
|
|
13959
13934
|
var safeInstanceOf_1 = __webpack_require__(/*! ../utils/safeInstanceOf */ "./packages/roosterjs-editor-dom/lib/utils/safeInstanceOf.ts");
|
|
13960
13935
|
function getInlineElementAtNode(parent, node) {
|
|
13961
13936
|
// An inline element has to be in a block element, get the block first and then resolve through the factory
|
|
13962
|
-
var parentBlock = (0, safeInstanceOf_1.default)(parent, 'Node')
|
|
13937
|
+
var parentBlock = (0, safeInstanceOf_1.default)(parent, 'Node')
|
|
13938
|
+
? (0, getBlockElementAtNode_1.default)(parent, node)
|
|
13939
|
+
: parent;
|
|
13963
13940
|
return node && parentBlock && resolveInlineElement(node, parentBlock);
|
|
13964
13941
|
}
|
|
13965
13942
|
exports["default"] = getInlineElementAtNode;
|
|
@@ -15207,7 +15184,6 @@ var ALPHABET = {
|
|
|
15207
15184
|
25: 'Z',
|
|
15208
15185
|
};
|
|
15209
15186
|
/**
|
|
15210
|
-
* @internal
|
|
15211
15187
|
* Convert decimal numbers into english alphabet letters
|
|
15212
15188
|
* @param decimal The decimal number that needs to be converted
|
|
15213
15189
|
* @param isLowerCase if true the roman value will appear in lower case
|
|
@@ -15253,7 +15229,6 @@ var RomanValues = {
|
|
|
15253
15229
|
I: 1,
|
|
15254
15230
|
};
|
|
15255
15231
|
/**
|
|
15256
|
-
* @internal
|
|
15257
15232
|
* Convert decimal numbers into roman numbers
|
|
15258
15233
|
* @param decimal The decimal number that needs to be converted
|
|
15259
15234
|
* @param isLowerCase if true the roman value will appear in lower case
|
|
@@ -18451,11 +18426,11 @@ function applyTableFormat(table, cells, format, darkColorHandler) {
|
|
|
18451
18426
|
}
|
|
18452
18427
|
exports["default"] = applyTableFormat;
|
|
18453
18428
|
/**
|
|
18454
|
-
* Check if the cell has shade
|
|
18429
|
+
* Check if the cell has shade meta override
|
|
18455
18430
|
* @param cell
|
|
18456
18431
|
* @returns
|
|
18457
18432
|
*/
|
|
18458
|
-
function
|
|
18433
|
+
function hasCellShadeOverride(cell) {
|
|
18459
18434
|
var _a;
|
|
18460
18435
|
if (!cell.td) {
|
|
18461
18436
|
return false;
|
|
@@ -18463,17 +18438,29 @@ function hasCellShade(cell) {
|
|
|
18463
18438
|
return !!((_a = (0, tableCellInfo_1.getTableCellMetadata)(cell.td)) === null || _a === void 0 ? void 0 : _a.bgColorOverride);
|
|
18464
18439
|
}
|
|
18465
18440
|
/**
|
|
18466
|
-
* Check if the cell has vertical align
|
|
18441
|
+
* Check if the cell has vertical align meta override
|
|
18467
18442
|
* @param cell
|
|
18468
18443
|
* @returns
|
|
18469
18444
|
*/
|
|
18470
|
-
function
|
|
18445
|
+
function hasValignOverride(cell) {
|
|
18471
18446
|
var _a;
|
|
18472
18447
|
if (!cell.td) {
|
|
18473
18448
|
return false;
|
|
18474
18449
|
}
|
|
18475
18450
|
return !!((_a = (0, tableCellInfo_1.getTableCellMetadata)(cell.td)) === null || _a === void 0 ? void 0 : _a.vAlignOverride);
|
|
18476
18451
|
}
|
|
18452
|
+
/**
|
|
18453
|
+
* Check if the cell has any modified border meta override
|
|
18454
|
+
* @param cell
|
|
18455
|
+
* @returns
|
|
18456
|
+
*/
|
|
18457
|
+
function hasBorderOverride(cell) {
|
|
18458
|
+
var _a;
|
|
18459
|
+
if (!cell.td) {
|
|
18460
|
+
return false;
|
|
18461
|
+
}
|
|
18462
|
+
return !!((_a = (0, tableCellInfo_1.getTableCellMetadata)(cell.td)) === null || _a === void 0 ? void 0 : _a.borderOverride);
|
|
18463
|
+
}
|
|
18477
18464
|
/**
|
|
18478
18465
|
* Set color and vertical align to the table
|
|
18479
18466
|
* @param format the format that must be applied
|
|
@@ -18487,7 +18474,7 @@ function setCellFormat(cells, format, darkColorHandler) {
|
|
|
18487
18474
|
row.forEach(function (cell) {
|
|
18488
18475
|
if (cell.td) {
|
|
18489
18476
|
// Set cell color
|
|
18490
|
-
if (!
|
|
18477
|
+
if (!hasCellShadeOverride(cell)) {
|
|
18491
18478
|
if (hasBandedRows) {
|
|
18492
18479
|
var backgroundColor = color(index);
|
|
18493
18480
|
(0, setColor_1.default)(cell.td, backgroundColor || TRANSPARENT, true /** isBackgroundColor*/, undefined /** isDarkMode **/, true /** shouldAdaptFontColor */, darkColorHandler);
|
|
@@ -18500,7 +18487,7 @@ function setCellFormat(cells, format, darkColorHandler) {
|
|
|
18500
18487
|
}
|
|
18501
18488
|
}
|
|
18502
18489
|
// Set cell vertical align
|
|
18503
|
-
if (format.verticalAlign && !
|
|
18490
|
+
if (format.verticalAlign && !hasValignOverride(cell)) {
|
|
18504
18491
|
cell.td.style.verticalAlign = format.verticalAlign;
|
|
18505
18492
|
}
|
|
18506
18493
|
}
|
|
@@ -18510,7 +18497,7 @@ function setCellFormat(cells, format, darkColorHandler) {
|
|
|
18510
18497
|
cells.forEach(function (row) {
|
|
18511
18498
|
row.forEach(function (cell, index) {
|
|
18512
18499
|
var backgroundColor = color(index);
|
|
18513
|
-
if (cell.td && backgroundColor && !
|
|
18500
|
+
if (cell.td && backgroundColor && !hasCellShadeOverride(cell)) {
|
|
18514
18501
|
(0, setColor_1.default)(cell.td, backgroundColor, true /** isBackgroundColor*/, undefined /** isDarkMode **/, true /** shouldAdaptFontColor */, darkColorHandler);
|
|
18515
18502
|
}
|
|
18516
18503
|
});
|
|
@@ -18650,7 +18637,7 @@ function formatBorders(format, td, isFirstRow, isLastRow, isFirstColumn, isLastC
|
|
|
18650
18637
|
function setBordersType(cells, format) {
|
|
18651
18638
|
cells.forEach(function (row, rowIndex) {
|
|
18652
18639
|
row.forEach(function (cell, cellIndex) {
|
|
18653
|
-
if (cell.td) {
|
|
18640
|
+
if (cell.td && !hasBorderOverride(cell)) {
|
|
18654
18641
|
formatBorders(format, cell.td, rowIndex === 0, rowIndex === cells.length - 1, cellIndex === 0, cellIndex === row.length - 1);
|
|
18655
18642
|
}
|
|
18656
18643
|
});
|
|
@@ -18676,7 +18663,7 @@ function setFirstColumnFormat(cells, format) {
|
|
|
18676
18663
|
cells.forEach(function (row, rowIndex) {
|
|
18677
18664
|
row.forEach(function (cell, cellIndex) {
|
|
18678
18665
|
if (cell.td && cellIndex === 0) {
|
|
18679
|
-
if (rowIndex !== 0 && !
|
|
18666
|
+
if (rowIndex !== 0 && !hasCellShadeOverride(cell)) {
|
|
18680
18667
|
cell.td.style.borderTopColor = TRANSPARENT;
|
|
18681
18668
|
(0, setColor_1.default)(cell.td, TRANSPARENT, true /** isBackgroundColor*/, undefined /** isDarkMode **/, true /** shouldAdaptFontColor */);
|
|
18682
18669
|
}
|
|
@@ -18708,7 +18695,7 @@ function setHeaderRowFormat(cells, format, darkColorHandler) {
|
|
|
18708
18695
|
}
|
|
18709
18696
|
(_b = cells[0]) === null || _b === void 0 ? void 0 : _b.forEach(function (cell) {
|
|
18710
18697
|
if (cell.td && format.headerRowColor) {
|
|
18711
|
-
if (!
|
|
18698
|
+
if (!hasCellShadeOverride(cell)) {
|
|
18712
18699
|
(0, setColor_1.default)(cell.td, format.headerRowColor, true /** isBackgroundColor*/, undefined /** isDarkMode **/, true /** shouldAdaptFontColor */, darkColorHandler);
|
|
18713
18700
|
}
|
|
18714
18701
|
cell.td.style.borderRightColor = format.headerRowColor;
|
|
@@ -18876,6 +18863,7 @@ var BooleanDefinition = (0, definitionCreators_1.createBooleanDefinition)(true /
|
|
|
18876
18863
|
var TableCellFormatMetadata = (0, definitionCreators_1.createObjectDefinition)({
|
|
18877
18864
|
bgColorOverride: BooleanDefinition,
|
|
18878
18865
|
vAlignOverride: BooleanDefinition,
|
|
18866
|
+
borderOverride: BooleanDefinition,
|
|
18879
18867
|
}, false /* isOptional */, true /** allowNull */);
|
|
18880
18868
|
/**
|
|
18881
18869
|
* @internal
|
|
@@ -20220,7 +20208,8 @@ function queryElements(container, selector, forEachCallback, scope, range) {
|
|
|
20220
20208
|
}
|
|
20221
20209
|
var elements = (0, toArray_1.default)(container.querySelectorAll(selector));
|
|
20222
20210
|
if (scope != 0 /* Body */ && range) {
|
|
20223
|
-
var
|
|
20211
|
+
var startOffset = range.startOffset, endOffset = range.endOffset;
|
|
20212
|
+
var startContainer_1 = range.startContainer, endContainer_1 = range.endContainer;
|
|
20224
20213
|
if (startContainer_1.nodeType == 1 /* Element */ && startContainer_1.firstChild) {
|
|
20225
20214
|
var child = startContainer_1.childNodes[startOffset];
|
|
20226
20215
|
// range.startOffset can give a value of child.length+1 when selection is after the last child
|
|
@@ -20721,6 +20710,21 @@ function wrap(nodes, wrapper) {
|
|
|
20721
20710
|
exports["default"] = wrap;
|
|
20722
20711
|
|
|
20723
20712
|
|
|
20713
|
+
/***/ }),
|
|
20714
|
+
|
|
20715
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/Announce.ts":
|
|
20716
|
+
/*!***********************************************************!*\
|
|
20717
|
+
!*** ./packages/roosterjs-editor-plugins/lib/Announce.ts ***!
|
|
20718
|
+
\***********************************************************/
|
|
20719
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
20720
|
+
|
|
20721
|
+
"use strict";
|
|
20722
|
+
|
|
20723
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
20724
|
+
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
|
|
20725
|
+
(0, tslib_1.__exportStar)(__webpack_require__(/*! ./plugins/Announce/index */ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/index.ts"), exports);
|
|
20726
|
+
|
|
20727
|
+
|
|
20724
20728
|
/***/ }),
|
|
20725
20729
|
|
|
20726
20730
|
/***/ "./packages/roosterjs-editor-plugins/lib/AutoFormat.ts":
|
|
@@ -20941,6 +20945,7 @@ var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.m
|
|
|
20941
20945
|
(0, tslib_1.__exportStar)(__webpack_require__(/*! ./Watermark */ "./packages/roosterjs-editor-plugins/lib/Watermark.ts"), exports);
|
|
20942
20946
|
(0, tslib_1.__exportStar)(__webpack_require__(/*! ./TableCellSelection */ "./packages/roosterjs-editor-plugins/lib/TableCellSelection.ts"), exports);
|
|
20943
20947
|
(0, tslib_1.__exportStar)(__webpack_require__(/*! ./AutoFormat */ "./packages/roosterjs-editor-plugins/lib/AutoFormat.ts"), exports);
|
|
20948
|
+
(0, tslib_1.__exportStar)(__webpack_require__(/*! ./Announce */ "./packages/roosterjs-editor-plugins/lib/Announce.ts"), exports);
|
|
20944
20949
|
|
|
20945
20950
|
|
|
20946
20951
|
/***/ }),
|
|
@@ -21077,6 +21082,313 @@ var DragAndDropHelper = /** @class */ (function () {
|
|
|
21077
21082
|
exports["default"] = DragAndDropHelper;
|
|
21078
21083
|
|
|
21079
21084
|
|
|
21085
|
+
/***/ }),
|
|
21086
|
+
|
|
21087
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/pluginUtils/announceData/getAnnounceDataForList.ts":
|
|
21088
|
+
/*!**************************************************************************************************!*\
|
|
21089
|
+
!*** ./packages/roosterjs-editor-plugins/lib/pluginUtils/announceData/getAnnounceDataForList.ts ***!
|
|
21090
|
+
\**************************************************************************************************/
|
|
21091
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21092
|
+
|
|
21093
|
+
"use strict";
|
|
21094
|
+
|
|
21095
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21096
|
+
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
21097
|
+
/**
|
|
21098
|
+
* @internal
|
|
21099
|
+
* Get the announce data for the current List
|
|
21100
|
+
* @returns announce data for list or undefined.
|
|
21101
|
+
*/
|
|
21102
|
+
function getAnnounceDataForList(list, li) {
|
|
21103
|
+
if (!(0, roosterjs_editor_dom_1.safeInstanceOf)(li, 'HTMLLIElement')) {
|
|
21104
|
+
return undefined;
|
|
21105
|
+
}
|
|
21106
|
+
if (li && (0, roosterjs_editor_dom_1.safeInstanceOf)(list, 'HTMLOListElement')) {
|
|
21107
|
+
var vList = new roosterjs_editor_dom_1.VList(list);
|
|
21108
|
+
var listItemIndex = vList.getListItemIndex(li);
|
|
21109
|
+
var stringToAnnounce = listItemIndex == -1 ? '' : listItemIndex.toString();
|
|
21110
|
+
switch (list.style.listStyleType) {
|
|
21111
|
+
case 'lower-alpha':
|
|
21112
|
+
case 'lower-latin':
|
|
21113
|
+
case 'upper-alpha':
|
|
21114
|
+
case 'upper-latin':
|
|
21115
|
+
stringToAnnounce = (0, roosterjs_editor_dom_1.convertDecimalsToAlpha)(listItemIndex - 1);
|
|
21116
|
+
break;
|
|
21117
|
+
case 'lower-roman':
|
|
21118
|
+
case 'upper-roman':
|
|
21119
|
+
stringToAnnounce = (0, roosterjs_editor_dom_1.convertDecimalsToRoman)(listItemIndex);
|
|
21120
|
+
break;
|
|
21121
|
+
}
|
|
21122
|
+
return {
|
|
21123
|
+
defaultStrings: 1 /* AnnounceListItemNumbering */,
|
|
21124
|
+
formatStrings: [stringToAnnounce],
|
|
21125
|
+
};
|
|
21126
|
+
}
|
|
21127
|
+
else if ((0, roosterjs_editor_dom_1.safeInstanceOf)(list, 'HTMLUListElement')) {
|
|
21128
|
+
return {
|
|
21129
|
+
defaultStrings: 2 /* AnnounceListItemBullet */,
|
|
21130
|
+
};
|
|
21131
|
+
}
|
|
21132
|
+
return undefined;
|
|
21133
|
+
}
|
|
21134
|
+
exports["default"] = getAnnounceDataForList;
|
|
21135
|
+
|
|
21136
|
+
|
|
21137
|
+
/***/ }),
|
|
21138
|
+
|
|
21139
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/AnnouncePlugin.ts":
|
|
21140
|
+
/*!**********************************************************************************!*\
|
|
21141
|
+
!*** ./packages/roosterjs-editor-plugins/lib/plugins/Announce/AnnouncePlugin.ts ***!
|
|
21142
|
+
\**********************************************************************************/
|
|
21143
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21144
|
+
|
|
21145
|
+
"use strict";
|
|
21146
|
+
|
|
21147
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21148
|
+
var AnnounceFeatures_1 = __webpack_require__(/*! ./features/AnnounceFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/AnnounceFeatures.ts");
|
|
21149
|
+
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
21150
|
+
var ARIA_LIVE_STYLE = 'clip: rect(0px, 0px, 0px, 0px); clip-path: inset(100%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px;';
|
|
21151
|
+
var ARIA_LIVE_ASSERTIVE = 'assertive';
|
|
21152
|
+
var DIV_TAG = 'div';
|
|
21153
|
+
var createAriaLiveElement = function (document) {
|
|
21154
|
+
var element = (0, roosterjs_editor_dom_1.createElement)({
|
|
21155
|
+
tag: DIV_TAG,
|
|
21156
|
+
style: ARIA_LIVE_STYLE,
|
|
21157
|
+
attributes: {
|
|
21158
|
+
'aria-live': ARIA_LIVE_ASSERTIVE,
|
|
21159
|
+
},
|
|
21160
|
+
}, document);
|
|
21161
|
+
document.body.appendChild(element);
|
|
21162
|
+
return element;
|
|
21163
|
+
};
|
|
21164
|
+
/**
|
|
21165
|
+
* Announce messages to screen reader by using aria live element.
|
|
21166
|
+
*/
|
|
21167
|
+
var Announce = /** @class */ (function () {
|
|
21168
|
+
function Announce(stringsMapOrGetter, skipAnnounceFeatures, additionalFeatures) {
|
|
21169
|
+
if (skipAnnounceFeatures === void 0) { skipAnnounceFeatures = []; }
|
|
21170
|
+
this.stringsMapOrGetter = stringsMapOrGetter;
|
|
21171
|
+
this.lastFocusedElement = null;
|
|
21172
|
+
this.features = (0, roosterjs_editor_dom_1.getObjectKeys)(AnnounceFeatures_1.AnnounceFeatures)
|
|
21173
|
+
.map(function (key) {
|
|
21174
|
+
if (skipAnnounceFeatures.indexOf(key) == -1) {
|
|
21175
|
+
return AnnounceFeatures_1.AnnounceFeatures[key];
|
|
21176
|
+
}
|
|
21177
|
+
return undefined;
|
|
21178
|
+
})
|
|
21179
|
+
.filter(function (feature) { return !!feature; })
|
|
21180
|
+
.concat(additionalFeatures || []);
|
|
21181
|
+
}
|
|
21182
|
+
/**
|
|
21183
|
+
* Get a friendly name of this plugin
|
|
21184
|
+
*/
|
|
21185
|
+
Announce.prototype.getName = function () {
|
|
21186
|
+
return 'Announce';
|
|
21187
|
+
};
|
|
21188
|
+
/**
|
|
21189
|
+
* Initialize this plugin
|
|
21190
|
+
* @param editor The editor instance
|
|
21191
|
+
*/
|
|
21192
|
+
Announce.prototype.initialize = function (editor) {
|
|
21193
|
+
this.editor = editor;
|
|
21194
|
+
};
|
|
21195
|
+
/**
|
|
21196
|
+
* Dispose this plugin
|
|
21197
|
+
*/
|
|
21198
|
+
Announce.prototype.dispose = function () {
|
|
21199
|
+
var _a, _b;
|
|
21200
|
+
(_b = (_a = this.ariaLiveElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.removeChild(this.ariaLiveElement);
|
|
21201
|
+
this.ariaLiveElement = undefined;
|
|
21202
|
+
this.stringsMapOrGetter = undefined;
|
|
21203
|
+
this.lastFocusedElement = null;
|
|
21204
|
+
while (this.features.length > 0) {
|
|
21205
|
+
this.features.pop();
|
|
21206
|
+
}
|
|
21207
|
+
this.editor = undefined;
|
|
21208
|
+
};
|
|
21209
|
+
/**
|
|
21210
|
+
* Handle events triggered from editor
|
|
21211
|
+
* @param event PluginEvent object
|
|
21212
|
+
*/
|
|
21213
|
+
Announce.prototype.onPluginEvent = function (ev) {
|
|
21214
|
+
var _a;
|
|
21215
|
+
if (this.editor &&
|
|
21216
|
+
ev.eventType == 7 /* ContentChanged */ &&
|
|
21217
|
+
((_a = ev.additionalData) === null || _a === void 0 ? void 0 : _a.getAnnounceData)) {
|
|
21218
|
+
var data = ev.additionalData.getAnnounceData();
|
|
21219
|
+
if (data) {
|
|
21220
|
+
this.announce(data, this.editor);
|
|
21221
|
+
}
|
|
21222
|
+
}
|
|
21223
|
+
if (ev.eventType == 0 /* KeyDown */ && this.editor) {
|
|
21224
|
+
this.handleFeatures(ev, this.editor);
|
|
21225
|
+
}
|
|
21226
|
+
};
|
|
21227
|
+
Announce.prototype.handleFeatures = function (event, editorInput) {
|
|
21228
|
+
var _this = this;
|
|
21229
|
+
editorInput.runAsync(function (editor) {
|
|
21230
|
+
_this.features
|
|
21231
|
+
.filter(function (feature) { return feature.keys.indexOf(event.rawEvent.which) > -1; })
|
|
21232
|
+
.some(function (feature) {
|
|
21233
|
+
var announceData = feature.shouldHandle(editor, _this.lastFocusedElement);
|
|
21234
|
+
if (announceData) {
|
|
21235
|
+
_this.announce(announceData, editor);
|
|
21236
|
+
}
|
|
21237
|
+
return !!announceData;
|
|
21238
|
+
});
|
|
21239
|
+
_this.lastFocusedElement = editor.getElementAtCursor();
|
|
21240
|
+
});
|
|
21241
|
+
};
|
|
21242
|
+
Announce.prototype.announce = function (announceData, editor) {
|
|
21243
|
+
var _a, _b, _c;
|
|
21244
|
+
var text = announceData.text, defaultStrings = announceData.defaultStrings, _d = announceData.formatStrings, formatStrings = _d === void 0 ? [] : _d;
|
|
21245
|
+
var textToAnnounce = formatString(this.getString(defaultStrings) || text, formatStrings);
|
|
21246
|
+
if (textToAnnounce) {
|
|
21247
|
+
if (!this.ariaLiveElement || textToAnnounce == ((_a = this.ariaLiveElement) === null || _a === void 0 ? void 0 : _a.textContent)) {
|
|
21248
|
+
(_c = (_b = this.ariaLiveElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.removeChild(this.ariaLiveElement);
|
|
21249
|
+
this.ariaLiveElement = createAriaLiveElement(editor.getDocument());
|
|
21250
|
+
}
|
|
21251
|
+
if (this.ariaLiveElement) {
|
|
21252
|
+
this.ariaLiveElement.textContent = textToAnnounce;
|
|
21253
|
+
}
|
|
21254
|
+
}
|
|
21255
|
+
};
|
|
21256
|
+
Announce.prototype.getString = function (key) {
|
|
21257
|
+
if (this.stringsMapOrGetter == undefined || key == undefined) {
|
|
21258
|
+
return undefined;
|
|
21259
|
+
}
|
|
21260
|
+
if (typeof this.stringsMapOrGetter === 'function') {
|
|
21261
|
+
return this.stringsMapOrGetter(key);
|
|
21262
|
+
}
|
|
21263
|
+
else {
|
|
21264
|
+
return this.stringsMapOrGetter.get(key);
|
|
21265
|
+
}
|
|
21266
|
+
};
|
|
21267
|
+
/**
|
|
21268
|
+
* @internal
|
|
21269
|
+
* Public only for unit testing.
|
|
21270
|
+
* @returns
|
|
21271
|
+
*/
|
|
21272
|
+
Announce.prototype.getAriaLiveElement = function () {
|
|
21273
|
+
return this.ariaLiveElement;
|
|
21274
|
+
};
|
|
21275
|
+
return Announce;
|
|
21276
|
+
}());
|
|
21277
|
+
exports["default"] = Announce;
|
|
21278
|
+
function formatString(text, formatStrings) {
|
|
21279
|
+
if (text == undefined) {
|
|
21280
|
+
return text;
|
|
21281
|
+
}
|
|
21282
|
+
formatStrings.forEach(function (value, index) {
|
|
21283
|
+
text = text === null || text === void 0 ? void 0 : text.replace("{" + index + "}", value);
|
|
21284
|
+
});
|
|
21285
|
+
return text;
|
|
21286
|
+
}
|
|
21287
|
+
|
|
21288
|
+
|
|
21289
|
+
/***/ }),
|
|
21290
|
+
|
|
21291
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/AnnounceFeatures.ts":
|
|
21292
|
+
/*!*********************************************************************************************!*\
|
|
21293
|
+
!*** ./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/AnnounceFeatures.ts ***!
|
|
21294
|
+
\*********************************************************************************************/
|
|
21295
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21296
|
+
|
|
21297
|
+
"use strict";
|
|
21298
|
+
|
|
21299
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21300
|
+
exports.AnnounceFeatures = void 0;
|
|
21301
|
+
var announceNewListItem_1 = __webpack_require__(/*! ./announceNewListItem */ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceNewListItem.ts");
|
|
21302
|
+
var announceWarningOnLastTableCell_1 = __webpack_require__(/*! ./announceWarningOnLastTableCell */ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceWarningOnLastTableCell.ts");
|
|
21303
|
+
/**
|
|
21304
|
+
* @internal
|
|
21305
|
+
*/
|
|
21306
|
+
exports.AnnounceFeatures = {
|
|
21307
|
+
announceNewListItem: announceNewListItem_1.default,
|
|
21308
|
+
announceWarningOnLastTableCell: announceWarningOnLastTableCell_1.default,
|
|
21309
|
+
};
|
|
21310
|
+
|
|
21311
|
+
|
|
21312
|
+
/***/ }),
|
|
21313
|
+
|
|
21314
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceNewListItem.ts":
|
|
21315
|
+
/*!************************************************************************************************!*\
|
|
21316
|
+
!*** ./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceNewListItem.ts ***!
|
|
21317
|
+
\************************************************************************************************/
|
|
21318
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21319
|
+
|
|
21320
|
+
"use strict";
|
|
21321
|
+
|
|
21322
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21323
|
+
var getAnnounceDataForList_1 = __webpack_require__(/*! ../../../pluginUtils/announceData/getAnnounceDataForList */ "./packages/roosterjs-editor-plugins/lib/pluginUtils/announceData/getAnnounceDataForList.ts");
|
|
21324
|
+
var LIST_SELECTOR = 'OL,UL';
|
|
21325
|
+
var LIST_ITEM_SELECTOR = 'LI';
|
|
21326
|
+
var announceNewListItemNumber = {
|
|
21327
|
+
keys: [13 /* ENTER */],
|
|
21328
|
+
shouldHandle: function (editor) {
|
|
21329
|
+
var li = editor.getElementAtCursor(LIST_ITEM_SELECTOR);
|
|
21330
|
+
var list = editor.getElementAtCursor(LIST_SELECTOR);
|
|
21331
|
+
return (!!(list && li) && (0, getAnnounceDataForList_1.default)(list, li)) || false;
|
|
21332
|
+
},
|
|
21333
|
+
};
|
|
21334
|
+
exports["default"] = announceNewListItemNumber;
|
|
21335
|
+
|
|
21336
|
+
|
|
21337
|
+
/***/ }),
|
|
21338
|
+
|
|
21339
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceWarningOnLastTableCell.ts":
|
|
21340
|
+
/*!***********************************************************************************************************!*\
|
|
21341
|
+
!*** ./packages/roosterjs-editor-plugins/lib/plugins/Announce/features/announceWarningOnLastTableCell.ts ***!
|
|
21342
|
+
\***********************************************************************************************************/
|
|
21343
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21344
|
+
|
|
21345
|
+
"use strict";
|
|
21346
|
+
|
|
21347
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21348
|
+
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
21349
|
+
var TABLE_CELL_SELECTOR = 'td,th';
|
|
21350
|
+
var TABLE_SELECTOR = 'table';
|
|
21351
|
+
var announceWarningOnLastCell = {
|
|
21352
|
+
shouldHandle: function (editor, lastFocusedElement) {
|
|
21353
|
+
var selection = editor.getSelectionRangeEx();
|
|
21354
|
+
return ((selection === null || selection === void 0 ? void 0 : selection.type) == 0 /* Normal */ &&
|
|
21355
|
+
selection.areAllCollapsed &&
|
|
21356
|
+
selection.ranges.length === 1 &&
|
|
21357
|
+
!(0, roosterjs_editor_dom_1.contains)(lastFocusedElement, selection.ranges[0].startContainer, true /*treatSameNodeAsContain*/) &&
|
|
21358
|
+
isLastCell() && {
|
|
21359
|
+
defaultStrings: 3 /* AnnounceOnFocusLastCell */,
|
|
21360
|
+
});
|
|
21361
|
+
function isLastCell() {
|
|
21362
|
+
var table = editor.getElementAtCursor(TABLE_SELECTOR);
|
|
21363
|
+
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(table, 'HTMLTableElement')) {
|
|
21364
|
+
var allCells = table.querySelectorAll(TABLE_CELL_SELECTOR);
|
|
21365
|
+
var focusedCell = editor.getElementAtCursor(TABLE_CELL_SELECTOR);
|
|
21366
|
+
return focusedCell == allCells.item(allCells.length - 1);
|
|
21367
|
+
}
|
|
21368
|
+
return false;
|
|
21369
|
+
}
|
|
21370
|
+
},
|
|
21371
|
+
keys: [9 /* TAB */, 38 /* UP */, 40 /* DOWN */, 37 /* LEFT */, 39 /* RIGHT */],
|
|
21372
|
+
};
|
|
21373
|
+
exports["default"] = announceWarningOnLastCell;
|
|
21374
|
+
|
|
21375
|
+
|
|
21376
|
+
/***/ }),
|
|
21377
|
+
|
|
21378
|
+
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/index.ts":
|
|
21379
|
+
/*!*************************************************************************!*\
|
|
21380
|
+
!*** ./packages/roosterjs-editor-plugins/lib/plugins/Announce/index.ts ***!
|
|
21381
|
+
\*************************************************************************/
|
|
21382
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
21383
|
+
|
|
21384
|
+
"use strict";
|
|
21385
|
+
|
|
21386
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21387
|
+
exports.Announce = void 0;
|
|
21388
|
+
var AnnouncePlugin_1 = __webpack_require__(/*! ./AnnouncePlugin */ "./packages/roosterjs-editor-plugins/lib/plugins/Announce/AnnouncePlugin.ts");
|
|
21389
|
+
Object.defineProperty(exports, "Announce", ({ enumerable: true, get: function () { return AnnouncePlugin_1.default; } }));
|
|
21390
|
+
|
|
21391
|
+
|
|
21080
21392
|
/***/ }),
|
|
21081
21393
|
|
|
21082
21394
|
/***/ "./packages/roosterjs-editor-plugins/lib/plugins/AutoFormat/AutoFormat.ts":
|
|
@@ -21528,7 +21840,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
21528
21840
|
exports.EntityFeatures = void 0;
|
|
21529
21841
|
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
|
|
21530
21842
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
21531
|
-
var roosterjs_editor_dom_2 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
21532
21843
|
/**
|
|
21533
21844
|
* A content edit feature to trigger EntityOperation event with operation "Click" when user
|
|
21534
21845
|
* clicks on a readonly entity.
|
|
@@ -21552,13 +21863,13 @@ var EscapeFromEntityFeature = {
|
|
|
21552
21863
|
},
|
|
21553
21864
|
};
|
|
21554
21865
|
function cacheGetReadonlyEntityElement(event, editor, operation) {
|
|
21555
|
-
var element = (0,
|
|
21866
|
+
var element = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, 'READONLY_ENTITY_ELEMENT', function () {
|
|
21556
21867
|
var node = event.rawEvent.target;
|
|
21557
|
-
var entityElement = node && editor.getElementAtCursor((0,
|
|
21868
|
+
var entityElement = node && editor.getElementAtCursor((0, roosterjs_editor_dom_1.getEntitySelector)(), node);
|
|
21558
21869
|
return entityElement && !entityElement.isContentEditable ? entityElement : null;
|
|
21559
21870
|
});
|
|
21560
21871
|
if (element && operation !== undefined) {
|
|
21561
|
-
var entity = (0,
|
|
21872
|
+
var entity = (0, roosterjs_editor_dom_1.getEntityFromElement)(element);
|
|
21562
21873
|
if (entity) {
|
|
21563
21874
|
editor.triggerPluginEvent(15 /* EntityOperation */, {
|
|
21564
21875
|
operation: operation,
|
|
@@ -21587,7 +21898,7 @@ var EnterBeforeReadonlyEntityFeature = {
|
|
|
21587
21898
|
if (!range) {
|
|
21588
21899
|
return;
|
|
21589
21900
|
}
|
|
21590
|
-
var node =
|
|
21901
|
+
var node = roosterjs_editor_dom_1.Position.getEnd(range).normalize().node;
|
|
21591
21902
|
var br = editor.getDocument().createElement('BR');
|
|
21592
21903
|
(_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(br, node.nextSibling);
|
|
21593
21904
|
var block = editor.getBlockElementAtNode(node);
|
|
@@ -21629,7 +21940,7 @@ var DeleteBeforeEntityFeature = {
|
|
|
21629
21940
|
},
|
|
21630
21941
|
};
|
|
21631
21942
|
function cacheGetNeighborEntityElement(event, editor, isNext, collapseOnly, operation) {
|
|
21632
|
-
var element = (0,
|
|
21943
|
+
var element = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, 'NEIGHBOR_ENTITY_ELEMENT_' + isNext + '_' + collapseOnly, function () {
|
|
21633
21944
|
var _a;
|
|
21634
21945
|
var range = editor.getSelectionRange();
|
|
21635
21946
|
if (!range || (collapseOnly && !range.collapsed)) {
|
|
@@ -21638,7 +21949,7 @@ function cacheGetNeighborEntityElement(event, editor, isNext, collapseOnly, oper
|
|
|
21638
21949
|
var regions = editor.getSelectedRegions();
|
|
21639
21950
|
var regionRoot = (_a = regions[0]) === null || _a === void 0 ? void 0 : _a.rootNode;
|
|
21640
21951
|
range.commonAncestorContainer.normalize();
|
|
21641
|
-
var pos =
|
|
21952
|
+
var pos = roosterjs_editor_dom_1.Position.getEnd(range).normalize();
|
|
21642
21953
|
var isAtBeginOrEnd = pos.offset == 0 || pos.isAtEnd;
|
|
21643
21954
|
var entityNode = null;
|
|
21644
21955
|
if (isAtBeginOrEnd && regionRoot) {
|
|
@@ -21657,12 +21968,12 @@ function cacheGetNeighborEntityElement(event, editor, isNext, collapseOnly, oper
|
|
|
21657
21968
|
node = null;
|
|
21658
21969
|
}
|
|
21659
21970
|
}
|
|
21660
|
-
entityNode = node && editor.getElementAtCursor((0,
|
|
21971
|
+
entityNode = node && editor.getElementAtCursor((0, roosterjs_editor_dom_1.getEntitySelector)(), node);
|
|
21661
21972
|
}
|
|
21662
21973
|
return entityNode;
|
|
21663
21974
|
});
|
|
21664
21975
|
if (element && operation !== undefined) {
|
|
21665
|
-
var entity = (0,
|
|
21976
|
+
var entity = (0, roosterjs_editor_dom_1.getEntityFromElement)(element);
|
|
21666
21977
|
if (entity) {
|
|
21667
21978
|
triggerOperation(entity, editor, operation, event);
|
|
21668
21979
|
}
|
|
@@ -21670,22 +21981,20 @@ function cacheGetNeighborEntityElement(event, editor, isNext, collapseOnly, oper
|
|
|
21670
21981
|
return element;
|
|
21671
21982
|
}
|
|
21672
21983
|
/**
|
|
21673
|
-
* @requires ExperimentalFeatures.InlineEntityReadOnlyDelimiters to be enabled
|
|
21674
21984
|
* Content edit feature to move the cursor from Delimiters around Entities when using Right or Left Arrow Keys
|
|
21675
21985
|
*/
|
|
21676
21986
|
var MoveBetweenDelimitersFeature = {
|
|
21677
21987
|
keys: [39 /* RIGHT */, 37 /* LEFT */],
|
|
21678
21988
|
allowFunctionKeys: true,
|
|
21679
21989
|
shouldHandleEvent: function (event, editor) {
|
|
21680
|
-
if (event.rawEvent.altKey
|
|
21681
|
-
!editor.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */)) {
|
|
21990
|
+
if (event.rawEvent.altKey) {
|
|
21682
21991
|
return false;
|
|
21683
21992
|
}
|
|
21684
21993
|
var element = editor.getElementAtCursor();
|
|
21685
21994
|
if (!element) {
|
|
21686
21995
|
return false;
|
|
21687
21996
|
}
|
|
21688
|
-
var isRTL = (0,
|
|
21997
|
+
var isRTL = (0, roosterjs_editor_dom_1.getComputedStyle)(element, 'direction') === 'rtl';
|
|
21689
21998
|
var shouldCheckBefore = isRTL == (event.rawEvent.which === 37 /* LEFT */);
|
|
21690
21999
|
return getIsDelimiterAtCursor(event, editor, shouldCheckBefore);
|
|
21691
22000
|
},
|
|
@@ -21696,7 +22005,7 @@ var MoveBetweenDelimitersFeature = {
|
|
|
21696
22005
|
return;
|
|
21697
22006
|
}
|
|
21698
22007
|
var _a = getRelatedElements(delimiter, checkBefore, editor), delimiterPair = _a.delimiterPair, entity = _a.entity;
|
|
21699
|
-
if (delimiterPair && entity && (0,
|
|
22008
|
+
if (delimiterPair && entity && (0, roosterjs_editor_dom_1.matchesSelector)(entity, (0, roosterjs_editor_dom_1.getEntitySelector)())) {
|
|
21700
22009
|
event.rawEvent.preventDefault();
|
|
21701
22010
|
editor.runAsync(function () {
|
|
21702
22011
|
var positionType = checkBefore
|
|
@@ -21704,7 +22013,7 @@ var MoveBetweenDelimitersFeature = {
|
|
|
21704
22013
|
? -3 /* After */
|
|
21705
22014
|
: -1 /* End */
|
|
21706
22015
|
: -2 /* Before */;
|
|
21707
|
-
var position = new
|
|
22016
|
+
var position = new roosterjs_editor_dom_1.Position(delimiterPair, positionType);
|
|
21708
22017
|
if (event.rawEvent.shiftKey) {
|
|
21709
22018
|
var selection = delimiterPair.ownerDocument.getSelection();
|
|
21710
22019
|
selection === null || selection === void 0 ? void 0 : selection.extend(position.node, position.offset);
|
|
@@ -21717,15 +22026,11 @@ var MoveBetweenDelimitersFeature = {
|
|
|
21717
22026
|
},
|
|
21718
22027
|
};
|
|
21719
22028
|
/**
|
|
21720
|
-
* @requires ExperimentalFeatures.InlineEntityReadOnlyDelimiters to be enabled
|
|
21721
22029
|
* Content edit Feature to trigger a Delete Entity Operation when one of the Delimiter is about to be removed with DELETE or Backspace
|
|
21722
22030
|
*/
|
|
21723
22031
|
var RemoveEntityBetweenDelimitersFeature = {
|
|
21724
22032
|
keys: [8 /* BACKSPACE */, 46 /* DELETE */],
|
|
21725
22033
|
shouldHandleEvent: function (event, editor) {
|
|
21726
|
-
if (!editor.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */)) {
|
|
21727
|
-
return false;
|
|
21728
|
-
}
|
|
21729
22034
|
var range = editor.getSelectionRange();
|
|
21730
22035
|
if (!(range === null || range === void 0 ? void 0 : range.collapsed)) {
|
|
21731
22036
|
return false;
|
|
@@ -21808,18 +22113,18 @@ function getBlockTraverser(editor, element) {
|
|
|
21808
22113
|
return undefined;
|
|
21809
22114
|
}
|
|
21810
22115
|
var blockElement = (_a = editor.getBlockElementAtNode(element)) === null || _a === void 0 ? void 0 : _a.getStartNode();
|
|
21811
|
-
if (!blockElement || !(0,
|
|
22116
|
+
if (!blockElement || !(0, roosterjs_editor_dom_1.isBlockElement)(blockElement)) {
|
|
21812
22117
|
return undefined;
|
|
21813
22118
|
}
|
|
21814
22119
|
return roosterjs_editor_dom_1.ContentTraverser.createBodyTraverser(blockElement, element);
|
|
21815
22120
|
}
|
|
21816
22121
|
function cacheDelimiter(event, checkBefore, delimiter) {
|
|
21817
|
-
return (0,
|
|
22122
|
+
return (0, roosterjs_editor_dom_1.cacheGetEventData)(event, 'delimiter_cache_key_' + checkBefore, function () { return delimiter; });
|
|
21818
22123
|
}
|
|
21819
22124
|
function cacheEntityBetweenDelimiter(event, editor, checkBefore, entity, operation) {
|
|
21820
|
-
var element = (0,
|
|
22125
|
+
var element = (0, roosterjs_editor_dom_1.cacheGetEventData)(event, 'entity_delimiter_cache_key_' + checkBefore, function () { return entity && editor.getElementAtCursor((0, roosterjs_editor_dom_1.getEntitySelector)(), entity); });
|
|
21821
22126
|
if (element && operation !== undefined) {
|
|
21822
|
-
var entity_1 = (0,
|
|
22127
|
+
var entity_1 = (0, roosterjs_editor_dom_1.getEntityFromElement)(element);
|
|
21823
22128
|
if (entity_1) {
|
|
21824
22129
|
triggerOperation(entity_1, editor, operation, event);
|
|
21825
22130
|
}
|
|
@@ -21833,38 +22138,36 @@ function triggerOperation(entity, editor, operation, event) {
|
|
|
21833
22138
|
rawEvent: event.rawEvent,
|
|
21834
22139
|
entity: entity,
|
|
21835
22140
|
});
|
|
21836
|
-
if (entity.isReadonly &&
|
|
21837
|
-
!(0, roosterjs_editor_dom_2.isBlockElement)(entity.wrapper) &&
|
|
21838
|
-
editor.isFeatureEnabled("InlineEntityReadOnlyDelimiters" /* InlineEntityReadOnlyDelimiters */)) {
|
|
22141
|
+
if (entity.isReadonly && !(0, roosterjs_editor_dom_1.isBlockElement)(entity.wrapper)) {
|
|
21839
22142
|
if (event.rawEvent.defaultPrevented) {
|
|
21840
22143
|
editor.runAsync(function () {
|
|
21841
22144
|
if (!editor.contains(entity.wrapper)) {
|
|
21842
22145
|
removeDelimiters(nextElementSibling, previousElementSibling);
|
|
21843
22146
|
}
|
|
21844
22147
|
else {
|
|
21845
|
-
var _a = (0, tslib_1.__read)((0,
|
|
22148
|
+
var _a = (0, tslib_1.__read)((0, roosterjs_editor_dom_1.addDelimiters)(entity.wrapper), 1), delimiterAfter = _a[0];
|
|
21846
22149
|
if (delimiterAfter) {
|
|
21847
22150
|
editor.select(delimiterAfter, -3 /* After */);
|
|
21848
22151
|
}
|
|
21849
22152
|
}
|
|
21850
22153
|
});
|
|
21851
22154
|
}
|
|
21852
|
-
else if ((0,
|
|
21853
|
-
(0,
|
|
21854
|
-
editor.select((0,
|
|
22155
|
+
else if ((0, roosterjs_editor_dom_1.getDelimiterFromElement)(nextElementSibling) &&
|
|
22156
|
+
(0, roosterjs_editor_dom_1.getDelimiterFromElement)(previousElementSibling)) {
|
|
22157
|
+
editor.select((0, roosterjs_editor_dom_1.createRange)(previousElementSibling, nextElementSibling));
|
|
21855
22158
|
}
|
|
21856
22159
|
}
|
|
21857
22160
|
}
|
|
21858
22161
|
function removeDelimiters(nextElementSibling, previousElementSibling) {
|
|
21859
22162
|
[nextElementSibling, previousElementSibling].forEach(function (sibling) {
|
|
21860
22163
|
var _a;
|
|
21861
|
-
if ((0,
|
|
22164
|
+
if ((0, roosterjs_editor_dom_1.getDelimiterFromElement)(sibling)) {
|
|
21862
22165
|
(_a = sibling === null || sibling === void 0 ? void 0 : sibling.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(sibling);
|
|
21863
22166
|
}
|
|
21864
22167
|
});
|
|
21865
22168
|
}
|
|
21866
22169
|
function cacheGetCheckBefore(event, checkBefore) {
|
|
21867
|
-
return !!(0,
|
|
22170
|
+
return !!(0, roosterjs_editor_dom_1.cacheGetEventData)(event, 'Check_Before', function () { return checkBefore; });
|
|
21868
22171
|
}
|
|
21869
22172
|
function getRelatedElements(delimiter, checkBefore, editor) {
|
|
21870
22173
|
var entity = null;
|
|
@@ -21882,7 +22185,7 @@ function getRelatedElements(delimiter, checkBefore, editor) {
|
|
|
21882
22185
|
var node = element === null || element === void 0 ? void 0 : element.getContainerNode();
|
|
21883
22186
|
return (_a = (node && editor.getElementAtCursor(selector, node))) !== null && _a !== void 0 ? _a : null;
|
|
21884
22187
|
};
|
|
21885
|
-
var entitySelector = (0,
|
|
22188
|
+
var entitySelector = (0, roosterjs_editor_dom_1.getEntitySelector)();
|
|
21886
22189
|
var current = traverser.currentInlineElement;
|
|
21887
22190
|
while (current && (!entity || !delimiterPair)) {
|
|
21888
22191
|
entity = entity || getElementFromInline(current, entitySelector);
|
|
@@ -21923,10 +22226,11 @@ exports.EntityFeatures = {
|
|
|
21923
22226
|
|
|
21924
22227
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21925
22228
|
exports.ListFeatures = void 0;
|
|
22229
|
+
var getAnnounceDataForList_1 = __webpack_require__(/*! ../../../pluginUtils/announceData/getAnnounceDataForList */ "./packages/roosterjs-editor-plugins/lib/pluginUtils/announceData/getAnnounceDataForList.ts");
|
|
21926
22230
|
var getAutoBulletListStyle_1 = __webpack_require__(/*! ../utils/getAutoBulletListStyle */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/utils/getAutoBulletListStyle.ts");
|
|
21927
22231
|
var getAutoNumberingListStyle_1 = __webpack_require__(/*! ../utils/getAutoNumberingListStyle */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/utils/getAutoNumberingListStyle.ts");
|
|
21928
|
-
var roosterjs_editor_api_1 = __webpack_require__(/*! roosterjs-editor-api */ "./packages/roosterjs-editor-api/lib/index.ts");
|
|
21929
22232
|
var roosterjs_editor_dom_1 = __webpack_require__(/*! roosterjs-editor-dom */ "./packages/roosterjs-editor-dom/lib/index.ts");
|
|
22233
|
+
var roosterjs_editor_api_1 = __webpack_require__(/*! roosterjs-editor-api */ "./packages/roosterjs-editor-api/lib/index.ts");
|
|
21930
22234
|
var PREVIOUS_BLOCK_CACHE_KEY = 'previousBlock';
|
|
21931
22235
|
var NEXT_BLOCK_CACHE_KEY = 'nextBlock';
|
|
21932
22236
|
var ListStyleDefinitionMetadata = (0, roosterjs_editor_dom_1.createObjectDefinition)({
|
|
@@ -21947,7 +22251,13 @@ var handleIndentationEvent = function (indenting) { return function (event, edit
|
|
|
21947
22251
|
var isRTL = event.rawEvent.keyCode !== 9 /* TAB */ &&
|
|
21948
22252
|
(currentElement = editor.getElementAtCursor()) &&
|
|
21949
22253
|
(0, roosterjs_editor_dom_1.getComputedStyle)(currentElement, 'direction') == 'rtl';
|
|
21950
|
-
(
|
|
22254
|
+
editor.addUndoSnapshot(function () {
|
|
22255
|
+
(0, roosterjs_editor_api_1.setIndentation)(editor, isRTL == indenting ? 1 /* Decrease */ : 0 /* Increase */);
|
|
22256
|
+
}, "Format" /* Format */, false /* canUndoByBackspace */, {
|
|
22257
|
+
getAnnounceData: function () {
|
|
22258
|
+
return (0, getAnnounceDataForList_1.default)(editor.getElementAtCursor('OL,UL'), editor.getElementAtCursor('LI'));
|
|
22259
|
+
},
|
|
22260
|
+
});
|
|
21951
22261
|
event.rawEvent.preventDefault();
|
|
21952
22262
|
}; };
|
|
21953
22263
|
/**
|
|
@@ -23113,6 +23423,7 @@ function insertTab(editor, event) {
|
|
|
23113
23423
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
23114
23424
|
var tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.mjs");
|
|
23115
23425
|
var autoLinkFeatures_1 = __webpack_require__(/*! ./features/autoLinkFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/autoLinkFeatures.ts");
|
|
23426
|
+
var codeFeatures_1 = __webpack_require__(/*! ./features/codeFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/codeFeatures.ts");
|
|
23116
23427
|
var cursorFeatures_1 = __webpack_require__(/*! ./features/cursorFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/cursorFeatures.ts");
|
|
23117
23428
|
var entityFeatures_1 = __webpack_require__(/*! ./features/entityFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts");
|
|
23118
23429
|
var listFeatures_1 = __webpack_require__(/*! ./features/listFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/listFeatures.ts");
|
|
@@ -23122,7 +23433,6 @@ var shortcutFeatures_1 = __webpack_require__(/*! ./features/shortcutFeatures */
|
|
|
23122
23433
|
var structuredNodeFeatures_1 = __webpack_require__(/*! ./features/structuredNodeFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/structuredNodeFeatures.ts");
|
|
23123
23434
|
var tableFeatures_1 = __webpack_require__(/*! ./features/tableFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/tableFeatures.ts");
|
|
23124
23435
|
var textFeatures_1 = __webpack_require__(/*! ./features/textFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/textFeatures.ts");
|
|
23125
|
-
var codeFeatures_1 = __webpack_require__(/*! ./features/codeFeatures */ "./packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/codeFeatures.ts");
|
|
23126
23436
|
var allFeatures = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, listFeatures_1.ListFeatures), quoteFeatures_1.QuoteFeatures), tableFeatures_1.TableFeatures), structuredNodeFeatures_1.StructuredNodeFeatures), autoLinkFeatures_1.AutoLinkFeatures), shortcutFeatures_1.ShortcutFeatures), cursorFeatures_1.CursorFeatures), markdownFeatures_1.MarkdownFeatures), entityFeatures_1.EntityFeatures), textFeatures_1.TextFeatures), codeFeatures_1.CodeFeatures);
|
|
23127
23437
|
/**
|
|
23128
23438
|
* Get all content edit features provided by roosterjs
|
|
@@ -24059,6 +24369,7 @@ var DefaultOptions = {
|
|
|
24059
24369
|
disableRotate: false,
|
|
24060
24370
|
disableSideResize: false,
|
|
24061
24371
|
onSelectState: 7 /* ResizeAndRotate */,
|
|
24372
|
+
applyChangesOnMouseUp: false,
|
|
24062
24373
|
};
|
|
24063
24374
|
/**
|
|
24064
24375
|
* Map the image edit operation to a function that returns editing elements HTML to help
|
|
@@ -24131,12 +24442,21 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24131
24442
|
* Remove the temp wrapper of the image
|
|
24132
24443
|
*/
|
|
24133
24444
|
this.removeWrapper = function () {
|
|
24445
|
+
var _a;
|
|
24134
24446
|
if (_this.shadowSpan) {
|
|
24135
24447
|
(0, roosterjs_editor_dom_1.unwrap)(_this.shadowSpan);
|
|
24136
24448
|
}
|
|
24449
|
+
if (_this.options.applyChangesOnMouseUp) {
|
|
24450
|
+
(_a = _this.wrapper) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseup', _this.changesWhenMouseUp, true /* useCapture*/);
|
|
24451
|
+
}
|
|
24137
24452
|
_this.wrapper = null;
|
|
24138
24453
|
_this.shadowSpan = null;
|
|
24139
24454
|
};
|
|
24455
|
+
this.changesWhenMouseUp = function () {
|
|
24456
|
+
if (_this.editor && _this.image && _this.editInfo && _this.lastSrc && _this.clonedImage) {
|
|
24457
|
+
(0, applyChange_1.default)(_this.editor, _this.image, _this.editInfo, _this.lastSrc, _this.wasResized, _this.clonedImage, _this.options.applyChangesOnMouseUp);
|
|
24458
|
+
}
|
|
24459
|
+
};
|
|
24140
24460
|
/**
|
|
24141
24461
|
* Update image edit elements to reflect current editing result
|
|
24142
24462
|
* @param context
|
|
@@ -24254,7 +24574,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24254
24574
|
* @param e PluginEvent object
|
|
24255
24575
|
*/
|
|
24256
24576
|
ImageEdit.prototype.onPluginEvent = function (e) {
|
|
24257
|
-
var _a
|
|
24577
|
+
var _a;
|
|
24258
24578
|
switch (e.eventType) {
|
|
24259
24579
|
case 22 /* SelectionChanged */:
|
|
24260
24580
|
if (e.selectionRangeEx &&
|
|
@@ -24275,10 +24595,10 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24275
24595
|
}
|
|
24276
24596
|
break;
|
|
24277
24597
|
case 6 /* MouseUp */:
|
|
24278
|
-
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
|
|
24598
|
+
if (this.editor && this.image && this.shadowSpan) {
|
|
24599
|
+
// When mouse up, if the image and the shadow span exists, the editing mode is on.
|
|
24600
|
+
// To make sure the selection did not jump to the shadow root, reselect the image.
|
|
24601
|
+
this.editor.select(this.image);
|
|
24282
24602
|
}
|
|
24283
24603
|
break;
|
|
24284
24604
|
case 0 /* KeyDown */:
|
|
@@ -24290,7 +24610,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24290
24610
|
break;
|
|
24291
24611
|
case 8 /* ExtractContentWithDom */:
|
|
24292
24612
|
// When extract content, remove all image info since they may not be valid when load the content again
|
|
24293
|
-
if ((
|
|
24613
|
+
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.imageSelector) {
|
|
24294
24614
|
(0, roosterjs_editor_dom_1.toArray)(e.clonedRoot.querySelectorAll(this.options.imageSelector)).forEach(function (img) {
|
|
24295
24615
|
(0, editInfo_1.deleteEditInfo)(img);
|
|
24296
24616
|
});
|
|
@@ -24421,6 +24741,7 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24421
24741
|
this.clonedImage = this.image.cloneNode(true);
|
|
24422
24742
|
this.clonedImage.removeAttribute('id');
|
|
24423
24743
|
this.clonedImage.style.removeProperty('max-width');
|
|
24744
|
+
this.clonedImage.style.removeProperty('max-height');
|
|
24424
24745
|
this.clonedImage.style.width = this.editInfo.widthPx + 'px';
|
|
24425
24746
|
this.clonedImage.style.height = this.editInfo.heightPx + 'px';
|
|
24426
24747
|
this.wrapper = (0, roosterjs_editor_dom_1.createElement)(6 /* ImageEditWrapper */, this.image.ownerDocument);
|
|
@@ -24458,6 +24779,10 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24458
24779
|
this.insertImageWrapper(this.wrapper);
|
|
24459
24780
|
}
|
|
24460
24781
|
};
|
|
24782
|
+
/**
|
|
24783
|
+
* EXPORTED FOR TESTING PURPOSES ONLY
|
|
24784
|
+
* @param wrapper
|
|
24785
|
+
*/
|
|
24461
24786
|
ImageEdit.prototype.insertImageWrapper = function (wrapper) {
|
|
24462
24787
|
if (this.image) {
|
|
24463
24788
|
this.shadowSpan = (0, roosterjs_editor_dom_1.wrap)(this.image, 'span');
|
|
@@ -24467,6 +24792,9 @@ var ImageEdit = /** @class */ (function () {
|
|
|
24467
24792
|
});
|
|
24468
24793
|
this.shadowSpan.style.verticalAlign = 'bottom';
|
|
24469
24794
|
wrapper.style.fontSize = '24px';
|
|
24795
|
+
if (this.options.applyChangesOnMouseUp) {
|
|
24796
|
+
wrapper.addEventListener('mouseup', this.changesWhenMouseUp, true /* useCapture*/);
|
|
24797
|
+
}
|
|
24470
24798
|
shadowRoot.appendChild(wrapper);
|
|
24471
24799
|
}
|
|
24472
24800
|
}
|
|
@@ -24825,7 +25153,7 @@ var editInfo_1 = __webpack_require__(/*! ./editInfo */ "./packages/roosterjs-edi
|
|
|
24825
25153
|
* @param wasResizedOrCropped if the image was resized or cropped apply the new image dimensions
|
|
24826
25154
|
* @param editingImage (optional) Image in editing state
|
|
24827
25155
|
*/
|
|
24828
|
-
function applyChange(editor, image, editInfo, previousSrc, wasResizedOrCropped, editingImage) {
|
|
25156
|
+
function applyChange(editor, image, editInfo, previousSrc, wasResizedOrCropped, editingImage, applyChangesOnMouseUp) {
|
|
24829
25157
|
var newSrc = '';
|
|
24830
25158
|
var initEditInfo = (0, editInfo_1.getEditInfoFromImage)(editingImage !== null && editingImage !== void 0 ? editingImage : image);
|
|
24831
25159
|
var state = (0, checkEditInfoState_1.default)(editInfo, initEditInfo);
|
|
@@ -24856,6 +25184,11 @@ function applyChange(editor, image, editInfo, previousSrc, wasResizedOrCropped,
|
|
|
24856
25184
|
});
|
|
24857
25185
|
newSrc = event_1.newSrc;
|
|
24858
25186
|
}
|
|
25187
|
+
else if (applyChangesOnMouseUp) {
|
|
25188
|
+
editor.triggerPluginEvent(7 /* ContentChanged */, {
|
|
25189
|
+
source: "ImageResize" /* ImageResize */,
|
|
25190
|
+
});
|
|
25191
|
+
}
|
|
24859
25192
|
if (newSrc == editInfo.src) {
|
|
24860
25193
|
// If newSrc is the same with original one, it means there is only size change, but no rotation, no cropping,
|
|
24861
25194
|
// so we don't need to keep edit info, we can delete it
|
|
@@ -24876,6 +25209,7 @@ function applyChange(editor, image, editInfo, previousSrc, wasResizedOrCropped,
|
|
|
24876
25209
|
image.style.removeProperty('width');
|
|
24877
25210
|
image.style.removeProperty('height');
|
|
24878
25211
|
image.style.removeProperty('max-width');
|
|
25212
|
+
image.style.removeProperty('max-height');
|
|
24879
25213
|
}
|
|
24880
25214
|
}
|
|
24881
25215
|
exports["default"] = applyChange;
|
|
@@ -27895,7 +28229,7 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
27895
28229
|
}
|
|
27896
28230
|
};
|
|
27897
28231
|
PickerPlugin.prototype.onKeyDownEvent = function (event) {
|
|
27898
|
-
var _a
|
|
28232
|
+
var _a;
|
|
27899
28233
|
var keyboardEvent = event.rawEvent;
|
|
27900
28234
|
if (this.isSuggesting) {
|
|
27901
28235
|
if (keyboardEvent.key == ESC_CHAR_CODE) {
|
|
@@ -27944,9 +28278,11 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
27944
28278
|
else if (keyboardEvent.key == DELETE_CHAR_CODE) {
|
|
27945
28279
|
var searcher = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.getContentSearcherOfCursor(event);
|
|
27946
28280
|
if (searcher) {
|
|
27947
|
-
var
|
|
27948
|
-
|
|
28281
|
+
var inlineElementAfter = searcher.getInlineElementAfter();
|
|
28282
|
+
var nodeAfterCursor = inlineElementAfter
|
|
28283
|
+
? inlineElementAfter.getContainerNode()
|
|
27949
28284
|
: null;
|
|
28285
|
+
nodeAfterCursor = this.getParentNodeIfTextNode(nodeAfterCursor);
|
|
27950
28286
|
var nodeId = nodeAfterCursor ? this.getIdValue(nodeAfterCursor) : null;
|
|
27951
28287
|
if (nodeId &&
|
|
27952
28288
|
nodeId.indexOf(this.pickerOptions.elementIdPrefix) == 0 &&
|
|
@@ -27959,6 +28295,12 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
27959
28295
|
}
|
|
27960
28296
|
}
|
|
27961
28297
|
};
|
|
28298
|
+
PickerPlugin.prototype.getParentNodeIfTextNode = function (node) {
|
|
28299
|
+
if ((0, roosterjs_editor_dom_1.safeInstanceOf)(node, 'Text')) {
|
|
28300
|
+
node = node.parentNode;
|
|
28301
|
+
}
|
|
28302
|
+
return node;
|
|
28303
|
+
};
|
|
27962
28304
|
PickerPlugin.prototype.onAndroidInputEvent = function (event) {
|
|
27963
28305
|
this.newInputLength = this.calcInputLength(event);
|
|
27964
28306
|
if (this.newInputLength < this.currentInputLength ||
|
|
@@ -27982,9 +28324,8 @@ var PickerPlugin = /** @class */ (function () {
|
|
|
27982
28324
|
return false;
|
|
27983
28325
|
}
|
|
27984
28326
|
var inlineElementBefore = searcher.getInlineElementBefore();
|
|
27985
|
-
var nodeBeforeCursor = inlineElementBefore
|
|
27986
|
-
|
|
27987
|
-
: null;
|
|
28327
|
+
var nodeBeforeCursor = inlineElementBefore ? inlineElementBefore.getContainerNode() : null;
|
|
28328
|
+
nodeBeforeCursor = this.getParentNodeIfTextNode(nodeBeforeCursor);
|
|
27988
28329
|
var nodeId = nodeBeforeCursor ? this.getIdValue(nodeBeforeCursor) : null;
|
|
27989
28330
|
var inlineElementAfter = searcher.getInlineElementAfter();
|
|
27990
28331
|
if (nodeBeforeCursor &&
|
|
@@ -31419,6 +31760,16 @@ var CompatibleExperimentalFeatures;
|
|
|
31419
31760
|
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
31420
31761
|
*/
|
|
31421
31762
|
CompatibleExperimentalFeatures["AutoFormatList"] = "AutoFormatList";
|
|
31763
|
+
/**
|
|
31764
|
+
* @deprecated This feature is always enabled
|
|
31765
|
+
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
31766
|
+
*/
|
|
31767
|
+
CompatibleExperimentalFeatures["InlineEntityReadOnlyDelimiters"] = "InlineEntityReadOnlyDelimiters";
|
|
31768
|
+
/**
|
|
31769
|
+
* @deprecated This feature is always enabled
|
|
31770
|
+
* Paste with Content model
|
|
31771
|
+
*/
|
|
31772
|
+
CompatibleExperimentalFeatures["ContentModelPaste"] = "ContentModelPaste";
|
|
31422
31773
|
//#endregion
|
|
31423
31774
|
/**
|
|
31424
31775
|
* Provide additional Tab Key Features. Requires Text Features Content Editable Features
|
|
@@ -31435,14 +31786,6 @@ var CompatibleExperimentalFeatures;
|
|
|
31435
31786
|
* Delete table with Backspace key with the whole was selected with table selector
|
|
31436
31787
|
*/
|
|
31437
31788
|
CompatibleExperimentalFeatures["DeleteTableWithBackspace"] = "DeleteTableWithBackspace";
|
|
31438
|
-
/**
|
|
31439
|
-
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
31440
|
-
*/
|
|
31441
|
-
CompatibleExperimentalFeatures["InlineEntityReadOnlyDelimiters"] = "InlineEntityReadOnlyDelimiters";
|
|
31442
|
-
/**
|
|
31443
|
-
* Paste with Content model
|
|
31444
|
-
*/
|
|
31445
|
-
CompatibleExperimentalFeatures["ContentModelPaste"] = "ContentModelPaste";
|
|
31446
31789
|
/**
|
|
31447
31790
|
* Disable list chain functionality
|
|
31448
31791
|
*/
|
|
@@ -31673,6 +32016,43 @@ var CompatibleKeys;
|
|
|
31673
32016
|
})(CompatibleKeys = exports.CompatibleKeys || (exports.CompatibleKeys = {}));
|
|
31674
32017
|
|
|
31675
32018
|
|
|
32019
|
+
/***/ }),
|
|
32020
|
+
|
|
32021
|
+
/***/ "./packages/roosterjs-editor-types/lib/compatibleEnum/KnownAnnounceStrings.ts":
|
|
32022
|
+
/*!************************************************************************************!*\
|
|
32023
|
+
!*** ./packages/roosterjs-editor-types/lib/compatibleEnum/KnownAnnounceStrings.ts ***!
|
|
32024
|
+
\************************************************************************************/
|
|
32025
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
32026
|
+
|
|
32027
|
+
"use strict";
|
|
32028
|
+
|
|
32029
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
32030
|
+
exports.CompatibleKnownAnnounceStrings = void 0;
|
|
32031
|
+
/**
|
|
32032
|
+
* Known announce strings
|
|
32033
|
+
*/
|
|
32034
|
+
var CompatibleKnownAnnounceStrings;
|
|
32035
|
+
(function (CompatibleKnownAnnounceStrings) {
|
|
32036
|
+
/**
|
|
32037
|
+
* String announced for a list item in a OL List
|
|
32038
|
+
* @example
|
|
32039
|
+
* Auto corrected, {0}
|
|
32040
|
+
* Where &lcub0&rcub is the new list item bullet
|
|
32041
|
+
*/
|
|
32042
|
+
CompatibleKnownAnnounceStrings[CompatibleKnownAnnounceStrings["AnnounceListItemNumbering"] = 1] = "AnnounceListItemNumbering";
|
|
32043
|
+
/**
|
|
32044
|
+
* String announced for a list item in a UL List
|
|
32045
|
+
* @example
|
|
32046
|
+
* Auto corrected bullet
|
|
32047
|
+
*/
|
|
32048
|
+
CompatibleKnownAnnounceStrings[CompatibleKnownAnnounceStrings["AnnounceListItemBullet"] = 2] = "AnnounceListItemBullet";
|
|
32049
|
+
/**
|
|
32050
|
+
* String announced when cursor is moved to the last cell in a table
|
|
32051
|
+
*/
|
|
32052
|
+
CompatibleKnownAnnounceStrings[CompatibleKnownAnnounceStrings["AnnounceOnFocusLastCell"] = 3] = "AnnounceOnFocusLastCell";
|
|
32053
|
+
})(CompatibleKnownAnnounceStrings = exports.CompatibleKnownAnnounceStrings || (exports.CompatibleKnownAnnounceStrings = {}));
|
|
32054
|
+
|
|
32055
|
+
|
|
31676
32056
|
/***/ }),
|
|
31677
32057
|
|
|
31678
32058
|
/***/ "./packages/roosterjs-editor-types/lib/compatibleEnum/KnownCreateElementDataIndex.ts":
|
|
@@ -32465,7 +32845,7 @@ var CompatibleTableOperation;
|
|
|
32465
32845
|
"use strict";
|
|
32466
32846
|
|
|
32467
32847
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
32468
|
-
exports.CompatibleTableOperation = exports.CompatibleTableBorderFormat = exports.CompatibleSelectionRangeTypes = exports.CompatibleRegionType = exports.CompatibleQueryScope = exports.CompatiblePositionType = exports.CompatiblePluginEventType = exports.CompatiblePasteType = exports.CompatibleNumberingListType = exports.CompatibleNodeType = exports.CompatibleListType = exports.CompatibleKnownPasteSourceType = exports.CompatibleKnownCreateElementDataIndex = exports.CompatibleKeys = exports.CompatibleIndentation = exports.CompatibleImageEditOperation = exports.CompatibleGetContentMode = exports.CompatibleFontSizeChange = exports.CompatibleExperimentalFeatures = exports.CompatibleEntityOperation = exports.CompatibleEntityClasses = exports.CompatibleDocumentPosition = exports.CompatibleDocumentCommand = exports.CompatibleDirection = exports.CompatibleDelimiterClasses = exports.CompatibleDefinitionType = exports.CompatibleDarkModeDatasetNames = exports.CompatibleContentType = exports.CompatibleContentTypePrefix = exports.CompatibleContentPosition = exports.CompatibleColorTransformDirection = exports.CompatibleClearFormatMode = exports.CompatibleChangeSource = exports.CompatibleCapitalization = exports.CompatibleBulletListType = exports.CompatibleAlignment = void 0;
|
|
32848
|
+
exports.CompatibleTableOperation = exports.CompatibleTableBorderFormat = exports.CompatibleSelectionRangeTypes = exports.CompatibleRegionType = exports.CompatibleQueryScope = exports.CompatiblePositionType = exports.CompatiblePluginEventType = exports.CompatiblePasteType = exports.CompatibleNumberingListType = exports.CompatibleNodeType = exports.CompatibleListType = exports.CompatibleKnownPasteSourceType = exports.CompatibleKnownCreateElementDataIndex = exports.CompatibleKnownAnnounceStrings = exports.CompatibleKeys = exports.CompatibleIndentation = exports.CompatibleImageEditOperation = exports.CompatibleGetContentMode = exports.CompatibleFontSizeChange = exports.CompatibleExperimentalFeatures = exports.CompatibleEntityOperation = exports.CompatibleEntityClasses = exports.CompatibleDocumentPosition = exports.CompatibleDocumentCommand = exports.CompatibleDirection = exports.CompatibleDelimiterClasses = exports.CompatibleDefinitionType = exports.CompatibleDarkModeDatasetNames = exports.CompatibleContentType = exports.CompatibleContentTypePrefix = exports.CompatibleContentPosition = exports.CompatibleColorTransformDirection = exports.CompatibleClearFormatMode = exports.CompatibleChangeSource = exports.CompatibleCapitalization = exports.CompatibleBulletListType = exports.CompatibleAlignment = void 0;
|
|
32469
32849
|
var Alignment_1 = __webpack_require__(/*! ./Alignment */ "./packages/roosterjs-editor-types/lib/compatibleEnum/Alignment.ts");
|
|
32470
32850
|
Object.defineProperty(exports, "CompatibleAlignment", ({ enumerable: true, get: function () { return Alignment_1.CompatibleAlignment; } }));
|
|
32471
32851
|
var BulletListType_1 = __webpack_require__(/*! ./BulletListType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/BulletListType.ts");
|
|
@@ -32511,6 +32891,8 @@ var Indentation_1 = __webpack_require__(/*! ./Indentation */ "./packages/rooster
|
|
|
32511
32891
|
Object.defineProperty(exports, "CompatibleIndentation", ({ enumerable: true, get: function () { return Indentation_1.CompatibleIndentation; } }));
|
|
32512
32892
|
var Keys_1 = __webpack_require__(/*! ./Keys */ "./packages/roosterjs-editor-types/lib/compatibleEnum/Keys.ts");
|
|
32513
32893
|
Object.defineProperty(exports, "CompatibleKeys", ({ enumerable: true, get: function () { return Keys_1.CompatibleKeys; } }));
|
|
32894
|
+
var KnownAnnounceStrings_1 = __webpack_require__(/*! ./KnownAnnounceStrings */ "./packages/roosterjs-editor-types/lib/compatibleEnum/KnownAnnounceStrings.ts");
|
|
32895
|
+
Object.defineProperty(exports, "CompatibleKnownAnnounceStrings", ({ enumerable: true, get: function () { return KnownAnnounceStrings_1.CompatibleKnownAnnounceStrings; } }));
|
|
32514
32896
|
var KnownCreateElementDataIndex_1 = __webpack_require__(/*! ./KnownCreateElementDataIndex */ "./packages/roosterjs-editor-types/lib/compatibleEnum/KnownCreateElementDataIndex.ts");
|
|
32515
32897
|
Object.defineProperty(exports, "CompatibleKnownCreateElementDataIndex", ({ enumerable: true, get: function () { return KnownCreateElementDataIndex_1.CompatibleKnownCreateElementDataIndex; } }));
|
|
32516
32898
|
var KnownPasteSourceType_1 = __webpack_require__(/*! ./KnownPasteSourceType */ "./packages/roosterjs-editor-types/lib/compatibleEnum/KnownPasteSourceType.ts");
|
|
@@ -33589,6 +33971,16 @@ var ExperimentalFeatures;
|
|
|
33589
33971
|
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
33590
33972
|
*/
|
|
33591
33973
|
ExperimentalFeatures["AutoFormatList"] = "AutoFormatList";
|
|
33974
|
+
/**
|
|
33975
|
+
* @deprecated This feature is always enabled
|
|
33976
|
+
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
33977
|
+
*/
|
|
33978
|
+
ExperimentalFeatures["InlineEntityReadOnlyDelimiters"] = "InlineEntityReadOnlyDelimiters";
|
|
33979
|
+
/**
|
|
33980
|
+
* @deprecated This feature is always enabled
|
|
33981
|
+
* Paste with Content model
|
|
33982
|
+
*/
|
|
33983
|
+
ExperimentalFeatures["ContentModelPaste"] = "ContentModelPaste";
|
|
33592
33984
|
//#endregion
|
|
33593
33985
|
/**
|
|
33594
33986
|
* Provide additional Tab Key Features. Requires Text Features Content Editable Features
|
|
@@ -33605,14 +33997,6 @@ var ExperimentalFeatures;
|
|
|
33605
33997
|
* Delete table with Backspace key with the whole was selected with table selector
|
|
33606
33998
|
*/
|
|
33607
33999
|
ExperimentalFeatures["DeleteTableWithBackspace"] = "DeleteTableWithBackspace";
|
|
33608
|
-
/**
|
|
33609
|
-
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
33610
|
-
*/
|
|
33611
|
-
ExperimentalFeatures["InlineEntityReadOnlyDelimiters"] = "InlineEntityReadOnlyDelimiters";
|
|
33612
|
-
/**
|
|
33613
|
-
* Paste with Content model
|
|
33614
|
-
*/
|
|
33615
|
-
ExperimentalFeatures["ContentModelPaste"] = "ContentModelPaste";
|
|
33616
34000
|
/**
|
|
33617
34001
|
* Disable list chain functionality
|
|
33618
34002
|
*/
|
|
@@ -33843,6 +34227,43 @@ var Keys;
|
|
|
33843
34227
|
})(Keys = exports.Keys || (exports.Keys = {}));
|
|
33844
34228
|
|
|
33845
34229
|
|
|
34230
|
+
/***/ }),
|
|
34231
|
+
|
|
34232
|
+
/***/ "./packages/roosterjs-editor-types/lib/enum/KnownAnnounceStrings.ts":
|
|
34233
|
+
/*!**************************************************************************!*\
|
|
34234
|
+
!*** ./packages/roosterjs-editor-types/lib/enum/KnownAnnounceStrings.ts ***!
|
|
34235
|
+
\**************************************************************************/
|
|
34236
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
34237
|
+
|
|
34238
|
+
"use strict";
|
|
34239
|
+
|
|
34240
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34241
|
+
exports.KnownAnnounceStrings = void 0;
|
|
34242
|
+
/**
|
|
34243
|
+
* Known announce strings
|
|
34244
|
+
*/
|
|
34245
|
+
var KnownAnnounceStrings;
|
|
34246
|
+
(function (KnownAnnounceStrings) {
|
|
34247
|
+
/**
|
|
34248
|
+
* String announced for a list item in a OL List
|
|
34249
|
+
* @example
|
|
34250
|
+
* Auto corrected, {0}
|
|
34251
|
+
* Where &lcub0&rcub is the new list item bullet
|
|
34252
|
+
*/
|
|
34253
|
+
KnownAnnounceStrings[KnownAnnounceStrings["AnnounceListItemNumbering"] = 1] = "AnnounceListItemNumbering";
|
|
34254
|
+
/**
|
|
34255
|
+
* String announced for a list item in a UL List
|
|
34256
|
+
* @example
|
|
34257
|
+
* Auto corrected bullet
|
|
34258
|
+
*/
|
|
34259
|
+
KnownAnnounceStrings[KnownAnnounceStrings["AnnounceListItemBullet"] = 2] = "AnnounceListItemBullet";
|
|
34260
|
+
/**
|
|
34261
|
+
* String announced when cursor is moved to the last cell in a table
|
|
34262
|
+
*/
|
|
34263
|
+
KnownAnnounceStrings[KnownAnnounceStrings["AnnounceOnFocusLastCell"] = 3] = "AnnounceOnFocusLastCell";
|
|
34264
|
+
})(KnownAnnounceStrings = exports.KnownAnnounceStrings || (exports.KnownAnnounceStrings = {}));
|
|
34265
|
+
|
|
34266
|
+
|
|
33846
34267
|
/***/ }),
|
|
33847
34268
|
|
|
33848
34269
|
/***/ "./packages/roosterjs-editor-types/lib/enum/KnownCreateElementDataIndex.ts":
|
|
@@ -34635,7 +35056,9 @@ var TableOperation;
|
|
|
34635
35056
|
"use strict";
|
|
34636
35057
|
|
|
34637
35058
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34638
|
-
exports.PasteType = exports.DefinitionType = exports.BulletListType = exports.NumberingListType = exports.SelectionRangeTypes = exports.PluginEventType = exports.TableBorderFormat = exports.KnownPasteSourceType = exports.KnownCreateElementDataIndex = exports.ClearFormatMode = exports.ImageEditOperation = exports.TableOperation = exports.RegionType = exports.QueryScope = exports.PositionType = exports.ListType = exports.Capitalization = exports.Indentation = exports.GetContentMode = exports.FontSizeChange = exports.ExperimentalFeatures = exports.EntityOperation = exports.EntityClasses = exports.Direction = exports.DelimiterClasses = exports.DarkModeDatasetNames = exports.ContentPosition = exports.ColorTransformDirection = exports.ChangeSource = exports.Alignment = exports.ContentType = exports.ContentTypePrefix = exports.NodeType = exports.Keys = exports.DocumentPosition = exports.DocumentCommand = void 0;
|
|
35059
|
+
exports.PasteType = exports.DefinitionType = exports.BulletListType = exports.NumberingListType = exports.SelectionRangeTypes = exports.PluginEventType = exports.TableBorderFormat = exports.KnownPasteSourceType = exports.KnownCreateElementDataIndex = exports.ClearFormatMode = exports.ImageEditOperation = exports.TableOperation = exports.RegionType = exports.QueryScope = exports.PositionType = exports.ListType = exports.Capitalization = exports.Indentation = exports.GetContentMode = exports.FontSizeChange = exports.ExperimentalFeatures = exports.EntityOperation = exports.EntityClasses = exports.Direction = exports.DelimiterClasses = exports.DarkModeDatasetNames = exports.ContentPosition = exports.ColorTransformDirection = exports.ChangeSource = exports.Alignment = exports.ContentType = exports.ContentTypePrefix = exports.NodeType = exports.Keys = exports.DocumentPosition = exports.DocumentCommand = exports.KnownAnnounceStrings = void 0;
|
|
35060
|
+
var KnownAnnounceStrings_1 = __webpack_require__(/*! ./KnownAnnounceStrings */ "./packages/roosterjs-editor-types/lib/enum/KnownAnnounceStrings.ts");
|
|
35061
|
+
Object.defineProperty(exports, "KnownAnnounceStrings", ({ enumerable: true, get: function () { return KnownAnnounceStrings_1.KnownAnnounceStrings; } }));
|
|
34639
35062
|
var DocumentCommand_1 = __webpack_require__(/*! ./DocumentCommand */ "./packages/roosterjs-editor-types/lib/enum/DocumentCommand.ts");
|
|
34640
35063
|
Object.defineProperty(exports, "DocumentCommand", ({ enumerable: true, get: function () { return DocumentCommand_1.DocumentCommand; } }));
|
|
34641
35064
|
var DocumentPosition_1 = __webpack_require__(/*! ./DocumentPosition */ "./packages/roosterjs-editor-types/lib/enum/DocumentPosition.ts");
|
|
@@ -34779,9 +35202,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
34779
35202
|
"use strict";
|
|
34780
35203
|
|
|
34781
35204
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
35205
|
+
var roosterjs_editor_plugins_1 = __webpack_require__(/*! roosterjs-editor-plugins */ "./packages/roosterjs-editor-plugins/lib/index.ts");
|
|
34782
35206
|
var roosterjs_editor_core_1 = __webpack_require__(/*! roosterjs-editor-core */ "./packages/roosterjs-editor-core/lib/index.ts");
|
|
34783
35207
|
var roosterjs_color_utils_1 = __webpack_require__(/*! roosterjs-color-utils */ "./packages/roosterjs-color-utils/lib/index.ts");
|
|
34784
|
-
var roosterjs_editor_plugins_1 = __webpack_require__(/*! roosterjs-editor-plugins */ "./packages/roosterjs-editor-plugins/lib/index.ts");
|
|
34785
35208
|
/**
|
|
34786
35209
|
* Create an editor instance with most common options
|
|
34787
35210
|
* @param contentDiv The html div element needed for creating the editor
|