roosterjs-content-model-plugins 0.26.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/lib/autoFormat/AutoFormatPlugin.d.ts +53 -53
  2. package/lib/autoFormat/AutoFormatPlugin.js +80 -80
  3. package/lib/autoFormat/AutoFormatPlugin.js.map +1 -1
  4. package/lib/autoFormat/keyboardListTrigger.d.ts +5 -5
  5. package/lib/autoFormat/keyboardListTrigger.js +45 -45
  6. package/lib/autoFormat/keyboardListTrigger.js.map +1 -1
  7. package/lib/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
  8. package/lib/autoFormat/utils/convertAlphaToDecimals.js +22 -22
  9. package/lib/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
  10. package/lib/autoFormat/utils/getIndex.d.ts +4 -4
  11. package/lib/autoFormat/utils/getIndex.js +13 -13
  12. package/lib/autoFormat/utils/getIndex.js.map +1 -1
  13. package/lib/autoFormat/utils/getListTypeStyle.d.ts +14 -14
  14. package/lib/autoFormat/utils/getListTypeStyle.js +87 -87
  15. package/lib/autoFormat/utils/getListTypeStyle.js.map +1 -1
  16. package/lib/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
  17. package/lib/autoFormat/utils/getNumberingListStyle.js +153 -153
  18. package/lib/autoFormat/utils/getNumberingListStyle.js.map +1 -1
  19. package/lib/edit/EditPlugin.d.ts +39 -39
  20. package/lib/edit/EditPlugin.js +128 -128
  21. package/lib/edit/EditPlugin.js.map +1 -1
  22. package/lib/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  23. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js +22 -22
  24. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  25. package/lib/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  26. package/lib/edit/deleteSteps/deleteCollapsedSelection.js +93 -93
  27. package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  28. package/lib/edit/deleteSteps/deleteList.d.ts +5 -5
  29. package/lib/edit/deleteSteps/deleteList.js +23 -23
  30. package/lib/edit/deleteSteps/deleteList.js.map +1 -1
  31. package/lib/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  32. package/lib/edit/deleteSteps/deleteWordSelection.js +173 -173
  33. package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  34. package/lib/edit/handleKeyboardEventCommon.d.ts +14 -14
  35. package/lib/edit/handleKeyboardEventCommon.js +54 -54
  36. package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
  37. package/lib/edit/inputSteps/handleEnterOnList.d.ts +5 -5
  38. package/lib/edit/inputSteps/handleEnterOnList.js +67 -67
  39. package/lib/edit/inputSteps/handleEnterOnList.js.map +1 -1
  40. package/lib/edit/keyboardDelete.d.ts +9 -9
  41. package/lib/edit/keyboardDelete.js +71 -71
  42. package/lib/edit/keyboardDelete.js.map +1 -1
  43. package/lib/edit/keyboardInput.d.ts +5 -5
  44. package/lib/edit/keyboardInput.js +58 -58
  45. package/lib/edit/keyboardInput.js.map +1 -1
  46. package/lib/edit/keyboardTab.d.ts +5 -5
  47. package/lib/edit/keyboardTab.js +34 -34
  48. package/lib/edit/keyboardTab.js.map +1 -1
  49. package/lib/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  50. package/lib/edit/utils/getLeafSiblingBlock.js +75 -75
  51. package/lib/edit/utils/getLeafSiblingBlock.js.map +1 -1
  52. package/lib/index.d.ts +3 -3
  53. package/lib/index.js +9 -9
  54. package/lib/index.js.map +1 -1
  55. package/lib/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
  56. package/lib/paste/Excel/processPastedContentFromExcel.js +82 -82
  57. package/lib/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  58. package/lib/paste/PastePlugin.d.ts +43 -43
  59. package/lib/paste/PastePlugin.js +130 -130
  60. package/lib/paste/PastePlugin.js.map +1 -1
  61. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  62. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js +19 -19
  63. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  64. package/lib/paste/WacComponents/constants.d.ts +48 -48
  65. package/lib/paste/WacComponents/constants.js +62 -62
  66. package/lib/paste/WacComponents/constants.js.map +1 -1
  67. package/lib/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  68. package/lib/paste/WacComponents/processPastedContentWacComponents.js +188 -188
  69. package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  70. package/lib/paste/WordDesktop/WordMetadata.d.ts +9 -9
  71. package/lib/paste/WordDesktop/WordMetadata.js +2 -2
  72. package/lib/paste/WordDesktop/WordMetadata.js.map +1 -1
  73. package/lib/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
  74. package/lib/paste/WordDesktop/getStyleMetadata.js +78 -78
  75. package/lib/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  76. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
  77. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +58 -58
  78. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  79. package/lib/paste/WordDesktop/processWordComments.d.ts +7 -7
  80. package/lib/paste/WordDesktop/processWordComments.js +21 -21
  81. package/lib/paste/WordDesktop/processWordComments.js.map +1 -1
  82. package/lib/paste/WordDesktop/processWordLists.d.ts +11 -11
  83. package/lib/paste/WordDesktop/processWordLists.js +179 -179
  84. package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
  85. package/lib/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
  86. package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js +13 -13
  87. package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  88. package/lib/paste/pasteSourceValidations/constants.d.ts +17 -17
  89. package/lib/paste/pasteSourceValidations/constants.js +20 -20
  90. package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
  91. package/lib/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  92. package/lib/paste/pasteSourceValidations/documentContainWacElements.js +15 -15
  93. package/lib/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  94. package/lib/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  95. package/lib/paste/pasteSourceValidations/getPasteSource.js +43 -43
  96. package/lib/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  97. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  98. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js +17 -17
  99. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  100. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  101. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js +19 -19
  102. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  103. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  104. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js +15 -15
  105. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  106. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  107. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +15 -15
  108. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  109. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  110. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js +19 -19
  111. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  112. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  113. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js +18 -18
  114. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  115. package/lib/paste/utils/addParser.d.ts +5 -5
  116. package/lib/paste/utils/addParser.js +16 -16
  117. package/lib/paste/utils/addParser.js.map +1 -1
  118. package/lib/paste/utils/deprecatedColorParser.d.ts +5 -5
  119. package/lib/paste/utils/deprecatedColorParser.js +19 -19
  120. package/lib/paste/utils/deprecatedColorParser.js.map +1 -1
  121. package/lib/paste/utils/getStyles.d.ts +6 -6
  122. package/lib/paste/utils/getStyles.js +22 -22
  123. package/lib/paste/utils/getStyles.js.map +1 -1
  124. package/lib/paste/utils/linkParser.d.ts +5 -5
  125. package/lib/paste/utils/linkParser.js +27 -27
  126. package/lib/paste/utils/linkParser.js.map +1 -1
  127. package/lib/paste/utils/setProcessor.d.ts +5 -5
  128. package/lib/paste/utils/setProcessor.js +13 -13
  129. package/lib/paste/utils/setProcessor.js.map +1 -1
  130. package/lib/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
  131. package/lib/pluginUtils/CreateElement/CreateElementData.js +2 -2
  132. package/lib/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  133. package/lib/pluginUtils/CreateElement/createElement.d.ts +9 -9
  134. package/lib/pluginUtils/CreateElement/createElement.js +50 -50
  135. package/lib/pluginUtils/CreateElement/createElement.js.map +1 -1
  136. package/lib/pluginUtils/Disposable.d.ts +10 -10
  137. package/lib/pluginUtils/Disposable.js +2 -2
  138. package/lib/pluginUtils/Disposable.js.map +1 -1
  139. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
  140. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js +2 -2
  141. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  142. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
  143. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js +119 -119
  144. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  145. package/lib/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
  146. package/lib/pluginUtils/Rect/getIntersectedRect.js +44 -44
  147. package/lib/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  148. package/lib/pluginUtils/Rect/normalizeRect.d.ts +7 -7
  149. package/lib/pluginUtils/Rect/normalizeRect.js +19 -19
  150. package/lib/pluginUtils/Rect/normalizeRect.js.map +1 -1
  151. package/lib-amd/autoFormat/AutoFormatPlugin.d.ts +53 -53
  152. package/lib-amd/autoFormat/AutoFormatPlugin.js +81 -81
  153. package/lib-amd/autoFormat/AutoFormatPlugin.js.map +1 -1
  154. package/lib-amd/autoFormat/keyboardListTrigger.d.ts +5 -5
  155. package/lib-amd/autoFormat/keyboardListTrigger.js +43 -43
  156. package/lib-amd/autoFormat/keyboardListTrigger.js.map +1 -1
  157. package/lib-amd/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
  158. package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js +24 -24
  159. package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
  160. package/lib-amd/autoFormat/utils/getIndex.d.ts +4 -4
  161. package/lib-amd/autoFormat/utils/getIndex.js +14 -14
  162. package/lib-amd/autoFormat/utils/getIndex.js.map +1 -1
  163. package/lib-amd/autoFormat/utils/getListTypeStyle.d.ts +14 -14
  164. package/lib-amd/autoFormat/utils/getListTypeStyle.js +86 -86
  165. package/lib-amd/autoFormat/utils/getListTypeStyle.js.map +1 -1
  166. package/lib-amd/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
  167. package/lib-amd/autoFormat/utils/getNumberingListStyle.js +153 -153
  168. package/lib-amd/autoFormat/utils/getNumberingListStyle.js.map +1 -1
  169. package/lib-amd/edit/EditPlugin.d.ts +39 -39
  170. package/lib-amd/edit/EditPlugin.js +127 -127
  171. package/lib-amd/edit/EditPlugin.js.map +1 -1
  172. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  173. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js +23 -23
  174. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  175. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  176. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js +92 -92
  177. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  178. package/lib-amd/edit/deleteSteps/deleteList.d.ts +5 -5
  179. package/lib-amd/edit/deleteSteps/deleteList.js +24 -24
  180. package/lib-amd/edit/deleteSteps/deleteList.js.map +1 -1
  181. package/lib-amd/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  182. package/lib-amd/edit/deleteSteps/deleteWordSelection.js +172 -172
  183. package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  184. package/lib-amd/edit/handleKeyboardEventCommon.d.ts +14 -14
  185. package/lib-amd/edit/handleKeyboardEventCommon.js +55 -55
  186. package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
  187. package/lib-amd/edit/inputSteps/handleEnterOnList.d.ts +5 -5
  188. package/lib-amd/edit/inputSteps/handleEnterOnList.js +66 -66
  189. package/lib-amd/edit/inputSteps/handleEnterOnList.js.map +1 -1
  190. package/lib-amd/edit/keyboardDelete.d.ts +9 -9
  191. package/lib-amd/edit/keyboardDelete.js +66 -66
  192. package/lib-amd/edit/keyboardDelete.js.map +1 -1
  193. package/lib-amd/edit/keyboardInput.d.ts +5 -5
  194. package/lib-amd/edit/keyboardInput.js +57 -57
  195. package/lib-amd/edit/keyboardInput.js.map +1 -1
  196. package/lib-amd/edit/keyboardTab.d.ts +5 -5
  197. package/lib-amd/edit/keyboardTab.js +34 -34
  198. package/lib-amd/edit/keyboardTab.js.map +1 -1
  199. package/lib-amd/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  200. package/lib-amd/edit/utils/getLeafSiblingBlock.js +75 -75
  201. package/lib-amd/edit/utils/getLeafSiblingBlock.js.map +1 -1
  202. package/lib-amd/index.d.ts +3 -3
  203. package/lib-amd/index.js +8 -8
  204. package/lib-amd/index.js.map +1 -1
  205. package/lib-amd/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
  206. package/lib-amd/paste/Excel/processPastedContentFromExcel.js +80 -80
  207. package/lib-amd/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  208. package/lib-amd/paste/PastePlugin.d.ts +43 -43
  209. package/lib-amd/paste/PastePlugin.js +122 -122
  210. package/lib-amd/paste/PastePlugin.js.map +1 -1
  211. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  212. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js +20 -20
  213. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  214. package/lib-amd/paste/WacComponents/constants.d.ts +48 -48
  215. package/lib-amd/paste/WacComponents/constants.js +63 -63
  216. package/lib-amd/paste/WacComponents/constants.js.map +1 -1
  217. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  218. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +185 -185
  219. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  220. package/lib-amd/paste/WordDesktop/WordMetadata.d.ts +9 -9
  221. package/lib-amd/paste/WordDesktop/WordMetadata.js +4 -4
  222. package/lib-amd/paste/WordDesktop/WordMetadata.js.map +1 -1
  223. package/lib-amd/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
  224. package/lib-amd/paste/WordDesktop/getStyleMetadata.js +78 -78
  225. package/lib-amd/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  226. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
  227. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +53 -53
  228. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  229. package/lib-amd/paste/WordDesktop/processWordComments.d.ts +7 -7
  230. package/lib-amd/paste/WordDesktop/processWordComments.js +22 -22
  231. package/lib-amd/paste/WordDesktop/processWordComments.js.map +1 -1
  232. package/lib-amd/paste/WordDesktop/processWordLists.d.ts +11 -11
  233. package/lib-amd/paste/WordDesktop/processWordLists.js +177 -177
  234. package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
  235. package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
  236. package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js +15 -15
  237. package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  238. package/lib-amd/paste/pasteSourceValidations/constants.d.ts +17 -17
  239. package/lib-amd/paste/pasteSourceValidations/constants.js +22 -22
  240. package/lib-amd/paste/pasteSourceValidations/constants.js.map +1 -1
  241. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  242. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js +16 -16
  243. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  244. package/lib-amd/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  245. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js +38 -38
  246. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  247. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  248. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js +18 -18
  249. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  250. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  251. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js +20 -20
  252. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  253. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  254. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js +16 -16
  255. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  256. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  257. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +16 -16
  258. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  259. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  260. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js +20 -20
  261. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  262. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  263. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js +20 -20
  264. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  265. package/lib-amd/paste/utils/addParser.d.ts +5 -5
  266. package/lib-amd/paste/utils/addParser.js +18 -18
  267. package/lib-amd/paste/utils/addParser.js.map +1 -1
  268. package/lib-amd/paste/utils/deprecatedColorParser.d.ts +5 -5
  269. package/lib-amd/paste/utils/deprecatedColorParser.js +20 -20
  270. package/lib-amd/paste/utils/deprecatedColorParser.js.map +1 -1
  271. package/lib-amd/paste/utils/getStyles.d.ts +6 -6
  272. package/lib-amd/paste/utils/getStyles.js +24 -24
  273. package/lib-amd/paste/utils/getStyles.js.map +1 -1
  274. package/lib-amd/paste/utils/linkParser.d.ts +5 -5
  275. package/lib-amd/paste/utils/linkParser.js +28 -28
  276. package/lib-amd/paste/utils/linkParser.js.map +1 -1
  277. package/lib-amd/paste/utils/setProcessor.d.ts +5 -5
  278. package/lib-amd/paste/utils/setProcessor.js +15 -15
  279. package/lib-amd/paste/utils/setProcessor.js.map +1 -1
  280. package/lib-amd/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
  281. package/lib-amd/pluginUtils/CreateElement/CreateElementData.js +4 -4
  282. package/lib-amd/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  283. package/lib-amd/pluginUtils/CreateElement/createElement.d.ts +9 -9
  284. package/lib-amd/pluginUtils/CreateElement/createElement.js +51 -51
  285. package/lib-amd/pluginUtils/CreateElement/createElement.js.map +1 -1
  286. package/lib-amd/pluginUtils/Disposable.d.ts +10 -10
  287. package/lib-amd/pluginUtils/Disposable.js +4 -4
  288. package/lib-amd/pluginUtils/Disposable.js.map +1 -1
  289. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
  290. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js +4 -4
  291. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  292. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
  293. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js +120 -120
  294. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  295. package/lib-amd/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
  296. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js +44 -44
  297. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  298. package/lib-amd/pluginUtils/Rect/normalizeRect.d.ts +7 -7
  299. package/lib-amd/pluginUtils/Rect/normalizeRect.js +21 -21
  300. package/lib-amd/pluginUtils/Rect/normalizeRect.js.map +1 -1
  301. package/lib-mjs/autoFormat/AutoFormatPlugin.d.ts +53 -53
  302. package/lib-mjs/autoFormat/AutoFormatPlugin.js +77 -77
  303. package/lib-mjs/autoFormat/AutoFormatPlugin.js.map +1 -1
  304. package/lib-mjs/autoFormat/keyboardListTrigger.d.ts +5 -5
  305. package/lib-mjs/autoFormat/keyboardListTrigger.js +41 -41
  306. package/lib-mjs/autoFormat/keyboardListTrigger.js.map +1 -1
  307. package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.d.ts +7 -7
  308. package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js +18 -18
  309. package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js.map +1 -1
  310. package/lib-mjs/autoFormat/utils/getIndex.d.ts +4 -4
  311. package/lib-mjs/autoFormat/utils/getIndex.js +9 -9
  312. package/lib-mjs/autoFormat/utils/getIndex.js.map +1 -1
  313. package/lib-mjs/autoFormat/utils/getListTypeStyle.d.ts +14 -14
  314. package/lib-mjs/autoFormat/utils/getListTypeStyle.js +83 -83
  315. package/lib-mjs/autoFormat/utils/getListTypeStyle.js.map +1 -1
  316. package/lib-mjs/autoFormat/utils/getNumberingListStyle.d.ts +4 -4
  317. package/lib-mjs/autoFormat/utils/getNumberingListStyle.js +149 -149
  318. package/lib-mjs/autoFormat/utils/getNumberingListStyle.js.map +1 -1
  319. package/lib-mjs/edit/EditPlugin.d.ts +39 -39
  320. package/lib-mjs/edit/EditPlugin.js +125 -125
  321. package/lib-mjs/edit/EditPlugin.js.map +1 -1
  322. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  323. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js +18 -18
  324. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  325. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  326. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js +90 -90
  327. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  328. package/lib-mjs/edit/deleteSteps/deleteList.d.ts +5 -5
  329. package/lib-mjs/edit/deleteSteps/deleteList.js +19 -19
  330. package/lib-mjs/edit/deleteSteps/deleteList.js.map +1 -1
  331. package/lib-mjs/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  332. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js +170 -170
  333. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  334. package/lib-mjs/edit/handleKeyboardEventCommon.d.ts +14 -14
  335. package/lib-mjs/edit/handleKeyboardEventCommon.js +48 -48
  336. package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
  337. package/lib-mjs/edit/inputSteps/handleEnterOnList.d.ts +5 -5
  338. package/lib-mjs/edit/inputSteps/handleEnterOnList.js +63 -63
  339. package/lib-mjs/edit/inputSteps/handleEnterOnList.js.map +1 -1
  340. package/lib-mjs/edit/keyboardDelete.d.ts +9 -9
  341. package/lib-mjs/edit/keyboardDelete.js +67 -67
  342. package/lib-mjs/edit/keyboardDelete.js.map +1 -1
  343. package/lib-mjs/edit/keyboardInput.d.ts +5 -5
  344. package/lib-mjs/edit/keyboardInput.js +54 -54
  345. package/lib-mjs/edit/keyboardInput.js.map +1 -1
  346. package/lib-mjs/edit/keyboardTab.d.ts +5 -5
  347. package/lib-mjs/edit/keyboardTab.js +30 -30
  348. package/lib-mjs/edit/keyboardTab.js.map +1 -1
  349. package/lib-mjs/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  350. package/lib-mjs/edit/utils/getLeafSiblingBlock.js +71 -71
  351. package/lib-mjs/edit/utils/getLeafSiblingBlock.js.map +1 -1
  352. package/lib-mjs/index.d.ts +3 -3
  353. package/lib-mjs/index.js +3 -3
  354. package/lib-mjs/index.js.map +1 -1
  355. package/lib-mjs/paste/Excel/processPastedContentFromExcel.d.ts +12 -12
  356. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +77 -77
  357. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  358. package/lib-mjs/paste/PastePlugin.d.ts +43 -43
  359. package/lib-mjs/paste/PastePlugin.js +127 -127
  360. package/lib-mjs/paste/PastePlugin.js.map +1 -1
  361. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  362. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js +15 -15
  363. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  364. package/lib-mjs/paste/WacComponents/constants.d.ts +48 -48
  365. package/lib-mjs/paste/WacComponents/constants.js +59 -59
  366. package/lib-mjs/paste/WacComponents/constants.js.map +1 -1
  367. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  368. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +184 -184
  369. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  370. package/lib-mjs/paste/WordDesktop/WordMetadata.d.ts +9 -9
  371. package/lib-mjs/paste/WordDesktop/WordMetadata.js +1 -1
  372. package/lib-mjs/paste/WordDesktop/WordMetadata.js.map +1 -1
  373. package/lib-mjs/paste/WordDesktop/getStyleMetadata.d.ts +23 -23
  374. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js +75 -75
  375. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  376. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +7 -7
  377. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +54 -54
  378. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  379. package/lib-mjs/paste/WordDesktop/processWordComments.d.ts +7 -7
  380. package/lib-mjs/paste/WordDesktop/processWordComments.js +17 -17
  381. package/lib-mjs/paste/WordDesktop/processWordComments.js.map +1 -1
  382. package/lib-mjs/paste/WordDesktop/processWordLists.d.ts +11 -11
  383. package/lib-mjs/paste/WordDesktop/processWordLists.js +175 -175
  384. package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
  385. package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.d.ts +5 -5
  386. package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js +9 -9
  387. package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  388. package/lib-mjs/paste/pasteSourceValidations/constants.d.ts +17 -17
  389. package/lib-mjs/paste/pasteSourceValidations/constants.js +17 -17
  390. package/lib-mjs/paste/pasteSourceValidations/constants.js.map +1 -1
  391. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  392. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js +11 -11
  393. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  394. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  395. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js +39 -39
  396. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  397. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  398. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js +13 -13
  399. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  400. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  401. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js +15 -15
  402. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  403. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  404. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js +11 -11
  405. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  406. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  407. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +11 -11
  408. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  409. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  410. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js +15 -15
  411. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  412. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  413. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js +14 -14
  414. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  415. package/lib-mjs/paste/utils/addParser.d.ts +5 -5
  416. package/lib-mjs/paste/utils/addParser.js +13 -13
  417. package/lib-mjs/paste/utils/addParser.js.map +1 -1
  418. package/lib-mjs/paste/utils/deprecatedColorParser.d.ts +5 -5
  419. package/lib-mjs/paste/utils/deprecatedColorParser.js +15 -15
  420. package/lib-mjs/paste/utils/deprecatedColorParser.js.map +1 -1
  421. package/lib-mjs/paste/utils/getStyles.d.ts +6 -6
  422. package/lib-mjs/paste/utils/getStyles.js +18 -18
  423. package/lib-mjs/paste/utils/getStyles.js.map +1 -1
  424. package/lib-mjs/paste/utils/linkParser.d.ts +5 -5
  425. package/lib-mjs/paste/utils/linkParser.js +23 -23
  426. package/lib-mjs/paste/utils/linkParser.js.map +1 -1
  427. package/lib-mjs/paste/utils/setProcessor.d.ts +5 -5
  428. package/lib-mjs/paste/utils/setProcessor.js +9 -9
  429. package/lib-mjs/paste/utils/setProcessor.js.map +1 -1
  430. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.d.ts +35 -35
  431. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js +1 -1
  432. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  433. package/lib-mjs/pluginUtils/CreateElement/createElement.d.ts +9 -9
  434. package/lib-mjs/pluginUtils/CreateElement/createElement.js +47 -47
  435. package/lib-mjs/pluginUtils/CreateElement/createElement.js.map +1 -1
  436. package/lib-mjs/pluginUtils/Disposable.d.ts +10 -10
  437. package/lib-mjs/pluginUtils/Disposable.js +1 -1
  438. package/lib-mjs/pluginUtils/Disposable.js.map +1 -1
  439. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +45 -45
  440. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js +1 -1
  441. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  442. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +39 -39
  443. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js +117 -117
  444. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  445. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.d.ts +27 -27
  446. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js +41 -41
  447. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  448. package/lib-mjs/pluginUtils/Rect/normalizeRect.d.ts +7 -7
  449. package/lib-mjs/pluginUtils/Rect/normalizeRect.js +16 -16
  450. package/lib-mjs/pluginUtils/Rect/normalizeRect.js.map +1 -1
  451. package/package.json +5 -5
