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.
Files changed (280) hide show
  1. package/lib/edit/ContentModelEditPlugin.d.ts +35 -35
  2. package/lib/edit/ContentModelEditPlugin.js +75 -75
  3. package/lib/edit/ContentModelEditPlugin.js.map +1 -1
  4. package/lib/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  5. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js +19 -19
  6. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  7. package/lib/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  8. package/lib/edit/deleteSteps/deleteCollapsedSelection.js +90 -90
  9. package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  10. package/lib/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  11. package/lib/edit/deleteSteps/deleteWordSelection.js +170 -170
  12. package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  13. package/lib/edit/handleKeyboardEventCommon.d.ts +15 -15
  14. package/lib/edit/handleKeyboardEventCommon.js +54 -54
  15. package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
  16. package/lib/edit/keyboardDelete.d.ts +8 -8
  17. package/lib/edit/keyboardDelete.js +67 -67
  18. package/lib/edit/keyboardDelete.js.map +1 -1
  19. package/lib/edit/keyboardInput.d.ts +5 -5
  20. package/lib/edit/keyboardInput.js +50 -49
  21. package/lib/edit/keyboardInput.js.map +1 -1
  22. package/lib/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  23. package/lib/edit/utils/getLeafSiblingBlock.js +75 -75
  24. package/lib/edit/utils/getLeafSiblingBlock.js.map +1 -1
  25. package/lib/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
  26. package/lib/entityDelimiter/EntityDelimiterPlugin.js +256 -254
  27. package/lib/entityDelimiter/EntityDelimiterPlugin.js.map +1 -1
  28. package/lib/index.d.ts +3 -3
  29. package/lib/index.js +9 -9
  30. package/lib/index.js.map +1 -1
  31. package/lib/paste/ContentModelPastePlugin.d.ts +42 -42
  32. package/lib/paste/ContentModelPastePlugin.js +148 -148
  33. package/lib/paste/ContentModelPastePlugin.js.map +1 -1
  34. package/lib/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
  35. package/lib/paste/Excel/processPastedContentFromExcel.js +82 -82
  36. package/lib/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  37. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  38. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js +19 -19
  39. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  40. package/lib/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  41. package/lib/paste/WacComponents/processPastedContentWacComponents.js +207 -207
  42. package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  43. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
  44. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +69 -69
  45. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  46. package/lib/paste/WordDesktop/processWordComments.d.ts +7 -7
  47. package/lib/paste/WordDesktop/processWordComments.js +21 -21
  48. package/lib/paste/WordDesktop/processWordComments.js.map +1 -1
  49. package/lib/paste/WordDesktop/processWordLists.d.ts +10 -10
  50. package/lib/paste/WordDesktop/processWordLists.js +154 -154
  51. package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
  52. package/lib/paste/pasteSourceValidations/constants.d.ts +17 -17
  53. package/lib/paste/pasteSourceValidations/constants.js +21 -21
  54. package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
  55. package/lib/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  56. package/lib/paste/pasteSourceValidations/documentContainWacElements.js +24 -24
  57. package/lib/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  58. package/lib/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  59. package/lib/paste/pasteSourceValidations/getPasteSource.js +43 -43
  60. package/lib/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  61. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  62. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js +16 -16
  63. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  64. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  65. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js +18 -18
  66. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  67. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  68. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js +14 -14
  69. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  70. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  71. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +14 -14
  72. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  73. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  74. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js +18 -18
  75. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  76. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  77. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js +18 -18
  78. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  79. package/lib/paste/utils/addParser.d.ts +5 -5
  80. package/lib/paste/utils/addParser.js +16 -16
  81. package/lib/paste/utils/addParser.js.map +1 -1
  82. package/lib/paste/utils/deprecatedColorParser.d.ts +5 -5
  83. package/lib/paste/utils/deprecatedColorParser.js +19 -19
  84. package/lib/paste/utils/deprecatedColorParser.js.map +1 -1
  85. package/lib/paste/utils/getStyles.d.ts +6 -6
  86. package/lib/paste/utils/getStyles.js +22 -22
  87. package/lib/paste/utils/getStyles.js.map +1 -1
  88. package/lib/paste/utils/linkParser.d.ts +5 -5
  89. package/lib/paste/utils/linkParser.js +27 -27
  90. package/lib/paste/utils/linkParser.js.map +1 -1
  91. package/lib/paste/utils/setProcessor.d.ts +5 -5
  92. package/lib/paste/utils/setProcessor.js +13 -13
  93. package/lib/paste/utils/setProcessor.js.map +1 -1
  94. package/lib-amd/edit/ContentModelEditPlugin.d.ts +35 -35
  95. package/lib-amd/edit/ContentModelEditPlugin.js +75 -75
  96. package/lib-amd/edit/ContentModelEditPlugin.js.map +1 -1
  97. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  98. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js +20 -20
  99. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  100. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  101. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js +89 -89
  102. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  103. package/lib-amd/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  104. package/lib-amd/edit/deleteSteps/deleteWordSelection.js +169 -169
  105. package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  106. package/lib-amd/edit/handleKeyboardEventCommon.d.ts +15 -15
  107. package/lib-amd/edit/handleKeyboardEventCommon.js +55 -55
  108. package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
  109. package/lib-amd/edit/keyboardDelete.d.ts +8 -8
  110. package/lib-amd/edit/keyboardDelete.js +63 -63
  111. package/lib-amd/edit/keyboardDelete.js.map +1 -1
  112. package/lib-amd/edit/keyboardInput.d.ts +5 -5
  113. package/lib-amd/edit/keyboardInput.js +50 -49
  114. package/lib-amd/edit/keyboardInput.js.map +1 -1
  115. package/lib-amd/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  116. package/lib-amd/edit/utils/getLeafSiblingBlock.js +75 -75
  117. package/lib-amd/edit/utils/getLeafSiblingBlock.js.map +1 -1
  118. package/lib-amd/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
  119. package/lib-amd/entityDelimiter/EntityDelimiterPlugin.js +255 -253
  120. package/lib-amd/entityDelimiter/EntityDelimiterPlugin.js.map +1 -1
  121. package/lib-amd/index.d.ts +3 -3
  122. package/lib-amd/index.js +8 -8
  123. package/lib-amd/index.js.map +1 -1
  124. package/lib-amd/paste/ContentModelPastePlugin.d.ts +42 -42
  125. package/lib-amd/paste/ContentModelPastePlugin.js +140 -140
  126. package/lib-amd/paste/ContentModelPastePlugin.js.map +1 -1
  127. package/lib-amd/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
  128. package/lib-amd/paste/Excel/processPastedContentFromExcel.js +80 -80
  129. package/lib-amd/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  130. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  131. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js +20 -20
  132. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  133. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  134. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +206 -206
  135. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  136. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
  137. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +64 -64
  138. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  139. package/lib-amd/paste/WordDesktop/processWordComments.d.ts +7 -7
  140. package/lib-amd/paste/WordDesktop/processWordComments.js +22 -22
  141. package/lib-amd/paste/WordDesktop/processWordComments.js.map +1 -1
  142. package/lib-amd/paste/WordDesktop/processWordLists.d.ts +10 -10
  143. package/lib-amd/paste/WordDesktop/processWordLists.js +153 -153
  144. package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
  145. package/lib-amd/paste/pasteSourceValidations/constants.d.ts +17 -17
  146. package/lib-amd/paste/pasteSourceValidations/constants.js +23 -23
  147. package/lib-amd/paste/pasteSourceValidations/constants.js.map +1 -1
  148. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  149. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js +26 -26
  150. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  151. package/lib-amd/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  152. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js +38 -38
  153. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  154. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  155. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js +18 -18
  156. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  157. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  158. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js +20 -20
  159. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  160. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  161. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js +16 -16
  162. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  163. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  164. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +16 -16
  165. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  166. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  167. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js +20 -20
  168. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  169. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  170. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js +20 -20
  171. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  172. package/lib-amd/paste/utils/addParser.d.ts +5 -5
  173. package/lib-amd/paste/utils/addParser.js +18 -18
  174. package/lib-amd/paste/utils/addParser.js.map +1 -1
  175. package/lib-amd/paste/utils/deprecatedColorParser.d.ts +5 -5
  176. package/lib-amd/paste/utils/deprecatedColorParser.js +20 -20
  177. package/lib-amd/paste/utils/deprecatedColorParser.js.map +1 -1
  178. package/lib-amd/paste/utils/getStyles.d.ts +6 -6
  179. package/lib-amd/paste/utils/getStyles.js +24 -24
  180. package/lib-amd/paste/utils/getStyles.js.map +1 -1
  181. package/lib-amd/paste/utils/linkParser.d.ts +5 -5
  182. package/lib-amd/paste/utils/linkParser.js +28 -28
  183. package/lib-amd/paste/utils/linkParser.js.map +1 -1
  184. package/lib-amd/paste/utils/setProcessor.d.ts +5 -5
  185. package/lib-amd/paste/utils/setProcessor.js +15 -15
  186. package/lib-amd/paste/utils/setProcessor.js.map +1 -1
  187. package/lib-mjs/edit/ContentModelEditPlugin.d.ts +35 -35
  188. package/lib-mjs/edit/ContentModelEditPlugin.js +72 -72
  189. package/lib-mjs/edit/ContentModelEditPlugin.js.map +1 -1
  190. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.d.ts +5 -5
  191. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js +15 -15
  192. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  193. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.d.ts +9 -9
  194. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js +87 -87
  195. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  196. package/lib-mjs/edit/deleteSteps/deleteWordSelection.d.ts +9 -9
  197. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js +167 -167
  198. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  199. package/lib-mjs/edit/handleKeyboardEventCommon.d.ts +15 -15
  200. package/lib-mjs/edit/handleKeyboardEventCommon.js +48 -48
  201. package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
  202. package/lib-mjs/edit/keyboardDelete.d.ts +8 -8
  203. package/lib-mjs/edit/keyboardDelete.js +63 -63
  204. package/lib-mjs/edit/keyboardDelete.js.map +1 -1
  205. package/lib-mjs/edit/keyboardInput.d.ts +5 -5
  206. package/lib-mjs/edit/keyboardInput.js +46 -45
  207. package/lib-mjs/edit/keyboardInput.js.map +1 -1
  208. package/lib-mjs/edit/utils/getLeafSiblingBlock.d.ts +23 -23
  209. package/lib-mjs/edit/utils/getLeafSiblingBlock.js +71 -71
  210. package/lib-mjs/edit/utils/getLeafSiblingBlock.js.map +1 -1
  211. package/lib-mjs/entityDelimiter/EntityDelimiterPlugin.d.ts +35 -35
  212. package/lib-mjs/entityDelimiter/EntityDelimiterPlugin.js +252 -250
  213. package/lib-mjs/entityDelimiter/EntityDelimiterPlugin.js.map +1 -1
  214. package/lib-mjs/index.d.ts +3 -3
  215. package/lib-mjs/index.js +3 -3
  216. package/lib-mjs/index.js.map +1 -1
  217. package/lib-mjs/paste/ContentModelPastePlugin.d.ts +42 -42
  218. package/lib-mjs/paste/ContentModelPastePlugin.js +145 -145
  219. package/lib-mjs/paste/ContentModelPastePlugin.js.map +1 -1
  220. package/lib-mjs/paste/Excel/processPastedContentFromExcel.d.ts +13 -13
  221. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +77 -77
  222. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  223. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.d.ts +7 -7
  224. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js +15 -15
  225. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  226. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.d.ts +9 -9
  227. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +203 -203
  228. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  229. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.d.ts +12 -12
  230. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +64 -64
  231. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  232. package/lib-mjs/paste/WordDesktop/processWordComments.d.ts +7 -7
  233. package/lib-mjs/paste/WordDesktop/processWordComments.js +17 -17
  234. package/lib-mjs/paste/WordDesktop/processWordComments.js.map +1 -1
  235. package/lib-mjs/paste/WordDesktop/processWordLists.d.ts +10 -10
  236. package/lib-mjs/paste/WordDesktop/processWordLists.js +150 -150
  237. package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
  238. package/lib-mjs/paste/pasteSourceValidations/constants.d.ts +17 -17
  239. package/lib-mjs/paste/pasteSourceValidations/constants.js +18 -18
  240. package/lib-mjs/paste/pasteSourceValidations/constants.js.map +1 -1
  241. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.d.ts +8 -8
  242. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js +20 -20
  243. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  244. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.d.ts +27 -27
  245. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js +39 -39
  246. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  247. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.d.ts +8 -8
  248. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js +12 -12
  249. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  250. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.d.ts +8 -8
  251. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js +14 -14
  252. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  253. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.d.ts +8 -8
  254. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js +10 -10
  255. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  256. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.d.ts +8 -8
  257. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js +10 -10
  258. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  259. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.d.ts +8 -8
  260. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js +14 -14
  261. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  262. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.d.ts +9 -9
  263. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js +14 -14
  264. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  265. package/lib-mjs/paste/utils/addParser.d.ts +5 -5
  266. package/lib-mjs/paste/utils/addParser.js +13 -13
  267. package/lib-mjs/paste/utils/addParser.js.map +1 -1
  268. package/lib-mjs/paste/utils/deprecatedColorParser.d.ts +5 -5
  269. package/lib-mjs/paste/utils/deprecatedColorParser.js +15 -15
  270. package/lib-mjs/paste/utils/deprecatedColorParser.js.map +1 -1
  271. package/lib-mjs/paste/utils/getStyles.d.ts +6 -6
  272. package/lib-mjs/paste/utils/getStyles.js +18 -18
  273. package/lib-mjs/paste/utils/getStyles.js.map +1 -1
  274. package/lib-mjs/paste/utils/linkParser.d.ts +5 -5
  275. package/lib-mjs/paste/utils/linkParser.js +23 -23
  276. package/lib-mjs/paste/utils/linkParser.js.map +1 -1
  277. package/lib-mjs/paste/utils/setProcessor.d.ts +5 -5
  278. package/lib-mjs/paste/utils/setProcessor.js +9 -9
  279. package/lib-mjs/paste/utils/setProcessor.js.map +1 -1
  280. 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
@@ -10,7 +10,7 @@
10
10
  "roosterjs-content-model-dom": "^0.21.2",
11
11
  "roosterjs-content-model-types": "^0.21.2"
12
12
  },
13
- "version": "0.21.2",
13
+ "version": "0.21.4",
14
14
  "main": "./lib/index.js",
15
15
  "typings": "./lib/index.d.ts",
16
16
  "module": "./lib-mjs/index.js",