roosterjs-content-model-plugins 0.21.2 → 0.21.4
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/edit/ContentModelEditPlugin.d.ts +35 -35
- package/lib/edit/ContentModelEditPlugin.js +75 -75
- package/lib/edit/ContentModelEditPlugin.js.map +1 -1
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.js +19 -19
- package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
- package/lib/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
- package/lib/edit/deleteSteps/deleteCollapsedSelection.js +90 -90
- package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib/edit/deleteSteps/deleteWordSelection.js +170 -170
- package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib/edit/handleKeyboardEventCommon.d.ts +15 -15
- package/lib/edit/handleKeyboardEventCommon.js +54 -54
- package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib/edit/keyboardDelete.d.ts +8 -8
- package/lib/edit/keyboardDelete.js +67 -67
- package/lib/edit/keyboardDelete.js.map +1 -1
- package/lib/edit/keyboardInput.d.ts +5 -5
- package/lib/edit/keyboardInput.js +50 -49
- package/lib/edit/keyboardInput.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/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
- package/lib/entityDelimiter/EntityDelimiterPlugin.js +256 -254
- package/lib/entityDelimiter/EntityDelimiterPlugin.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/ContentModelPastePlugin.d.ts +42 -42
- package/lib/paste/ContentModelPastePlugin.js +148 -148
- package/lib/paste/ContentModelPastePlugin.js.map +1 -1
- package/lib/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
- package/lib/paste/Excel/processPastedContentFromExcel.js +82 -82
- package/lib/paste/Excel/processPastedContentFromExcel.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/processPastedContentWacComponents.d.ts +9 -9
- package/lib/paste/WacComponents/processPastedContentWacComponents.js +207 -207
- package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
- package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +69 -69
- 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 +10 -10
- package/lib/paste/WordDesktop/processWordLists.js +154 -154
- package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib/paste/pasteSourceValidations/constants.js +21 -21
- package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
- package/lib/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/documentContainWacElements.js +24 -24
- 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 +16 -16
- package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js +18 -18
- package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js +14 -14
- package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +14 -14
- package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
- package/lib/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
- package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js +18 -18
- 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-amd/edit/ContentModelEditPlugin.d.ts +35 -35
- package/lib-amd/edit/ContentModelEditPlugin.js +75 -75
- package/lib-amd/edit/ContentModelEditPlugin.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js +20 -20
- 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 +89 -89
- package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib-amd/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib-amd/edit/deleteSteps/deleteWordSelection.js +169 -169
- package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib-amd/edit/handleKeyboardEventCommon.d.ts +15 -15
- package/lib-amd/edit/handleKeyboardEventCommon.js +55 -55
- package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib-amd/edit/keyboardDelete.d.ts +8 -8
- package/lib-amd/edit/keyboardDelete.js +63 -63
- package/lib-amd/edit/keyboardDelete.js.map +1 -1
- package/lib-amd/edit/keyboardInput.d.ts +5 -5
- package/lib-amd/edit/keyboardInput.js +50 -49
- package/lib-amd/edit/keyboardInput.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/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
- package/lib-amd/entityDelimiter/EntityDelimiterPlugin.js +255 -253
- package/lib-amd/entityDelimiter/EntityDelimiterPlugin.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/ContentModelPastePlugin.d.ts +42 -42
- package/lib-amd/paste/ContentModelPastePlugin.js +140 -140
- package/lib-amd/paste/ContentModelPastePlugin.js.map +1 -1
- package/lib-amd/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
- package/lib-amd/paste/Excel/processPastedContentFromExcel.js +80 -80
- package/lib-amd/paste/Excel/processPastedContentFromExcel.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/processPastedContentWacComponents.d.ts +9 -9
- package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +206 -206
- package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
- package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +64 -64
- 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 +10 -10
- package/lib-amd/paste/WordDesktop/processWordLists.js +153 -153
- package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib-amd/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib-amd/paste/pasteSourceValidations/constants.js +23 -23
- 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 +26 -26
- 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-mjs/edit/ContentModelEditPlugin.d.ts +35 -35
- package/lib-mjs/edit/ContentModelEditPlugin.js +72 -72
- package/lib-mjs/edit/ContentModelEditPlugin.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
- package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js +15 -15
- 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 +87 -87
- package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.js +167 -167
- package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
- package/lib-mjs/edit/handleKeyboardEventCommon.d.ts +15 -15
- package/lib-mjs/edit/handleKeyboardEventCommon.js +48 -48
- package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
- package/lib-mjs/edit/keyboardDelete.d.ts +8 -8
- package/lib-mjs/edit/keyboardDelete.js +63 -63
- package/lib-mjs/edit/keyboardDelete.js.map +1 -1
- package/lib-mjs/edit/keyboardInput.d.ts +5 -5
- package/lib-mjs/edit/keyboardInput.js +46 -45
- package/lib-mjs/edit/keyboardInput.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/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
- package/lib-mjs/entityDelimiter/EntityDelimiterPlugin.js +252 -250
- package/lib-mjs/entityDelimiter/EntityDelimiterPlugin.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/ContentModelPastePlugin.d.ts +42 -42
- package/lib-mjs/paste/ContentModelPastePlugin.js +145 -145
- package/lib-mjs/paste/ContentModelPastePlugin.js.map +1 -1
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +77 -77
- package/lib-mjs/paste/Excel/processPastedContentFromExcel.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/processPastedContentWacComponents.d.ts +9 -9
- package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +203 -203
- package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
- package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
- package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +64 -64
- 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 +10 -10
- package/lib-mjs/paste/WordDesktop/processWordLists.js +150 -150
- package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
- package/lib-mjs/paste/pasteSourceValidations/constants.d.ts +17 -17
- package/lib-mjs/paste/pasteSourceValidations/constants.js +18 -18
- 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 +20 -20
- 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 +12 -12
- 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 +14 -14
- 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 +10 -10
- 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 +10 -10
- 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 +14 -14
- 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/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processWordLists.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processWordLists.ts"],"names":[],"mappings":";;;;IAiBA,oCAAoC;IACpC,IAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,IAAM,eAAe,GAAG,QAAQ,CAAC;IACjC,IAAM,YAAY,GAAG,CAAC,CAAC;IACvB,IAAM,eAAe,GAAG,IAAI,CAAC;IAQ7B;;;;;;;OAOG;IACH,SAAgB,eAAe,CAC3B,MAA8B,EAC9B,KAA6B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AAO,MAAM,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACH,SAAS,YAAY,CAAC,IAAU;QAC5B,IAAI,IAAA,0CAAY,EAAC,IAAI,EAAE,cAAc,CAAC,EAAE;YACpC,IAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,IAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC/D,IACI,aAAa;gBACb,aAAa,CAAC,MAAM,GAAG,CAAC;gBACxB,aAAa,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,eAAe,EACvD;gBACE,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC","sourcesContent":["import { getStyles } from '../utils/getStyles';\nimport {\n addBlock,\n createListItem,\n createListLevel,\n isNodeOfType,\n parseFormat,\n} from 'roosterjs-content-model-dom';\nimport type {\n ContentModelBlockGroup,\n ContentModelListItemLevelFormat,\n ContentModelListLevel,\n DomToModelContext,\n DomToModelListFormat,\n FormatParser,\n} from 'roosterjs-content-model-types';\n\n/** Word list metadata style name */\nconst MSO_LIST = 'mso-list';\nconst MSO_LIST_IGNORE = 'ignore';\nconst LOOKUP_DEPTH = 5;\nconst WORD_FIRST_LIST = 'l0';\n\ninterface WordDesktopListFormat extends DomToModelListFormat {\n wordLevel?: number | '';\n wordList?: string;\n wordKnownLevels?: Map<string, ContentModelListLevel[]>;\n}\n\n/**\n * @internal\n * @param styles\n * @param group\n * @param element\n * @param context\n * @returns\n */\nexport function processWordList(\n styles: Record<string, string>,\n group: ContentModelBlockGroup,\n element: HTMLElement,\n context: DomToModelContext\n) {\n const listFormat = context.listFormat as WordDesktopListFormat;\n if (!listFormat.wordKnownLevels) {\n listFormat.wordKnownLevels = new Map<string, ContentModelListLevel[]>();\n }\n const wordListStyle = styles[MSO_LIST] || '';\n\n // If the element contains Ignore style, do not process it,\n // Usually this element contains the fake bullet used in Word Desktop.\n if (wordListStyle.toLowerCase() === MSO_LIST_IGNORE) {\n return true;\n }\n\n const listProps = wordListStyle.split(' ');\n // Try get the list metadata from word, which follows this format: l1 level1 lfo2\n // If we are able to get the level property means we can process this element to be a list\n listFormat.wordLevel = listProps[1] && parseInt(listProps[1].substr('level'.length));\n\n listFormat.wordList = listProps[0] || WORD_FIRST_LIST;\n if (listFormat.levels.length == 0) {\n listFormat.levels = listFormat.wordKnownLevels.get(listFormat.wordList) || [];\n }\n\n if (wordListStyle && group && typeof listFormat.wordLevel === 'number') {\n const { wordLevel } = listFormat;\n // Retrieve the Fake bullet on the element and also the list type\n const fakeBullet = getFakeBulletText(element);\n const listType = getFakeBulletTagName(fakeBullet);\n\n // Create the new level of the list item and parse the format\n const newLevel: ContentModelListLevel = createListLevel(listType);\n parseFormat(element, context.formatParsers.listLevel, newLevel.format, context);\n\n // If the list format is in a different level, update the array so we get the new item\n // To be in the same level as the provided level metadata.\n if (wordLevel > listFormat.levels.length) {\n while (wordLevel != listFormat.levels.length) {\n listFormat.levels.push(newLevel);\n }\n } else {\n listFormat.levels.splice(wordLevel, listFormat.levels.length - 1);\n listFormat.levels[wordLevel - 1] = newLevel;\n }\n\n listFormat.listParent = group;\n\n processAsListItem(listFormat, context, element, group, fakeBullet);\n\n if (\n listFormat.levels.length > 0 &&\n listFormat.wordKnownLevels.get(listFormat.wordList) != listFormat.levels\n ) {\n listFormat.wordKnownLevels.set(listFormat.wordList, [...listFormat.levels]);\n }\n return true;\n }\n\n return false;\n}\n\nfunction processAsListItem(\n listFormat: WordDesktopListFormat,\n context: DomToModelContext,\n element: HTMLElement,\n group: ContentModelBlockGroup,\n fakeBullet: string\n) {\n const listItem = createListItem(listFormat.levels, context.segmentFormat);\n const lastLevel = listItem.levels[listItem.levels.length - 1];\n\n parseFormat(element, context.formatParsers.segmentOnBlock, context.segmentFormat, context);\n parseFormat(element, context.formatParsers.listItemElement, listItem.format, context);\n\n if (lastLevel?.listType == 'OL') {\n parseFormat(\n element,\n [startNumberOverrideParser(fakeBullet)],\n listItem.levels[listItem.levels.length - 1].format,\n context\n );\n }\n\n context.elementProcessors.child(listItem, element, context);\n addBlock(group, listItem);\n}\n\nfunction startNumberOverrideParser(\n fakeBullet: string\n): FormatParser<ContentModelListItemLevelFormat> | null {\n return (format, _, context) => {\n const {\n wordKnownLevels,\n wordLevel,\n wordList,\n } = context.listFormat as WordDesktopListFormat;\n if (typeof wordLevel === 'number' && wordList) {\n const start = parseInt(fakeBullet);\n if (start != undefined && !isNaN(start) && !wordKnownLevels?.has(wordList)) {\n format.startNumberOverride = start;\n }\n }\n };\n}\n\n/**\n * Check whether the string is a fake bullet from word Desktop\n */\nfunction isFakeBullet(fakeBullet: string): boolean {\n return ['o', '·', '§', '-'].indexOf(fakeBullet) >= 0;\n}\n\n/** Given a fake bullet text, returns the type of list that should be used for it */\nfunction getFakeBulletTagName(fakeBullet: string): 'UL' | 'OL' {\n return isFakeBullet(fakeBullet) ? 'UL' : 'OL';\n}\n\n/**\n * Finds the fake bullet text out of the specified node and returns it. For images, it will return\n * a bullet string. If not found, it returns null...\n */\nfunction getFakeBulletText(node: Node, levels?: number): string {\n // Word uses the following format for their bullets:\n // <p style=\"mso-list:l1 level1 lfo2\">\n // <span style=\"...\">\n // <span style=\"mso-list:Ignore\">1.<span style=\"...\"> </span></span>\n // </span>\n // Content here...\n // </p>\n //\n // Basically, we need to locate the mso-list:Ignore SPAN, which holds either one text or image node. That\n // text or image node will be the fake bullet we are looking for\n let result: string = '';\n levels = levels || LOOKUP_DEPTH;\n let child: Node | null = node.firstChild;\n while (!result && child) {\n // Check if this is the node that holds the fake bullets (mso-list: Ignore)\n if (isIgnoreNode(child)) {\n // Yes... this is the node that holds either the text or image data\n result = child.textContent?.trim() ?? '';\n\n // This is the case for image case\n if (result.length == 0) {\n result = 'o';\n }\n } else if (isNodeOfType(child, 'ELEMENT_NODE') && levels > 1) {\n // If this is an element and we are not in the last level, try to get the fake bullet\n // out of the child\n result = getFakeBulletText(child, levels - 1);\n }\n\n child = child.nextSibling;\n }\n\n return result;\n}\n/**\n * Checks if the specified node is marked as a mso-list: Ignore. These\n * nodes need to be ignored when a list item is converted into standard\n * HTML lists\n */\nfunction isIgnoreNode(node: Node): boolean {\n if (isNodeOfType(node, 'ELEMENT_NODE')) {\n const listAttribute = getStyles(node as HTMLElement)[MSO_LIST];\n if (\n listAttribute &&\n listAttribute.length > 0 &&\n listAttribute.trim().toLowerCase() == MSO_LIST_IGNORE\n ) {\n return true;\n }\n }\n\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"processWordLists.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WordDesktop/processWordLists.ts"],"names":[],"mappings":";;;;IAiBA,oCAAoC;IACpC,IAAM,QAAQ,GAAG,UAAU,CAAC;IAC5B,IAAM,eAAe,GAAG,QAAQ,CAAC;IACjC,IAAM,YAAY,GAAG,CAAC,CAAC;IACvB,IAAM,eAAe,GAAG,IAAI,CAAC;IAQ7B;;;;;;;OAOG;IACH,SAAgB,eAAe,CAC3B,MAA8B,EAC9B,KAA6B,EAC7B,OAAoB,EACpB,OAA0B;QAE1B,IAAM,UAAU,GAAG,OAAO,CAAC,UAAmC,CAAC;QAC/D,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE;YAC7B,UAAU,CAAC,eAAe,GAAG,IAAI,GAAG,EAAmC,CAAC;SAC3E;QACD,IAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAE7C,2DAA2D;QAC3D,sEAAsE;QACtE,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,eAAe,EAAE;YACjD,OAAO,IAAI,CAAC;SACf;QAED,IAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,iFAAiF;QACjF,0FAA0F;QAC1F,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,C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AI,YAAY,CAAC;QAChC,IAAI,KAAK,GAAgB,IAAI,CAAC,UAAU,CAAC;QACzC,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE;YACrB,2EAA2E;YAC3E,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;gBACrB,mEAAmE;gBACnE,MAAM,GAAG,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,IAAI,EAAE,mCAAI,EAAE,CAAC;gBAEzC,kCAAkC;gBAClC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;oBACpB,MAAM,GAAG,GAAG,CAAC;iBAChB;aACJ;iBAAM,IAAI,IAAA,0CAAY,EAAC,KAAK,EAAE,cAAc,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE;gBAC1D,qFAAqF;gBACrF,mBAAmB;gBACnB,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;aACjD;YAED,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC;SAC7B;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACH,SAAS,YAAY,CAAC,IAAU;QAC5B,IAAI,IAAA,0CAAY,EAAC,IAAI,EAAE,cAAc,CAAC,EAAE;YACpC,IAAM,aAAa,GAAG,IAAA,qBAAS,EAAC,IAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC;YAC/D,IACI,aAAa;gBACb,aAAa,CAAC,MAAM,GAAG,CAAC;gBACxB,aAAa,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,eAAe,EACvD;gBACE,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC","sourcesContent":["import { getStyles } from '../utils/getStyles';\r\nimport {\r\n addBlock,\r\n createListItem,\r\n createListLevel,\r\n isNodeOfType,\r\n parseFormat,\r\n} from 'roosterjs-content-model-dom';\r\nimport type {\r\n ContentModelBlockGroup,\r\n ContentModelListItemLevelFormat,\r\n ContentModelListLevel,\r\n DomToModelContext,\r\n DomToModelListFormat,\r\n FormatParser,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/** Word list metadata style name */\r\nconst MSO_LIST = 'mso-list';\r\nconst MSO_LIST_IGNORE = 'ignore';\r\nconst LOOKUP_DEPTH = 5;\r\nconst WORD_FIRST_LIST = 'l0';\r\n\r\ninterface WordDesktopListFormat extends DomToModelListFormat {\r\n wordLevel?: number | '';\r\n wordList?: string;\r\n wordKnownLevels?: Map<string, ContentModelListLevel[]>;\r\n}\r\n\r\n/**\r\n * @internal\r\n * @param styles\r\n * @param group\r\n * @param element\r\n * @param context\r\n * @returns\r\n */\r\nexport function processWordList(\r\n styles: Record<string, string>,\r\n group: ContentModelBlockGroup,\r\n element: HTMLElement,\r\n context: DomToModelContext\r\n) {\r\n const listFormat = context.listFormat as WordDesktopListFormat;\r\n if (!listFormat.wordKnownLevels) {\r\n listFormat.wordKnownLevels = new Map<string, ContentModelListLevel[]>();\r\n }\r\n const wordListStyle = styles[MSO_LIST] || '';\r\n\r\n // If the element contains Ignore style, do not process it,\r\n // Usually this element contains the fake bullet used in Word Desktop.\r\n if (wordListStyle.toLowerCase() === MSO_LIST_IGNORE) {\r\n return true;\r\n }\r\n\r\n const listProps = wordListStyle.split(' ');\r\n // Try get the list metadata from word, which follows this format: l1 level1 lfo2\r\n // If we are able to get the level property means we can process this element to be a list\r\n listFormat.wordLevel = listProps[1] && parseInt(listProps[1].substr('level'.length));\r\n\r\n listFormat.wordList = listProps[0] || WORD_FIRST_LIST;\r\n if (listFormat.levels.length == 0) {\r\n listFormat.levels = listFormat.wordKnownLevels.get(listFormat.wordList) || [];\r\n }\r\n\r\n if (wordListStyle && group && typeof listFormat.wordLevel === 'number') {\r\n const { wordLevel } = listFormat;\r\n // Retrieve the Fake bullet on the element and also the list type\r\n const fakeBullet = getFakeBulletText(element);\r\n const listType = getFakeBulletTagName(fakeBullet);\r\n\r\n // Create the new level of the list item and parse the format\r\n const newLevel: ContentModelListLevel = createListLevel(listType);\r\n parseFormat(element, context.formatParsers.listLevel, newLevel.format, context);\r\n\r\n // If the list format is in a different level, update the array so we get the new item\r\n // To be in the same level as the provided level metadata.\r\n if (wordLevel > listFormat.levels.length) {\r\n while (wordLevel != listFormat.levels.length) {\r\n listFormat.levels.push(newLevel);\r\n }\r\n } else {\r\n listFormat.levels.splice(wordLevel, listFormat.levels.length - 1);\r\n listFormat.levels[wordLevel - 1] = newLevel;\r\n }\r\n\r\n listFormat.listParent = group;\r\n\r\n processAsListItem(listFormat, context, element, group, fakeBullet);\r\n\r\n if (\r\n listFormat.levels.length > 0 &&\r\n listFormat.wordKnownLevels.get(listFormat.wordList) != listFormat.levels\r\n ) {\r\n listFormat.wordKnownLevels.set(listFormat.wordList, [...listFormat.levels]);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction processAsListItem(\r\n listFormat: WordDesktopListFormat,\r\n context: DomToModelContext,\r\n element: HTMLElement,\r\n group: ContentModelBlockGroup,\r\n fakeBullet: string\r\n) {\r\n const listItem = createListItem(listFormat.levels, context.segmentFormat);\r\n const lastLevel = listItem.levels[listItem.levels.length - 1];\r\n\r\n parseFormat(element, context.formatParsers.segmentOnBlock, context.segmentFormat, context);\r\n parseFormat(element, context.formatParsers.listItemElement, listItem.format, context);\r\n\r\n if (lastLevel?.listType == 'OL') {\r\n parseFormat(\r\n element,\r\n [startNumberOverrideParser(fakeBullet)],\r\n listItem.levels[listItem.levels.length - 1].format,\r\n context\r\n );\r\n }\r\n\r\n context.elementProcessors.child(listItem, element, context);\r\n addBlock(group, listItem);\r\n}\r\n\r\nfunction startNumberOverrideParser(\r\n fakeBullet: string\r\n): FormatParser<ContentModelListItemLevelFormat> | null {\r\n return (format, _, context) => {\r\n const {\r\n wordKnownLevels,\r\n wordLevel,\r\n wordList,\r\n } = context.listFormat as WordDesktopListFormat;\r\n if (typeof wordLevel === 'number' && wordList) {\r\n const start = parseInt(fakeBullet);\r\n if (start != undefined && !isNaN(start) && !wordKnownLevels?.has(wordList)) {\r\n format.startNumberOverride = start;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Check whether the string is a fake bullet from word Desktop\r\n */\r\nfunction isFakeBullet(fakeBullet: string): boolean {\r\n return ['o', '·', '§', '-'].indexOf(fakeBullet) >= 0;\r\n}\r\n\r\n/** Given a fake bullet text, returns the type of list that should be used for it */\r\nfunction getFakeBulletTagName(fakeBullet: string): 'UL' | 'OL' {\r\n return isFakeBullet(fakeBullet) ? 'UL' : 'OL';\r\n}\r\n\r\n/**\r\n * Finds the fake bullet text out of the specified node and returns it. For images, it will return\r\n * a bullet string. If not found, it returns null...\r\n */\r\nfunction getFakeBulletText(node: Node, levels?: number): string {\r\n // Word uses the following format for their bullets:\r\n // <p style=\"mso-list:l1 level1 lfo2\">\r\n // <span style=\"...\">\r\n // <span style=\"mso-list:Ignore\">1.<span style=\"...\"> </span></span>\r\n // </span>\r\n // Content here...\r\n // </p>\r\n //\r\n // Basically, we need to locate the mso-list:Ignore SPAN, which holds either one text or image node. That\r\n // text or image node will be the fake bullet we are looking for\r\n let result: string = '';\r\n levels = levels || LOOKUP_DEPTH;\r\n let child: Node | null = node.firstChild;\r\n while (!result && child) {\r\n // Check if this is the node that holds the fake bullets (mso-list: Ignore)\r\n if (isIgnoreNode(child)) {\r\n // Yes... this is the node that holds either the text or image data\r\n result = child.textContent?.trim() ?? '';\r\n\r\n // This is the case for image case\r\n if (result.length == 0) {\r\n result = 'o';\r\n }\r\n } else if (isNodeOfType(child, 'ELEMENT_NODE') && levels > 1) {\r\n // If this is an element and we are not in the last level, try to get the fake bullet\r\n // out of the child\r\n result = getFakeBulletText(child, levels - 1);\r\n }\r\n\r\n child = child.nextSibling;\r\n }\r\n\r\n return result;\r\n}\r\n/**\r\n * Checks if the specified node is marked as a mso-list: Ignore. These\r\n * nodes need to be ignored when a list item is converted into standard\r\n * HTML lists\r\n */\r\nfunction isIgnoreNode(node: Node): boolean {\r\n if (isNodeOfType(node, 'ELEMENT_NODE')) {\r\n const listAttribute = getStyles(node as HTMLElement)[MSO_LIST];\r\n if (\r\n listAttribute &&\r\n listAttribute.length > 0 &&\r\n listAttribute.trim().toLowerCase() == MSO_LIST_IGNORE\r\n ) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export declare const enum PastePropertyNames {
|
|
5
|
-
/**
|
|
6
|
-
* Node attribute used to identify if the content is from Google Sheets.
|
|
7
|
-
*/
|
|
8
|
-
GOOGLE_SHEET_NODE_NAME = "google-sheets-html-origin",
|
|
9
|
-
/**
|
|
10
|
-
* Name of the HTMLMeta Property that provides the Office App Source of the pasted content
|
|
11
|
-
*/
|
|
12
|
-
PROG_ID_NAME = "ProgId",
|
|
13
|
-
/**
|
|
14
|
-
* Name of the HTMLMeta Property that identifies pated content as from Excel Desktop
|
|
15
|
-
*/
|
|
16
|
-
EXCEL_DESKTOP_ATTRIBUTE_NAME = "xmlns:x"
|
|
17
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare const enum PastePropertyNames {
|
|
5
|
+
/**
|
|
6
|
+
* Node attribute used to identify if the content is from Google Sheets.
|
|
7
|
+
*/
|
|
8
|
+
GOOGLE_SHEET_NODE_NAME = "google-sheets-html-origin",
|
|
9
|
+
/**
|
|
10
|
+
* Name of the HTMLMeta Property that provides the Office App Source of the pasted content
|
|
11
|
+
*/
|
|
12
|
+
PROG_ID_NAME = "ProgId",
|
|
13
|
+
/**
|
|
14
|
+
* Name of the HTMLMeta Property that identifies pated content as from Excel Desktop
|
|
15
|
+
*/
|
|
16
|
+
EXCEL_DESKTOP_ATTRIBUTE_NAME = "xmlns:x"
|
|
17
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PastePropertyNames = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
var PastePropertyNames;
|
|
9
|
-
(function (PastePropertyNames) {
|
|
10
|
-
/**
|
|
11
|
-
* Node attribute used to identify if the content is from Google Sheets.
|
|
12
|
-
*/
|
|
13
|
-
PastePropertyNames["GOOGLE_SHEET_NODE_NAME"] = "google-sheets-html-origin";
|
|
14
|
-
/**
|
|
15
|
-
* Name of the HTMLMeta Property that provides the Office App Source of the pasted content
|
|
16
|
-
*/
|
|
17
|
-
PastePropertyNames["PROG_ID_NAME"] = "ProgId";
|
|
18
|
-
/**
|
|
19
|
-
* Name of the HTMLMeta Property that identifies pated content as from Excel Desktop
|
|
20
|
-
*/
|
|
21
|
-
PastePropertyNames["EXCEL_DESKTOP_ATTRIBUTE_NAME"] = "xmlns:x";
|
|
22
|
-
})(PastePropertyNames = exports.PastePropertyNames || (exports.PastePropertyNames = {}));
|
|
23
|
-
});
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PastePropertyNames = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
var PastePropertyNames;
|
|
9
|
+
(function (PastePropertyNames) {
|
|
10
|
+
/**
|
|
11
|
+
* Node attribute used to identify if the content is from Google Sheets.
|
|
12
|
+
*/
|
|
13
|
+
PastePropertyNames["GOOGLE_SHEET_NODE_NAME"] = "google-sheets-html-origin";
|
|
14
|
+
/**
|
|
15
|
+
* Name of the HTMLMeta Property that provides the Office App Source of the pasted content
|
|
16
|
+
*/
|
|
17
|
+
PastePropertyNames["PROG_ID_NAME"] = "ProgId";
|
|
18
|
+
/**
|
|
19
|
+
* Name of the HTMLMeta Property that identifies pated content as from Excel Desktop
|
|
20
|
+
*/
|
|
21
|
+
PastePropertyNames["EXCEL_DESKTOP_ATTRIBUTE_NAME"] = "xmlns:x";
|
|
22
|
+
})(PastePropertyNames = exports.PastePropertyNames || (exports.PastePropertyNames = {}));
|
|
23
|
+
});
|
|
24
24
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/constants.ts"],"names":[],"mappings":";;;;IAAA;;OAEG;IACH,IAAkB,kBAejB;IAfD,WAAkB,kBAAkB;QAChC;;WAEG;QACH,0EAAoD,CAAA;QAEpD;;WAEG;QACH,6CAAuB,CAAA;QAEvB;;WAEG;QACH,8DAAwC,CAAA;IAC5C,CAAC,EAfiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAenC","sourcesContent":["/**\n * @internal\n */\nexport const enum PastePropertyNames {\n /**\n * Node attribute used to identify if the content is from Google Sheets.\n */\n GOOGLE_SHEET_NODE_NAME = 'google-sheets-html-origin',\n\n /**\n * Name of the HTMLMeta Property that provides the Office App Source of the pasted content\n */\n PROG_ID_NAME = 'ProgId',\n\n /**\n * Name of the HTMLMeta Property that identifies pated content as from Excel Desktop\n */\n EXCEL_DESKTOP_ATTRIBUTE_NAME = 'xmlns:x',\n}\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/constants.ts"],"names":[],"mappings":";;;;IAAA;;OAEG;IACH,IAAkB,kBAejB;IAfD,WAAkB,kBAAkB;QAChC;;WAEG;QACH,0EAAoD,CAAA;QAEpD;;WAEG;QACH,6CAAuB,CAAA;QAEvB;;WAEG;QACH,8DAAwC,CAAA;IAC5C,CAAC,EAfiB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAenC","sourcesContent":["/**\r\n * @internal\r\n */\r\nexport const enum PastePropertyNames {\r\n /**\r\n * Node attribute used to identify if the content is from Google Sheets.\r\n */\r\n GOOGLE_SHEET_NODE_NAME = 'google-sheets-html-origin',\r\n\r\n /**\r\n * Name of the HTMLMeta Property that provides the Office App Source of the pasted content\r\n */\r\n PROG_ID_NAME = 'ProgId',\r\n\r\n /**\r\n * Name of the HTMLMeta Property that identifies pated content as from Excel Desktop\r\n */\r\n EXCEL_DESKTOP_ATTRIBUTE_NAME = 'xmlns:x',\r\n}\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Check whether the fragment provided contain Wac Elements
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const documentContainWacElements: GetSourceFunction;
|
|
1
|
+
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Check whether the fragment provided contain Wac Elements
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const documentContainWacElements: GetSourceFunction;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.documentContainWacElements = void 0;
|
|
5
|
-
var WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [
|
|
6
|
-
'TableInsertRowGapBlank',
|
|
7
|
-
'TableColumnResizeHandle',
|
|
8
|
-
'TableCellTopBorderHandle',
|
|
9
|
-
'TableCellLeftBorderHandle',
|
|
10
|
-
'TableHoverColumnHandle',
|
|
11
|
-
'TableHoverRowHandle',
|
|
12
|
-
];
|
|
13
|
-
var WAC_IDENTIFY_SELECTOR = 'ul[class^="BulletListStyle"]>.OutlineElement,ol[class^="NumberListStyle"]>.OutlineElement,span.WACImageContainer,' +
|
|
14
|
-
WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(function (c) { return "table div[class^=\"" + c + "\"]"; }).join(',');
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
* Check whether the fragment provided contain Wac Elements
|
|
18
|
-
* @param props Properties related to the PasteEvent
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
var documentContainWacElements = function (props) {
|
|
22
|
-
var fragment = props.fragment;
|
|
23
|
-
return !!fragment.querySelector(WAC_IDENTIFY_SELECTOR);
|
|
24
|
-
};
|
|
25
|
-
exports.documentContainWacElements = documentContainWacElements;
|
|
26
|
-
});
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.documentContainWacElements = void 0;
|
|
5
|
+
var WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [
|
|
6
|
+
'TableInsertRowGapBlank',
|
|
7
|
+
'TableColumnResizeHandle',
|
|
8
|
+
'TableCellTopBorderHandle',
|
|
9
|
+
'TableCellLeftBorderHandle',
|
|
10
|
+
'TableHoverColumnHandle',
|
|
11
|
+
'TableHoverRowHandle',
|
|
12
|
+
];
|
|
13
|
+
var WAC_IDENTIFY_SELECTOR = 'ul[class^="BulletListStyle"]>.OutlineElement,ol[class^="NumberListStyle"]>.OutlineElement,span.WACImageContainer,' +
|
|
14
|
+
WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(function (c) { return "table div[class^=\"" + c + "\"]"; }).join(',');
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
* Check whether the fragment provided contain Wac Elements
|
|
18
|
+
* @param props Properties related to the PasteEvent
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
var documentContainWacElements = function (props) {
|
|
22
|
+
var fragment = props.fragment;
|
|
23
|
+
return !!fragment.querySelector(WAC_IDENTIFY_SELECTOR);
|
|
24
|
+
};
|
|
25
|
+
exports.documentContainWacElements = documentContainWacElements;
|
|
26
|
+
});
|
|
27
27
|
//# sourceMappingURL=documentContainWacElements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentContainWacElements.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/documentContainWacElements.ts"],"names":[],"mappings":";;;;IAEA,IAAM,sCAAsC,GAAG;QAC3C,wBAAwB;QACxB,yBAAyB;QACzB,0BAA0B;QAC1B,2BAA2B;QAC3B,wBAAwB;QACxB,qBAAqB;KACxB,CAAC;IAEF,IAAM,qBAAqB,GACvB,mHAAmH;QACnH,sCAAsC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,wBAAqB,CAAC,QAAI,EAA1B,CAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1F;;;;;OAKG;IACI,IAAM,0BAA0B,GAAsB,UAAA,KAAK;QACtD,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC3D,CAAC,CAAC;IAHW,QAAA,0BAA0B,8BAGrC","sourcesContent":["import type { GetSourceFunction } from './getPasteSource';\n\nconst WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [\n 'TableInsertRowGapBlank',\n 'TableColumnResizeHandle',\n 'TableCellTopBorderHandle',\n 'TableCellLeftBorderHandle',\n 'TableHoverColumnHandle',\n 'TableHoverRowHandle',\n];\n\nconst WAC_IDENTIFY_SELECTOR =\n 'ul[class^=\"BulletListStyle\"]>.OutlineElement,ol[class^=\"NumberListStyle\"]>.OutlineElement,span.WACImageContainer,' +\n WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(c => `table div[class^=\"${c}\"]`).join(',');\n\n/**\n * @internal\n * Check whether the fragment provided contain Wac Elements\n * @param props Properties related to the PasteEvent\n * @returns\n */\nexport const documentContainWacElements: GetSourceFunction = props => {\n const { fragment } = props;\n return !!fragment.querySelector(WAC_IDENTIFY_SELECTOR);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"documentContainWacElements.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/documentContainWacElements.ts"],"names":[],"mappings":";;;;IAEA,IAAM,sCAAsC,GAAG;QAC3C,wBAAwB;QACxB,yBAAyB;QACzB,0BAA0B;QAC1B,2BAA2B;QAC3B,wBAAwB;QACxB,qBAAqB;KACxB,CAAC;IAEF,IAAM,qBAAqB,GACvB,mHAAmH;QACnH,sCAAsC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,wBAAqB,CAAC,QAAI,EAA1B,CAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE1F;;;;;OAKG;IACI,IAAM,0BAA0B,GAAsB,UAAA,KAAK;QACtD,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC3D,CAAC,CAAC;IAHW,QAAA,0BAA0B,8BAGrC","sourcesContent":["import type { GetSourceFunction } from './getPasteSource';\r\n\r\nconst WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [\r\n 'TableInsertRowGapBlank',\r\n 'TableColumnResizeHandle',\r\n 'TableCellTopBorderHandle',\r\n 'TableCellLeftBorderHandle',\r\n 'TableHoverColumnHandle',\r\n 'TableHoverRowHandle',\r\n];\r\n\r\nconst WAC_IDENTIFY_SELECTOR =\r\n 'ul[class^=\"BulletListStyle\"]>.OutlineElement,ol[class^=\"NumberListStyle\"]>.OutlineElement,span.WACImageContainer,' +\r\n WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(c => `table div[class^=\"${c}\"]`).join(',');\r\n\r\n/**\r\n * @internal\r\n * Check whether the fragment provided contain Wac Elements\r\n * @param props Properties related to the PasteEvent\r\n * @returns\r\n */\r\nexport const documentContainWacElements: GetSourceFunction = props => {\r\n const { fragment } = props;\r\n return !!fragment.querySelector(WAC_IDENTIFY_SELECTOR);\r\n};\r\n"]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { BeforePasteEvent, ClipboardData } from 'roosterjs-editor-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare type GetSourceInputParams = {
|
|
6
|
-
htmlAttributes: Record<string, string>;
|
|
7
|
-
fragment: DocumentFragment;
|
|
8
|
-
shouldConvertSingleImage: boolean;
|
|
9
|
-
clipboardData: ClipboardData;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
* Represent the types of sources to handle in the Paste Plugin
|
|
14
|
-
*/
|
|
15
|
-
export declare type KnownPasteSourceType = 'wordDesktop' | 'excelDesktop' | 'excelOnline' | 'powerPointDesktop' | 'googleSheets' | 'wacComponents' | 'default' | 'singleImage';
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export declare type GetSourceFunction = (props: GetSourceInputParams) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
* This function tries to get the source of the Pasted content
|
|
23
|
-
* @param event the before paste event
|
|
24
|
-
* @param shouldConvertSingleImage Whether convert single image is enabled.
|
|
25
|
-
* @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}
|
|
26
|
-
*/
|
|
27
|
-
export declare function getPasteSource(event: BeforePasteEvent, shouldConvertSingleImage: boolean): KnownPasteSourceType;
|
|
1
|
+
import type { BeforePasteEvent, ClipboardData } from 'roosterjs-editor-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare type GetSourceInputParams = {
|
|
6
|
+
htmlAttributes: Record<string, string>;
|
|
7
|
+
fragment: DocumentFragment;
|
|
8
|
+
shouldConvertSingleImage: boolean;
|
|
9
|
+
clipboardData: ClipboardData;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
* Represent the types of sources to handle in the Paste Plugin
|
|
14
|
+
*/
|
|
15
|
+
export declare type KnownPasteSourceType = 'wordDesktop' | 'excelDesktop' | 'excelOnline' | 'powerPointDesktop' | 'googleSheets' | 'wacComponents' | 'default' | 'singleImage';
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare type GetSourceFunction = (props: GetSourceInputParams) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
* This function tries to get the source of the Pasted content
|
|
23
|
+
* @param event the before paste event
|
|
24
|
+
* @param shouldConvertSingleImage Whether convert single image is enabled.
|
|
25
|
+
* @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPasteSource(event: BeforePasteEvent, shouldConvertSingleImage: boolean): KnownPasteSourceType;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
define(["require", "exports", "./documentContainWacElements", "./isExcelDesktopDocument", "./isExcelOnlineDocument", "./isGoogleSheetDocument", "./isPowerPointDesktopDocument", "./isWordDesktopDocument", "./shouldConvertToSingleImage"], function (require, exports, documentContainWacElements_1, isExcelDesktopDocument_1, isExcelOnlineDocument_1, isGoogleSheetDocument_1, isPowerPointDesktopDocument_1, isWordDesktopDocument_1, shouldConvertToSingleImage_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getPasteSource = void 0;
|
|
5
|
-
var getSourceFunctions = new Map([
|
|
6
|
-
['wordDesktop', isWordDesktopDocument_1.isWordDesktopDocument],
|
|
7
|
-
['excelDesktop', isExcelDesktopDocument_1.isExcelDesktopDocument],
|
|
8
|
-
['excelOnline', isExcelOnlineDocument_1.isExcelOnlineDocument],
|
|
9
|
-
['powerPointDesktop', isPowerPointDesktopDocument_1.isPowerPointDesktopDocument],
|
|
10
|
-
['wacComponents', documentContainWacElements_1.documentContainWacElements],
|
|
11
|
-
['googleSheets', isGoogleSheetDocument_1.isGoogleSheetDocument],
|
|
12
|
-
['singleImage', shouldConvertToSingleImage_1.shouldConvertToSingleImage],
|
|
13
|
-
]);
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
* This function tries to get the source of the Pasted content
|
|
17
|
-
* @param event the before paste event
|
|
18
|
-
* @param shouldConvertSingleImage Whether convert single image is enabled.
|
|
19
|
-
* @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}
|
|
20
|
-
*/
|
|
21
|
-
function getPasteSource(event, shouldConvertSingleImage) {
|
|
22
|
-
var htmlAttributes = event.htmlAttributes, clipboardData = event.clipboardData, fragment = event.fragment;
|
|
23
|
-
var result = null;
|
|
24
|
-
var param = {
|
|
25
|
-
htmlAttributes: htmlAttributes,
|
|
26
|
-
fragment: fragment,
|
|
27
|
-
shouldConvertSingleImage: shouldConvertSingleImage,
|
|
28
|
-
clipboardData: clipboardData,
|
|
29
|
-
};
|
|
30
|
-
getSourceFunctions.forEach(function (func, key) {
|
|
31
|
-
if (!result && func(param)) {
|
|
32
|
-
result = key;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return result !== null && result !== void 0 ? result : 'default';
|
|
36
|
-
}
|
|
37
|
-
exports.getPasteSource = getPasteSource;
|
|
38
|
-
});
|
|
1
|
+
define(["require", "exports", "./documentContainWacElements", "./isExcelDesktopDocument", "./isExcelOnlineDocument", "./isGoogleSheetDocument", "./isPowerPointDesktopDocument", "./isWordDesktopDocument", "./shouldConvertToSingleImage"], function (require, exports, documentContainWacElements_1, isExcelDesktopDocument_1, isExcelOnlineDocument_1, isGoogleSheetDocument_1, isPowerPointDesktopDocument_1, isWordDesktopDocument_1, shouldConvertToSingleImage_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getPasteSource = void 0;
|
|
5
|
+
var getSourceFunctions = new Map([
|
|
6
|
+
['wordDesktop', isWordDesktopDocument_1.isWordDesktopDocument],
|
|
7
|
+
['excelDesktop', isExcelDesktopDocument_1.isExcelDesktopDocument],
|
|
8
|
+
['excelOnline', isExcelOnlineDocument_1.isExcelOnlineDocument],
|
|
9
|
+
['powerPointDesktop', isPowerPointDesktopDocument_1.isPowerPointDesktopDocument],
|
|
10
|
+
['wacComponents', documentContainWacElements_1.documentContainWacElements],
|
|
11
|
+
['googleSheets', isGoogleSheetDocument_1.isGoogleSheetDocument],
|
|
12
|
+
['singleImage', shouldConvertToSingleImage_1.shouldConvertToSingleImage],
|
|
13
|
+
]);
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
* This function tries to get the source of the Pasted content
|
|
17
|
+
* @param event the before paste event
|
|
18
|
+
* @param shouldConvertSingleImage Whether convert single image is enabled.
|
|
19
|
+
* @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}
|
|
20
|
+
*/
|
|
21
|
+
function getPasteSource(event, shouldConvertSingleImage) {
|
|
22
|
+
var htmlAttributes = event.htmlAttributes, clipboardData = event.clipboardData, fragment = event.fragment;
|
|
23
|
+
var result = null;
|
|
24
|
+
var param = {
|
|
25
|
+
htmlAttributes: htmlAttributes,
|
|
26
|
+
fragment: fragment,
|
|
27
|
+
shouldConvertSingleImage: shouldConvertSingleImage,
|
|
28
|
+
clipboardData: clipboardData,
|
|
29
|
+
};
|
|
30
|
+
getSourceFunctions.forEach(function (func, key) {
|
|
31
|
+
if (!result && func(param)) {
|
|
32
|
+
result = key;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return result !== null && result !== void 0 ? result : 'default';
|
|
36
|
+
}
|
|
37
|
+
exports.getPasteSource = getPasteSource;
|
|
38
|
+
});
|
|
39
39
|
//# sourceMappingURL=getPasteSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPasteSource.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/getPasteSource.ts"],"names":[],"mappings":";;;;IAsCA,IAAM,kBAAkB,GAAG,IAAI,GAAG,CAA0C;QACxE,CAAC,aAAa,EAAE,6CAAqB,CAAC;QACtC,CAAC,cAAc,EAAE,+CAAsB,CAAC;QACxC,CAAC,aAAa,EAAE,6CAAqB,CAAC;QACtC,CAAC,mBAAmB,EAAE,yDAA2B,CAAC;QAClD,CAAC,eAAe,EAAE,uDAA0B,CAAC;QAC7C,CAAC,cAAc,EAAE,6CAAqB,CAAC;QACvC,CAAC,aAAa,EAAE,uDAA0B,CAAC;KAC9C,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,SAAgB,cAAc,CAC1B,KAAuB,EACvB,wBAAiC;QAEzB,IAAA,cAAc,GAA8B,KAAK,eAAnC,EAAE,aAAa,GAAe,KAAK,cAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE1D,IAAI,MAAM,GAAgC,IAAI,CAAC;QAC/C,IAAM,KAAK,GAAyB;YAChC,cAAc,gBAAA;YACd,QAAQ,UAAA;YACR,wBAAwB,0BAAA;YACxB,aAAa,eAAA;SAChB,CAAC;QAEF,kBAAkB,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACjC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;gBACxB,MAAM,GAAG,GAAG,CAAC;aAChB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,SAAS,CAAC;IAC/B,CAAC;IArBD,wCAqBC","sourcesContent":["import { documentContainWacElements } from './documentContainWacElements';\nimport { isExcelDesktopDocument } from './isExcelDesktopDocument';\nimport { isExcelOnlineDocument } from './isExcelOnlineDocument';\nimport { isGoogleSheetDocument } from './isGoogleSheetDocument';\nimport { isPowerPointDesktopDocument } from './isPowerPointDesktopDocument';\nimport { isWordDesktopDocument } from './isWordDesktopDocument';\nimport { shouldConvertToSingleImage } from './shouldConvertToSingleImage';\nimport type { BeforePasteEvent, ClipboardData } from 'roosterjs-editor-types';\n\n/**\n * @internal\n */\nexport type GetSourceInputParams = {\n htmlAttributes: Record<string, string>;\n fragment: DocumentFragment;\n shouldConvertSingleImage: boolean;\n clipboardData: ClipboardData;\n};\n\n/**\n * @internal\n * Represent the types of sources to handle in the Paste Plugin\n */\nexport type KnownPasteSourceType =\n | 'wordDesktop'\n | 'excelDesktop'\n | 'excelOnline'\n | 'powerPointDesktop'\n | 'googleSheets'\n | 'wacComponents'\n | 'default'\n | 'singleImage';\n\n/**\n * @internal\n */\nexport type GetSourceFunction = (props: GetSourceInputParams) => boolean;\n\nconst getSourceFunctions = new Map<KnownPasteSourceType, GetSourceFunction>([\n ['wordDesktop', isWordDesktopDocument],\n ['excelDesktop', isExcelDesktopDocument],\n ['excelOnline', isExcelOnlineDocument],\n ['powerPointDesktop', isPowerPointDesktopDocument],\n ['wacComponents', documentContainWacElements],\n ['googleSheets', isGoogleSheetDocument],\n ['singleImage', shouldConvertToSingleImage],\n]);\n\n/**\n * @internal\n * This function tries to get the source of the Pasted content\n * @param event the before paste event\n * @param shouldConvertSingleImage Whether convert single image is enabled.\n * @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}\n */\nexport function getPasteSource(\n event: BeforePasteEvent,\n shouldConvertSingleImage: boolean\n): KnownPasteSourceType {\n const { htmlAttributes, clipboardData, fragment } = event;\n\n let result: KnownPasteSourceType | null = null;\n const param: GetSourceInputParams = {\n htmlAttributes,\n fragment,\n shouldConvertSingleImage,\n clipboardData,\n };\n\n getSourceFunctions.forEach((func, key) => {\n if (!result && func(param)) {\n result = key;\n }\n });\n\n return result ?? 'default';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getPasteSource.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/getPasteSource.ts"],"names":[],"mappings":";;;;IAsCA,IAAM,kBAAkB,GAAG,IAAI,GAAG,CAA0C;QACxE,CAAC,aAAa,EAAE,6CAAqB,CAAC;QACtC,CAAC,cAAc,EAAE,+CAAsB,CAAC;QACxC,CAAC,aAAa,EAAE,6CAAqB,CAAC;QACtC,CAAC,mBAAmB,EAAE,yDAA2B,CAAC;QAClD,CAAC,eAAe,EAAE,uDAA0B,CAAC;QAC7C,CAAC,cAAc,EAAE,6CAAqB,CAAC;QACvC,CAAC,aAAa,EAAE,uDAA0B,CAAC;KAC9C,CAAC,CAAC;IAEH;;;;;;OAMG;IACH,SAAgB,cAAc,CAC1B,KAAuB,EACvB,wBAAiC;QAEzB,IAAA,cAAc,GAA8B,KAAK,eAAnC,EAAE,aAAa,GAAe,KAAK,cAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE1D,IAAI,MAAM,GAAgC,IAAI,CAAC;QAC/C,IAAM,KAAK,GAAyB;YAChC,cAAc,gBAAA;YACd,QAAQ,UAAA;YACR,wBAAwB,0BAAA;YACxB,aAAa,eAAA;SAChB,CAAC;QAEF,kBAAkB,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,GAAG;YACjC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;gBACxB,MAAM,GAAG,GAAG,CAAC;aAChB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,SAAS,CAAC;IAC/B,CAAC;IArBD,wCAqBC","sourcesContent":["import { documentContainWacElements } from './documentContainWacElements';\r\nimport { isExcelDesktopDocument } from './isExcelDesktopDocument';\r\nimport { isExcelOnlineDocument } from './isExcelOnlineDocument';\r\nimport { isGoogleSheetDocument } from './isGoogleSheetDocument';\r\nimport { isPowerPointDesktopDocument } from './isPowerPointDesktopDocument';\r\nimport { isWordDesktopDocument } from './isWordDesktopDocument';\r\nimport { shouldConvertToSingleImage } from './shouldConvertToSingleImage';\r\nimport type { BeforePasteEvent, ClipboardData } from 'roosterjs-editor-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport type GetSourceInputParams = {\r\n htmlAttributes: Record<string, string>;\r\n fragment: DocumentFragment;\r\n shouldConvertSingleImage: boolean;\r\n clipboardData: ClipboardData;\r\n};\r\n\r\n/**\r\n * @internal\r\n * Represent the types of sources to handle in the Paste Plugin\r\n */\r\nexport type KnownPasteSourceType =\r\n | 'wordDesktop'\r\n | 'excelDesktop'\r\n | 'excelOnline'\r\n | 'powerPointDesktop'\r\n | 'googleSheets'\r\n | 'wacComponents'\r\n | 'default'\r\n | 'singleImage';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport type GetSourceFunction = (props: GetSourceInputParams) => boolean;\r\n\r\nconst getSourceFunctions = new Map<KnownPasteSourceType, GetSourceFunction>([\r\n ['wordDesktop', isWordDesktopDocument],\r\n ['excelDesktop', isExcelDesktopDocument],\r\n ['excelOnline', isExcelOnlineDocument],\r\n ['powerPointDesktop', isPowerPointDesktopDocument],\r\n ['wacComponents', documentContainWacElements],\r\n ['googleSheets', isGoogleSheetDocument],\r\n ['singleImage', shouldConvertToSingleImage],\r\n]);\r\n\r\n/**\r\n * @internal\r\n * This function tries to get the source of the Pasted content\r\n * @param event the before paste event\r\n * @param shouldConvertSingleImage Whether convert single image is enabled.\r\n * @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}\r\n */\r\nexport function getPasteSource(\r\n event: BeforePasteEvent,\r\n shouldConvertSingleImage: boolean\r\n): KnownPasteSourceType {\r\n const { htmlAttributes, clipboardData, fragment } = event;\r\n\r\n let result: KnownPasteSourceType | null = null;\r\n const param: GetSourceInputParams = {\r\n htmlAttributes,\r\n fragment,\r\n shouldConvertSingleImage,\r\n clipboardData,\r\n };\r\n\r\n getSourceFunctions.forEach((func, key) => {\r\n if (!result && func(param)) {\r\n result = key;\r\n }\r\n });\r\n\r\n return result ?? 'default';\r\n}\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Checks whether the Array provided contains strings that identify Excel Desktop documents
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const isExcelDesktopDocument: GetSourceFunction;
|
|
1
|
+
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Checks whether the Array provided contains strings that identify Excel Desktop documents
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const isExcelDesktopDocument: GetSourceFunction;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isExcelDesktopDocument = void 0;
|
|
5
|
-
var EXCEL_ATTRIBUTE_VALUE = 'urn:schemas-microsoft-com:office:excel';
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
* Checks whether the Array provided contains strings that identify Excel Desktop documents
|
|
9
|
-
* @param props Properties related to the PasteEvent
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
var isExcelDesktopDocument = function (props) {
|
|
13
|
-
var htmlAttributes = props.htmlAttributes;
|
|
14
|
-
// The presence of this attribute confirms its origin from Excel Desktop
|
|
15
|
-
return htmlAttributes["xmlns:x" /* EXCEL_DESKTOP_ATTRIBUTE_NAME */] == EXCEL_ATTRIBUTE_VALUE;
|
|
16
|
-
};
|
|
17
|
-
exports.isExcelDesktopDocument = isExcelDesktopDocument;
|
|
18
|
-
});
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isExcelDesktopDocument = void 0;
|
|
5
|
+
var EXCEL_ATTRIBUTE_VALUE = 'urn:schemas-microsoft-com:office:excel';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Checks whether the Array provided contains strings that identify Excel Desktop documents
|
|
9
|
+
* @param props Properties related to the PasteEvent
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
var isExcelDesktopDocument = function (props) {
|
|
13
|
+
var htmlAttributes = props.htmlAttributes;
|
|
14
|
+
// The presence of this attribute confirms its origin from Excel Desktop
|
|
15
|
+
return htmlAttributes["xmlns:x" /* EXCEL_DESKTOP_ATTRIBUTE_NAME */] == EXCEL_ATTRIBUTE_VALUE;
|
|
16
|
+
};
|
|
17
|
+
exports.isExcelDesktopDocument = isExcelDesktopDocument;
|
|
18
|
+
});
|
|
19
19
|
//# sourceMappingURL=isExcelDesktopDocument.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isExcelDesktopDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isExcelDesktopDocument.ts"],"names":[],"mappings":";;;;IAGA,IAAM,qBAAqB,GAAG,wCAAwC,CAAC;IAEvE;;;;;OAKG;IACI,IAAM,sBAAsB,GAAsB,UAAA,KAAK;QAClD,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QACjC,wEAAwE;QACxE,OAAO,cAAc,8CAAiD,IAAI,qBAAqB,CAAC;IACpG,CAAC,CAAC;IAJW,QAAA,sBAAsB,0BAIjC","sourcesContent":["import { PastePropertyNames } from './constants';\nimport type { GetSourceFunction } from './getPasteSource';\n\nconst EXCEL_ATTRIBUTE_VALUE = 'urn:schemas-microsoft-com:office:excel';\n\n/**\n * @internal\n * Checks whether the Array provided contains strings that identify Excel Desktop documents\n * @param props Properties related to the PasteEvent\n * @returns\n */\nexport const isExcelDesktopDocument: GetSourceFunction = props => {\n const { htmlAttributes } = props;\n // The presence of this attribute confirms its origin from Excel Desktop\n return htmlAttributes[PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME] == EXCEL_ATTRIBUTE_VALUE;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"isExcelDesktopDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isExcelDesktopDocument.ts"],"names":[],"mappings":";;;;IAGA,IAAM,qBAAqB,GAAG,wCAAwC,CAAC;IAEvE;;;;;OAKG;IACI,IAAM,sBAAsB,GAAsB,UAAA,KAAK;QAClD,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QACjC,wEAAwE;QACxE,OAAO,cAAc,8CAAiD,IAAI,qBAAqB,CAAC;IACpG,CAAC,CAAC;IAJW,QAAA,sBAAsB,0BAIjC","sourcesContent":["import { PastePropertyNames } from './constants';\r\nimport type { GetSourceFunction } from './getPasteSource';\r\n\r\nconst EXCEL_ATTRIBUTE_VALUE = 'urn:schemas-microsoft-com:office:excel';\r\n\r\n/**\r\n * @internal\r\n * Checks whether the Array provided contains strings that identify Excel Desktop documents\r\n * @param props Properties related to the PasteEvent\r\n * @returns\r\n */\r\nexport const isExcelDesktopDocument: GetSourceFunction = props => {\r\n const { htmlAttributes } = props;\r\n // The presence of this attribute confirms its origin from Excel Desktop\r\n return htmlAttributes[PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME] == EXCEL_ATTRIBUTE_VALUE;\r\n};\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Checks whether the Array provided contains strings that identify Excel Online documents
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const isExcelOnlineDocument: GetSourceFunction;
|
|
1
|
+
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Checks whether the Array provided contains strings that identify Excel Online documents
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const isExcelOnlineDocument: GetSourceFunction;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isExcelOnlineDocument = void 0;
|
|
5
|
-
// Excel Desktop also has this attribute
|
|
6
|
-
var EXCEL_ONLINE_ATTRIBUTE_VALUE = 'Excel.Sheet';
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
* Checks whether the Array provided contains strings that identify Excel Online documents
|
|
10
|
-
* @param props Properties related to the PasteEvent
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
var isExcelOnlineDocument = function (props) {
|
|
14
|
-
var htmlAttributes = props.htmlAttributes;
|
|
15
|
-
// The presence of Excel.Sheet confirms its origin from Excel, the absence of EXCEL_DESKTOP_ATTRIBUTE_NAME confirms it is from the Online version
|
|
16
|
-
return (htmlAttributes["ProgId" /* PROG_ID_NAME */] == EXCEL_ONLINE_ATTRIBUTE_VALUE &&
|
|
17
|
-
htmlAttributes["xmlns:x" /* EXCEL_DESKTOP_ATTRIBUTE_NAME */] == undefined);
|
|
18
|
-
};
|
|
19
|
-
exports.isExcelOnlineDocument = isExcelOnlineDocument;
|
|
20
|
-
});
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isExcelOnlineDocument = void 0;
|
|
5
|
+
// Excel Desktop also has this attribute
|
|
6
|
+
var EXCEL_ONLINE_ATTRIBUTE_VALUE = 'Excel.Sheet';
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* Checks whether the Array provided contains strings that identify Excel Online documents
|
|
10
|
+
* @param props Properties related to the PasteEvent
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
var isExcelOnlineDocument = function (props) {
|
|
14
|
+
var htmlAttributes = props.htmlAttributes;
|
|
15
|
+
// The presence of Excel.Sheet confirms its origin from Excel, the absence of EXCEL_DESKTOP_ATTRIBUTE_NAME confirms it is from the Online version
|
|
16
|
+
return (htmlAttributes["ProgId" /* PROG_ID_NAME */] == EXCEL_ONLINE_ATTRIBUTE_VALUE &&
|
|
17
|
+
htmlAttributes["xmlns:x" /* EXCEL_DESKTOP_ATTRIBUTE_NAME */] == undefined);
|
|
18
|
+
};
|
|
19
|
+
exports.isExcelOnlineDocument = isExcelOnlineDocument;
|
|
20
|
+
});
|
|
21
21
|
//# sourceMappingURL=isExcelOnlineDocument.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isExcelOnlineDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isExcelOnlineDocument.ts"],"names":[],"mappings":";;;;IAGA,wCAAwC;IACxC,IAAM,4BAA4B,GAAG,aAAa,CAAC;IAEnD;;;;;OAKG;IACI,IAAM,qBAAqB,GAAsB,UAAA,KAAK;QACjD,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QACjC,iJAAiJ;QACjJ,OAAO,CACH,cAAc,6BAAiC,IAAI,4BAA4B;YAC/E,cAAc,8CAAiD,IAAI,SAAS,CAC/E,CAAC;IACN,CAAC,CAAC;IAPW,QAAA,qBAAqB,yBAOhC","sourcesContent":["import { PastePropertyNames } from './constants';\nimport type { GetSourceFunction } from './getPasteSource';\n\n// Excel Desktop also has this attribute\nconst EXCEL_ONLINE_ATTRIBUTE_VALUE = 'Excel.Sheet';\n\n/**\n * @internal\n * Checks whether the Array provided contains strings that identify Excel Online documents\n * @param props Properties related to the PasteEvent\n * @returns\n */\nexport const isExcelOnlineDocument: GetSourceFunction = props => {\n const { htmlAttributes } = props;\n // The presence of Excel.Sheet confirms its origin from Excel, the absence of EXCEL_DESKTOP_ATTRIBUTE_NAME confirms it is from the Online version\n return (\n htmlAttributes[PastePropertyNames.PROG_ID_NAME] == EXCEL_ONLINE_ATTRIBUTE_VALUE &&\n htmlAttributes[PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME] == undefined\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"isExcelOnlineDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isExcelOnlineDocument.ts"],"names":[],"mappings":";;;;IAGA,wCAAwC;IACxC,IAAM,4BAA4B,GAAG,aAAa,CAAC;IAEnD;;;;;OAKG;IACI,IAAM,qBAAqB,GAAsB,UAAA,KAAK;QACjD,IAAA,cAAc,GAAK,KAAK,eAAV,CAAW;QACjC,iJAAiJ;QACjJ,OAAO,CACH,cAAc,6BAAiC,IAAI,4BAA4B;YAC/E,cAAc,8CAAiD,IAAI,SAAS,CAC/E,CAAC;IACN,CAAC,CAAC;IAPW,QAAA,qBAAqB,yBAOhC","sourcesContent":["import { PastePropertyNames } from './constants';\r\nimport type { GetSourceFunction } from './getPasteSource';\r\n\r\n// Excel Desktop also has this attribute\r\nconst EXCEL_ONLINE_ATTRIBUTE_VALUE = 'Excel.Sheet';\r\n\r\n/**\r\n * @internal\r\n * Checks whether the Array provided contains strings that identify Excel Online documents\r\n * @param props Properties related to the PasteEvent\r\n * @returns\r\n */\r\nexport const isExcelOnlineDocument: GetSourceFunction = props => {\r\n const { htmlAttributes } = props;\r\n // The presence of Excel.Sheet confirms its origin from Excel, the absence of EXCEL_DESKTOP_ATTRIBUTE_NAME confirms it is from the Online version\r\n return (\r\n htmlAttributes[PastePropertyNames.PROG_ID_NAME] == EXCEL_ONLINE_ATTRIBUTE_VALUE &&\r\n htmlAttributes[PastePropertyNames.EXCEL_DESKTOP_ATTRIBUTE_NAME] == undefined\r\n );\r\n};\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Checks whether the fragment provided contain elements from Google sheets
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const isGoogleSheetDocument: GetSourceFunction;
|
|
1
|
+
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Checks whether the fragment provided contain elements from Google sheets
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const isGoogleSheetDocument: GetSourceFunction;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isGoogleSheetDocument = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
* Checks whether the fragment provided contain elements from Google sheets
|
|
8
|
-
* @param props Properties related to the PasteEvent
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
var isGoogleSheetDocument = function (props) {
|
|
12
|
-
var fragment = props.fragment;
|
|
13
|
-
return !!fragment.querySelector("google-sheets-html-origin" /* GOOGLE_SHEET_NODE_NAME */);
|
|
14
|
-
};
|
|
15
|
-
exports.isGoogleSheetDocument = isGoogleSheetDocument;
|
|
16
|
-
});
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isGoogleSheetDocument = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* Checks whether the fragment provided contain elements from Google sheets
|
|
8
|
+
* @param props Properties related to the PasteEvent
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
var isGoogleSheetDocument = function (props) {
|
|
12
|
+
var fragment = props.fragment;
|
|
13
|
+
return !!fragment.querySelector("google-sheets-html-origin" /* GOOGLE_SHEET_NODE_NAME */);
|
|
14
|
+
};
|
|
15
|
+
exports.isGoogleSheetDocument = isGoogleSheetDocument;
|
|
16
|
+
});
|
|
17
17
|
//# sourceMappingURL=isGoogleSheetDocument.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isGoogleSheetDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isGoogleSheetDocument.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACI,IAAM,qBAAqB,GAAsB,UAAA,KAAK;QACjD,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,0DAA2C,CAAC;IAC/E,CAAC,CAAC;IAHW,QAAA,qBAAqB,yBAGhC","sourcesContent":["import { PastePropertyNames } from './constants';\nimport type { GetSourceFunction } from './getPasteSource';\n\n/**\n * @internal\n * Checks whether the fragment provided contain elements from Google sheets\n * @param props Properties related to the PasteEvent\n * @returns\n */\nexport const isGoogleSheetDocument: GetSourceFunction = props => {\n const { fragment } = props;\n return !!fragment.querySelector(PastePropertyNames.GOOGLE_SHEET_NODE_NAME);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"isGoogleSheetDocument.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/isGoogleSheetDocument.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACI,IAAM,qBAAqB,GAAsB,UAAA,KAAK;QACjD,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC3B,OAAO,CAAC,CAAC,QAAQ,CAAC,aAAa,0DAA2C,CAAC;IAC/E,CAAC,CAAC;IAHW,QAAA,qBAAqB,yBAGhC","sourcesContent":["import { PastePropertyNames } from './constants';\r\nimport type { GetSourceFunction } from './getPasteSource';\r\n\r\n/**\r\n * @internal\r\n * Checks whether the fragment provided contain elements from Google sheets\r\n * @param props Properties related to the PasteEvent\r\n * @returns\r\n */\r\nexport const isGoogleSheetDocument: GetSourceFunction = props => {\r\n const { fragment } = props;\r\n return !!fragment.querySelector(PastePropertyNames.GOOGLE_SHEET_NODE_NAME);\r\n};\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* Checks whether the Array provided contains strings that identify Power Point Desktop documents
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const isPowerPointDesktopDocument: GetSourceFunction;
|
|
1
|
+
import type { GetSourceFunction } from './getPasteSource';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Checks whether the Array provided contains strings that identify Power Point Desktop documents
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const isPowerPointDesktopDocument: GetSourceFunction;
|