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,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var hasSelectionInBlockGroup_1 = require("../selection/hasSelectionInBlockGroup");
|
|
5
|
+
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
6
|
+
/**
|
|
7
|
+
* Set table cell shade color
|
|
8
|
+
* @param editor The editor instance
|
|
9
|
+
* @param color The color to set. Pass null to remove existing shade color
|
|
10
|
+
*/
|
|
11
|
+
function setTableCellShade(editor, color) {
|
|
12
|
+
editor.focus();
|
|
13
|
+
editor.formatContentModel(function (model) {
|
|
14
|
+
var _a = (0, tslib_1.__read)((0, roosterjs_content_model_core_1.getFirstSelectedTable)(model), 1), table = _a[0];
|
|
15
|
+
if (table) {
|
|
16
|
+
(0, roosterjs_content_model_core_1.normalizeTable)(table);
|
|
17
|
+
table.rows.forEach(function (row) {
|
|
18
|
+
return row.cells.forEach(function (cell) {
|
|
19
|
+
if ((0, hasSelectionInBlockGroup_1.default)(cell)) {
|
|
20
|
+
(0, roosterjs_content_model_core_1.setTableCellBackgroundColor)(cell, color, true /*isColorOverride*/);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
apiName: 'setTableCellShade',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.default = setTableCellShade;
|
|
34
|
+
//# sourceMappingURL=setTableCellShade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setTableCellShade.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/setTableCellShade.ts"],"names":[],"mappings":";;;AAAA,kFAA6E;AAC7E,6EAIsC;AAGtC;;;;GAIG;AACH,SAAwB,iBAAiB,CAAC,MAAyB,EAAE,KAAoB;IACrF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,oBAAU,IAAA,oDAAqB,EAAC,KAAK,CAAC,IAAA,EAArC,KAAK,QAAgC,CAAC;QAE7C,IAAI,KAAK,EAAE;YACP,IAAA,6CAAc,EAAC,KAAK,CAAC,CAAC;YAEtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,OAAA,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,IAAI,IAAA,kCAAwB,EAAC,IAAI,CAAC,EAAE;wBAChC,IAAA,0DAA2B,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;qBACtE;gBACL,CAAC,CAAC;YAJF,CAIE,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,mBAAmB;KAC/B,CACJ,CAAC;AACN,CAAC;AA3BD,oCA2BC","sourcesContent":["import hasSelectionInBlockGroup from '../selection/hasSelectionInBlockGroup';\nimport {\n getFirstSelectedTable,\n normalizeTable,\n setTableCellBackgroundColor,\n} from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set table cell shade color\n * @param editor The editor instance\n * @param color The color to set. Pass null to remove existing shade color\n */\nexport default function setTableCellShade(editor: IStandaloneEditor, color: string | null) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [table] = getFirstSelectedTable(model);\n\n if (table) {\n normalizeTable(table);\n\n table.rows.forEach(row =>\n row.cells.forEach(cell => {\n if (hasSelectionInBlockGroup(cell)) {\n setTableCellBackgroundColor(cell, color, true /*isColorOverride*/);\n }\n })\n );\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setTableCellShade',\n }\n );\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var formatSegmentWithContentModel_1 = require("./formatSegmentWithContentModel");
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
function formatImageWithContentModel(editor, apiName, callback) {
|
|
8
|
+
(0, formatSegmentWithContentModel_1.formatSegmentWithContentModel)(editor, apiName, function (_, __, segment) {
|
|
9
|
+
if ((segment === null || segment === void 0 ? void 0 : segment.segmentType) == 'Image') {
|
|
10
|
+
callback(segment);
|
|
11
|
+
}
|
|
12
|
+
}, undefined /** segmentHasStyleCallback **/, undefined /** includingFormatHolder */);
|
|
13
|
+
}
|
|
14
|
+
exports.default = formatImageWithContentModel;
|
|
15
|
+
//# sourceMappingURL=formatImageWithContentModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatImageWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatImageWithContentModel.ts"],"names":[],"mappings":";;AAAA,iFAAgF;AAGhF;;GAEG;AACH,SAAwB,2BAA2B,CAC/C,MAAyB,EACzB,OAAe,EACf,QAA8C;IAE9C,IAAA,6DAA6B,EACzB,MAAM,EACN,OAAO,EACP,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACX,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,OAAO,EAAE;YACjC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrB;IACL,CAAC,EACD,SAAS,CAAC,+BAA+B,EACzC,SAAS,CAAC,4BAA4B,CACzC,CAAC;AACN,CAAC;AAhBD,8CAgBC","sourcesContent":["import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';\nimport type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport default function formatImageWithContentModel(\n editor: IStandaloneEditor,\n apiName: string,\n callback: (segment: ContentModelImage) => void\n) {\n formatSegmentWithContentModel(\n editor,\n apiName,\n (_, __, segment) => {\n if (segment?.segmentType == 'Image') {\n callback(segment);\n }\n },\n undefined /** segmentHasStyleCallback **/,\n undefined /** includingFormatHolder */\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatParagraphWithContentModel(editor: IStandaloneEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatParagraphWithContentModel = void 0;
|
|
4
|
+
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function formatParagraphWithContentModel(editor, apiName, setStyleCallback) {
|
|
9
|
+
editor.formatContentModel(function (model, context) {
|
|
10
|
+
var paragraphs = (0, roosterjs_content_model_core_1.getSelectedParagraphs)(model);
|
|
11
|
+
paragraphs.forEach(setStyleCallback);
|
|
12
|
+
context.newPendingFormat = 'preserve';
|
|
13
|
+
return paragraphs.length > 0;
|
|
14
|
+
}, {
|
|
15
|
+
apiName: apiName,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.formatParagraphWithContentModel = formatParagraphWithContentModel;
|
|
19
|
+
//# sourceMappingURL=formatParagraphWithContentModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatParagraphWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatParagraphWithContentModel.ts"],"names":[],"mappings":";;;AAAA,6EAAqE;AAGrE;;GAEG;AACH,SAAgB,+BAA+B,CAC3C,MAAyB,EACzB,OAAe,EACf,gBAA4D;IAE5D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,UAAU,GAAG,IAAA,oDAAqB,EAAC,KAAK,CAAC,CAAC;QAEhD,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACrC,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AAlBD,0EAkBC","sourcesContent":["import { getSelectedParagraphs } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function formatParagraphWithContentModel(\n editor: IStandaloneEditor,\n apiName: string,\n setStyleCallback: (paragraph: ContentModelParagraph) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n const paragraphs = getSelectedParagraphs(model);\n\n paragraphs.forEach(setStyleCallback);\n context.newPendingFormat = 'preserve';\n\n return paragraphs.length > 0;\n },\n {\n apiName,\n }\n );\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatSegmentWithContentModel(editor: IStandaloneEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatSegmentWithContentModel = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var adjustWordSelection_1 = require("../../modelApi/selection/adjustWordSelection");
|
|
6
|
+
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
function formatSegmentWithContentModel(editor, apiName, toggleStyleCallback, segmentHasStyleCallback, includingFormatHolder, afterFormatCallback) {
|
|
11
|
+
editor.formatContentModel(function (model, context) {
|
|
12
|
+
var segmentAndParagraphs = (0, roosterjs_content_model_core_1.getSelectedSegmentsAndParagraphs)(model, !!includingFormatHolder);
|
|
13
|
+
var pendingFormat = editor.getPendingFormat();
|
|
14
|
+
var isCollapsedSelection = segmentAndParagraphs.length == 1 &&
|
|
15
|
+
segmentAndParagraphs[0][0].segmentType == 'SelectionMarker';
|
|
16
|
+
if (isCollapsedSelection) {
|
|
17
|
+
var para_1 = segmentAndParagraphs[0][1];
|
|
18
|
+
segmentAndParagraphs = (0, adjustWordSelection_1.adjustWordSelection)(model, segmentAndParagraphs[0][0]).map(function (x) { return [x, para_1]; });
|
|
19
|
+
if (segmentAndParagraphs.length > 1) {
|
|
20
|
+
isCollapsedSelection = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var formatsAndSegments = pendingFormat
|
|
24
|
+
? [[pendingFormat, null, null]]
|
|
25
|
+
: segmentAndParagraphs.map(function (item) { return [item[0].format, item[0], item[1]]; });
|
|
26
|
+
var isTurningOff = segmentHasStyleCallback
|
|
27
|
+
? formatsAndSegments.every(function (_a) {
|
|
28
|
+
var _b = (0, tslib_1.__read)(_a, 3), format = _b[0], segment = _b[1], paragraph = _b[2];
|
|
29
|
+
return segmentHasStyleCallback(format, segment, paragraph);
|
|
30
|
+
})
|
|
31
|
+
: false;
|
|
32
|
+
formatsAndSegments.forEach(function (_a) {
|
|
33
|
+
var _b = (0, tslib_1.__read)(_a, 3), format = _b[0], segment = _b[1], paragraph = _b[2];
|
|
34
|
+
return toggleStyleCallback(format, !isTurningOff, segment, paragraph);
|
|
35
|
+
});
|
|
36
|
+
afterFormatCallback === null || afterFormatCallback === void 0 ? void 0 : afterFormatCallback(model);
|
|
37
|
+
if (!pendingFormat && isCollapsedSelection) {
|
|
38
|
+
context.newPendingFormat = segmentAndParagraphs[0][0].format;
|
|
39
|
+
}
|
|
40
|
+
if (isCollapsedSelection) {
|
|
41
|
+
editor.focus();
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return formatsAndSegments.length > 0;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
apiName: apiName,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.formatSegmentWithContentModel = formatSegmentWithContentModel;
|
|
52
|
+
//# sourceMappingURL=formatSegmentWithContentModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatSegmentWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatSegmentWithContentModel.ts"],"names":[],"mappings":";;;;AAAA,oFAAmF;AACnF,6EAAgF;AAQhF;;GAEG;AACH,SAAgB,6BAA6B,CACzC,MAAyB,EACzB,OAAe,EACf,mBAKS,EACT,uBAIY,EACZ,qBAA+B,EAC/B,mBAA2D;IAE3D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAI,oBAAoB,GAAG,IAAA,+DAAgC,EACvD,KAAK,EACL,CAAC,CAAC,qBAAqB,CAC1B,CAAC;QACF,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAChD,IAAI,oBAAoB,GACpB,oBAAoB,CAAC,MAAM,IAAI,CAAC;YAChC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,iBAAiB,CAAC;QAEhE,IAAI,oBAAoB,EAAE;YACtB,IAAM,MAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAExC,oBAAoB,GAAG,IAAA,yCAAmB,EACtC,KAAK,EACL,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,MAAI,CAAC,EAAT,CAAS,CAAC,CAAC;YAEtB,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjC,oBAAoB,GAAG,KAAK,CAAC;aAChC;SACJ;QAED,IAAM,kBAAkB,GAIlB,aAAa;YACf,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAC/B,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAlC,CAAkC,CAAC,CAAC;QAE3E,IAAM,YAAY,GAAG,uBAAuB;YACxC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,UAAC,EAA4B;oBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;gBACjD,OAAA,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;YAAnD,CAAmD,CACtD;YACH,CAAC,CAAC,KAAK,CAAC;QAEZ,kBAAkB,CAAC,OAAO,CAAC,UAAC,EAA4B;gBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;YACnD,OAAA,mBAAmB,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC;QAA9D,CAA8D,CACjE,CAAC;QAEF,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,aAAa,IAAI,oBAAoB,EAAE;YACxC,OAAO,CAAC,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;SAChE;QAED,IAAI,oBAAoB,EAAE;YACtB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;SAChB;aAAM;YACH,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC;IACL,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AA5ED,sEA4EC","sourcesContent":["import { adjustWordSelection } from '../../modelApi/selection/adjustWordSelection';\nimport { getSelectedSegmentsAndParagraphs } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelParagraph,\n ContentModelSegment,\n ContentModelSegmentFormat,\n IStandaloneEditor,\n} from 'roosterjs-content-model-types';\n/**\n * @internal\n */\nexport function formatSegmentWithContentModel(\n editor: IStandaloneEditor,\n apiName: string,\n toggleStyleCallback: (\n format: ContentModelSegmentFormat,\n isTuringOn: boolean,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => void,\n segmentHasStyleCallback?: (\n format: ContentModelSegmentFormat,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => boolean,\n includingFormatHolder?: boolean,\n afterFormatCallback?: (model: ContentModelDocument) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n let segmentAndParagraphs = getSelectedSegmentsAndParagraphs(\n model,\n !!includingFormatHolder\n );\n const pendingFormat = editor.getPendingFormat();\n let isCollapsedSelection =\n segmentAndParagraphs.length == 1 &&\n segmentAndParagraphs[0][0].segmentType == 'SelectionMarker';\n\n if (isCollapsedSelection) {\n const para = segmentAndParagraphs[0][1];\n\n segmentAndParagraphs = adjustWordSelection(\n model,\n segmentAndParagraphs[0][0]\n ).map(x => [x, para]);\n\n if (segmentAndParagraphs.length > 1) {\n isCollapsedSelection = false;\n }\n }\n\n const formatsAndSegments: [\n ContentModelSegmentFormat,\n ContentModelSegment | null,\n ContentModelParagraph | null\n ][] = pendingFormat\n ? [[pendingFormat, null, null]]\n : segmentAndParagraphs.map(item => [item[0].format, item[0], item[1]]);\n\n const isTurningOff = segmentHasStyleCallback\n ? formatsAndSegments.every(([format, segment, paragraph]) =>\n segmentHasStyleCallback(format, segment, paragraph)\n )\n : false;\n\n formatsAndSegments.forEach(([format, segment, paragraph]) =>\n toggleStyleCallback(format, !isTurningOff, segment, paragraph)\n );\n\n afterFormatCallback?.(model);\n\n if (!pendingFormat && isCollapsedSelection) {\n context.newPendingFormat = segmentAndParagraphs[0][0].format;\n }\n\n if (isCollapsedSelection) {\n editor.focus();\n return false;\n } else {\n return formatsAndSegments.length > 0;\n }\n },\n {\n apiName,\n }\n );\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { default as insertTable } from './publicApi/table/insertTable';
|
|
2
|
+
export { default as formatTable } from './publicApi/table/formatTable';
|
|
3
|
+
export { default as setTableCellShade } from './publicApi/table/setTableCellShade';
|
|
4
|
+
export { default as editTable } from './publicApi/table/editTable';
|
|
5
|
+
export { default as applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';
|
|
6
|
+
export { default as toggleBullet } from './publicApi/list/toggleBullet';
|
|
7
|
+
export { default as toggleNumbering } from './publicApi/list/toggleNumbering';
|
|
8
|
+
export { default as toggleBold } from './publicApi/segment/toggleBold';
|
|
9
|
+
export { default as toggleItalic } from './publicApi/segment/toggleItalic';
|
|
10
|
+
export { default as toggleUnderline } from './publicApi/segment/toggleUnderline';
|
|
11
|
+
export { default as toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';
|
|
12
|
+
export { default as toggleSubscript } from './publicApi/segment/toggleSubscript';
|
|
13
|
+
export { default as toggleSuperscript } from './publicApi/segment/toggleSuperscript';
|
|
14
|
+
export { default as setBackgroundColor } from './publicApi/segment/setBackgroundColor';
|
|
15
|
+
export { default as setFontName } from './publicApi/segment/setFontName';
|
|
16
|
+
export { default as setFontSize } from './publicApi/segment/setFontSize';
|
|
17
|
+
export { default as setTextColor } from './publicApi/segment/setTextColor';
|
|
18
|
+
export { default as changeFontSize } from './publicApi/segment/changeFontSize';
|
|
19
|
+
export { default as applySegmentFormat } from './publicApi/segment/applySegmentFormat';
|
|
20
|
+
export { default as changeCapitalization } from './publicApi/segment/changeCapitalization';
|
|
21
|
+
export { default as insertImage } from './publicApi/image/insertImage';
|
|
22
|
+
export { default as setListStyle } from './publicApi/list/setListStyle';
|
|
23
|
+
export { default as setListStartNumber } from './publicApi/list/setListStartNumber';
|
|
24
|
+
export { default as hasSelectionInBlock } from './publicApi/selection/hasSelectionInBlock';
|
|
25
|
+
export { default as hasSelectionInSegment } from './publicApi/selection/hasSelectionInSegment';
|
|
26
|
+
export { default as hasSelectionInBlockGroup } from './publicApi/selection/hasSelectionInBlockGroup';
|
|
27
|
+
export { default as setIndentation } from './publicApi/block/setIndentation';
|
|
28
|
+
export { default as setAlignment } from './publicApi/block/setAlignment';
|
|
29
|
+
export { default as setDirection } from './publicApi/block/setDirection';
|
|
30
|
+
export { default as setHeadingLevel } from './publicApi/block/setHeadingLevel';
|
|
31
|
+
export { default as toggleBlockQuote } from './publicApi/block/toggleBlockQuote';
|
|
32
|
+
export { default as setSpacing } from './publicApi/block/setSpacing';
|
|
33
|
+
export { default as setImageBorder } from './publicApi/image/setImageBorder';
|
|
34
|
+
export { default as setImageBoxShadow } from './publicApi/image/setImageBoxShadow';
|
|
35
|
+
export { default as changeImage } from './publicApi/image/changeImage';
|
|
36
|
+
export { default as getFormatState } from './publicApi/format/getFormatState';
|
|
37
|
+
export { default as clearFormat } from './publicApi/format/clearFormat';
|
|
38
|
+
export { default as insertLink } from './publicApi/link/insertLink';
|
|
39
|
+
export { default as removeLink } from './publicApi/link/removeLink';
|
|
40
|
+
export { default as adjustLinkSelection } from './publicApi/link/adjustLinkSelection';
|
|
41
|
+
export { default as setImageAltText } from './publicApi/image/setImageAltText';
|
|
42
|
+
export { default as adjustImageSelection } from './publicApi/image/adjustImageSelection';
|
|
43
|
+
export { default as setParagraphMargin } from './publicApi/block/setParagraphMargin';
|
|
44
|
+
export { default as toggleCode } from './publicApi/segment/toggleCode';
|
|
45
|
+
export { default as insertEntity } from './publicApi/entity/insertEntity';
|
package/lib-amd/index.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
define(["require", "exports", "./publicApi/table/insertTable", "./publicApi/table/formatTable", "./publicApi/table/setTableCellShade", "./publicApi/table/editTable", "./publicApi/table/applyTableBorderFormat", "./publicApi/list/toggleBullet", "./publicApi/list/toggleNumbering", "./publicApi/segment/toggleBold", "./publicApi/segment/toggleItalic", "./publicApi/segment/toggleUnderline", "./publicApi/segment/toggleStrikethrough", "./publicApi/segment/toggleSubscript", "./publicApi/segment/toggleSuperscript", "./publicApi/segment/setBackgroundColor", "./publicApi/segment/setFontName", "./publicApi/segment/setFontSize", "./publicApi/segment/setTextColor", "./publicApi/segment/changeFontSize", "./publicApi/segment/applySegmentFormat", "./publicApi/segment/changeCapitalization", "./publicApi/image/insertImage", "./publicApi/list/setListStyle", "./publicApi/list/setListStartNumber", "./publicApi/selection/hasSelectionInBlock", "./publicApi/selection/hasSelectionInSegment", "./publicApi/selection/hasSelectionInBlockGroup", "./publicApi/block/setIndentation", "./publicApi/block/setAlignment", "./publicApi/block/setDirection", "./publicApi/block/setHeadingLevel", "./publicApi/block/toggleBlockQuote", "./publicApi/block/setSpacing", "./publicApi/image/setImageBorder", "./publicApi/image/setImageBoxShadow", "./publicApi/image/changeImage", "./publicApi/format/getFormatState", "./publicApi/format/clearFormat", "./publicApi/link/insertLink", "./publicApi/link/removeLink", "./publicApi/link/adjustLinkSelection", "./publicApi/image/setImageAltText", "./publicApi/image/adjustImageSelection", "./publicApi/block/setParagraphMargin", "./publicApi/segment/toggleCode", "./publicApi/entity/insertEntity"], function (require, exports, insertTable_1, formatTable_1, setTableCellShade_1, editTable_1, applyTableBorderFormat_1, toggleBullet_1, toggleNumbering_1, toggleBold_1, toggleItalic_1, toggleUnderline_1, toggleStrikethrough_1, toggleSubscript_1, toggleSuperscript_1, setBackgroundColor_1, setFontName_1, setFontSize_1, setTextColor_1, changeFontSize_1, applySegmentFormat_1, changeCapitalization_1, insertImage_1, setListStyle_1, setListStartNumber_1, hasSelectionInBlock_1, hasSelectionInSegment_1, hasSelectionInBlockGroup_1, setIndentation_1, setAlignment_1, setDirection_1, setHeadingLevel_1, toggleBlockQuote_1, setSpacing_1, setImageBorder_1, setImageBoxShadow_1, changeImage_1, getFormatState_1, clearFormat_1, insertLink_1, removeLink_1, adjustLinkSelection_1, setImageAltText_1, adjustImageSelection_1, setParagraphMargin_1, toggleCode_1, insertEntity_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.hasSelectionInBlockGroup = exports.hasSelectionInSegment = exports.hasSelectionInBlock = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
|
|
5
|
+
Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.default; } });
|
|
6
|
+
Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.default; } });
|
|
7
|
+
Object.defineProperty(exports, "setTableCellShade", { enumerable: true, get: function () { return setTableCellShade_1.default; } });
|
|
8
|
+
Object.defineProperty(exports, "editTable", { enumerable: true, get: function () { return editTable_1.default; } });
|
|
9
|
+
Object.defineProperty(exports, "applyTableBorderFormat", { enumerable: true, get: function () { return applyTableBorderFormat_1.default; } });
|
|
10
|
+
Object.defineProperty(exports, "toggleBullet", { enumerable: true, get: function () { return toggleBullet_1.default; } });
|
|
11
|
+
Object.defineProperty(exports, "toggleNumbering", { enumerable: true, get: function () { return toggleNumbering_1.default; } });
|
|
12
|
+
Object.defineProperty(exports, "toggleBold", { enumerable: true, get: function () { return toggleBold_1.default; } });
|
|
13
|
+
Object.defineProperty(exports, "toggleItalic", { enumerable: true, get: function () { return toggleItalic_1.default; } });
|
|
14
|
+
Object.defineProperty(exports, "toggleUnderline", { enumerable: true, get: function () { return toggleUnderline_1.default; } });
|
|
15
|
+
Object.defineProperty(exports, "toggleStrikethrough", { enumerable: true, get: function () { return toggleStrikethrough_1.default; } });
|
|
16
|
+
Object.defineProperty(exports, "toggleSubscript", { enumerable: true, get: function () { return toggleSubscript_1.default; } });
|
|
17
|
+
Object.defineProperty(exports, "toggleSuperscript", { enumerable: true, get: function () { return toggleSuperscript_1.default; } });
|
|
18
|
+
Object.defineProperty(exports, "setBackgroundColor", { enumerable: true, get: function () { return setBackgroundColor_1.default; } });
|
|
19
|
+
Object.defineProperty(exports, "setFontName", { enumerable: true, get: function () { return setFontName_1.default; } });
|
|
20
|
+
Object.defineProperty(exports, "setFontSize", { enumerable: true, get: function () { return setFontSize_1.default; } });
|
|
21
|
+
Object.defineProperty(exports, "setTextColor", { enumerable: true, get: function () { return setTextColor_1.default; } });
|
|
22
|
+
Object.defineProperty(exports, "changeFontSize", { enumerable: true, get: function () { return changeFontSize_1.default; } });
|
|
23
|
+
Object.defineProperty(exports, "applySegmentFormat", { enumerable: true, get: function () { return applySegmentFormat_1.default; } });
|
|
24
|
+
Object.defineProperty(exports, "changeCapitalization", { enumerable: true, get: function () { return changeCapitalization_1.default; } });
|
|
25
|
+
Object.defineProperty(exports, "insertImage", { enumerable: true, get: function () { return insertImage_1.default; } });
|
|
26
|
+
Object.defineProperty(exports, "setListStyle", { enumerable: true, get: function () { return setListStyle_1.default; } });
|
|
27
|
+
Object.defineProperty(exports, "setListStartNumber", { enumerable: true, get: function () { return setListStartNumber_1.default; } });
|
|
28
|
+
Object.defineProperty(exports, "hasSelectionInBlock", { enumerable: true, get: function () { return hasSelectionInBlock_1.default; } });
|
|
29
|
+
Object.defineProperty(exports, "hasSelectionInSegment", { enumerable: true, get: function () { return hasSelectionInSegment_1.default; } });
|
|
30
|
+
Object.defineProperty(exports, "hasSelectionInBlockGroup", { enumerable: true, get: function () { return hasSelectionInBlockGroup_1.default; } });
|
|
31
|
+
Object.defineProperty(exports, "setIndentation", { enumerable: true, get: function () { return setIndentation_1.default; } });
|
|
32
|
+
Object.defineProperty(exports, "setAlignment", { enumerable: true, get: function () { return setAlignment_1.default; } });
|
|
33
|
+
Object.defineProperty(exports, "setDirection", { enumerable: true, get: function () { return setDirection_1.default; } });
|
|
34
|
+
Object.defineProperty(exports, "setHeadingLevel", { enumerable: true, get: function () { return setHeadingLevel_1.default; } });
|
|
35
|
+
Object.defineProperty(exports, "toggleBlockQuote", { enumerable: true, get: function () { return toggleBlockQuote_1.default; } });
|
|
36
|
+
Object.defineProperty(exports, "setSpacing", { enumerable: true, get: function () { return setSpacing_1.default; } });
|
|
37
|
+
Object.defineProperty(exports, "setImageBorder", { enumerable: true, get: function () { return setImageBorder_1.default; } });
|
|
38
|
+
Object.defineProperty(exports, "setImageBoxShadow", { enumerable: true, get: function () { return setImageBoxShadow_1.default; } });
|
|
39
|
+
Object.defineProperty(exports, "changeImage", { enumerable: true, get: function () { return changeImage_1.default; } });
|
|
40
|
+
Object.defineProperty(exports, "getFormatState", { enumerable: true, get: function () { return getFormatState_1.default; } });
|
|
41
|
+
Object.defineProperty(exports, "clearFormat", { enumerable: true, get: function () { return clearFormat_1.default; } });
|
|
42
|
+
Object.defineProperty(exports, "insertLink", { enumerable: true, get: function () { return insertLink_1.default; } });
|
|
43
|
+
Object.defineProperty(exports, "removeLink", { enumerable: true, get: function () { return removeLink_1.default; } });
|
|
44
|
+
Object.defineProperty(exports, "adjustLinkSelection", { enumerable: true, get: function () { return adjustLinkSelection_1.default; } });
|
|
45
|
+
Object.defineProperty(exports, "setImageAltText", { enumerable: true, get: function () { return setImageAltText_1.default; } });
|
|
46
|
+
Object.defineProperty(exports, "adjustImageSelection", { enumerable: true, get: function () { return adjustImageSelection_1.default; } });
|
|
47
|
+
Object.defineProperty(exports, "setParagraphMargin", { enumerable: true, get: function () { return setParagraphMargin_1.default; } });
|
|
48
|
+
Object.defineProperty(exports, "toggleCode", { enumerable: true, get: function () { return toggleCode_1.default; } });
|
|
49
|
+
Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.default; } });
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages-content-model/roosterjs-content-model-api/lib/index.ts"],"names":[],"mappings":";;;;IAAS,0GAAA,OAAO,OAAe;IACtB,0GAAA,OAAO,OAAe;IACtB,sHAAA,OAAO,OAAqB;IAC5B,sGAAA,OAAO,OAAa;IACpB,gIAAA,OAAO,OAA0B;IACjC,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,wGAAA,OAAO,OAAc;IACrB,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,0HAAA,OAAO,OAAuB;IAC9B,kHAAA,OAAO,OAAmB;IAC1B,sHAAA,OAAO,OAAqB;IAC5B,wHAAA,OAAO,OAAsB;IAC7B,0GAAA,OAAO,OAAe;IACtB,0GAAA,OAAO,OAAe;IACtB,4GAAA,OAAO,OAAgB;IACvB,gHAAA,OAAO,OAAkB;IACzB,wHAAA,OAAO,OAAsB;IAC7B,4HAAA,OAAO,OAAwB;IAC/B,0GAAA,OAAO,OAAe;IACtB,4GAAA,OAAO,OAAgB;IACvB,wHAAA,OAAO,OAAsB;IAC7B,0HAAA,OAAO,OAAuB;IAC9B,8HAAA,OAAO,OAAyB;IAChC,oIAAA,OAAO,OAA4B;IACnC,gHAAA,OAAO,OAAkB;IACzB,4GAAA,OAAO,OAAgB;IACvB,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,oHAAA,OAAO,OAAoB;IAC3B,wGAAA,OAAO,OAAc;IACrB,gHAAA,OAAO,OAAkB;IACzB,sHAAA,OAAO,OAAqB;IAC5B,0GAAA,OAAO,OAAe;IACtB,gHAAA,OAAO,OAAkB;IACzB,0GAAA,OAAO,OAAe;IACtB,wGAAA,OAAO,OAAc;IACrB,wGAAA,OAAO,OAAc;IACrB,0HAAA,OAAO,OAAuB;IAC9B,kHAAA,OAAO,OAAmB;IAC1B,4HAAA,OAAO,OAAwB;IAC/B,wHAAA,OAAO,OAAsB;IAC7B,wGAAA,OAAO,OAAc;IACrB,4GAAA,OAAO,OAAgB","sourcesContent":["export { default as insertTable } from './publicApi/table/insertTable';\nexport { default as formatTable } from './publicApi/table/formatTable';\nexport { default as setTableCellShade } from './publicApi/table/setTableCellShade';\nexport { default as editTable } from './publicApi/table/editTable';\nexport { default as applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';\nexport { default as toggleBullet } from './publicApi/list/toggleBullet';\nexport { default as toggleNumbering } from './publicApi/list/toggleNumbering';\nexport { default as toggleBold } from './publicApi/segment/toggleBold';\nexport { default as toggleItalic } from './publicApi/segment/toggleItalic';\nexport { default as toggleUnderline } from './publicApi/segment/toggleUnderline';\nexport { default as toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';\nexport { default as toggleSubscript } from './publicApi/segment/toggleSubscript';\nexport { default as toggleSuperscript } from './publicApi/segment/toggleSuperscript';\nexport { default as setBackgroundColor } from './publicApi/segment/setBackgroundColor';\nexport { default as setFontName } from './publicApi/segment/setFontName';\nexport { default as setFontSize } from './publicApi/segment/setFontSize';\nexport { default as setTextColor } from './publicApi/segment/setTextColor';\nexport { default as changeFontSize } from './publicApi/segment/changeFontSize';\nexport { default as applySegmentFormat } from './publicApi/segment/applySegmentFormat';\nexport { default as changeCapitalization } from './publicApi/segment/changeCapitalization';\nexport { default as insertImage } from './publicApi/image/insertImage';\nexport { default as setListStyle } from './publicApi/list/setListStyle';\nexport { default as setListStartNumber } from './publicApi/list/setListStartNumber';\nexport { default as hasSelectionInBlock } from './publicApi/selection/hasSelectionInBlock';\nexport { default as hasSelectionInSegment } from './publicApi/selection/hasSelectionInSegment';\nexport { default as hasSelectionInBlockGroup } from './publicApi/selection/hasSelectionInBlockGroup';\nexport { default as setIndentation } from './publicApi/block/setIndentation';\nexport { default as setAlignment } from './publicApi/block/setAlignment';\nexport { default as setDirection } from './publicApi/block/setDirection';\nexport { default as setHeadingLevel } from './publicApi/block/setHeadingLevel';\nexport { default as toggleBlockQuote } from './publicApi/block/toggleBlockQuote';\nexport { default as setSpacing } from './publicApi/block/setSpacing';\nexport { default as setImageBorder } from './publicApi/image/setImageBorder';\nexport { default as setImageBoxShadow } from './publicApi/image/setImageBoxShadow';\nexport { default as changeImage } from './publicApi/image/changeImage';\nexport { default as getFormatState } from './publicApi/format/getFormatState';\nexport { default as clearFormat } from './publicApi/format/clearFormat';\nexport { default as insertLink } from './publicApi/link/insertLink';\nexport { default as removeLink } from './publicApi/link/removeLink';\nexport { default as adjustLinkSelection } from './publicApi/link/adjustLinkSelection';\nexport { default as setImageAltText } from './publicApi/image/setImageAltText';\nexport { default as adjustImageSelection } from './publicApi/image/adjustImageSelection';\nexport { default as setParagraphMargin } from './publicApi/block/setParagraphMargin';\nexport { default as toggleCode } from './publicApi/segment/toggleCode';\nexport { default as insertEntity } from './publicApi/entity/insertEntity';\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
define(["require", "exports", "../table/alignTable", "roosterjs-content-model-core"], function (require, exports, alignTable_1, roosterjs_content_model_core_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setModelAlignment = void 0;
|
|
5
|
+
var ResultMap = {
|
|
6
|
+
left: {
|
|
7
|
+
ltr: 'start',
|
|
8
|
+
rtl: 'end',
|
|
9
|
+
},
|
|
10
|
+
center: {
|
|
11
|
+
ltr: 'center',
|
|
12
|
+
rtl: 'center',
|
|
13
|
+
},
|
|
14
|
+
right: {
|
|
15
|
+
ltr: 'end',
|
|
16
|
+
rtl: 'start',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
var TableAlignMap = {
|
|
20
|
+
left: {
|
|
21
|
+
ltr: 'alignLeft',
|
|
22
|
+
rtl: 'alignRight',
|
|
23
|
+
},
|
|
24
|
+
center: {
|
|
25
|
+
ltr: 'alignCenter',
|
|
26
|
+
rtl: 'alignCenter',
|
|
27
|
+
},
|
|
28
|
+
right: {
|
|
29
|
+
ltr: 'alignRight',
|
|
30
|
+
rtl: 'alignLeft',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
function setModelAlignment(model, alignment) {
|
|
37
|
+
var paragraphOrListItemOrTable = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['ListItem'], ['TableCell']);
|
|
38
|
+
paragraphOrListItemOrTable.forEach(function (_a) {
|
|
39
|
+
var block = _a.block;
|
|
40
|
+
var newAligment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];
|
|
41
|
+
if (block.blockType === 'Table') {
|
|
42
|
+
(0, alignTable_1.alignTable)(block, TableAlignMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr']);
|
|
43
|
+
}
|
|
44
|
+
else if (block) {
|
|
45
|
+
var format = block.format;
|
|
46
|
+
format.textAlign = newAligment;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return paragraphOrListItemOrTable.length > 0;
|
|
50
|
+
}
|
|
51
|
+
exports.setModelAlignment = setModelAlignment;
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=setModelAlignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setModelAlignment.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/setModelAlignment.ts"],"names":[],"mappings":";;;;IAQA,IAAM,SAAS,GAGX;QACA,IAAI,EAAE;YACF,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,KAAK;SACb;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SAChB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,OAAO;SACf;KACJ,CAAC;IAEF,IAAM,aAAa,GAGf;QACA,IAAI,EAAE;YACF,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,YAAY;SACpB;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,aAAa;YAClB,GAAG,EAAE,aAAa;SACrB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,WAAW;SACnB;KACJ,CAAC;IAEF;;OAEG;IACH,SAAgB,iBAAiB,CAC7B,KAA2B,EAC3B,SAAsC;QAEtC,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC1F,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,EAAE;gBAC7B,IAAA,uBAAU,EACN,KAAK,EACL,aAAa,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAC5E,CAAC;aACL;iBAAM,IAAI,KAAK,EAAE;gBACN,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;gBACzB,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC;aAClC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IAxBD,8CAwBC","sourcesContent":["import { alignTable } from '../table/alignTable';\nimport { getOperationalBlocks } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelListItem,\n TableAlignOperation,\n} from 'roosterjs-content-model-types';\n\nconst ResultMap: Record<\n 'left' | 'center' | 'right',\n Record<'ltr' | 'rtl', 'start' | 'center' | 'end'>\n> = {\n left: {\n ltr: 'start',\n rtl: 'end',\n },\n center: {\n ltr: 'center',\n rtl: 'center',\n },\n right: {\n ltr: 'end',\n rtl: 'start',\n },\n};\n\nconst TableAlignMap: Record<\n 'left' | 'center' | 'right',\n Record<'ltr' | 'rtl', TableAlignOperation>\n> = {\n left: {\n ltr: 'alignLeft',\n rtl: 'alignRight',\n },\n center: {\n ltr: 'alignCenter',\n rtl: 'alignCenter',\n },\n right: {\n ltr: 'alignRight',\n rtl: 'alignLeft',\n },\n};\n\n/**\n * @internal\n */\nexport function setModelAlignment(\n model: ContentModelDocument,\n alignment: 'left' | 'center' | 'right'\n) {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n const newAligment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];\n if (block.blockType === 'Table') {\n alignTable(\n block,\n TableAlignMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr']\n );\n } else if (block) {\n const { format } = block;\n format.textAlign = newAligment;\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
define(["require", "exports", "../list/findListItemsInSameThread", "roosterjs-content-model-core"], function (require, exports, findListItemsInSameThread_1, roosterjs_content_model_core_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setModelDirection = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function setModelDirection(model, direction) {
|
|
9
|
+
var paragraphOrListItemOrTable = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['ListItem'], ['TableCell']);
|
|
10
|
+
paragraphOrListItemOrTable.forEach(function (_a) {
|
|
11
|
+
var block = _a.block;
|
|
12
|
+
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
|
|
13
|
+
var items = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block);
|
|
14
|
+
items.forEach(function (item) {
|
|
15
|
+
item.levels.forEach(function (level) {
|
|
16
|
+
level.format.direction = direction;
|
|
17
|
+
});
|
|
18
|
+
item.blocks.forEach(function (block) { return internalSetDirection(block.format, direction); });
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else if (block) {
|
|
22
|
+
internalSetDirection(block.format, direction);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return paragraphOrListItemOrTable.length > 0;
|
|
26
|
+
}
|
|
27
|
+
exports.setModelDirection = setModelDirection;
|
|
28
|
+
function internalSetDirection(format, direction) {
|
|
29
|
+
var wasRtl = format.direction == 'rtl';
|
|
30
|
+
var isRtl = direction == 'rtl';
|
|
31
|
+
if (wasRtl != isRtl) {
|
|
32
|
+
format.direction = direction;
|
|
33
|
+
// Adjust margin when change direction
|
|
34
|
+
// TODO: make margin and padding direction-aware, like what we did for textAlign. So no need to adjust them here
|
|
35
|
+
// TODO: Do we also need to handle border here?
|
|
36
|
+
var marginLeft = format.marginLeft;
|
|
37
|
+
var paddingLeft = format.paddingLeft;
|
|
38
|
+
setProperty(format, 'marginLeft', format.marginRight);
|
|
39
|
+
setProperty(format, 'marginRight', marginLeft);
|
|
40
|
+
setProperty(format, 'paddingLeft', format.paddingRight);
|
|
41
|
+
setProperty(format, 'paddingRight', paddingLeft);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function setProperty(format, key, value) {
|
|
45
|
+
if (value) {
|
|
46
|
+
format[key] = value;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
delete format[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=setModelDirection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setModelDirection.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/setModelDirection.ts"],"names":[],"mappings":";;;;IAUA;;OAEG;IACH,SAAgB,iBAAiB,CAAC,KAA2B,EAAE,SAAwB;QACnF,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAI,IAAA,iDAAkB,EAAuB,KAAK,EAAE,UAAU,CAAC,EAAE;gBAC7D,IAAM,KAAK,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAEtD,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;wBACrB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;oBACvC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAA7C,CAA6C,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,KAAK,EAAE;gBACd,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;aACjD;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IAxBD,8CAwBC;IAED,SAAS,oBAAoB,CAAC,MAA+B,EAAE,SAAwB;QACnF,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;QACzC,IAAM,KAAK,GAAG,SAAS,IAAI,KAAK,CAAC;QAEjC,IAAI,MAAM,IAAI,KAAK,EAAE;YACjB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YAE7B,sCAAsC;YACtC,gHAAgH;YAChH,+CAA+C;YAC/C,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACrC,IAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;YAEvC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;YACtD,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;YAC/C,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACxD,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;SACpD;IACL,CAAC;IAED,SAAS,WAAW,CAChB,MAAoC,EACpC,GAAyC,EACzC,KAAyB;QAEzB,IAAI,KAAK,EAAE;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACvB;aAAM;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;SACtB;IACL,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../list/findListItemsInSameThread';\nimport { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';\nimport type {\n ContentModelBlockFormat,\n ContentModelDocument,\n ContentModelListItem,\n MarginFormat,\n PaddingFormat,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setModelDirection(model: ContentModelDocument, direction: 'ltr' | 'rtl') {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n if (isBlockGroupOfType<ContentModelListItem>(block, 'ListItem')) {\n const items = findListItemsInSameThread(model, block);\n\n items.forEach(item => {\n item.levels.forEach(level => {\n level.format.direction = direction;\n });\n\n item.blocks.forEach(block => internalSetDirection(block.format, direction));\n });\n } else if (block) {\n internalSetDirection(block.format, direction);\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n\nfunction internalSetDirection(format: ContentModelBlockFormat, direction: 'ltr' | 'rtl') {\n const wasRtl = format.direction == 'rtl';\n const isRtl = direction == 'rtl';\n\n if (wasRtl != isRtl) {\n format.direction = direction;\n\n // Adjust margin when change direction\n // TODO: make margin and padding direction-aware, like what we did for textAlign. So no need to adjust them here\n // TODO: Do we also need to handle border here?\n const marginLeft = format.marginLeft;\n const paddingLeft = format.paddingLeft;\n\n setProperty(format, 'marginLeft', format.marginRight);\n setProperty(format, 'marginRight', marginLeft);\n setProperty(format, 'paddingLeft', format.paddingRight);\n setProperty(format, 'paddingRight', paddingLeft);\n }\n}\n\nfunction setProperty(\n format: MarginFormat & PaddingFormat,\n key: keyof (MarginFormat & PaddingFormat),\n value: string | undefined\n) {\n if (value) {\n format[key] = value;\n } else {\n delete format[key];\n }\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.setModelIndentation = void 0;
|
|
5
|
+
var IndentStepInPixel = 40;
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function setModelIndentation(model, indentation, length) {
|
|
10
|
+
if (length === void 0) { length = IndentStepInPixel; }
|
|
11
|
+
var paragraphOrListItem = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['ListItem'], ['TableCell']);
|
|
12
|
+
var isIndent = indentation == 'indent';
|
|
13
|
+
paragraphOrListItem.forEach(function (_a) {
|
|
14
|
+
var block = _a.block;
|
|
15
|
+
if ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'ListItem')) {
|
|
16
|
+
if (isIndent) {
|
|
17
|
+
var lastLevel = block.levels[block.levels.length - 1];
|
|
18
|
+
var newLevel = (0, roosterjs_content_model_dom_1.createListLevel)((lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.listType) || 'UL', lastLevel === null || lastLevel === void 0 ? void 0 : lastLevel.format);
|
|
19
|
+
// New level is totally new, no need to have these attributes for now
|
|
20
|
+
delete newLevel.format.startNumberOverride;
|
|
21
|
+
block.levels.push(newLevel);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
block.levels.pop();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else if (block) {
|
|
28
|
+
var format = block.format;
|
|
29
|
+
var marginLeft = format.marginLeft, marginRight = format.marginRight, direction = format.direction;
|
|
30
|
+
var isRtl = direction == 'rtl';
|
|
31
|
+
var originalValue = (0, roosterjs_content_model_dom_1.parseValueWithUnit)(isRtl ? marginRight : marginLeft);
|
|
32
|
+
var newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;
|
|
33
|
+
if (newValue == originalValue) {
|
|
34
|
+
newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);
|
|
35
|
+
}
|
|
36
|
+
if (isRtl) {
|
|
37
|
+
format.marginRight = newValue + 'px';
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
format.marginLeft = newValue + 'px';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return paragraphOrListItem.length > 0;
|
|
45
|
+
}
|
|
46
|
+
exports.setModelIndentation = setModelIndentation;
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=setModelIndentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setModelIndentation.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/setModelIndentation.ts"],"names":[],"mappings":";;;;IAQA,IAAM,iBAAiB,GAAG,EAAE,CAAC;IAE7B;;OAEG;IACH,SAAgB,mBAAmB,CAC/B,KAA2B,EAC3B,WAAiC,EACjC,MAAkC;QAAlC,uBAAA,EAAA,0BAAkC;QAElC,IAAM,mBAAmB,GAAG,IAAA,mDAAoB,EAC5C,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QACF,IAAM,QAAQ,GAAG,WAAW,IAAI,QAAQ,CAAC;QAEzC,mBAAmB,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YAChC,IAAI,IAAA,iDAAkB,EAAuB,KAAK,EAAE,UAAU,CAAC,EAAE;gBAC7D,IAAI,QAAQ,EAAE;oBACV,IAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBACxD,IAAM,QAAQ,GAA0B,IAAA,6CAAe,EACnD,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,QAAQ,KAAI,IAAI,EAC3B,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,CACpB,CAAC;oBAEF,qEAAqE;oBACrE,OAAO,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC;oBAE3C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC/B;qBAAM;oBACH,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;iBACtB;aACJ;iBAAM,IAAI,KAAK,EAAE;gBACN,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;gBACjB,IAAA,UAAU,GAA6B,MAAM,WAAnC,EAAE,WAAW,GAAgB,MAAM,YAAtB,EAAE,SAAS,GAAK,MAAM,UAAX,CAAY;gBACtD,IAAM,KAAK,GAAG,SAAS,IAAI,KAAK,CAAC;gBACjC,IAAM,aAAa,GAAG,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;gBAC3E,IAAI,QAAQ,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;gBAEpF,IAAI,QAAQ,IAAI,aAAa,EAAE;oBAC3B,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;iBACnE;gBAED,IAAI,KAAK,EAAE;oBACP,MAAM,CAAC,WAAW,GAAG,QAAQ,GAAG,IAAI,CAAC;iBACxC;qBAAM;oBACH,MAAM,CAAC,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC;iBACvC;aACJ;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1C,CAAC;IAhDD,kDAgDC","sourcesContent":["import { createListLevel, parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelListItem,\n ContentModelListLevel,\n} from 'roosterjs-content-model-types';\n\nconst IndentStepInPixel = 40;\n\n/**\n * @internal\n */\nexport function setModelIndentation(\n model: ContentModelDocument,\n indentation: 'indent' | 'outdent',\n length: number = IndentStepInPixel\n) {\n const paragraphOrListItem = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n const isIndent = indentation == 'indent';\n\n paragraphOrListItem.forEach(({ block }) => {\n if (isBlockGroupOfType<ContentModelListItem>(block, 'ListItem')) {\n if (isIndent) {\n const lastLevel = block.levels[block.levels.length - 1];\n const newLevel: ContentModelListLevel = createListLevel(\n lastLevel?.listType || 'UL',\n lastLevel?.format\n );\n\n // New level is totally new, no need to have these attributes for now\n delete newLevel.format.startNumberOverride;\n\n block.levels.push(newLevel);\n } else {\n block.levels.pop();\n }\n } else if (block) {\n const { format } = block;\n const { marginLeft, marginRight, direction } = format;\n const isRtl = direction == 'rtl';\n const originalValue = parseValueWithUnit(isRtl ? marginRight : marginLeft);\n let newValue = (isIndent ? Math.ceil : Math.floor)(originalValue / length) * length;\n\n if (newValue == originalValue) {\n newValue = Math.max(newValue + length * (isIndent ? 1 : -1), 0);\n }\n\n if (isRtl) {\n format.marginRight = newValue + 'px';\n } else {\n format.marginLeft = newValue + 'px';\n }\n }\n });\n\n return paragraphOrListItem.length > 0;\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core", "../common/wrapBlock"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1, wrapBlock_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.toggleModelBlockQuote = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function toggleModelBlockQuote(model, format) {
|
|
9
|
+
var paragraphOfQuote = (0, roosterjs_content_model_core_1.getOperationalBlocks)(model, ['FormatContainer', 'ListItem'], ['TableCell'], true /*deepFirst*/);
|
|
10
|
+
if (areAllBlockQuotes(paragraphOfQuote)) {
|
|
11
|
+
// All selections are already in quote, we need to unquote them
|
|
12
|
+
paragraphOfQuote.forEach(function (_a) {
|
|
13
|
+
var block = _a.block, parent = _a.parent;
|
|
14
|
+
(0, roosterjs_content_model_dom_1.unwrapBlock)(parent, block);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
var step1Results_1 = [];
|
|
19
|
+
var creator_1 = function () { return (0, roosterjs_content_model_dom_1.createFormatContainer)('blockquote', format); };
|
|
20
|
+
var canMerge_1 = function (target, current) {
|
|
21
|
+
return canMergeQuote(target, (current === null || current === void 0 ? void 0 : current.format) || format);
|
|
22
|
+
};
|
|
23
|
+
paragraphOfQuote.forEach(function (_a) {
|
|
24
|
+
var block = _a.block, parent = _a.parent;
|
|
25
|
+
if (isQuote(block)) {
|
|
26
|
+
// Already in quote, no op
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
(0, wrapBlock_1.wrapBlockStep1)(step1Results_1, parent, block, creator_1, canMerge_1);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
(0, wrapBlock_1.wrapBlockStep2)(step1Results_1, canMerge_1);
|
|
33
|
+
}
|
|
34
|
+
return paragraphOfQuote.length > 0;
|
|
35
|
+
}
|
|
36
|
+
exports.toggleModelBlockQuote = toggleModelBlockQuote;
|
|
37
|
+
function canMergeQuote(target, format) {
|
|
38
|
+
return isQuote(target) && (0, roosterjs_content_model_dom_1.areSameFormats)(format, target.format);
|
|
39
|
+
}
|
|
40
|
+
function isQuote(block) {
|
|
41
|
+
return ((0, roosterjs_content_model_core_1.isBlockGroupOfType)(block, 'FormatContainer') &&
|
|
42
|
+
block.tagName == 'blockquote');
|
|
43
|
+
}
|
|
44
|
+
function areAllBlockQuotes(blockAndParents) {
|
|
45
|
+
return blockAndParents.every(function (blockAndParent) { return isQuote(blockAndParent.block); });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=toggleModelBlockQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggleModelBlockQuote.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/toggleModelBlockQuote.ts"],"names":[],"mappings":";;;;IAcA;;OAEG;IACH,SAAgB,qBAAqB,CACjC,KAA2B,EAC3B,MAAyC;QAEzC,IAAM,gBAAgB,GAAG,IAAA,mDAAoB,EAE3C,KAAK,EAAE,CAAC,iBAAiB,EAAE,UAAU,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAE7E,IAAI,iBAAiB,CAAC,gBAAgB,CAAC,EAAE;YACrC,+DAA+D;YAC/D,gBAAgB,CAAC,OAAO,CAAC,UAAC,EAAiB;oBAAf,KAAK,WAAA,EAAE,MAAM,YAAA;gBACrC,IAAA,yCAAW,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAM,cAAY,GAAwD,EAAE,CAAC;YAC7E,IAAM,SAAO,GAAG,cAAM,OAAA,IAAA,mDAAqB,EAAC,YAAY,EAAE,MAAM,CAAC,EAA3C,CAA2C,CAAC;YAClE,IAAM,UAAQ,GAAG,UACb,MAAyB,EACzB,OAAqC;gBAErC,OAAA,aAAa,CAAC,MAAM,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,MAAM,CAAC;YAAhD,CAAgD,CAAC;YAErD,gBAAgB,CAAC,OAAO,CAAC,UAAC,EAAiB;oBAAf,KAAK,WAAA,EAAE,MAAM,YAAA;gBACrC,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;oBAChB,0BAA0B;iBAC7B;qBAAM;oBACH,IAAA,0BAAc,EAAC,cAAY,EAAE,MAAM,EAAE,KAAK,EAAE,SAAO,EAAE,UAAQ,CAAC,CAAC;iBAClE;YACL,CAAC,CAAC,CAAC;YAEH,IAAA,0BAAc,EAAC,cAAY,EAAE,UAAQ,CAAC,CAAC;SAC1C;QAED,OAAO,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC;IACvC,CAAC;IAlCD,sDAkCC;IAED,SAAS,aAAa,CAClB,MAAyB,EACzB,MAAyC;QAEzC,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,IAAA,4CAAc,EAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED,SAAS,OAAO,CAAC,KAAwB;QACrC,OAAO,CACH,IAAA,iDAAkB,EAA8B,KAAK,EAAE,iBAAiB,CAAC;YACzE,KAAK,CAAC,OAAO,IAAI,YAAY,CAChC,CAAC;IACN,CAAC;IAED,SAAS,iBAAiB,CACtB,eAAwF;QAExF,OAAO,eAAe,CAAC,KAAK,CAAC,UAAA,cAAc,IAAI,OAAA,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAAC;IAClF,CAAC","sourcesContent":["import { areSameFormats, createFormatContainer, unwrapBlock } from 'roosterjs-content-model-dom';\nimport { getOperationalBlocks, isBlockGroupOfType } from 'roosterjs-content-model-core';\nimport { wrapBlockStep1, wrapBlockStep2 } from '../common/wrapBlock';\nimport type { OperationalBlocks } from 'roosterjs-content-model-core';\nimport type { WrapBlockStep1Result } from '../common/wrapBlock';\nimport type {\n ContentModelBlock,\n ContentModelBlockGroup,\n ContentModelDocument,\n ContentModelFormatContainer,\n ContentModelFormatContainerFormat,\n ContentModelListItem,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function toggleModelBlockQuote(\n model: ContentModelDocument,\n format: ContentModelFormatContainerFormat\n): boolean {\n const paragraphOfQuote = getOperationalBlocks<\n ContentModelFormatContainer | ContentModelListItem\n >(model, ['FormatContainer', 'ListItem'], ['TableCell'], true /*deepFirst*/);\n\n if (areAllBlockQuotes(paragraphOfQuote)) {\n // All selections are already in quote, we need to unquote them\n paragraphOfQuote.forEach(({ block, parent }) => {\n unwrapBlock(parent, block);\n });\n } else {\n const step1Results: WrapBlockStep1Result<ContentModelFormatContainer>[] = [];\n const creator = () => createFormatContainer('blockquote', format);\n const canMerge = (\n target: ContentModelBlock,\n current?: ContentModelFormatContainer\n ): target is ContentModelFormatContainer =>\n canMergeQuote(target, current?.format || format);\n\n paragraphOfQuote.forEach(({ block, parent }) => {\n if (isQuote(block)) {\n // Already in quote, no op\n } else {\n wrapBlockStep1(step1Results, parent, block, creator, canMerge);\n }\n });\n\n wrapBlockStep2(step1Results, canMerge);\n }\n\n return paragraphOfQuote.length > 0;\n}\n\nfunction canMergeQuote(\n target: ContentModelBlock,\n format: ContentModelFormatContainerFormat\n): target is ContentModelFormatContainer {\n return isQuote(target) && areSameFormats(format, target.format);\n}\n\nfunction isQuote(block: ContentModelBlock): block is ContentModelFormatContainer {\n return (\n isBlockGroupOfType<ContentModelFormatContainer>(block, 'FormatContainer') &&\n block.tagName == 'blockquote'\n );\n}\n\nfunction areAllBlockQuotes(\n blockAndParents: OperationalBlocks<ContentModelFormatContainer | ContentModelListItem>[]\n): blockAndParents is { block: ContentModelFormatContainer; parent: ContentModelBlockGroup }[] {\n return blockAndParents.every(blockAndParent => isQuote(blockAndParent.block));\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentModelBlock, ContentModelBlockGroup, ContentModelDocument, ContentModelSegment, ContentModelTable } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function clearModelFormat(model: ContentModelDocument, blocksToClear: [ContentModelBlockGroup[], ContentModelBlock][], segmentsToClear: ContentModelSegment[], tablesToClear: [ContentModelTable, boolean][]): void;
|