roosterjs-content-model-plugins 0.26.0 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/autoFormat/AutoFormatPlugin.d.ts +53 -53
- package/lib/autoFormat/AutoFormatPlugin.js +80 -80
- package/lib/autoFormat/AutoFormatPlugin.js.map +1 -1
- package/lib/autoFormat/keyboardListTrigger.d.ts +5 -5
- package/lib/autoFormat/keyboardListTrigger.js +45 -45
- package/lib/autoFormat/keyboardListTrigger.js.map +1 -1
- package/lib/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
- package/lib/autoFormat/utils/convertAlphaToDecimals.js +22 -22
- package/lib/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
- package/lib/autoFormat/utils/getIndex.d.ts +4 -4
- package/lib/autoFormat/utils/getIndex.js +13 -13
- package/lib/autoFormat/utils/getIndex.js.map +1 -1
- package/lib/autoFormat/utils/getListTypeStyle.d.ts +14 -14
- package/lib/autoFormat/utils/getListTypeStyle.js +87 -87
- package/lib/autoFormat/utils/getListTypeStyle.js.map +1 -1
- package/lib/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
- package/lib/autoFormat/utils/getNumberingListStyle.js +153 -153
- package/lib/autoFormat/utils/getNumberingListStyle.js.map +1 -1
- package/lib/edit/EditPlugin.d.ts +39 -39
- package/lib/edit/EditPlugin.js +128 -128
- package/lib/edit/EditPlugin.js.map +1 -1
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.js +22 -22
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
- package/lib/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
- package/lib/edit/deleteSteps/deleteCollapsedSelection.js +93 -93
- package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib/edit/deleteSteps/deleteList.d.ts +5 -5
- package/lib/edit/deleteSteps/deleteList.js +23 -23
- package/lib/edit/deleteSteps/deleteList.js.map +1 -1
- package/lib/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib/edit/deleteSteps/deleteWordSelection.js +173 -173
- package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib/edit/handleKeyboardEventCommon.d.ts +14 -14
- package/lib/edit/handleKeyboardEventCommon.js +54 -54
- package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib/edit/inputSteps/handleEnterOnList.d.ts +5 -5
- package/lib/edit/inputSteps/handleEnterOnList.js +67 -67
- package/lib/edit/inputSteps/handleEnterOnList.js.map +1 -1
- package/lib/edit/keyboardDelete.d.ts +9 -9
- package/lib/edit/keyboardDelete.js +71 -71
- package/lib/edit/keyboardDelete.js.map +1 -1
- package/lib/edit/keyboardInput.d.ts +5 -5
- package/lib/edit/keyboardInput.js +58 -58
- package/lib/edit/keyboardInput.js.map +1 -1
- package/lib/edit/keyboardTab.d.ts +5 -5
- package/lib/edit/keyboardTab.js +34 -34
- package/lib/edit/keyboardTab.js.map +1 -1
- package/lib/edit/utils/getLeafSiblingBlock.d.ts +23 -23
- package/lib/edit/utils/getLeafSiblingBlock.js +75 -75
- package/lib/edit/utils/getLeafSiblingBlock.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
- package/lib/paste/Excel/processPastedContentFromExcel.js +82 -82
- package/lib/paste/Excel/processPastedContentFromExcel.js.map +1 -1
- package/lib/paste/PastePlugin.d.ts +43 -43
- package/lib/paste/PastePlugin.js +130 -130
- package/lib/paste/PastePlugin.js.map +1 -1
- package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
- package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js +19 -19
- package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
- package/lib/paste/WacComponents/constants.d.ts +48 -48
- package/lib/paste/WacComponents/constants.js +62 -62
- package/lib/paste/WacComponents/constants.js.map +1 -1
- package/lib/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
- package/lib/paste/WacComponents/processPastedContentWacComponents.js +188 -188
- package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib/paste/WordDesktop/WordMetadata.d.ts +9 -9
- package/lib/paste/WordDesktop/WordMetadata.js +2 -2
- package/lib/paste/WordDesktop/WordMetadata.js.map +1 -1
- package/lib/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
- package/lib/paste/WordDesktop/getStyleMetadata.js +78 -78
- package/lib/paste/WordDesktop/getStyleMetadata.js.map +1 -1
- package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
- package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +58 -58
- package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
- package/lib/paste/WordDesktop/processWordComments.d.ts +7 -7
- package/lib/paste/WordDesktop/processWordComments.js +21 -21
- package/lib/paste/WordDesktop/processWordComments.js.map +1 -1
- package/lib/paste/WordDesktop/processWordLists.d.ts +11 -11
- package/lib/paste/WordDesktop/processWordLists.js +179 -179
- package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
- package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js +13 -13
- package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
- package/lib/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib/paste/pasteSourceValidations/constants.js +20 -20
- package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
- package/lib/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/documentContainWacElements.js +15 -15
- package/lib/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
- package/lib/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
- package/lib/paste/pasteSourceValidations/getPasteSource.js +43 -43
- package/lib/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js +17 -17
- package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js +19 -19
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js +15 -15
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +15 -15
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js +19 -19
- package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
- package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js +18 -18
- package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
- package/lib/paste/utils/addParser.d.ts +5 -5
- package/lib/paste/utils/addParser.js +16 -16
- package/lib/paste/utils/addParser.js.map +1 -1
- package/lib/paste/utils/deprecatedColorParser.d.ts +5 -5
- package/lib/paste/utils/deprecatedColorParser.js +19 -19
- package/lib/paste/utils/deprecatedColorParser.js.map +1 -1
- package/lib/paste/utils/getStyles.d.ts +6 -6
- package/lib/paste/utils/getStyles.js +22 -22
- package/lib/paste/utils/getStyles.js.map +1 -1
- package/lib/paste/utils/linkParser.d.ts +5 -5
- package/lib/paste/utils/linkParser.js +27 -27
- package/lib/paste/utils/linkParser.js.map +1 -1
- package/lib/paste/utils/setProcessor.d.ts +5 -5
- package/lib/paste/utils/setProcessor.js +13 -13
- package/lib/paste/utils/setProcessor.js.map +1 -1
- package/lib/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
- package/lib/pluginUtils/CreateElement/CreateElementData.js +2 -2
- package/lib/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
- package/lib/pluginUtils/CreateElement/createElement.d.ts +9 -9
- package/lib/pluginUtils/CreateElement/createElement.js +50 -50
- package/lib/pluginUtils/CreateElement/createElement.js.map +1 -1
- package/lib/pluginUtils/Disposable.d.ts +10 -10
- package/lib/pluginUtils/Disposable.js +2 -2
- package/lib/pluginUtils/Disposable.js.map +1 -1
- package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
- package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js +2 -2
- package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
- package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
- package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js +119 -119
- package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
- package/lib/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
- package/lib/pluginUtils/Rect/getIntersectedRect.js +44 -44
- package/lib/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
- package/lib/pluginUtils/Rect/normalizeRect.d.ts +7 -7
- package/lib/pluginUtils/Rect/normalizeRect.js +19 -19
- package/lib/pluginUtils/Rect/normalizeRect.js.map +1 -1
- package/lib-amd/autoFormat/AutoFormatPlugin.d.ts +53 -53
- package/lib-amd/autoFormat/AutoFormatPlugin.js +81 -81
- package/lib-amd/autoFormat/AutoFormatPlugin.js.map +1 -1
- package/lib-amd/autoFormat/keyboardListTrigger.d.ts +5 -5
- package/lib-amd/autoFormat/keyboardListTrigger.js +43 -43
- package/lib-amd/autoFormat/keyboardListTrigger.js.map +1 -1
- package/lib-amd/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
- package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js +24 -24
- package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
- package/lib-amd/autoFormat/utils/getIndex.d.ts +4 -4
- package/lib-amd/autoFormat/utils/getIndex.js +14 -14
- package/lib-amd/autoFormat/utils/getIndex.js.map +1 -1
- package/lib-amd/autoFormat/utils/getListTypeStyle.d.ts +14 -14
- package/lib-amd/autoFormat/utils/getListTypeStyle.js +86 -86
- package/lib-amd/autoFormat/utils/getListTypeStyle.js.map +1 -1
- package/lib-amd/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
- package/lib-amd/autoFormat/utils/getNumberingListStyle.js +153 -153
- package/lib-amd/autoFormat/utils/getNumberingListStyle.js.map +1 -1
- package/lib-amd/edit/EditPlugin.d.ts +39 -39
- package/lib-amd/edit/EditPlugin.js +127 -127
- package/lib-amd/edit/EditPlugin.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js +23 -23
- package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
- package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js +92 -92
- package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteList.d.ts +5 -5
- package/lib-amd/edit/deleteSteps/deleteList.js +24 -24
- package/lib-amd/edit/deleteSteps/deleteList.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib-amd/edit/deleteSteps/deleteWordSelection.js +172 -172
- package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib-amd/edit/handleKeyboardEventCommon.d.ts +14 -14
- package/lib-amd/edit/handleKeyboardEventCommon.js +55 -55
- package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib-amd/edit/inputSteps/handleEnterOnList.d.ts +5 -5
- package/lib-amd/edit/inputSteps/handleEnterOnList.js +66 -66
- package/lib-amd/edit/inputSteps/handleEnterOnList.js.map +1 -1
- package/lib-amd/edit/keyboardDelete.d.ts +9 -9
- package/lib-amd/edit/keyboardDelete.js +66 -66
- package/lib-amd/edit/keyboardDelete.js.map +1 -1
- package/lib-amd/edit/keyboardInput.d.ts +5 -5
- package/lib-amd/edit/keyboardInput.js +57 -57
- package/lib-amd/edit/keyboardInput.js.map +1 -1
- package/lib-amd/edit/keyboardTab.d.ts +5 -5
- package/lib-amd/edit/keyboardTab.js +34 -34
- package/lib-amd/edit/keyboardTab.js.map +1 -1
- package/lib-amd/edit/utils/getLeafSiblingBlock.d.ts +23 -23
- package/lib-amd/edit/utils/getLeafSiblingBlock.js +75 -75
- package/lib-amd/edit/utils/getLeafSiblingBlock.js.map +1 -1
- package/lib-amd/index.d.ts +3 -3
- package/lib-amd/index.js +8 -8
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
- package/lib-amd/paste/Excel/processPastedContentFromExcel.js +80 -80
- package/lib-amd/paste/Excel/processPastedContentFromExcel.js.map +1 -1
- package/lib-amd/paste/PastePlugin.d.ts +43 -43
- package/lib-amd/paste/PastePlugin.js +122 -122
- package/lib-amd/paste/PastePlugin.js.map +1 -1
- package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
- package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js +20 -20
- package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
- package/lib-amd/paste/WacComponents/constants.d.ts +48 -48
- package/lib-amd/paste/WacComponents/constants.js +63 -63
- package/lib-amd/paste/WacComponents/constants.js.map +1 -1
- package/lib-amd/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
- package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +185 -185
- package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib-amd/paste/WordDesktop/WordMetadata.d.ts +9 -9
- package/lib-amd/paste/WordDesktop/WordMetadata.js +4 -4
- package/lib-amd/paste/WordDesktop/WordMetadata.js.map +1 -1
- package/lib-amd/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
- package/lib-amd/paste/WordDesktop/getStyleMetadata.js +78 -78
- package/lib-amd/paste/WordDesktop/getStyleMetadata.js.map +1 -1
- package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
- package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +53 -53
- package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
- package/lib-amd/paste/WordDesktop/processWordComments.d.ts +7 -7
- package/lib-amd/paste/WordDesktop/processWordComments.js +22 -22
- package/lib-amd/paste/WordDesktop/processWordComments.js.map +1 -1
- package/lib-amd/paste/WordDesktop/processWordLists.d.ts +11 -11
- package/lib-amd/paste/WordDesktop/processWordLists.js +177 -177
- package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
- package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js +15 -15
- package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib-amd/paste/pasteSourceValidations/constants.js +22 -22
- package/lib-amd/paste/pasteSourceValidations/constants.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js +16 -16
- package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
- package/lib-amd/paste/pasteSourceValidations/getPasteSource.js +38 -38
- package/lib-amd/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js +18 -18
- package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js +20 -20
- package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js +16 -16
- package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +16 -16
- package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
- package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js +20 -20
- package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
- package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js +20 -20
- package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
- package/lib-amd/paste/utils/addParser.d.ts +5 -5
- package/lib-amd/paste/utils/addParser.js +18 -18
- package/lib-amd/paste/utils/addParser.js.map +1 -1
- package/lib-amd/paste/utils/deprecatedColorParser.d.ts +5 -5
- package/lib-amd/paste/utils/deprecatedColorParser.js +20 -20
- package/lib-amd/paste/utils/deprecatedColorParser.js.map +1 -1
- package/lib-amd/paste/utils/getStyles.d.ts +6 -6
- package/lib-amd/paste/utils/getStyles.js +24 -24
- package/lib-amd/paste/utils/getStyles.js.map +1 -1
- package/lib-amd/paste/utils/linkParser.d.ts +5 -5
- package/lib-amd/paste/utils/linkParser.js +28 -28
- package/lib-amd/paste/utils/linkParser.js.map +1 -1
- package/lib-amd/paste/utils/setProcessor.d.ts +5 -5
- package/lib-amd/paste/utils/setProcessor.js +15 -15
- package/lib-amd/paste/utils/setProcessor.js.map +1 -1
- package/lib-amd/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
- package/lib-amd/pluginUtils/CreateElement/CreateElementData.js +4 -4
- package/lib-amd/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
- package/lib-amd/pluginUtils/CreateElement/createElement.d.ts +9 -9
- package/lib-amd/pluginUtils/CreateElement/createElement.js +51 -51
- package/lib-amd/pluginUtils/CreateElement/createElement.js.map +1 -1
- package/lib-amd/pluginUtils/Disposable.d.ts +10 -10
- package/lib-amd/pluginUtils/Disposable.js +4 -4
- package/lib-amd/pluginUtils/Disposable.js.map +1 -1
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js +4 -4
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js +120 -120
- package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
- package/lib-amd/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
- package/lib-amd/pluginUtils/Rect/getIntersectedRect.js +44 -44
- package/lib-amd/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
- package/lib-amd/pluginUtils/Rect/normalizeRect.d.ts +7 -7
- package/lib-amd/pluginUtils/Rect/normalizeRect.js +21 -21
- package/lib-amd/pluginUtils/Rect/normalizeRect.js.map +1 -1
- package/lib-mjs/autoFormat/AutoFormatPlugin.d.ts +53 -53
- package/lib-mjs/autoFormat/AutoFormatPlugin.js +77 -77
- package/lib-mjs/autoFormat/AutoFormatPlugin.js.map +1 -1
- package/lib-mjs/autoFormat/keyboardListTrigger.d.ts +5 -5
- package/lib-mjs/autoFormat/keyboardListTrigger.js +41 -41
- package/lib-mjs/autoFormat/keyboardListTrigger.js.map +1 -1
- package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
- package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js +18 -18
- package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
- package/lib-mjs/autoFormat/utils/getIndex.d.ts +4 -4
- package/lib-mjs/autoFormat/utils/getIndex.js +9 -9
- package/lib-mjs/autoFormat/utils/getIndex.js.map +1 -1
- package/lib-mjs/autoFormat/utils/getListTypeStyle.d.ts +14 -14
- package/lib-mjs/autoFormat/utils/getListTypeStyle.js +83 -83
- package/lib-mjs/autoFormat/utils/getListTypeStyle.js.map +1 -1
- package/lib-mjs/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
- package/lib-mjs/autoFormat/utils/getNumberingListStyle.js +149 -149
- package/lib-mjs/autoFormat/utils/getNumberingListStyle.js.map +1 -1
- package/lib-mjs/edit/EditPlugin.d.ts +39 -39
- package/lib-mjs/edit/EditPlugin.js +125 -125
- package/lib-mjs/edit/EditPlugin.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js +18 -18
- package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
- package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js +90 -90
- package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteList.d.ts +5 -5
- package/lib-mjs/edit/deleteSteps/deleteList.js +19 -19
- package/lib-mjs/edit/deleteSteps/deleteList.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.js +170 -170
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib-mjs/edit/handleKeyboardEventCommon.d.ts +14 -14
- package/lib-mjs/edit/handleKeyboardEventCommon.js +48 -48
- package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib-mjs/edit/inputSteps/handleEnterOnList.d.ts +5 -5
- package/lib-mjs/edit/inputSteps/handleEnterOnList.js +63 -63
- package/lib-mjs/edit/inputSteps/handleEnterOnList.js.map +1 -1
- package/lib-mjs/edit/keyboardDelete.d.ts +9 -9
- package/lib-mjs/edit/keyboardDelete.js +67 -67
- package/lib-mjs/edit/keyboardDelete.js.map +1 -1
- package/lib-mjs/edit/keyboardInput.d.ts +5 -5
- package/lib-mjs/edit/keyboardInput.js +54 -54
- package/lib-mjs/edit/keyboardInput.js.map +1 -1
- package/lib-mjs/edit/keyboardTab.d.ts +5 -5
- package/lib-mjs/edit/keyboardTab.js +30 -30
- package/lib-mjs/edit/keyboardTab.js.map +1 -1
- package/lib-mjs/edit/utils/getLeafSiblingBlock.d.ts +23 -23
- package/lib-mjs/edit/utils/getLeafSiblingBlock.js +71 -71
- package/lib-mjs/edit/utils/getLeafSiblingBlock.js.map +1 -1
- package/lib-mjs/index.d.ts +3 -3
- package/lib-mjs/index.js +3 -3
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +77 -77
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.js.map +1 -1
- package/lib-mjs/paste/PastePlugin.d.ts +43 -43
- package/lib-mjs/paste/PastePlugin.js +127 -127
- package/lib-mjs/paste/PastePlugin.js.map +1 -1
- package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
- package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js +15 -15
- package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
- package/lib-mjs/paste/WacComponents/constants.d.ts +48 -48
- package/lib-mjs/paste/WacComponents/constants.js +59 -59
- package/lib-mjs/paste/WacComponents/constants.js.map +1 -1
- package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
- package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +184 -184
- package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/WordMetadata.d.ts +9 -9
- package/lib-mjs/paste/WordDesktop/WordMetadata.js +1 -1
- package/lib-mjs/paste/WordDesktop/WordMetadata.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
- package/lib-mjs/paste/WordDesktop/getStyleMetadata.js +75 -75
- package/lib-mjs/paste/WordDesktop/getStyleMetadata.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
- package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +54 -54
- package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/processWordComments.d.ts +7 -7
- package/lib-mjs/paste/WordDesktop/processWordComments.js +17 -17
- package/lib-mjs/paste/WordDesktop/processWordComments.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/processWordLists.d.ts +11 -11
- package/lib-mjs/paste/WordDesktop/processWordLists.js +175 -175
- package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
- package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js +9 -9
- package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib-mjs/paste/pasteSourceValidations/constants.js +17 -17
- package/lib-mjs/paste/pasteSourceValidations/constants.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js +11 -11
- package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
- package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js +39 -39
- package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js +13 -13
- package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js +15 -15
- package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js +11 -11
- package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +11 -11
- package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
- package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js +15 -15
- package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
- package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js +14 -14
- package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
- package/lib-mjs/paste/utils/addParser.d.ts +5 -5
- package/lib-mjs/paste/utils/addParser.js +13 -13
- package/lib-mjs/paste/utils/addParser.js.map +1 -1
- package/lib-mjs/paste/utils/deprecatedColorParser.d.ts +5 -5
- package/lib-mjs/paste/utils/deprecatedColorParser.js +15 -15
- package/lib-mjs/paste/utils/deprecatedColorParser.js.map +1 -1
- package/lib-mjs/paste/utils/getStyles.d.ts +6 -6
- package/lib-mjs/paste/utils/getStyles.js +18 -18
- package/lib-mjs/paste/utils/getStyles.js.map +1 -1
- package/lib-mjs/paste/utils/linkParser.d.ts +5 -5
- package/lib-mjs/paste/utils/linkParser.js +23 -23
- package/lib-mjs/paste/utils/linkParser.js.map +1 -1
- package/lib-mjs/paste/utils/setProcessor.d.ts +5 -5
- package/lib-mjs/paste/utils/setProcessor.js +9 -9
- package/lib-mjs/paste/utils/setProcessor.js.map +1 -1
- package/lib-mjs/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
- package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js +1 -1
- package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
- package/lib-mjs/pluginUtils/CreateElement/createElement.d.ts +9 -9
- package/lib-mjs/pluginUtils/CreateElement/createElement.js +47 -47
- package/lib-mjs/pluginUtils/CreateElement/createElement.js.map +1 -1
- package/lib-mjs/pluginUtils/Disposable.d.ts +10 -10
- package/lib-mjs/pluginUtils/Disposable.js +1 -1
- package/lib-mjs/pluginUtils/Disposable.js.map +1 -1
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js +1 -1
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js +117 -117
- package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
- package/lib-mjs/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
- package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js +41 -41
- package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
- package/lib-mjs/pluginUtils/Rect/normalizeRect.d.ts +7 -7
- package/lib-mjs/pluginUtils/Rect/normalizeRect.js +16 -16
- package/lib-mjs/pluginUtils/Rect/normalizeRect.js.map +1 -1
- package/package.json +5 -5
package/lib/edit/EditPlugin.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* ContentModel edit plugins helps editor to do editing operation on top of content model.
|
|
4
|
-
* This includes:
|
|
5
|
-
* 1. Delete Key
|
|
6
|
-
* 2. Backspace Key
|
|
7
|
-
* 3. Tab Key
|
|
8
|
-
*/
|
|
9
|
-
export declare class EditPlugin implements EditorPlugin {
|
|
10
|
-
private editor;
|
|
11
|
-
private disposer;
|
|
12
|
-
private shouldHandleNextInputEvent;
|
|
13
|
-
/**
|
|
14
|
-
* Get name of this plugin
|
|
15
|
-
*/
|
|
16
|
-
getName(): string;
|
|
17
|
-
/**
|
|
18
|
-
* The first method that editor will call to a plugin when editor is initializing.
|
|
19
|
-
* It will pass in the editor instance, plugin should take this chance to save the
|
|
20
|
-
* editor reference so that it can call to any editor method or format API later.
|
|
21
|
-
* @param editor The editor object
|
|
22
|
-
*/
|
|
23
|
-
initialize(editor: IStandaloneEditor): void;
|
|
24
|
-
/**
|
|
25
|
-
* The last method that editor will call to a plugin before it is disposed.
|
|
26
|
-
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
27
|
-
* called, plugin should not call to any editor method since it will result in error.
|
|
28
|
-
*/
|
|
29
|
-
dispose(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
32
|
-
* method of each plugin to handle the event as long as the event is not handled
|
|
33
|
-
* exclusively by another plugin.
|
|
34
|
-
* @param event The event to handle:
|
|
35
|
-
*/
|
|
36
|
-
onPluginEvent(event: PluginEvent): void;
|
|
37
|
-
private handleKeyDownEvent;
|
|
38
|
-
private handleBeforeInputEvent;
|
|
39
|
-
}
|
|
1
|
+
import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* ContentModel edit plugins helps editor to do editing operation on top of content model.
|
|
4
|
+
* This includes:
|
|
5
|
+
* 1. Delete Key
|
|
6
|
+
* 2. Backspace Key
|
|
7
|
+
* 3. Tab Key
|
|
8
|
+
*/
|
|
9
|
+
export declare class EditPlugin implements EditorPlugin {
|
|
10
|
+
private editor;
|
|
11
|
+
private disposer;
|
|
12
|
+
private shouldHandleNextInputEvent;
|
|
13
|
+
/**
|
|
14
|
+
* Get name of this plugin
|
|
15
|
+
*/
|
|
16
|
+
getName(): string;
|
|
17
|
+
/**
|
|
18
|
+
* The first method that editor will call to a plugin when editor is initializing.
|
|
19
|
+
* It will pass in the editor instance, plugin should take this chance to save the
|
|
20
|
+
* editor reference so that it can call to any editor method or format API later.
|
|
21
|
+
* @param editor The editor object
|
|
22
|
+
*/
|
|
23
|
+
initialize(editor: IStandaloneEditor): void;
|
|
24
|
+
/**
|
|
25
|
+
* The last method that editor will call to a plugin before it is disposed.
|
|
26
|
+
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
27
|
+
* called, plugin should not call to any editor method since it will result in error.
|
|
28
|
+
*/
|
|
29
|
+
dispose(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
32
|
+
* method of each plugin to handle the event as long as the event is not handled
|
|
33
|
+
* exclusively by another plugin.
|
|
34
|
+
* @param event The event to handle:
|
|
35
|
+
*/
|
|
36
|
+
onPluginEvent(event: PluginEvent): void;
|
|
37
|
+
private handleKeyDownEvent;
|
|
38
|
+
private handleBeforeInputEvent;
|
|
39
|
+
}
|
package/lib/edit/EditPlugin.js
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EditPlugin = void 0;
|
|
4
|
-
var keyboardDelete_1 = require("./keyboardDelete");
|
|
5
|
-
var keyboardInput_1 = require("./keyboardInput");
|
|
6
|
-
var keyboardTab_1 = require("./keyboardTab");
|
|
7
|
-
var BACKSPACE_KEY = 8;
|
|
8
|
-
var DELETE_KEY = 46;
|
|
9
|
-
/**
|
|
10
|
-
* ContentModel edit plugins helps editor to do editing operation on top of content model.
|
|
11
|
-
* This includes:
|
|
12
|
-
* 1. Delete Key
|
|
13
|
-
* 2. Backspace Key
|
|
14
|
-
* 3. Tab Key
|
|
15
|
-
*/
|
|
16
|
-
var EditPlugin = /** @class */ (function () {
|
|
17
|
-
function EditPlugin() {
|
|
18
|
-
this.editor = null;
|
|
19
|
-
this.disposer = null;
|
|
20
|
-
this.shouldHandleNextInputEvent = false;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get name of this plugin
|
|
24
|
-
*/
|
|
25
|
-
EditPlugin.prototype.getName = function () {
|
|
26
|
-
return 'Edit';
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* The first method that editor will call to a plugin when editor is initializing.
|
|
30
|
-
* It will pass in the editor instance, plugin should take this chance to save the
|
|
31
|
-
* editor reference so that it can call to any editor method or format API later.
|
|
32
|
-
* @param editor The editor object
|
|
33
|
-
*/
|
|
34
|
-
EditPlugin.prototype.initialize = function (editor) {
|
|
35
|
-
var _this = this;
|
|
36
|
-
this.editor = editor;
|
|
37
|
-
if (editor.getEnvironment().isAndroid) {
|
|
38
|
-
this.disposer = this.editor.attachDomEvent({
|
|
39
|
-
beforeinput: {
|
|
40
|
-
beforeDispatch: function (e) { return _this.handleBeforeInputEvent(editor, e); },
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The last method that editor will call to a plugin before it is disposed.
|
|
47
|
-
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
48
|
-
* called, plugin should not call to any editor method since it will result in error.
|
|
49
|
-
*/
|
|
50
|
-
EditPlugin.prototype.dispose = function () {
|
|
51
|
-
var _a;
|
|
52
|
-
this.editor = null;
|
|
53
|
-
(_a = this.disposer) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
54
|
-
this.disposer = null;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
58
|
-
* method of each plugin to handle the event as long as the event is not handled
|
|
59
|
-
* exclusively by another plugin.
|
|
60
|
-
* @param event The event to handle:
|
|
61
|
-
*/
|
|
62
|
-
EditPlugin.prototype.onPluginEvent = function (event) {
|
|
63
|
-
if (this.editor) {
|
|
64
|
-
switch (event.eventType) {
|
|
65
|
-
case 'keyDown':
|
|
66
|
-
this.handleKeyDownEvent(this.editor, event);
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
EditPlugin.prototype.handleKeyDownEvent = function (editor, event) {
|
|
72
|
-
var rawEvent = event.rawEvent;
|
|
73
|
-
if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
|
|
74
|
-
switch (rawEvent.key) {
|
|
75
|
-
case 'Backspace':
|
|
76
|
-
case 'Delete':
|
|
77
|
-
// Use our API to handle BACKSPACE/DELETE key.
|
|
78
|
-
// No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache
|
|
79
|
-
(0, keyboardDelete_1.keyboardDelete)(editor, rawEvent);
|
|
80
|
-
break;
|
|
81
|
-
case 'Tab':
|
|
82
|
-
(0, keyboardTab_1.keyboardTab)(editor, rawEvent);
|
|
83
|
-
break;
|
|
84
|
-
case 'Unidentified':
|
|
85
|
-
if (editor.getEnvironment().isAndroid) {
|
|
86
|
-
this.shouldHandleNextInputEvent = true;
|
|
87
|
-
}
|
|
88
|
-
break;
|
|
89
|
-
case 'Enter':
|
|
90
|
-
default:
|
|
91
|
-
(0, keyboardInput_1.keyboardInput)(editor, rawEvent);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
EditPlugin.prototype.handleBeforeInputEvent = function (editor, rawEvent) {
|
|
97
|
-
// Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key
|
|
98
|
-
// Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic
|
|
99
|
-
if (!this.shouldHandleNextInputEvent ||
|
|
100
|
-
!(rawEvent instanceof InputEvent) ||
|
|
101
|
-
rawEvent.defaultPrevented) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
this.shouldHandleNextInputEvent = false;
|
|
105
|
-
var handled = false;
|
|
106
|
-
switch (rawEvent.inputType) {
|
|
107
|
-
case 'deleteContentBackward':
|
|
108
|
-
handled = (0, keyboardDelete_1.keyboardDelete)(editor, new KeyboardEvent('keydown', {
|
|
109
|
-
key: 'Backspace',
|
|
110
|
-
keyCode: BACKSPACE_KEY,
|
|
111
|
-
which: BACKSPACE_KEY,
|
|
112
|
-
}));
|
|
113
|
-
break;
|
|
114
|
-
case 'deleteContentForward':
|
|
115
|
-
handled = (0, keyboardDelete_1.keyboardDelete)(editor, new KeyboardEvent('keydown', {
|
|
116
|
-
key: 'Delete',
|
|
117
|
-
keyCode: DELETE_KEY,
|
|
118
|
-
which: DELETE_KEY,
|
|
119
|
-
}));
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
if (handled) {
|
|
123
|
-
rawEvent.preventDefault();
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
return EditPlugin;
|
|
127
|
-
}());
|
|
128
|
-
exports.EditPlugin = EditPlugin;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditPlugin = void 0;
|
|
4
|
+
var keyboardDelete_1 = require("./keyboardDelete");
|
|
5
|
+
var keyboardInput_1 = require("./keyboardInput");
|
|
6
|
+
var keyboardTab_1 = require("./keyboardTab");
|
|
7
|
+
var BACKSPACE_KEY = 8;
|
|
8
|
+
var DELETE_KEY = 46;
|
|
9
|
+
/**
|
|
10
|
+
* ContentModel edit plugins helps editor to do editing operation on top of content model.
|
|
11
|
+
* This includes:
|
|
12
|
+
* 1. Delete Key
|
|
13
|
+
* 2. Backspace Key
|
|
14
|
+
* 3. Tab Key
|
|
15
|
+
*/
|
|
16
|
+
var EditPlugin = /** @class */ (function () {
|
|
17
|
+
function EditPlugin() {
|
|
18
|
+
this.editor = null;
|
|
19
|
+
this.disposer = null;
|
|
20
|
+
this.shouldHandleNextInputEvent = false;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get name of this plugin
|
|
24
|
+
*/
|
|
25
|
+
EditPlugin.prototype.getName = function () {
|
|
26
|
+
return 'Edit';
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The first method that editor will call to a plugin when editor is initializing.
|
|
30
|
+
* It will pass in the editor instance, plugin should take this chance to save the
|
|
31
|
+
* editor reference so that it can call to any editor method or format API later.
|
|
32
|
+
* @param editor The editor object
|
|
33
|
+
*/
|
|
34
|
+
EditPlugin.prototype.initialize = function (editor) {
|
|
35
|
+
var _this = this;
|
|
36
|
+
this.editor = editor;
|
|
37
|
+
if (editor.getEnvironment().isAndroid) {
|
|
38
|
+
this.disposer = this.editor.attachDomEvent({
|
|
39
|
+
beforeinput: {
|
|
40
|
+
beforeDispatch: function (e) { return _this.handleBeforeInputEvent(editor, e); },
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The last method that editor will call to a plugin before it is disposed.
|
|
47
|
+
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
48
|
+
* called, plugin should not call to any editor method since it will result in error.
|
|
49
|
+
*/
|
|
50
|
+
EditPlugin.prototype.dispose = function () {
|
|
51
|
+
var _a;
|
|
52
|
+
this.editor = null;
|
|
53
|
+
(_a = this.disposer) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
54
|
+
this.disposer = null;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
58
|
+
* method of each plugin to handle the event as long as the event is not handled
|
|
59
|
+
* exclusively by another plugin.
|
|
60
|
+
* @param event The event to handle:
|
|
61
|
+
*/
|
|
62
|
+
EditPlugin.prototype.onPluginEvent = function (event) {
|
|
63
|
+
if (this.editor) {
|
|
64
|
+
switch (event.eventType) {
|
|
65
|
+
case 'keyDown':
|
|
66
|
+
this.handleKeyDownEvent(this.editor, event);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
EditPlugin.prototype.handleKeyDownEvent = function (editor, event) {
|
|
72
|
+
var rawEvent = event.rawEvent;
|
|
73
|
+
if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
|
|
74
|
+
switch (rawEvent.key) {
|
|
75
|
+
case 'Backspace':
|
|
76
|
+
case 'Delete':
|
|
77
|
+
// Use our API to handle BACKSPACE/DELETE key.
|
|
78
|
+
// No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache
|
|
79
|
+
(0, keyboardDelete_1.keyboardDelete)(editor, rawEvent);
|
|
80
|
+
break;
|
|
81
|
+
case 'Tab':
|
|
82
|
+
(0, keyboardTab_1.keyboardTab)(editor, rawEvent);
|
|
83
|
+
break;
|
|
84
|
+
case 'Unidentified':
|
|
85
|
+
if (editor.getEnvironment().isAndroid) {
|
|
86
|
+
this.shouldHandleNextInputEvent = true;
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
case 'Enter':
|
|
90
|
+
default:
|
|
91
|
+
(0, keyboardInput_1.keyboardInput)(editor, rawEvent);
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
EditPlugin.prototype.handleBeforeInputEvent = function (editor, rawEvent) {
|
|
97
|
+
// Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key
|
|
98
|
+
// Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic
|
|
99
|
+
if (!this.shouldHandleNextInputEvent ||
|
|
100
|
+
!(rawEvent instanceof InputEvent) ||
|
|
101
|
+
rawEvent.defaultPrevented) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.shouldHandleNextInputEvent = false;
|
|
105
|
+
var handled = false;
|
|
106
|
+
switch (rawEvent.inputType) {
|
|
107
|
+
case 'deleteContentBackward':
|
|
108
|
+
handled = (0, keyboardDelete_1.keyboardDelete)(editor, new KeyboardEvent('keydown', {
|
|
109
|
+
key: 'Backspace',
|
|
110
|
+
keyCode: BACKSPACE_KEY,
|
|
111
|
+
which: BACKSPACE_KEY,
|
|
112
|
+
}));
|
|
113
|
+
break;
|
|
114
|
+
case 'deleteContentForward':
|
|
115
|
+
handled = (0, keyboardDelete_1.keyboardDelete)(editor, new KeyboardEvent('keydown', {
|
|
116
|
+
key: 'Delete',
|
|
117
|
+
keyCode: DELETE_KEY,
|
|
118
|
+
which: DELETE_KEY,
|
|
119
|
+
}));
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (handled) {
|
|
123
|
+
rawEvent.preventDefault();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return EditPlugin;
|
|
127
|
+
}());
|
|
128
|
+
exports.EditPlugin = EditPlugin;
|
|
129
129
|
//# sourceMappingURL=EditPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts"],"names":[],"mappings":"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","sourcesContent":["import { keyboardDelete } from './keyboardDelete';\
|
|
1
|
+
{"version":3,"file":"EditPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts"],"names":[],"mappings":"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","sourcesContent":["import { keyboardDelete } from './keyboardDelete';\nimport { keyboardInput } from './keyboardInput';\nimport { keyboardTab } from './keyboardTab';\nimport type {\n EditorPlugin,\n IStandaloneEditor,\n KeyDownEvent,\n PluginEvent,\n} from 'roosterjs-content-model-types';\n\nconst BACKSPACE_KEY = 8;\nconst DELETE_KEY = 46;\n\n/**\n * ContentModel edit plugins helps editor to do editing operation on top of content model.\n * This includes:\n * 1. Delete Key\n * 2. Backspace Key\n * 3. Tab Key\n */\nexport class EditPlugin implements EditorPlugin {\n private editor: IStandaloneEditor | null = null;\n private disposer: (() => void) | null = null;\n private shouldHandleNextInputEvent = false;\n\n /**\n * Get name of this plugin\n */\n getName() {\n return 'Edit';\n }\n\n /**\n * The first method that editor will call to a plugin when editor is initializing.\n * It will pass in the editor instance, plugin should take this chance to save the\n * editor reference so that it can call to any editor method or format API later.\n * @param editor The editor object\n */\n initialize(editor: IStandaloneEditor) {\n this.editor = editor;\n if (editor.getEnvironment().isAndroid) {\n this.disposer = this.editor.attachDomEvent({\n beforeinput: {\n beforeDispatch: e => this.handleBeforeInputEvent(editor, e),\n },\n });\n }\n }\n\n /**\n * The last method that editor will call to a plugin before it is disposed.\n * Plugin can take this chance to clear the reference to editor. After this method is\n * called, plugin should not call to any editor method since it will result in error.\n */\n dispose() {\n this.editor = null;\n this.disposer?.();\n this.disposer = null;\n }\n\n /**\n * Core method for a plugin. Once an event happens in editor, editor will call this\n * method of each plugin to handle the event as long as the event is not handled\n * exclusively by another plugin.\n * @param event The event to handle:\n */\n onPluginEvent(event: PluginEvent) {\n if (this.editor) {\n switch (event.eventType) {\n case 'keyDown':\n this.handleKeyDownEvent(this.editor, event);\n break;\n }\n }\n }\n\n private handleKeyDownEvent(editor: IStandaloneEditor, event: KeyDownEvent) {\n const rawEvent = event.rawEvent;\n\n if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {\n switch (rawEvent.key) {\n case 'Backspace':\n case 'Delete':\n // Use our API to handle BACKSPACE/DELETE key.\n // No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache\n keyboardDelete(editor, rawEvent);\n break;\n\n case 'Tab':\n keyboardTab(editor, rawEvent);\n break;\n case 'Unidentified':\n if (editor.getEnvironment().isAndroid) {\n this.shouldHandleNextInputEvent = true;\n }\n break;\n\n case 'Enter':\n default:\n keyboardInput(editor, rawEvent);\n break;\n }\n }\n }\n\n private handleBeforeInputEvent(editor: IStandaloneEditor, rawEvent: Event) {\n // Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key\n // Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic\n if (\n !this.shouldHandleNextInputEvent ||\n !(rawEvent instanceof InputEvent) ||\n rawEvent.defaultPrevented\n ) {\n return;\n }\n this.shouldHandleNextInputEvent = false;\n\n let handled = false;\n switch (rawEvent.inputType) {\n case 'deleteContentBackward':\n handled = keyboardDelete(\n editor,\n new KeyboardEvent('keydown', {\n key: 'Backspace',\n keyCode: BACKSPACE_KEY,\n which: BACKSPACE_KEY,\n })\n );\n break;\n case 'deleteContentForward':\n handled = keyboardDelete(\n editor,\n new KeyboardEvent('keydown', {\n key: 'Delete',\n keyCode: DELETE_KEY,\n which: DELETE_KEY,\n })\n );\n break;\n }\n\n if (handled) {\n rawEvent.preventDefault();\n }\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const deleteAllSegmentBefore: DeleteSelectionStep;
|
|
1
|
+
import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const deleteAllSegmentBefore: DeleteSelectionStep;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteAllSegmentBefore = void 0;
|
|
4
|
-
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
var deleteAllSegmentBefore = function (context) {
|
|
9
|
-
if (context.deleteResult != 'notDeleted') {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
var _a = context.insertPoint, paragraph = _a.paragraph, marker = _a.marker;
|
|
13
|
-
var index = paragraph.segments.indexOf(marker);
|
|
14
|
-
for (var i = index - 1; i >= 0; i--) {
|
|
15
|
-
var segment = paragraph.segments[i];
|
|
16
|
-
segment.isSelected = true;
|
|
17
|
-
if ((0, roosterjs_content_model_core_1.deleteSegment)(paragraph, segment, context.formatContext)) {
|
|
18
|
-
context.deleteResult = 'range';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.deleteAllSegmentBefore = deleteAllSegmentBefore;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteAllSegmentBefore = void 0;
|
|
4
|
+
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
var deleteAllSegmentBefore = function (context) {
|
|
9
|
+
if (context.deleteResult != 'notDeleted') {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
var _a = context.insertPoint, paragraph = _a.paragraph, marker = _a.marker;
|
|
13
|
+
var index = paragraph.segments.indexOf(marker);
|
|
14
|
+
for (var i = index - 1; i >= 0; i--) {
|
|
15
|
+
var segment = paragraph.segments[i];
|
|
16
|
+
segment.isSelected = true;
|
|
17
|
+
if ((0, roosterjs_content_model_core_1.deleteSegment)(paragraph, segment, context.formatContext)) {
|
|
18
|
+
context.deleteResult = 'range';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.deleteAllSegmentBefore = deleteAllSegmentBefore;
|
|
23
23
|
//# sourceMappingURL=deleteAllSegmentBefore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteAllSegmentBefore.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteAllSegmentBefore.ts"],"names":[],"mappings":";;;AAAA,6EAA6D;AAG7D;;GAEG;AACI,IAAM,sBAAsB,GAAwB,UAAA,OAAO;IAC9D,IAAI,OAAO,CAAC,YAAY,IAAI,YAAY,EAAE;QACtC,OAAO;KACV;IAEK,IAAA,KAAwB,OAAO,CAAC,WAAW,EAAzC,SAAS,eAAA,EAAE,MAAM,YAAwB,CAAC;IAClD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,IAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;QAE1B,IAAI,IAAA,4CAAa,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE;YAC1D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;KACJ;AACL,CAAC,CAAC;AAjBW,QAAA,sBAAsB,0BAiBjC","sourcesContent":["import { deleteSegment } from 'roosterjs-content-model-core';\
|
|
1
|
+
{"version":3,"file":"deleteAllSegmentBefore.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteAllSegmentBefore.ts"],"names":[],"mappings":";;;AAAA,6EAA6D;AAG7D;;GAEG;AACI,IAAM,sBAAsB,GAAwB,UAAA,OAAO;IAC9D,IAAI,OAAO,CAAC,YAAY,IAAI,YAAY,EAAE;QACtC,OAAO;KACV;IAEK,IAAA,KAAwB,OAAO,CAAC,WAAW,EAAzC,SAAS,eAAA,EAAE,MAAM,YAAwB,CAAC;IAClD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,IAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;QAE1B,IAAI,IAAA,4CAAa,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE;YAC1D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;KACJ;AACL,CAAC,CAAC;AAjBW,QAAA,sBAAsB,0BAiBjC","sourcesContent":["import { deleteSegment } from 'roosterjs-content-model-core';\nimport type { DeleteSelectionStep } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const deleteAllSegmentBefore: DeleteSelectionStep = context => {\n if (context.deleteResult != 'notDeleted') {\n return;\n }\n\n const { paragraph, marker } = context.insertPoint;\n const index = paragraph.segments.indexOf(marker);\n\n for (let i = index - 1; i >= 0; i--) {\n const segment = paragraph.segments[i];\n\n segment.isSelected = true;\n\n if (deleteSegment(paragraph, segment, context.formatContext)) {\n context.deleteResult = 'range';\n }\n }\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal if we didn't delete anything, and we want to delete forward, now perform it
|
|
4
|
-
*/
|
|
5
|
-
export declare const forwardDeleteCollapsedSelection: DeleteSelectionStep;
|
|
6
|
-
/**
|
|
7
|
-
* @internal if we didn't delete anything, and we want to delete backward, now perform it
|
|
8
|
-
*/
|
|
9
|
-
export declare const backwardDeleteCollapsedSelection: DeleteSelectionStep;
|
|
1
|
+
import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal if we didn't delete anything, and we want to delete forward, now perform it
|
|
4
|
+
*/
|
|
5
|
+
export declare const forwardDeleteCollapsedSelection: DeleteSelectionStep;
|
|
6
|
+
/**
|
|
7
|
+
* @internal if we didn't delete anything, and we want to delete backward, now perform it
|
|
8
|
+
*/
|
|
9
|
+
export declare const backwardDeleteCollapsedSelection: DeleteSelectionStep;
|