roosterjs-content-model-plugins 0.27.0 → 0.28.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 (431) hide show
  1. package/lib/autoFormat/AutoFormatPlugin.d.ts +9 -0
  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/{keyboardListTrigger.js → list/keyboardListTrigger.js} +17 -15
  22. package/lib/autoFormat/list/keyboardListTrigger.js.map +1 -0
  23. package/lib/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  24. package/lib/contextMenuBase/ContextMenuPluginBase.js +84 -0
  25. package/lib/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  26. package/lib/edit/EditPlugin.js.map +1 -1
  27. package/lib/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  28. package/lib/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  29. package/lib/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  30. package/lib/edit/deleteSteps/deleteEmptyQuote.js +60 -0
  31. package/lib/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  32. package/lib/edit/deleteSteps/deleteList.js +2 -1
  33. package/lib/edit/deleteSteps/deleteList.js.map +1 -1
  34. package/lib/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  35. package/lib/edit/handleKeyboardEventCommon.js.map +1 -1
  36. package/lib/edit/inputSteps/handleEnterOnList.js +1 -1
  37. package/lib/edit/inputSteps/handleEnterOnList.js.map +1 -1
  38. package/lib/edit/keyboardDelete.js +9 -1
  39. package/lib/edit/keyboardDelete.js.map +1 -1
  40. package/lib/edit/keyboardInput.js +2 -1
  41. package/lib/edit/keyboardInput.js.map +1 -1
  42. package/lib/edit/keyboardTab.js.map +1 -1
  43. package/lib/edit/tabUtils/handleTabOnList.js.map +1 -1
  44. package/lib/edit/tabUtils/handleTabOnParagraph.js +7 -0
  45. package/lib/edit/tabUtils/handleTabOnParagraph.js.map +1 -1
  46. package/lib/edit/utils/getLeafSiblingBlock.js.map +1 -1
  47. package/lib/index.d.ts +2 -1
  48. package/lib/index.js +5 -1
  49. package/lib/index.js.map +1 -1
  50. package/lib/paste/Excel/processPastedContentFromExcel.js +1 -1
  51. package/lib/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  52. package/lib/paste/PastePlugin.js +6 -6
  53. package/lib/paste/PastePlugin.js.map +1 -1
  54. package/lib/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  55. package/lib/paste/WacComponents/constants.js.map +1 -1
  56. package/lib/paste/WacComponents/processPastedContentWacComponents.js +6 -6
  57. package/lib/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  58. package/lib/paste/WordDesktop/WordMetadata.js.map +1 -1
  59. package/lib/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  60. package/lib/paste/WordDesktop/getStyleMetadata.js +2 -1
  61. package/lib/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  62. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js +5 -17
  63. package/lib/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  64. package/lib/paste/WordDesktop/processWordComments.js.map +1 -1
  65. package/lib/paste/WordDesktop/processWordLists.js.map +1 -1
  66. package/lib/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  67. package/lib/paste/pasteSourceValidations/constants.js.map +1 -1
  68. package/lib/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  69. package/lib/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  70. package/lib/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  71. package/lib/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  72. package/lib/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  73. package/lib/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  74. package/lib/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  75. package/lib/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  76. package/lib/paste/utils/addParser.d.ts +1 -1
  77. package/lib/paste/utils/addParser.js +2 -1
  78. package/lib/paste/utils/addParser.js.map +1 -1
  79. package/lib/paste/utils/deprecatedColorParser.js.map +1 -1
  80. package/lib/paste/utils/getStyles.js.map +1 -1
  81. package/lib/paste/utils/linkParser.js.map +1 -1
  82. package/lib/paste/utils/setProcessor.js.map +1 -1
  83. package/lib/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  84. package/lib/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  85. package/lib/pluginUtils/CreateElement/createElement.d.ts +2 -2
  86. package/lib/pluginUtils/CreateElement/createElement.js +2 -1
  87. package/lib/pluginUtils/CreateElement/createElement.js.map +1 -1
  88. package/lib/pluginUtils/Disposable.d.ts +1 -1
  89. package/lib/pluginUtils/Disposable.js.map +1 -1
  90. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  91. package/lib/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  92. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  93. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js +2 -1
  94. package/lib/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  95. package/lib/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  96. package/lib/pluginUtils/Rect/getIntersectedRect.js +4 -3
  97. package/lib/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  98. package/lib/shortcut/ShortcutCommand.js.map +1 -1
  99. package/lib/shortcut/ShortcutPlugin.js +2 -0
  100. package/lib/shortcut/ShortcutPlugin.js.map +1 -1
  101. package/lib/shortcut/shortcuts.d.ts +12 -0
  102. package/lib/shortcut/shortcuts.js +34 -1
  103. package/lib/shortcut/shortcuts.js.map +1 -1
  104. package/lib/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  105. package/lib/shortcut/utils/setShortcutIndentationCommand.js +22 -0
  106. package/lib/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  107. package/lib/tableEdit/TableEditPlugin.js +5 -5
  108. package/lib/tableEdit/TableEditPlugin.js.map +1 -1
  109. package/lib/tableEdit/editors/TableEditor.d.ts +1 -1
  110. package/lib/tableEdit/editors/TableEditor.js +17 -17
  111. package/lib/tableEdit/editors/TableEditor.js.map +1 -1
  112. package/lib/tableEdit/editors/features/CellResizer.d.ts +2 -2
  113. package/lib/tableEdit/editors/features/CellResizer.js +7 -7
  114. package/lib/tableEdit/editors/features/CellResizer.js.map +1 -1
  115. package/{lib-mjs/tableEdit/editors/features/TableEditorFeature.d.ts → lib/tableEdit/editors/features/TableEditFeature.d.ts} +2 -2
  116. package/lib/tableEdit/editors/features/{TableEditorFeature.js → TableEditFeature.js} +1 -1
  117. package/lib/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  118. package/lib/tableEdit/editors/features/TableInserter.d.ts +2 -2
  119. package/lib/tableEdit/editors/features/TableInserter.js +5 -5
  120. package/lib/tableEdit/editors/features/TableInserter.js.map +1 -1
  121. package/lib/tableEdit/editors/features/TableMover.d.ts +2 -2
  122. package/lib/tableEdit/editors/features/TableMover.js +6 -6
  123. package/lib/tableEdit/editors/features/TableMover.js.map +1 -1
  124. package/lib/tableEdit/editors/features/TableResizer.d.ts +2 -2
  125. package/lib/tableEdit/editors/features/TableResizer.js +11 -8
  126. package/lib/tableEdit/editors/features/TableResizer.js.map +1 -1
  127. package/lib-amd/autoFormat/AutoFormatPlugin.d.ts +9 -0
  128. package/lib-amd/autoFormat/AutoFormatPlugin.js +21 -4
  129. package/lib-amd/autoFormat/AutoFormatPlugin.js.map +1 -1
  130. package/lib-amd/autoFormat/link/createLink.d.ts +5 -0
  131. package/lib-amd/autoFormat/link/createLink.js +26 -0
  132. package/lib-amd/autoFormat/link/createLink.js.map +1 -0
  133. package/lib-amd/autoFormat/link/createLinkAfterSpace.d.ts +5 -0
  134. package/lib-amd/autoFormat/link/createLinkAfterSpace.js +38 -0
  135. package/lib-amd/autoFormat/link/createLinkAfterSpace.js.map +1 -0
  136. package/lib-amd/autoFormat/link/getLinkSegment.d.ts +5 -0
  137. package/lib-amd/autoFormat/link/getLinkSegment.js +27 -0
  138. package/lib-amd/autoFormat/link/getLinkSegment.js.map +1 -0
  139. package/lib-amd/autoFormat/link/unlink.d.ts +5 -0
  140. package/lib-amd/autoFormat/link/unlink.js +21 -0
  141. package/lib-amd/autoFormat/link/unlink.js.map +1 -0
  142. package/lib-amd/autoFormat/list/convertAlphaToDecimals.js.map +1 -0
  143. package/lib-amd/autoFormat/list/getIndex.js.map +1 -0
  144. package/lib-amd/autoFormat/{utils → list}/getListTypeStyle.js +3 -0
  145. package/lib-amd/autoFormat/list/getListTypeStyle.js.map +1 -0
  146. package/lib-amd/autoFormat/list/getNumberingListStyle.js.map +1 -0
  147. package/lib-amd/autoFormat/list/keyboardListTrigger.js +46 -0
  148. package/lib-amd/autoFormat/list/keyboardListTrigger.js.map +1 -0
  149. package/lib-amd/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  150. package/lib-amd/contextMenuBase/ContextMenuPluginBase.js +86 -0
  151. package/lib-amd/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  152. package/lib-amd/edit/EditPlugin.js.map +1 -1
  153. package/lib-amd/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  154. package/lib-amd/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  155. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  156. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.js +60 -0
  157. package/lib-amd/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  158. package/lib-amd/edit/deleteSteps/deleteList.js +2 -1
  159. package/lib-amd/edit/deleteSteps/deleteList.js.map +1 -1
  160. package/lib-amd/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  161. package/lib-amd/edit/handleKeyboardEventCommon.js.map +1 -1
  162. package/lib-amd/edit/inputSteps/handleEnterOnList.js +1 -1
  163. package/lib-amd/edit/inputSteps/handleEnterOnList.js.map +1 -1
  164. package/lib-amd/edit/keyboardDelete.js +9 -2
  165. package/lib-amd/edit/keyboardDelete.js.map +1 -1
  166. package/lib-amd/edit/keyboardInput.js +2 -2
  167. package/lib-amd/edit/keyboardInput.js.map +1 -1
  168. package/lib-amd/edit/keyboardTab.js.map +1 -1
  169. package/lib-amd/edit/tabUtils/handleTabOnList.js.map +1 -1
  170. package/lib-amd/edit/tabUtils/handleTabOnParagraph.js +7 -0
  171. package/lib-amd/edit/tabUtils/handleTabOnParagraph.js.map +1 -1
  172. package/lib-amd/edit/utils/getLeafSiblingBlock.js.map +1 -1
  173. package/lib-amd/index.d.ts +2 -1
  174. package/lib-amd/index.js +5 -2
  175. package/lib-amd/index.js.map +1 -1
  176. package/lib-amd/paste/Excel/processPastedContentFromExcel.js +1 -1
  177. package/lib-amd/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  178. package/lib-amd/paste/PastePlugin.js +6 -6
  179. package/lib-amd/paste/PastePlugin.js.map +1 -1
  180. package/lib-amd/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  181. package/lib-amd/paste/WacComponents/constants.js.map +1 -1
  182. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js +6 -6
  183. package/lib-amd/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  184. package/lib-amd/paste/WordDesktop/WordMetadata.js.map +1 -1
  185. package/lib-amd/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  186. package/lib-amd/paste/WordDesktop/getStyleMetadata.js +2 -1
  187. package/lib-amd/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  188. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js +5 -17
  189. package/lib-amd/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  190. package/lib-amd/paste/WordDesktop/processWordComments.js.map +1 -1
  191. package/lib-amd/paste/WordDesktop/processWordLists.js.map +1 -1
  192. package/lib-amd/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  193. package/lib-amd/paste/pasteSourceValidations/constants.js.map +1 -1
  194. package/lib-amd/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  195. package/lib-amd/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  196. package/lib-amd/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  197. package/lib-amd/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  198. package/lib-amd/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  199. package/lib-amd/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  200. package/lib-amd/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  201. package/lib-amd/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  202. package/lib-amd/paste/utils/addParser.d.ts +1 -1
  203. package/lib-amd/paste/utils/addParser.js +2 -1
  204. package/lib-amd/paste/utils/addParser.js.map +1 -1
  205. package/lib-amd/paste/utils/deprecatedColorParser.js.map +1 -1
  206. package/lib-amd/paste/utils/getStyles.js.map +1 -1
  207. package/lib-amd/paste/utils/linkParser.js.map +1 -1
  208. package/lib-amd/paste/utils/setProcessor.js.map +1 -1
  209. package/lib-amd/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  210. package/lib-amd/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  211. package/lib-amd/pluginUtils/CreateElement/createElement.d.ts +2 -2
  212. package/lib-amd/pluginUtils/CreateElement/createElement.js +2 -1
  213. package/lib-amd/pluginUtils/CreateElement/createElement.js.map +1 -1
  214. package/lib-amd/pluginUtils/Disposable.d.ts +1 -1
  215. package/lib-amd/pluginUtils/Disposable.js.map +1 -1
  216. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  217. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  218. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  219. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js +2 -1
  220. package/lib-amd/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  221. package/lib-amd/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  222. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js +4 -3
  223. package/lib-amd/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  224. package/lib-amd/shortcut/ShortcutCommand.js.map +1 -1
  225. package/lib-amd/shortcut/ShortcutPlugin.js +2 -0
  226. package/lib-amd/shortcut/ShortcutPlugin.js.map +1 -1
  227. package/lib-amd/shortcut/shortcuts.d.ts +12 -0
  228. package/lib-amd/shortcut/shortcuts.js +34 -2
  229. package/lib-amd/shortcut/shortcuts.js.map +1 -1
  230. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  231. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.js +22 -0
  232. package/lib-amd/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  233. package/lib-amd/tableEdit/TableEditPlugin.js +5 -4
  234. package/lib-amd/tableEdit/TableEditPlugin.js.map +1 -1
  235. package/lib-amd/tableEdit/editors/TableEditor.d.ts +1 -1
  236. package/lib-amd/tableEdit/editors/TableEditor.js +17 -16
  237. package/lib-amd/tableEdit/editors/TableEditor.js.map +1 -1
  238. package/lib-amd/tableEdit/editors/features/CellResizer.d.ts +2 -2
  239. package/lib-amd/tableEdit/editors/features/CellResizer.js +8 -7
  240. package/lib-amd/tableEdit/editors/features/CellResizer.js.map +1 -1
  241. package/lib-amd/tableEdit/editors/features/{TableEditorFeature.d.ts → TableEditFeature.d.ts} +2 -2
  242. package/lib-amd/tableEdit/editors/features/{TableEditorFeature.js → TableEditFeature.js} +1 -1
  243. package/lib-amd/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  244. package/lib-amd/tableEdit/editors/features/TableInserter.d.ts +2 -2
  245. package/lib-amd/tableEdit/editors/features/TableInserter.js +6 -5
  246. package/lib-amd/tableEdit/editors/features/TableInserter.js.map +1 -1
  247. package/lib-amd/tableEdit/editors/features/TableMover.d.ts +2 -2
  248. package/lib-amd/tableEdit/editors/features/TableMover.js +7 -6
  249. package/lib-amd/tableEdit/editors/features/TableMover.js.map +1 -1
  250. package/lib-amd/tableEdit/editors/features/TableResizer.d.ts +2 -2
  251. package/lib-amd/tableEdit/editors/features/TableResizer.js +12 -8
  252. package/lib-amd/tableEdit/editors/features/TableResizer.js.map +1 -1
  253. package/lib-mjs/autoFormat/AutoFormatPlugin.d.ts +9 -0
  254. package/lib-mjs/autoFormat/AutoFormatPlugin.js +24 -4
  255. package/lib-mjs/autoFormat/AutoFormatPlugin.js.map +1 -1
  256. package/lib-mjs/autoFormat/link/createLink.d.ts +5 -0
  257. package/lib-mjs/autoFormat/link/createLink.js +22 -0
  258. package/lib-mjs/autoFormat/link/createLink.js.map +1 -0
  259. package/lib-mjs/autoFormat/link/createLinkAfterSpace.d.ts +5 -0
  260. package/lib-mjs/autoFormat/link/createLinkAfterSpace.js +35 -0
  261. package/lib-mjs/autoFormat/link/createLinkAfterSpace.js.map +1 -0
  262. package/lib-mjs/autoFormat/link/getLinkSegment.d.ts +5 -0
  263. package/lib-mjs/autoFormat/link/getLinkSegment.js +23 -0
  264. package/lib-mjs/autoFormat/link/getLinkSegment.js.map +1 -0
  265. package/lib-mjs/autoFormat/link/unlink.d.ts +5 -0
  266. package/lib-mjs/autoFormat/link/unlink.js +16 -0
  267. package/lib-mjs/autoFormat/link/unlink.js.map +1 -0
  268. package/lib-mjs/autoFormat/list/convertAlphaToDecimals.js.map +1 -0
  269. package/lib-mjs/autoFormat/list/getIndex.js.map +1 -0
  270. package/lib-mjs/autoFormat/{utils → list}/getListTypeStyle.js +3 -0
  271. package/lib-mjs/autoFormat/list/getListTypeStyle.js.map +1 -0
  272. package/lib-mjs/autoFormat/list/getNumberingListStyle.js.map +1 -0
  273. package/lib-mjs/autoFormat/{keyboardListTrigger.js → list/keyboardListTrigger.js} +17 -15
  274. package/lib-mjs/autoFormat/list/keyboardListTrigger.js.map +1 -0
  275. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.d.ts +58 -0
  276. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.js +81 -0
  277. package/lib-mjs/contextMenuBase/ContextMenuPluginBase.js.map +1 -0
  278. package/lib-mjs/edit/EditPlugin.js.map +1 -1
  279. package/lib-mjs/edit/deleteSteps/deleteAllSegmentBefore.js.map +1 -1
  280. package/lib-mjs/edit/deleteSteps/deleteCollapsedSelection.js.map +1 -1
  281. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.d.ts +5 -0
  282. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.js +56 -0
  283. package/lib-mjs/edit/deleteSteps/deleteEmptyQuote.js.map +1 -0
  284. package/lib-mjs/edit/deleteSteps/deleteList.js +2 -1
  285. package/lib-mjs/edit/deleteSteps/deleteList.js.map +1 -1
  286. package/lib-mjs/edit/deleteSteps/deleteWordSelection.js.map +1 -1
  287. package/lib-mjs/edit/handleKeyboardEventCommon.js.map +1 -1
  288. package/lib-mjs/edit/inputSteps/handleEnterOnList.js +1 -1
  289. package/lib-mjs/edit/inputSteps/handleEnterOnList.js.map +1 -1
  290. package/lib-mjs/edit/keyboardDelete.js +9 -1
  291. package/lib-mjs/edit/keyboardDelete.js.map +1 -1
  292. package/lib-mjs/edit/keyboardInput.js +2 -1
  293. package/lib-mjs/edit/keyboardInput.js.map +1 -1
  294. package/lib-mjs/edit/keyboardTab.js.map +1 -1
  295. package/lib-mjs/edit/tabUtils/handleTabOnList.js.map +1 -1
  296. package/lib-mjs/edit/tabUtils/handleTabOnParagraph.js +7 -0
  297. package/lib-mjs/edit/tabUtils/handleTabOnParagraph.js.map +1 -1
  298. package/lib-mjs/edit/utils/getLeafSiblingBlock.js.map +1 -1
  299. package/lib-mjs/index.d.ts +2 -1
  300. package/lib-mjs/index.js +2 -1
  301. package/lib-mjs/index.js.map +1 -1
  302. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js +1 -1
  303. package/lib-mjs/paste/Excel/processPastedContentFromExcel.js.map +1 -1
  304. package/lib-mjs/paste/PastePlugin.js +1 -1
  305. package/lib-mjs/paste/PastePlugin.js.map +1 -1
  306. package/lib-mjs/paste/PowerPoint/processPastedContentFromPowerPoint.js.map +1 -1
  307. package/lib-mjs/paste/WacComponents/constants.js.map +1 -1
  308. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js +1 -1
  309. package/lib-mjs/paste/WacComponents/processPastedContentWacComponents.js.map +1 -1
  310. package/lib-mjs/paste/WordDesktop/WordMetadata.js.map +1 -1
  311. package/lib-mjs/paste/WordDesktop/getStyleMetadata.d.ts +1 -1
  312. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js +1 -1
  313. package/lib-mjs/paste/WordDesktop/getStyleMetadata.js.map +1 -1
  314. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js +2 -14
  315. package/lib-mjs/paste/WordDesktop/processPastedContentFromWordDesktop.js.map +1 -1
  316. package/lib-mjs/paste/WordDesktop/processWordComments.js.map +1 -1
  317. package/lib-mjs/paste/WordDesktop/processWordLists.js.map +1 -1
  318. package/lib-mjs/paste/WordDesktop/removeNegativeTextIndentParser.js.map +1 -1
  319. package/lib-mjs/paste/pasteSourceValidations/constants.js.map +1 -1
  320. package/lib-mjs/paste/pasteSourceValidations/documentContainWacElements.js.map +1 -1
  321. package/lib-mjs/paste/pasteSourceValidations/getPasteSource.js.map +1 -1
  322. package/lib-mjs/paste/pasteSourceValidations/isExcelDesktopDocument.js.map +1 -1
  323. package/lib-mjs/paste/pasteSourceValidations/isExcelOnlineDocument.js.map +1 -1
  324. package/lib-mjs/paste/pasteSourceValidations/isGoogleSheetDocument.js.map +1 -1
  325. package/lib-mjs/paste/pasteSourceValidations/isPowerPointDesktopDocument.js.map +1 -1
  326. package/lib-mjs/paste/pasteSourceValidations/isWordDesktopDocument.js.map +1 -1
  327. package/lib-mjs/paste/pasteSourceValidations/shouldConvertToSingleImage.js.map +1 -1
  328. package/lib-mjs/paste/utils/addParser.d.ts +1 -1
  329. package/lib-mjs/paste/utils/addParser.js +1 -1
  330. package/lib-mjs/paste/utils/addParser.js.map +1 -1
  331. package/lib-mjs/paste/utils/deprecatedColorParser.js.map +1 -1
  332. package/lib-mjs/paste/utils/getStyles.js.map +1 -1
  333. package/lib-mjs/paste/utils/linkParser.js.map +1 -1
  334. package/lib-mjs/paste/utils/setProcessor.js.map +1 -1
  335. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.d.ts +1 -1
  336. package/lib-mjs/pluginUtils/CreateElement/CreateElementData.js.map +1 -1
  337. package/lib-mjs/pluginUtils/CreateElement/createElement.d.ts +2 -2
  338. package/lib-mjs/pluginUtils/CreateElement/createElement.js +1 -1
  339. package/lib-mjs/pluginUtils/CreateElement/createElement.js.map +1 -1
  340. package/lib-mjs/pluginUtils/Disposable.d.ts +1 -1
  341. package/lib-mjs/pluginUtils/Disposable.js.map +1 -1
  342. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.d.ts +1 -1
  343. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHandler.js.map +1 -1
  344. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.d.ts +3 -3
  345. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js +1 -1
  346. package/lib-mjs/pluginUtils/DragAndDrop/DragAndDropHelper.js.map +1 -1
  347. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.d.ts +1 -1
  348. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js +2 -2
  349. package/lib-mjs/pluginUtils/Rect/getIntersectedRect.js.map +1 -1
  350. package/lib-mjs/shortcut/ShortcutCommand.js.map +1 -1
  351. package/lib-mjs/shortcut/ShortcutPlugin.js +3 -1
  352. package/lib-mjs/shortcut/ShortcutPlugin.js.map +1 -1
  353. package/lib-mjs/shortcut/shortcuts.d.ts +12 -0
  354. package/lib-mjs/shortcut/shortcuts.js +33 -0
  355. package/lib-mjs/shortcut/shortcuts.js.map +1 -1
  356. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.d.ts +5 -0
  357. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.js +18 -0
  358. package/lib-mjs/shortcut/utils/setShortcutIndentationCommand.js.map +1 -0
  359. package/lib-mjs/tableEdit/TableEditPlugin.js +4 -4
  360. package/lib-mjs/tableEdit/TableEditPlugin.js.map +1 -1
  361. package/lib-mjs/tableEdit/editors/TableEditor.d.ts +1 -1
  362. package/lib-mjs/tableEdit/editors/TableEditor.js +7 -8
  363. package/lib-mjs/tableEdit/editors/TableEditor.js.map +1 -1
  364. package/lib-mjs/tableEdit/editors/features/CellResizer.d.ts +2 -2
  365. package/lib-mjs/tableEdit/editors/features/CellResizer.js +4 -5
  366. package/lib-mjs/tableEdit/editors/features/CellResizer.js.map +1 -1
  367. package/{lib/tableEdit/editors/features/TableEditorFeature.d.ts → lib-mjs/tableEdit/editors/features/TableEditFeature.d.ts} +2 -2
  368. package/lib-mjs/tableEdit/editors/features/{TableEditorFeature.js → TableEditFeature.js} +1 -1
  369. package/lib-mjs/tableEdit/editors/features/TableEditFeature.js.map +1 -0
  370. package/lib-mjs/tableEdit/editors/features/TableInserter.d.ts +2 -2
  371. package/lib-mjs/tableEdit/editors/features/TableInserter.js +4 -5
  372. package/lib-mjs/tableEdit/editors/features/TableInserter.js.map +1 -1
  373. package/lib-mjs/tableEdit/editors/features/TableMover.d.ts +2 -2
  374. package/lib-mjs/tableEdit/editors/features/TableMover.js +4 -5
  375. package/lib-mjs/tableEdit/editors/features/TableMover.js.map +1 -1
  376. package/lib-mjs/tableEdit/editors/features/TableResizer.d.ts +2 -2
  377. package/lib-mjs/tableEdit/editors/features/TableResizer.js +7 -5
  378. package/lib-mjs/tableEdit/editors/features/TableResizer.js.map +1 -1
  379. package/package.json +5 -5
  380. package/lib/autoFormat/keyboardListTrigger.js.map +0 -1
  381. package/lib/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  382. package/lib/autoFormat/utils/getIndex.js.map +0 -1
  383. package/lib/autoFormat/utils/getListTypeStyle.js.map +0 -1
  384. package/lib/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  385. package/lib/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  386. package/lib/pluginUtils/Rect/normalizeRect.js +0 -20
  387. package/lib/pluginUtils/Rect/normalizeRect.js.map +0 -1
  388. package/lib/tableEdit/editors/features/TableEditorFeature.js.map +0 -1
  389. package/lib-amd/autoFormat/keyboardListTrigger.js +0 -44
  390. package/lib-amd/autoFormat/keyboardListTrigger.js.map +0 -1
  391. package/lib-amd/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  392. package/lib-amd/autoFormat/utils/getIndex.js.map +0 -1
  393. package/lib-amd/autoFormat/utils/getListTypeStyle.js.map +0 -1
  394. package/lib-amd/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  395. package/lib-amd/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  396. package/lib-amd/pluginUtils/Rect/normalizeRect.js +0 -22
  397. package/lib-amd/pluginUtils/Rect/normalizeRect.js.map +0 -1
  398. package/lib-amd/tableEdit/editors/features/TableEditorFeature.js.map +0 -1
  399. package/lib-mjs/autoFormat/keyboardListTrigger.js.map +0 -1
  400. package/lib-mjs/autoFormat/utils/convertAlphaToDecimals.js.map +0 -1
  401. package/lib-mjs/autoFormat/utils/getIndex.js.map +0 -1
  402. package/lib-mjs/autoFormat/utils/getListTypeStyle.js.map +0 -1
  403. package/lib-mjs/autoFormat/utils/getNumberingListStyle.js.map +0 -1
  404. package/lib-mjs/pluginUtils/Rect/normalizeRect.d.ts +0 -7
  405. package/lib-mjs/pluginUtils/Rect/normalizeRect.js +0 -17
  406. package/lib-mjs/pluginUtils/Rect/normalizeRect.js.map +0 -1
  407. package/lib-mjs/tableEdit/editors/features/TableEditorFeature.js.map +0 -1
  408. /package/lib/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  409. /package/lib/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  410. /package/lib/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  411. /package/lib/autoFormat/{utils → list}/getIndex.js +0 -0
  412. /package/lib/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  413. /package/lib/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  414. /package/lib/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
  415. /package/lib/autoFormat/{keyboardListTrigger.d.ts → list/keyboardListTrigger.d.ts} +0 -0
  416. /package/lib-amd/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  417. /package/lib-amd/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  418. /package/lib-amd/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  419. /package/lib-amd/autoFormat/{utils → list}/getIndex.js +0 -0
  420. /package/lib-amd/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  421. /package/lib-amd/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  422. /package/lib-amd/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
  423. /package/lib-amd/autoFormat/{keyboardListTrigger.d.ts → list/keyboardListTrigger.d.ts} +0 -0
  424. /package/lib-mjs/autoFormat/{utils → list}/convertAlphaToDecimals.d.ts +0 -0
  425. /package/lib-mjs/autoFormat/{utils → list}/convertAlphaToDecimals.js +0 -0
  426. /package/lib-mjs/autoFormat/{utils → list}/getIndex.d.ts +0 -0
  427. /package/lib-mjs/autoFormat/{utils → list}/getIndex.js +0 -0
  428. /package/lib-mjs/autoFormat/{utils → list}/getListTypeStyle.d.ts +0 -0
  429. /package/lib-mjs/autoFormat/{utils → list}/getNumberingListStyle.d.ts +0 -0
  430. /package/lib-mjs/autoFormat/{utils → list}/getNumberingListStyle.js +0 -0
  431. /package/lib-mjs/autoFormat/{keyboardListTrigger.d.ts → list/keyboardListTrigger.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addParser = void 0;
3
4
  /**
4
5
  * @internal
5
6
  */
@@ -13,5 +14,5 @@ function addParser(domToModelOption, entry, additionalFormatParsers) {
13
14
  }
14
15
  (_a = domToModelOption.additionalFormatParsers[entry]) === null || _a === void 0 ? void 0 : _a.push(additionalFormatParsers);
15
16
  }
