Socket
Socket
Sign inDemoInstall

roosterjs-content-model-api

Package Overview
Dependencies
4
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.26.4 to 0.27.0

3

lib-amd/modelApi/list/setListType.d.ts

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

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL'): boolean;
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL', removeMargins?: boolean): boolean;

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

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function setListType(model, listType) {
function setListType(model, listType, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
var paragraphOrListItems = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['ListItem'], [] // Set stop types to be empty so we can find list items even cross the boundary of table, then we can always operation on the list item if any

@@ -65,4 +67,4 @@ );

textAlign: block.format.textAlign,
marginTop: '0px',
marginBottom: '0px',
marginBottom: removeMargins ? '0px' : undefined,
marginTop: removeMargins ? '0px' : undefined,
}),

@@ -69,0 +71,0 @@ ],

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text alignment of selected paragraphs

*/
export default function setAlignment(editor: IStandaloneEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;
export default function setAlignment(editor: IEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text direction of selected paragraphs (Left to right or Right to left)

*/
export default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl'): void;
export default function setDirection(editor: IEditor, direction: 'ltr' | 'rtl'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set heading level of selected paragraphs

*/
export default function setHeadingLevel(editor: IStandaloneEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
export default function setHeadingLevel(editor: IEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Indent or outdent to selected paragraphs

*/
export default function setIndentation(editor: IStandaloneEditor, indentation: 'indent' | 'outdent', length?: number): void;
export default function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggles the current block(s) margin properties.

*/
export default function setParagraphMargin(editor: IStandaloneEditor, marginTop?: string | null, marginBottom?: string | null): void;
export default function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Sets current selected block(s) line-height property and wipes such property from child segments

*/
export default function setSpacing(editor: IStandaloneEditor, spacing: number | string): void;
export default function setSpacing(editor: IEditor, spacing: number | string): void;

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

import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggle BLOCKQUOTE state of selected paragraphs.

*/
export default function toggleBlockQuote(editor: IStandaloneEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
export default function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;

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

import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IEditor } from 'roosterjs-content-model-types';
/**
* Insert an entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -13,6 +13,6 @@ * @param isBlock True to insert a block entity, false to insert an inline entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
/**
* Insert a block entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -26,2 +26,2 @@ * @param isBlock Must be true for a block entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;

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

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) {
define(["require", "exports", "roosterjs-content-model-core", "../../modelApi/entity/insertEntityModel", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_core_1, insertEntityModel_1, roosterjs_content_model_dom_1) {
"use strict";

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

function insertEntity(editor, type, isBlock, position, options) {
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
var document = editor.getDocument();

@@ -21,6 +21,9 @@ var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);

var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
if (!skipUndoSnapshot) {
editor.takeSnapshot();
}
editor.formatContentModel(function (model, context) {
(0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);
(0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
context.skipUndoSnapshot = skipUndoSnapshot;
context.skipUndoSnapshot = true;
context.newEntities.push(entityModel);

@@ -39,2 +42,18 @@ return true;

});
if (!skipUndoSnapshot) {
var entityState = void 0;
if (initialEntityState) {
var format = (0, roosterjs_content_model_dom_1.parseEntityFormat)(wrapper);
var id = format.id, entityType = format.entityType;
entityState =
id && entityType
? {
id: id,
type: entityType,
state: initialEntityState,
}
: undefined;
}
editor.takeSnapshot(entityState);
}
return entityModel;

@@ -41,0 +60,0 @@ }

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Clear format of selection

*/
export default function clearFormat(editor: IStandaloneEditor): void;
export default function clearFormat(editor: IEditor): void;

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

import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
import type { IEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Get current format state

*/
export default function getFormatState(editor: IStandaloneEditor): ContentModelFormatState;
export default function getFormatState(editor: IEditor): ContentModelFormatState;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select an image if any

*/
export default function adjustImageSelection(editor: IStandaloneEditor): ContentModelImage | null;
export default function adjustImageSelection(editor: IEditor): ContentModelImage | null;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Change the selected image src

*/
export default function changeImage(editor: IStandaloneEditor, file: File): void;
export default function changeImage(editor: IEditor, file: File): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Insert an image into current selected position

*/
export default function insertImage(editor: IStandaloneEditor, imageFileOrSrc: File | string): void;
export default function insertImage(editor: IEditor, imageFileOrSrc: File | string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image alt text for all selected images at selection. If no images is contained

*/
export default function setImageAltText(editor: IStandaloneEditor, altText: string): void;
export default function setImageAltText(editor: IEditor, altText: string): void;

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

import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { Border, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Set image border style for all selected images at selection.

*/
export default function setImageBorder(editor: IStandaloneEditor, border: Border | null, borderRadius?: string): void;
export default function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image box shadow for all selected images at selection.

*/
export default function setImageBoxShadow(editor: IStandaloneEditor, boxShadow: string, margin?: string | null): void;
export default function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed

*/
export default function adjustLinkSelection(editor: IStandaloneEditor): [string, string | null];
export default function adjustLinkSelection(editor: IEditor): [string, string | null];

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -15,2 +15,2 @@ * Insert a hyperlink at cursor.

*/
export default function insertLink(editor: IStandaloneEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;
export default function insertLink(editor: IEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Remove link at selection. If no links at selection, do nothing.

*/
export default function removeLink(editor: IStandaloneEditor): void;
export default function removeLink(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set start number of a list item

*/
export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
export default function setListStartNumber(editor: IEditor, value: number): void;

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

import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set style of list items with in same thread of current item

*/
export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
export default function setListStyle(editor: IEditor, style: ListMetadataFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle bullet list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleBullet(editor: IStandaloneEditor): void;
export default function toggleBullet(editor: IEditor, removeMargins?: boolean): void;

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

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function toggleBullet(editor) {
function toggleBullet(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return (0, setListType_1.setListType)(model, 'UL');
return (0, setListType_1.setListType)(model, 'UL', removeMargins);
}, {

@@ -17,0 +19,0 @@ apiName: 'toggleBullet',

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle numbering list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleNumbering(editor: IStandaloneEditor): void;
export default function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;

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

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function toggleNumbering(editor) {
function toggleNumbering(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return (0, setListType_1.setListType)(model, 'OL');
return (0, setListType_1.setListType)(model, 'OL', removeMargins);
}, {

@@ -17,0 +19,0 @@ apiName: 'toggleNumbering',

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

import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Bulk apply segment format to all selected content. This is usually used for format painter.

*/
export default function applySegmentFormat(editor: IStandaloneEditor, newFormat: ContentModelSegmentFormat): void;
export default function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -10,2 +10,2 @@ * Change the capitalization of text in the selection

*/
export default function changeCapitalization(editor: IStandaloneEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
export default function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Increase or decrease font size in selection

*/
export default function changeFontSize(editor: IStandaloneEditor, change: 'increase' | 'decrease'): void;
export default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set background color

*/
export default function setBackgroundColor(editor: IStandaloneEditor, backgroundColor: string | null): void;
export default function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set font name

*/
export default function setFontName(editor: IStandaloneEditor, fontName: string): void;
export default function setFontName(editor: IEditor, fontName: string): void;

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

import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,3 @@ * Set font size

*/
export default function setFontSize(editor: IStandaloneEditor, fontSize: string): void;
export default function setFontSize(editor: IEditor, fontSize: string): void;
/**

@@ -10,0 +10,0 @@ * @internal

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text color

*/
export default function setTextColor(editor: IStandaloneEditor, textColor: string | null): void;
export default function setTextColor(editor: IEditor, textColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle bold style

*/
export default function toggleBold(editor: IStandaloneEditor): void;
export default function toggleBold(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleCode(editor: IStandaloneEditor): void;
export default function toggleCode(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleItalic(editor: IStandaloneEditor): void;
export default function toggleItalic(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle strikethrough style

*/
export default function toggleStrikethrough(editor: IStandaloneEditor): void;
export default function toggleStrikethrough(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle subscript style

*/
export default function toggleSubscript(editor: IStandaloneEditor): void;
export default function toggleSubscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle superscript style

*/
export default function toggleSuperscript(editor: IStandaloneEditor): void;
export default function toggleSuperscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle underline style

*/
export default function toggleUnderline(editor: IStandaloneEditor): void;
export default function toggleUnderline(editor: IEditor): void;

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

import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
import type { IEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Operations to apply border

*/
export default function applyTableBorderFormat(editor: IStandaloneEditor, border: Border, operation: BorderOperations): void;
export default function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;

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

import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Format current focused table with the given format

*/
export default function editTable(editor: IStandaloneEditor, operation: TableOperation): void;
export default function editTable(editor: IEditor, operation: TableOperation): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Format current focused table with the given format

*/
export default function formatTable(editor: IStandaloneEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
export default function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -11,2 +11,2 @@ * Insert table into editor at current selection

*/
export default function insertTable(editor: IStandaloneEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
export default function insertTable(editor: IEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set table cell shade color

*/
export default function setTableCellShade(editor: IStandaloneEditor, color: string | null): void;
export default function setTableCellShade(editor: IEditor, color: string | null): void;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export default function formatImageWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
export default function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;

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

import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatParagraphWithContentModel(editor: IStandaloneEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;
export declare function formatParagraphWithContentModel(editor: IEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;

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

import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatSegmentWithContentModel(editor: IStandaloneEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;
export declare function formatSegmentWithContentModel(editor: IEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;

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

import type { ContentModelTable, IStandaloneEditor, TableSelection } from 'roosterjs-content-model-types';
import type { ContentModelTable, IEditor, TableSelection } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Invoke a callback to format the selected table using Content Model

*/
export declare function formatTableWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;
export declare function formatTableWithContentModel(editor: IEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;

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

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL'): boolean;
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL', removeMargins?: boolean): boolean;

@@ -7,4 +7,6 @@ import { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export function setListType(model, listType) {
export function setListType(model, listType, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
var paragraphOrListItems = getOperationalBlocks(model, ['ListItem'], [] // Set stop types to be empty so we can find list items even cross the boundary of table, then we can always operation on the list item if any

@@ -63,4 +65,4 @@ );

textAlign: block.format.textAlign,
marginTop: '0px',
marginBottom: '0px',
marginBottom: removeMargins ? '0px' : undefined,
marginTop: removeMargins ? '0px' : undefined,
}),

@@ -67,0 +69,0 @@ ],

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text alignment of selected paragraphs

*/
export default function setAlignment(editor: IStandaloneEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;
export default function setAlignment(editor: IEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text direction of selected paragraphs (Left to right or Right to left)

*/
export default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl'): void;
export default function setDirection(editor: IEditor, direction: 'ltr' | 'rtl'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set heading level of selected paragraphs

*/
export default function setHeadingLevel(editor: IStandaloneEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
export default function setHeadingLevel(editor: IEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Indent or outdent to selected paragraphs

*/
export default function setIndentation(editor: IStandaloneEditor, indentation: 'indent' | 'outdent', length?: number): void;
export default function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggles the current block(s) margin properties.

*/
export default function setParagraphMargin(editor: IStandaloneEditor, marginTop?: string | null, marginBottom?: string | null): void;
export default function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Sets current selected block(s) line-height property and wipes such property from child segments

*/
export default function setSpacing(editor: IStandaloneEditor, spacing: number | string): void;
export default function setSpacing(editor: IEditor, spacing: number | string): void;

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

import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggle BLOCKQUOTE state of selected paragraphs.

*/
export default function toggleBlockQuote(editor: IStandaloneEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
export default function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;

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

import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IEditor } from 'roosterjs-content-model-types';
/**
* Insert an entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -13,6 +13,6 @@ * @param isBlock True to insert a block entity, false to insert an inline entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
/**
* Insert a block entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -26,2 +26,2 @@ * @param isBlock Must be true for a block entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
import { ChangeSource } from 'roosterjs-content-model-core';
import { createEntity, normalizeContentModel } from 'roosterjs-content-model-dom';
import { insertEntityModel } from '../../modelApi/entity/insertEntityModel';
import { createEntity, normalizeContentModel, parseEntityFormat, } from 'roosterjs-content-model-dom';
var BlockEntityTag = 'div';
var InlineEntityTag = 'span';
export default function insertEntity(editor, type, isBlock, position, options) {
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
var document = editor.getDocument();

@@ -20,6 +20,9 @@ var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);

var entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);
if (!skipUndoSnapshot) {
editor.takeSnapshot();
}
editor.formatContentModel(function (model, context) {
insertEntityModel(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);
normalizeContentModel(model);
context.skipUndoSnapshot = skipUndoSnapshot;
context.skipUndoSnapshot = true;
context.newEntities.push(entityModel);

@@ -38,4 +41,20 @@ return true;

});
if (!skipUndoSnapshot) {
var entityState = void 0;
if (initialEntityState) {
var format = parseEntityFormat(wrapper);
var id = format.id, entityType = format.entityType;
entityState =
id && entityType
? {
id: id,
type: entityType,
state: initialEntityState,
}
: undefined;
}
editor.takeSnapshot(entityState);
}
return entityModel;
}
//# sourceMappingURL=insertEntity.js.map

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Clear format of selection

*/
export default function clearFormat(editor: IStandaloneEditor): void;
export default function clearFormat(editor: IEditor): void;

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

import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
import type { IEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Get current format state

*/
export default function getFormatState(editor: IStandaloneEditor): ContentModelFormatState;
export default function getFormatState(editor: IEditor): ContentModelFormatState;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select an image if any

*/
export default function adjustImageSelection(editor: IStandaloneEditor): ContentModelImage | null;
export default function adjustImageSelection(editor: IEditor): ContentModelImage | null;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Change the selected image src

*/
export default function changeImage(editor: IStandaloneEditor, file: File): void;
export default function changeImage(editor: IEditor, file: File): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Insert an image into current selected position

*/
export default function insertImage(editor: IStandaloneEditor, imageFileOrSrc: File | string): void;
export default function insertImage(editor: IEditor, imageFileOrSrc: File | string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image alt text for all selected images at selection. If no images is contained

*/
export default function setImageAltText(editor: IStandaloneEditor, altText: string): void;
export default function setImageAltText(editor: IEditor, altText: string): void;

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

import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { Border, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Set image border style for all selected images at selection.

*/
export default function setImageBorder(editor: IStandaloneEditor, border: Border | null, borderRadius?: string): void;
export default function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image box shadow for all selected images at selection.

*/
export default function setImageBoxShadow(editor: IStandaloneEditor, boxShadow: string, margin?: string | null): void;
export default function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed

*/
export default function adjustLinkSelection(editor: IStandaloneEditor): [string, string | null];
export default function adjustLinkSelection(editor: IEditor): [string, string | null];

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -15,2 +15,2 @@ * Insert a hyperlink at cursor.

*/
export default function insertLink(editor: IStandaloneEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;
export default function insertLink(editor: IEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Remove link at selection. If no links at selection, do nothing.

*/
export default function removeLink(editor: IStandaloneEditor): void;
export default function removeLink(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set start number of a list item

*/
export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
export default function setListStartNumber(editor: IEditor, value: number): void;

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

import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set style of list items with in same thread of current item

*/
export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
export default function setListStyle(editor: IEditor, style: ListMetadataFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle bullet list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleBullet(editor: IStandaloneEditor): void;
export default function toggleBullet(editor: IEditor, removeMargins?: boolean): void;

@@ -7,8 +7,10 @@ import { setListType } from '../../modelApi/list/setListType';

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleBullet(editor) {
export default function toggleBullet(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return setListType(model, 'UL');
return setListType(model, 'UL', removeMargins);
}, {

@@ -15,0 +17,0 @@ apiName: 'toggleBullet',

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle numbering list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleNumbering(editor: IStandaloneEditor): void;
export default function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;

@@ -7,8 +7,10 @@ import { setListType } from '../../modelApi/list/setListType';

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleNumbering(editor) {
export default function toggleNumbering(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return setListType(model, 'OL');
return setListType(model, 'OL', removeMargins);
}, {

@@ -15,0 +17,0 @@ apiName: 'toggleNumbering',

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

import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Bulk apply segment format to all selected content. This is usually used for format painter.

*/
export default function applySegmentFormat(editor: IStandaloneEditor, newFormat: ContentModelSegmentFormat): void;
export default function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -10,2 +10,2 @@ * Change the capitalization of text in the selection

*/
export default function changeCapitalization(editor: IStandaloneEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
export default function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Increase or decrease font size in selection

*/
export default function changeFontSize(editor: IStandaloneEditor, change: 'increase' | 'decrease'): void;
export default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set background color

*/
export default function setBackgroundColor(editor: IStandaloneEditor, backgroundColor: string | null): void;
export default function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set font name

*/
export default function setFontName(editor: IStandaloneEditor, fontName: string): void;
export default function setFontName(editor: IEditor, fontName: string): void;

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

import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,3 @@ * Set font size

*/
export default function setFontSize(editor: IStandaloneEditor, fontSize: string): void;
export default function setFontSize(editor: IEditor, fontSize: string): void;
/**

@@ -10,0 +10,0 @@ * @internal

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text color

*/
export default function setTextColor(editor: IStandaloneEditor, textColor: string | null): void;
export default function setTextColor(editor: IEditor, textColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle bold style

*/
export default function toggleBold(editor: IStandaloneEditor): void;
export default function toggleBold(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleCode(editor: IStandaloneEditor): void;
export default function toggleCode(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleItalic(editor: IStandaloneEditor): void;
export default function toggleItalic(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle strikethrough style

*/
export default function toggleStrikethrough(editor: IStandaloneEditor): void;
export default function toggleStrikethrough(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle subscript style

*/
export default function toggleSubscript(editor: IStandaloneEditor): void;
export default function toggleSubscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle superscript style

*/
export default function toggleSuperscript(editor: IStandaloneEditor): void;
export default function toggleSuperscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle underline style

*/
export default function toggleUnderline(editor: IStandaloneEditor): void;
export default function toggleUnderline(editor: IEditor): void;

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

import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
import type { IEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Operations to apply border

*/
export default function applyTableBorderFormat(editor: IStandaloneEditor, border: Border, operation: BorderOperations): void;
export default function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;

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

import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Format current focused table with the given format

*/
export default function editTable(editor: IStandaloneEditor, operation: TableOperation): void;
export default function editTable(editor: IEditor, operation: TableOperation): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Format current focused table with the given format

*/
export default function formatTable(editor: IStandaloneEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
export default function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -11,2 +11,2 @@ * Insert table into editor at current selection

*/
export default function insertTable(editor: IStandaloneEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
export default function insertTable(editor: IEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set table cell shade color

*/
export default function setTableCellShade(editor: IStandaloneEditor, color: string | null): void;
export default function setTableCellShade(editor: IEditor, color: string | null): void;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export default function formatImageWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
export default function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;

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

import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatParagraphWithContentModel(editor: IStandaloneEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;
export declare function formatParagraphWithContentModel(editor: IEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;

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

import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatSegmentWithContentModel(editor: IStandaloneEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;
export declare function formatSegmentWithContentModel(editor: IEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;

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

import type { ContentModelTable, IStandaloneEditor, TableSelection } from 'roosterjs-content-model-types';
import type { ContentModelTable, IEditor, TableSelection } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Invoke a callback to format the selected table using Content Model

*/
export declare function formatTableWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;
export declare function formatTableWithContentModel(editor: IEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;

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

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL'): boolean;
export declare function setListType(model: ContentModelDocument, listType: 'OL' | 'UL', removeMargins?: boolean): boolean;

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

* @param listType the list type OL | UL
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function setListType(model, listType) {
function setListType(model, listType, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
var paragraphOrListItems = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['ListItem'], [] // Set stop types to be empty so we can find list items even cross the boundary of table, then we can always operation on the list item if any

@@ -66,4 +68,4 @@ );

textAlign: block.format.textAlign,
marginTop: '0px',
marginBottom: '0px',
marginBottom: removeMargins ? '0px' : undefined,
marginTop: removeMargins ? '0px' : undefined,
}),

@@ -70,0 +72,0 @@ ],

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text alignment of selected paragraphs

*/
export default function setAlignment(editor: IStandaloneEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;
export default function setAlignment(editor: IEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text direction of selected paragraphs (Left to right or Right to left)

*/
export default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl'): void;
export default function setDirection(editor: IEditor, direction: 'ltr' | 'rtl'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set heading level of selected paragraphs

*/
export default function setHeadingLevel(editor: IStandaloneEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
export default function setHeadingLevel(editor: IEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Indent or outdent to selected paragraphs

*/
export default function setIndentation(editor: IStandaloneEditor, indentation: 'indent' | 'outdent', length?: number): void;
export default function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggles the current block(s) margin properties.

*/
export default function setParagraphMargin(editor: IStandaloneEditor, marginTop?: string | null, marginBottom?: string | null): void;
export default function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Sets current selected block(s) line-height property and wipes such property from child segments

*/
export default function setSpacing(editor: IStandaloneEditor, spacing: number | string): void;
export default function setSpacing(editor: IEditor, spacing: number | string): void;

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

import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Toggle BLOCKQUOTE state of selected paragraphs.

*/
export default function toggleBlockQuote(editor: IStandaloneEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
export default function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;

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

import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IEditor } from 'roosterjs-content-model-types';
/**
* Insert an entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -13,6 +13,6 @@ * @param isBlock True to insert a block entity, false to insert an inline entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
/**
* Insert a block entity into editor
* @param editor The Content Model editor
* @param editor The editor object
* @param type Type of entity

@@ -26,2 +26,2 @@ * @param isBlock Must be true for a block entity

*/
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
export default function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
var insertEntityModel_1 = require("../../modelApi/entity/insertEntityModel");
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
var insertEntityModel_1 = require("../../modelApi/entity/insertEntityModel");
var BlockEntityTag = 'div';
var InlineEntityTag = 'span';
function insertEntity(editor, type, isBlock, position, options) {
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
var document = editor.getDocument();

@@ -22,6 +22,9 @@ var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);

var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
if (!skipUndoSnapshot) {
editor.takeSnapshot();
}
editor.formatContentModel(function (model, context) {
(0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);
(0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
context.skipUndoSnapshot = skipUndoSnapshot;
context.skipUndoSnapshot = true;
context.newEntities.push(entityModel);

@@ -40,2 +43,18 @@ return true;

});
if (!skipUndoSnapshot) {
var entityState = void 0;
if (initialEntityState) {
var format = (0, roosterjs_content_model_dom_1.parseEntityFormat)(wrapper);
var id = format.id, entityType = format.entityType;
entityState =
id && entityType
? {
id: id,
type: entityType,
state: initialEntityState,
}
: undefined;
}
editor.takeSnapshot(entityState);
}
return entityModel;

@@ -42,0 +61,0 @@ }

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Clear format of selection

*/
export default function clearFormat(editor: IStandaloneEditor): void;
export default function clearFormat(editor: IEditor): void;

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

import type { IStandaloneEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
import type { IEditor, ContentModelFormatState } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Get current format state

*/
export default function getFormatState(editor: IStandaloneEditor): ContentModelFormatState;
export default function getFormatState(editor: IEditor): ContentModelFormatState;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select an image if any

*/
export default function adjustImageSelection(editor: IStandaloneEditor): ContentModelImage | null;
export default function adjustImageSelection(editor: IEditor): ContentModelImage | null;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Change the selected image src

*/
export default function changeImage(editor: IStandaloneEditor, file: File): void;
export default function changeImage(editor: IEditor, file: File): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Insert an image into current selected position

*/
export default function insertImage(editor: IStandaloneEditor, imageFileOrSrc: File | string): void;
export default function insertImage(editor: IEditor, imageFileOrSrc: File | string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image alt text for all selected images at selection. If no images is contained

*/
export default function setImageAltText(editor: IStandaloneEditor, altText: string): void;
export default function setImageAltText(editor: IEditor, altText: string): void;

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

import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { Border, IEditor } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Set image border style for all selected images at selection.

*/
export default function setImageBorder(editor: IStandaloneEditor, border: Border | null, borderRadius?: string): void;
export default function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Set image box shadow for all selected images at selection.

*/
export default function setImageBoxShadow(editor: IStandaloneEditor, boxShadow: string, margin?: string | null): void;
export default function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed

*/
export default function adjustLinkSelection(editor: IStandaloneEditor): [string, string | null];
export default function adjustLinkSelection(editor: IEditor): [string, string | null];

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -15,2 +15,2 @@ * Insert a hyperlink at cursor.

*/
export default function insertLink(editor: IStandaloneEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;
export default function insertLink(editor: IEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Remove link at selection. If no links at selection, do nothing.

*/
export default function removeLink(editor: IStandaloneEditor): void;
export default function removeLink(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set start number of a list item

*/
export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
export default function setListStartNumber(editor: IEditor, value: number): void;

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

import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set style of list items with in same thread of current item

*/
export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
export default function setListStyle(editor: IEditor, style: ListMetadataFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle bullet list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleBullet(editor: IStandaloneEditor): void;
export default function toggleBullet(editor: IEditor, removeMargins?: boolean): void;

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

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function toggleBullet(editor) {
function toggleBullet(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return (0, setListType_1.setListType)(model, 'UL');
return (0, setListType_1.setListType)(model, 'UL', removeMargins);
}, {

@@ -17,0 +19,0 @@ apiName: 'toggleBullet',

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,4 @@ * Toggle numbering list type

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
export default function toggleNumbering(editor: IStandaloneEditor): void;
export default function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;

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

* @param editor The editor to operate on
* @param removeMargins true to remove margins, false to keep margins @default false
*/
function toggleNumbering(editor) {
function toggleNumbering(editor, removeMargins) {
if (removeMargins === void 0) { removeMargins = false; }
editor.focus();
editor.formatContentModel(function (model, context) {
context.newPendingFormat = 'preserve';
return (0, setListType_1.setListType)(model, 'OL');
return (0, setListType_1.setListType)(model, 'OL', removeMargins);
}, {

@@ -17,0 +19,0 @@ apiName: 'toggleNumbering',

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

import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Bulk apply segment format to all selected content. This is usually used for format painter.

*/
export default function applySegmentFormat(editor: IStandaloneEditor, newFormat: ContentModelSegmentFormat): void;
export default function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -10,2 +10,2 @@ * Change the capitalization of text in the selection

*/
export default function changeCapitalization(editor: IStandaloneEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
export default function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Increase or decrease font size in selection

*/
export default function changeFontSize(editor: IStandaloneEditor, change: 'increase' | 'decrease'): void;
export default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set background color

*/
export default function setBackgroundColor(editor: IStandaloneEditor, backgroundColor: string | null): void;
export default function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set font name

*/
export default function setFontName(editor: IStandaloneEditor, fontName: string): void;
export default function setFontName(editor: IEditor, fontName: string): void;

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

import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,3 +7,3 @@ * Set font size

*/
export default function setFontSize(editor: IStandaloneEditor, fontSize: string): void;
export default function setFontSize(editor: IEditor, fontSize: string): void;
/**

@@ -10,0 +10,0 @@ * @internal

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set text color

*/
export default function setTextColor(editor: IStandaloneEditor, textColor: string | null): void;
export default function setTextColor(editor: IEditor, textColor: string | null): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle bold style

*/
export default function toggleBold(editor: IStandaloneEditor): void;
export default function toggleBold(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleCode(editor: IStandaloneEditor): void;
export default function toggleCode(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle italic style

*/
export default function toggleItalic(editor: IStandaloneEditor): void;
export default function toggleItalic(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle strikethrough style

*/
export default function toggleStrikethrough(editor: IStandaloneEditor): void;
export default function toggleStrikethrough(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle subscript style

*/
export default function toggleSubscript(editor: IStandaloneEditor): void;
export default function toggleSubscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle superscript style

*/
export default function toggleSuperscript(editor: IStandaloneEditor): void;
export default function toggleSuperscript(editor: IEditor): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -6,2 +6,2 @@ * Toggle underline style

*/
export default function toggleUnderline(editor: IStandaloneEditor): void;
export default function toggleUnderline(editor: IEditor): void;

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

import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
import type { IEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Operations to apply border

*/
export default function applyTableBorderFormat(editor: IStandaloneEditor, border: Border, operation: BorderOperations): void;
export default function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;

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

import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Format current focused table with the given format

*/
export default function editTable(editor: IStandaloneEditor, operation: TableOperation): void;
export default function editTable(editor: IEditor, operation: TableOperation): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -8,2 +8,2 @@ * Format current focused table with the given format

*/
export default function formatTable(editor: IStandaloneEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
export default function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;

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

import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
/**

@@ -11,2 +11,2 @@ * Insert table into editor at current selection

*/
export default function insertTable(editor: IStandaloneEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
export default function insertTable(editor: IEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;

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

import type { IStandaloneEditor } from 'roosterjs-content-model-types';
import type { IEditor } from 'roosterjs-content-model-types';
/**

@@ -7,2 +7,2 @@ * Set table cell shade color

*/
export default function setTableCellShade(editor: IStandaloneEditor, color: string | null): void;
export default function setTableCellShade(editor: IEditor, color: string | null): void;

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

import type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export default function formatImageWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
export default function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;

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

import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatParagraphWithContentModel(editor: IStandaloneEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;
export declare function formatParagraphWithContentModel(editor: IEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;

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

import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
/**
* @internal
*/
export declare function formatSegmentWithContentModel(editor: IStandaloneEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;
export declare function formatSegmentWithContentModel(editor: IEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;

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

import type { ContentModelTable, IStandaloneEditor, TableSelection } from 'roosterjs-content-model-types';
import type { ContentModelTable, IEditor, TableSelection } from 'roosterjs-content-model-types';
/**

@@ -9,2 +9,2 @@ * Invoke a callback to format the selected table using Content Model

*/
export declare function formatTableWithContentModel(editor: IStandaloneEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;
export declare function formatTableWithContentModel(editor: IEditor, apiName: string, callback: (tableModel: ContentModelTable) => void, selectionOverride?: TableSelection): void;

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

"tslib": "^2.3.1",
"roosterjs-content-model-core": "^0.26.4",
"roosterjs-content-model-dom": "^0.26.4",
"roosterjs-content-model-types": "^0.26.4"
"roosterjs-content-model-core": "^0.27.0",
"roosterjs-content-model-dom": "^0.27.0",
"roosterjs-content-model-types": "^0.27.0"
},
"version": "0.26.4",
"version": "0.27.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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc