roosterjs-content-model-api 0.20.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/LICENSE +25 -0
- package/README.md +262 -0
- package/lib/index.d.ts +45 -0
- package/lib/index.js +94 -0
- package/lib/index.js.map +1 -0
- package/lib/modelApi/block/setModelAlignment.d.ts +5 -0
- package/lib/modelApi/block/setModelAlignment.js +53 -0
- package/lib/modelApi/block/setModelAlignment.js.map +1 -0
- package/lib/modelApi/block/setModelDirection.d.ts +5 -0
- package/lib/modelApi/block/setModelDirection.js +53 -0
- package/lib/modelApi/block/setModelDirection.js.map +1 -0
- package/lib/modelApi/block/setModelIndentation.d.ts +5 -0
- package/lib/modelApi/block/setModelIndentation.js +48 -0
- package/lib/modelApi/block/setModelIndentation.js.map +1 -0
- package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
- package/lib/modelApi/block/toggleModelBlockQuote.js +49 -0
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -0
- package/lib/modelApi/common/clearModelFormat.d.ts +5 -0
- package/lib/modelApi/common/clearModelFormat.js +130 -0
- package/lib/modelApi/common/clearModelFormat.js.map +1 -0
- package/lib/modelApi/common/retrieveModelFormatState.d.ts +5 -0
- package/lib/modelApi/common/retrieveModelFormatState.js +172 -0
- package/lib/modelApi/common/retrieveModelFormatState.js.map +1 -0
- package/lib/modelApi/common/wrapBlock.d.ts +16 -0
- package/lib/modelApi/common/wrapBlock.js +45 -0
- package/lib/modelApi/common/wrapBlock.js.map +1 -0
- package/lib/modelApi/domUtils/readFile.d.ts +8 -0
- package/lib/modelApi/domUtils/readFile.js +24 -0
- package/lib/modelApi/domUtils/readFile.js.map +1 -0
- package/lib/modelApi/entity/insertEntityModel.d.ts +5 -0
- package/lib/modelApi/entity/insertEntityModel.js +76 -0
- package/lib/modelApi/entity/insertEntityModel.js.map +1 -0
- package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -0
- package/lib/modelApi/image/applyImageBorderFormat.js +58 -0
- package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -0
- package/lib/modelApi/list/findListItemsInSameThread.d.ts +5 -0
- package/lib/modelApi/list/findListItemsInSameThread.js +113 -0
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -0
- package/lib/modelApi/list/setListType.d.ts +5 -0
- package/lib/modelApi/list/setListType.js +92 -0
- package/lib/modelApi/list/setListType.js.map +1 -0
- package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
- package/lib/modelApi/selection/adjustSegmentSelection.js +48 -0
- package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -0
- package/lib/modelApi/selection/adjustWordSelection.d.ts +5 -0
- package/lib/modelApi/selection/adjustWordSelection.js +122 -0
- package/lib/modelApi/selection/adjustWordSelection.js.map +1 -0
- package/lib/modelApi/selection/collapseTableSelection.d.ts +6 -0
- package/lib/modelApi/selection/collapseTableSelection.js +17 -0
- package/lib/modelApi/selection/collapseTableSelection.js.map +1 -0
- package/lib/modelApi/table/alignTable.d.ts +5 -0
- package/lib/modelApi/table/alignTable.js +13 -0
- package/lib/modelApi/table/alignTable.js.map +1 -0
- package/lib/modelApi/table/alignTableCell.d.ts +9 -0
- package/lib/modelApi/table/alignTableCell.js +60 -0
- package/lib/modelApi/table/alignTableCell.js.map +1 -0
- package/lib/modelApi/table/canMergeCells.d.ts +5 -0
- package/lib/modelApi/table/canMergeCells.js +57 -0
- package/lib/modelApi/table/canMergeCells.js.map +1 -0
- package/lib/modelApi/table/createTableStructure.d.ts +5 -0
- package/lib/modelApi/table/createTableStructure.js +20 -0
- package/lib/modelApi/table/createTableStructure.js.map +1 -0
- package/lib/modelApi/table/deleteTable.d.ts +5 -0
- package/lib/modelApi/table/deleteTable.js +12 -0
- package/lib/modelApi/table/deleteTable.js.map +1 -0
- package/lib/modelApi/table/deleteTableColumn.d.ts +5 -0
- package/lib/modelApi/table/deleteTableColumn.js +25 -0
- package/lib/modelApi/table/deleteTableColumn.js.map +1 -0
- package/lib/modelApi/table/deleteTableRow.d.ts +5 -0
- package/lib/modelApi/table/deleteTableRow.js +24 -0
- package/lib/modelApi/table/deleteTableRow.js.map +1 -0
- package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js +57 -0
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
- package/lib/modelApi/table/getSelectedCells.d.ts +14 -0
- package/lib/modelApi/table/getSelectedCells.js +32 -0
- package/lib/modelApi/table/getSelectedCells.js.map +1 -0
- package/lib/modelApi/table/insertTableColumn.d.ts +5 -0
- package/lib/modelApi/table/insertTableColumn.js +23 -0
- package/lib/modelApi/table/insertTableColumn.js.map +1 -0
- package/lib/modelApi/table/insertTableRow.d.ts +5 -0
- package/lib/modelApi/table/insertTableRow.js +27 -0
- package/lib/modelApi/table/insertTableRow.js.map +1 -0
- package/lib/modelApi/table/mergeTableCells.d.ts +5 -0
- package/lib/modelApi/table/mergeTableCells.js +26 -0
- package/lib/modelApi/table/mergeTableCells.js.map +1 -0
- package/lib/modelApi/table/mergeTableColumn.d.ts +5 -0
- package/lib/modelApi/table/mergeTableColumn.js +38 -0
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -0
- package/lib/modelApi/table/mergeTableRow.d.ts +5 -0
- package/lib/modelApi/table/mergeTableRow.js +39 -0
- package/lib/modelApi/table/mergeTableRow.js.map +1 -0
- package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
- package/lib/modelApi/table/splitTableCellHorizontally.js +55 -0
- package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -0
- package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -0
- package/lib/modelApi/table/splitTableCellVertically.js +56 -0
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -0
- package/lib/publicApi/block/setAlignment.d.ts +7 -0
- package/lib/publicApi/block/setAlignment.js +16 -0
- package/lib/publicApi/block/setAlignment.js.map +1 -0
- package/lib/publicApi/block/setDirection.d.ts +7 -0
- package/lib/publicApi/block/setDirection.js +16 -0
- package/lib/publicApi/block/setDirection.js.map +1 -0
- package/lib/publicApi/block/setHeadingLevel.d.ts +7 -0
- package/lib/publicApi/block/setHeadingLevel.js +50 -0
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -0
- package/lib/publicApi/block/setIndentation.d.ts +8 -0
- package/lib/publicApi/block/setIndentation.js +25 -0
- package/lib/publicApi/block/setIndentation.js.map +1 -0
- package/lib/publicApi/block/setParagraphMargin.d.ts +9 -0
- package/lib/publicApi/block/setParagraphMargin.js +33 -0
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -0
- package/lib/publicApi/block/setSpacing.d.ts +7 -0
- package/lib/publicApi/block/setSpacing.js +21 -0
- package/lib/publicApi/block/setSpacing.js.map +1 -0
- package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -0
- package/lib/publicApi/block/toggleBlockQuote.js +35 -0
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -0
- package/lib/publicApi/entity/insertEntity.d.ts +25 -0
- package/lib/publicApi/entity/insertEntity.js +41 -0
- package/lib/publicApi/entity/insertEntity.js.map +1 -0
- package/lib/publicApi/format/clearFormat.d.ts +6 -0
- package/lib/publicApi/format/clearFormat.js +23 -0
- package/lib/publicApi/format/clearFormat.js.map +1 -0
- package/lib/publicApi/format/getFormatState.d.ts +26 -0
- package/lib/publicApi/format/getFormatState.js +83 -0
- package/lib/publicApi/format/getFormatState.js.map +1 -0
- package/lib/publicApi/image/adjustImageSelection.d.ts +6 -0
- package/lib/publicApi/image/adjustImageSelection.js +26 -0
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -0
- package/lib/publicApi/image/changeImage.d.ts +7 -0
- package/lib/publicApi/image/changeImage.js +36 -0
- package/lib/publicApi/image/changeImage.js.map +1 -0
- package/lib/publicApi/image/insertImage.d.ts +7 -0
- package/lib/publicApi/image/insertImage.js +38 -0
- package/lib/publicApi/image/insertImage.js.map +1 -0
- package/lib/publicApi/image/setImageAltText.d.ts +8 -0
- package/lib/publicApi/image/setImageAltText.js +17 -0
- package/lib/publicApi/image/setImageAltText.js.map +1 -0
- package/lib/publicApi/image/setImageBorder.d.ts +9 -0
- package/lib/publicApi/image/setImageBorder.js +19 -0
- package/lib/publicApi/image/setImageBorder.js.map +1 -0
- package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -0
- package/lib/publicApi/image/setImageBoxShadow.js +29 -0
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -0
- package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -0
- package/lib/publicApi/link/adjustLinkSelection.js +34 -0
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -0
- package/lib/publicApi/link/insertLink.d.ts +15 -0
- package/lib/publicApi/link/insertLink.js +127 -0
- package/lib/publicApi/link/insertLink.js.map +1 -0
- package/lib/publicApi/link/removeLink.d.ts +8 -0
- package/lib/publicApi/link/removeLink.js +32 -0
- package/lib/publicApi/link/removeLink.js.map +1 -0
- package/lib/publicApi/list/setListStartNumber.d.ts +7 -0
- package/lib/publicApi/list/setListStartNumber.js +26 -0
- package/lib/publicApi/list/setListStartNumber.js.map +1 -0
- package/lib/publicApi/list/setListStyle.d.ts +7 -0
- package/lib/publicApi/list/setListStyle.js +33 -0
- package/lib/publicApi/list/setListStyle.js.map +1 -0
- package/lib/publicApi/list/toggleBullet.d.ts +8 -0
- package/lib/publicApi/list/toggleBullet.js +20 -0
- package/lib/publicApi/list/toggleBullet.js.map +1 -0
- package/lib/publicApi/list/toggleNumbering.d.ts +8 -0
- package/lib/publicApi/list/toggleNumbering.js +20 -0
- package/lib/publicApi/list/toggleNumbering.js.map +1 -0
- package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -0
- package/lib/publicApi/segment/applySegmentFormat.js +23 -0
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -0
- package/lib/publicApi/segment/changeCapitalization.d.ts +10 -0
- package/lib/publicApi/segment/changeCapitalization.js +50 -0
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -0
- package/lib/publicApi/segment/changeFontSize.d.ts +8 -0
- package/lib/publicApi/segment/changeFontSize.js +62 -0
- package/lib/publicApi/segment/changeFontSize.js.map +1 -0
- package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -0
- package/lib/publicApi/segment/setBackgroundColor.js +36 -0
- package/lib/publicApi/segment/setBackgroundColor.js.map +1 -0
- package/lib/publicApi/segment/setFontName.d.ts +7 -0
- package/lib/publicApi/segment/setFontName.js +19 -0
- package/lib/publicApi/segment/setFontName.js.map +1 -0
- package/lib/publicApi/segment/setFontSize.d.ts +12 -0
- package/lib/publicApi/segment/setFontSize.js +34 -0
- package/lib/publicApi/segment/setFontSize.js.map +1 -0
- package/lib/publicApi/segment/setTextColor.d.ts +7 -0
- package/lib/publicApi/segment/setTextColor.js +26 -0
- package/lib/publicApi/segment/setTextColor.js.map +1 -0
- package/lib/publicApi/segment/toggleBold.d.ts +10 -0
- package/lib/publicApi/segment/toggleBold.js +28 -0
- package/lib/publicApi/segment/toggleBold.js.map +1 -0
- package/lib/publicApi/segment/toggleCode.d.ts +6 -0
- package/lib/publicApi/segment/toggleCode.js +28 -0
- package/lib/publicApi/segment/toggleCode.js.map +1 -0
- package/lib/publicApi/segment/toggleItalic.d.ts +6 -0
- package/lib/publicApi/segment/toggleItalic.js +15 -0
- package/lib/publicApi/segment/toggleItalic.js.map +1 -0
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -0
- package/lib/publicApi/segment/toggleStrikethrough.js +15 -0
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -0
- package/lib/publicApi/segment/toggleSubscript.d.ts +6 -0
- package/lib/publicApi/segment/toggleSubscript.js +15 -0
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -0
- package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -0
- package/lib/publicApi/segment/toggleSuperscript.js +15 -0
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -0
- package/lib/publicApi/segment/toggleUnderline.d.ts +6 -0
- package/lib/publicApi/segment/toggleUnderline.js +18 -0
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -0
- package/lib/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
- package/lib/publicApi/selection/hasSelectionInBlock.js +25 -0
- package/lib/publicApi/selection/hasSelectionInBlock.js.map +1 -0
- package/lib/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
- package/lib/publicApi/selection/hasSelectionInBlockGroup.js +18 -0
- package/lib/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
- package/lib/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
- package/lib/publicApi/selection/hasSelectionInSegment.js +13 -0
- package/lib/publicApi/selection/hasSelectionInSegment.js.map +1 -0
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -0
- package/lib/publicApi/table/applyTableBorderFormat.js +293 -0
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -0
- package/lib/publicApi/table/editTable.d.ts +7 -0
- package/lib/publicApi/table/editTable.js +104 -0
- package/lib/publicApi/table/editTable.js.map +1 -0
- package/lib/publicApi/table/formatTable.d.ts +8 -0
- package/lib/publicApi/table/formatTable.js +38 -0
- package/lib/publicApi/table/formatTable.js.map +1 -0
- package/lib/publicApi/table/insertTable.d.ts +11 -0
- package/lib/publicApi/table/insertTable.js +47 -0
- package/lib/publicApi/table/insertTable.js.map +1 -0
- package/lib/publicApi/table/setTableCellShade.d.ts +7 -0
- package/lib/publicApi/table/setTableCellShade.js +34 -0
- package/lib/publicApi/table/setTableCellShade.js.map +1 -0
- package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
- package/lib/publicApi/utils/formatImageWithContentModel.js +15 -0
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -0
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +19 -0
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +52 -0
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
- package/lib-amd/index.d.ts +45 -0
- package/lib-amd/index.js +51 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -0
- package/lib-amd/modelApi/block/setModelAlignment.js +53 -0
- package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -0
- package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -0
- package/lib-amd/modelApi/block/setModelDirection.js +53 -0
- package/lib-amd/modelApi/block/setModelDirection.js.map +1 -0
- package/lib-amd/modelApi/block/setModelIndentation.d.ts +5 -0
- package/lib-amd/modelApi/block/setModelIndentation.js +48 -0
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -0
- package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js +48 -0
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -0
- package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -0
- package/lib-amd/modelApi/common/clearModelFormat.js +128 -0
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -0
- package/lib-amd/modelApi/common/retrieveModelFormatState.d.ts +5 -0
- package/lib-amd/modelApi/common/retrieveModelFormatState.js +172 -0
- package/lib-amd/modelApi/common/retrieveModelFormatState.js.map +1 -0
- package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -0
- package/lib-amd/modelApi/common/wrapBlock.js +45 -0
- package/lib-amd/modelApi/common/wrapBlock.js.map +1 -0
- package/lib-amd/modelApi/domUtils/readFile.d.ts +8 -0
- package/lib-amd/modelApi/domUtils/readFile.js +26 -0
- package/lib-amd/modelApi/domUtils/readFile.js.map +1 -0
- package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -0
- package/lib-amd/modelApi/entity/insertEntityModel.js +75 -0
- package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -0
- package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -0
- package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -0
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -0
- package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +5 -0
- package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -0
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -0
- package/lib-amd/modelApi/list/setListType.d.ts +5 -0
- package/lib-amd/modelApi/list/setListType.js +92 -0
- package/lib-amd/modelApi/list/setListType.js.map +1 -0
- package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js +49 -0
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -0
- package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +5 -0
- package/lib-amd/modelApi/selection/adjustWordSelection.js +121 -0
- package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -0
- package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +6 -0
- package/lib-amd/modelApi/selection/collapseTableSelection.js +18 -0
- package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -0
- package/lib-amd/modelApi/table/alignTable.d.ts +5 -0
- package/lib-amd/modelApi/table/alignTable.js +15 -0
- package/lib-amd/modelApi/table/alignTable.js.map +1 -0
- package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -0
- package/lib-amd/modelApi/table/alignTableCell.js +60 -0
- package/lib-amd/modelApi/table/alignTableCell.js.map +1 -0
- package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -0
- package/lib-amd/modelApi/table/canMergeCells.js +59 -0
- package/lib-amd/modelApi/table/canMergeCells.js.map +1 -0
- package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -0
- package/lib-amd/modelApi/table/createTableStructure.js +21 -0
- package/lib-amd/modelApi/table/createTableStructure.js.map +1 -0
- package/lib-amd/modelApi/table/deleteTable.d.ts +5 -0
- package/lib-amd/modelApi/table/deleteTable.js +14 -0
- package/lib-amd/modelApi/table/deleteTable.js.map +1 -0
- package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -0
- package/lib-amd/modelApi/table/deleteTableColumn.js +25 -0
- package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -0
- package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -0
- package/lib-amd/modelApi/table/deleteTableRow.js +24 -0
- package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -0
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +58 -0
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
- package/lib-amd/modelApi/table/getSelectedCells.d.ts +14 -0
- package/lib-amd/modelApi/table/getSelectedCells.js +33 -0
- package/lib-amd/modelApi/table/getSelectedCells.js.map +1 -0
- package/lib-amd/modelApi/table/insertTableColumn.d.ts +5 -0
- package/lib-amd/modelApi/table/insertTableColumn.js +23 -0
- package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -0
- package/lib-amd/modelApi/table/insertTableRow.d.ts +5 -0
- package/lib-amd/modelApi/table/insertTableRow.js +26 -0
- package/lib-amd/modelApi/table/insertTableRow.js.map +1 -0
- package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -0
- package/lib-amd/modelApi/table/mergeTableCells.js +26 -0
- package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -0
- package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -0
- package/lib-amd/modelApi/table/mergeTableColumn.js +38 -0
- package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -0
- package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -0
- package/lib-amd/modelApi/table/mergeTableRow.js +39 -0
- package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -0
- package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -0
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -0
- package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -0
- package/lib-amd/modelApi/table/splitTableCellVertically.js +55 -0
- package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -0
- package/lib-amd/publicApi/block/setAlignment.d.ts +7 -0
- package/lib-amd/publicApi/block/setAlignment.js +17 -0
- package/lib-amd/publicApi/block/setAlignment.js.map +1 -0
- package/lib-amd/publicApi/block/setDirection.d.ts +7 -0
- package/lib-amd/publicApi/block/setDirection.js +17 -0
- package/lib-amd/publicApi/block/setDirection.js.map +1 -0
- package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -0
- package/lib-amd/publicApi/block/setHeadingLevel.js +51 -0
- package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -0
- package/lib-amd/publicApi/block/setIndentation.d.ts +8 -0
- package/lib-amd/publicApi/block/setIndentation.js +25 -0
- package/lib-amd/publicApi/block/setIndentation.js.map +1 -0
- package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -0
- package/lib-amd/publicApi/block/setParagraphMargin.js +33 -0
- package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -0
- package/lib-amd/publicApi/block/setSpacing.d.ts +7 -0
- package/lib-amd/publicApi/block/setSpacing.js +22 -0
- package/lib-amd/publicApi/block/setSpacing.js.map +1 -0
- package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -0
- package/lib-amd/publicApi/block/toggleBlockQuote.js +35 -0
- package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -0
- package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -0
- package/lib-amd/publicApi/entity/insertEntity.js +40 -0
- package/lib-amd/publicApi/entity/insertEntity.js.map +1 -0
- package/lib-amd/publicApi/format/clearFormat.d.ts +6 -0
- package/lib-amd/publicApi/format/clearFormat.js +23 -0
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -0
- package/lib-amd/publicApi/format/getFormatState.d.ts +26 -0
- package/lib-amd/publicApi/format/getFormatState.js +81 -0
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -0
- package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -0
- package/lib-amd/publicApi/image/adjustImageSelection.js +27 -0
- package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -0
- package/lib-amd/publicApi/image/changeImage.d.ts +7 -0
- package/lib-amd/publicApi/image/changeImage.js +35 -0
- package/lib-amd/publicApi/image/changeImage.js.map +1 -0
- package/lib-amd/publicApi/image/insertImage.d.ts +7 -0
- package/lib-amd/publicApi/image/insertImage.js +37 -0
- package/lib-amd/publicApi/image/insertImage.js.map +1 -0
- package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -0
- package/lib-amd/publicApi/image/setImageAltText.js +18 -0
- package/lib-amd/publicApi/image/setImageAltText.js.map +1 -0
- package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -0
- package/lib-amd/publicApi/image/setImageBorder.js +19 -0
- package/lib-amd/publicApi/image/setImageBorder.js.map +1 -0
- package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -0
- package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -0
- package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -0
- package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -0
- package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -0
- package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -0
- package/lib-amd/publicApi/link/insertLink.d.ts +15 -0
- package/lib-amd/publicApi/link/insertLink.js +125 -0
- package/lib-amd/publicApi/link/insertLink.js.map +1 -0
- package/lib-amd/publicApi/link/removeLink.d.ts +8 -0
- package/lib-amd/publicApi/link/removeLink.js +32 -0
- package/lib-amd/publicApi/link/removeLink.js.map +1 -0
- package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -0
- package/lib-amd/publicApi/list/setListStartNumber.js +27 -0
- package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -0
- package/lib-amd/publicApi/list/setListStyle.d.ts +7 -0
- package/lib-amd/publicApi/list/setListStyle.js +33 -0
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -0
- package/lib-amd/publicApi/list/toggleBullet.d.ts +8 -0
- package/lib-amd/publicApi/list/toggleBullet.js +21 -0
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -0
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +8 -0
- package/lib-amd/publicApi/list/toggleNumbering.js +21 -0
- package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -0
- package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -0
- package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -0
- package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -0
- package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -0
- package/lib-amd/publicApi/segment/changeCapitalization.js +51 -0
- package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -0
- package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -0
- package/lib-amd/publicApi/segment/changeFontSize.js +61 -0
- package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -0
- package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -0
- package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -0
- package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -0
- package/lib-amd/publicApi/segment/setFontName.d.ts +7 -0
- package/lib-amd/publicApi/segment/setFontName.js +20 -0
- package/lib-amd/publicApi/segment/setFontName.js.map +1 -0
- package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -0
- package/lib-amd/publicApi/segment/setFontSize.js +35 -0
- package/lib-amd/publicApi/segment/setFontSize.js.map +1 -0
- package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -0
- package/lib-amd/publicApi/segment/setTextColor.js +27 -0
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleBold.d.ts +10 -0
- package/lib-amd/publicApi/segment/toggleBold.js +29 -0
- package/lib-amd/publicApi/segment/toggleBold.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleCode.js +28 -0
- package/lib-amd/publicApi/segment/toggleCode.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleItalic.js +16 -0
- package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -0
- package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleSubscript.js +16 -0
- package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -0
- package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -0
- package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -0
- package/lib-amd/publicApi/segment/toggleUnderline.js +19 -0
- package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlock.js +25 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlock.js.map +1 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js +19 -0
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
- package/lib-amd/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
- package/lib-amd/publicApi/selection/hasSelectionInSegment.js +14 -0
- package/lib-amd/publicApi/selection/hasSelectionInSegment.js.map +1 -0
- package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -0
- package/lib-amd/publicApi/table/applyTableBorderFormat.js +291 -0
- package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -0
- package/lib-amd/publicApi/table/editTable.d.ts +7 -0
- package/lib-amd/publicApi/table/editTable.js +89 -0
- package/lib-amd/publicApi/table/editTable.js.map +1 -0
- package/lib-amd/publicApi/table/formatTable.d.ts +8 -0
- package/lib-amd/publicApi/table/formatTable.js +38 -0
- package/lib-amd/publicApi/table/formatTable.js.map +1 -0
- package/lib-amd/publicApi/table/insertTable.d.ts +11 -0
- package/lib-amd/publicApi/table/insertTable.js +46 -0
- package/lib-amd/publicApi/table/insertTable.js.map +1 -0
- package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -0
- package/lib-amd/publicApi/table/setTableCellShade.js +33 -0
- package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -0
- package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +16 -0
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -0
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +20 -0
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +51 -0
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
- package/lib-mjs/index.d.ts +45 -0
- package/lib-mjs/index.js +46 -0
- package/lib-mjs/index.js.map +1 -0
- package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -0
- package/lib-mjs/modelApi/block/setModelAlignment.js +49 -0
- package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -0
- package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -0
- package/lib-mjs/modelApi/block/setModelDirection.js +49 -0
- package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -0
- package/lib-mjs/modelApi/block/setModelIndentation.d.ts +5 -0
- package/lib-mjs/modelApi/block/setModelIndentation.js +44 -0
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -0
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +45 -0
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -0
- package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -0
- package/lib-mjs/modelApi/common/clearModelFormat.js +126 -0
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -0
- package/lib-mjs/modelApi/common/retrieveModelFormatState.d.ts +5 -0
- package/lib-mjs/modelApi/common/retrieveModelFormatState.js +168 -0
- package/lib-mjs/modelApi/common/retrieveModelFormatState.js.map +1 -0
- package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -0
- package/lib-mjs/modelApi/common/wrapBlock.js +40 -0
- package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -0
- package/lib-mjs/modelApi/domUtils/readFile.d.ts +8 -0
- package/lib-mjs/modelApi/domUtils/readFile.js +20 -0
- package/lib-mjs/modelApi/domUtils/readFile.js.map +1 -0
- package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -0
- package/lib-mjs/modelApi/entity/insertEntityModel.js +72 -0
- package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -0
- package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -0
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js +55 -0
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -0
- package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +5 -0
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -0
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -0
- package/lib-mjs/modelApi/list/setListType.d.ts +5 -0
- package/lib-mjs/modelApi/list/setListType.js +88 -0
- package/lib-mjs/modelApi/list/setListType.js.map +1 -0
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +44 -0
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -0
- package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +5 -0
- package/lib-mjs/modelApi/selection/adjustWordSelection.js +118 -0
- package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -0
- package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +6 -0
- package/lib-mjs/modelApi/selection/collapseTableSelection.js +13 -0
- package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -0
- package/lib-mjs/modelApi/table/alignTable.d.ts +5 -0
- package/lib-mjs/modelApi/table/alignTable.js +9 -0
- package/lib-mjs/modelApi/table/alignTable.js.map +1 -0
- package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -0
- package/lib-mjs/modelApi/table/alignTableCell.js +55 -0
- package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -0
- package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -0
- package/lib-mjs/modelApi/table/canMergeCells.js +53 -0
- package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -0
- package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -0
- package/lib-mjs/modelApi/table/createTableStructure.js +16 -0
- package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -0
- package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -0
- package/lib-mjs/modelApi/table/deleteTable.js +8 -0
- package/lib-mjs/modelApi/table/deleteTable.js.map +1 -0
- package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -0
- package/lib-mjs/modelApi/table/deleteTableColumn.js +21 -0
- package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -0
- package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -0
- package/lib-mjs/modelApi/table/deleteTableRow.js +20 -0
- package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -0
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +53 -0
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
- package/lib-mjs/modelApi/table/getSelectedCells.d.ts +14 -0
- package/lib-mjs/modelApi/table/getSelectedCells.js +28 -0
- package/lib-mjs/modelApi/table/getSelectedCells.js.map +1 -0
- package/lib-mjs/modelApi/table/insertTableColumn.d.ts +5 -0
- package/lib-mjs/modelApi/table/insertTableColumn.js +19 -0
- package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -0
- package/lib-mjs/modelApi/table/insertTableRow.d.ts +5 -0
- package/lib-mjs/modelApi/table/insertTableRow.js +23 -0
- package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -0
- package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -0
- package/lib-mjs/modelApi/table/mergeTableCells.js +22 -0
- package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -0
- package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -0
- package/lib-mjs/modelApi/table/mergeTableColumn.js +34 -0
- package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -0
- package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -0
- package/lib-mjs/modelApi/table/mergeTableRow.js +35 -0
- package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -0
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +51 -0
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -0
- package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -0
- package/lib-mjs/modelApi/table/splitTableCellVertically.js +52 -0
- package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -0
- package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -0
- package/lib-mjs/publicApi/block/setAlignment.js +13 -0
- package/lib-mjs/publicApi/block/setAlignment.js.map +1 -0
- package/lib-mjs/publicApi/block/setDirection.d.ts +7 -0
- package/lib-mjs/publicApi/block/setDirection.js +13 -0
- package/lib-mjs/publicApi/block/setDirection.js.map +1 -0
- package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -0
- package/lib-mjs/publicApi/block/setHeadingLevel.js +47 -0
- package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -0
- package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -0
- package/lib-mjs/publicApi/block/setIndentation.js +22 -0
- package/lib-mjs/publicApi/block/setIndentation.js.map +1 -0
- package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -0
- package/lib-mjs/publicApi/block/setParagraphMargin.js +30 -0
- package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -0
- package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -0
- package/lib-mjs/publicApi/block/setSpacing.js +18 -0
- package/lib-mjs/publicApi/block/setSpacing.js.map +1 -0
- package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -0
- package/lib-mjs/publicApi/block/toggleBlockQuote.js +32 -0
- package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -0
- package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -0
- package/lib-mjs/publicApi/entity/insertEntity.js +38 -0
- package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -0
- package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -0
- package/lib-mjs/publicApi/format/clearFormat.js +20 -0
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -0
- package/lib-mjs/publicApi/format/getFormatState.d.ts +26 -0
- package/lib-mjs/publicApi/format/getFormatState.js +78 -0
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -0
- package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -0
- package/lib-mjs/publicApi/image/adjustImageSelection.js +23 -0
- package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -0
- package/lib-mjs/publicApi/image/changeImage.d.ts +7 -0
- package/lib-mjs/publicApi/image/changeImage.js +33 -0
- package/lib-mjs/publicApi/image/changeImage.js.map +1 -0
- package/lib-mjs/publicApi/image/insertImage.d.ts +7 -0
- package/lib-mjs/publicApi/image/insertImage.js +35 -0
- package/lib-mjs/publicApi/image/insertImage.js.map +1 -0
- package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -0
- package/lib-mjs/publicApi/image/setImageAltText.js +14 -0
- package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -0
- package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -0
- package/lib-mjs/publicApi/image/setImageBorder.js +16 -0
- package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -0
- package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -0
- package/lib-mjs/publicApi/image/setImageBoxShadow.js +26 -0
- package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -0
- package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -0
- package/lib-mjs/publicApi/link/adjustLinkSelection.js +31 -0
- package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -0
- package/lib-mjs/publicApi/link/insertLink.d.ts +15 -0
- package/lib-mjs/publicApi/link/insertLink.js +124 -0
- package/lib-mjs/publicApi/link/insertLink.js.map +1 -0
- package/lib-mjs/publicApi/link/removeLink.d.ts +8 -0
- package/lib-mjs/publicApi/link/removeLink.js +29 -0
- package/lib-mjs/publicApi/link/removeLink.js.map +1 -0
- package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -0
- package/lib-mjs/publicApi/list/setListStartNumber.js +23 -0
- package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -0
- package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -0
- package/lib-mjs/publicApi/list/setListStyle.js +30 -0
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -0
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +8 -0
- package/lib-mjs/publicApi/list/toggleBullet.js +17 -0
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -0
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +8 -0
- package/lib-mjs/publicApi/list/toggleNumbering.js +17 -0
- package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -0
- package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -0
- package/lib-mjs/publicApi/segment/applySegmentFormat.js +20 -0
- package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -0
- package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -0
- package/lib-mjs/publicApi/segment/changeCapitalization.js +47 -0
- package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -0
- package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -0
- package/lib-mjs/publicApi/segment/changeFontSize.js +59 -0
- package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -0
- package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -0
- package/lib-mjs/publicApi/segment/setBackgroundColor.js +33 -0
- package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -0
- package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -0
- package/lib-mjs/publicApi/segment/setFontName.js +16 -0
- package/lib-mjs/publicApi/segment/setFontName.js.map +1 -0
- package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -0
- package/lib-mjs/publicApi/segment/setFontSize.js +29 -0
- package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -0
- package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -0
- package/lib-mjs/publicApi/segment/setTextColor.js +23 -0
- package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleBold.d.ts +10 -0
- package/lib-mjs/publicApi/segment/toggleBold.js +23 -0
- package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleCode.js +25 -0
- package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleItalic.js +12 -0
- package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js +12 -0
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleSubscript.js +12 -0
- package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleSuperscript.js +12 -0
- package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -0
- package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -0
- package/lib-mjs/publicApi/segment/toggleUnderline.js +15 -0
- package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.js +22 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.js.map +1 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js +15 -0
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.js +10 -0
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.js.map +1 -0
- package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -0
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js +290 -0
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -0
- package/lib-mjs/publicApi/table/editTable.d.ts +7 -0
- package/lib-mjs/publicApi/table/editTable.js +101 -0
- package/lib-mjs/publicApi/table/editTable.js.map +1 -0
- package/lib-mjs/publicApi/table/formatTable.d.ts +8 -0
- package/lib-mjs/publicApi/table/formatTable.js +35 -0
- package/lib-mjs/publicApi/table/formatTable.js.map +1 -0
- package/lib-mjs/publicApi/table/insertTable.d.ts +11 -0
- package/lib-mjs/publicApi/table/insertTable.js +44 -0
- package/lib-mjs/publicApi/table/insertTable.js.map +1 -0
- package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -0
- package/lib-mjs/publicApi/table/setTableCellShade.js +31 -0
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -0
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +12 -0
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -0
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +15 -0
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +48 -0
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
- package/package.json +21 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeTableColumn = void 0;
|
|
4
|
+
var canMergeCells_1 = require("./canMergeCells");
|
|
5
|
+
var getSelectedCells_1 = require("./getSelectedCells");
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function mergeTableColumn(table, operation) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
var sel = (0, getSelectedCells_1.getSelectedCells)(table);
|
|
12
|
+
var mergeLeft = operation == 'mergeLeft';
|
|
13
|
+
if (sel) {
|
|
14
|
+
var mergingColIndex = mergeLeft ? sel.firstCol : sel.lastCol + 1;
|
|
15
|
+
if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {
|
|
16
|
+
for (var rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {
|
|
17
|
+
var cell = (_a = table.rows[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells[mergingColIndex];
|
|
18
|
+
if (cell &&
|
|
19
|
+
(0, canMergeCells_1.canMergeCells)(table.rows, rowIndex, mergingColIndex - 1, rowIndex, mergingColIndex)) {
|
|
20
|
+
cell.spanLeft = true;
|
|
21
|
+
var newSelectedCol = mergingColIndex;
|
|
22
|
+
while ((_c = (_b = table.rows[rowIndex]) === null || _b === void 0 ? void 0 : _b.cells[newSelectedCol]) === null || _c === void 0 ? void 0 : _c.spanLeft) {
|
|
23
|
+
delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
|
|
24
|
+
newSelectedCol--;
|
|
25
|
+
}
|
|
26
|
+
if ((_d = table.rows[rowIndex]) === null || _d === void 0 ? void 0 : _d.cells[newSelectedCol]) {
|
|
27
|
+
table.rows[rowIndex].cells[newSelectedCol].isSelected = true;
|
|
28
|
+
delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
|
|
29
|
+
}
|
|
30
|
+
delete cell.cachedElement;
|
|
31
|
+
}
|
|
32
|
+
delete table.rows[rowIndex].cachedElement;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.mergeTableColumn = mergeTableColumn;
|
|
38
|
+
//# sourceMappingURL=mergeTableColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeTableColumn.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableColumn.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAChD,uDAAsD;AAMtD;;GAEG;AACH,SAAgB,gBAAgB,CAC5B,KAAwB,EACxB,SAAwC;;IAExC,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IACpC,IAAM,SAAS,GAAG,SAAS,IAAI,WAAW,CAAC;IAE3C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;QAEnE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YACrE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBAE1D,IACI,IAAI;oBACJ,IAAA,6BAAa,EACT,KAAK,CAAC,IAAI,EACV,QAAQ,EACR,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,CAClB,EACH;oBACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAErB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,0CAAE,QAAQ,EAAE;wBAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChE,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnE;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;aAC7C;SACJ;KACJ;AACL,CAAC;AA9CD,4CA8CC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from './getSelectedCells';\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.firstCol : sel.lastCol + 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"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeTableRow = void 0;
|
|
4
|
+
var canMergeCells_1 = require("./canMergeCells");
|
|
5
|
+
var getSelectedCells_1 = require("./getSelectedCells");
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function mergeTableRow(table, operation) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
var sel = (0, getSelectedCells_1.getSelectedCells)(table);
|
|
12
|
+
var mergeAbove = operation == 'mergeAbove';
|
|
13
|
+
if (sel) {
|
|
14
|
+
var mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;
|
|
15
|
+
if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {
|
|
16
|
+
for (var colIndex = sel.firstCol; colIndex <= sel.lastCol; colIndex++) {
|
|
17
|
+
var cell = table.rows[mergingRowIndex].cells[colIndex];
|
|
18
|
+
if (cell &&
|
|
19
|
+
(0, canMergeCells_1.canMergeCells)(table.rows, mergingRowIndex - 1, colIndex, mergingRowIndex, colIndex)) {
|
|
20
|
+
cell.spanAbove = true;
|
|
21
|
+
var newSelectedRow = mergingRowIndex;
|
|
22
|
+
while ((_b = (_a = table.rows[newSelectedRow]) === null || _a === void 0 ? void 0 : _a.cells[colIndex]) === null || _b === void 0 ? void 0 : _b.spanAbove) {
|
|
23
|
+
delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
|
|
24
|
+
delete table.rows[newSelectedRow].cachedElement;
|
|
25
|
+
newSelectedRow--;
|
|
26
|
+
}
|
|
27
|
+
if ((_c = table.rows[newSelectedRow]) === null || _c === void 0 ? void 0 : _c.cells[colIndex]) {
|
|
28
|
+
table.rows[newSelectedRow].cells[colIndex].isSelected = true;
|
|
29
|
+
delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
|
|
30
|
+
delete table.rows[newSelectedRow].cachedElement;
|
|
31
|
+
}
|
|
32
|
+
delete cell.cachedElement;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.mergeTableRow = mergeTableRow;
|
|
39
|
+
//# sourceMappingURL=mergeTableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableRow.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAChD,uDAAsD;AAGtD;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,SAAsC;;IAC1F,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;IAE7C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;QAEpE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5D,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAEzD,IACI,IAAI;oBACJ,IAAA,6BAAa,EACT,KAAK,CAAC,IAAI,EACV,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,EACf,QAAQ,CACX,EACH;oBACE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBAEtB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,0CAAE,SAAS,EAAE;wBAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChD,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnD;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;aACJ;SACJ;KACJ;AACL,CAAC;AA3CD,sCA2CC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from './getSelectedCells';\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.firstCol; colIndex <= sel.lastCol; 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"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTableCellHorizontally = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
6
|
+
var getSelectedCells_1 = require("./getSelectedCells");
|
|
7
|
+
var MIN_WIDTH = 30;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function splitTableCellHorizontally(table) {
|
|
12
|
+
var sel = (0, getSelectedCells_1.getSelectedCells)(table);
|
|
13
|
+
if (sel) {
|
|
14
|
+
var _loop_1 = function (colIndex) {
|
|
15
|
+
if (table.rows.every(function (row, rowIndex) {
|
|
16
|
+
var _a;
|
|
17
|
+
return rowIndex < sel.firstRow ||
|
|
18
|
+
rowIndex > sel.lastRow ||
|
|
19
|
+
((_a = row.cells[colIndex + 1]) === null || _a === void 0 ? void 0 : _a.spanLeft);
|
|
20
|
+
})) {
|
|
21
|
+
table.rows.forEach(function (row, rowIndex) {
|
|
22
|
+
delete row.cells[colIndex].cachedElement;
|
|
23
|
+
if (rowIndex >= sel.firstRow && rowIndex <= sel.lastRow) {
|
|
24
|
+
row.cells[colIndex + 1].spanLeft = false;
|
|
25
|
+
delete row.cells[colIndex + 1].cachedElement;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
table.rows.forEach(function (row, rowIndex) {
|
|
31
|
+
var cell = row.cells[colIndex];
|
|
32
|
+
if (cell) {
|
|
33
|
+
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format);
|
|
34
|
+
newCell.dataset = (0, tslib_1.__assign)({}, cell.dataset);
|
|
35
|
+
if (rowIndex < sel.firstRow || rowIndex > sel.lastRow) {
|
|
36
|
+
newCell.spanLeft = true;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
newCell.isSelected = cell.isSelected;
|
|
40
|
+
}
|
|
41
|
+
row.cells.splice(colIndex + 1, 0, newCell);
|
|
42
|
+
delete row.cells[colIndex].cachedElement;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
var newWidth = Math.max(table.widths[colIndex] / 2, MIN_WIDTH);
|
|
46
|
+
table.widths.splice(colIndex, 1, newWidth, newWidth);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
for (var colIndex = sel.lastCol; colIndex >= sel.firstCol; colIndex--) {
|
|
50
|
+
_loop_1(colIndex);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.splitTableCellHorizontally = splitTableCellHorizontally;
|
|
55
|
+
//# sourceMappingURL=splitTableCellHorizontally.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitTableCellHorizontally.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/splitTableCellHorizontally.ts"],"names":[],"mappings":";;;;AAAA,2EAA8D;AAC9D,uDAAsD;AAGtD,IAAM,SAAS,GAAG,EAAE,CAAC;AAErB;;GAEG;AACH,SAAgB,0BAA0B,CAAC,KAAwB;IAC/D,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,EAAE;gCACI,QAAQ;YACb,IACI,KAAK,CAAC,IAAI,CAAC,KAAK,CACZ,UAAC,GAAG,EAAE,QAAQ;;gBACV,OAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ;oBACvB,QAAQ,GAAG,GAAG,CAAC,OAAO;qBACtB,MAAA,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,0CAAE,QAAQ,CAAA,CAAA;aAAA,CACxC,EACH;gBACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;oBAC7B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;oBAEzC,IAAI,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE;wBACrD,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC;wBACzC,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;qBAChD;gBACL,CAAC,CAAC,CAAC;aACN;iBAAM;gBACH,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;oBAC7B,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBACjC,IAAI,IAAI,EAAE;wBACN,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;wBAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;wBAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE;4BACnD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;yBAC3B;6BAAM;4BACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;yBACxC;wBACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;wBAE3C,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;qBAC5C;gBACL,CAAC,CAAC,CAAC;gBAEH,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;gBAEjE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;aACxD;;QA5CL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE;oBAA5D,QAAQ;SA6ChB;KACJ;AACL,CAAC;AAnDD,gEAmDC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from './getSelectedCells';\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.lastCol; colIndex >= sel.firstCol; 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"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTableCellVertically = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
6
|
+
var getSelectedCells_1 = require("./getSelectedCells");
|
|
7
|
+
var MIN_HEIGHT = 22;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function splitTableCellVertically(table) {
|
|
12
|
+
var sel = (0, getSelectedCells_1.getSelectedCells)(table);
|
|
13
|
+
if (sel) {
|
|
14
|
+
for (var rowIndex = sel.lastRow; rowIndex >= sel.firstRow; rowIndex--) {
|
|
15
|
+
var row = table.rows[rowIndex];
|
|
16
|
+
var belowRow = table.rows[rowIndex + 1];
|
|
17
|
+
row.cells.forEach(function (cell) {
|
|
18
|
+
delete cell.cachedElement;
|
|
19
|
+
});
|
|
20
|
+
delete row.cachedElement;
|
|
21
|
+
if (belowRow === null || belowRow === void 0 ? void 0 : belowRow.cells.every(function (belowCell, colIndex) {
|
|
22
|
+
return colIndex < sel.firstCol || colIndex > sel.lastCol || belowCell.spanAbove;
|
|
23
|
+
})) {
|
|
24
|
+
belowRow.cells.forEach(function (belowCell, colIndex) {
|
|
25
|
+
if (colIndex >= sel.firstCol && colIndex <= sel.lastCol) {
|
|
26
|
+
belowCell.spanAbove = false;
|
|
27
|
+
delete belowCell.cachedElement;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
delete belowRow.cachedElement;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
var newHeight = Math.max((row.height /= 2), MIN_HEIGHT);
|
|
34
|
+
var newRow = {
|
|
35
|
+
format: (0, tslib_1.__assign)({}, row.format),
|
|
36
|
+
height: newHeight,
|
|
37
|
+
cells: row.cells.map(function (cell, colIndex) {
|
|
38
|
+
var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format);
|
|
39
|
+
newCell.dataset = (0, tslib_1.__assign)({}, cell.dataset);
|
|
40
|
+
if (colIndex < sel.firstCol || colIndex > sel.lastCol) {
|
|
41
|
+
newCell.spanAbove = true;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
newCell.isSelected = cell.isSelected;
|
|
45
|
+
}
|
|
46
|
+
return newCell;
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
row.height = newHeight;
|
|
50
|
+
table.rows.splice(rowIndex + 1, 0, newRow);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.splitTableCellVertically = splitTableCellVertically;
|
|
56
|
+
//# sourceMappingURL=splitTableCellVertically.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitTableCellVertically.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/splitTableCellVertically.ts"],"names":[],"mappings":";;;;AAAA,2EAA8D;AAC9D,uDAAsD;AAGtD,IAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;GAEG;AACH,SAAgB,wBAAwB,CAAC,KAAwB;IAC7D,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,EAAE;QACL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACnE,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,IAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;YAE1C,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;gBAClB,OAAO,IAAI,CAAC,aAAa,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,OAAO,GAAG,CAAC,aAAa,CAAC;YAEzB,IACI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,KAAK,CACjB,UAAC,SAAS,EAAE,QAAQ;gBAChB,OAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC,SAAS;YAAxE,CAAwE,CAC/E,EACH;gBACE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,SAAS,EAAE,QAAQ;oBACvC,IAAI,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE;wBACrD,SAAS,CAAC,SAAS,GAAG,KAAK,CAAC;wBAC5B,OAAO,SAAS,CAAC,aAAa,CAAC;qBAClC;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC,aAAa,CAAC;aACjC;iBAAM;gBACH,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;gBAC1D,IAAM,MAAM,GAAyB;oBACjC,MAAM,4BAAO,GAAG,CAAC,MAAM,CAAE;oBACzB,MAAM,EAAE,SAAS;oBACjB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,QAAQ;wBAChC,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;wBAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;wBAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE;4BACnD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;yBAC5B;6BAAM;4BACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;yBACxC;wBAED,OAAO,OAAO,CAAC;oBACnB,CAAC,CAAC;iBACL,CAAC;gBAEF,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC;gBACvB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;aAC9C;SACJ;KACJ;AACL,CAAC;AA1DD,4DA0DC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from './getSelectedCells';\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.firstCol || colIndex > sel.lastCol || belowCell.spanAbove\n )\n ) {\n belowRow.cells.forEach((belowCell, colIndex) => {\n if (colIndex >= sel.firstCol && colIndex <= sel.lastCol) {\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.firstCol || colIndex > sel.lastCol) {\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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set text alignment of selected paragraphs
|
|
4
|
+
* @param editor The editor to set alignment
|
|
5
|
+
* @param alignment Alignment value: left, center or right
|
|
6
|
+
*/
|
|
7
|
+
export default function setAlignment(editor: IStandaloneEditor, alignment: 'left' | 'center' | 'right'): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var setModelAlignment_1 = require("../../modelApi/block/setModelAlignment");
|
|
4
|
+
/**
|
|
5
|
+
* Set text alignment of selected paragraphs
|
|
6
|
+
* @param editor The editor to set alignment
|
|
7
|
+
* @param alignment Alignment value: left, center or right
|
|
8
|
+
*/
|
|
9
|
+
function setAlignment(editor, alignment) {
|
|
10
|
+
editor.focus();
|
|
11
|
+
editor.formatContentModel(function (model) { return (0, setModelAlignment_1.setModelAlignment)(model, alignment); }, {
|
|
12
|
+
apiName: 'setAlignment',
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.default = setAlignment;
|
|
16
|
+
//# sourceMappingURL=setAlignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setAlignment.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setAlignment.ts"],"names":[],"mappings":";;AAAA,4EAA2E;AAG3E;;;;GAIG;AACH,SAAwB,YAAY,CAChC,MAAyB,EACzB,SAAsC;IAEtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;QACpE,OAAO,EAAE,cAAc;KAC1B,CAAC,CAAC;AACP,CAAC;AATD,+BASC","sourcesContent":["import { setModelAlignment } from '../../modelApi/block/setModelAlignment';\nimport type { IStandaloneEditor } 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 default function setAlignment(\n editor: IStandaloneEditor,\n alignment: 'left' | 'center' | 'right'\n) {\n editor.focus();\n\n editor.formatContentModel(model => setModelAlignment(model, alignment), {\n apiName: 'setAlignment',\n });\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set text direction of selected paragraphs (Left to right or Right to left)
|
|
4
|
+
* @param editor The editor to set alignment
|
|
5
|
+
* @param direction Direction value: ltr (Left to right) or rtl (Right to left)
|
|
6
|
+
*/
|
|
7
|
+
export default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl'): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var setModelDirection_1 = require("../../modelApi/block/setModelDirection");
|
|
4
|
+
/**
|
|
5
|
+
* Set text direction of selected paragraphs (Left to right or Right to left)
|
|
6
|
+
* @param editor The editor to set alignment
|
|
7
|
+
* @param direction Direction value: ltr (Left to right) or rtl (Right to left)
|
|
8
|
+
*/
|
|
9
|
+
function setDirection(editor, direction) {
|
|
10
|
+
editor.focus();
|
|
11
|
+
editor.formatContentModel(function (model) { return (0, setModelDirection_1.setModelDirection)(model, direction); }, {
|
|
12
|
+
apiName: 'setDirection',
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.default = setDirection;
|
|
16
|
+
//# sourceMappingURL=setDirection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setDirection.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setDirection.ts"],"names":[],"mappings":";;AAAA,4EAA2E;AAG3E;;;;GAIG;AACH,SAAwB,YAAY,CAAC,MAAyB,EAAE,SAAwB;IACpF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;QACpE,OAAO,EAAE,cAAc;KAC1B,CAAC,CAAC;AACP,CAAC;AAND,+BAMC","sourcesContent":["import { setModelDirection } from '../../modelApi/block/setModelDirection';\nimport type { IStandaloneEditor } 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 default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl') {\n editor.focus();\n\n editor.formatContentModel(model => setModelDirection(model, direction), {\n apiName: 'setDirection',\n });\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set heading level of selected paragraphs
|
|
4
|
+
* @param editor The editor to set heading level to
|
|
5
|
+
* @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
|
|
6
|
+
*/
|
|
7
|
+
export default function setHeadingLevel(editor: IStandaloneEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var formatParagraphWithContentModel_1 = require("../utils/formatParagraphWithContentModel");
|
|
4
|
+
var HeaderFontSizes = {
|
|
5
|
+
h1: '2em',
|
|
6
|
+
h2: '1.5em',
|
|
7
|
+
h3: '1.17em',
|
|
8
|
+
h4: '1em',
|
|
9
|
+
h5: '0.83em',
|
|
10
|
+
h6: '0.67em',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Set heading level of selected paragraphs
|
|
14
|
+
* @param editor The editor to set heading level to
|
|
15
|
+
* @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
|
|
16
|
+
*/
|
|
17
|
+
function setHeadingLevel(editor, headingLevel) {
|
|
18
|
+
editor.focus();
|
|
19
|
+
(0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setHeadingLevel', function (para) {
|
|
20
|
+
var tagName = headingLevel > 0
|
|
21
|
+
? ('h' + headingLevel)
|
|
22
|
+
: getExistingHeadingTag(para.decorator);
|
|
23
|
+
if (headingLevel > 0) {
|
|
24
|
+
para.decorator = {
|
|
25
|
+
tagName: tagName,
|
|
26
|
+
format: tagName
|
|
27
|
+
? {
|
|
28
|
+
fontWeight: 'bold',
|
|
29
|
+
fontSize: HeaderFontSizes[tagName],
|
|
30
|
+
}
|
|
31
|
+
: {},
|
|
32
|
+
};
|
|
33
|
+
// Remove existing formats since tags have default font size and weight
|
|
34
|
+
para.segments.forEach(function (segment) {
|
|
35
|
+
delete segment.format.fontSize;
|
|
36
|
+
delete segment.format.fontWeight;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else if (tagName) {
|
|
40
|
+
delete para.decorator;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.default = setHeadingLevel;
|
|
45
|
+
function getExistingHeadingTag(decorator) {
|
|
46
|
+
var tag = (decorator === null || decorator === void 0 ? void 0 : decorator.tagName) || '';
|
|
47
|
+
var level = parseInt(tag.substring(1));
|
|
48
|
+
return level >= 1 && level <= 6 ? tag : null;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=setHeadingLevel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setHeadingLevel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setHeadingLevel.ts"],"names":[],"mappings":";;AAAA,4FAA2F;AAQ3F,IAAM,eAAe,GAAqC;IACtD,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,KAAK;IACT,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;CACf,CAAC;AAEF;;;;GAIG;AACH,SAAwB,eAAe,CACnC,MAAyB,EACzB,YAAuC;IAEvC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,iBAAiB,EAAE,UAAA,IAAI;QAC3D,IAAM,OAAO,GACT,YAAY,GAAG,CAAC;YACZ,CAAC,CAAE,CAAC,GAAG,GAAG,YAAY,CAA6B;YACnD,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,YAAY,GAAG,CAAC,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG;gBACb,OAAO,EAAE,OAAQ;gBACjB,MAAM,EAAE,OAAO;oBACX,CAAC,CAAC;wBACI,UAAU,EAAE,MAAM;wBAClB,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC;qBACrC;oBACH,CAAC,CAAC,EAAE;aACX,CAAC;YAEF,uEAAuE;YACvE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC/B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;YACrC,CAAC,CAAC,CAAC;SACN;aAAM,IAAI,OAAO,EAAE;YAChB,OAAO,IAAI,CAAC,SAAS,CAAC;SACzB;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAhCD,kCAgCC;AAED,SAAS,qBAAqB,CAC1B,SAA0C;IAE1C,IAAM,GAAG,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,EAAE,CAAC;IACrC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAE,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC;AACvE,CAAC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type {\n ContentModelParagraphDecorator,\n IStandaloneEditor,\n} 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 default function setHeadingLevel(\n editor: IStandaloneEditor,\n headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6\n) {\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"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Indent or outdent to selected paragraphs
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param indentation Whether indent or outdent
|
|
6
|
+
* @param length The length of pixel to indent/outdent @default 40
|
|
7
|
+
*/
|
|
8
|
+
export default function setIndentation(editor: IStandaloneEditor, indentation: 'indent' | 'outdent', length?: number): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
4
|
+
var setModelIndentation_1 = require("../../modelApi/block/setModelIndentation");
|
|
5
|
+
/**
|
|
6
|
+
* Indent or outdent to selected paragraphs
|
|
7
|
+
* @param editor The editor to operate on
|
|
8
|
+
* @param indentation Whether indent or outdent
|
|
9
|
+
* @param length The length of pixel to indent/outdent @default 40
|
|
10
|
+
*/
|
|
11
|
+
function setIndentation(editor, indentation, length) {
|
|
12
|
+
editor.focus();
|
|
13
|
+
editor.formatContentModel(function (model, context) {
|
|
14
|
+
var result = (0, setModelIndentation_1.setModelIndentation)(model, indentation, length);
|
|
15
|
+
if (result) {
|
|
16
|
+
(0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
|
|
17
|
+
}
|
|
18
|
+
context.newPendingFormat = 'preserve';
|
|
19
|
+
return result;
|
|
20
|
+
}, {
|
|
21
|
+
apiName: 'setIndentation',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.default = setIndentation;
|
|
25
|
+
//# sourceMappingURL=setIndentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setIndentation.ts"],"names":[],"mappings":";;AAAA,2EAAoE;AACpE,gFAA+E;AAG/E;;;;;GAKG;AACH,SAAwB,cAAc,CAClC,MAAyB,EACzB,WAAiC,EACjC,MAAe;IAEf,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,MAAM,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAE/D,IAAI,MAAM,EAAE;YACR,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;SAChC;QAED,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,MAAM,CAAC;IAClB,CAAC,EACD;QACI,OAAO,EAAE,gBAAgB;KAC5B,CACJ,CAAC;AACN,CAAC;AAvBD,iCAuBC","sourcesContent":["import { normalizeContentModel } from 'roosterjs-content-model-dom';\nimport { setModelIndentation } from '../../modelApi/block/setModelIndentation';\nimport type { IStandaloneEditor } 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 default function setIndentation(\n editor: IStandaloneEditor,\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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggles the current block(s) margin properties.
|
|
4
|
+
* null deletes any existing value, undefined is ignored
|
|
5
|
+
* @param editor The editor to operate on
|
|
6
|
+
* @param marginTop value for top margin
|
|
7
|
+
* @param marginBottom value for bottom margin
|
|
8
|
+
*/
|
|
9
|
+
export default function setParagraphMargin(editor: IStandaloneEditor, marginTop?: string | null, marginBottom?: string | null): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
4
|
+
var formatParagraphWithContentModel_1 = require("../utils/formatParagraphWithContentModel");
|
|
5
|
+
/**
|
|
6
|
+
* Toggles the current block(s) margin properties.
|
|
7
|
+
* null deletes any existing value, undefined is ignored
|
|
8
|
+
* @param editor The editor to operate on
|
|
9
|
+
* @param marginTop value for top margin
|
|
10
|
+
* @param marginBottom value for bottom margin
|
|
11
|
+
*/
|
|
12
|
+
function setParagraphMargin(editor, marginTop, marginBottom) {
|
|
13
|
+
editor.focus();
|
|
14
|
+
(0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setParagraphMargin', function (para) {
|
|
15
|
+
if (!para.decorator) {
|
|
16
|
+
para.decorator = (0, roosterjs_content_model_dom_1.createParagraphDecorator)('p');
|
|
17
|
+
}
|
|
18
|
+
if (marginTop) {
|
|
19
|
+
para.format.marginTop = marginTop;
|
|
20
|
+
}
|
|
21
|
+
else if (marginTop === null) {
|
|
22
|
+
delete para.format.marginTop;
|
|
23
|
+
}
|
|
24
|
+
if (marginBottom) {
|
|
25
|
+
para.format.marginBottom = marginBottom;
|
|
26
|
+
}
|
|
27
|
+
else if (marginBottom === null) {
|
|
28
|
+
delete para.format.marginBottom;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
exports.default = setParagraphMargin;
|
|
33
|
+
//# sourceMappingURL=setParagraphMargin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setParagraphMargin.ts"],"names":[],"mappings":";;AAAA,2EAAuE;AACvE,4FAA2F;AAG3F;;;;;;GAMG;AACH,SAAwB,kBAAkB,CACtC,MAAyB,EACzB,SAAyB,EACzB,YAA4B;IAE5B,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,oBAAoB,EAAE,UAAA,IAAI;QAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,SAAS,GAAG,IAAA,sDAAwB,EAAC,GAAG,CAAC,CAAC;SAClD;QAED,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;SACrC;aAAM,IAAI,SAAS,KAAK,IAAI,EAAE;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;SAChC;QAED,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;SAC3C;aAAM,IAAI,YAAY,KAAK,IAAI,EAAE;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;SACnC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAxBD,qCAwBC","sourcesContent":["import { createParagraphDecorator } from 'roosterjs-content-model-dom';\nimport { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IStandaloneEditor } 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 default function setParagraphMargin(\n editor: IStandaloneEditor,\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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param spacing Unitless/px value to set line height
|
|
6
|
+
*/
|
|
7
|
+
export default function setSpacing(editor: IStandaloneEditor, spacing: number | string): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var formatParagraphWithContentModel_1 = require("../utils/formatParagraphWithContentModel");
|
|
4
|
+
/**
|
|
5
|
+
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
6
|
+
* @param editor The editor to operate on
|
|
7
|
+
* @param spacing Unitless/px value to set line height
|
|
8
|
+
*/
|
|
9
|
+
function setSpacing(editor, spacing) {
|
|
10
|
+
editor.focus();
|
|
11
|
+
(0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setSpacing', function (paragraph) {
|
|
12
|
+
paragraph.format.lineHeight = spacing.toString();
|
|
13
|
+
paragraph.segments.forEach(function (segment) {
|
|
14
|
+
if (segment.format.lineHeight) {
|
|
15
|
+
delete segment.format.lineHeight;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.default = setSpacing;
|
|
21
|
+
//# sourceMappingURL=setSpacing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setSpacing.ts"],"names":[],"mappings":";;AAAA,4FAA2F;AAG3F;;;;GAIG;AACH,SAAwB,UAAU,CAAC,MAAyB,EAAE,OAAwB;IAClF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,YAAY,EAAE,UAAA,SAAS;QAC3D,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YAC9B,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;aACpC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAXD,6BAWC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IStandaloneEditor } 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 default function setSpacing(editor: IStandaloneEditor, 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"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
4
|
+
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
5
|
+
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
6
|
+
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
7
|
+
* @param quoteFormat @optional Block format for the new quote object
|
|
8
|
+
*/
|
|
9
|
+
export default function toggleBlockQuote(editor: IStandaloneEditor, quoteFormat?: ContentModelFormatContainerFormat): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var toggleModelBlockQuote_1 = require("../../modelApi/block/toggleModelBlockQuote");
|
|
5
|
+
var DefaultQuoteFormat = {
|
|
6
|
+
borderLeft: '3px solid rgb(200, 200, 200)',
|
|
7
|
+
textColor: 'rgb(102, 102, 102)',
|
|
8
|
+
};
|
|
9
|
+
var BuildInQuoteFormat = {
|
|
10
|
+
marginTop: '1em',
|
|
11
|
+
marginBottom: '1em',
|
|
12
|
+
marginLeft: '40px',
|
|
13
|
+
marginRight: '40px',
|
|
14
|
+
paddingLeft: '10px',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
18
|
+
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
19
|
+
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
20
|
+
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
21
|
+
* @param quoteFormat @optional Block format for the new quote object
|
|
22
|
+
*/
|
|
23
|
+
function toggleBlockQuote(editor, quoteFormat) {
|
|
24
|
+
if (quoteFormat === void 0) { quoteFormat = DefaultQuoteFormat; }
|
|
25
|
+
var fullQuoteFormat = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, BuildInQuoteFormat), quoteFormat);
|
|
26
|
+
editor.focus();
|
|
27
|
+
editor.formatContentModel(function (model, context) {
|
|
28
|
+
context.newPendingFormat = 'preserve';
|
|
29
|
+
return (0, toggleModelBlockQuote_1.toggleModelBlockQuote)(model, fullQuoteFormat);
|
|
30
|
+
}, {
|
|
31
|
+
apiName: 'toggleBlockQuote',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.default = toggleBlockQuote;
|
|
35
|
+
//# sourceMappingURL=toggleBlockQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/toggleBlockQuote.ts"],"names":[],"mappings":";;;AAAA,oFAAmF;AAMnF,IAAM,kBAAkB,GAAsC;IAC1D,UAAU,EAAE,8BAA8B;IAC1C,SAAS,EAAE,oBAAoB;CAClC,CAAC;AACF,IAAM,kBAAkB,GAAsC;IAC1D,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,KAAK;IACnB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,MAAM;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,SAAwB,gBAAgB,CACpC,MAAyB,EACzB,WAAmE;IAAnE,4BAAA,EAAA,gCAAmE;IAEnE,IAAM,eAAe,mDACd,kBAAkB,GAClB,WAAW,CACjB,CAAC;IAEF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,IAAA,6CAAqB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IACzD,CAAC,EACD;QACI,OAAO,EAAE,kBAAkB;KAC9B,CACJ,CAAC;AACN,CAAC;AArBD,mCAqBC","sourcesContent":["import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';\nimport type {\n ContentModelFormatContainerFormat,\n IStandaloneEditor,\n} from 'roosterjs-content-model-types';\n\nconst DefaultQuoteFormat: ContentModelFormatContainerFormat = {\n borderLeft: '3px solid rgb(200, 200, 200)', // TODO: Support RTL\n textColor: 'rgb(102, 102, 102)',\n};\nconst BuildInQuoteFormat: ContentModelFormatContainerFormat = {\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n paddingLeft: '10px',\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 default function toggleBlockQuote(\n editor: IStandaloneEditor,\n quoteFormat: ContentModelFormatContainerFormat = DefaultQuoteFormat\n) {\n const fullQuoteFormat = {\n ...BuildInQuoteFormat,\n ...quoteFormat,\n };\n\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return toggleModelBlockQuote(model, fullQuoteFormat);\n },\n {\n apiName: 'toggleBlockQuote',\n }\n );\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Insert an entity into editor
|
|
4
|
+
* @param editor The Content Model editor
|
|
5
|
+
* @param type Type of entity
|
|
6
|
+
* @param isBlock True to insert a block entity, false to insert an inline entity
|
|
7
|
+
* @param position Position of the entity to insert. It can be
|
|
8
|
+
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
9
|
+
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
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
|
+
* @param options Move options to insert. See InsertEntityOptions
|
|
12
|
+
*/
|
|
13
|
+
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
14
|
+
/**
|
|
15
|
+
* Insert a block entity into editor
|
|
16
|
+
* @param editor The Content Model editor
|
|
17
|
+
* @param type Type of entity
|
|
18
|
+
* @param isBlock Must be true for a block entity
|
|
19
|
+
* @param position Position of the entity to insert. It can be
|
|
20
|
+
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
21
|
+
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
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
|
+
* @param options Move options to insert. See InsertEntityOptions
|
|
24
|
+
*/
|
|
25
|
+
export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
|