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,79 +1,79 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var FORMATING_REGEX = /[\n\t'{}"]+/g;
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
* Word Desktop content has a style tag that contains data for the lists.
|
|
8
|
-
* So this function query that style tag and extract the data from the innerHTML, since it is not available from the HTMLStyleElement.sheet.
|
|
9
|
-
*
|
|
10
|
-
* The format is like:
|
|
11
|
-
* example of style element content
|
|
12
|
-
* @list l0:level1 {
|
|
13
|
-
* styleTag: styleValue;
|
|
14
|
-
* ...
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* To extract the data:
|
|
18
|
-
* 1. Substring the value of the style selector, using @ index and { index
|
|
19
|
-
* 2. Substring the value of the style rules by Substring the content between { and }
|
|
20
|
-
* 3. Split the value of the rules using ; as separator { styleTag: styleValue; styleTag1: StyleValue1 } = ['styleTag: styleValue', 'styleTag1: StyleValue1']
|
|
21
|
-
* 4. Split the value of the rule using : as separator: styleTag: styleValue = [styleTag, styleValue]
|
|
22
|
-
* 5. Save data in record and only use the required information.
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
function getStyleMetadata(ev, trustedHTMLHandler) {
|
|
26
|
-
var metadataMap = new Map();
|
|
27
|
-
var doc = new DOMParser().parseFromString(trustedHTMLHandler(ev.htmlBefore), 'text/html');
|
|
28
|
-
var styles = doc.querySelectorAll('style');
|
|
29
|
-
styles.forEach(function (style) {
|
|
30
|
-
var text = (style === null || style === void 0 ? void 0 : style.innerHTML.trim()) || '';
|
|
31
|
-
var index = 0;
|
|
32
|
-
var _loop_1 = function () {
|
|
33
|
-
var indexAt = text.indexOf('@', index + 1);
|
|
34
|
-
var indexCurlyEnd = text.indexOf('}', indexAt);
|
|
35
|
-
var indexCurlyStart = text.indexOf('{', indexAt);
|
|
36
|
-
index = indexAt;
|
|
37
|
-
// 1.
|
|
38
|
-
var metadataName = text
|
|
39
|
-
.substring(indexAt + 1, indexCurlyStart)
|
|
40
|
-
.replace(FORMATING_REGEX, '')
|
|
41
|
-
.replace('list', '')
|
|
42
|
-
.trimRight()
|
|
43
|
-
.trimLeft();
|
|
44
|
-
// 2.
|
|
45
|
-
var dataName = text
|
|
46
|
-
.substring(indexCurlyStart, indexCurlyEnd + 1)
|
|
47
|
-
.trimLeft()
|
|
48
|
-
.trimRight();
|
|
49
|
-
var record = {};
|
|
50
|
-
// 3.
|
|
51
|
-
var entries = dataName.split(';');
|
|
52
|
-
entries.forEach(function (entry) {
|
|
53
|
-
// 4.
|
|
54
|
-
var _a = (0, tslib_1.__read)(entry.split(':'), 2), key = _a[0], value = _a[1];
|
|
55
|
-
if (key && value) {
|
|
56
|
-
var formatedKey = key.replace(FORMATING_REGEX, '').trimRight().trimLeft();
|
|
57
|
-
var formatedValue = value.replace(FORMATING_REGEX, '').trimRight().trimLeft();
|
|
58
|
-
// 5.
|
|
59
|
-
record[formatedKey] = formatedValue;
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
var data = {
|
|
63
|
-
'mso-level-number-format': record['mso-level-number-format'],
|
|
64
|
-
'mso-level-start-at': record['mso-level-start-at'] || '1',
|
|
65
|
-
'mso-level-text': record['mso-level-text'],
|
|
66
|
-
};
|
|
67
|
-
if ((0, roosterjs_content_model_dom_1.getObjectKeys)(data).some(function (key) { return !!data[key]; })) {
|
|
68
|
-
metadataMap.set(metadataName, data);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
while (index >= 0) {
|
|
72
|
-
_loop_1();
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return metadataMap;
|
|
76
|
-
}
|
|
77
|
-
exports.default = getStyleMetadata;
|
|
78
|
-
});
|
|
1
|
+
define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var FORMATING_REGEX = /[\n\t'{}"]+/g;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* Word Desktop content has a style tag that contains data for the lists.
|
|
8
|
+
* So this function query that style tag and extract the data from the innerHTML, since it is not available from the HTMLStyleElement.sheet.
|
|
9
|
+
*
|
|
10
|
+
* The format is like:
|
|
11
|
+
* example of style element content
|
|
12
|
+
* @list l0:level1 {
|
|
13
|
+
* styleTag: styleValue;
|
|
14
|
+
* ...
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* To extract the data:
|
|
18
|
+
* 1. Substring the value of the style selector, using @ index and { index
|
|
19
|
+
* 2. Substring the value of the style rules by Substring the content between { and }
|
|
20
|
+
* 3. Split the value of the rules using ; as separator { styleTag: styleValue; styleTag1: StyleValue1 } = ['styleTag: styleValue', 'styleTag1: StyleValue1']
|
|
21
|
+
* 4. Split the value of the rule using : as separator: styleTag: styleValue = [styleTag, styleValue]
|
|
22
|
+
* 5. Save data in record and only use the required information.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
function getStyleMetadata(ev, trustedHTMLHandler) {
|
|
26
|
+
var metadataMap = new Map();
|
|
27
|
+
var doc = new DOMParser().parseFromString(trustedHTMLHandler(ev.htmlBefore), 'text/html');
|
|
28
|
+
var styles = doc.querySelectorAll('style');
|
|
29
|
+
styles.forEach(function (style) {
|
|
30
|
+
var text = (style === null || style === void 0 ? void 0 : style.innerHTML.trim()) || '';
|
|
31
|
+
var index = 0;
|
|
32
|
+
var _loop_1 = function () {
|
|
33
|
+
var indexAt = text.indexOf('@', index + 1);
|
|
34
|
+
var indexCurlyEnd = text.indexOf('}', indexAt);
|
|
35
|
+
var indexCurlyStart = text.indexOf('{', indexAt);
|
|
36
|
+
index = indexAt;
|
|
37
|
+
// 1.
|
|
38
|
+
var metadataName = text
|
|
39
|
+
.substring(indexAt + 1, indexCurlyStart)
|
|
40
|
+
.replace(FORMATING_REGEX, '')
|
|
41
|
+
.replace('list', '')
|
|
42
|
+
.trimRight()
|
|
43
|
+
.trimLeft();
|
|
44
|
+
// 2.
|
|
45
|
+
var dataName = text
|
|
46
|
+
.substring(indexCurlyStart, indexCurlyEnd + 1)
|
|
47
|
+
.trimLeft()
|
|
48
|
+
.trimRight();
|
|
49
|
+
var record = {};
|
|
50
|
+
// 3.
|
|
51
|
+
var entries = dataName.split(';');
|
|
52
|
+
entries.forEach(function (entry) {
|
|
53
|
+
// 4.
|
|
54
|
+
var _a = (0, tslib_1.__read)(entry.split(':'), 2), key = _a[0], value = _a[1];
|
|
55
|
+
if (key && value) {
|
|
56
|
+
var formatedKey = key.replace(FORMATING_REGEX, '').trimRight().trimLeft();
|
|
57
|
+
var formatedValue = value.replace(FORMATING_REGEX, '').trimRight().trimLeft();
|
|
58
|
+
// 5.
|
|
59
|
+
record[formatedKey] = formatedValue;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var data = {
|
|
63
|
+
'mso-level-number-format': record['mso-level-number-format'],
|
|
64
|
+
'mso-level-start-at': record['mso-level-start-at'] || '1',
|
|
65
|
+
'mso-level-text': record['mso-level-text'],
|
|
66
|
+
};
|
|
67
|
+
if ((0, roosterjs_content_model_dom_1.getObjectKeys)(data).some(function (key) { return !!data[key]; })) {
|
|
68
|
+
metadataMap.set(metadataName, data);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
while (index >= 0) {
|
|
72
|
+
_loop_1();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return metadataMap;
|
|
76
|
+
}
|
|
77
|
+
exports.default = getStyleMetadata;
|
|
78
|
+
});
|
|
79
79
|
//# sourceMappingURL=getStyleMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStyleMetadata.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/getStyleMetadata.ts"],"names":[],"mappings":";;;IAIA,IAAM,eAAe,GAAG,cAAc,CAAC;IAEvC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAwB,gBAAgB,CACpC,EAAoB,EACpB,kBAA2C;QAE3C,IAAM,WAAW,GAA8B,IAAI,GAAG,EAAE,CAAC;QACzD,IAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC;QAC5F,IAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE7C,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;YAChB,IAAM,IAAI,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,IAAI,EAAE,KAAI,EAAE,CAAC;YAE3C,IAAI,KAAK,GAAG,CAAC,CAAC;;gBAEV,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC7C,IAAM,aAAa,GAAG,IAAI,CAAC,OAAO,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CAAC,yBAAyB,CAAC;oBAC5D,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAI,GAAG;oBACzD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,CAAC;iBAC7C,CAAC;gBACF,IAAI,IAAA,2CAAa,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAX,CAAW,CAAC,EAAE;oBAC9C,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;iBACvC;;YAzCL,OAAO,KAAK,IAAI,CAAC;;aA0ChB;QACL,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;IACvB,CAAC;IAzDD,mCAyDC","sourcesContent":["import { getObjectKeys } from 'roosterjs-content-model-dom';\
|
|
1
|
+
{"version":3,"file":"getStyleMetadata.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/getStyleMetadata.ts"],"names":[],"mappings":";;;IAIA,IAAM,eAAe,GAAG,cAAc,CAAC;IAEvC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAwB,gBAAgB,CACpC,EAAoB,EACpB,kBAA2C;QAE3C,IAAM,WAAW,GAA8B,IAAI,GAAG,EAAE,CAAC;QACzD,IAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC;QAC5F,IAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAE7C,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;YAChB,IAAM,IAAI,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAC,IAAI,EAAE,KAAI,EAAE,CAAC;YAE3C,IAAI,KAAK,GAAG,CAAC,CAAC;;gBAEV,IAAM,OAAO,GAAG,IA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AAC,GAAG,aAAa,CAAC;qBACvC;gBACL,CAAC,CAAC,CAAC;gBAEH,IAAM,IAAI,GAAiB;oBACvB,yBAAyB,EAAE,MAAM,CAAC,yBAAyB,CAAC;oBAC5D,oBAAoB,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAI,GAAG;oBACzD,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,CAAC;iBAC7C,CAAC;gBACF,IAAI,IAAA,2CAAa,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAX,CAAW,CAAC,EAAE;oBAC9C,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;iBACvC;;YAzCL,OAAO,KAAK,IAAI,CAAC;;aA0ChB;QACL,CAAC,CAAC,CAAC;QACH,OAAO,WAAW,CAAC;IACvB,CAAC;IAzDD,mCAyDC","sourcesContent":["import { getObjectKeys } from 'roosterjs-content-model-dom';\nimport type { WordMetadata } from './WordMetadata';\nimport type { BeforePasteEvent } from 'roosterjs-content-model-types';\n\nconst FORMATING_REGEX = /[\\n\\t'{}\"]+/g;\n\n/**\n * @internal\n * Word Desktop content has a style tag that contains data for the lists.\n * So this function query that style tag and extract the data from the innerHTML, since it is not available from the HTMLStyleElement.sheet.\n *\n * The format is like:\n * example of style element content\n * @list l0:level1 {\n * styleTag: styleValue;\n * ...\n * }\n *\n * To extract the data:\n * 1. Substring the value of the style selector, using @ index and { index\n * 2. Substring the value of the style rules by Substring the content between { and }\n * 3. Split the value of the rules using ; as separator { styleTag: styleValue; styleTag1: StyleValue1 } = ['styleTag: styleValue', 'styleTag1: StyleValue1']\n * 4. Split the value of the rule using : as separator: styleTag: styleValue = [styleTag, styleValue]\n * 5. Save data in record and only use the required information.\n *\n */\nexport default function getStyleMetadata(\n ev: BeforePasteEvent,\n trustedHTMLHandler: (val: string) => string\n) {\n const metadataMap: Map<string, WordMetadata> = new Map();\n const doc = new DOMParser().parseFromString(trustedHTMLHandler(ev.htmlBefore), 'text/html');\n const styles = doc.querySelectorAll('style');\n\n styles.forEach(style => {\n const text = style?.innerHTML.trim() || '';\n\n let index = 0;\n while (index >= 0) {\n const indexAt = text.indexOf('@', index + 1);\n const indexCurlyEnd = text.indexOf('}', indexAt);\n const indexCurlyStart = text.indexOf('{', indexAt);\n index = indexAt;\n\n // 1.\n const metadataName = text\n .substring(indexAt + 1, indexCurlyStart)\n .replace(FORMATING_REGEX, '')\n .replace('list', '')\n .trimRight()\n .trimLeft();\n\n // 2.\n const dataName = text\n .substring(indexCurlyStart, indexCurlyEnd + 1)\n .trimLeft()\n .trimRight();\n const record: Record<string, string> = {};\n\n // 3.\n const entries = dataName.split(';');\n entries.forEach(entry => {\n // 4.\n const [key, value] = entry.split(':');\n if (key && value) {\n const formatedKey = key.replace(FORMATING_REGEX, '').trimRight().trimLeft();\n const formatedValue = value.replace(FORMATING_REGEX, '').trimRight().trimLeft();\n // 5.\n record[formatedKey] = formatedValue;\n }\n });\n\n const data: WordMetadata = {\n 'mso-level-number-format': record['mso-level-number-format'],\n 'mso-level-start-at': record['mso-level-start-at'] || '1',\n 'mso-level-text': record['mso-level-text'],\n };\n if (getObjectKeys(data).some(key => !!data[key])) {\n metadataMap.set(metadataName, data);\n }\n }\n });\n return metadataMap;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BeforePasteEvent } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Handles Pasted content when source is Word Desktop
|
|
5
|
-
* @param ev BeforePasteEvent
|
|
6
|
-
*/
|
|
7
|
-
export declare function processPastedContentFromWordDesktop(ev: BeforePasteEvent, trustedHTMLHandler: (text: string) => string): void;
|
|
1
|
+
import type { BeforePasteEvent } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Handles Pasted content when source is Word Desktop
|
|
5
|
+
* @param ev BeforePasteEvent
|
|
6
|
+
*/
|
|
7
|
+
export declare function processPastedContentFromWordDesktop(ev: BeforePasteEvent, trustedHTMLHandler: (text: string) => string): void;
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
define(["require", "exports", "../utils/addParser", "./getStyleMetadata", "../utils/getStyles", "./processWordComments", "./processWordLists", "./removeNegativeTextIndentParser", "../utils/setProcessor"], function (require, exports, addParser_1, getStyleMetadata_1, getStyles_1, processWordComments_1, processWordLists_1, removeNegativeTextIndentParser_1, setProcessor_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.processPastedContentFromWordDesktop = void 0;
|
|
5
|
-
var PERCENTAGE_REGEX = /%/;
|
|
6
|
-
var DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE = 120;
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
* Handles Pasted content when source is Word Desktop
|
|
10
|
-
* @param ev BeforePasteEvent
|
|
11
|
-
*/
|
|
12
|
-
function processPastedContentFromWordDesktop(ev, trustedHTMLHandler) {
|
|
13
|
-
var metadataMap = (0, getStyleMetadata_1.default)(ev, trustedHTMLHandler);
|
|
14
|
-
(0, setProcessor_1.setProcessor)(ev.domToModelOption, 'element', wordDesktopElementProcessor(metadataMap));
|
|
15
|
-
(0, addParser_1.default)(ev.domToModelOption, 'block', removeNonValidLineHeight);
|
|
16
|
-
(0, addParser_1.default)(ev.domToModelOption, 'block', removeNegativeTextIndentParser_1.removeNegativeTextIndentParser);
|
|
17
|
-
(0, addParser_1.default)(ev.domToModelOption, 'listLevel', listLevelParser);
|
|
18
|
-
(0, addParser_1.default)(ev.domToModelOption, 'container', wordTableParser);
|
|
19
|
-
(0, addParser_1.default)(ev.domToModelOption, 'table', wordTableParser);
|
|
20
|
-
}
|
|
21
|
-
exports.processPastedContentFromWordDesktop = processPastedContentFromWordDesktop;
|
|
22
|
-
var wordDesktopElementProcessor = function (metadataKey) {
|
|
23
|
-
return function (group, element, context) {
|
|
24
|
-
var styles = (0, getStyles_1.getStyles)(element);
|
|
25
|
-
// Process Word Lists or Word Commands, otherwise use the default processor on this element.
|
|
26
|
-
if (!((0, processWordLists_1.processWordList)(styles, group, element, context, metadataKey) ||
|
|
27
|
-
(0, processWordComments_1.processWordComments)(styles, element))) {
|
|
28
|
-
context.defaultElementProcessors.element(group, element, context);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
function removeNonValidLineHeight(format, element, context, defaultStyle) {
|
|
33
|
-
//If the line height is less than the browser default line height, line between the text is going to be too narrow
|
|
34
|
-
var parsedLineHeight;
|
|
35
|
-
if (PERCENTAGE_REGEX.test(element.style.lineHeight) &&
|
|
36
|
-
!isNaN((parsedLineHeight = parseInt(element.style.lineHeight))) &&
|
|
37
|
-
parsedLineHeight < DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE) {
|
|
38
|
-
format.lineHeight = defaultStyle.lineHeight;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function listLevelParser(format, element, context, defaultStyle) {
|
|
42
|
-
if (element.style.marginLeft != '') {
|
|
43
|
-
format.marginLeft = defaultStyle.marginLeft;
|
|
44
|
-
}
|
|
45
|
-
format.marginBottom = undefined;
|
|
46
|
-
}
|
|
47
|
-
var wordTableParser = function (format) {
|
|
48
|
-
var _a;
|
|
49
|
-
if ((_a = format.marginLeft) === null || _a === void 0 ? void 0 : _a.startsWith('-')) {
|
|
50
|
-
delete format.marginLeft;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
});
|
|
1
|
+
define(["require", "exports", "../utils/addParser", "./getStyleMetadata", "../utils/getStyles", "./processWordComments", "./processWordLists", "./removeNegativeTextIndentParser", "../utils/setProcessor"], function (require, exports, addParser_1, getStyleMetadata_1, getStyles_1, processWordComments_1, processWordLists_1, removeNegativeTextIndentParser_1, setProcessor_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.processPastedContentFromWordDesktop = void 0;
|
|
5
|
+
var PERCENTAGE_REGEX = /%/;
|
|
6
|
+
var DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE = 120;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* Handles Pasted content when source is Word Desktop
|
|
10
|
+
* @param ev BeforePasteEvent
|
|
11
|
+
*/
|
|
12
|
+
function processPastedContentFromWordDesktop(ev, trustedHTMLHandler) {
|
|
13
|
+
var metadataMap = (0, getStyleMetadata_1.default)(ev, trustedHTMLHandler);
|
|
14
|
+
(0, setProcessor_1.setProcessor)(ev.domToModelOption, 'element', wordDesktopElementProcessor(metadataMap));
|
|
15
|
+
(0, addParser_1.default)(ev.domToModelOption, 'block', removeNonValidLineHeight);
|
|
16
|
+
(0, addParser_1.default)(ev.domToModelOption, 'block', removeNegativeTextIndentParser_1.removeNegativeTextIndentParser);
|
|
17
|
+
(0, addParser_1.default)(ev.domToModelOption, 'listLevel', listLevelParser);
|
|
18
|
+
(0, addParser_1.default)(ev.domToModelOption, 'container', wordTableParser);
|
|
19
|
+
(0, addParser_1.default)(ev.domToModelOption, 'table', wordTableParser);
|
|
20
|
+
}
|
|
21
|
+
exports.processPastedContentFromWordDesktop = processPastedContentFromWordDesktop;
|
|
22
|
+
var wordDesktopElementProcessor = function (metadataKey) {
|
|
23
|
+
return function (group, element, context) {
|
|
24
|
+
var styles = (0, getStyles_1.getStyles)(element);
|
|
25
|
+
// Process Word Lists or Word Commands, otherwise use the default processor on this element.
|
|
26
|
+
if (!((0, processWordLists_1.processWordList)(styles, group, element, context, metadataKey) ||
|
|
27
|
+
(0, processWordComments_1.processWordComments)(styles, element))) {
|
|
28
|
+
context.defaultElementProcessors.element(group, element, context);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
function removeNonValidLineHeight(format, element, context, defaultStyle) {
|
|
33
|
+
//If the line height is less than the browser default line height, line between the text is going to be too narrow
|
|
34
|
+
var parsedLineHeight;
|
|
35
|
+
if (PERCENTAGE_REGEX.test(element.style.lineHeight) &&
|
|
36
|
+
!isNaN((parsedLineHeight = parseInt(element.style.lineHeight))) &&
|
|
37
|
+
parsedLineHeight < DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE) {
|
|
38
|
+
format.lineHeight = defaultStyle.lineHeight;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function listLevelParser(format, element, context, defaultStyle) {
|
|
42
|
+
if (element.style.marginLeft != '') {
|
|
43
|
+
format.marginLeft = defaultStyle.marginLeft;
|
|
44
|
+
}
|
|
45
|
+
format.marginBottom = undefined;
|
|
46
|
+
}
|
|
47
|
+
var wordTableParser = function (format) {
|
|
48
|
+
var _a;
|
|
49
|
+
if ((_a = format.marginLeft) === null || _a === void 0 ? void 0 : _a.startsWith('-')) {
|
|
50
|
+
delete format.marginLeft;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
54
|
//# sourceMappingURL=processPastedContentFromWordDesktop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processPastedContentFromWordDesktop.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processPastedContentFromWordDesktop.ts"],"names":[],"mappings":";;;;IAkBA,IAAM,gBAAgB,GAAG,GAAG,CAAC;IAC7B,IAAM,sCAAsC,GAAG,GAAG,CAAC;IAEnD;;;;OAIG;IACH,SAAgB,mCAAmC,CAC/C,EAAoB,EACpB,kBAA4C;QAE5C,IAAM,WAAW,GAA8B,IAAA,0BAAgB,EAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;QAExF,IAAA,2BAAY,EAAC,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC;QACvF,IAAA,mBAAS,EAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAA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C/C;IACL,CAAC;IAED,SAAS,eAAe,CACpB,MAAuC,EACvC,OAAoB,EACpB,OAA0B,EAC1B,YAAoD;QAEpD,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE;YAChC,MAAM,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;SAC/C;QAED,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC;IACpC,CAAC;IAED,IAAM,eAAe,GAA0C,UAAC,MAAM;;QAClE,IAAI,MAAA,MAAM,CAAC,UAAU,0CAAE,UAAU,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,MAAM,CAAC,UAAU,CAAC;SAC5B;IACL,CAAC,CAAC","sourcesContent":["import addParser from '../utils/addParser';\
|
|
1
|
+
{"version":3,"file":"processPastedContentFromWordDesktop.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processPastedContentFromWordDesktop.ts"],"names":[],"mappings":";;;;IAkBA,IAAM,gBAAgB,GAAG,GAAG,CAAC;IAC7B,IAAM,sCAAsC,GAAG,GAAG,CAAC;IAEnD;;;;OAIG;IACH,SAAgB,mCAAmC,CAC/C,EAAoB,EACpB,kBAA4C;QAE5C,IAAM,WAAW,GAA8B,IAAA,0BAAgB,EAAC,EAAE,EAAE,kBAAkB,CAAC,CAAC;QAExF,IAAA,2BAAY,EAAC,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC;QACvF,IAAA,mBAAS,EAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,wBAAwB,CAAC,CAAC;QAClE,IAAA,mBAAS,EAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,EAAE,+DAA8B,CAAC,CAAC;QACxE,IAAA,mBAAS,EAAC,EAAE,CAAC,gBAAgB,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;QAC7D,IAAA,mBAAS,EAAC,EAAE,CAAC,gBAAgB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AG,SAAS,CAAC;IACpC,CAAC;IAED,IAAM,eAAe,GAA0C,UAAC,MAAM;;QAClE,IAAI,MAAA,MAAM,CAAC,UAAU,0CAAE,UAAU,CAAC,GAAG,CAAC,EAAE;YACpC,OAAO,MAAM,CAAC,UAAU,CAAC;SAC5B;IACL,CAAC,CAAC","sourcesContent":["import addParser from '../utils/addParser';\nimport getStyleMetadata from './getStyleMetadata';\nimport { getStyles } from '../utils/getStyles';\nimport { processWordComments } from './processWordComments';\nimport { processWordList } from './processWordLists';\nimport { removeNegativeTextIndentParser } from './removeNegativeTextIndentParser';\nimport { setProcessor } from '../utils/setProcessor';\nimport type { WordMetadata } from './WordMetadata';\nimport type {\n BeforePasteEvent,\n ContentModelBlockFormat,\n ContentModelListItemLevelFormat,\n ContentModelTableFormat,\n DomToModelContext,\n ElementProcessor,\n FormatParser,\n} from 'roosterjs-content-model-types';\n\nconst PERCENTAGE_REGEX = /%/;\nconst DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE = 120;\n\n/**\n * @internal\n * Handles Pasted content when source is Word Desktop\n * @param ev BeforePasteEvent\n */\nexport function processPastedContentFromWordDesktop(\n ev: BeforePasteEvent,\n trustedHTMLHandler: (text: string) => string\n) {\n const metadataMap: Map<string, WordMetadata> = getStyleMetadata(ev, trustedHTMLHandler);\n\n setProcessor(ev.domToModelOption, 'element', wordDesktopElementProcessor(metadataMap));\n addParser(ev.domToModelOption, 'block', removeNonValidLineHeight);\n addParser(ev.domToModelOption, 'block', removeNegativeTextIndentParser);\n addParser(ev.domToModelOption, 'listLevel', listLevelParser);\n addParser(ev.domToModelOption, 'container', wordTableParser);\n addParser(ev.domToModelOption, 'table', wordTableParser);\n}\n\nconst wordDesktopElementProcessor = (\n metadataKey: Map<string, WordMetadata>\n): ElementProcessor<HTMLElement> => {\n return (group, element, context) => {\n const styles = getStyles(element);\n // Process Word Lists or Word Commands, otherwise use the default processor on this element.\n if (\n !(\n processWordList(styles, group, element, context, metadataKey) ||\n processWordComments(styles, element)\n )\n ) {\n context.defaultElementProcessors.element(group, element, context);\n }\n };\n};\n\nfunction removeNonValidLineHeight(\n format: ContentModelBlockFormat,\n element: HTMLElement,\n context: DomToModelContext,\n defaultStyle: Readonly<Partial<CSSStyleDeclaration>>\n): void {\n //If the line height is less than the browser default line height, line between the text is going to be too narrow\n let parsedLineHeight: number;\n if (\n PERCENTAGE_REGEX.test(element.style.lineHeight) &&\n !isNaN((parsedLineHeight = parseInt(element.style.lineHeight))) &&\n parsedLineHeight < DEFAULT_BROWSER_LINE_HEIGHT_PERCENTAGE\n ) {\n format.lineHeight = defaultStyle.lineHeight;\n }\n}\n\nfunction listLevelParser(\n format: ContentModelListItemLevelFormat,\n element: HTMLElement,\n context: DomToModelContext,\n defaultStyle: Readonly<Partial<CSSStyleDeclaration>>\n): void {\n if (element.style.marginLeft != '') {\n format.marginLeft = defaultStyle.marginLeft;\n }\n\n format.marginBottom = undefined;\n}\n\nconst wordTableParser: FormatParser<ContentModelTableFormat> = (format): void => {\n if (format.marginLeft?.startsWith('-')) {\n delete format.marginLeft;\n }\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Check whether the element contain Word attributes related to comments and if it does we should no process
|
|
4
|
-
* this element.
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare function processWordComments(styles: Record<string, string>, element: HTMLElement): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Check whether the element contain Word attributes related to comments and if it does we should no process
|
|
4
|
+
* this element.
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function processWordComments(styles: Record<string, string>, element: HTMLElement): boolean;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
define(["require", "exports", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_dom_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.processWordComments = void 0;
|
|
5
|
-
var MSO_COMMENT_ANCHOR_HREF_REGEX = /#_msocom_/;
|
|
6
|
-
var MSO_SPECIAL_CHARACTER = 'mso-special-character';
|
|
7
|
-
var MSO_SPECIAL_CHARACTER_COMMENT = 'comment';
|
|
8
|
-
var MSO_ELEMENT = 'mso-element';
|
|
9
|
-
var MSO_ELEMENT_COMMENT_LIST = 'comment-list';
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
* Check whether the element contain Word attributes related to comments and if it does we should no process
|
|
13
|
-
* this element.
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
function processWordComments(styles, element) {
|
|
17
|
-
return (styles[MSO_SPECIAL_CHARACTER] == MSO_SPECIAL_CHARACTER_COMMENT ||
|
|
18
|
-
((0, roosterjs_content_model_dom_1.isElementOfType)(element, 'a') && MSO_COMMENT_ANCHOR_HREF_REGEX.test(element.href)) ||
|
|
19
|
-
styles[MSO_ELEMENT] == MSO_ELEMENT_COMMENT_LIST);
|
|
20
|
-
}
|
|
21
|
-
exports.processWordComments = processWordComments;
|
|
22
|
-
});
|
|
1
|
+
define(["require", "exports", "roosterjs-content-model-dom"], function (require, exports, roosterjs_content_model_dom_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.processWordComments = void 0;
|
|
5
|
+
var MSO_COMMENT_ANCHOR_HREF_REGEX = /#_msocom_/;
|
|
6
|
+
var MSO_SPECIAL_CHARACTER = 'mso-special-character';
|
|
7
|
+
var MSO_SPECIAL_CHARACTER_COMMENT = 'comment';
|
|
8
|
+
var MSO_ELEMENT = 'mso-element';
|
|
9
|
+
var MSO_ELEMENT_COMMENT_LIST = 'comment-list';
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* Check whether the element contain Word attributes related to comments and if it does we should no process
|
|
13
|
+
* this element.
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
function processWordComments(styles, element) {
|
|
17
|
+
return (styles[MSO_SPECIAL_CHARACTER] == MSO_SPECIAL_CHARACTER_COMMENT ||
|
|
18
|
+
((0, roosterjs_content_model_dom_1.isElementOfType)(element, 'a') && MSO_COMMENT_ANCHOR_HREF_REGEX.test(element.href)) ||
|
|
19
|
+
styles[MSO_ELEMENT] == MSO_ELEMENT_COMMENT_LIST);
|
|
20
|
+
}
|
|
21
|
+
exports.processWordComments = processWordComments;
|
|
22
|
+
});
|
|
23
23
|
//# sourceMappingURL=processWordComments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processWordComments.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processWordComments.ts"],"names":[],"mappings":";;;;IAEA,IAAM,6BAA6B,GAAG,WAAW,CAAC;IAClD,IAAM,qBAAqB,GAAG,uBAAuB,CAAC;IACtD,IAAM,6BAA6B,GAAG,SAAS,CAAC;IAChD,IAAM,WAAW,GAAG,aAAa,CAAC;IAClC,IAAM,wBAAwB,GAAG,cAAc,CAAC;IAEhD;;;;;OAKG;IACH,SAAgB,mBAAmB,CAAC,MAA8B,EAAE,OAAoB;QACpF,OAAO,CACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,6BAA6B;YAC9D,CAAC,IAAA,6CAAe,EAAC,OAAO,EAAE,GAAG,CAAC,IAAI,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACnF,MAAM,CAAC,WAAW,CAAC,IAAI,wBAAwB,CAClD,CAAC;IACN,CAAC;IAND,kDAMC","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\
|
|
1
|
+
{"version":3,"file":"processWordComments.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processWordComments.ts"],"names":[],"mappings":";;;;IAEA,IAAM,6BAA6B,GAAG,WAAW,CAAC;IAClD,IAAM,qBAAqB,GAAG,uBAAuB,CAAC;IACtD,IAAM,6BAA6B,GAAG,SAAS,CAAC;IAChD,IAAM,WAAW,GAAG,aAAa,CAAC;IAClC,IAAM,wBAAwB,GAAG,cAAc,CAAC;IAEhD;;;;;OAKG;IACH,SAAgB,mBAAmB,CAAC,MAA8B,EAAE,OAAoB;QACpF,OAAO,CACH,MAAM,CAAC,qBAAqB,CAAC,IAAI,6BAA6B;YAC9D,CAAC,IAAA,6CAAe,EAAC,OAAO,EAAE,GAAG,CAAC,IAAI,6BAA6B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACnF,MAAM,CAAC,WAAW,CAAC,IAAI,wBAAwB,CAClD,CAAC;IACN,CAAC;IAND,kDAMC","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\n\nconst MSO_COMMENT_ANCHOR_HREF_REGEX = /#_msocom_/;\nconst MSO_SPECIAL_CHARACTER = 'mso-special-character';\nconst MSO_SPECIAL_CHARACTER_COMMENT = 'comment';\nconst MSO_ELEMENT = 'mso-element';\nconst MSO_ELEMENT_COMMENT_LIST = 'comment-list';\n\n/**\n * @internal\n * Check whether the element contain Word attributes related to comments and if it does we should no process\n * this element.\n * @returns\n */\nexport function processWordComments(styles: Record<string, string>, element: HTMLElement) {\n return (\n styles[MSO_SPECIAL_CHARACTER] == MSO_SPECIAL_CHARACTER_COMMENT ||\n (isElementOfType(element, 'a') && MSO_COMMENT_ANCHOR_HREF_REGEX.test(element.href)) ||\n styles[MSO_ELEMENT] == MSO_ELEMENT_COMMENT_LIST\n );\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { WordMetadata } from './WordMetadata';
|
|
2
|
-
import type { ContentModelBlockGroup, DomToModelContext } from 'roosterjs-content-model-types';
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
* @param styles
|
|
6
|
-
* @param group
|
|
7
|
-
* @param element
|
|
8
|
-
* @param context
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare function processWordList(styles: Record<string, string>, group: ContentModelBlockGroup, element: HTMLElement, context: DomToModelContext, metadata: Map<string, WordMetadata>): boolean;
|
|
1
|
+
import type { WordMetadata } from './WordMetadata';
|
|
2
|
+
import type { ContentModelBlockGroup, DomToModelContext } from 'roosterjs-content-model-types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* @param styles
|
|
6
|
+
* @param group
|
|
7
|
+
* @param element
|
|
8
|
+
* @param context
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function processWordList(styles: Record<string, string>, group: ContentModelBlockGroup, element: HTMLElement, context: DomToModelContext, metadata: Map<string, WordMetadata>): boolean;
|