roosterjs-content-model-plugins 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1 @@
1
- {"version":3,"file":"getNumberingListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/getNumberingListStyle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,IAAW,cAMV;AAND,WAAW,cAAc;IACrB,yDAAW,CAAA;IACX,+DAAc,CAAA;IACd,+DAAc,CAAA;IACd,+DAAc,CAAA;IACd,+DAAc,CAAA;AAClB,CAAC,EANU,cAAc,KAAd,cAAc,QAMxB;AAED,IAAW,SAKV;AALD,WAAW,SAAS;IAChB,uCAAO,CAAA;IACP,yCAAQ,CAAA;IACR,uDAAe,CAAA;IACf,mEAAqB,CAAA;AACzB,CAAC,EALU,SAAS,KAAT,SAAS,QAKnB;AAED,IAAM,UAAU,GAA2B;IACvC,GAAG,aAAe;IAClB,GAAG,cAAgB;IACnB,GAAG,qBAAuB;CAC7B,CAAC;AAEF,IAAM,eAAe,GAAG;IACpB,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAAC,cAAc;IAChC,iBAAiB,CAAC,2BAA2B;IAC7C,iBAAiB,CAAC,qBAAqB;CAC1C,CAAC;AACF,IAAM,eAAe,GAAG;IACpB,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAA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,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;IACtF,kIAAkI;IAClI,8DAA8D;IAC9D,IAAM,SAAS,GAAG,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpF,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,IAAM,eAAe,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAEjE,IACI,CAAC,KAAK;QACN,KAAK,GAAG,CAAC;QACT,CAAC,CAAC,iBAAiB,IAAI,eAAe,CAAC;QACvC,CAAC,iBAAiB,IAAI,eAAe,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,EACpF;QACE,OAAO,SAAS,CAAC;KACpB;IAED,IAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC;QAC7C,CAAC,CAAC,yBAAyB,CACrB,OAAO,EACP,mBAAmB,EACnB,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAClD;QACH,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,aAAa,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,iBAA0B;IAC7D,OAAO,iBAAiB,IAAI,KAAK,IAAI,iBAAiB,GAAG,CAAC,KAAK,KAAK,CAAC;AACzE,CAAC","sourcesContent":["import { getIndex } from './getIndex';\r\nimport { NumberingListType } from 'roosterjs-content-model-core';\r\n\r\nconst enum NumberingTypes {\r\n Decimal = 1,\r\n LowerAlpha = 2,\r\n UpperAlpha = 3,\r\n LowerRoman = 4,\r\n UpperRoman = 5,\r\n}\r\n\r\nconst enum Character {\r\n Dot = 1,\r\n Dash = 2,\r\n Parenthesis = 3,\r\n DoubleParenthesis = 4,\r\n}\r\n\r\nconst characters: Record<string, number> = {\r\n '.': Character.Dot,\r\n '-': Character.Dash,\r\n ')': Character.Parenthesis,\r\n};\r\n\r\nconst lowerRomanTypes = [\r\n NumberingListType.LowerRoman,\r\n NumberingListType.LowerRomanDash,\r\n NumberingListType.LowerRomanDoubleParenthesis,\r\n NumberingListType.LowerRomanParenthesis,\r\n];\r\nconst upperRomanTypes = [\r\n NumberingListType.UpperRoman,\r\n NumberingListType.UpperRomanDash,\r\n NumberingListType.UpperRomanDoubleParenthesis,\r\n NumberingListType.UpperRomanParenthesis,\r\n];\r\nconst numberingTriggers = ['1', 'a', 'A', 'I', 'i'];\r\nconst lowerRomanNumbers = ['i', 'v', 'x', 'l', 'c', 'd', 'm'];\r\nconst upperRomanNumbers = ['I', 'V', 'X', 'L', 'C', 'D', 'M'];\r\n\r\nconst identifyNumberingType = (text: string, previousListStyle?: number) => {\r\n if (!isNaN(parseInt(text))) {\r\n return NumberingTypes.Decimal;\r\n } else if (/[a-z]+/g.test(text)) {\r\n if (\r\n (previousListStyle === NumberingTypes.LowerRoman &&\r\n lowerRomanTypes.indexOf(previousListStyle) > -1 &&\r\n lowerRomanNumbers.indexOf(text[0]) > -1) ||\r\n (!previousListStyle && text === 'i')\r\n ) {\r\n return NumberingTypes.LowerRoman;\r\n } else if (\r\n previousListStyle === NumberingTypes.LowerAlpha ||\r\n (!previousListStyle && text === 'a')\r\n ) {\r\n return NumberingTypes.LowerAlpha;\r\n }\r\n } else if (/[A-Z]+/g.test(text)) {\r\n if (\r\n (previousListStyle == NumberingTypes.UpperRoman &&\r\n upperRomanTypes.indexOf(previousListStyle) > -1 &&\r\n upperRomanNumbers.indexOf(text[0]) > -1) ||\r\n (!previousListStyle && text === 'I')\r\n ) {\r\n return NumberingTypes.UpperRoman;\r\n } else if (\r\n previousListStyle == NumberingTypes.UpperAlpha ||\r\n (!previousListStyle && text === 'A')\r\n ) {\r\n return NumberingTypes.UpperAlpha;\r\n }\r\n }\r\n};\r\n\r\nconst numberingListTypes: Record<number, (char: number) => number | undefined> = {\r\n [NumberingTypes.Decimal]: char => DecimalsTypes[char] || undefined,\r\n [NumberingTypes.LowerAlpha]: char => LowerAlphaTypes[char] || undefined,\r\n [NumberingTypes.UpperAlpha]: char => UpperAlphaTypes[char] || undefined,\r\n [NumberingTypes.LowerRoman]: char => LowerRomanTypes[char] || undefined,\r\n [NumberingTypes.UpperRoman]: char => UpperRomanTypes[char] || undefined,\r\n};\r\n\r\nconst UpperRomanTypes: Record<number, number> = {\r\n [Character.Dot]: NumberingListType.UpperRoman,\r\n [Character.Dash]: NumberingListType.UpperRomanDash,\r\n [Character.Parenthesis]: NumberingListType.UpperRomanParenthesis,\r\n [Character.DoubleParenthesis]: NumberingListType.UpperRomanDoubleParenthesis,\r\n};\r\n\r\nconst LowerRomanTypes: Record<number, number> = {\r\n [Character.Dot]: NumberingListType.LowerRoman,\r\n [Character.Dash]: NumberingListType.LowerRomanDash,\r\n [Character.Parenthesis]: NumberingListType.LowerRomanParenthesis,\r\n [Character.DoubleParenthesis]: NumberingListType.LowerRomanDoubleParenthesis,\r\n};\r\n\r\nconst UpperAlphaTypes: Record<number, number> = {\r\n [Character.Dot]: NumberingListType.UpperAlpha,\r\n [Character.Dash]: NumberingListType.UpperAlphaDash,\r\n [Character.Parenthesis]: NumberingListType.UpperAlphaParenthesis,\r\n [Character.DoubleParenthesis]: NumberingListType.UpperAlphaDoubleParenthesis,\r\n};\r\n\r\nconst LowerAlphaTypes: Record<number, number> = {\r\n [Character.Dot]: NumberingListType.LowerAlpha,\r\n [Character.Dash]: NumberingListType.LowerAlphaDash,\r\n [Character.Parenthesis]: NumberingListType.LowerAlphaParenthesis,\r\n [Character.DoubleParenthesis]: NumberingListType.LowerAlphaDoubleParenthesis,\r\n};\r\n\r\nconst DecimalsTypes: Record<number, number> = {\r\n [Character.Dot]: NumberingListType.Decimal,\r\n [Character.Dash]: NumberingListType.DecimalDash,\r\n [Character.Parenthesis]: NumberingListType.DecimalParenthesis,\r\n [Character.DoubleParenthesis]: NumberingListType.DecimalDoubleParenthesis,\r\n};\r\n\r\nconst identifyNumberingListType = (\r\n numbering: string,\r\n isDoubleParenthesis: boolean,\r\n previousListStyle?: number\r\n): number | undefined => {\r\n const separatorCharacter = isDoubleParenthesis\r\n ? Character.DoubleParenthesis\r\n : characters[numbering[numbering.length - 1]];\r\n // if separator is not valid, no need to check if the number is valid.\r\n if (separatorCharacter) {\r\n const number = isDoubleParenthesis ? numbering.slice(1, -1) : numbering.slice(0, -1);\r\n const numberingType = identifyNumberingType(number, previousListStyle);\r\n return numberingType ? numberingListTypes[numberingType](separatorCharacter) : undefined;\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function getNumberingListStyle(\r\n textBeforeCursor: string,\r\n previousListIndex?: number,\r\n previousListStyle?: number\r\n): number | undefined {\r\n const trigger = textBeforeCursor.trim();\r\n const isDoubleParenthesis = trigger[0] === '(' && trigger[trigger.length - 1] === ')';\r\n //Only the staring items ['1', 'a', 'A', 'I', 'i'] must trigger a new list. All the other triggers is used to keep the list chain.\r\n //The index is always the characters before the last character\r\n const listIndex = isDoubleParenthesis ? trigger.slice(1, -1) : trigger.slice(0, -1);\r\n const index = getIndex(listIndex);\r\n const isContinuosList = numberingTriggers.indexOf(listIndex) < 0;\r\n\r\n if (\r\n !index ||\r\n index < 1 ||\r\n (!previousListIndex && isContinuosList) ||\r\n (previousListIndex && isContinuosList && !canAppendList(index, previousListIndex))\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const numberingType = isValidNumbering(listIndex)\r\n ? identifyNumberingListType(\r\n trigger,\r\n isDoubleParenthesis,\r\n isContinuosList ? previousListStyle : undefined\r\n )\r\n : undefined;\r\n return numberingType;\r\n}\r\n\r\n/**\r\n * Check if index has only numbers or only letters to avoid sequence of character such 1:1. trigger a list.\r\n * @param index\r\n * @returns\r\n */\r\nfunction isValidNumbering(index: string) {\r\n return Number(index) || /^[A-Za-z\\s]*$/.test(index);\r\n}\r\n\r\nfunction canAppendList(index?: number, previousListIndex?: number) {\r\n return previousListIndex && index && previousListIndex + 1 === index;\r\n}\r\n"]}
1
+ {"version":3,"file":"getNumberingListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/autoFormat/utils/getNumberingListStyle.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,IAAW,cAMV;AAND,WAAW,cAAc;IACrB,yDAAW,CAAA;IACX,+DAAc,CAAA;IACd,+DAAc,CAAA;IACd,+DAAc,CAAA;IACd,+DAAc,CAAA;AAClB,CAAC,EANU,cAAc,KAAd,cAAc,QAMxB;AAED,IAAW,SAKV;AALD,WAAW,SAAS;IAChB,uCAAO,CAAA;IACP,yCAAQ,CAAA;IACR,uDAAe,CAAA;IACf,mEAAqB,CAAA;AACzB,CAAC,EALU,SAAS,KAAT,SAAS,QAKnB;AAED,IAAM,UAAU,GAA2B;IACvC,GAAG,aAAe;IAClB,GAAG,cAAgB;IACnB,GAAG,qBAAuB;CAC7B,CAAC;AAEF,IAAM,eAAe,GAAG;IACpB,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAAC,cAAc;IAChC,iBAAiB,CAAC,2BAA2B;IAC7C,iBAAiB,CAAC,qBAAqB;CAC1C,CAAC;AACF,IAAM,eAAe,GAAG;IACpB,iBAAiB,CAAC,UAAU;IAC5B,iBAAiB,CAAC,cAAc;IAChC,iBAAiB,CAAC,2BAA2B;IAC7C,iBAAiB,CAAC,qBAAqB;CAC1C,CAAC;AACF,IAAM,iBAAi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A8D;IAC9D,IAAM,SAAS,GAAG,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpF,IAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IAClC,IAAM,eAAe,GAAG,iBAAiB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAEjE,IACI,CAAC,KAAK;QACN,KAAK,GAAG,CAAC;QACT,CAAC,CAAC,iBAAiB,IAAI,eAAe,CAAC;QACvC,CAAC,iBAAiB,IAAI,eAAe,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,EACpF;QACE,OAAO,SAAS,CAAC;KACpB;IAED,IAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC;QAC7C,CAAC,CAAC,yBAAyB,CACrB,OAAO,EACP,mBAAmB,EACnB,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAClD;QACH,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO,aAAa,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,iBAA0B;IAC7D,OAAO,iBAAiB,IAAI,KAAK,IAAI,iBAAiB,GAAG,CAAC,KAAK,KAAK,CAAC;AACzE,CAAC","sourcesContent":["import { getIndex } from './getIndex';\nimport { NumberingListType } from 'roosterjs-content-model-core';\n\nconst enum NumberingTypes {\n Decimal = 1,\n LowerAlpha = 2,\n UpperAlpha = 3,\n LowerRoman = 4,\n UpperRoman = 5,\n}\n\nconst enum Character {\n Dot = 1,\n Dash = 2,\n Parenthesis = 3,\n DoubleParenthesis = 4,\n}\n\nconst characters: Record<string, number> = {\n '.': Character.Dot,\n '-': Character.Dash,\n ')': Character.Parenthesis,\n};\n\nconst lowerRomanTypes = [\n NumberingListType.LowerRoman,\n NumberingListType.LowerRomanDash,\n NumberingListType.LowerRomanDoubleParenthesis,\n NumberingListType.LowerRomanParenthesis,\n];\nconst upperRomanTypes = [\n NumberingListType.UpperRoman,\n NumberingListType.UpperRomanDash,\n NumberingListType.UpperRomanDoubleParenthesis,\n NumberingListType.UpperRomanParenthesis,\n];\nconst numberingTriggers = ['1', 'a', 'A', 'I', 'i'];\nconst lowerRomanNumbers = ['i', 'v', 'x', 'l', 'c', 'd', 'm'];\nconst upperRomanNumbers = ['I', 'V', 'X', 'L', 'C', 'D', 'M'];\n\nconst identifyNumberingType = (text: string, previousListStyle?: number) => {\n if (!isNaN(parseInt(text))) {\n return NumberingTypes.Decimal;\n } else if (/[a-z]+/g.test(text)) {\n if (\n (previousListStyle === NumberingTypes.LowerRoman &&\n lowerRomanTypes.indexOf(previousListStyle) > -1 &&\n lowerRomanNumbers.indexOf(text[0]) > -1) ||\n (!previousListStyle && text === 'i')\n ) {\n return NumberingTypes.LowerRoman;\n } else if (\n previousListStyle === NumberingTypes.LowerAlpha ||\n (!previousListStyle && text === 'a')\n ) {\n return NumberingTypes.LowerAlpha;\n }\n } else if (/[A-Z]+/g.test(text)) {\n if (\n (previousListStyle == NumberingTypes.UpperRoman &&\n upperRomanTypes.indexOf(previousListStyle) > -1 &&\n upperRomanNumbers.indexOf(text[0]) > -1) ||\n (!previousListStyle && text === 'I')\n ) {\n return NumberingTypes.UpperRoman;\n } else if (\n previousListStyle == NumberingTypes.UpperAlpha ||\n (!previousListStyle && text === 'A')\n ) {\n return NumberingTypes.UpperAlpha;\n }\n }\n};\n\nconst numberingListTypes: Record<number, (char: number) => number | undefined> = {\n [NumberingTypes.Decimal]: char => DecimalsTypes[char] || undefined,\n [NumberingTypes.LowerAlpha]: char => LowerAlphaTypes[char] || undefined,\n [NumberingTypes.UpperAlpha]: char => UpperAlphaTypes[char] || undefined,\n [NumberingTypes.LowerRoman]: char => LowerRomanTypes[char] || undefined,\n [NumberingTypes.UpperRoman]: char => UpperRomanTypes[char] || undefined,\n};\n\nconst UpperRomanTypes: Record<number, number> = {\n [Character.Dot]: NumberingListType.UpperRoman,\n [Character.Dash]: NumberingListType.UpperRomanDash,\n [Character.Parenthesis]: NumberingListType.UpperRomanParenthesis,\n [Character.DoubleParenthesis]: NumberingListType.UpperRomanDoubleParenthesis,\n};\n\nconst LowerRomanTypes: Record<number, number> = {\n [Character.Dot]: NumberingListType.LowerRoman,\n [Character.Dash]: NumberingListType.LowerRomanDash,\n [Character.Parenthesis]: NumberingListType.LowerRomanParenthesis,\n [Character.DoubleParenthesis]: NumberingListType.LowerRomanDoubleParenthesis,\n};\n\nconst UpperAlphaTypes: Record<number, number> = {\n [Character.Dot]: NumberingListType.UpperAlpha,\n [Character.Dash]: NumberingListType.UpperAlphaDash,\n [Character.Parenthesis]: NumberingListType.UpperAlphaParenthesis,\n [Character.DoubleParenthesis]: NumberingListType.UpperAlphaDoubleParenthesis,\n};\n\nconst LowerAlphaTypes: Record<number, number> = {\n [Character.Dot]: NumberingListType.LowerAlpha,\n [Character.Dash]: NumberingListType.LowerAlphaDash,\n [Character.Parenthesis]: NumberingListType.LowerAlphaParenthesis,\n [Character.DoubleParenthesis]: NumberingListType.LowerAlphaDoubleParenthesis,\n};\n\nconst DecimalsTypes: Record<number, number> = {\n [Character.Dot]: NumberingListType.Decimal,\n [Character.Dash]: NumberingListType.DecimalDash,\n [Character.Parenthesis]: NumberingListType.DecimalParenthesis,\n [Character.DoubleParenthesis]: NumberingListType.DecimalDoubleParenthesis,\n};\n\nconst identifyNumberingListType = (\n numbering: string,\n isDoubleParenthesis: boolean,\n previousListStyle?: number\n): number | undefined => {\n const separatorCharacter = isDoubleParenthesis\n ? Character.DoubleParenthesis\n : characters[numbering[numbering.length - 1]];\n // if separator is not valid, no need to check if the number is valid.\n if (separatorCharacter) {\n const number = isDoubleParenthesis ? numbering.slice(1, -1) : numbering.slice(0, -1);\n const numberingType = identifyNumberingType(number, previousListStyle);\n return numberingType ? numberingListTypes[numberingType](separatorCharacter) : undefined;\n }\n return undefined;\n};\n\n/**\n * @internal\n */\nexport function getNumberingListStyle(\n textBeforeCursor: string,\n previousListIndex?: number,\n previousListStyle?: number\n): number | undefined {\n const trigger = textBeforeCursor.trim();\n const isDoubleParenthesis = trigger[0] === '(' && trigger[trigger.length - 1] === ')';\n //Only the staring items ['1', 'a', 'A', 'I', 'i'] must trigger a new list. All the other triggers is used to keep the list chain.\n //The index is always the characters before the last character\n const listIndex = isDoubleParenthesis ? trigger.slice(1, -1) : trigger.slice(0, -1);\n const index = getIndex(listIndex);\n const isContinuosList = numberingTriggers.indexOf(listIndex) < 0;\n\n if (\n !index ||\n index < 1 ||\n (!previousListIndex && isContinuosList) ||\n (previousListIndex && isContinuosList && !canAppendList(index, previousListIndex))\n ) {\n return undefined;\n }\n\n const numberingType = isValidNumbering(listIndex)\n ? identifyNumberingListType(\n trigger,\n isDoubleParenthesis,\n isContinuosList ? previousListStyle : undefined\n )\n : undefined;\n return numberingType;\n}\n\n/**\n * Check if index has only numbers or only letters to avoid sequence of character such 1:1. trigger a list.\n * @param index\n * @returns\n */\nfunction isValidNumbering(index: string) {\n return Number(index) || /^[A-Za-z\\s]*$/.test(index);\n}\n\nfunction canAppendList(index?: number, previousListIndex?: number) {\n return previousListIndex && index && previousListIndex + 1 === index;\n}\n"]}
@@ -1,39 +1,39 @@
1
- import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
2
- /**
3
- * ContentModel edit plugins helps editor to do editing operation on top of content model.
4
- * This includes:
5
- * 1. Delete Key
6
- * 2. Backspace Key
7
- * 3. Tab Key
8
- */
9
- export declare class EditPlugin implements EditorPlugin {
10
- private editor;
11
- private disposer;
12
- private shouldHandleNextInputEvent;
13
- /**
14
- * Get name of this plugin
15
- */
16
- getName(): string;
17
- /**
18
- * The first method that editor will call to a plugin when editor is initializing.
19
- * It will pass in the editor instance, plugin should take this chance to save the
20
- * editor reference so that it can call to any editor method or format API later.
21
- * @param editor The editor object
22
- */
23
- initialize(editor: IStandaloneEditor): void;
24
- /**
25
- * The last method that editor will call to a plugin before it is disposed.
26
- * Plugin can take this chance to clear the reference to editor. After this method is
27
- * called, plugin should not call to any editor method since it will result in error.
28
- */
29
- dispose(): void;
30
- /**
31
- * Core method for a plugin. Once an event happens in editor, editor will call this
32
- * method of each plugin to handle the event as long as the event is not handled
33
- * exclusively by another plugin.
34
- * @param event The event to handle:
35
- */
36
- onPluginEvent(event: PluginEvent): void;
37
- private handleKeyDownEvent;
38
- private handleBeforeInputEvent;
39
- }
1
+ import type { EditorPlugin, IStandaloneEditor, PluginEvent } from 'roosterjs-content-model-types';
2
+ /**
3
+ * ContentModel edit plugins helps editor to do editing operation on top of content model.
4
+ * This includes:
5
+ * 1. Delete Key
6
+ * 2. Backspace Key
7
+ * 3. Tab Key
8
+ */
9
+ export declare class EditPlugin implements EditorPlugin {
10
+ private editor;
11
+ private disposer;
12
+ private shouldHandleNextInputEvent;
13
+ /**
14
+ * Get name of this plugin
15
+ */
16
+ getName(): string;
17
+ /**
18
+ * The first method that editor will call to a plugin when editor is initializing.
19
+ * It will pass in the editor instance, plugin should take this chance to save the
20
+ * editor reference so that it can call to any editor method or format API later.
21
+ * @param editor The editor object
22
+ */
23
+ initialize(editor: IStandaloneEditor): void;
24
+ /**
25
+ * The last method that editor will call to a plugin before it is disposed.
26
+ * Plugin can take this chance to clear the reference to editor. After this method is
27
+ * called, plugin should not call to any editor method since it will result in error.
28
+ */
29
+ dispose(): void;
30
+ /**
31
+ * Core method for a plugin. Once an event happens in editor, editor will call this
32
+ * method of each plugin to handle the event as long as the event is not handled
33
+ * exclusively by another plugin.
34
+ * @param event The event to handle:
35
+ */
36
+ onPluginEvent(event: PluginEvent): void;
37
+ private handleKeyDownEvent;
38
+ private handleBeforeInputEvent;
39
+ }
@@ -1,126 +1,126 @@
1
- import { keyboardDelete } from './keyboardDelete';
2
- import { keyboardInput } from './keyboardInput';
3
- import { keyboardTab } from './keyboardTab';
4
- var BACKSPACE_KEY = 8;
5
- var DELETE_KEY = 46;
6
- /**
7
- * ContentModel edit plugins helps editor to do editing operation on top of content model.
8
- * This includes:
9
- * 1. Delete Key
10
- * 2. Backspace Key
11
- * 3. Tab Key
12
- */
13
- var EditPlugin = /** @class */ (function () {
14
- function EditPlugin() {
15
- this.editor = null;
16
- this.disposer = null;
17
- this.shouldHandleNextInputEvent = false;
18
- }
19
- /**
20
- * Get name of this plugin
21
- */
22
- EditPlugin.prototype.getName = function () {
23
- return 'Edit';
24
- };
25
- /**
26
- * The first method that editor will call to a plugin when editor is initializing.
27
- * It will pass in the editor instance, plugin should take this chance to save the
28
- * editor reference so that it can call to any editor method or format API later.
29
- * @param editor The editor object
30
- */
31
- EditPlugin.prototype.initialize = function (editor) {
32
- var _this = this;
33
- this.editor = editor;
34
- if (editor.getEnvironment().isAndroid) {
35
- this.disposer = this.editor.attachDomEvent({
36
- beforeinput: {
37
- beforeDispatch: function (e) { return _this.handleBeforeInputEvent(editor, e); },
38
- },
39
- });
40
- }
41
- };
42
- /**
43
- * The last method that editor will call to a plugin before it is disposed.
44
- * Plugin can take this chance to clear the reference to editor. After this method is
45
- * called, plugin should not call to any editor method since it will result in error.
46
- */
47
- EditPlugin.prototype.dispose = function () {
48
- var _a;
49
- this.editor = null;
50
- (_a = this.disposer) === null || _a === void 0 ? void 0 : _a.call(this);
51
- this.disposer = null;
52
- };
53
- /**
54
- * Core method for a plugin. Once an event happens in editor, editor will call this
55
- * method of each plugin to handle the event as long as the event is not handled
56
- * exclusively by another plugin.
57
- * @param event The event to handle:
58
- */
59
- EditPlugin.prototype.onPluginEvent = function (event) {
60
- if (this.editor) {
61
- switch (event.eventType) {
62
- case 'keyDown':
63
- this.handleKeyDownEvent(this.editor, event);
64
- break;
65
- }
66
- }
67
- };
68
- EditPlugin.prototype.handleKeyDownEvent = function (editor, event) {
69
- var rawEvent = event.rawEvent;
70
- if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
71
- switch (rawEvent.key) {
72
- case 'Backspace':
73
- case 'Delete':
74
- // Use our API to handle BACKSPACE/DELETE key.
75
- // No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache
76
- keyboardDelete(editor, rawEvent);
77
- break;
78
- case 'Tab':
79
- keyboardTab(editor, rawEvent);
80
- break;
81
- case 'Unidentified':
82
- if (editor.getEnvironment().isAndroid) {
83
- this.shouldHandleNextInputEvent = true;
84
- }
85
- break;
86
- case 'Enter':
87
- default:
88
- keyboardInput(editor, rawEvent);
89
- break;
90
- }
91
- }
92
- };
93
- EditPlugin.prototype.handleBeforeInputEvent = function (editor, rawEvent) {
94
- // Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key
95
- // Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic
96
- if (!this.shouldHandleNextInputEvent ||
97
- !(rawEvent instanceof InputEvent) ||
98
- rawEvent.defaultPrevented) {
99
- return;
100
- }
101
- this.shouldHandleNextInputEvent = false;
102
- var handled = false;
103
- switch (rawEvent.inputType) {
104
- case 'deleteContentBackward':
105
- handled = keyboardDelete(editor, new KeyboardEvent('keydown', {
106
- key: 'Backspace',
107
- keyCode: BACKSPACE_KEY,
108
- which: BACKSPACE_KEY,
109
- }));
110
- break;
111
- case 'deleteContentForward':
112
- handled = keyboardDelete(editor, new KeyboardEvent('keydown', {
113
- key: 'Delete',
114
- keyCode: DELETE_KEY,
115
- which: DELETE_KEY,
116
- }));
117
- break;
118
- }
119
- if (handled) {
120
- rawEvent.preventDefault();
121
- }
122
- };
123
- return EditPlugin;
124
- }());
125
- export { EditPlugin };
1
+ import { keyboardDelete } from './keyboardDelete';
2
+ import { keyboardInput } from './keyboardInput';
3
+ import { keyboardTab } from './keyboardTab';
4
+ var BACKSPACE_KEY = 8;
5
+ var DELETE_KEY = 46;
6
+ /**
7
+ * ContentModel edit plugins helps editor to do editing operation on top of content model.
8
+ * This includes:
9
+ * 1. Delete Key
10
+ * 2. Backspace Key
11
+ * 3. Tab Key
12
+ */
13
+ var EditPlugin = /** @class */ (function () {
14
+ function EditPlugin() {
15
+ this.editor = null;
16
+ this.disposer = null;
17
+ this.shouldHandleNextInputEvent = false;
18
+ }
19
+ /**
20
+ * Get name of this plugin
21
+ */
22
+ EditPlugin.prototype.getName = function () {
23
+ return 'Edit';
24
+ };
25
+ /**
26
+ * The first method that editor will call to a plugin when editor is initializing.
27
+ * It will pass in the editor instance, plugin should take this chance to save the
28
+ * editor reference so that it can call to any editor method or format API later.
29
+ * @param editor The editor object
30
+ */
31
+ EditPlugin.prototype.initialize = function (editor) {
32
+ var _this = this;
33
+ this.editor = editor;
34
+ if (editor.getEnvironment().isAndroid) {
35
+ this.disposer = this.editor.attachDomEvent({
36
+ beforeinput: {
37
+ beforeDispatch: function (e) { return _this.handleBeforeInputEvent(editor, e); },
38
+ },
39
+ });
40
+ }
41
+ };
42
+ /**
43
+ * The last method that editor will call to a plugin before it is disposed.
44
+ * Plugin can take this chance to clear the reference to editor. After this method is
45
+ * called, plugin should not call to any editor method since it will result in error.
46
+ */
47
+ EditPlugin.prototype.dispose = function () {
48
+ var _a;
49
+ this.editor = null;
50
+ (_a = this.disposer) === null || _a === void 0 ? void 0 : _a.call(this);
51
+ this.disposer = null;
52
+ };
53
+ /**
54
+ * Core method for a plugin. Once an event happens in editor, editor will call this
55
+ * method of each plugin to handle the event as long as the event is not handled
56
+ * exclusively by another plugin.
57
+ * @param event The event to handle:
58
+ */
59
+ EditPlugin.prototype.onPluginEvent = function (event) {
60
+ if (this.editor) {
61
+ switch (event.eventType) {
62
+ case 'keyDown':
63
+ this.handleKeyDownEvent(this.editor, event);
64
+ break;
65
+ }
66
+ }
67
+ };
68
+ EditPlugin.prototype.handleKeyDownEvent = function (editor, event) {
69
+ var rawEvent = event.rawEvent;
70
+ if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {
71
+ switch (rawEvent.key) {
72
+ case 'Backspace':
73
+ case 'Delete':
74
+ // Use our API to handle BACKSPACE/DELETE key.
75
+ // No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache
76
+ keyboardDelete(editor, rawEvent);
77
+ break;
78
+ case 'Tab':
79
+ keyboardTab(editor, rawEvent);
80
+ break;
81
+ case 'Unidentified':
82
+ if (editor.getEnvironment().isAndroid) {
83
+ this.shouldHandleNextInputEvent = true;
84
+ }
85
+ break;
86
+ case 'Enter':
87
+ default:
88
+ keyboardInput(editor, rawEvent);
89
+ break;
90
+ }
91
+ }
92
+ };
93
+ EditPlugin.prototype.handleBeforeInputEvent = function (editor, rawEvent) {
94
+ // Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key
95
+ // Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic
96
+ if (!this.shouldHandleNextInputEvent ||
97
+ !(rawEvent instanceof InputEvent) ||
98
+ rawEvent.defaultPrevented) {
99
+ return;
100
+ }
101
+ this.shouldHandleNextInputEvent = false;
102
+ var handled = false;
103
+ switch (rawEvent.inputType) {
104
+ case 'deleteContentBackward':
105
+ handled = keyboardDelete(editor, new KeyboardEvent('keydown', {
106
+ key: 'Backspace',
107
+ keyCode: BACKSPACE_KEY,
108
+ which: BACKSPACE_KEY,
109
+ }));
110
+ break;
111
+ case 'deleteContentForward':
112
+ handled = keyboardDelete(editor, new KeyboardEvent('keydown', {
113
+ key: 'Delete',
114
+ keyCode: DELETE_KEY,
115
+ which: DELETE_KEY,
116
+ }));
117
+ break;
118
+ }
119
+ if (handled) {
120
+ rawEvent.preventDefault();
121
+ }
122
+ };
123
+ return EditPlugin;
124
+ }());
125
+ export { EditPlugin };
126
126
  //# sourceMappingURL=EditPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/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AE,aAAa;oBACtB,KAAK,EAAE,aAAa;iBACvB,CAAC,CACL,CAAC;gBACF,MAAM;YACV,KAAK,sBAAsB;gBACvB,OAAO,GAAG,cAAc,CACpB,MAAM,EACN,IAAI,aAAa,CAAC,SAAS,EAAE;oBACzB,GAAG,EAAE,QAAQ;oBACb,OAAO,EAAE,UAAU;oBACnB,KAAK,EAAE,UAAU;iBACpB,CAAC,CACL,CAAC;gBACF,MAAM;SACb;QAED,IAAI,OAAO,EAAE;YACT,QAAQ,CAAC,cAAc,EAAE,CAAC;SAC7B;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AA7HD,IA6HC","sourcesContent":["import { keyboardDelete } from './keyboardDelete';\r\nimport { keyboardInput } from './keyboardInput';\r\nimport { keyboardTab } from './keyboardTab';\r\nimport type {\r\n EditorPlugin,\r\n IStandaloneEditor,\r\n KeyDownEvent,\r\n PluginEvent,\r\n} from 'roosterjs-content-model-types';\r\n\r\nconst BACKSPACE_KEY = 8;\r\nconst DELETE_KEY = 46;\r\n\r\n/**\r\n * ContentModel edit plugins helps editor to do editing operation on top of content model.\r\n * This includes:\r\n * 1. Delete Key\r\n * 2. Backspace Key\r\n * 3. Tab Key\r\n */\r\nexport class EditPlugin implements EditorPlugin {\r\n private editor: IStandaloneEditor | null = null;\r\n private disposer: (() => void) | null = null;\r\n private shouldHandleNextInputEvent = false;\r\n\r\n /**\r\n * Get name of this plugin\r\n */\r\n getName() {\r\n return 'Edit';\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 if (editor.getEnvironment().isAndroid) {\r\n this.disposer = this.editor.attachDomEvent({\r\n beforeinput: {\r\n beforeDispatch: e => this.handleBeforeInputEvent(editor, e),\r\n },\r\n });\r\n }\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 this.disposer?.();\r\n this.disposer = 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) {\r\n switch (event.eventType) {\r\n case 'keyDown':\r\n this.handleKeyDownEvent(this.editor, event);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private handleKeyDownEvent(editor: IStandaloneEditor, event: KeyDownEvent) {\r\n const rawEvent = event.rawEvent;\r\n\r\n if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {\r\n switch (rawEvent.key) {\r\n case 'Backspace':\r\n case 'Delete':\r\n // Use our API to handle BACKSPACE/DELETE key.\r\n // No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache\r\n keyboardDelete(editor, rawEvent);\r\n break;\r\n\r\n case 'Tab':\r\n keyboardTab(editor, rawEvent);\r\n break;\r\n case 'Unidentified':\r\n if (editor.getEnvironment().isAndroid) {\r\n this.shouldHandleNextInputEvent = true;\r\n }\r\n break;\r\n\r\n case 'Enter':\r\n default:\r\n keyboardInput(editor, rawEvent);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private handleBeforeInputEvent(editor: IStandaloneEditor, rawEvent: Event) {\r\n // Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key\r\n // Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic\r\n if (\r\n !this.shouldHandleNextInputEvent ||\r\n !(rawEvent instanceof InputEvent) ||\r\n rawEvent.defaultPrevented\r\n ) {\r\n return;\r\n }\r\n this.shouldHandleNextInputEvent = false;\r\n\r\n let handled = false;\r\n switch (rawEvent.inputType) {\r\n case 'deleteContentBackward':\r\n handled = keyboardDelete(\r\n editor,\r\n new KeyboardEvent('keydown', {\r\n key: 'Backspace',\r\n keyCode: BACKSPACE_KEY,\r\n which: BACKSPACE_KEY,\r\n })\r\n );\r\n break;\r\n case 'deleteContentForward':\r\n handled = keyboardDelete(\r\n editor,\r\n new KeyboardEvent('keydown', {\r\n key: 'Delete',\r\n keyCode: DELETE_KEY,\r\n which: DELETE_KEY,\r\n })\r\n );\r\n break;\r\n }\r\n\r\n if (handled) {\r\n rawEvent.preventDefault();\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"EditPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C,IAAM,aAAa,GAAG,CAAC,CAAC;AACxB,IAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;;;;;GAMG;AACH;IAAA;QACY,WAAM,GAA6B,IAAI,CAAC;QACxC,aAAQ,GAAwB,IAAI,CAAC;QACrC,+BAA0B,GAAG,KAAK,CAAC;IA0H/C,CAAC;IAxHG;;OAEG;IACH,4BAAO,GAAP;QACI,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACH,+BAAU,GAAV,UAAW,MAAyB;QAApC,iBASC;QARG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE;YACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;gBACvC,WAAW,EAAE;oBACT,cAAc,EAAE,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAtC,CAAsC;iBAC9D;aACJ,CAAC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;QACvG,IACI,CAAC,IAAI,CAAC,0BAA0B;YAChC,CAAC,CAAC,QAAQ,YAAY,UAAU,CAAC;YACjC,QAAQ,CAAC,gBAAgB,EAC3B;YACE,OAAO;SACV;QACD,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC;QAExC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,QAAQ,QAAQ,CAAC,SAAS,EAAE;YACxB,KAAK,uBAAuB;gBACxB,OAAO,GAAG,cAAc,CACpB,MAAM,EACN,IAAI,aAAa,CAAC,SAAS,EAAE;oBACzB,GAAG,EAAE,WAAW;oBAChB,OAAO,EAAE,aAAa;oBACtB,KAAK,EAAE,aAAa;iBACvB,CAAC,CACL,CAAC;gBACF,MAAM;YACV,KAAK,sBAAsB;gBACvB,OAAO,GAAG,cAAc,CACpB,MAAM,EACN,IAAI,aAAa,CAAC,SAAS,EAAE;oBACzB,GAAG,EAAE,QAAQ;oBACb,OAAO,EAAE,UAAU;oBACnB,KAAK,EAAE,UAAU;iBACpB,CAAC,CACL,CAAC;gBACF,MAAM;SACb;QAED,IAAI,OAAO,EAAE;YACT,QAAQ,CAAC,cAAc,EAAE,CAAC;SAC7B;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AA7HD,IA6HC","sourcesContent":["import { keyboardDelete } from './keyboardDelete';\nimport { keyboardInput } from './keyboardInput';\nimport { keyboardTab } from './keyboardTab';\nimport type {\n EditorPlugin,\n IStandaloneEditor,\n KeyDownEvent,\n PluginEvent,\n} from 'roosterjs-content-model-types';\n\nconst BACKSPACE_KEY = 8;\nconst DELETE_KEY = 46;\n\n/**\n * ContentModel edit plugins helps editor to do editing operation on top of content model.\n * This includes:\n * 1. Delete Key\n * 2. Backspace Key\n * 3. Tab Key\n */\nexport class EditPlugin implements EditorPlugin {\n private editor: IStandaloneEditor | null = null;\n private disposer: (() => void) | null = null;\n private shouldHandleNextInputEvent = false;\n\n /**\n * Get name of this plugin\n */\n getName() {\n return 'Edit';\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 if (editor.getEnvironment().isAndroid) {\n this.disposer = this.editor.attachDomEvent({\n beforeinput: {\n beforeDispatch: e => this.handleBeforeInputEvent(editor, e),\n },\n });\n }\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 this.disposer?.();\n this.disposer = 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) {\n switch (event.eventType) {\n case 'keyDown':\n this.handleKeyDownEvent(this.editor, event);\n break;\n }\n }\n }\n\n private handleKeyDownEvent(editor: IStandaloneEditor, event: KeyDownEvent) {\n const rawEvent = event.rawEvent;\n\n if (!rawEvent.defaultPrevented && !event.handledByEditFeature) {\n switch (rawEvent.key) {\n case 'Backspace':\n case 'Delete':\n // Use our API to handle BACKSPACE/DELETE key.\n // No need to clear cache here since if we rely on browser's behavior, there will be Input event and its handler will reconcile cache\n keyboardDelete(editor, rawEvent);\n break;\n\n case 'Tab':\n keyboardTab(editor, rawEvent);\n break;\n case 'Unidentified':\n if (editor.getEnvironment().isAndroid) {\n this.shouldHandleNextInputEvent = true;\n }\n break;\n\n case 'Enter':\n default:\n keyboardInput(editor, rawEvent);\n break;\n }\n }\n }\n\n private handleBeforeInputEvent(editor: IStandaloneEditor, rawEvent: Event) {\n // Some Android IMEs doesn't fire correct keydown event for BACKSPACE/DELETE key\n // Here we translate input event to BACKSPACE/DELETE keydown event to be compatible with existing logic\n if (\n !this.shouldHandleNextInputEvent ||\n !(rawEvent instanceof InputEvent) ||\n rawEvent.defaultPrevented\n ) {\n return;\n }\n this.shouldHandleNextInputEvent = false;\n\n let handled = false;\n switch (rawEvent.inputType) {\n case 'deleteContentBackward':\n handled = keyboardDelete(\n editor,\n new KeyboardEvent('keydown', {\n key: 'Backspace',\n keyCode: BACKSPACE_KEY,\n which: BACKSPACE_KEY,\n })\n );\n break;\n case 'deleteContentForward':\n handled = keyboardDelete(\n editor,\n new KeyboardEvent('keydown', {\n key: 'Delete',\n keyCode: DELETE_KEY,\n which: DELETE_KEY,\n })\n );\n break;\n }\n\n if (handled) {\n rawEvent.preventDefault();\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- */