@@ -1,128 +1,128 @@
1
- import addParser from './utils/addParser';
2
- import { BorderKeys } from 'roosterjs-content-model-dom';
3
- import { deprecatedBorderColorParser } from './utils/deprecatedColorParser';
4
- import { getPasteSource } from './pasteSourceValidations/getPasteSource';
5
- import { parseLink } from './utils/linkParser';
6
- import { PastePropertyNames } from './pasteSourceValidations/constants';
7
- import { processPastedContentFromExcel } from './Excel/processPastedContentFromExcel';
8
- import { processPastedContentFromPowerPoint } from './PowerPoint/processPastedContentFromPowerPoint';
9
- import { processPastedContentFromWordDesktop } from './WordDesktop/processPastedContentFromWordDesktop';
10
- import { processPastedContentWacComponents } from './WacComponents/processPastedContentWacComponents';
11
- /**
12
- * Paste plugin, handles BeforePaste event and reformat some special content, including:
13
- * 1. Content copied from Word
14
- * 2. Content copied from Excel
15
- * 3. Content copied from Word Online or OneNote Online
16
- * 4. Content copied from Power Point
17
- * (This class is still under development, and may still be changed in the future with some breaking changes)
18
- */
19
- var PastePlugin = /** @class */ (function () {
20
- /**
21
- * Construct a new instance of Paste class
22
- * @param unknownTagReplacement Replace solution of unknown tags, default behavior is to replace with SPAN
23
- * @param allowExcelNoBorderTable Allow table copied from Excel without border
24
- */
25
- function PastePlugin(allowExcelNoBorderTable) {
26
- this.allowExcelNoBorderTable = allowExcelNoBorderTable;
27
- this.editor = null;
28
- }
29
- /**
30
- * Get name of this plugin
31
- */
32
- PastePlugin.prototype.getName = function () {
33
- return 'Paste';
34
- };
35
- /**
36
- * The first method that editor will call to a plugin when editor is initializing.
37
- * It will pass in the editor instance, plugin should take this chance to save the
38
- * editor reference so that it can call to any editor method or format API later.
39
- * @param editor The editor object
40
- */
41
- PastePlugin.prototype.initialize = function (editor) {
42
- this.editor = editor;
43
- };
44
- /**
45
- * The last method that editor will call to a plugin before it is disposed.
46
- * Plugin can take this chance to clear the reference to editor. After this method is
47
- * called, plugin should not call to any editor method since it will result in error.
48
- */
49
- PastePlugin.prototype.dispose = function () {
50
- this.editor = null;
51
- };
52
- /**
53
- * Core method for a plugin. Once an event happens in editor, editor will call this
54
- * method of each plugin to handle the event as long as the event is not handled
55
- * exclusively by another plugin.
56
- * @param event The event to handle:
57
- */
58
- PastePlugin.prototype.onPluginEvent = function (event) {
59
- if (!this.editor || event.eventType != 'beforePaste') {
60
- return;
61
- }
62
- if (!event.domToModelOption) {
63
- return;
64
- }
65
- var pasteSource = getPasteSource(event, false);
66
- var pasteType = event.pasteType;
67
- switch (pasteSource) {
68
- case 'wordDesktop':
69
- processPastedContentFromWordDesktop(event, this.editor.getTrustedHTMLHandler());
70
- break;
71
- case 'wacComponents':
72
- processPastedContentWacComponents(event);
73
- break;
74
- case 'excelOnline':
75
- case 'excelDesktop':
76
- if (pasteType === 'normal' || pasteType === 'mergeFormat') {
77
- // Handle HTML copied from Excel
78
- processPastedContentFromExcel(event, this.editor.getTrustedHTMLHandler(), this.allowExcelNoBorderTable);
79
- }
80
- break;
81
- case 'googleSheets':
82
- event.domToModelOption.additionalAllowedTags.push(PastePropertyNames.GOOGLE_SHEET_NODE_NAME);
83
- break;
84
- case 'powerPointDesktop':
85
- processPastedContentFromPowerPoint(event, this.editor.getTrustedHTMLHandler());
86
- break;
87
- }
88
- addParser(event.domToModelOption, 'link', parseLink);
89
- addParser(event.domToModelOption, 'tableCell', deprecatedBorderColorParser);
90
- addParser(event.domToModelOption, 'tableCell', tableBorderParser);
91
- addParser(event.domToModelOption, 'table', deprecatedBorderColorParser);
92
- if (pasteType === 'mergeFormat') {
93
- addParser(event.domToModelOption, 'block', blockElementParser);
94
- addParser(event.domToModelOption, 'listLevel', blockElementParser);
95
- }
96
- };
97
- return PastePlugin;
98
- }());
99
- export { PastePlugin };
100
- /**
101
- * For block elements that have background color style, remove the background color when user selects the merge current format
102
- * paste option
103
- */
104
- var blockElementParser = function (format, element) {
105
- if (element.style.backgroundColor) {
106
- delete format.backgroundColor;
107
- }
108
- };
109
- var ElementBorderKeys = new Map([
110
- ['borderTop', { w: 'borderTopWidth', s: 'borderTopStyle', c: 'borderTopColor' }],
111
- ['borderRight', { w: 'borderRightWidth', s: 'borderRightStyle', c: 'borderRightColor' }],
112
- ['borderBottom', { w: 'borderBottomWidth', s: 'borderBottomStyle', c: 'borderBottomColor' }],
113
- ['borderLeft', { w: 'borderLeftWidth', s: 'borderLeftStyle', c: 'borderLeftColor' }],
114
- ]);
115
- function tableBorderParser(format, element) {
116
- BorderKeys.forEach(function (key) {
117
- if (!format[key]) {
118
- var styleSet = ElementBorderKeys.get(key);
119
- if (styleSet &&
120
- element.style[styleSet.w] &&
121
- element.style[styleSet.s] &&
122
- !element.style[styleSet.c]) {
123
- format[key] = element.style[styleSet.w] + " " + element.style[styleSet.s];
124
- }
125
- }
126
- });
127
- }
1
+ import addParser from './utils/addParser';
2
+ import { BorderKeys } from 'roosterjs-content-model-dom';
3
+ import { deprecatedBorderColorParser } from './utils/deprecatedColorParser';
4
+ import { getPasteSource } from './pasteSourceValidations/getPasteSource';
5
+ import { parseLink } from './utils/linkParser';
6
+ import { PastePropertyNames } from './pasteSourceValidations/constants';
7
+ import { processPastedContentFromExcel } from './Excel/processPastedContentFromExcel';
8
+ import { processPastedContentFromPowerPoint } from './PowerPoint/processPastedContentFromPowerPoint';
9
+ import { processPastedContentFromWordDesktop } from './WordDesktop/processPastedContentFromWordDesktop';
10
+ import { processPastedContentWacComponents } from './WacComponents/processPastedContentWacComponents';
11
+ /**
12
+ * Paste plugin, handles BeforePaste event and reformat some special content, including:
13
+ * 1. Content copied from Word
14
+ * 2. Content copied from Excel
15
+ * 3. Content copied from Word Online or OneNote Online
16
+ * 4. Content copied from Power Point
17
+ * (This class is still under development, and may still be changed in the future with some breaking changes)
18
+ */
19
+ var PastePlugin = /** @class */ (function () {
20
+ /**
21
+ * Construct a new instance of Paste class
22
+ * @param unknownTagReplacement Replace solution of unknown tags, default behavior is to replace with SPAN
23
+ * @param allowExcelNoBorderTable Allow table copied from Excel without border
24
+ */
25
+ function PastePlugin(allowExcelNoBorderTable) {
26
+ this.allowExcelNoBorderTable = allowExcelNoBorderTable;
27
+ this.editor = null;
28
+ }
29
+ /**
30
+ * Get name of this plugin
31
+ */
32
+ PastePlugin.prototype.getName = function () {
33
+ return 'Paste';
34
+ };
35
+ /**
36
+ * The first method that editor will call to a plugin when editor is initializing.
37
+ * It will pass in the editor instance, plugin should take this chance to save the
38
+ * editor reference so that it can call to any editor method or format API later.
39
+ * @param editor The editor object
40
+ */
41
+ PastePlugin.prototype.initialize = function (editor) {
42
+ this.editor = editor;
43
+ };
44
+ /**
45
+ * The last method that editor will call to a plugin before it is disposed.
46
+ * Plugin can take this chance to clear the reference to editor. After this method is
47
+ * called, plugin should not call to any editor method since it will result in error.
48
+ */
49
+ PastePlugin.prototype.dispose = function () {
50
+ this.editor = null;
51
+ };
52
+ /**
53
+ * Core method for a plugin. Once an event happens in editor, editor will call this
54
+ * method of each plugin to handle the event as long as the event is not handled
55
+ * exclusively by another plugin.
56
+ * @param event The event to handle:
57
+ */
58
+ PastePlugin.prototype.onPluginEvent = function (event) {
59
+ if (!this.editor || event.eventType != 'beforePaste') {
60
+ return;
61
+ }
62
+ if (!event.domToModelOption) {
63
+ return;
64
+ }
65
+ var pasteSource = getPasteSource(event, false);
66
+ var pasteType = event.pasteType;
67
+ switch (pasteSource) {
68
+ case 'wordDesktop':
69
+ processPastedContentFromWordDesktop(event, this.editor.getTrustedHTMLHandler());
70
+ break;
71
+ case 'wacComponents':
72
+ processPastedContentWacComponents(event);
73
+ break;
74
+ case 'excelOnline':
75
+ case 'excelDesktop':
76
+ if (pasteType === 'normal' || pasteType === 'mergeFormat') {
77
+ // Handle HTML copied from Excel
78
+ processPastedContentFromExcel(event, this.editor.getTrustedHTMLHandler(), this.allowExcelNoBorderTable);
79
+ }
80
+ break;
81
+ case 'googleSheets':
82
+ event.domToModelOption.additionalAllowedTags.push(PastePropertyNames.GOOGLE_SHEET_NODE_NAME);
83
+ break;
84
+ case 'powerPointDesktop':
85
+ processPastedContentFromPowerPoint(event, this.editor.getTrustedHTMLHandler());
86
+ break;
87
+ }
88
+ addParser(event.domToModelOption, 'link', parseLink);
89
+ addParser(event.domToModelOption, 'tableCell', deprecatedBorderColorParser);
90
+ addParser(event.domToModelOption, 'tableCell', tableBorderParser);
91
+ addParser(event.domToModelOption, 'table', deprecatedBorderColorParser);
92
+ if (pasteType === 'mergeFormat') {
93
+ addParser(event.domToModelOption, 'block', blockElementParser);
94
+ addParser(event.domToModelOption, 'listLevel', blockElementParser);
95
+ }
96
+ };
97
+ return PastePlugin;
98
+ }());
99
+ export { PastePlugin };
100
+ /**
101
+ * For block elements that have background color style, remove the background color when user selects the merge current format
102
+ * paste option
103
+ */
104
+ var blockElementParser = function (format, element) {
105
+ if (element.style.backgroundColor) {
106
+ delete format.backgroundColor;
107
+ }
108
+ };
109
+ var ElementBorderKeys = new Map([
110
+ ['borderTop', { w: 'borderTopWidth', s: 'borderTopStyle', c: 'borderTopColor' }],
111
+ ['borderRight', { w: 'borderRightWidth', s: 'borderRightStyle', c: 'borderRightColor' }],
112
+ ['borderBottom', { w: 'borderBottomWidth', s: 'borderBottomStyle', c: 'borderBottomColor' }],
113
+ ['borderLeft', { w: 'borderLeftWidth', s: 'borderLeftStyle', c: 'borderLeftColor' }],
114
+ ]);
115
+ function tableBorderParser(format, element) {
116
+ BorderKeys.forEach(function (key) {
117
+ if (!format[key]) {
118
+ var styleSet = ElementBorderKeys.get(key);
119
+ if (styleSet &&
120
+ element.style[styleSet.w] &&
121
+ element.style[styleSet.s] &&
122
+ !element.style[styleSet.c]) {
123
+ format[key] = element.style[styleSet.w] + " " + element.style[styleSet.s];
124
+ }
125
+ }
126
+ });
127
+ }
128
128
  //# sourceMappingURL=PastePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PastePlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/PastePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iDAAiD,CAAC;AACrG,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AACxG,OAAO,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAWtG;;;;;;;GAOG;AACH;IAGI;;;;OAIG;IACH,qBAAoB,uBAAiC;QAAjC,4BAAuB,GAAvB,uBAAuB,CAAU;QAP7C,WAAM,GAA6B,IAAI,CAAC;IAOQ,CAAC;IAEzD;;OAEG;IACH,6BAAO,GAAP;QACI,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,gCAAU,GAAV,UAAW,MAAyB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,6BAAO,GAAP;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,mCAAa,GA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,QAAQ;gBACR,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACzB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC5B;gBACE,MAAM,CAAC,GAAG,CAAC,GAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAG,CAAC;aAC7E;SACJ;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import addParser from './utils/addParser';\r\nimport { BorderKeys } from 'roosterjs-content-model-dom';\r\nimport { deprecatedBorderColorParser } from './utils/deprecatedColorParser';\r\nimport { getPasteSource } from './pasteSourceValidations/getPasteSource';\r\nimport { parseLink } from './utils/linkParser';\r\nimport { PastePropertyNames } from './pasteSourceValidations/constants';\r\nimport { processPastedContentFromExcel } from './Excel/processPastedContentFromExcel';\r\nimport { processPastedContentFromPowerPoint } from './PowerPoint/processPastedContentFromPowerPoint';\r\nimport { processPastedContentFromWordDesktop } from './WordDesktop/processPastedContentFromWordDesktop';\r\nimport { processPastedContentWacComponents } from './WacComponents/processPastedContentWacComponents';\r\nimport type {\r\n BorderFormat,\r\n ContentModelBlockFormat,\r\n ContentModelTableCellFormat,\r\n EditorPlugin,\r\n FormatParser,\r\n IStandaloneEditor,\r\n PluginEvent,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Paste plugin, handles BeforePaste event and reformat some special content, including:\r\n * 1. Content copied from Word\r\n * 2. Content copied from Excel\r\n * 3. Content copied from Word Online or OneNote Online\r\n * 4. Content copied from Power Point\r\n * (This class is still under development, and may still be changed in the future with some breaking changes)\r\n */\r\nexport class PastePlugin implements EditorPlugin {\r\n private editor: IStandaloneEditor | null = null;\r\n\r\n /**\r\n * Construct a new instance of Paste class\r\n * @param unknownTagReplacement Replace solution of unknown tags, default behavior is to replace with SPAN\r\n * @param allowExcelNoBorderTable Allow table copied from Excel without border\r\n */\r\n constructor(private allowExcelNoBorderTable?: boolean) {}\r\n\r\n /**\r\n * Get name of this plugin\r\n */\r\n getName() {\r\n return 'Paste';\r\n }\r\n\r\n /**\r\n * The first method that editor will call to a plugin when editor is initializing.\r\n * It will pass in the editor instance, plugin should take this chance to save the\r\n * editor reference so that it can call to any editor method or format API later.\r\n * @param editor The editor object\r\n */\r\n initialize(editor: IStandaloneEditor) {\r\n this.editor = editor;\r\n }\r\n\r\n /**\r\n * The last method that editor will call to a plugin before it is disposed.\r\n * Plugin can take this chance to clear the reference to editor. After this method is\r\n * called, plugin should not call to any editor method since it will result in error.\r\n */\r\n dispose() {\r\n this.editor = null;\r\n }\r\n\r\n /**\r\n * Core method for a plugin. Once an event happens in editor, editor will call this\r\n * method of each plugin to handle the event as long as the event is not handled\r\n * exclusively by another plugin.\r\n * @param event The event to handle:\r\n */\r\n onPluginEvent(event: PluginEvent) {\r\n if (!this.editor || event.eventType != 'beforePaste') {\r\n return;\r\n }\r\n\r\n if (!event.domToModelOption) {\r\n return;\r\n }\r\n\r\n const pasteSource = getPasteSource(event, false);\r\n const pasteType = event.pasteType;\r\n\r\n switch (pasteSource) {\r\n case 'wordDesktop':\r\n processPastedContentFromWordDesktop(event, this.editor.getTrustedHTMLHandler());\r\n break;\r\n case 'wacComponents':\r\n processPastedContentWacComponents(event);\r\n break;\r\n case 'excelOnline':\r\n case 'excelDesktop':\r\n if (pasteType === 'normal' || pasteType === 'mergeFormat') {\r\n // Handle HTML copied from Excel\r\n processPastedContentFromExcel(\r\n event,\r\n this.editor.getTrustedHTMLHandler(),\r\n this.allowExcelNoBorderTable\r\n );\r\n }\r\n break;\r\n case 'googleSheets':\r\n event.domToModelOption.additionalAllowedTags.push(\r\n PastePropertyNames.GOOGLE_SHEET_NODE_NAME as Lowercase<string>\r\n );\r\n break;\r\n case 'powerPointDesktop':\r\n processPastedContentFromPowerPoint(event, this.editor.getTrustedHTMLHandler());\r\n break;\r\n }\r\n\r\n addParser(event.domToModelOption, 'link', parseLink);\r\n addParser(event.domToModelOption, 'tableCell', deprecatedBorderColorParser);\r\n addParser(event.domToModelOption, 'tableCell', tableBorderParser);\r\n addParser(event.domToModelOption, 'table', deprecatedBorderColorParser);\r\n\r\n if (pasteType === 'mergeFormat') {\r\n addParser(event.domToModelOption, 'block', blockElementParser);\r\n addParser(event.domToModelOption, 'listLevel', blockElementParser);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * For block elements that have background color style, remove the background color when user selects the merge current format\r\n * paste option\r\n */\r\nconst blockElementParser: FormatParser<ContentModelBlockFormat> = (\r\n format: ContentModelBlockFormat,\r\n element: HTMLElement\r\n) => {\r\n if (element.style.backgroundColor) {\r\n delete format.backgroundColor;\r\n }\r\n};\r\n\r\nconst ElementBorderKeys = new Map<\r\n keyof BorderFormat,\r\n {\r\n c: keyof CSSStyleDeclaration;\r\n s: keyof CSSStyleDeclaration;\r\n w: keyof CSSStyleDeclaration;\r\n }\r\n>([\r\n ['borderTop', { w: 'borderTopWidth', s: 'borderTopStyle', c: 'borderTopColor' }],\r\n ['borderRight', { w: 'borderRightWidth', s: 'borderRightStyle', c: 'borderRightColor' }],\r\n ['borderBottom', { w: 'borderBottomWidth', s: 'borderBottomStyle', c: 'borderBottomColor' }],\r\n ['borderLeft', { w: 'borderLeftWidth', s: 'borderLeftStyle', c: 'borderLeftColor' }],\r\n]);\r\n\r\nfunction tableBorderParser(format: ContentModelTableCellFormat, element: HTMLElement): void {\r\n BorderKeys.forEach(key => {\r\n if (!format[key]) {\r\n const styleSet = ElementBorderKeys.get(key);\r\n if (\r\n styleSet &&\r\n element.style[styleSet.w] &&\r\n element.style[styleSet.s] &&\r\n !element.style[styleSet.c]\r\n ) {\r\n format[key] = `${element.style[styleSet.w]} ${element.style[styleSet.s]}`;\r\n }\r\n }\r\n });\r\n}\r\n"]}
