roosterjs-content-model-types 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/lib/context/DarkColorHandler.d.ts +52 -0
  2. package/lib/{pluginState/StandaloneEditorPluginState.js → context/DarkColorHandler.js} +1 -1
  3. package/lib/context/DarkColorHandler.js.map +1 -0
  4. package/lib/context/DomToModelSettings.d.ts +16 -2
  5. package/lib/context/DomToModelSettings.js.map +1 -1
  6. package/lib/context/EditorContext.d.ts +7 -2
  7. package/lib/context/EditorContext.js.map +1 -1
  8. package/lib/context/ModelToDomSettings.d.ts +15 -2
  9. package/lib/context/ModelToDomSettings.js.map +1 -1
  10. package/lib/editor/ContextMenuProvider.d.ts +12 -0
  11. package/lib/{event/ContentModelBeforePasteEvent.js → editor/ContextMenuProvider.js} +1 -1
  12. package/lib/editor/ContextMenuProvider.js.map +1 -0
  13. package/lib/editor/EditorPlugin.d.ts +40 -0
  14. package/lib/{context/ColorManager.js → editor/EditorPlugin.js} +1 -1
  15. package/lib/editor/EditorPlugin.js.map +1 -0
  16. package/lib/editor/IStandaloneEditor.d.ts +20 -5
  17. package/lib/editor/IStandaloneEditor.js.map +1 -1
  18. package/lib/editor/PluginWithState.d.ts +11 -0
  19. package/lib/{event/ContentModelContentChangedEvent.js → editor/PluginWithState.js} +1 -1
  20. package/lib/editor/PluginWithState.js.map +1 -0
  21. package/lib/editor/StandaloneEditorCore.d.ts +8 -4
  22. package/lib/editor/StandaloneEditorCore.js.map +1 -1
  23. package/lib/editor/StandaloneEditorCorePlugins.d.ts +1 -1
  24. package/lib/editor/StandaloneEditorCorePlugins.js.map +1 -1
  25. package/lib/editor/StandaloneEditorOptions.d.ts +11 -6
  26. package/lib/editor/StandaloneEditorOptions.js.map +1 -1
  27. package/lib/event/BasePluginEvent.d.ts +27 -0
  28. package/lib/event/BasePluginEvent.js +3 -0
  29. package/lib/event/BasePluginEvent.js.map +1 -0
  30. package/lib/event/BeforeCutCopyEvent.d.ts +18 -0
  31. package/lib/event/BeforeCutCopyEvent.js +3 -0
  32. package/lib/event/BeforeCutCopyEvent.js.map +1 -0
  33. package/lib/event/BeforeDisposeEvent.d.ts +6 -0
  34. package/lib/event/BeforeDisposeEvent.js +3 -0
  35. package/lib/event/BeforeDisposeEvent.js.map +1 -0
  36. package/lib/event/BeforeKeyboardEditingEvent.d.ts +6 -0
  37. package/lib/event/BeforeKeyboardEditingEvent.js +3 -0
  38. package/lib/event/BeforeKeyboardEditingEvent.js.map +1 -0
  39. package/{lib-amd/event/ContentModelBeforePasteEvent.d.ts → lib/event/BeforePasteEvent.d.ts} +34 -18
  40. package/lib/event/BeforePasteEvent.js +3 -0
  41. package/lib/event/BeforePasteEvent.js.map +1 -0
  42. package/lib/event/BeforeSetContentEvent.d.ts +11 -0
  43. package/lib/event/BeforeSetContentEvent.js +3 -0
  44. package/lib/event/BeforeSetContentEvent.js.map +1 -0
  45. package/{lib-mjs/event/ContentModelContentChangedEvent.d.ts → lib/event/ContentChangedEvent.d.ts} +20 -13
  46. package/lib/event/ContentChangedEvent.js +3 -0
  47. package/lib/event/ContentChangedEvent.js.map +1 -0
  48. package/lib/event/ContextMenuEvent.d.ts +12 -0
  49. package/lib/event/ContextMenuEvent.js +3 -0
  50. package/lib/event/ContextMenuEvent.js.map +1 -0
  51. package/lib/event/EditImageEvent.d.ts +25 -0
  52. package/lib/event/EditImageEvent.js +3 -0
  53. package/lib/event/EditImageEvent.js.map +1 -0
  54. package/lib/event/EditorInputEvent.d.ts +10 -0
  55. package/lib/event/EditorInputEvent.js +3 -0
  56. package/lib/event/EditorInputEvent.js.map +1 -0
  57. package/lib/event/EditorReadyEvent.d.ts +6 -0
  58. package/lib/event/EditorReadyEvent.js +3 -0
  59. package/lib/event/EditorReadyEvent.js.map +1 -0
  60. package/lib/event/EntityOperationEvent.d.ts +52 -0
  61. package/lib/event/EntityOperationEvent.js +3 -0
  62. package/lib/event/EntityOperationEvent.js.map +1 -0
  63. package/lib/event/ExtractContentWithDomEvent.d.ts +14 -0
  64. package/lib/event/ExtractContentWithDomEvent.js +3 -0
  65. package/lib/event/ExtractContentWithDomEvent.js.map +1 -0
  66. package/lib/event/KeyboardEvent.d.ts +25 -0
  67. package/lib/event/KeyboardEvent.js +3 -0
  68. package/lib/event/KeyboardEvent.js.map +1 -0
  69. package/lib/event/MouseEvent.d.ts +15 -0
  70. package/lib/event/MouseEvent.js +3 -0
  71. package/lib/event/MouseEvent.js.map +1 -0
  72. package/lib/event/PluginEvent.d.ts +22 -0
  73. package/lib/event/PluginEvent.js +3 -0
  74. package/lib/event/PluginEvent.js.map +1 -0
  75. package/lib/event/PluginEventData.d.ts +21 -0
  76. package/lib/event/PluginEventData.js +3 -0
  77. package/lib/event/PluginEventData.js.map +1 -0
  78. package/lib/event/PluginEventType.d.ts +103 -0
  79. package/lib/event/PluginEventType.js +3 -0
  80. package/lib/event/PluginEventType.js.map +1 -0
  81. package/lib/event/ScrollEvent.d.ts +10 -0
  82. package/lib/event/ScrollEvent.js +3 -0
  83. package/lib/event/ScrollEvent.js.map +1 -0
  84. package/lib/event/SelectionChangedEvent.d.ts +11 -0
  85. package/lib/event/SelectionChangedEvent.js +3 -0
  86. package/lib/event/SelectionChangedEvent.js.map +1 -0
  87. package/lib/event/ShadowEditEvent.d.ts +11 -0
  88. package/lib/event/ShadowEditEvent.js +3 -0
  89. package/lib/event/ShadowEditEvent.js.map +1 -0
  90. package/lib/event/ZoomChangedEvent.d.ts +16 -0
  91. package/lib/event/ZoomChangedEvent.js +3 -0
  92. package/lib/event/ZoomChangedEvent.js.map +1 -0
  93. package/lib/format/ContentModelBlockFormat.d.ts +2 -1
  94. package/lib/format/ContentModelBlockFormat.js.map +1 -1
  95. package/lib/format/ContentModelFormatMap.d.ts +5 -0
  96. package/lib/format/ContentModelFormatMap.js.map +1 -1
  97. package/lib/format/ContentModelListItemFormat.d.ts +2 -1
  98. package/lib/format/ContentModelListItemFormat.js.map +1 -1
  99. package/lib/format/FormatHandlerTypeMap.d.ts +5 -0
  100. package/lib/format/FormatHandlerTypeMap.js.map +1 -1
  101. package/lib/format/formatParts/BorderFormat.d.ts +16 -0
  102. package/lib/format/formatParts/BorderFormat.js.map +1 -1
  103. package/lib/format/formatParts/SpacingFormat.d.ts +4 -0
  104. package/lib/format/formatParts/SpacingFormat.js.map +1 -1
  105. package/lib/format/formatParts/TextIndentFormat.d.ts +14 -0
  106. package/lib/format/formatParts/TextIndentFormat.js +3 -0
  107. package/lib/format/formatParts/TextIndentFormat.js.map +1 -0
  108. package/lib/index.d.ts +33 -7
  109. package/lib/index.js.map +1 -1
  110. package/lib/parameter/AnnounceData.d.ts +39 -0
  111. package/lib/parameter/AnnounceData.js +3 -0
  112. package/lib/parameter/AnnounceData.js.map +1 -0
  113. package/lib/parameter/DOMEventRecord.d.ts +1 -1
  114. package/lib/parameter/DOMEventRecord.js.map +1 -1
  115. package/lib/parameter/Rect.d.ts +21 -0
  116. package/lib/parameter/Rect.js +3 -0
  117. package/lib/parameter/Rect.js.map +1 -0
  118. package/lib/parameter/Snapshot.d.ts +4 -5
  119. package/lib/parameter/Snapshot.js.map +1 -1
  120. package/lib/parameter/TrustedHTMLHandler.d.ts +4 -0
  121. package/lib/parameter/TrustedHTMLHandler.js +3 -0
  122. package/lib/parameter/TrustedHTMLHandler.js.map +1 -0
  123. package/lib/pluginState/LifecyclePluginState.d.ts +0 -5
  124. package/lib/pluginState/LifecyclePluginState.js.map +1 -1
  125. package/lib/pluginState/PluginState.d.ts +30 -0
  126. package/lib/pluginState/PluginState.js +3 -0
  127. package/lib/pluginState/PluginState.js.map +1 -0
  128. package/lib-amd/context/DarkColorHandler.d.ts +52 -0
  129. package/lib-amd/{pluginState/StandaloneEditorPluginState.js → context/DarkColorHandler.js} +1 -1
  130. package/lib-amd/context/DarkColorHandler.js.map +1 -0
  131. package/lib-amd/context/DomToModelSettings.d.ts +16 -2
  132. package/lib-amd/context/DomToModelSettings.js.map +1 -1
  133. package/lib-amd/context/EditorContext.d.ts +7 -2
  134. package/lib-amd/context/EditorContext.js.map +1 -1
  135. package/lib-amd/context/ModelToDomSettings.d.ts +15 -2
  136. package/lib-amd/context/ModelToDomSettings.js.map +1 -1
  137. package/lib-amd/editor/ContextMenuProvider.d.ts +12 -0
  138. package/lib-amd/{event/ContentModelBeforePasteEvent.js → editor/ContextMenuProvider.js} +1 -1
  139. package/lib-amd/editor/ContextMenuProvider.js.map +1 -0
  140. package/lib-amd/editor/EditorPlugin.d.ts +40 -0
  141. package/lib-amd/{context/ColorManager.js → editor/EditorPlugin.js} +1 -1
  142. package/lib-amd/editor/EditorPlugin.js.map +1 -0
  143. package/lib-amd/editor/IStandaloneEditor.d.ts +20 -5
  144. package/lib-amd/editor/IStandaloneEditor.js.map +1 -1
  145. package/lib-amd/editor/PluginWithState.d.ts +11 -0
  146. package/lib-amd/{event/ContentModelContentChangedEvent.js → editor/PluginWithState.js} +1 -1
  147. package/lib-amd/editor/PluginWithState.js.map +1 -0
  148. package/lib-amd/editor/StandaloneEditorCore.d.ts +8 -4
  149. package/lib-amd/editor/StandaloneEditorCore.js.map +1 -1
  150. package/lib-amd/editor/StandaloneEditorCorePlugins.d.ts +1 -1
  151. package/lib-amd/editor/StandaloneEditorCorePlugins.js.map +1 -1
  152. package/lib-amd/editor/StandaloneEditorOptions.d.ts +11 -6
  153. package/lib-amd/editor/StandaloneEditorOptions.js.map +1 -1
  154. package/lib-amd/event/BasePluginEvent.d.ts +27 -0
  155. package/lib-amd/event/BasePluginEvent.js +5 -0
  156. package/lib-amd/event/BasePluginEvent.js.map +1 -0
  157. package/lib-amd/event/BeforeCutCopyEvent.d.ts +18 -0
  158. package/lib-amd/event/BeforeCutCopyEvent.js +5 -0
  159. package/lib-amd/event/BeforeCutCopyEvent.js.map +1 -0
  160. package/lib-amd/event/BeforeDisposeEvent.d.ts +6 -0
  161. package/lib-amd/event/BeforeDisposeEvent.js +5 -0
  162. package/lib-amd/event/BeforeDisposeEvent.js.map +1 -0
  163. package/lib-amd/event/BeforeKeyboardEditingEvent.d.ts +6 -0
  164. package/lib-amd/event/BeforeKeyboardEditingEvent.js +5 -0
  165. package/lib-amd/event/BeforeKeyboardEditingEvent.js.map +1 -0
  166. package/{lib-mjs/event/ContentModelBeforePasteEvent.d.ts → lib-amd/event/BeforePasteEvent.d.ts} +34 -18
  167. package/lib-amd/event/BeforePasteEvent.js +5 -0
  168. package/lib-amd/event/BeforePasteEvent.js.map +1 -0
  169. package/lib-amd/event/BeforeSetContentEvent.d.ts +11 -0
  170. package/lib-amd/event/BeforeSetContentEvent.js +5 -0
  171. package/lib-amd/event/BeforeSetContentEvent.js.map +1 -0
  172. package/{lib/event/ContentModelContentChangedEvent.d.ts → lib-amd/event/ContentChangedEvent.d.ts} +20 -13
  173. package/lib-amd/event/ContentChangedEvent.js +5 -0
  174. package/lib-amd/event/ContentChangedEvent.js.map +1 -0
  175. package/lib-amd/event/ContextMenuEvent.d.ts +12 -0
  176. package/lib-amd/event/ContextMenuEvent.js +5 -0
  177. package/lib-amd/event/ContextMenuEvent.js.map +1 -0
  178. package/lib-amd/event/EditImageEvent.d.ts +25 -0
  179. package/lib-amd/event/EditImageEvent.js +5 -0
  180. package/lib-amd/event/EditImageEvent.js.map +1 -0
  181. package/lib-amd/event/EditorInputEvent.d.ts +10 -0
  182. package/lib-amd/event/EditorInputEvent.js +5 -0
  183. package/lib-amd/event/EditorInputEvent.js.map +1 -0
  184. package/lib-amd/event/EditorReadyEvent.d.ts +6 -0
  185. package/lib-amd/event/EditorReadyEvent.js +5 -0
  186. package/lib-amd/event/EditorReadyEvent.js.map +1 -0
  187. package/lib-amd/event/EntityOperationEvent.d.ts +52 -0
  188. package/lib-amd/event/EntityOperationEvent.js +5 -0
  189. package/lib-amd/event/EntityOperationEvent.js.map +1 -0
  190. package/lib-amd/event/ExtractContentWithDomEvent.d.ts +14 -0
  191. package/lib-amd/event/ExtractContentWithDomEvent.js +5 -0
  192. package/lib-amd/event/ExtractContentWithDomEvent.js.map +1 -0
  193. package/lib-amd/event/KeyboardEvent.d.ts +25 -0
  194. package/lib-amd/event/KeyboardEvent.js +5 -0
  195. package/lib-amd/event/KeyboardEvent.js.map +1 -0
  196. package/lib-amd/event/MouseEvent.d.ts +15 -0
  197. package/lib-amd/event/MouseEvent.js +5 -0
  198. package/lib-amd/event/MouseEvent.js.map +1 -0
  199. package/lib-amd/event/PluginEvent.d.ts +22 -0
  200. package/lib-amd/event/PluginEvent.js +5 -0
  201. package/lib-amd/event/PluginEvent.js.map +1 -0
  202. package/lib-amd/event/PluginEventData.d.ts +21 -0
  203. package/lib-amd/event/PluginEventData.js +5 -0
  204. package/lib-amd/event/PluginEventData.js.map +1 -0
  205. package/lib-amd/event/PluginEventType.d.ts +103 -0
  206. package/lib-amd/event/PluginEventType.js +5 -0
  207. package/lib-amd/event/PluginEventType.js.map +1 -0
  208. package/lib-amd/event/ScrollEvent.d.ts +10 -0
  209. package/lib-amd/event/ScrollEvent.js +5 -0
  210. package/lib-amd/event/ScrollEvent.js.map +1 -0
  211. package/lib-amd/event/SelectionChangedEvent.d.ts +11 -0
  212. package/lib-amd/event/SelectionChangedEvent.js +5 -0
  213. package/lib-amd/event/SelectionChangedEvent.js.map +1 -0
  214. package/lib-amd/event/ShadowEditEvent.d.ts +11 -0
  215. package/lib-amd/event/ShadowEditEvent.js +5 -0
  216. package/lib-amd/event/ShadowEditEvent.js.map +1 -0
  217. package/lib-amd/event/ZoomChangedEvent.d.ts +16 -0
  218. package/lib-amd/event/ZoomChangedEvent.js +5 -0
  219. package/lib-amd/event/ZoomChangedEvent.js.map +1 -0
  220. package/lib-amd/format/ContentModelBlockFormat.d.ts +2 -1
  221. package/lib-amd/format/ContentModelBlockFormat.js.map +1 -1
  222. package/lib-amd/format/ContentModelFormatMap.d.ts +5 -0
  223. package/lib-amd/format/ContentModelFormatMap.js.map +1 -1
  224. package/lib-amd/format/ContentModelListItemFormat.d.ts +2 -1
  225. package/lib-amd/format/ContentModelListItemFormat.js.map +1 -1
  226. package/lib-amd/format/FormatHandlerTypeMap.d.ts +5 -0
  227. package/lib-amd/format/FormatHandlerTypeMap.js.map +1 -1
  228. package/lib-amd/format/formatParts/BorderFormat.d.ts +16 -0
  229. package/lib-amd/format/formatParts/BorderFormat.js.map +1 -1
  230. package/lib-amd/format/formatParts/SpacingFormat.d.ts +4 -0
  231. package/lib-amd/format/formatParts/SpacingFormat.js.map +1 -1
  232. package/lib-amd/format/formatParts/TextIndentFormat.d.ts +14 -0
  233. package/lib-amd/format/formatParts/TextIndentFormat.js +5 -0
  234. package/lib-amd/format/formatParts/TextIndentFormat.js.map +1 -0
  235. package/lib-amd/index.d.ts +33 -7
  236. package/lib-amd/index.js.map +1 -1
  237. package/lib-amd/parameter/AnnounceData.d.ts +39 -0
  238. package/lib-amd/parameter/AnnounceData.js +5 -0
  239. package/lib-amd/parameter/AnnounceData.js.map +1 -0
  240. package/lib-amd/parameter/DOMEventRecord.d.ts +1 -1
  241. package/lib-amd/parameter/DOMEventRecord.js.map +1 -1
  242. package/lib-amd/parameter/Rect.d.ts +21 -0
  243. package/lib-amd/parameter/Rect.js +5 -0
  244. package/lib-amd/parameter/Rect.js.map +1 -0
  245. package/lib-amd/parameter/Snapshot.d.ts +4 -5
  246. package/lib-amd/parameter/Snapshot.js.map +1 -1
  247. package/lib-amd/parameter/TrustedHTMLHandler.d.ts +4 -0
  248. package/lib-amd/parameter/TrustedHTMLHandler.js +5 -0
  249. package/lib-amd/parameter/TrustedHTMLHandler.js.map +1 -0
  250. package/lib-amd/pluginState/LifecyclePluginState.d.ts +0 -5
  251. package/lib-amd/pluginState/LifecyclePluginState.js.map +1 -1
  252. package/lib-amd/pluginState/PluginState.d.ts +30 -0
  253. package/lib-amd/pluginState/PluginState.js +5 -0
  254. package/lib-amd/pluginState/PluginState.js.map +1 -0
  255. package/lib-mjs/context/DarkColorHandler.d.ts +52 -0
  256. package/lib-mjs/context/DarkColorHandler.js +2 -0
  257. package/lib-mjs/context/DarkColorHandler.js.map +1 -0
  258. package/lib-mjs/context/DomToModelSettings.d.ts +16 -2
  259. package/lib-mjs/context/DomToModelSettings.js.map +1 -1
  260. package/lib-mjs/context/EditorContext.d.ts +7 -2
  261. package/lib-mjs/context/EditorContext.js.map +1 -1
  262. package/lib-mjs/context/ModelToDomSettings.d.ts +15 -2
  263. package/lib-mjs/context/ModelToDomSettings.js.map +1 -1
  264. package/lib-mjs/editor/ContextMenuProvider.d.ts +12 -0
  265. package/lib-mjs/editor/ContextMenuProvider.js +2 -0
  266. package/lib-mjs/editor/ContextMenuProvider.js.map +1 -0
  267. package/lib-mjs/editor/EditorPlugin.d.ts +40 -0
  268. package/lib-mjs/editor/EditorPlugin.js +2 -0
  269. package/lib-mjs/editor/EditorPlugin.js.map +1 -0
  270. package/lib-mjs/editor/IStandaloneEditor.d.ts +20 -5
  271. package/lib-mjs/editor/IStandaloneEditor.js.map +1 -1
  272. package/lib-mjs/editor/PluginWithState.d.ts +11 -0
  273. package/lib-mjs/editor/PluginWithState.js +2 -0
  274. package/lib-mjs/editor/PluginWithState.js.map +1 -0
  275. package/lib-mjs/editor/StandaloneEditorCore.d.ts +8 -4
  276. package/lib-mjs/editor/StandaloneEditorCore.js.map +1 -1
  277. package/lib-mjs/editor/StandaloneEditorCorePlugins.d.ts +1 -1
  278. package/lib-mjs/editor/StandaloneEditorCorePlugins.js.map +1 -1
  279. package/lib-mjs/editor/StandaloneEditorOptions.d.ts +11 -6
  280. package/lib-mjs/editor/StandaloneEditorOptions.js.map +1 -1
  281. package/lib-mjs/event/BasePluginEvent.d.ts +27 -0
  282. package/lib-mjs/event/BasePluginEvent.js +2 -0
  283. package/lib-mjs/event/BasePluginEvent.js.map +1 -0
  284. package/lib-mjs/event/BeforeCutCopyEvent.d.ts +18 -0
  285. package/lib-mjs/event/BeforeCutCopyEvent.js +2 -0
  286. package/lib-mjs/event/BeforeCutCopyEvent.js.map +1 -0
  287. package/lib-mjs/event/BeforeDisposeEvent.d.ts +6 -0
  288. package/lib-mjs/event/BeforeDisposeEvent.js +2 -0
  289. package/lib-mjs/event/BeforeDisposeEvent.js.map +1 -0
  290. package/lib-mjs/event/BeforeKeyboardEditingEvent.d.ts +6 -0
  291. package/lib-mjs/event/BeforeKeyboardEditingEvent.js +2 -0
  292. package/lib-mjs/event/BeforeKeyboardEditingEvent.js.map +1 -0
  293. package/{lib/event/ContentModelBeforePasteEvent.d.ts → lib-mjs/event/BeforePasteEvent.d.ts} +34 -18
  294. package/lib-mjs/event/BeforePasteEvent.js +2 -0
  295. package/lib-mjs/event/BeforePasteEvent.js.map +1 -0
  296. package/lib-mjs/event/BeforeSetContentEvent.d.ts +11 -0
  297. package/lib-mjs/event/BeforeSetContentEvent.js +2 -0
  298. package/lib-mjs/event/BeforeSetContentEvent.js.map +1 -0
  299. package/{lib-amd/event/ContentModelContentChangedEvent.d.ts → lib-mjs/event/ContentChangedEvent.d.ts} +20 -13
  300. package/lib-mjs/event/ContentChangedEvent.js +2 -0
  301. package/lib-mjs/event/ContentChangedEvent.js.map +1 -0
  302. package/lib-mjs/event/ContextMenuEvent.d.ts +12 -0
  303. package/lib-mjs/event/ContextMenuEvent.js +2 -0
  304. package/lib-mjs/event/ContextMenuEvent.js.map +1 -0
  305. package/lib-mjs/event/EditImageEvent.d.ts +25 -0
  306. package/lib-mjs/event/EditImageEvent.js +2 -0
  307. package/lib-mjs/event/EditImageEvent.js.map +1 -0
  308. package/lib-mjs/event/EditorInputEvent.d.ts +10 -0
  309. package/lib-mjs/event/EditorInputEvent.js +2 -0
  310. package/lib-mjs/event/EditorInputEvent.js.map +1 -0
  311. package/lib-mjs/event/EditorReadyEvent.d.ts +6 -0
  312. package/lib-mjs/event/EditorReadyEvent.js +2 -0
  313. package/lib-mjs/event/EditorReadyEvent.js.map +1 -0
  314. package/lib-mjs/event/EntityOperationEvent.d.ts +52 -0
  315. package/lib-mjs/event/EntityOperationEvent.js +2 -0
  316. package/lib-mjs/event/EntityOperationEvent.js.map +1 -0
  317. package/lib-mjs/event/ExtractContentWithDomEvent.d.ts +14 -0
  318. package/lib-mjs/event/ExtractContentWithDomEvent.js +2 -0
  319. package/lib-mjs/event/ExtractContentWithDomEvent.js.map +1 -0
  320. package/lib-mjs/event/KeyboardEvent.d.ts +25 -0
  321. package/lib-mjs/event/KeyboardEvent.js +2 -0
  322. package/lib-mjs/event/KeyboardEvent.js.map +1 -0
  323. package/lib-mjs/event/MouseEvent.d.ts +15 -0
  324. package/lib-mjs/event/MouseEvent.js +2 -0
  325. package/lib-mjs/event/MouseEvent.js.map +1 -0
  326. package/lib-mjs/event/PluginEvent.d.ts +22 -0
  327. package/lib-mjs/event/PluginEvent.js +2 -0
  328. package/lib-mjs/event/PluginEvent.js.map +1 -0
  329. package/lib-mjs/event/PluginEventData.d.ts +21 -0
  330. package/lib-mjs/event/PluginEventData.js +2 -0
  331. package/lib-mjs/event/PluginEventData.js.map +1 -0
  332. package/lib-mjs/event/PluginEventType.d.ts +103 -0
  333. package/lib-mjs/event/PluginEventType.js +2 -0
  334. package/lib-mjs/event/PluginEventType.js.map +1 -0
  335. package/lib-mjs/event/ScrollEvent.d.ts +10 -0
  336. package/lib-mjs/event/ScrollEvent.js +2 -0
  337. package/lib-mjs/event/ScrollEvent.js.map +1 -0
  338. package/lib-mjs/event/SelectionChangedEvent.d.ts +11 -0
  339. package/lib-mjs/event/SelectionChangedEvent.js +2 -0
  340. package/lib-mjs/event/SelectionChangedEvent.js.map +1 -0
  341. package/lib-mjs/event/ShadowEditEvent.d.ts +11 -0
  342. package/lib-mjs/event/ShadowEditEvent.js +2 -0
  343. package/lib-mjs/event/ShadowEditEvent.js.map +1 -0
  344. package/lib-mjs/event/ZoomChangedEvent.d.ts +16 -0
  345. package/lib-mjs/event/ZoomChangedEvent.js +2 -0
  346. package/lib-mjs/event/ZoomChangedEvent.js.map +1 -0
  347. package/lib-mjs/format/ContentModelBlockFormat.d.ts +2 -1
  348. package/lib-mjs/format/ContentModelBlockFormat.js.map +1 -1
  349. package/lib-mjs/format/ContentModelFormatMap.d.ts +5 -0
  350. package/lib-mjs/format/ContentModelFormatMap.js.map +1 -1
  351. package/lib-mjs/format/ContentModelListItemFormat.d.ts +2 -1
  352. package/lib-mjs/format/ContentModelListItemFormat.js.map +1 -1
  353. package/lib-mjs/format/FormatHandlerTypeMap.d.ts +5 -0
  354. package/lib-mjs/format/FormatHandlerTypeMap.js.map +1 -1
  355. package/lib-mjs/format/formatParts/BorderFormat.d.ts +16 -0
  356. package/lib-mjs/format/formatParts/BorderFormat.js.map +1 -1
  357. package/lib-mjs/format/formatParts/SpacingFormat.d.ts +4 -0
  358. package/lib-mjs/format/formatParts/SpacingFormat.js.map +1 -1
  359. package/lib-mjs/format/formatParts/TextIndentFormat.d.ts +14 -0
  360. package/lib-mjs/format/formatParts/TextIndentFormat.js +2 -0
  361. package/lib-mjs/format/formatParts/TextIndentFormat.js.map +1 -0
  362. package/lib-mjs/index.d.ts +33 -7
  363. package/lib-mjs/index.js.map +1 -1
  364. package/lib-mjs/parameter/AnnounceData.d.ts +39 -0
  365. package/lib-mjs/parameter/AnnounceData.js +2 -0
  366. package/lib-mjs/parameter/AnnounceData.js.map +1 -0
  367. package/lib-mjs/parameter/DOMEventRecord.d.ts +1 -1
  368. package/lib-mjs/parameter/DOMEventRecord.js.map +1 -1
  369. package/lib-mjs/parameter/Rect.d.ts +21 -0
  370. package/lib-mjs/parameter/Rect.js +2 -0
  371. package/lib-mjs/parameter/Rect.js.map +1 -0
  372. package/lib-mjs/parameter/Snapshot.d.ts +4 -5
  373. package/lib-mjs/parameter/Snapshot.js.map +1 -1
  374. package/lib-mjs/parameter/TrustedHTMLHandler.d.ts +4 -0
  375. package/lib-mjs/parameter/TrustedHTMLHandler.js +2 -0
  376. package/lib-mjs/parameter/TrustedHTMLHandler.js.map +1 -0
  377. package/lib-mjs/pluginState/LifecyclePluginState.d.ts +0 -5
  378. package/lib-mjs/pluginState/LifecyclePluginState.js.map +1 -1
  379. package/lib-mjs/pluginState/PluginState.d.ts +30 -0
  380. package/lib-mjs/pluginState/PluginState.js +2 -0
  381. package/lib-mjs/pluginState/PluginState.js.map +1 -0
  382. package/package.json +2 -4
  383. package/lib/context/ColorManager.d.ts +0 -33
  384. package/lib/context/ColorManager.js.map +0 -1
  385. package/lib/event/ContentModelBeforePasteEvent.js.map +0 -1
  386. package/lib/event/ContentModelContentChangedEvent.js.map +0 -1
  387. package/lib/event/ContentModelSelectionChangedEvent.d.ts +0 -21
  388. package/lib/event/ContentModelSelectionChangedEvent.js +0 -3
  389. package/lib/event/ContentModelSelectionChangedEvent.js.map +0 -1
  390. package/lib/pluginState/StandaloneEditorPluginState.d.ts +0 -46
  391. package/lib/pluginState/StandaloneEditorPluginState.js.map +0 -1
  392. package/lib-amd/context/ColorManager.d.ts +0 -33
  393. package/lib-amd/context/ColorManager.js.map +0 -1
  394. package/lib-amd/event/ContentModelBeforePasteEvent.js.map +0 -1
  395. package/lib-amd/event/ContentModelContentChangedEvent.js.map +0 -1
  396. package/lib-amd/event/ContentModelSelectionChangedEvent.d.ts +0 -21
  397. package/lib-amd/event/ContentModelSelectionChangedEvent.js +0 -5
  398. package/lib-amd/event/ContentModelSelectionChangedEvent.js.map +0 -1
  399. package/lib-amd/pluginState/StandaloneEditorPluginState.d.ts +0 -46
  400. package/lib-amd/pluginState/StandaloneEditorPluginState.js.map +0 -1
  401. package/lib-mjs/context/ColorManager.d.ts +0 -33
  402. package/lib-mjs/context/ColorManager.js +0 -2
  403. package/lib-mjs/context/ColorManager.js.map +0 -1
  404. package/lib-mjs/event/ContentModelBeforePasteEvent.js +0 -2
  405. package/lib-mjs/event/ContentModelBeforePasteEvent.js.map +0 -1
  406. package/lib-mjs/event/ContentModelContentChangedEvent.js +0 -2
  407. package/lib-mjs/event/ContentModelContentChangedEvent.js.map +0 -1
  408. package/lib-mjs/event/ContentModelSelectionChangedEvent.d.ts +0 -21
  409. package/lib-mjs/event/ContentModelSelectionChangedEvent.js +0 -2
  410. package/lib-mjs/event/ContentModelSelectionChangedEvent.js.map +0 -1
  411. package/lib-mjs/pluginState/StandaloneEditorPluginState.d.ts +0 -46
  412. package/lib-mjs/pluginState/StandaloneEditorPluginState.js +0 -2
  413. package/lib-mjs/pluginState/StandaloneEditorPluginState.js.map +0 -1
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Represents a combination of color key, light color and dark color, parsed from existing color value
3
+ */
4
+ export interface Colors {
5
+ /**
6
+ * Light mode color value
7
+ */
8
+ lightModeColor: string;
9
+ /**
10
+ * Dark mode color value, if found, otherwise undefined
11
+ */
12
+ darkModeColor: string;
13
+ }
14
+ /**
15
+ * A util function type to transform light mode color to dark mode color
16
+ * Default value is to return the original light color
17
+ * @param lightColor Source color string in light mode
18
+ * @param baseLValue Base value of light used for dark value calculation
19
+ * @param colorType @optional Type of color, can be text, background, or border
20
+ * @param element @optional Source HTML element of the color
21
+ */
22
+ export declare type ColorTransformFunction = (lightColor: string, baseLValue?: number, colorType?: 'text' | 'background' | 'border', element?: HTMLElement) => string;
23
+ /**
24
+ * A handler object for dark color, used for variable-based dark color solution
25
+ */
26
+ export interface DarkColorHandler {
27
+ /**
28
+ * Map of known colors
29
+ */
30
+ readonly knownColors: Record<string, Colors>;
31
+ /**
32
+ * Update all known colors to root container.
33
+ * @param isDarkMode Whether container is in dark mode. When in dark mode, we add CSS color variables for all known colors.
34
+ * When in light mode, we will remove all those CSS color variables
35
+ */
36
+ updateKnownColor(isDarkMode: boolean): void;
37
+ /**
38
+ * Register a known color, and update it to root container via CSS color variable when in dark mode
39
+ * @param isDarkMode Whether container is in dark mode.
40
+ * @param key The key of color, normally it is the name of color variable
41
+ * @param colorPair A pair value of light color and dark color
42
+ */
43
+ updateKnownColor(isDarkMode: boolean, key: string, colorPair: Colors): void;
44
+ /**
45
+ * Reset known color record, clean up registered color variables.
46
+ */
47
+ reset(): void;
48
+ /**
49
+ * A util function to transform light mode color to dark mode color
50
+ */
51
+ getDarkColor: ColorTransformFunction;
52
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=StandaloneEditorPluginState.js.map
3
+ //# sourceMappingURL=DarkColorHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DarkColorHandler.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/DarkColorHandler.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a combination of color key, light color and dark color, parsed from existing color value\n */\nexport interface Colors {\n /**\n * Light mode color value\n */\n lightModeColor: string;\n\n /**\n * Dark mode color value, if found, otherwise undefined\n */\n darkModeColor: string;\n}\n\n/**\n * A util function type to transform light mode color to dark mode color\n * Default value is to return the original light color\n * @param lightColor Source color string in light mode\n * @param baseLValue Base value of light used for dark value calculation\n * @param colorType @optional Type of color, can be text, background, or border\n * @param element @optional Source HTML element of the color\n */\nexport type ColorTransformFunction = (\n lightColor: string,\n baseLValue?: number,\n colorType?: 'text' | 'background' | 'border',\n element?: HTMLElement\n) => string;\n\n/**\n * A handler object for dark color, used for variable-based dark color solution\n */\nexport interface DarkColorHandler {\n /**\n * Map of known colors\n */\n readonly knownColors: Record<string, Colors>;\n\n /**\n * Update all known colors to root container.\n * @param isDarkMode Whether container is in dark mode. When in dark mode, we add CSS color variables for all known colors.\n * When in light mode, we will remove all those CSS color variables\n */\n updateKnownColor(isDarkMode: boolean): void;\n\n /**\n * Register a known color, and update it to root container via CSS color variable when in dark mode\n * @param isDarkMode Whether container is in dark mode.\n * @param key The key of color, normally it is the name of color variable\n * @param colorPair A pair value of light color and dark color\n */\n updateKnownColor(isDarkMode: boolean, key: string, colorPair: Colors): void;\n\n /**\n * Reset known color record, clean up registered color variables.\n */\n reset(): void;\n\n /**\n * A util function to transform light mode color to dark mode color\n */\n getDarkColor: ColorTransformFunction;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
1
2
  import type { ContentModelFormatBase } from '../format/ContentModelFormatBase';
2
3
  import type { ContentModelFormatMap } from '../format/ContentModelFormatMap';
3
4
  import type { DomToModelContext } from './DomToModelContext';
@@ -22,6 +23,13 @@ export declare type DefaultStyleMap = {
22
23
  * @param defaultStyle Default CSS style of the given HTML element
23
24
  */
24
25
  export declare type FormatParser<TFormat extends ContentModelFormatBase> = (format: TFormat, element: HTMLElement, context: DomToModelContext, defaultStyle: Readonly<Partial<CSSStyleDeclaration>>) => void;
26
+ /**
27
+ * Parse format from the given text node
28
+ * @param format The format object to parse into
29
+ * @param textNode The text node to parse format from
30
+ * @param context The context object that provide related context information
31
+ */
32
+ export declare type TextFormatParser<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: DomToModelContext) => void;
25
33
  /**
26
34
  * All format parsers
27
35
  */
@@ -29,11 +37,17 @@ export declare type FormatParsers = {
29
37
  [Key in FormatKey]: FormatParser<FormatHandlerTypeMap[Key]> | null;
30
38
  };
31
39
  /**
32
- * A map from format parser category name to an array of parsers
40
+ * A map from format parser category name to an array of parsers. This is for HTML Element only
33
41
  */
34
- export declare type FormatParsersPerCategory = {
42
+ export declare type ElementFormatParserPerCategory = {
35
43
  [Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];
36
44
  };
45
+ /**
46
+ * A map from format parser category name to an array of parsers
47
+ */
48
+ export declare type FormatParsersPerCategory = ElementFormatParserPerCategory & {
49
+ text: TextFormatParser[];
50
+ };
37
51
  /**
38
52
  * A map from element processor name to its processor type
39
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"DomToModelSettings.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/DomToModelSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelFormatBase } from '../format/ContentModelFormatBase';\nimport type { ContentModelFormatMap } from '../format/ContentModelFormatMap';\nimport type { DomToModelContext } from './DomToModelContext';\nimport type { ElementProcessor } from './ElementProcessor';\nimport type { FormatHandlerTypeMap, FormatKey } from '../format/FormatHandlerTypeMap';\n\n/**\n * A type of Default style map, from tag name string (in upper case) to a static style object\n */\nexport type DefaultStyleMap = {\n [key in keyof HTMLElementDeprecatedTagNameMap]?: Readonly<Partial<CSSStyleDeclaration>>;\n} &\n {\n [key in keyof HTMLElementTagNameMap]?: Readonly<Partial<CSSStyleDeclaration>>;\n } & {\n // Workaround typescript 4.4.4 which does not have these elements in its declaration file\n center?: Partial<CSSStyleDeclaration>;\n strike?: Partial<CSSStyleDeclaration>;\n };\n\n/**\n * Parse format from the given HTML element and default style\n * @param format The format object to parse into\n * @param element The HTML element to parse format from\n * @param context The context object that provide related context information\n * @param defaultStyle Default CSS style of the given HTML element\n */\nexport type FormatParser<TFormat extends ContentModelFormatBase> = (\n format: TFormat,\n element: HTMLElement,\n context: DomToModelContext,\n defaultStyle: Readonly<Partial<CSSStyleDeclaration>>\n) => void;\n\n/**\n * All format parsers\n */\nexport type FormatParsers = {\n [Key in FormatKey]: FormatParser<FormatHandlerTypeMap[Key]> | null;\n};\n\n/**\n * A map from format parser category name to an array of parsers\n */\nexport type FormatParsersPerCategory = {\n [Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];\n};\n\n/**\n * A map from element processor name to its processor type\n */\nexport type ElementProcessorMap = {\n [key in keyof HTMLElementDeprecatedTagNameMap]?: ElementProcessor<\n HTMLElementDeprecatedTagNameMap[key]\n >;\n} &\n {\n [key in keyof HTMLElementTagNameMap]?: ElementProcessor<HTMLElementTagNameMap[key]>;\n } & {\n /**\n * Processors for all other HTML elements\n */\n '*': ElementProcessor<HTMLElement>;\n\n /**\n * Processor for text node\n */\n '#text': ElementProcessor<Text>;\n\n /**\n * Processor for entity\n */\n entity: ElementProcessor<HTMLElement>;\n\n /**\n * Common processor dispatch for all elements\n */\n element: ElementProcessor<HTMLElement>;\n\n /**\n * Common processor for child nodes of a given element\n */\n child: ElementProcessor<ParentNode>;\n\n /**\n * Workaround for typescript 4.4.4 that doesn't have element \"strike\" in its element type\n */\n strike?: ElementProcessor<HTMLElement>;\n\n /**\n * Workaround for typescript 4.4.4 that doesn't have element \"center\" in its element type\n */\n center?: ElementProcessor<HTMLElement>;\n\n /**\n * Processor for Inline Readonly Delimiters\n */\n delimiter?: ElementProcessor<Node>;\n };\n\n/**\n * Represents settings to customize DOM to Content Model conversion\n */\nexport interface DomToModelSettings {\n /**\n * Map of element processors\n */\n elementProcessors: ElementProcessorMap;\n\n /**\n * Map of format parsers\n */\n formatParsers: FormatParsersPerCategory;\n\n /**\n * Default DOM to Content Model processors before overriding.\n * This provides a way to call original processor from an overridden processor function\n */\n defaultElementProcessors: Readonly<ElementProcessorMap>;\n\n /**\n * Default format parsers before overriding.\n * This provides a way to call original format parser from an overridden parser function\n */\n defaultFormatParsers: Readonly<FormatParsers>;\n}\n"]}
1
+ {"version":3,"file":"DomToModelSettings.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/DomToModelSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { ContentModelFormatBase } from '../format/ContentModelFormatBase';\nimport type { ContentModelFormatMap } from '../format/ContentModelFormatMap';\nimport type { DomToModelContext } from './DomToModelContext';\nimport type { ElementProcessor } from './ElementProcessor';\nimport type { FormatHandlerTypeMap, FormatKey } from '../format/FormatHandlerTypeMap';\n\n/**\n * A type of Default style map, from tag name string (in upper case) to a static style object\n */\nexport type DefaultStyleMap = {\n [key in keyof HTMLElementDeprecatedTagNameMap]?: Readonly<Partial<CSSStyleDeclaration>>;\n} &\n {\n [key in keyof HTMLElementTagNameMap]?: Readonly<Partial<CSSStyleDeclaration>>;\n } & {\n // Workaround typescript 4.4.4 which does not have these elements in its declaration file\n center?: Partial<CSSStyleDeclaration>;\n strike?: Partial<CSSStyleDeclaration>;\n };\n\n/**\n * Parse format from the given HTML element and default style\n * @param format The format object to parse into\n * @param element The HTML element to parse format from\n * @param context The context object that provide related context information\n * @param defaultStyle Default CSS style of the given HTML element\n */\nexport type FormatParser<TFormat extends ContentModelFormatBase> = (\n format: TFormat,\n element: HTMLElement,\n context: DomToModelContext,\n defaultStyle: Readonly<Partial<CSSStyleDeclaration>>\n) => void;\n\n/**\n * Parse format from the given text node\n * @param format The format object to parse into\n * @param textNode The text node to parse format from\n * @param context The context object that provide related context information\n */\nexport type TextFormatParser<\n TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat\n> = (format: TFormat, textNode: Text, context: DomToModelContext) => void;\n\n/**\n * All format parsers\n */\nexport type FormatParsers = {\n [Key in FormatKey]: FormatParser<FormatHandlerTypeMap[Key]> | null;\n};\n\n/**\n * A map from format parser category name to an array of parsers. This is for HTML Element only\n */\nexport type ElementFormatParserPerCategory = {\n [Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];\n};\n\n/**\n * A map from format parser category name to an array of parsers\n */\nexport type FormatParsersPerCategory = ElementFormatParserPerCategory & {\n text: TextFormatParser[];\n};\n\n/**\n * A map from element processor name to its processor type\n */\nexport type ElementProcessorMap = {\n [key in keyof HTMLElementDeprecatedTagNameMap]?: ElementProcessor<\n HTMLElementDeprecatedTagNameMap[key]\n >;\n} &\n {\n [key in keyof HTMLElementTagNameMap]?: ElementProcessor<HTMLElementTagNameMap[key]>;\n } & {\n /**\n * Processors for all other HTML elements\n */\n '*': ElementProcessor<HTMLElement>;\n\n /**\n * Processor for text node\n */\n '#text': ElementProcessor<Text>;\n\n /**\n * Processor for entity\n */\n entity: ElementProcessor<HTMLElement>;\n\n /**\n * Common processor dispatch for all elements\n */\n element: ElementProcessor<HTMLElement>;\n\n /**\n * Common processor for child nodes of a given element\n */\n child: ElementProcessor<ParentNode>;\n\n /**\n * Workaround for typescript 4.4.4 that doesn't have element \"strike\" in its element type\n */\n strike?: ElementProcessor<HTMLElement>;\n\n /**\n * Workaround for typescript 4.4.4 that doesn't have element \"center\" in its element type\n */\n center?: ElementProcessor<HTMLElement>;\n\n /**\n * Processor for Inline Readonly Delimiters\n */\n delimiter?: ElementProcessor<Node>;\n };\n\n/**\n * Represents settings to customize DOM to Content Model conversion\n */\nexport interface DomToModelSettings {\n /**\n * Map of element processors\n */\n elementProcessors: ElementProcessorMap;\n\n /**\n * Map of format parsers\n */\n formatParsers: FormatParsersPerCategory;\n\n /**\n * Default DOM to Content Model processors before overriding.\n * This provides a way to call original processor from an overridden processor function\n */\n defaultElementProcessors: Readonly<ElementProcessorMap>;\n\n /**\n * Default format parsers before overriding.\n * This provides a way to call original format parser from an overridden parser function\n */\n defaultFormatParsers: Readonly<FormatParsers>;\n}\n"]}
@@ -1,6 +1,7 @@
1
- import type { ColorManager } from './ColorManager';
1
+ import type { DarkColorHandler } from './DarkColorHandler';
2
2
  import type { ContentModelDomIndexer } from './ContentModelDomIndexer';
3
3
  import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
4
+ import type { PendingFormat } from '../pluginState/ContentModelFormatPluginState';
4
5
  /**
5
6
  * An editor context interface used by ContentModel PAI
6
7
  */
@@ -13,10 +14,14 @@ export interface EditorContext {
13
14
  * Default format of editor
14
15
  */
15
16
  defaultFormat?: ContentModelSegmentFormat;
17
+ /**
18
+ * Pending format if any
19
+ */
20
+ pendingFormat?: PendingFormat;
16
21
  /**
17
22
  * Color manager, to help manager color in dark mode
18
23
  */
19
- darkColorHandler?: ColorManager;
24
+ darkColorHandler?: DarkColorHandler;
20
25
  /**
21
26
  * Whether to handle delimiters in Content Model
22
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorManager } from './ColorManager';\nimport type { ContentModelDomIndexer } from './ContentModelDomIndexer';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: ColorManager;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: ContentModelDomIndexer;\n}\n"]}
1
+ {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { ContentModelDomIndexer } from './ContentModelDomIndexer';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/ContentModelFormatPluginState';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: ContentModelDomIndexer;\n}\n"]}
@@ -36,6 +36,13 @@ export declare type DefaultImplicitFormatMap = Record<string, Readonly<ContentMo
36
36
  * @param context The context object that provide related context information
37
37
  */
38
38
  export declare type FormatApplier<TFormat extends ContentModelFormatBase> = (format: TFormat, element: HTMLElement, context: ModelToDomContext) => void;
39
+ /**
40
+ * Apply format to the given text node
41
+ * @param format The format object to apply
42
+ * @param textNode The text node to apply format to
43
+ * @param context The context object that provide related context information
44
+ */
45
+ export declare type TextFormatApplier<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: ModelToDomContext) => void;
39
46
  /**
40
47
  * All format appliers
41
48
  */
@@ -43,11 +50,17 @@ export declare type FormatAppliers = {
43
50
  [Key in FormatKey]: FormatApplier<FormatHandlerTypeMap[Key]> | null;
44
51
  };
45
52
  /**
46
- * A map from format parser category name to an array of parsers
53
+ * A map from format parser category name to an array of parsers. This is for HTMLElement only
47
54
  */
48
- export declare type FormatAppliersPerCategory = {
55
+ export declare type ElementFormatAppliersPerCategory = {
49
56
  [Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];
50
57
  };
58
+ /**
59
+ * A map from format parser category name to an array of parsers
60
+ */
61
+ export declare type FormatAppliersPerCategory = ElementFormatAppliersPerCategory & {
62
+ text: TextFormatApplier[];
63
+ };
51
64
  /**
52
65
  * Represents a map from content model handler name to its handle type
53
66
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ModelToDomSettings.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { Definition } from '../metadata/Definition';\nimport type { ContentModelBlock } from '../block/ContentModelBlock';\nimport type { ContentModelBlockFormat } from '../format/ContentModelBlockFormat';\nimport type { ContentModelBlockGroup } from '../group/ContentModelBlockGroup';\nimport type { ContentModelBr } from '../segment/ContentModelBr';\nimport type { ContentModelDecorator } from '../decorator/ContentModelDecorator';\nimport type { ContentModelDivider } from '../block/ContentModelDivider';\nimport type { ContentModelEntity } from '../entity/ContentModelEntity';\nimport type { ContentModelFormatBase } from '../format/ContentModelFormatBase';\nimport type { ContentModelFormatContainer } from '../group/ContentModelFormatContainer';\nimport type { ContentModelFormatMap } from '../format/ContentModelFormatMap';\nimport type { ContentModelGeneralBlock } from '../group/ContentModelGeneralBlock';\nimport type { ContentModelGeneralSegment } from '../segment/ContentModelGeneralSegment';\nimport type { ContentModelImage } from '../segment/ContentModelImage';\nimport type { ContentModelListItem } from '../group/ContentModelListItem';\nimport type { ContentModelListItemFormat } from '../format/ContentModelListItemFormat';\nimport type { ContentModelListItemLevelFormat } from '../format/ContentModelListItemLevelFormat';\nimport type { ContentModelParagraph } from '../block/ContentModelParagraph';\nimport type { ContentModelSegment } from '../segment/ContentModelSegment';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { ContentModelTable } from '../block/ContentModelTable';\nimport type { ContentModelTableRow } from '../block/ContentModelTableRow';\nimport type { ContentModelText } from '../segment/ContentModelText';\nimport type { FormatHandlerTypeMap, FormatKey } from '../format/FormatHandlerTypeMap';\nimport type { ModelToDomContext } from './ModelToDomContext';\nimport type { ListMetadataFormat } from '../format/metadata/ListMetadataFormat';\nimport type {\n ContentModelHandler,\n ContentModelBlockHandler,\n ContentModelSegmentHandler,\n} from './ContentModelHandler';\n\n/**\n * Default implicit format map from tag name (lower case) to segment format\n */\nexport type DefaultImplicitFormatMap = Record<\n string,\n Readonly<ContentModelSegmentFormat & ContentModelBlockFormat>\n>;\n\n/**\n * Apply format to the given HTML element\n * @param format The format object to apply\n * @param element The HTML element to apply format to\n * @param context The context object that provide related context information\n */\nexport type FormatApplier<TFormat extends ContentModelFormatBase> = (\n format: TFormat,\n element: HTMLElement,\n context: ModelToDomContext\n) => void;\n\n/**\n * All format appliers\n */\nexport type FormatAppliers = {\n [Key in FormatKey]: FormatApplier<FormatHandlerTypeMap[Key]> | null;\n};\n\n/**\n * A map from format parser category name to an array of parsers\n */\nexport type FormatAppliersPerCategory = {\n [Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];\n};\n\n/**\n * Represents a map from content model handler name to its handle type\n */\nexport type ContentModelHandlerMap = {\n /**\n * Content Model type for ContentModelBlock\n */\n block: ContentModelBlockHandler<ContentModelBlock>;\n\n /**\n * Content Model type for child models of ContentModelBlockGroup\n */\n blockGroupChildren: ContentModelHandler<ContentModelBlockGroup>;\n\n /**\n * Content Model type for ContentModelBr\n */\n br: ContentModelSegmentHandler<ContentModelBr>;\n\n /**\n * Content Model type for child models of ContentModelEntity\n */\n entityBlock: ContentModelBlockHandler<ContentModelEntity>;\n\n /**\n * Content Model type for child models of ContentModelEntity\n */\n entitySegment: ContentModelSegmentHandler<ContentModelEntity>;\n\n /**\n * Content Model type for ContentModelGeneralBlock\n */\n generalBlock: ContentModelBlockHandler<ContentModelGeneralBlock>;\n\n /**\n * Content Model type for ContentModelGeneralBlock\n */\n generalSegment: ContentModelSegmentHandler<ContentModelGeneralSegment>;\n\n /**\n * Content Model type for ContentModelHR\n */\n divider: ContentModelBlockHandler<ContentModelDivider>;\n\n /**\n * Content Model type for ContentModelImage\n */\n image: ContentModelSegmentHandler<ContentModelImage>;\n\n /**\n * Content Model type for list group of ContentModelListItem\n */\n list: ContentModelBlockHandler<ContentModelListItem>;\n\n /**\n * Content Model type for list item of ContentModelListItem\n */\n listItem: ContentModelBlockHandler<ContentModelListItem>;\n\n /**\n * Content Model type for ContentModelParagraph\n */\n paragraph: ContentModelBlockHandler<ContentModelParagraph>;\n\n /**\n * Content Model type for ContentModelFormatContainer\n */\n formatContainer: ContentModelBlockHandler<ContentModelFormatContainer>;\n\n /**\n * Content Model type for ContentModelSegment\n */\n segment: ContentModelSegmentHandler<ContentModelSegment>;\n\n /**\n * Content Model type for ContentModelCode\n */\n segmentDecorator: ContentModelSegmentHandler<ContentModelSegment>;\n\n /**\n * Content Model type for ContentModelTable\n */\n table: ContentModelBlockHandler<ContentModelTable>;\n\n /**\n * Content Model type for ContentModelText\n */\n text: ContentModelSegmentHandler<ContentModelText>;\n};\n\n/**\n * Function type to apply metadata value into format\n * @param metadata The metadata object to apply\n * @param format The format object to apply metadata to\n * @param context Content Model to DOM context\n */\nexport type ApplyMetadata<TMetadata, TFormat extends ContentModelFormatBase> = (\n metadata: TMetadata | null,\n format: TFormat,\n context: ModelToDomContext\n) => void;\n\n/**\n * Metadata applier interface\n */\nexport interface MetadataApplier<TMetadata, TFormat extends ContentModelFormatBase> {\n /**\n * The metadata applier function\n */\n applierFunction: ApplyMetadata<TMetadata, TFormat>;\n\n /**\n * @optional Metadata definition, used for validate the metadata object\n */\n metadataDefinition?: Definition<TMetadata>;\n}\n\n/**\n * Map of metadata handlers\n */\nexport type MetadataAppliers = {\n /**\n * Metadata handler for list item\n */\n listItem?: MetadataApplier<ListMetadataFormat, ContentModelListItemFormat>;\n\n /**\n * Metadata handler for list level\n */\n listLevel?: MetadataApplier<ListMetadataFormat, ContentModelListItemLevelFormat>;\n};\n\n/**\n * An optional callback that will be called when a DOM node is created\n * @param modelElement The related Content Model element\n * @param node The node created for this model element\n */\nexport type OnNodeCreated = (\n modelElement:\n | ContentModelBlock\n | ContentModelBlockGroup\n | ContentModelSegment\n | ContentModelDecorator\n | ContentModelTableRow,\n node: Node\n) => void;\n\n/**\n * Represents settings to customize DOM to Content Model conversion\n */\nexport interface ModelToDomSettings {\n /**\n * Map of Content Model handlers\n */\n modelHandlers: ContentModelHandlerMap;\n\n /**\n * Map of format appliers\n */\n formatAppliers: FormatAppliersPerCategory;\n\n /**\n * Map of metadata appliers\n */\n metadataAppliers: MetadataAppliers;\n\n /**\n * Default Content Model to DOM handlers before overriding.\n * This provides a way to call original handler from an overridden handler function\n */\n defaultModelHandlers: Readonly<ContentModelHandlerMap>;\n\n /**\n * Default format parsers before overriding.\n * This provides a way to call original format applier from an overridden applier function\n */\n defaultFormatAppliers: Readonly<FormatAppliers>;\n\n /**\n * An optional callback that will be called when a DOM node is created\n * @param modelElement The related Content Model element\n * @param node The node created for this model element\n */\n onNodeCreated?: OnNodeCreated;\n}\n"]}
1
+ {"version":3,"file":"ModelToDomSettings.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { Definition } from '../metadata/Definition';\nimport type { ContentModelBlock } from '../block/ContentModelBlock';\nimport type { ContentModelBlockFormat } from '../format/ContentModelBlockFormat';\nimport type { ContentModelBlockGroup } from '../group/ContentModelBlockGroup';\nimport type { ContentModelBr } from '../segment/ContentModelBr';\nimport type { ContentModelDecorator } from '../decorator/ContentModelDecorator';\nimport type { ContentModelDivider } from '../block/ContentModelDivider';\nimport type { ContentModelEntity } from '../entity/ContentModelEntity';\nimport type { ContentModelFormatBase } from '../format/ContentModelFormatBase';\nimport type { ContentModelFormatContainer } from '../group/ContentModelFormatContainer';\nimport type { ContentModelFormatMap } from '../format/ContentModelFormatMap';\nimport type { ContentModelGeneralBlock } from '../group/ContentModelGeneralBlock';\nimport type { ContentModelGeneralSegment } from '../segment/ContentModelGeneralSegment';\nimport type { ContentModelImage } from '../segment/ContentModelImage';\nimport type { ContentModelListItem } from '../group/ContentModelListItem';\nimport type { ContentModelListItemFormat } from '../format/ContentModelListItemFormat';\nimport type { ContentModelListItemLevelFormat } from '../format/ContentModelListItemLevelFormat';\nimport type { ContentModelParagraph } from '../block/ContentModelParagraph';\nimport type { ContentModelSegment } from '../segment/ContentModelSegment';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { ContentModelTable } from '../block/ContentModelTable';\nimport type { ContentModelTableRow } from '../block/ContentModelTableRow';\nimport type { ContentModelText } from '../segment/ContentModelText';\nimport type { FormatHandlerTypeMap, FormatKey } from '../format/FormatHandlerTypeMap';\nimport type { ModelToDomContext } from './ModelToDomContext';\nimport type { ListMetadataFormat } from '../format/metadata/ListMetadataFormat';\nimport type {\n ContentModelHandler,\n ContentModelBlockHandler,\n ContentModelSegmentHandler,\n} from './ContentModelHandler';\n\n/**\n * Default implicit format map from tag name (lower case) to segment format\n */\nexport type DefaultImplicitFormatMap = Record<\n string,\n Readonly<ContentModelSegmentFormat & ContentModelBlockFormat>\n>;\n\n/**\n * Apply format to the given HTML element\n * @param format The format object to apply\n * @param element The HTML element to apply format to\n * @param context The context object that provide related context information\n */\nexport type FormatApplier<TFormat extends ContentModelFormatBase> = (\n format: TFormat,\n element: HTMLElement,\n context: ModelToDomContext\n) => void;\n\n/**\n * Apply format to the given text node\n * @param format The format object to apply\n * @param textNode The text node to apply format to\n * @param context The context object that provide related context information\n */\nexport type TextFormatApplier<\n TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat\n> = (format: TFormat, textNode: Text, context: ModelToDomContext) => void;\n\n/**\n * All format appliers\n */\nexport type FormatAppliers = {\n [Key in FormatKey]: FormatApplier<FormatHandlerTypeMap[Key]> | null;\n};\n\n/**\n * A map from format parser category name to an array of parsers. This is for HTMLElement only\n */\nexport type ElementFormatAppliersPerCategory = {\n [Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];\n};\n\n/**\n * A map from format parser category name to an array of parsers\n */\nexport type FormatAppliersPerCategory = ElementFormatAppliersPerCategory & {\n text: TextFormatApplier[];\n};\n\n/**\n * Represents a map from content model handler name to its handle type\n */\nexport type ContentModelHandlerMap = {\n /**\n * Content Model type for ContentModelBlock\n */\n block: ContentModelBlockHandler<ContentModelBlock>;\n\n /**\n * Content Model type for child models of ContentModelBlockGroup\n */\n blockGroupChildren: ContentModelHandler<ContentModelBlockGroup>;\n\n /**\n * Content Model type for ContentModelBr\n */\n br: ContentModelSegmentHandler<ContentModelBr>;\n\n /**\n * Content Model type for child models of ContentModelEntity\n */\n entityBlock: ContentModelBlockHandler<ContentModelEntity>;\n\n /**\n * Content Model type for child models of ContentModelEntity\n */\n entitySegment: ContentModelSegmentHandler<ContentModelEntity>;\n\n /**\n * Content Model type for ContentModelGeneralBlock\n */\n generalBlock: ContentModelBlockHandler<ContentModelGeneralBlock>;\n\n /**\n * Content Model type for ContentModelGeneralBlock\n */\n generalSegment: ContentModelSegmentHandler<ContentModelGeneralSegment>;\n\n /**\n * Content Model type for ContentModelHR\n */\n divider: ContentModelBlockHandler<ContentModelDivider>;\n\n /**\n * Content Model type for ContentModelImage\n */\n image: ContentModelSegmentHandler<ContentModelImage>;\n\n /**\n * Content Model type for list group of ContentModelListItem\n */\n list: ContentModelBlockHandler<ContentModelListItem>;\n\n /**\n * Content Model type for list item of ContentModelListItem\n */\n listItem: ContentModelBlockHandler<ContentModelListItem>;\n\n /**\n * Content Model type for ContentModelParagraph\n */\n paragraph: ContentModelBlockHandler<ContentModelParagraph>;\n\n /**\n * Content Model type for ContentModelFormatContainer\n */\n formatContainer: ContentModelBlockHandler<ContentModelFormatContainer>;\n\n /**\n * Content Model type for ContentModelSegment\n */\n segment: ContentModelSegmentHandler<ContentModelSegment>;\n\n /**\n * Content Model type for ContentModelCode\n */\n segmentDecorator: ContentModelSegmentHandler<ContentModelSegment>;\n\n /**\n * Content Model type for ContentModelTable\n */\n table: ContentModelBlockHandler<ContentModelTable>;\n\n /**\n * Content Model type for ContentModelText\n */\n text: ContentModelSegmentHandler<ContentModelText>;\n};\n\n/**\n * Function type to apply metadata value into format\n * @param metadata The metadata object to apply\n * @param format The format object to apply metadata to\n * @param context Content Model to DOM context\n */\nexport type ApplyMetadata<TMetadata, TFormat extends ContentModelFormatBase> = (\n metadata: TMetadata | null,\n format: TFormat,\n context: ModelToDomContext\n) => void;\n\n/**\n * Metadata applier interface\n */\nexport interface MetadataApplier<TMetadata, TFormat extends ContentModelFormatBase> {\n /**\n * The metadata applier function\n */\n applierFunction: ApplyMetadata<TMetadata, TFormat>;\n\n /**\n * @optional Metadata definition, used for validate the metadata object\n */\n metadataDefinition?: Definition<TMetadata>;\n}\n\n/**\n * Map of metadata handlers\n */\nexport type MetadataAppliers = {\n /**\n * Metadata handler for list item\n */\n listItem?: MetadataApplier<ListMetadataFormat, ContentModelListItemFormat>;\n\n /**\n * Metadata handler for list level\n */\n listLevel?: MetadataApplier<ListMetadataFormat, ContentModelListItemLevelFormat>;\n};\n\n/**\n * An optional callback that will be called when a DOM node is created\n * @param modelElement The related Content Model element\n * @param node The node created for this model element\n */\nexport type OnNodeCreated = (\n modelElement:\n | ContentModelBlock\n | ContentModelBlockGroup\n | ContentModelSegment\n | ContentModelDecorator\n | ContentModelTableRow,\n node: Node\n) => void;\n\n/**\n * Represents settings to customize DOM to Content Model conversion\n */\nexport interface ModelToDomSettings {\n /**\n * Map of Content Model handlers\n */\n modelHandlers: ContentModelHandlerMap;\n\n /**\n * Map of format appliers\n */\n formatAppliers: FormatAppliersPerCategory;\n\n /**\n * Map of metadata appliers\n */\n metadataAppliers: MetadataAppliers;\n\n /**\n * Default Content Model to DOM handlers before overriding.\n * This provides a way to call original handler from an overridden handler function\n */\n defaultModelHandlers: Readonly<ContentModelHandlerMap>;\n\n /**\n * Default format parsers before overriding.\n * This provides a way to call original format applier from an overridden applier function\n */\n defaultFormatAppliers: Readonly<FormatAppliers>;\n\n /**\n * An optional callback that will be called when a DOM node is created\n * @param modelElement The related Content Model element\n * @param node The node created for this model element\n */\n onNodeCreated?: OnNodeCreated;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import type { EditorPlugin } from './EditorPlugin';
2
+ /**
3
+ * An extended Editor plugin interface which supports providing context menu items
4
+ */
5
+ export interface ContextMenuProvider<T> extends EditorPlugin {
6
+ /**
7
+ * A callback to return context menu items
8
+ * @param target Target node that triggered a ContextMenu event
9
+ * @returns An array of context menu items, or null means no items needed
10
+ */
11
+ getContextMenuItems: (target: Node) => T[] | null;
12
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ContentModelBeforePasteEvent.js.map
3
+ //# sourceMappingURL=ContextMenuProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextMenuProvider.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/ContextMenuProvider.ts"],"names":[],"mappings":"","sourcesContent":["import type { EditorPlugin } from './EditorPlugin';\n\n/**\n * An extended Editor plugin interface which supports providing context menu items\n */\nexport interface ContextMenuProvider<T> extends EditorPlugin {\n /**\n * A callback to return context menu items\n * @param target Target node that triggered a ContextMenu event\n * @returns An array of context menu items, or null means no items needed\n */\n getContextMenuItems: (target: Node) => T[] | null;\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import type { PluginEvent } from '../event/PluginEvent';
2
+ import type { IStandaloneEditor } from './IStandaloneEditor';
3
+ /**
4
+ * Interface of an editor plugin
5
+ */
6
+ export interface EditorPlugin {
7
+ /**
8
+ * Get a friendly name of this plugin
9
+ */
10
+ getName: () => string;
11
+ /**
12
+ * The first method that editor will call to a plugin when editor is initializing.
13
+ * It will pass in the editor instance, plugin should take this chance to save the
14
+ * editor reference so that it can call to any editor method or format API later.
15
+ * @param editor The editor object
16
+ */
17
+ initialize: (editor: IStandaloneEditor) => void;
18
+ /**
19
+ * The last method that editor will call to a plugin before it is disposed.
20
+ * Plugin can take this chance to clear the reference to editor. After this method is
21
+ * called, plugin should not call to any editor method since it will result in error.
22
+ */
23
+ dispose: () => void;
24
+ /**
25
+ * Check if the plugin should handle the given event exclusively.
26
+ * Handle an event exclusively means other plugin will not receive this event in
27
+ * onPluginEvent method.
28
+ * If two plugins will return true in willHandleEventExclusively() for the same event,
29
+ * the final result depends on the order of the plugins are added into editor
30
+ * @param event The event to check:
31
+ */
32
+ willHandleEventExclusively?: (event: PluginEvent) => boolean;
33
+ /**
34
+ * Core method for a plugin. Once an event happens in editor, editor will call this
35
+ * method of each plugin to handle the event as long as the event is not handled
36
+ * exclusively by another plugin.
37
+ * @param event The event to handle:
38
+ */
39
+ onPluginEvent?: (event: PluginEvent) => void;
40
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ColorManager.js.map
3
+ //# sourceMappingURL=EditorPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorPlugin.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/EditorPlugin.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEvent } from '../event/PluginEvent';\nimport type { IStandaloneEditor } from './IStandaloneEditor';\n\n/**\n * Interface of an editor plugin\n */\nexport interface EditorPlugin {\n /**\n * Get a friendly name of this plugin\n */\n getName: () => string;\n\n /**\n * The first method that editor will call to a plugin when editor is initializing.\n * It will pass in the editor instance, plugin should take this chance to save the\n * editor reference so that it can call to any editor method or format API later.\n * @param editor The editor object\n */\n initialize: (editor: IStandaloneEditor) => void;\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: () => void;\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) => boolean;\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) => void;\n}\n"]}
@@ -1,9 +1,10 @@
1
+ import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';
2
+ import type { PluginEventType } from '../event/PluginEventType';
1
3
  import type { PasteType } from '../enum/PasteType';
2
4
  import type { ClipboardData } from '../parameter/ClipboardData';
3
5
  import type { DOMEventRecord } from '../parameter/DOMEventRecord';
4
6
  import type { SnapshotsManager } from '../parameter/SnapshotsManager';
5
7
  import type { Snapshot } from '../parameter/Snapshot';
6
- import type { CompatiblePluginEventType } from 'roosterjs-editor-types/lib/compatibleTypes';
7
8
  import type { ContentModelDocument } from '../group/ContentModelDocument';
8
9
  import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
9
10
  import type { DOMSelection } from '../selection/DOMSelection';
@@ -12,7 +13,8 @@ import type { EditorEnvironment } from '../parameter/EditorEnvironment';
12
13
  import type { ModelToDomOption } from '../context/ModelToDomOption';
13
14
  import type { OnNodeCreated } from '../context/ModelToDomSettings';
14
15
  import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
15
- import type { DarkColorHandler, PluginEventData, PluginEventFromType, PluginEventType } from 'roosterjs-editor-types';
16
+ import type { DarkColorHandler } from '../context/DarkColorHandler';
17
+ import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
16
18
  /**
17
19
  * An interface of standalone Content Model editor.
18
20
  * (This interface is still under development, and may still be changed in the future with some breaking changes)
@@ -84,7 +86,7 @@ export interface IStandaloneEditor {
84
86
  * @returns the event object which is really passed into plugins. Some plugin may modify the event object so
85
87
  * the result of this function provides a chance to read the modified result
86
88
  */
87
- triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
89
+ triggerEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
88
90
  /**
89
91
  * Get undo snapshots manager
90
92
  */
@@ -106,10 +108,16 @@ export interface IStandaloneEditor {
106
108
  * @returns current zoom scale number
107
109
  */
108
110
  getZoomScale(): number;
111
+ /**
112
+ * Set current zoom scale, default value is 1
113
+ * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
114
+ * to let editor behave correctly especially for those mouse drag/drop behaviors
115
+ */
116
+ setZoomScale(scale: number): void;
109
117
  /**
110
118
  * Add a single undo snapshot to undo stack
111
119
  */
112
- takeSnapshot(): void;
120
+ takeSnapshot(): Snapshot | null;
113
121
  /**
114
122
  * Restore an undo snapshot into editor
115
123
  * @param snapshot The snapshot to restore
@@ -156,7 +164,7 @@ export interface IStandaloneEditor {
156
164
  /**
157
165
  * Get a darkColorHandler object for this editor.
158
166
  */
159
- getDarkColorHandler(): DarkColorHandler;
167
+ getColorManager(): DarkColorHandler;
160
168
  /**
161
169
  * Dispose this editor, dispose all plugins and custom data
162
170
  */
@@ -166,4 +174,11 @@ export interface IStandaloneEditor {
166
174
  * @returns true if focus is in editor, otherwise false
167
175
  */
168
176
  hasFocus(): boolean;
177
+ /**
178
+ * Get a function to convert HTML string to trusted HTML string.
179
+ * By default it will just return the input HTML directly. To override this behavior,
180
+ * pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler
181
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types
182
+ */
183
+ getTrustedHTMLHandler(): TrustedHTMLHandler;
169
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IStandaloneEditor.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/IStandaloneEditor.ts"],"names":[],"mappings":"","sourcesContent":["import type { PasteType } from '../enum/PasteType';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { SnapshotsManager } from '../parameter/SnapshotsManager';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { CompatiblePluginEventType } from 'roosterjs-editor-types/lib/compatibleTypes';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { OnNodeCreated } from '../context/ModelToDomSettings';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\nimport type {\n DarkColorHandler,\n PluginEventData,\n PluginEventFromType,\n PluginEventType,\n} from 'roosterjs-editor-types';\n\n/**\n * An interface of standalone Content Model editor.\n * (This interface is still under development, and may still be changed in the future with some breaking changes)\n */\nexport interface IStandaloneEditor {\n /**\n * Create Content Model from DOM tree in this editor\n * @param rootNode Optional start node. If provided, Content Model will be created from this node (including itself),\n * otherwise it will create Content Model for the whole content in editor.\n * @param option The options to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When specified, use this selection to override existing selection inside editor\n */\n createContentModel(\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n ): ContentModelDocument;\n\n /**\n * Set content with content model\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\n setContentModel(\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n ): DOMSelection | null;\n\n /**\n * Get current running environment, such as if editor is running on Mac\n */\n getEnvironment(): EditorEnvironment;\n\n /**\n * Get current DOM selection.\n * This is the replacement of IEditor.getSelectionRangeEx.\n */\n getDOMSelection(): DOMSelection | null;\n\n /**\n * Set DOMSelection into editor content.\n * This is the replacement of IEditor.select.\n * @param selection The selection to set\n */\n setDOMSelection(selection: DOMSelection | null): void;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel(\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n ): void;\n\n /**\n * Get pending format of editor if any, or return null\n */\n getPendingFormat(): ContentModelSegmentFormat | null;\n\n /**\n * Get whether this editor is disposed\n * @returns True if editor is disposed, otherwise false\n */\n isDisposed(): boolean;\n\n /**\n * Get document which contains this editor\n * @returns The HTML document which contains this editor\n */\n getDocument(): Document;\n\n /**\n * Focus to this editor, the selection was restored to where it was before, no unexpected scroll.\n */\n focus(): void;\n\n /**\n * Trigger an event to be dispatched to all plugins\n * @param eventType Type of the event\n * @param data data of the event with given type, this is the rest part of PluginEvent with the given type\n * @param broadcast indicates if the event needs to be dispatched to all plugins\n * True means to all, false means to allow exclusive handling from one plugin unless no one wants that\n * @returns the event object which is really passed into plugins. Some plugin may modify the event object so\n * the result of this function provides a chance to read the modified result\n */\n triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(\n eventType: T,\n data: PluginEventData<T>,\n broadcast?: boolean\n ): PluginEventFromType<T>;\n\n /**\n * Get undo snapshots manager\n */\n getSnapshotsManager(): SnapshotsManager;\n\n /**\n * Check if the editor is in dark mode\n * @returns True if the editor is in dark mode, otherwise false\n */\n isDarkMode(): boolean;\n\n /**\n * Set the dark mode state and transforms the content to match the new state.\n * @param isDarkMode The next status of dark mode. True if the editor should be in dark mode, false if not.\n */\n setDarkModeState(isDarkMode?: boolean): void;\n\n /**\n * Get current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n * @returns current zoom scale number\n */\n getZoomScale(): number;\n\n /**\n * Add a single undo snapshot to undo stack\n */\n takeSnapshot(): void;\n\n /**\n * Restore an undo snapshot into editor\n * @param snapshot The snapshot to restore\n */\n restoreSnapshot(snapshot: Snapshot): void;\n\n /**\n * Check if editor is in IME input sequence\n * @returns True if editor is in IME input sequence, otherwise false\n */\n isInIME(): boolean;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent(eventMap: Record<string, DOMEventRecord>): () => void;\n\n /**\n * Check if editor is in Shadow Edit mode\n */\n isInShadowEdit(): boolean;\n\n /**\n * Make the editor in \"Shadow Edit\" mode.\n * In Shadow Edit mode, all format change will finally be ignored.\n * This can be used for building a live preview feature for format button, to allow user\n * see format result without really apply it.\n * This function can be called repeated. If editor is already in shadow edit mode, we can still\n * use this function to do more shadow edit operation.\n */\n startShadowEdit(): void;\n\n /**\n * Leave \"Shadow Edit\" mode, all changes made during shadow edit will be discarded\n */\n stopShadowEdit(): void;\n\n /**\n * Check if the given DOM node is in editor\n * @param node The node to check\n */\n isNodeInEditor(node: Node): boolean;\n\n /**\n * Paste into editor using a clipboardData object\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of paste\n */\n pasteFromClipboard(clipboardData: ClipboardData, pasteType?: PasteType): void;\n\n /**\n * Get a darkColorHandler object for this editor.\n */\n getDarkColorHandler(): DarkColorHandler;\n\n /**\n * Dispose this editor, dispose all plugins and custom data\n */\n dispose(): void;\n /**\n * Check if focus is in editor now\n * @returns true if focus is in editor, otherwise false\n */\n hasFocus(): boolean;\n}\n"]}
1
+ {"version":3,"file":"IStandaloneEditor.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/IStandaloneEditor.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';\nimport type { PluginEventType } from '../event/PluginEventType';\nimport type { PasteType } from '../enum/PasteType';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { SnapshotsManager } from '../parameter/SnapshotsManager';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { OnNodeCreated } from '../context/ModelToDomSettings';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\nimport type { DarkColorHandler } from '../context/DarkColorHandler';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\n\n/**\n * An interface of standalone Content Model editor.\n * (This interface is still under development, and may still be changed in the future with some breaking changes)\n */\nexport interface IStandaloneEditor {\n /**\n * Create Content Model from DOM tree in this editor\n * @param rootNode Optional start node. If provided, Content Model will be created from this node (including itself),\n * otherwise it will create Content Model for the whole content in editor.\n * @param option The options to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When specified, use this selection to override existing selection inside editor\n */\n createContentModel(\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n ): ContentModelDocument;\n\n /**\n * Set content with content model\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\n setContentModel(\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n ): DOMSelection | null;\n\n /**\n * Get current running environment, such as if editor is running on Mac\n */\n getEnvironment(): EditorEnvironment;\n\n /**\n * Get current DOM selection.\n * This is the replacement of IEditor.getSelectionRangeEx.\n */\n getDOMSelection(): DOMSelection | null;\n\n /**\n * Set DOMSelection into editor content.\n * This is the replacement of IEditor.select.\n * @param selection The selection to set\n */\n setDOMSelection(selection: DOMSelection | null): void;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel(\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n ): void;\n\n /**\n * Get pending format of editor if any, or return null\n */\n getPendingFormat(): ContentModelSegmentFormat | null;\n\n /**\n * Get whether this editor is disposed\n * @returns True if editor is disposed, otherwise false\n */\n isDisposed(): boolean;\n\n /**\n * Get document which contains this editor\n * @returns The HTML document which contains this editor\n */\n getDocument(): Document;\n\n /**\n * Focus to this editor, the selection was restored to where it was before, no unexpected scroll.\n */\n focus(): void;\n\n /**\n * Trigger an event to be dispatched to all plugins\n * @param eventType Type of the event\n * @param data data of the event with given type, this is the rest part of PluginEvent with the given type\n * @param broadcast indicates if the event needs to be dispatched to all plugins\n * True means to all, false means to allow exclusive handling from one plugin unless no one wants that\n * @returns the event object which is really passed into plugins. Some plugin may modify the event object so\n * the result of this function provides a chance to read the modified result\n */\n triggerEvent<T extends PluginEventType>(\n eventType: T,\n data: PluginEventData<T>,\n broadcast?: boolean\n ): PluginEventFromType<T>;\n\n /**\n * Get undo snapshots manager\n */\n getSnapshotsManager(): SnapshotsManager;\n\n /**\n * Check if the editor is in dark mode\n * @returns True if the editor is in dark mode, otherwise false\n */\n isDarkMode(): boolean;\n\n /**\n * Set the dark mode state and transforms the content to match the new state.\n * @param isDarkMode The next status of dark mode. True if the editor should be in dark mode, false if not.\n */\n setDarkModeState(isDarkMode?: boolean): void;\n\n /**\n * Get current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n * @returns current zoom scale number\n */\n getZoomScale(): number;\n\n /**\n * Set current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n */\n setZoomScale(scale: number): void;\n\n /**\n * Add a single undo snapshot to undo stack\n */\n takeSnapshot(): Snapshot | null;\n\n /**\n * Restore an undo snapshot into editor\n * @param snapshot The snapshot to restore\n */\n restoreSnapshot(snapshot: Snapshot): void;\n\n /**\n * Check if editor is in IME input sequence\n * @returns True if editor is in IME input sequence, otherwise false\n */\n isInIME(): boolean;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent(eventMap: Record<string, DOMEventRecord>): () => void;\n\n /**\n * Check if editor is in Shadow Edit mode\n */\n isInShadowEdit(): boolean;\n\n /**\n * Make the editor in \"Shadow Edit\" mode.\n * In Shadow Edit mode, all format change will finally be ignored.\n * This can be used for building a live preview feature for format button, to allow user\n * see format result without really apply it.\n * This function can be called repeated. If editor is already in shadow edit mode, we can still\n * use this function to do more shadow edit operation.\n */\n startShadowEdit(): void;\n\n /**\n * Leave \"Shadow Edit\" mode, all changes made during shadow edit will be discarded\n */\n stopShadowEdit(): void;\n\n /**\n * Check if the given DOM node is in editor\n * @param node The node to check\n */\n isNodeInEditor(node: Node): boolean;\n\n /**\n * Paste into editor using a clipboardData object\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of paste\n */\n pasteFromClipboard(clipboardData: ClipboardData, pasteType?: PasteType): void;\n\n /**\n * Get a darkColorHandler object for this editor.\n */\n getColorManager(): DarkColorHandler;\n\n /**\n * Dispose this editor, dispose all plugins and custom data\n */\n dispose(): void;\n /**\n * Check if focus is in editor now\n * @returns true if focus is in editor, otherwise false\n */\n hasFocus(): boolean;\n\n /**\n * Get a function to convert HTML string to trusted HTML string.\n * By default it will just return the input HTML directly. To override this behavior,\n * pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types\n */\n getTrustedHTMLHandler(): TrustedHTMLHandler;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { EditorPlugin } from './EditorPlugin';
2
+ /**
3
+ * An editor plugin which have a state object stored on editor core
4
+ * so that editor and core api can access it
5
+ */
6
+ export interface PluginWithState<T> extends EditorPlugin {
7
+ /**
8
+ * Get plugin state object
9
+ */
10
+ getState(): T;
11
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ContentModelContentChangedEvent.js.map
3
+ //# sourceMappingURL=PluginWithState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginWithState.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/PluginWithState.ts"],"names":[],"mappings":"","sourcesContent":["import type { EditorPlugin } from './EditorPlugin';\n\n/**\n * An editor plugin which have a state object stored on editor core\n * so that editor and core api can access it\n */\nexport interface PluginWithState<T> extends EditorPlugin {\n /**\n * Get plugin state object\n */\n getState(): T;\n}\n"]}
@@ -1,11 +1,13 @@
1
+ import type { PluginEvent } from '../event/PluginEvent';
2
+ import type { PluginState } from '../pluginState/PluginState';
3
+ import type { EditorPlugin } from './EditorPlugin';
1
4
  import type { ClipboardData } from '../parameter/ClipboardData';
2
5
  import type { PasteType } from '../enum/PasteType';
3
6
  import type { DOMEventRecord } from '../parameter/DOMEventRecord';
4
7
  import type { Snapshot } from '../parameter/Snapshot';
5
8
  import type { EntityState } from '../parameter/FormatWithContentModelContext';
6
- import type { DarkColorHandler, EditorPlugin, PluginEvent, Rect, TrustedHTMLHandler } from 'roosterjs-editor-types';
9
+ import type { DarkColorHandler } from '../context/DarkColorHandler';
7
10
  import type { ContentModelDocument } from '../group/ContentModelDocument';
8
- import type { StandaloneEditorCorePluginState } from '../pluginState/StandaloneEditorPluginState';
9
11
  import type { DOMSelection } from '../selection/DOMSelection';
10
12
  import type { DomToModelOption } from '../context/DomToModelOption';
11
13
  import type { DomToModelSettings } from '../context/DomToModelSettings';
@@ -13,6 +15,8 @@ import type { EditorContext } from '../context/EditorContext';
13
15
  import type { EditorEnvironment } from '../parameter/EditorEnvironment';
14
16
  import type { ModelToDomOption } from '../context/ModelToDomOption';
15
17
  import type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';
18
+ import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
19
+ import type { Rect } from '../parameter/Rect';
16
20
  import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
17
21
  /**
18
22
  * Create a EditorContext object used by ContentModel API
@@ -77,7 +81,7 @@ export declare type TriggerEvent = (core: StandaloneEditorCore, pluginEvent: Plu
77
81
  * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState
78
82
  * when undo/redo to this snapshot
79
83
  */
80
- export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => void;
84
+ export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => Snapshot | null;
81
85
  /**
82
86
  * Retrieves the rect of the visible viewport of the editor.
83
87
  * @param core The StandaloneEditorCore object
@@ -219,7 +223,7 @@ export interface StandaloneCoreApiMap {
219
223
  /**
220
224
  * Represents the core data structure of a Content Model editor
221
225
  */
222
- export interface StandaloneEditorCore extends StandaloneEditorCorePluginState {
226
+ export interface StandaloneEditorCore extends PluginState {
223
227
  /**
224
228
  * The content DIV element of this editor
225
229
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StandaloneEditorCore.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCore.ts"],"names":[],"mappings":"","sourcesContent":["import type { ClipboardData } from '../parameter/ClipboardData';\nimport type { PasteType } from '../enum/PasteType';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { EntityState } from '../parameter/FormatWithContentModelContext';\nimport type {\n DarkColorHandler,\n EditorPlugin,\n PluginEvent,\n Rect,\n TrustedHTMLHandler,\n} from 'roosterjs-editor-types';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { StandaloneEditorCorePluginState } from '../pluginState/StandaloneEditorPluginState';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { DomToModelSettings } from '../context/DomToModelSettings';\nimport type { EditorContext } from '../context/EditorContext';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\n\n/**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\nexport type CreateEditorContext = (core: StandaloneEditorCore) => EditorContext;\n\n/**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When passed, use this selection range instead of current selection in editor\n */\nexport type CreateContentModel = (\n core: StandaloneEditorCore,\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n) => ContentModelDocument;\n\n/**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\nexport type GetDOMSelection = (core: StandaloneEditorCore) => DOMSelection | null;\n\n/**\n * Set content with content model. This is the replacement of core API getSelectionRangeEx\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\nexport type SetContentModel = (\n core: StandaloneEditorCore,\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n) => DOMSelection | null;\n\n/**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\nexport type SetDOMSelection = (\n core: StandaloneEditorCore,\n selection: DOMSelection | null,\n skipSelectionChangedEvent?: boolean\n) => void;\n\n/**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\nexport type FormatContentModel = (\n core: StandaloneEditorCore,\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n) => void;\n\n/**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\nexport type SwitchShadowEdit = (core: StandaloneEditorCore, isOn: boolean) => void;\n\n/**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\nexport type TriggerEvent = (\n core: StandaloneEditorCore,\n pluginEvent: PluginEvent,\n broadcast: boolean\n) => void;\n\n/**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\nexport type AddUndoSnapshot = (\n core: StandaloneEditorCore,\n canUndoByBackspace: boolean,\n entityStates?: EntityState[]\n) => void;\n\n/**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\nexport type GetVisibleViewport = (core: StandaloneEditorCore) => Rect | null;\n\n/**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\nexport type HasFocus = (core: StandaloneEditorCore) => boolean;\n\n/**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\nexport type Focus = (core: StandaloneEditorCore) => void;\n\n/**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\nexport type AttachDomEvent = (\n core: StandaloneEditorCore,\n eventMap: Record<string, DOMEventRecord>\n) => () => void;\n\n/**\n * Restore an undo snapshot into editor\n * @param core The StandaloneEditorCore object\n * @param step Steps to move, can be 0, positive or negative\n */\nexport type RestoreUndoSnapshot = (core: StandaloneEditorCore, snapshot: Snapshot) => void;\n\n/**\n * Paste into editor using a clipboardData object\n * @param core The StandaloneEditorCore object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport type Paste = (\n core: StandaloneEditorCore,\n clipboardData: ClipboardData,\n pasteType: PasteType\n) => void;\n\n/**\n * The interface for the map of core API for Content Model editor.\n * Editor can call call API from this map under StandaloneEditorCore object\n */\nexport interface StandaloneCoreApiMap {\n /**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\n createEditorContext: CreateEditorContext;\n\n /**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n */\n createContentModel: CreateContentModel;\n\n /**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\n getDOMSelection: GetDOMSelection;\n\n /**\n * Set content with content model\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n */\n setContentModel: SetContentModel;\n\n /**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\n setDOMSelection: SetDOMSelection;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel: FormatContentModel;\n\n /**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\n switchShadowEdit: SwitchShadowEdit;\n\n /**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\n getVisibleViewport: GetVisibleViewport;\n\n /**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\n hasFocus: HasFocus;\n\n /**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\n focus: Focus;\n\n /**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\n addUndoSnapshot: AddUndoSnapshot;\n\n /**\n * Restore an undo snapshot into editor\n * @param core The editor core object\n * @param step Steps to move, can be 0, positive or negative\n */\n restoreUndoSnapshot: RestoreUndoSnapshot;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent: AttachDomEvent;\n\n /**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\n triggerEvent: TriggerEvent;\n\n /**\n * Paste into editor using a clipboardData object\n * @param editor The editor to paste content into\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\n paste: Paste;\n}\n\n/**\n * Represents the core data structure of a Content Model editor\n */\nexport interface StandaloneEditorCore extends StandaloneEditorCorePluginState {\n /**\n * The content DIV element of this editor\n */\n readonly contentDiv: HTMLDivElement;\n\n /**\n * Core API map of this editor\n */\n readonly api: StandaloneCoreApiMap;\n\n /**\n * Original API map of this editor. Overridden core API can use API from this map to call the original version of core API.\n */\n readonly originalApi: StandaloneCoreApiMap;\n\n /**\n * An array of editor plugins.\n */\n readonly plugins: EditorPlugin[];\n\n /**\n * Settings used by DOM to Content Model conversion\n */\n readonly domToModelSettings: ContentModelSettings<DomToModelOption, DomToModelSettings>;\n\n /**\n * Settings used by Content Model to DOM conversion\n */\n readonly modelToDomSettings: ContentModelSettings<ModelToDomOption, ModelToDomSettings>;\n\n /**\n * Editor running environment\n */\n readonly environment: EditorEnvironment;\n\n /**\n * Dark model handler for the editor, used for variable-based solution.\n * If keep it null, editor will still use original dataset-based dark mode solution.\n */\n readonly darkColorHandler: DarkColorHandler;\n\n /**\n * A handler to convert HTML string to a trust HTML string.\n * By default it will just return the original HTML string directly.\n * To override, pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n */\n readonly trustedHTMLHandler: TrustedHTMLHandler;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n readonly disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n\n /**\n * @deprecated Will be removed soon.\n * Current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using this property\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n */\n zoomScale: number;\n}\n\n/**\n * Default DOM and Content Model conversion settings for an editor\n */\nexport interface ContentModelSettings<OptionType, ConfigType> {\n /**\n * Built in options used by editor\n */\n builtIn: OptionType;\n\n /**\n * Customize options passed in from Editor Options, used for overwrite default option.\n * This will also be used by copy/paste\n */\n customized: OptionType;\n\n /**\n * Configuration calculated from default and customized options.\n * This is a cached object so that we don't need to cache it every time when we use Content Model\n */\n calculated: ConfigType;\n}\n"]}
1
+ {"version":3,"file":"StandaloneEditorCore.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCore.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEvent } from '../event/PluginEvent';\nimport type { PluginState } from '../pluginState/PluginState';\nimport type { EditorPlugin } from './EditorPlugin';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { PasteType } from '../enum/PasteType';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { EntityState } from '../parameter/FormatWithContentModelContext';\nimport type { DarkColorHandler } from '../context/DarkColorHandler';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { DomToModelSettings } from '../context/DomToModelSettings';\nimport type { EditorContext } from '../context/EditorContext';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\nimport type { Rect } from '../parameter/Rect';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\n\n/**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\nexport type CreateEditorContext = (core: StandaloneEditorCore) => EditorContext;\n\n/**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When passed, use this selection range instead of current selection in editor\n */\nexport type CreateContentModel = (\n core: StandaloneEditorCore,\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n) => ContentModelDocument;\n\n/**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\nexport type GetDOMSelection = (core: StandaloneEditorCore) => DOMSelection | null;\n\n/**\n * Set content with content model. This is the replacement of core API getSelectionRangeEx\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\nexport type SetContentModel = (\n core: StandaloneEditorCore,\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n) => DOMSelection | null;\n\n/**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\nexport type SetDOMSelection = (\n core: StandaloneEditorCore,\n selection: DOMSelection | null,\n skipSelectionChangedEvent?: boolean\n) => void;\n\n/**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\nexport type FormatContentModel = (\n core: StandaloneEditorCore,\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n) => void;\n\n/**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\nexport type SwitchShadowEdit = (core: StandaloneEditorCore, isOn: boolean) => void;\n\n/**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\nexport type TriggerEvent = (\n core: StandaloneEditorCore,\n pluginEvent: PluginEvent,\n broadcast: boolean\n) => void;\n\n/**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\nexport type AddUndoSnapshot = (\n core: StandaloneEditorCore,\n canUndoByBackspace: boolean,\n entityStates?: EntityState[]\n) => Snapshot | null;\n\n/**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\nexport type GetVisibleViewport = (core: StandaloneEditorCore) => Rect | null;\n\n/**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\nexport type HasFocus = (core: StandaloneEditorCore) => boolean;\n\n/**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\nexport type Focus = (core: StandaloneEditorCore) => void;\n\n/**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\nexport type AttachDomEvent = (\n core: StandaloneEditorCore,\n eventMap: Record<string, DOMEventRecord>\n) => () => void;\n\n/**\n * Restore an undo snapshot into editor\n * @param core The StandaloneEditorCore object\n * @param step Steps to move, can be 0, positive or negative\n */\nexport type RestoreUndoSnapshot = (core: StandaloneEditorCore, snapshot: Snapshot) => void;\n\n/**\n * Paste into editor using a clipboardData object\n * @param core The StandaloneEditorCore object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport type Paste = (\n core: StandaloneEditorCore,\n clipboardData: ClipboardData,\n pasteType: PasteType\n) => void;\n\n/**\n * The interface for the map of core API for Content Model editor.\n * Editor can call call API from this map under StandaloneEditorCore object\n */\nexport interface StandaloneCoreApiMap {\n /**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\n createEditorContext: CreateEditorContext;\n\n /**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n */\n createContentModel: CreateContentModel;\n\n /**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\n getDOMSelection: GetDOMSelection;\n\n /**\n * Set content with content model\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n */\n setContentModel: SetContentModel;\n\n /**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\n setDOMSelection: SetDOMSelection;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel: FormatContentModel;\n\n /**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\n switchShadowEdit: SwitchShadowEdit;\n\n /**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\n getVisibleViewport: GetVisibleViewport;\n\n /**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\n hasFocus: HasFocus;\n\n /**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\n focus: Focus;\n\n /**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\n addUndoSnapshot: AddUndoSnapshot;\n\n /**\n * Restore an undo snapshot into editor\n * @param core The editor core object\n * @param step Steps to move, can be 0, positive or negative\n */\n restoreUndoSnapshot: RestoreUndoSnapshot;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent: AttachDomEvent;\n\n /**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\n triggerEvent: TriggerEvent;\n\n /**\n * Paste into editor using a clipboardData object\n * @param editor The editor to paste content into\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\n paste: Paste;\n}\n\n/**\n * Represents the core data structure of a Content Model editor\n */\nexport interface StandaloneEditorCore extends PluginState {\n /**\n * The content DIV element of this editor\n */\n readonly contentDiv: HTMLDivElement;\n\n /**\n * Core API map of this editor\n */\n readonly api: StandaloneCoreApiMap;\n\n /**\n * Original API map of this editor. Overridden core API can use API from this map to call the original version of core API.\n */\n readonly originalApi: StandaloneCoreApiMap;\n\n /**\n * An array of editor plugins.\n */\n readonly plugins: EditorPlugin[];\n\n /**\n * Settings used by DOM to Content Model conversion\n */\n readonly domToModelSettings: ContentModelSettings<DomToModelOption, DomToModelSettings>;\n\n /**\n * Settings used by Content Model to DOM conversion\n */\n readonly modelToDomSettings: ContentModelSettings<ModelToDomOption, ModelToDomSettings>;\n\n /**\n * Editor running environment\n */\n readonly environment: EditorEnvironment;\n\n /**\n * Dark model handler for the editor, used for variable-based solution.\n * If keep it null, editor will still use original dataset-based dark mode solution.\n */\n readonly darkColorHandler: DarkColorHandler;\n\n /**\n * A handler to convert HTML string to a trust HTML string.\n * By default it will just return the original HTML string directly.\n * To override, pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n */\n readonly trustedHTMLHandler: TrustedHTMLHandler;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n readonly disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n\n /**\n * @deprecated Will be removed soon.\n * Current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using this property\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n */\n zoomScale: number;\n}\n\n/**\n * Default DOM and Content Model conversion settings for an editor\n */\nexport interface ContentModelSettings<OptionType, ConfigType> {\n /**\n * Built in options used by editor\n */\n builtIn: OptionType;\n\n /**\n * Customize options passed in from Editor Options, used for overwrite default option.\n * This will also be used by copy/paste\n */\n customized: OptionType;\n\n /**\n * Configuration calculated from default and customized options.\n * This is a cached object so that we don't need to cache it every time when we use Content Model\n */\n calculated: ConfigType;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { PluginWithState } from './PluginWithState';
1
2
  import type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';
2
3
  import type { UndoPluginState } from '../pluginState/UndoPluginState';
3
4
  import type { SelectionPluginState } from '../pluginState/SelectionPluginState';
@@ -6,7 +7,6 @@ import type { LifecyclePluginState } from '../pluginState/LifecyclePluginState';
6
7
  import type { DOMEventPluginState } from '../pluginState/DOMEventPluginState';
7
8
  import type { ContentModelCachePluginState } from '../pluginState/ContentModelCachePluginState';
8
9
  import type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';
9
- import type { PluginWithState } from 'roosterjs-editor-types';
10
10
  /**
11
11
  * Core plugins for standalone editor
12
12
  */