roosterjs-content-model-api 0.26.0 → 0.26.1
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 +48 -48
- package/lib/index.js +99 -99
- package/lib/index.js.map +1 -1
- package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib/modelApi/block/setModelAlignment.js +62 -62
- package/lib/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib/modelApi/block/setModelDirection.js +68 -68
- package/lib/modelApi/block/setModelDirection.js.map +1 -1
- package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib/modelApi/block/setModelIndentation.js +138 -138
- package/lib/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib/modelApi/block/toggleModelBlockQuote.js +50 -50
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib/modelApi/common/clearModelFormat.js +129 -129
- package/lib/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib/modelApi/common/wrapBlock.js +48 -48
- package/lib/modelApi/common/wrapBlock.js.map +1 -1
- package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib/modelApi/entity/insertEntityModel.js +79 -79
- 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/matchLink.d.ts +29 -29
- package/lib/modelApi/link/matchLink.js +94 -94
- package/lib/modelApi/link/matchLink.js.map +1 -1
- package/lib/modelApi/list/findListItemsInSameThread.d.ts +7 -7
- package/lib/modelApi/list/findListItemsInSameThread.js +114 -114
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib/modelApi/list/setListType.d.ts +7 -7
- package/lib/modelApi/list/setListType.js +113 -113
- package/lib/modelApi/list/setListType.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 +55 -55
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustWordSelection.d.ts +5 -5
- package/lib/modelApi/selection/adjustWordSelection.js +121 -121
- 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 +12 -12
- package/lib/modelApi/table/alignTable.js.map +1 -1
- package/lib/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib/modelApi/table/alignTableCell.js +58 -58
- 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 +8 -8
- package/lib/modelApi/table/clearSelectedCells.js +26 -26
- 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 +11 -11
- 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 +28 -28
- package/lib/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib/modelApi/table/insertTableRow.js +32 -32
- package/lib/modelApi/table/insertTableRow.js.map +1 -1
- package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib/modelApi/table/mergeTableCells.js +26 -26
- package/lib/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib/modelApi/table/mergeTableColumn.js +37 -37
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib/modelApi/table/mergeTableRow.js +38 -38
- 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 +57 -57
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib/publicApi/block/setAlignment.d.ts +7 -7
- package/lib/publicApi/block/setAlignment.js +15 -15
- package/lib/publicApi/block/setAlignment.js.map +1 -1
- package/lib/publicApi/block/setDirection.d.ts +7 -7
- package/lib/publicApi/block/setDirection.js +15 -15
- package/lib/publicApi/block/setDirection.js.map +1 -1
- package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib/publicApi/block/setHeadingLevel.js +49 -49
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib/publicApi/block/setIndentation.d.ts +8 -8
- package/lib/publicApi/block/setIndentation.js +24 -24
- package/lib/publicApi/block/setIndentation.js.map +1 -1
- package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib/publicApi/block/setParagraphMargin.js +32 -32
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib/publicApi/block/setSpacing.d.ts +7 -7
- package/lib/publicApi/block/setSpacing.js +20 -20
- package/lib/publicApi/block/setSpacing.js.map +1 -1
- package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib/publicApi/block/toggleBlockQuote.js +38 -38
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib/publicApi/entity/insertEntity.js +41 -41
- package/lib/publicApi/entity/insertEntity.js.map +1 -1
- package/lib/publicApi/format/clearFormat.d.ts +6 -6
- package/lib/publicApi/format/clearFormat.js +22 -22
- package/lib/publicApi/format/clearFormat.js.map +1 -1
- package/lib/publicApi/format/getFormatState.d.ts +6 -6
- package/lib/publicApi/format/getFormatState.js +20 -20
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib/publicApi/image/adjustImageSelection.js +25 -25
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib/publicApi/image/changeImage.d.ts +7 -7
- package/lib/publicApi/image/changeImage.js +34 -34
- package/lib/publicApi/image/changeImage.js.map +1 -1
- package/lib/publicApi/image/insertImage.d.ts +7 -7
- package/lib/publicApi/image/insertImage.js +36 -36
- package/lib/publicApi/image/insertImage.js.map +1 -1
- package/lib/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib/publicApi/image/setImageAltText.js +16 -16
- package/lib/publicApi/image/setImageAltText.js.map +1 -1
- package/lib/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib/publicApi/image/setImageBorder.js +18 -18
- package/lib/publicApi/image/setImageBorder.js.map +1 -1
- package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib/publicApi/image/setImageBoxShadow.js +28 -28
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib/publicApi/link/adjustLinkSelection.js +33 -33
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib/publicApi/link/insertLink.d.ts +15 -15
- package/lib/publicApi/link/insertLink.js +119 -119
- package/lib/publicApi/link/insertLink.js.map +1 -1
- package/lib/publicApi/link/removeLink.d.ts +8 -8
- package/lib/publicApi/link/removeLink.js +31 -31
- package/lib/publicApi/link/removeLink.js.map +1 -1
- package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib/publicApi/list/setListStartNumber.js +25 -25
- package/lib/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib/publicApi/list/setListStyle.d.ts +7 -7
- package/lib/publicApi/list/setListStyle.js +32 -32
- package/lib/publicApi/list/setListStyle.js.map +1 -1
- package/lib/publicApi/list/toggleBullet.d.ts +8 -8
- package/lib/publicApi/list/toggleBullet.js +19 -19
- package/lib/publicApi/list/toggleBullet.js.map +1 -1
- package/lib/publicApi/list/toggleNumbering.d.ts +8 -8
- package/lib/publicApi/list/toggleNumbering.js +19 -19
- package/lib/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib/publicApi/segment/applySegmentFormat.js +22 -22
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib/publicApi/segment/changeCapitalization.js +48 -48
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib/publicApi/segment/changeFontSize.js +61 -61
- 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 +18 -18
- 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 +25 -25
- package/lib/publicApi/segment/setTextColor.js.map +1 -1
- package/lib/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib/publicApi/segment/toggleBold.js +20 -20
- package/lib/publicApi/segment/toggleBold.js.map +1 -1
- package/lib/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib/publicApi/segment/toggleCode.js +27 -27
- package/lib/publicApi/segment/toggleCode.js.map +1 -1
- package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib/publicApi/segment/toggleItalic.js +14 -14
- package/lib/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib/publicApi/segment/toggleStrikethrough.js +14 -14
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSubscript.js +14 -14
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSuperscript.js +14 -14
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib/publicApi/segment/toggleUnderline.js +18 -18
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib/publicApi/table/applyTableBorderFormat.js +293 -293
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib/publicApi/table/editTable.d.ts +7 -7
- package/lib/publicApi/table/editTable.js +77 -77
- package/lib/publicApi/table/editTable.js.map +1 -1
- package/lib/publicApi/table/formatTable.d.ts +8 -8
- package/lib/publicApi/table/formatTable.js +37 -37
- package/lib/publicApi/table/formatTable.js.map +1 -1
- package/lib/publicApi/table/insertTable.d.ts +11 -11
- package/lib/publicApi/table/insertTable.js +46 -46
- 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/formatImageWithContentModel.d.ts +5 -5
- package/lib/publicApi/utils/formatImageWithContentModel.js +14 -14
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +18 -18
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +46 -46
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib/publicApi/utils/formatTableWithContentModel.js +43 -43
- package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-amd/index.d.ts +48 -48
- package/lib-amd/index.js +53 -53
- 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 +62 -62
- 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 +68 -68
- 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 +137 -137
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js +49 -49
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-amd/modelApi/common/clearModelFormat.js +127 -127
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-amd/modelApi/common/wrapBlock.js +48 -48
- 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 +78 -78
- 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 +57 -57
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-amd/modelApi/link/matchLink.d.ts +29 -29
- package/lib-amd/modelApi/link/matchLink.js +94 -94
- package/lib-amd/modelApi/link/matchLink.js.map +1 -1
- package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +7 -7
- package/lib-amd/modelApi/list/findListItemsInSameThread.js +116 -116
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-amd/modelApi/list/setListType.d.ts +7 -7
- package/lib-amd/modelApi/list/setListType.js +113 -113
- package/lib-amd/modelApi/list/setListType.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 +54 -54
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +5 -5
- package/lib-amd/modelApi/selection/adjustWordSelection.js +120 -120
- 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 +14 -14
- 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 +59 -59
- 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 +8 -8
- package/lib-amd/modelApi/table/clearSelectedCells.js +27 -27
- 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 +13 -13
- 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 +26 -26
- 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 +37 -37
- 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 +38 -38
- 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 +53 -53
- 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 +56 -56
- 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 +16 -16
- 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 +16 -16
- 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 +50 -50
- 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 +24 -24
- 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 +32 -32
- 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 +21 -21
- 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 +38 -38
- 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 +40 -40
- 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 +22 -22
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.d.ts +6 -6
- package/lib-amd/publicApi/format/getFormatState.js +21 -21
- 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 +26 -26
- 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 +34 -34
- 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 +36 -36
- 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 +17 -17
- 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 +18 -18
- 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 +29 -29
- 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 +32 -32
- 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 +116 -116
- 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 +31 -31
- 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 +26 -26
- 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 +32 -32
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
- package/lib-amd/publicApi/list/toggleBullet.d.ts +8 -8
- package/lib-amd/publicApi/list/toggleBullet.js +20 -20
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +8 -8
- package/lib-amd/publicApi/list/toggleNumbering.js +20 -20
- 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 +23 -23
- 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 +49 -49
- 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 +60 -60
- 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 +34 -34
- 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 +19 -19
- 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 +26 -26
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleBold.js +20 -20
- 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 +27 -27
- 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 +15 -15
- 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 +15 -15
- 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 +15 -15
- 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 +15 -15
- 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 +18 -18
- 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 +292 -292
- 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 +66 -66
- 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 +37 -37
- package/lib-amd/publicApi/table/formatTable.js.map +1 -1
- package/lib-amd/publicApi/table/insertTable.d.ts +11 -11
- package/lib-amd/publicApi/table/insertTable.js +45 -45
- 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/formatImageWithContentModel.d.ts +5 -5
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +15 -15
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +19 -19
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +45 -45
- 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 +41 -41
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-mjs/index.d.ts +48 -48
- package/lib-mjs/index.js +48 -48
- 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 +58 -58
- 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 +64 -64
- 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 +134 -134
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +46 -46
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-mjs/modelApi/common/clearModelFormat.js +125 -125
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-mjs/modelApi/common/wrapBlock.js +43 -43
- 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 +75 -75
- 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 +54 -54
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-mjs/modelApi/link/matchLink.d.ts +29 -29
- package/lib-mjs/modelApi/link/matchLink.js +90 -90
- package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
- package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +7 -7
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js +110 -110
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-mjs/modelApi/list/setListType.d.ts +7 -7
- package/lib-mjs/modelApi/list/setListType.js +109 -109
- package/lib-mjs/modelApi/list/setListType.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 +51 -51
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +5 -5
- package/lib-mjs/modelApi/selection/adjustWordSelection.js +117 -117
- 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 +8 -8
- 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 +53 -53
- 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 +8 -8
- package/lib-mjs/modelApi/table/clearSelectedCells.js +22 -22
- 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 +7 -7
- 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 +24 -24
- 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 +28 -28
- 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 +22 -22
- 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 +33 -33
- 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 +34 -34
- 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 +53 -53
- 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 +21 -21
- 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 +38 -38
- 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 +19 -19
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.d.ts +6 -6
- package/lib-mjs/publicApi/format/getFormatState.js +17 -17
- 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 +22 -22
- 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 +33 -33
- 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 +22 -22
- 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 +29 -29
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +8 -8
- package/lib-mjs/publicApi/list/toggleBullet.js +16 -16
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +8 -8
- package/lib-mjs/publicApi/list/toggleNumbering.js +16 -16
- 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 +58 -58
- 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 +32 -32
- 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/toggleBold.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleBold.js +17 -17
- 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 +11 -11
- 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 +15 -15
- 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 +290 -290
- 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 +74 -74
- 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 +11 -11
- package/lib-mjs/publicApi/table/insertTable.js +43 -43
- 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 +29 -29
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -5
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +11 -11
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +14 -14
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +42 -42
- 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 +39 -39
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AA4BtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC1C,MAAyB,EACzB,MAAc,EACd,SAA2B;IAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,IAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACzC,IAAM,SAAS,GAAc;gBACzB,GAAG,EAAE,KAAK;gBACV,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;aACf,CAAC;YAEF,mDAAmD;YACnD,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YACzB,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,KAAK,GAAY,MAAM,MAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;YACvC,IAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;YAC1C,IAAM,WAAW,GAAG,eAA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AAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YACjE,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SACjF;KACJ;AACL,CAAC","sourcesContent":["import { parseValueWithUnit } from 'roosterjs-content-model-dom';\r\nimport {\r\n extractBorderValues,\r\n getFirstSelectedTable,\r\n getSelectedCells,\r\n updateTableCellMetadata,\r\n} from 'roosterjs-content-model-core';\r\nimport type {\r\n IStandaloneEditor,\r\n Border,\r\n ContentModelTable,\r\n ContentModelTableCell,\r\n BorderOperations,\r\n TableSelectionCoordinates,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n * Border positions\r\n */\r\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\r\n\r\n/**\r\n * @internal\r\n * Perimeter of the table selection\r\n * Used to determine where to apply border to the cells adjacent to the selection.\r\n */\r\ntype Perimeter = {\r\n Top: boolean;\r\n Bottom: boolean;\r\n Left: boolean;\r\n Right: boolean;\r\n};\r\n\r\n/**\r\n * Operations to apply border\r\n * @param editor The editor instance\r\n * @param border The border to apply\r\n * @param operation The operation to apply\r\n */\r\nexport default function applyTableBorderFormat(\r\n editor: IStandaloneEditor,\r\n border: Border,\r\n operation: BorderOperations\r\n) {\r\n editor.formatContentModel(\r\n model => {\r\n const [tableModel] = getFirstSelectedTable(model);\r\n\r\n if (tableModel) {\r\n const sel = getSelectedCells(tableModel);\r\n const perimeter: Perimeter = {\r\n Top: false,\r\n Bottom: false,\r\n Left: false,\r\n Right: false,\r\n };\r\n\r\n // Create border format with table format as backup\r\n let borderFormat = '';\r\n const format = tableModel.format;\r\n const { width, style, color } = border;\r\n const extractedBorder = extractBorderValues(format.borderTop);\r\n const borderColor = extractedBorder.color;\r\n const borderWidth = extractedBorder.width;\r\n const borderStyle = extractedBorder.style;\r\n\r\n if (width) {\r\n borderFormat = parseValueWithUnit(width) + 'px';\r\n } else if (borderWidth) {\r\n borderFormat = borderWidth;\r\n } else {\r\n borderFormat = '1px';\r\n }\r\n\r\n if (style) {\r\n borderFormat = `${borderFormat} ${style}`;\r\n } else if (borderStyle) {\r\n borderFormat = `${borderFormat} ${borderStyle}`;\r\n } else {\r\n borderFormat = `${borderFormat} solid`;\r\n }\r\n\r\n if (color) {\r\n borderFormat = `${borderFormat} ${color}`;\r\n } else if (borderColor) {\r\n borderFormat = `${borderFormat} ${borderColor}`;\r\n }\r\n\r\n // undefined is treated as Left to Right\r\n const isRtl = tableModel.format.direction == 'rtl';\r\n\r\n if (sel) {\r\n const operations: BorderOperations[] = [operation];\r\n while (operations.length) {\r\n switch (operations.pop()) {\r\n case 'noBorders':\r\n // Do All borders but with empty border format\r\n borderFormat = '';\r\n operations.push('allBorders');\r\n break;\r\n case 'allBorders':\r\n const allBorders: BorderPositions[] = [\r\n 'borderTop',\r\n 'borderBottom',\r\n 'borderLeft',\r\n 'borderRight',\r\n ];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[colIndex];\r\n // Format cells - All borders\r\n applyBorderFormat(cell, borderFormat, allBorders);\r\n }\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Top = true;\r\n perimeter.Bottom = true;\r\n perimeter.Left = true;\r\n perimeter.Right = true;\r\n break;\r\n case 'leftBorders':\r\n const leftBorder: BorderPositions[] = ['borderLeft'];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ];\r\n // Format cells - Left border\r\n applyBorderFormat(cell, borderFormat, leftBorder);\r\n }\r\n\r\n // Format perimeter\r\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\r\n break;\r\n case 'rightBorders':\r\n const rightBorder: BorderPositions[] = ['borderRight'];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ];\r\n // Format cells - Right border\r\n applyBorderFormat(cell, borderFormat, rightBorder);\r\n }\r\n\r\n // Format perimeter\r\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\r\n break;\r\n case 'topBorders':\r\n const topBorder: BorderPositions[] = ['borderTop'];\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n // Format cells - Top border\r\n applyBorderFormat(cell, borderFormat, topBorder);\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Top = true;\r\n break;\r\n case 'bottomBorders':\r\n const bottomBorder: BorderPositions[] = ['borderBottom'];\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\r\n // Format cells - Bottom border\r\n applyBorderFormat(cell, borderFormat, bottomBorder);\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Bottom = true;\r\n break;\r\n case 'insideBorders':\r\n // Format cells - Inside borders\r\n const singleCol = sel.lastColumn == sel.firstColumn;\r\n const singleRow = sel.lastRow == sel.firstRow;\r\n // Single cell selection\r\n if (singleCol && singleRow) {\r\n break;\r\n }\r\n // Single column selection\r\n if (singleCol) {\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\r\n borderFormat,\r\n ['borderBottom']\r\n );\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex <= sel.lastRow - 1;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[sel.firstColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n ]);\r\n }\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\r\n borderFormat,\r\n ['borderTop']\r\n );\r\n break;\r\n }\r\n // Single row selection\r\n if (singleRow) {\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderRight']\r\n );\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex <= sel.lastColumn - 1;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderLeft']\r\n );\r\n break;\r\n }\r\n\r\n // For multiple rows and columns selections\r\n // Top left cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderBottom', 'borderRight']\r\n );\r\n // Top right cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderBottom', 'borderLeft']\r\n );\r\n // Bottom left cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderTop', 'borderRight']\r\n );\r\n // Bottom right cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderTop', 'borderLeft']\r\n );\r\n // First row\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex < sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderBottom',\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n // Last row\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex < sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n // First column\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex < sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n isRtl ? 'borderLeft' : 'borderRight',\r\n ]);\r\n }\r\n // Last column\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex < sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n isRtl ? 'borderRight' : 'borderLeft',\r\n ]);\r\n }\r\n // Inner cells\r\n sel.firstColumn++;\r\n sel.firstRow++;\r\n sel.lastColumn--;\r\n sel.lastRow--;\r\n operations.push('allBorders');\r\n break;\r\n case 'outsideBorders':\r\n // Format cells - Outside borders\r\n operations.push('topBorders');\r\n operations.push('bottomBorders');\r\n operations.push('leftBorders');\r\n operations.push('rightBorders');\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n //Format perimeter if necessary or possible\r\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\r\n }\r\n\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n },\r\n {\r\n apiName: 'tableBorder',\r\n }\r\n );\r\n}\r\n\r\n/**\r\n * @internal\r\n * Apply border format to a cell\r\n * @param cell The cell to apply border format\r\n * @param borderFormat The border format to apply\r\n * @param positions The positions to apply\r\n */\r\nfunction applyBorderFormat(\r\n cell: ContentModelTableCell,\r\n borderFormat: string,\r\n positions: BorderPositions[]\r\n) {\r\n positions.forEach(pos => {\r\n cell.format[pos] = borderFormat;\r\n });\r\n\r\n updateTableCellMetadata(cell, metadata => {\r\n metadata = metadata || {};\r\n metadata.borderOverride = true;\r\n return metadata;\r\n });\r\n\r\n // Cell was modified, so delete cached element\r\n delete cell.cachedElement;\r\n}\r\n\r\n/**\r\n * @internal\r\n * Modify the perimeter of the table selection\r\n * @param tableModel The table model\r\n * @param sel The table selection\r\n * @param borderFormat The border format to apply\r\n * If borderFormat is empty, the border will be removed\r\n * @param perimeter Where in the perimeter to apply\r\n */\r\nfunction modifyPerimeter(\r\n tableModel: ContentModelTable,\r\n sel: TableSelectionCoordinates,\r\n borderFormat: string,\r\n perimeter: Perimeter,\r\n isRtl: boolean\r\n) {\r\n // Top of selection\r\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\r\n }\r\n }\r\n // Bottom of selection\r\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, ['borderTop']);\r\n }\r\n }\r\n // Left of selection\r\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\r\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\r\n }\r\n }\r\n // Right of selection\r\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\r\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AA4BtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC1C,MAAyB,EACzB,MAAc,EACd,SAA2B;IAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,IAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACzC,IAAM,SAAS,GAAc;gBACzB,GAAG,EAAE,KAAK;gBACV,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;aACf,CAAC;YAEF,mDAAmD;YACnD,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YACzB,IAAA,KAAK,GAAmB,MAAM,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AAG,CAAC,UAAU,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;QACzE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACnE,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YACjE,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SACjF;KACJ;AACL,CAAC","sourcesContent":["import { parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport {\n extractBorderValues,\n getFirstSelectedTable,\n getSelectedCells,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type {\n IStandaloneEditor,\n Border,\n ContentModelTable,\n ContentModelTableCell,\n BorderOperations,\n TableSelectionCoordinates,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * Border positions\n */\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\n\n/**\n * @internal\n * Perimeter of the table selection\n * Used to determine where to apply border to the cells adjacent to the selection.\n */\ntype Perimeter = {\n Top: boolean;\n Bottom: boolean;\n Left: boolean;\n Right: boolean;\n};\n\n/**\n * Operations to apply border\n * @param editor The editor instance\n * @param border The border to apply\n * @param operation The operation to apply\n */\nexport default function applyTableBorderFormat(\n editor: IStandaloneEditor,\n border: Border,\n operation: BorderOperations\n) {\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n const sel = getSelectedCells(tableModel);\n const perimeter: Perimeter = {\n Top: false,\n Bottom: false,\n Left: false,\n Right: false,\n };\n\n // Create border format with table format as backup\n let borderFormat = '';\n const format = tableModel.format;\n const { width, style, color } = border;\n const extractedBorder = extractBorderValues(format.borderTop);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n if (width) {\n borderFormat = parseValueWithUnit(width) + 'px';\n } else if (borderWidth) {\n borderFormat = borderWidth;\n } else {\n borderFormat = '1px';\n }\n\n if (style) {\n borderFormat = `${borderFormat} ${style}`;\n } else if (borderStyle) {\n borderFormat = `${borderFormat} ${borderStyle}`;\n } else {\n borderFormat = `${borderFormat} solid`;\n }\n\n if (color) {\n borderFormat = `${borderFormat} ${color}`;\n } else if (borderColor) {\n borderFormat = `${borderFormat} ${borderColor}`;\n }\n\n // undefined is treated as Left to Right\n const isRtl = tableModel.format.direction == 'rtl';\n\n if (sel) {\n const operations: BorderOperations[] = [operation];\n while (operations.length) {\n switch (operations.pop()) {\n case 'noBorders':\n // Do All borders but with empty border format\n borderFormat = '';\n operations.push('allBorders');\n break;\n case 'allBorders':\n const allBorders: BorderPositions[] = [\n 'borderTop',\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[colIndex];\n // Format cells - All borders\n applyBorderFormat(cell, borderFormat, allBorders);\n }\n }\n\n // Format perimeter\n perimeter.Top = true;\n perimeter.Bottom = true;\n perimeter.Left = true;\n perimeter.Right = true;\n break;\n case 'leftBorders':\n const leftBorder: BorderPositions[] = ['borderLeft'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ];\n // Format cells - Left border\n applyBorderFormat(cell, borderFormat, leftBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\n break;\n case 'rightBorders':\n const rightBorder: BorderPositions[] = ['borderRight'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ];\n // Format cells - Right border\n applyBorderFormat(cell, borderFormat, rightBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\n break;\n case 'topBorders':\n const topBorder: BorderPositions[] = ['borderTop'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n // Format cells - Top border\n applyBorderFormat(cell, borderFormat, topBorder);\n }\n\n // Format perimeter\n perimeter.Top = true;\n break;\n case 'bottomBorders':\n const bottomBorder: BorderPositions[] = ['borderBottom'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n // Format cells - Bottom border\n applyBorderFormat(cell, borderFormat, bottomBorder);\n }\n\n // Format perimeter\n perimeter.Bottom = true;\n break;\n case 'insideBorders':\n // Format cells - Inside borders\n const singleCol = sel.lastColumn == sel.firstColumn;\n const singleRow = sel.lastRow == sel.firstRow;\n // Single cell selection\n if (singleCol && singleRow) {\n break;\n }\n // Single column selection\n if (singleCol) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\n borderFormat,\n ['borderBottom']\n );\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex <= sel.lastRow - 1;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\n borderFormat,\n ['borderTop']\n );\n break;\n }\n // Single row selection\n if (singleRow) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderRight']\n );\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex <= sel.lastColumn - 1;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderLeft',\n 'borderRight',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderLeft']\n );\n break;\n }\n\n // For multiple rows and columns selections\n // Top left cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderBottom', 'borderRight']\n );\n // Top right cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderBottom', 'borderLeft']\n );\n // Bottom left cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderTop', 'borderRight']\n );\n // Bottom right cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderTop', 'borderLeft']\n );\n // First row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // Last row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // First column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderLeft' : 'borderRight',\n ]);\n }\n // Last column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderRight' : 'borderLeft',\n ]);\n }\n // Inner cells\n sel.firstColumn++;\n sel.firstRow++;\n sel.lastColumn--;\n sel.lastRow--;\n operations.push('allBorders');\n break;\n case 'outsideBorders':\n // Format cells - Outside borders\n operations.push('topBorders');\n operations.push('bottomBorders');\n operations.push('leftBorders');\n operations.push('rightBorders');\n break;\n default:\n break;\n }\n }\n\n //Format perimeter if necessary or possible\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'tableBorder',\n }\n );\n}\n\n/**\n * @internal\n * Apply border format to a cell\n * @param cell The cell to apply border format\n * @param borderFormat The border format to apply\n * @param positions The positions to apply\n */\nfunction applyBorderFormat(\n cell: ContentModelTableCell,\n borderFormat: string,\n positions: BorderPositions[]\n) {\n positions.forEach(pos => {\n cell.format[pos] = borderFormat;\n });\n\n updateTableCellMetadata(cell, metadata => {\n metadata = metadata || {};\n metadata.borderOverride = true;\n return metadata;\n });\n\n // Cell was modified, so delete cached element\n delete cell.cachedElement;\n}\n\n/**\n * @internal\n * Modify the perimeter of the table selection\n * @param tableModel The table model\n * @param sel The table selection\n * @param borderFormat The border format to apply\n * If borderFormat is empty, the border will be removed\n * @param perimeter Where in the perimeter to apply\n */\nfunction modifyPerimeter(\n tableModel: ContentModelTable,\n sel: TableSelectionCoordinates,\n borderFormat: string,\n perimeter: Perimeter,\n isRtl: boolean\n) {\n // Top of selection\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\n }\n }\n // Bottom of selection\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderTop']);\n }\n }\n // Left of selection\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\n }\n }\n // Right of selection\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\n }\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Format current focused table with the given format
|
|
4
|
-
* @param editor The editor instance
|
|
5
|
-
* @param operation The table operation to apply
|
|
6
|
-
*/
|
|
7
|
-
export default function editTable(editor: IStandaloneEditor, operation: TableOperation): void;
|
|
1
|
+
import type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Format current focused table with the given format
|
|
4
|
+
* @param editor The editor instance
|
|
5
|
+
* @param operation The table operation to apply
|
|
6
|
+
*/
|
|
7
|
+
export default function editTable(editor: IStandaloneEditor, operation: TableOperation): void;
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { alignTable } from '../../modelApi/table/alignTable';
|
|
2
|
-
import { deleteTable } from '../../modelApi/table/deleteTable';
|
|
3
|
-
import { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';
|
|
4
|
-
import { deleteTableRow } from '../../modelApi/table/deleteTableRow';
|
|
5
|
-
import { formatTableWithContentModel } from '../utils/formatTableWithContentModel';
|
|
6
|
-
import { insertTableColumn } from '../../modelApi/table/insertTableColumn';
|
|
7
|
-
import { insertTableRow } from '../../modelApi/table/insertTableRow';
|
|
8
|
-
import { mergeTableCells } from '../../modelApi/table/mergeTableCells';
|
|
9
|
-
import { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';
|
|
10
|
-
import { mergeTableRow } from '../../modelApi/table/mergeTableRow';
|
|
11
|
-
import { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';
|
|
12
|
-
import { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';
|
|
13
|
-
import { alignTableCellHorizontally, alignTableCellVertically, } from '../../modelApi/table/alignTableCell';
|
|
14
|
-
/**
|
|
15
|
-
* Format current focused table with the given format
|
|
16
|
-
* @param editor The editor instance
|
|
17
|
-
* @param operation The table operation to apply
|
|
18
|
-
*/
|
|
19
|
-
export default function editTable(editor, operation) {
|
|
20
|
-
editor.focus();
|
|
21
|
-
formatTableWithContentModel(editor, 'editTable', function (tableModel) {
|
|
22
|
-
switch (operation) {
|
|
23
|
-
case 'alignCellLeft':
|
|
24
|
-
case 'alignCellCenter':
|
|
25
|
-
case 'alignCellRight':
|
|
26
|
-
alignTableCellHorizontally(tableModel, operation);
|
|
27
|
-
break;
|
|
28
|
-
case 'alignCellTop':
|
|
29
|
-
case 'alignCellMiddle':
|
|
30
|
-
case 'alignCellBottom':
|
|
31
|
-
alignTableCellVertically(tableModel, operation);
|
|
32
|
-
break;
|
|
33
|
-
case 'alignCenter':
|
|
34
|
-
case 'alignLeft':
|
|
35
|
-
case 'alignRight':
|
|
36
|
-
alignTable(tableModel, operation);
|
|
37
|
-
break;
|
|
38
|
-
case 'deleteColumn':
|
|
39
|
-
deleteTableColumn(tableModel);
|
|
40
|
-
break;
|
|
41
|
-
case 'deleteRow':
|
|
42
|
-
deleteTableRow(tableModel);
|
|
43
|
-
break;
|
|
44
|
-
case 'deleteTable':
|
|
45
|
-
deleteTable(tableModel);
|
|
46
|
-
break;
|
|
47
|
-
case 'insertAbove':
|
|
48
|
-
case 'insertBelow':
|
|
49
|
-
insertTableRow(tableModel, operation);
|
|
50
|
-
break;
|
|
51
|
-
case 'insertLeft':
|
|
52
|
-
case 'insertRight':
|
|
53
|
-
insertTableColumn(tableModel, operation);
|
|
54
|
-
break;
|
|
55
|
-
case 'mergeAbove':
|
|
56
|
-
case 'mergeBelow':
|
|
57
|
-
mergeTableRow(tableModel, operation);
|
|
58
|
-
break;
|
|
59
|
-
case 'mergeCells':
|
|
60
|
-
mergeTableCells(tableModel);
|
|
61
|
-
break;
|
|
62
|
-
case 'mergeLeft':
|
|
63
|
-
case 'mergeRight':
|
|
64
|
-
mergeTableColumn(tableModel, operation);
|
|
65
|
-
break;
|
|
66
|
-
case 'splitHorizontally':
|
|
67
|
-
splitTableCellHorizontally(tableModel);
|
|
68
|
-
break;
|
|
69
|
-
case 'splitVertically':
|
|
70
|
-
splitTableCellVertically(tableModel);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
1
|
+
import { alignTable } from '../../modelApi/table/alignTable';
|
|
2
|
+
import { deleteTable } from '../../modelApi/table/deleteTable';
|
|
3
|
+
import { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';
|
|
4
|
+
import { deleteTableRow } from '../../modelApi/table/deleteTableRow';
|
|
5
|
+
import { formatTableWithContentModel } from '../utils/formatTableWithContentModel';
|
|
6
|
+
import { insertTableColumn } from '../../modelApi/table/insertTableColumn';
|
|
7
|
+
import { insertTableRow } from '../../modelApi/table/insertTableRow';
|
|
8
|
+
import { mergeTableCells } from '../../modelApi/table/mergeTableCells';
|
|
9
|
+
import { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';
|
|
10
|
+
import { mergeTableRow } from '../../modelApi/table/mergeTableRow';
|
|
11
|
+
import { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';
|
|
12
|
+
import { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';
|
|
13
|
+
import { alignTableCellHorizontally, alignTableCellVertically, } from '../../modelApi/table/alignTableCell';
|
|
14
|
+
/**
|
|
15
|
+
* Format current focused table with the given format
|
|
16
|
+
* @param editor The editor instance
|
|
17
|
+
* @param operation The table operation to apply
|
|
18
|
+
*/
|
|
19
|
+
export default function editTable(editor, operation) {
|
|
20
|
+
editor.focus();
|
|
21
|
+
formatTableWithContentModel(editor, 'editTable', function (tableModel) {
|
|
22
|
+
switch (operation) {
|
|
23
|
+
case 'alignCellLeft':
|
|
24
|
+
case 'alignCellCenter':
|
|
25
|
+
case 'alignCellRight':
|
|
26
|
+
alignTableCellHorizontally(tableModel, operation);
|
|
27
|
+
break;
|
|
28
|
+
case 'alignCellTop':
|
|
29
|
+
case 'alignCellMiddle':
|
|
30
|
+
case 'alignCellBottom':
|
|
31
|
+
alignTableCellVertically(tableModel, operation);
|
|
32
|
+
break;
|
|
33
|
+
case 'alignCenter':
|
|
34
|
+
case 'alignLeft':
|
|
35
|
+
case 'alignRight':
|
|
36
|
+
alignTable(tableModel, operation);
|
|
37
|
+
break;
|
|
38
|
+
case 'deleteColumn':
|
|
39
|
+
deleteTableColumn(tableModel);
|
|
40
|
+
break;
|
|
41
|
+
case 'deleteRow':
|
|
42
|
+
deleteTableRow(tableModel);
|
|
43
|
+
break;
|
|
44
|
+
case 'deleteTable':
|
|
45
|
+
deleteTable(tableModel);
|
|
46
|
+
break;
|
|
47
|
+
case 'insertAbove':
|
|
48
|
+
case 'insertBelow':
|
|
49
|
+
insertTableRow(tableModel, operation);
|
|
50
|
+
break;
|
|
51
|
+
case 'insertLeft':
|
|
52
|
+
case 'insertRight':
|
|
53
|
+
insertTableColumn(tableModel, operation);
|
|
54
|
+
break;
|
|
55
|
+
case 'mergeAbove':
|
|
56
|
+
case 'mergeBelow':
|
|
57
|
+
mergeTableRow(tableModel, operation);
|
|
58
|
+
break;
|
|
59
|
+
case 'mergeCells':
|
|
60
|
+
mergeTableCells(tableModel);
|
|
61
|
+
break;
|
|
62
|
+
case 'mergeLeft':
|
|
63
|
+
case 'mergeRight':
|
|
64
|
+
mergeTableColumn(tableModel, operation);
|
|
65
|
+
break;
|
|
66
|
+
case 'splitHorizontally':
|
|
67
|
+
splitTableCellHorizontally(tableModel);
|
|
68
|
+
break;
|
|
69
|
+
case 'splitVertically':
|
|
70
|
+
splitTableCellVertically(tableModel);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
75
|
//# sourceMappingURL=editTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/editTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAA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AAU,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAEV,KAAK,YAAY;gBACb,eAAe,CAAC,UAAU,CAAC,CAAC;gBAC5B,MAAM;YAEV,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBACb,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACxC,MAAM;YAEV,KAAK,mBAAmB;gBACpB,0BAA0B,CAAC,UAAU,CAAC,CAAC;gBACvC,MAAM;YAEV,KAAK,iBAAiB;gBAClB,wBAAwB,CAAC,UAAU,CAAC,CAAC;gBACrC,MAAM;SACb;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\
|
|
1
|
+
{"version":3,"file":"editTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/editTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AAEzF,OAAO,EACH,0BAA0B,EAC1B,wBAAwB,GAC3B,MAA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K,YAAY;gBACb,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACxC,MAAM;YAEV,KAAK,mBAAmB;gBACpB,0BAA0B,CAAC,UAAU,CAAC,CAAC;gBACvC,MAAM;YAEV,KAAK,iBAAiB;gBAClB,wBAAwB,CAAC,UAAU,CAAC,CAAC;gBACrC,MAAM;SACb;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\nimport { deleteTable } from '../../modelApi/table/deleteTable';\nimport { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';\nimport { deleteTableRow } from '../../modelApi/table/deleteTableRow';\nimport { formatTableWithContentModel } from '../utils/formatTableWithContentModel';\nimport { insertTableColumn } from '../../modelApi/table/insertTableColumn';\nimport { insertTableRow } from '../../modelApi/table/insertTableRow';\nimport { mergeTableCells } from '../../modelApi/table/mergeTableCells';\nimport { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';\nimport { mergeTableRow } from '../../modelApi/table/mergeTableRow';\nimport { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';\nimport { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';\nimport type { TableOperation, IStandaloneEditor } from 'roosterjs-content-model-types';\nimport {\n alignTableCellHorizontally,\n alignTableCellVertically,\n} from '../../modelApi/table/alignTableCell';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param operation The table operation to apply\n */\nexport default function editTable(editor: IStandaloneEditor, operation: TableOperation) {\n editor.focus();\n\n formatTableWithContentModel(editor, 'editTable', tableModel => {\n switch (operation) {\n case 'alignCellLeft':\n case 'alignCellCenter':\n case 'alignCellRight':\n alignTableCellHorizontally(tableModel, operation);\n break;\n case 'alignCellTop':\n case 'alignCellMiddle':\n case 'alignCellBottom':\n alignTableCellVertically(tableModel, operation);\n break;\n case 'alignCenter':\n case 'alignLeft':\n case 'alignRight':\n alignTable(tableModel, operation);\n break;\n\n case 'deleteColumn':\n deleteTableColumn(tableModel);\n break;\n\n case 'deleteRow':\n deleteTableRow(tableModel);\n break;\n\n case 'deleteTable':\n deleteTable(tableModel);\n break;\n\n case 'insertAbove':\n case 'insertBelow':\n insertTableRow(tableModel, operation);\n break;\n\n case 'insertLeft':\n case 'insertRight':\n insertTableColumn(tableModel, operation);\n break;\n\n case 'mergeAbove':\n case 'mergeBelow':\n mergeTableRow(tableModel, operation);\n break;\n\n case 'mergeCells':\n mergeTableCells(tableModel);\n break;\n\n case 'mergeLeft':\n case 'mergeRight':\n mergeTableColumn(tableModel, operation);\n break;\n\n case 'splitHorizontally':\n splitTableCellHorizontally(tableModel);\n break;\n\n case 'splitVertically':\n splitTableCellVertically(tableModel);\n break;\n }\n });\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Format current focused table with the given format
|
|
4
|
-
* @param editor The editor instance
|
|
5
|
-
* @param format The table format to apply
|
|
6
|
-
* @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
|
|
7
|
-
*/
|
|
8
|
-
export default function formatTable(editor: IStandaloneEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
|
|
1
|
+
import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Format current focused table with the given format
|
|
4
|
+
* @param editor The editor instance
|
|
5
|
+
* @param format The table format to apply
|
|
6
|
+
* @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
|
|
7
|
+
*/
|
|
8
|
+
export default function formatTable(editor: IStandaloneEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { applyTableFormat, getFirstSelectedTable, updateTableCellMetadata, } from 'roosterjs-content-model-core';
|
|
3
|
-
/**
|
|
4
|
-
* Format current focused table with the given format
|
|
5
|
-
* @param editor The editor instance
|
|
6
|
-
* @param format The table format to apply
|
|
7
|
-
* @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
|
|
8
|
-
*/
|
|
9
|
-
export default function formatTable(editor, format, keepCellShade) {
|
|
10
|
-
editor.focus();
|
|
11
|
-
editor.formatContentModel(function (model) {
|
|
12
|
-
var _a = __read(getFirstSelectedTable(model), 1), tableModel = _a[0];
|
|
13
|
-
if (tableModel) {
|
|
14
|
-
// Wipe border metadata
|
|
15
|
-
tableModel.rows.forEach(function (row) {
|
|
16
|
-
row.cells.forEach(function (cell) {
|
|
17
|
-
updateTableCellMetadata(cell, function (metadata) {
|
|
18
|
-
if (metadata) {
|
|
19
|
-
delete metadata.borderOverride;
|
|
20
|
-
}
|
|
21
|
-
return metadata;
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
applyTableFormat(tableModel, format, keepCellShade);
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
apiName: 'formatTable',
|
|
33
|
-
});
|
|
34
|
-
}
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
import { applyTableFormat, getFirstSelectedTable, updateTableCellMetadata, } from 'roosterjs-content-model-core';
|
|
3
|
+
/**
|
|
4
|
+
* Format current focused table with the given format
|
|
5
|
+
* @param editor The editor instance
|
|
6
|
+
* @param format The table format to apply
|
|
7
|
+
* @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
|
|
8
|
+
*/
|
|
9
|
+
export default function formatTable(editor, format, keepCellShade) {
|
|
10
|
+
editor.focus();
|
|
11
|
+
editor.formatContentModel(function (model) {
|
|
12
|
+
var _a = __read(getFirstSelectedTable(model), 1), tableModel = _a[0];
|
|
13
|
+
if (tableModel) {
|
|
14
|
+
// Wipe border metadata
|
|
15
|
+
tableModel.rows.forEach(function (row) {
|
|
16
|
+
row.cells.forEach(function (cell) {
|
|
17
|
+
updateTableCellMetadata(cell, function (metadata) {
|
|
18
|
+
if (metadata) {
|
|
19
|
+
delete metadata.borderOverride;
|
|
20
|
+
}
|
|
21
|
+
return metadata;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
applyTableFormat(tableModel, format, keepCellShade);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
apiName: 'formatTable',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=formatTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,MAAyB,EACzB,MAA2B,EAC3B,aAAuB;IAEvB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,uBAAuB;YACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,uBAAuB,CAAC,IAAI,EAAE,UAAA,QAAQ;wBAClC,IAAI,QAAQ,EAAE;4BACV,OAAO,QAAQ,CAAC,cAAc,CAAC;yBAClC;wBACD,OAAO,QAAQ,CAAC;oBACpB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\
|
|
1
|
+
{"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,MAAyB,EACzB,MAA2B,EAC3B,aAAuB;IAEvB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,uBAAuB;YACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,uBAAuB,CAAC,IAAI,EAAE,UAAA,QAAQ;wBAClC,IAAI,QAAQ,EAAE;4BACV,OAAO,QAAQ,CAAC,cAAc,CAAC;yBAClC;wBACD,OAAO,QAAQ,CAAC;oBACpB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\n applyTableFormat,\n getFirstSelectedTable,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param format The table format to apply\n * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color\n */\nexport default function formatTable(\n editor: IStandaloneEditor,\n format: TableMetadataFormat,\n keepCellShade?: boolean\n) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n // Wipe border metadata\n tableModel.rows.forEach(row => {\n row.cells.forEach(cell => {\n updateTableCellMetadata(cell, metadata => {\n if (metadata) {\n delete metadata.borderOverride;\n }\n return metadata;\n });\n });\n });\n applyTableFormat(tableModel, format, keepCellShade);\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'formatTable',\n }\n );\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Insert table into editor at current selection
|
|
4
|
-
* @param editor The editor instance
|
|
5
|
-
* @param columns Number of columns in table, it also controls the default table cell width:
|
|
6
|
-
* if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px
|
|
7
|
-
* @param rows Number of rows in table
|
|
8
|
-
* @param format (Optional) The table format. If not passed, the default format will be applied:
|
|
9
|
-
* background color: #FFF; border color: #ABABAB
|
|
10
|
-
*/
|
|
11
|
-
export default function insertTable(editor: IStandaloneEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
|
|
1
|
+
import type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Insert table into editor at current selection
|
|
4
|
+
* @param editor The editor instance
|
|
5
|
+
* @param columns Number of columns in table, it also controls the default table cell width:
|
|
6
|
+
* if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px
|
|
7
|
+
* @param rows Number of rows in table
|
|
8
|
+
* @param format (Optional) The table format. If not passed, the default format will be applied:
|
|
9
|
+
* background color: #FFF; border color: #ABABAB
|
|
10
|
+
*/
|
|
11
|
+
export default function insertTable(editor: IStandaloneEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';
|
|
2
|
-
import { createTableStructure } from '../../modelApi/table/createTableStructure';
|
|
3
|
-
import { applyTableFormat, deleteSelection, mergeModel, normalizeTable, setSelection, } from 'roosterjs-content-model-core';
|
|
4
|
-
/**
|
|
5
|
-
* Insert table into editor at current selection
|
|
6
|
-
* @param editor The editor instance
|
|
7
|
-
* @param columns Number of columns in table, it also controls the default table cell width:
|
|
8
|
-
* if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px
|
|
9
|
-
* @param rows Number of rows in table
|
|
10
|
-
* @param format (Optional) The table format. If not passed, the default format will be applied:
|
|
11
|
-
* background color: #FFF; border color: #ABABAB
|
|
12
|
-
*/
|
|
13
|
-
export default function insertTable(editor, columns, rows, format) {
|
|
14
|
-
editor.focus();
|
|
15
|
-
editor.formatContentModel(function (model, context) {
|
|
16
|
-
var _a, _b, _c;
|
|
17
|
-
var insertPosition = deleteSelection(model, [], context).insertPoint;
|
|
18
|
-
if (insertPosition) {
|
|
19
|
-
var doc = createContentModelDocument();
|
|
20
|
-
var table = createTableStructure(doc, columns, rows);
|
|
21
|
-
normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);
|
|
22
|
-
// Assign default vertical align
|
|
23
|
-
format = format || { verticalAlign: 'top' };
|
|
24
|
-
applyTableFormat(table, format);
|
|
25
|
-
mergeModel(model, doc, context, {
|
|
26
|
-
insertPosition: insertPosition,
|
|
27
|
-
mergeFormat: 'mergeAll',
|
|
28
|
-
});
|
|
29
|
-
var firstBlock = (_b = (_a = table.rows[0]) === null || _a === void 0 ? void 0 : _a.cells[0]) === null || _b === void 0 ? void 0 : _b.blocks[0];
|
|
30
|
-
if ((firstBlock === null || firstBlock === void 0 ? void 0 : firstBlock.blockType) == 'Paragraph') {
|
|
31
|
-
var marker = createSelectionMarker((_c = firstBlock.segments[0]) === null || _c === void 0 ? void 0 : _c.format);
|
|
32
|
-
firstBlock.segments.unshift(marker);
|
|
33
|
-
setSelection(model, marker);
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
apiName: 'insertTable',
|
|
42
|
-
});
|
|
43
|
-
}
|
|
1
|
+
import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';
|
|
2
|
+
import { createTableStructure } from '../../modelApi/table/createTableStructure';
|
|
3
|
+
import { applyTableFormat, deleteSelection, mergeModel, normalizeTable, setSelection, } from 'roosterjs-content-model-core';
|
|
4
|
+
/**
|
|
5
|
+
* Insert table into editor at current selection
|
|
6
|
+
* @param editor The editor instance
|
|
7
|
+
* @param columns Number of columns in table, it also controls the default table cell width:
|
|
8
|
+
* if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px
|
|
9
|
+
* @param rows Number of rows in table
|
|
10
|
+
* @param format (Optional) The table format. If not passed, the default format will be applied:
|
|
11
|
+
* background color: #FFF; border color: #ABABAB
|
|
12
|
+
*/
|
|
13
|
+
export default function insertTable(editor, columns, rows, format) {
|
|
14
|
+
editor.focus();
|
|
15
|
+
editor.formatContentModel(function (model, context) {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
var insertPosition = deleteSelection(model, [], context).insertPoint;
|
|
18
|
+
if (insertPosition) {
|
|
19
|
+
var doc = createContentModelDocument();
|
|
20
|
+
var table = createTableStructure(doc, columns, rows);
|
|
21
|
+
normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);
|
|
22
|
+
// Assign default vertical align
|
|
23
|
+
format = format || { verticalAlign: 'top' };
|
|
24
|
+
applyTableFormat(table, format);
|
|
25
|
+
mergeModel(model, doc, context, {
|
|
26
|
+
insertPosition: insertPosition,
|
|
27
|
+
mergeFormat: 'mergeAll',
|
|
28
|
+
});
|
|
29
|
+
var firstBlock = (_b = (_a = table.rows[0]) === null || _a === void 0 ? void 0 : _a.cells[0]) === null || _b === void 0 ? void 0 : _b.blocks[0];
|
|
30
|
+
if ((firstBlock === null || firstBlock === void 0 ? void 0 : firstBlock.blockType) == 'Paragraph') {
|
|
31
|
+
var marker = createSelectionMarker((_c = firstBlock.segments[0]) === null || _c === void 0 ? void 0 : _c.format);
|
|
32
|
+
firstBlock.segments.unshift(marker);
|
|
33
|
+
setSelection(model, marker);
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
apiName: 'insertTable',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
44
|
//# sourceMappingURL=insertTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,GACf,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,MAAyB,EACzB,OAAe,EACf,IAAY,EACZ,MAAqC;IAErC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;;QACX,IAAM,cA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version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,GACf,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,MAAyB,EACzB,OAAe,EACf,IAAY,EACZ,MAAqC;IAErC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;;QACX,IAAM,cAAc,GAAG,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,WAAW,CAAC;QAEvE,IAAI,cAAc,EAAE;YAChB,IAAM,GAAG,GAAG,0BAA0B,EAAE,CAAC;YACzC,IAAM,KAAK,GAAG,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAEvD,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACjF,gCAAgC;YAChC,MAAM,GAAG,MAAM,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;YAC5C,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAChC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;gBAC5B,cAAc,gBAAA;gBACd,WAAW,EAAE,UAAU;aAC1B,CAAC,CAAC;YAEH,IAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAEtD,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,KAAI,WAAW,EAAE;gBACtC,IAAM,MAAM,GAAG,qBAAqB,CAAC,MAAA,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC;gBACrE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aAC/B;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { createTableStructure } from '../../modelApi/table/createTableStructure';\nimport {\n applyTableFormat,\n deleteSelection,\n mergeModel,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Insert table into editor at current selection\n * @param editor The editor instance\n * @param columns Number of columns in table, it also controls the default table cell width:\n * if columns <= 4, width = 120px; if columns <= 6, width = 100px; else width = 70px\n * @param rows Number of rows in table\n * @param format (Optional) The table format. If not passed, the default format will be applied:\n * background color: #FFF; border color: #ABABAB\n */\nexport default function insertTable(\n editor: IStandaloneEditor,\n columns: number,\n rows: number,\n format?: Partial<TableMetadataFormat>\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const insertPosition = deleteSelection(model, [], context).insertPoint;\n\n if (insertPosition) {\n const doc = createContentModelDocument();\n const table = createTableStructure(doc, columns, rows);\n\n normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);\n // Assign default vertical align\n format = format || { verticalAlign: 'top' };\n applyTableFormat(table, format);\n mergeModel(model, doc, context, {\n insertPosition,\n mergeFormat: 'mergeAll',\n });\n\n const firstBlock = table.rows[0]?.cells[0]?.blocks[0];\n\n if (firstBlock?.blockType == 'Paragraph') {\n const marker = createSelectionMarker(firstBlock.segments[0]?.format);\n firstBlock.segments.unshift(marker);\n setSelection(model, marker);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'insertTable',\n }\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Set table cell shade color
|
|
4
|
-
* @param editor The editor instance
|
|
5
|
-
* @param color The color to set. Pass null to remove existing shade color
|
|
6
|
-
*/
|
|
7
|
-
export default function setTableCellShade(editor: IStandaloneEditor, color: string | null): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set table cell shade color
|
|
4
|
+
* @param editor The editor instance
|
|
5
|
+
* @param color The color to set. Pass null to remove existing shade color
|
|
6
|
+
*/
|
|
7
|
+
export default function setTableCellShade(editor: IStandaloneEditor, color: string | null): void;
|