roosterjs-content-model-api 0.26.0 → 0.26.2
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,117 +1,117 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';
|
|
3
|
-
import { ChangeSource, getSelectedSegments, mergeModel } from 'roosterjs-content-model-core';
|
|
4
|
-
import { matchLink } from '../../modelApi/link/matchLink';
|
|
5
|
-
import { addLink, addSegment, createContentModelDocument, createText, } from 'roosterjs-content-model-dom';
|
|
6
|
-
// Regex matching Uri scheme
|
|
7
|
-
var URI_REGEX = /^[a-zA-Z]+:/i;
|
|
8
|
-
// Regex matching begin of email address
|
|
9
|
-
var MAILTO_REGEX = /^[\w.%+-]+@/i;
|
|
10
|
-
// Regex matching begin of ftp, i.e. ftp.microsoft.com
|
|
11
|
-
var FTP_REGEX = /^ftp\./i;
|
|
12
|
-
/**
|
|
13
|
-
* Insert a hyperlink at cursor.
|
|
14
|
-
* When there is a selection, hyperlink will be applied to the selection,
|
|
15
|
-
* otherwise a hyperlink will be inserted to the cursor position.
|
|
16
|
-
* @param editor Editor object
|
|
17
|
-
* @param link Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais.
|
|
18
|
-
* When protocol is not specified, a best matched protocol will be predicted.
|
|
19
|
-
* @param anchorTitle Optional alt text of the link, will be shown when hover on the link
|
|
20
|
-
* @param displayText Optional display text for the link.
|
|
21
|
-
* @param target Optional display target for the link ("_blank"|"_self"|"_parent"|"_top"|"{framename}")
|
|
22
|
-
* If specified, the display text of link will be replaced with this text.
|
|
23
|
-
* If not specified and there wasn't a link, the link url will be used as display text.
|
|
24
|
-
*/
|
|
25
|
-
export default function insertLink(editor, link, anchorTitle, displayText, target) {
|
|
26
|
-
editor.focus();
|
|
27
|
-
var url = (checkXss(link) || '').trim();
|
|
28
|
-
if (url) {
|
|
29
|
-
var linkData_1 = matchLink(url);
|
|
30
|
-
var linkUrl_1 = linkData_1 ? linkData_1.normalizedUrl : applyLinkPrefix(url);
|
|
31
|
-
var links_1 = [];
|
|
32
|
-
var anchorNode_1;
|
|
33
|
-
editor.formatContentModel(function (model, context) {
|
|
34
|
-
var _a;
|
|
35
|
-
var segments = getSelectedSegments(model, false /*includingFormatHolder*/);
|
|
36
|
-
var originalText = segments
|
|
37
|
-
.map(function (x) { return (x.segmentType == 'Text' ? x.text : ''); })
|
|
38
|
-
.join('');
|
|
39
|
-
var text = displayText || originalText || '';
|
|
40
|
-
if (segments.some(function (x) { return x.segmentType != 'SelectionMarker'; }) &&
|
|
41
|
-
originalText == text) {
|
|
42
|
-
segments.forEach(function (x) {
|
|
43
|
-
var link = createLink(linkUrl_1, anchorTitle, target, x.segmentType == 'Text');
|
|
44
|
-
addLink(x, link);
|
|
45
|
-
if (x.link) {
|
|
46
|
-
links_1.push(x.link);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
else if (segments.every(function (x) { return x.segmentType == 'SelectionMarker'; }) ||
|
|
51
|
-
(!!text && text != originalText)) {
|
|
52
|
-
var segment = createText(text || (linkData_1 ? linkData_1.originalUrl : url), __assign(__assign({}, (_a = segments[0]) === null || _a === void 0 ? void 0 : _a.format), editor.getPendingFormat()));
|
|
53
|
-
var doc = createContentModelDocument();
|
|
54
|
-
var link_1 = createLink(linkUrl_1, anchorTitle, target);
|
|
55
|
-
addLink(segment, link_1);
|
|
56
|
-
addSegment(doc, segment);
|
|
57
|
-
if (segment.link) {
|
|
58
|
-
links_1.push(segment.link);
|
|
59
|
-
}
|
|
60
|
-
mergeModel(model, doc, context, {
|
|
61
|
-
mergeFormat: 'mergeAll',
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
adjustTrailingSpaceSelection(model);
|
|
65
|
-
return segments.length > 0;
|
|
66
|
-
}, {
|
|
67
|
-
changeSource: ChangeSource.CreateLink,
|
|
68
|
-
onNodeCreated: function (modelElement, node) {
|
|
69
|
-
if (!anchorNode_1 && links_1.indexOf(modelElement) >= 0) {
|
|
70
|
-
anchorNode_1 = node;
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
getChangeData: function () { return anchorNode_1; },
|
|
74
|
-
apiName: 'insertLink',
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
var createLink = function (url, anchorTitle, target, underline) {
|
|
79
|
-
if (underline === void 0) { underline = true; }
|
|
80
|
-
return {
|
|
81
|
-
dataset: {},
|
|
82
|
-
format: {
|
|
83
|
-
href: url,
|
|
84
|
-
anchorTitle: anchorTitle,
|
|
85
|
-
target: target,
|
|
86
|
-
underline: underline,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
function applyLinkPrefix(url) {
|
|
91
|
-
if (!url) {
|
|
92
|
-
return url;
|
|
93
|
-
}
|
|
94
|
-
// Add link prefix per rule:
|
|
95
|
-
// (a) if the url always starts with a URI scheme, leave it as it is
|
|
96
|
-
// (b) if the url is an email address, xxx@... add mailto: prefix
|
|
97
|
-
// (c) if the url starts with ftp., add ftp:// prefix
|
|
98
|
-
// (d) rest, add http:// prefix
|
|
99
|
-
var prefix = '';
|
|
100
|
-
if (url.search(URI_REGEX) < 0) {
|
|
101
|
-
if (url.search(MAILTO_REGEX) == 0) {
|
|
102
|
-
prefix = 'mailto:';
|
|
103
|
-
}
|
|
104
|
-
else if (url.search(FTP_REGEX) == 0) {
|
|
105
|
-
prefix = 'ftp://';
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
// fallback to http://
|
|
109
|
-
prefix = 'http://';
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return prefix + url;
|
|
113
|
-
}
|
|
114
|
-
function checkXss(link) {
|
|
115
|
-
return link.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i) ? '' : link;
|
|
116
|
-
}
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';
|
|
3
|
+
import { ChangeSource, getSelectedSegments, mergeModel } from 'roosterjs-content-model-core';
|
|
4
|
+
import { matchLink } from '../../modelApi/link/matchLink';
|
|
5
|
+
import { addLink, addSegment, createContentModelDocument, createText, } from 'roosterjs-content-model-dom';
|
|
6
|
+
// Regex matching Uri scheme
|
|
7
|
+
var URI_REGEX = /^[a-zA-Z]+:/i;
|
|
8
|
+
// Regex matching begin of email address
|
|
9
|
+
var MAILTO_REGEX = /^[\w.%+-]+@/i;
|
|
10
|
+
// Regex matching begin of ftp, i.e. ftp.microsoft.com
|
|
11
|
+
var FTP_REGEX = /^ftp\./i;
|
|
12
|
+
/**
|
|
13
|
+
* Insert a hyperlink at cursor.
|
|
14
|
+
* When there is a selection, hyperlink will be applied to the selection,
|
|
15
|
+
* otherwise a hyperlink will be inserted to the cursor position.
|
|
16
|
+
* @param editor Editor object
|
|
17
|
+
* @param link Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais.
|
|
18
|
+
* When protocol is not specified, a best matched protocol will be predicted.
|
|
19
|
+
* @param anchorTitle Optional alt text of the link, will be shown when hover on the link
|
|
20
|
+
* @param displayText Optional display text for the link.
|
|
21
|
+
* @param target Optional display target for the link ("_blank"|"_self"|"_parent"|"_top"|"{framename}")
|
|
22
|
+
* If specified, the display text of link will be replaced with this text.
|
|
23
|
+
* If not specified and there wasn't a link, the link url will be used as display text.
|
|
24
|
+
*/
|
|
25
|
+
export default function insertLink(editor, link, anchorTitle, displayText, target) {
|
|
26
|
+
editor.focus();
|
|
27
|
+
var url = (checkXss(link) || '').trim();
|
|
28
|
+
if (url) {
|
|
29
|
+
var linkData_1 = matchLink(url);
|
|
30
|
+
var linkUrl_1 = linkData_1 ? linkData_1.normalizedUrl : applyLinkPrefix(url);
|
|
31
|
+
var links_1 = [];
|
|
32
|
+
var anchorNode_1;
|
|
33
|
+
editor.formatContentModel(function (model, context) {
|
|
34
|
+
var _a;
|
|
35
|
+
var segments = getSelectedSegments(model, false /*includingFormatHolder*/);
|
|
36
|
+
var originalText = segments
|
|
37
|
+
.map(function (x) { return (x.segmentType == 'Text' ? x.text : ''); })
|
|
38
|
+
.join('');
|
|
39
|
+
var text = displayText || originalText || '';
|
|
40
|
+
if (segments.some(function (x) { return x.segmentType != 'SelectionMarker'; }) &&
|
|
41
|
+
originalText == text) {
|
|
42
|
+
segments.forEach(function (x) {
|
|
43
|
+
var link = createLink(linkUrl_1, anchorTitle, target, x.segmentType == 'Text');
|
|
44
|
+
addLink(x, link);
|
|
45
|
+
if (x.link) {
|
|
46
|
+
links_1.push(x.link);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else if (segments.every(function (x) { return x.segmentType == 'SelectionMarker'; }) ||
|
|
51
|
+
(!!text && text != originalText)) {
|
|
52
|
+
var segment = createText(text || (linkData_1 ? linkData_1.originalUrl : url), __assign(__assign({}, (_a = segments[0]) === null || _a === void 0 ? void 0 : _a.format), editor.getPendingFormat()));
|
|
53
|
+
var doc = createContentModelDocument();
|
|
54
|
+
var link_1 = createLink(linkUrl_1, anchorTitle, target);
|
|
55
|
+
addLink(segment, link_1);
|
|
56
|
+
addSegment(doc, segment);
|
|
57
|
+
if (segment.link) {
|
|
58
|
+
links_1.push(segment.link);
|
|
59
|
+
}
|
|
60
|
+
mergeModel(model, doc, context, {
|
|
61
|
+
mergeFormat: 'mergeAll',
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
adjustTrailingSpaceSelection(model);
|
|
65
|
+
return segments.length > 0;
|
|
66
|
+
}, {
|
|
67
|
+
changeSource: ChangeSource.CreateLink,
|
|
68
|
+
onNodeCreated: function (modelElement, node) {
|
|
69
|
+
if (!anchorNode_1 && links_1.indexOf(modelElement) >= 0) {
|
|
70
|
+
anchorNode_1 = node;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
getChangeData: function () { return anchorNode_1; },
|
|
74
|
+
apiName: 'insertLink',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
var createLink = function (url, anchorTitle, target, underline) {
|
|
79
|
+
if (underline === void 0) { underline = true; }
|
|
80
|
+
return {
|
|
81
|
+
dataset: {},
|
|
82
|
+
format: {
|
|
83
|
+
href: url,
|
|
84
|
+
anchorTitle: anchorTitle,
|
|
85
|
+
target: target,
|
|
86
|
+
underline: underline,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
function applyLinkPrefix(url) {
|
|
91
|
+
if (!url) {
|
|
92
|
+
return url;
|
|
93
|
+
}
|
|
94
|
+
// Add link prefix per rule:
|
|
95
|
+
// (a) if the url always starts with a URI scheme, leave it as it is
|
|
96
|
+
// (b) if the url is an email address, xxx@... add mailto: prefix
|
|
97
|
+
// (c) if the url starts with ftp., add ftp:// prefix
|
|
98
|
+
// (d) rest, add http:// prefix
|
|
99
|
+
var prefix = '';
|
|
100
|
+
if (url.search(URI_REGEX) < 0) {
|
|
101
|
+
if (url.search(MAILTO_REGEX) == 0) {
|
|
102
|
+
prefix = 'mailto:';
|
|
103
|
+
}
|
|
104
|
+
else if (url.search(FTP_REGEX) == 0) {
|
|
105
|
+
prefix = 'ftp://';
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
// fallback to http://
|
|
109
|
+
prefix = 'http://';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return prefix + url;
|
|
113
|
+
}
|
|
114
|
+
function checkXss(link) {
|
|
115
|
+
return link.match(/s\n*c\n*r\n*i\n*p\n*t\n*:/i) ? '' : link;
|
|
116
|
+
}
|
|
117
117
|
//# sourceMappingURL=insertLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EACH,OAAO,EACP,UAAU,EACV,0BAA0B,EAC1B,UAAU,GACb,MAAM,6BAA6B,CAAC;AAErC,4BAA4B;AAC5B,IAAM,SAAS,GAAG,cAAc,CAAC;AACjC,wCAAwC;AACxC,IAAM,YAAY,GAAG,cAAc,CAAC;AACpC,sDAAsD;AACtD,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAC9B,MAAyB,EACzB,IAAY,EACZ,WAAoB,EACpB,WAAoB,EACpB,MAAe;IAEf,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,GAAG,EAAE;QACL,IAAM,UAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;QAChC,IAAM,SAAO,GAAG,UAAQ,CAAC,CAAC,CAAC,UAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QACzE,IAAM,OAAK,GAAuB,EAAE,CAAC;QACrC,IAAI,YAA4B,CAAC;QAEjC,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;;YACX,IAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC7E,IAAM,YAAY,GAAG,QAAQ;iBACxB,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAvC,CAAuC,CAAC;iBACjD,IAAI,CAAC,EAAE,CAAC,CAAC;YACd,IAAM,IAAI,GAAG,WAAW,IAAI,YAAY,IAAI,EAAE,CAAC;YAE/C,IACI,QAAQ,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,IAAI,iBAAiB,EAAlC,CAAkC,CAAC;gBACtD,YAAY,IAAI,IAAI,EACtB;gBACE,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC;oBACd,IAAM,IAAI,GAAG,UAAU,CACnB,SAAO,EACP,WAAW,EACX,MAAM,EACN,CAAC,CAAC,WAAW,IAAI,MAAM,CAC1B,CAAC;oBACF,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;oBACjB,IAAI,CAAC,CAAC,IAAI,EAAE;wBACR,OAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;qBACtB;gBACL,CAAC,CAAC,CAAC;aACN;iBAAM,IACH,QAAQ,CAAC,KAAK,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,IAAI,iBAAiB,EAAlC,CAAkC,CAAC;gBACvD,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,YAAY,CAAC,EAClC;gBACE,IAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,CAAC,UAAQ,CAAC,CAAC,CAAC,UAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,wBACnE,MAAA,QAAQ,CAAC,CAAC,CAAC,0CAAE,MAAM,GACnB,MAAM,CAAC,gBAAgB,EAAE,EAC9B,CAAC;gBACH,IAAM,GAAG,GAAG,0BAA0B,EAAE,CAAC;gBACzC,IAAM,MAAI,GAAG,UAAU,CAAC,SAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;gBAEtD,OAAO,CAAC,OAAO,EAAE,MAAI,CAAC,CAAC;gBACvB,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAEzB,IAAI,OAAO,CAAC,IAAI,EAAE;oBACd,OAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBAC5B;gBAED,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;oBAC5B,WAAW,EAAE,UAAU;iBAC1B,CAAC,CAAC;aACN;YAED,4BAA4B,CAAC,KAAK,CAAC,CAAC;YACpC,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/B,CAAC,EACD;YACI,YAAY,EAAE,YAAY,CAAC,UAAU;YACrC,aAAa,EAAE,UAAC,YAAY,EAAE,IAAI;gBAC9B,IAAI,CAAC,YAAU,IAAI,OAAK,CAAC,OAAO,CAAC,YAAgC,CAAC,IAAI,CAAC,EAAE;oBACrE,YAAU,GAAG,IAAI,CAAC;iBACrB;YACL,CAAC;YACD,aAAa,EAAE,cAAM,OAAA,YAAU,EAAV,CAAU;YAC/B,OAAO,EAAE,YAAY;SACxB,CACJ,CAAC;KACL;AACL,CAAC;AAED,IAAM,UAAU,GAAG,UACf,GAAW,EACX,WAAoB,EACpB,MAAe,EACf,SAAyB;IAAzB,0BAAA,EAAA,gBAAyB;IAEzB,OAAO;QACH,OAAO,EAAE,EAAE;QACX,MAAM,EAAE;YACJ,IAAI,EAAE,GAAG;YACT,WAAW,aAAA;YACX,MAAM,QAAA;YACN,SAAS,EAAE,SAAS;SACvB;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,GAAG,CAAC;KACd;IAED,4BAA4B;IAC5B,oEAAoE;IACpE,iEAAiE;IACjE,qDAAqD;IACrD,+BAA+B;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QAC3B,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,GAAG,SAAS,CAAC;SACtB;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;YACnC,MAAM,GAAG,QAAQ,CAAC;SACrB;aAAM;YACH,sBAAsB;YACtB,MAAM,GAAG,SAAS,CAAC;SACtB;KACJ;IAED,OAAO,MAAM,GAAG,GAAG,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\
|
|
1
|
+
{"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":"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","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { ChangeSource, getSelectedSegments, mergeModel } from 'roosterjs-content-model-core';\nimport { matchLink } from '../../modelApi/link/matchLink';\nimport type { ContentModelLink, IStandaloneEditor } from 'roosterjs-content-model-types';\nimport {\n addLink,\n addSegment,\n createContentModelDocument,\n createText,\n} from 'roosterjs-content-model-dom';\n\n// Regex matching Uri scheme\nconst URI_REGEX = /^[a-zA-Z]+:/i;\n// Regex matching begin of email address\nconst MAILTO_REGEX = /^[\\w.%+-]+@/i;\n// Regex matching begin of ftp, i.e. ftp.microsoft.com\nconst FTP_REGEX = /^ftp\\./i;\n\n/**\n * Insert a hyperlink at cursor.\n * When there is a selection, hyperlink will be applied to the selection,\n * otherwise a hyperlink will be inserted to the cursor position.\n * @param editor Editor object\n * @param link Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais.\n * When protocol is not specified, a best matched protocol will be predicted.\n * @param anchorTitle Optional alt text of the link, will be shown when hover on the link\n * @param displayText Optional display text for the link.\n * @param target Optional display target for the link (\"_blank\"|\"_self\"|\"_parent\"|\"_top\"|\"{framename}\")\n * If specified, the display text of link will be replaced with this text.\n * If not specified and there wasn't a link, the link url will be used as display text.\n */\nexport default function insertLink(\n editor: IStandaloneEditor,\n link: string,\n anchorTitle?: string,\n displayText?: string,\n target?: string\n) {\n editor.focus();\n\n const url = (checkXss(link) || '').trim();\n if (url) {\n const linkData = matchLink(url);\n const linkUrl = linkData ? linkData.normalizedUrl : applyLinkPrefix(url);\n const links: ContentModelLink[] = [];\n let anchorNode: Node | undefined;\n\n editor.formatContentModel(\n (model, context) => {\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n const originalText = segments\n .map(x => (x.segmentType == 'Text' ? x.text : ''))\n .join('');\n const text = displayText || originalText || '';\n\n if (\n segments.some(x => x.segmentType != 'SelectionMarker') &&\n originalText == text\n ) {\n segments.forEach(x => {\n const link = createLink(\n linkUrl,\n anchorTitle,\n target,\n x.segmentType == 'Text'\n );\n addLink(x, link);\n if (x.link) {\n links.push(x.link);\n }\n });\n } else if (\n segments.every(x => x.segmentType == 'SelectionMarker') ||\n (!!text && text != originalText)\n ) {\n const segment = createText(text || (linkData ? linkData.originalUrl : url), {\n ...segments[0]?.format,\n ...editor.getPendingFormat(),\n });\n const doc = createContentModelDocument();\n const link = createLink(linkUrl, anchorTitle, target);\n\n addLink(segment, link);\n addSegment(doc, segment);\n\n if (segment.link) {\n links.push(segment.link);\n }\n\n mergeModel(model, doc, context, {\n mergeFormat: 'mergeAll',\n });\n }\n\n adjustTrailingSpaceSelection(model);\n return segments.length > 0;\n },\n {\n changeSource: ChangeSource.CreateLink,\n onNodeCreated: (modelElement, node) => {\n if (!anchorNode && links.indexOf(modelElement as ContentModelLink) >= 0) {\n anchorNode = node;\n }\n },\n getChangeData: () => anchorNode,\n apiName: 'insertLink',\n }\n );\n }\n}\n\nconst createLink = (\n url: string,\n anchorTitle?: string,\n target?: string,\n underline: boolean = true\n): ContentModelLink => {\n return {\n dataset: {},\n format: {\n href: url,\n anchorTitle,\n target,\n underline: underline,\n },\n };\n};\n\nfunction applyLinkPrefix(url: string): string {\n if (!url) {\n return url;\n }\n\n // Add link prefix per rule:\n // (a) if the url always starts with a URI scheme, leave it as it is\n // (b) if the url is an email address, xxx@... add mailto: prefix\n // (c) if the url starts with ftp., add ftp:// prefix\n // (d) rest, add http:// prefix\n let prefix = '';\n if (url.search(URI_REGEX) < 0) {\n if (url.search(MAILTO_REGEX) == 0) {\n prefix = 'mailto:';\n } else if (url.search(FTP_REGEX) == 0) {\n prefix = 'ftp://';\n } else {\n // fallback to http://\n prefix = 'http://';\n }\n }\n\n return prefix + url;\n}\n\nfunction checkXss(link: string): string {\n return link.match(/s\\n*c\\n*r\\n*i\\n*p\\n*t\\n*:/i) ? '' : link;\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Remove link at selection. If no links at selection, do nothing.
|
|
4
|
-
* If selection contains multiple links, all of the link styles will be removed.
|
|
5
|
-
* If only part of a link is selected, the whole link style will be removed.
|
|
6
|
-
* @param editor The editor instance
|
|
7
|
-
*/
|
|
8
|
-
export default function removeLink(editor: IStandaloneEditor): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Remove link at selection. If no links at selection, do nothing.
|
|
4
|
+
* If selection contains multiple links, all of the link styles will be removed.
|
|
5
|
+
* If only part of a link is selected, the whole link style will be removed.
|
|
6
|
+
* @param editor The editor instance
|
|
7
|
+
*/
|
|
8
|
+
export default function removeLink(editor: IStandaloneEditor): void;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';
|
|
2
|
-
import { getSelectedSegments } from 'roosterjs-content-model-core';
|
|
3
|
-
/**
|
|
4
|
-
* Remove link at selection. If no links at selection, do nothing.
|
|
5
|
-
* If selection contains multiple links, all of the link styles will be removed.
|
|
6
|
-
* If only part of a link is selected, the whole link style will be removed.
|
|
7
|
-
* @param editor The editor instance
|
|
8
|
-
*/
|
|
9
|
-
export default function removeLink(editor) {
|
|
10
|
-
editor.focus();
|
|
11
|
-
editor.formatContentModel(function (model) {
|
|
12
|
-
adjustSegmentSelection(model, function (target) { return !!target.isSelected && !!target.link; }, function (target, ref) {
|
|
13
|
-
return target.isSelected || // Expand the selection to any link that is involved. So we can remove multiple links together
|
|
14
|
-
(!!target.link && target.link.format.href == ref.link.format.href);
|
|
15
|
-
});
|
|
16
|
-
var segments = getSelectedSegments(model, false /*includingFormatHolder*/);
|
|
17
|
-
var isChanged = false;
|
|
18
|
-
segments.forEach(function (segment) {
|
|
19
|
-
if (segment.link) {
|
|
20
|
-
isChanged = true;
|
|
21
|
-
delete segment.link;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return isChanged;
|
|
25
|
-
}, {
|
|
26
|
-
apiName: 'removeLink',
|
|
27
|
-
});
|
|
28
|
-
}
|
|
1
|
+
import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';
|
|
2
|
+
import { getSelectedSegments } from 'roosterjs-content-model-core';
|
|
3
|
+
/**
|
|
4
|
+
* Remove link at selection. If no links at selection, do nothing.
|
|
5
|
+
* If selection contains multiple links, all of the link styles will be removed.
|
|
6
|
+
* If only part of a link is selected, the whole link style will be removed.
|
|
7
|
+
* @param editor The editor instance
|
|
8
|
+
*/
|
|
9
|
+
export default function removeLink(editor) {
|
|
10
|
+
editor.focus();
|
|
11
|
+
editor.formatContentModel(function (model) {
|
|
12
|
+
adjustSegmentSelection(model, function (target) { return !!target.isSelected && !!target.link; }, function (target, ref) {
|
|
13
|
+
return target.isSelected || // Expand the selection to any link that is involved. So we can remove multiple links together
|
|
14
|
+
(!!target.link && target.link.format.href == ref.link.format.href);
|
|
15
|
+
});
|
|
16
|
+
var segments = getSelectedSegments(model, false /*includingFormatHolder*/);
|
|
17
|
+
var isChanged = false;
|
|
18
|
+
segments.forEach(function (segment) {
|
|
19
|
+
if (segment.link) {
|
|
20
|
+
isChanged = true;
|
|
21
|
+
delete segment.link;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return isChanged;
|
|
25
|
+
}, {
|
|
26
|
+
apiName: 'removeLink',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=removeLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAyB;IACxD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,sBAAsB,CAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;YACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;gBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QADnE,CACmE,CAC1E,CAAC;QAEF,IAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YACpB,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,SAAS,GAAG,IAAI,CAAC;gBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACrB,CAAC,EACD;QACI,OAAO,EAAE,YAAY;KACxB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\
|
|
1
|
+
{"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAyB;IACxD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,sBAAsB,CAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;YACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;gBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QADnE,CACmE,CAC1E,CAAC;QAEF,IAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YACpB,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,SAAS,GAAG,IAAI,CAAC;gBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACrB,CAAC,EACD;QACI,OAAO,EAAE,YAAY;KACxB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { getSelectedSegments } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Remove link at selection. If no links at selection, do nothing.\n * If selection contains multiple links, all of the link styles will be removed.\n * If only part of a link is selected, the whole link style will be removed.\n * @param editor The editor instance\n */\nexport default function removeLink(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n adjustSegmentSelection(\n model,\n target => !!target.isSelected && !!target.link,\n (target, ref) =>\n target.isSelected || // Expand the selection to any link that is involved. So we can remove multiple links together\n (!!target.link && target.link.format.href == ref.link!.format.href)\n );\n\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n let isChanged = false;\n\n segments.forEach(segment => {\n if (segment.link) {\n isChanged = true;\n\n delete segment.link;\n }\n });\n\n return isChanged;\n },\n {\n apiName: 'removeLink',\n }\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Set start number of a list item
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param value The number to set to, must be equal or greater than 1
|
|
6
|
-
*/
|
|
7
|
-
export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set start number of a list item
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param value The number to set to, must be equal or greater than 1
|
|
6
|
+
*/
|
|
7
|
+
export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { getFirstSelectedListItem } from 'roosterjs-content-model-core';
|
|
2
|
-
/**
|
|
3
|
-
* Set start number of a list item
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param value The number to set to, must be equal or greater than 1
|
|
6
|
-
*/
|
|
7
|
-
export default function setListStartNumber(editor, value) {
|
|
8
|
-
editor.focus();
|
|
9
|
-
editor.formatContentModel(function (model) {
|
|
10
|
-
var listItem = getFirstSelectedListItem(model);
|
|
11
|
-
var level = listItem === null || listItem === void 0 ? void 0 : listItem.levels[(listItem === null || listItem === void 0 ? void 0 : listItem.levels.length) - 1];
|
|
12
|
-
if (level) {
|
|
13
|
-
level.format.startNumberOverride = value;
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
}, {
|
|
20
|
-
apiName: 'setListStartNumber',
|
|
21
|
-
});
|
|
22
|
-
}
|
|
1
|
+
import { getFirstSelectedListItem } from 'roosterjs-content-model-core';
|
|
2
|
+
/**
|
|
3
|
+
* Set start number of a list item
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param value The number to set to, must be equal or greater than 1
|
|
6
|
+
*/
|
|
7
|
+
export default function setListStartNumber(editor, value) {
|
|
8
|
+
editor.focus();
|
|
9
|
+
editor.formatContentModel(function (model) {
|
|
10
|
+
var listItem = getFirstSelectedListItem(model);
|
|
11
|
+
var level = listItem === null || listItem === void 0 ? void 0 : listItem.levels[(listItem === null || listItem === void 0 ? void 0 : listItem.levels.length) - 1];
|
|
12
|
+
if (level) {
|
|
13
|
+
level.format.startNumberOverride = value;
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
apiName: 'setListStartNumber',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=setListStartNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAGxE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAyB,EAAE,KAAa;IAC/E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACjD,IAAM,KAAK,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,MAAM,IAAG,CAAC,CAAC,CAAC;QAE5D,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;YAEzC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,oBAAoB;KAChC,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { getFirstSelectedListItem } from 'roosterjs-content-model-core';\
|
|
1
|
+
{"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAGxE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAyB,EAAE,KAAa;IAC/E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACjD,IAAM,KAAK,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,MAAM,IAAG,CAAC,CAAC,CAAC;QAE5D,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;YAEzC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,oBAAoB;KAChC,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { getFirstSelectedListItem } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set start number of a list item\n * @param editor The editor to operate on\n * @param value The number to set to, must be equal or greater than 1\n */\nexport default function setListStartNumber(editor: IStandaloneEditor, value: number) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n const level = listItem?.levels[listItem?.levels.length - 1];\n\n if (level) {\n level.format.startNumberOverride = value;\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStartNumber',\n }\n );\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Set style of list items with in same thread of current item
|
|
4
|
-
* @param editor The editor to operate on
|
|
5
|
-
* @param style The target list item style to set
|
|
6
|
-
*/
|
|
7
|
-
export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
|
|
1
|
+
import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Set style of list items with in same thread of current item
|
|
4
|
+
* @param editor The editor to operate on
|
|
5
|
+
* @param style The target list item style to set
|
|
6
|
+
*/
|
|
7
|
+
export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';
|
|
2
|
-
import { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';
|
|
3
|
-
/**
|
|
4
|
-
* Set style of list items with in same thread of current item
|
|
5
|
-
* @param editor The editor to operate on
|
|
6
|
-
* @param style The target list item style to set
|
|
7
|
-
*/
|
|
8
|
-
export default function setListStyle(editor, style) {
|
|
9
|
-
editor.focus();
|
|
10
|
-
editor.formatContentModel(function (model) {
|
|
11
|
-
var listItem = getFirstSelectedListItem(model);
|
|
12
|
-
if (listItem) {
|
|
13
|
-
var listItems = findListItemsInSameThread(model, listItem);
|
|
14
|
-
var levelIndex_1 = listItem.levels.length - 1;
|
|
15
|
-
listItems.forEach(function (listItem) {
|
|
16
|
-
var level = listItem.levels[levelIndex_1];
|
|
17
|
-
if (level) {
|
|
18
|
-
updateListMetadata(level, function (metadata) { return Object.assign({}, metadata, style); });
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}, {
|
|
27
|
-
apiName: 'setListStyle',
|
|
28
|
-
});
|
|
29
|
-
}
|
|
1
|
+
import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';
|
|
2
|
+
import { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';
|
|
3
|
+
/**
|
|
4
|
+
* Set style of list items with in same thread of current item
|
|
5
|
+
* @param editor The editor to operate on
|
|
6
|
+
* @param style The target list item style to set
|
|
7
|
+
*/
|
|
8
|
+
export default function setListStyle(editor, style) {
|
|
9
|
+
editor.focus();
|
|
10
|
+
editor.formatContentModel(function (model) {
|
|
11
|
+
var listItem = getFirstSelectedListItem(model);
|
|
12
|
+
if (listItem) {
|
|
13
|
+
var listItems = findListItemsInSameThread(model, listItem);
|
|
14
|
+
var levelIndex_1 = listItem.levels.length - 1;
|
|
15
|
+
listItems.forEach(function (listItem) {
|
|
16
|
+
var level = listItem.levels[levelIndex_1];
|
|
17
|
+
if (level) {
|
|
18
|
+
updateListMetadata(level, function (metadata) { return Object.assign({}, metadata, style); });
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}, {
|
|
27
|
+
apiName: 'setListStyle',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
30
|
//# sourceMappingURL=setListStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG5F;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAyB,EAAE,KAAyB;IACrF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,QAAQ,EAAE;YACV,IAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;gBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;gBAE1C,IAAI,KAAK,EAAE;oBACP,kBAAkB,CAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;iBAC7E;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\
|
|
1
|
+
{"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG5F;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAyB,EAAE,KAAyB;IACrF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,QAAQ,EAAE;YACV,IAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;gBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;gBAE1C,IAAI,KAAK,EAAE;oBACP,kBAAkB,CAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;iBAC7E;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\nimport { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Set style of list items with in same thread of current item\n * @param editor The editor to operate on\n * @param style The target list item style to set\n */\nexport default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n\n if (listItem) {\n const listItems = findListItemsInSameThread(model, listItem);\n const levelIndex = listItem.levels.length - 1;\n\n listItems.forEach(listItem => {\n const level = listItem.levels[levelIndex];\n\n if (level) {\n updateListMetadata(level, metadata => Object.assign({}, metadata, style));\n }\n });\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStyle',\n }\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Toggle bullet list type
|
|
4
|
-
* - When there are some blocks not in bullet list, set all blocks to the given type
|
|
5
|
-
* - When all blocks are already in bullet list, turn off / outdent there list type
|
|
6
|
-
* @param editor The editor to operate on
|
|
7
|
-
*/
|
|
8
|
-
export default function toggleBullet(editor: IStandaloneEditor): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle bullet list type
|
|
4
|
+
* - When there are some blocks not in bullet list, set all blocks to the given type
|
|
5
|
+
* - When all blocks are already in bullet list, turn off / outdent there list type
|
|
6
|
+
* @param editor The editor to operate on
|
|
7
|
+
*/
|
|
8
|
+
export default function toggleBullet(editor: IStandaloneEditor): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { setListType } from '../../modelApi/list/setListType';
|
|
2
|
-
/**
|
|
3
|
-
* Toggle bullet list type
|
|
4
|
-
* - When there are some blocks not in bullet list, set all blocks to the given type
|
|
5
|
-
* - When all blocks are already in bullet list, turn off / outdent there list type
|
|
6
|
-
* @param editor The editor to operate on
|
|
7
|
-
*/
|
|
8
|
-
export default function toggleBullet(editor) {
|
|
9
|
-
editor.focus();
|
|
10
|
-
editor.formatContentModel(function (model, context) {
|
|
11
|
-
context.newPendingFormat = 'preserve';
|
|
12
|
-
return setListType(model, 'UL');
|
|
13
|
-
}, {
|
|
14
|
-
apiName: 'toggleBullet',
|
|
15
|
-
});
|
|
16
|
-
}
|
|
1
|
+
import { setListType } from '../../modelApi/list/setListType';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle bullet list type
|
|
4
|
+
* - When there are some blocks not in bullet list, set all blocks to the given type
|
|
5
|
+
* - When all blocks are already in bullet list, turn off / outdent there list type
|
|
6
|
+
* @param editor The editor to operate on
|
|
7
|
+
*/
|
|
8
|
+
export default function toggleBullet(editor) {
|
|
9
|
+
editor.focus();
|
|
10
|
+
editor.formatContentModel(function (model, context) {
|
|
11
|
+
context.newPendingFormat = 'preserve';
|
|
12
|
+
return setListType(model, 'UL');
|
|
13
|
+
}, {
|
|
14
|
+
apiName: 'toggleBullet',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=toggleBullet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAyB;IAC1D,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\
|
|
1
|
+
{"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAyB;IAC1D,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bullet list type\n * - When there are some blocks not in bullet list, set all blocks to the given type\n * - When all blocks are already in bullet list, turn off / outdent there list type\n * @param editor The editor to operate on\n */\nexport default function toggleBullet(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'UL');\n },\n {\n apiName: 'toggleBullet',\n }\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Toggle numbering list type
|
|
4
|
-
* - When there are some blocks not in numbering list, set all blocks to the given type
|
|
5
|
-
* - When all blocks are already in numbering list, turn off / outdent there list type
|
|
6
|
-
* @param editor The editor to operate on
|
|
7
|
-
*/
|
|
8
|
-
export default function toggleNumbering(editor: IStandaloneEditor): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Toggle numbering list type
|
|
4
|
+
* - When there are some blocks not in numbering list, set all blocks to the given type
|
|
5
|
+
* - When all blocks are already in numbering list, turn off / outdent there list type
|
|
6
|
+
* @param editor The editor to operate on
|
|
7
|
+
*/
|
|
8
|
+
export default function toggleNumbering(editor: IStandaloneEditor): void;
|