roosterjs-content-model-plugins 0.26.4 → 0.28.0

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 (479) hide show
  1. package/lib/autoFormat/AutoFormatPlugin.d.ts +11 -2
  2. package/lib/autoFormat/AutoFormatPlugin.js +24 -4
  3. package/lib/autoFormat/AutoFormatPlugin.js.map +1 -1
  4. package/lib/autoFormat/link/createLink.d.ts +5 -0
  5. package/lib/autoFormat/link/createLink.js +26 -0
  6. package/lib/autoFormat/link/createLink.js.map +1 -0
  7. package/lib/autoFormat/link/createLinkAfterSpace.d.ts +5 -0
  8. package/lib/autoFormat/link/createLinkAfterSpace.js +39 -0
  9. package/lib/autoFormat/link/createLinkAfterSpace.js.map +1 -0
  10. package/lib/autoFormat/link/getLinkSegment.d.ts +5 -0
  11. package/lib/autoFormat/link/getLinkSegment.js +27 -0
  12. package/lib/autoFormat/link/getLinkSegment.js.map +1 -0
  13. package/lib/autoFormat/link/unlink.d.ts +5 -0
  14. package/lib/autoFormat/link/unlink.js +20 -0
  15. package/lib/autoFormat/link/unlink.js.map +1 -0
  16. package/lib/autoFormat/list/convertAlphaToDecimals.js.map +1 -0
  17. package/lib/autoFormat/list/getIndex.js.map +1 -0
  18. package/lib/autoFormat/{utils → list}/getListTypeStyle.js +3 -0
  19. package/lib/autoFormat/list/getListTypeStyle.js.map +1 -0
  20. package/lib/autoFormat/list/getNumberingListStyle.js.map +1 -0
  21. package/lib/autoFormat/list/keyboardListTrigger.d.ts +5 -0
  22. package/lib/autoFormat/{keyboardListTrigger.js → list/keyboardListTrigger.js} +17 -15
  23. package/lib/autoFormat/list/keyboardListTrigger.js.map +1 -0
  24. package/lib/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  25. package/lib/contextMenuBase/ContextMenuPluginBase.js +84 -0
  26. package/lib/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  27. package/lib/edit/EditPlugin.d.ts +3 -3
  28. package/lib/edit/EditPlugin.js +1 -1
  29. package/lib/edit/EditPlugin.js.map +1 -1
  30. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  31. package/lib/edit/deleteSteps/deleteCollapsedSelection.js +20 -1
  32. package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  33. package/lib/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  34. package/lib/edit/deleteSteps/deleteEmptyQuote.js +60 -0
  35. package/lib/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  36. package/lib/edit/deleteSteps/deleteList.js +2 -1
  37. package/lib/edit/deleteSteps/deleteList.js.map +1 -1
  38. package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  39. package/lib/edit/handleKeyboardEventCommon.d.ts +2 -2
  40. package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
  41. package/lib/edit/inputSteps/handleEnterOnList.js +40 -10
  42. package/lib/edit/inputSteps/handleEnterOnList.js.map +1 -1
  43. package/lib/edit/keyboardDelete.d.ts +3 -3
  44. package/lib/edit/keyboardDelete.js +10 -2
  45. package/lib/edit/keyboardDelete.js.map +1 -1
  46. package/lib/edit/keyboardInput.d.ts +2 -2
  47. package/lib/edit/keyboardInput.js +2 -1
  48. package/lib/edit/keyboardInput.js.map +1 -1
  49. package/lib/edit/keyboardTab.d.ts +2 -2
  50. package/lib/edit/keyboardTab.js +19 -11
  51. package/lib/edit/keyboardTab.js.map +1 -1
  52. package/lib/edit/tabUtils/handleTabOnList.d.ts +7 -0
  53. package/lib/edit/tabUtils/handleTabOnList.js +34 -0
  54. package/lib/edit/tabUtils/handleTabOnList.js.map +1 -0
  55. package/lib/edit/tabUtils/handleTabOnParagraph.d.ts +17 -0
  56. package/lib/edit/tabUtils/handleTabOnParagraph.js +81 -0
  57. package/lib/edit/tabUtils/handleTabOnParagraph.js.map +1 -0
  58. package/lib/edit/utils/getLeafSiblingBlock.js.map +1 -1
  59. package/lib/index.d.ts +5 -0
  60. package/lib/index.js +22 -1
  61. package/lib/index.js.map +1 -1
  62. package/lib/paste/Excel/processPastedContentFromExcel.js +1 -1
  63. package/lib/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  64. package/lib/paste/PastePlugin.d.ts +2 -3
  65. package/lib/paste/PastePlugin.js +6 -7
  66. package/lib/paste/PastePlugin.js.map +1 -1
  67. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  68. package/lib/paste/WacComponents/constants.js.map +1 -1
  69. package/lib/paste/WacComponents/processPastedContentWacComponents.js +6 -6
  70. package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  71. package/lib/paste/WordDesktop/WordMetadata.js.map +1 -1
  72. package/lib/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  73. package/lib/paste/WordDesktop/getStyleMetadata.js +2 -1
  74. package/lib/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  75. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +5 -17
  76. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  77. package/lib/paste/WordDesktop/processWordComments.js.map +1 -1
  78. package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
  79. package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  80. package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
  81. package/lib/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  82. package/lib/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  83. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  84. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  85. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  86. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  87. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  88. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  89. package/lib/paste/utils/addParser.d.ts +1 -1
  90. package/lib/paste/utils/addParser.js +2 -1
  91. package/lib/paste/utils/addParser.js.map +1 -1
  92. package/lib/paste/utils/deprecatedColorParser.js.map +1 -1
  93. package/lib/paste/utils/getStyles.js.map +1 -1
  94. package/lib/paste/utils/linkParser.js.map +1 -1
  95. package/lib/paste/utils/setProcessor.js.map +1 -1
  96. package/lib/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  97. package/lib/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  98. package/lib/pluginUtils/CreateElement/createElement.d.ts +2 -2
  99. package/lib/pluginUtils/CreateElement/createElement.js +2 -1
  100. package/lib/pluginUtils/CreateElement/createElement.js.map +1 -1
  101. package/lib/pluginUtils/Disposable.d.ts +1 -1
  102. package/lib/pluginUtils/Disposable.js.map +1 -1
  103. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  104. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  105. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  106. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js +2 -1
  107. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  108. package/lib/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  109. package/lib/pluginUtils/Rect/getIntersectedRect.js +4 -3
  110. package/lib/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  111. package/lib/shortcut/ShortcutCommand.d.ts +44 -0
  112. package/lib/shortcut/ShortcutCommand.js +3 -0
  113. package/lib/shortcut/ShortcutCommand.js.map +1 -0
  114. package/lib/shortcut/ShortcutPlugin.d.ts +51 -0
  115. package/lib/shortcut/ShortcutPlugin.js +120 -0
  116. package/lib/shortcut/ShortcutPlugin.js.map +1 -0
  117. package/lib/shortcut/shortcuts.d.ts +85 -0
  118. package/lib/shortcut/shortcuts.js +211 -0
  119. package/lib/shortcut/shortcuts.js.map +1 -0
  120. package/lib/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  121. package/lib/shortcut/utils/setShortcutIndentationCommand.js +22 -0
  122. package/lib/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  123. package/lib/tableEdit/TableEditPlugin.d.ts +47 -0
  124. package/lib/tableEdit/TableEditPlugin.js +156 -0
  125. package/lib/tableEdit/TableEditPlugin.js.map +1 -0
  126. package/lib/tableEdit/editors/TableEditor.d.ts +73 -0
  127. package/lib/tableEdit/editors/TableEditor.js +294 -0
  128. package/lib/tableEdit/editors/TableEditor.js.map +1 -0
  129. package/lib/tableEdit/editors/features/CellResizer.d.ts +6 -0
  130. package/lib/tableEdit/editors/features/CellResizer.js +169 -0
  131. package/lib/tableEdit/editors/features/CellResizer.js.map +1 -0
  132. package/lib/tableEdit/editors/features/TableEditFeature.d.ts +13 -0
  133. package/lib/tableEdit/editors/features/TableEditFeature.js +17 -0
  134. package/lib/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  135. package/lib/tableEdit/editors/features/TableInserter.d.ts +6 -0
  136. package/lib/tableEdit/editors/features/TableInserter.js +113 -0
  137. package/lib/tableEdit/editors/features/TableInserter.js.map +1 -0
  138. package/lib/tableEdit/editors/features/TableMover.d.ts +8 -0
  139. package/lib/tableEdit/editors/features/TableMover.js +83 -0
  140. package/lib/tableEdit/editors/features/TableMover.js.map +1 -0
  141. package/lib/tableEdit/editors/features/TableResizer.d.ts +6 -0
  142. package/lib/tableEdit/editors/features/TableResizer.js +166 -0
  143. package/lib/tableEdit/editors/features/TableResizer.js.map +1 -0
  144. package/lib-amd/autoFormat/AutoFormatPlugin.d.ts +11 -2
  145. package/lib-amd/autoFormat/AutoFormatPlugin.js +21 -4
  146. package/lib-amd/autoFormat/AutoFormatPlugin.js.map +1 -1
  147. package/lib-amd/autoFormat/link/createLink.d.ts +5 -0
  148. package/lib-amd/autoFormat/link/createLink.js +26 -0
  149. package/lib-amd/autoFormat/link/createLink.js.map +1 -0
  150. package/lib-amd/autoFormat/link/createLinkAfterSpace.d.ts +5 -0
  151. package/lib-amd/autoFormat/link/createLinkAfterSpace.js +38 -0
  152. package/lib-amd/autoFormat/link/createLinkAfterSpace.js.map +1 -0
  153. package/lib-amd/autoFormat/link/getLinkSegment.d.ts +5 -0
  154. package/lib-amd/autoFormat/link/getLinkSegment.js +27 -0
  155. package/lib-amd/autoFormat/link/getLinkSegment.js.map +1 -0
  156. package/lib-amd/autoFormat/link/unlink.d.ts +5 -0
  157. package/lib-amd/autoFormat/link/unlink.js +21 -0
  158. package/lib-amd/autoFormat/link/unlink.js.map +1 -0
  159. package/lib-amd/autoFormat/list/convertAlphaToDecimals.js.map +1 -0
  160. package/lib-amd/autoFormat/list/getIndex.js.map +1 -0
  161. package/lib-amd/autoFormat/{utils → list}/getListTypeStyle.js +3 -0
  162. package/lib-amd/autoFormat/list/getListTypeStyle.js.map +1 -0
  163. package/lib-amd/autoFormat/list/getNumberingListStyle.js.map +1 -0
  164. package/lib-amd/autoFormat/list/keyboardListTrigger.d.ts +5 -0
  165. package/lib-amd/autoFormat/list/keyboardListTrigger.js +46 -0
  166. package/lib-amd/autoFormat/list/keyboardListTrigger.js.map +1 -0
  167. package/lib-amd/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  168. package/lib-amd/contextMenuBase/ContextMenuPluginBase.js +86 -0
  169. package/lib-amd/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  170. package/lib-amd/edit/EditPlugin.d.ts +3 -3
  171. package/lib-amd/edit/EditPlugin.js +1 -1
  172. package/lib-amd/edit/EditPlugin.js.map +1 -1
  173. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  174. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js +19 -1
  175. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  176. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  177. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.js +60 -0
  178. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  179. package/lib-amd/edit/deleteSteps/deleteList.js +2 -1
  180. package/lib-amd/edit/deleteSteps/deleteList.js.map +1 -1
  181. package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  182. package/lib-amd/edit/handleKeyboardEventCommon.d.ts +2 -2
  183. package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
  184. package/lib-amd/edit/inputSteps/handleEnterOnList.js +40 -10
  185. package/lib-amd/edit/inputSteps/handleEnterOnList.js.map +1 -1
  186. package/lib-amd/edit/keyboardDelete.d.ts +3 -3
  187. package/lib-amd/edit/keyboardDelete.js +10 -3
  188. package/lib-amd/edit/keyboardDelete.js.map +1 -1
  189. package/lib-amd/edit/keyboardInput.d.ts +2 -2
  190. package/lib-amd/edit/keyboardInput.js +2 -2
  191. package/lib-amd/edit/keyboardInput.js.map +1 -1
  192. package/lib-amd/edit/keyboardTab.d.ts +2 -2
  193. package/lib-amd/edit/keyboardTab.js +18 -12
  194. package/lib-amd/edit/keyboardTab.js.map +1 -1
  195. package/lib-amd/edit/tabUtils/handleTabOnList.d.ts +7 -0
  196. package/lib-amd/edit/tabUtils/handleTabOnList.js +34 -0
  197. package/lib-amd/edit/tabUtils/handleTabOnList.js.map +1 -0
  198. package/lib-amd/edit/tabUtils/handleTabOnParagraph.d.ts +17 -0
  199. package/lib-amd/edit/tabUtils/handleTabOnParagraph.js +81 -0
  200. package/lib-amd/edit/tabUtils/handleTabOnParagraph.js.map +1 -0
  201. package/lib-amd/edit/utils/getLeafSiblingBlock.js.map +1 -1
  202. package/lib-amd/index.d.ts +5 -0
  203. package/lib-amd/index.js +19 -2
  204. package/lib-amd/index.js.map +1 -1
  205. package/lib-amd/paste/Excel/processPastedContentFromExcel.js +1 -1
  206. package/lib-amd/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  207. package/lib-amd/paste/PastePlugin.d.ts +2 -3
  208. package/lib-amd/paste/PastePlugin.js +6 -7
  209. package/lib-amd/paste/PastePlugin.js.map +1 -1
  210. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  211. package/lib-amd/paste/WacComponents/constants.js.map +1 -1
  212. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +6 -6
  213. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  214. package/lib-amd/paste/WordDesktop/WordMetadata.js.map +1 -1
  215. package/lib-amd/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  216. package/lib-amd/paste/WordDesktop/getStyleMetadata.js +2 -1
  217. package/lib-amd/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  218. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +5 -17
  219. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  220. package/lib-amd/paste/WordDesktop/processWordComments.js.map +1 -1
  221. package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
  222. package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  223. package/lib-amd/paste/pasteSourceValidations/constants.js.map +1 -1
  224. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  225. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  226. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  227. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  228. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  229. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  230. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  231. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  232. package/lib-amd/paste/utils/addParser.d.ts +1 -1
  233. package/lib-amd/paste/utils/addParser.js +2 -1
  234. package/lib-amd/paste/utils/addParser.js.map +1 -1
  235. package/lib-amd/paste/utils/deprecatedColorParser.js.map +1 -1
  236. package/lib-amd/paste/utils/getStyles.js.map +1 -1
  237. package/lib-amd/paste/utils/linkParser.js.map +1 -1
  238. package/lib-amd/paste/utils/setProcessor.js.map +1 -1
  239. package/lib-amd/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  240. package/lib-amd/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  241. package/lib-amd/pluginUtils/CreateElement/createElement.d.ts +2 -2
  242. package/lib-amd/pluginUtils/CreateElement/createElement.js +2 -1
  243. package/lib-amd/pluginUtils/CreateElement/createElement.js.map +1 -1
  244. package/lib-amd/pluginUtils/Disposable.d.ts +1 -1
  245. package/lib-amd/pluginUtils/Disposable.js.map +1 -1
  246. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  247. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  248. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  249. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js +2 -1
  250. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  251. package/lib-amd/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  252. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js +4 -3
  253. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  254. package/lib-amd/shortcut/ShortcutCommand.d.ts +44 -0
  255. package/lib-amd/shortcut/ShortcutCommand.js +5 -0
  256. package/lib-amd/shortcut/ShortcutCommand.js.map +1 -0
  257. package/lib-amd/shortcut/ShortcutPlugin.d.ts +51 -0
  258. package/lib-amd/shortcut/ShortcutPlugin.js +120 -0
  259. package/lib-amd/shortcut/ShortcutPlugin.js.map +1 -0
  260. package/lib-amd/shortcut/shortcuts.d.ts +85 -0
  261. package/lib-amd/shortcut/shortcuts.js +210 -0
  262. package/lib-amd/shortcut/shortcuts.js.map +1 -0
  263. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  264. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.js +22 -0
  265. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  266. package/lib-amd/tableEdit/TableEditPlugin.d.ts +47 -0
  267. package/lib-amd/tableEdit/TableEditPlugin.js +156 -0
  268. package/lib-amd/tableEdit/TableEditPlugin.js.map +1 -0
  269. package/lib-amd/tableEdit/editors/TableEditor.d.ts +73 -0
  270. package/lib-amd/tableEdit/editors/TableEditor.js +290 -0
  271. package/lib-amd/tableEdit/editors/TableEditor.js.map +1 -0
  272. package/lib-amd/tableEdit/editors/features/CellResizer.d.ts +6 -0
  273. package/lib-amd/tableEdit/editors/features/CellResizer.js +166 -0
  274. package/lib-amd/tableEdit/editors/features/CellResizer.js.map +1 -0
  275. package/lib-amd/tableEdit/editors/features/TableEditFeature.d.ts +13 -0
  276. package/lib-amd/tableEdit/editors/features/TableEditFeature.js +19 -0
  277. package/lib-amd/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  278. package/lib-amd/tableEdit/editors/features/TableInserter.d.ts +6 -0
  279. package/lib-amd/tableEdit/editors/features/TableInserter.js +111 -0
  280. package/lib-amd/tableEdit/editors/features/TableInserter.js.map +1 -0
  281. package/lib-amd/tableEdit/editors/features/TableMover.d.ts +8 -0
  282. package/lib-amd/tableEdit/editors/features/TableMover.js +81 -0
  283. package/lib-amd/tableEdit/editors/features/TableMover.js.map +1 -0
  284. package/lib-amd/tableEdit/editors/features/TableResizer.d.ts +6 -0
  285. package/lib-amd/tableEdit/editors/features/TableResizer.js +164 -0
  286. package/lib-amd/tableEdit/editors/features/TableResizer.js.map +1 -0
  287. package/lib-mjs/autoFormat/AutoFormatPlugin.d.ts +11 -2
  288. package/lib-mjs/autoFormat/AutoFormatPlugin.js +24 -4
  289. package/lib-mjs/autoFormat/AutoFormatPlugin.js.map +1 -1
  290. package/lib-mjs/autoFormat/link/createLink.d.ts +5 -0
  291. package/lib-mjs/autoFormat/link/createLink.js +22 -0
  292. package/lib-mjs/autoFormat/link/createLink.js.map +1 -0
  293. package/lib-mjs/autoFormat/link/createLinkAfterSpace.d.ts +5 -0
  294. package/lib-mjs/autoFormat/link/createLinkAfterSpace.js +35 -0
  295. package/lib-mjs/autoFormat/link/createLinkAfterSpace.js.map +1 -0
  296. package/lib-mjs/autoFormat/link/getLinkSegment.d.ts +5 -0
  297. package/lib-mjs/autoFormat/link/getLinkSegment.js +23 -0
  298. package/lib-mjs/autoFormat/link/getLinkSegment.js.map +1 -0
  299. package/lib-mjs/autoFormat/link/unlink.d.ts +5 -0
  300. package/lib-mjs/autoFormat/link/unlink.js +16 -0
  301. package/lib-mjs/autoFormat/link/unlink.js.map +1 -0
  302. package/lib-mjs/autoFormat/list/convertAlphaToDecimals.js.map +1 -0
  303. package/lib-mjs/autoFormat/list/getIndex.js.map +1 -0
  304. package/lib-mjs/autoFormat/{utils → list}/getListTypeStyle.js +3 -0
  305. package/lib-mjs/autoFormat/list/getListTypeStyle.js.map +1 -0
  306. package/lib-mjs/autoFormat/list/getNumberingListStyle.js.map +1 -0
  307. package/lib-mjs/autoFormat/list/keyboardListTrigger.d.ts +5 -0
  308. package/lib-mjs/autoFormat/{keyboardListTrigger.js → list/keyboardListTrigger.js} +17 -15
  309. package/lib-mjs/autoFormat/list/keyboardListTrigger.js.map +1 -0
  310. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  311. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.js +81 -0
  312. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  313. package/lib-mjs/edit/EditPlugin.d.ts +3 -3
  314. package/lib-mjs/edit/EditPlugin.js +1 -1
  315. package/lib-mjs/edit/EditPlugin.js.map +1 -1
  316. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  317. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js +20 -1
  318. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  319. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  320. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.js +56 -0
  321. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  322. package/lib-mjs/edit/deleteSteps/deleteList.js +2 -1
  323. package/lib-mjs/edit/deleteSteps/deleteList.js.map +1 -1
  324. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  325. package/lib-mjs/edit/handleKeyboardEventCommon.d.ts +2 -2
  326. package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
  327. package/lib-mjs/edit/inputSteps/handleEnterOnList.js +42 -12
  328. package/lib-mjs/edit/inputSteps/handleEnterOnList.js.map +1 -1
  329. package/lib-mjs/edit/keyboardDelete.d.ts +3 -3
  330. package/lib-mjs/edit/keyboardDelete.js +10 -2
  331. package/lib-mjs/edit/keyboardDelete.js.map +1 -1
  332. package/lib-mjs/edit/keyboardInput.d.ts +2 -2
  333. package/lib-mjs/edit/keyboardInput.js +2 -1
  334. package/lib-mjs/edit/keyboardInput.js.map +1 -1
  335. package/lib-mjs/edit/keyboardTab.d.ts +2 -2
  336. package/lib-mjs/edit/keyboardTab.js +19 -11
  337. package/lib-mjs/edit/keyboardTab.js.map +1 -1
  338. package/lib-mjs/edit/tabUtils/handleTabOnList.d.ts +7 -0
  339. package/lib-mjs/edit/tabUtils/handleTabOnList.js +30 -0
  340. package/lib-mjs/edit/tabUtils/handleTabOnList.js.map +1 -0
  341. package/lib-mjs/edit/tabUtils/handleTabOnParagraph.d.ts +17 -0
  342. package/lib-mjs/edit/tabUtils/handleTabOnParagraph.js +77 -0
  343. package/lib-mjs/edit/tabUtils/handleTabOnParagraph.js.map +1 -0
  344. package/lib-mjs/edit/utils/getLeafSiblingBlock.js.map +1 -1
  345. package/lib-mjs/index.d.ts +5 -0
  346. package/lib-mjs/index.js +4 -0
  347. package/lib-mjs/index.js.map +1 -1
  348. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +1 -1
  349. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  350. package/lib-mjs/paste/PastePlugin.d.ts +2 -3
  351. package/lib-mjs/paste/PastePlugin.js +1 -2
  352. package/lib-mjs/paste/PastePlugin.js.map +1 -1
  353. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  354. package/lib-mjs/paste/WacComponents/constants.js.map +1 -1
  355. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +1 -1
  356. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  357. package/lib-mjs/paste/WordDesktop/WordMetadata.js.map +1 -1
  358. package/lib-mjs/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  359. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js +1 -1
  360. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  361. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +2 -14
  362. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  363. package/lib-mjs/paste/WordDesktop/processWordComments.js.map +1 -1
  364. package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
  365. package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  366. package/lib-mjs/paste/pasteSourceValidations/constants.js.map +1 -1
  367. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  368. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  369. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  370. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  371. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  372. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  373. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  374. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  375. package/lib-mjs/paste/utils/addParser.d.ts +1 -1
  376. package/lib-mjs/paste/utils/addParser.js +1 -1
  377. package/lib-mjs/paste/utils/addParser.js.map +1 -1
  378. package/lib-mjs/paste/utils/deprecatedColorParser.js.map +1 -1
  379. package/lib-mjs/paste/utils/getStyles.js.map +1 -1
  380. package/lib-mjs/paste/utils/linkParser.js.map +1 -1
  381. package/lib-mjs/paste/utils/setProcessor.js.map +1 -1
  382. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  383. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  384. package/lib-mjs/pluginUtils/CreateElement/createElement.d.ts +2 -2
  385. package/lib-mjs/pluginUtils/CreateElement/createElement.js +1 -1
  386. package/lib-mjs/pluginUtils/CreateElement/createElement.js.map +1 -1
  387. package/lib-mjs/pluginUtils/Disposable.d.ts +1 -1
  388. package/lib-mjs/pluginUtils/Disposable.js.map +1 -1
  389. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  390. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  391. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  392. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js +1 -1
  393. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  394. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  395. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js +2 -2
  396. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  397. package/lib-mjs/shortcut/ShortcutCommand.d.ts +44 -0
  398. package/lib-mjs/shortcut/ShortcutCommand.js +2 -0
  399. package/lib-mjs/shortcut/ShortcutCommand.js.map +1 -0
  400. package/lib-mjs/shortcut/ShortcutPlugin.d.ts +51 -0
  401. package/lib-mjs/shortcut/ShortcutPlugin.js +117 -0
  402. package/lib-mjs/shortcut/ShortcutPlugin.js.map +1 -0
  403. package/lib-mjs/shortcut/shortcuts.d.ts +85 -0
  404. package/lib-mjs/shortcut/shortcuts.js +208 -0
  405. package/lib-mjs/shortcut/shortcuts.js.map +1 -0
  406. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  407. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.js +18 -0
  408. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  409. package/lib-mjs/tableEdit/TableEditPlugin.d.ts +47 -0
  410. package/lib-mjs/tableEdit/TableEditPlugin.js +153 -0
  411. package/lib-mjs/tableEdit/TableEditPlugin.js.map +1 -0
  412. package/lib-mjs/tableEdit/editors/TableEditor.d.ts +73 -0
  413. package/lib-mjs/tableEdit/editors/TableEditor.js +291 -0
  414. package/lib-mjs/tableEdit/editors/TableEditor.js.map +1 -0
  415. package/lib-mjs/tableEdit/editors/features/CellResizer.d.ts +6 -0
  416. package/lib-mjs/tableEdit/editors/features/CellResizer.js +165 -0
  417. package/lib-mjs/tableEdit/editors/features/CellResizer.js.map +1 -0
  418. package/lib-mjs/tableEdit/editors/features/TableEditFeature.d.ts +13 -0
  419. package/lib-mjs/tableEdit/editors/features/TableEditFeature.js +13 -0
  420. package/lib-mjs/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  421. package/lib-mjs/tableEdit/editors/features/TableInserter.d.ts +6 -0
  422. package/lib-mjs/tableEdit/editors/features/TableInserter.js +109 -0
  423. package/lib-mjs/tableEdit/editors/features/TableInserter.js.map +1 -0
  424. package/lib-mjs/tableEdit/editors/features/TableMover.d.ts +8 -0
  425. package/lib-mjs/tableEdit/editors/features/TableMover.js +79 -0
  426. package/lib-mjs/tableEdit/editors/features/TableMover.js.map +1 -0
  427. package/lib-mjs/tableEdit/editors/features/TableResizer.d.ts +6 -0
  428. package/lib-mjs/tableEdit/editors/features/TableResizer.js +162 -0
  429. package/lib-mjs/tableEdit/editors/features/TableResizer.js.map +1 -0
  430. package/package.json +5 -5
  431. package/lib/autoFormat/keyboardListTrigger.d.ts +0 -5
  432. package/lib/autoFormat/keyboardListTrigger.js.map +0 -1
  433. package/lib/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  434. package/lib/autoFormat/utils/getIndex.js.map +0 -1
  435. package/lib/autoFormat/utils/getListTypeStyle.js.map +0 -1
  436. package/lib/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  437. package/lib/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  438. package/lib/pluginUtils/Rect/normalizeRect.js +0 -20
  439. package/lib/pluginUtils/Rect/normalizeRect.js.map +0 -1
  440. package/lib-amd/autoFormat/keyboardListTrigger.d.ts +0 -5
  441. package/lib-amd/autoFormat/keyboardListTrigger.js +0 -44
  442. package/lib-amd/autoFormat/keyboardListTrigger.js.map +0 -1
  443. package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  444. package/lib-amd/autoFormat/utils/getIndex.js.map +0 -1
  445. package/lib-amd/autoFormat/utils/getListTypeStyle.js.map +0 -1
  446. package/lib-amd/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  447. package/lib-amd/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  448. package/lib-amd/pluginUtils/Rect/normalizeRect.js +0 -22
  449. package/lib-amd/pluginUtils/Rect/normalizeRect.js.map +0 -1
  450. package/lib-mjs/autoFormat/keyboardListTrigger.d.ts +0 -5
  451. package/lib-mjs/autoFormat/keyboardListTrigger.js.map +0 -1
  452. package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  453. package/lib-mjs/autoFormat/utils/getIndex.js.map +0 -1
  454. package/lib-mjs/autoFormat/utils/getListTypeStyle.js.map +0 -1
  455. package/lib-mjs/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  456. package/lib-mjs/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  457. package/lib-mjs/pluginUtils/Rect/normalizeRect.js +0 -17
  458. package/lib-mjs/pluginUtils/Rect/normalizeRect.js.map +0 -1
  459. /package/lib/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  460. /package/lib/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  461. /package/lib/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  462. /package/lib/autoFormat/{utils → list}/getIndex.js +0 -0
  463. /package/lib/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  464. /package/lib/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  465. /package/lib/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
  466. /package/lib-amd/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  467. /package/lib-amd/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  468. /package/lib-amd/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  469. /package/lib-amd/autoFormat/{utils → list}/getIndex.js +0 -0
  470. /package/lib-amd/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  471. /package/lib-amd/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  472. /package/lib-amd/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
  473. /package/lib-mjs/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  474. /package/lib-mjs/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  475. /package/lib-mjs/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  476. /package/lib-mjs/autoFormat/{utils → list}/getIndex.js +0 -0
  477. /package/lib-mjs/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  478. /package/lib-mjs/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  479. /package/lib-mjs/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CreateElementData.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/CreateElement/CreateElementData.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * An interface represents the data for creating element used by createElement()\n */\nexport default interface CreateElementData {\n /**\n * Tag name of this element.\n * It can be just a tag, or in format \"namespace:tag\"\n */\n tag: string;\n\n /**\n * Namespace of this tag\n */\n namespace?: string;\n\n /**\n * CSS class name\n */\n className?: string;\n\n /**\n * CSS style\n */\n style?: string;\n\n /**\n * Dataset of this element\n */\n dataset?: Record<string, string>;\n\n /**\n * Additional attributes of this element\n */\n attributes?: Record<string, string>;\n\n /**\n * Child nodes of this element, can be another CreateElementData, or a string which represents a text node\n */\n children?: (CreateElementData | string)[];\n}\n"]}