5
- export declare const deleteAllSegmentBefore: DeleteSelectionStep;
1
+ import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const deleteAllSegmentBefore: DeleteSelectionStep;
@@ -1,19 +1,19 @@
1
- import { deleteSegment } from 'roosterjs-content-model-core';
2
- /**
3
- * @internal
4
- */
5
- export var deleteAllSegmentBefore = function (context) {
6
- if (context.deleteResult != 'notDeleted') {
7
- return;
8
- }
9
- var _a = context.insertPoint, paragraph = _a.paragraph, marker = _a.marker;
10
- var index = paragraph.segments.indexOf(marker);
11
- for (var i = index - 1; i >= 0; i--) {
12
- var segment = paragraph.segments[i];
13
- segment.isSelected = true;
14
- if (deleteSegment(paragraph, segment, context.formatContext)) {
15
- context.deleteResult = 'range';
16
- }
17
- }
18
- };
1
+ import { deleteSegment } from 'roosterjs-content-model-core';
2
+ /**
3
+ * @internal
4
+ */
5
+ export var deleteAllSegmentBefore = function (context) {
6
+ if (context.deleteResult != 'notDeleted') {
7
+ return;
8
+ }
9
+ var _a = context.insertPoint, paragraph = _a.paragraph, marker = _a.marker;
10
+ var index = paragraph.segments.indexOf(marker);
11
+ for (var i = index - 1; i >= 0; i--) {
12
+ var segment = paragraph.segments[i];
13
+ segment.isSelected = true;
14
+ if (deleteSegment(paragraph, segment, context.formatContext)) {
15
+ context.deleteResult = 'range';
16
+ }
17
+ }
18
+ };
19
19
  //# sourceMappingURL=deleteAllSegmentBefore.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deleteAllSegmentBefore.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteAllSegmentBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D;;GAEG;AACH,MAAM,CAAC,IAAM,sBAAsB,GAAwB,UAAA,OAAO;IAC9D,IAAI,OAAO,CAAC,YAAY,IAAI,YAAY,EAAE;QACtC,OAAO;KACV;IAEK,IAAA,KAAwB,OAAO,CAAC,WAAW,EAAzC,SAAS,eAAA,EAAE,MAAM,YAAwB,CAAC;IAClD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,IAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;QAE1B,IAAI,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE;YAC1D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;KACJ;AACL,CAAC,CAAC","sourcesContent":["import { deleteSegment } from 'roosterjs-content-model-core';\r\nimport type { DeleteSelectionStep } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const deleteAllSegmentBefore: DeleteSelectionStep = context => {\r\n if (context.deleteResult != 'notDeleted') {\r\n return;\r\n }\r\n\r\n const { paragraph, marker } = context.insertPoint;\r\n const index = paragraph.segments.indexOf(marker);\r\n\r\n for (let i = index - 1; i >= 0; i--) {\r\n const segment = paragraph.segments[i];\r\n\r\n segment.isSelected = true;\r\n\r\n if (deleteSegment(paragraph, segment, context.formatContext)) {\r\n context.deleteResult = 'range';\r\n }\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"deleteAllSegmentBefore.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteAllSegmentBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D;;GAEG;AACH,MAAM,CAAC,IAAM,sBAAsB,GAAwB,UAAA,OAAO;IAC9D,IAAI,OAAO,CAAC,YAAY,IAAI,YAAY,EAAE;QACtC,OAAO;KACV;IAEK,IAAA,KAAwB,OAAO,CAAC,WAAW,EAAzC,SAAS,eAAA,EAAE,MAAM,YAAwB,CAAC;IAClD,IAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,IAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;QAE1B,IAAI,aAAa,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE;YAC1D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;KACJ;AACL,CAAC,CAAC","sourcesContent":["import { deleteSegment } from 'roosterjs-content-model-core';\nimport type { DeleteSelectionStep } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const deleteAllSegmentBefore: DeleteSelectionStep = context => {\n if (context.deleteResult != 'notDeleted') {\n return;\n }\n\n const { paragraph, marker } = context.insertPoint;\n const index = paragraph.segments.indexOf(marker);\n\n for (let i = index - 1; i >= 0; i--) {\n const segment = paragraph.segments[i];\n\n segment.isSelected = true;\n\n if (deleteSegment(paragraph, segment, context.formatContext)) {\n context.deleteResult = 'range';\n }\n }\n};\n"]}
@@ -1,9 +1,9 @@
1
- import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal if we didn't delete anything, and we want to delete forward, now perform it
4
- */
5
- export declare const forwardDeleteCollapsedSelection: DeleteSelectionStep;
6
- /**
7
- * @internal if we didn't delete anything, and we want to delete backward, now perform it
8
- */
9
- export declare const backwardDeleteCollapsedSelection: DeleteSelectionStep;
1
+ import type { DeleteSelectionStep } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal if we didn't delete anything, and we want to delete forward, now perform it
4
+ */
5
+ export declare const forwardDeleteCollapsedSelection: DeleteSelectionStep;
6
+ /**
7
+ * @internal if we didn't delete anything, and we want to delete backward, now perform it
8
+ */
9
+ export declare const backwardDeleteCollapsedSelection: DeleteSelectionStep;