Socket
Socket
Sign inDemoInstall

roosterjs-content-model-api

Package Overview
Dependencies
4
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.25.0 to 0.26.0

lib-amd/modelApi/table/clearSelectedCells.d.ts

5

lib-amd/index.d.ts

@@ -43,2 +43,7 @@ export { default as insertTable } from './publicApi/table/insertTable';

export { default as insertEntity } from './publicApi/entity/insertEntity';
export { insertTableRow } from './modelApi/table/insertTableRow';
export { insertTableColumn } from './modelApi/table/insertTableColumn';
export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
export { setListType } from './modelApi/list/setListType';
export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
export { setModelIndentation } from './modelApi/block/setModelIndentation';

9

lib-amd/index.js

@@ -1,5 +0,5 @@

define(["require", "exports", "./publicApi/table/insertTable", "./publicApi/table/formatTable", "./publicApi/table/setTableCellShade", "./publicApi/table/editTable", "./publicApi/table/applyTableBorderFormat", "./publicApi/list/toggleBullet", "./publicApi/list/toggleNumbering", "./publicApi/segment/toggleBold", "./publicApi/segment/toggleItalic", "./publicApi/segment/toggleUnderline", "./publicApi/segment/toggleStrikethrough", "./publicApi/segment/toggleSubscript", "./publicApi/segment/toggleSuperscript", "./publicApi/segment/setBackgroundColor", "./publicApi/segment/setFontName", "./publicApi/segment/setFontSize", "./publicApi/segment/setTextColor", "./publicApi/segment/changeFontSize", "./publicApi/segment/applySegmentFormat", "./publicApi/segment/changeCapitalization", "./publicApi/image/insertImage", "./publicApi/list/setListStyle", "./publicApi/list/setListStartNumber", "./publicApi/block/setIndentation", "./publicApi/block/setAlignment", "./publicApi/block/setDirection", "./publicApi/block/setHeadingLevel", "./publicApi/block/toggleBlockQuote", "./publicApi/block/setSpacing", "./publicApi/image/setImageBorder", "./publicApi/image/setImageBoxShadow", "./publicApi/image/changeImage", "./publicApi/format/getFormatState", "./publicApi/format/clearFormat", "./publicApi/link/insertLink", "./publicApi/link/removeLink", "./publicApi/link/adjustLinkSelection", "./publicApi/image/setImageAltText", "./publicApi/image/adjustImageSelection", "./publicApi/block/setParagraphMargin", "./publicApi/segment/toggleCode", "./publicApi/entity/insertEntity", "./modelApi/list/setListType"], function (require, exports, insertTable_1, formatTable_1, setTableCellShade_1, editTable_1, applyTableBorderFormat_1, toggleBullet_1, toggleNumbering_1, toggleBold_1, toggleItalic_1, toggleUnderline_1, toggleStrikethrough_1, toggleSubscript_1, toggleSuperscript_1, setBackgroundColor_1, setFontName_1, setFontSize_1, setTextColor_1, changeFontSize_1, applySegmentFormat_1, changeCapitalization_1, insertImage_1, setListStyle_1, setListStartNumber_1, setIndentation_1, setAlignment_1, setDirection_1, setHeadingLevel_1, toggleBlockQuote_1, setSpacing_1, setImageBorder_1, setImageBoxShadow_1, changeImage_1, getFormatState_1, clearFormat_1, insertLink_1, removeLink_1, adjustLinkSelection_1, setImageAltText_1, adjustImageSelection_1, setParagraphMargin_1, toggleCode_1, insertEntity_1, setListType_1) {
define(["require", "exports", "./publicApi/table/insertTable", "./publicApi/table/formatTable", "./publicApi/table/setTableCellShade", "./publicApi/table/editTable", "./publicApi/table/applyTableBorderFormat", "./publicApi/list/toggleBullet", "./publicApi/list/toggleNumbering", "./publicApi/segment/toggleBold", "./publicApi/segment/toggleItalic", "./publicApi/segment/toggleUnderline", "./publicApi/segment/toggleStrikethrough", "./publicApi/segment/toggleSubscript", "./publicApi/segment/toggleSuperscript", "./publicApi/segment/setBackgroundColor", "./publicApi/segment/setFontName", "./publicApi/segment/setFontSize", "./publicApi/segment/setTextColor", "./publicApi/segment/changeFontSize", "./publicApi/segment/applySegmentFormat", "./publicApi/segment/changeCapitalization", "./publicApi/image/insertImage", "./publicApi/list/setListStyle", "./publicApi/list/setListStartNumber", "./publicApi/block/setIndentation", "./publicApi/block/setAlignment", "./publicApi/block/setDirection", "./publicApi/block/setHeadingLevel", "./publicApi/block/toggleBlockQuote", "./publicApi/block/setSpacing", "./publicApi/image/setImageBorder", "./publicApi/image/setImageBoxShadow", "./publicApi/image/changeImage", "./publicApi/format/getFormatState", "./publicApi/format/clearFormat", "./publicApi/link/insertLink", "./publicApi/link/removeLink", "./publicApi/link/adjustLinkSelection", "./publicApi/image/setImageAltText", "./publicApi/image/adjustImageSelection", "./publicApi/block/setParagraphMargin", "./publicApi/segment/toggleCode", "./publicApi/entity/insertEntity", "./modelApi/table/insertTableRow", "./modelApi/table/insertTableColumn", "./publicApi/utils/formatTableWithContentModel", "./modelApi/list/setListType", "./modelApi/list/findListItemsInSameThread", "./modelApi/block/setModelIndentation"], function (require, exports, insertTable_1, formatTable_1, setTableCellShade_1, editTable_1, applyTableBorderFormat_1, toggleBullet_1, toggleNumbering_1, toggleBold_1, toggleItalic_1, toggleUnderline_1, toggleStrikethrough_1, toggleSubscript_1, toggleSuperscript_1, setBackgroundColor_1, setFontName_1, setFontSize_1, setTextColor_1, changeFontSize_1, applySegmentFormat_1, changeCapitalization_1, insertImage_1, setListStyle_1, setListStartNumber_1, setIndentation_1, setAlignment_1, setDirection_1, setHeadingLevel_1, toggleBlockQuote_1, setSpacing_1, setImageBorder_1, setImageBoxShadow_1, changeImage_1, getFormatState_1, clearFormat_1, insertLink_1, removeLink_1, adjustLinkSelection_1, setImageAltText_1, adjustImageSelection_1, setParagraphMargin_1, toggleCode_1, insertEntity_1, insertTableRow_1, insertTableColumn_1, formatTableWithContentModel_1, setListType_1, findListItemsInSameThread_1, setModelIndentation_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setListType = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
exports.setModelIndentation = exports.findListItemsInSameThread = exports.setListType = exports.formatTableWithContentModel = exports.insertTableColumn = exports.insertTableRow = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.default; } });

@@ -47,4 +47,9 @@ Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.default; } });

Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.default; } });
Object.defineProperty(exports, "insertTableRow", { enumerable: true, get: function () { return insertTableRow_1.insertTableRow; } });
Object.defineProperty(exports, "insertTableColumn", { enumerable: true, get: function () { return insertTableColumn_1.insertTableColumn; } });
Object.defineProperty(exports, "formatTableWithContentModel", { enumerable: true, get: function () { return formatTableWithContentModel_1.formatTableWithContentModel; } });
Object.defineProperty(exports, "setListType", { enumerable: true, get: function () { return setListType_1.setListType; } });
Object.defineProperty(exports, "findListItemsInSameThread", { enumerable: true, get: function () { return findListItemsInSameThread_1.findListItemsInSameThread; } });
Object.defineProperty(exports, "setModelIndentation", { enumerable: true, get: function () { return setModelIndentation_1.setModelIndentation; } });
});
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../table/alignTable", "roosterjs-content-model-core"], function (require, exports, alignTable_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../list/findListItemsInSameThread", "roosterjs-content-model-core"], function (require, exports, findListItemsInSameThread_1, roosterjs_content_model_core_1) {

import type { ContentModelDocument } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/
export declare function setModelIndentation(model: ContentModelDocument, indentation: 'indent' | 'outdent', length?: number): boolean;

@@ -1,2 +0,2 @@

define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
define(["require", "exports", "roosterjs-content-model-dom", "../list/findListItemsInSameThread", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, findListItemsInSameThread_1, roosterjs_content_model_core_1) {
"use strict";

@@ -7,3 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });

/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/

@@ -14,31 +17,74 @@ function setModelIndentation(model, indentation, length) {

var isIndent = indentation == 'indent';
var modifiedBlocks = [];
paragraphOrListItem.forEach(function (_a) {
var block = _a.block;
var block = _a.block, parent = _a.parent, path = _a.path;
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = (0, roosterjs_content_model_dom_1.createListLevel)((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
var thread = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block);
var firstItem = thread[0];
//if the first item is selected and has only one level, we should add margin to the whole list
if (isSelected(firstItem) && firstItem.levels.length == 1) {
var level = block.levels[0];
var format = level.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight;
var newValue = calculateMarginValue(format, isIndent, length);
var isRtl = format.direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
if (!isIndent && originalValue == 0) {
block.levels.pop();
}
else if (newValue !== null) {
if (isRtl) {
level.format.marginRight = newValue + 'px';
}
else {
level.format.marginLeft = newValue + 'px';
}
}
//if block has only one level, there is not need to check if it is multilevel selection
}
else {
block.levels.pop();
else if (block.levels.length == 1 || !isMultilevelSelection(model, block, parent)) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = (0, roosterjs_content_model_dom_1.createListLevel)((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
(0, roosterjs_content_model_core_1.updateListMetadata)(newLevel, function (metadata) {
metadata = metadata || {};
metadata.applyListStyleFromLevel = true;
return metadata;
});
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
}
else {
block.levels.pop();
}
}
}
else if (block) {
var format = block.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
var currentBlock = block;
var currentParent = parent;
while (currentParent && modifiedBlocks.indexOf(currentBlock) < 0) {
var index = path.indexOf(currentParent);
var format = currentBlock.format;
var newValue = calculateMarginValue(format, isIndent, length);
if (newValue !== null) {
var isRtl = format.direction == 'rtl';
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
modifiedBlocks.push(currentBlock);
break;
}
else if (currentParent.blockGroupType == 'FormatContainer' && index >= 0) {
delete currentParent.cachedElement;
currentBlock = currentParent;
currentParent = path[index + 1];
}
else {
break;
}
}
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
}

@@ -49,3 +95,47 @@ });

exports.setModelIndentation = setModelIndentation;
function isSelected(listItem) {
return listItem.blocks.some(function (block) {
if (block.blockType == 'Paragraph') {
return block.segments.some(function (segment) { return segment.isSelected; });
}
});
}
/*
* Check if the selection has list items with different levels and the first item of the list is selected, do not create a sub list.
* Otherwise, the margin of the first item will be changed, and the sub list will be created, creating a unintentional margin difference between the list items.
*/
function isMultilevelSelection(model, listItem, parent) {
var listIndex = parent.blocks.indexOf(listItem);
for (var i = listIndex - 1; i >= 0; i--) {
var block = parent.blocks[i];
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem') &&
block.levels.length == 1 &&
isSelected(block)) {
var firstItem = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block)[0];
return isSelected(firstItem);
}
if (!(0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
return false;
}
}
return false;
}
function calculateMarginValue(format, isIndent, length) {
if (length === void 0) { length = IndentStepInPixel; }
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
}
if (newValue == originalValue) {
// Return null to let caller know nothing is changed
return null;
}
else {
return newValue;
}
}
});
//# sourceMappingURL=setModelIndentation.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelFormatContainerFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core", "../common/wrapBlock"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1, wrapBlock_1) {

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup, ContentModelDocument, ContentModelSegment, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "../selection/adjustWordSelection", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, adjustWordSelection_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {

@@ -1,5 +0,5 @@

import type { ContentModelDocument, ContentModelEntity, FormatWithContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelEntity, FormatContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatWithContentModelContext): void;
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatContentModelContext): void;

