roosterjs-content-model-api 9.43.0 → 9.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +63 -63
- package/lib/index.js +131 -131
- package/lib/index.js.map +1 -1
- package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib/modelApi/block/setModelAlignment.js +65 -65
- package/lib/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib/modelApi/block/setModelDirection.js +113 -109
- package/lib/modelApi/block/setModelDirection.js.map +1 -1
- package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib/modelApi/block/setModelIndentation.js +158 -152
- package/lib/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib/modelApi/block/splitSelectedParagraphByBr.js +71 -71
- package/lib/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib/modelApi/block/toggleModelBlockQuote.js +53 -53
- package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib/modelApi/common/adjustIndentation.js +114 -114
- package/lib/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib/modelApi/common/clearModelFormat.js +143 -143
- package/lib/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib/modelApi/common/queryContentModelBlocks.js +87 -87
- package/lib/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib/modelApi/common/reducedModelChildProcessor.js +63 -63
- package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib/modelApi/common/wrapBlock.js +52 -52
- package/lib/modelApi/common/wrapBlock.js.map +1 -1
- package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib/modelApi/entity/insertEntityModel.js +105 -105
- package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib/modelApi/image/applyImageBorderFormat.js +57 -57
- package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib/modelApi/link/getLinkUrl.js +28 -28
- package/lib/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib/modelApi/link/matchLink.d.ts +12 -12
- package/lib/modelApi/link/matchLink.js +93 -93
- package/lib/modelApi/link/matchLink.js.map +1 -1
- package/lib/modelApi/link/promoteLink.d.ts +20 -20
- package/lib/modelApi/link/promoteLink.js +54 -54
- package/lib/modelApi/link/promoteLink.js.map +1 -1
- package/lib/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib/modelApi/list/findListItemsInSameThread.js +113 -113
- package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib/modelApi/list/getListAnnounceData.js +68 -68
- package/lib/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib/modelApi/list/setListType.d.ts +8 -8
- package/lib/modelApi/list/setListType.js +117 -116
- package/lib/modelApi/list/setListType.js.map +1 -1
- package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib/modelApi/list/setModelListStartNumber.js +21 -21
- package/lib/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib/modelApi/list/setModelListStyle.js +25 -25
- package/lib/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib/modelApi/selection/adjustSegmentSelection.js +47 -47
- package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
- package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib/modelApi/selection/adjustWordSelection.js +123 -123
- package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib/modelApi/selection/collapseTableSelection.js +16 -16
- package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib/modelApi/table/alignTable.d.ts +5 -5
- package/lib/modelApi/table/alignTable.js +11 -11
- package/lib/modelApi/table/alignTable.js.map +1 -1
- package/lib/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib/modelApi/table/alignTableCell.js +57 -57
- package/lib/modelApi/table/alignTableCell.js.map +1 -1
- package/lib/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib/modelApi/table/canMergeCells.js +56 -56
- package/lib/modelApi/table/canMergeCells.js.map +1 -1
- package/lib/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib/modelApi/table/clearSelectedCells.js +29 -29
- package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib/modelApi/table/createTableStructure.js +19 -19
- package/lib/modelApi/table/createTableStructure.js.map +1 -1
- package/lib/modelApi/table/deleteTable.d.ts +5 -5
- package/lib/modelApi/table/deleteTable.js +10 -10
- package/lib/modelApi/table/deleteTable.js.map +1 -1
- package/lib/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib/modelApi/table/deleteTableColumn.js +24 -24
- package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib/modelApi/table/deleteTableRow.js +23 -23
- package/lib/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js +56 -56
- package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib/modelApi/table/insertTableColumn.js +27 -27
- package/lib/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib/modelApi/table/insertTableRow.js +31 -31
- package/lib/modelApi/table/insertTableRow.js.map +1 -1
- package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib/modelApi/table/mergeTableCells.js +25 -25
- package/lib/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib/modelApi/table/mergeTableColumn.js +35 -35
- package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib/modelApi/table/mergeTableRow.js +35 -35
- package/lib/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib/modelApi/table/splitTableCellHorizontally.js +54 -54
- package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib/modelApi/table/splitTableCellVertically.js +53 -53
- package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib/publicApi/block/setAlignment.d.ts +7 -7
- package/lib/publicApi/block/setAlignment.js +16 -16
- package/lib/publicApi/block/setAlignment.js.map +1 -1
- package/lib/publicApi/block/setDirection.d.ts +7 -7
- package/lib/publicApi/block/setDirection.js +16 -16
- package/lib/publicApi/block/setDirection.js.map +1 -1
- package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib/publicApi/block/setHeadingLevel.js +50 -50
- package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib/publicApi/block/setIndentation.d.ts +8 -8
- package/lib/publicApi/block/setIndentation.js +21 -25
- package/lib/publicApi/block/setIndentation.js.map +1 -1
- package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib/publicApi/block/setParagraphMargin.js +33 -33
- package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib/publicApi/block/setSpacing.d.ts +7 -7
- package/lib/publicApi/block/setSpacing.js +21 -21
- package/lib/publicApi/block/setSpacing.js.map +1 -1
- package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib/publicApi/block/toggleBlockQuote.js +39 -39
- package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib/publicApi/entity/insertEntity.js +67 -67
- package/lib/publicApi/entity/insertEntity.js.map +1 -1
- package/lib/publicApi/format/clearFormat.d.ts +6 -6
- package/lib/publicApi/format/clearFormat.js +34 -34
- package/lib/publicApi/format/clearFormat.js.map +1 -1
- package/lib/publicApi/format/getFormatState.d.ts +7 -7
- package/lib/publicApi/format/getFormatState.js +31 -31
- package/lib/publicApi/format/getFormatState.js.map +1 -1
- package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib/publicApi/image/adjustImageSelection.js +29 -29
- package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib/publicApi/image/changeImage.d.ts +7 -7
- package/lib/publicApi/image/changeImage.js +35 -35
- package/lib/publicApi/image/changeImage.js.map +1 -1
- package/lib/publicApi/image/insertImage.d.ts +7 -7
- package/lib/publicApi/image/insertImage.js +38 -38
- package/lib/publicApi/image/insertImage.js.map +1 -1
- package/lib/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib/publicApi/image/setImageAltText.js +17 -17
- package/lib/publicApi/image/setImageAltText.js.map +1 -1
- package/lib/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib/publicApi/image/setImageBorder.js +19 -19
- package/lib/publicApi/image/setImageBorder.js.map +1 -1
- package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib/publicApi/image/setImageBoxShadow.js +29 -29
- package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib/publicApi/link/adjustLinkSelection.js +34 -34
- package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib/publicApi/link/insertLink.d.ts +15 -15
- package/lib/publicApi/link/insertLink.js +120 -120
- package/lib/publicApi/link/insertLink.js.map +1 -1
- package/lib/publicApi/link/removeLink.d.ts +8 -8
- package/lib/publicApi/link/removeLink.js +32 -32
- package/lib/publicApi/link/removeLink.js.map +1 -1
- package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib/publicApi/list/setListStartNumber.js +18 -18
- package/lib/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib/publicApi/list/setListStyle.d.ts +7 -7
- package/lib/publicApi/list/setListStyle.js +18 -18
- package/lib/publicApi/list/setListStyle.js.map +1 -1
- package/lib/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib/publicApi/list/toggleBullet.js +22 -22
- package/lib/publicApi/list/toggleBullet.js.map +1 -1
- package/lib/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib/publicApi/list/toggleNumbering.js +22 -22
- package/lib/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib/publicApi/segment/applySegmentFormat.js +23 -23
- package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib/publicApi/segment/changeCapitalization.js +49 -49
- package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib/publicApi/segment/changeFontSize.js +63 -63
- package/lib/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib/publicApi/segment/setBackgroundColor.js +35 -35
- package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib/publicApi/segment/setFontName.d.ts +7 -7
- package/lib/publicApi/segment/setFontName.js +19 -19
- package/lib/publicApi/segment/setFontName.js.map +1 -1
- package/lib/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib/publicApi/segment/setFontSize.js +33 -33
- package/lib/publicApi/segment/setFontSize.js.map +1 -1
- package/lib/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib/publicApi/segment/setTextColor.js +26 -26
- package/lib/publicApi/segment/setTextColor.js.map +1 -1
- package/lib/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib/publicApi/segment/splitTextSegment.js +30 -30
- package/lib/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib/publicApi/segment/toggleBold.js +27 -27
- package/lib/publicApi/segment/toggleBold.js.map +1 -1
- package/lib/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib/publicApi/segment/toggleCode.js +28 -28
- package/lib/publicApi/segment/toggleCode.js.map +1 -1
- package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib/publicApi/segment/toggleItalic.js +21 -21
- package/lib/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib/publicApi/segment/toggleStrikethrough.js +15 -15
- package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSubscript.js +15 -15
- package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib/publicApi/segment/toggleSuperscript.js +15 -15
- package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib/publicApi/segment/toggleUnderline.js +24 -24
- package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib/publicApi/table/applyTableBorderFormat.js +297 -297
- package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib/publicApi/table/editTable.d.ts +7 -7
- package/lib/publicApi/table/editTable.js +95 -95
- package/lib/publicApi/table/editTable.js.map +1 -1
- package/lib/publicApi/table/formatTable.d.ts +8 -8
- package/lib/publicApi/table/formatTable.js +38 -38
- package/lib/publicApi/table/formatTable.js.map +1 -1
- package/lib/publicApi/table/insertTable.d.ts +12 -11
- package/lib/publicApi/table/insertTable.js +76 -52
- package/lib/publicApi/table/insertTable.js.map +1 -1
- package/lib/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib/publicApi/table/setTableCellShade.js +32 -32
- package/lib/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib/publicApi/utils/createEditorContextForEntity.js +29 -29
- package/lib/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib/publicApi/utils/formatImageWithContentModel.js +18 -18
- package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
- package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib/publicApi/utils/formatParagraphWithContentModel.js +23 -23
- package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib/publicApi/utils/formatSegmentWithContentModel.js +117 -114
- package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib/publicApi/utils/formatTableWithContentModel.js +46 -46
- package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +34 -34
- package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/lib-amd/index.d.ts +63 -63
- package/lib-amd/index.js +69 -69
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib-amd/modelApi/block/setModelAlignment.js +64 -64
- package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib-amd/modelApi/block/setModelDirection.js +112 -108
- package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-amd/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib-amd/modelApi/block/setModelIndentation.js +154 -148
- package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js +71 -71
- package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js +52 -52
- package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-amd/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib-amd/modelApi/common/adjustIndentation.js +114 -114
- package/lib-amd/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-amd/modelApi/common/clearModelFormat.js +142 -142
- package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-amd/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib-amd/modelApi/common/queryContentModelBlocks.js +87 -87
- package/lib-amd/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js +63 -63
- package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-amd/modelApi/common/wrapBlock.js +52 -52
- package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib-amd/modelApi/entity/insertEntityModel.js +105 -105
- package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -58
- package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-amd/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib-amd/modelApi/link/getLinkUrl.js +29 -29
- package/lib-amd/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib-amd/modelApi/link/matchLink.d.ts +12 -12
- package/lib-amd/modelApi/link/matchLink.js +93 -93
- package/lib-amd/modelApi/link/matchLink.js.map +1 -1
- package/lib-amd/modelApi/link/promoteLink.d.ts +20 -20
- package/lib-amd/modelApi/link/promoteLink.js +54 -54
- package/lib-amd/modelApi/link/promoteLink.js.map +1 -1
- package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -115
- package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-amd/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib-amd/modelApi/list/getListAnnounceData.js +68 -68
- package/lib-amd/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib-amd/modelApi/list/setListType.d.ts +8 -8
- package/lib-amd/modelApi/list/setListType.js +116 -115
- package/lib-amd/modelApi/list/setListType.js.map +1 -1
- package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib-amd/modelApi/list/setModelListStartNumber.js +22 -22
- package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib-amd/modelApi/list/setModelListStyle.js +25 -25
- package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js +48 -48
- package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
- package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib-amd/modelApi/selection/adjustWordSelection.js +123 -123
- package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib-amd/modelApi/selection/collapseTableSelection.js +17 -17
- package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-amd/modelApi/table/alignTable.d.ts +5 -5
- package/lib-amd/modelApi/table/alignTable.js +13 -13
- package/lib-amd/modelApi/table/alignTable.js.map +1 -1
- package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib-amd/modelApi/table/alignTableCell.js +58 -58
- package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib-amd/modelApi/table/canMergeCells.js +58 -58
- package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-amd/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib-amd/modelApi/table/clearSelectedCells.js +30 -30
- package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib-amd/modelApi/table/createTableStructure.js +20 -20
- package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTable.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTable.js +12 -12
- package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTableColumn.js +24 -24
- package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib-amd/modelApi/table/deleteTableRow.js +23 -23
- package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +57 -57
- package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib-amd/modelApi/table/insertTableColumn.js +27 -27
- package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib-amd/modelApi/table/insertTableRow.js +30 -30
- package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableCells.js +25 -25
- package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableColumn.js +35 -35
- package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib-amd/modelApi/table/mergeTableRow.js +35 -35
- package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -54
- package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib-amd/modelApi/table/splitTableCellVertically.js +53 -53
- package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-amd/publicApi/block/setAlignment.d.ts +7 -7
- package/lib-amd/publicApi/block/setAlignment.js +17 -17
- package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
- package/lib-amd/publicApi/block/setDirection.d.ts +7 -7
- package/lib-amd/publicApi/block/setDirection.js +17 -17
- package/lib-amd/publicApi/block/setDirection.js.map +1 -1
- package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib-amd/publicApi/block/setHeadingLevel.js +51 -51
- package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-amd/publicApi/block/setIndentation.d.ts +8 -8
- package/lib-amd/publicApi/block/setIndentation.js +22 -25
- package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
- package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -9
- package/lib-amd/publicApi/block/setParagraphMargin.js +33 -33
- package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
- package/lib-amd/publicApi/block/setSpacing.d.ts +7 -7
- package/lib-amd/publicApi/block/setSpacing.js +22 -22
- package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
- package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -9
- package/lib-amd/publicApi/block/toggleBlockQuote.js +39 -39
- package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
- package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -25
- package/lib-amd/publicApi/entity/insertEntity.js +66 -66
- package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-amd/publicApi/format/clearFormat.d.ts +6 -6
- package/lib-amd/publicApi/format/clearFormat.js +34 -34
- package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
- package/lib-amd/publicApi/format/getFormatState.d.ts +7 -7
- package/lib-amd/publicApi/format/getFormatState.js +31 -31
- package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
- package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib-amd/publicApi/image/adjustImageSelection.js +29 -29
- package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-amd/publicApi/image/changeImage.d.ts +7 -7
- package/lib-amd/publicApi/image/changeImage.js +35 -35
- package/lib-amd/publicApi/image/changeImage.js.map +1 -1
- package/lib-amd/publicApi/image/insertImage.d.ts +7 -7
- package/lib-amd/publicApi/image/insertImage.js +39 -39
- package/lib-amd/publicApi/image/insertImage.js.map +1 -1
- package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib-amd/publicApi/image/setImageAltText.js +18 -18
- package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib-amd/publicApi/image/setImageBorder.js +19 -19
- package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -30
- package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -33
- package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-amd/publicApi/link/insertLink.d.ts +15 -15
- package/lib-amd/publicApi/link/insertLink.js +118 -118
- package/lib-amd/publicApi/link/insertLink.js.map +1 -1
- package/lib-amd/publicApi/link/removeLink.d.ts +8 -8
- package/lib-amd/publicApi/link/removeLink.js +32 -32
- package/lib-amd/publicApi/link/removeLink.js.map +1 -1
- package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib-amd/publicApi/list/setListStartNumber.js +19 -19
- package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-amd/publicApi/list/setListStyle.d.ts +7 -7
- package/lib-amd/publicApi/list/setListStyle.js +19 -19
- package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
- package/lib-amd/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib-amd/publicApi/list/toggleBullet.js +23 -23
- package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-amd/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib-amd/publicApi/list/toggleNumbering.js +23 -23
- package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -24
- package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib-amd/publicApi/segment/changeCapitalization.js +50 -50
- package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib-amd/publicApi/segment/changeFontSize.js +62 -62
- package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -35
- package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontName.d.ts +7 -7
- package/lib-amd/publicApi/segment/setFontName.js +20 -20
- package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
- package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib-amd/publicApi/segment/setFontSize.js +34 -34
- package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib-amd/publicApi/segment/setTextColor.js +27 -27
- package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-amd/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib-amd/publicApi/segment/splitTextSegment.js +30 -30
- package/lib-amd/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleBold.js +27 -27
- package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleCode.js +28 -28
- package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleItalic.js +22 -22
- package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -16
- package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleSubscript.js +16 -16
- package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -16
- package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib-amd/publicApi/segment/toggleUnderline.js +25 -25
- package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib-amd/publicApi/table/applyTableBorderFormat.js +297 -297
- package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-amd/publicApi/table/editTable.d.ts +7 -7
- package/lib-amd/publicApi/table/editTable.js +84 -84
- package/lib-amd/publicApi/table/editTable.js.map +1 -1
- package/lib-amd/publicApi/table/formatTable.d.ts +8 -8
- package/lib-amd/publicApi/table/formatTable.js +38 -38
- package/lib-amd/publicApi/table/formatTable.js.map +1 -1
- package/lib-amd/publicApi/table/insertTable.d.ts +12 -11
- package/lib-amd/publicApi/table/insertTable.js +74 -50
- package/lib-amd/publicApi/table/insertTable.js.map +1 -1
- package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib-amd/publicApi/table/setTableCellShade.js +32 -32
- package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-amd/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib-amd/publicApi/utils/createEditorContextForEntity.js +30 -30
- package/lib-amd/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js +19 -19
- package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
- package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +23 -23
- package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +115 -112
- package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js +45 -45
- package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +35 -35
- package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/lib-mjs/index.d.ts +63 -63
- package/lib-mjs/index.js +63 -63
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -5
- package/lib-mjs/modelApi/block/setModelAlignment.js +61 -61
- package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -5
- package/lib-mjs/modelApi/block/setModelDirection.js +109 -105
- package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
- package/lib-mjs/modelApi/block/setModelIndentation.d.ts +8 -8
- package/lib-mjs/modelApi/block/setModelIndentation.js +154 -148
- package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js +67 -67
- package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +49 -49
- package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
- package/lib-mjs/modelApi/common/adjustIndentation.d.ts +13 -13
- package/lib-mjs/modelApi/common/adjustIndentation.js +109 -109
- package/lib-mjs/modelApi/common/adjustIndentation.js.map +1 -1
- package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
- package/lib-mjs/modelApi/common/clearModelFormat.js +139 -139
- package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
- package/lib-mjs/modelApi/common/queryContentModelBlocks.d.ts +10 -10
- package/lib-mjs/modelApi/common/queryContentModelBlocks.js +83 -83
- package/lib-mjs/modelApi/common/queryContentModelBlocks.js.map +1 -1
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +59 -59
- package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -1
- package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
- package/lib-mjs/modelApi/common/wrapBlock.js +47 -47
- package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
- package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -5
- package/lib-mjs/modelApi/entity/insertEntityModel.js +101 -101
- package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
- package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -5
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js +53 -53
- package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
- package/lib-mjs/modelApi/link/getLinkUrl.d.ts +5 -5
- package/lib-mjs/modelApi/link/getLinkUrl.js +24 -24
- package/lib-mjs/modelApi/link/getLinkUrl.js.map +1 -1
- package/lib-mjs/modelApi/link/matchLink.d.ts +12 -12
- package/lib-mjs/modelApi/link/matchLink.js +89 -89
- package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
- package/lib-mjs/modelApi/link/promoteLink.d.ts +20 -20
- package/lib-mjs/modelApi/link/promoteLink.js +49 -49
- package/lib-mjs/modelApi/link/promoteLink.js.map +1 -1
- package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +13 -13
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -109
- package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
- package/lib-mjs/modelApi/list/getListAnnounceData.d.ts +7 -7
- package/lib-mjs/modelApi/list/getListAnnounceData.js +64 -64
- package/lib-mjs/modelApi/list/getListAnnounceData.js.map +1 -1
- package/lib-mjs/modelApi/list/setListType.d.ts +8 -8
- package/lib-mjs/modelApi/list/setListType.js +113 -112
- package/lib-mjs/modelApi/list/setListType.js.map +1 -1
- package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -7
- package/lib-mjs/modelApi/list/setModelListStartNumber.js +17 -17
- package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -1
- package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -7
- package/lib-mjs/modelApi/list/setModelListStyle.js +21 -21
- package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +43 -43
- package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +52 -52
- package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +8 -8
- package/lib-mjs/modelApi/selection/adjustWordSelection.js +119 -119
- package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
- package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +5 -5
- package/lib-mjs/modelApi/selection/collapseTableSelection.js +12 -12
- package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTable.d.ts +5 -5
- package/lib-mjs/modelApi/table/alignTable.js +7 -7
- package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
- package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -9
- package/lib-mjs/modelApi/table/alignTableCell.js +52 -52
- package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
- package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -5
- package/lib-mjs/modelApi/table/canMergeCells.js +52 -52
- package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
- package/lib-mjs/modelApi/table/clearSelectedCells.d.ts +7 -7
- package/lib-mjs/modelApi/table/clearSelectedCells.js +25 -25
- package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
- package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -5
- package/lib-mjs/modelApi/table/createTableStructure.js +15 -15
- package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTable.js +6 -6
- package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTableColumn.js +20 -20
- package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -5
- package/lib-mjs/modelApi/table/deleteTableRow.js +19 -19
- package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +52 -52
- package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableColumn.d.ts +7 -7
- package/lib-mjs/modelApi/table/insertTableColumn.js +23 -23
- package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/insertTableRow.d.ts +7 -7
- package/lib-mjs/modelApi/table/insertTableRow.js +27 -27
- package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableCells.js +21 -21
- package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableColumn.js +31 -31
- package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
- package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -5
- package/lib-mjs/modelApi/table/mergeTableRow.js +31 -31
- package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +50 -50
- package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
- package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -5
- package/lib-mjs/modelApi/table/splitTableCellVertically.js +49 -49
- package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
- package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -7
- package/lib-mjs/publicApi/block/setAlignment.js +12 -12
- package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
- package/lib-mjs/publicApi/block/setDirection.d.ts +7 -7
- package/lib-mjs/publicApi/block/setDirection.js +12 -12
- package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
- package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -7
- package/lib-mjs/publicApi/block/setHeadingLevel.js +46 -46
- package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
- package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -8
- package/lib-mjs/publicApi/block/setIndentation.js +17 -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 +63 -63
- package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
- package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -6
- package/lib-mjs/publicApi/format/clearFormat.js +30 -30
- package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
- package/lib-mjs/publicApi/format/getFormatState.d.ts +7 -7
- package/lib-mjs/publicApi/format/getFormatState.js +27 -27
- package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
- package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -6
- package/lib-mjs/publicApi/image/adjustImageSelection.js +25 -25
- package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
- package/lib-mjs/publicApi/image/changeImage.d.ts +7 -7
- package/lib-mjs/publicApi/image/changeImage.js +31 -31
- package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
- package/lib-mjs/publicApi/image/insertImage.d.ts +7 -7
- package/lib-mjs/publicApi/image/insertImage.js +34 -34
- package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -8
- package/lib-mjs/publicApi/image/setImageAltText.js +13 -13
- package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -9
- package/lib-mjs/publicApi/image/setImageBorder.js +15 -15
- package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
- package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -8
- package/lib-mjs/publicApi/image/setImageBoxShadow.js +25 -25
- package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
- package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -6
- package/lib-mjs/publicApi/link/adjustLinkSelection.js +30 -30
- package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
- package/lib-mjs/publicApi/link/insertLink.d.ts +15 -15
- package/lib-mjs/publicApi/link/insertLink.js +116 -116
- package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
- package/lib-mjs/publicApi/link/removeLink.d.ts +8 -8
- package/lib-mjs/publicApi/link/removeLink.js +28 -28
- package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -7
- package/lib-mjs/publicApi/list/setListStartNumber.js +14 -14
- package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
- package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -7
- package/lib-mjs/publicApi/list/setListStyle.js +14 -14
- package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleBullet.d.ts +9 -9
- package/lib-mjs/publicApi/list/toggleBullet.js +18 -18
- package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
- package/lib-mjs/publicApi/list/toggleNumbering.d.ts +9 -9
- package/lib-mjs/publicApi/list/toggleNumbering.js +18 -18
- package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
- package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -7
- package/lib-mjs/publicApi/segment/applySegmentFormat.js +19 -19
- package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -10
- package/lib-mjs/publicApi/segment/changeCapitalization.js +45 -45
- package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
- package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -8
- package/lib-mjs/publicApi/segment/changeFontSize.js +59 -59
- package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setBackgroundColor.js +31 -31
- package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setFontName.js +15 -15
- package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
- package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -12
- package/lib-mjs/publicApi/segment/setFontSize.js +28 -28
- package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
- package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -7
- package/lib-mjs/publicApi/segment/setTextColor.js +22 -22
- package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
- package/lib-mjs/publicApi/segment/splitTextSegment.d.ts +10 -10
- package/lib-mjs/publicApi/segment/splitTextSegment.js +26 -26
- package/lib-mjs/publicApi/segment/splitTextSegment.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleBold.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleBold.js +23 -23
- package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleCode.js +24 -24
- package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleItalic.js +17 -17
- package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js +11 -11
- package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleSubscript.js +11 -11
- package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleSuperscript.js +11 -11
- package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
- package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -6
- package/lib-mjs/publicApi/segment/toggleUnderline.js +20 -20
- package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
- package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -8
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js +293 -293
- package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
- package/lib-mjs/publicApi/table/editTable.d.ts +7 -7
- package/lib-mjs/publicApi/table/editTable.js +91 -91
- package/lib-mjs/publicApi/table/editTable.js.map +1 -1
- package/lib-mjs/publicApi/table/formatTable.d.ts +8 -8
- package/lib-mjs/publicApi/table/formatTable.js +34 -34
- package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
- package/lib-mjs/publicApi/table/insertTable.d.ts +12 -11
- package/lib-mjs/publicApi/table/insertTable.js +72 -48
- package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
- package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -7
- package/lib-mjs/publicApi/table/setTableCellShade.js +28 -28
- package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.js +25 -25
- package/lib-mjs/publicApi/utils/createEditorContextForEntity.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +14 -14
- package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +126 -126
- package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +19 -19
- package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +113 -110
- package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +42 -42
- package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +30 -30
- package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Border, ContentModelImage } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function applyImageBorderFormat(image: ContentModelImage, border: Border | null, borderRadius?: string): void;
|
|
1
|
+
import type { Border, ContentModelImage } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function applyImageBorderFormat(image: ContentModelImage, border: Border | null, borderRadius?: string): void;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { extractBorderValues, parseValueWithUnit } from 'roosterjs-content-model-dom';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export function applyImageBorderFormat(image, border, borderRadius) {
|
|
6
|
-
if (border) {
|
|
7
|
-
var format = image.format;
|
|
8
|
-
var width = border.width, style = border.style, color = border.color;
|
|
9
|
-
var borderKey = 'borderTop';
|
|
10
|
-
var extractedBorder = extractBorderValues(format[borderKey]);
|
|
11
|
-
var borderColor = extractedBorder.color;
|
|
12
|
-
var borderWidth = extractedBorder.width;
|
|
13
|
-
var borderStyle = extractedBorder.style;
|
|
14
|
-
var borderFormat = '';
|
|
15
|
-
if (width) {
|
|
16
|
-
borderFormat = parseValueWithUnit(width) + 'px';
|
|
17
|
-
}
|
|
18
|
-
else if (borderWidth) {
|
|
19
|
-
borderFormat = borderWidth;
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
borderFormat = '1px';
|
|
23
|
-
}
|
|
24
|
-
if (style) {
|
|
25
|
-
borderFormat = borderFormat + " " + style;
|
|
26
|
-
}
|
|
27
|
-
else if (borderStyle) {
|
|
28
|
-
borderFormat = borderFormat + " " + borderStyle;
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
borderFormat = borderFormat + " solid";
|
|
32
|
-
}
|
|
33
|
-
if (color) {
|
|
34
|
-
borderFormat = borderFormat + " " + color;
|
|
35
|
-
}
|
|
36
|
-
else if (borderColor) {
|
|
37
|
-
borderFormat = borderFormat + " " + borderColor;
|
|
38
|
-
}
|
|
39
|
-
image.format.borderLeft = borderFormat;
|
|
40
|
-
image.format.borderTop = borderFormat;
|
|
41
|
-
image.format.borderBottom = borderFormat;
|
|
42
|
-
image.format.borderRight = borderFormat;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
delete image.format.borderLeft;
|
|
46
|
-
delete image.format.borderTop;
|
|
47
|
-
delete image.format.borderBottom;
|
|
48
|
-
delete image.format.borderRight;
|
|
49
|
-
}
|
|
50
|
-
if (borderRadius) {
|
|
51
|
-
image.format.borderRadius = borderRadius;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import { extractBorderValues, parseValueWithUnit } from 'roosterjs-content-model-dom';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export function applyImageBorderFormat(image, border, borderRadius) {
|
|
6
|
+
if (border) {
|
|
7
|
+
var format = image.format;
|
|
8
|
+
var width = border.width, style = border.style, color = border.color;
|
|
9
|
+
var borderKey = 'borderTop';
|
|
10
|
+
var extractedBorder = extractBorderValues(format[borderKey]);
|
|
11
|
+
var borderColor = extractedBorder.color;
|
|
12
|
+
var borderWidth = extractedBorder.width;
|
|
13
|
+
var borderStyle = extractedBorder.style;
|
|
14
|
+
var borderFormat = '';
|
|
15
|
+
if (width) {
|
|
16
|
+
borderFormat = parseValueWithUnit(width) + 'px';
|
|
17
|
+
}
|
|
18
|
+
else if (borderWidth) {
|
|
19
|
+
borderFormat = borderWidth;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
borderFormat = '1px';
|
|
23
|
+
}
|
|
24
|
+
if (style) {
|
|
25
|
+
borderFormat = borderFormat + " " + style;
|
|
26
|
+
}
|
|
27
|
+
else if (borderStyle) {
|
|
28
|
+
borderFormat = borderFormat + " " + borderStyle;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
borderFormat = borderFormat + " solid";
|
|
32
|
+
}
|
|
33
|
+
if (color) {
|
|
34
|
+
borderFormat = borderFormat + " " + color;
|
|
35
|
+
}
|
|
36
|
+
else if (borderColor) {
|
|
37
|
+
borderFormat = borderFormat + " " + borderColor;
|
|
38
|
+
}
|
|
39
|
+
image.format.borderLeft = borderFormat;
|
|
40
|
+
image.format.borderTop = borderFormat;
|
|
41
|
+
image.format.borderBottom = borderFormat;
|
|
42
|
+
image.format.borderRight = borderFormat;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
delete image.format.borderLeft;
|
|
46
|
+
delete image.format.borderTop;
|
|
47
|
+
delete image.format.borderBottom;
|
|
48
|
+
delete image.format.borderRight;
|
|
49
|
+
}
|
|
50
|
+
if (borderRadius) {
|
|
51
|
+
image.format.borderRadius = borderRadius;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
54
|
//# sourceMappingURL=applyImageBorderFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyImageBorderFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/image/applyImageBorderFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtF;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAClC,KAAwB,EACxB,MAAqB,EACrB,YAAqB;IAErB,IAAI,MAAM,EAAE;QACR,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QACpB,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,KAAK,GAAY,MAAM,MAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;QACvC,IAAM,SAAS,GAAG,WAAW,CAAC;QAC9B,IAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/D,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,KAAK,EAAE;YACP,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACnD;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAG,WAAW,CAAC;SAC9B;aAAM;YACH,YAAY,GAAG,KAAK,CAAC;SACxB;QAED,IAAI,KAAK,EAAE;YACP,YAAY,GAAM,YAAY,SAAI,KAAO,CAAC;SAC7C;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAM,YAAY,SAAI,WAAa,CAAC;SACnD;aAAM;YACH,YAAY,GAAM,YAAY,WAAQ,CAAC;SAC1C;QAED,IAAI,KAAK,EAAE;YACP,YAAY,GAAM,YAAY,SAAI,KAAO,CAAC;SAC7C;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAM,YAAY,SAAI,WAAa,CAAC;SACnD;QACD,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,YAAY,CAAC;QACvC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;QACtC,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QACzC,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;KAC3C;SAAM;QACH,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;QAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;KACnC;IAED,IAAI,YAAY,EAAE;QACd,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;KAC5C;AACL,CAAC","sourcesContent":["import { extractBorderValues, parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport type { Border, ContentModelImage } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function applyImageBorderFormat(\n image: ContentModelImage,\n border: Border | null,\n borderRadius?: string\n) {\n if (border) {\n const format = image.format;\n const { width, style, color } = border;\n const borderKey = 'borderTop';\n const extractedBorder = extractBorderValues(format[borderKey]);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n let borderFormat = '';\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 image.format.borderLeft = borderFormat;\n image.format.borderTop = borderFormat;\n image.format.borderBottom = borderFormat;\n image.format.borderRight = borderFormat;\n } else {\n delete image.format.borderLeft;\n delete image.format.borderTop;\n delete image.format.borderBottom;\n delete image.format.borderRight;\n }\n\n if (borderRadius) {\n image.format.borderRadius = borderRadius;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"applyImageBorderFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/image/applyImageBorderFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtF;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAClC,KAAwB,EACxB,MAAqB,EACrB,YAAqB;IAErB,IAAI,MAAM,EAAE;QACR,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QACpB,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,KAAK,GAAY,MAAM,MAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;QACvC,IAAM,SAAS,GAAG,WAAW,CAAC;QAC9B,IAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/D,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;QAC1C,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,KAAK,EAAE;YACP,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;SACnD;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAG,WAAW,CAAC;SAC9B;aAAM;YACH,YAAY,GAAG,KAAK,CAAC;SACxB;QAED,IAAI,KAAK,EAAE;YACP,YAAY,GAAM,YAAY,SAAI,KAAO,CAAC;SAC7C;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAM,YAAY,SAAI,WAAa,CAAC;SACnD;aAAM;YACH,YAAY,GAAM,YAAY,WAAQ,CAAC;SAC1C;QAED,IAAI,KAAK,EAAE;YACP,YAAY,GAAM,YAAY,SAAI,KAAO,CAAC;SAC7C;aAAM,IAAI,WAAW,EAAE;YACpB,YAAY,GAAM,YAAY,SAAI,WAAa,CAAC;SACnD;QACD,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,YAAY,CAAC;QACvC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;QACtC,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QACzC,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;KAC3C;SAAM;QACH,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;QAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;KACnC;IAED,IAAI,YAAY,EAAE;QACd,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;KAC5C;AACL,CAAC","sourcesContent":["import { extractBorderValues, parseValueWithUnit } from 'roosterjs-content-model-dom';\r\nimport type { Border, ContentModelImage } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function applyImageBorderFormat(\r\n image: ContentModelImage,\r\n border: Border | null,\r\n borderRadius?: string\r\n) {\r\n if (border) {\r\n const format = image.format;\r\n const { width, style, color } = border;\r\n const borderKey = 'borderTop';\r\n const extractedBorder = extractBorderValues(format[borderKey]);\r\n const borderColor = extractedBorder.color;\r\n const borderWidth = extractedBorder.width;\r\n const borderStyle = extractedBorder.style;\r\n let borderFormat = '';\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 image.format.borderLeft = borderFormat;\r\n image.format.borderTop = borderFormat;\r\n image.format.borderBottom = borderFormat;\r\n image.format.borderRight = borderFormat;\r\n } else {\r\n delete image.format.borderLeft;\r\n delete image.format.borderTop;\r\n delete image.format.borderBottom;\r\n delete image.format.borderRight;\r\n }\r\n\r\n if (borderRadius) {\r\n image.format.borderRadius = borderRadius;\r\n }\r\n}\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AutoLinkOptions } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function getLinkUrl(text: string, autoLinkOptions?: AutoLinkOptions): string | undefined;
|
|
1
|
+
import type { AutoLinkOptions } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function getLinkUrl(text: string, autoLinkOptions?: AutoLinkOptions): string | undefined;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { matchLink } from './matchLink';
|
|
2
|
-
var COMMON_REGEX = "[s]*[a-zA-Z0-9+][s]*";
|
|
3
|
-
var TELEPHONE_REGEX = "(T|t)el:" + COMMON_REGEX;
|
|
4
|
-
var MAILTO_REGEX = "(M|m)ailto:" + COMMON_REGEX;
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export function getLinkUrl(text, autoLinkOptions) {
|
|
9
|
-
var _a;
|
|
10
|
-
var _b = autoLinkOptions !== null && autoLinkOptions !== void 0 ? autoLinkOptions : {}, autoLink = _b.autoLink, autoMailto = _b.autoMailto, autoTel = _b.autoTel;
|
|
11
|
-
var mailtoMatch = matchMailTo(text);
|
|
12
|
-
if (mailtoMatch && !autoMailto) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
var linkMatch = autoLink ? (_a = matchLink(text)) === null || _a === void 0 ? void 0 : _a.normalizedUrl : undefined;
|
|
16
|
-
var telMatch = autoTel ? matchTel(text) : undefined;
|
|
17
|
-
return linkMatch || telMatch || mailtoMatch;
|
|
18
|
-
}
|
|
19
|
-
function matchTel(text) {
|
|
20
|
-
return text.match(TELEPHONE_REGEX) ? text.toLocaleLowerCase() : undefined;
|
|
21
|
-
}
|
|
22
|
-
function matchMailTo(text) {
|
|
23
|
-
return text.match(MAILTO_REGEX) ? text.toLocaleLowerCase() : undefined;
|
|
24
|
-
}
|
|
1
|
+
import { matchLink } from './matchLink';
|
|
2
|
+
var COMMON_REGEX = "[s]*[a-zA-Z0-9+][s]*";
|
|
3
|
+
var TELEPHONE_REGEX = "(T|t)el:" + COMMON_REGEX;
|
|
4
|
+
var MAILTO_REGEX = "(M|m)ailto:" + COMMON_REGEX;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export function getLinkUrl(text, autoLinkOptions) {
|
|
9
|
+
var _a;
|
|
10
|
+
var _b = autoLinkOptions !== null && autoLinkOptions !== void 0 ? autoLinkOptions : {}, autoLink = _b.autoLink, autoMailto = _b.autoMailto, autoTel = _b.autoTel;
|
|
11
|
+
var mailtoMatch = matchMailTo(text);
|
|
12
|
+
if (mailtoMatch && !autoMailto) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
var linkMatch = autoLink ? (_a = matchLink(text)) === null || _a === void 0 ? void 0 : _a.normalizedUrl : undefined;
|
|
16
|
+
var telMatch = autoTel ? matchTel(text) : undefined;
|
|
17
|
+
return linkMatch || telMatch || mailtoMatch;
|
|
18
|
+
}
|
|
19
|
+
function matchTel(text) {
|
|
20
|
+
return text.match(TELEPHONE_REGEX) ? text.toLocaleLowerCase() : undefined;
|
|
21
|
+
}
|
|
22
|
+
function matchMailTo(text) {
|
|
23
|
+
return text.match(MAILTO_REGEX) ? text.toLocaleLowerCase() : undefined;
|
|
24
|
+
}
|
|
25
25
|
//# sourceMappingURL=getLinkUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLinkUrl.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/link/getLinkUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,IAAM,YAAY,GAAG,sBAAwB,CAAC;AAC9C,IAAM,eAAe,GAAG,aAAW,YAAc,CAAC;AAClD,IAAM,YAAY,GAAG,gBAAc,YAAc,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,eAAiC;;IAChE,IAAA,KAAoC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,EAAvD,QAAQ,cAAA,EAAE,UAAU,gBAAA,EAAE,OAAO,aAA0B,CAAC;IAChE,IAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,WAAW,IAAI,CAAC,UAAU,EAAE;QAC5B,OAAO,SAAS,CAAC;KACpB;IACD,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAA,SAAS,CAAC,IAAI,CAAC,0CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,IAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtD,OAAO,SAAS,IAAI,QAAQ,IAAI,WAAW,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC","sourcesContent":["import { matchLink } from './matchLink';\nimport type { AutoLinkOptions } from 'roosterjs-content-model-types';\n\nconst COMMON_REGEX = `[\\s]*[a-zA-Z0-9+][\\s]*`;\nconst TELEPHONE_REGEX = `(T|t)el:${COMMON_REGEX}`;\nconst MAILTO_REGEX = `(M|m)ailto:${COMMON_REGEX}`;\n\n/**\n * @internal\n */\nexport function getLinkUrl(text: string, autoLinkOptions?: AutoLinkOptions): string | undefined {\n const { autoLink, autoMailto, autoTel } = autoLinkOptions ?? {};\n const mailtoMatch = matchMailTo(text);\n if (mailtoMatch && !autoMailto) {\n return undefined;\n }\n const linkMatch = autoLink ? matchLink(text)?.normalizedUrl : undefined;\n const telMatch = autoTel ? matchTel(text) : undefined;\n\n return linkMatch || telMatch || mailtoMatch;\n}\n\nfunction matchTel(text: string) {\n return text.match(TELEPHONE_REGEX) ? text.toLocaleLowerCase() : undefined;\n}\n\nfunction matchMailTo(text: string) {\n return text.match(MAILTO_REGEX) ? text.toLocaleLowerCase() : undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getLinkUrl.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/link/getLinkUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,IAAM,YAAY,GAAG,sBAAwB,CAAC;AAC9C,IAAM,eAAe,GAAG,aAAW,YAAc,CAAC;AAClD,IAAM,YAAY,GAAG,gBAAc,YAAc,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,eAAiC;;IAChE,IAAA,KAAoC,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,EAAE,EAAvD,QAAQ,cAAA,EAAE,UAAU,gBAAA,EAAE,OAAO,aAA0B,CAAC;IAChE,IAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,WAAW,IAAI,CAAC,UAAU,EAAE;QAC5B,OAAO,SAAS,CAAC;KACpB;IACD,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAA,SAAS,CAAC,IAAI,CAAC,0CAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,IAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtD,OAAO,SAAS,IAAI,QAAQ,IAAI,WAAW,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC","sourcesContent":["import { matchLink } from './matchLink';\r\nimport type { AutoLinkOptions } from 'roosterjs-content-model-types';\r\n\r\nconst COMMON_REGEX = `[\\s]*[a-zA-Z0-9+][\\s]*`;\r\nconst TELEPHONE_REGEX = `(T|t)el:${COMMON_REGEX}`;\r\nconst MAILTO_REGEX = `(M|m)ailto:${COMMON_REGEX}`;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function getLinkUrl(text: string, autoLinkOptions?: AutoLinkOptions): string | undefined {\r\n const { autoLink, autoMailto, autoTel } = autoLinkOptions ?? {};\r\n const mailtoMatch = matchMailTo(text);\r\n if (mailtoMatch && !autoMailto) {\r\n return undefined;\r\n }\r\n const linkMatch = autoLink ? matchLink(text)?.normalizedUrl : undefined;\r\n const telMatch = autoTel ? matchTel(text) : undefined;\r\n\r\n return linkMatch || telMatch || mailtoMatch;\r\n}\r\n\r\nfunction matchTel(text: string) {\r\n return text.match(TELEPHONE_REGEX) ? text.toLocaleLowerCase() : undefined;\r\n}\r\n\r\nfunction matchMailTo(text: string) {\r\n return text.match(MAILTO_REGEX) ? text.toLocaleLowerCase() : undefined;\r\n}\r\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { LinkData } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Try to match a given string with link match rules, return matched link
|
|
4
|
-
* @param url Input url to match
|
|
5
|
-
* @param option Link match option, exact or partial. If it is exact match, we need
|
|
6
|
-
* to check the length of matched link and url
|
|
7
|
-
* @param rules Optional link match rules, if not passed, only the default link match
|
|
8
|
-
* rules will be applied
|
|
9
|
-
* @returns The matched link data, or null if no match found.
|
|
10
|
-
* The link data includes an original url and a normalized url
|
|
11
|
-
*/
|
|
12
|
-
export declare function matchLink(url: string): LinkData | null;
|
|
1
|
+
import type { LinkData } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Try to match a given string with link match rules, return matched link
|
|
4
|
+
* @param url Input url to match
|
|
5
|
+
* @param option Link match option, exact or partial. If it is exact match, we need
|
|
6
|
+
* to check the length of matched link and url
|
|
7
|
+
* @param rules Optional link match rules, if not passed, only the default link match
|
|
8
|
+
* rules will be applied
|
|
9
|
+
* @returns The matched link data, or null if no match found.
|
|
10
|
+
* The link data includes an original url and a normalized url
|
|
11
|
+
*/
|
|
12
|
+
export declare function matchLink(url: string): LinkData | null;
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { __values } from "tslib";
|
|
2
|
-
import { getObjectKeys } from 'roosterjs-content-model-dom';
|
|
3
|
-
// http exclude matching regex
|
|
4
|
-
// invalid URL example (in particular on IE and Edge):
|
|
5
|
-
// - http://www.bing.com%00, %00 before ? (question mark) is considered invalid. IE/Edge throws invalid argument exception
|
|
6
|
-
// - http://www.bing.com%1, %1 is invalid
|
|
7
|
-
// - http://www.bing.com%g, %g is invalid (IE and Edge expects a two hex value after a %)
|
|
8
|
-
// - http://www.bing.com%, % as ending is invalid (IE and Edge expects a two hex value after a %)
|
|
9
|
-
// All above % cases if they're after ? (question mark) is then considered valid again
|
|
10
|
-
// Similar for @, it needs to be after / (forward slash), or ? (question mark). Otherwise IE/Edge will throw security exception
|
|
11
|
-
// - http://www.bing.com@name, @name before ? (question mark) is considered invalid
|
|
12
|
-
// - http://www.bing.com/@name, is valid sine it is after / (forward slash)
|
|
13
|
-
// - http://www.bing.com?@name, is also valid since it is after ? (question mark)
|
|
14
|
-
// The regex below is essentially a break down of:
|
|
15
|
-
// ^[^?]+%[^0-9a-f]+ => to exclude URL like www.bing.com%%
|
|
16
|
-
// ^[^?]+%[0-9a-f][^0-9a-f]+ => to exclude URL like www.bing.com%1
|
|
17
|
-
// ^[^?]+%00 => to exclude URL like www.bing.com%00
|
|
18
|
-
// ^[^?]+%$ => to exclude URL like www.bing.com%
|
|
19
|
-
// ^https?:\/\/[^?\/]+@ => to exclude URL like http://www.bing.com@name
|
|
20
|
-
// ^www\.[^?\/]+@ => to exclude URL like www.bing.com@name
|
|
21
|
-
// , => to exclude url like www.bing,,com
|
|
22
|
-
var httpExcludeRegEx = /^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\/\/[^?\/]+@|^www\.[^?\/]+@/i;
|
|
23
|
-
// via https://tools.ietf.org/html/rfc1035 Page 7
|
|
24
|
-
var labelRegEx = '[a-z0-9](?:[a-z0-9-]*[a-z0-9])?'; // We're using case insensitive regexps below so don't bother including A-Z
|
|
25
|
-
var domainNameRegEx = "(?:" + labelRegEx + "\\.)*" + labelRegEx;
|
|
26
|
-
var domainPortRegEx = domainNameRegEx + "(?:\\:[0-9]+)?";
|
|
27
|
-
var domainPortWithUrlRegEx = domainPortRegEx + "(?:[\\/\\?]\\S*)?";
|
|
28
|
-
var linkMatchRules = {
|
|
29
|
-
http: {
|
|
30
|
-
match: new RegExp("^(?:microsoft-edge:)?http:\\/\\/" + domainPortWithUrlRegEx + "|www\\." + domainPortWithUrlRegEx, 'i'),
|
|
31
|
-
except: httpExcludeRegEx,
|
|
32
|
-
normalizeUrl: function (url) {
|
|
33
|
-
return new RegExp('^(?:microsoft-edge:)?http:\\/\\/', 'i').test(url) ? url : 'http://' + url;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
https: {
|
|
37
|
-
match: new RegExp("^(?:microsoft-edge:)?https:\\/\\/" + domainPortWithUrlRegEx, 'i'),
|
|
38
|
-
except: httpExcludeRegEx,
|
|
39
|
-
},
|
|
40
|
-
mailto: { match: new RegExp('^mailto:\\S+@\\S+\\.\\S+', 'i') },
|
|
41
|
-
notes: { match: new RegExp('^notes:\\/\\/\\S+', 'i') },
|
|
42
|
-
file: { match: new RegExp('^file:\\/\\/\\/?\\S+', 'i') },
|
|
43
|
-
unc: { match: new RegExp('^\\\\\\\\\\S+', 'i') },
|
|
44
|
-
ftp: {
|
|
45
|
-
match: new RegExp("^ftp:\\/\\/" + domainPortWithUrlRegEx + "|ftp\\." + domainPortWithUrlRegEx, 'i'),
|
|
46
|
-
normalizeUrl: function (url) { return (new RegExp('^ftp:\\/\\/', 'i').test(url) ? url : 'ftp://' + url); },
|
|
47
|
-
},
|
|
48
|
-
news: { match: new RegExp("^news:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
49
|
-
telnet: { match: new RegExp("^telnet:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
50
|
-
gopher: { match: new RegExp("^gopher:\\/\\/" + domainPortWithUrlRegEx, 'i') },
|
|
51
|
-
wais: { match: new RegExp("^wais:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Try to match a given string with link match rules, return matched link
|
|
55
|
-
* @param url Input url to match
|
|
56
|
-
* @param option Link match option, exact or partial. If it is exact match, we need
|
|
57
|
-
* to check the length of matched link and url
|
|
58
|
-
* @param rules Optional link match rules, if not passed, only the default link match
|
|
59
|
-
* rules will be applied
|
|
60
|
-
* @returns The matched link data, or null if no match found.
|
|
61
|
-
* The link data includes an original url and a normalized url
|
|
62
|
-
*/
|
|
63
|
-
export function matchLink(url) {
|
|
64
|
-
var e_1, _a;
|
|
65
|
-
if (url) {
|
|
66
|
-
try {
|
|
67
|
-
for (var _b = __values(getObjectKeys(linkMatchRules)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
68
|
-
var schema = _c.value;
|
|
69
|
-
var rule = linkMatchRules[schema];
|
|
70
|
-
var matches = url.match(rule.match);
|
|
71
|
-
if (matches && matches[0] == url && (!rule.except || !rule.except.test(url))) {
|
|
72
|
-
return {
|
|
73
|
-
scheme: schema,
|
|
74
|
-
originalUrl: url,
|
|
75
|
-
normalizedUrl: rule.normalizeUrl ? rule.normalizeUrl(url) : url,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
81
|
-
finally {
|
|
82
|
-
try {
|
|
83
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
84
|
-
}
|
|
85
|
-
finally { if (e_1) throw e_1.error; }
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
1
|
+
import { __values } from "tslib";
|
|
2
|
+
import { getObjectKeys } from 'roosterjs-content-model-dom';
|
|
3
|
+
// http exclude matching regex
|
|
4
|
+
// invalid URL example (in particular on IE and Edge):
|
|
5
|
+
// - http://www.bing.com%00, %00 before ? (question mark) is considered invalid. IE/Edge throws invalid argument exception
|
|
6
|
+
// - http://www.bing.com%1, %1 is invalid
|
|
7
|
+
// - http://www.bing.com%g, %g is invalid (IE and Edge expects a two hex value after a %)
|
|
8
|
+
// - http://www.bing.com%, % as ending is invalid (IE and Edge expects a two hex value after a %)
|
|
9
|
+
// All above % cases if they're after ? (question mark) is then considered valid again
|
|
10
|
+
// Similar for @, it needs to be after / (forward slash), or ? (question mark). Otherwise IE/Edge will throw security exception
|
|
11
|
+
// - http://www.bing.com@name, @name before ? (question mark) is considered invalid
|
|
12
|
+
// - http://www.bing.com/@name, is valid sine it is after / (forward slash)
|
|
13
|
+
// - http://www.bing.com?@name, is also valid since it is after ? (question mark)
|
|
14
|
+
// The regex below is essentially a break down of:
|
|
15
|
+
// ^[^?]+%[^0-9a-f]+ => to exclude URL like www.bing.com%%
|
|
16
|
+
// ^[^?]+%[0-9a-f][^0-9a-f]+ => to exclude URL like www.bing.com%1
|
|
17
|
+
// ^[^?]+%00 => to exclude URL like www.bing.com%00
|
|
18
|
+
// ^[^?]+%$ => to exclude URL like www.bing.com%
|
|
19
|
+
// ^https?:\/\/[^?\/]+@ => to exclude URL like http://www.bing.com@name
|
|
20
|
+
// ^www\.[^?\/]+@ => to exclude URL like www.bing.com@name
|
|
21
|
+
// , => to exclude url like www.bing,,com
|
|
22
|
+
var httpExcludeRegEx = /^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\/\/[^?\/]+@|^www\.[^?\/]+@/i;
|
|
23
|
+
// via https://tools.ietf.org/html/rfc1035 Page 7
|
|
24
|
+
var labelRegEx = '[a-z0-9](?:[a-z0-9-]*[a-z0-9])?'; // We're using case insensitive regexps below so don't bother including A-Z
|
|
25
|
+
var domainNameRegEx = "(?:" + labelRegEx + "\\.)*" + labelRegEx;
|
|
26
|
+
var domainPortRegEx = domainNameRegEx + "(?:\\:[0-9]+)?";
|
|
27
|
+
var domainPortWithUrlRegEx = domainPortRegEx + "(?:[\\/\\?]\\S*)?";
|
|
28
|
+
var linkMatchRules = {
|
|
29
|
+
http: {
|
|
30
|
+
match: new RegExp("^(?:microsoft-edge:)?http:\\/\\/" + domainPortWithUrlRegEx + "|www\\." + domainPortWithUrlRegEx, 'i'),
|
|
31
|
+
except: httpExcludeRegEx,
|
|
32
|
+
normalizeUrl: function (url) {
|
|
33
|
+
return new RegExp('^(?:microsoft-edge:)?http:\\/\\/', 'i').test(url) ? url : 'http://' + url;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
https: {
|
|
37
|
+
match: new RegExp("^(?:microsoft-edge:)?https:\\/\\/" + domainPortWithUrlRegEx, 'i'),
|
|
38
|
+
except: httpExcludeRegEx,
|
|
39
|
+
},
|
|
40
|
+
mailto: { match: new RegExp('^mailto:\\S+@\\S+\\.\\S+', 'i') },
|
|
41
|
+
notes: { match: new RegExp('^notes:\\/\\/\\S+', 'i') },
|
|
42
|
+
file: { match: new RegExp('^file:\\/\\/\\/?\\S+', 'i') },
|
|
43
|
+
unc: { match: new RegExp('^\\\\\\\\\\S+', 'i') },
|
|
44
|
+
ftp: {
|
|
45
|
+
match: new RegExp("^ftp:\\/\\/" + domainPortWithUrlRegEx + "|ftp\\." + domainPortWithUrlRegEx, 'i'),
|
|
46
|
+
normalizeUrl: function (url) { return (new RegExp('^ftp:\\/\\/', 'i').test(url) ? url : 'ftp://' + url); },
|
|
47
|
+
},
|
|
48
|
+
news: { match: new RegExp("^news:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
49
|
+
telnet: { match: new RegExp("^telnet:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
50
|
+
gopher: { match: new RegExp("^gopher:\\/\\/" + domainPortWithUrlRegEx, 'i') },
|
|
51
|
+
wais: { match: new RegExp("^wais:(\\/\\/)?" + domainPortWithUrlRegEx, 'i') },
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Try to match a given string with link match rules, return matched link
|
|
55
|
+
* @param url Input url to match
|
|
56
|
+
* @param option Link match option, exact or partial. If it is exact match, we need
|
|
57
|
+
* to check the length of matched link and url
|
|
58
|
+
* @param rules Optional link match rules, if not passed, only the default link match
|
|
59
|
+
* rules will be applied
|
|
60
|
+
* @returns The matched link data, or null if no match found.
|
|
61
|
+
* The link data includes an original url and a normalized url
|
|
62
|
+
*/
|
|
63
|
+
export function matchLink(url) {
|
|
64
|
+
var e_1, _a;
|
|
65
|
+
if (url) {
|
|
66
|
+
try {
|
|
67
|
+
for (var _b = __values(getObjectKeys(linkMatchRules)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
68
|
+
var schema = _c.value;
|
|
69
|
+
var rule = linkMatchRules[schema];
|
|
70
|
+
var matches = url.match(rule.match);
|
|
71
|
+
if (matches && matches[0] == url && (!rule.except || !rule.except.test(url))) {
|
|
72
|
+
return {
|
|
73
|
+
scheme: schema,
|
|
74
|
+
originalUrl: url,
|
|
75
|
+
normalizedUrl: rule.normalizeUrl ? rule.normalizeUrl(url) : url,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
84
|
+
}
|
|
85
|
+
finally { if (e_1) throw e_1.error; }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
90
|
//# sourceMappingURL=matchLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/link/matchLink.ts"],"names":[],"mappings":"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","sourcesContent":["import { getObjectKeys } from 'roosterjs-content-model-dom';\nimport type { LinkData } from 'roosterjs-content-model-types';\n\ninterface LinkMatchRule {\n match: RegExp;\n except?: RegExp;\n normalizeUrl?: (url: string) => string;\n}\n\n// http exclude matching regex\n// invalid URL example (in particular on IE and Edge):\n// - http://www.bing.com%00, %00 before ? (question mark) is considered invalid. IE/Edge throws invalid argument exception\n// - http://www.bing.com%1, %1 is invalid\n// - http://www.bing.com%g, %g is invalid (IE and Edge expects a two hex value after a %)\n// - http://www.bing.com%, % as ending is invalid (IE and Edge expects a two hex value after a %)\n// All above % cases if they're after ? (question mark) is then considered valid again\n// Similar for @, it needs to be after / (forward slash), or ? (question mark). Otherwise IE/Edge will throw security exception\n// - http://www.bing.com@name, @name before ? (question mark) is considered invalid\n// - http://www.bing.com/@name, is valid sine it is after / (forward slash)\n// - http://www.bing.com?@name, is also valid since it is after ? (question mark)\n// The regex below is essentially a break down of:\n// ^[^?]+%[^0-9a-f]+ => to exclude URL like www.bing.com%%\n// ^[^?]+%[0-9a-f][^0-9a-f]+ => to exclude URL like www.bing.com%1\n// ^[^?]+%00 => to exclude URL like www.bing.com%00\n// ^[^?]+%$ => to exclude URL like www.bing.com%\n// ^https?:\\/\\/[^?\\/]+@ => to exclude URL like http://www.bing.com@name\n// ^www\\.[^?\\/]+@ => to exclude URL like www.bing.com@name\n// , => to exclude url like www.bing,,com\nconst httpExcludeRegEx = /^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\\/\\/[^?\\/]+@|^www\\.[^?\\/]+@/i;\n\n// via https://tools.ietf.org/html/rfc1035 Page 7\nconst labelRegEx = '[a-z0-9](?:[a-z0-9-]*[a-z0-9])?'; // We're using case insensitive regexps below so don't bother including A-Z\nconst domainNameRegEx = `(?:${labelRegEx}\\\\.)*${labelRegEx}`;\nconst domainPortRegEx = `${domainNameRegEx}(?:\\\\:[0-9]+)?`;\nconst domainPortWithUrlRegEx = `${domainPortRegEx}(?:[\\\\/\\\\?]\\\\S*)?`;\n\nconst linkMatchRules: Record<string, LinkMatchRule> = {\n http: {\n match: new RegExp(\n `^(?:microsoft-edge:)?http:\\\\/\\\\/${domainPortWithUrlRegEx}|www\\\\.${domainPortWithUrlRegEx}`,\n 'i'\n ),\n except: httpExcludeRegEx,\n normalizeUrl: url =>\n new RegExp('^(?:microsoft-edge:)?http:\\\\/\\\\/', 'i').test(url) ? url : 'http://' + url,\n },\n https: {\n match: new RegExp(`^(?:microsoft-edge:)?https:\\\\/\\\\/${domainPortWithUrlRegEx}`, 'i'),\n except: httpExcludeRegEx,\n },\n mailto: { match: new RegExp('^mailto:\\\\S+@\\\\S+\\\\.\\\\S+', 'i') },\n notes: { match: new RegExp('^notes:\\\\/\\\\/\\\\S+', 'i') },\n file: { match: new RegExp('^file:\\\\/\\\\/\\\\/?\\\\S+', 'i') },\n unc: { match: new RegExp('^\\\\\\\\\\\\\\\\\\\\S+', 'i') },\n ftp: {\n match: new RegExp(\n `^ftp:\\\\/\\\\/${domainPortWithUrlRegEx}|ftp\\\\.${domainPortWithUrlRegEx}`,\n 'i'\n ),\n normalizeUrl: url => (new RegExp('^ftp:\\\\/\\\\/', 'i').test(url) ? url : 'ftp://' + url),\n },\n news: { match: new RegExp(`^news:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\n telnet: { match: new RegExp(`^telnet:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\n gopher: { match: new RegExp(`^gopher:\\\\/\\\\/${domainPortWithUrlRegEx}`, 'i') },\n wais: { match: new RegExp(`^wais:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\n};\n\n/**\n * Try to match a given string with link match rules, return matched link\n * @param url Input url to match\n * @param option Link match option, exact or partial. If it is exact match, we need\n * to check the length of matched link and url\n * @param rules Optional link match rules, if not passed, only the default link match\n * rules will be applied\n * @returns The matched link data, or null if no match found.\n * The link data includes an original url and a normalized url\n */\nexport function matchLink(url: string): LinkData | null {\n if (url) {\n for (const schema of getObjectKeys(linkMatchRules)) {\n const rule = linkMatchRules[schema];\n const matches = url.match(rule.match);\n if (matches && matches[0] == url && (!rule.except || !rule.except.test(url))) {\n return {\n scheme: schema,\n originalUrl: url,\n normalizedUrl: rule.normalizeUrl ? rule.normalizeUrl(url) : url,\n };\n }\n }\n }\n\n return null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"matchLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/link/matchLink.ts"],"names":[],"mappings":"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","sourcesContent":["import { getObjectKeys } from 'roosterjs-content-model-dom';\r\nimport type { LinkData } from 'roosterjs-content-model-types';\r\n\r\ninterface LinkMatchRule {\r\n match: RegExp;\r\n except?: RegExp;\r\n normalizeUrl?: (url: string) => string;\r\n}\r\n\r\n// http exclude matching regex\r\n// invalid URL example (in particular on IE and Edge):\r\n// - http://www.bing.com%00, %00 before ? (question mark) is considered invalid. IE/Edge throws invalid argument exception\r\n// - http://www.bing.com%1, %1 is invalid\r\n// - http://www.bing.com%g, %g is invalid (IE and Edge expects a two hex value after a %)\r\n// - http://www.bing.com%, % as ending is invalid (IE and Edge expects a two hex value after a %)\r\n// All above % cases if they're after ? (question mark) is then considered valid again\r\n// Similar for @, it needs to be after / (forward slash), or ? (question mark). Otherwise IE/Edge will throw security exception\r\n// - http://www.bing.com@name, @name before ? (question mark) is considered invalid\r\n// - http://www.bing.com/@name, is valid sine it is after / (forward slash)\r\n// - http://www.bing.com?@name, is also valid since it is after ? (question mark)\r\n// The regex below is essentially a break down of:\r\n// ^[^?]+%[^0-9a-f]+ => to exclude URL like www.bing.com%%\r\n// ^[^?]+%[0-9a-f][^0-9a-f]+ => to exclude URL like www.bing.com%1\r\n// ^[^?]+%00 => to exclude URL like www.bing.com%00\r\n// ^[^?]+%$ => to exclude URL like www.bing.com%\r\n// ^https?:\\/\\/[^?\\/]+@ => to exclude URL like http://www.bing.com@name\r\n// ^www\\.[^?\\/]+@ => to exclude URL like www.bing.com@name\r\n// , => to exclude url like www.bing,,com\r\nconst httpExcludeRegEx = /^[^?]+%[^0-9a-f]+|^[^?]+%[0-9a-f][^0-9a-f]+|^[^?]+%00|^[^?]+%$|^https?:\\/\\/[^?\\/]+@|^www\\.[^?\\/]+@/i;\r\n\r\n// via https://tools.ietf.org/html/rfc1035 Page 7\r\nconst labelRegEx = '[a-z0-9](?:[a-z0-9-]*[a-z0-9])?'; // We're using case insensitive regexps below so don't bother including A-Z\r\nconst domainNameRegEx = `(?:${labelRegEx}\\\\.)*${labelRegEx}`;\r\nconst domainPortRegEx = `${domainNameRegEx}(?:\\\\:[0-9]+)?`;\r\nconst domainPortWithUrlRegEx = `${domainPortRegEx}(?:[\\\\/\\\\?]\\\\S*)?`;\r\n\r\nconst linkMatchRules: Record<string, LinkMatchRule> = {\r\n http: {\r\n match: new RegExp(\r\n `^(?:microsoft-edge:)?http:\\\\/\\\\/${domainPortWithUrlRegEx}|www\\\\.${domainPortWithUrlRegEx}`,\r\n 'i'\r\n ),\r\n except: httpExcludeRegEx,\r\n normalizeUrl: url =>\r\n new RegExp('^(?:microsoft-edge:)?http:\\\\/\\\\/', 'i').test(url) ? url : 'http://' + url,\r\n },\r\n https: {\r\n match: new RegExp(`^(?:microsoft-edge:)?https:\\\\/\\\\/${domainPortWithUrlRegEx}`, 'i'),\r\n except: httpExcludeRegEx,\r\n },\r\n mailto: { match: new RegExp('^mailto:\\\\S+@\\\\S+\\\\.\\\\S+', 'i') },\r\n notes: { match: new RegExp('^notes:\\\\/\\\\/\\\\S+', 'i') },\r\n file: { match: new RegExp('^file:\\\\/\\\\/\\\\/?\\\\S+', 'i') },\r\n unc: { match: new RegExp('^\\\\\\\\\\\\\\\\\\\\S+', 'i') },\r\n ftp: {\r\n match: new RegExp(\r\n `^ftp:\\\\/\\\\/${domainPortWithUrlRegEx}|ftp\\\\.${domainPortWithUrlRegEx}`,\r\n 'i'\r\n ),\r\n normalizeUrl: url => (new RegExp('^ftp:\\\\/\\\\/', 'i').test(url) ? url : 'ftp://' + url),\r\n },\r\n news: { match: new RegExp(`^news:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\r\n telnet: { match: new RegExp(`^telnet:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\r\n gopher: { match: new RegExp(`^gopher:\\\\/\\\\/${domainPortWithUrlRegEx}`, 'i') },\r\n wais: { match: new RegExp(`^wais:(\\\\/\\\\/)?${domainPortWithUrlRegEx}`, 'i') },\r\n};\r\n\r\n/**\r\n * Try to match a given string with link match rules, return matched link\r\n * @param url Input url to match\r\n * @param option Link match option, exact or partial. If it is exact match, we need\r\n * to check the length of matched link and url\r\n * @param rules Optional link match rules, if not passed, only the default link match\r\n * rules will be applied\r\n * @returns The matched link data, or null if no match found.\r\n * The link data includes an original url and a normalized url\r\n */\r\nexport function matchLink(url: string): LinkData | null {\r\n if (url) {\r\n for (const schema of getObjectKeys(linkMatchRules)) {\r\n const rule = linkMatchRules[schema];\r\n const matches = url.match(rule.match);\r\n if (matches && matches[0] == url && (!rule.except || !rule.except.test(url))) {\r\n return {\r\n scheme: schema,\r\n originalUrl: url,\r\n normalizedUrl: rule.normalizeUrl ? rule.normalizeUrl(url) : url,\r\n };\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { AutoLinkOptions, ContentModelText, PromotedLink, ShallowMutableContentModelParagraph } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Promote the given text segment to a hyper link when the segment text is ending with a valid link format.
|
|
4
|
-
* When the whole text segment if of a link, promote the whole segment.
|
|
5
|
-
* When the text segment ends with a link format, split the segment and promote the second part
|
|
6
|
-
* When link is in middle of the text segment, no action.
|
|
7
|
-
* This is mainly used for doing auto link when there is a link before cursor
|
|
8
|
-
* @param segment The text segment to search link text from
|
|
9
|
-
* @param paragraph Parent paragraph of the segment
|
|
10
|
-
* @param options Options of auto link
|
|
11
|
-
* @returns If a link is promoted, return this segment. Otherwise return null
|
|
12
|
-
*/
|
|
13
|
-
export declare function promoteLink(segment: ContentModelText, paragraph: ShallowMutableContentModelParagraph, autoLinkOptions: AutoLinkOptions): ContentModelText | null;
|
|
14
|
-
/**
|
|
15
|
-
* Verify if the link can be promoted
|
|
16
|
-
* @param segment The text segment to search link text from
|
|
17
|
-
* @param options Options of auto link
|
|
18
|
-
* @returns if a link can be promoted
|
|
19
|
-
*/
|
|
20
|
-
export declare function getPromoteLink(segment: ContentModelText, autoLinkOptions: AutoLinkOptions): PromotedLink | undefined;
|
|
1
|
+
import type { AutoLinkOptions, ContentModelText, PromotedLink, ShallowMutableContentModelParagraph } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Promote the given text segment to a hyper link when the segment text is ending with a valid link format.
|
|
4
|
+
* When the whole text segment if of a link, promote the whole segment.
|
|
5
|
+
* When the text segment ends with a link format, split the segment and promote the second part
|
|
6
|
+
* When link is in middle of the text segment, no action.
|
|
7
|
+
* This is mainly used for doing auto link when there is a link before cursor
|
|
8
|
+
* @param segment The text segment to search link text from
|
|
9
|
+
* @param paragraph Parent paragraph of the segment
|
|
10
|
+
* @param options Options of auto link
|
|
11
|
+
* @returns If a link is promoted, return this segment. Otherwise return null
|
|
12
|
+
*/
|
|
13
|
+
export declare function promoteLink(segment: ContentModelText, paragraph: ShallowMutableContentModelParagraph, autoLinkOptions: AutoLinkOptions): ContentModelText | null;
|
|
14
|
+
/**
|
|
15
|
+
* Verify if the link can be promoted
|
|
16
|
+
* @param segment The text segment to search link text from
|
|
17
|
+
* @param options Options of auto link
|
|
18
|
+
* @returns if a link can be promoted
|
|
19
|
+
*/
|
|
20
|
+
export declare function getPromoteLink(segment: ContentModelText, autoLinkOptions: AutoLinkOptions): PromotedLink | undefined;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { getLinkUrl } from './getLinkUrl';
|
|
2
|
-
import { splitTextSegment } from '../../publicApi/segment/splitTextSegment';
|
|
3
|
-
/**
|
|
4
|
-
* Promote the given text segment to a hyper link when the segment text is ending with a valid link format.
|
|
5
|
-
* When the whole text segment if of a link, promote the whole segment.
|
|
6
|
-
* When the text segment ends with a link format, split the segment and promote the second part
|
|
7
|
-
* When link is in middle of the text segment, no action.
|
|
8
|
-
* This is mainly used for doing auto link when there is a link before cursor
|
|
9
|
-
* @param segment The text segment to search link text from
|
|
10
|
-
* @param paragraph Parent paragraph of the segment
|
|
11
|
-
* @param options Options of auto link
|
|
12
|
-
* @returns If a link is promoted, return this segment. Otherwise return null
|
|
13
|
-
*/
|
|
14
|
-
export function promoteLink(segment, paragraph, autoLinkOptions) {
|
|
15
|
-
if (segment.link) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
var promotedLink = getPromoteLink(segment, autoLinkOptions);
|
|
19
|
-
if (promotedLink) {
|
|
20
|
-
var linkSegment = splitTextSegment(segment, paragraph, segment.text.length - promotedLink.label.trimLeft().length, segment.text.trimRight().length);
|
|
21
|
-
linkSegment.link = {
|
|
22
|
-
format: {
|
|
23
|
-
href: promotedLink.href,
|
|
24
|
-
underline: true,
|
|
25
|
-
},
|
|
26
|
-
dataset: {},
|
|
27
|
-
};
|
|
28
|
-
return linkSegment;
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Verify if the link can be promoted
|
|
34
|
-
* @param segment The text segment to search link text from
|
|
35
|
-
* @param options Options of auto link
|
|
36
|
-
* @returns if a link can be promoted
|
|
37
|
-
*/
|
|
38
|
-
export function getPromoteLink(segment, autoLinkOptions) {
|
|
39
|
-
var link = segment.text.split(' ').pop();
|
|
40
|
-
var url = link === null || link === void 0 ? void 0 : link.trim();
|
|
41
|
-
var linkUrl = undefined;
|
|
42
|
-
if (url && link && (linkUrl = getLinkUrl(url, autoLinkOptions))) {
|
|
43
|
-
return {
|
|
44
|
-
label: link,
|
|
45
|
-
href: linkUrl,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
1
|
+
import { getLinkUrl } from './getLinkUrl';
|
|
2
|
+
import { splitTextSegment } from '../../publicApi/segment/splitTextSegment';
|
|
3
|
+
/**
|
|
4
|
+
* Promote the given text segment to a hyper link when the segment text is ending with a valid link format.
|
|
5
|
+
* When the whole text segment if of a link, promote the whole segment.
|
|
6
|
+
* When the text segment ends with a link format, split the segment and promote the second part
|
|
7
|
+
* When link is in middle of the text segment, no action.
|
|
8
|
+
* This is mainly used for doing auto link when there is a link before cursor
|
|
9
|
+
* @param segment The text segment to search link text from
|
|
10
|
+
* @param paragraph Parent paragraph of the segment
|
|
11
|
+
* @param options Options of auto link
|
|
12
|
+
* @returns If a link is promoted, return this segment. Otherwise return null
|
|
13
|
+
*/
|
|
14
|
+
export function promoteLink(segment, paragraph, autoLinkOptions) {
|
|
15
|
+
if (segment.link) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
var promotedLink = getPromoteLink(segment, autoLinkOptions);
|
|
19
|
+
if (promotedLink) {
|
|
20
|
+
var linkSegment = splitTextSegment(segment, paragraph, segment.text.length - promotedLink.label.trimLeft().length, segment.text.trimRight().length);
|
|
21
|
+
linkSegment.link = {
|
|
22
|
+
format: {
|
|
23
|
+
href: promotedLink.href,
|
|
24
|
+
underline: true,
|
|
25
|
+
},
|
|
26
|
+
dataset: {},
|
|
27
|
+
};
|
|
28
|
+
return linkSegment;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Verify if the link can be promoted
|
|
34
|
+
* @param segment The text segment to search link text from
|
|
35
|
+
* @param options Options of auto link
|
|
36
|
+
* @returns if a link can be promoted
|
|
37
|
+
*/
|
|
38
|
+
export function getPromoteLink(segment, autoLinkOptions) {
|
|
39
|
+
var link = segment.text.split(' ').pop();
|
|
40
|
+
var url = link === null || link === void 0 ? void 0 : link.trim();
|
|
41
|
+
var linkUrl = undefined;
|
|
42
|
+
if (url && link && (linkUrl = getLinkUrl(url, autoLinkOptions))) {
|
|
43
|
+
return {
|
|
44
|
+
label: link,
|
|
45
|
+
href: linkUrl,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
50
|
//# sourceMappingURL=promoteLink.js.map
|