roosterjs-content-model-api 9.44.0 → 9.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +63 -63
- package/lib/index.js +131 -131
- package/lib/index.js.map +1 -1
- package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib/modelApi/block/setModelAlignment.js +65 -65
- package/lib/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib/modelApi/block/setModelDirection.js +113 -109
- package/lib/modelApi/block/setModelDirection.js.map +1 -1
- package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib/modelApi/block/setModelIndentation.js +158 -158
- package/lib/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib/modelApi/block/splitSelectedParagraphByBr.js +71 -71
- package/lib/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib/modelApi/block/toggleModelBlockQuote.js +53 -53
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib/modelApi/common/adjustIndentation.js +114 -114
- package/lib/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib/modelApi/common/clearModelFormat.js +143 -143
- package/lib/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib/modelApi/common/queryContentModelBlocks.js +87 -87
- package/lib/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib/modelApi/common/reducedModelChildProcessor.js +63 -63
- package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib/modelApi/common/wrapBlock.js +52 -52
- package/lib/modelApi/common/wrapBlock.js.map +1 -1
- package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib/modelApi/entity/insertEntityModel.js +105 -105
- package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib/modelApi/image/applyImageBorderFormat.js +57 -57
- package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib/modelApi/link/getLinkUrl.js +28 -28
- package/lib/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib/modelApi/link/matchLink.d.ts +12 -12
- package/lib/modelApi/link/matchLink.js +93 -93
- package/lib/modelApi/link/matchLink.js.map +1 -1
- package/lib/modelApi/link/promoteLink.d.ts +20 -20
- package/lib/modelApi/link/promoteLink.js +54 -54
- package/lib/modelApi/link/promoteLink.js.map +1 -1
- package/lib/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib/modelApi/list/findListItemsInSameThread.js +113 -113
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib/modelApi/list/getListAnnounceData.js +68 -68
- package/lib/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib/modelApi/list/setListType.d.ts +8 -8
- package/lib/modelApi/list/setListType.js +117 -117
- package/lib/modelApi/list/setListType.js.map +1 -1
- package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib/modelApi/list/setModelListStartNumber.js +21 -21
- package/lib/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib/modelApi/list/setModelListStyle.js +25 -25
- package/lib/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib/modelApi/selection/adjustSegmentSelection.js +47 -47
- package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib/modelApi/selection/adjustWordSelection.js +123 -123
- package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib/modelApi/selection/collapseTableSelection.js +16 -16
- package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib/modelApi/table/alignTable.d.ts +5 -5
- package/lib/modelApi/table/alignTable.js +11 -11
- package/lib/modelApi/table/alignTable.js.map +1 -1
- package/lib/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib/modelApi/table/alignTableCell.js +57 -57
- package/lib/modelApi/table/alignTableCell.js.map +1 -1
- package/lib/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib/modelApi/table/canMergeCells.js +56 -56
- package/lib/modelApi/table/canMergeCells.js.map +1 -1
- package/lib/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib/modelApi/table/clearSelectedCells.js +29 -29
- package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib/modelApi/table/createTableStructure.js +19 -19
- package/lib/modelApi/table/createTableStructure.js.map +1 -1
- package/lib/modelApi/table/deleteTable.d.ts +5 -5
- package/lib/modelApi/table/deleteTable.js +10 -10
- package/lib/modelApi/table/deleteTable.js.map +1 -1
- package/lib/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib/modelApi/table/deleteTableColumn.js +24 -24
- package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib/modelApi/table/deleteTableRow.js +23 -23
- package/lib/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js +56 -56
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib/modelApi/table/insertTableColumn.js +27 -27
- package/lib/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib/modelApi/table/insertTableRow.js +31 -31
- package/lib/modelApi/table/insertTableRow.js.map +1 -1
- package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib/modelApi/table/mergeTableCells.js +25 -25
- package/lib/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib/modelApi/table/mergeTableColumn.js +35 -35
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib/modelApi/table/mergeTableRow.js +35 -35
- package/lib/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib/modelApi/table/splitTableCellHorizontally.js +54 -54
- package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib/modelApi/table/splitTableCellVertically.js +53 -53
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib/publicApi/block/setAlignment.d.ts +7 -7
- package/lib/publicApi/block/setAlignment.js +16 -16
- package/lib/publicApi/block/setAlignment.js.map +1 -1
- package/lib/publicApi/block/setDirection.d.ts +7 -7
- package/lib/publicApi/block/setDirection.js +16 -16
- package/lib/publicApi/block/setDirection.js.map +1 -1
- package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib/publicApi/block/setHeadingLevel.js +50 -50
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib/publicApi/block/setIndentation.d.ts +8 -8
- package/lib/publicApi/block/setIndentation.js +21 -21
- package/lib/publicApi/block/setIndentation.js.map +1 -1
- package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib/publicApi/block/setParagraphMargin.js +33 -33
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib/publicApi/block/setSpacing.d.ts +7 -7
- package/lib/publicApi/block/setSpacing.js +21 -21
- package/lib/publicApi/block/setSpacing.js.map +1 -1
- package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib/publicApi/block/toggleBlockQuote.js +39 -39
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib/publicApi/entity/insertEntity.js +67 -67
- package/lib/publicApi/entity/insertEntity.js.map +1 -1
- package/lib/publicApi/format/clearFormat.d.ts +6 -6
- package/lib/publicApi/format/clearFormat.js +34 -34
- package/lib/publicApi/format/clearFormat.js.map +1 -1
- package/lib/publicApi/format/getFormatState.d.ts +7 -7
- package/lib/publicApi/format/getFormatState.js +31 -31
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib/publicApi/image/adjustImageSelection.js +29 -29
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib/publicApi/image/changeImage.d.ts +7 -7
- package/lib/publicApi/image/changeImage.js +35 -35
- package/lib/publicApi/image/changeImage.js.map +1 -1
- package/lib/publicApi/image/insertImage.d.ts +7 -7
- package/lib/publicApi/image/insertImage.js +38 -38
- package/lib/publicApi/image/insertImage.js.map +1 -1
- package/lib/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib/publicApi/image/setImageAltText.js +17 -17
- package/lib/publicApi/image/setImageAltText.js.map +1 -1
- package/lib/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib/publicApi/image/setImageBorder.js +19 -19
- package/lib/publicApi/image/setImageBorder.js.map +1 -1
- package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib/publicApi/image/setImageBoxShadow.js +29 -29
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib/publicApi/link/adjustLinkSelection.js +34 -34
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib/publicApi/link/insertLink.d.ts +15 -15
- package/lib/publicApi/link/insertLink.js +120 -120
- package/lib/publicApi/link/insertLink.js.map +1 -1
- package/lib/publicApi/link/removeLink.d.ts +8 -8
- package/lib/publicApi/link/removeLink.js +32 -32
- package/lib/publicApi/link/removeLink.js.map +1 -1
- package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib/publicApi/list/setListStartNumber.js +18 -18
- package/lib/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib/publicApi/list/setListStyle.d.ts +7 -7
- package/lib/publicApi/list/setListStyle.js +18 -18
- package/lib/publicApi/list/setListStyle.js.map +1 -1
- package/lib/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib/publicApi/list/toggleBullet.js +22 -22
- package/lib/publicApi/list/toggleBullet.js.map +1 -1
- package/lib/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib/publicApi/list/toggleNumbering.js +22 -22
- package/lib/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib/publicApi/segment/applySegmentFormat.js +23 -23
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib/publicApi/segment/changeCapitalization.js +49 -49
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib/publicApi/segment/changeFontSize.js +63 -63
- package/lib/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib/publicApi/segment/setBackgroundColor.js +35 -35
- package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib/publicApi/segment/setFontName.d.ts +7 -7
- package/lib/publicApi/segment/setFontName.js +19 -19
- package/lib/publicApi/segment/setFontName.js.map +1 -1
- package/lib/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib/publicApi/segment/setFontSize.js +33 -33
- package/lib/publicApi/segment/setFontSize.js.map +1 -1
- package/lib/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib/publicApi/segment/setTextColor.js +26 -26
- package/lib/publicApi/segment/setTextColor.js.map +1 -1
- package/lib/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib/publicApi/segment/splitTextSegment.js +30 -30
- package/lib/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib/publicApi/segment/toggleBold.js +27 -27
- package/lib/publicApi/segment/toggleBold.js.map +1 -1
- package/lib/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib/publicApi/segment/toggleCode.js +28 -28
- package/lib/publicApi/segment/toggleCode.js.map +1 -1
- package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib/publicApi/segment/toggleItalic.js +21 -21
- package/lib/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib/publicApi/segment/toggleStrikethrough.js +15 -15
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSubscript.js +15 -15
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSuperscript.js +15 -15
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib/publicApi/segment/toggleUnderline.js +24 -24
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib/publicApi/table/applyTableBorderFormat.js +297 -297
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib/publicApi/table/editTable.d.ts +7 -7
- package/lib/publicApi/table/editTable.js +95 -95
- package/lib/publicApi/table/editTable.js.map +1 -1
- package/lib/publicApi/table/formatTable.d.ts +8 -8
- package/lib/publicApi/table/formatTable.js +38 -38
- package/lib/publicApi/table/formatTable.js.map +1 -1
- package/lib/publicApi/table/insertTable.d.ts +12 -11
- package/lib/publicApi/table/insertTable.js +76 -52
- package/lib/publicApi/table/insertTable.js.map +1 -1
- package/lib/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib/publicApi/table/setTableCellShade.js +32 -32
- package/lib/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib/publicApi/utils/createEditorContextForEntity.js +29 -29
- package/lib/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib/publicApi/utils/formatImageWithContentModel.js +18 -18
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +23 -23
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +117 -117
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib/publicApi/utils/formatTableWithContentModel.js +46 -46
- package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +34 -34
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/lib-amd/index.d.ts +63 -63
- package/lib-amd/index.js +69 -69
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib-amd/modelApi/block/setModelAlignment.js +64 -64
- package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib-amd/modelApi/block/setModelDirection.js +112 -108
- package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-amd/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib-amd/modelApi/block/setModelIndentation.js +154 -154
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js +71 -71
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js +52 -52
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-amd/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib-amd/modelApi/common/adjustIndentation.js +114 -114
- package/lib-amd/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-amd/modelApi/common/clearModelFormat.js +142 -142
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-amd/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib-amd/modelApi/common/queryContentModelBlocks.js +87 -87
- package/lib-amd/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js +63 -63
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-amd/modelApi/common/wrapBlock.js +52 -52
- package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib-amd/modelApi/entity/insertEntityModel.js +105 -105
- package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -58
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-amd/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib-amd/modelApi/link/getLinkUrl.js +29 -29
- package/lib-amd/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib-amd/modelApi/link/matchLink.d.ts +12 -12
- package/lib-amd/modelApi/link/matchLink.js +93 -93
- package/lib-amd/modelApi/link/matchLink.js.map +1 -1
- package/lib-amd/modelApi/link/promoteLink.d.ts +20 -20
- package/lib-amd/modelApi/link/promoteLink.js +54 -54
- package/lib-amd/modelApi/link/promoteLink.js.map +1 -1
- package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -115
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-amd/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib-amd/modelApi/list/getListAnnounceData.js +68 -68
- package/lib-amd/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib-amd/modelApi/list/setListType.d.ts +8 -8
- package/lib-amd/modelApi/list/setListType.js +116 -116
- package/lib-amd/modelApi/list/setListType.js.map +1 -1
- package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib-amd/modelApi/list/setModelListStartNumber.js +22 -22
- package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib-amd/modelApi/list/setModelListStyle.js +25 -25
- package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js +48 -48
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib-amd/modelApi/selection/adjustWordSelection.js +123 -123
- package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib-amd/modelApi/selection/collapseTableSelection.js +17 -17
- package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-amd/modelApi/table/alignTable.d.ts +5 -5
- package/lib-amd/modelApi/table/alignTable.js +13 -13
- package/lib-amd/modelApi/table/alignTable.js.map +1 -1
- package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib-amd/modelApi/table/alignTableCell.js +58 -58
- package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib-amd/modelApi/table/canMergeCells.js +58 -58
- package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-amd/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib-amd/modelApi/table/clearSelectedCells.js +30 -30
- package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib-amd/modelApi/table/createTableStructure.js +20 -20
- package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTable.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTable.js +12 -12
- package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTableColumn.js +24 -24
- package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTableRow.js +23 -23
- package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +57 -57
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib-amd/modelApi/table/insertTableColumn.js +27 -27
- package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib-amd/modelApi/table/insertTableRow.js +30 -30
- package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableCells.js +25 -25
- package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableColumn.js +35 -35
- package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableRow.js +35 -35
- package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -54
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib-amd/modelApi/table/splitTableCellVertically.js +53 -53
- package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-amd/publicApi/block/setAlignment.d.ts +7 -7
- package/lib-amd/publicApi/block/setAlignment.js +17 -17
- package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
- package/lib-amd/publicApi/block/setDirection.d.ts +7 -7
- package/lib-amd/publicApi/block/setDirection.js +17 -17
- package/lib-amd/publicApi/block/setDirection.js.map +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib-amd/publicApi/block/setHeadingLevel.js +51 -51
- package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-amd/publicApi/block/setIndentation.d.ts +8 -8
- package/lib-amd/publicApi/block/setIndentation.js +22 -22
- package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib-amd/publicApi/block/setParagraphMargin.js +33 -33
- package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-amd/publicApi/block/setSpacing.d.ts +7 -7
- package/lib-amd/publicApi/block/setSpacing.js +22 -22
- package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib-amd/publicApi/block/toggleBlockQuote.js +39 -39
- package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib-amd/publicApi/entity/insertEntity.js +66 -66
- package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-amd/publicApi/format/clearFormat.d.ts +6 -6
- package/lib-amd/publicApi/format/clearFormat.js +34 -34
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.d.ts +7 -7
- package/lib-amd/publicApi/format/getFormatState.js +31 -31
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib-amd/publicApi/image/adjustImageSelection.js +29 -29
- package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-amd/publicApi/image/changeImage.d.ts +7 -7
- package/lib-amd/publicApi/image/changeImage.js +35 -35
- package/lib-amd/publicApi/image/changeImage.js.map +1 -1
- package/lib-amd/publicApi/image/insertImage.d.ts +7 -7
- package/lib-amd/publicApi/image/insertImage.js +39 -39
- package/lib-amd/publicApi/image/insertImage.js.map +1 -1
- package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib-amd/publicApi/image/setImageAltText.js +18 -18
- package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib-amd/publicApi/image/setImageBorder.js +19 -19
- package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -30
- package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -33
- package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-amd/publicApi/link/insertLink.d.ts +15 -15
- package/lib-amd/publicApi/link/insertLink.js +118 -118
- package/lib-amd/publicApi/link/insertLink.js.map +1 -1
- package/lib-amd/publicApi/link/removeLink.d.ts +8 -8
- package/lib-amd/publicApi/link/removeLink.js +32 -32
- package/lib-amd/publicApi/link/removeLink.js.map +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib-amd/publicApi/list/setListStartNumber.js +19 -19
- package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-amd/publicApi/list/setListStyle.d.ts +7 -7
- package/lib-amd/publicApi/list/setListStyle.js +19 -19
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
- package/lib-amd/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib-amd/publicApi/list/toggleBullet.js +23 -23
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib-amd/publicApi/list/toggleNumbering.js +23 -23
- package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -24
- package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib-amd/publicApi/segment/changeCapitalization.js +50 -50
- package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib-amd/publicApi/segment/changeFontSize.js +62 -62
- package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -35
- package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontName.d.ts +7 -7
- package/lib-amd/publicApi/segment/setFontName.js +20 -20
- package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib-amd/publicApi/segment/setFontSize.js +34 -34
- package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib-amd/publicApi/segment/setTextColor.js +27 -27
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-amd/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib-amd/publicApi/segment/splitTextSegment.js +30 -30
- package/lib-amd/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleBold.js +27 -27
- package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleCode.js +28 -28
- package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleItalic.js +22 -22
- package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -16
- package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleSubscript.js +16 -16
- package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -16
- package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleUnderline.js +25 -25
- package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib-amd/publicApi/table/applyTableBorderFormat.js +297 -297
- package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-amd/publicApi/table/editTable.d.ts +7 -7
- package/lib-amd/publicApi/table/editTable.js +84 -84
- package/lib-amd/publicApi/table/editTable.js.map +1 -1
- package/lib-amd/publicApi/table/formatTable.d.ts +8 -8
- package/lib-amd/publicApi/table/formatTable.js +38 -38
- package/lib-amd/publicApi/table/formatTable.js.map +1 -1
- package/lib-amd/publicApi/table/insertTable.d.ts +12 -11
- package/lib-amd/publicApi/table/insertTable.js +74 -50
- package/lib-amd/publicApi/table/insertTable.js.map +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib-amd/publicApi/table/setTableCellShade.js +32 -32
- package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-amd/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib-amd/publicApi/utils/createEditorContextForEntity.js +30 -30
- package/lib-amd/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +19 -19
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +23 -23
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +115 -115
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js +45 -45
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +35 -35
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/lib-mjs/index.d.ts +63 -63
- package/lib-mjs/index.js +63 -63
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib-mjs/modelApi/block/setModelAlignment.js +61 -61
- package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib-mjs/modelApi/block/setModelDirection.js +109 -105
- package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib-mjs/modelApi/block/setModelIndentation.js +154 -154
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js +67 -67
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +49 -49
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-mjs/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib-mjs/modelApi/common/adjustIndentation.js +109 -109
- package/lib-mjs/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-mjs/modelApi/common/clearModelFormat.js +139 -139
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-mjs/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib-mjs/modelApi/common/queryContentModelBlocks.js +83 -83
- package/lib-mjs/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +59 -59
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-mjs/modelApi/common/wrapBlock.js +47 -47
- package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib-mjs/modelApi/entity/insertEntityModel.js +101 -101
- package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js +53 -53
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-mjs/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib-mjs/modelApi/link/getLinkUrl.js +24 -24
- package/lib-mjs/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib-mjs/modelApi/link/matchLink.d.ts +12 -12
- package/lib-mjs/modelApi/link/matchLink.js +89 -89
- package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
- package/lib-mjs/modelApi/link/promoteLink.d.ts +20 -20
- package/lib-mjs/modelApi/link/promoteLink.js +49 -49
- package/lib-mjs/modelApi/link/promoteLink.js.map +1 -1
- package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -109
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-mjs/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib-mjs/modelApi/list/getListAnnounceData.js +64 -64
- package/lib-mjs/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib-mjs/modelApi/list/setListType.d.ts +8 -8
- package/lib-mjs/modelApi/list/setListType.js +113 -113
- package/lib-mjs/modelApi/list/setListType.js.map +1 -1
- package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib-mjs/modelApi/list/setModelListStartNumber.js +17 -17
- package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib-mjs/modelApi/list/setModelListStyle.js +21 -21
- package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +43 -43
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +52 -52
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib-mjs/modelApi/selection/adjustWordSelection.js +119 -119
- package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib-mjs/modelApi/selection/collapseTableSelection.js +12 -12
- package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTable.d.ts +5 -5
- package/lib-mjs/modelApi/table/alignTable.js +7 -7
- package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib-mjs/modelApi/table/alignTableCell.js +52 -52
- package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib-mjs/modelApi/table/canMergeCells.js +52 -52
- package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-mjs/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib-mjs/modelApi/table/clearSelectedCells.js +25 -25
- package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib-mjs/modelApi/table/createTableStructure.js +15 -15
- package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTable.js +6 -6
- package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTableColumn.js +20 -20
- package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTableRow.js +19 -19
- package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +52 -52
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib-mjs/modelApi/table/insertTableColumn.js +23 -23
- package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib-mjs/modelApi/table/insertTableRow.js +27 -27
- package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableCells.js +21 -21
- package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableColumn.js +31 -31
- package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableRow.js +31 -31
- package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +50 -50
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib-mjs/modelApi/table/splitTableCellVertically.js +49 -49
- package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -7
- package/lib-mjs/publicApi/block/setAlignment.js +12 -12
- package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
- package/lib-mjs/publicApi/block/setDirection.d.ts +7 -7
- package/lib-mjs/publicApi/block/setDirection.js +12 -12
- package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib-mjs/publicApi/block/setHeadingLevel.js +46 -46
- package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -8
- package/lib-mjs/publicApi/block/setIndentation.js +17 -17
- package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
- package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib-mjs/publicApi/block/setParagraphMargin.js +29 -29
- package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -7
- package/lib-mjs/publicApi/block/setSpacing.js +17 -17
- package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
- package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib-mjs/publicApi/block/toggleBlockQuote.js +35 -35
- package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib-mjs/publicApi/entity/insertEntity.js +63 -63
- package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -6
- package/lib-mjs/publicApi/format/clearFormat.js +30 -30
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.d.ts +7 -7
- package/lib-mjs/publicApi/format/getFormatState.js +27 -27
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib-mjs/publicApi/image/adjustImageSelection.js +25 -25
- package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-mjs/publicApi/image/changeImage.d.ts +7 -7
- package/lib-mjs/publicApi/image/changeImage.js +31 -31
- package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
- package/lib-mjs/publicApi/image/insertImage.d.ts +7 -7
- package/lib-mjs/publicApi/image/insertImage.js +34 -34
- package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib-mjs/publicApi/image/setImageAltText.js +13 -13
- package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib-mjs/publicApi/image/setImageBorder.js +15 -15
- package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib-mjs/publicApi/image/setImageBoxShadow.js +25 -25
- package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib-mjs/publicApi/link/adjustLinkSelection.js +30 -30
- package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-mjs/publicApi/link/insertLink.d.ts +15 -15
- package/lib-mjs/publicApi/link/insertLink.js +116 -116
- package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
- package/lib-mjs/publicApi/link/removeLink.d.ts +8 -8
- package/lib-mjs/publicApi/link/removeLink.js +28 -28
- package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib-mjs/publicApi/list/setListStartNumber.js +14 -14
- package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -7
- package/lib-mjs/publicApi/list/setListStyle.js +14 -14
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib-mjs/publicApi/list/toggleBullet.js +18 -18
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib-mjs/publicApi/list/toggleNumbering.js +18 -18
- package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib-mjs/publicApi/segment/applySegmentFormat.js +19 -19
- package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib-mjs/publicApi/segment/changeCapitalization.js +45 -45
- package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib-mjs/publicApi/segment/changeFontSize.js +59 -59
- package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setBackgroundColor.js +31 -31
- package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setFontName.js +15 -15
- package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib-mjs/publicApi/segment/setFontSize.js +28 -28
- package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setTextColor.js +22 -22
- package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib-mjs/publicApi/segment/splitTextSegment.js +26 -26
- package/lib-mjs/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleBold.js +23 -23
- package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleCode.js +24 -24
- package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleItalic.js +17 -17
- package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js +11 -11
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleSubscript.js +11 -11
- package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleSuperscript.js +11 -11
- package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleUnderline.js +20 -20
- package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js +293 -293
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-mjs/publicApi/table/editTable.d.ts +7 -7
- package/lib-mjs/publicApi/table/editTable.js +91 -91
- package/lib-mjs/publicApi/table/editTable.js.map +1 -1
- package/lib-mjs/publicApi/table/formatTable.d.ts +8 -8
- package/lib-mjs/publicApi/table/formatTable.js +34 -34
- package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
- package/lib-mjs/publicApi/table/insertTable.d.ts +12 -11
- package/lib-mjs/publicApi/table/insertTable.js +72 -48
- package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib-mjs/publicApi/table/setTableCellShade.js +28 -28
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.js +25 -25
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +14 -14
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +126 -126
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +19 -19
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +113 -113
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +42 -42
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +30 -30
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Indent or outdent to selected paragraphs
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param indentation Whether indent or outdent
|
|
6
|
-
* @param length The length of pixel to indent/outdent @default 40
|
|
7
|
-
*/
|
|
8
|
-
export declare function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;
|
|
1
|
+
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Indent or outdent to selected paragraphs
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param indentation Whether indent or outdent
|
|
6
|
+
* @param length The length of pixel to indent/outdent @default 40
|
|
7
|
+
*/
|
|
8
|
+
export declare function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { setModelIndentation } from '../../modelApi/block/setModelIndentation';
|
|
2
|
-
/**
|
|
3
|
-
* Indent or outdent to selected paragraphs
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param indentation Whether indent or outdent
|
|
6
|
-
* @param length The length of pixel to indent/outdent @default 40
|
|
7
|
-
*/
|
|
8
|
-
export function setIndentation(editor, indentation, length) {
|
|
9
|
-
editor.focus();
|
|
10
|
-
editor.formatContentModel(function (model, context) {
|
|
11
|
-
var result = setModelIndentation(model, indentation, length);
|
|
12
|
-
context.newPendingFormat = 'preserve';
|
|
13
|
-
return result;
|
|
14
|
-
}, {
|
|
15
|
-
apiName: 'setIndentation',
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import { setModelIndentation } from '../../modelApi/block/setModelIndentation';
|
|
2
|
+
/**
|
|
3
|
+
* Indent or outdent to selected paragraphs
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param indentation Whether indent or outdent
|
|
6
|
+
* @param length The length of pixel to indent/outdent @default 40
|
|
7
|
+
*/
|
|
8
|
+
export function setIndentation(editor, indentation, length) {
|
|
9
|
+
editor.focus();
|
|
10
|
+
editor.formatContentModel(function (model, context) {
|
|
11
|
+
var result = setModelIndentation(model, indentation, length);
|
|
12
|
+
context.newPendingFormat = 'preserve';
|
|
13
|
+
return result;
|
|
14
|
+
}, {
|
|
15
|
+
apiName: 'setIndentation',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=setIndentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setIndentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC1B,MAAe,EACf,WAAiC,EACjC,MAAe;IAEf,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAE/D,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,MAAM,CAAC;IAClB,CAAC,EACD;QACI,OAAO,EAAE,gBAAgB;KAC5B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { setModelIndentation } from '../../modelApi/block/setModelIndentation';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Indent or outdent to selected paragraphs\n * @param editor The editor to operate on\n * @param indentation Whether indent or outdent\n * @param length The length of pixel to indent/outdent @default 40\n */\nexport function setIndentation(\n editor: IEditor,\n indentation: 'indent' | 'outdent',\n length?: number\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const result = setModelIndentation(model, indentation, length);\n\n context.newPendingFormat = 'preserve';\n\n return result;\n },\n {\n apiName: 'setIndentation',\n }\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setIndentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC1B,MAAe,EACf,WAAiC,EACjC,MAAe;IAEf,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAE/D,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,MAAM,CAAC;IAClB,CAAC,EACD;QACI,OAAO,EAAE,gBAAgB;KAC5B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { setModelIndentation } from '../../modelApi/block/setModelIndentation';\r\nimport type { IEditor } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Indent or outdent to selected paragraphs\r\n * @param editor The editor to operate on\r\n * @param indentation Whether indent or outdent\r\n * @param length The length of pixel to indent/outdent @default 40\r\n */\r\nexport function setIndentation(\r\n editor: IEditor,\r\n indentation: 'indent' | 'outdent',\r\n length?: number\r\n) {\r\n editor.focus();\r\n\r\n editor.formatContentModel(\r\n (model, context) => {\r\n const result = setModelIndentation(model, indentation, length);\r\n\r\n context.newPendingFormat = 'preserve';\r\n\r\n return result;\r\n },\r\n {\r\n apiName: 'setIndentation',\r\n }\r\n );\r\n}\r\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Toggles the current block(s) margin properties.
|
|
4
|
-
* null deletes any existing value, undefined is ignored
|
|
5
|
-
* @param editor The editor to operate on
|
|
6
|
-
* @param marginTop value for top margin
|
|
7
|
-
* @param marginBottom value for bottom margin
|
|
8
|
-
*/
|
|
9
|
-
export declare function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;
|
|
1
|
+
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggles the current block(s) margin properties.
|
|
4
|
+
* null deletes any existing value, undefined is ignored
|
|
5
|
+
* @param editor The editor to operate on
|
|
6
|
+
* @param marginTop value for top margin
|
|
7
|
+
* @param marginBottom value for bottom margin
|
|
8
|
+
*/
|
|
9
|
+
export declare function setParagraphMargin(editor: IEditor, marginTop?: string | null, marginBottom?: string | null): void;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createParagraphDecorator } from 'roosterjs-content-model-dom';
|
|
2
|
-
import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';
|
|
3
|
-
/**
|
|
4
|
-
* Toggles the current block(s) margin properties.
|
|
5
|
-
* null deletes any existing value, undefined is ignored
|
|
6
|
-
* @param editor The editor to operate on
|
|
7
|
-
* @param marginTop value for top margin
|
|
8
|
-
* @param marginBottom value for bottom margin
|
|
9
|
-
*/
|
|
10
|
-
export function setParagraphMargin(editor, marginTop, marginBottom) {
|
|
11
|
-
editor.focus();
|
|
12
|
-
formatParagraphWithContentModel(editor, 'setParagraphMargin', function (para) {
|
|
13
|
-
if (!para.decorator) {
|
|
14
|
-
para.decorator = createParagraphDecorator('p');
|
|
15
|
-
}
|
|
16
|
-
if (marginTop) {
|
|
17
|
-
para.format.marginTop = marginTop;
|
|
18
|
-
}
|
|
19
|
-
else if (marginTop === null) {
|
|
20
|
-
delete para.format.marginTop;
|
|
21
|
-
}
|
|
22
|
-
if (marginBottom) {
|
|
23
|
-
para.format.marginBottom = marginBottom;
|
|
24
|
-
}
|
|
25
|
-
else if (marginBottom === null) {
|
|
26
|
-
delete para.format.marginBottom;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
1
|
+
import { createParagraphDecorator } from 'roosterjs-content-model-dom';
|
|
2
|
+
import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';
|
|
3
|
+
/**
|
|
4
|
+
* Toggles the current block(s) margin properties.
|
|
5
|
+
* null deletes any existing value, undefined is ignored
|
|
6
|
+
* @param editor The editor to operate on
|
|
7
|
+
* @param marginTop value for top margin
|
|
8
|
+
* @param marginBottom value for bottom margin
|
|
9
|
+
*/
|
|
10
|
+
export function setParagraphMargin(editor, marginTop, marginBottom) {
|
|
11
|
+
editor.focus();
|
|
12
|
+
formatParagraphWithContentModel(editor, 'setParagraphMargin', function (para) {
|
|
13
|
+
if (!para.decorator) {
|
|
14
|
+
para.decorator = createParagraphDecorator('p');
|
|
15
|
+
}
|
|
16
|
+
if (marginTop) {
|
|
17
|
+
para.format.marginTop = marginTop;
|
|
18
|
+
}
|
|
19
|
+
else if (marginTop === null) {
|
|
20
|
+
delete para.format.marginTop;
|
|
21
|
+
}
|
|
22
|
+
if (marginBottom) {
|
|
23
|
+
para.format.marginBottom = marginBottom;
|
|
24
|
+
}
|
|
25
|
+
else if (marginBottom === null) {
|
|
26
|
+
delete para.format.marginBottom;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
30
|
//# sourceMappingURL=setParagraphMargin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setParagraphMargin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAe,EACf,SAAyB,EACzB,YAA4B;IAE5B,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,+BAA+B,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAA,IAAI;QAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;SAClD;QAED,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;SACrC;aAAM,IAAI,SAAS,KAAK,IAAI,EAAE;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;SAChC;QAED,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;SAC3C;aAAM,IAAI,YAAY,KAAK,IAAI,EAAE;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;SACnC;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { createParagraphDecorator } from 'roosterjs-content-model-dom';\nimport { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggles the current block(s) margin properties.\n * null deletes any existing value, undefined is ignored\n * @param editor The editor to operate on\n * @param marginTop value for top margin\n * @param marginBottom value for bottom margin\n */\nexport function setParagraphMargin(\n editor: IEditor,\n marginTop?: string | null,\n marginBottom?: string | null\n) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setParagraphMargin', para => {\n if (!para.decorator) {\n para.decorator = createParagraphDecorator('p');\n }\n\n if (marginTop) {\n para.format.marginTop = marginTop;\n } else if (marginTop === null) {\n delete para.format.marginTop;\n }\n\n if (marginBottom) {\n para.format.marginBottom = marginBottom;\n } else if (marginBottom === null) {\n delete para.format.marginBottom;\n }\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setParagraphMargin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAC9B,MAAe,EACf,SAAyB,EACzB,YAA4B;IAE5B,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,+BAA+B,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAA,IAAI;QAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;SAClD;QAED,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;SACrC;aAAM,IAAI,SAAS,KAAK,IAAI,EAAE;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;SAChC;QAED,IAAI,YAAY,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;SAC3C;aAAM,IAAI,YAAY,KAAK,IAAI,EAAE;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;SACnC;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { createParagraphDecorator } from 'roosterjs-content-model-dom';\r\nimport { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\r\nimport type { IEditor } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Toggles the current block(s) margin properties.\r\n * null deletes any existing value, undefined is ignored\r\n * @param editor The editor to operate on\r\n * @param marginTop value for top margin\r\n * @param marginBottom value for bottom margin\r\n */\r\nexport function setParagraphMargin(\r\n editor: IEditor,\r\n marginTop?: string | null,\r\n marginBottom?: string | null\r\n) {\r\n editor.focus();\r\n\r\n formatParagraphWithContentModel(editor, 'setParagraphMargin', para => {\r\n if (!para.decorator) {\r\n para.decorator = createParagraphDecorator('p');\r\n }\r\n\r\n if (marginTop) {\r\n para.format.marginTop = marginTop;\r\n } else if (marginTop === null) {\r\n delete para.format.marginTop;\r\n }\r\n\r\n if (marginBottom) {\r\n para.format.marginBottom = marginBottom;\r\n } else if (marginBottom === null) {\r\n delete para.format.marginBottom;\r\n }\r\n });\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param spacing Unitless/px value to set line height
|
|
6
|
-
*/
|
|
7
|
-
export declare function setSpacing(editor: IEditor, spacing: number | string): void;
|
|
1
|
+
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param spacing Unitless/px value to set line height
|
|
6
|
+
*/
|
|
7
|
+
export declare function setSpacing(editor: IEditor, spacing: number | string): void;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';
|
|
2
|
-
/**
|
|
3
|
-
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param spacing Unitless/px value to set line height
|
|
6
|
-
*/
|
|
7
|
-
export function setSpacing(editor, spacing) {
|
|
8
|
-
editor.focus();
|
|
9
|
-
formatParagraphWithContentModel(editor, 'setSpacing', function (paragraph) {
|
|
10
|
-
paragraph.format.lineHeight = spacing.toString();
|
|
11
|
-
paragraph.segments.forEach(function (segment) {
|
|
12
|
-
if (segment.format.lineHeight) {
|
|
13
|
-
delete segment.format.lineHeight;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
}
|
|
1
|
+
import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';
|
|
2
|
+
/**
|
|
3
|
+
* Sets current selected block(s) line-height property and wipes such property from child segments
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param spacing Unitless/px value to set line height
|
|
6
|
+
*/
|
|
7
|
+
export function setSpacing(editor, spacing) {
|
|
8
|
+
editor.focus();
|
|
9
|
+
formatParagraphWithContentModel(editor, 'setSpacing', function (paragraph) {
|
|
10
|
+
paragraph.format.lineHeight = spacing.toString();
|
|
11
|
+
paragraph.segments.forEach(function (segment) {
|
|
12
|
+
if (segment.format.lineHeight) {
|
|
13
|
+
delete segment.format.lineHeight;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=setSpacing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setSpacing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe,EAAE,OAAwB;IAChE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,+BAA+B,CAAC,MAAM,EAAE,YAAY,EAAE,UAAA,SAAS;QAC3D,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YAC9B,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;aACpC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Sets current selected block(s) line-height property and wipes such property from child segments\n * @param editor The editor to operate on\n * @param spacing Unitless/px value to set line height\n */\nexport function setSpacing(editor: IEditor, spacing: number | string) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setSpacing', paragraph => {\n paragraph.format.lineHeight = spacing.toString();\n paragraph.segments.forEach(segment => {\n if (segment.format.lineHeight) {\n delete segment.format.lineHeight;\n }\n });\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/setSpacing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAG3F;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe,EAAE,OAAwB;IAChE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,+BAA+B,CAAC,MAAM,EAAE,YAAY,EAAE,UAAA,SAAS;QAC3D,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YAC9B,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;gBAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;aACpC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\r\nimport type { IEditor } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Sets current selected block(s) line-height property and wipes such property from child segments\r\n * @param editor The editor to operate on\r\n * @param spacing Unitless/px value to set line height\r\n */\r\nexport function setSpacing(editor: IEditor, spacing: number | string) {\r\n editor.focus();\r\n\r\n formatParagraphWithContentModel(editor, 'setSpacing', paragraph => {\r\n paragraph.format.lineHeight = spacing.toString();\r\n paragraph.segments.forEach(segment => {\r\n if (segment.format.lineHeight) {\r\n delete segment.format.lineHeight;\r\n }\r\n });\r\n });\r\n}\r\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
4
|
-
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
5
|
-
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
6
|
-
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
7
|
-
* @param quoteFormat @optional Block format for the new quote object
|
|
8
|
-
*/
|
|
9
|
-
export declare function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
|
|
1
|
+
import type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
4
|
+
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
5
|
+
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
6
|
+
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
7
|
+
* @param quoteFormat @optional Block format for the new quote object
|
|
8
|
+
*/
|
|
9
|
+
export declare function toggleBlockQuote(editor: IEditor, quoteFormat?: ContentModelFormatContainerFormat, quoteFormatRtl?: ContentModelFormatContainerFormat): void;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';
|
|
3
|
-
var DefaultQuoteFormatLtr = {
|
|
4
|
-
borderLeft: '3px solid rgb(200, 200, 200)',
|
|
5
|
-
textColor: 'rgb(102, 102, 102)',
|
|
6
|
-
};
|
|
7
|
-
var DefaultQuoteFormatRtl = {
|
|
8
|
-
borderRight: '3px solid rgb(200, 200, 200)',
|
|
9
|
-
textColor: 'rgb(102, 102, 102)',
|
|
10
|
-
};
|
|
11
|
-
var BuildInQuoteFormat = {
|
|
12
|
-
marginTop: '1em',
|
|
13
|
-
marginBottom: '1em',
|
|
14
|
-
marginLeft: '40px',
|
|
15
|
-
marginRight: '40px',
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
19
|
-
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
20
|
-
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
21
|
-
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
22
|
-
* @param quoteFormat @optional Block format for the new quote object
|
|
23
|
-
*/
|
|
24
|
-
export function toggleBlockQuote(editor, quoteFormat, quoteFormatRtl) {
|
|
25
|
-
var _a;
|
|
26
|
-
var fullQuoteFormatLtr = __assign(__assign(__assign({}, BuildInQuoteFormat), { paddingLeft: '10px' }), (quoteFormat !== null && quoteFormat !== void 0 ? quoteFormat : DefaultQuoteFormatLtr));
|
|
27
|
-
var fullQuoteFormatRtl = __assign(__assign(__assign({}, BuildInQuoteFormat), { paddingRight: '10px', direction: 'rtl' }), ((_a = quoteFormatRtl !== null && quoteFormatRtl !== void 0 ? quoteFormatRtl : quoteFormat) !== null && _a !== void 0 ? _a : DefaultQuoteFormatRtl));
|
|
28
|
-
editor.focus();
|
|
29
|
-
editor.formatContentModel(function (model, context) {
|
|
30
|
-
context.newPendingFormat = 'preserve';
|
|
31
|
-
return toggleModelBlockQuote(model, fullQuoteFormatLtr, fullQuoteFormatRtl);
|
|
32
|
-
}, {
|
|
33
|
-
apiName: 'toggleBlockQuote',
|
|
34
|
-
});
|
|
35
|
-
}
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';
|
|
3
|
+
var DefaultQuoteFormatLtr = {
|
|
4
|
+
borderLeft: '3px solid rgb(200, 200, 200)',
|
|
5
|
+
textColor: 'rgb(102, 102, 102)',
|
|
6
|
+
};
|
|
7
|
+
var DefaultQuoteFormatRtl = {
|
|
8
|
+
borderRight: '3px solid rgb(200, 200, 200)',
|
|
9
|
+
textColor: 'rgb(102, 102, 102)',
|
|
10
|
+
};
|
|
11
|
+
var BuildInQuoteFormat = {
|
|
12
|
+
marginTop: '1em',
|
|
13
|
+
marginBottom: '1em',
|
|
14
|
+
marginLeft: '40px',
|
|
15
|
+
marginRight: '40px',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Toggle BLOCKQUOTE state of selected paragraphs.
|
|
19
|
+
* If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
|
|
20
|
+
* Otherwise, unwrap all related BLOCKQUOTEs.
|
|
21
|
+
* @param editor The editor object to toggle BLOCKQUOTE onto
|
|
22
|
+
* @param quoteFormat @optional Block format for the new quote object
|
|
23
|
+
*/
|
|
24
|
+
export function toggleBlockQuote(editor, quoteFormat, quoteFormatRtl) {
|
|
25
|
+
var _a;
|
|
26
|
+
var fullQuoteFormatLtr = __assign(__assign(__assign({}, BuildInQuoteFormat), { paddingLeft: '10px' }), (quoteFormat !== null && quoteFormat !== void 0 ? quoteFormat : DefaultQuoteFormatLtr));
|
|
27
|
+
var fullQuoteFormatRtl = __assign(__assign(__assign({}, BuildInQuoteFormat), { paddingRight: '10px', direction: 'rtl' }), ((_a = quoteFormatRtl !== null && quoteFormatRtl !== void 0 ? quoteFormatRtl : quoteFormat) !== null && _a !== void 0 ? _a : DefaultQuoteFormatRtl));
|
|
28
|
+
editor.focus();
|
|
29
|
+
editor.formatContentModel(function (model, context) {
|
|
30
|
+
context.newPendingFormat = 'preserve';
|
|
31
|
+
return toggleModelBlockQuote(model, fullQuoteFormatLtr, fullQuoteFormatRtl);
|
|
32
|
+
}, {
|
|
33
|
+
apiName: 'toggleBlockQuote',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
36
|
//# sourceMappingURL=toggleBlockQuote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/toggleBlockQuote.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAGnF,IAAM,qBAAqB,GAAsC;IAC7D,UAAU,EAAE,8BAA8B;IAC1C,SAAS,EAAE,oBAAoB;CAClC,CAAC;AACF,IAAM,qBAAqB,GAAsC;IAC7D,WAAW,EAAE,8BAA8B;IAC3C,SAAS,EAAE,oBAAoB;CAClC,CAAC;AACF,IAAM,kBAAkB,GAAsC;IAC1D,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,KAAK;IACnB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,MAAM;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC5B,MAAe,EACf,WAA+C,EAC/C,cAAkD;;IAElD,IAAM,kBAAkB,kCACjB,kBAAkB,KACrB,WAAW,EAAE,MAAM,KAChB,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,qBAAqB,CAAC,CAC5C,CAAC;IACF,IAAM,kBAAkB,kCACjB,kBAAkB,KACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,KAAK,KACb,CAAC,MAAA,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,WAAW,mCAAI,qBAAqB,CAAC,CAC9D,CAAC;IAEF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAChF,CAAC,EACD;QACI,OAAO,EAAE,kBAAkB;KAC9B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';\nimport type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultQuoteFormatLtr: ContentModelFormatContainerFormat = {\n borderLeft: '3px solid rgb(200, 200, 200)',\n textColor: 'rgb(102, 102, 102)',\n};\nconst DefaultQuoteFormatRtl: ContentModelFormatContainerFormat = {\n borderRight: '3px solid rgb(200, 200, 200)',\n textColor: 'rgb(102, 102, 102)',\n};\nconst BuildInQuoteFormat: ContentModelFormatContainerFormat = {\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n};\n\n/**\n * Toggle BLOCKQUOTE state of selected paragraphs.\n * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.\n * Otherwise, unwrap all related BLOCKQUOTEs.\n * @param editor The editor object to toggle BLOCKQUOTE onto\n * @param quoteFormat @optional Block format for the new quote object\n */\nexport function toggleBlockQuote(\n editor: IEditor,\n quoteFormat?: ContentModelFormatContainerFormat,\n quoteFormatRtl?: ContentModelFormatContainerFormat\n) {\n const fullQuoteFormatLtr: ContentModelFormatContainerFormat = {\n ...BuildInQuoteFormat,\n paddingLeft: '10px',\n ...(quoteFormat ?? DefaultQuoteFormatLtr),\n };\n const fullQuoteFormatRtl: ContentModelFormatContainerFormat = {\n ...BuildInQuoteFormat,\n paddingRight: '10px',\n direction: 'rtl',\n ...(quoteFormatRtl ?? quoteFormat ?? DefaultQuoteFormatRtl),\n };\n\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return toggleModelBlockQuote(model, fullQuoteFormatLtr, fullQuoteFormatRtl);\n },\n {\n apiName: 'toggleBlockQuote',\n }\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/block/toggleBlockQuote.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAGnF,IAAM,qBAAqB,GAAsC;IAC7D,UAAU,EAAE,8BAA8B;IAC1C,SAAS,EAAE,oBAAoB;CAClC,CAAC;AACF,IAAM,qBAAqB,GAAsC;IAC7D,WAAW,EAAE,8BAA8B;IAC3C,SAAS,EAAE,oBAAoB;CAClC,CAAC;AACF,IAAM,kBAAkB,GAAsC;IAC1D,SAAS,EAAE,KAAK;IAChB,YAAY,EAAE,KAAK;IACnB,UAAU,EAAE,MAAM;IAClB,WAAW,EAAE,MAAM;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC5B,MAAe,EACf,WAA+C,EAC/C,cAAkD;;IAElD,IAAM,kBAAkB,kCACjB,kBAAkB,KACrB,WAAW,EAAE,MAAM,KAChB,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,qBAAqB,CAAC,CAC5C,CAAC;IACF,IAAM,kBAAkB,kCACjB,kBAAkB,KACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,KAAK,KACb,CAAC,MAAA,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,WAAW,mCAAI,qBAAqB,CAAC,CAC9D,CAAC;IAEF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,qBAAqB,CAAC,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IAChF,CAAC,EACD;QACI,OAAO,EAAE,kBAAkB;KAC9B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';\r\nimport type { ContentModelFormatContainerFormat, IEditor } from 'roosterjs-content-model-types';\r\n\r\nconst DefaultQuoteFormatLtr: ContentModelFormatContainerFormat = {\r\n borderLeft: '3px solid rgb(200, 200, 200)',\r\n textColor: 'rgb(102, 102, 102)',\r\n};\r\nconst DefaultQuoteFormatRtl: ContentModelFormatContainerFormat = {\r\n borderRight: '3px solid rgb(200, 200, 200)',\r\n textColor: 'rgb(102, 102, 102)',\r\n};\r\nconst BuildInQuoteFormat: ContentModelFormatContainerFormat = {\r\n marginTop: '1em',\r\n marginBottom: '1em',\r\n marginLeft: '40px',\r\n marginRight: '40px',\r\n};\r\n\r\n/**\r\n * Toggle BLOCKQUOTE state of selected paragraphs.\r\n * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.\r\n * Otherwise, unwrap all related BLOCKQUOTEs.\r\n * @param editor The editor object to toggle BLOCKQUOTE onto\r\n * @param quoteFormat @optional Block format for the new quote object\r\n */\r\nexport function toggleBlockQuote(\r\n editor: IEditor,\r\n quoteFormat?: ContentModelFormatContainerFormat,\r\n quoteFormatRtl?: ContentModelFormatContainerFormat\r\n) {\r\n const fullQuoteFormatLtr: ContentModelFormatContainerFormat = {\r\n ...BuildInQuoteFormat,\r\n paddingLeft: '10px',\r\n ...(quoteFormat ?? DefaultQuoteFormatLtr),\r\n };\r\n const fullQuoteFormatRtl: ContentModelFormatContainerFormat = {\r\n ...BuildInQuoteFormat,\r\n paddingRight: '10px',\r\n direction: 'rtl',\r\n ...(quoteFormatRtl ?? quoteFormat ?? DefaultQuoteFormatRtl),\r\n };\r\n\r\n editor.focus();\r\n\r\n editor.formatContentModel(\r\n (model, context) => {\r\n context.newPendingFormat = 'preserve';\r\n\r\n return toggleModelBlockQuote(model, fullQuoteFormatLtr, fullQuoteFormatRtl);\r\n },\r\n {\r\n apiName: 'toggleBlockQuote',\r\n }\r\n );\r\n}\r\n"]}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import type { ContentModelEntity, InsertEntityPosition, InsertEntityOptions, IEditor, DOMInsertPoint } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Insert an entity into editor
|
|
4
|
-
* @param editor The editor object
|
|
5
|
-
* @param type Type of entity
|
|
6
|
-
* @param isBlock True to insert a block entity, false to insert an inline entity
|
|
7
|
-
* @param position Position of the entity to insert. It can be
|
|
8
|
-
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
9
|
-
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
10
|
-
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
11
|
-
* @param options Move options to insert. See InsertEntityOptions
|
|
12
|
-
*/
|
|
13
|
-
export declare function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMInsertPoint, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
14
|
-
/**
|
|
15
|
-
* Insert a block entity into editor
|
|
16
|
-
* @param editor The editor object
|
|
17
|
-
* @param type Type of entity
|
|
18
|
-
* @param isBlock Must be true for a block entity
|
|
19
|
-
* @param position Position of the entity to insert. It can be
|
|
20
|
-
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
21
|
-
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
22
|
-
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
23
|
-
* @param options Move options to insert. See InsertEntityOptions
|
|
24
|
-
*/
|
|
25
|
-
export declare function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMInsertPoint, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
1
|
+
import type { ContentModelEntity, InsertEntityPosition, InsertEntityOptions, IEditor, DOMInsertPoint } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Insert an entity into editor
|
|
4
|
+
* @param editor The editor object
|
|
5
|
+
* @param type Type of entity
|
|
6
|
+
* @param isBlock True to insert a block entity, false to insert an inline entity
|
|
7
|
+
* @param position Position of the entity to insert. It can be
|
|
8
|
+
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
9
|
+
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
10
|
+
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
11
|
+
* @param options Move options to insert. See InsertEntityOptions
|
|
12
|
+
*/
|
|
13
|
+
export declare function insertEntity(editor: IEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMInsertPoint, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
14
|
+
/**
|
|
15
|
+
* Insert a block entity into editor
|
|
16
|
+
* @param editor The editor object
|
|
17
|
+
* @param type Type of entity
|
|
18
|
+
* @param isBlock Must be true for a block entity
|
|
19
|
+
* @param position Position of the entity to insert. It can be
|
|
20
|
+
* Value of InsertEntityPosition: see InsertEntityPosition
|
|
21
|
+
* selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
|
|
22
|
+
* the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
|
|
23
|
+
* @param options Move options to insert. See InsertEntityOptions
|
|
24
|
+
*/
|
|
25
|
+
export declare function insertEntity(editor: IEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMInsertPoint, options?: InsertEntityOptions): ContentModelEntity | null;
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';
|
|
2
|
-
import { insertEntityModel } from '../../modelApi/entity/insertEntityModel';
|
|
3
|
-
import { ChangeSource, createEntity, normalizeContentModel, parseEntityFormat, } from 'roosterjs-content-model-dom';
|
|
4
|
-
var BlockEntityTag = 'div';
|
|
5
|
-
var InlineEntityTag = 'span';
|
|
6
|
-
export function insertEntity(editor, type, isBlock, position, options) {
|
|
7
|
-
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
|
|
8
|
-
var document = editor.getDocument();
|
|
9
|
-
var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
|
|
10
|
-
var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
|
|
11
|
-
wrapper.style.setProperty('display', display || null);
|
|
12
|
-
if (display == undefined && isBlock) {
|
|
13
|
-
wrapper.style.setProperty('width', '100%');
|
|
14
|
-
wrapper.style.setProperty('display', 'inline-block');
|
|
15
|
-
}
|
|
16
|
-
if (contentNode) {
|
|
17
|
-
wrapper.appendChild(contentNode);
|
|
18
|
-
}
|
|
19
|
-
var entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);
|
|
20
|
-
if (!skipUndoSnapshot) {
|
|
21
|
-
editor.takeSnapshot();
|
|
22
|
-
}
|
|
23
|
-
var formatOptions = {
|
|
24
|
-
changeSource: ChangeSource.InsertEntity,
|
|
25
|
-
getChangeData: function () { return ({
|
|
26
|
-
wrapper: wrapper,
|
|
27
|
-
type: type,
|
|
28
|
-
id: '',
|
|
29
|
-
isReadonly: true,
|
|
30
|
-
}); },
|
|
31
|
-
apiName: 'insertEntity',
|
|
32
|
-
};
|
|
33
|
-
var callback = function (model, context, insertPoint) {
|
|
34
|
-
insertEntityModel(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context, insertPoint);
|
|
35
|
-
normalizeContentModel(model);
|
|
36
|
-
context.skipUndoSnapshot = true;
|
|
37
|
-
context.newEntities.push(entityModel);
|
|
38
|
-
return true;
|
|
39
|
-
};
|
|
40
|
-
if (typeof position == 'object') {
|
|
41
|
-
formatInsertPointWithContentModel(editor, position, callback, formatOptions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
editor.formatContentModel(callback, formatOptions);
|
|
45
|
-
}
|
|
46
|
-
if (!skipUndoSnapshot) {
|
|
47
|
-
var entityState = void 0;
|
|
48
|
-
if (initialEntityState) {
|
|
49
|
-
var format = parseEntityFormat(wrapper);
|
|
50
|
-
var id = format.id, entityType = format.entityType;
|
|
51
|
-
entityState =
|
|
52
|
-
id && entityType
|
|
53
|
-
? {
|
|
54
|
-
id: id,
|
|
55
|
-
type: entityType,
|
|
56
|
-
state: initialEntityState,
|
|
57
|
-
}
|
|
58
|
-
: undefined;
|
|
59
|
-
}
|
|
60
|
-
editor.takeSnapshot(entityState);
|
|
61
|
-
}
|
|
62
|
-
return entityModel;
|
|
63
|
-
}
|
|
1
|
+
import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';
|
|
2
|
+
import { insertEntityModel } from '../../modelApi/entity/insertEntityModel';
|
|
3
|
+
import { ChangeSource, createEntity, normalizeContentModel, parseEntityFormat, } from 'roosterjs-content-model-dom';
|
|
4
|
+
var BlockEntityTag = 'div';
|
|
5
|
+
var InlineEntityTag = 'span';
|
|
6
|
+
export function insertEntity(editor, type, isBlock, position, options) {
|
|
7
|
+
var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
|
|
8
|
+
var document = editor.getDocument();
|
|
9
|
+
var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
|
|
10
|
+
var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
|
|
11
|
+
wrapper.style.setProperty('display', display || null);
|
|
12
|
+
if (display == undefined && isBlock) {
|
|
13
|
+
wrapper.style.setProperty('width', '100%');
|
|
14
|
+
wrapper.style.setProperty('display', 'inline-block');
|
|
15
|
+
}
|
|
16
|
+
if (contentNode) {
|
|
17
|
+
wrapper.appendChild(contentNode);
|
|
18
|
+
}
|
|
19
|
+
var entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);
|
|
20
|
+
if (!skipUndoSnapshot) {
|
|
21
|
+
editor.takeSnapshot();
|
|
22
|
+
}
|
|
23
|
+
var formatOptions = {
|
|
24
|
+
changeSource: ChangeSource.InsertEntity,
|
|
25
|
+
getChangeData: function () { return ({
|
|
26
|
+
wrapper: wrapper,
|
|
27
|
+
type: type,
|
|
28
|
+
id: '',
|
|
29
|
+
isReadonly: true,
|
|
30
|
+
}); },
|
|
31
|
+
apiName: 'insertEntity',
|
|
32
|
+
};
|
|
33
|
+
var callback = function (model, context, insertPoint) {
|
|
34
|
+
insertEntityModel(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context, insertPoint);
|
|
35
|
+
normalizeContentModel(model);
|
|
36
|
+
context.skipUndoSnapshot = true;
|
|
37
|
+
context.newEntities.push(entityModel);
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
if (typeof position == 'object') {
|
|
41
|
+
formatInsertPointWithContentModel(editor, position, callback, formatOptions);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
editor.formatContentModel(callback, formatOptions);
|
|
45
|
+
}
|
|
46
|
+
if (!skipUndoSnapshot) {
|
|
47
|
+
var entityState = void 0;
|
|
48
|
+
if (initialEntityState) {
|
|
49
|
+
var format = parseEntityFormat(wrapper);
|
|
50
|
+
var id = format.id, entityType = format.entityType;
|
|
51
|
+
entityState =
|
|
52
|
+
id && entityType
|
|
53
|
+
? {
|
|
54
|
+
id: id,
|
|
55
|
+
type: entityType,
|
|
56
|
+
state: initialEntityState,
|
|
57
|
+
}
|
|
58
|
+
: undefined;
|
|
59
|
+
}
|
|
60
|
+
editor.takeSnapshot(entityState);
|
|
61
|
+
}
|
|
62
|
+
return entityModel;
|
|
63
|
+
}
|
|
64
64
|
//# sourceMappingURL=insertEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\nimport {\n ChangeSource,\n createEntity,\n normalizeContentModel,\n parseEntityFormat,\n} from 'roosterjs-content-model-dom';\nimport type {\n ContentModelEntity,\n InsertEntityPosition,\n InsertEntityOptions,\n IEditor,\n EntityState,\n DOMInsertPoint,\n FormatContentModelOptions,\n FormatContentModelContext,\n InsertPoint,\n ShallowMutableContentModelDocument,\n} from 'roosterjs-content-model-types';\n\nconst BlockEntityTag = 'div';\nconst InlineEntityTag = 'span';\n\n/**\n * Insert an entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock True to insert a block entity, false to insert an inline entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position: 'focus' | 'begin' | 'end' | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\n/**\n * Insert a block entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock Must be true for a block entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: true,\n position: InsertEntityPosition | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position?: InsertEntityPosition | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null {\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot, initialEntityState } =\n options || {};\n const document = editor.getDocument();\n const wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\n\n wrapper.style.setProperty('display', display || null);\n\n if (display == undefined && isBlock) {\n wrapper.style.setProperty('width', '100%');\n wrapper.style.setProperty('display', 'inline-block');\n }\n\n if (contentNode) {\n wrapper.appendChild(contentNode);\n }\n\n const entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);\n\n if (!skipUndoSnapshot) {\n editor.takeSnapshot();\n }\n\n const formatOptions: FormatContentModelOptions = {\n changeSource: ChangeSource.InsertEntity,\n getChangeData: () => ({\n wrapper,\n type,\n id: '',\n isReadonly: true,\n }),\n apiName: 'insertEntity',\n };\n\n const callback = (\n model: ShallowMutableContentModelDocument,\n context: FormatContentModelContext,\n insertPoint?: InsertPoint\n ) => {\n insertEntityModel(\n model,\n entityModel,\n typeof position == 'string' ? position : 'focus',\n isBlock,\n focusAfterEntity,\n context,\n insertPoint\n );\n\n normalizeContentModel(model);\n\n context.skipUndoSnapshot = true;\n context.newEntities.push(entityModel);\n\n return true;\n };\n\n if (typeof position == 'object') {\n formatInsertPointWithContentModel(editor, position, callback, formatOptions);\n } else {\n editor.formatContentModel(callback, formatOptions);\n }\n\n if (!skipUndoSnapshot) {\n let entityState: EntityState | undefined;\n\n if (initialEntityState) {\n const format = parseEntityFormat(wrapper);\n const { id, entityType } = format;\n\n entityState =\n id && entityType\n ? {\n id: id,\n type: entityType,\n state: initialEntityState,\n }\n : undefined;\n }\n\n editor.takeSnapshot(entityState);\n }\n\n return entityModel;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';\r\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\r\nimport {\r\n ChangeSource,\r\n createEntity,\r\n normalizeContentModel,\r\n parseEntityFormat,\r\n} from 'roosterjs-content-model-dom';\r\nimport type {\r\n ContentModelEntity,\r\n InsertEntityPosition,\r\n InsertEntityOptions,\r\n IEditor,\r\n EntityState,\r\n DOMInsertPoint,\r\n FormatContentModelOptions,\r\n FormatContentModelContext,\r\n InsertPoint,\r\n ShallowMutableContentModelDocument,\r\n} from 'roosterjs-content-model-types';\r\n\r\nconst BlockEntityTag = 'div';\r\nconst InlineEntityTag = 'span';\r\n\r\n/**\r\n * Insert an entity into editor\r\n * @param editor The editor object\r\n * @param type Type of entity\r\n * @param isBlock True to insert a block entity, false to insert an inline entity\r\n * @param position Position of the entity to insert. It can be\r\n * Value of InsertEntityPosition: see InsertEntityPosition\r\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\r\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\r\n * @param options Move options to insert. See InsertEntityOptions\r\n */\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: boolean,\r\n position: 'focus' | 'begin' | 'end' | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null;\r\n\r\n/**\r\n * Insert a block entity into editor\r\n * @param editor The editor object\r\n * @param type Type of entity\r\n * @param isBlock Must be true for a block entity\r\n * @param position Position of the entity to insert. It can be\r\n * Value of InsertEntityPosition: see InsertEntityPosition\r\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\r\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\r\n * @param options Move options to insert. See InsertEntityOptions\r\n */\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: true,\r\n position: InsertEntityPosition | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null;\r\n\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: boolean,\r\n position?: InsertEntityPosition | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null {\r\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot, initialEntityState } =\r\n options || {};\r\n const document = editor.getDocument();\r\n const wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);\r\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\r\n\r\n wrapper.style.setProperty('display', display || null);\r\n\r\n if (display == undefined && isBlock) {\r\n wrapper.style.setProperty('width', '100%');\r\n wrapper.style.setProperty('display', 'inline-block');\r\n }\r\n\r\n if (contentNode) {\r\n wrapper.appendChild(contentNode);\r\n }\r\n\r\n const entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);\r\n\r\n if (!skipUndoSnapshot) {\r\n editor.takeSnapshot();\r\n }\r\n\r\n const formatOptions: FormatContentModelOptions = {\r\n changeSource: ChangeSource.InsertEntity,\r\n getChangeData: () => ({\r\n wrapper,\r\n type,\r\n id: '',\r\n isReadonly: true,\r\n }),\r\n apiName: 'insertEntity',\r\n };\r\n\r\n const callback = (\r\n model: ShallowMutableContentModelDocument,\r\n context: FormatContentModelContext,\r\n insertPoint?: InsertPoint\r\n ) => {\r\n insertEntityModel(\r\n model,\r\n entityModel,\r\n typeof position == 'string' ? position : 'focus',\r\n isBlock,\r\n focusAfterEntity,\r\n context,\r\n insertPoint\r\n );\r\n\r\n normalizeContentModel(model);\r\n\r\n context.skipUndoSnapshot = true;\r\n context.newEntities.push(entityModel);\r\n\r\n return true;\r\n };\r\n\r\n if (typeof position == 'object') {\r\n formatInsertPointWithContentModel(editor, position, callback, formatOptions);\r\n } else {\r\n editor.formatContentModel(callback, formatOptions);\r\n }\r\n\r\n if (!skipUndoSnapshot) {\r\n let entityState: EntityState | undefined;\r\n\r\n if (initialEntityState) {\r\n const format = parseEntityFormat(wrapper);\r\n const { id, entityType } = format;\r\n\r\n entityState =\r\n id && entityType\r\n ? {\r\n id: id,\r\n type: entityType,\r\n state: initialEntityState,\r\n }\r\n : undefined;\r\n }\r\n\r\n editor.takeSnapshot(entityState);\r\n }\r\n\r\n return entityModel;\r\n}\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Clear format of selection
|
|
4
|
-
* @param editor The editor to clear format from
|
|
5
|
-
*/
|
|
6
|
-
export declare function clearFormat(editor: IEditor): void;
|
|
1
|
+
import type { IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Clear format of selection
|
|
4
|
+
* @param editor The editor to clear format from
|
|
5
|
+
*/
|
|
6
|
+
export declare function clearFormat(editor: IEditor): void;
|