@@ -17,2 +17,5 @@ define(["require", "exports", "tslib", "roosterjs-content-model-core", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_core_1, roosterjs_content_model_dom_1) {

blockIndex = position == 'begin' ? 0 : model.blocks.length;
if (!isBlock) {
Object.assign(entityModel.format, model.format);
}
}

@@ -26,2 +29,3 @@ else if ((deleteResult = (0, roosterjs_content_model_core_1.deleteSelection)(model, [], context)).insertPoint) {

var index = paragraph.segments.indexOf(marker);
Object.assign(entityModel.format, marker.format);
if (index >= 0) {

@@ -28,0 +32,0 @@ paragraph.segments.splice(focusAfterEntity ? index : index + 1, 0, entityModel);

@@ -0,0 +0,0 @@ import type { Border, ContentModelImage } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-core", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_core_1, roosterjs_content_model_dom_1) {

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {

import type { ContentModelDocument, ContentModelListItem } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/
export declare function findListItemsInSameThread(model: ContentModelDocument, currentItem: ContentModelListItem): ContentModelListItem[];

@@ -6,3 +6,5 @@ define(["require", "exports"], function (require, exports) {

/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/

@@ -9,0 +11,0 @@ function findListItemsInSameThread(model, currentItem) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -75,3 +75,3 @@ define(["require", "exports", "roosterjs-content-model-core", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_core_1, roosterjs_content_model_dom_1) {

if (block.blockType == 'Paragraph') {
block.isImplicit = true;
(0, roosterjs_content_model_dom_1.setParagraphNotImplicit)(block);
}

@@ -78,0 +78,0 @@ newListItem.blocks.push(block);

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTableRow, TableSelectionCoordinates } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_dom_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports"], function (require, exports) {

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableCellHorizontalAlignOperation, TableCellVerticalAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTableRow } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports"], function (require, exports) {

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_dom_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports"], function (require, exports) {

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../selection/collapseTableSelection", "roosterjs-content-model-core"], function (require, exports, collapseTableSelection_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../selection/collapseTableSelection", "roosterjs-content-model-core"], function (require, exports, collapseTableSelection_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelDocument, ContentModelParagraph, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_dom_1) {

import type { ContentModelTable, TableHorizontalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableColumn(table: ContentModelTable, operation: TableHorizontalInsertOperation): void;

@@ -1,2 +0,2 @@

define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
define(["require", "exports", "./clearSelectedCells", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, clearSelectedCells_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
"use strict";

@@ -6,3 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });

/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/

@@ -13,6 +15,9 @@ function insertTableColumn(table, operation) {

if (sel) {
(0, clearSelectedCells_1.clearSelectedCells)(table, sel);
for (var i = sel === null || sel === void 0 ? void 0 : sel.firstColumn; i <= sel.lastColumn; i++) {
table.rows.forEach(function (row) {
var cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset));
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);
});

@@ -19,0 +24,0 @@ table.widths.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]);

import type { ContentModelTable, TableVerticalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation): void;

@@ -1,2 +0,2 @@

define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
define(["require", "exports", "tslib", "./clearSelectedCells", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, clearSelectedCells_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
"use strict";

@@ -6,3 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });

/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/

@@ -13,2 +15,3 @@ function insertTableRow(table, operation) {

if (sel) {
(0, clearSelectedCells_1.clearSelectedCells)(table, sel);
for (var i = sel.firstRow; i <= sel.lastRow; i++) {

@@ -19,3 +22,5 @@ var sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];

cells: sourceRow.cells.map(function (cell) {
return (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
return newCell;
}),

@@ -22,0 +27,0 @@ height: sourceRow.height,

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "./canMergeCells", "roosterjs-content-model-core"], function (require, exports, canMergeCells_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableHorizontalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "./canMergeCells", "roosterjs-content-model-core"], function (require, exports, canMergeCells_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "./canMergeCells", "roosterjs-content-model-core"], function (require, exports, canMergeCells_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/block/setModelAlignment"], function (require, exports, setModelAlignment_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/block/setModelDirection"], function (require, exports, setModelDirection_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "../../modelApi/block/setModelIndentation"], function (require, exports, roosterjs_content_model_dom_1, setModelIndentation_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatParagraphWithContentModel"], function (require, exports, roosterjs_content_model_dom_1, formatParagraphWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "../../modelApi/block/toggleModelBlockQuote"], function (require, exports, tslib_1, toggleModelBlockQuote_1) {

@@ -0,0 +0,0 @@ import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -8,9 +8,14 @@ define(["require", "exports", "roosterjs-content-model-core", "roosterjs-content-model-dom", "../../modelApi/entity/insertEntityModel"], function (require, exports, roosterjs_content_model_core_1, roosterjs_content_model_dom_1, insertEntityModel_1) {

var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var wrapper = editor.getDocument().createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var document = editor.getDocument();
var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
wrapper.style.setProperty('display', display || null);
if (display == undefined && isBlock) {
wrapper.style.setProperty('width', '100%');
wrapper.style.setProperty('display', 'inline-block');
}
if (contentNode) {
wrapper.appendChild(contentNode);
}
var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /*isReadonly*/, undefined /*format*/, type);
var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
editor.formatContentModel(function (model, context) {

@@ -17,0 +22,0 @@ (0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/common/clearModelFormat", "roosterjs-content-model-dom"], function (require, exports, clearModelFormat_1, roosterjs_content_model_dom_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';

@@ -1,2 +0,2 @@

define(["require", "exports", "../../modelApi/common/retrieveModelFormatState"], function (require, exports, retrieveModelFormatState_1) {
define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {
"use strict";

@@ -17,3 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

};
(0, retrieveModelFormatState_1.retrieveModelFormatState)(model, pendingFormat, result);
(0, roosterjs_content_model_core_1.retrieveModelFormatState)(model, pendingFormat, result);
return result;

@@ -20,0 +20,0 @@ }

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection"], function (require, exports, adjustSegmentSelection_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatImageWithContentModel", "roosterjs-content-model-core"], function (require, exports, formatImageWithContentModel_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatImageWithContentModel"], function (require, exports, formatImageWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/image/applyImageBorderFormat", "../utils/formatImageWithContentModel"], function (require, exports, applyImageBorderFormat_1, formatImageWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatImageWithContentModel"], function (require, exports, formatImageWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "../../modelApi/selection/adjustWordSelection", "roosterjs-content-model-core"], function (require, exports, adjustSegmentSelection_1, adjustWordSelection_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "../../modelApi/selection/adjustTrailingSpaceSelection", "roosterjs-content-model-core", "../../modelApi/link/matchLink", "roosterjs-content-model-dom"], function (require, exports, tslib_1, adjustTrailingSpaceSelection_1, roosterjs_content_model_core_1, matchLink_1, roosterjs_content_model_dom_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "roosterjs-content-model-core"], function (require, exports, adjustSegmentSelection_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/list/findListItemsInSameThread", "roosterjs-content-model-core"], function (require, exports, findListItemsInSameThread_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/list/setListType"], function (require, exports, setListType_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/list/setListType"], function (require, exports, setListType_1) {

@@ -0,0 +0,0 @@ import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel", "roosterjs-content-model-dom", "./setFontSize"], function (require, exports, formatSegmentWithContentModel_1, roosterjs_content_model_dom_1, setFontSize_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatSegmentWithContentModel", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, formatSegmentWithContentModel_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel", "roosterjs-content-model-core"], function (require, exports, formatSegmentWithContentModel_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatSegmentWithContentModel"], function (require, exports, roosterjs_content_model_dom_1, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "../../modelApi/selection/adjustTrailingSpaceSelection", "../utils/formatSegmentWithContentModel"], function (require, exports, adjustTrailingSpaceSelection_1, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -1,2 +0,2 @@

define(["require", "exports", "tslib", "../../modelApi/table/alignTable", "../../modelApi/table/deleteTable", "../../modelApi/table/deleteTableColumn", "../../modelApi/table/deleteTableRow", "../../modelApi/table/ensureFocusableParagraphForTable", "../../modelApi/table/insertTableColumn", "../../modelApi/table/insertTableRow", "../../modelApi/table/mergeTableCells", "../../modelApi/table/mergeTableColumn", "../../modelApi/table/mergeTableRow", "../../modelApi/table/splitTableCellHorizontally", "../../modelApi/table/splitTableCellVertically", "roosterjs-content-model-core", "../../modelApi/table/alignTableCell", "roosterjs-content-model-dom"], function (require, exports, tslib_1, alignTable_1, deleteTable_1, deleteTableColumn_1, deleteTableRow_1, ensureFocusableParagraphForTable_1, insertTableColumn_1, insertTableRow_1, mergeTableCells_1, mergeTableColumn_1, mergeTableRow_1, splitTableCellHorizontally_1, splitTableCellVertically_1, roosterjs_content_model_core_1, alignTableCell_1, roosterjs_content_model_dom_1) {
define(["require", "exports", "../../modelApi/table/alignTable", "../../modelApi/table/deleteTable", "../../modelApi/table/deleteTableColumn", "../../modelApi/table/deleteTableRow", "../utils/formatTableWithContentModel", "../../modelApi/table/insertTableColumn", "../../modelApi/table/insertTableRow", "../../modelApi/table/mergeTableCells", "../../modelApi/table/mergeTableColumn", "../../modelApi/table/mergeTableRow", "../../modelApi/table/splitTableCellHorizontally", "../../modelApi/table/splitTableCellVertically", "../../modelApi/table/alignTableCell"], function (require, exports, alignTable_1, deleteTable_1, deleteTableColumn_1, deleteTableRow_1, formatTableWithContentModel_1, insertTableColumn_1, insertTableRow_1, mergeTableCells_1, mergeTableColumn_1, mergeTableRow_1, splitTableCellHorizontally_1, splitTableCellVertically_1, alignTableCell_1) {
"use strict";

@@ -11,76 +11,54 @@ Object.defineProperty(exports, "__esModule", { value: true });

editor.focus();
editor.formatContentModel(function (model) {
var _a = (0, tslib_1.__read)((0, roosterjs_content_model_core_1.getFirstSelectedTable)(model), 2), tableModel = _a[0], path = _a[1];
if (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
(0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
(0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
(0, alignTable_1.alignTable)(tableModel, operation);
break;
case 'deleteColumn':
(0, deleteTableColumn_1.deleteTableColumn)(tableModel);
break;
case 'deleteRow':
(0, deleteTableRow_1.deleteTableRow)(tableModel);
break;
case 'deleteTable':
(0, deleteTable_1.deleteTable)(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
(0, insertTableRow_1.insertTableRow)(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
(0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
(0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
break;
case 'mergeCells':
(0, mergeTableCells_1.mergeTableCells)(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
(0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
break;
case 'splitHorizontally':
(0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
break;
case 'splitVertically':
(0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
break;
}
if (!(0, roosterjs_content_model_core_1.hasSelectionInBlock)(tableModel)) {
var paragraph = (0, ensureFocusableParagraphForTable_1.ensureFocusableParagraphForTable)(model, path, tableModel);
if (paragraph) {
var marker = (0, roosterjs_content_model_dom_1.createSelectionMarker)(model.format);
paragraph.segments.unshift(marker);
(0, roosterjs_content_model_dom_1.setParagraphNotImplicit)(paragraph);
(0, roosterjs_content_model_core_1.setSelection)(model, marker);
}
}
(0, roosterjs_content_model_core_1.normalizeTable)(tableModel, model.format);
if ((0, roosterjs_content_model_dom_1.hasMetadata)(tableModel)) {
(0, roosterjs_content_model_core_1.applyTableFormat)(tableModel, undefined /*newFormat*/, true /*keepCellShade*/);
}
return true;
(0, formatTableWithContentModel_1.formatTableWithContentModel)(editor, 'editTable', function (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
(0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
(0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
(0, alignTable_1.alignTable)(tableModel, operation);
break;
case 'deleteColumn':
(0, deleteTableColumn_1.deleteTableColumn)(tableModel);
break;
case 'deleteRow':
(0, deleteTableRow_1.deleteTableRow)(tableModel);
break;
case 'deleteTable':
(0, deleteTable_1.deleteTable)(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
(0, insertTableRow_1.insertTableRow)(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
(0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
(0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
break;
case 'mergeCells':
(0, mergeTableCells_1.mergeTableCells)(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
(0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
break;
case 'splitHorizontally':
(0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
break;
case 'splitVertically':
(0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
break;
}
else {
return false;
}
}, {
apiName: 'editTable',
});

@@ -87,0 +65,0 @@ }

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-dom", "../../modelApi/table/createTableStructure", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, createTableStructure_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "roosterjs-content-model-core"], function (require, exports, tslib_1, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "./formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ define(["require", "exports", "tslib", "../../modelApi/selection/adjustWordSelection", "roosterjs-content-model-core"], function (require, exports, tslib_1, adjustWordSelection_1, roosterjs_content_model_core_1) {

@@ -43,2 +43,7 @@ export { default as insertTable } from './publicApi/table/insertTable';

export { default as insertEntity } from './publicApi/entity/insertEntity';
export { insertTableRow } from './modelApi/table/insertTableRow';
export { insertTableColumn } from './modelApi/table/insertTableColumn';
export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
export { setListType } from './modelApi/list/setListType';
export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
export { setModelIndentation } from './modelApi/block/setModelIndentation';

@@ -43,3 +43,8 @@ export { default as insertTable } from './publicApi/table/insertTable';

export { default as insertEntity } from './publicApi/entity/insertEntity';
export { insertTableRow } from './modelApi/table/insertTableRow';
export { insertTableColumn } from './modelApi/table/insertTableColumn';
export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
export { setListType } from './modelApi/list/setListType';
export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
export { setModelIndentation } from './modelApi/block/setModelIndentation';
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { alignTable } from '../table/alignTable';

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { findListItemsInSameThread } from '../list/findListItemsInSameThread';

import type { ContentModelDocument } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/
export declare function setModelIndentation(model: ContentModelDocument, indentation: 'indent' | 'outdent', length?: number): boolean;
import { createListLevel, parseValueWithUnit } from 'roosterjs-content-model-dom';
import { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';
import { findListItemsInSameThread } from '../list/findListItemsInSameThread';
import { getOperationalBlocks, isBlockGroupOfType, updateListMetadata, } from 'roosterjs-content-model-core';
var IndentStepInPixel = 40;
/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/

@@ -11,31 +15,74 @@ export function setModelIndentation(model, indentation, length) {

var isIndent = indentation == 'indent';
var modifiedBlocks = [];
paragraphOrListItem.forEach(function (_a) {
var block = _a.block;
var block = _a.block, parent = _a.parent, path = _a.path;
if (isBlockGroupOfType(block, 'ListItem')) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = createListLevel((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
var thread = findListItemsInSameThread(model, block);
var firstItem = thread[0];
//if the first item is selected and has only one level, we should add margin to the whole list
if (isSelected(firstItem) && firstItem.levels.length == 1) {
var level = block.levels[0];
var format = level.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight;
var newValue = calculateMarginValue(format, isIndent, length);
var isRtl = format.direction == 'rtl';
var originalValue = parseValueWithUnit(isRtl ? marginRight : marginLeft);
if (!isIndent && originalValue == 0) {
block.levels.pop();
}
else if (newValue !== null) {
if (isRtl) {
level.format.marginRight = newValue + 'px';
}
else {
level.format.marginLeft = newValue + 'px';
}
}
//if block has only one level, there is not need to check if it is multilevel selection
}
else {
block.levels.pop();
else if (block.levels.length == 1 || !isMultilevelSelection(model, block, parent)) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = createListLevel((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
updateListMetadata(newLevel, function (metadata) {
metadata = metadata || {};
metadata.applyListStyleFromLevel = true;
return metadata;
});
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
}
else {
block.levels.pop();
}
}
}
else if (block) {
var format = block.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = parseValueWithUnit(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
var currentBlock = block;
var currentParent = parent;
while (currentParent && modifiedBlocks.indexOf(currentBlock) < 0) {
var index = path.indexOf(currentParent);
var format = currentBlock.format;
var newValue = calculateMarginValue(format, isIndent, length);
if (newValue !== null) {
var isRtl = format.direction == 'rtl';
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
modifiedBlocks.push(currentBlock);
break;
}
else if (currentParent.blockGroupType == 'FormatContainer' && index >= 0) {
delete currentParent.cachedElement;
currentBlock = currentParent;
currentParent = path[index + 1];
}
else {
break;
}
}
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
}

@@ -45,2 +92,46 @@ });

}
function isSelected(listItem) {
return listItem.blocks.some(function (block) {
if (block.blockType == 'Paragraph') {
return block.segments.some(function (segment) { return segment.isSelected; });
}
});
}
/*
* Check if the selection has list items with different levels and the first item of the list is selected, do not create a sub list.
* Otherwise, the margin of the first item will be changed, and the sub list will be created, creating a unintentional margin difference between the list items.
*/
function isMultilevelSelection(model, listItem, parent) {
var listIndex = parent.blocks.indexOf(listItem);
for (var i = listIndex - 1; i >= 0; i--) {
var block = parent.blocks[i];
if (isBlockGroupOfType(block, 'ListItem') &&
block.levels.length == 1 &&
isSelected(block)) {
var firstItem = findListItemsInSameThread(model, block)[0];
return isSelected(firstItem);
}
if (!isBlockGroupOfType(block, 'ListItem')) {
return false;
}
}
return false;
}
function calculateMarginValue(format, isIndent, length) {
if (length === void 0) { length = IndentStepInPixel; }
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = parseValueWithUnit(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
}
if (newValue == originalValue) {
// Return null to let caller know nothing is changed
return null;
}
else {
return newValue;
}
}
//# sourceMappingURL=setModelIndentation.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelFormatContainerFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { areSameFormats, createFormatContainer, unwrapBlock } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup, ContentModelDocument, ContentModelSegment, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign, __read, __spreadArray } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read, __spreadArray } from "tslib";

@@ -1,5 +0,5 @@

import type { ContentModelDocument, ContentModelEntity, FormatWithContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelEntity, FormatContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatWithContentModelContext): void;
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatContentModelContext): void;

@@ -16,2 +16,5 @@ import { __read, __spreadArray } from "tslib";

blockIndex = position == 'begin' ? 0 : model.blocks.length;
if (!isBlock) {
Object.assign(entityModel.format, model.format);
}
}

@@ -25,2 +28,3 @@ else if ((deleteResult = deleteSelection(model, [], context)).insertPoint) {

var index = paragraph.segments.indexOf(marker);
Object.assign(entityModel.format, marker.format);
if (index >= 0) {

@@ -27,0 +31,0 @@ paragraph.segments.splice(focusAfterEntity ? index : index + 1, 0, entityModel);

@@ -0,0 +0,0 @@ import type { Border, ContentModelImage } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { extractBorderValues } from 'roosterjs-content-model-core';

@@ -0,0 +0,0 @@ import { __values } from "tslib";

import type { ContentModelDocument, ContentModelListItem } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/
export declare function findListItemsInSameThread(model: ContentModelDocument, currentItem: ContentModelListItem): ContentModelListItem[];
/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/

@@ -4,0 +6,0 @@ export function findListItemsInSameThread(model, currentItem) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -73,3 +73,3 @@ import { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';

if (block.blockType == 'Paragraph') {
block.isImplicit = true;
setParagraphNotImplicit(block);
}

@@ -76,0 +76,0 @@ newListItem.blocks.push(block);

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { getSelectedParagraphs, setSelection } from 'roosterjs-content-model-core';

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read, __spreadArray } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelTableRow, TableSelectionCoordinates } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { addSegment, createSelectionMarker } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableCellHorizontalAlignOperation, TableCellVerticalAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { getSelectedCells, updateTableCellMetadata } from 'roosterjs-content-model-core';

@@ -0,0 +0,0 @@ import type { ContentModelTableRow } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { addBlock, createTable, createTableCell } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { collapseTableSelection } from '../selection/collapseTableSelection';

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { collapseTableSelection } from '../selection/collapseTableSelection';

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelDocument, ContentModelParagraph, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { createBr, createParagraph } from 'roosterjs-content-model-dom';

import type { ContentModelTable, TableHorizontalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableColumn(table: ContentModelTable, operation: TableHorizontalInsertOperation): void;

@@ -0,5 +1,8 @@

import { clearSelectedCells } from './clearSelectedCells';
import { createTableCell } from 'roosterjs-content-model-dom';
import { getSelectedCells } from 'roosterjs-content-model-core';
/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/

@@ -10,6 +13,9 @@ export function insertTableColumn(table, operation) {

if (sel) {
clearSelectedCells(table, sel);
for (var i = sel === null || sel === void 0 ? void 0 : sel.firstColumn; i <= sel.lastColumn; i++) {
table.rows.forEach(function (row) {
var cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset));
var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);
});

@@ -16,0 +22,0 @@ table.widths.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]);

import type { ContentModelTable, TableVerticalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation): void;
import { __assign } from "tslib";
import { clearSelectedCells } from './clearSelectedCells';
import { createTableCell } from 'roosterjs-content-model-dom';
import { getSelectedCells } from 'roosterjs-content-model-core';
/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/

@@ -11,2 +14,3 @@ export function insertTableRow(table, operation) {

if (sel) {
clearSelectedCells(table, sel);
for (var i = sel.firstRow; i <= sel.lastRow; i++) {

@@ -17,3 +21,5 @@ var sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];

cells: sourceRow.cells.map(function (cell) {
return createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
return newCell;
}),

@@ -20,0 +26,0 @@ height: sourceRow.height,

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { canMergeCells } from './canMergeCells';

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableHorizontalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { canMergeCells } from './canMergeCells';

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { canMergeCells } from './canMergeCells';

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign } from "tslib";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { setModelAlignment } from '../../modelApi/block/setModelAlignment';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { setModelDirection } from '../../modelApi/block/setModelDirection';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { normalizeContentModel } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { createParagraphDecorator } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';

@@ -0,0 +0,0 @@ import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -8,9 +8,14 @@ import { ChangeSource } from 'roosterjs-content-model-core';

var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var wrapper = editor.getDocument().createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var document = editor.getDocument();
var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
wrapper.style.setProperty('display', display || null);
if (display == undefined && isBlock) {
wrapper.style.setProperty('width', '100%');
wrapper.style.setProperty('display', 'inline-block');
}
if (contentNode) {
wrapper.appendChild(contentNode);
}
var entityModel = createEntity(wrapper, true /*isReadonly*/, undefined /*format*/, type);
var entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);
editor.formatContentModel(function (model, context) {

@@ -17,0 +22,0 @@ insertEntityModel(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { clearModelFormat } from '../../modelApi/common/clearModelFormat';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';

@@ -1,2 +0,2 @@

import { retrieveModelFormatState } from '../../modelApi/common/retrieveModelFormatState';
import { retrieveModelFormatState } from 'roosterjs-content-model-core';
/**

@@ -3,0 +3,0 @@ * Get current format state

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import formatImageWithContentModel from '../utils/formatImageWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { addSegment, createContentModelDocument, createImage } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import formatImageWithContentModel from '../utils/formatImageWithContentModel';

@@ -0,0 +0,0 @@ import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import applyImageBorderFormat from '../../modelApi/image/applyImageBorderFormat';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import formatImageWithContentModel from '../utils/formatImageWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __assign } from "tslib";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { getFirstSelectedListItem } from 'roosterjs-content-model-core';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { setListType } from '../../modelApi/list/setListType';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { setListType } from '../../modelApi/list/setListType';

@@ -0,0 +0,0 @@ import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { createSelectionMarker } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { addCode } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read } from "tslib";

@@ -0,0 +0,0 @@ import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -1,2 +0,1 @@

import { __read } from "tslib";
import { alignTable } from '../../modelApi/table/alignTable';

@@ -6,3 +5,3 @@ import { deleteTable } from '../../modelApi/table/deleteTable';

import { deleteTableRow } from '../../modelApi/table/deleteTableRow';
import { ensureFocusableParagraphForTable } from '../../modelApi/table/ensureFocusableParagraphForTable';
import { formatTableWithContentModel } from '../utils/formatTableWithContentModel';
import { insertTableColumn } from '../../modelApi/table/insertTableColumn';

@@ -15,5 +14,3 @@ import { insertTableRow } from '../../modelApi/table/insertTableRow';

import { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';
import { hasSelectionInBlock, applyTableFormat, getFirstSelectedTable, normalizeTable, setSelection, } from 'roosterjs-content-model-core';
import { alignTableCellHorizontally, alignTableCellVertically, } from '../../modelApi/table/alignTableCell';
import { createSelectionMarker, hasMetadata, setParagraphNotImplicit, } from 'roosterjs-content-model-dom';
/**

@@ -26,78 +23,56 @@ * Format current focused table with the given format

editor.focus();
editor.formatContentModel(function (model) {
var _a = __read(getFirstSelectedTable(model), 2), tableModel = _a[0], path = _a[1];
if (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
alignTableCellHorizontally(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
alignTableCellVertically(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
alignTable(tableModel, operation);
break;
case 'deleteColumn':
deleteTableColumn(tableModel);
break;
case 'deleteRow':
deleteTableRow(tableModel);
break;
case 'deleteTable':
deleteTable(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
insertTableRow(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
insertTableColumn(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
mergeTableRow(tableModel, operation);
break;
case 'mergeCells':
mergeTableCells(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
mergeTableColumn(tableModel, operation);
break;
case 'splitHorizontally':
splitTableCellHorizontally(tableModel);
break;
case 'splitVertically':
splitTableCellVertically(tableModel);
break;
}
if (!hasSelectionInBlock(tableModel)) {
var paragraph = ensureFocusableParagraphForTable(model, path, tableModel);
if (paragraph) {
var marker = createSelectionMarker(model.format);
paragraph.segments.unshift(marker);
setParagraphNotImplicit(paragraph);
setSelection(model, marker);
}
}
normalizeTable(tableModel, model.format);
if (hasMetadata(tableModel)) {
applyTableFormat(tableModel, undefined /*newFormat*/, true /*keepCellShade*/);
}
return true;
formatTableWithContentModel(editor, 'editTable', function (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
alignTableCellHorizontally(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
alignTableCellVertically(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
alignTable(tableModel, operation);
break;
case 'deleteColumn':
deleteTableColumn(tableModel);
break;
case 'deleteRow':
deleteTableRow(tableModel);
break;
case 'deleteTable':
deleteTable(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
insertTableRow(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
insertTableColumn(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
mergeTableRow(tableModel, operation);
break;
case 'mergeCells':
mergeTableCells(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
mergeTableColumn(tableModel, operation);
break;
case 'splitHorizontally':
splitTableCellHorizontally(tableModel);
break;
case 'splitVertically':
splitTableCellVertically(tableModel);
break;
}
else {
return false;
}
}, {
apiName: 'editTable',
});
}
//# sourceMappingURL=editTable.js.map

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read } from "tslib";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read } from "tslib";

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { getSelectedParagraphs } from 'roosterjs-content-model-core';

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import { __read } from "tslib";

@@ -43,2 +43,7 @@ export { default as insertTable } from './publicApi/table/insertTable';

export { default as insertEntity } from './publicApi/entity/insertEntity';
export { insertTableRow } from './modelApi/table/insertTableRow';
export { insertTableColumn } from './modelApi/table/insertTableColumn';
export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
export { setListType } from './modelApi/list/setListType';
export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
export { setModelIndentation } from './modelApi/block/setModelIndentation';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setListType = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
exports.setModelIndentation = exports.findListItemsInSameThread = exports.setListType = exports.formatTableWithContentModel = exports.insertTableColumn = exports.insertTableRow = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
var insertTable_1 = require("./publicApi/table/insertTable");

@@ -88,4 +88,14 @@ Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.default; } });

Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.default; } });
var insertTableRow_1 = require("./modelApi/table/insertTableRow");
Object.defineProperty(exports, "insertTableRow", { enumerable: true, get: function () { return insertTableRow_1.insertTableRow; } });
var insertTableColumn_1 = require("./modelApi/table/insertTableColumn");
Object.defineProperty(exports, "insertTableColumn", { enumerable: true, get: function () { return insertTableColumn_1.insertTableColumn; } });
var formatTableWithContentModel_1 = require("./publicApi/utils/formatTableWithContentModel");
Object.defineProperty(exports, "formatTableWithContentModel", { enumerable: true, get: function () { return formatTableWithContentModel_1.formatTableWithContentModel; } });
var setListType_1 = require("./modelApi/list/setListType");
Object.defineProperty(exports, "setListType", { enumerable: true, get: function () { return setListType_1.setListType; } });
var findListItemsInSameThread_1 = require("./modelApi/list/findListItemsInSameThread");
Object.defineProperty(exports, "findListItemsInSameThread", { enumerable: true, get: function () { return findListItemsInSameThread_1.findListItemsInSameThread; } });
var setModelIndentation_1 = require("./modelApi/block/setModelIndentation");
Object.defineProperty(exports, "setModelIndentation", { enumerable: true, get: function () { return setModelIndentation_1.setModelIndentation; } });
//# sourceMappingURL=index.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

import type { ContentModelDocument } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/
export declare function setModelIndentation(model: ContentModelDocument, indentation: 'indent' | 'outdent', length?: number): boolean;

@@ -5,6 +5,10 @@ "use strict";

var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
var findListItemsInSameThread_1 = require("../list/findListItemsInSameThread");
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
var IndentStepInPixel = 40;
/**
* @internal
* @param model The content model to set indentation
* @param indentation The indentation type, 'indent' to indent, 'outdent' to outdent
* @param length The length of indentation in pixel, default value is 40
* Set indentation for selected list items or paragraphs
*/

@@ -15,31 +19,74 @@ function setModelIndentation(model, indentation, length) {

var isIndent = indentation == 'indent';
var modifiedBlocks = [];
paragraphOrListItem.forEach(function (_a) {
var block = _a.block;
var block = _a.block, parent = _a.parent, path = _a.path;
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = (0, roosterjs_content_model_dom_1.createListLevel)((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
var thread = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block);
var firstItem = thread[0];
//if the first item is selected and has only one level, we should add margin to the whole list
if (isSelected(firstItem) && firstItem.levels.length == 1) {
var level = block.levels[0];
var format = level.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight;
var newValue = calculateMarginValue(format, isIndent, length);
var isRtl = format.direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
if (!isIndent && originalValue == 0) {
block.levels.pop();
}
else if (newValue !== null) {
if (isRtl) {
level.format.marginRight = newValue + 'px';
}
else {
level.format.marginLeft = newValue + 'px';
}
}
//if block has only one level, there is not need to check if it is multilevel selection
}
else {
block.levels.pop();
else if (block.levels.length == 1 || !isMultilevelSelection(model, block, parent)) {
if (isIndent) {
var lastLevel = block.levels[block.levels.length - 1];
var newLevel = (0, roosterjs_content_model_dom_1.createListLevel)((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
(0, roosterjs_content_model_core_1.updateListMetadata)(newLevel, function (metadata) {
metadata = metadata || {};
metadata.applyListStyleFromLevel = true;
return metadata;
});
// New level is totally new, no need to have these attributes for now
delete newLevel.format.startNumberOverride;
block.levels.push(newLevel);
}
else {
block.levels.pop();
}
}
}
else if (block) {
var format = block.format;
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
var currentBlock = block;
var currentParent = parent;
while (currentParent && modifiedBlocks.indexOf(currentBlock) < 0) {
var index = path.indexOf(currentParent);
var format = currentBlock.format;
var newValue = calculateMarginValue(format, isIndent, length);
if (newValue !== null) {
var isRtl = format.direction == 'rtl';
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
modifiedBlocks.push(currentBlock);
break;
}
else if (currentParent.blockGroupType == 'FormatContainer' && index >= 0) {
delete currentParent.cachedElement;
currentBlock = currentParent;
currentParent = path[index + 1];
}
else {
break;
}
}
if (isRtl) {
format.marginRight = newValue + 'px';
}
else {
format.marginLeft = newValue + 'px';
}
}

@@ -50,2 +97,46 @@ });

exports.setModelIndentation = setModelIndentation;
function isSelected(listItem) {
return listItem.blocks.some(function (block) {
if (block.blockType == 'Paragraph') {
return block.segments.some(function (segment) { return segment.isSelected; });
}
});
}
/*
* Check if the selection has list items with different levels and the first item of the list is selected, do not create a sub list.
* Otherwise, the margin of the first item will be changed, and the sub list will be created, creating a unintentional margin difference between the list items.
*/
function isMultilevelSelection(model, listItem, parent) {
var listIndex = parent.blocks.indexOf(listItem);
for (var i = listIndex - 1; i >= 0; i--) {
var block = parent.blocks[i];
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem') &&
block.levels.length == 1 &&
isSelected(block)) {
var firstItem = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block)[0];
return isSelected(firstItem);
}
if (!(0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
return false;
}
}
return false;
}
function calculateMarginValue(format, isIndent, length) {
if (length === void 0) { length = IndentStepInPixel; }
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
var isRtl = direction == 'rtl';
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
if (newValue == originalValue) {
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
}
if (newValue == originalValue) {
// Return null to let caller know nothing is changed
return null;
}
else {
return newValue;
}
}
//# sourceMappingURL=setModelIndentation.js.map

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelFormatContainerFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup, ContentModelDocument, ContentModelSegment, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelBlock, ContentModelBlockGroup } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -1,5 +0,5 @@

import type { ContentModelDocument, ContentModelEntity, FormatWithContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelEntity, FormatContentModelContext, InsertEntityPosition } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatWithContentModelContext): void;
export declare function insertEntityModel(model: ContentModelDocument, entityModel: ContentModelEntity, position: InsertEntityPosition, isBlock: boolean, focusAfterEntity?: boolean, context?: FormatContentModelContext): void;

@@ -19,2 +19,5 @@ "use strict";

blockIndex = position == 'begin' ? 0 : model.blocks.length;
if (!isBlock) {
Object.assign(entityModel.format, model.format);
}
}

@@ -28,2 +31,3 @@ else if ((deleteResult = (0, roosterjs_content_model_core_1.deleteSelection)(model, [], context)).insertPoint) {

var index = paragraph.segments.indexOf(marker);
Object.assign(entityModel.format, marker.format);
if (index >= 0) {

@@ -30,0 +34,0 @@ paragraph.segments.splice(focusAfterEntity ? index : index + 1, 0, entityModel);

@@ -0,0 +0,0 @@ import type { Border, ContentModelImage } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

import type { ContentModelDocument, ContentModelListItem } from 'roosterjs-content-model-types';
/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/
export declare function findListItemsInSameThread(model: ContentModelDocument, currentItem: ContentModelListItem): ContentModelListItem[];

@@ -5,3 +5,5 @@ "use strict";

/**
* @internal
* @param model The content model
* @param currentItem The current list item
* Search for all list items in the same thread as the current list item
*/

@@ -8,0 +10,0 @@ function findListItemsInSameThread(model, currentItem) {

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -76,3 +76,3 @@ "use strict";

if (block.blockType == 'Paragraph') {
block.isImplicit = true;
(0, roosterjs_content_model_dom_1.setParagraphNotImplicit)(block);
}

@@ -79,0 +79,0 @@ newListItem.blocks.push(block);

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelDocument } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelSegment } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTableRow, TableSelectionCoordinates } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableCellHorizontalAlignOperation, TableCellVerticalAlignOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTableRow } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelBlockGroup, ContentModelDocument, ContentModelParagraph, ContentModelTable } from 'roosterjs-content-model-types';

import type { ContentModelTable, TableHorizontalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableColumn(table: ContentModelTable, operation: TableHorizontalInsertOperation): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.insertTableColumn = void 0;
var clearSelectedCells_1 = require("./clearSelectedCells");
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
/**
* @internal
* Insert a column to the table
* @param table The table model where the column is to be inserted
* @param operation The operation to be performed
*/

@@ -13,6 +16,9 @@ function insertTableColumn(table, operation) {

if (sel) {
(0, clearSelectedCells_1.clearSelectedCells)(table, sel);
for (var i = sel === null || sel === void 0 ? void 0 : sel.firstColumn; i <= sel.lastColumn; i++) {
table.rows.forEach(function (row) {
var cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset));
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);
});

@@ -19,0 +25,0 @@ table.widths.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]);

import type { ContentModelTable, TableVerticalInsertOperation } from 'roosterjs-content-model-types';
/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/
export declare function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation): void;

@@ -5,6 +5,9 @@ "use strict";

var tslib_1 = require("tslib");
var clearSelectedCells_1 = require("./clearSelectedCells");
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
/**
* @internal
* Insert a row to the table
* @param table The table model where the row is to be inserted
* @param operation The operation to be performed
*/

@@ -15,2 +18,3 @@ function insertTableRow(table, operation) {

if (sel) {
(0, clearSelectedCells_1.clearSelectedCells)(table, sel);
for (var i = sel.firstRow; i <= sel.lastRow; i++) {

@@ -21,3 +25,5 @@ var sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];

cells: sourceRow.cells.map(function (cell) {
return (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
newCell.isSelected = true;
return newCell;
}),

@@ -24,0 +30,0 @@ height: sourceRow.height,

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableHorizontalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelTable } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -10,9 +10,14 @@ "use strict";

var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var wrapper = editor.getDocument().createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var document = editor.getDocument();
var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
wrapper.style.setProperty('display', display || null);
if (display == undefined && isBlock) {
wrapper.style.setProperty('width', '100%');
wrapper.style.setProperty('display', 'inline-block');
}
if (contentNode) {
wrapper.appendChild(contentNode);
}
var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /*isReadonly*/, undefined /*format*/, type);
var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
editor.formatContentModel(function (model, context) {

@@ -19,0 +24,0 @@ (0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var retrieveModelFormatState_1 = require("../../modelApi/common/retrieveModelFormatState");
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
/**

@@ -17,3 +17,3 @@ * Get current format state

};
(0, retrieveModelFormatState_1.retrieveModelFormatState)(model, pendingFormat, result);
(0, roosterjs_content_model_core_1.retrieveModelFormatState)(model, pendingFormat, result);
return result;

@@ -20,0 +20,0 @@ }

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var alignTable_1 = require("../../modelApi/table/alignTable");

@@ -8,3 +7,3 @@ var deleteTable_1 = require("../../modelApi/table/deleteTable");

var deleteTableRow_1 = require("../../modelApi/table/deleteTableRow");
var ensureFocusableParagraphForTable_1 = require("../../modelApi/table/ensureFocusableParagraphForTable");
var formatTableWithContentModel_1 = require("../utils/formatTableWithContentModel");
var insertTableColumn_1 = require("../../modelApi/table/insertTableColumn");

@@ -17,5 +16,3 @@ var insertTableRow_1 = require("../../modelApi/table/insertTableRow");

var splitTableCellVertically_1 = require("../../modelApi/table/splitTableCellVertically");
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
var alignTableCell_1 = require("../../modelApi/table/alignTableCell");
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
/**

@@ -28,76 +25,54 @@ * Format current focused table with the given format

editor.focus();
editor.formatContentModel(function (model) {
var _a = (0, tslib_1.__read)((0, roosterjs_content_model_core_1.getFirstSelectedTable)(model), 2), tableModel = _a[0], path = _a[1];
if (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
(0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
(0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
(0, alignTable_1.alignTable)(tableModel, operation);
break;
case 'deleteColumn':
(0, deleteTableColumn_1.deleteTableColumn)(tableModel);
break;
case 'deleteRow':
(0, deleteTableRow_1.deleteTableRow)(tableModel);
break;
case 'deleteTable':
(0, deleteTable_1.deleteTable)(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
(0, insertTableRow_1.insertTableRow)(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
(0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
(0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
break;
case 'mergeCells':
(0, mergeTableCells_1.mergeTableCells)(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
(0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
break;
case 'splitHorizontally':
(0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
break;
case 'splitVertically':
(0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
break;
}
if (!(0, roosterjs_content_model_core_1.hasSelectionInBlock)(tableModel)) {
var paragraph = (0, ensureFocusableParagraphForTable_1.ensureFocusableParagraphForTable)(model, path, tableModel);
if (paragraph) {
var marker = (0, roosterjs_content_model_dom_1.createSelectionMarker)(model.format);
paragraph.segments.unshift(marker);
(0, roosterjs_content_model_dom_1.setParagraphNotImplicit)(paragraph);
(0, roosterjs_content_model_core_1.setSelection)(model, marker);
}
}
(0, roosterjs_content_model_core_1.normalizeTable)(tableModel, model.format);
if ((0, roosterjs_content_model_dom_1.hasMetadata)(tableModel)) {
(0, roosterjs_content_model_core_1.applyTableFormat)(tableModel, undefined /*newFormat*/, true /*keepCellShade*/);
}
return true;
(0, formatTableWithContentModel_1.formatTableWithContentModel)(editor, 'editTable', function (tableModel) {
switch (operation) {
case 'alignCellLeft':
case 'alignCellCenter':
case 'alignCellRight':
(0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
break;
case 'alignCellTop':
case 'alignCellMiddle':
case 'alignCellBottom':
(0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
break;
case 'alignCenter':
case 'alignLeft':
case 'alignRight':
(0, alignTable_1.alignTable)(tableModel, operation);
break;
case 'deleteColumn':
(0, deleteTableColumn_1.deleteTableColumn)(tableModel);
break;
case 'deleteRow':
(0, deleteTableRow_1.deleteTableRow)(tableModel);
break;
case 'deleteTable':
(0, deleteTable_1.deleteTable)(tableModel);
break;
case 'insertAbove':
case 'insertBelow':
(0, insertTableRow_1.insertTableRow)(tableModel, operation);
break;
case 'insertLeft':
case 'insertRight':
(0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
break;
case 'mergeAbove':
case 'mergeBelow':
(0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
break;
case 'mergeCells':
(0, mergeTableCells_1.mergeTableCells)(tableModel);
break;
case 'mergeLeft':
case 'mergeRight':
(0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
break;
case 'splitHorizontally':
(0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
break;
case 'splitVertically':
(0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
break;
}
else {
return false;
}
}, {
apiName: 'editTable',
});

@@ -104,0 +79,0 @@ }

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -0,0 +0,0 @@ import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';

@@ -6,7 +6,7 @@ {

"tslib": "^2.3.1",
"roosterjs-content-model-core": "^0.25.0",
"roosterjs-content-model-dom": "^0.25.0",
"roosterjs-content-model-types": "^0.25.0"
"roosterjs-content-model-core": "^0.26.0",
"roosterjs-content-model-dom": "^0.26.0",
"roosterjs-content-model-types": "^0.26.0"
},
"version": "0.25.0",
"version": "0.26.0",
"main": "./lib/index.js",

@@ -13,0 +13,0 @@ "typings": "./lib/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc