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,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Checks whether the fragment only contains a single image to paste
|
|
4
|
-
* and the editor have the ConvertSingleImageBody Experimental feature
|
|
5
|
-
* @param props Properties related to the PasteEvent
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export var shouldConvertToSingleImage = function (props) {
|
|
9
|
-
var _a;
|
|
10
|
-
var shouldConvertSingleImage = props.shouldConvertSingleImage, clipboardData = props.clipboardData;
|
|
11
|
-
return (shouldConvertSingleImage &&
|
|
12
|
-
((_a = clipboardData.htmlFirstLevelChildTags) === null || _a === void 0 ? void 0 : _a.length) == 1 &&
|
|
13
|
-
clipboardData.htmlFirstLevelChildTags[0] == 'IMG');
|
|
14
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Checks whether the fragment only contains a single image to paste
|
|
4
|
+
* and the editor have the ConvertSingleImageBody Experimental feature
|
|
5
|
+
* @param props Properties related to the PasteEvent
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export var shouldConvertToSingleImage = function (props) {
|
|
9
|
+
var _a;
|
|
10
|
+
var shouldConvertSingleImage = props.shouldConvertSingleImage, clipboardData = props.clipboardData;
|
|
11
|
+
return (shouldConvertSingleImage &&
|
|
12
|
+
((_a = clipboardData.htmlFirstLevelChildTags) === null || _a === void 0 ? void 0 : _a.length) == 1 &&
|
|
13
|
+
clipboardData.htmlFirstLevelChildTags[0] == 'IMG');
|
|
14
|
+
};
|
|
15
15
|
//# sourceMappingURL=shouldConvertToSingleImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldConvertToSingleImage.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,0BAA0B,GAAsB,UAAA,KAAK;;IACtD,IAAA,wBAAwB,GAAoB,KAAK,yBAAzB,EAAE,aAAa,GAAK,KAAK,cAAV,CAAW;IAC1D,OAAO,CACH,wBAAwB;QACxB,CAAA,MAAA,aAAa,CAAC,uBAAuB,0CAAE,MAAM,KAAI,CAAC;QAClD,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,KAAK,CACpD,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { GetSourceFunction } from './getPasteSource';\n\n/**\n * @internal\n * Checks whether the fragment only contains a single image to paste\n * and the editor have the ConvertSingleImageBody Experimental feature\n * @param props Properties related to the PasteEvent\n * @returns\n */\nexport const shouldConvertToSingleImage: GetSourceFunction = props => {\n const { shouldConvertSingleImage, clipboardData } = props;\n return (\n shouldConvertSingleImage &&\n clipboardData.htmlFirstLevelChildTags?.length == 1 &&\n clipboardData.htmlFirstLevelChildTags[0] == 'IMG'\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"shouldConvertToSingleImage.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,0BAA0B,GAAsB,UAAA,KAAK;;IACtD,IAAA,wBAAwB,GAAoB,KAAK,yBAAzB,EAAE,aAAa,GAAK,KAAK,cAAV,CAAW;IAC1D,OAAO,CACH,wBAAwB;QACxB,CAAA,MAAA,aAAa,CAAC,uBAAuB,0CAAE,MAAM,KAAI,CAAC;QAClD,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,KAAK,CACpD,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { GetSourceFunction } from './getPasteSource';\r\n\r\n/**\r\n * @internal\r\n * Checks whether the fragment only contains a single image to paste\r\n * and the editor have the ConvertSingleImageBody Experimental feature\r\n * @param props Properties related to the PasteEvent\r\n * @returns\r\n */\r\nexport const shouldConvertToSingleImage: GetSourceFunction = props => {\r\n const { shouldConvertSingleImage, clipboardData } = props;\r\n return (\r\n shouldConvertSingleImage &&\r\n clipboardData.htmlFirstLevelChildTags?.length == 1 &&\r\n clipboardData.htmlFirstLevelChildTags[0] == 'IMG'\r\n );\r\n};\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContentModelFormatMap, DomToModelOption, FormatParser, FormatParsersPerCategory } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export default function addParser<TKey extends keyof FormatParsersPerCategory>(domToModelOption: DomToModelOption, entry: TKey, additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>): void;
|
|
1
|
+
import type { ContentModelFormatMap, DomToModelOption, FormatParser, FormatParsersPerCategory } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export default function addParser<TKey extends keyof FormatParsersPerCategory>(domToModelOption: DomToModelOption, entry: TKey, additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export default function addParser(domToModelOption, entry, additionalFormatParsers) {
|
|
5
|
-
var _a;
|
|
6
|
-
if (!domToModelOption.additionalFormatParsers) {
|
|
7
|
-
domToModelOption.additionalFormatParsers = {};
|
|
8
|
-
}
|
|
9
|
-
if (!domToModelOption.additionalFormatParsers[entry]) {
|
|
10
|
-
domToModelOption.additionalFormatParsers[entry] = [];
|
|
11
|
-
}
|
|
12
|
-
(_a = domToModelOption.additionalFormatParsers[entry]) === null || _a === void 0 ? void 0 : _a.push(additionalFormatParsers);
|
|
13
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export default function addParser(domToModelOption, entry, additionalFormatParsers) {
|
|
5
|
+
var _a;
|
|
6
|
+
if (!domToModelOption.additionalFormatParsers) {
|
|
7
|
+
domToModelOption.additionalFormatParsers = {};
|
|
8
|
+
}
|
|
9
|
+
if (!domToModelOption.additionalFormatParsers[entry]) {
|
|
10
|
+
domToModelOption.additionalFormatParsers[entry] = [];
|
|
11
|
+
}
|
|
12
|
+
(_a = domToModelOption.additionalFormatParsers[entry]) === null || _a === void 0 ? void 0 : _a.push(additionalFormatParsers);
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=addParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/addParser.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC7B,gBAAkC,EAClC,KAAW,EACX,uBAAkE;;IAElE,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE;QAC3C,gBAAgB,CAAC,uBAAuB,GAAG,EAAE,CAAC;KACjD;IACD,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAClD,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;KACxD;IAED,MAAA,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import type {\n ContentModelFormatMap,\n DomToModelOption,\n FormatParser,\n FormatParsersPerCategory,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport default function addParser<TKey extends keyof FormatParsersPerCategory>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>\n) {\n if (!domToModelOption.additionalFormatParsers) {\n domToModelOption.additionalFormatParsers = {};\n }\n if (!domToModelOption.additionalFormatParsers[entry]) {\n domToModelOption.additionalFormatParsers[entry] = [];\n }\n\n domToModelOption.additionalFormatParsers[entry]?.push(additionalFormatParsers);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"addParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/addParser.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC7B,gBAAkC,EAClC,KAAW,EACX,uBAAkE;;IAElE,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE;QAC3C,gBAAgB,CAAC,uBAAuB,GAAG,EAAE,CAAC;KACjD;IACD,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAClD,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;KACxD;IAED,MAAA,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import type {\r\n ContentModelFormatMap,\r\n DomToModelOption,\r\n FormatParser,\r\n FormatParsersPerCategory,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default function addParser<TKey extends keyof FormatParsersPerCategory>(\r\n domToModelOption: DomToModelOption,\r\n entry: TKey,\r\n additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>\r\n) {\r\n if (!domToModelOption.additionalFormatParsers) {\r\n domToModelOption.additionalFormatParsers = {};\r\n }\r\n if (!domToModelOption.additionalFormatParsers[entry]) {\r\n domToModelOption.additionalFormatParsers[entry] = [];\r\n }\r\n\r\n domToModelOption.additionalFormatParsers[entry]?.push(additionalFormatParsers);\r\n}\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const deprecatedBorderColorParser: FormatParser<BorderFormat>;
|
|
1
|
+
import type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const deprecatedBorderColorParser: FormatParser<BorderFormat>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export var deprecatedBorderColorParser = function (format) {
|
|
6
|
-
BorderKeys.forEach(function (key) {
|
|
7
|
-
var value = format[key];
|
|
8
|
-
var color = '';
|
|
9
|
-
if (value &&
|
|
10
|
-
DeprecatedColors.some(function (dColor) { return value.indexOf(dColor) > -1 && (color = dColor); })) {
|
|
11
|
-
var newValue = value.replace(color, '').trimRight();
|
|
12
|
-
format[key] = newValue;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
};
|
|
1
|
+
import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export var deprecatedBorderColorParser = function (format) {
|
|
6
|
+
BorderKeys.forEach(function (key) {
|
|
7
|
+
var value = format[key];
|
|
8
|
+
var color = '';
|
|
9
|
+
if (value &&
|
|
10
|
+
DeprecatedColors.some(function (dColor) { return value.indexOf(dColor) > -1 && (color = dColor); })) {
|
|
11
|
+
var newValue = value.replace(color, '').trimRight();
|
|
12
|
+
format[key] = newValue;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
16
|
//# sourceMappingURL=deprecatedColorParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecatedColorParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/deprecatedColorParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG3E;;GAEG;AACH,MAAM,CAAC,IAAM,2BAA2B,GAA+B,UACnE,MAAoB;IAEpB,UAAU,CAAC,OAAO,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAW,EAAE,CAAC;QACvB,IACI,KAAK;YACL,gBAAgB,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,EAA9C,CAA8C,CAAC,EACjF;YACE,IAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YACtD,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SAC1B;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC","sourcesContent":["import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';\nimport type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const deprecatedBorderColorParser: FormatParser<BorderFormat> = (\n format: BorderFormat\n): void => {\n BorderKeys.forEach(key => {\n const value = format[key];\n let color: string = '';\n if (\n value &&\n DeprecatedColors.some(dColor => value.indexOf(dColor) > -1 && (color = dColor))\n ) {\n const newValue = value.replace(color, '').trimRight();\n format[key] = newValue;\n }\n });\n};\n"]}
|
|
1
|
+
{"version":3,"file":"deprecatedColorParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/deprecatedColorParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG3E;;GAEG;AACH,MAAM,CAAC,IAAM,2BAA2B,GAA+B,UACnE,MAAoB;IAEpB,UAAU,CAAC,OAAO,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAW,EAAE,CAAC;QACvB,IACI,KAAK;YACL,gBAAgB,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,EAA9C,CAA8C,CAAC,EACjF;YACE,IAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YACtD,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SAC1B;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC","sourcesContent":["import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';\r\nimport type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const deprecatedBorderColorParser: FormatParser<BorderFormat> = (\r\n format: BorderFormat\r\n): void => {\r\n BorderKeys.forEach(key => {\r\n const value = format[key];\r\n let color: string = '';\r\n if (\r\n value &&\r\n DeprecatedColors.some(dColor => value.indexOf(dColor) > -1 && (color = dColor))\r\n ) {\r\n const newValue = value.replace(color, '').trimRight();\r\n format[key] = newValue;\r\n }\r\n });\r\n};\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Get CSS styles of a given element in name-value pair format
|
|
4
|
-
* @param element The element to get styles from
|
|
5
|
-
*/
|
|
6
|
-
export declare function getStyles(element: HTMLElement): Record<string, string>;
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Get CSS styles of a given element in name-value pair format
|
|
4
|
+
* @param element The element to get styles from
|
|
5
|
+
*/
|
|
6
|
+
export declare function getStyles(element: HTMLElement): Record<string, string>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
* Get CSS styles of a given element in name-value pair format
|
|
4
|
-
* @param element The element to get styles from
|
|
5
|
-
*/
|
|
6
|
-
export function getStyles(element) {
|
|
7
|
-
var result = {};
|
|
8
|
-
var style = (element === null || element === void 0 ? void 0 : element.getAttribute('style')) || '';
|
|
9
|
-
style.split(';').forEach(function (pair) {
|
|
10
|
-
var valueIndex = pair.indexOf(':');
|
|
11
|
-
var name = pair.slice(0, valueIndex);
|
|
12
|
-
var value = pair.slice(valueIndex + 1);
|
|
13
|
-
if (name && value) {
|
|
14
|
-
result[name.trim()] = value.trim();
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Get CSS styles of a given element in name-value pair format
|
|
4
|
+
* @param element The element to get styles from
|
|
5
|
+
*/
|
|
6
|
+
export function getStyles(element) {
|
|
7
|
+
var result = {};
|
|
8
|
+
var style = (element === null || element === void 0 ? void 0 : element.getAttribute('style')) || '';
|
|
9
|
+
style.split(';').forEach(function (pair) {
|
|
10
|
+
var valueIndex = pair.indexOf(':');
|
|
11
|
+
var name = pair.slice(0, valueIndex);
|
|
12
|
+
var value = pair.slice(valueIndex + 1);
|
|
13
|
+
if (name && value) {
|
|
14
|
+
result[name.trim()] = value.trim();
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=getStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/getStyles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAoB;IAC1C,IAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;IACnD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;QACzB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,IAAI,KAAK,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;SACtC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/**\n * @internal\n * Get CSS styles of a given element in name-value pair format\n * @param element The element to get styles from\n */\nexport function getStyles(element: HTMLElement): Record<string, string> {\n const result: Record<string, string> = {};\n const style = element?.getAttribute('style') || '';\n style.split(';').forEach(pair => {\n const valueIndex = pair.indexOf(':');\n const name = pair.slice(0, valueIndex);\n const value = pair.slice(valueIndex + 1);\n if (name && value) {\n result[name.trim()] = value.trim();\n }\n });\n return result;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/getStyles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAoB;IAC1C,IAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;IACnD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;QACzB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,IAAI,KAAK,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;SACtC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["/**\r\n * @internal\r\n * Get CSS styles of a given element in name-value pair format\r\n * @param element The element to get styles from\r\n */\r\nexport function getStyles(element: HTMLElement): Record<string, string> {\r\n const result: Record<string, string> = {};\r\n const style = element?.getAttribute('style') || '';\r\n style.split(';').forEach(pair => {\r\n const valueIndex = pair.indexOf(':');\r\n const name = pair.slice(0, valueIndex);\r\n const value = pair.slice(valueIndex + 1);\r\n if (name && value) {\r\n result[name.trim()] = value.trim();\r\n }\r\n });\r\n return result;\r\n}\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare const parseLink: FormatParser<ContentModelHyperLinkFormat>;
|
|
1
|
+
import type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const parseLink: FormatParser<ContentModelHyperLinkFormat>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { isElementOfType } from 'roosterjs-content-model-dom';
|
|
2
|
-
var SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];
|
|
3
|
-
var INVALID_LINKS_REGEX = /^file:\/\/\/[a-zA-Z\/]/i;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export var parseLink = function (format, element) {
|
|
8
|
-
if (!isElementOfType(element, 'a')) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
var url;
|
|
12
|
-
try {
|
|
13
|
-
url = new URL(element.href);
|
|
14
|
-
}
|
|
15
|
-
catch (_a) {
|
|
16
|
-
url = undefined;
|
|
17
|
-
}
|
|
18
|
-
if ((url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||
|
|
19
|
-
INVALID_LINKS_REGEX.test(element.href)) {
|
|
20
|
-
element.removeAttribute('href');
|
|
21
|
-
format.href = '';
|
|
22
|
-
}
|
|
23
|
-
};
|
|
1
|
+
import { isElementOfType } from 'roosterjs-content-model-dom';
|
|
2
|
+
var SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];
|
|
3
|
+
var INVALID_LINKS_REGEX = /^file:\/\/\/[a-zA-Z\/]/i;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export var parseLink = function (format, element) {
|
|
8
|
+
if (!isElementOfType(element, 'a')) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
var url;
|
|
12
|
+
try {
|
|
13
|
+
url = new URL(element.href);
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
url = undefined;
|
|
17
|
+
}
|
|
18
|
+
if ((url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||
|
|
19
|
+
INVALID_LINKS_REGEX.test(element.href)) {
|
|
20
|
+
element.removeAttribute('href');
|
|
21
|
+
format.href = '';
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
24
|
//# sourceMappingURL=linkParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/linkParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,IAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjF,IAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,IAAM,SAAS,GAA8C,UAAC,MAAM,EAAE,OAAO;IAChF,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAChC,OAAO;KACV;IAED,IAAI,GAAoB,CAAC;IACzB,IAAI;QACA,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC/B;IAAC,WAAM;QACJ,GAAG,GAAG,SAAS,CAAC;KACnB;IAED,IACI,CAAC,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EACxC;QACE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;KACpB;AACL,CAAC,CAAC","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\nimport type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';\n\nconst SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];\nconst INVALID_LINKS_REGEX = /^file:\\/\\/\\/[a-zA-Z\\/]/i;\n\n/**\n * @internal\n */\nexport const parseLink: FormatParser<ContentModelHyperLinkFormat> = (format, element) => {\n if (!isElementOfType(element, 'a')) {\n return;\n }\n\n let url: URL | undefined;\n try {\n url = new URL(element.href);\n } catch {\n url = undefined;\n }\n\n if (\n (url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||\n INVALID_LINKS_REGEX.test(element.href)\n ) {\n element.removeAttribute('href');\n format.href = '';\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"linkParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/linkParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,IAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjF,IAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,IAAM,SAAS,GAA8C,UAAC,MAAM,EAAE,OAAO;IAChF,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAChC,OAAO;KACV;IAED,IAAI,GAAoB,CAAC;IACzB,IAAI;QACA,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC/B;IAAC,WAAM;QACJ,GAAG,GAAG,SAAS,CAAC;KACnB;IAED,IACI,CAAC,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EACxC;QACE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;KACpB;AACL,CAAC,CAAC","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\r\nimport type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';\r\n\r\nconst SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];\r\nconst INVALID_LINKS_REGEX = /^file:\\/\\/\\/[a-zA-Z\\/]/i;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const parseLink: FormatParser<ContentModelHyperLinkFormat> = (format, element) => {\r\n if (!isElementOfType(element, 'a')) {\r\n return;\r\n }\r\n\r\n let url: URL | undefined;\r\n try {\r\n url = new URL(element.href);\r\n } catch {\r\n url = undefined;\r\n }\r\n\r\n if (\r\n (url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||\r\n INVALID_LINKS_REGEX.test(element.href)\r\n ) {\r\n element.removeAttribute('href');\r\n format.href = '';\r\n }\r\n};\r\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function setProcessor<TKey extends keyof ElementProcessorMap>(domToModelOption: DomToModelOption, entry: TKey, processorOverride: Partial<ElementProcessorMap>[TKey]): void;
|
|
1
|
+
import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function setProcessor<TKey extends keyof ElementProcessorMap>(domToModelOption: DomToModelOption, entry: TKey, processorOverride: Partial<ElementProcessorMap>[TKey]): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export function setProcessor(domToModelOption, entry, processorOverride) {
|
|
5
|
-
if (!domToModelOption.processorOverride) {
|
|
6
|
-
domToModelOption.processorOverride = {};
|
|
7
|
-
}
|
|
8
|
-
domToModelOption.processorOverride[entry] = processorOverride;
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export function setProcessor(domToModelOption, entry, processorOverride) {
|
|
5
|
+
if (!domToModelOption.processorOverride) {
|
|
6
|
+
domToModelOption.processorOverride = {};
|
|
7
|
+
}
|
|
8
|
+
domToModelOption.processorOverride[entry] = processorOverride;
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=setProcessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/setProcessor.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,YAAY,CACxB,gBAAkC,EAClC,KAAW,EACX,iBAAqD;IAErD,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC3C;IAED,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC;AAClE,CAAC","sourcesContent":["import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setProcessor<TKey extends keyof ElementProcessorMap>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n processorOverride: Partial<ElementProcessorMap>[TKey]\n) {\n if (!domToModelOption.processorOverride) {\n domToModelOption.processorOverride = {};\n }\n\n domToModelOption.processorOverride[entry] = processorOverride;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/setProcessor.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,YAAY,CACxB,gBAAkC,EAClC,KAAW,EACX,iBAAqD;IAErD,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC3C;IAED,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC;AAClE,CAAC","sourcesContent":["import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function setProcessor<TKey extends keyof ElementProcessorMap>(\r\n domToModelOption: DomToModelOption,\r\n entry: TKey,\r\n processorOverride: Partial<ElementProcessorMap>[TKey]\r\n) {\r\n if (!domToModelOption.processorOverride) {\r\n domToModelOption.processorOverride = {};\r\n }\r\n\r\n domToModelOption.processorOverride[entry] = processorOverride;\r\n}\r\n"]}
|
package/package.json
CHANGED