roosterjs-content-model-plugins 0.26.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* Options to customize the Content Model Auto Format Plugin
|
|
4
|
-
*/
|
|
5
|
-
export declare type AutoFormatOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered. @default true
|
|
8
|
-
*/
|
|
9
|
-
autoBullet: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered. @default true
|
|
12
|
-
*/
|
|
13
|
-
autoNumbering: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.
|
|
17
|
-
* It can be customized with options to enable or disable auto list features.
|
|
18
|
-
*/
|
|
19
|
-
export declare class AutoFormatPlugin implements EditorPlugin {
|
|
20
|
-
private options;
|
|
21
|
-
private editor;
|
|
22
|
-
/**
|
|
23
|
-
* @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
|
|
24
|
-
* - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to true.
|
|
25
|
-
* - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to true.
|
|
26
|
-
*/
|
|
27
|
-
constructor(options?: AutoFormatOptions);
|
|
28
|
-
/**
|
|
29
|
-
* Get name of this plugin
|
|
30
|
-
*/
|
|
31
|
-
getName(): string;
|
|
32
|
-
/**
|
|
33
|
-
* The first method that editor will call to a plugin when editor is initializing.
|
|
34
|
-
* It will pass in the editor instance, plugin should take this chance to save the
|
|
35
|
-
* editor reference so that it can call to any editor method or format API later.
|
|
36
|
-
* @param editor The editor object
|
|
37
|
-
*/
|
|
38
|
-
initialize(editor: IStandaloneEditor): void;
|
|
39
|
-
/**
|
|
40
|
-
* The last method that editor will call to a plugin before it is disposed.
|
|
41
|
-
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
42
|
-
* called, plugin should not call to any editor method since it will result in error.
|
|
43
|
-
*/
|
|
44
|
-
dispose(): void;
|
|
45
|
-
/**
|
|
46
|
-
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
47
|
-
* method of each plugin to handle the event as long as the event is not handled
|
|
48
|
-
* exclusively by another plugin.
|
|
49
|
-
* @param event The event to handle:
|
|
50
|
-
*/
|
|
51
|
-
onPluginEvent(event: PluginEvent): void;
|
|
52
|
-
private handleKeyDownEvent;
|
|
53
|
-
}
|
|
1
|
+
import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Options to customize the Content Model Auto Format Plugin
|
|
4
|
+
*/
|
|
5
|
+
export declare type AutoFormatOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered. @default true
|
|
8
|
+
*/
|
|
9
|
+
autoBullet: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered. @default true
|
|
12
|
+
*/
|
|
13
|
+
autoNumbering: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.
|
|
17
|
+
* It can be customized with options to enable or disable auto list features.
|
|
18
|
+
*/
|
|
19
|
+
export declare class AutoFormatPlugin implements EditorPlugin {
|
|
20
|
+
private options;
|
|
21
|
+
private editor;
|
|
22
|
+
/**
|
|
23
|
+
* @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
|
|
24
|
+
* - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to true.
|
|
25
|
+
* - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to true.
|
|
26
|
+
*/
|
|
27
|
+
constructor(options?: AutoFormatOptions);
|
|
28
|
+
/**
|
|
29
|
+
* Get name of this plugin
|
|
30
|
+
*/
|
|
31
|
+
getName(): string;
|
|
32
|
+
/**
|
|
33
|
+
* The first method that editor will call to a plugin when editor is initializing.
|
|
34
|
+
* It will pass in the editor instance, plugin should take this chance to save the
|
|
35
|
+
* editor reference so that it can call to any editor method or format API later.
|
|
36
|
+
* @param editor The editor object
|
|
37
|
+
*/
|
|
38
|
+
initialize(editor: IStandaloneEditor): void;
|
|
39
|
+
/**
|
|
40
|
+
* The last method that editor will call to a plugin before it is disposed.
|
|
41
|
+
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
42
|
+
* called, plugin should not call to any editor method since it will result in error.
|
|
43
|
+
*/
|
|
44
|
+
dispose(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
47
|
+
* method of each plugin to handle the event as long as the event is not handled
|
|
48
|
+
* exclusively by another plugin.
|
|
49
|
+
* @param event The event to handle:
|
|
50
|
+
*/
|
|
51
|
+
onPluginEvent(event: PluginEvent): void;
|
|
52
|
+
private handleKeyDownEvent;
|
|
53
|
+
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AutoFormatPlugin = void 0;
|
|
4
|
-
var keyboardListTrigger_1 = require("./keyboardListTrigger");
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
var DefaultOptions = {
|
|
9
|
-
autoBullet: true,
|
|
10
|
-
autoNumbering: true,
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.
|
|
14
|
-
* It can be customized with options to enable or disable auto list features.
|
|
15
|
-
*/
|
|
16
|
-
var AutoFormatPlugin = /** @class */ (function () {
|
|
17
|
-
/**
|
|
18
|
-
* @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
|
|
19
|
-
* - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to true.
|
|
20
|
-
* - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to true.
|
|
21
|
-
*/
|
|
22
|
-
function AutoFormatPlugin(options) {
|
|
23
|
-
if (options === void 0) { options = DefaultOptions; }
|
|
24
|
-
this.options = options;
|
|
25
|
-
this.editor = null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Get name of this plugin
|
|
29
|
-
*/
|
|
30
|
-
AutoFormatPlugin.prototype.getName = function () {
|
|
31
|
-
return 'AutoFormat';
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The first method that editor will call to a plugin when editor is initializing.
|
|
35
|
-
* It will pass in the editor instance, plugin should take this chance to save the
|
|
36
|
-
* editor reference so that it can call to any editor method or format API later.
|
|
37
|
-
* @param editor The editor object
|
|
38
|
-
*/
|
|
39
|
-
AutoFormatPlugin.prototype.initialize = function (editor) {
|
|
40
|
-
this.editor = editor;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* The last method that editor will call to a plugin before it is disposed.
|
|
44
|
-
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
45
|
-
* called, plugin should not call to any editor method since it will result in error.
|
|
46
|
-
*/
|
|
47
|
-
AutoFormatPlugin.prototype.dispose = function () {
|
|
48
|
-
this.editor = null;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
52
|
-
* method of each plugin to handle the event as long as the event is not handled
|
|
53
|
-
* exclusively by another plugin.
|
|
54
|
-
* @param event The event to handle:
|
|
55
|
-
*/
|
|
56
|
-
AutoFormatPlugin.prototype.onPluginEvent = function (event) {
|
|
57
|
-
if (this.editor) {
|
|
58
|
-
switch (event.eventType) {
|
|
59
|
-
case 'keyDown':
|
|
60
|
-
this.handleKeyDownEvent(this.editor, event);
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
AutoFormatPlugin.prototype.handleKeyDownEvent = function (editor, event) {
|
|
66
|
-
var rawEvent = event.rawEvent;
|
|
67
|
-
if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
|
|
68
|
-
switch (rawEvent.key) {
|
|
69
|
-
case ' ':
|
|
70
|
-
var _a = this.options, autoBullet = _a.autoBullet, autoNumbering = _a.autoNumbering;
|
|
71
|
-
if (autoBullet || autoNumbering) {
|
|
72
|
-
(0, keyboardListTrigger_1.keyboardListTrigger)(editor, rawEvent, autoBullet, autoNumbering);
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
return AutoFormatPlugin;
|
|
79
|
-
}());
|
|
80
|
-
exports.AutoFormatPlugin = AutoFormatPlugin;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AutoFormatPlugin = void 0;
|
|
4
|
+
var keyboardListTrigger_1 = require("./keyboardListTrigger");
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
var DefaultOptions = {
|
|
9
|
+
autoBullet: true,
|
|
10
|
+
autoNumbering: true,
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.
|
|
14
|
+
* It can be customized with options to enable or disable auto list features.
|
|
15
|
+
*/
|
|
16
|
+
var AutoFormatPlugin = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
|
|
19
|
+
* - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to true.
|
|
20
|
+
* - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to true.
|
|
21
|
+
*/
|
|
22
|
+
function AutoFormatPlugin(options) {
|
|
23
|
+
if (options === void 0) { options = DefaultOptions; }
|
|
24
|
+
this.options = options;
|
|
25
|
+
this.editor = null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get name of this plugin
|
|
29
|
+
*/
|
|
30
|
+
AutoFormatPlugin.prototype.getName = function () {
|
|
31
|
+
return 'AutoFormat';
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The first method that editor will call to a plugin when editor is initializing.
|
|
35
|
+
* It will pass in the editor instance, plugin should take this chance to save the
|
|
36
|
+
* editor reference so that it can call to any editor method or format API later.
|
|
37
|
+
* @param editor The editor object
|
|
38
|
+
*/
|
|
39
|
+
AutoFormatPlugin.prototype.initialize = function (editor) {
|
|
40
|
+
this.editor = editor;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The last method that editor will call to a plugin before it is disposed.
|
|
44
|
+
* Plugin can take this chance to clear the reference to editor. After this method is
|
|
45
|
+
* called, plugin should not call to any editor method since it will result in error.
|
|
46
|
+
*/
|
|
47
|
+
AutoFormatPlugin.prototype.dispose = function () {
|
|
48
|
+
this.editor = null;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Core method for a plugin. Once an event happens in editor, editor will call this
|
|
52
|
+
* method of each plugin to handle the event as long as the event is not handled
|
|
53
|
+
* exclusively by another plugin.
|
|
54
|
+
* @param event The event to handle:
|
|
55
|
+
*/
|
|
56
|
+
AutoFormatPlugin.prototype.onPluginEvent = function (event) {
|
|
57
|
+
if (this.editor) {
|
|
58
|
+
switch (event.eventType) {
|
|
59
|
+
case 'keyDown':
|
|
60
|
+
this.handleKeyDownEvent(this.editor, event);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
AutoFormatPlugin.prototype.handleKeyDownEvent = function (editor, event) {
|
|
66
|
+
var rawEvent = event.rawEvent;
|
|
67
|
+
if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
|
|
68
|
+
switch (rawEvent.key) {
|
|
69
|
+
case ' ':
|
|
70
|
+
var _a = this.options, autoBullet = _a.autoBullet, autoNumbering = _a.autoNumbering;
|
|
71
|
+
if (autoBullet || autoNumbering) {
|
|
72
|
+
(0, keyboardListTrigger_1.keyboardListTrigger)(editor, rawEvent, autoBullet, autoNumbering);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return AutoFormatPlugin;
|
|
79
|
+
}());
|
|
80
|
+
exports.AutoFormatPlugin = AutoFormatPlugin;
|
|
81
81
|
//# sourceMappingURL=AutoFormatPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoFormatPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/AutoFormatPlugin.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAuB5D;;GAEG;AACH,IAAM,cAAc,GAAgC;IAChD,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;CACtB,CAAC;AAEF;;;GAGG;AACH;IAGI;;;;OAIG;IACH,0BAAoB,OAA2C;QAA3C,wBAAA,EAAA,wBAA2C;QAA3C,YAAO,GAAP,OAAO,CAAoC;QAPvD,WAAM,GAA6B,IAAI,CAAC;IAOkB,CAAC;IAEnE;;OAEG;IACH,kCAAO,GAAP;QACI,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,qCAAU,GAAV,UAAW,MAAyB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,kCAAO,GAAP;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,wCAAa,GAAb,UAAc,KAAkB;QAC5B,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,QAAQ,KAAK,CAAC,SAAS,EAAE;gBACrB,KAAK,SAAS;oBACV,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;oBAC5C,MAAM;aACb;SACJ;IACL,CAAC;IAEO,6CAAkB,GAA1B,UAA2B,MAAyB,EAAE,KAAmB;QACrE,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;YAC3D,QAAQ,QAAQ,CAAC,GAAG,EAAE;gBAClB,KAAK,GAAG;oBACE,IAAA,KAAgC,IAAI,CAAC,OAAO,EAA1C,UAAU,gBAAA,EAAE,aAAa,mBAAiB,CAAC;oBACnD,IAAI,UAAU,IAAI,aAAa,EAAE;wBAC7B,IAAA,yCAAmB,EAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;qBACpE;oBACD,MAAM;aACb;SACJ;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,4CAAgB","sourcesContent":["import { keyboardListTrigger } from './keyboardListTrigger';\
|
|
1
|
+
{"version":3,"file":"AutoFormatPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/AutoFormatPlugin.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAuB5D;;GAEG;AACH,IAAM,cAAc,GAAgC;IAChD,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;CACtB,CAAC;AAEF;;;GAGG;AACH;IAGI;;;;OAIG;IACH,0BAAoB,OAA2C;QAA3C,wBAAA,EAAA,wBAA2C;QAA3C,YAAO,GAAP,OAAO,CAAoC;QAPvD,WAAM,GAA6B,IAAI,CAAC;IAOkB,CAAC;IAEnE;;OAEG;IACH,kCAAO,GAAP;QACI,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,qCAAU,GAAV,UAAW,MAAyB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,kCAAO,GAAP;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,wCAAa,GAAb,UAAc,KAAkB;QAC5B,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,QAAQ,KAAK,CAAC,SAAS,EAAE;gBACrB,KAAK,SAAS;oBACV,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;oBAC5C,MAAM;aACb;SACJ;IACL,CAAC;IAEO,6CAAkB,GAA1B,UAA2B,MAAyB,EAAE,KAAmB;QACrE,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;YAC3D,QAAQ,QAAQ,CAAC,GAAG,EAAE;gBAClB,KAAK,GAAG;oBACE,IAAA,KAAgC,IAAI,CAAC,OAAO,EAA1C,UAAU,gBAAA,EAAE,aAAa,mBAAiB,CAAC;oBACnD,IAAI,UAAU,IAAI,aAAa,EAAE;wBAC7B,IAAA,yCAAmB,EAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;qBACpE;oBACD,MAAM;aACb;SACJ;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AAjED,IAiEC;AAjEY,4CAAgB","sourcesContent":["import { keyboardListTrigger } from './keyboardListTrigger';\nimport type {\n EditorPlugin,\n IStandaloneEditor,\n KeyDownEvent,\n PluginEvent,\n} from 'roosterjs-content-model-types';\n\n/**\n * Options to customize the Content Model Auto Format Plugin\n */\nexport type AutoFormatOptions = {\n /**\n * When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered. @default true\n */\n autoBullet: boolean;\n\n /**\n * When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered. @default true\n */\n autoNumbering: boolean;\n};\n\n/**\n * @internal\n */\nconst DefaultOptions: Required<AutoFormatOptions> = {\n autoBullet: true,\n autoNumbering: true,\n};\n\n/**\n * Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.\n * It can be customized with options to enable or disable auto list features.\n */\nexport class AutoFormatPlugin implements EditorPlugin {\n private editor: IStandaloneEditor | null = null;\n\n /**\n * @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:\n * - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to true.\n * - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to true.\n */\n constructor(private options: AutoFormatOptions = DefaultOptions) {}\n\n /**\n * Get name of this plugin\n */\n getName() {\n return 'AutoFormat';\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 }\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 }\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 if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {\n switch (rawEvent.key) {\n case ' ':\n const { autoBullet, autoNumbering } = this.options;\n if (autoBullet || autoNumbering) {\n keyboardListTrigger(editor, rawEvent, autoBullet, autoNumbering);\n }\n break;\n }\n }\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function keyboardListTrigger(editor: IStandaloneEditor, rawEvent: KeyboardEvent, shouldSearchForBullet?: boolean, shouldSearchForNumbering?: boolean): void;
|
|
1
|
+
import type { IStandaloneEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function keyboardListTrigger(editor: IStandaloneEditor, rawEvent: KeyboardEvent, shouldSearchForBullet?: boolean, shouldSearchForNumbering?: boolean): void;
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyboardListTrigger = void 0;
|
|
4
|
-
var getListTypeStyle_1 = require("./utils/getListTypeStyle");
|
|
5
|
-
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
6
|
-
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
7
|
-
var roosterjs_content_model_api_1 = require("roosterjs-content-model-api");
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
function keyboardListTrigger(editor, rawEvent, shouldSearchForBullet, shouldSearchForNumbering) {
|
|
12
|
-
if (shouldSearchForBullet === void 0) { shouldSearchForBullet = true; }
|
|
13
|
-
if (shouldSearchForNumbering === void 0) { shouldSearchForNumbering = true; }
|
|
14
|
-
editor.formatContentModel(function (model, _context) {
|
|
15
|
-
var listStyleType = (0, getListTypeStyle_1.getListTypeStyle)(model, shouldSearchForBullet, shouldSearchForNumbering);
|
|
16
|
-
if (listStyleType) {
|
|
17
|
-
var segmentsAndParagraphs = (0, roosterjs_content_model_core_1.getSelectedSegmentsAndParagraphs)(model, false);
|
|
18
|
-
if (segmentsAndParagraphs[0] && segmentsAndParagraphs[0][1]) {
|
|
19
|
-
segmentsAndParagraphs[0][1].segments.splice(0, 1);
|
|
20
|
-
}
|
|
21
|
-
var listType = listStyleType.listType, styleType = listStyleType.styleType, index = listStyleType.index;
|
|
22
|
-
triggerList(editor, model, listType, styleType, index);
|
|
23
|
-
rawEvent.preventDefault();
|
|
24
|
-
(0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.keyboardListTrigger = keyboardListTrigger;
|
|
31
|
-
var triggerList = function (editor, model, listType, styleType, index) {
|
|
32
|
-
(0, roosterjs_content_model_api_1.setListType)(model, listType);
|
|
33
|
-
var isOrderedList = listType == 'OL';
|
|
34
|
-
// If the index < 1, it is a new list, so it will be starting by 1, then no need to set startNumber
|
|
35
|
-
if (index && index > 1 && isOrderedList) {
|
|
36
|
-
(0, roosterjs_content_model_api_1.setListStartNumber)(editor, index);
|
|
37
|
-
}
|
|
38
|
-
(0, roosterjs_content_model_api_1.setListStyle)(editor, isOrderedList
|
|
39
|
-
? {
|
|
40
|
-
orderedStyleType: styleType,
|
|
41
|
-
}
|
|
42
|
-
: {
|
|
43
|
-
unorderedStyleType: styleType,
|
|
44
|
-
});
|
|
45
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keyboardListTrigger = void 0;
|
|
4
|
+
var getListTypeStyle_1 = require("./utils/getListTypeStyle");
|
|
5
|
+
var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
|
|
6
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
7
|
+
var roosterjs_content_model_api_1 = require("roosterjs-content-model-api");
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function keyboardListTrigger(editor, rawEvent, shouldSearchForBullet, shouldSearchForNumbering) {
|
|
12
|
+
if (shouldSearchForBullet === void 0) { shouldSearchForBullet = true; }
|
|
13
|
+
if (shouldSearchForNumbering === void 0) { shouldSearchForNumbering = true; }
|
|
14
|
+
editor.formatContentModel(function (model, _context) {
|
|
15
|
+
var listStyleType = (0, getListTypeStyle_1.getListTypeStyle)(model, shouldSearchForBullet, shouldSearchForNumbering);
|
|
16
|
+
if (listStyleType) {
|
|
17
|
+
var segmentsAndParagraphs = (0, roosterjs_content_model_core_1.getSelectedSegmentsAndParagraphs)(model, false);
|
|
18
|
+
if (segmentsAndParagraphs[0] && segmentsAndParagraphs[0][1]) {
|
|
19
|
+
segmentsAndParagraphs[0][1].segments.splice(0, 1);
|
|
20
|
+
}
|
|
21
|
+
var listType = listStyleType.listType, styleType = listStyleType.styleType, index = listStyleType.index;
|
|
22
|
+
triggerList(editor, model, listType, styleType, index);
|
|
23
|
+
rawEvent.preventDefault();
|
|
24
|
+
(0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.keyboardListTrigger = keyboardListTrigger;
|
|
31
|
+
var triggerList = function (editor, model, listType, styleType, index) {
|
|
32
|
+
(0, roosterjs_content_model_api_1.setListType)(model, listType);
|
|
33
|
+
var isOrderedList = listType == 'OL';
|
|
34
|
+
// If the index < 1, it is a new list, so it will be starting by 1, then no need to set startNumber
|
|
35
|
+
if (index && index > 1 && isOrderedList) {
|
|
36
|
+
(0, roosterjs_content_model_api_1.setListStartNumber)(editor, index);
|
|
37
|
+
}
|
|
38
|
+
(0, roosterjs_content_model_api_1.setListStyle)(editor, isOrderedList
|
|
39
|
+
? {
|
|
40
|
+
orderedStyleType: styleType,
|
|
41
|
+
}
|
|
42
|
+
: {
|
|
43
|
+
unorderedStyleType: styleType,
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
46
|
//# sourceMappingURL=keyboardListTrigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardListTrigger.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/keyboardListTrigger.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAC5D,6EAAgF;AAChF,2EAAoE;AACpE,2EAA4F;AAI5F;;GAEG;AACH,SAAgB,mBAAmB,CAC/B,MAAyB,EACzB,QAAuB,EACvB,qBAAqC,EACrC,wBAAwC;IADxC,sCAAA,EAAA,4BAAqC;IACrC,yCAAA,EAAA,+BAAwC;IAExC,MAAM,CAAC,kBAAkB,CAAC,UAAC,KAAK,EAAE,QAAQ;QACtC,IAAM,aAAa,GAAG,IAAA,mCAAgB,EAClC,KAAK,EACL,qBAAqB,EACrB,wBAAwB,CAC3B,CAAC;QACF,IAAI,aAAa,EAAE;YACf,IAAM,qBAAqB,GAAG,IAAA,+DAAgC,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC7E,IAAI,qBAAqB,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gBACzD,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACrD;YACO,IAAA,QAAQ,GAAuB,aAAa,SAApC,EAAE,SAAS,GAAY,aAAa,UAAzB,EAAE,KAAK,GAAK,aAAa,MAAlB,CAAmB;YACrD,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YACvD,QAAQ,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;YAE7B,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,kDA0BC;AAED,IAAM,WAAW,GAAG,UAChB,MAAyB,EACzB,KAA2B,EAC3B,QAAqB,EACrB,SAAiB,EACjB,KAAc;IAEd,IAAA,yCAAW,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7B,IAAM,aAAa,GAAG,QAAQ,IAAI,IAAI,CAAC;IACvC,mGAAmG;IACnG,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,IAAI,aAAa,EAAE;QACrC,IAAA,gDAAkB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACrC;IACD,IAAA,0CAAY,EACR,MAAM,EACN,aAAa;QACT,CAAC,CAAC;YACI,gBAAgB,EAAE,SAAS;SAC9B;QACH,CAAC,CAAC;YACI,kBAAkB,EAAE,SAAS;SAChC,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { getListTypeStyle } from './utils/getListTypeStyle';\
|
|
1
|
+
{"version":3,"file":"keyboardListTrigger.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/keyboardListTrigger.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAC5D,6EAAgF;AAChF,2EAAoE;AACpE,2EAA4F;AAI5F;;GAEG;AACH,SAAgB,mBAAmB,CAC/B,MAAyB,EACzB,QAAuB,EACvB,qBAAqC,EACrC,wBAAwC;IADxC,sCAAA,EAAA,4BAAqC;IACrC,yCAAA,EAAA,+BAAwC;IAExC,MAAM,CAAC,kBAAkB,CAAC,UAAC,KAAK,EAAE,QAAQ;QACtC,IAAM,aAAa,GAAG,IAAA,mCAAgB,EAClC,KAAK,EACL,qBAAqB,EACrB,wBAAwB,CAC3B,CAAC;QACF,IAAI,aAAa,EAAE;YACf,IAAM,qBAAqB,GAAG,IAAA,+DAAgC,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC7E,IAAI,qBAAqB,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gBACzD,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACrD;YACO,IAAA,QAAQ,GAAuB,aAAa,SAApC,EAAE,SAAS,GAAY,aAAa,UAAzB,EAAE,KAAK,GAAK,aAAa,MAAlB,CAAmB;YACrD,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YACvD,QAAQ,CAAC,cAAc,EAAE,CAAC;YAC1B,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;YAE7B,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC;AA1BD,kDA0BC;AAED,IAAM,WAAW,GAAG,UAChB,MAAyB,EACzB,KAA2B,EAC3B,QAAqB,EACrB,SAAiB,EACjB,KAAc;IAEd,IAAA,yCAAW,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7B,IAAM,aAAa,GAAG,QAAQ,IAAI,IAAI,CAAC;IACvC,mGAAmG;IACnG,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,IAAI,aAAa,EAAE;QACrC,IAAA,gDAAkB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;KACrC;IACD,IAAA,0CAAY,EACR,MAAM,EACN,aAAa;QACT,CAAC,CAAC;YACI,gBAAgB,EAAE,SAAS;SAC9B;QACH,CAAC,CAAC;YACI,kBAAkB,EAAE,SAAS;SAChC,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { getListTypeStyle } from './utils/getListTypeStyle';\nimport { getSelectedSegmentsAndParagraphs } from 'roosterjs-content-model-core';\nimport { normalizeContentModel } from 'roosterjs-content-model-dom';\nimport { setListStartNumber, setListStyle, setListType } from 'roosterjs-content-model-api';\n\nimport type { ContentModelDocument, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function keyboardListTrigger(\n editor: IStandaloneEditor,\n rawEvent: KeyboardEvent,\n shouldSearchForBullet: boolean = true,\n shouldSearchForNumbering: boolean = true\n) {\n editor.formatContentModel((model, _context) => {\n const listStyleType = getListTypeStyle(\n model,\n shouldSearchForBullet,\n shouldSearchForNumbering\n );\n if (listStyleType) {\n const segmentsAndParagraphs = getSelectedSegmentsAndParagraphs(model, false);\n if (segmentsAndParagraphs[0] && segmentsAndParagraphs[0][1]) {\n segmentsAndParagraphs[0][1].segments.splice(0, 1);\n }\n const { listType, styleType, index } = listStyleType;\n triggerList(editor, model, listType, styleType, index);\n rawEvent.preventDefault();\n normalizeContentModel(model);\n\n return true;\n }\n return false;\n });\n}\n\nconst triggerList = (\n editor: IStandaloneEditor,\n model: ContentModelDocument,\n listType: 'OL' | 'UL',\n styleType: number,\n index?: number\n) => {\n setListType(model, listType);\n const isOrderedList = listType == 'OL';\n // If the index < 1, it is a new list, so it will be starting by 1, then no need to set startNumber\n if (index && index > 1 && isOrderedList) {\n setListStartNumber(editor, index);\n }\n setListStyle(\n editor,\n isOrderedList\n ? {\n orderedStyleType: styleType,\n }\n : {\n unorderedStyleType: styleType,\n }\n );\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Convert english alphabet numbers into decimal numbers
|
|
4
|
-
* @param letter The letter that needs to be converted
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare function convertAlphaToDecimals(letter: string): number | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Convert english alphabet numbers into decimal numbers
|
|
4
|
+
* @param letter The letter that needs to be converted
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function convertAlphaToDecimals(letter: string): number | undefined;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertAlphaToDecimals = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
* Convert english alphabet numbers into decimal numbers
|
|
7
|
-
* @param letter The letter that needs to be converted
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
function convertAlphaToDecimals(letter) {
|
|
11
|
-
var alpha = letter.toUpperCase();
|
|
12
|
-
if (alpha) {
|
|
13
|
-
var result = 0;
|
|
14
|
-
for (var i = 0; i < alpha.length; i++) {
|
|
15
|
-
var charCode = alpha.charCodeAt(i) - 65 + 1;
|
|
16
|
-
result = result * 26 + charCode;
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
exports.convertAlphaToDecimals = convertAlphaToDecimals;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertAlphaToDecimals = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Convert english alphabet numbers into decimal numbers
|
|
7
|
+
* @param letter The letter that needs to be converted
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
function convertAlphaToDecimals(letter) {
|
|
11
|
+
var alpha = letter.toUpperCase();
|
|
12
|
+
if (alpha) {
|
|
13
|
+
var result = 0;
|
|
14
|
+
for (var i = 0; i < alpha.length; i++) {
|
|
15
|
+
var charCode = alpha.charCodeAt(i) - 65 + 1;
|
|
16
|
+
result = result * 26 + charCode;
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
exports.convertAlphaToDecimals = convertAlphaToDecimals;
|
|
23
23
|
//# sourceMappingURL=convertAlphaToDecimals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertAlphaToDecimals.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/convertAlphaToDecimals.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,MAAc;IACjD,IAAM,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACnC,IAAI,KAAK,EAAE;QACP,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC9C,MAAM,GAAG,MAAM,GAAG,EAAE,GAAG,QAAQ,CAAC;SACnC;QAED,OAAO,MAAM,CAAC;KACjB;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAZD,wDAYC","sourcesContent":["/**\
|
|
1
|
+
{"version":3,"file":"convertAlphaToDecimals.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/convertAlphaToDecimals.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,MAAc;IACjD,IAAM,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACnC,IAAI,KAAK,EAAE;QACP,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACnC,IAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC9C,MAAM,GAAG,MAAM,GAAG,EAAE,GAAG,QAAQ,CAAC;SACnC;QAED,OAAO,MAAM,CAAC;KACjB;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAZD,wDAYC","sourcesContent":["/**\n * @internal\n * Convert english alphabet numbers into decimal numbers\n * @param letter The letter that needs to be converted\n * @returns\n */\nexport function convertAlphaToDecimals(letter: string): number | undefined {\n const alpha = letter.toUpperCase();\n if (alpha) {\n let result = 0;\n for (let i = 0; i < alpha.length; i++) {\n const charCode = alpha.charCodeAt(i) - 65 + 1;\n result = result * 26 + charCode;\n }\n\n return result;\n }\n return undefined;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export declare function getIndex(listIndex: string): number | undefined;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare function getIndex(listIndex: string): number | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIndex = void 0;
|
|
4
|
-
var convertAlphaToDecimals_1 = require("./convertAlphaToDecimals");
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
function getIndex(listIndex) {
|
|
9
|
-
var index = listIndex.replace(/[^a-zA-Z0-9 ]/g, '');
|
|
10
|
-
var indexNumber = parseInt(index);
|
|
11
|
-
return !isNaN(indexNumber) ? indexNumber : (0, convertAlphaToDecimals_1.convertAlphaToDecimals)(index);
|
|
12
|
-
}
|
|
13
|
-
exports.getIndex = getIndex;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIndex = void 0;
|
|
4
|
+
var convertAlphaToDecimals_1 = require("./convertAlphaToDecimals");
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function getIndex(listIndex) {
|
|
9
|
+
var index = listIndex.replace(/[^a-zA-Z0-9 ]/g, '');
|
|
10
|
+
var indexNumber = parseInt(index);
|
|
11
|
+
return !isNaN(indexNumber) ? indexNumber : (0, convertAlphaToDecimals_1.convertAlphaToDecimals)(index);
|
|
12
|
+
}
|
|
13
|
+
exports.getIndex = getIndex;
|
|
14
14
|
//# sourceMappingURL=getIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIndex.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/getIndex.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAElE;;GAEG;AACH,SAAgB,QAAQ,CAAC,SAAiB;IACtC,IAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACtD,IAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,+CAAsB,EAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAJD,4BAIC","sourcesContent":["import { convertAlphaToDecimals } from './convertAlphaToDecimals';\
|
|
1
|
+
{"version":3,"file":"getIndex.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/getIndex.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAElE;;GAEG;AACH,SAAgB,QAAQ,CAAC,SAAiB;IACtC,IAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACtD,IAAM,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAA,+CAAsB,EAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAJD,4BAIC","sourcesContent":["import { convertAlphaToDecimals } from './convertAlphaToDecimals';\n\n/**\n * @internal\n */\nexport function getIndex(listIndex: string) {\n const index = listIndex.replace(/[^a-zA-Z0-9 ]/g, '');\n const indexNumber = parseInt(index);\n return !isNaN(indexNumber) ? indexNumber : convertAlphaToDecimals(index);\n}\n"]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { ContentModelDocument } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
interface ListTypeStyle {
|
|
6
|
-
listType: 'UL' | 'OL';
|
|
7
|
-
styleType: number;
|
|
8
|
-
index?: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare function getListTypeStyle(model: ContentModelDocument, shouldSearchForBullet?: boolean, shouldSearchForNumbering?: boolean): ListTypeStyle | undefined;
|
|
14
|
-
export {};
|
|
1
|
+
import type { ContentModelDocument } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
interface ListTypeStyle {
|
|
6
|
+
listType: 'UL' | 'OL';
|
|
7
|
+
styleType: number;
|
|
8
|
+
index?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function getListTypeStyle(model: ContentModelDocument, shouldSearchForBullet?: boolean, shouldSearchForNumbering?: boolean): ListTypeStyle | undefined;
|
|
14
|
+
export {};
|