roosterjs-content-model-api 0.27.0 → 9.0.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/README.md +47 -37
- package/lib/index.d.ts +48 -42
- package/lib/index.js +56 -43
- package/lib/index.js.map +1 -1
- package/lib/modelApi/block/setModelAlignment.js +2 -2
- package/lib/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib/modelApi/block/setModelDirection.js +5 -5
- package/lib/modelApi/block/setModelDirection.js.map +1 -1
- package/lib/modelApi/block/setModelIndentation.js +6 -7
- package/lib/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib/modelApi/block/toggleModelBlockQuote.js +3 -4
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib/modelApi/common/clearModelFormat.js +6 -7
- package/lib/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
- package/lib/modelApi/common/reducedModelChildProcessor.js +64 -0
- package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -0
- package/lib/modelApi/common/wrapBlock.js.map +1 -1
- package/lib/modelApi/entity/insertEntityModel.d.ts +2 -2
- package/lib/modelApi/entity/insertEntityModel.js +19 -10
- package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.js +3 -3
- package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib/modelApi/link/matchLink.d.ts +1 -18
- package/lib/modelApi/link/matchLink.js +0 -1
- package/lib/modelApi/link/matchLink.js.map +1 -1
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib/modelApi/list/setListType.js +3 -4
- package/lib/modelApi/list/setListType.js.map +1 -1
- package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -0
- package/lib/modelApi/list/setModelListStartNumber.js +22 -0
- package/lib/modelApi/list/setModelListStartNumber.js.map +1 -0
- package/lib/modelApi/list/setModelListStyle.d.ts +7 -0
- package/lib/modelApi/list/setModelListStyle.js +26 -0
- package/lib/modelApi/list/setModelListStyle.js.map +1 -0
- package/lib/modelApi/selection/adjustSegmentSelection.js +3 -3
- package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +1 -2
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustWordSelection.js +3 -4
- package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib/modelApi/table/alignTable.js.map +1 -1
- package/lib/modelApi/table/alignTableCell.js +3 -3
- package/lib/modelApi/table/alignTableCell.js.map +1 -1
- package/lib/modelApi/table/canMergeCells.js.map +1 -1
- package/lib/modelApi/table/clearSelectedCells.js +2 -2
- package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib/modelApi/table/createTableStructure.js.map +1 -1
- package/lib/modelApi/table/deleteTable.js.map +1 -1
- package/lib/modelApi/table/deleteTableColumn.js +2 -2
- package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib/modelApi/table/deleteTableRow.js +2 -2
- package/lib/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib/modelApi/table/insertTableColumn.js +1 -2
- package/lib/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib/modelApi/table/insertTableRow.js +1 -2
- package/lib/modelApi/table/insertTableRow.js.map +1 -1
- package/lib/modelApi/table/mergeTableCells.js +2 -2
- package/lib/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib/modelApi/table/mergeTableColumn.js +2 -2
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib/modelApi/table/mergeTableRow.js +2 -2
- package/lib/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib/modelApi/table/splitTableCellHorizontally.js +1 -2
- package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib/modelApi/table/splitTableCellVertically.js +1 -2
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib/publicApi/block/setAlignment.d.ts +1 -1
- package/lib/publicApi/block/setAlignment.js +2 -1
- package/lib/publicApi/block/setAlignment.js.map +1 -1
- package/lib/publicApi/block/setDirection.d.ts +1 -1
- package/lib/publicApi/block/setDirection.js +2 -1
- package/lib/publicApi/block/setDirection.js.map +1 -1
- package/lib/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib/publicApi/block/setHeadingLevel.js +2 -1
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib/publicApi/block/setIndentation.d.ts +1 -1
- package/lib/publicApi/block/setIndentation.js +2 -1
- package/lib/publicApi/block/setIndentation.js.map +1 -1
- package/lib/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib/publicApi/block/setParagraphMargin.js +2 -1
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib/publicApi/block/setSpacing.d.ts +1 -1
- package/lib/publicApi/block/setSpacing.js +2 -1
- package/lib/publicApi/block/setSpacing.js.map +1 -1
- package/lib/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib/publicApi/block/toggleBlockQuote.js +2 -1
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib/publicApi/entity/insertEntity.d.ts +3 -3
- package/lib/publicApi/entity/insertEntity.js +19 -12
- package/lib/publicApi/entity/insertEntity.js.map +1 -1
- package/lib/publicApi/format/clearFormat.d.ts +1 -1
- package/lib/publicApi/format/clearFormat.js +2 -1
- package/lib/publicApi/format/clearFormat.js.map +1 -1
- package/lib/publicApi/format/getFormatState.d.ts +1 -1
- package/lib/publicApi/format/getFormatState.js +13 -4
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib/publicApi/image/adjustImageSelection.js +2 -1
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib/publicApi/image/changeImage.d.ts +1 -1
- package/lib/publicApi/image/changeImage.js +6 -5
- package/lib/publicApi/image/changeImage.js.map +1 -1
- package/lib/publicApi/image/insertImage.d.ts +1 -1
- package/lib/publicApi/image/insertImage.js +4 -4
- package/lib/publicApi/image/insertImage.js.map +1 -1
- package/lib/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib/publicApi/image/setImageAltText.js +3 -2
- package/lib/publicApi/image/setImageAltText.js.map +1 -1
- package/lib/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib/publicApi/image/setImageBorder.js +4 -3
- package/lib/publicApi/image/setImageBorder.js.map +1 -1
- package/lib/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib/publicApi/image/setImageBoxShadow.js +3 -2
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib/publicApi/link/adjustLinkSelection.js +5 -4
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib/publicApi/link/insertLink.d.ts +1 -1
- package/lib/publicApi/link/insertLink.js +5 -5
- package/lib/publicApi/link/insertLink.js.map +1 -1
- package/lib/publicApi/link/removeLink.d.ts +1 -1
- package/lib/publicApi/link/removeLink.js +4 -3
- package/lib/publicApi/link/removeLink.js.map +1 -1
- package/lib/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib/publicApi/list/setListStartNumber.js +4 -11
- package/lib/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib/publicApi/list/setListStyle.d.ts +1 -1
- package/lib/publicApi/list/setListStyle.js +4 -18
- package/lib/publicApi/list/setListStyle.js.map +1 -1
- package/lib/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib/publicApi/list/toggleBullet.js +2 -1
- package/lib/publicApi/list/toggleBullet.js.map +1 -1
- package/lib/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib/publicApi/list/toggleNumbering.js +2 -1
- package/lib/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib/publicApi/segment/applySegmentFormat.js +2 -1
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib/publicApi/segment/changeCapitalization.js +2 -1
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib/publicApi/segment/changeFontSize.js +2 -1
- package/lib/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib/publicApi/segment/setBackgroundColor.js +3 -3
- package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib/publicApi/segment/setFontName.d.ts +1 -1
- package/lib/publicApi/segment/setFontName.js +2 -1
- package/lib/publicApi/segment/setFontName.js.map +1 -1
- package/lib/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib/publicApi/segment/setFontSize.js +2 -2
- package/lib/publicApi/segment/setFontSize.js.map +1 -1
- package/lib/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib/publicApi/segment/setTextColor.js +2 -1
- package/lib/publicApi/segment/setTextColor.js.map +1 -1
- package/lib/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib/publicApi/segment/toggleBold.js +4 -3
- package/lib/publicApi/segment/toggleBold.js.map +1 -1
- package/lib/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib/publicApi/segment/toggleCode.js +2 -1
- package/lib/publicApi/segment/toggleCode.js.map +1 -1
- package/lib/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib/publicApi/segment/toggleItalic.js +2 -1
- package/lib/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib/publicApi/segment/toggleSubscript.js +2 -1
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib/publicApi/segment/toggleSuperscript.js +2 -1
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib/publicApi/segment/toggleUnderline.js +2 -1
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.js +6 -6
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib/publicApi/table/editTable.d.ts +1 -1
- package/lib/publicApi/table/editTable.js +2 -1
- package/lib/publicApi/table/editTable.js.map +1 -1
- package/lib/publicApi/table/formatTable.d.ts +1 -1
- package/lib/publicApi/table/formatTable.js +6 -5
- package/lib/publicApi/table/formatTable.js.map +1 -1
- package/lib/publicApi/table/insertTable.d.ts +1 -1
- package/lib/publicApi/table/insertTable.js +8 -8
- package/lib/publicApi/table/insertTable.js.map +1 -1
- package/lib/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib/publicApi/table/setTableCellShade.js +7 -6
- package/lib/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js +127 -0
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +6 -3
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +9 -3
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTableWithContentModel.js +5 -6
- package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-amd/index.d.ts +48 -42
- package/lib-amd/index.js +50 -44
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/modelApi/block/setModelAlignment.js +2 -2
- package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-amd/modelApi/block/setModelDirection.js +5 -5
- package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-amd/modelApi/block/setModelIndentation.js +6 -6
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js +3 -3
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-amd/modelApi/common/clearModelFormat.js +7 -7
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js +64 -0
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -0
- package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-amd/modelApi/entity/insertEntityModel.d.ts +2 -2
- package/lib-amd/modelApi/entity/insertEntityModel.js +20 -10
- package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.js +4 -3
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
- package/lib-amd/modelApi/link/matchLink.js +0 -1
- package/lib-amd/modelApi/link/matchLink.js.map +1 -1
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-amd/modelApi/list/setListType.js +4 -4
- package/lib-amd/modelApi/list/setListType.js.map +1 -1
- package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -0
- package/lib-amd/modelApi/list/setModelListStartNumber.js +23 -0
- package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -0
- package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -0
- package/lib-amd/modelApi/list/setModelListStyle.js +26 -0
- package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -0
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js +3 -3
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +2 -2
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustWordSelection.js +4 -4
- package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-amd/modelApi/table/alignTable.js.map +1 -1
- package/lib-amd/modelApi/table/alignTableCell.js +3 -3
- package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-amd/modelApi/table/clearSelectedCells.js +2 -2
- package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableColumn.js +2 -2
- package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableRow.js +2 -2
- package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableColumn.js +2 -2
- package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableRow.js +2 -2
- package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableCells.js +2 -2
- package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableColumn.js +2 -2
- package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableRow.js +2 -2
- package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js +2 -2
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellVertically.js +2 -2
- package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-amd/publicApi/block/setAlignment.d.ts +1 -1
- package/lib-amd/publicApi/block/setAlignment.js +2 -1
- package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
- package/lib-amd/publicApi/block/setDirection.d.ts +1 -1
- package/lib-amd/publicApi/block/setDirection.js +2 -1
- package/lib-amd/publicApi/block/setDirection.js.map +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
- package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-amd/publicApi/block/setIndentation.d.ts +1 -1
- package/lib-amd/publicApi/block/setIndentation.js +2 -1
- package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
- package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-amd/publicApi/block/setSpacing.d.ts +1 -1
- package/lib-amd/publicApi/block/setSpacing.js +2 -1
- package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-amd/publicApi/entity/insertEntity.d.ts +3 -3
- package/lib-amd/publicApi/entity/insertEntity.js +19 -12
- package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-amd/publicApi/format/clearFormat.d.ts +1 -1
- package/lib-amd/publicApi/format/clearFormat.js +2 -1
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.d.ts +1 -1
- package/lib-amd/publicApi/format/getFormatState.js +12 -4
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
- package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-amd/publicApi/image/changeImage.d.ts +1 -1
- package/lib-amd/publicApi/image/changeImage.js +6 -5
- package/lib-amd/publicApi/image/changeImage.js.map +1 -1
- package/lib-amd/publicApi/image/insertImage.d.ts +1 -1
- package/lib-amd/publicApi/image/insertImage.js +5 -4
- package/lib-amd/publicApi/image/insertImage.js.map +1 -1
- package/lib-amd/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageAltText.js +3 -2
- package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageBorder.js +4 -3
- package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
- package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.js +5 -4
- package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-amd/publicApi/link/insertLink.d.ts +1 -1
- package/lib-amd/publicApi/link/insertLink.js +6 -5
- package/lib-amd/publicApi/link/insertLink.js.map +1 -1
- package/lib-amd/publicApi/link/removeLink.d.ts +1 -1
- package/lib-amd/publicApi/link/removeLink.js +4 -3
- package/lib-amd/publicApi/link/removeLink.js.map +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.js +4 -11
- package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-amd/publicApi/list/setListStyle.d.ts +1 -1
- package/lib-amd/publicApi/list/setListStyle.js +4 -17
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
- package/lib-amd/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib-amd/publicApi/list/toggleBullet.js +2 -1
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.js +2 -1
- package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
- package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
- package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.js +4 -3
- package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontName.d.ts +1 -1
- package/lib-amd/publicApi/segment/setFontName.js +2 -1
- package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib-amd/publicApi/segment/setFontSize.js +2 -2
- package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib-amd/publicApi/segment/setTextColor.js +2 -1
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleBold.js +4 -3
- package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleCode.js +2 -1
- package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
- package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
- package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
- package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.js +7 -6
- package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-amd/publicApi/table/editTable.d.ts +1 -1
- package/lib-amd/publicApi/table/editTable.js +2 -1
- package/lib-amd/publicApi/table/editTable.js.map +1 -1
- package/lib-amd/publicApi/table/formatTable.d.ts +1 -1
- package/lib-amd/publicApi/table/formatTable.js +6 -5
- package/lib-amd/publicApi/table/formatTable.js.map +1 -1
- package/lib-amd/publicApi/table/insertTable.d.ts +1 -1
- package/lib-amd/publicApi/table/insertTable.js +8 -7
- package/lib-amd/publicApi/table/insertTable.js.map +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.js +7 -6
- package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +127 -0
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +6 -3
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +9 -3
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js +6 -6
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-mjs/index.d.ts +48 -42
- package/lib-mjs/index.js +48 -42
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelAlignment.js +1 -1
- package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelDirection.js +1 -1
- package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelIndentation.js +1 -2
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +1 -2
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-mjs/modelApi/common/clearModelFormat.js +1 -2
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +60 -0
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -0
- package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +2 -2
- package/lib-mjs/modelApi/entity/insertEntityModel.js +18 -9
- package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js +2 -3
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
- package/lib-mjs/modelApi/link/matchLink.js +0 -1
- package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-mjs/modelApi/list/setListType.js +1 -2
- package/lib-mjs/modelApi/list/setListType.js.map +1 -1
- package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -0
- package/lib-mjs/modelApi/list/setModelListStartNumber.js +18 -0
- package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -0
- package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -0
- package/lib-mjs/modelApi/list/setModelListStyle.js +22 -0
- package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -0
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +1 -1
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +1 -2
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustWordSelection.js +1 -2
- package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTableCell.js +1 -1
- package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-mjs/modelApi/table/clearSelectedCells.js +1 -1
- package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableColumn.js +1 -1
- package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableRow.js +1 -1
- package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableColumn.js +1 -2
- package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableRow.js +1 -2
- package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableCells.js +1 -1
- package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableColumn.js +1 -1
- package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableRow.js +1 -1
- package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +1 -2
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellVertically.js +1 -2
- package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-mjs/publicApi/block/setAlignment.d.ts +1 -1
- package/lib-mjs/publicApi/block/setAlignment.js +1 -1
- package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
- package/lib-mjs/publicApi/block/setDirection.d.ts +1 -1
- package/lib-mjs/publicApi/block/setDirection.js +1 -1
- package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-mjs/publicApi/block/setIndentation.d.ts +1 -1
- package/lib-mjs/publicApi/block/setIndentation.js +1 -1
- package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-mjs/publicApi/block/setSpacing.d.ts +1 -1
- package/lib-mjs/publicApi/block/setSpacing.js +1 -1
- package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-mjs/publicApi/entity/insertEntity.d.ts +3 -3
- package/lib-mjs/publicApi/entity/insertEntity.js +18 -12
- package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-mjs/publicApi/format/clearFormat.d.ts +1 -1
- package/lib-mjs/publicApi/format/clearFormat.js +1 -1
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.d.ts +1 -1
- package/lib-mjs/publicApi/format/getFormatState.js +12 -4
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-mjs/publicApi/image/changeImage.d.ts +1 -1
- package/lib-mjs/publicApi/image/changeImage.js +3 -3
- package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
- package/lib-mjs/publicApi/image/insertImage.d.ts +1 -1
- package/lib-mjs/publicApi/image/insertImage.js +2 -3
- package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
- package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
- package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
- package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.js +2 -2
- package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-mjs/publicApi/link/insertLink.d.ts +1 -1
- package/lib-mjs/publicApi/link/insertLink.js +2 -3
- package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
- package/lib-mjs/publicApi/link/removeLink.d.ts +1 -1
- package/lib-mjs/publicApi/link/removeLink.js +2 -2
- package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.d.ts +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.js +3 -11
- package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStyle.d.ts +1 -1
- package/lib-mjs/publicApi/list/setListStyle.js +3 -18
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.js +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.js +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.d.ts +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.js +2 -3
- package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontName.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setFontName.js +1 -1
- package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.d.ts +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.js +2 -2
- package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js +2 -3
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-mjs/publicApi/table/editTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/editTable.js +1 -1
- package/lib-mjs/publicApi/table/editTable.js.map +1 -1
- package/lib-mjs/publicApi/table/formatTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/formatTable.js +2 -2
- package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
- package/lib-mjs/publicApi/table/insertTable.d.ts +1 -1
- package/lib-mjs/publicApi/table/insertTable.js +2 -3
- package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.d.ts +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.js +2 -2
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +123 -0
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +5 -2
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +8 -2
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +1 -2
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -6,13 +6,17 @@ Rooster is a framework-independent JavaScript rich-text editor neatly nested
|
|
|
6
6
|
inside one HTML `<div>` element. Editing operations performed by end users are
|
|
7
7
|
handled in simple ways to generate the final HTML.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Rooster is working on top of a middle layer data structure called "Content Model".
|
|
10
|
+
All format API and editing operation are using this Content Model layer as content format,
|
|
11
|
+
and finally convert to HTML and show it in editor.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
To view the demo site, please click the link below:
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
[RoosterJs Demo Site](https://microsoft.github.io/roosterjs/index.html).
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
## Upgrade from RoosterJs 8.\*
|
|
18
|
+
|
|
19
|
+
Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-9).
|
|
16
20
|
|
|
17
21
|
## Features
|
|
18
22
|
|
|
@@ -25,24 +29,22 @@ Rooster contains 6 basic packages.
|
|
|
25
29
|
`createEditor()` function in roosterjs to create an editor with default
|
|
26
30
|
configurations.
|
|
27
31
|
|
|
28
|
-
2. [roosterjs-
|
|
29
|
-
Defines the core editor and plugin infrastructure. Use `roosterjs-
|
|
32
|
+
2. [roosterjs-content-model-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_core.html):
|
|
33
|
+
Defines the core editor and plugin infrastructure. Use `roosterjs-content-model-core`
|
|
30
34
|
instead of `roosterjs` to build and customize your own editor.
|
|
31
35
|
|
|
32
|
-
3. [roosterjs-
|
|
36
|
+
3. [roosterjs-content-model-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_api.html):
|
|
33
37
|
Defines APIs for editor operations. Use these APIs to modify content and
|
|
34
|
-
formatting in the editor you built using `roosterjs-
|
|
38
|
+
formatting in the editor you built using `roosterjs-content-model-core`.
|
|
35
39
|
|
|
36
|
-
4. [roosterjs-
|
|
37
|
-
Defines APIs for DOM operations.
|
|
38
|
-
you want to access DOM API directly.
|
|
40
|
+
4. [roosterjs-content-model-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_dom.html):
|
|
41
|
+
Defines APIs for Content Model and DOM operations. This package do conversion between DOM tree and roosterjs Content Model.
|
|
39
42
|
|
|
40
|
-
5. [roosterjs-
|
|
41
|
-
Defines basic plugins for common features.
|
|
42
|
-
pasting HTML content, inserting inline images.
|
|
43
|
+
5. [roosterjs-content-model-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_plugins.html):
|
|
44
|
+
Defines basic plugins for common features.
|
|
43
45
|
|
|
44
|
-
6. [roosterjs-
|
|
45
|
-
Defines public interfaces and enumerations.
|
|
46
|
+
6. [roosterjs-content-model-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_types.html):
|
|
47
|
+
Defines public interfaces and enumerations, including Content Model types, API parameters and other types.
|
|
46
48
|
|
|
47
49
|
There are also some extension packages to provide additional functionalities.
|
|
48
50
|
|
|
@@ -52,30 +54,38 @@ There are also some extension packages to provide additional functionalities.
|
|
|
52
54
|
2. [roosterjs-react](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_react.html):
|
|
53
55
|
Provide a React wrapper of roosterjs so it can be easily used with React.
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
To be compatible with old (8.\*) versions, you can use `EditorAdapter` class from the following package which can act as a 8.\* Editor:
|
|
58
|
+
|
|
59
|
+
1. [roosterjs-editor-adapter](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_adapter.html):
|
|
60
|
+
Provide a adapter class `EditorAdapter` to work with Editor (9.\*) and legacy plugins (via [EditorAdapterOptions.legacyPlugins](https://microsoft.github.io/roosterjs/docs/interfaces/roosterjs_editor_adapter.editoradapteroptions.html#legacyplugins))
|
|
61
|
+
|
|
62
|
+
And the following packages are for old (8.\*) compatibility:
|
|
63
|
+
|
|
64
|
+
1. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
|
|
65
|
+
2. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
|
|
66
|
+
3. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
|
|
67
|
+
4. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
|
|
68
|
+
5. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
|
|
69
|
+
6. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
|
|
59
70
|
|
|
60
71
|
### APIs
|
|
61
72
|
|
|
62
|
-
Rooster provides
|
|
63
|
-
(in `roosterjs-
|
|
73
|
+
Rooster provides Content Model level APIs (in `roosterjs-content-model-dom`), core APIs (in `roosterjs-content-model-core`), and formatting APIs
|
|
74
|
+
(in `roosterjs-content-modelapi`) to perform editing operations.
|
|
64
75
|
|
|
65
|
-
`roosterjs-
|
|
76
|
+
`roosterjs-content-model-dom` provides several levels of Content Model operations:
|
|
66
77
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
ContentTraverser API.
|
|
78
|
+
- Create Content Model elements
|
|
79
|
+
- Convert DOM tree to Content Model
|
|
80
|
+
- Convert Content Model to DOM tree
|
|
81
|
+
- Format handlers
|
|
82
|
+
- A few DOM level API
|
|
73
83
|
|
|
74
|
-
`roosterjs-
|
|
75
|
-
APIs to perform basic editor operations. These APIs
|
|
84
|
+
`roosterjs-content-model-core` provides APIs for editor core. Editor class will call such
|
|
85
|
+
APIs to perform basic editor operations. These APIs can be overridden by specifying
|
|
76
86
|
API overrides in Editor options when creating the editor.
|
|
77
87
|
|
|
78
|
-
`roosterjs-
|
|
88
|
+
`roosterjs-content-model-api` provides APIs for scenario-based operations triggered by
|
|
79
89
|
user interaction.
|
|
80
90
|
|
|
81
91
|
## Plugins
|
|
@@ -99,7 +109,7 @@ class HelloRooster implements EditorPlugin {
|
|
|
99
109
|
dispose() {}
|
|
100
110
|
|
|
101
111
|
onPluginEvent(e: PluginEvent) {
|
|
102
|
-
if (e.eventType ==
|
|
112
|
+
if (e.eventType == 'input' && e.rawEvent.which == 65) {
|
|
103
113
|
alert('Hello Rooster');
|
|
104
114
|
}
|
|
105
115
|
}
|
|
@@ -114,9 +124,9 @@ Install via NPM or Yarn:
|
|
|
114
124
|
|
|
115
125
|
You can also install sub packages separately:
|
|
116
126
|
|
|
117
|
-
`yarn add roosterjs-
|
|
127
|
+
`yarn add roosterjs-content-model-core`
|
|
118
128
|
|
|
119
|
-
`yarn add roosterjs-
|
|
129
|
+
`yarn add roosterjs-content-model-api`
|
|
120
130
|
|
|
121
131
|
`...`
|
|
122
132
|
|
|
@@ -161,9 +171,9 @@ In order to run the code below, you may also need to install [webpack](https://w
|
|
|
161
171
|
|
|
162
172
|
## Sample code
|
|
163
173
|
|
|
164
|
-
To view the
|
|
174
|
+
To view the demo site, please click [here](https://microsoft.github.io/roosterjs/index.html).
|
|
165
175
|
|
|
166
|
-
To build the
|
|
176
|
+
To build the demo site code yourself, follow these instructions:
|
|
167
177
|
|
|
168
178
|
1. Get dependencies using [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/):
|
|
169
179
|
|
package/lib/index.d.ts
CHANGED
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
1
|
+
export { insertTable } from './publicApi/table/insertTable';
|
|
2
|
+
export { formatTable } from './publicApi/table/formatTable';
|
|
3
|
+
export { setTableCellShade } from './publicApi/table/setTableCellShade';
|
|
4
|
+
export { editTable } from './publicApi/table/editTable';
|
|
5
|
+
export { applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';
|
|
6
|
+
export { toggleBullet } from './publicApi/list/toggleBullet';
|
|
7
|
+
export { toggleNumbering } from './publicApi/list/toggleNumbering';
|
|
8
|
+
export { toggleBold } from './publicApi/segment/toggleBold';
|
|
9
|
+
export { toggleItalic } from './publicApi/segment/toggleItalic';
|
|
10
|
+
export { toggleUnderline } from './publicApi/segment/toggleUnderline';
|
|
11
|
+
export { toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';
|
|
12
|
+
export { toggleSubscript } from './publicApi/segment/toggleSubscript';
|
|
13
|
+
export { toggleSuperscript } from './publicApi/segment/toggleSuperscript';
|
|
14
|
+
export { setBackgroundColor } from './publicApi/segment/setBackgroundColor';
|
|
15
|
+
export { setFontName } from './publicApi/segment/setFontName';
|
|
16
|
+
export { setFontSize } from './publicApi/segment/setFontSize';
|
|
17
|
+
export { setTextColor } from './publicApi/segment/setTextColor';
|
|
18
|
+
export { changeFontSize } from './publicApi/segment/changeFontSize';
|
|
19
|
+
export { applySegmentFormat } from './publicApi/segment/applySegmentFormat';
|
|
20
|
+
export { changeCapitalization } from './publicApi/segment/changeCapitalization';
|
|
21
|
+
export { insertImage } from './publicApi/image/insertImage';
|
|
22
|
+
export { setListStyle } from './publicApi/list/setListStyle';
|
|
23
|
+
export { setListStartNumber } from './publicApi/list/setListStartNumber';
|
|
24
|
+
export { setIndentation } from './publicApi/block/setIndentation';
|
|
25
|
+
export { setAlignment } from './publicApi/block/setAlignment';
|
|
26
|
+
export { setDirection } from './publicApi/block/setDirection';
|
|
27
|
+
export { setHeadingLevel } from './publicApi/block/setHeadingLevel';
|
|
28
|
+
export { toggleBlockQuote } from './publicApi/block/toggleBlockQuote';
|
|
29
|
+
export { setSpacing } from './publicApi/block/setSpacing';
|
|
30
|
+
export { setImageBorder } from './publicApi/image/setImageBorder';
|
|
31
|
+
export { setImageBoxShadow } from './publicApi/image/setImageBoxShadow';
|
|
32
|
+
export { changeImage } from './publicApi/image/changeImage';
|
|
33
|
+
export { getFormatState } from './publicApi/format/getFormatState';
|
|
34
|
+
export { clearFormat } from './publicApi/format/clearFormat';
|
|
35
|
+
export { insertLink } from './publicApi/link/insertLink';
|
|
36
|
+
export { removeLink } from './publicApi/link/removeLink';
|
|
37
|
+
export { adjustLinkSelection } from './publicApi/link/adjustLinkSelection';
|
|
38
|
+
export { setImageAltText } from './publicApi/image/setImageAltText';
|
|
39
|
+
export { adjustImageSelection } from './publicApi/image/adjustImageSelection';
|
|
40
|
+
export { setParagraphMargin } from './publicApi/block/setParagraphMargin';
|
|
41
|
+
export { toggleCode } from './publicApi/segment/toggleCode';
|
|
42
|
+
export { insertEntity } from './publicApi/entity/insertEntity';
|
|
43
43
|
export { insertTableRow } from './modelApi/table/insertTableRow';
|
|
44
44
|
export { insertTableColumn } from './modelApi/table/insertTableColumn';
|
|
45
45
|
export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
|
|
46
|
+
export { formatImageWithContentModel } from './publicApi/utils/formatImageWithContentModel';
|
|
47
|
+
export { formatParagraphWithContentModel } from './publicApi/utils/formatParagraphWithContentModel';
|
|
48
|
+
export { formatSegmentWithContentModel } from './publicApi/utils/formatSegmentWithContentModel';
|
|
46
49
|
export { setListType } from './modelApi/list/setListType';
|
|
50
|
+
export { setModelListStyle } from './modelApi/list/setModelListStyle';
|
|
51
|
+
export { setModelListStartNumber } from './modelApi/list/setModelListStartNumber';
|
|
47
52
|
export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
|
|
48
53
|
export { setModelIndentation } from './modelApi/block/setModelIndentation';
|
|
54
|
+
export { matchLink } from './modelApi/link/matchLink';
|
package/lib/index.js
CHANGED
|
@@ -1,100 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setModelListStyle = exports.setListType = exports.formatSegmentWithContentModel = exports.formatParagraphWithContentModel = exports.formatImageWithContentModel = exports.formatTableWithContentModel = exports.insertTableColumn = exports.insertTableRow = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
|
|
4
|
+
exports.matchLink = exports.setModelIndentation = exports.findListItemsInSameThread = exports.setModelListStartNumber = void 0;
|
|
4
5
|
var insertTable_1 = require("./publicApi/table/insertTable");
|
|
5
|
-
Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.
|
|
6
|
+
Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.insertTable; } });
|
|
6
7
|
var formatTable_1 = require("./publicApi/table/formatTable");
|
|
7
|
-
Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.
|
|
8
|
+
Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.formatTable; } });
|
|
8
9
|
var setTableCellShade_1 = require("./publicApi/table/setTableCellShade");
|
|
9
|
-
Object.defineProperty(exports, "setTableCellShade", { enumerable: true, get: function () { return setTableCellShade_1.
|
|
10
|
+
Object.defineProperty(exports, "setTableCellShade", { enumerable: true, get: function () { return setTableCellShade_1.setTableCellShade; } });
|
|
10
11
|
var editTable_1 = require("./publicApi/table/editTable");
|
|
11
|
-
Object.defineProperty(exports, "editTable", { enumerable: true, get: function () { return editTable_1.
|
|
12
|
+
Object.defineProperty(exports, "editTable", { enumerable: true, get: function () { return editTable_1.editTable; } });
|
|
12
13
|
var applyTableBorderFormat_1 = require("./publicApi/table/applyTableBorderFormat");
|
|
13
|
-
Object.defineProperty(exports, "applyTableBorderFormat", { enumerable: true, get: function () { return applyTableBorderFormat_1.
|
|
14
|
+
Object.defineProperty(exports, "applyTableBorderFormat", { enumerable: true, get: function () { return applyTableBorderFormat_1.applyTableBorderFormat; } });
|
|
14
15
|
var toggleBullet_1 = require("./publicApi/list/toggleBullet");
|
|
15
|
-
Object.defineProperty(exports, "toggleBullet", { enumerable: true, get: function () { return toggleBullet_1.
|
|
16
|
+
Object.defineProperty(exports, "toggleBullet", { enumerable: true, get: function () { return toggleBullet_1.toggleBullet; } });
|
|
16
17
|
var toggleNumbering_1 = require("./publicApi/list/toggleNumbering");
|
|
17
|
-
Object.defineProperty(exports, "toggleNumbering", { enumerable: true, get: function () { return toggleNumbering_1.
|
|
18
|
+
Object.defineProperty(exports, "toggleNumbering", { enumerable: true, get: function () { return toggleNumbering_1.toggleNumbering; } });
|
|
18
19
|
var toggleBold_1 = require("./publicApi/segment/toggleBold");
|
|
19
|
-
Object.defineProperty(exports, "toggleBold", { enumerable: true, get: function () { return toggleBold_1.
|
|
20
|
+
Object.defineProperty(exports, "toggleBold", { enumerable: true, get: function () { return toggleBold_1.toggleBold; } });
|
|
20
21
|
var toggleItalic_1 = require("./publicApi/segment/toggleItalic");
|
|
21
|
-
Object.defineProperty(exports, "toggleItalic", { enumerable: true, get: function () { return toggleItalic_1.
|
|
22
|
+
Object.defineProperty(exports, "toggleItalic", { enumerable: true, get: function () { return toggleItalic_1.toggleItalic; } });
|
|
22
23
|
var toggleUnderline_1 = require("./publicApi/segment/toggleUnderline");
|
|
23
|
-
Object.defineProperty(exports, "toggleUnderline", { enumerable: true, get: function () { return toggleUnderline_1.
|
|
24
|
+
Object.defineProperty(exports, "toggleUnderline", { enumerable: true, get: function () { return toggleUnderline_1.toggleUnderline; } });
|
|
24
25
|
var toggleStrikethrough_1 = require("./publicApi/segment/toggleStrikethrough");
|
|
25
|
-
Object.defineProperty(exports, "toggleStrikethrough", { enumerable: true, get: function () { return toggleStrikethrough_1.
|
|
26
|
+
Object.defineProperty(exports, "toggleStrikethrough", { enumerable: true, get: function () { return toggleStrikethrough_1.toggleStrikethrough; } });
|
|
26
27
|
var toggleSubscript_1 = require("./publicApi/segment/toggleSubscript");
|
|
27
|
-
Object.defineProperty(exports, "toggleSubscript", { enumerable: true, get: function () { return toggleSubscript_1.
|
|
28
|
+
Object.defineProperty(exports, "toggleSubscript", { enumerable: true, get: function () { return toggleSubscript_1.toggleSubscript; } });
|
|
28
29
|
var toggleSuperscript_1 = require("./publicApi/segment/toggleSuperscript");
|
|
29
|
-
Object.defineProperty(exports, "toggleSuperscript", { enumerable: true, get: function () { return toggleSuperscript_1.
|
|
30
|
+
Object.defineProperty(exports, "toggleSuperscript", { enumerable: true, get: function () { return toggleSuperscript_1.toggleSuperscript; } });
|
|
30
31
|
var setBackgroundColor_1 = require("./publicApi/segment/setBackgroundColor");
|
|
31
|
-
Object.defineProperty(exports, "setBackgroundColor", { enumerable: true, get: function () { return setBackgroundColor_1.
|
|
32
|
+
Object.defineProperty(exports, "setBackgroundColor", { enumerable: true, get: function () { return setBackgroundColor_1.setBackgroundColor; } });
|
|
32
33
|
var setFontName_1 = require("./publicApi/segment/setFontName");
|
|
33
|
-
Object.defineProperty(exports, "setFontName", { enumerable: true, get: function () { return setFontName_1.
|
|
34
|
+
Object.defineProperty(exports, "setFontName", { enumerable: true, get: function () { return setFontName_1.setFontName; } });
|
|
34
35
|
var setFontSize_1 = require("./publicApi/segment/setFontSize");
|
|
35
|
-
Object.defineProperty(exports, "setFontSize", { enumerable: true, get: function () { return setFontSize_1.
|
|
36
|
+
Object.defineProperty(exports, "setFontSize", { enumerable: true, get: function () { return setFontSize_1.setFontSize; } });
|
|
36
37
|
var setTextColor_1 = require("./publicApi/segment/setTextColor");
|
|
37
|
-
Object.defineProperty(exports, "setTextColor", { enumerable: true, get: function () { return setTextColor_1.
|
|
38
|
+
Object.defineProperty(exports, "setTextColor", { enumerable: true, get: function () { return setTextColor_1.setTextColor; } });
|
|
38
39
|
var changeFontSize_1 = require("./publicApi/segment/changeFontSize");
|
|
39
|
-
Object.defineProperty(exports, "changeFontSize", { enumerable: true, get: function () { return changeFontSize_1.
|
|
40
|
+
Object.defineProperty(exports, "changeFontSize", { enumerable: true, get: function () { return changeFontSize_1.changeFontSize; } });
|
|
40
41
|
var applySegmentFormat_1 = require("./publicApi/segment/applySegmentFormat");
|
|
41
|
-
Object.defineProperty(exports, "applySegmentFormat", { enumerable: true, get: function () { return applySegmentFormat_1.
|
|
42
|
+
Object.defineProperty(exports, "applySegmentFormat", { enumerable: true, get: function () { return applySegmentFormat_1.applySegmentFormat; } });
|
|
42
43
|
var changeCapitalization_1 = require("./publicApi/segment/changeCapitalization");
|
|
43
|
-
Object.defineProperty(exports, "changeCapitalization", { enumerable: true, get: function () { return changeCapitalization_1.
|
|
44
|
+
Object.defineProperty(exports, "changeCapitalization", { enumerable: true, get: function () { return changeCapitalization_1.changeCapitalization; } });
|
|
44
45
|
var insertImage_1 = require("./publicApi/image/insertImage");
|
|
45
|
-
Object.defineProperty(exports, "insertImage", { enumerable: true, get: function () { return insertImage_1.
|
|
46
|
+
Object.defineProperty(exports, "insertImage", { enumerable: true, get: function () { return insertImage_1.insertImage; } });
|
|
46
47
|
var setListStyle_1 = require("./publicApi/list/setListStyle");
|
|
47
|
-
Object.defineProperty(exports, "setListStyle", { enumerable: true, get: function () { return setListStyle_1.
|
|
48
|
+
Object.defineProperty(exports, "setListStyle", { enumerable: true, get: function () { return setListStyle_1.setListStyle; } });
|
|
48
49
|
var setListStartNumber_1 = require("./publicApi/list/setListStartNumber");
|
|
49
|
-
Object.defineProperty(exports, "setListStartNumber", { enumerable: true, get: function () { return setListStartNumber_1.
|
|
50
|
+
Object.defineProperty(exports, "setListStartNumber", { enumerable: true, get: function () { return setListStartNumber_1.setListStartNumber; } });
|
|
50
51
|
var setIndentation_1 = require("./publicApi/block/setIndentation");
|
|
51
|
-
Object.defineProperty(exports, "setIndentation", { enumerable: true, get: function () { return setIndentation_1.
|
|
52
|
+
Object.defineProperty(exports, "setIndentation", { enumerable: true, get: function () { return setIndentation_1.setIndentation; } });
|
|
52
53
|
var setAlignment_1 = require("./publicApi/block/setAlignment");
|
|
53
|
-
Object.defineProperty(exports, "setAlignment", { enumerable: true, get: function () { return setAlignment_1.
|
|
54
|
+
Object.defineProperty(exports, "setAlignment", { enumerable: true, get: function () { return setAlignment_1.setAlignment; } });
|
|
54
55
|
var setDirection_1 = require("./publicApi/block/setDirection");
|
|
55
|
-
Object.defineProperty(exports, "setDirection", { enumerable: true, get: function () { return setDirection_1.
|
|
56
|
+
Object.defineProperty(exports, "setDirection", { enumerable: true, get: function () { return setDirection_1.setDirection; } });
|
|
56
57
|
var setHeadingLevel_1 = require("./publicApi/block/setHeadingLevel");
|
|
57
|
-
Object.defineProperty(exports, "setHeadingLevel", { enumerable: true, get: function () { return setHeadingLevel_1.
|
|
58
|
+
Object.defineProperty(exports, "setHeadingLevel", { enumerable: true, get: function () { return setHeadingLevel_1.setHeadingLevel; } });
|
|
58
59
|
var toggleBlockQuote_1 = require("./publicApi/block/toggleBlockQuote");
|
|
59
|
-
Object.defineProperty(exports, "toggleBlockQuote", { enumerable: true, get: function () { return toggleBlockQuote_1.
|
|
60
|
+
Object.defineProperty(exports, "toggleBlockQuote", { enumerable: true, get: function () { return toggleBlockQuote_1.toggleBlockQuote; } });
|
|
60
61
|
var setSpacing_1 = require("./publicApi/block/setSpacing");
|
|
61
|
-
Object.defineProperty(exports, "setSpacing", { enumerable: true, get: function () { return setSpacing_1.
|
|
62
|
+
Object.defineProperty(exports, "setSpacing", { enumerable: true, get: function () { return setSpacing_1.setSpacing; } });
|
|
62
63
|
var setImageBorder_1 = require("./publicApi/image/setImageBorder");
|
|
63
|
-
Object.defineProperty(exports, "setImageBorder", { enumerable: true, get: function () { return setImageBorder_1.
|
|
64
|
+
Object.defineProperty(exports, "setImageBorder", { enumerable: true, get: function () { return setImageBorder_1.setImageBorder; } });
|
|
64
65
|
var setImageBoxShadow_1 = require("./publicApi/image/setImageBoxShadow");
|
|
65
|
-
Object.defineProperty(exports, "setImageBoxShadow", { enumerable: true, get: function () { return setImageBoxShadow_1.
|
|
66
|
+
Object.defineProperty(exports, "setImageBoxShadow", { enumerable: true, get: function () { return setImageBoxShadow_1.setImageBoxShadow; } });
|
|
66
67
|
var changeImage_1 = require("./publicApi/image/changeImage");
|
|
67
|
-
Object.defineProperty(exports, "changeImage", { enumerable: true, get: function () { return changeImage_1.
|
|
68
|
+
Object.defineProperty(exports, "changeImage", { enumerable: true, get: function () { return changeImage_1.changeImage; } });
|
|
68
69
|
var getFormatState_1 = require("./publicApi/format/getFormatState");
|
|
69
|
-
Object.defineProperty(exports, "getFormatState", { enumerable: true, get: function () { return getFormatState_1.
|
|
70
|
+
Object.defineProperty(exports, "getFormatState", { enumerable: true, get: function () { return getFormatState_1.getFormatState; } });
|
|
70
71
|
var clearFormat_1 = require("./publicApi/format/clearFormat");
|
|
71
|
-
Object.defineProperty(exports, "clearFormat", { enumerable: true, get: function () { return clearFormat_1.
|
|
72
|
+
Object.defineProperty(exports, "clearFormat", { enumerable: true, get: function () { return clearFormat_1.clearFormat; } });
|
|
72
73
|
var insertLink_1 = require("./publicApi/link/insertLink");
|
|
73
|
-
Object.defineProperty(exports, "insertLink", { enumerable: true, get: function () { return insertLink_1.
|
|
74
|
+
Object.defineProperty(exports, "insertLink", { enumerable: true, get: function () { return insertLink_1.insertLink; } });
|
|
74
75
|
var removeLink_1 = require("./publicApi/link/removeLink");
|
|
75
|
-
Object.defineProperty(exports, "removeLink", { enumerable: true, get: function () { return removeLink_1.
|
|
76
|
+
Object.defineProperty(exports, "removeLink", { enumerable: true, get: function () { return removeLink_1.removeLink; } });
|
|
76
77
|
var adjustLinkSelection_1 = require("./publicApi/link/adjustLinkSelection");
|
|
77
|
-
Object.defineProperty(exports, "adjustLinkSelection", { enumerable: true, get: function () { return adjustLinkSelection_1.
|
|
78
|
+
Object.defineProperty(exports, "adjustLinkSelection", { enumerable: true, get: function () { return adjustLinkSelection_1.adjustLinkSelection; } });
|
|
78
79
|
var setImageAltText_1 = require("./publicApi/image/setImageAltText");
|
|
79
|
-
Object.defineProperty(exports, "setImageAltText", { enumerable: true, get: function () { return setImageAltText_1.
|
|
80
|
+
Object.defineProperty(exports, "setImageAltText", { enumerable: true, get: function () { return setImageAltText_1.setImageAltText; } });
|
|
80
81
|
var adjustImageSelection_1 = require("./publicApi/image/adjustImageSelection");
|
|
81
|
-
Object.defineProperty(exports, "adjustImageSelection", { enumerable: true, get: function () { return adjustImageSelection_1.
|
|
82
|
+
Object.defineProperty(exports, "adjustImageSelection", { enumerable: true, get: function () { return adjustImageSelection_1.adjustImageSelection; } });
|
|
82
83
|
var setParagraphMargin_1 = require("./publicApi/block/setParagraphMargin");
|
|
83
|
-
Object.defineProperty(exports, "setParagraphMargin", { enumerable: true, get: function () { return setParagraphMargin_1.
|
|
84
|
+
Object.defineProperty(exports, "setParagraphMargin", { enumerable: true, get: function () { return setParagraphMargin_1.setParagraphMargin; } });
|
|
84
85
|
var toggleCode_1 = require("./publicApi/segment/toggleCode");
|
|
85
|
-
Object.defineProperty(exports, "toggleCode", { enumerable: true, get: function () { return toggleCode_1.
|
|
86
|
+
Object.defineProperty(exports, "toggleCode", { enumerable: true, get: function () { return toggleCode_1.toggleCode; } });
|
|
86
87
|
var insertEntity_1 = require("./publicApi/entity/insertEntity");
|
|
87
|
-
Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.
|
|
88
|
+
Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.insertEntity; } });
|
|
88
89
|
var insertTableRow_1 = require("./modelApi/table/insertTableRow");
|
|
89
90
|
Object.defineProperty(exports, "insertTableRow", { enumerable: true, get: function () { return insertTableRow_1.insertTableRow; } });
|
|
90
91
|
var insertTableColumn_1 = require("./modelApi/table/insertTableColumn");
|
|
91
92
|
Object.defineProperty(exports, "insertTableColumn", { enumerable: true, get: function () { return insertTableColumn_1.insertTableColumn; } });
|
|
92
93
|
var formatTableWithContentModel_1 = require("./publicApi/utils/formatTableWithContentModel");
|
|
93
94
|
Object.defineProperty(exports, "formatTableWithContentModel", { enumerable: true, get: function () { return formatTableWithContentModel_1.formatTableWithContentModel; } });
|
|
95
|
+
var formatImageWithContentModel_1 = require("./publicApi/utils/formatImageWithContentModel");
|
|
96
|
+
Object.defineProperty(exports, "formatImageWithContentModel", { enumerable: true, get: function () { return formatImageWithContentModel_1.formatImageWithContentModel; } });
|
|
97
|
+
var formatParagraphWithContentModel_1 = require("./publicApi/utils/formatParagraphWithContentModel");
|
|
98
|
+
Object.defineProperty(exports, "formatParagraphWithContentModel", { enumerable: true, get: function () { return formatParagraphWithContentModel_1.formatParagraphWithContentModel; } });
|
|
99
|
+
var formatSegmentWithContentModel_1 = require("./publicApi/utils/formatSegmentWithContentModel");
|
|
100
|
+
Object.defineProperty(exports, "formatSegmentWithContentModel", { enumerable: true, get: function () { return formatSegmentWithContentModel_1.formatSegmentWithContentModel; } });
|
|
94
101
|
var setListType_1 = require("./modelApi/list/setListType");
|
|
95
102
|
Object.defineProperty(exports, "setListType", { enumerable: true, get: function () { return setListType_1.setListType; } });
|
|
103
|
+
var setModelListStyle_1 = require("./modelApi/list/setModelListStyle");
|
|
104
|
+
Object.defineProperty(exports, "setModelListStyle", { enumerable: true, get: function () { return setModelListStyle_1.setModelListStyle; } });
|
|
105
|
+
var setModelListStartNumber_1 = require("./modelApi/list/setModelListStartNumber");
|
|
106
|
+
Object.defineProperty(exports, "setModelListStartNumber", { enumerable: true, get: function () { return setModelListStartNumber_1.setModelListStartNumber; } });
|
|
96
107
|
var findListItemsInSameThread_1 = require("./modelApi/list/findListItemsInSameThread");
|
|
97
108
|
Object.defineProperty(exports, "findListItemsInSameThread", { enumerable: true, get: function () { return findListItemsInSameThread_1.findListItemsInSameThread; } });
|
|
98
109
|
var setModelIndentation_1 = require("./modelApi/block/setModelIndentation");
|
|
99
110
|
Object.defineProperty(exports, "setModelIndentation", { enumerable: true, get: function () { return setModelIndentation_1.setModelIndentation; } });
|
|
111
|
+
var matchLink_1 = require("./modelApi/link/matchLink");
|
|
112
|
+
Object.defineProperty(exports, "matchLink", { enumerable: true, get: function () { return matchLink_1.matchLink; } });
|
|
100
113
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/roosterjs-content-model-api/lib/index.ts"],"names":[],"mappings":";;;;AAAA,6DAA4D;AAAnD,0GAAA,WAAW,OAAA;AACpB,6DAA4D;AAAnD,0GAAA,WAAW,OAAA;AACpB,yEAAwE;AAA/D,sHAAA,iBAAiB,OAAA;AAC1B,yDAAwD;AAA/C,sGAAA,SAAS,OAAA;AAClB,mFAAkF;AAAzE,gIAAA,sBAAsB,OAAA;AAC/B,8DAA6D;AAApD,4GAAA,YAAY,OAAA;AACrB,oEAAmE;AAA1D,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,wGAAA,UAAU,OAAA;AACnB,iEAAgE;AAAvD,4GAAA,YAAY,OAAA;AACrB,uEAAsE;AAA7D,kHAAA,eAAe,OAAA;AACxB,+EAA8E;AAArE,0HAAA,mBAAmB,OAAA;AAC5B,uEAAsE;AAA7D,kHAAA,eAAe,OAAA;AACxB,2EAA0E;AAAjE,sHAAA,iBAAiB,OAAA;AAC1B,6EAA4E;AAAnE,wHAAA,kBAAkB,OAAA;AAC3B,+DAA8D;AAArD,0GAAA,WAAW,OAAA;AACpB,+DAA8D;AAArD,0GAAA,WAAW,OAAA;AACpB,iEAAgE;AAAvD,4GAAA,YAAY,OAAA;AACrB,qEAAoE;AAA3D,gHAAA,cAAc,OAAA;AACvB,6EAA4E;AAAnE,wHAAA,kBAAkB,OAAA;AAC3B,iFAAgF;AAAvE,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0GAAA,WAAW,OAAA;AACpB,8DAA6D;AAApD,4GAAA,YAAY,OAAA;AACrB,0EAAyE;AAAhE,wHAAA,kBAAkB,OAAA;AAC3B,mEAAkE;AAAzD,gHAAA,cAAc,OAAA;AACvB,+DAA8D;AAArD,4GAAA,YAAY,OAAA;AACrB,+DAA8D;AAArD,4GAAA,YAAY,OAAA;AACrB,qEAAoE;AAA3D,kHAAA,eAAe,OAAA;AACxB,uEAAsE;AAA7D,oHAAA,gBAAgB,OAAA;AACzB,2DAA0D;AAAjD,wGAAA,UAAU,OAAA;AACnB,mEAAkE;AAAzD,gHAAA,cAAc,OAAA;AACvB,yEAAwE;AAA/D,sHAAA,iBAAiB,OAAA;AAC1B,6DAA4D;AAAnD,0GAAA,WAAW,OAAA;AACpB,oEAAmE;AAA1D,gHAAA,cAAc,OAAA;AACvB,8DAA6D;AAApD,0GAAA,WAAW,OAAA;AACpB,0DAAyD;AAAhD,wGAAA,UAAU,OAAA;AACnB,0DAAyD;AAAhD,wGAAA,UAAU,OAAA;AACnB,4EAA2E;AAAlE,0HAAA,mBAAmB,OAAA;AAC5B,qEAAoE;AAA3D,kHAAA,eAAe,OAAA;AACxB,+EAA8E;AAArE,4HAAA,oBAAoB,OAAA;AAC7B,2EAA0E;AAAjE,wHAAA,kBAAkB,OAAA;AAC3B,6DAA4D;AAAnD,wGAAA,UAAU,OAAA;AACnB,gEAA+D;AAAtD,4GAAA,YAAY,OAAA;AACrB,kEAAiE;AAAxD,gHAAA,cAAc,OAAA;AACvB,wEAAuE;AAA9D,sHAAA,iBAAiB,OAAA;AAE1B,6FAA4F;AAAnF,0IAAA,2BAA2B,OAAA;AACpC,6FAA4F;AAAnF,0IAAA,2BAA2B,OAAA;AACpC,qGAAoG;AAA3F,kJAAA,+BAA+B,OAAA;AACxC,iGAAgG;AAAvF,8IAAA,6BAA6B,OAAA;AAEtC,2DAA0D;AAAjD,0GAAA,WAAW,OAAA;AACpB,uEAAsE;AAA7D,sHAAA,iBAAiB,OAAA;AAC1B,mFAAkF;AAAzE,kIAAA,uBAAuB,OAAA;AAChC,uFAAsF;AAA7E,sIAAA,yBAAyB,OAAA;AAClC,4EAA2E;AAAlE,0HAAA,mBAAmB,OAAA;AAC5B,uDAAsD;AAA7C,sGAAA,SAAS,OAAA","sourcesContent":["export { insertTable } from './publicApi/table/insertTable';\nexport { formatTable } from './publicApi/table/formatTable';\nexport { setTableCellShade } from './publicApi/table/setTableCellShade';\nexport { editTable } from './publicApi/table/editTable';\nexport { applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';\nexport { toggleBullet } from './publicApi/list/toggleBullet';\nexport { toggleNumbering } from './publicApi/list/toggleNumbering';\nexport { toggleBold } from './publicApi/segment/toggleBold';\nexport { toggleItalic } from './publicApi/segment/toggleItalic';\nexport { toggleUnderline } from './publicApi/segment/toggleUnderline';\nexport { toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';\nexport { toggleSubscript } from './publicApi/segment/toggleSubscript';\nexport { toggleSuperscript } from './publicApi/segment/toggleSuperscript';\nexport { setBackgroundColor } from './publicApi/segment/setBackgroundColor';\nexport { setFontName } from './publicApi/segment/setFontName';\nexport { setFontSize } from './publicApi/segment/setFontSize';\nexport { setTextColor } from './publicApi/segment/setTextColor';\nexport { changeFontSize } from './publicApi/segment/changeFontSize';\nexport { applySegmentFormat } from './publicApi/segment/applySegmentFormat';\nexport { changeCapitalization } from './publicApi/segment/changeCapitalization';\nexport { insertImage } from './publicApi/image/insertImage';\nexport { setListStyle } from './publicApi/list/setListStyle';\nexport { setListStartNumber } from './publicApi/list/setListStartNumber';\nexport { setIndentation } from './publicApi/block/setIndentation';\nexport { setAlignment } from './publicApi/block/setAlignment';\nexport { setDirection } from './publicApi/block/setDirection';\nexport { setHeadingLevel } from './publicApi/block/setHeadingLevel';\nexport { toggleBlockQuote } from './publicApi/block/toggleBlockQuote';\nexport { setSpacing } from './publicApi/block/setSpacing';\nexport { setImageBorder } from './publicApi/image/setImageBorder';\nexport { setImageBoxShadow } from './publicApi/image/setImageBoxShadow';\nexport { changeImage } from './publicApi/image/changeImage';\nexport { getFormatState } from './publicApi/format/getFormatState';\nexport { clearFormat } from './publicApi/format/clearFormat';\nexport { insertLink } from './publicApi/link/insertLink';\nexport { removeLink } from './publicApi/link/removeLink';\nexport { adjustLinkSelection } from './publicApi/link/adjustLinkSelection';\nexport { setImageAltText } from './publicApi/image/setImageAltText';\nexport { adjustImageSelection } from './publicApi/image/adjustImageSelection';\nexport { setParagraphMargin } from './publicApi/block/setParagraphMargin';\nexport { toggleCode } from './publicApi/segment/toggleCode';\nexport { insertEntity } from './publicApi/entity/insertEntity';\nexport { insertTableRow } from './modelApi/table/insertTableRow';\nexport { insertTableColumn } from './modelApi/table/insertTableColumn';\n\nexport { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';\nexport { formatImageWithContentModel } from './publicApi/utils/formatImageWithContentModel';\nexport { formatParagraphWithContentModel } from './publicApi/utils/formatParagraphWithContentModel';\nexport { formatSegmentWithContentModel } from './publicApi/utils/formatSegmentWithContentModel';\n\nexport { setListType } from './modelApi/list/setListType';\nexport { setModelListStyle } from './modelApi/list/setModelListStyle';\nexport { setModelListStartNumber } from './modelApi/list/setModelListStartNumber';\nexport { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';\nexport { setModelIndentation } from './modelApi/block/setModelIndentation';\nexport { matchLink } from './modelApi/link/matchLink';\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setModelAlignment = void 0;
|
|
4
4
|
var alignTable_1 = require("../table/alignTable");
|
|
5
|
-
var
|
|
5
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
6
6
|
var ResultMap = {
|
|
7
7
|
left: {
|
|
8
8
|
ltr: 'start',
|
|
@@ -39,7 +39,7 @@ var TableAlignMap = {
|
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
41
|
function setModelAlignment(model, alignment) {
|
|
42
|
-
var paragraphOrListItemOrTable = (0,
|
|
42
|
+
var paragraphOrListItemOrTable = (0, roosterjs_content_model_dom_1.getOperationalBlocks)(model, ['ListItem'], ['TableCell']);
|
|
43
43
|
paragraphOrListItemOrTable.forEach(function (_a) {
|
|
44
44
|
var block = _a.block;
|
|
45
45
|
var newAlignment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setModelAlignment.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setModelAlignment.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/block/setModelAlignment.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,2EAAmE;AAOnE,IAAM,SAAS,GAGX;IACA,IAAI,EAAE;QACF,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,KAAK;KACb;IACD,MAAM,EAAE;QACJ,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,QAAQ;KAChB;IACD,KAAK,EAAE;QACH,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,OAAO;KACf;IACD,OAAO,EAAE;QACL,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,SAAS;KACjB;CACJ,CAAC;AAEF,IAAM,aAAa,GAGf;IACA,IAAI,EAAE;QACF,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,YAAY;KACpB;IACD,MAAM,EAAE;QACJ,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,aAAa;KACrB;IACD,KAAK,EAAE;QACH,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,WAAW;KACnB;CACJ,CAAC;AAEF;;GAEG;AACH,SAAgB,iBAAiB,CAC7B,KAA2B,EAC3B,SAAkD;IAElD,IAAM,0BAA0B,GAAG,IAAA,kDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;IAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;YAAP,KAAK,WAAA;QACvC,IAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3F,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,SAAS,EAAE;YACxD,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;SACL;aAAM,IAAI,KAAK,EAAE;YACd,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,IAAI,KAAK,CAAC,cAAc,KAAK,UAAU,EAAE;gBACzE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;oBACV,IAAA,MAAM,GAAK,CAAC,OAAN,CAAO;oBACrB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;gBACpC,CAAC,CAAC,CAAC;aACN;YACO,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;YACzB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;SACnC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC;AA9BD,8CA8BC","sourcesContent":["import { alignTable } from '../table/alignTable';\nimport { getOperationalBlocks } from 'roosterjs-content-model-dom';\nimport type {\n ContentModelDocument,\n ContentModelListItem,\n TableAlignOperation,\n} from 'roosterjs-content-model-types';\n\nconst ResultMap: Record<\n 'left' | 'center' | 'right' | 'justify',\n Record<'ltr' | 'rtl', 'start' | 'center' | 'end' | 'justify'>\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 justify: {\n ltr: 'justify',\n rtl: 'justify',\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' | 'justify'\n) {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n const newAlignment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];\n if (block.blockType === 'Table' && alignment !== 'justify') {\n alignTable(\n block,\n TableAlignMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr']\n );\n } else if (block) {\n if (block.blockType === 'BlockGroup' && block.blockGroupType === 'ListItem') {\n block.blocks.forEach(b => {\n const { format } = b;\n format.textAlign = newAlignment;\n });\n }\n const { format } = block;\n format.textAlign = newAlignment;\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n"]}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setModelDirection = void 0;
|
|
4
4
|
var findListItemsInSameThread_1 = require("../list/findListItemsInSameThread");
|
|
5
|
-
var
|
|
5
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
function setModelDirection(model, direction) {
|
|
10
|
-
var paragraphOrListItemOrTable = (0,
|
|
10
|
+
var paragraphOrListItemOrTable = (0, roosterjs_content_model_dom_1.getOperationalBlocks)(model, ['ListItem'], ['TableCell']);
|
|
11
11
|
paragraphOrListItemOrTable.forEach(function (_a) {
|
|
12
12
|
var block = _a.block;
|
|
13
|
-
if ((0,
|
|
13
|
+
if ((0, roosterjs_content_model_dom_1.isBlockGroupOfType)(block, 'ListItem')) {
|
|
14
14
|
var items = (0, findListItemsInSameThread_1.findListItemsInSameThread)(model, block);
|
|
15
15
|
items.forEach(function (item) {
|
|
16
16
|
item.levels.forEach(function (level) {
|
|
@@ -43,7 +43,7 @@ function internalSetDirection(format, direction, block) {
|
|
|
43
43
|
block.rows.forEach(function (row) {
|
|
44
44
|
row.cells.forEach(function (cell) {
|
|
45
45
|
// Optimise by skipping cells with unchanged borders
|
|
46
|
-
(0,
|
|
46
|
+
(0, roosterjs_content_model_dom_1.updateTableCellMetadata)(cell, function (metadata) {
|
|
47
47
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.borderOverride) {
|
|
48
48
|
var storeBorderLeft = cell.format.borderLeft;
|
|
49
49
|
setProperty(cell.format, 'borderLeft', cell.format.borderRight);
|
|
@@ -54,7 +54,7 @@ function internalSetDirection(format, direction, block) {
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
// Apply changed borders
|
|
57
|
-
(0,
|
|
57
|
+
(0, roosterjs_content_model_dom_1.applyTableFormat)(block, undefined /* newFormat */, true /* keepCellShade*/);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setModelDirection.js","sourceRoot":"","sources":["../../../../../packages
|
|
1
|
+
{"version":3,"file":"setModelDirection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/block/setModelDirection.ts"],"names":[],"mappings":";;;AAAA,+EAA8E;AAC9E,2EAKqC;AAWrC;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAA2B,EAAE,SAAwB;IACnF,IAAM,0BAA0B,GAAG,IAAA,kDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;IAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;YAAP,KAAK,WAAA;QACvC,IAAI,IAAA,gDAAkB,EAAuB,KAAK,EAAE,UAAU,CAAC,EAAE;YAC7D,IAAM,KAAK,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAEtD,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;gBACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;oBACrB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;gBACvC,CAAC,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAA7C,CAA6C,CAAC,CAAC;YAChF,CAAC,CAAC,CAAC;SACN;aAAM,IAAI,KAAK,EAAE;YACd,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;SACxD;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;AACjD,CAAC;AAxBD,8CAwBC;AAED,SAAS,oBAAoB,CACzB,MAA+B,EAC/B,SAAwB,EACxB,KAAyB;IAEzB,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;IACzC,IAAM,KAAK,GAAG,SAAS,IAAI,KAAK,CAAC;IAEjC,IAAI,MAAM,IAAI,KAAK,EAAE;QACjB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAE7B,sCAAsC;QACtC,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACrC,IAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QAEvC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACtD,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;QAC/C,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QACxD,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;QAEjD,2DAA2D;QAC3D,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,OAAO,EAAE;YACrC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,oDAAoD;oBACpD,IAAA,qDAAuB,EAAC,IAAI,EAAE,UAAA,QAAQ;wBAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,EAAE;4BAC1B,IAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;4BAC/C,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;4BAChE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;yBAC5D;wBACD,OAAO,QAAQ,CAAC;oBACpB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,wBAAwB;YACxB,IAAA,8CAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;SAC/E;KACJ;AACL,CAAC;AAED,SAAS,WAAW,CAChB,MAAmD,EACnD,GAAwD,EACxD,KAAyB;IAEzB,IAAI,KAAK,EAAE;QACP,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KACvB;SAAM;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;KACtB;AACL,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../list/findListItemsInSameThread';\nimport {\n applyTableFormat,\n getOperationalBlocks,\n isBlockGroupOfType,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-dom';\nimport type {\n BorderFormat,\n ContentModelBlock,\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, block);\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n\nfunction internalSetDirection(\n format: ContentModelBlockFormat,\n direction: 'ltr' | 'rtl',\n block?: ContentModelBlock\n) {\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 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 // If whole Table direction changed, flip cell side borders\n if (block && block.blockType == 'Table') {\n block.rows.forEach(row => {\n row.cells.forEach(cell => {\n // Optimise by skipping cells with unchanged borders\n updateTableCellMetadata(cell, metadata => {\n if (metadata?.borderOverride) {\n const storeBorderLeft = cell.format.borderLeft;\n setProperty(cell.format, 'borderLeft', cell.format.borderRight);\n setProperty(cell.format, 'borderRight', storeBorderLeft);\n }\n return metadata;\n });\n });\n });\n\n // Apply changed borders\n applyTableFormat(block, undefined /* newFormat */, true /* keepCellShade*/);\n }\n }\n}\n\nfunction setProperty(\n format: MarginFormat & PaddingFormat & BorderFormat,\n key: keyof (MarginFormat & PaddingFormat & BorderFormat),\n value: string | undefined\n) {\n if (value) {\n format[key] = value;\n } else {\n delete format[key];\n }\n}\n"]}
|