roosterjs-content-model-api 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +46 -42
- package/lib/index.js +52 -43
- package/lib/index.js.map +1 -1
- package/lib/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib/modelApi/block/setModelDirection.js.map +1 -1
- package/lib/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib/modelApi/common/wrapBlock.js.map +1 -1
- package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.js +2 -1
- package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib/modelApi/link/matchLink.d.ts +1 -18
- package/lib/modelApi/link/matchLink.js +0 -1
- package/lib/modelApi/link/matchLink.js.map +1 -1
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib/modelApi/list/setListType.js.map +1 -1
- package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib/modelApi/table/alignTable.js.map +1 -1
- package/lib/modelApi/table/alignTableCell.js.map +1 -1
- package/lib/modelApi/table/canMergeCells.js.map +1 -1
- package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib/modelApi/table/createTableStructure.js.map +1 -1
- package/lib/modelApi/table/deleteTable.js.map +1 -1
- package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib/modelApi/table/insertTableRow.js.map +1 -1
- package/lib/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib/publicApi/block/setAlignment.d.ts +1 -1
- package/lib/publicApi/block/setAlignment.js +2 -1
- package/lib/publicApi/block/setAlignment.js.map +1 -1
- package/lib/publicApi/block/setDirection.d.ts +1 -1
- package/lib/publicApi/block/setDirection.js +2 -1
- package/lib/publicApi/block/setDirection.js.map +1 -1
- package/lib/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib/publicApi/block/setHeadingLevel.js +2 -1
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib/publicApi/block/setIndentation.d.ts +1 -1
- package/lib/publicApi/block/setIndentation.js +2 -1
- package/lib/publicApi/block/setIndentation.js.map +1 -1
- package/lib/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib/publicApi/block/setParagraphMargin.js +2 -1
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib/publicApi/block/setSpacing.d.ts +1 -1
- package/lib/publicApi/block/setSpacing.js +2 -1
- package/lib/publicApi/block/setSpacing.js.map +1 -1
- package/lib/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib/publicApi/block/toggleBlockQuote.js +2 -1
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib/publicApi/entity/insertEntity.d.ts +2 -2
- package/lib/publicApi/entity/insertEntity.js +2 -1
- package/lib/publicApi/entity/insertEntity.js.map +1 -1
- package/lib/publicApi/format/clearFormat.d.ts +1 -1
- package/lib/publicApi/format/clearFormat.js +2 -1
- package/lib/publicApi/format/clearFormat.js.map +1 -1
- package/lib/publicApi/format/getFormatState.d.ts +1 -1
- package/lib/publicApi/format/getFormatState.js +2 -1
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib/publicApi/image/adjustImageSelection.js +2 -1
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib/publicApi/image/changeImage.d.ts +1 -1
- package/lib/publicApi/image/changeImage.js +3 -2
- package/lib/publicApi/image/changeImage.js.map +1 -1
- package/lib/publicApi/image/insertImage.d.ts +1 -1
- package/lib/publicApi/image/insertImage.js +2 -1
- package/lib/publicApi/image/insertImage.js.map +1 -1
- package/lib/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib/publicApi/image/setImageAltText.js +3 -2
- package/lib/publicApi/image/setImageAltText.js.map +1 -1
- package/lib/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib/publicApi/image/setImageBorder.js +4 -3
- package/lib/publicApi/image/setImageBorder.js.map +1 -1
- package/lib/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib/publicApi/image/setImageBoxShadow.js +3 -2
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib/publicApi/link/adjustLinkSelection.js +2 -1
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib/publicApi/link/insertLink.d.ts +1 -1
- package/lib/publicApi/link/insertLink.js +2 -1
- package/lib/publicApi/link/insertLink.js.map +1 -1
- package/lib/publicApi/link/removeLink.d.ts +1 -1
- package/lib/publicApi/link/removeLink.js +2 -1
- package/lib/publicApi/link/removeLink.js.map +1 -1
- package/lib/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib/publicApi/list/setListStartNumber.js +2 -1
- package/lib/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib/publicApi/list/setListStyle.d.ts +1 -1
- package/lib/publicApi/list/setListStyle.js +2 -1
- package/lib/publicApi/list/setListStyle.js.map +1 -1
- package/lib/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib/publicApi/list/toggleBullet.js +2 -1
- package/lib/publicApi/list/toggleBullet.js.map +1 -1
- package/lib/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib/publicApi/list/toggleNumbering.js +2 -1
- package/lib/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib/publicApi/segment/applySegmentFormat.js +2 -1
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib/publicApi/segment/changeCapitalization.js +2 -1
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib/publicApi/segment/changeFontSize.js +2 -1
- package/lib/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib/publicApi/segment/setBackgroundColor.js +2 -1
- package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib/publicApi/segment/setFontName.d.ts +1 -1
- package/lib/publicApi/segment/setFontName.js +2 -1
- package/lib/publicApi/segment/setFontName.js.map +1 -1
- package/lib/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib/publicApi/segment/setFontSize.js +2 -2
- package/lib/publicApi/segment/setFontSize.js.map +1 -1
- package/lib/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib/publicApi/segment/setTextColor.js +2 -1
- package/lib/publicApi/segment/setTextColor.js.map +1 -1
- package/lib/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib/publicApi/segment/toggleBold.js +2 -1
- package/lib/publicApi/segment/toggleBold.js.map +1 -1
- package/lib/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib/publicApi/segment/toggleCode.js +2 -1
- package/lib/publicApi/segment/toggleCode.js.map +1 -1
- package/lib/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib/publicApi/segment/toggleItalic.js +2 -1
- package/lib/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib/publicApi/segment/toggleSubscript.js +2 -1
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib/publicApi/segment/toggleSuperscript.js +2 -1
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib/publicApi/segment/toggleUnderline.js +2 -1
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.js +2 -1
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib/publicApi/table/editTable.d.ts +1 -1
- package/lib/publicApi/table/editTable.js +2 -1
- package/lib/publicApi/table/editTable.js.map +1 -1
- package/lib/publicApi/table/formatTable.d.ts +1 -1
- package/lib/publicApi/table/formatTable.js +2 -1
- package/lib/publicApi/table/formatTable.js.map +1 -1
- package/lib/publicApi/table/insertTable.d.ts +1 -1
- package/lib/publicApi/table/insertTable.js +2 -1
- package/lib/publicApi/table/insertTable.js.map +1 -1
- package/lib/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib/publicApi/table/setTableCellShade.js +2 -1
- package/lib/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +4 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +7 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-amd/index.d.ts +46 -42
- package/lib-amd/index.js +48 -44
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.js +2 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
- package/lib-amd/modelApi/link/matchLink.js +0 -1
- package/lib-amd/modelApi/link/matchLink.js.map +1 -1
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-amd/modelApi/list/setListType.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-amd/modelApi/table/alignTable.js.map +1 -1
- package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-amd/publicApi/block/setAlignment.d.ts +1 -1
- package/lib-amd/publicApi/block/setAlignment.js +2 -1
- package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
- package/lib-amd/publicApi/block/setDirection.d.ts +1 -1
- package/lib-amd/publicApi/block/setDirection.js +2 -1
- package/lib-amd/publicApi/block/setDirection.js.map +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
- package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-amd/publicApi/block/setIndentation.d.ts +1 -1
- package/lib-amd/publicApi/block/setIndentation.js +2 -1
- package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
- package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-amd/publicApi/block/setSpacing.d.ts +1 -1
- package/lib-amd/publicApi/block/setSpacing.js +2 -1
- package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-amd/publicApi/entity/insertEntity.d.ts +2 -2
- package/lib-amd/publicApi/entity/insertEntity.js +2 -1
- package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-amd/publicApi/format/clearFormat.d.ts +1 -1
- package/lib-amd/publicApi/format/clearFormat.js +2 -1
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.d.ts +1 -1
- package/lib-amd/publicApi/format/getFormatState.js +2 -1
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
- package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-amd/publicApi/image/changeImage.d.ts +1 -1
- package/lib-amd/publicApi/image/changeImage.js +3 -2
- package/lib-amd/publicApi/image/changeImage.js.map +1 -1
- package/lib-amd/publicApi/image/insertImage.d.ts +1 -1
- package/lib-amd/publicApi/image/insertImage.js +2 -1
- package/lib-amd/publicApi/image/insertImage.js.map +1 -1
- package/lib-amd/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageAltText.js +3 -2
- package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageBorder.js +4 -3
- package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
- package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.js +2 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-amd/publicApi/link/insertLink.d.ts +1 -1
- package/lib-amd/publicApi/link/insertLink.js +2 -1
- package/lib-amd/publicApi/link/insertLink.js.map +1 -1
- package/lib-amd/publicApi/link/removeLink.d.ts +1 -1
- package/lib-amd/publicApi/link/removeLink.js +2 -1
- package/lib-amd/publicApi/link/removeLink.js.map +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.js +2 -1
- package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-amd/publicApi/list/setListStyle.d.ts +1 -1
- package/lib-amd/publicApi/list/setListStyle.js +2 -1
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
- package/lib-amd/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib-amd/publicApi/list/toggleBullet.js +2 -1
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.js +2 -1
- package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
- package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
- package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.js +2 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontName.d.ts +1 -1
- package/lib-amd/publicApi/segment/setFontName.js +2 -1
- package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib-amd/publicApi/segment/setFontSize.js +2 -2
- package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib-amd/publicApi/segment/setTextColor.js +2 -1
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleBold.js +2 -1
- package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleCode.js +2 -1
- package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
- package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
- package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
- package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.js +2 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-amd/publicApi/table/editTable.d.ts +1 -1
- package/lib-amd/publicApi/table/editTable.js +2 -1
- package/lib-amd/publicApi/table/editTable.js.map +1 -1
- package/lib-amd/publicApi/table/formatTable.d.ts +1 -1
- package/lib-amd/publicApi/table/formatTable.js +2 -1
- package/lib-amd/publicApi/table/formatTable.js.map +1 -1
- package/lib-amd/publicApi/table/insertTable.d.ts +1 -1
- package/lib-amd/publicApi/table/insertTable.js +2 -1
- package/lib-amd/publicApi/table/insertTable.js.map +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.js +2 -1
- package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +4 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +7 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-mjs/index.d.ts +46 -42
- package/lib-mjs/index.js +46 -42
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
- package/lib-mjs/modelApi/link/matchLink.js +0 -1
- package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-mjs/modelApi/list/setListType.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-mjs/publicApi/block/setAlignment.d.ts +1 -1
- package/lib-mjs/publicApi/block/setAlignment.js +1 -1
- package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
- package/lib-mjs/publicApi/block/setDirection.d.ts +1 -1
- package/lib-mjs/publicApi/block/setDirection.js +1 -1
- package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-mjs/publicApi/block/setIndentation.d.ts +1 -1
- package/lib-mjs/publicApi/block/setIndentation.js +1 -1
- package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-mjs/publicApi/block/setSpacing.d.ts +1 -1
- package/lib-mjs/publicApi/block/setSpacing.js +1 -1
- package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-mjs/publicApi/entity/insertEntity.d.ts +2 -2
- package/lib-mjs/publicApi/entity/insertEntity.js +1 -1
- package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-mjs/publicApi/format/clearFormat.d.ts +1 -1
- package/lib-mjs/publicApi/format/clearFormat.js +1 -1
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.d.ts +1 -1
- package/lib-mjs/publicApi/format/getFormatState.js +1 -1
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-mjs/publicApi/image/changeImage.d.ts +1 -1
- package/lib-mjs/publicApi/image/changeImage.js +2 -2
- package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
- package/lib-mjs/publicApi/image/insertImage.d.ts +1 -1
- package/lib-mjs/publicApi/image/insertImage.js +1 -1
- package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
- package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
- package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
- package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.js +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-mjs/publicApi/link/insertLink.d.ts +1 -1
- package/lib-mjs/publicApi/link/insertLink.js +1 -1
- package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
- package/lib-mjs/publicApi/link/removeLink.d.ts +1 -1
- package/lib-mjs/publicApi/link/removeLink.js +1 -1
- package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.js +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStyle.d.ts +1 -1
- package/lib-mjs/publicApi/list/setListStyle.js +1 -1
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.js +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.js +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.js +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontName.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setFontName.js +1 -1
- package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.js +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-mjs/publicApi/table/editTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/editTable.js +1 -1
- package/lib-mjs/publicApi/table/editTable.js.map +1 -1
- package/lib-mjs/publicApi/table/formatTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/formatTable.js +1 -1
- package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
- package/lib-mjs/publicApi/table/insertTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/insertTable.js +1 -1
- package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.js +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +4 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +7 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearSelectedCells.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"clearSelectedCells.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/clearSelectedCells.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,GAA8B;QACvF,IACI,GAAG,CAAC,WAAW,IAAI,CAAC;YACpB,GAAG,CAAC,QAAQ,IAAI,CAAC;YACjB,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM;YACpC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EACjC;YACE,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC1B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;oBACpD,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC1B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;oBACxB,IAAA,2CAAY,EAAC,IAAI,CAAC,CAAC;iBACtB;aACJ;SACJ;IACL,CAAC;IAhBD,gDAgBC","sourcesContent":["import { setSelection } from 'roosterjs-content-model-core';\nimport type { ContentModelTable, TableSelectionCoordinates } from 'roosterjs-content-model-types';\n\n/**\n * Clear selection of a table.\n * @internal\n * @param table The table model where the selection is to be cleared\n * @param sel The selection coordinates to be cleared\n */\nexport function clearSelectedCells(table: ContentModelTable, sel: TableSelectionCoordinates) {\n if (\n sel.firstColumn >= 0 &&\n sel.firstRow >= 0 &&\n sel.lastColumn < table.widths.length &&\n sel.lastRow < table.rows.length\n ) {\n for (let i = sel.firstRow; i <= sel.lastRow; i++) {\n const row = table.rows[i];\n for (let j = sel.firstColumn; j <= sel.lastColumn; j++) {\n const cell = row.cells[j];\n cell.isSelected = false;\n setSelection(cell);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTableStructure.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"createTableStructure.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/createTableStructure.ts"],"names":[],"mappings":";;;;IAGA;;OAEG;IACH,SAAgB,oBAAoB,CAChC,MAA8B,EAC9B,OAAe,EACf,IAAY;QAEZ,IAAM,KAAK,GAAG,IAAA,yCAAW,EAAC,IAAI,CAAC,CAAC;QAEhC,IAAA,sCAAQ,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAExB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;YAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;gBAC9B,IAAM,IAAI,GAAG,IAAA,6CAAe,GAAE,CAAC;gBAE/B,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACxB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACjB,CAAC;IAlBD,oDAkBC","sourcesContent":["import { addBlock, createTable, createTableCell } from 'roosterjs-content-model-dom';\nimport type { ContentModelBlockGroup, ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function createTableStructure(\n parent: ContentModelBlockGroup,\n columns: number,\n rows: number\n): ContentModelTable {\n const table = createTable(rows);\n\n addBlock(parent, table);\n\n table.rows.forEach(row => {\n for (let i = 0; i < columns; i++) {\n const cell = createTableCell();\n\n row.cells.push(cell);\n }\n });\n\n return table;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteTable.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"deleteTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/deleteTable.ts"],"names":[],"mappings":";;;;IAEA;;OAEG;IACH,SAAgB,WAAW,CAAC,KAAwB;QAChD,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,aAAa,CAAC;IAC/B,CAAC;IAHD,kCAGC","sourcesContent":["import type { ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function deleteTable(table: ContentModelTable) {\n table.rows = [];\n delete table.cachedElement;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteTableColumn.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"deleteTableColumn.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/deleteTableColumn.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,iBAAiB,CAAC,KAAwB;QACtD,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;YACL,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;gBAC7D,IAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;gBAErE,IAAI,aAAa,EAAE;oBACf,aAAa,CAAC,QAAQ;wBAClB,aAAa,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;iBACtF;gBAED,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,CAC7B,GAAG,CAAC,WAAW,EACf,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,WAAW,GAAG,CAAC,CACvC,CAAC;aACL;YAED,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;YAC3E,IAAA,+CAAsB,EAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC3C;IACL,CAAC;IArBD,8CAqBC","sourcesContent":["import { collapseTableSelection } from '../selection/collapseTableSelection';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function deleteTableColumn(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n for (let rowIndex = 0; rowIndex < table.rows.length; rowIndex++) {\n const cellInNextCol = table.rows[rowIndex].cells[sel.lastColumn + 1];\n\n if (cellInNextCol) {\n cellInNextCol.spanLeft =\n cellInNextCol.spanLeft && table.rows[rowIndex].cells[sel.firstColumn].spanLeft;\n }\n\n table.rows[rowIndex].cells.splice(\n sel.firstColumn,\n sel.lastColumn - sel.firstColumn + 1\n );\n }\n\n table.widths.splice(sel.firstColumn, sel.lastColumn - sel.firstColumn + 1);\n collapseTableSelection(table.rows, sel);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteTableRow.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"deleteTableRow.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/deleteTableRow.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,cAAc,CAAC,KAAwB;QACnD,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;YACL,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,QAAQ;;gBAClD,IAAM,aAAa,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAEnE,IAAI,aAAa,EAAE;oBACf,aAAa,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;iBACvE;YACL,CAAC,CAAC,CAAC;YAEH,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;YAEhE,IAAA,+CAAsB,EAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC3C;IACL,CAAC;IAhBD,wCAgBC","sourcesContent":["import { collapseTableSelection } from '../selection/collapseTableSelection';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function deleteTableRow(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n table.rows[sel.firstRow].cells.forEach((cell, colIndex) => {\n const cellInNextRow = table.rows[sel.lastRow + 1]?.cells[colIndex];\n\n if (cellInNextRow) {\n cellInNextRow.spanAbove = cellInNextRow.spanAbove && cell.spanAbove;\n }\n });\n\n table.rows.splice(sel.firstRow, sel.lastRow - sel.firstRow + 1);\n\n collapseTableSelection(table.rows, sel);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureFocusableParagraphForTable.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"ensureFocusableParagraphForTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/ensureFocusableParagraphForTable.ts"],"names":[],"mappings":";;;;IASA;;;;;OAKG;IACH,SAAgB,gCAAgC,CAC5C,KAA2B,EAC3B,IAA8B,EAC9B,KAAwB;;QAExB,IAAI,SAA4C,CAAC;QACjD,IAAM,SAAS,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAApB,CAAoB,CAAC,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAE9E,IAAI,SAAS,EAAE;YACX,kDAAkD;YAClD,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAC/B,UAAC,KAAK,IAAqC,OAAA,KAAK,CAAC,SAAS,IAAI,WAAW,EAA9B,CAA8B,CAC5E,CAAC,CAAC,CAAC,CAAC;YAEL,IAAI,CAAC,SAAS,EAAE;gBACZ,0DAA0D;gBAC1D,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBACxC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACpC;SACJ;aAAM;YACH,4GAA4G;YAC5G,IAAI,KAAK,GAAsB,KAAK,CAAC;YACrC,IAAI,QAA0C,CAAC;YAC/C,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAExC,2GAA2G;YAC3G,wGAAwG;YACxG,OAAO,CAAC,QAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;gBAC5B,IAAM,KAAK,GAAG,MAAA,QAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC,CAAC;gBAEjD,IAAI,QAAM,IAAI,KAAK,IAAI,CAAC,EAAE;oBACtB,QAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;iBAC7C;gBAED,IACI,QAAM,CAAC,cAAc,IAAI,iBAAiB;oBAC1C,QAAM,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC;oBACzB,QAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,EAC/B;oBACE,2FAA2F;oBAC3F,KAAK,GAAG,QAAM,CAAC;iBAClB;qBAAM;oBACH,kEAAkE;oBAClE,MAAM;iBACT;aACJ;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAjDD,4EAiDC;IAED,SAAS,oBAAoB,CAAC,KAA2B;QACrD,IAAM,OAAO,GAAG,IAAA,6CAAe,EAAC,KAAK,CAAC,cAAc,EAAE,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/F,IAAM,EAAE,GAAG,IAAA,sCAAQ,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAElC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAE1B,OAAO,OAAO,CAAC;IACnB,CAAC","sourcesContent":["import { createBr, createParagraph } from 'roosterjs-content-model-dom';\nimport type {\n ContentModelBlock,\n ContentModelBlockGroup,\n ContentModelDocument,\n ContentModelParagraph,\n ContentModelTable,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * After edit table, it maybe in a abnormal state, e.g. selected table cell is removed, or all rows are removed causes no place to put cursor.\n * We need to make sure table is in normal state, and there is a place to put cursor.\n * @returns a new paragraph that can but put focus in, or undefined if not needed\n */\nexport function ensureFocusableParagraphForTable(\n model: ContentModelDocument,\n path: ContentModelBlockGroup[],\n table: ContentModelTable\n): ContentModelParagraph | undefined {\n let paragraph: ContentModelParagraph | undefined;\n const firstCell = table.rows.filter(row => row.cells.length > 0)[0]?.cells[0];\n\n if (firstCell) {\n // When there is a valid cell to put focus, use it\n paragraph = firstCell.blocks.filter(\n (block): block is ContentModelParagraph => block.blockType == 'Paragraph'\n )[0];\n\n if (!paragraph) {\n // If there is not a paragraph under this cell, create one\n paragraph = createEmptyParagraph(model);\n firstCell.blocks.push(paragraph);\n }\n } else {\n // No table cell at all, which means the whole table is deleted. So we need to remove it from content model.\n let block: ContentModelBlock = table;\n let parent: ContentModelBlockGroup | undefined;\n paragraph = createEmptyParagraph(model);\n\n // If the table is the only block of its parent and parent is a FormatContainer, remove the parent as well.\n // We need to do this in a loop in case there are multiple layer of FormatContainer that match this case\n while ((parent = path.shift())) {\n const index = parent.blocks.indexOf(block) ?? -1;\n\n if (parent && index >= 0) {\n parent.blocks.splice(index, 1, paragraph);\n }\n\n if (\n parent.blockGroupType == 'FormatContainer' &&\n parent.blocks.length == 1 &&\n parent.blocks[0] == paragraph\n ) {\n // If the new paragraph is the only child of parent format container, unwrap parent as well\n block = parent;\n } else {\n // Otherwise, just stop here and keep processing the new paragraph\n break;\n }\n }\n }\n\n return paragraph;\n}\n\nfunction createEmptyParagraph(model: ContentModelDocument) {\n const newPara = createParagraph(false /*isImplicit*/, undefined /*blockFormat*/, model.format);\n const br = createBr(model.format);\n\n newPara.segments.push(br);\n\n return newPara;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertTableColumn.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"insertTableColumn.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/insertTableColumn.ts"],"names":[],"mappings":";;;;IAQA;;;;OAIG;IACH,SAAgB,iBAAiB,CAC7B,KAAwB,EACxB,SAAyC;QAEzC,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;QAE7C,IAAI,GAAG,EAAE;YACL,IAAA,uCAAkB,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;gBACrD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBAClB,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;oBAEtE,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;oBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;oBAE1B,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;gBACpF,CAAC,CAAC,CAAC;gBACH,KAAK,CAAC,MAAM,CAAC,MAAM,CACf,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EACjD,CAAC,EACD,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAC9D,CAAC;aACL;SACJ;IACL,CAAC;IA/BD,8CA+BC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\nimport { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableHorizontalInsertOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * Insert a column to the table\n * @param table The table model where the column is to be inserted\n * @param operation The operation to be performed\n */\nexport function insertTableColumn(\n table: ContentModelTable,\n operation: TableHorizontalInsertOperation\n) {\n const sel = getSelectedCells(table);\n const insertLeft = operation == 'insertLeft';\n\n if (sel) {\n clearSelectedCells(table, sel);\n for (let i = sel?.firstColumn; i <= sel.lastColumn; i++) {\n table.rows.forEach(row => {\n const cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];\n\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format,\n cell.dataset\n );\n newCell.isSelected = true;\n\n row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);\n });\n table.widths.splice(\n insertLeft ? sel.firstColumn : sel.lastColumn + 1,\n 0,\n table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]\n );\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertTableRow.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"insertTableRow.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/insertTableRow.ts"],"names":[],"mappings":";;;;IAQA;;;;OAIG;IACH,SAAgB,cAAc,CAAC,KAAwB,EAAE,SAAuC;QAC5F,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QACpC,IAAM,WAAW,GAAG,SAAS,IAAI,aAAa,CAAC;QAE/C,IAAI,GAAG,EAAE;YACL,IAAA,uCAAkB,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;gBAC9C,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAEvE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE;oBAC/D,MAAM,4BAAO,SAAS,CAAC,MAAM,CAAE;oBAC/B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;wBAC3B,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;wBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;wBAC1B,OAAO,OAAO,CAAC;oBACnB,CAAC,CAAC;oBACF,MAAM,EAAE,SAAS,CAAC,MAAM;iBAC3B,CAAC,CAAC;aACN;SACJ;IACL,CAAC;IA1BD,wCA0BC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\nimport { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableVerticalInsertOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * Insert a row to the table\n * @param table The table model where the row is to be inserted\n * @param operation The operation to be performed\n */\nexport function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation) {\n const sel = getSelectedCells(table);\n const insertAbove = operation == 'insertAbove';\n\n if (sel) {\n clearSelectedCells(table, sel);\n for (let i = sel.firstRow; i <= sel.lastRow; i++) {\n const sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];\n\n table.rows.splice(insertAbove ? sel.firstRow : sel.lastRow + 1, 0, {\n format: { ...sourceRow.format },\n cells: sourceRow.cells.map(cell => {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format,\n cell.dataset\n );\n newCell.isSelected = true;\n return newCell;\n }),\n height: sourceRow.height,\n });\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTableCells.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"mergeTableCells.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/mergeTableCells.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,eAAe,CAAC,KAAwB;QACpD,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IACI,GAAG;YACH,IAAA,6BAAa,EAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,EACvF;YACE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;oBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAElD,IAAI,IAAI,EAAE;wBACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC;wBAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;wBAEzC,OAAO,IAAI,CAAC,aAAa,CAAC;qBAC7B;iBACJ;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;aAC7C;SACJ;IACL,CAAC;IAtBD,0CAsBC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableCells(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (\n sel &&\n canMergeCells(table.rows, sel.firstRow, sel.firstColumn, sel.lastRow, sel.lastColumn)\n ) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = table.rows[rowIndex].cells[colIndex];\n\n if (cell) {\n cell.spanLeft = colIndex > sel.firstColumn;\n cell.spanAbove = rowIndex > sel.firstRow;\n\n delete cell.cachedElement;\n }\n }\n\n delete table.rows[rowIndex].cachedElement;\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTableColumn.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"mergeTableColumn.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/mergeTableColumn.ts"],"names":[],"mappings":";;;;IAOA;;OAEG;IACH,SAAgB,gBAAgB,CAC5B,KAAwB,EACxB,SAAwC;;QAExC,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QACpC,IAAM,SAAS,GAAG,SAAS,IAAI,WAAW,CAAC;QAE3C,IAAI,GAAG,EAAE;YACL,IAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;YAEzE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;gBACrE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;oBACnE,IAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,eAAe,CAAC,CAAC;oBAE1D,IACI,IAAI;wBACJ,IAAA,6BAAa,EACT,KAAK,CAAC,IAAI,EACV,QAAQ,EACR,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,CAClB,EACH;wBACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;wBAErB,IAAI,cAAc,GAAG,eAAe,CAAC;wBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,0CAAE,QAAQ,EAAE;4BAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;4BAChE,cAAc,EAAE,CAAC;yBACpB;wBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,EAAE;4BAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;4BAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;yBACnE;wBAED,OAAO,IAAI,CAAC,aAAa,CAAC;qBAC7B;oBAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;iBAC7C;aACJ;SACJ;IACL,CAAC;IA9CD,4CA8CC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableHorizontalMergeOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableColumn(\n table: ContentModelTable,\n operation: TableHorizontalMergeOperation\n) {\n const sel = getSelectedCells(table);\n const mergeLeft = operation == 'mergeLeft';\n\n if (sel) {\n const mergingColIndex = mergeLeft ? sel.firstColumn : sel.lastColumn + 1;\n\n if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = table.rows[rowIndex]?.cells[mergingColIndex];\n\n if (\n cell &&\n canMergeCells(\n table.rows,\n rowIndex,\n mergingColIndex - 1,\n rowIndex,\n mergingColIndex\n )\n ) {\n cell.spanLeft = true;\n\n let newSelectedCol = mergingColIndex;\n\n while (table.rows[rowIndex]?.cells[newSelectedCol]?.spanLeft) {\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\n newSelectedCol--;\n }\n\n if (table.rows[rowIndex]?.cells[newSelectedCol]) {\n table.rows[rowIndex].cells[newSelectedCol].isSelected = true;\n\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\n }\n\n delete cell.cachedElement;\n }\n\n delete table.rows[rowIndex].cachedElement;\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/mergeTableRow.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,SAAsC;;QAC1F,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;QAE7C,IAAI,GAAG,EAAE;YACL,IAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;YAEpE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;gBAC5D,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;oBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAEzD,IACI,IAAI;wBACJ,IAAA,6BAAa,EACT,KAAK,CAAC,IAAI,EACV,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,EACf,QAAQ,CACX,EACH;wBACE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;wBAEtB,IAAI,cAAc,GAAG,eAAe,CAAC;wBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,0CAAE,SAAS,EAAE;4BAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;4BAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;4BAChD,cAAc,EAAE,CAAC;yBACpB;wBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;4BAC7C,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;4BAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;4BAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;yBACnD;wBAED,OAAO,IAAI,CAAC,aAAa,CAAC;qBAC7B;iBACJ;aACJ;SACJ;IACL,CAAC;IA3CD,sCA2CC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation) {\n const sel = getSelectedCells(table);\n const mergeAbove = operation == 'mergeAbove';\n\n if (sel) {\n const mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;\n\n if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = table.rows[mergingRowIndex].cells[colIndex];\n\n if (\n cell &&\n canMergeCells(\n table.rows,\n mergingRowIndex - 1,\n colIndex,\n mergingRowIndex,\n colIndex\n )\n ) {\n cell.spanAbove = true;\n\n let newSelectedRow = mergingRowIndex;\n\n while (table.rows[newSelectedRow]?.cells[colIndex]?.spanAbove) {\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n newSelectedRow--;\n }\n\n if (table.rows[newSelectedRow]?.cells[colIndex]) {\n table.rows[newSelectedRow].cells[colIndex].isSelected = true;\n\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n }\n\n delete cell.cachedElement;\n }\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitTableCellHorizontally.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"splitTableCellHorizontally.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/splitTableCellHorizontally.ts"],"names":[],"mappings":";;;;IAIA,IAAM,SAAS,GAAG,EAAE,CAAC;IAErB;;OAEG;IACH,SAAgB,0BAA0B,CAAC,KAAwB;QAC/D,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;oCACI,QAAQ;gBACb,IACI,KAAK,CAAC,IAAI,CAAC,KAAK,CACZ,UAAC,GAAG,EAAE,QAAQ;;oBACV,OAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ;wBACvB,QAAQ,GAAG,GAAG,CAAC,OAAO;yBACtB,MAAA,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,0CAAE,QAAQ,CAAA,CAAA;iBAAA,CACxC,EACH;oBACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;wBAC7B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAEzC,IAAI,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE;4BACrD,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC;4BACzC,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;yBAChD;oBACL,CAAC,CAAC,CAAC;iBACN;qBAAM;oBACH,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;wBAC7B,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;wBACjC,IAAI,IAAI,EAAE;4BACN,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;4BAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;4BAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE;gCACnD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;6BAC3B;iCAAM;gCACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;6BACxC;4BACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;4BAE3C,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;yBAC5C;oBACL,CAAC,CAAC,CAAC;oBAEH,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;oBAEjE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBACxD;;YA5CL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,UAAU,EAAE,QAAQ,IAAI,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE;wBAAlE,QAAQ;aA6ChB;SACJ;IACL,CAAC;IAnDD,gEAmDC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\nconst MIN_WIDTH = 30;\n\n/**\n * @internal\n */\nexport function splitTableCellHorizontally(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n for (let colIndex = sel.lastColumn; colIndex >= sel.firstColumn; colIndex--) {\n if (\n table.rows.every(\n (row, rowIndex) =>\n rowIndex < sel.firstRow ||\n rowIndex > sel.lastRow ||\n row.cells[colIndex + 1]?.spanLeft\n )\n ) {\n table.rows.forEach((row, rowIndex) => {\n delete row.cells[colIndex].cachedElement;\n\n if (rowIndex >= sel.firstRow && rowIndex <= sel.lastRow) {\n row.cells[colIndex + 1].spanLeft = false;\n delete row.cells[colIndex + 1].cachedElement;\n }\n });\n } else {\n table.rows.forEach((row, rowIndex) => {\n const cell = row.cells[colIndex];\n if (cell) {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format\n );\n\n newCell.dataset = { ...cell.dataset };\n\n if (rowIndex < sel.firstRow || rowIndex > sel.lastRow) {\n newCell.spanLeft = true;\n } else {\n newCell.isSelected = cell.isSelected;\n }\n row.cells.splice(colIndex + 1, 0, newCell);\n\n delete row.cells[colIndex].cachedElement;\n }\n });\n\n const newWidth = Math.max(table.widths[colIndex] / 2, MIN_WIDTH);\n\n table.widths.splice(colIndex, 1, newWidth, newWidth);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitTableCellVertically.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"splitTableCellVertically.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/table/splitTableCellVertically.ts"],"names":[],"mappings":";;;;IAIA,IAAM,UAAU,GAAG,EAAE,CAAC;IAEtB;;OAEG;IACH,SAAgB,wBAAwB,CAAC,KAAwB;QAC7D,IAAM,GAAG,GAAG,IAAA,+CAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;YACL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjC,IAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;gBAE1C,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,OAAO,IAAI,CAAC,aAAa,CAAC;gBAC9B,CAAC,CAAC,CAAC;gBAEH,OAAO,GAAG,CAAC,aAAa,CAAC;gBAEzB,IACI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,KAAK,CACjB,UAAC,SAAS,EAAE,QAAQ;oBAChB,OAAA,QAAQ,GAAG,GAAG,CAAC,WAAW;wBAC1B,QAAQ,GAAG,GAAG,CAAC,UAAU;wBACzB,SAAS,CAAC,SAAS;gBAFnB,CAEmB,CAC1B,EACH;oBACE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,SAAS,EAAE,QAAQ;wBACvC,IAAI,QAAQ,IAAI,GAAG,CAAC,WAAW,IAAI,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE;4BAC3D,SAAS,CAAC,SAAS,GAAG,KAAK,CAAC;4BAC5B,OAAO,SAAS,CAAC,aAAa,CAAC;yBAClC;oBACL,CAAC,CAAC,CAAC;oBAEH,OAAO,QAAQ,CAAC,aAAa,CAAC;iBACjC;qBAAM;oBACH,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;oBAC1D,IAAM,MAAM,GAAyB;wBACjC,MAAM,4BAAO,GAAG,CAAC,MAAM,CAAE;wBACzB,MAAM,EAAE,SAAS;wBACjB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,QAAQ;4BAChC,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;4BAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;4BAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,IAAI,QAAQ,GAAG,GAAG,CAAC,UAAU,EAAE;gCACzD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;6BAC5B;iCAAM;gCACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;6BACxC;4BAED,OAAO,OAAO,CAAC;wBACnB,CAAC,CAAC;qBACL,CAAC;oBAEF,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC;oBACvB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;iBAC9C;aACJ;SACJ;IACL,CAAC;IA5DD,4DA4DC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable, ContentModelTableRow } from 'roosterjs-content-model-types';\n\nconst MIN_HEIGHT = 22;\n\n/**\n * @internal\n */\nexport function splitTableCellVertically(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n for (let rowIndex = sel.lastRow; rowIndex >= sel.firstRow; rowIndex--) {\n const row = table.rows[rowIndex];\n const belowRow = table.rows[rowIndex + 1];\n\n row.cells.forEach(cell => {\n delete cell.cachedElement;\n });\n\n delete row.cachedElement;\n\n if (\n belowRow?.cells.every(\n (belowCell, colIndex) =>\n colIndex < sel.firstColumn ||\n colIndex > sel.lastColumn ||\n belowCell.spanAbove\n )\n ) {\n belowRow.cells.forEach((belowCell, colIndex) => {\n if (colIndex >= sel.firstColumn && colIndex <= sel.lastColumn) {\n belowCell.spanAbove = false;\n delete belowCell.cachedElement;\n }\n });\n\n delete belowRow.cachedElement;\n } else {\n const newHeight = Math.max((row.height /= 2), MIN_HEIGHT);\n const newRow: ContentModelTableRow = {\n format: { ...row.format },\n height: newHeight,\n cells: row.cells.map((cell, colIndex) => {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format\n );\n\n newCell.dataset = { ...cell.dataset };\n\n if (colIndex < sel.firstColumn || colIndex > sel.lastColumn) {\n newCell.spanAbove = true;\n } else {\n newCell.isSelected = cell.isSelected;\n }\n\n return newCell;\n }),\n };\n\n row.height = newHeight;\n table.rows.splice(rowIndex + 1, 0, newRow);\n }\n }\n }\n}\n"]}
|
|
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
4
4
|
* @param editor The editor to set alignment
|
|
5
5
|
* @param alignment Alignment value: left, center or right
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function setAlignment(editor: IEditor, alignment: 'left' | 'center' | 'right' | 'justify'): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "../../modelApi/block/setModelAlignment"], function (require, exports, setModelAlignment_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setAlignment = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Set text alignment of selected paragraphs
|
|
6
7
|
* @param editor The editor to set alignment
|
|
@@ -12,6 +13,6 @@ define(["require", "exports", "../../modelApi/block/setModelAlignment"], functio
|
|
|
12
13
|
apiName: 'setAlignment',
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
exports.
|
|
16
|
+
exports.setAlignment = setAlignment;
|
|
16
17
|
});
|
|
17
18
|
//# sourceMappingURL=setAlignment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setAlignment.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setAlignment.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setAlignment.ts"],"names":[],"mappings":";;;;IAGA;;;;OAIG;IACH,SAAgB,YAAY,CAAC,MAAe,EAAE,SAAkD;QAC5F,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;YACpE,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;IACP,CAAC;IAND,oCAMC","sourcesContent":["import { setModelAlignment } from '../../modelApi/block/setModelAlignment';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text alignment of selected paragraphs\n * @param editor The editor to set alignment\n * @param alignment Alignment value: left, center or right\n */\nexport function setAlignment(editor: IEditor, alignment: 'left' | 'center' | 'right' | 'justify') {\n editor.focus();\n\n editor.formatContentModel(model => setModelAlignment(model, alignment), {\n apiName: 'setAlignment',\n });\n}\n"]}
|
|
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
4
4
|
* @param editor The editor to set alignment
|
|
5
5
|
* @param direction Direction value: ltr (Left to right) or rtl (Right to left)
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function setDirection(editor: IEditor, direction: 'ltr' | 'rtl'): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "../../modelApi/block/setModelDirection"], function (require, exports, setModelDirection_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setDirection = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Set text direction of selected paragraphs (Left to right or Right to left)
|
|
6
7
|
* @param editor The editor to set alignment
|
|
@@ -12,6 +13,6 @@ define(["require", "exports", "../../modelApi/block/setModelDirection"], functio
|
|
|
12
13
|
apiName: 'setDirection',
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
exports.
|
|
16
|
+
exports.setDirection = setDirection;
|
|
16
17
|
});
|
|
17
18
|
//# sourceMappingURL=setDirection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setDirection.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setDirection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setDirection.ts"],"names":[],"mappings":";;;;IAGA;;;;OAIG;IACH,SAAgB,YAAY,CAAC,MAAe,EAAE,SAAwB;QAClE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;YACpE,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;IACP,CAAC;IAND,oCAMC","sourcesContent":["import { setModelDirection } from '../../modelApi/block/setModelDirection';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text direction of selected paragraphs (Left to right or Right to left)\n * @param editor The editor to set alignment\n * @param direction Direction value: ltr (Left to right) or rtl (Right to left)\n */\nexport function setDirection(editor: IEditor, direction: 'ltr' | 'rtl') {\n editor.focus();\n\n editor.formatContentModel(model => setModelDirection(model, direction), {\n apiName: 'setDirection',\n });\n}\n"]}
|
|
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
4
4
|
* @param editor The editor to set heading level to
|
|
5
5
|
* @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function setHeadingLevel(editor: IEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setHeadingLevel = void 0;
|
|
4
5
|
var HeaderFontSizes = {
|
|
5
6
|
h1: '2em',
|
|
6
7
|
h2: '1.5em',
|
|
@@ -41,7 +42,7 @@ define(["require", "exports", "../utils/formatParagraphWithContentModel"], funct
|
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
|
-
exports.
|
|
45
|
+
exports.setHeadingLevel = setHeadingLevel;
|
|
45
46
|
function getExistingHeadingTag(decorator) {
|
|
46
47
|
var tag = (decorator === null || decorator === void 0 ? void 0 : decorator.tagName) || '';
|
|
47
48
|
var level = parseInt(tag.substring(1));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setHeadingLevel.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setHeadingLevel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setHeadingLevel.ts"],"names":[],"mappings":";;;;IAKA,IAAM,eAAe,GAAqC;QACtD,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,OAAO;QACX,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;KACf,CAAC;IAEF;;;;OAIG;IACH,SAAgB,eAAe,CAAC,MAAe,EAAE,YAAuC;QACpF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,iBAAiB,EAAE,UAAA,IAAI;YAC3D,IAAM,OAAO,GACT,YAAY,GAAG,CAAC;gBACZ,CAAC,CAAE,CAAC,GAAG,GAAG,YAAY,CAA6B;gBACnD,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAEhD,IAAI,YAAY,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,SAAS,GAAG;oBACb,OAAO,EAAE,OAAQ;oBACjB,MAAM,EAAE,OAAO;wBACX,CAAC,CAAC;4BACI,UAAU,EAAE,MAAM;4BAClB,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC;yBACrC;wBACH,CAAC,CAAC,EAAE;iBACX,CAAC;gBAEF,uEAAuE;gBACvE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;oBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;oBAC/B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;gBACrC,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,OAAO,EAAE;gBAChB,OAAO,IAAI,CAAC,SAAS,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IA7BD,0CA6BC;IAED,SAAS,qBAAqB,CAC1B,SAA0C;QAE1C,IAAM,GAAG,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,EAAE,CAAC;QACrC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzC,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAE,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC;IACvE,CAAC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { ContentModelParagraphDecorator, IEditor } from 'roosterjs-content-model-types';\n\ntype HeadingLevelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nconst HeaderFontSizes: Record<HeadingLevelTags, string> = {\n h1: '2em',\n h2: '1.5em',\n h3: '1.17em',\n h4: '1em',\n h5: '0.83em',\n h6: '0.67em',\n};\n\n/**\n * Set heading level of selected paragraphs\n * @param editor The editor to set heading level to\n * @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph\n */\nexport function setHeadingLevel(editor: IEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setHeadingLevel', para => {\n const tagName =\n headingLevel > 0\n ? (('h' + headingLevel) as HeadingLevelTags | null)\n : getExistingHeadingTag(para.decorator);\n\n if (headingLevel > 0) {\n para.decorator = {\n tagName: tagName!,\n format: tagName\n ? {\n fontWeight: 'bold',\n fontSize: HeaderFontSizes[tagName],\n }\n : {},\n };\n\n // Remove existing formats since tags have default font size and weight\n para.segments.forEach(segment => {\n delete segment.format.fontSize;\n delete segment.format.fontWeight;\n });\n } else if (tagName) {\n delete para.decorator;\n }\n });\n}\n\nfunction getExistingHeadingTag(\n decorator?: ContentModelParagraphDecorator\n): HeadingLevelTags | null {\n const tag = decorator?.tagName || '';\n const level = parseInt(tag.substring(1));\n\n return level >= 1 && level <= 6 ? (tag as HeadingLevelTags) : null;\n}\n"]}
|
|
@@ -5,4 +5,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
5
5
|
* @param indentation Whether indent or outdent
|
|
6
6
|
* @param length The length of pixel to indent/outdent @default 40
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "roosterjs-content-model-dom", "../../modelApi/block/setModelIndentation"], function (require, exports, roosterjs_content_model_dom_1, setModelIndentation_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setIndentation = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Indent or outdent to selected paragraphs
|
|
6
7
|
* @param editor The editor to operate on
|
|
@@ -20,6 +21,6 @@ define(["require", "exports", "roosterjs-content-model-dom", "../../modelApi/blo
|
|
|
20
21
|
apiName: 'setIndentation',
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
exports.
|
|
24
|
+
exports.setIndentation = setIndentation;
|
|
24
25
|
});
|
|
25
26
|
//# sourceMappingURL=setIndentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setIndentation.ts"],"names":[],"mappings":";;;;IAIA;;;;;OAKG;IACH,SAAgB,cAAc,CAC1B,MAAe,EACf,WAAiC,EACjC,MAAe;QAEf,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAM,MAAM,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YAE/D,IAAI,MAAM,EAAE;gBACR,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;aAChC;YAED,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,MAAM,CAAC;QAClB,CAAC,EACD;YACI,OAAO,EAAE,gBAAgB;SAC5B,CACJ,CAAC;IACN,CAAC;IAvBD,wCAuBC","sourcesContent":["import { normalizeContentModel } from 'roosterjs-content-model-dom';\nimport { setModelIndentation } from '../../modelApi/block/setModelIndentation';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Indent or outdent to selected paragraphs\n * @param editor The editor to operate on\n * @param indentation Whether indent or outdent\n * @param length The length of pixel to indent/outdent @default 40\n */\nexport function setIndentation(\n editor: IEditor,\n indentation: 'indent' | 'outdent',\n length?: number\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const result = setModelIndentation(model, indentation, length);\n\n if (result) {\n normalizeContentModel(model);\n }\n\n context.newPendingFormat = 'preserve';\n\n return result;\n },\n {\n apiName: 'setIndentation',\n }\n );\n}\n"]}
|
|
@@ -6,4 +6,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
6
6
|
* @param marginTop value for top margin
|
|
7
7
|
* @param marginBottom value for bottom margin
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatParagraphWithContentModel"], function (require, exports, roosterjs_content_model_dom_1, formatParagraphWithContentModel_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setParagraphMargin = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Toggles the current block(s) margin properties.
|
|
6
7
|
* null deletes any existing value, undefined is ignored
|
|
@@ -28,6 +29,6 @@ define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatPar
|
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
|
-
exports.
|
|
32
|
+
exports.setParagraphMargin = setParagraphMargin;
|
|
32
33
|
});
|
|
33
34
|
//# sourceMappingURL=setParagraphMargin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setParagraphMargin.ts"],"names":[],"mappings":";;;;IAIA;;;;;;OAMG;IACH,SAAgB,kBAAkB,CAC9B,MAAe,EACf,SAAyB,EACzB,YAA4B;QAE5B,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,oBAAoB,EAAE,UAAA,IAAI;YAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACjB,IAAI,CAAC,SAAS,GAAG,IAAA,sDAAwB,EAAC,GAAG,CAAC,CAAC;aAClD;YAED,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;aACrC;iBAAM,IAAI,SAAS,KAAK,IAAI,EAAE;gBAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;aAChC;YAED,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;aAC3C;iBAAM,IAAI,YAAY,KAAK,IAAI,EAAE;gBAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;aACnC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAxBD,gDAwBC","sourcesContent":["import { createParagraphDecorator } from 'roosterjs-content-model-dom';\nimport { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggles the current block(s) margin properties.\n * null deletes any existing value, undefined is ignored\n * @param editor The editor to operate on\n * @param marginTop value for top margin\n * @param marginBottom value for bottom margin\n */\nexport function setParagraphMargin(\n editor: IEditor,\n marginTop?: string | null,\n marginBottom?: string | null\n) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setParagraphMargin', para => {\n if (!para.decorator) {\n para.decorator = createParagraphDecorator('p');\n }\n\n if (marginTop) {\n para.format.marginTop = marginTop;\n } else if (marginTop === null) {\n delete para.format.marginTop;\n }\n\n if (marginBottom) {\n para.format.marginBottom = marginBottom;\n } else if (marginBottom === null) {\n delete para.format.marginBottom;\n }\n });\n}\n"]}
|
|
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
|
|
|
4
4
|
* @param editor The editor to operate on
|
|
5
5
|
* @param spacing Unitless/px value to set line height
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function setSpacing(editor: IEditor, spacing: number | string): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setSpacing = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
6
7
|
* @param editor The editor to operate on
|
|
@@ -17,6 +18,6 @@ define(["require", "exports", "../utils/formatParagraphWithContentModel"], funct
|
|
|
17
18
|
});
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
exports.
|
|
21
|
+
exports.setSpacing = setSpacing;
|
|
21
22
|
});
|
|
22
23
|
//# sourceMappingURL=setSpacing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setSpacing.ts"],"names":[],"mappings":";;;;IAGA;;;;OAIG;IACH,SAAgB,UAAU,CAAC,MAAe,EAAE,OAAwB;QAChE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,YAAY,EAAE,UAAA,SAAS;YAC3D,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBAC9B,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;oBAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;iBACpC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAXD,gCAWC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Sets current selected block(s) line-height property and wipes such property from child segments\n * @param editor The editor to operate on\n * @param spacing Unitless/px value to set line height\n */\nexport function setSpacing(editor: IEditor, spacing: number | string) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setSpacing', paragraph => {\n paragraph.format.lineHeight = spacing.toString();\n paragraph.segments.forEach(segment => {\n if (segment.format.lineHeight) {\n delete segment.format.lineHeight;\n }\n });\n });\n}\n"]}
|
|
@@ -6,4 +6,4 @@ import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-conte
|
|
|
6
6
|
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
7
7
|
* @param quoteFormat @optional Block format for the new quote object
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "tslib", "../../modelApi/block/toggleModelBlockQuote"], function (require, exports, tslib_1, toggleModelBlockQuote_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.toggleBlockQuote = void 0;
|
|
4
5
|
var DefaultQuoteFormatLtr = {
|
|
5
6
|
borderLeft: '3px solid rgb(200, 200, 200)',
|
|
6
7
|
textColor: 'rgb(102, 102, 102)',
|
|
@@ -34,6 +35,6 @@ define(["require", "exports", "tslib", "../../modelApi/block/toggleModelBlockQuo
|
|
|
34
35
|
apiName: 'toggleBlockQuote',
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
exports.
|
|
38
|
+
exports.toggleBlockQuote = toggleBlockQuote;
|
|
38
39
|
});
|
|
39
40
|
//# sourceMappingURL=toggleBlockQuote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/toggleBlockQuote.ts"],"names":[],"mappings":";;;;IAGA,IAAM,qBAAqB,GAAsC;QAC7D,UAAU,EAAE,8BAA8B;QAC1C,SAAS,EAAE,oBAAoB;KAClC,CAAC;IACF,IAAM,qBAAqB,GAAsC;QAC7D,WAAW,EAAE,8BAA8B;QAC3C,SAAS,EAAE,oBAAoB;KAClC,CAAC;IACF,IAAM,kBAAkB,GAAsC;QAC1D,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,MAAM;KACtB,CAAC;IAEF;;;;;;OAMG;IACH,SAAgB,gBAAgB,CAC5B,MAAe,EACf,WAA+C,EAC/C,cAAkD;;QAElD,IAAM,kBAAkB,yEACjB,kBAAkB,KACrB,WAAW,EAAE,MAAM,KAChB,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,qBAAqB,CAAC,CAC5C,CAAC;QACF,IAAM,kBAAkB,yEACjB,kBAAkB,KACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,KAAK,KACb,CAAC,MAAA,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,WAAW,mCAAI,qBAAqB,CAAC,CAC9D,CAAC;QAEF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,6CAAqB,EAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QAChF,CAAC,EACD;YACI,OAAO,EAAE,kBAAkB;SAC9B,CACJ,CAAC;IACN,CAAC;IA7BD,4CA6BC","sourcesContent":["import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';\nimport type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultQuoteFormatLtr: ContentModelFormatContainerFormat = {\n borderLeft: '3px solid rgb(200, 200, 200)',\n textColor: 'rgb(102, 102, 102)',\n};\nconst DefaultQuoteFormatRtl: ContentModelFormatContainerFormat = {\n borderRight: '3px solid rgb(200, 200, 200)',\n textColor: 'rgb(102, 102, 102)',\n};\nconst BuildInQuoteFormat: ContentModelFormatContainerFormat = {\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n};\n\n/**\n * Toggle BLOCKQUOTE state of selected paragraphs.\n * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.\n * Otherwise, unwrap all related BLOCKQUOTEs.\n * @param editor The editor object to toggle BLOCKQUOTE onto\n * @param quoteFormat @optional Block format for the new quote object\n */\nexport function toggleBlockQuote(\n editor: IEditor,\n quoteFormat?: ContentModelFormatContainerFormat,\n quoteFormatRtl?: ContentModelFormatContainerFormat\n) {\n const fullQuoteFormatLtr: ContentModelFormatContainerFormat = {\n ...BuildInQuoteFormat,\n paddingLeft: '10px',\n ...(quoteFormat ?? DefaultQuoteFormatLtr),\n };\n const fullQuoteFormatRtl: ContentModelFormatContainerFormat = {\n ...BuildInQuoteFormat,\n paddingRight: '10px',\n direction: 'rtl',\n ...(quoteFormatRtl ?? quoteFormat ?? DefaultQuoteFormatRtl),\n };\n\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return toggleModelBlockQuote(model, fullQuoteFormatLtr, fullQuoteFormatRtl);\n },\n {\n apiName: 'toggleBlockQuote',\n }\n );\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEnti
|
|
|
10
10
|
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
11
11
|
* @param options Move options to insert. See InsertEntityOptions
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
14
14
|
/**
|
|
15
15
|
* Insert a block entity into editor
|
|
16
16
|
* @param editor The editor object
|
|
@@ -22,4 +22,4 @@ export default function insertEntity(editor: IEditor, type: string, isBlock: boo
|
|
|
22
22
|
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
23
23
|
* @param options Move options to insert. See InsertEntityOptions
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export declare function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
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) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.insertEntity = void 0;
|
|
4
5
|
var BlockEntityTag = 'div';
|
|
5
6
|
var InlineEntityTag = 'span';
|
|
6
7
|
function insertEntity(editor, type, isBlock, position, options) {
|
|
@@ -55,6 +56,6 @@ define(["require", "exports", "roosterjs-content-model-core", "../../modelApi/en
|
|
|
55
56
|
}
|
|
56
57
|
return entityModel;
|
|
57
58
|
}
|
|
58
|
-
exports.
|
|
59
|
+
exports.insertEntity = insertEntity;
|
|
59
60
|
});
|
|
60
61
|
//# sourceMappingURL=insertEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":";;;;IAgBA,IAAM,cAAc,GAAG,KAAK,CAAC;IAC7B,IAAM,eAAe,GAAG,MAAM,CAAC;IAwC/B,SAAgB,YAAY,CACxB,MAAe,EACf,IAAY,EACZ,OAAgB,EAChB,QAA8C,EAC9C,OAA6B;QAEvB,IAAA,KACF,OAAO,IAAI,EAAE,EADT,WAAW,iBAAA,EAAE,gBAAgB,sBAAA,EAAE,cAAc,oBAAA,EAAE,gBAAgB,sBAAA,EAAE,kBAAkB,wBAC1E,CAAC;QAClB,IAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;QACtC,IAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QACnF,IAAM,OAAO,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAEzE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC;QAEtD,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC3C,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;SACxD;QAED,IAAI,WAAW,EAAE;YACb,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SACpC;QAED,IAAM,WAAW,GAAG,IAAA,0CAAY,EAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAE7F,IAAI,CAAC,gBAAgB,EAAE;YACnB,MAAM,CAAC,YAAY,EAAE,CAAC;SACzB;QAED,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAA,qCAAiB,EACb,KAAK,EACL,WAAW,EACX,OAAO,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAChD,OAAO,EACP,gBAAgB,EAChB,OAAO,CACV,CAAC;YAEF,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;YAE7B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAChC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEtC,OAAO,IAAI,CAAC;QAChB,CAAC,EACD;YACI,iBAAiB,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACtE,YAAY,EAAE,2CAAY,CAAC,YAAY;YACvC,aAAa,EAAE,cAAM,OAAA,CAAC;gBAClB,OAAO,SAAA;gBACP,IAAI,MAAA;gBACJ,EAAE,EAAE,EAAE;gBACN,UAAU,EAAE,IAAI;aACnB,CAAC,EALmB,CAKnB;YACF,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;QAEF,IAAI,CAAC,gBAAgB,EAAE;YACnB,IAAI,WAAW,SAAyB,CAAC;YAEzC,IAAI,kBAAkB,EAAE;gBACpB,IAAM,MAAM,GAAG,IAAA,+CAAiB,EAAC,OAAO,CAAC,CAAC;gBAClC,IAAA,EAAE,GAAiB,MAAM,GAAvB,EAAE,UAAU,GAAK,MAAM,WAAX,CAAY;gBAElC,WAAW;oBACP,EAAE,IAAI,UAAU;wBACZ,CAAC,CAAC;4BACI,EAAE,EAAE,EAAE;4BACN,IAAI,EAAE,UAAU;4BAChB,KAAK,EAAE,kBAAkB;yBAC5B;wBACH,CAAC,CAAC,SAAS,CAAC;aACvB;YAED,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;SACpC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IAlFD,oCAkFC","sourcesContent":["import { ChangeSource } from 'roosterjs-content-model-core';\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\nimport {\n createEntity,\n normalizeContentModel,\n parseEntityFormat,\n} from 'roosterjs-content-model-dom';\nimport type {\n ContentModelEntity,\n DOMSelection,\n InsertEntityPosition,\n InsertEntityOptions,\n IEditor,\n EntityState,\n} from 'roosterjs-content-model-types';\n\nconst BlockEntityTag = 'div';\nconst InlineEntityTag = 'span';\n\n/**\n * Insert an entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock True to insert a block entity, false to insert an inline entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position: 'focus' | 'begin' | 'end' | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\n/**\n * Insert a block entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock Must be true for a block entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: true,\n position: InsertEntityPosition | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position?: InsertEntityPosition | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null {\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot, initialEntityState } =\n options || {};\n const document = editor.getDocument();\n const wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\n\n wrapper.style.setProperty('display', display || null);\n\n if (display == undefined && isBlock) {\n wrapper.style.setProperty('width', '100%');\n wrapper.style.setProperty('display', 'inline-block');\n }\n\n if (contentNode) {\n wrapper.appendChild(contentNode);\n }\n\n const entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);\n\n if (!skipUndoSnapshot) {\n editor.takeSnapshot();\n }\n\n editor.formatContentModel(\n (model, context) => {\n insertEntityModel(\n model,\n entityModel,\n typeof position == 'string' ? position : 'focus',\n isBlock,\n focusAfterEntity,\n context\n );\n\n normalizeContentModel(model);\n\n context.skipUndoSnapshot = true;\n context.newEntities.push(entityModel);\n\n return true;\n },\n {\n selectionOverride: typeof position === 'object' ? position : undefined,\n changeSource: ChangeSource.InsertEntity,\n getChangeData: () => ({\n wrapper,\n type,\n id: '',\n isReadonly: true,\n }),\n apiName: 'insertEntity',\n }\n );\n\n if (!skipUndoSnapshot) {\n let entityState: EntityState | undefined;\n\n if (initialEntityState) {\n const format = parseEntityFormat(wrapper);\n const { id, entityType } = format;\n\n entityState =\n id && entityType\n ? {\n id: id,\n type: entityType,\n state: initialEntityState,\n }\n : undefined;\n }\n\n editor.takeSnapshot(entityState);\n }\n\n return entityModel;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
define(["require", "exports", "../../modelApi/common/clearModelFormat", "roosterjs-content-model-dom"], function (require, exports, clearModelFormat_1, roosterjs_content_model_dom_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearFormat = void 0;
|
|
4
5
|
/**
|
|
5
6
|
* Clear format of selection
|
|
6
7
|
* @param editor The editor to clear format from
|
|
@@ -18,6 +19,6 @@ define(["require", "exports", "../../modelApi/common/clearModelFormat", "rooster
|
|
|
18
19
|
apiName: 'clearFormat',
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.
|
|
22
|
+
exports.clearFormat = clearFormat;
|
|
22
23
|
});
|
|
23
24
|
//# sourceMappingURL=clearFormat.js.map
|