16
- exports.default = addParser;
17
+ exports.addParser = addParser;
17
18
  //# sourceMappingURL=addParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/addParser.ts"],"names":[],"mappings":";;AAOA;;GAEG;AACH,SAAwB,SAAS,CAC7B,gBAAkC,EAClC,KAAW,EACX,uBAAkE;;IAElE,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE;QAC3C,gBAAgB,CAAC,uBAAuB,GAAG,EAAE,CAAC;KACjD;IACD,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAClD,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;KACxD;IAED,MAAA,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnF,CAAC;AAbD,4BAaC","sourcesContent":["import type {\n ContentModelFormatMap,\n DomToModelOption,\n FormatParser,\n ElementFormatParserPerCategory,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport default function addParser<TKey extends keyof ElementFormatParserPerCategory>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>\n) {\n if (!domToModelOption.additionalFormatParsers) {\n domToModelOption.additionalFormatParsers = {};\n }\n if (!domToModelOption.additionalFormatParsers[entry]) {\n domToModelOption.additionalFormatParsers[entry] = [];\n }\n\n domToModelOption.additionalFormatParsers[entry]?.push(additionalFormatParsers);\n}\n"]}
1
+ {"version":3,"file":"addParser.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/paste/utils/addParser.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,SAAgB,SAAS,CACrB,gBAAkC,EAClC,KAAW,EACX,uBAAkE;;IAElE,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE;QAC3C,gBAAgB,CAAC,uBAAuB,GAAG,EAAE,CAAC;KACjD;IACD,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAClD,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;KACxD;IAED,MAAA,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,0CAAE,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnF,CAAC;AAbD,8BAaC","sourcesContent":["import type {\n ContentModelFormatMap,\n DomToModelOption,\n FormatParser,\n ElementFormatParserPerCategory,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function addParser<TKey extends keyof ElementFormatParserPerCategory>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n additionalFormatParsers: FormatParser<ContentModelFormatMap[TKey]>\n) {\n if (!domToModelOption.additionalFormatParsers) {\n domToModelOption.additionalFormatParsers = {};\n }\n if (!domToModelOption.additionalFormatParsers[entry]) {\n domToModelOption.additionalFormatParsers[entry] = [];\n }\n\n domToModelOption.additionalFormatParsers[entry]?.push(additionalFormatParsers);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecatedColorParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/deprecatedColorParser.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAG3E;;GAEG;AACI,IAAM,2BAA2B,GAA+B,UACnE,MAAoB;IAEpB,wCAAU,CAAC,OAAO,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAW,EAAE,CAAC;QACvB,IACI,KAAK;YACL,8CAAgB,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,EAA9C,CAA8C,CAAC,EACjF;YACE,IAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YACtD,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SAC1B;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAdW,QAAA,2BAA2B,+BActC","sourcesContent":["import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';\nimport type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const deprecatedBorderColorParser: FormatParser<BorderFormat> = (\n format: BorderFormat\n): void => {\n BorderKeys.forEach(key => {\n const value = format[key];\n let color: string = '';\n if (\n value &&\n DeprecatedColors.some(dColor => value.indexOf(dColor) > -1 && (color = dColor))\n ) {\n const newValue = value.replace(color, '').trimRight();\n format[key] = newValue;\n }\n });\n};\n"]}
1
+ {"version":3,"file":"deprecatedColorParser.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/paste/utils/deprecatedColorParser.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAG3E;;GAEG;AACI,IAAM,2BAA2B,GAA+B,UACnE,MAAoB;IAEpB,wCAAU,CAAC,OAAO,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAW,EAAE,CAAC;QACvB,IACI,KAAK;YACL,8CAAgB,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,EAA9C,CAA8C,CAAC,EACjF;YACE,IAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;YACtD,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SAC1B;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAdW,QAAA,2BAA2B,+BActC","sourcesContent":["import { BorderKeys, DeprecatedColors } from 'roosterjs-content-model-dom';\nimport type { BorderFormat, FormatParser } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const deprecatedBorderColorParser: FormatParser<BorderFormat> = (\n format: BorderFormat\n): void => {\n BorderKeys.forEach(key => {\n const value = format[key];\n let color: string = '';\n if (\n value &&\n DeprecatedColors.some(dColor => value.indexOf(dColor) > -1 && (color = dColor))\n ) {\n const newValue = value.replace(color, '').trimRight();\n format[key] = newValue;\n }\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/getStyles.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAoB;IAC1C,IAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;IACnD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;QACzB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,IAAI,KAAK,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;SACtC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC;AAZD,8BAYC","sourcesContent":["/**\n * @internal\n * Get CSS styles of a given element in name-value pair format\n * @param element The element to get styles from\n */\nexport function getStyles(element: HTMLElement): Record<string, string> {\n const result: Record<string, string> = {};\n const style = element?.getAttribute('style') || '';\n style.split(';').forEach(pair => {\n const valueIndex = pair.indexOf(':');\n const name = pair.slice(0, valueIndex);\n const value = pair.slice(valueIndex + 1);\n if (name && value) {\n result[name.trim()] = value.trim();\n }\n });\n return result;\n}\n"]}
1
+ {"version":3,"file":"getStyles.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/paste/utils/getStyles.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAoB;IAC1C,IAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;IACnD,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;QACzB,IAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,IAAI,IAAI,KAAK,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;SACtC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC;AAZD,8BAYC","sourcesContent":["/**\n * @internal\n * Get CSS styles of a given element in name-value pair format\n * @param element The element to get styles from\n */\nexport function getStyles(element: HTMLElement): Record<string, string> {\n const result: Record<string, string> = {};\n const style = element?.getAttribute('style') || '';\n style.split(';').forEach(pair => {\n const valueIndex = pair.indexOf(':');\n const name = pair.slice(0, valueIndex);\n const value = pair.slice(valueIndex + 1);\n if (name && value) {\n result[name.trim()] = value.trim();\n }\n });\n return result;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"linkParser.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/linkParser.ts"],"names":[],"mappings":";;;AAAA,2EAA8D;AAG9D,IAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjF,IAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAEtD;;GAEG;AACI,IAAM,SAAS,GAA8C,UAAC,MAAM,EAAE,OAAO;IAChF,IAAI,CAAC,IAAA,6CAAe,EAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAChC,OAAO;KACV;IAED,IAAI,GAAoB,CAAC;IACzB,IAAI;QACA,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC/B;IAAC,WAAM;QACJ,GAAG,GAAG,SAAS,CAAC;KACnB;IAED,IACI,CAAC,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EACxC;QACE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;KACpB;AACL,CAAC,CAAC;AAnBW,QAAA,SAAS,aAmBpB","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\nimport type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';\n\nconst SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];\nconst INVALID_LINKS_REGEX = /^file:\\/\\/\\/[a-zA-Z\\/]/i;\n\n/**\n * @internal\n */\nexport const parseLink: FormatParser<ContentModelHyperLinkFormat> = (format, element) => {\n if (!isElementOfType(element, 'a')) {\n return;\n }\n\n let url: URL | undefined;\n try {\n url = new URL(element.href);\n } catch {\n url = undefined;\n }\n\n if (\n (url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||\n INVALID_LINKS_REGEX.test(element.href)\n ) {\n element.removeAttribute('href');\n format.href = '';\n }\n};\n"]}
1
+ {"version":3,"file":"linkParser.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/paste/utils/linkParser.ts"],"names":[],"mappings":";;;AAAA,2EAA8D;AAG9D,IAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjF,IAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAEtD;;GAEG;AACI,IAAM,SAAS,GAA8C,UAAC,MAAM,EAAE,OAAO;IAChF,IAAI,CAAC,IAAA,6CAAe,EAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAChC,OAAO;KACV;IAED,IAAI,GAAoB,CAAC;IACzB,IAAI;QACA,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC/B;IAAC,WAAM;QACJ,GAAG,GAAG,SAAS,CAAC;KACnB;IAED,IACI,CAAC,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EACxC;QACE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;KACpB;AACL,CAAC,CAAC;AAnBW,QAAA,SAAS,aAmBpB","sourcesContent":["import { isElementOfType } from 'roosterjs-content-model-dom';\nimport type { ContentModelHyperLinkFormat, FormatParser } from 'roosterjs-content-model-types';\n\nconst SUPPORTED_PROTOCOLS = ['http:', 'https:', 'notes:', 'mailto:', 'onenote:'];\nconst INVALID_LINKS_REGEX = /^file:\\/\\/\\/[a-zA-Z\\/]/i;\n\n/**\n * @internal\n */\nexport const parseLink: FormatParser<ContentModelHyperLinkFormat> = (format, element) => {\n if (!isElementOfType(element, 'a')) {\n return;\n }\n\n let url: URL | undefined;\n try {\n url = new URL(element.href);\n } catch {\n url = undefined;\n }\n\n if (\n (url && SUPPORTED_PROTOCOLS.indexOf(url.protocol) === -1) ||\n INVALID_LINKS_REGEX.test(element.href)\n ) {\n element.removeAttribute('href');\n format.href = '';\n }\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setProcessor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-plugins/lib/paste/utils/setProcessor.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,YAAY,CACxB,gBAAkC,EAClC,KAAW,EACX,iBAAqD;IAErD,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC3C;IAED,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC;AAClE,CAAC;AAVD,oCAUC","sourcesContent":["import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setProcessor<TKey extends keyof ElementProcessorMap>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n processorOverride: Partial<ElementProcessorMap>[TKey]\n) {\n if (!domToModelOption.processorOverride) {\n domToModelOption.processorOverride = {};\n }\n\n domToModelOption.processorOverride[entry] = processorOverride;\n}\n"]}
1
+ {"version":3,"file":"setProcessor.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/paste/utils/setProcessor.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,YAAY,CACxB,gBAAkC,EAClC,KAAW,EACX,iBAAqD;IAErD,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE;QACrC,gBAAgB,CAAC,iBAAiB,GAAG,EAAE,CAAC;KAC3C;IAED,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC;AAClE,CAAC;AAVD,oCAUC","sourcesContent":["import type { DomToModelOption, ElementProcessorMap } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setProcessor<TKey extends keyof ElementProcessorMap>(\n domToModelOption: DomToModelOption,\n entry: TKey,\n processorOverride: Partial<ElementProcessorMap>[TKey]\n) {\n if (!domToModelOption.processorOverride) {\n domToModelOption.processorOverride = {};\n }\n\n domToModelOption.processorOverride[entry] = processorOverride;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @internal
3
3
  * An interface represents the data for creating element used by createElement()
4
4
  */
5
- export default interface CreateElementData {
5
+ export interface CreateElementData {
6
6
  /**
7
7
  * Tag name of this element.
8
8
  * It can be just a tag, or in format "namespace:tag"
@@ -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;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createElement = void 0;
3
4
  var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
4
5
  /**
5
6
  * @internal
@@ -47,5 +48,5 @@ function createElement(elementData, document) {
47
48
  }
48
49
  return result;
49
50
  }
50
- exports.default = createElement;
51
+ exports.createElement = createElement;
51
52
  //# sourceMappingURL=createElement.js.map
@@ -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,2EAA0E;AAG1E;;;;;;GAMG;AACH,SAAwB,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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cesContent":["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,2EAA0E;AAG1E;;;;;;GAMG;AACH,SAAgB,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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D,sCA4CC","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;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DragAndDropHelper = void 0;
3
4
  var tslib_1 = require("tslib");
4
5
  /**
5
6
  * Generate event names and getXY function based on different platforms to be compatible with desktop and mobile browsers
@@ -116,5 +117,5 @@ var DragAndDropHelper = /** @class */ (function () {
116
117
  };
117
118
  return DragAndDropHelper;
118
119
  }());
119
- exports.default = DragAndDropHelper;
120
+ exports.DragAndDropHelper = DragAndDropHelper;
120
121
  //# 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,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;QACpB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;KACvB;IACD,OAAO,CAAC,KA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AAC;;;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 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;A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,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;AAjFY,8CAAiB","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,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIntersectedRect = void 0;
3
4
  var tslib_1 = require("tslib");
4
- var normalizeRect_1 = require("./normalizeRect");
5
+ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
5
6
  /**
6
7
  * Get the intersected Rect of elements provided
7
8
  *
@@ -30,7 +31,7 @@ var normalizeRect_1 = require("./normalizeRect");
30
31
  function getIntersectedRect(elements, additionalRects) {
31
32
  if (additionalRects === void 0) { additionalRects = []; }
32
33
  var rects = elements
33
- .map(function (element) { return (0, normalizeRect_1.default)(element.getBoundingClientRect()); })
34
+ .map(function (element) { return (0, roosterjs_content_model_dom_1.normalizeRect)(element.getBoundingClientRect()); })
34
35
  .concat(additionalRects)
35
36
  .filter(function (element) { return !!element; });
36
37
  var result = {
@@ -41,5 +42,5 @@ function getIntersectedRect(elements, additionalRects) {
41
42
  };
42
43
  return result.top < result.bottom && result.left < result.right ? result : null;
43
44
  }
44
- exports.default = getIntersectedRect;
45
+ exports.getIntersectedRect = getIntersectedRect;
45
46
  //# sourceMappingURL=getIntersectedRect.js.map
@@ -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,iDAA4C;AAG5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAwB,kBAAkB,CACtC,QAAuB,EACvB,eAA4B;IAA5B,gCAAA,EAAA,oBAA4B;IAE5B,IAAM,KAAK,GAAG,QAAQ;SACjB,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,IAAA,uBAAa,EAAC,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,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,EAAL,CAAK,CAAC,UAAC;QACvC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,EAAR,CAAQ,CAAC,UAAC;QAC7C,IAAI,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC,UAAC;QACzC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,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;AAjBD,qCAiBC","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":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/pluginUtils/Rect/getIntersectedRect.ts"],"names":[],"mappings":";;;;AAAA,2EAA4D;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,kBAAkB,CAC9B,QAAuB,EACvB,eAA4B;IAA5B,gCAAA,EAAA,oBAA4B;IAE5B,IAAM,KAAK,GAAG,QAAQ;SACjB,GAAG,CAAC,UAAA,OAAO,IAAI,OAAA,IAAA,2CAAa,EAAC,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,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,EAAL,CAAK,CAAC,UAAC;QACvC,MAAM,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,EAAR,CAAQ,CAAC,UAAC;QAC7C,IAAI,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC,UAAC;QACzC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAR,IAAI,qDAAQ,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;AAjBD,gDAiBC","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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutCommand.js","sourceRoot":"","sources":["../../../../packages-content-model/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"]}
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"]}
@@ -16,6 +16,8 @@ var defaultShortcuts = [
16
16
  shortcuts_1.ShortcutNumbering,
17
17
  shortcuts_1.ShortcutIncreaseFont,
18
18
  shortcuts_1.ShortcutDecreaseFont,
19
+ shortcuts_1.ShortcutIndentList,
20
+ shortcuts_1.ShortcutOutdentList,
19
21
  ];
20
22
  var CommandCacheKey = '__ShortcutCommandCache';
21
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ShortcutPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/shortcut/Short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AO,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;AA3GY,wCAAc","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 ShortcutItalic,\n ShortcutNumbering,\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];\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"]}
1
+ {"version":3,"file":"ShortcutPlugin.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-plugins/lib/shortcut/ShortcutPlugin.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAEjE,yCAeqB;AAQrB,IAAM,gBAAgB,GAAsB;IACxC,wBAAY;IACZ,0BAAc;IACd,6BAAiB;IACjB,+BAAmB;IACnB,wBAAY;IACZ,yBAAa;IACb,wBAAY;IACZ,6BAAiB;IACjB,0BAAc;IACd,6BAAiB;IACjB,gCAAoB;IACpB,gCAAoB;IACpB,8BAAkB;IAClB,+BAAmB;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,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,gCAAO,GAAP;QACI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,mDAA0B,GAA1B,UAA2B,KAAkB;QACzC,OAAO,CACH,KAAK,CAAC,SAAS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,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;AA3GY,wCAAc","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"]}
@@ -71,3 +71,15 @@ export declare const ShortcutIncreaseFont: ShortcutCommand;
71
71
  * MacOS: Meta + Shift + , (Comma)
72
72
  */
73
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;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShortcutDecreaseFont = exports.ShortcutIncreaseFont = exports.ShortcutNumbering = exports.ShortcutBullet = exports.ShortcutRedoMacOS = exports.ShortcutRedo = exports.ShortcutUndo2 = exports.ShortcutUndo = exports.ShortcutClearFormat = exports.ShortcutUnderline = exports.ShortcutItalic = exports.ShortcutBold = void 0;
3
+ exports.ShortcutOutdentList = exports.ShortcutIndentList = exports.ShortcutDecreaseFont = exports.ShortcutIncreaseFont = exports.ShortcutNumbering = exports.ShortcutBullet = exports.ShortcutRedoMacOS = exports.ShortcutRedo = exports.ShortcutUndo2 = exports.ShortcutUndo = exports.ShortcutClearFormat = exports.ShortcutUnderline = exports.ShortcutItalic = exports.ShortcutBold = void 0;
4
4
  var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
5
+ var setShortcutIndentationCommand_1 = require("./utils/setShortcutIndentationCommand");
5
6
  var roosterjs_content_model_api_1 = require("roosterjs-content-model-api");
6
7
  var Keys;
7
8
  (function (Keys) {
@@ -15,6 +16,8 @@ var Keys;
15
16
  Keys[Keys["COMMA"] = 188] = "COMMA";
16
17
  Keys[Keys["PERIOD"] = 190] = "PERIOD";
17
18
  Keys[Keys["FORWARD_SLASH"] = 191] = "FORWARD_SLASH";
19
+ Keys[Keys["ArrowRight"] = 39] = "ArrowRight";
20
+ Keys[Keys["ArrowLeft"] = 37] = "ArrowLeft";
18
21
  })(Keys || (Keys = {}));
19
22
  /**
20
23
  * Shortcut command for Bold
@@ -175,4 +178,34 @@ exports.ShortcutDecreaseFont = {
175
178
  },
176
179
  onClick: function (editor) { return (0, roosterjs_content_model_api_1.changeFontSize)(editor, 'decrease'); },
177
180
  };
181
+ /**
182
+ * Shortcut command for Intent list
183
+ * Windows: Alt + Shift + Arrow Right
184
+ * MacOS: Option + Shift+ Arrow Right
185
+ */
186
+ exports.ShortcutIndentList = {
187
+ shortcutKey: {
188
+ modifierKey: 'alt',
189
+ shiftKey: true,
190
+ which: 39 /* ArrowRight */,
191
+ },
192
+ onClick: function (editor) {
193
+ (0, setShortcutIndentationCommand_1.setShortcutIndentationCommand)(editor, 'indent');
194
+ },
195
+ };
196
+ /**
197
+ * Shortcut command for Outdent list
198
+ * Windows: Alt + Shift + Arrow Left
199
+ * MacOS: Option + Shift+ Arrow Left
200
+ */
201
+ exports.ShortcutOutdentList = {
202
+ shortcutKey: {
203
+ modifierKey: 'alt',
204
+ shiftKey: true,
205
+ which: 37 /* ArrowLeft */,
206
+ },
207
+ onClick: function (editor) {
208
+ (0, setShortcutIndentationCommand_1.setShortcutIndentationCommand)(editor, 'outdent');
209
+ },
210
+ };
178
211
  //# sourceMappingURL=shortcuts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-plugins/lib/shortcut/shortcuts.ts"],"names":[],"mappings":";;;AAAA,6EAA0D;AAC1D,2EAQqC;AAGrC,IAAW,IAWV;AAXD,WAAW,IAAI;IACX,yCAAa,CAAA;IACb,kCAAU,CAAA;IACV,0BAAM,CAAA;IACN,0BAAM,CAAA;IACN,0BAAM,CAAA;IACN,0BAAM,CAAA;IACN,0BAAM,CAAA;IACN,mCAAW,CAAA;IACX,qCAAY,CAAA;IACZ,mDAAmB,CAAA;AACvB,CAAC,EAXU,IAAI,KAAJ,IAAI,QAWd;AAED;;;;GAIG;AACU,QAAA,YAAY,GAAoB;IACzC,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,YAAQ;KAChB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,wCAAU,EAAC,MAAM,CAAC,EAAlB,CAAkB;CACxC,CAAC;AAEF;;;;GAIG;AACU,QAAA,cAAc,GAAoB;IAC3C,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,YAAQ;KAChB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,0CAAY,EAAC,MAAM,CAAC,EAApB,CAAoB;CAC1C,CAAC;AAEF;;;;GAIG;AACU,QAAA,iBAAiB,GAAoB;IAC9C,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,YAAQ;KAChB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAA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AZ,CAAY;IAC/B,WAAW,EAAE,KAAK;CACrB,CAAC;AAEF;;;;GAIG;AACU,QAAA,cAAc,GAAoB;IAC3C,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,kBAAa;KACrB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,0CAAY,EAAC,MAAM,CAAC,EAApB,CAAoB;CAC1C,CAAC;AAEF;;;;GAIG;AACU,QAAA,iBAAiB,GAAoB;IAC9C,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,yBAAoB;KAC5B;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,6CAAe,EAAC,MAAM,CAAC,EAAvB,CAAuB;CAC7C,CAAC;AAEF;;;;GAIG;AACU,QAAA,oBAAoB,GAAoB;IACjD,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,IAAI;QACd,KAAK,kBAAa;KACrB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,4CAAc,EAAC,MAAM,EAAE,UAAU,CAAC,EAAlC,CAAkC;CACxD,CAAC;AAEF;;;;GAIG;AACU,QAAA,oBAAoB,GAAoB;IACjD,WAAW,EAAE;QACT,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,IAAI;QACd,KAAK,iBAAY;KACpB;IACD,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,IAAA,4CAAc,EAAC,MAAM,EAAE,UAAU,CAAC,EAAlC,CAAkC;CACxD,CAAC","sourcesContent":["import { redo, undo } from 'roosterjs-content-model-core';\nimport {\n changeFontSize,\n clearFormat,\n toggleBold,\n toggleBullet,\n toggleItalic,\n toggleNumbering,\n toggleUnderline,\n} from 'roosterjs-content-model-api';\nimport type { ShortcutCommand } from './ShortcutCommand';\n\nconst enum Keys {\n BACKSPACE = 8,\n SPACE = 32,\n B = 66,\n I = 73,\n U = 85,\n Y = 89,\n Z = 90,\n COMMA = 188,\n PERIOD = 190,\n FORWARD_SLASH = 191,\n}\n\n/**\n * Shortcut command for Bold\n * Windows: Ctrl + B\n * MacOS: Meta + B\n */\nexport const ShortcutBold: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.B,\n },\n onClick: editor => toggleBold(editor),\n};\n\n/**\n * Shortcut command for Italic\n * Windows: Ctrl + I\n * MacOS: Meta + I\n */\nexport const ShortcutItalic: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.I,\n },\n onClick: editor => toggleItalic(editor),\n};\n\n/**\n * Shortcut command for Underline\n * Windows: Ctrl + U\n * MacOS: Meta + U\n */\nexport const ShortcutUnderline: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.U,\n },\n onClick: editor => toggleUnderline(editor),\n};\n\n/**\n * Shortcut command for Clear Format\n * Windows: Ctrl + Space\n * MacOS: Meta + Space\n */\nexport const ShortcutClearFormat: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.SPACE,\n },\n onClick: editor => clearFormat(editor),\n};\n\n/**\n * Shortcut command for Undo 1\n * Windows: Ctrl + Z\n * MacOS: Meta + Z\n */\nexport const ShortcutUndo: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.Z,\n },\n onClick: editor => undo(editor),\n};\n\n/**\n * Shortcut command for Undo 2\n * Windows: Alt + Backspace\n * MacOS: N/A\n */\nexport const ShortcutUndo2: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'alt',\n shiftKey: false,\n which: Keys.BACKSPACE,\n },\n onClick: editor => undo(editor),\n environment: 'nonMac',\n};\n\n/**\n * Shortcut command for Redo 1\n * Windows: Ctrl + Y\n * MacOS: N/A\n */\nexport const ShortcutRedo: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.Y,\n },\n onClick: editor => redo(editor),\n environment: 'nonMac',\n};\n\n/**\n * Shortcut command for Redo 2\n * Windows: N/A\n * MacOS: Meta + Shift + Z\n */\nexport const ShortcutRedoMacOS: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.Z,\n },\n onClick: editor => redo(editor),\n environment: 'mac',\n};\n\n/**\n * Shortcut command for Bullet List\n * Windows: Ctrl + . (Period)\n * MacOS: Meta + . (Period)\n */\nexport const ShortcutBullet: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.PERIOD,\n },\n onClick: editor => toggleBullet(editor),\n};\n\n/**\n * Shortcut command for Numbering List\n * Windows: Ctrl + / (Forward slash)\n * MacOS: Meta + / (Forward slash)\n */\nexport const ShortcutNumbering: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.FORWARD_SLASH,\n },\n onClick: editor => toggleNumbering(editor),\n};\n\n/**\n * Shortcut command for Increase Font\n * Windows: Ctrl + Shift + . (Period)\n * MacOS: Meta + Shift + . (Period)\n */\nexport const ShortcutIncreaseFont: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.PERIOD,\n },\n onClick: editor => changeFontSize(editor, 'increase'),\n};\n\n/**\n * Shortcut command for Decrease Font\n * Windows: Ctrl + Shift + , (Comma)\n * MacOS: Meta + Shift + , (Comma)\n */\nexport const ShortcutDecreaseFont: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.COMMA,\n },\n onClick: editor => changeFontSize(editor, 'decrease'),\n};\n"]}
1
+ {"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-plugins/lib/shortcut/shortcuts.ts"],"names":[],"mappings":";;;AAAA,6EAA0D;AAC1D,uFAA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terjs-content-model-core';\nimport { setShortcutIndentationCommand } from './utils/setShortcutIndentationCommand';\nimport {\n changeFontSize,\n clearFormat,\n toggleBold,\n toggleBullet,\n toggleItalic,\n toggleNumbering,\n toggleUnderline,\n} from 'roosterjs-content-model-api';\nimport type { ShortcutCommand } from './ShortcutCommand';\n\nconst enum Keys {\n BACKSPACE = 8,\n SPACE = 32,\n B = 66,\n I = 73,\n U = 85,\n Y = 89,\n Z = 90,\n COMMA = 188,\n PERIOD = 190,\n FORWARD_SLASH = 191,\n ArrowRight = 39,\n ArrowLeft = 37,\n}\n\n/**\n * Shortcut command for Bold\n * Windows: Ctrl + B\n * MacOS: Meta + B\n */\nexport const ShortcutBold: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.B,\n },\n onClick: editor => toggleBold(editor),\n};\n\n/**\n * Shortcut command for Italic\n * Windows: Ctrl + I\n * MacOS: Meta + I\n */\nexport const ShortcutItalic: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.I,\n },\n onClick: editor => toggleItalic(editor),\n};\n\n/**\n * Shortcut command for Underline\n * Windows: Ctrl + U\n * MacOS: Meta + U\n */\nexport const ShortcutUnderline: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.U,\n },\n onClick: editor => toggleUnderline(editor),\n};\n\n/**\n * Shortcut command for Clear Format\n * Windows: Ctrl + Space\n * MacOS: Meta + Space\n */\nexport const ShortcutClearFormat: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.SPACE,\n },\n onClick: editor => clearFormat(editor),\n};\n\n/**\n * Shortcut command for Undo 1\n * Windows: Ctrl + Z\n * MacOS: Meta + Z\n */\nexport const ShortcutUndo: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.Z,\n },\n onClick: editor => undo(editor),\n};\n\n/**\n * Shortcut command for Undo 2\n * Windows: Alt + Backspace\n * MacOS: N/A\n */\nexport const ShortcutUndo2: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'alt',\n shiftKey: false,\n which: Keys.BACKSPACE,\n },\n onClick: editor => undo(editor),\n environment: 'nonMac',\n};\n\n/**\n * Shortcut command for Redo 1\n * Windows: Ctrl + Y\n * MacOS: N/A\n */\nexport const ShortcutRedo: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.Y,\n },\n onClick: editor => redo(editor),\n environment: 'nonMac',\n};\n\n/**\n * Shortcut command for Redo 2\n * Windows: N/A\n * MacOS: Meta + Shift + Z\n */\nexport const ShortcutRedoMacOS: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.Z,\n },\n onClick: editor => redo(editor),\n environment: 'mac',\n};\n\n/**\n * Shortcut command for Bullet List\n * Windows: Ctrl + . (Period)\n * MacOS: Meta + . (Period)\n */\nexport const ShortcutBullet: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.PERIOD,\n },\n onClick: editor => toggleBullet(editor),\n};\n\n/**\n * Shortcut command for Numbering List\n * Windows: Ctrl + / (Forward slash)\n * MacOS: Meta + / (Forward slash)\n */\nexport const ShortcutNumbering: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: false,\n which: Keys.FORWARD_SLASH,\n },\n onClick: editor => toggleNumbering(editor),\n};\n\n/**\n * Shortcut command for Increase Font\n * Windows: Ctrl + Shift + . (Period)\n * MacOS: Meta + Shift + . (Period)\n */\nexport const ShortcutIncreaseFont: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.PERIOD,\n },\n onClick: editor => changeFontSize(editor, 'increase'),\n};\n\n/**\n * Shortcut command for Decrease Font\n * Windows: Ctrl + Shift + , (Comma)\n * MacOS: Meta + Shift + , (Comma)\n */\nexport const ShortcutDecreaseFont: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'ctrl',\n shiftKey: true,\n which: Keys.COMMA,\n },\n onClick: editor => changeFontSize(editor, 'decrease'),\n};\n\n/**\n * Shortcut command for Intent list\n * Windows: Alt + Shift + Arrow Right\n * MacOS: Option + Shift+ Arrow Right\n */\nexport const ShortcutIndentList: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'alt',\n shiftKey: true,\n which: Keys.ArrowRight,\n },\n onClick: editor => {\n setShortcutIndentationCommand(editor, 'indent');\n },\n};\n\n/**\n * Shortcut command for Outdent list\n * Windows: Alt + Shift + Arrow Left\n * MacOS: Option + Shift+ Arrow Left\n */\nexport const ShortcutOutdentList: ShortcutCommand = {\n shortcutKey: {\n modifierKey: 'alt',\n shiftKey: true,\n which: Keys.ArrowLeft,\n },\n onClick: editor => {\n setShortcutIndentationCommand(editor, 'outdent');\n },\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function setShortcutIndentationCommand(editor: IEditor, operation: 'indent' | 'outdent'): void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setShortcutIndentationCommand = void 0;
4
+ var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
5
+ var roosterjs_content_model_api_1 = require("roosterjs-content-model-api");
6
+ /**
7
+ * @internal
8
+ */
9
+ function setShortcutIndentationCommand(editor, operation) {
10
+ editor.formatContentModel(function (model) {
11
+ var listItem = (0, roosterjs_content_model_core_1.getFirstSelectedListItem)(model);
12
+ if (listItem &&
13
+ listItem.blocks[0].blockType == 'Paragraph' &&
14
+ listItem.blocks[0].segments[0].segmentType == 'SelectionMarker') {
15
+ (0, roosterjs_content_model_api_1.setModelIndentation)(model, operation);
16
+ return true;
17
+ }
18
+ return false;
19
+ });
20
+ }
21
+ exports.setShortcutIndentationCommand = setShortcutIndentationCommand;
22
+ //# sourceMappingURL=setShortcutIndentationCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setShortcutIndentationCommand.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-plugins/lib/shortcut/utils/setShortcutIndentationCommand.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,2EAAkE;AAGlE;;GAEG;AACH,SAAgB,6BAA6B,CAAC,MAAe,EAAE,SAA+B;IAC1F,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK;QAC3B,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;QAEjD,IACI,QAAQ;YACR,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,WAAW;YAC3C,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,iBAAiB,EACjE;YACE,IAAA,iDAAmB,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACtC,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC,CAAC;AACP,CAAC;AAdD,sEAcC","sourcesContent":["import { getFirstSelectedListItem } from 'roosterjs-content-model-core';\nimport { setModelIndentation } from 'roosterjs-content-model-api';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setShortcutIndentationCommand(editor: IEditor, operation: 'indent' | 'outdent') {\n editor.formatContentModel(model => {\n const listItem = getFirstSelectedListItem(model);\n\n if (\n listItem &&\n listItem.blocks[0].blockType == 'Paragraph' &&\n listItem.blocks[0].segments[0].segmentType == 'SelectionMarker'\n ) {\n setModelIndentation(model, operation);\n return true;\n }\n return false;\n });\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TableEditPlugin = void 0;
4
- var normalizeRect_1 = require("../pluginUtils/Rect/normalizeRect");
5
- var TableEditor_1 = require("./editors/TableEditor");
6
4
  var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
5
+ var TableEditor_1 = require("./editors/TableEditor");
7
6
  var TABLE_RESIZER_LENGTH = 12;
8
7
  /**
9
8
  * TableEdit plugin, provides the ability to resize a table by drag-and-drop
@@ -121,10 +120,11 @@ var TableEditPlugin = /** @class */ (function () {
121
120
  this.disposeTableEditor();
122
121
  }
123
122
  if (!this.tableEditor && table && this.editor && table.rows.length > 0) {
123
+ // anchorContainerSelector is used to specify the container to host the plugin, which can be outside of the editor's div
124
124
  var container = this.anchorContainerSelector
125
- ? this.editor.getDOMHelper().queryElements(this.anchorContainerSelector)[0]
125
+ ? this.editor.getDocument().querySelector(this.anchorContainerSelector)
126
126
  : undefined;
127
- this.tableEditor = new TableEditor_1.default(this.editor, table, this.invalidateTableRects, (0, roosterjs_content_model_dom_1.isNodeOfType)(container, 'ELEMENT_NODE') ? container : undefined, event === null || event === void 0 ? void 0 : event.currentTarget);
127
+ this.tableEditor = new TableEditor_1.TableEditor(this.editor, table, this.invalidateTableRects, (0, roosterjs_content_model_dom_1.isNodeOfType)(container, 'ELEMENT_NODE') ? container : undefined, event === null || event === void 0 ? void 0 : event.currentTarget);
128
128
  }
129
129
  };
130
130
  TableEditPlugin.prototype.disposeTableEditor = function () {
@@ -139,7 +139,7 @@ var TableEditPlugin = /** @class */ (function () {
139
139
  var tables = this.editor.getDOMHelper().queryElements('table');
140
140
  tables.forEach(function (table) {
141
141
  if (table.isContentEditable) {
142
- var rect = (0, normalizeRect_1.default)(table.getBoundingClientRect());
142
+ var rect = (0, roosterjs_content_model_dom_1.normalizeRect)(table.getBoundingClientRect());
143
143
  if (rect && _this.tableRectMap) {
144
144
  _this.tableRectMap.push({
145
145
  table: table,