1
+ {"version":3,"file":"CreateElementData.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/CreateElement/CreateElementData.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * An interface represents the data for creating element used by createElement()\n */\nexport interface CreateElementData {\n /**\n * Tag name of this element.\n * It can be just a tag, or in format \"namespace:tag\"\n */\n tag: string;\n\n /**\n * Namespace of this tag\n */\n namespace?: string;\n\n /**\n * CSS class name\n */\n className?: string;\n\n /**\n * CSS style\n */\n style?: string;\n\n /**\n * Dataset of this element\n */\n dataset?: Record<string, string>;\n\n /**\n * Additional attributes of this element\n */\n attributes?: Record<string, string>;\n\n /**\n * Child nodes of this element, can be another CreateElementData, or a string which represents a text node\n */\n children?: (CreateElementData | string)[];\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type CreateElementData from './CreateElementData';
1
+ import type { CreateElementData } from './CreateElementData';
2
2
  /**
3
3
  * @internal
4
4
  * Create DOM element from the given CreateElementData
@@ -6,4 +6,4 @@ import type CreateElementData from './CreateElementData';
6
6
  * @param document The document to create the element from
7
7
  * @returns The root DOM element just created
8
8
  */
9
- export default function createElement(elementData: CreateElementData, document: Document): Element | null;
9
+ export declare function createElement(elementData: CreateElementData, document: Document): Element | null;
@@ -6,7 +6,7 @@ import { getObjectKeys, isNodeOfType } from 'roosterjs-content-model-dom';
6
6
  * @param document The document to create the element from
7
7
  * @returns The root DOM element just created
8
8
  */
9
- export default function createElement(elementData, document) {
9
+ export function createElement(elementData, document) {
10
10
  if (!elementData || !elementData.tag) {
11
11
  return null;
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createElement.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/CreateElement/createElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG1E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACjC,WAA8B,EAC9B,QAAkB;IAElB,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,OAAO,IAAI,CAAC;KACf;IAEO,IAAA,GAAG,GAAiE,WAAW,IAA5E,EAAE,SAAS,GAAsD,WAAW,UAAjE,EAAE,SAAS,GAA2C,WAAW,UAAtD,EAAE,KAAK,GAAoC,WAAW,MAA/C,EAAE,OAAO,GAA2B,WAAW,QAAtC,EAAE,UAAU,GAAe,WAAW,WAA1B,EAAE,QAAQ,GAAK,WAAW,SAAhB,CAAiB;IACxF,IAAM,MAAM,GAAG,SAAS;QACpB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC;QAC1C,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAElC,IAAI,KAAK,EAAE;QACP,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,IAAI,SAAS,EAAE;QACX,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;KAChC;IAED,IAAI,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE;QACjD,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAA,WAAW;YACtC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;KACN;IAED,IAAI,UAAU,EAAE;QACZ,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAA,QAAQ;YACtC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;KACN;IAED,IAAI,QAAQ,EAAE;QACV,QAAQ,CAAC,OAAO,CAAC,UAAA,KAAK;YAClB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC3B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;aACtD;iBAAM,IAAI,KAAK,EAAE;gBACd,IAAM,YAAY,GAAG,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBACpD,IAAI,YAAY,EAAE;oBACd,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;iBACpC;aACJ;QACL,CAAC,CAAC,CAAC;KACN;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { getObjectKeys, isNodeOfType } from 'roosterjs-content-model-dom';\nimport type CreateElementData from './CreateElementData';\n\n/**\n * @internal\n * Create DOM element from the given CreateElementData\n * @param elementData The CreateElementData or an index of a known CreateElementData used for creating this element\n * @param document The document to create the element from\n * @returns The root DOM element just created\n */\nexport default function createElement(\n elementData: CreateElementData,\n document: Document\n): Element | null {\n if (!elementData || !elementData.tag) {\n return null;\n }\n\n const { tag, namespace, className, style, dataset, attributes, children } = elementData;\n const result = namespace\n ? document.createElementNS(namespace, tag)\n : document.createElement(tag);\n\n if (style) {\n result.setAttribute('style', style);\n }\n\n if (className) {\n result.className = className;\n }\n\n if (dataset && isNodeOfType(result, 'ELEMENT_NODE')) {\n getObjectKeys(dataset).forEach(datasetName => {\n result.dataset[datasetName] = dataset[datasetName];\n });\n }\n\n if (attributes) {\n getObjectKeys(attributes).forEach(attrName => {\n result.setAttribute(attrName, attributes[attrName]);\n });\n }\n\n if (children) {\n children.forEach(child => {\n if (typeof child === 'string') {\n result.appendChild(document.createTextNode(child));\n } else if (child) {\n const childElement = createElement(child, document);\n if (childElement) {\n result.appendChild(childElement);\n }\n }\n });\n }\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"createElement.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/CreateElement/createElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG1E;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,WAA8B,EAAE,QAAkB;IAC5E,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,OAAO,IAAI,CAAC;KACf;IAEO,IAAA,GAAG,GAAiE,WAAW,IAA5E,EAAE,SAAS,GAAsD,WAAW,UAAjE,EAAE,SAAS,GAA2C,WAAW,UAAtD,EAAE,KAAK,GAAoC,WAAW,MAA/C,EAAE,OAAO,GAA2B,WAAW,QAAtC,EAAE,UAAU,GAAe,WAAW,WAA1B,EAAE,QAAQ,GAAK,WAAW,SAAhB,CAAiB;IACxF,IAAM,MAAM,GAAG,SAAS;QACpB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC;QAC1C,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAElC,IAAI,KAAK,EAAE;QACP,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,IAAI,SAAS,EAAE;QACX,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;KAChC;IAED,IAAI,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE;QACjD,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,UAAA,WAAW;YACtC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;KACN;IAED,IAAI,UAAU,EAAE;QACZ,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAA,QAAQ;YACtC,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;KACN;IAED,IAAI,QAAQ,EAAE;QACV,QAAQ,CAAC,OAAO,CAAC,UAAA,KAAK;YAClB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC3B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;aACtD;iBAAM,IAAI,KAAK,EAAE;gBACd,IAAM,YAAY,GAAG,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBACpD,IAAI,YAAY,EAAE;oBACd,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;iBACpC;aACJ;QACL,CAAC,CAAC,CAAC;KACN;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { getObjectKeys, isNodeOfType } from 'roosterjs-content-model-dom';\nimport type { CreateElementData } from './CreateElementData';\n\n/**\n * @internal\n * Create DOM element from the given CreateElementData\n * @param elementData The CreateElementData or an index of a known CreateElementData used for creating this element\n * @param document The document to create the element from\n * @returns The root DOM element just created\n */\nexport function createElement(elementData: CreateElementData, document: Document): Element | null {\n if (!elementData || !elementData.tag) {\n return null;\n }\n\n const { tag, namespace, className, style, dataset, attributes, children } = elementData;\n const result = namespace\n ? document.createElementNS(namespace, tag)\n : document.createElement(tag);\n\n if (style) {\n result.setAttribute('style', style);\n }\n\n if (className) {\n result.className = className;\n }\n\n if (dataset && isNodeOfType(result, 'ELEMENT_NODE')) {\n getObjectKeys(dataset).forEach(datasetName => {\n result.dataset[datasetName] = dataset[datasetName];\n });\n }\n\n if (attributes) {\n getObjectKeys(attributes).forEach(attrName => {\n result.setAttribute(attrName, attributes[attrName]);\n });\n }\n\n if (children) {\n children.forEach(child => {\n if (typeof child === 'string') {\n result.appendChild(document.createTextNode(child));\n } else if (child) {\n const childElement = createElement(child, document);\n if (childElement) {\n result.appendChild(childElement);\n }\n }\n });\n }\n\n return result;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  * Represents a disposable object
4
4
  */
5
- export default interface Disposable {
5
+ export interface Disposable {
6
6
  /**
7
7
  * Dispose this object
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Disposable.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/Disposable.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * Represents a disposable object\n */\nexport default interface Disposable {\n /**\n * Dispose this object\n */\n dispose: () => void;\n}\n"]}
1
+ {"version":3,"file":"Disposable.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/Disposable.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * Represents a disposable object\n */\nexport interface Disposable {\n /**\n * Dispose this object\n */\n dispose: () => void;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  * Drag and drop handler interface, used for implementing a handler object and pass into DragAndDropHelper class
4
4
  */
5
- export default interface DragAndDropHandler<TContext, TInitValue> {
5
+ export interface DragAndDropHandler<TContext, TInitValue> {
6
6
  /**
7
7
  * A callback that will be called when user starts to drag (mouse down event from the trigger element)
8
8
  * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use
@@ -1 +1 @@
1
- {"version":3,"file":"DragAndDropHandler.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/DragAndDrop/DragAndDropHandler.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * Drag and drop handler interface, used for implementing a handler object and pass into DragAndDropHelper class\n */\nexport default interface DragAndDropHandler<TContext, TInitValue> {\n /**\n * A callback that will be called when user starts to drag (mouse down event from the trigger element)\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler\n * @param event The mouse event that triggers this callback\n * @returns An optional object, which will be passed into onDragging and onDragEnd callback. It normally used\n * for passing an initial state of the target object\n */\n onDragStart?: (context: TContext, event: MouseEvent) => TInitValue;\n\n /**\n * A callback that will be called when user moves mouse and drag the trigger element.\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler.If an object is used as context, here it will\n * be the same object that passed into constructor of DragAndDropHelper class. Inside this callback you can change\n * its sub value so that caller can get the changed result.\n * @param event The mouse event that triggers this callback\n * @param initValue The initial value that is returned from onDragStart callback. It normally used\n * for passing an initial state of the target object\n * @param deltaX x delta value. It equals to current event.pageX - initial pageX (captured when mousedown happens)\n * @param deltaY y delta value. It equals to current event.pageY - initial pageY (captured when mousedown happens)\n * @returns Whether the onSubmit callback passed into constructor of DragAndDropHelper class should be invoked.\n * Returns true will invoke the onSubmit callback, it means this is a meaningful dragging action, something (mostly\n * under context object) has been changed, and caller should handle this change. Otherwise, return false.\n */\n onDragging?: (\n context: TContext,\n event: MouseEvent,\n initValue: TInitValue,\n deltaX: number,\n deltaY: number\n ) => boolean;\n\n /**\n * A callback that will be called when user stops dragging the trigger element.\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler.If an object is used as context, here it will\n * be the same object that passed into constructor of DragAndDropHelper class. Inside this callback you can change\n * its sub value so that caller can get the changed result.\n * @param event The mouse event that triggers this callback\n * @param initValue The initial value that is returned from onDragStart callback. It normally used\n * for passing an initial state of the target object\n * @returns Whether the onSubmit callback passed into constructor of DragAndDropHelper class should be invoked.\n * Returns true will invoke the onSubmit callback, it means this is a meaningful dragging action, something (mostly\n * under context object) has been changed, and caller should handle this change. Otherwise, return false.\n */\n onDragEnd?: (\n context: TContext,\n event: MouseEvent,\n initValue: TInitValue | undefined\n ) => boolean;\n}\n"]}
1
+ {"version":3,"file":"DragAndDropHandler.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/DragAndDrop/DragAndDropHandler.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n * Drag and drop handler interface, used for implementing a handler object and pass into DragAndDropHelper class\n */\nexport interface DragAndDropHandler<TContext, TInitValue> {\n /**\n * A callback that will be called when user starts to drag (mouse down event from the trigger element)\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler\n * @param event The mouse event that triggers this callback\n * @returns An optional object, which will be passed into onDragging and onDragEnd callback. It normally used\n * for passing an initial state of the target object\n */\n onDragStart?: (context: TContext, event: MouseEvent) => TInitValue;\n\n /**\n * A callback that will be called when user moves mouse and drag the trigger element.\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler.If an object is used as context, here it will\n * be the same object that passed into constructor of DragAndDropHelper class. Inside this callback you can change\n * its sub value so that caller can get the changed result.\n * @param event The mouse event that triggers this callback\n * @param initValue The initial value that is returned from onDragStart callback. It normally used\n * for passing an initial state of the target object\n * @param deltaX x delta value. It equals to current event.pageX - initial pageX (captured when mousedown happens)\n * @param deltaY y delta value. It equals to current event.pageY - initial pageY (captured when mousedown happens)\n * @returns Whether the onSubmit callback passed into constructor of DragAndDropHelper class should be invoked.\n * Returns true will invoke the onSubmit callback, it means this is a meaningful dragging action, something (mostly\n * under context object) has been changed, and caller should handle this change. Otherwise, return false.\n */\n onDragging?: (\n context: TContext,\n event: MouseEvent,\n initValue: TInitValue,\n deltaX: number,\n deltaY: number\n ) => boolean;\n\n /**\n * A callback that will be called when user stops dragging the trigger element.\n * @param context The context object that was passed into DragAndDropHelper from its constructor. We can use\n * this object to communicate between caller code and this handler.If an object is used as context, here it will\n * be the same object that passed into constructor of DragAndDropHelper class. Inside this callback you can change\n * its sub value so that caller can get the changed result.\n * @param event The mouse event that triggers this callback\n * @param initValue The initial value that is returned from onDragStart callback. It normally used\n * for passing an initial state of the target object\n * @returns Whether the onSubmit callback passed into constructor of DragAndDropHelper class should be invoked.\n * Returns true will invoke the onSubmit callback, it means this is a meaningful dragging action, something (mostly\n * under context object) has been changed, and caller should handle this change. Otherwise, return false.\n */\n onDragEnd?: (\n context: TContext,\n event: MouseEvent,\n initValue: TInitValue | undefined\n ) => boolean;\n}\n"]}
@@ -1,10 +1,10 @@
1
- import type Disposable from '../Disposable';
2
- import type DragAndDropHandler from './DragAndDropHandler';
1
+ import type { Disposable } from '../Disposable';
2
+ import type { DragAndDropHandler } from './DragAndDropHandler';
3
3
  /**
4
4
  * @internal
5
5
  * A helper class to help manage drag and drop to an HTML element
6
6
  */
7
- export default class DragAndDropHelper<TContext, TInitValue> implements Disposable {
7
+ export declare class DragAndDropHelper<TContext, TInitValue> implements Disposable {
8
8
  private trigger;
9
9
  private context;
10
10
  private onSubmit;
@@ -114,5 +114,5 @@ var DragAndDropHelper = /** @class */ (function () {
114
114
  };
115
115
  return DragAndDropHelper;
116
116
  }());
117
- export default DragAndDropHelper;
117
+ export { DragAndDropHelper };
118
118
  //# sourceMappingURL=DragAndDropHelper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DragAndDropHelper.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/DragAndDrop/DragAndDropHelper.ts"],"names":[],"mappings":";AA2BA;;GAEG;AACH,IAAM,wBAAwB,GAAmB,CAAC;IAC9C,OAAO;QACH,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,mBAAmB;KACjC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,IAAM,uBAAuB,GAAmB,CAAC;IAC7C,OAAO;QACH,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,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACxF,CAAC;IA8BL,wBAAC;AAAD,CAAC,AAjFD,IAiFC","sourcesContent":["import type Disposable from '../Disposable';\nimport type DragAndDropHandler from './DragAndDropHandler';\n\n/**\n * @internal\n */\ninterface MouseEventMoves {\n MOUSEDOWN: string;\n MOUSEMOVE: string;\n MOUSEUP: string;\n}\n\n/**\n * @internal\n */\ninterface MouseEventInfo extends MouseEventMoves {\n getPageXY: (e: MouseEvent) => number[];\n}\n\n/**\n * @internal\n * Compatible mouse event names for different platform\n */\ninterface TouchEventInfo extends MouseEventMoves {\n getPageXY: (e: TouchEvent) => number[];\n}\n\n/**\n * Generate event names and getXY function based on different platforms to be compatible with desktop and mobile browsers\n */\nconst MOUSE_EVENT_INFO_DESKTOP: MouseEventInfo = (() => {\n return {\n MOUSEDOWN: 'mousedown',\n MOUSEMOVE: 'mousemove',\n MOUSEUP: 'mouseup',\n getPageXY: getMouseEventPageXY,\n };\n})();\n\nconst MOUSE_EVENT_INFO_MOBILE: TouchEventInfo = (() => {\n return {\n MOUSEDOWN: 'touchstart',\n MOUSEMOVE: 'touchmove',\n MOUSEUP: 'touchend',\n getPageXY: getTouchEventPageXY,\n };\n})();\n\nfunction getMouseEventPageXY(e: MouseEvent): [number, number] {\n return [e.pageX, e.pageY];\n}\n\nfunction getTouchEventPageXY(e: TouchEvent): [number, number] {\n let pageX = 0;\n let pageY = 0;\n if (e.targetTouches && e.targetTouches.length > 0) {\n const touch = e.targetTouches[0];\n pageX = touch.pageX;\n pageY = touch.pageY;\n }\n return [pageX, pageY];\n}\n\n/**\n * @internal\n * A helper class to help manage drag and drop to an HTML element\n */\nexport default class DragAndDropHelper<TContext, TInitValue> implements Disposable {\n private initX: number = 0;\n private initY: number = 0;\n private initValue: TInitValue | undefined = undefined;\n private dndMouse: MouseEventInfo | TouchEventInfo;\n\n /**\n * Create a new instance of DragAndDropHelper class\n * @param trigger The trigger element. When user start drag on this element,\n * events will be fired to the handler object\n * @param context Context object that will be passed to handler function when event is fired,\n * so that the handler object knows which element it is triggered from.\n * @param onSubmit A callback that will be invoked when event handler in handler object returns true\n * @param handler The event handler object, see DragAndDropHandler interface for more information\n * @param zoomScale The zoom scale of the editor\n * @param forceMobile A boolean to force the use of touch controls for the helper\n */\n constructor(\n private trigger: HTMLElement,\n private context: TContext,\n private onSubmit: (context: TContext, trigger: HTMLElement) => void,\n private handler: DragAndDropHandler<TContext, TInitValue>,\n private zoomScale: number,\n forceMobile?: boolean\n ) {\n this.dndMouse = forceMobile ? MOUSE_EVENT_INFO_MOBILE : MOUSE_EVENT_INFO_DESKTOP;\n trigger.addEventListener(this.dndMouse.MOUSEDOWN, this.onMouseDown);\n }\n\n /**\n * Dispose this object, remove all event listeners that has been attached\n */\n dispose() {\n this.trigger.removeEventListener(this.dndMouse.MOUSEDOWN, this.onMouseDown);\n this.removeDocumentEvents();\n }\n\n public get mouseType(): string {\n return this.dndMouse == MOUSE_EVENT_INFO_MOBILE ? 'touch' : 'mouse';\n }\n\n private addDocumentEvents() {\n const doc = this.trigger.ownerDocument;\n doc.addEventListener(this.dndMouse.MOUSEMOVE, this.onMouseMove, true /*useCapture*/);\n doc.addEventListener(this.dndMouse.MOUSEUP, this.onMouseUp, true /*useCapture*/);\n }\n\n private removeDocumentEvents() {\n const doc = this.trigger.ownerDocument;\n doc.removeEventListener(this.dndMouse.MOUSEMOVE, this.onMouseMove, true /*useCapture*/);\n doc.removeEventListener(this.dndMouse.MOUSEUP, this.onMouseUp, true /*useCapture*/);\n }\n\n private onMouseDown = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n this.addDocumentEvents();\n [this.initX, this.initY] = this.dndMouse.getPageXY(e as MouseEvent & TouchEvent);\n this.initValue = this.handler.onDragStart?.(this.context, e as MouseEvent);\n };\n\n private onMouseMove = (e: Event) => {\n e.preventDefault();\n const [pageX, pageY] = this.dndMouse.getPageXY(e as MouseEvent & TouchEvent);\n const deltaX = (pageX - this.initX) / this.zoomScale;\n const deltaY = (pageY - this.initY) / this.zoomScale;\n if (\n this.initValue &&\n this.handler.onDragging?.(this.context, e as MouseEvent, this.initValue, deltaX, deltaY)\n ) {\n this.onSubmit?.(this.context, this.trigger);\n }\n };\n\n private onMouseUp = (e: Event) => {\n e.preventDefault();\n this.removeDocumentEvents();\n if (this.handler.onDragEnd?.(this.context, e as MouseEvent, this.initValue)) {\n this.onSubmit?.(this.context, this.trigger);\n }\n };\n}\n"]}
1
+ {"version":3,"file":"DragAndDropHelper.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/DragAndDrop/DragAndDropHelper.ts"],"names":[],"mappings":";AA2BA;;GAEG;AACH,IAAM,wBAAwB,GAAmB,CAAC;IAC9C,OAAO;QACH,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,mBAAmB;KACjC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,IAAM,uBAAuB,GAAmB,CAAC;IAC7C,OAAO;QACH,SAAS,EAAE,YAAY;QACvB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,mBAAmB;KACjC,CAAC;AACN,CAAC,CAAC,EAAE,CAAC;AAEL,SAAS,mBAAmB,CAAC,CAAa;IACtC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,mBAAmB,CAAC,CAAa;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;QAC/C,IAAM,KAAK,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACjC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC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AuB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QACxE,CAAC;;;OAAA;IAEO,6CAAiB,GAAzB;QACI,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACrF,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrF,CAAC;IAEO,gDAAoB,GAA5B;QACI,IAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;QACvC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACxF,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACxF,CAAC;IA8BL,wBAAC;AAAD,CAAC,AAjFD,IAiFC","sourcesContent":["import type { Disposable } from '../Disposable';\nimport type { DragAndDropHandler } from './DragAndDropHandler';\n\n/**\n * @internal\n */\ninterface MouseEventMoves {\n MOUSEDOWN: string;\n MOUSEMOVE: string;\n MOUSEUP: string;\n}\n\n/**\n * @internal\n */\ninterface MouseEventInfo extends MouseEventMoves {\n getPageXY: (e: MouseEvent) => number[];\n}\n\n/**\n * @internal\n * Compatible mouse event names for different platform\n */\ninterface TouchEventInfo extends MouseEventMoves {\n getPageXY: (e: TouchEvent) => number[];\n}\n\n/**\n * Generate event names and getXY function based on different platforms to be compatible with desktop and mobile browsers\n */\nconst MOUSE_EVENT_INFO_DESKTOP: MouseEventInfo = (() => {\n return {\n MOUSEDOWN: 'mousedown',\n MOUSEMOVE: 'mousemove',\n MOUSEUP: 'mouseup',\n getPageXY: getMouseEventPageXY,\n };\n})();\n\nconst MOUSE_EVENT_INFO_MOBILE: TouchEventInfo = (() => {\n return {\n MOUSEDOWN: 'touchstart',\n MOUSEMOVE: 'touchmove',\n MOUSEUP: 'touchend',\n getPageXY: getTouchEventPageXY,\n };\n})();\n\nfunction getMouseEventPageXY(e: MouseEvent): [number, number] {\n return [e.pageX, e.pageY];\n}\n\nfunction getTouchEventPageXY(e: TouchEvent): [number, number] {\n let pageX = 0;\n let pageY = 0;\n if (e.targetTouches && e.targetTouches.length > 0) {\n const touch = e.targetTouches[0];\n pageX = touch.pageX;\n pageY = touch.pageY;\n }\n return [pageX, pageY];\n}\n\n/**\n * @internal\n * A helper class to help manage drag and drop to an HTML element\n */\nexport class DragAndDropHelper<TContext, TInitValue> implements Disposable {\n private initX: number = 0;\n private initY: number = 0;\n private initValue: TInitValue | undefined = undefined;\n private dndMouse: MouseEventInfo | TouchEventInfo;\n\n /**\n * Create a new instance of DragAndDropHelper class\n * @param trigger The trigger element. When user start drag on this element,\n * events will be fired to the handler object\n * @param context Context object that will be passed to handler function when event is fired,\n * so that the handler object knows which element it is triggered from.\n * @param onSubmit A callback that will be invoked when event handler in handler object returns true\n * @param handler The event handler object, see DragAndDropHandler interface for more information\n * @param zoomScale The zoom scale of the editor\n * @param forceMobile A boolean to force the use of touch controls for the helper\n */\n constructor(\n private trigger: HTMLElement,\n private context: TContext,\n private onSubmit: (context: TContext, trigger: HTMLElement) => void,\n private handler: DragAndDropHandler<TContext, TInitValue>,\n private zoomScale: number,\n forceMobile?: boolean\n ) {\n this.dndMouse = forceMobile ? MOUSE_EVENT_INFO_MOBILE : MOUSE_EVENT_INFO_DESKTOP;\n trigger.addEventListener(this.dndMouse.MOUSEDOWN, this.onMouseDown);\n }\n\n /**\n * Dispose this object, remove all event listeners that has been attached\n */\n dispose() {\n this.trigger.removeEventListener(this.dndMouse.MOUSEDOWN, this.onMouseDown);\n this.removeDocumentEvents();\n }\n\n public get mouseType(): string {\n return this.dndMouse == MOUSE_EVENT_INFO_MOBILE ? 'touch' : 'mouse';\n }\n\n private addDocumentEvents() {\n const doc = this.trigger.ownerDocument;\n doc.addEventListener(this.dndMouse.MOUSEMOVE, this.onMouseMove, true /*useCapture*/);\n doc.addEventListener(this.dndMouse.MOUSEUP, this.onMouseUp, true /*useCapture*/);\n }\n\n private removeDocumentEvents() {\n const doc = this.trigger.ownerDocument;\n doc.removeEventListener(this.dndMouse.MOUSEMOVE, this.onMouseMove, true /*useCapture*/);\n doc.removeEventListener(this.dndMouse.MOUSEUP, this.onMouseUp, true /*useCapture*/);\n }\n\n private onMouseDown = (e: Event) => {\n e.preventDefault();\n e.stopPropagation();\n this.addDocumentEvents();\n [this.initX, this.initY] = this.dndMouse.getPageXY(e as MouseEvent & TouchEvent);\n this.initValue = this.handler.onDragStart?.(this.context, e as MouseEvent);\n };\n\n private onMouseMove = (e: Event) => {\n e.preventDefault();\n const [pageX, pageY] = this.dndMouse.getPageXY(e as MouseEvent & TouchEvent);\n const deltaX = (pageX - this.initX) / this.zoomScale;\n const deltaY = (pageY - this.initY) / this.zoomScale;\n if (\n this.initValue &&\n this.handler.onDragging?.(this.context, e as MouseEvent, this.initValue, deltaX, deltaY)\n ) {\n this.onSubmit?.(this.context, this.trigger);\n }\n };\n\n private onMouseUp = (e: Event) => {\n e.preventDefault();\n this.removeDocumentEvents();\n if (this.handler.onDragEnd?.(this.context, e as MouseEvent, this.initValue)) {\n this.onSubmit?.(this.context, this.trigger);\n }\n };\n}\n"]}
@@ -24,4 +24,4 @@ import type { Rect } from 'roosterjs-content-model-types';
24
24
  * @param additionalRects additional rects to use
25
25
  * @returns If the Rect is valid return the rect, if not, return null.
26
26
  */
27
- export default function getIntersectedRect(elements: HTMLElement[], additionalRects?: Rect[]): Rect | null;
27
+ export declare function getIntersectedRect(elements: HTMLElement[], additionalRects?: Rect[]): Rect | null;
@@ -1,5 +1,5 @@
1
1
  import { __read, __spreadArray } from "tslib";
2
- import normalizeRect from './normalizeRect';
2
+ import { normalizeRect } from 'roosterjs-content-model-dom';
3
3
  /**
4
4
  * Get the intersected Rect of elements provided
5
5
  *
@@ -25,7 +25,7 @@ import normalizeRect from './normalizeRect';
25
25
  * @param additionalRects additional rects to use
26
26
  * @returns If the Rect is valid return the rect, if not, return null.
27
27
  */
28
- export default function getIntersectedRect(elements, additionalRects) {
28
+ export function getIntersectedRect(elements, additionalRects) {
29
29
  if (additionalRects === void 0) { additionalRects = []; }
30
30
  var rects = elements
31
31
  .map(function (element) { return normalizeRect(element.getBoundingClientRect()); })
@@ -1 +1 @@
1
- {"version":3,"file":"getIntersectedRect.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/pluginUtils/Rect/getIntersectedRect.ts"],"names":[],"mappings":";AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACtC,QAAuB,EACvB,eAA4B;IAA5B,gCAAA,EAAA,oBAA4B;IAE5B,IAAM,KAAK,GAAG,QAAQ;SACjB,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,aAAa,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,EAA9C,CAA8C,CAAC;SAC9D,MAAM,CAAC,eAAe,CAAC;SACvB,MAAM,CAAC,UAAA,OAAO,IAAI,OAAA,CAAC,CAAC,OAAO,EAAT,CAAS,CAAW,CAAC;IAE5C,IAAM,MAAM,GAAS;QACjB,GAAG,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,EAAL,CAAK,CAAC,UAAC;QACvC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,EAAR,CAAQ,CAAC,UAAC;QAC7C,IAAI,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC,UAAC;QACzC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,2BAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,EAAP,CAAO,CAAC,UAAC;KAC9C,CAAC;IAEF,OAAO,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC","sourcesContent":["import normalizeRect from './normalizeRect';\nimport type { Rect } from 'roosterjs-content-model-types';\n\n/**\n * Get the intersected Rect of elements provided\n *\n * @example\n * The result of the following Elements Rects would be:\n {\n top: Element2.top,\n bottom: Element1.bottom,\n left: Element2.left,\n right: Element2.right\n }\n +-------------------------+\n | Element 1 |\n | +-----------------+ |\n | | Element2 | |\n | | | |\n | | | |\n +-------------------------+\n | |\n +-----------------+\n * @internal\n * @param elements Elements to use.\n * @param additionalRects additional rects to use\n * @returns If the Rect is valid return the rect, if not, return null.\n */\nexport default function getIntersectedRect(\n elements: HTMLElement[],\n additionalRects: Rect[] = []\n): Rect | null {\n const rects = elements\n .map(element => normalizeRect(element.getBoundingClientRect()))\n .concat(additionalRects)\n .filter(element => !!element) as Rect[];\n\n const result: Rect = {\n top: Math.max(...rects.map(r => r.top)),\n bottom: Math.min(...rects.map(r => r.bottom)),\n left: Math.max(...rects.map(r => r.left)),\n right: Math.min(...rects.map(r => r.right)),\n };\n\n return result.top < result.bottom && result.left < result.right ? result : null;\n}\n"]}
1
+ {"version":3,"file":"getIntersectedRect.js","sourceRoot":"","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AAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC","sourcesContent":["import { normalizeRect } from 'roosterjs-content-model-dom';\nimport type { Rect } from 'roosterjs-content-model-types';\n\n/**\n * Get the intersected Rect of elements provided\n *\n * @example\n * The result of the following Elements Rects would be:\n {\n top: Element2.top,\n bottom: Element1.bottom,\n left: Element2.left,\n right: Element2.right\n }\n +-------------------------+\n | Element 1 |\n | +-----------------+ |\n | | Element2 | |\n | | | |\n | | | |\n +-------------------------+\n | |\n +-----------------+\n * @internal\n * @param elements Elements to use.\n * @param additionalRects additional rects to use\n * @returns If the Rect is valid return the rect, if not, return null.\n */\nexport function getIntersectedRect(\n elements: HTMLElement[],\n additionalRects: Rect[] = []\n): Rect | null {\n const rects = elements\n .map(element => normalizeRect(element.getBoundingClientRect()))\n .concat(additionalRects)\n .filter(element => !!element) as Rect[];\n\n const result: Rect = {\n top: Math.max(...rects.map(r => r.top)),\n bottom: Math.min(...rects.map(r => r.bottom)),\n left: Math.max(...rects.map(r => r.left)),\n right: Math.min(...rects.map(r => r.right)),\n };\n\n return result.top < result.bottom && result.left < result.right ? result : null;\n}\n"]}
@@ -0,0 +1,44 @@
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Definition of the shortcut key
4
+ */
5
+ export interface ShortcutKeyDefinition {
6
+ /**
7
+ * Modifier key for this shortcut, allowed values are:
8
+ * ctrl: Ctrl key (or Meta key on MacOS)
9
+ * alt: Alt key
10
+ */
11
+ modifierKey: 'ctrl' | 'alt';
12
+ /**
13
+ * Whether ALT key is required for this shortcut
14
+ */
15
+ shiftKey: boolean;
16
+ /**
17
+ * Key code for this shortcut. The value should be the value of KeyboardEvent.which
18
+ * We are still using key code here rather than key name (event.key) although event.which is deprecated because of globalization.
19
+ * For example, on US keyboard, Shift+Comma="<" but on Spanish keyboard it is ":"
20
+ * And we still want the shortcut key to be registered on the same key, in that case key name is different but key code keeps the same.
21
+ */
22
+ which: number;
23
+ }
24
+ /**
25
+ * Represents a command for shortcut
26
+ */
27
+ export interface ShortcutCommand {
28
+ /**
29
+ * Definition of the shortcut key
30
+ */
31
+ shortcutKey: ShortcutKeyDefinition;
32
+ /**
33
+ * @optional Required environment for this command
34
+ * all: (Default) This feature is available for all environments
35
+ * mac: This feature is available on MacOS only
36
+ * nonMac: This feature is available on OS other than MacOS
37
+ */
38
+ environment?: 'all' | 'mac' | 'nonMac';
39
+ /**
40
+ * The callback function to invoke when this shortcut is triggered
41
+ * @param editor The editor object
42
+ */
43
+ onClick: (editor: IEditor) => void;
44
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ShortcutCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutCommand.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-plugins/lib/shortcut/ShortcutCommand.ts"],"names":[],"mappings":"","sourcesContent":["import type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Definition of the shortcut key\n */\nexport interface ShortcutKeyDefinition {\n /**\n * Modifier key for this shortcut, allowed values are:\n * ctrl: Ctrl key (or Meta key on MacOS)\n * alt: Alt key\n */\n modifierKey: 'ctrl' | 'alt';\n\n /**\n * Whether ALT key is required for this shortcut\n */\n shiftKey: boolean;\n\n /**\n * Key code for this shortcut. The value should be the value of KeyboardEvent.which\n * We are still using key code here rather than key name (event.key) although event.which is deprecated because of globalization.\n * For example, on US keyboard, Shift+Comma=\"<\" but on Spanish keyboard it is \":\"\n * And we still want the shortcut key to be registered on the same key, in that case key name is different but key code keeps the same.\n */\n which: number;\n}\n\n/**\n * Represents a command for shortcut\n */\nexport interface ShortcutCommand {\n /**\n * Definition of the shortcut key\n */\n shortcutKey: ShortcutKeyDefinition;\n\n /**\n * @optional Required environment for this command\n * all: (Default) This feature is available for all environments\n * mac: This feature is available on MacOS only\n * nonMac: This feature is available on OS other than MacOS\n */\n environment?: 'all' | 'mac' | 'nonMac';\n\n /**\n * The callback function to invoke when this shortcut is triggered\n * @param editor The editor object\n */\n onClick: (editor: IEditor) => void;\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import type { ShortcutCommand } from './ShortcutCommand';
2
+ import type { EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types';
3
+ /**
4
+ * Shortcut plugin hook on the specified shortcut keys and trigger related format API
5
+ */
6
+ export declare class ShortcutPlugin implements EditorPlugin {
7
+ private shortcuts;
8
+ private editor;
9
+ private isMac;
10
+ /**
11
+ * Create a new instance of ShortcutPlugin
12
+ * @param [shortcuts=defaultShortcuts] Allowed commands
13
+ */
14
+ constructor(shortcuts?: ShortcutCommand[]);
15
+ /**
16
+ * Get name of this plugin
17
+ */
18
+ getName(): string;
19
+ /**
20
+ * The first method that editor will call to a plugin when editor is initializing.
21
+ * It will pass in the editor instance, plugin should take this chance to save the
22
+ * editor reference so that it can call to any editor method or format API later.
23
+ * @param editor The editor object
24
+ */
25
+ initialize(editor: IEditor): void;
26
+ /**
27
+ * The last method that editor will call to a plugin before it is disposed.
28
+ * Plugin can take this chance to clear the reference to editor. After this method is
29
+ * called, plugin should not call to any editor method since it will result in error.
30
+ */
31
+ dispose(): void;
32
+ /**
33
+ * Check if the plugin should handle the given event exclusively.
34
+ * Handle an event exclusively means other plugin will not receive this event in
35
+ * onPluginEvent method.
36
+ * If two plugins will return true in willHandleEventExclusively() for the same event,
37
+ * the final result depends on the order of the plugins are added into editor
38
+ * @param event The event to check:
39
+ */
40
+ willHandleEventExclusively(event: PluginEvent): boolean;
41
+ /**
42
+ * Core method for a plugin. Once an event happens in editor, editor will call this
43
+ * method of each plugin to handle the event as long as the event is not handled
44
+ * exclusively by another plugin.
45
+ * @param event The event to handle:
46
+ */
47
+ onPluginEvent(event: PluginEvent): void;
48
+ private cacheGetCommand;
49
+ private matchOS;
50
+ private matchShortcut;
51
+ }
@@ -0,0 +1,117 @@
1
+ import { cacheGetEventData } from 'roosterjs-content-model-core';
2
+ import { ShortcutBold, ShortcutBullet, ShortcutClearFormat, ShortcutDecreaseFont, ShortcutIncreaseFont, ShortcutIndentList, ShortcutItalic, ShortcutNumbering, ShortcutOutdentList, ShortcutRedo, ShortcutRedoMacOS, ShortcutUnderline, ShortcutUndo, ShortcutUndo2, } from './shortcuts';
3
+ var defaultShortcuts = [
4
+ ShortcutBold,
5
+ ShortcutItalic,
6
+ ShortcutUnderline,
7
+ ShortcutClearFormat,
8
+ ShortcutUndo,
9
+ ShortcutUndo2,
10
+ ShortcutRedo,
11
+ ShortcutRedoMacOS,
12
+ ShortcutBullet,
13
+ ShortcutNumbering,
14
+ ShortcutIncreaseFont,
15
+ ShortcutDecreaseFont,
16
+ ShortcutIndentList,
17
+ ShortcutOutdentList,
18
+ ];
19
+ var CommandCacheKey = '__ShortcutCommandCache';
20
+ /**
21
+ * Shortcut plugin hook on the specified shortcut keys and trigger related format API
22
+ */
23
+ var ShortcutPlugin = /** @class */ (function () {
24
+ /**
25
+ * Create a new instance of ShortcutPlugin
26
+ * @param [shortcuts=defaultShortcuts] Allowed commands
27
+ */
28
+ function ShortcutPlugin(shortcuts) {
29
+ if (shortcuts === void 0) { shortcuts = defaultShortcuts; }
30
+ this.shortcuts = shortcuts;
31
+ this.editor = null;
32
+ this.isMac = false;
33
+ }
34
+ /**
35
+ * Get name of this plugin
36
+ */
37
+ ShortcutPlugin.prototype.getName = function () {
38
+ return 'Shortcut';
39
+ };
40
+ /**
41
+ * The first method that editor will call to a plugin when editor is initializing.
42
+ * It will pass in the editor instance, plugin should take this chance to save the
43
+ * editor reference so that it can call to any editor method or format API later.
44
+ * @param editor The editor object
45
+ */
46
+ ShortcutPlugin.prototype.initialize = function (editor) {
47
+ this.editor = editor;
48
+ this.isMac = !!this.editor.getEnvironment().isMac;
49
+ };
50
+ /**
51
+ * The last method that editor will call to a plugin before it is disposed.
52
+ * Plugin can take this chance to clear the reference to editor. After this method is
53
+ * called, plugin should not call to any editor method since it will result in error.
54
+ */
55
+ ShortcutPlugin.prototype.dispose = function () {
56
+ this.editor = null;
57
+ };
58
+ /**
59
+ * Check if the plugin should handle the given event exclusively.
60
+ * Handle an event exclusively means other plugin will not receive this event in
61
+ * onPluginEvent method.
62
+ * If two plugins will return true in willHandleEventExclusively() for the same event,
63
+ * the final result depends on the order of the plugins are added into editor
64
+ * @param event The event to check:
65
+ */
66
+ ShortcutPlugin.prototype.willHandleEventExclusively = function (event) {
67
+ return (event.eventType == 'keyDown' &&
68
+ (event.rawEvent.ctrlKey || event.rawEvent.altKey || event.rawEvent.metaKey) &&
69
+ !!this.cacheGetCommand(event));
70
+ };
71
+ /**
72
+ * Core method for a plugin. Once an event happens in editor, editor will call this
73
+ * method of each plugin to handle the event as long as the event is not handled
74
+ * exclusively by another plugin.
75
+ * @param event The event to handle:
76
+ */
77
+ ShortcutPlugin.prototype.onPluginEvent = function (event) {
78
+ if (this.editor && event.eventType == 'keyDown') {
79
+ var command = this.cacheGetCommand(event);
80
+ if (command) {
81
+ command.onClick(this.editor);
82
+ event.rawEvent.preventDefault();
83
+ }
84
+ }
85
+ };
86
+ ShortcutPlugin.prototype.cacheGetCommand = function (event) {
87
+ var _this = this;
88
+ return cacheGetEventData(event, CommandCacheKey, function (event) {
89
+ var editor = _this.editor;
90
+ return (editor &&
91
+ _this.shortcuts.filter(function (command) {
92
+ return _this.matchOS(command.environment) &&
93
+ _this.matchShortcut(command.shortcutKey, event.rawEvent);
94
+ })[0]);
95
+ });
96
+ };
97
+ ShortcutPlugin.prototype.matchOS = function (environment) {
98
+ switch (environment) {
99
+ case 'mac':
100
+ return this.isMac;
101
+ case 'nonMac':
102
+ return !this.isMac;
103
+ default:
104
+ return true;
105
+ }
106
+ };
107
+ ShortcutPlugin.prototype.matchShortcut = function (shortcutKey, event) {
108
+ var ctrlKey = event.ctrlKey, altKey = event.altKey, shiftKey = event.shiftKey, which = event.which, metaKey = event.metaKey;
109
+ var ctrlOrMeta = this.isMac ? metaKey : ctrlKey;
110
+ var matchModifier = (shortcutKey.modifierKey == 'ctrl' && ctrlOrMeta && !altKey) ||
111
+ (shortcutKey.modifierKey == 'alt' && altKey && !ctrlOrMeta);
112
+ return matchModifier && shiftKey == shortcutKey.shiftKey && shortcutKey.which == which;
113
+ };
114
+ return ShortcutPlugin;
115
+ }());
116
+ export { ShortcutPlugin };
117
+ //# sourceMappingURL=ShortcutPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutPlugin.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-plugins/lib/shortcut/ShortcutPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EACH,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,aAAa,GAChB,MAAM,aAAa,CAAC;AAQrB,IAAM,gBAAgB,GAAsB;IACxC,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,iBAAiB;IACjB,cAAc;IACd,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;CACtB,CAAC;AACF,IAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD;;GAEG;AACH;IAII;;;OAGG;IACH,wBAAoB,SAA+C;QAA/C,0BAAA,EAAA,4BAA+C;QAA/C,cAAS,GAAT,SAAS,CAAsC;QAP3D,WAAM,GAAmB,IAAI,CAAC;QAC9B,UAAK,GAAG,KAAK,CAAC;IAMgD,CAAC;IAEvE;;OAEG;IACH,gCAAO,GAAP;QACI,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;;;OAKG;IACH,mCAAU,GAAV,UAAW,MAAe;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,I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C9D,CAAC,CAAC,CAAC,CACP,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,gCAAO,GAAf,UAAgB,WAAsC;QAClD,QAAQ,WAAW,EAAE;YACjB,KAAK,KAAK;gBACN,OAAO,IAAI,CAAC,KAAK,CAAC;YAEtB,KAAK,QAAQ;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAEvB;gBACI,OAAO,IAAI,CAAC;SACnB;IACL,CAAC;IAEO,sCAAa,GAArB,UAAsB,WAAkC,EAAE,KAAoB;QAClE,IAAA,OAAO,GAAuC,KAAK,QAA5C,EAAE,MAAM,GAA+B,KAAK,OAApC,EAAE,QAAQ,GAAqB,KAAK,SAA1B,EAAE,KAAK,GAAc,KAAK,MAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;QAC5D,IAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAClD,IAAM,aAAa,GACf,CAAC,WAAW,CAAC,WAAW,IAAI,MAAM,IAAI,UAAU,IAAI,CAAC,MAAM,CAAC;YAC5D,CAAC,WAAW,CAAC,WAAW,IAAI,KAAK,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhE,OAAO,aAAa,IAAI,QAAQ,IAAI,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,KAAK,IAAI,KAAK,CAAC;IAC3F,CAAC;IACL,qBAAC;AAAD,CAAC,AA3GD,IA2GC","sourcesContent":["import { cacheGetEventData } from 'roosterjs-content-model-core';\nimport type { ShortcutCommand, ShortcutKeyDefinition } from './ShortcutCommand';\nimport {\n ShortcutBold,\n ShortcutBullet,\n ShortcutClearFormat,\n ShortcutDecreaseFont,\n ShortcutIncreaseFont,\n ShortcutIndentList,\n ShortcutItalic,\n ShortcutNumbering,\n ShortcutOutdentList,\n ShortcutRedo,\n ShortcutRedoMacOS,\n ShortcutUnderline,\n ShortcutUndo,\n ShortcutUndo2,\n} from './shortcuts';\nimport type {\n EditorPlugin,\n IEditor,\n KeyDownEvent,\n PluginEvent,\n} from 'roosterjs-content-model-types';\n\nconst defaultShortcuts: ShortcutCommand[] = [\n ShortcutBold,\n ShortcutItalic,\n ShortcutUnderline,\n ShortcutClearFormat,\n ShortcutUndo,\n ShortcutUndo2,\n ShortcutRedo,\n ShortcutRedoMacOS,\n ShortcutBullet,\n ShortcutNumbering,\n ShortcutIncreaseFont,\n ShortcutDecreaseFont,\n ShortcutIndentList,\n ShortcutOutdentList,\n];\nconst CommandCacheKey = '__ShortcutCommandCache';\n\n/**\n * Shortcut plugin hook on the specified shortcut keys and trigger related format API\n */\nexport class ShortcutPlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n private isMac = false;\n\n /**\n * Create a new instance of ShortcutPlugin\n * @param [shortcuts=defaultShortcuts] Allowed commands\n */\n constructor(private shortcuts: ShortcutCommand[] = defaultShortcuts) {}\n\n /**\n * Get name of this plugin\n */\n getName() {\n return 'Shortcut';\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: IEditor) {\n this.editor = editor;\n this.isMac = !!this.editor.getEnvironment().isMac;\n }\n\n /**\n * The last method that editor will call to a plugin before it is disposed.\n * Plugin can take this chance to clear the reference to editor. After this method is\n * called, plugin should not call to any editor method since it will result in error.\n */\n dispose() {\n this.editor = null;\n }\n\n /**\n * Check if the plugin should handle the given event exclusively.\n * Handle an event exclusively means other plugin will not receive this event in\n * onPluginEvent method.\n * If two plugins will return true in willHandleEventExclusively() for the same event,\n * the final result depends on the order of the plugins are added into editor\n * @param event The event to check:\n */\n willHandleEventExclusively(event: PluginEvent) {\n return (\n event.eventType == 'keyDown' &&\n (event.rawEvent.ctrlKey || event.rawEvent.altKey || event.rawEvent.metaKey) &&\n !!this.cacheGetCommand(event)\n );\n }\n\n /**\n * Core method for a plugin. Once an event happens in editor, editor will call this\n * method of each plugin to handle the event as long as the event is not handled\n * exclusively by another plugin.\n * @param event The event to handle:\n */\n onPluginEvent(event: PluginEvent) {\n if (this.editor && event.eventType == 'keyDown') {\n const command = this.cacheGetCommand(event);\n\n if (command) {\n command.onClick(this.editor);\n event.rawEvent.preventDefault();\n }\n }\n }\n\n private cacheGetCommand(event: KeyDownEvent) {\n return cacheGetEventData(event, CommandCacheKey, event => {\n const editor = this.editor;\n\n return (\n editor &&\n this.shortcuts.filter(\n command =>\n this.matchOS(command.environment) &&\n this.matchShortcut(command.shortcutKey, event.rawEvent)\n )[0]\n );\n });\n }\n\n private matchOS(environment?: 'all' | 'mac' | 'nonMac') {\n switch (environment) {\n case 'mac':\n return this.isMac;\n\n case 'nonMac':\n return !this.isMac;\n\n default:\n return true;\n }\n }\n\n private matchShortcut(shortcutKey: ShortcutKeyDefinition, event: KeyboardEvent) {\n const { ctrlKey, altKey, shiftKey, which, metaKey } = event;\n const ctrlOrMeta = this.isMac ? metaKey : ctrlKey;\n const matchModifier =\n (shortcutKey.modifierKey == 'ctrl' && ctrlOrMeta && !altKey) ||\n (shortcutKey.modifierKey == 'alt' && altKey && !ctrlOrMeta);\n\n return matchModifier && shiftKey == shortcutKey.shiftKey && shortcutKey.which == which;\n }\n}\n"]}
@@ -0,0 +1,85 @@
1
+ import type { ShortcutCommand } from './ShortcutCommand';
2
+ /**
3
+ * Shortcut command for Bold
4
+ * Windows: Ctrl + B
5
+ * MacOS: Meta + B
6
+ */
7
+ export declare const ShortcutBold: ShortcutCommand;
8
+ /**
9
+ * Shortcut command for Italic
10
+ * Windows: Ctrl + I
11
+ * MacOS: Meta + I
12
+ */
13
+ export declare const ShortcutItalic: ShortcutCommand;
14
+ /**
15
+ * Shortcut command for Underline
16
+ * Windows: Ctrl + U
17
+ * MacOS: Meta + U
18
+ */
19
+ export declare const ShortcutUnderline: ShortcutCommand;
20
+ /**
21
+ * Shortcut command for Clear Format
22
+ * Windows: Ctrl + Space
23
+ * MacOS: Meta + Space
24
+ */
25
+ export declare const ShortcutClearFormat: ShortcutCommand;
26
+ /**
27
+ * Shortcut command for Undo 1
28
+ * Windows: Ctrl + Z
29
+ * MacOS: Meta + Z
30
+ */
31
+ export declare const ShortcutUndo: ShortcutCommand;
32
+ /**
33
+ * Shortcut command for Undo 2
34
+ * Windows: Alt + Backspace
35
+ * MacOS: N/A
36
+ */
37
+ export declare const ShortcutUndo2: ShortcutCommand;
38
+ /**
39
+ * Shortcut command for Redo 1
40
+ * Windows: Ctrl + Y
41
+ * MacOS: N/A
42
+ */
43
+ export declare const ShortcutRedo: ShortcutCommand;
44
+ /**
45
+ * Shortcut command for Redo 2
46
+ * Windows: N/A
47
+ * MacOS: Meta + Shift + Z
48
+ */
49
+ export declare const ShortcutRedoMacOS: ShortcutCommand;
50
+ /**
51
+ * Shortcut command for Bullet List
52
+ * Windows: Ctrl + . (Period)
53
+ * MacOS: Meta + . (Period)
54
+ */
55
+ export declare const ShortcutBullet: ShortcutCommand;
56
+ /**
57
+ * Shortcut command for Numbering List
58
+ * Windows: Ctrl + / (Forward slash)
59
+ * MacOS: Meta + / (Forward slash)
60
+ */
61
+ export declare const ShortcutNumbering: ShortcutCommand;
62
+ /**
63
+ * Shortcut command for Increase Font
64
+ * Windows: Ctrl + Shift + . (Period)
65
+ * MacOS: Meta + Shift + . (Period)
66
+ */
67
+ export declare const ShortcutIncreaseFont: ShortcutCommand;
68
+ /**
69
+ * Shortcut command for Decrease Font
70
+ * Windows: Ctrl + Shift + , (Comma)
71
+ * MacOS: Meta + Shift + , (Comma)
72
+ */
73
+ export declare const ShortcutDecreaseFont: ShortcutCommand;
74
+ /**
75
+ * Shortcut command for Intent list
76
+ * Windows: Alt + Shift + Arrow Right
77
+ * MacOS: Option + Shift+ Arrow Right
78
+ */
79
+ export declare const ShortcutIndentList: ShortcutCommand;
80
+ /**
81
+ * Shortcut command for Outdent list
82
+ * Windows: Alt + Shift + Arrow Left
83
+ * MacOS: Option + Shift+ Arrow Left
84
+ */
85
+ export declare const ShortcutOutdentList: ShortcutCommand;