1
+ {"version":3,"file":"PastePlugin.js","sourceRoot":"","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AM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAG,CAAC;aAC7E;SACJ;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import addParser from './utils/addParser';\nimport { BorderKeys } from 'roosterjs-content-model-dom';\nimport { deprecatedBorderColorParser } from './utils/deprecatedColorParser';\nimport { getPasteSource } from './pasteSourceValidations/getPasteSource';\nimport { parseLink } from './utils/linkParser';\nimport { PastePropertyNames } from './pasteSourceValidations/constants';\nimport { processPastedContentFromExcel } from './Excel/processPastedContentFromExcel';\nimport { processPastedContentFromPowerPoint } from './PowerPoint/processPastedContentFromPowerPoint';\nimport { processPastedContentFromWordDesktop } from './WordDesktop/processPastedContentFromWordDesktop';\nimport { processPastedContentWacComponents } from './WacComponents/processPastedContentWacComponents';\nimport type {\n BorderFormat,\n ContentModelBlockFormat,\n ContentModelTableCellFormat,\n EditorPlugin,\n FormatParser,\n IStandaloneEditor,\n PluginEvent,\n} from 'roosterjs-content-model-types';\n\n/**\n * Paste plugin, handles BeforePaste event and reformat some special content, including:\n * 1. Content copied from Word\n * 2. Content copied from Excel\n * 3. Content copied from Word Online or OneNote Online\n * 4. Content copied from Power Point\n * (This class is still under development, and may still be changed in the future with some breaking changes)\n */\nexport class PastePlugin implements EditorPlugin {\n private editor: IStandaloneEditor | null = null;\n\n /**\n * Construct a new instance of Paste class\n * @param unknownTagReplacement Replace solution of unknown tags, default behavior is to replace with SPAN\n * @param allowExcelNoBorderTable Allow table copied from Excel without border\n */\n constructor(private allowExcelNoBorderTable?: boolean) {}\n\n /**\n * Get name of this plugin\n */\n getName() {\n return 'Paste';\n }\n\n /**\n * The first method that editor will call to a plugin when editor is initializing.\n * It will pass in the editor instance, plugin should take this chance to save the\n * editor reference so that it can call to any editor method or format API later.\n * @param editor The editor object\n */\n initialize(editor: IStandaloneEditor) {\n this.editor = editor;\n }\n\n /**\n * The last method that editor will call to a plugin before it is disposed.\n * Plugin can take this chance to clear the reference to editor. After this method is\n * called, plugin should not call to any editor method since it will result in error.\n */\n dispose() {\n this.editor = null;\n }\n\n /**\n * Core method for a plugin. Once an event happens in editor, editor will call this\n * method of each plugin to handle the event as long as the event is not handled\n * exclusively by another plugin.\n * @param event The event to handle:\n */\n onPluginEvent(event: PluginEvent) {\n if (!this.editor || event.eventType != 'beforePaste') {\n return;\n }\n\n if (!event.domToModelOption) {\n return;\n }\n\n const pasteSource = getPasteSource(event, false);\n const pasteType = event.pasteType;\n\n switch (pasteSource) {\n case 'wordDesktop':\n processPastedContentFromWordDesktop(event, this.editor.getTrustedHTMLHandler());\n break;\n case 'wacComponents':\n processPastedContentWacComponents(event);\n break;\n case 'excelOnline':\n case 'excelDesktop':\n if (pasteType === 'normal' || pasteType === 'mergeFormat') {\n // Handle HTML copied from Excel\n processPastedContentFromExcel(\n event,\n this.editor.getTrustedHTMLHandler(),\n this.allowExcelNoBorderTable\n );\n }\n break;\n case 'googleSheets':\n event.domToModelOption.additionalAllowedTags.push(\n PastePropertyNames.GOOGLE_SHEET_NODE_NAME as Lowercase<string>\n );\n break;\n case 'powerPointDesktop':\n processPastedContentFromPowerPoint(event, this.editor.getTrustedHTMLHandler());\n break;\n }\n\n addParser(event.domToModelOption, 'link', parseLink);\n addParser(event.domToModelOption, 'tableCell', deprecatedBorderColorParser);\n addParser(event.domToModelOption, 'tableCell', tableBorderParser);\n addParser(event.domToModelOption, 'table', deprecatedBorderColorParser);\n\n if (pasteType === 'mergeFormat') {\n addParser(event.domToModelOption, 'block', blockElementParser);\n addParser(event.domToModelOption, 'listLevel', blockElementParser);\n }\n }\n}\n\n/**\n * For block elements that have background color style, remove the background color when user selects the merge current format\n * paste option\n */\nconst blockElementParser: FormatParser<ContentModelBlockFormat> = (\n format: ContentModelBlockFormat,\n element: HTMLElement\n) => {\n if (element.style.backgroundColor) {\n delete format.backgroundColor;\n }\n};\n\nconst ElementBorderKeys = new Map<\n keyof BorderFormat,\n {\n c: keyof CSSStyleDeclaration;\n s: keyof CSSStyleDeclaration;\n w: keyof CSSStyleDeclaration;\n }\n>([\n ['borderTop', { w: 'borderTopWidth', s: 'borderTopStyle', c: 'borderTopColor' }],\n ['borderRight', { w: 'borderRightWidth', s: 'borderRightStyle', c: 'borderRightColor' }],\n ['borderBottom', { w: 'borderBottomWidth', s: 'borderBottomStyle', c: 'borderBottomColor' }],\n ['borderLeft', { w: 'borderLeftWidth', s: 'borderLeftStyle', c: 'borderLeftColor' }],\n]);\n\nfunction tableBorderParser(format: ContentModelTableCellFormat, element: HTMLElement): void {\n BorderKeys.forEach(key => {\n if (!format[key]) {\n const styleSet = ElementBorderKeys.get(key);\n if (\n styleSet &&\n element.style[styleSet.w] &&\n element.style[styleSet.s] &&\n !element.style[styleSet.c]\n ) {\n format[key] = `${element.style[styleSet.w]} ${element.style[styleSet.s]}`;\n }\n }\n });\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { BeforePasteEvent, TrustedHTMLHandler } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- * Convert pasted content from PowerPoint
5
- * @param event The BeforePaste event
6
- */
7
- export declare function processPastedContentFromPowerPoint(event: BeforePasteEvent, trustedHTMLHandler: TrustedHTMLHandler): void;
1
+ import type { BeforePasteEvent, TrustedHTMLHandler } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ * Convert pasted content from PowerPoint
5
+ * @param event The BeforePaste event
6
+ */
7
+ export declare function processPastedContentFromPowerPoint(event: BeforePasteEvent, trustedHTMLHandler: TrustedHTMLHandler): void;
@@ -1,16 +1,16 @@
1
- import { moveChildNodes } from 'roosterjs-content-model-dom';
2
- /**
3
- * @internal
4
- * Convert pasted content from PowerPoint
5
- * @param event The BeforePaste event
6
- */
7
- export function processPastedContentFromPowerPoint(event, trustedHTMLHandler) {
8
- var fragment = event.fragment, clipboardData = event.clipboardData;
9
- if (clipboardData.html && !clipboardData.text && clipboardData.image) {
10
- // It is possible that PowerPoint copied both image and HTML but not plain text.
11
- // We always prefer HTML if any.
12
- var doc = new DOMParser().parseFromString(trustedHTMLHandler(clipboardData.html), 'text/html');
13
- moveChildNodes(fragment, doc === null || doc === void 0 ? void 0 : doc.body);
14
- }
15
- }
1
+ import { moveChildNodes } from 'roosterjs-content-model-dom';
2
+ /**
3
+ * @internal
4
+ * Convert pasted content from PowerPoint
5
+ * @param event The BeforePaste event
6
+ */
7
+ export function processPastedContentFromPowerPoint(event, trustedHTMLHandler) {
8
+ var fragment = event.fragment, clipboardData = event.clipboardData;
9
+ if (clipboardData.html && !clipboardData.text && clipboardData.image) {
10
+ // It is possible that PowerPoint copied both image and HTML but not plain text.
11
+ // We always prefer HTML if any.
12
+ var doc = new DOMParser().parseFromString(trustedHTMLHandler(clipboardData.html), 'text/html');
13
+ moveChildNodes(fragment, doc === null || doc === void 0 ? void 0 : doc.body);
14
+ }
15
+ }
16
16
  //# sourceMappingURL=processPastedContentFromPowerPoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"processPastedContentFromPowerPoint.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/PowerPoint/processPastedContentFromPowerPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D;;;;GAIG;AAEH,MAAM,UAAU,kCAAkC,CAC9C,KAAuB,EACvB,kBAAsC;IAE9B,IAAA,QAAQ,GAAoB,KAAK,SAAzB,EAAE,aAAa,GAAK,KAAK,cAAV,CAAW;IAE1C,IAAI,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,KAAK,EAAE;QAClE,gFAAgF;QAChF,gCAAgC;QAChC,IAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CACvC,kBAAkB,CAAC,aAAa,CAAC,IAAI,CAAC,EACtC,WAAW,CACd,CAAC;QAEF,cAAc,CAAC,QAAQ,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAC,CAAC;KACvC;AACL,CAAC","sourcesContent":["import { moveChildNodes } from 'roosterjs-content-model-dom';\r\nimport type { BeforePasteEvent, TrustedHTMLHandler } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n * Convert pasted content from PowerPoint\r\n * @param event The BeforePaste event\r\n */\r\n\r\nexport function processPastedContentFromPowerPoint(\r\n event: BeforePasteEvent,\r\n trustedHTMLHandler: TrustedHTMLHandler\r\n) {\r\n const { fragment, clipboardData } = event;\r\n\r\n if (clipboardData.html && !clipboardData.text && clipboardData.image) {\r\n // It is possible that PowerPoint copied both image and HTML but not plain text.\r\n // We always prefer HTML if any.\r\n const doc = new DOMParser().parseFromString(\r\n trustedHTMLHandler(clipboardData.html),\r\n 'text/html'\r\n );\r\n\r\n moveChildNodes(fragment, doc?.body);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"processPastedContentFromPowerPoint.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/PowerPoint/processPastedContentFromPowerPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D;;;;GAIG;AAEH,MAAM,UAAU,kCAAkC,CAC9C,KAAuB,EACvB,kBAAsC;IAE9B,IAAA,QAAQ,GAAoB,KAAK,SAAzB,EAAE,aAAa,GAAK,KAAK,cAAV,CAAW;IAE1C,IAAI,aAAa,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,aAAa,CAAC,KAAK,EAAE;QAClE,gFAAgF;QAChF,gCAAgC;QAChC,IAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CACvC,kBAAkB,CAAC,aAAa,CAAC,IAAI,CAAC,EACtC,WAAW,CACd,CAAC;QAEF,cAAc,CAAC,QAAQ,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,CAAC,CAAC;KACvC;AACL,CAAC","sourcesContent":["import { moveChildNodes } from 'roosterjs-content-model-dom';\nimport type { BeforePasteEvent, TrustedHTMLHandler } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * Convert pasted content from PowerPoint\n * @param event The BeforePaste event\n */\n\nexport function processPastedContentFromPowerPoint(\n event: BeforePasteEvent,\n trustedHTMLHandler: TrustedHTMLHandler\n) {\n const { fragment, clipboardData } = event;\n\n if (clipboardData.html && !clipboardData.text && clipboardData.image) {\n // It is possible that PowerPoint copied both image and HTML but not plain text.\n // We always prefer HTML if any.\n const doc = new DOMParser().parseFromString(\n trustedHTMLHandler(clipboardData.html),\n 'text/html'\n );\n\n moveChildNodes(fragment, doc?.body);\n }\n}\n"]}
@@ -1,48 +1,48 @@
1
- /**
2
- * @internal
3
- **/
4
- export declare const WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES: string[];
5
- /**
6
- * @internal
7
- **/
8
- export declare const BULLET_LIST_STYLE: string;
9
- /**
10
- * @internal
11
- **/
12
- export declare const NUMBER_LIST_STYLE: string;
13
- /**
14
- * @internal
15
- **/
16
- export declare const IMAGE_BORDER: string;
17
- /**
18
- * @internal
19
- **/
20
- export declare const IMAGE_CONTAINER: string;
21
- /**
22
- * @internal
23
- **/
24
- export declare const OUTLINE_ELEMENT: string;
25
- /**
26
- * @internal
27
- **/
28
- export declare const PARAGRAPH: string;
29
- /**
30
- * @internal
31
- **/
32
- export declare const LIST_CONTAINER_ELEMENT_CLASS_NAME: string;
33
- /**
34
- * @internal
35
- **/
36
- export declare const COMMENT_HIGHLIGHT_CLASS: string;
37
- /**
38
- * @internal
39
- **/
40
- export declare const COMMENT_HIGHLIGHT_CLICKED_CLASS: string;
41
- /**
42
- * @internal
43
- **/
44
- export declare const TEMP_ELEMENTS_CLASSES: string[];
45
- /**
46
- * @internal
47
- **/
48
- export declare const WAC_IDENTIFY_SELECTOR: string;
1
+ /**
2
+ * @internal
3
+ **/
4
+ export declare const WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES: string[];
5
+ /**
6
+ * @internal
7
+ **/
8
+ export declare const BULLET_LIST_STYLE: string;
9
+ /**
10
+ * @internal
11
+ **/
12
+ export declare const NUMBER_LIST_STYLE: string;
13
+ /**
14
+ * @internal
15
+ **/
16
+ export declare const IMAGE_BORDER: string;
17
+ /**
18
+ * @internal
19
+ **/
20
+ export declare const IMAGE_CONTAINER: string;
21
+ /**
22
+ * @internal
23
+ **/
24
+ export declare const OUTLINE_ELEMENT: string;
25
+ /**
26
+ * @internal
27
+ **/
28
+ export declare const PARAGRAPH: string;
29
+ /**
30
+ * @internal
31
+ **/
32
+ export declare const LIST_CONTAINER_ELEMENT_CLASS_NAME: string;
33
+ /**
34
+ * @internal
35
+ **/
36
+ export declare const COMMENT_HIGHLIGHT_CLASS: string;
37
+ /**
38
+ * @internal
39
+ **/
40
+ export declare const COMMENT_HIGHLIGHT_CLICKED_CLASS: string;
41
+ /**
42
+ * @internal
43
+ **/
44
+ export declare const TEMP_ELEMENTS_CLASSES: string[];
45
+ /**
46
+ * @internal
47
+ **/
48
+ export declare const WAC_IDENTIFY_SELECTOR: string;
@@ -1,60 +1,60 @@
1
- import { __read, __spreadArray } from "tslib";
2
- /**
3
- * @internal
4
- **/
5
- export var WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [
6
- 'TableInsertRowGapBlank',
7
- 'TableColumnResizeHandle',
8
- 'TableCellTopBorderHandle',
9
- 'TableCellLeftBorderHandle',
10
- 'TableHoverColumnHandle',
11
- 'TableHoverRowHandle',
12
- ];
13
- /**
14
- * @internal
15
- **/
16
- export var BULLET_LIST_STYLE = 'BulletListStyle';
17
- /**
18
- * @internal
19
- **/
20
- export var NUMBER_LIST_STYLE = 'NumberListStyle';
21
- /**
22
- * @internal
23
- **/
24
- export var IMAGE_BORDER = 'WACImageBorder';
25
- /**
26
- * @internal
27
- **/
28
- export var IMAGE_CONTAINER = 'WACImageContainer';
29
- /**
30
- * @internal
31
- **/
32
- export var OUTLINE_ELEMENT = 'OutlineElement';
33
- /**
34
- * @internal
35
- **/
36
- export var PARAGRAPH = 'Paragraph';
37
- /**
38
- * @internal
39
- **/
40
- export var LIST_CONTAINER_ELEMENT_CLASS_NAME = 'ListContainerWrapper';
41
- /**
42
- * @internal
43
- **/
44
- export var COMMENT_HIGHLIGHT_CLASS = 'CommentHighlightRest';
45
- /**
46
- * @internal
47
- **/
48
- export var COMMENT_HIGHLIGHT_CLICKED_CLASS = 'CommentHighlightClicked';
49
- /**
50
- * @internal
51
- **/
52
- export var TEMP_ELEMENTS_CLASSES = __spreadArray(__spreadArray([], __read(WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES), false), [
53
- 'ListMarkerWrappingSpan',
54
- ], false);
55
- /**
56
- * @internal
57
- **/
58
- export var WAC_IDENTIFY_SELECTOR = "ul[class^=\"" + BULLET_LIST_STYLE + "\"]>." + OUTLINE_ELEMENT + ",ol[class^=\"" + NUMBER_LIST_STYLE + "\"]>." + OUTLINE_ELEMENT + ",span." + IMAGE_CONTAINER + ",span." + IMAGE_BORDER + ",." + COMMENT_HIGHLIGHT_CLASS + ",." + COMMENT_HIGHLIGHT_CLICKED_CLASS + "," +
59
- WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(function (c) { return "table div[class^=\"" + c + "\"]"; }).join(',');
1
+ import { __read, __spreadArray } from "tslib";
2
+ /**
3
+ * @internal
4
+ **/
5
+ export var WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES = [
6
+ 'TableInsertRowGapBlank',
7
+ 'TableColumnResizeHandle',
8
+ 'TableCellTopBorderHandle',
9
+ 'TableCellLeftBorderHandle',
10
+ 'TableHoverColumnHandle',
11
+ 'TableHoverRowHandle',
12
+ ];
13
+ /**
14
+ * @internal
15
+ **/
16
+ export var BULLET_LIST_STYLE = 'BulletListStyle';
17
+ /**
18
+ * @internal
19
+ **/
20
+ export var NUMBER_LIST_STYLE = 'NumberListStyle';
21
+ /**
22
+ * @internal
23
+ **/
24
+ export var IMAGE_BORDER = 'WACImageBorder';
25
+ /**
26
+ * @internal
27
+ **/
28
+ export var IMAGE_CONTAINER = 'WACImageContainer';
29
+ /**
30
+ * @internal
31
+ **/
32
+ export var OUTLINE_ELEMENT = 'OutlineElement';
33
+ /**
34
+ * @internal
35
+ **/
36
+ export var PARAGRAPH = 'Paragraph';
37
+ /**
38
+ * @internal
39
+ **/
40
+ export var LIST_CONTAINER_ELEMENT_CLASS_NAME = 'ListContainerWrapper';
41
+ /**
42
+ * @internal
43
+ **/
44
+ export var COMMENT_HIGHLIGHT_CLASS = 'CommentHighlightRest';
45
+ /**
46
+ * @internal
47
+ **/
48
+ export var COMMENT_HIGHLIGHT_CLICKED_CLASS = 'CommentHighlightClicked';
49
+ /**
50
+ * @internal
51
+ **/
52
+ export var TEMP_ELEMENTS_CLASSES = __spreadArray(__spreadArray([], __read(WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES), false), [
53
+ 'ListMarkerWrappingSpan',
54
+ ], false);
55
+ /**
56
+ * @internal
57
+ **/
58
+ export var WAC_IDENTIFY_SELECTOR = "ul[class^=\"" + BULLET_LIST_STYLE + "\"]>." + OUTLINE_ELEMENT + ",ol[class^=\"" + NUMBER_LIST_STYLE + "\"]>." + OUTLINE_ELEMENT + ",span." + IMAGE_CONTAINER + ",span." + IMAGE_BORDER + ",." + COMMENT_HIGHLIGHT_CLASS + ",." + COMMENT_HIGHLIGHT_CLICKED_CLASS + "," +
59
+ WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(function (c) { return "table div[class^=\"" + c + "\"]"; }).join(',');
60
60
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WacComponents/constants.ts"],"names":[],"mappings":";AAAA;;IAEI;AACJ,MAAM,CAAC,IAAM,sCAAsC,GAAa;IAC5D,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,wBAAwB;IACxB,qBAAqB;CACxB,CAAC;AACF;;IAEI;AACJ,MAAM,CAAC,IAAM,iBAAiB,GAAW,iBAAiB,CAAC;AAC3D;;IAEI;AACJ,MAAM,CAAC,IAAM,iBAAiB,GAAW,iBAAiB,CAAC;AAC3D;;IAEI;AACJ,MAAM,CAAC,IAAM,YAAY,GAAW,gBAAgB,CAAC;AACrD;;IAEI;AACJ,MAAM,CAAC,IAAM,eAAe,GAAW,mBAAmB,CAAC;AAC3D;;IAEI;AACJ,MAAM,CAAC,IAAM,eAAe,GAAW,gBAAgB,CAAC;AACxD;;IAEI;AACJ,MAAM,CAAC,IAAM,SAAS,GAAW,WAAW,CAAC;AAC7C;;IAEI;AACJ,MAAM,CAAC,IAAM,iCAAiC,GAAW,sBAAsB,CAAC;AAChF;;IAEI;AACJ,MAAM,CAAC,IAAM,uBAAuB,GAAW,sBAAsB,CAAC;AACtE;;IAEI;AACJ,MAAM,CAAC,IAAM,+BAA+B,GAAW,yBAAyB,CAAC;AACjF;;IAEI;AACJ,MAAM,CAAC,IAAM,qBAAqB,0CAC3B,sCAAsC;IACzC,wBAAwB;SAC3B,CAAC;AACF;;IAEI;AACJ,MAAM,CAAC,IAAM,qBAAqB,GAC9B,iBAAc,iBAAiB,aAAO,eAAe,qBAAe,iBAAiB,aAAO,eAAe,cAAS,eAAe,cAAS,YAAY,UAAK,uBAAuB,UAAK,+BAA+B,MAAG;IAC3N,sCAAsC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,wBAAqB,CAAC,QAAI,EAA1B,CAA0B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC","sourcesContent":["/**\r\n * @internal\r\n **/\r\nexport const WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES: string[] = [\r\n 'TableInsertRowGapBlank',\r\n 'TableColumnResizeHandle',\r\n 'TableCellTopBorderHandle',\r\n 'TableCellLeftBorderHandle',\r\n 'TableHoverColumnHandle',\r\n 'TableHoverRowHandle',\r\n];\r\n/**\r\n * @internal\r\n **/\r\nexport const BULLET_LIST_STYLE: string = 'BulletListStyle';\r\n/**\r\n * @internal\r\n **/\r\nexport const NUMBER_LIST_STYLE: string = 'NumberListStyle';\r\n/**\r\n * @internal\r\n **/\r\nexport const IMAGE_BORDER: string = 'WACImageBorder';\r\n/**\r\n * @internal\r\n **/\r\nexport const IMAGE_CONTAINER: string = 'WACImageContainer';\r\n/**\r\n * @internal\r\n **/\r\nexport const OUTLINE_ELEMENT: string = 'OutlineElement';\r\n/**\r\n * @internal\r\n **/\r\nexport const PARAGRAPH: string = 'Paragraph';\r\n/**\r\n * @internal\r\n **/\r\nexport const LIST_CONTAINER_ELEMENT_CLASS_NAME: string = 'ListContainerWrapper';\r\n/**\r\n * @internal\r\n **/\r\nexport const COMMENT_HIGHLIGHT_CLASS: string = 'CommentHighlightRest';\r\n/**\r\n * @internal\r\n **/\r\nexport const COMMENT_HIGHLIGHT_CLICKED_CLASS: string = 'CommentHighlightClicked';\r\n/**\r\n * @internal\r\n **/\r\nexport const TEMP_ELEMENTS_CLASSES: string[] = [\r\n ...WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES,\r\n 'ListMarkerWrappingSpan',\r\n];\r\n/**\r\n * @internal\r\n **/\r\nexport const WAC_IDENTIFY_SELECTOR: string =\r\n `ul[class^=\"${BULLET_LIST_STYLE}\"]>.${OUTLINE_ELEMENT},ol[class^=\"${NUMBER_LIST_STYLE}\"]>.${OUTLINE_ELEMENT},span.${IMAGE_CONTAINER},span.${IMAGE_BORDER},.${COMMENT_HIGHLIGHT_CLASS},.${COMMENT_HIGHLIGHT_CLICKED_CLASS},` +\r\n WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(c => `table div[class^=\"${c}\"]`).join(',');\r\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/WacComponents/constants.ts"],"names":[],"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ank',\n 'TableColumnResizeHandle',\n 'TableCellTopBorderHandle',\n 'TableCellLeftBorderHandle',\n 'TableHoverColumnHandle',\n 'TableHoverRowHandle',\n];\n/**\n * @internal\n **/\nexport const BULLET_LIST_STYLE: string = 'BulletListStyle';\n/**\n * @internal\n **/\nexport const NUMBER_LIST_STYLE: string = 'NumberListStyle';\n/**\n * @internal\n **/\nexport const IMAGE_BORDER: string = 'WACImageBorder';\n/**\n * @internal\n **/\nexport const IMAGE_CONTAINER: string = 'WACImageContainer';\n/**\n * @internal\n **/\nexport const OUTLINE_ELEMENT: string = 'OutlineElement';\n/**\n * @internal\n **/\nexport const PARAGRAPH: string = 'Paragraph';\n/**\n * @internal\n **/\nexport const LIST_CONTAINER_ELEMENT_CLASS_NAME: string = 'ListContainerWrapper';\n/**\n * @internal\n **/\nexport const COMMENT_HIGHLIGHT_CLASS: string = 'CommentHighlightRest';\n/**\n * @internal\n **/\nexport const COMMENT_HIGHLIGHT_CLICKED_CLASS: string = 'CommentHighlightClicked';\n/**\n * @internal\n **/\nexport const TEMP_ELEMENTS_CLASSES: string[] = [\n ...WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES,\n 'ListMarkerWrappingSpan',\n];\n/**\n * @internal\n **/\nexport const WAC_IDENTIFY_SELECTOR: string =\n `ul[class^=\"${BULLET_LIST_STYLE}\"]>.${OUTLINE_ELEMENT},ol[class^=\"${NUMBER_LIST_STYLE}\"]>.${OUTLINE_ELEMENT},span.${IMAGE_CONTAINER},span.${IMAGE_BORDER},.${COMMENT_HIGHLIGHT_CLASS},.${COMMENT_HIGHLIGHT_CLICKED_CLASS},` +\n WORD_ONLINE_TABLE_TEMP_ELEMENT_CLASSES.map(c => `table div[class^=\"${c}\"]`).join(',');\n"]}
@@ -1,9 +1,9 @@
1
- import type { BeforePasteEvent } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- * Convert pasted content from Office Online
5
- * Once it is known that the document is from WAC
6
- * We need to remove the display property and margin from all the list item
7
- * @param ev BeforePasteEvent
8
- */
9
- export declare function processPastedContentWacComponents(ev: BeforePasteEvent): void;
1
+ import type { BeforePasteEvent } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ * Convert pasted content from Office Online
5
+ * Once it is known that the document is from WAC
6
+ * We need to remove the display property and margin from all the list item
7
+ * @param ev BeforePasteEvent
8
+ */
9
+ export declare function processPastedContentWacComponents(ev: BeforePasteEvent): void;