roosterjs-content-model-core 0.28.0 → 9.0.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 (1295) hide show
  1. package/README.md +47 -37
  2. package/lib/command/createModelFromHtml/convertInlineCss.js +75 -0
  3. package/lib/command/createModelFromHtml/convertInlineCss.js.map +1 -0
  4. package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
  5. package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.js +43 -0
  6. package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
  7. package/lib/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
  8. package/lib/command/createModelFromHtml/createModelFromHtml.js +31 -0
  9. package/lib/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
  10. package/lib/command/createModelFromHtml/sanitizeElement.js.map +1 -0
  11. package/lib/command/exportContent/exportContent.js.map +1 -0
  12. package/lib/command/paste/createPasteFragment.js.map +1 -0
  13. package/lib/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
  14. package/lib/command/paste/mergePasteContent.d.ts +9 -0
  15. package/lib/command/paste/mergePasteContent.js +76 -0
  16. package/lib/command/paste/mergePasteContent.js.map +1 -0
  17. package/lib/command/paste/paste.js +42 -0
  18. package/lib/command/paste/paste.js.map +1 -0
  19. package/lib/command/paste/retrieveHtmlInfo.d.ts +15 -0
  20. package/lib/command/paste/retrieveHtmlInfo.js +69 -0
  21. package/lib/command/paste/retrieveHtmlInfo.js.map +1 -0
  22. package/lib/command/redo/redo.js.map +1 -0
  23. package/lib/command/undo/undo.js.map +1 -0
  24. package/lib/coreApi/addUndoSnapshot/addUndoSnapshot.js +69 -0
  25. package/lib/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
  26. package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
  27. package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.js +117 -0
  28. package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
  29. package/lib/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
  30. package/lib/coreApi/addUndoSnapshot/getPath.js +60 -0
  31. package/lib/coreApi/addUndoSnapshot/getPath.js.map +1 -0
  32. package/lib/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
  33. package/lib/coreApi/coreApiMap.js +40 -0
  34. package/lib/coreApi/coreApiMap.js.map +1 -0
  35. package/lib/coreApi/createContentModel/createContentModel.js +47 -0
  36. package/lib/coreApi/createContentModel/createContentModel.js.map +1 -0
  37. package/lib/coreApi/createEditorContext/createEditorContext.js +26 -0
  38. package/lib/coreApi/createEditorContext/createEditorContext.js.map +1 -0
  39. package/lib/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
  40. package/lib/coreApi/focus/focus.js.map +1 -0
  41. package/lib/coreApi/formatContentModel/formatContentModel.js +122 -0
  42. package/lib/coreApi/formatContentModel/formatContentModel.js.map +1 -0
  43. package/lib/coreApi/getDOMSelection/getDOMSelection.js +32 -0
  44. package/lib/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
  45. package/lib/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
  46. package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
  47. package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.js +29 -0
  48. package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
  49. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +16 -0
  50. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
  51. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
  52. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
  53. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +21 -0
  54. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
  55. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +59 -0
  56. package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
  57. package/lib/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +38 -0
  58. package/lib/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
  59. package/lib/coreApi/setContentModel/setContentModel.js +36 -0
  60. package/lib/coreApi/setContentModel/setContentModel.js.map +1 -0
  61. package/lib/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
  62. package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
  63. package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.js +33 -0
  64. package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
  65. package/lib/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
  66. package/lib/coreApi/setDOMSelection/findTableCellElement.js +36 -0
  67. package/lib/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
  68. package/lib/coreApi/setDOMSelection/setDOMSelection.js +151 -0
  69. package/lib/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
  70. package/lib/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
  71. package/lib/coreApi/setEditorStyle/ensureUniqueId.js +17 -0
  72. package/lib/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
  73. package/lib/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
  74. package/lib/coreApi/setEditorStyle/setEditorStyle.js +57 -0
  75. package/lib/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
  76. package/lib/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
  77. package/lib/coreApi/setLogicalRoot/setLogicalRoot.js +41 -0
  78. package/lib/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
  79. package/lib/coreApi/switchShadowEdit/switchShadowEdit.js +45 -0
  80. package/lib/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
  81. package/lib/coreApi/triggerEvent/triggerEvent.js.map +1 -0
  82. package/lib/corePlugin/cache/CachePlugin.js +158 -0
  83. package/lib/corePlugin/cache/CachePlugin.js.map +1 -0
  84. package/lib/corePlugin/cache/areSameSelection.d.ts +6 -0
  85. package/lib/corePlugin/cache/areSameSelection.js +32 -0
  86. package/lib/corePlugin/cache/areSameSelection.js.map +1 -0
  87. package/lib/corePlugin/cache/domIndexerImpl.js +193 -0
  88. package/lib/corePlugin/cache/domIndexerImpl.js.map +1 -0
  89. package/lib/corePlugin/cache/textMutationObserver.js.map +1 -0
  90. package/lib/corePlugin/cache/updateCachedSelection.d.ts +5 -0
  91. package/lib/corePlugin/cache/updateCachedSelection.js +28 -0
  92. package/lib/corePlugin/cache/updateCachedSelection.js.map +1 -0
  93. package/lib/corePlugin/contextMenu/ContextMenuPlugin.js +112 -0
  94. package/lib/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
  95. package/lib/corePlugin/copyPaste/CopyPastePlugin.js +269 -0
  96. package/lib/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
  97. package/lib/corePlugin/copyPaste/deleteEmptyList.js +42 -0
  98. package/lib/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
  99. package/lib/corePlugin/createEditorCorePlugins.js +9 -9
  100. package/lib/corePlugin/createEditorCorePlugins.js.map +1 -1
  101. package/lib/corePlugin/domEvent/DOMEventPlugin.js +199 -0
  102. package/lib/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
  103. package/lib/corePlugin/entity/EntityPlugin.js +216 -0
  104. package/lib/corePlugin/entity/EntityPlugin.js.map +1 -0
  105. package/lib/corePlugin/entity/entityDelimiterUtils.js +279 -0
  106. package/lib/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
  107. package/lib/corePlugin/entity/findAllEntities.js.map +1 -0
  108. package/lib/corePlugin/format/FormatPlugin.js +188 -0
  109. package/lib/corePlugin/format/FormatPlugin.js.map +1 -0
  110. package/lib/corePlugin/format/applyDefaultFormat.js +53 -0
  111. package/lib/corePlugin/format/applyDefaultFormat.js.map +1 -0
  112. package/lib/corePlugin/format/applyPendingFormat.js +50 -0
  113. package/lib/corePlugin/format/applyPendingFormat.js.map +1 -0
  114. package/lib/corePlugin/lifecycle/LifecyclePlugin.js +121 -0
  115. package/lib/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
  116. package/lib/corePlugin/selection/SelectionPlugin.js +420 -0
  117. package/lib/corePlugin/selection/SelectionPlugin.js.map +1 -0
  118. package/lib/corePlugin/selection/findCoordinate.d.ts +6 -0
  119. package/lib/corePlugin/selection/findCoordinate.js +29 -0
  120. package/lib/corePlugin/selection/findCoordinate.js.map +1 -0
  121. package/lib/corePlugin/selection/normalizePos.d.ts +5 -0
  122. package/lib/corePlugin/selection/normalizePos.js +29 -0
  123. package/lib/corePlugin/selection/normalizePos.js.map +1 -0
  124. package/lib/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
  125. package/lib/corePlugin/undo/UndoPlugin.js +218 -0
  126. package/lib/corePlugin/undo/UndoPlugin.js.map +1 -0
  127. package/lib/editor/Editor.d.ts +16 -5
  128. package/lib/editor/Editor.js +36 -22
  129. package/lib/editor/Editor.js.map +1 -1
  130. package/lib/editor/core/DOMHelperImpl.js.map +1 -0
  131. package/lib/editor/core/DarkColorHandlerImpl.js.map +1 -0
  132. package/lib/editor/core/createEditorCore.js +86 -0
  133. package/lib/editor/core/createEditorCore.js.map +1 -0
  134. package/lib/editor/core/createEditorDefaultSettings.js +48 -0
  135. package/lib/editor/core/createEditorDefaultSettings.js.map +1 -0
  136. package/lib/index.d.ts +5 -42
  137. package/lib/index.js +10 -95
  138. package/lib/index.js.map +1 -1
  139. package/lib/override/listMetadataApplier.d.ts +9 -0
  140. package/lib/override/listMetadataApplier.js +140 -0
  141. package/lib/override/listMetadataApplier.js.map +1 -0
  142. package/lib/override/pasteEntityProcessor.js +1 -1
  143. package/lib/override/pasteEntityProcessor.js.map +1 -1
  144. package/lib/override/pasteGeneralProcessor.js +1 -1
  145. package/lib/override/pasteGeneralProcessor.js.map +1 -1
  146. package/lib/override/tablePreProcessor.js +1 -2
  147. package/lib/override/tablePreProcessor.js.map +1 -1
  148. package/lib-amd/command/createModelFromHtml/convertInlineCss.js +75 -0
  149. package/lib-amd/command/createModelFromHtml/convertInlineCss.js.map +1 -0
  150. package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
  151. package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.js +36 -0
  152. package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
  153. package/lib-amd/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
  154. package/lib-amd/command/createModelFromHtml/createModelFromHtml.js +30 -0
  155. package/lib-amd/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
  156. package/lib-amd/command/createModelFromHtml/sanitizeElement.js.map +1 -0
  157. package/lib-amd/command/exportContent/exportContent.js.map +1 -0
  158. package/lib-amd/command/paste/createPasteFragment.js.map +1 -0
  159. package/lib-amd/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
  160. package/lib-amd/command/paste/mergePasteContent.d.ts +9 -0
  161. package/lib-amd/command/paste/mergePasteContent.js +75 -0
  162. package/lib-amd/command/paste/mergePasteContent.js.map +1 -0
  163. package/lib-amd/command/paste/paste.js +39 -0
  164. package/lib-amd/command/paste/paste.js.map +1 -0
  165. package/lib-amd/command/paste/retrieveHtmlInfo.d.ts +15 -0
  166. package/lib-amd/command/paste/retrieveHtmlInfo.js +68 -0
  167. package/lib-amd/command/paste/retrieveHtmlInfo.js.map +1 -0
  168. package/lib-amd/command/redo/redo.js.map +1 -0
  169. package/lib-amd/command/undo/undo.js.map +1 -0
  170. package/lib-amd/coreApi/addUndoSnapshot/addUndoSnapshot.js +68 -0
  171. package/lib-amd/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
  172. package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
  173. package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.js +117 -0
  174. package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
  175. package/lib-amd/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
  176. package/lib-amd/coreApi/addUndoSnapshot/getPath.js +61 -0
  177. package/lib-amd/coreApi/addUndoSnapshot/getPath.js.map +1 -0
  178. package/lib-amd/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
  179. package/lib-amd/coreApi/coreApiMap.js +27 -0
  180. package/lib-amd/coreApi/coreApiMap.js.map +1 -0
  181. package/lib-amd/coreApi/createContentModel/createContentModel.js +47 -0
  182. package/lib-amd/coreApi/createContentModel/createContentModel.js.map +1 -0
  183. package/lib-amd/coreApi/createEditorContext/createEditorContext.js +26 -0
  184. package/lib-amd/coreApi/createEditorContext/createEditorContext.js.map +1 -0
  185. package/lib-amd/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
  186. package/lib-amd/coreApi/focus/focus.js.map +1 -0
  187. package/lib-amd/coreApi/formatContentModel/formatContentModel.js +122 -0
  188. package/lib-amd/coreApi/formatContentModel/formatContentModel.js.map +1 -0
  189. package/lib-amd/coreApi/getDOMSelection/getDOMSelection.js +34 -0
  190. package/lib-amd/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
  191. package/lib-amd/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
  192. package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
  193. package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.js +30 -0
  194. package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
  195. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +17 -0
  196. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
  197. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
  198. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
  199. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +22 -0
  200. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
  201. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +60 -0
  202. package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
  203. package/lib-amd/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +35 -0
  204. package/lib-amd/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
  205. package/lib-amd/coreApi/setContentModel/setContentModel.js +36 -0
  206. package/lib-amd/coreApi/setContentModel/setContentModel.js.map +1 -0
  207. package/lib-amd/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
  208. package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
  209. package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.js +35 -0
  210. package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
  211. package/lib-amd/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
  212. package/lib-amd/coreApi/setDOMSelection/findTableCellElement.js +38 -0
  213. package/lib-amd/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
  214. package/lib-amd/coreApi/setDOMSelection/setDOMSelection.js +148 -0
  215. package/lib-amd/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
  216. package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
  217. package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.js +19 -0
  218. package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
  219. package/lib-amd/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
  220. package/lib-amd/coreApi/setEditorStyle/setEditorStyle.js +58 -0
  221. package/lib-amd/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
  222. package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
  223. package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.js +43 -0
  224. package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
  225. package/lib-amd/coreApi/switchShadowEdit/switchShadowEdit.js +46 -0
  226. package/lib-amd/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
  227. package/lib-amd/coreApi/triggerEvent/triggerEvent.js.map +1 -0
  228. package/lib-amd/corePlugin/cache/CachePlugin.js +156 -0
  229. package/lib-amd/corePlugin/cache/CachePlugin.js.map +1 -0
  230. package/lib-amd/corePlugin/cache/areSameSelection.d.ts +6 -0
  231. package/lib-amd/corePlugin/cache/areSameSelection.js +34 -0
  232. package/lib-amd/corePlugin/cache/areSameSelection.js.map +1 -0
  233. package/lib-amd/corePlugin/cache/domIndexerImpl.js +193 -0
  234. package/lib-amd/corePlugin/cache/domIndexerImpl.js.map +1 -0
  235. package/lib-amd/corePlugin/cache/textMutationObserver.js.map +1 -0
  236. package/lib-amd/corePlugin/cache/updateCachedSelection.d.ts +5 -0
  237. package/lib-amd/corePlugin/cache/updateCachedSelection.js +30 -0
  238. package/lib-amd/corePlugin/cache/updateCachedSelection.js.map +1 -0
  239. package/lib-amd/corePlugin/contextMenu/ContextMenuPlugin.js +112 -0
  240. package/lib-amd/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
  241. package/lib-amd/corePlugin/copyPaste/CopyPastePlugin.js +265 -0
  242. package/lib-amd/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
  243. package/lib-amd/corePlugin/copyPaste/deleteEmptyList.js +43 -0
  244. package/lib-amd/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
  245. package/lib-amd/corePlugin/createEditorCorePlugins.js +1 -1
  246. package/lib-amd/corePlugin/createEditorCorePlugins.js.map +1 -1
  247. package/lib-amd/corePlugin/domEvent/DOMEventPlugin.js +200 -0
  248. package/lib-amd/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
  249. package/lib-amd/corePlugin/entity/EntityPlugin.js +215 -0
  250. package/lib-amd/corePlugin/entity/EntityPlugin.js.map +1 -0
  251. package/lib-amd/corePlugin/entity/entityDelimiterUtils.js +278 -0
  252. package/lib-amd/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
  253. package/lib-amd/corePlugin/entity/findAllEntities.js.map +1 -0
  254. package/lib-amd/corePlugin/format/FormatPlugin.js +186 -0
  255. package/lib-amd/corePlugin/format/FormatPlugin.js.map +1 -0
  256. package/lib-amd/corePlugin/format/applyDefaultFormat.js +53 -0
  257. package/lib-amd/corePlugin/format/applyDefaultFormat.js.map +1 -0
  258. package/lib-amd/corePlugin/format/applyPendingFormat.js +50 -0
  259. package/lib-amd/corePlugin/format/applyPendingFormat.js.map +1 -0
  260. package/lib-amd/corePlugin/lifecycle/LifecyclePlugin.js +122 -0
  261. package/lib-amd/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
  262. package/lib-amd/corePlugin/selection/SelectionPlugin.js +418 -0
  263. package/lib-amd/corePlugin/selection/SelectionPlugin.js.map +1 -0
  264. package/lib-amd/corePlugin/selection/findCoordinate.d.ts +6 -0
  265. package/lib-amd/corePlugin/selection/findCoordinate.js +31 -0
  266. package/lib-amd/corePlugin/selection/findCoordinate.js.map +1 -0
  267. package/lib-amd/corePlugin/selection/normalizePos.d.ts +5 -0
  268. package/lib-amd/corePlugin/selection/normalizePos.js +30 -0
  269. package/lib-amd/corePlugin/selection/normalizePos.js.map +1 -0
  270. package/lib-amd/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
  271. package/lib-amd/corePlugin/undo/UndoPlugin.js +217 -0
  272. package/lib-amd/corePlugin/undo/UndoPlugin.js.map +1 -0
  273. package/lib-amd/editor/Editor.d.ts +16 -5
  274. package/lib-amd/editor/Editor.js +36 -18
  275. package/lib-amd/editor/Editor.js.map +1 -1
  276. package/lib-amd/editor/core/DOMHelperImpl.js.map +1 -0
  277. package/lib-amd/editor/core/DarkColorHandlerImpl.js.map +1 -0
  278. package/lib-amd/editor/core/createEditorCore.js +82 -0
  279. package/lib-amd/editor/core/createEditorCore.js.map +1 -0
  280. package/lib-amd/editor/core/createEditorDefaultSettings.js +47 -0
  281. package/lib-amd/editor/core/createEditorDefaultSettings.js.map +1 -0
  282. package/lib-amd/index.d.ts +5 -42
  283. package/lib-amd/index.js +3 -52
  284. package/lib-amd/index.js.map +1 -1
  285. package/lib-amd/override/listMetadataApplier.d.ts +9 -0
  286. package/lib-amd/override/listMetadataApplier.js +140 -0
  287. package/lib-amd/override/listMetadataApplier.js.map +1 -0
  288. package/lib-amd/override/pasteEntityProcessor.js +1 -1
  289. package/lib-amd/override/pasteEntityProcessor.js.map +1 -1
  290. package/lib-amd/override/pasteGeneralProcessor.js +1 -1
  291. package/lib-amd/override/pasteGeneralProcessor.js.map +1 -1
  292. package/lib-amd/override/tablePreProcessor.js +2 -2
  293. package/lib-amd/override/tablePreProcessor.js.map +1 -1
  294. package/lib-mjs/command/createModelFromHtml/convertInlineCss.js +70 -0
  295. package/lib-mjs/command/createModelFromHtml/convertInlineCss.js.map +1 -0
  296. package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
  297. package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.js +39 -0
  298. package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
  299. package/lib-mjs/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
  300. package/lib-mjs/command/createModelFromHtml/createModelFromHtml.js +27 -0
  301. package/lib-mjs/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
  302. package/lib-mjs/command/createModelFromHtml/sanitizeElement.js.map +1 -0
  303. package/lib-mjs/command/exportContent/exportContent.js.map +1 -0
  304. package/lib-mjs/command/paste/createPasteFragment.js.map +1 -0
  305. package/lib-mjs/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
  306. package/lib-mjs/command/paste/mergePasteContent.d.ts +9 -0
  307. package/lib-mjs/command/paste/mergePasteContent.js +71 -0
  308. package/lib-mjs/command/paste/mergePasteContent.js.map +1 -0
  309. package/lib-mjs/command/paste/paste.js +38 -0
  310. package/lib-mjs/command/paste/paste.js.map +1 -0
  311. package/lib-mjs/command/paste/retrieveHtmlInfo.d.ts +15 -0
  312. package/lib-mjs/command/paste/retrieveHtmlInfo.js +65 -0
  313. package/lib-mjs/command/paste/retrieveHtmlInfo.js.map +1 -0
  314. package/lib-mjs/command/redo/redo.js.map +1 -0
  315. package/lib-mjs/command/undo/undo.js.map +1 -0
  316. package/lib-mjs/coreApi/addUndoSnapshot/addUndoSnapshot.js +65 -0
  317. package/lib-mjs/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
  318. package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
  319. package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.js +113 -0
  320. package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
  321. package/lib-mjs/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
  322. package/lib-mjs/coreApi/addUndoSnapshot/getPath.js +56 -0
  323. package/lib-mjs/coreApi/addUndoSnapshot/getPath.js.map +1 -0
  324. package/lib-mjs/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
  325. package/lib-mjs/coreApi/coreApiMap.js +37 -0
  326. package/lib-mjs/coreApi/coreApiMap.js.map +1 -0
  327. package/lib-mjs/coreApi/createContentModel/createContentModel.js +43 -0
  328. package/lib-mjs/coreApi/createContentModel/createContentModel.js.map +1 -0
  329. package/lib-mjs/coreApi/createEditorContext/createEditorContext.js +22 -0
  330. package/lib-mjs/coreApi/createEditorContext/createEditorContext.js.map +1 -0
  331. package/lib-mjs/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
  332. package/lib-mjs/coreApi/focus/focus.js.map +1 -0
  333. package/lib-mjs/coreApi/formatContentModel/formatContentModel.js +118 -0
  334. package/lib-mjs/coreApi/formatContentModel/formatContentModel.js.map +1 -0
  335. package/lib-mjs/coreApi/getDOMSelection/getDOMSelection.js +28 -0
  336. package/lib-mjs/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
  337. package/lib-mjs/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
  338. package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
  339. package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.js +25 -0
  340. package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
  341. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +12 -0
  342. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
  343. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
  344. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
  345. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +17 -0
  346. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
  347. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +55 -0
  348. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
  349. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +34 -0
  350. package/lib-mjs/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
  351. package/lib-mjs/coreApi/setContentModel/setContentModel.js +32 -0
  352. package/lib-mjs/coreApi/setContentModel/setContentModel.js.map +1 -0
  353. package/lib-mjs/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
  354. package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
  355. package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.js +29 -0
  356. package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
  357. package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
  358. package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.js +32 -0
  359. package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
  360. package/lib-mjs/coreApi/setDOMSelection/setDOMSelection.js +147 -0
  361. package/lib-mjs/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
  362. package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
  363. package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.js +13 -0
  364. package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
  365. package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
  366. package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.js +53 -0
  367. package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
  368. package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
  369. package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.js +37 -0
  370. package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
  371. package/lib-mjs/coreApi/switchShadowEdit/switchShadowEdit.js +41 -0
  372. package/lib-mjs/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
  373. package/lib-mjs/coreApi/triggerEvent/triggerEvent.js.map +1 -0
  374. package/lib-mjs/corePlugin/cache/CachePlugin.js +154 -0
  375. package/lib-mjs/corePlugin/cache/CachePlugin.js.map +1 -0
  376. package/lib-mjs/corePlugin/cache/areSameSelection.d.ts +6 -0
  377. package/lib-mjs/corePlugin/cache/areSameSelection.js +28 -0
  378. package/lib-mjs/corePlugin/cache/areSameSelection.js.map +1 -0
  379. package/lib-mjs/corePlugin/cache/domIndexerImpl.js +190 -0
  380. package/lib-mjs/corePlugin/cache/domIndexerImpl.js.map +1 -0
  381. package/lib-mjs/corePlugin/cache/textMutationObserver.js.map +1 -0
  382. package/lib-mjs/corePlugin/cache/updateCachedSelection.d.ts +5 -0
  383. package/lib-mjs/corePlugin/cache/updateCachedSelection.js +24 -0
  384. package/lib-mjs/corePlugin/cache/updateCachedSelection.js.map +1 -0
  385. package/lib-mjs/corePlugin/contextMenu/ContextMenuPlugin.js +108 -0
  386. package/lib-mjs/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
  387. package/lib-mjs/corePlugin/copyPaste/CopyPastePlugin.js +262 -0
  388. package/lib-mjs/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
  389. package/lib-mjs/corePlugin/copyPaste/deleteEmptyList.js +38 -0
  390. package/lib-mjs/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
  391. package/lib-mjs/corePlugin/createEditorCorePlugins.js +9 -9
  392. package/lib-mjs/corePlugin/createEditorCorePlugins.js.map +1 -1
  393. package/lib-mjs/corePlugin/domEvent/DOMEventPlugin.js +195 -0
  394. package/lib-mjs/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
  395. package/lib-mjs/corePlugin/entity/EntityPlugin.js +212 -0
  396. package/lib-mjs/corePlugin/entity/EntityPlugin.js.map +1 -0
  397. package/lib-mjs/corePlugin/entity/entityDelimiterUtils.js +270 -0
  398. package/lib-mjs/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
  399. package/lib-mjs/corePlugin/entity/findAllEntities.js.map +1 -0
  400. package/lib-mjs/corePlugin/format/FormatPlugin.js +184 -0
  401. package/lib-mjs/corePlugin/format/FormatPlugin.js.map +1 -0
  402. package/lib-mjs/corePlugin/format/applyDefaultFormat.js +49 -0
  403. package/lib-mjs/corePlugin/format/applyDefaultFormat.js.map +1 -0
  404. package/lib-mjs/corePlugin/format/applyPendingFormat.js +46 -0
  405. package/lib-mjs/corePlugin/format/applyPendingFormat.js.map +1 -0
  406. package/lib-mjs/corePlugin/lifecycle/LifecyclePlugin.js +117 -0
  407. package/lib-mjs/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
  408. package/lib-mjs/corePlugin/selection/SelectionPlugin.js +416 -0
  409. package/lib-mjs/corePlugin/selection/SelectionPlugin.js.map +1 -0
  410. package/lib-mjs/corePlugin/selection/findCoordinate.d.ts +6 -0
  411. package/lib-mjs/corePlugin/selection/findCoordinate.js +25 -0
  412. package/lib-mjs/corePlugin/selection/findCoordinate.js.map +1 -0
  413. package/lib-mjs/corePlugin/selection/normalizePos.d.ts +5 -0
  414. package/lib-mjs/corePlugin/selection/normalizePos.js +25 -0
  415. package/lib-mjs/corePlugin/selection/normalizePos.js.map +1 -0
  416. package/lib-mjs/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
  417. package/lib-mjs/corePlugin/undo/UndoPlugin.js +214 -0
  418. package/lib-mjs/corePlugin/undo/UndoPlugin.js.map +1 -0
  419. package/lib-mjs/editor/Editor.d.ts +16 -5
  420. package/lib-mjs/editor/Editor.js +33 -19
  421. package/lib-mjs/editor/Editor.js.map +1 -1
  422. package/lib-mjs/editor/core/DOMHelperImpl.js.map +1 -0
  423. package/lib-mjs/editor/core/DarkColorHandlerImpl.js.map +1 -0
  424. package/lib-mjs/editor/core/createEditorCore.js +80 -0
  425. package/lib-mjs/editor/core/createEditorCore.js.map +1 -0
  426. package/lib-mjs/editor/core/createEditorDefaultSettings.js +43 -0
  427. package/lib-mjs/editor/core/createEditorDefaultSettings.js.map +1 -0
  428. package/lib-mjs/index.d.ts +5 -42
  429. package/lib-mjs/index.js +7 -42
  430. package/lib-mjs/index.js.map +1 -1
  431. package/lib-mjs/override/listMetadataApplier.d.ts +9 -0
  432. package/lib-mjs/override/listMetadataApplier.js +137 -0
  433. package/lib-mjs/override/listMetadataApplier.js.map +1 -0
  434. package/lib-mjs/override/pasteEntityProcessor.js +1 -1
  435. package/lib-mjs/override/pasteEntityProcessor.js.map +1 -1
  436. package/lib-mjs/override/pasteGeneralProcessor.js +1 -1
  437. package/lib-mjs/override/pasteGeneralProcessor.js.map +1 -1
  438. package/lib-mjs/override/tablePreProcessor.js +1 -2
  439. package/lib-mjs/override/tablePreProcessor.js.map +1 -1
  440. package/package.json +4 -4
  441. package/lib/constants/BulletListType.d.ts +0 -49
  442. package/lib/constants/BulletListType.js +0 -53
  443. package/lib/constants/BulletListType.js.map +0 -1
  444. package/lib/constants/ChangeSource.d.ts +0 -59
  445. package/lib/constants/ChangeSource.js +0 -63
  446. package/lib/constants/ChangeSource.js.map +0 -1
  447. package/lib/constants/NumberingListType.d.ts +0 -93
  448. package/lib/constants/NumberingListType.js +0 -97
  449. package/lib/constants/NumberingListType.js.map +0 -1
  450. package/lib/constants/TableBorderFormat.d.ts +0 -81
  451. package/lib/constants/TableBorderFormat.js +0 -85
  452. package/lib/constants/TableBorderFormat.js.map +0 -1
  453. package/lib/coreApi/addUndoSnapshot.js +0 -33
  454. package/lib/coreApi/addUndoSnapshot.js.map +0 -1
  455. package/lib/coreApi/attachDomEvent.js.map +0 -1
  456. package/lib/coreApi/createContentModel.js +0 -44
  457. package/lib/coreApi/createContentModel.js.map +0 -1
  458. package/lib/coreApi/createEditorContext.js +0 -25
  459. package/lib/coreApi/createEditorContext.js.map +0 -1
  460. package/lib/coreApi/focus.js.map +0 -1
  461. package/lib/coreApi/formatContentModel.js +0 -118
  462. package/lib/coreApi/formatContentModel.js.map +0 -1
  463. package/lib/coreApi/getDOMSelection.js +0 -40
  464. package/lib/coreApi/getDOMSelection.js.map +0 -1
  465. package/lib/coreApi/getVisibleViewport.js.map +0 -1
  466. package/lib/coreApi/restoreUndoSnapshot.js +0 -36
  467. package/lib/coreApi/restoreUndoSnapshot.js.map +0 -1
  468. package/lib/coreApi/setContentModel.js +0 -35
  469. package/lib/coreApi/setContentModel.js.map +0 -1
  470. package/lib/coreApi/setDOMSelection.js +0 -163
  471. package/lib/coreApi/setDOMSelection.js.map +0 -1
  472. package/lib/coreApi/switchShadowEdit.js +0 -46
  473. package/lib/coreApi/switchShadowEdit.js.map +0 -1
  474. package/lib/coreApi/triggerEvent.js.map +0 -1
  475. package/lib/corePlugin/CachePlugin.js +0 -157
  476. package/lib/corePlugin/CachePlugin.js.map +0 -1
  477. package/lib/corePlugin/ContextMenuPlugin.js +0 -112
  478. package/lib/corePlugin/ContextMenuPlugin.js.map +0 -1
  479. package/lib/corePlugin/CopyPastePlugin.js +0 -274
  480. package/lib/corePlugin/CopyPastePlugin.js.map +0 -1
  481. package/lib/corePlugin/DOMEventPlugin.js +0 -201
  482. package/lib/corePlugin/DOMEventPlugin.js.map +0 -1
  483. package/lib/corePlugin/EntityPlugin.js +0 -217
  484. package/lib/corePlugin/EntityPlugin.js.map +0 -1
  485. package/lib/corePlugin/FormatPlugin.js +0 -189
  486. package/lib/corePlugin/FormatPlugin.js.map +0 -1
  487. package/lib/corePlugin/LifecyclePlugin.js +0 -114
  488. package/lib/corePlugin/LifecyclePlugin.js.map +0 -1
  489. package/lib/corePlugin/SelectionPlugin.js +0 -189
  490. package/lib/corePlugin/SelectionPlugin.js.map +0 -1
  491. package/lib/corePlugin/UndoPlugin.js +0 -221
  492. package/lib/corePlugin/UndoPlugin.js.map +0 -1
  493. package/lib/corePlugin/utils/addRangeToSelection.js.map +0 -1
  494. package/lib/corePlugin/utils/applyDefaultFormat.js +0 -54
  495. package/lib/corePlugin/utils/applyDefaultFormat.js.map +0 -1
  496. package/lib/corePlugin/utils/applyPendingFormat.js +0 -51
  497. package/lib/corePlugin/utils/applyPendingFormat.js.map +0 -1
  498. package/lib/corePlugin/utils/areSameSelection.d.ts +0 -6
  499. package/lib/corePlugin/utils/areSameSelection.js +0 -36
  500. package/lib/corePlugin/utils/areSameSelection.js.map +0 -1
  501. package/lib/corePlugin/utils/deleteEmptyList.js +0 -44
  502. package/lib/corePlugin/utils/deleteEmptyList.js.map +0 -1
  503. package/lib/corePlugin/utils/domIndexerImpl.js +0 -190
  504. package/lib/corePlugin/utils/domIndexerImpl.js.map +0 -1
  505. package/lib/corePlugin/utils/entityDelimiterUtils.js +0 -259
  506. package/lib/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
  507. package/lib/corePlugin/utils/findAllEntities.js.map +0 -1
  508. package/lib/corePlugin/utils/textMutationObserver.js.map +0 -1
  509. package/lib/editor/DOMHelperImpl.js.map +0 -1
  510. package/lib/editor/DarkColorHandlerImpl.js.map +0 -1
  511. package/lib/editor/SnapshotsManagerImpl.js.map +0 -1
  512. package/lib/editor/coreApiMap.js +0 -36
  513. package/lib/editor/coreApiMap.js.map +0 -1
  514. package/lib/editor/createEditorCore.js +0 -86
  515. package/lib/editor/createEditorCore.js.map +0 -1
  516. package/lib/editor/createEditorDefaultSettings.js +0 -48
  517. package/lib/editor/createEditorDefaultSettings.js.map +0 -1
  518. package/lib/metadata/definitionCreators.d.ts +0 -48
  519. package/lib/metadata/definitionCreators.js +0 -95
  520. package/lib/metadata/definitionCreators.js.map +0 -1
  521. package/lib/metadata/updateImageMetadata.d.ts +0 -7
  522. package/lib/metadata/updateImageMetadata.js +0 -28
  523. package/lib/metadata/updateImageMetadata.js.map +0 -1
  524. package/lib/metadata/updateListMetadata.d.ts +0 -22
  525. package/lib/metadata/updateListMetadata.js +0 -207
  526. package/lib/metadata/updateListMetadata.js.map +0 -1
  527. package/lib/metadata/updateTableCellMetadata.d.ts +0 -7
  528. package/lib/metadata/updateTableCellMetadata.js +0 -20
  529. package/lib/metadata/updateTableCellMetadata.js.map +0 -1
  530. package/lib/metadata/updateTableMetadata.d.ts +0 -7
  531. package/lib/metadata/updateTableMetadata.js +0 -32
  532. package/lib/metadata/updateTableMetadata.js.map +0 -1
  533. package/lib/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
  534. package/lib/modelApi/edit/deleteExpandedSelection.js +0 -100
  535. package/lib/modelApi/edit/deleteExpandedSelection.js.map +0 -1
  536. package/lib/modelApi/edit/deleteSingleChar.d.ts +0 -4
  537. package/lib/modelApi/edit/deleteSingleChar.js +0 -36
  538. package/lib/modelApi/edit/deleteSingleChar.js.map +0 -1
  539. package/lib/override/reducedModelChildProcessor.d.ts +0 -21
  540. package/lib/override/reducedModelChildProcessor.js +0 -66
  541. package/lib/override/reducedModelChildProcessor.js.map +0 -1
  542. package/lib/publicApi/color/transformColor.d.ts +0 -9
  543. package/lib/publicApi/color/transformColor.js +0 -41
  544. package/lib/publicApi/color/transformColor.js.map +0 -1
  545. package/lib/publicApi/domUtils/borderValues.d.ts +0 -13
  546. package/lib/publicApi/domUtils/borderValues.js +0 -48
  547. package/lib/publicApi/domUtils/borderValues.js.map +0 -1
  548. package/lib/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
  549. package/lib/publicApi/domUtils/cacheGetEventData.js +0 -20
  550. package/lib/publicApi/domUtils/cacheGetEventData.js.map +0 -1
  551. package/lib/publicApi/domUtils/eventUtils.d.ts +0 -20
  552. package/lib/publicApi/domUtils/eventUtils.js +0 -49
  553. package/lib/publicApi/domUtils/eventUtils.js.map +0 -1
  554. package/lib/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
  555. package/lib/publicApi/domUtils/getSegmentTextFormat.js +0 -33
  556. package/lib/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
  557. package/lib/publicApi/domUtils/readFile.d.ts +0 -7
  558. package/lib/publicApi/domUtils/readFile.js +0 -23
  559. package/lib/publicApi/domUtils/readFile.js.map +0 -1
  560. package/lib/publicApi/domUtils/stringUtil.d.ts +0 -18
  561. package/lib/publicApi/domUtils/stringUtil.js +0 -35
  562. package/lib/publicApi/domUtils/stringUtil.js.map +0 -1
  563. package/lib/publicApi/domUtils/tableCellUtils.d.ts +0 -13
  564. package/lib/publicApi/domUtils/tableCellUtils.js +0 -57
  565. package/lib/publicApi/domUtils/tableCellUtils.js.map +0 -1
  566. package/lib/publicApi/format/retrieveModelFormatState.d.ts +0 -8
  567. package/lib/publicApi/format/retrieveModelFormatState.js +0 -178
  568. package/lib/publicApi/format/retrieveModelFormatState.js.map +0 -1
  569. package/lib/publicApi/model/cloneModel.d.ts +0 -7
  570. package/lib/publicApi/model/cloneModel.js +0 -207
  571. package/lib/publicApi/model/cloneModel.js.map +0 -1
  572. package/lib/publicApi/model/createModelFromHtml.d.ts +0 -9
  573. package/lib/publicApi/model/createModelFromHtml.js +0 -31
  574. package/lib/publicApi/model/createModelFromHtml.js.map +0 -1
  575. package/lib/publicApi/model/exportContent.js.map +0 -1
  576. package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
  577. package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -28
  578. package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
  579. package/lib/publicApi/model/isBlockGroupOfType.d.ts +0 -8
  580. package/lib/publicApi/model/isBlockGroupOfType.js +0 -14
  581. package/lib/publicApi/model/isBlockGroupOfType.js.map +0 -1
  582. package/lib/publicApi/model/isBold.d.ts +0 -5
  583. package/lib/publicApi/model/isBold.js +0 -12
  584. package/lib/publicApi/model/isBold.js.map +0 -1
  585. package/lib/publicApi/model/mergeModel.d.ts +0 -36
  586. package/lib/publicApi/model/mergeModel.js +0 -271
  587. package/lib/publicApi/model/mergeModel.js.map +0 -1
  588. package/lib/publicApi/paste/paste.js +0 -42
  589. package/lib/publicApi/paste/paste.js.map +0 -1
  590. package/lib/publicApi/selection/collectSelections.d.ts +0 -54
  591. package/lib/publicApi/selection/collectSelections.js +0 -184
  592. package/lib/publicApi/selection/collectSelections.js.map +0 -1
  593. package/lib/publicApi/selection/deleteBlock.d.ts +0 -11
  594. package/lib/publicApi/selection/deleteBlock.js +0 -56
  595. package/lib/publicApi/selection/deleteBlock.js.map +0 -1
  596. package/lib/publicApi/selection/deleteSegment.d.ts +0 -10
  597. package/lib/publicApi/selection/deleteSegment.js +0 -86
  598. package/lib/publicApi/selection/deleteSegment.js.map +0 -1
  599. package/lib/publicApi/selection/deleteSelection.d.ts +0 -9
  600. package/lib/publicApi/selection/deleteSelection.js +0 -42
  601. package/lib/publicApi/selection/deleteSelection.js.map +0 -1
  602. package/lib/publicApi/selection/getSelectionRootNode.d.ts +0 -9
  603. package/lib/publicApi/selection/getSelectionRootNode.js +0 -23
  604. package/lib/publicApi/selection/getSelectionRootNode.js.map +0 -1
  605. package/lib/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
  606. package/lib/publicApi/selection/hasSelectionInBlock.js +0 -26
  607. package/lib/publicApi/selection/hasSelectionInBlock.js.map +0 -1
  608. package/lib/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
  609. package/lib/publicApi/selection/hasSelectionInBlockGroup.js +0 -19
  610. package/lib/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
  611. package/lib/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
  612. package/lib/publicApi/selection/hasSelectionInSegment.js +0 -14
  613. package/lib/publicApi/selection/hasSelectionInSegment.js.map +0 -1
  614. package/lib/publicApi/selection/iterateSelections.d.ts +0 -48
  615. package/lib/publicApi/selection/iterateSelections.js +0 -145
  616. package/lib/publicApi/selection/iterateSelections.js.map +0 -1
  617. package/lib/publicApi/selection/setSelection.d.ts +0 -8
  618. package/lib/publicApi/selection/setSelection.js +0 -131
  619. package/lib/publicApi/selection/setSelection.js.map +0 -1
  620. package/lib/publicApi/table/applyTableFormat.d.ts +0 -8
  621. package/lib/publicApi/table/applyTableFormat.js +0 -243
  622. package/lib/publicApi/table/applyTableFormat.js.map +0 -1
  623. package/lib/publicApi/table/getSelectedCells.d.ts +0 -6
  624. package/lib/publicApi/table/getSelectedCells.js +0 -33
  625. package/lib/publicApi/table/getSelectedCells.js.map +0 -1
  626. package/lib/publicApi/table/normalizeTable.d.ts +0 -17
  627. package/lib/publicApi/table/normalizeTable.js +0 -128
  628. package/lib/publicApi/table/normalizeTable.js.map +0 -1
  629. package/lib/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
  630. package/lib/publicApi/table/setTableCellBackgroundColor.js +0 -121
  631. package/lib/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
  632. package/lib/publicApi/undo/redo.js.map +0 -1
  633. package/lib/publicApi/undo/undo.js.map +0 -1
  634. package/lib/utils/convertInlineCss.js +0 -64
  635. package/lib/utils/convertInlineCss.js.map +0 -1
  636. package/lib/utils/createDomToModelContextForSanitizing.d.ts +0 -5
  637. package/lib/utils/createDomToModelContextForSanitizing.js +0 -43
  638. package/lib/utils/createDomToModelContextForSanitizing.js.map +0 -1
  639. package/lib/utils/createSnapshotSelection.d.ts +0 -5
  640. package/lib/utils/createSnapshotSelection.js +0 -168
  641. package/lib/utils/createSnapshotSelection.js.map +0 -1
  642. package/lib/utils/extractClipboardItems.d.ts +0 -8
  643. package/lib/utils/extractClipboardItems.js +0 -83
  644. package/lib/utils/extractClipboardItems.js.map +0 -1
  645. package/lib/utils/getRootComputedStyleForContext.js.map +0 -1
  646. package/lib/utils/paste/createPasteFragment.js.map +0 -1
  647. package/lib/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
  648. package/lib/utils/paste/mergePasteContent.d.ts +0 -5
  649. package/lib/utils/paste/mergePasteContent.js +0 -74
  650. package/lib/utils/paste/mergePasteContent.js.map +0 -1
  651. package/lib/utils/paste/retrieveHtmlInfo.d.ts +0 -15
  652. package/lib/utils/paste/retrieveHtmlInfo.js +0 -69
  653. package/lib/utils/paste/retrieveHtmlInfo.js.map +0 -1
  654. package/lib/utils/restoreSnapshotColors.js +0 -16
  655. package/lib/utils/restoreSnapshotColors.js.map +0 -1
  656. package/lib/utils/restoreSnapshotHTML.js.map +0 -1
  657. package/lib/utils/restoreSnapshotSelection.js +0 -73
  658. package/lib/utils/restoreSnapshotSelection.js.map +0 -1
  659. package/lib/utils/sanitizeElement.js.map +0 -1
  660. package/lib-amd/constants/BulletListType.d.ts +0 -49
  661. package/lib-amd/constants/BulletListType.js +0 -55
  662. package/lib-amd/constants/BulletListType.js.map +0 -1
  663. package/lib-amd/constants/ChangeSource.d.ts +0 -59
  664. package/lib-amd/constants/ChangeSource.js +0 -65
  665. package/lib-amd/constants/ChangeSource.js.map +0 -1
  666. package/lib-amd/constants/NumberingListType.d.ts +0 -93
  667. package/lib-amd/constants/NumberingListType.js +0 -99
  668. package/lib-amd/constants/NumberingListType.js.map +0 -1
  669. package/lib-amd/constants/TableBorderFormat.d.ts +0 -81
  670. package/lib-amd/constants/TableBorderFormat.js +0 -87
  671. package/lib-amd/constants/TableBorderFormat.js.map +0 -1
  672. package/lib-amd/coreApi/addUndoSnapshot.js +0 -34
  673. package/lib-amd/coreApi/addUndoSnapshot.js.map +0 -1
  674. package/lib-amd/coreApi/attachDomEvent.js.map +0 -1
  675. package/lib-amd/coreApi/createContentModel.js +0 -44
  676. package/lib-amd/coreApi/createContentModel.js.map +0 -1
  677. package/lib-amd/coreApi/createEditorContext.js +0 -25
  678. package/lib-amd/coreApi/createEditorContext.js.map +0 -1
  679. package/lib-amd/coreApi/focus.js.map +0 -1
  680. package/lib-amd/coreApi/formatContentModel.js +0 -118
  681. package/lib-amd/coreApi/formatContentModel.js.map +0 -1
  682. package/lib-amd/coreApi/getDOMSelection.js +0 -42
  683. package/lib-amd/coreApi/getDOMSelection.js.map +0 -1
  684. package/lib-amd/coreApi/getVisibleViewport.js.map +0 -1
  685. package/lib-amd/coreApi/restoreUndoSnapshot.js +0 -34
  686. package/lib-amd/coreApi/restoreUndoSnapshot.js.map +0 -1
  687. package/lib-amd/coreApi/setContentModel.js +0 -36
  688. package/lib-amd/coreApi/setContentModel.js.map +0 -1
  689. package/lib-amd/coreApi/setDOMSelection.js +0 -162
  690. package/lib-amd/coreApi/setDOMSelection.js.map +0 -1
  691. package/lib-amd/coreApi/switchShadowEdit.js +0 -46
  692. package/lib-amd/coreApi/switchShadowEdit.js.map +0 -1
  693. package/lib-amd/coreApi/triggerEvent.js.map +0 -1
  694. package/lib-amd/corePlugin/CachePlugin.js +0 -156
  695. package/lib-amd/corePlugin/CachePlugin.js.map +0 -1
  696. package/lib-amd/corePlugin/ContextMenuPlugin.js +0 -112
  697. package/lib-amd/corePlugin/ContextMenuPlugin.js.map +0 -1
  698. package/lib-amd/corePlugin/CopyPastePlugin.js +0 -265
  699. package/lib-amd/corePlugin/CopyPastePlugin.js.map +0 -1
  700. package/lib-amd/corePlugin/DOMEventPlugin.js +0 -200
  701. package/lib-amd/corePlugin/DOMEventPlugin.js.map +0 -1
  702. package/lib-amd/corePlugin/EntityPlugin.js +0 -215
  703. package/lib-amd/corePlugin/EntityPlugin.js.map +0 -1
  704. package/lib-amd/corePlugin/FormatPlugin.js +0 -186
  705. package/lib-amd/corePlugin/FormatPlugin.js.map +0 -1
  706. package/lib-amd/corePlugin/LifecyclePlugin.js +0 -114
  707. package/lib-amd/corePlugin/LifecyclePlugin.js.map +0 -1
  708. package/lib-amd/corePlugin/SelectionPlugin.js +0 -189
  709. package/lib-amd/corePlugin/SelectionPlugin.js.map +0 -1
  710. package/lib-amd/corePlugin/UndoPlugin.js +0 -219
  711. package/lib-amd/corePlugin/UndoPlugin.js.map +0 -1
  712. package/lib-amd/corePlugin/utils/addRangeToSelection.js.map +0 -1
  713. package/lib-amd/corePlugin/utils/applyDefaultFormat.js +0 -53
  714. package/lib-amd/corePlugin/utils/applyDefaultFormat.js.map +0 -1
  715. package/lib-amd/corePlugin/utils/applyPendingFormat.js +0 -50
  716. package/lib-amd/corePlugin/utils/applyPendingFormat.js.map +0 -1
  717. package/lib-amd/corePlugin/utils/areSameSelection.d.ts +0 -6
  718. package/lib-amd/corePlugin/utils/areSameSelection.js +0 -38
  719. package/lib-amd/corePlugin/utils/areSameSelection.js.map +0 -1
  720. package/lib-amd/corePlugin/utils/deleteEmptyList.js +0 -43
  721. package/lib-amd/corePlugin/utils/deleteEmptyList.js.map +0 -1
  722. package/lib-amd/corePlugin/utils/domIndexerImpl.js +0 -189
  723. package/lib-amd/corePlugin/utils/domIndexerImpl.js.map +0 -1
  724. package/lib-amd/corePlugin/utils/entityDelimiterUtils.js +0 -257
  725. package/lib-amd/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
  726. package/lib-amd/corePlugin/utils/findAllEntities.js.map +0 -1
  727. package/lib-amd/corePlugin/utils/textMutationObserver.js.map +0 -1
  728. package/lib-amd/editor/DOMHelperImpl.js.map +0 -1
  729. package/lib-amd/editor/DarkColorHandlerImpl.js.map +0 -1
  730. package/lib-amd/editor/SnapshotsManagerImpl.js.map +0 -1
  731. package/lib-amd/editor/coreApiMap.js +0 -25
  732. package/lib-amd/editor/coreApiMap.js.map +0 -1
  733. package/lib-amd/editor/createEditorCore.js +0 -82
  734. package/lib-amd/editor/createEditorCore.js.map +0 -1
  735. package/lib-amd/editor/createEditorDefaultSettings.js +0 -47
  736. package/lib-amd/editor/createEditorDefaultSettings.js.map +0 -1
  737. package/lib-amd/metadata/definitionCreators.d.ts +0 -48
  738. package/lib-amd/metadata/definitionCreators.js +0 -97
  739. package/lib-amd/metadata/definitionCreators.js.map +0 -1
  740. package/lib-amd/metadata/updateImageMetadata.d.ts +0 -7
  741. package/lib-amd/metadata/updateImageMetadata.js +0 -28
  742. package/lib-amd/metadata/updateImageMetadata.js.map +0 -1
  743. package/lib-amd/metadata/updateListMetadata.d.ts +0 -22
  744. package/lib-amd/metadata/updateListMetadata.js +0 -204
  745. package/lib-amd/metadata/updateListMetadata.js.map +0 -1
  746. package/lib-amd/metadata/updateTableCellMetadata.d.ts +0 -7
  747. package/lib-amd/metadata/updateTableCellMetadata.js +0 -20
  748. package/lib-amd/metadata/updateTableCellMetadata.js.map +0 -1
  749. package/lib-amd/metadata/updateTableMetadata.d.ts +0 -7
  750. package/lib-amd/metadata/updateTableMetadata.js +0 -31
  751. package/lib-amd/metadata/updateTableMetadata.js.map +0 -1
  752. package/lib-amd/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
  753. package/lib-amd/modelApi/edit/deleteExpandedSelection.js +0 -96
  754. package/lib-amd/modelApi/edit/deleteExpandedSelection.js.map +0 -1
  755. package/lib-amd/modelApi/edit/deleteSingleChar.d.ts +0 -4
  756. package/lib-amd/modelApi/edit/deleteSingleChar.js +0 -37
  757. package/lib-amd/modelApi/edit/deleteSingleChar.js.map +0 -1
  758. package/lib-amd/override/reducedModelChildProcessor.d.ts +0 -21
  759. package/lib-amd/override/reducedModelChildProcessor.js +0 -65
  760. package/lib-amd/override/reducedModelChildProcessor.js.map +0 -1
  761. package/lib-amd/publicApi/color/transformColor.d.ts +0 -9
  762. package/lib-amd/publicApi/color/transformColor.js +0 -42
  763. package/lib-amd/publicApi/color/transformColor.js.map +0 -1
  764. package/lib-amd/publicApi/domUtils/borderValues.d.ts +0 -13
  765. package/lib-amd/publicApi/domUtils/borderValues.js +0 -50
  766. package/lib-amd/publicApi/domUtils/borderValues.js.map +0 -1
  767. package/lib-amd/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
  768. package/lib-amd/publicApi/domUtils/cacheGetEventData.js +0 -22
  769. package/lib-amd/publicApi/domUtils/cacheGetEventData.js.map +0 -1
  770. package/lib-amd/publicApi/domUtils/eventUtils.d.ts +0 -20
  771. package/lib-amd/publicApi/domUtils/eventUtils.js +0 -51
  772. package/lib-amd/publicApi/domUtils/eventUtils.js.map +0 -1
  773. package/lib-amd/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
  774. package/lib-amd/publicApi/domUtils/getSegmentTextFormat.js +0 -35
  775. package/lib-amd/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
  776. package/lib-amd/publicApi/domUtils/readFile.d.ts +0 -7
  777. package/lib-amd/publicApi/domUtils/readFile.js +0 -25
  778. package/lib-amd/publicApi/domUtils/readFile.js.map +0 -1
  779. package/lib-amd/publicApi/domUtils/stringUtil.d.ts +0 -18
  780. package/lib-amd/publicApi/domUtils/stringUtil.js +0 -37
  781. package/lib-amd/publicApi/domUtils/stringUtil.js.map +0 -1
  782. package/lib-amd/publicApi/domUtils/tableCellUtils.d.ts +0 -13
  783. package/lib-amd/publicApi/domUtils/tableCellUtils.js +0 -58
  784. package/lib-amd/publicApi/domUtils/tableCellUtils.js.map +0 -1
  785. package/lib-amd/publicApi/format/retrieveModelFormatState.d.ts +0 -8
  786. package/lib-amd/publicApi/format/retrieveModelFormatState.js +0 -174
  787. package/lib-amd/publicApi/format/retrieveModelFormatState.js.map +0 -1
  788. package/lib-amd/publicApi/model/cloneModel.d.ts +0 -7
  789. package/lib-amd/publicApi/model/cloneModel.js +0 -208
  790. package/lib-amd/publicApi/model/cloneModel.js.map +0 -1
  791. package/lib-amd/publicApi/model/createModelFromHtml.d.ts +0 -9
  792. package/lib-amd/publicApi/model/createModelFromHtml.js +0 -30
  793. package/lib-amd/publicApi/model/createModelFromHtml.js.map +0 -1
  794. package/lib-amd/publicApi/model/exportContent.js.map +0 -1
  795. package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
  796. package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -30
  797. package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
  798. package/lib-amd/publicApi/model/isBlockGroupOfType.d.ts +0 -8
  799. package/lib-amd/publicApi/model/isBlockGroupOfType.js +0 -16
  800. package/lib-amd/publicApi/model/isBlockGroupOfType.js.map +0 -1
  801. package/lib-amd/publicApi/model/isBold.d.ts +0 -5
  802. package/lib-amd/publicApi/model/isBold.js +0 -14
  803. package/lib-amd/publicApi/model/isBold.js.map +0 -1
  804. package/lib-amd/publicApi/model/mergeModel.d.ts +0 -36
  805. package/lib-amd/publicApi/model/mergeModel.js +0 -267
  806. package/lib-amd/publicApi/model/mergeModel.js.map +0 -1
  807. package/lib-amd/publicApi/paste/paste.js +0 -39
  808. package/lib-amd/publicApi/paste/paste.js.map +0 -1
  809. package/lib-amd/publicApi/selection/collectSelections.d.ts +0 -54
  810. package/lib-amd/publicApi/selection/collectSelections.js +0 -182
  811. package/lib-amd/publicApi/selection/collectSelections.js.map +0 -1
  812. package/lib-amd/publicApi/selection/deleteBlock.d.ts +0 -11
  813. package/lib-amd/publicApi/selection/deleteBlock.js +0 -58
  814. package/lib-amd/publicApi/selection/deleteBlock.js.map +0 -1
  815. package/lib-amd/publicApi/selection/deleteSegment.d.ts +0 -10
  816. package/lib-amd/publicApi/selection/deleteSegment.js +0 -85
  817. package/lib-amd/publicApi/selection/deleteSegment.js.map +0 -1
  818. package/lib-amd/publicApi/selection/deleteSelection.d.ts +0 -9
  819. package/lib-amd/publicApi/selection/deleteSelection.js +0 -42
  820. package/lib-amd/publicApi/selection/deleteSelection.js.map +0 -1
  821. package/lib-amd/publicApi/selection/getSelectionRootNode.d.ts +0 -9
  822. package/lib-amd/publicApi/selection/getSelectionRootNode.js +0 -25
  823. package/lib-amd/publicApi/selection/getSelectionRootNode.js.map +0 -1
  824. package/lib-amd/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
  825. package/lib-amd/publicApi/selection/hasSelectionInBlock.js +0 -26
  826. package/lib-amd/publicApi/selection/hasSelectionInBlock.js.map +0 -1
  827. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
  828. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js +0 -20
  829. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
  830. package/lib-amd/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
  831. package/lib-amd/publicApi/selection/hasSelectionInSegment.js +0 -15
  832. package/lib-amd/publicApi/selection/hasSelectionInSegment.js.map +0 -1
  833. package/lib-amd/publicApi/selection/iterateSelections.d.ts +0 -48
  834. package/lib-amd/publicApi/selection/iterateSelections.js +0 -146
  835. package/lib-amd/publicApi/selection/iterateSelections.js.map +0 -1
  836. package/lib-amd/publicApi/selection/setSelection.d.ts +0 -8
  837. package/lib-amd/publicApi/selection/setSelection.js +0 -132
  838. package/lib-amd/publicApi/selection/setSelection.js.map +0 -1
  839. package/lib-amd/publicApi/table/applyTableFormat.d.ts +0 -8
  840. package/lib-amd/publicApi/table/applyTableFormat.js +0 -238
  841. package/lib-amd/publicApi/table/applyTableFormat.js.map +0 -1
  842. package/lib-amd/publicApi/table/getSelectedCells.d.ts +0 -6
  843. package/lib-amd/publicApi/table/getSelectedCells.js +0 -34
  844. package/lib-amd/publicApi/table/getSelectedCells.js.map +0 -1
  845. package/lib-amd/publicApi/table/normalizeTable.d.ts +0 -17
  846. package/lib-amd/publicApi/table/normalizeTable.js +0 -128
  847. package/lib-amd/publicApi/table/normalizeTable.js.map +0 -1
  848. package/lib-amd/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
  849. package/lib-amd/publicApi/table/setTableCellBackgroundColor.js +0 -120
  850. package/lib-amd/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
  851. package/lib-amd/publicApi/undo/redo.js.map +0 -1
  852. package/lib-amd/publicApi/undo/undo.js.map +0 -1
  853. package/lib-amd/utils/convertInlineCss.js +0 -64
  854. package/lib-amd/utils/convertInlineCss.js.map +0 -1
  855. package/lib-amd/utils/createDomToModelContextForSanitizing.d.ts +0 -5
  856. package/lib-amd/utils/createDomToModelContextForSanitizing.js +0 -36
  857. package/lib-amd/utils/createDomToModelContextForSanitizing.js.map +0 -1
  858. package/lib-amd/utils/createSnapshotSelection.d.ts +0 -5
  859. package/lib-amd/utils/createSnapshotSelection.js +0 -169
  860. package/lib-amd/utils/createSnapshotSelection.js.map +0 -1
  861. package/lib-amd/utils/extractClipboardItems.d.ts +0 -8
  862. package/lib-amd/utils/extractClipboardItems.js +0 -84
  863. package/lib-amd/utils/extractClipboardItems.js.map +0 -1
  864. package/lib-amd/utils/getRootComputedStyleForContext.js.map +0 -1
  865. package/lib-amd/utils/paste/createPasteFragment.js.map +0 -1
  866. package/lib-amd/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
  867. package/lib-amd/utils/paste/mergePasteContent.d.ts +0 -5
  868. package/lib-amd/utils/paste/mergePasteContent.js +0 -68
  869. package/lib-amd/utils/paste/mergePasteContent.js.map +0 -1
  870. package/lib-amd/utils/paste/retrieveHtmlInfo.d.ts +0 -15
  871. package/lib-amd/utils/paste/retrieveHtmlInfo.js +0 -68
  872. package/lib-amd/utils/paste/retrieveHtmlInfo.js.map +0 -1
  873. package/lib-amd/utils/restoreSnapshotColors.js +0 -17
  874. package/lib-amd/utils/restoreSnapshotColors.js.map +0 -1
  875. package/lib-amd/utils/restoreSnapshotHTML.js.map +0 -1
  876. package/lib-amd/utils/restoreSnapshotSelection.js +0 -74
  877. package/lib-amd/utils/restoreSnapshotSelection.js.map +0 -1
  878. package/lib-amd/utils/sanitizeElement.js.map +0 -1
  879. package/lib-mjs/constants/BulletListType.d.ts +0 -49
  880. package/lib-mjs/constants/BulletListType.js +0 -50
  881. package/lib-mjs/constants/BulletListType.js.map +0 -1
  882. package/lib-mjs/constants/ChangeSource.d.ts +0 -59
  883. package/lib-mjs/constants/ChangeSource.js +0 -60
  884. package/lib-mjs/constants/ChangeSource.js.map +0 -1
  885. package/lib-mjs/constants/NumberingListType.d.ts +0 -93
  886. package/lib-mjs/constants/NumberingListType.js +0 -94
  887. package/lib-mjs/constants/NumberingListType.js.map +0 -1
  888. package/lib-mjs/constants/TableBorderFormat.d.ts +0 -81
  889. package/lib-mjs/constants/TableBorderFormat.js +0 -82
  890. package/lib-mjs/constants/TableBorderFormat.js.map +0 -1
  891. package/lib-mjs/coreApi/addUndoSnapshot.js +0 -29
  892. package/lib-mjs/coreApi/addUndoSnapshot.js.map +0 -1
  893. package/lib-mjs/coreApi/attachDomEvent.js.map +0 -1
  894. package/lib-mjs/coreApi/createContentModel.js +0 -40
  895. package/lib-mjs/coreApi/createContentModel.js.map +0 -1
  896. package/lib-mjs/coreApi/createEditorContext.js +0 -21
  897. package/lib-mjs/coreApi/createEditorContext.js.map +0 -1
  898. package/lib-mjs/coreApi/focus.js.map +0 -1
  899. package/lib-mjs/coreApi/formatContentModel.js +0 -114
  900. package/lib-mjs/coreApi/formatContentModel.js.map +0 -1
  901. package/lib-mjs/coreApi/getDOMSelection.js +0 -36
  902. package/lib-mjs/coreApi/getDOMSelection.js.map +0 -1
  903. package/lib-mjs/coreApi/getVisibleViewport.js.map +0 -1
  904. package/lib-mjs/coreApi/restoreUndoSnapshot.js +0 -32
  905. package/lib-mjs/coreApi/restoreUndoSnapshot.js.map +0 -1
  906. package/lib-mjs/coreApi/setContentModel.js +0 -31
  907. package/lib-mjs/coreApi/setContentModel.js.map +0 -1
  908. package/lib-mjs/coreApi/setDOMSelection.js +0 -159
  909. package/lib-mjs/coreApi/setDOMSelection.js.map +0 -1
  910. package/lib-mjs/coreApi/switchShadowEdit.js +0 -42
  911. package/lib-mjs/coreApi/switchShadowEdit.js.map +0 -1
  912. package/lib-mjs/coreApi/triggerEvent.js.map +0 -1
  913. package/lib-mjs/corePlugin/CachePlugin.js +0 -153
  914. package/lib-mjs/corePlugin/CachePlugin.js.map +0 -1
  915. package/lib-mjs/corePlugin/ContextMenuPlugin.js +0 -108
  916. package/lib-mjs/corePlugin/ContextMenuPlugin.js.map +0 -1
  917. package/lib-mjs/corePlugin/CopyPastePlugin.js +0 -267
  918. package/lib-mjs/corePlugin/CopyPastePlugin.js.map +0 -1
  919. package/lib-mjs/corePlugin/DOMEventPlugin.js +0 -197
  920. package/lib-mjs/corePlugin/DOMEventPlugin.js.map +0 -1
  921. package/lib-mjs/corePlugin/EntityPlugin.js +0 -213
  922. package/lib-mjs/corePlugin/EntityPlugin.js.map +0 -1
  923. package/lib-mjs/corePlugin/FormatPlugin.js +0 -185
  924. package/lib-mjs/corePlugin/FormatPlugin.js.map +0 -1
  925. package/lib-mjs/corePlugin/LifecyclePlugin.js +0 -110
  926. package/lib-mjs/corePlugin/LifecyclePlugin.js.map +0 -1
  927. package/lib-mjs/corePlugin/SelectionPlugin.js +0 -185
  928. package/lib-mjs/corePlugin/SelectionPlugin.js.map +0 -1
  929. package/lib-mjs/corePlugin/UndoPlugin.js +0 -217
  930. package/lib-mjs/corePlugin/UndoPlugin.js.map +0 -1
  931. package/lib-mjs/corePlugin/utils/addRangeToSelection.js.map +0 -1
  932. package/lib-mjs/corePlugin/utils/applyDefaultFormat.js +0 -50
  933. package/lib-mjs/corePlugin/utils/applyDefaultFormat.js.map +0 -1
  934. package/lib-mjs/corePlugin/utils/applyPendingFormat.js +0 -47
  935. package/lib-mjs/corePlugin/utils/applyPendingFormat.js.map +0 -1
  936. package/lib-mjs/corePlugin/utils/areSameSelection.d.ts +0 -6
  937. package/lib-mjs/corePlugin/utils/areSameSelection.js +0 -32
  938. package/lib-mjs/corePlugin/utils/areSameSelection.js.map +0 -1
  939. package/lib-mjs/corePlugin/utils/deleteEmptyList.js +0 -40
  940. package/lib-mjs/corePlugin/utils/deleteEmptyList.js.map +0 -1
  941. package/lib-mjs/corePlugin/utils/domIndexerImpl.js +0 -187
  942. package/lib-mjs/corePlugin/utils/domIndexerImpl.js.map +0 -1
  943. package/lib-mjs/corePlugin/utils/entityDelimiterUtils.js +0 -250
  944. package/lib-mjs/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
  945. package/lib-mjs/corePlugin/utils/findAllEntities.js.map +0 -1
  946. package/lib-mjs/corePlugin/utils/textMutationObserver.js.map +0 -1
  947. package/lib-mjs/editor/DOMHelperImpl.js.map +0 -1
  948. package/lib-mjs/editor/DarkColorHandlerImpl.js.map +0 -1
  949. package/lib-mjs/editor/SnapshotsManagerImpl.js.map +0 -1
  950. package/lib-mjs/editor/coreApiMap.js +0 -33
  951. package/lib-mjs/editor/coreApiMap.js.map +0 -1
  952. package/lib-mjs/editor/createEditorCore.js +0 -80
  953. package/lib-mjs/editor/createEditorCore.js.map +0 -1
  954. package/lib-mjs/editor/createEditorDefaultSettings.js +0 -43
  955. package/lib-mjs/editor/createEditorDefaultSettings.js.map +0 -1
  956. package/lib-mjs/metadata/definitionCreators.d.ts +0 -48
  957. package/lib-mjs/metadata/definitionCreators.js +0 -87
  958. package/lib-mjs/metadata/definitionCreators.js.map +0 -1
  959. package/lib-mjs/metadata/updateImageMetadata.d.ts +0 -7
  960. package/lib-mjs/metadata/updateImageMetadata.js +0 -24
  961. package/lib-mjs/metadata/updateImageMetadata.js.map +0 -1
  962. package/lib-mjs/metadata/updateListMetadata.d.ts +0 -22
  963. package/lib-mjs/metadata/updateListMetadata.js +0 -202
  964. package/lib-mjs/metadata/updateListMetadata.js.map +0 -1
  965. package/lib-mjs/metadata/updateTableCellMetadata.d.ts +0 -7
  966. package/lib-mjs/metadata/updateTableCellMetadata.js +0 -16
  967. package/lib-mjs/metadata/updateTableCellMetadata.js.map +0 -1
  968. package/lib-mjs/metadata/updateTableMetadata.d.ts +0 -7
  969. package/lib-mjs/metadata/updateTableMetadata.js +0 -28
  970. package/lib-mjs/metadata/updateTableMetadata.js.map +0 -1
  971. package/lib-mjs/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
  972. package/lib-mjs/modelApi/edit/deleteExpandedSelection.js +0 -96
  973. package/lib-mjs/modelApi/edit/deleteExpandedSelection.js.map +0 -1
  974. package/lib-mjs/modelApi/edit/deleteSingleChar.d.ts +0 -4
  975. package/lib-mjs/modelApi/edit/deleteSingleChar.js +0 -32
  976. package/lib-mjs/modelApi/edit/deleteSingleChar.js.map +0 -1
  977. package/lib-mjs/override/reducedModelChildProcessor.d.ts +0 -21
  978. package/lib-mjs/override/reducedModelChildProcessor.js +0 -62
  979. package/lib-mjs/override/reducedModelChildProcessor.js.map +0 -1
  980. package/lib-mjs/publicApi/color/transformColor.d.ts +0 -9
  981. package/lib-mjs/publicApi/color/transformColor.js +0 -37
  982. package/lib-mjs/publicApi/color/transformColor.js.map +0 -1
  983. package/lib-mjs/publicApi/domUtils/borderValues.d.ts +0 -13
  984. package/lib-mjs/publicApi/domUtils/borderValues.js +0 -43
  985. package/lib-mjs/publicApi/domUtils/borderValues.js.map +0 -1
  986. package/lib-mjs/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
  987. package/lib-mjs/publicApi/domUtils/cacheGetEventData.js +0 -16
  988. package/lib-mjs/publicApi/domUtils/cacheGetEventData.js.map +0 -1
  989. package/lib-mjs/publicApi/domUtils/eventUtils.d.ts +0 -20
  990. package/lib-mjs/publicApi/domUtils/eventUtils.js +0 -43
  991. package/lib-mjs/publicApi/domUtils/eventUtils.js.map +0 -1
  992. package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
  993. package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.js +0 -29
  994. package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
  995. package/lib-mjs/publicApi/domUtils/readFile.d.ts +0 -7
  996. package/lib-mjs/publicApi/domUtils/readFile.js +0 -19
  997. package/lib-mjs/publicApi/domUtils/readFile.js.map +0 -1
  998. package/lib-mjs/publicApi/domUtils/stringUtil.d.ts +0 -18
  999. package/lib-mjs/publicApi/domUtils/stringUtil.js +0 -29
  1000. package/lib-mjs/publicApi/domUtils/stringUtil.js.map +0 -1
  1001. package/lib-mjs/publicApi/domUtils/tableCellUtils.d.ts +0 -13
  1002. package/lib-mjs/publicApi/domUtils/tableCellUtils.js +0 -52
  1003. package/lib-mjs/publicApi/domUtils/tableCellUtils.js.map +0 -1
  1004. package/lib-mjs/publicApi/format/retrieveModelFormatState.d.ts +0 -8
  1005. package/lib-mjs/publicApi/format/retrieveModelFormatState.js +0 -174
  1006. package/lib-mjs/publicApi/format/retrieveModelFormatState.js.map +0 -1
  1007. package/lib-mjs/publicApi/model/cloneModel.d.ts +0 -7
  1008. package/lib-mjs/publicApi/model/cloneModel.js +0 -203
  1009. package/lib-mjs/publicApi/model/cloneModel.js.map +0 -1
  1010. package/lib-mjs/publicApi/model/createModelFromHtml.d.ts +0 -9
  1011. package/lib-mjs/publicApi/model/createModelFromHtml.js +0 -27
  1012. package/lib-mjs/publicApi/model/createModelFromHtml.js.map +0 -1
  1013. package/lib-mjs/publicApi/model/exportContent.js.map +0 -1
  1014. package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
  1015. package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -24
  1016. package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
  1017. package/lib-mjs/publicApi/model/isBlockGroupOfType.d.ts +0 -8
  1018. package/lib-mjs/publicApi/model/isBlockGroupOfType.js +0 -10
  1019. package/lib-mjs/publicApi/model/isBlockGroupOfType.js.map +0 -1
  1020. package/lib-mjs/publicApi/model/isBold.d.ts +0 -5
  1021. package/lib-mjs/publicApi/model/isBold.js +0 -8
  1022. package/lib-mjs/publicApi/model/isBold.js.map +0 -1
  1023. package/lib-mjs/publicApi/model/mergeModel.d.ts +0 -36
  1024. package/lib-mjs/publicApi/model/mergeModel.js +0 -267
  1025. package/lib-mjs/publicApi/model/mergeModel.js.map +0 -1
  1026. package/lib-mjs/publicApi/paste/paste.js +0 -38
  1027. package/lib-mjs/publicApi/paste/paste.js.map +0 -1
  1028. package/lib-mjs/publicApi/selection/collectSelections.d.ts +0 -54
  1029. package/lib-mjs/publicApi/selection/collectSelections.js +0 -175
  1030. package/lib-mjs/publicApi/selection/collectSelections.js.map +0 -1
  1031. package/lib-mjs/publicApi/selection/deleteBlock.d.ts +0 -11
  1032. package/lib-mjs/publicApi/selection/deleteBlock.js +0 -52
  1033. package/lib-mjs/publicApi/selection/deleteBlock.js.map +0 -1
  1034. package/lib-mjs/publicApi/selection/deleteSegment.d.ts +0 -10
  1035. package/lib-mjs/publicApi/selection/deleteSegment.js +0 -82
  1036. package/lib-mjs/publicApi/selection/deleteSegment.js.map +0 -1
  1037. package/lib-mjs/publicApi/selection/deleteSelection.d.ts +0 -9
  1038. package/lib-mjs/publicApi/selection/deleteSelection.js +0 -38
  1039. package/lib-mjs/publicApi/selection/deleteSelection.js.map +0 -1
  1040. package/lib-mjs/publicApi/selection/getSelectionRootNode.d.ts +0 -9
  1041. package/lib-mjs/publicApi/selection/getSelectionRootNode.js +0 -19
  1042. package/lib-mjs/publicApi/selection/getSelectionRootNode.js.map +0 -1
  1043. package/lib-mjs/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
  1044. package/lib-mjs/publicApi/selection/hasSelectionInBlock.js +0 -22
  1045. package/lib-mjs/publicApi/selection/hasSelectionInBlock.js.map +0 -1
  1046. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
  1047. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js +0 -15
  1048. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
  1049. package/lib-mjs/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
  1050. package/lib-mjs/publicApi/selection/hasSelectionInSegment.js +0 -10
  1051. package/lib-mjs/publicApi/selection/hasSelectionInSegment.js.map +0 -1
  1052. package/lib-mjs/publicApi/selection/iterateSelections.d.ts +0 -48
  1053. package/lib-mjs/publicApi/selection/iterateSelections.js +0 -141
  1054. package/lib-mjs/publicApi/selection/iterateSelections.js.map +0 -1
  1055. package/lib-mjs/publicApi/selection/setSelection.d.ts +0 -8
  1056. package/lib-mjs/publicApi/selection/setSelection.js +0 -127
  1057. package/lib-mjs/publicApi/selection/setSelection.js.map +0 -1
  1058. package/lib-mjs/publicApi/table/applyTableFormat.d.ts +0 -8
  1059. package/lib-mjs/publicApi/table/applyTableFormat.js +0 -239
  1060. package/lib-mjs/publicApi/table/applyTableFormat.js.map +0 -1
  1061. package/lib-mjs/publicApi/table/getSelectedCells.d.ts +0 -6
  1062. package/lib-mjs/publicApi/table/getSelectedCells.js +0 -29
  1063. package/lib-mjs/publicApi/table/getSelectedCells.js.map +0 -1
  1064. package/lib-mjs/publicApi/table/normalizeTable.d.ts +0 -17
  1065. package/lib-mjs/publicApi/table/normalizeTable.js +0 -124
  1066. package/lib-mjs/publicApi/table/normalizeTable.js.map +0 -1
  1067. package/lib-mjs/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
  1068. package/lib-mjs/publicApi/table/setTableCellBackgroundColor.js +0 -117
  1069. package/lib-mjs/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
  1070. package/lib-mjs/publicApi/undo/redo.js.map +0 -1
  1071. package/lib-mjs/publicApi/undo/undo.js.map +0 -1
  1072. package/lib-mjs/utils/convertInlineCss.js +0 -59
  1073. package/lib-mjs/utils/convertInlineCss.js.map +0 -1
  1074. package/lib-mjs/utils/createDomToModelContextForSanitizing.d.ts +0 -5
  1075. package/lib-mjs/utils/createDomToModelContextForSanitizing.js +0 -39
  1076. package/lib-mjs/utils/createDomToModelContextForSanitizing.js.map +0 -1
  1077. package/lib-mjs/utils/createSnapshotSelection.d.ts +0 -5
  1078. package/lib-mjs/utils/createSnapshotSelection.js +0 -164
  1079. package/lib-mjs/utils/createSnapshotSelection.js.map +0 -1
  1080. package/lib-mjs/utils/extractClipboardItems.d.ts +0 -8
  1081. package/lib-mjs/utils/extractClipboardItems.js +0 -79
  1082. package/lib-mjs/utils/extractClipboardItems.js.map +0 -1
  1083. package/lib-mjs/utils/getRootComputedStyleForContext.js.map +0 -1
  1084. package/lib-mjs/utils/paste/createPasteFragment.js.map +0 -1
  1085. package/lib-mjs/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
  1086. package/lib-mjs/utils/paste/mergePasteContent.d.ts +0 -5
  1087. package/lib-mjs/utils/paste/mergePasteContent.js +0 -70
  1088. package/lib-mjs/utils/paste/mergePasteContent.js.map +0 -1
  1089. package/lib-mjs/utils/paste/retrieveHtmlInfo.d.ts +0 -15
  1090. package/lib-mjs/utils/paste/retrieveHtmlInfo.js +0 -65
  1091. package/lib-mjs/utils/paste/retrieveHtmlInfo.js.map +0 -1
  1092. package/lib-mjs/utils/restoreSnapshotColors.js +0 -12
  1093. package/lib-mjs/utils/restoreSnapshotColors.js.map +0 -1
  1094. package/lib-mjs/utils/restoreSnapshotHTML.js.map +0 -1
  1095. package/lib-mjs/utils/restoreSnapshotSelection.js +0 -69
  1096. package/lib-mjs/utils/restoreSnapshotSelection.js.map +0 -1
  1097. package/lib-mjs/utils/sanitizeElement.js.map +0 -1
  1098. /package/lib/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
  1099. /package/lib/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
  1100. /package/lib/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
  1101. /package/lib/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
  1102. /package/lib/{publicApi/model → command/exportContent}/exportContent.js +0 -0
  1103. /package/lib/{utils → command}/paste/createPasteFragment.d.ts +0 -0
  1104. /package/lib/{utils → command}/paste/createPasteFragment.js +0 -0
  1105. /package/lib/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
  1106. /package/lib/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
  1107. /package/lib/{publicApi → command}/paste/paste.d.ts +0 -0
  1108. /package/lib/{publicApi/undo → command/redo}/redo.d.ts +0 -0
  1109. /package/lib/{publicApi/undo → command/redo}/redo.js +0 -0
  1110. /package/lib/{publicApi → command}/undo/undo.d.ts +0 -0
  1111. /package/lib/{publicApi → command}/undo/undo.js +0 -0
  1112. /package/lib/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
  1113. /package/lib/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
  1114. /package/lib/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
  1115. /package/lib/{editor → coreApi}/coreApiMap.d.ts +0 -0
  1116. /package/lib/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
  1117. /package/lib/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
  1118. /package/lib/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
  1119. /package/lib/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
  1120. /package/lib/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
  1121. /package/lib/coreApi/{focus.js → focus/focus.js} +0 -0
  1122. /package/lib/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
  1123. /package/lib/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
  1124. /package/lib/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
  1125. /package/lib/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
  1126. /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
  1127. /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
  1128. /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
  1129. /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
  1130. /package/lib/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
  1131. /package/lib/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
  1132. /package/lib/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
  1133. /package/lib/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
  1134. /package/lib/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
  1135. /package/lib/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
  1136. /package/lib/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
  1137. /package/lib/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
  1138. /package/lib/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
  1139. /package/lib/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
  1140. /package/lib/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
  1141. /package/lib/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
  1142. /package/lib/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
  1143. /package/lib/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
  1144. /package/lib/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
  1145. /package/lib/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
  1146. /package/lib/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
  1147. /package/lib/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
  1148. /package/lib/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
  1149. /package/lib/corePlugin/{utils → entity}/findAllEntities.js +0 -0
  1150. /package/lib/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
  1151. /package/lib/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
  1152. /package/lib/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
  1153. /package/lib/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
  1154. /package/lib/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
  1155. /package/lib/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
  1156. /package/lib/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
  1157. /package/lib/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
  1158. /package/lib/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
  1159. /package/lib/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
  1160. /package/lib/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
  1161. /package/lib/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
  1162. /package/lib/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
  1163. /package/lib/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
  1164. /package/lib-amd/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
  1165. /package/lib-amd/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
  1166. /package/lib-amd/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
  1167. /package/lib-amd/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
  1168. /package/lib-amd/{publicApi/model → command/exportContent}/exportContent.js +0 -0
  1169. /package/lib-amd/{utils → command}/paste/createPasteFragment.d.ts +0 -0
  1170. /package/lib-amd/{utils → command}/paste/createPasteFragment.js +0 -0
  1171. /package/lib-amd/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
  1172. /package/lib-amd/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
  1173. /package/lib-amd/{publicApi → command}/paste/paste.d.ts +0 -0
  1174. /package/lib-amd/{publicApi/undo → command/redo}/redo.d.ts +0 -0
  1175. /package/lib-amd/{publicApi/undo → command/redo}/redo.js +0 -0
  1176. /package/lib-amd/{publicApi → command}/undo/undo.d.ts +0 -0
  1177. /package/lib-amd/{publicApi → command}/undo/undo.js +0 -0
  1178. /package/lib-amd/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
  1179. /package/lib-amd/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
  1180. /package/lib-amd/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
  1181. /package/lib-amd/{editor → coreApi}/coreApiMap.d.ts +0 -0
  1182. /package/lib-amd/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
  1183. /package/lib-amd/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
  1184. /package/lib-amd/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
  1185. /package/lib-amd/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
  1186. /package/lib-amd/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
  1187. /package/lib-amd/coreApi/{focus.js → focus/focus.js} +0 -0
  1188. /package/lib-amd/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
  1189. /package/lib-amd/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
  1190. /package/lib-amd/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
  1191. /package/lib-amd/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
  1192. /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
  1193. /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
  1194. /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
  1195. /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
  1196. /package/lib-amd/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
  1197. /package/lib-amd/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
  1198. /package/lib-amd/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
  1199. /package/lib-amd/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
  1200. /package/lib-amd/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
  1201. /package/lib-amd/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
  1202. /package/lib-amd/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
  1203. /package/lib-amd/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
  1204. /package/lib-amd/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
  1205. /package/lib-amd/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
  1206. /package/lib-amd/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
  1207. /package/lib-amd/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
  1208. /package/lib-amd/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
  1209. /package/lib-amd/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
  1210. /package/lib-amd/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
  1211. /package/lib-amd/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
  1212. /package/lib-amd/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
  1213. /package/lib-amd/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
  1214. /package/lib-amd/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
  1215. /package/lib-amd/corePlugin/{utils → entity}/findAllEntities.js +0 -0
  1216. /package/lib-amd/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
  1217. /package/lib-amd/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
  1218. /package/lib-amd/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
  1219. /package/lib-amd/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
  1220. /package/lib-amd/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
  1221. /package/lib-amd/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
  1222. /package/lib-amd/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
  1223. /package/lib-amd/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
  1224. /package/lib-amd/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
  1225. /package/lib-amd/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
  1226. /package/lib-amd/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
  1227. /package/lib-amd/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
  1228. /package/lib-amd/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
  1229. /package/lib-amd/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
  1230. /package/lib-mjs/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
  1231. /package/lib-mjs/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
  1232. /package/lib-mjs/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
  1233. /package/lib-mjs/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
  1234. /package/lib-mjs/{publicApi/model → command/exportContent}/exportContent.js +0 -0
  1235. /package/lib-mjs/{utils → command}/paste/createPasteFragment.d.ts +0 -0
  1236. /package/lib-mjs/{utils → command}/paste/createPasteFragment.js +0 -0
  1237. /package/lib-mjs/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
  1238. /package/lib-mjs/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
  1239. /package/lib-mjs/{publicApi → command}/paste/paste.d.ts +0 -0
  1240. /package/lib-mjs/{publicApi/undo → command/redo}/redo.d.ts +0 -0
  1241. /package/lib-mjs/{publicApi/undo → command/redo}/redo.js +0 -0
  1242. /package/lib-mjs/{publicApi → command}/undo/undo.d.ts +0 -0
  1243. /package/lib-mjs/{publicApi → command}/undo/undo.js +0 -0
  1244. /package/lib-mjs/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
  1245. /package/lib-mjs/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
  1246. /package/lib-mjs/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
  1247. /package/lib-mjs/{editor → coreApi}/coreApiMap.d.ts +0 -0
  1248. /package/lib-mjs/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
  1249. /package/lib-mjs/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
  1250. /package/lib-mjs/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
  1251. /package/lib-mjs/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
  1252. /package/lib-mjs/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
  1253. /package/lib-mjs/coreApi/{focus.js → focus/focus.js} +0 -0
  1254. /package/lib-mjs/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
  1255. /package/lib-mjs/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
  1256. /package/lib-mjs/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
  1257. /package/lib-mjs/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
  1258. /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
  1259. /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
  1260. /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
  1261. /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
  1262. /package/lib-mjs/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
  1263. /package/lib-mjs/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
  1264. /package/lib-mjs/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
  1265. /package/lib-mjs/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
  1266. /package/lib-mjs/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
  1267. /package/lib-mjs/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
  1268. /package/lib-mjs/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
  1269. /package/lib-mjs/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
  1270. /package/lib-mjs/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
  1271. /package/lib-mjs/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
  1272. /package/lib-mjs/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
  1273. /package/lib-mjs/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
  1274. /package/lib-mjs/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
  1275. /package/lib-mjs/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
  1276. /package/lib-mjs/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
  1277. /package/lib-mjs/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
  1278. /package/lib-mjs/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
  1279. /package/lib-mjs/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
  1280. /package/lib-mjs/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
  1281. /package/lib-mjs/corePlugin/{utils → entity}/findAllEntities.js +0 -0
  1282. /package/lib-mjs/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
  1283. /package/lib-mjs/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
  1284. /package/lib-mjs/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
  1285. /package/lib-mjs/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
  1286. /package/lib-mjs/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
  1287. /package/lib-mjs/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
  1288. /package/lib-mjs/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
  1289. /package/lib-mjs/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
  1290. /package/lib-mjs/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
  1291. /package/lib-mjs/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
  1292. /package/lib-mjs/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
  1293. /package/lib-mjs/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
  1294. /package/lib-mjs/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
  1295. /package/lib-mjs/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
package/README.md CHANGED
@@ -6,13 +6,17 @@ Rooster is a framework-independent JavaScript rich-text editor neatly nested
6
6
  inside one HTML `<div>` element. Editing operations performed by end users are
7
7
  handled in simple ways to generate the final HTML.
8
8
 
9
- To view the sample site, please click the link below:
9
+ Rooster is working on top of a middle layer data structure called "Content Model".
10
+ All format API and editing operation are using this Content Model layer as content format,
11
+ and finally convert to HTML and show it in editor.
10
12
 
11
- [RoosterJs Sample Site](https://microsoft.github.io/roosterjs/index.html).
13
+ To view the demo site, please click the link below:
12
14
 
13
- ## Upgrade from RoosterJs 7.\*
15
+ [RoosterJs Demo Site](https://microsoft.github.io/roosterjs/index.html).
14
16
 
15
- Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-8).
17
+ ## Upgrade from RoosterJs 8.\*
18
+
19
+ Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-9).
16
20
 
17
21
  ## Features
18
22
 
@@ -25,24 +29,22 @@ Rooster contains 6 basic packages.
25
29
  `createEditor()` function in roosterjs to create an editor with default
26
30
  configurations.
27
31
 
28
- 2. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
29
- Defines the core editor and plugin infrastructure. Use `roosterjs-editor-core`
32
+ 2. [roosterjs-content-model-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_core.html):
33
+ Defines the core editor and plugin infrastructure. Use `roosterjs-content-model-core`
30
34
  instead of `roosterjs` to build and customize your own editor.
31
35
 
32
- 3. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
36
+ 3. [roosterjs-content-model-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_api.html):
33
37
  Defines APIs for editor operations. Use these APIs to modify content and
34
- formatting in the editor you built using `roosterjs-editor-core`.
38
+ formatting in the editor you built using `roosterjs-content-model-core`.
35
39
 
36
- 4. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
37
- Defines APIs for DOM operations. Use `roosterjs-editor-api` instead unless
38
- you want to access DOM API directly.
40
+ 4. [roosterjs-content-model-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_dom.html):
41
+ Defines APIs for Content Model and DOM operations. This package do conversion between DOM tree and roosterjs Content Model.
39
42
 
40
- 5. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
41
- Defines basic plugins for common features. Examples: making hyperlinks,
42
- pasting HTML content, inserting inline images.
43
+ 5. [roosterjs-content-model-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_plugins.html):
44
+ Defines basic plugins for common features.
43
45
 
44
- 6. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
45
- Defines public interfaces and enumerations.
46
+ 6. [roosterjs-content-model-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_types.html):
47
+ Defines public interfaces and enumerations, including Content Model types, API parameters and other types.
46
48
 
47
49
  There are also some extension packages to provide additional functionalities.
48
50
 
@@ -52,30 +54,38 @@ There are also some extension packages to provide additional functionalities.
52
54
  2. [roosterjs-react](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_react.html):
53
55
  Provide a React wrapper of roosterjs so it can be easily used with React.
54
56
 
55
- 3. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
56
- Provide types that are compatible with isolatedModules mode. When using isolatedModules mode,
57
- "const enum" will not work correctly, this package provides enums with prefix "Compatible" in
58
- their names and they have the same value with const enums in roosterjs-editor-types package
57
+ To be compatible with old (8.\*) versions, you can use `EditorAdapter` class from the following package which can act as a 8.\* Editor:
58
+
59
+ 1. [roosterjs-editor-adapter](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_adapter.html):
60
+ Provide a adapter class `EditorAdapter` to work with Editor (9.\*) and legacy plugins (via [EditorAdapterOptions.legacyPlugins](https://microsoft.github.io/roosterjs/docs/interfaces/roosterjs_editor_adapter.editoradapteroptions.html#legacyplugins))
61
+
62
+ And the following packages are for old (8.\*) compatibility:
63
+
64
+ 1. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
65
+ 2. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
66
+ 3. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
67
+ 4. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
68
+ 5. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
69
+ 6. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
59
70
 
60
71
  ### APIs
61
72
 
62
- Rooster provides DOM level APIs (in `roosterjs-editor-dom`), core APIs (in `roosterjs-editor-core`), and formatting APIs
63
- (in `roosterjs-editor-api`) to perform editing operations.
73
+ Rooster provides Content Model level APIs (in `roosterjs-content-model-dom`), core APIs (in `roosterjs-content-model-core`), and formatting APIs
74
+ (in `roosterjs-content-modelapi`) to perform editing operations.
64
75
 
65
- `roosterjs-editor-dom` provides several levels of DOM operations:
76
+ `roosterjs-content-model-dom` provides several levels of Content Model operations:
66
77
 
67
- - Perform basic DOM operations such as `wrap()`, `unwrap()`, ...
68
- - Wrap a given DOM node with `InlineElement` or `BlockElement` and perform
69
- operations with DOM Walker API.
70
- - Perform DOM operations on a given scope using scopers.
71
- - Travel among `InlineElements` and `BlockElements` with scope using
72
- ContentTraverser API.
78
+ - Create Content Model elements
79
+ - Convert DOM tree to Content Model
80
+ - Convert Content Model to DOM tree
81
+ - Format handlers
82
+ - A few DOM level API
73
83
 
74
- `roosterjs-editor-core` provides APIs for editor core. Editor class will call such
75
- APIs to perform basic editor operations. These APIs are overridable by specifying
84
+ `roosterjs-content-model-core` provides APIs for editor core. Editor class will call such
85
+ APIs to perform basic editor operations. These APIs can be overridden by specifying
76
86
  API overrides in Editor options when creating the editor.
77
87
 
78
- `roosterjs-editor-api` provides APIs for scenario-based operations triggered by
88
+ `roosterjs-content-model-api` provides APIs for scenario-based operations triggered by
79
89
  user interaction.
80
90
 
81
91
  ## Plugins
@@ -99,7 +109,7 @@ class HelloRooster implements EditorPlugin {
99
109
  dispose() {}
100
110
 
101
111
  onPluginEvent(e: PluginEvent) {
102
- if (e.eventType == PluginEventType.KeyPress && e.rawEvent.which == 65) {
112
+ if (e.eventType == 'input' && e.rawEvent.which == 65) {
103
113
  alert('Hello Rooster');
104
114
  }
105
115
  }
@@ -114,9 +124,9 @@ Install via NPM or Yarn:
114
124
 
115
125
  You can also install sub packages separately:
116
126
 
117
- `yarn add roosterjs-editor-core`
127
+ `yarn add roosterjs-content-model-core`
118
128
 
119
- `yarn add roosterjs-editor-api`
129
+ `yarn add roosterjs-content-model-api`
120
130
 
121
131
  `...`
122
132
 
@@ -161,9 +171,9 @@ In order to run the code below, you may also need to install [webpack](https://w
161
171
 
162
172
  ## Sample code
163
173
 
164
- To view the sample site, please click [here](https://microsoft.github.io/roosterjs/index.html).
174
+ To view the demo site, please click [here](https://microsoft.github.io/roosterjs/index.html).
165
175
 
166
- To build the sample site code yourself, follow these instructions:
176
+ To build the demo site code yourself, follow these instructions:
167
177
 
168
178
  1. Get dependencies using [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/):
169
179
 
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertInlineCss = exports.retrieveCssRules = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
6
+ /**
7
+ * @internal
8
+ *
9
+ * Splits CSS selectors, avoiding splits within parentheses
10
+ * @param selectorText The CSS selector string
11
+ * @return Array of trimmed selectors
12
+ */
13
+ function splitSelectors(selectorText) {
14
+ var regex = /(?![^(]*\)),/;
15
+ return selectorText.split(regex).map(function (s) { return s.trim(); });
16
+ }
17
+ /**
18
+ * @internal
19
+ */
20
+ function retrieveCssRules(doc) {
21
+ var styles = (0, roosterjs_content_model_dom_1.toArray)(doc.querySelectorAll('style'));
22
+ var result = [];
23
+ styles.forEach(function (styleNode) {
24
+ var _a;
25
+ var sheet = styleNode.sheet;
26
+ for (var ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) {
27
+ var rule = sheet.cssRules[ruleIndex];
28
+ if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) {
29
+ result.push({
30
+ selectors: splitSelectors(rule.selectorText),
31
+ text: rule.style.cssText,
32
+ });
33
+ }
34
+ }
35
+ (_a = styleNode.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(styleNode);
36
+ });
37
+ return result;
38
+ }
39
+ exports.retrieveCssRules = retrieveCssRules;
40
+ /**
41
+ * @internal
42
+ */
43
+ function convertInlineCss(root, cssRules) {
44
+ var _loop_1 = function (i) {
45
+ var e_1, _a;
46
+ var _b = cssRules[i], selectors = _b.selectors, text = _b.text;
47
+ try {
48
+ for (var selectors_1 = (e_1 = void 0, (0, tslib_1.__values)(selectors)), selectors_1_1 = selectors_1.next(); !selectors_1_1.done; selectors_1_1 = selectors_1.next()) {
49
+ var selector = selectors_1_1.value;
50
+ if (!selector || !selector.trim()) {
51
+ continue;
52
+ }
53
+ var nodes = (0, roosterjs_content_model_dom_1.toArray)(root.querySelectorAll(selector));
54
+ // Always put existing styles after so that they have higher priority
55
+ // Which means if both global style and inline style apply to the same element,
56
+ // inline style will have higher priority
57
+ nodes.forEach(function (node) {
58
+ return node.setAttribute('style', text + (node.getAttribute('style') || ''));
59
+ });
60
+ }
61
+ }
62
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
63
+ finally {
64
+ try {
65
+ if (selectors_1_1 && !selectors_1_1.done && (_a = selectors_1.return)) _a.call(selectors_1);
66
+ }
67
+ finally { if (e_1) throw e_1.error; }
68
+ }
69
+ };
70
+ for (var i = cssRules.length - 1; i >= 0; i--) {
71
+ _loop_1(i);
72
+ }
73
+ }
74
+ exports.convertInlineCss = convertInlineCss;
75
+ //# sourceMappingURL=convertInlineCss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertInlineCss.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts"],"names":[],"mappings":";;;;AAAA,2EAAsD;AAUtD;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,YAAoB;IACxC,IAAM,KAAK,GAAG,cAAc,CAAC;IAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CA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,CAAC,IAAI,EAAE,EAAE;oBAC/B,SAAS;iBACZ;gBAED,IAAM,KAAK,GAAG,IAAA,qCAAO,EAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAEvD,qEAAqE;gBACrE,+EAA+E;gBAC/E,yCAAyC;gBACzC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBACd,OAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;gBAArE,CAAqE,CACxE,CAAC;aACL;;;;;;;;;;IAhBL,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;gBAApC,CAAC;KAiBT;AACL,CAAC;AAnBD,4CAmBC","sourcesContent":["import { toArray } from 'roosterjs-content-model-dom';\n\n/**\n * @internal\n */\nexport interface CssRule {\n selectors: string[];\n text: string;\n}\n\n/**\n * @internal\n *\n * Splits CSS selectors, avoiding splits within parentheses\n * @param selectorText The CSS selector string\n * @return Array of trimmed selectors\n */\nfunction splitSelectors(selectorText: string) {\n const regex = /(?![^(]*\\)),/;\n return selectorText.split(regex).map(s => s.trim());\n}\n\n/**\n * @internal\n */\nexport function retrieveCssRules(doc: Document): CssRule[] {\n const styles = toArray(doc.querySelectorAll('style'));\n const result: CssRule[] = [];\n\n styles.forEach(styleNode => {\n const sheet = styleNode.sheet as CSSStyleSheet;\n\n for (let ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) {\n const rule = sheet.cssRules[ruleIndex] as CSSStyleRule;\n\n if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) {\n result.push({\n selectors: splitSelectors(rule.selectorText),\n text: rule.style.cssText,\n });\n }\n }\n\n styleNode.parentNode?.removeChild(styleNode);\n });\n\n return result;\n}\n\n/**\n * @internal\n */\nexport function convertInlineCss(root: ParentNode, cssRules: CssRule[]) {\n for (let i = cssRules.length - 1; i >= 0; i--) {\n const { selectors, text } = cssRules[i];\n\n for (const selector of selectors) {\n if (!selector || !selector.trim()) {\n continue;\n }\n\n const nodes = toArray(root.querySelectorAll(selector));\n\n // Always put existing styles after so that they have higher priority\n // Which means if both global style and inline style apply to the same element,\n // inline style will have higher priority\n nodes.forEach(node =>\n node.setAttribute('style', text + (node.getAttribute('style') || ''))\n );\n }\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ContentModelSegmentFormat, DomToModelContext, DomToModelOption, DomToModelOptionForSanitizing } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function createDomToModelContextForSanitizing(document: Document, defaultFormat?: ContentModelSegmentFormat, defaultOption?: DomToModelOption, additionalSanitizingOption?: Partial<DomToModelOptionForSanitizing>): DomToModelContext;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDomToModelContextForSanitizing = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var containerSizeFormatParser_1 = require("../../override/containerSizeFormatParser");
6
+ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
7
+ var pasteEntityProcessor_1 = require("../../override/pasteEntityProcessor");
8
+ var pasteGeneralProcessor_1 = require("../../override/pasteGeneralProcessor");
9
+ var getRootComputedStyleForContext_1 = require("../../coreApi/createEditorContext/getRootComputedStyleForContext");
10
+ var pasteCopyBlockEntityParser_1 = require("../../override/pasteCopyBlockEntityParser");
11
+ var pasteDisplayFormatParser_1 = require("../../override/pasteDisplayFormatParser");
12
+ var pasteTextProcessor_1 = require("../../override/pasteTextProcessor");
13
+ var DefaultSanitizingOption = {
14
+ processorOverride: {},
15
+ formatParserOverride: {},
16
+ additionalFormatParsers: {},
17
+ additionalAllowedTags: [],
18
+ additionalDisallowedTags: [],
19
+ styleSanitizers: {},
20
+ attributeSanitizers: {},
21
+ };
22
+ /**
23
+ * @internal
24
+ */
25
+ function createDomToModelContextForSanitizing(document, defaultFormat, defaultOption, additionalSanitizingOption) {
26
+ var sanitizingOption = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DefaultSanitizingOption), additionalSanitizingOption);
27
+ return (0, roosterjs_content_model_dom_1.createDomToModelContext)((0, tslib_1.__assign)({ defaultFormat: defaultFormat }, (0, getRootComputedStyleForContext_1.getRootComputedStyleForContext)(document)), defaultOption, {
28
+ processorOverride: {
29
+ '#text': pasteTextProcessor_1.pasteTextProcessor,
30
+ entity: (0, pasteEntityProcessor_1.createPasteEntityProcessor)(sanitizingOption),
31
+ '*': (0, pasteGeneralProcessor_1.createPasteGeneralProcessor)(sanitizingOption),
32
+ },
33
+ formatParserOverride: {
34
+ display: pasteDisplayFormatParser_1.pasteDisplayFormatParser,
35
+ },
36
+ additionalFormatParsers: {
37
+ container: [containerSizeFormatParser_1.containerSizeFormatParser],
38
+ entity: [pasteCopyBlockEntityParser_1.pasteBlockEntityParser],
39
+ },
40
+ }, sanitizingOption);
41
+ }
42
+ exports.createDomToModelContextForSanitizing = createDomToModelContextForSanitizing;
43
+ //# sourceMappingURL=createDomToModelContextForSanitizing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDomToModelContextForSanitizing.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.ts"],"names":[],"mappings":";;;;AAAA,sFAAqF;AACrF,2EAAsE;AACtE,4EAAiF;AACjF,8EAAmF;AACnF,mHAAkH;AAClH,wFAAmF;AACnF,oFAAmF;AACnF,wEAAuE;AAQvE,IAAM,uBAAuB,GAAkC;IAC3D,iBAAiB,EAAE,EAAE;IACrB,oBAAoB,EAAE,EAAE;IACxB,uBAAuB,EAAE,EAAE;IAC3B,qBAAqB,EAAE,EAAE;IACzB,wBAAwB,EAAE,EAAE;IAC5B,eAAe,EAAE,EAAE;IACnB,mBAAmB,EAAE,EAAE;CAC1B,CAAC;AAEF;;GAEG;AACH,SAAgB,oCAAoC,CAChD,QAAkB,EAClB,aAAyC,EACzC,aAAgC,EAChC,0BAAmE;IAEnE,IAAM,gBAAgB,mDACf,uBAAuB,GACvB,0BAA0B,CAChC,CAAC;IAEF,OAAO,IAAA,qDAAuB,0BAEtB,aAAa,eAAA,IACV,IAAA,+DAA8B,EAAC,QAAQ,CAAC,GAE/C,aAAa,EACb;QACI,iBAAiB,EAAE;YACf,OAAO,EAAE,uCAAkB;YAC3B,MAAM,EAAE,IAAA,iDAA0B,EAAC,gBAAgB,CAAC;YACpD,GAAG,EAAE,IAAA,mDAA2B,EAAC,gBAAgB,CAAC;SACrD;QACD,oBAAoB,EAAE;YAClB,OAAO,EAAE,mDAAwB;SACpC;QACD,uBAAuB,EAAE;YACrB,SAAS,EAAE,CAAC,qDAAyB,CAAC;YACtC,MAAM,EAAE,CAAC,mDAAsB,CAAC;SACnC;KACJ,EACD,gBAAgB,CACnB,CAAC;AACN,CAAC;AAjCD,oFAiCC","sourcesContent":["import { containerSizeFormatParser } from '../../override/containerSizeFormatParser';\nimport { createDomToModelContext } from 'roosterjs-content-model-dom';\nimport { createPasteEntityProcessor } from '../../override/pasteEntityProcessor';\nimport { createPasteGeneralProcessor } from '../../override/pasteGeneralProcessor';\nimport { getRootComputedStyleForContext } from '../../coreApi/createEditorContext/getRootComputedStyleForContext';\nimport { pasteBlockEntityParser } from '../../override/pasteCopyBlockEntityParser';\nimport { pasteDisplayFormatParser } from '../../override/pasteDisplayFormatParser';\nimport { pasteTextProcessor } from '../../override/pasteTextProcessor';\nimport type {\n ContentModelSegmentFormat,\n DomToModelContext,\n DomToModelOption,\n DomToModelOptionForSanitizing,\n} from 'roosterjs-content-model-types';\n\nconst DefaultSanitizingOption: DomToModelOptionForSanitizing = {\n processorOverride: {},\n formatParserOverride: {},\n additionalFormatParsers: {},\n additionalAllowedTags: [],\n additionalDisallowedTags: [],\n styleSanitizers: {},\n attributeSanitizers: {},\n};\n\n/**\n * @internal\n */\nexport function createDomToModelContextForSanitizing(\n document: Document,\n defaultFormat?: ContentModelSegmentFormat,\n defaultOption?: DomToModelOption,\n additionalSanitizingOption?: Partial<DomToModelOptionForSanitizing>\n): DomToModelContext {\n const sanitizingOption: DomToModelOptionForSanitizing = {\n ...DefaultSanitizingOption,\n ...additionalSanitizingOption,\n };\n\n return createDomToModelContext(\n {\n defaultFormat,\n ...getRootComputedStyleForContext(document),\n },\n defaultOption,\n {\n processorOverride: {\n '#text': pasteTextProcessor,\n entity: createPasteEntityProcessor(sanitizingOption),\n '*': createPasteGeneralProcessor(sanitizingOption),\n },\n formatParserOverride: {\n display: pasteDisplayFormatParser,\n },\n additionalFormatParsers: {\n container: [containerSizeFormatParser],\n entity: [pasteBlockEntityParser],\n },\n },\n sanitizingOption\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ContentModelDocument, ContentModelSegmentFormat, DomToModelOptionForSanitizing, TrustedHTMLHandler } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Create Content Model from HTML string
4
+ * @param html The source HTML string
5
+ * @param options Options for DOM to Content Model conversion
6
+ * @param trustedHTMLHandler A string handler to convert string to trusted string
7
+ * @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML
8
+ */
9
+ export declare function createModelFromHtml(html: string, options?: Partial<DomToModelOptionForSanitizing>, trustedHTMLHandler?: TrustedHTMLHandler, defaultSegmentFormat?: ContentModelSegmentFormat): ContentModelDocument;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createModelFromHtml = void 0;
4
+ var convertInlineCss_1 = require("./convertInlineCss");
5
+ var createDomToModelContextForSanitizing_1 = require("./createDomToModelContextForSanitizing");
6
+ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
7
+ /**
8
+ * Create Content Model from HTML string
9
+ * @param html The source HTML string
10
+ * @param options Options for DOM to Content Model conversion
11
+ * @param trustedHTMLHandler A string handler to convert string to trusted string
12
+ * @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML
13
+ */
14
+ function createModelFromHtml(html, options, trustedHTMLHandler, defaultSegmentFormat) {
15
+ var _a;
16
+ var doc = html
17
+ ? new DOMParser().parseFromString((_a = trustedHTMLHandler === null || trustedHTMLHandler === void 0 ? void 0 : trustedHTMLHandler(html)) !== null && _a !== void 0 ? _a : html, 'text/html')
18
+ : null;
19
+ if (doc === null || doc === void 0 ? void 0 : doc.body) {
20
+ var context = (0, createDomToModelContextForSanitizing_1.createDomToModelContextForSanitizing)(doc, defaultSegmentFormat, undefined /*defaultOptions*/, options);
21
+ var cssRules = doc ? (0, convertInlineCss_1.retrieveCssRules)(doc) : [];
22
+ (0, convertInlineCss_1.convertInlineCss)(doc, cssRules);
23
+ (0, roosterjs_content_model_dom_1.parseFormat)(doc.body, context.formatParsers.segmentOnBlock, context.segmentFormat, context);
24
+ return (0, roosterjs_content_model_dom_1.domToContentModel)(doc.body, context);
25
+ }
26
+ else {
27
+ return (0, roosterjs_content_model_dom_1.createEmptyModel)(defaultSegmentFormat);
28
+ }
29
+ }
30
+ exports.createModelFromHtml = createModelFromHtml;
31
+ //# sourceMappingURL=createModelFromHtml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createModelFromHtml.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/createModelFromHtml.ts"],"names":[],"mappings":";;;AAAA,uDAAwE;AACxE,+FAA8F;AAC9F,2EAA+F;AAQ/F;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAC/B,IAAY,EACZ,OAAgD,EAChD,kBAAuC,EACvC,oBAAgD;;IAEhD,IAAM,GAAG,GAAG,IAAI;QACZ,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,IAAI,CAAC,mCAAI,IAAI,EAAE,WAAW,CAAC;QAClF,CAAC,CAAC,IAAI,CAAC;IAEX,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE;QACX,IAAM,OAAO,GAAG,IAAA,2EAAoC,EAChD,GAAG,EACH,oBAAoB,EACpB,SAAS,CAAC,kBAAkB,EAC5B,OAAO,CACV,CAAC;QACF,IAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,mCAAgB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAElD,IAAA,mCAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAChC,IAAA,yCAAW,EAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAE5F,OAAO,IAAA,+CAAiB,EAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;SAAM;QACH,OAAO,IAAA,8CAAgB,EAAC,oBAAoB,CAAC,CAAC;KACjD;AACL,CAAC;AA1BD,kDA0BC","sourcesContent":["import { convertInlineCss, retrieveCssRules } from './convertInlineCss';\nimport { createDomToModelContextForSanitizing } from './createDomToModelContextForSanitizing';\nimport { createEmptyModel, domToContentModel, parseFormat } from 'roosterjs-content-model-dom';\nimport type {\n ContentModelDocument,\n ContentModelSegmentFormat,\n DomToModelOptionForSanitizing,\n TrustedHTMLHandler,\n} from 'roosterjs-content-model-types';\n\n/**\n * Create Content Model from HTML string\n * @param html The source HTML string\n * @param options Options for DOM to Content Model conversion\n * @param trustedHTMLHandler A string handler to convert string to trusted string\n * @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML\n */\nexport function createModelFromHtml(\n html: string,\n options?: Partial<DomToModelOptionForSanitizing>,\n trustedHTMLHandler?: TrustedHTMLHandler,\n defaultSegmentFormat?: ContentModelSegmentFormat\n): ContentModelDocument {\n const doc = html\n ? new DOMParser().parseFromString(trustedHTMLHandler?.(html) ?? html, 'text/html')\n : null;\n\n if (doc?.body) {\n const context = createDomToModelContextForSanitizing(\n doc,\n defaultSegmentFormat,\n undefined /*defaultOptions*/,\n options\n );\n const cssRules = doc ? retrieveCssRules(doc) : [];\n\n convertInlineCss(doc, cssRules);\n parseFormat(doc.body, context.formatParsers.segmentOnBlock, context.segmentFormat, context);\n\n return domToContentModel(doc.body, context);\n } else {\n return createEmptyModel(defaultSegmentFormat);\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizeElement.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/sanitizeElement.ts"],"names":[],"mappings":";;;AAAA,2EAA2D;AAG3D;;GAEG;AACU,QAAA,WAAW,GAA0B;IAC9C,GAAG;IACH,MAAM;IACN,SAAS;IACT,MAAM;IACN,SAAS;IACT,OAAO;IACP,GAAG;IACH,KAAK;IACL,KAAK;IACL,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;IACL,UAAU;IACV,MAAM;IACN,UAAU;IACV,IAAI;IACJ,KAAK;IACL,SAAS;IACT,KAAK;IACL,QAAQ;IACR,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,GAAG;IACH,KAAK;IACL,OAAO;IACP,KAAK;IACL,KAAK;IACL,OAAO;IACP,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,UAAU;IACV,OAAO;IACP,KAAK;IACL,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,G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AAI,SAAS;gBAC3B,cAAc,IAAI,SAAS;gBAC3B,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC;gBACxC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBACrB,iBAAiB,CAAC,IAAI,CAAC,IAAI,cAAc,EAC3C;gBACE,MAAM,CAAC,IAAI,CAAI,IAAI,SAAI,cAAgB,CAAC,CAAC;aAC5C;SACJ;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACrC,IAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,KAAI,EAAE,CAAC,CAAC,wFAAwF;AACrH,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { isNodeOfType } from 'roosterjs-content-model-dom';\nimport type { ValueSanitizer } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const AllowedTags: ReadonlyArray<string> = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'b',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'small',\n 'span',\n 'strike',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'wbr',\n 'xmp',\n];\n\n/**\n * @internal\n */\nexport const DisallowedTags: ReadonlyArray<string> = [\n 'applet',\n 'audio',\n 'base',\n 'basefont',\n 'embed',\n 'frame',\n 'frameset',\n 'iframe',\n 'link',\n 'meta',\n 'noscript',\n 'object',\n 'param',\n 'script',\n 'slot',\n 'source',\n 'style',\n 'template',\n 'title',\n 'track',\n 'video',\n];\n\nconst VARIABLE_REGEX = /^\\s*var\\(\\s*[a-zA-Z0-9-_]+\\s*(,\\s*(.*))?\\)\\s*$/;\nconst VARIABLE_PREFIX = 'var(';\n\nconst AllowedAttributes = [\n 'accept',\n 'align',\n 'alt',\n 'checked',\n 'cite',\n 'class',\n 'color',\n 'cols',\n 'colspan',\n 'contextmenu',\n 'coords',\n 'datetime',\n 'default',\n 'dir',\n 'dirname',\n 'disabled',\n 'download',\n 'face',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'min',\n 'multiple',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'readonly',\n 'rel',\n 'required',\n 'reversed',\n 'rows',\n 'rowspan',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'spellcheck',\n 'src',\n 'srclang',\n 'srcset',\n 'start',\n 'step',\n 'style',\n 'tabindex',\n 'target',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'bgColor',\n];\n\nconst DefaultStyleValue: { [name: string]: string } = {\n 'background-color': 'transparent',\n 'border-bottom-color': 'rgb(0, 0, 0)',\n 'border-bottom-style': 'none',\n 'border-bottom-width': '0px',\n 'border-image-outset': '0',\n 'border-image-repeat': 'stretch',\n 'border-image-slice': '100%',\n 'border-image-source': 'none',\n 'border-image-width': '1',\n 'border-left-color': 'rgb(0, 0, 0)',\n 'border-left-style': 'none',\n 'border-left-width': '0px',\n 'border-right-color': 'rgb(0, 0, 0)',\n 'border-right-style': 'none',\n 'border-right-width': '0px',\n 'border-top-color': 'rgb(0, 0, 0)',\n 'border-top-style': 'none',\n 'border-top-width': '0px',\n 'outline-color': 'transparent',\n 'outline-style': 'none',\n 'outline-width': '0px',\n overflow: 'visible',\n '-webkit-text-stroke-width': '0px',\n 'word-wrap': 'break-word',\n 'margin-left': '0px',\n 'margin-right': '0px',\n padding: '0px',\n 'padding-top': '0px',\n 'padding-left': '0px',\n 'padding-right': '0px',\n 'padding-bottom': '0px',\n border: '0px',\n 'border-top': '0px',\n 'border-left': '0px',\n 'border-right': '0px',\n 'border-bottom': '0px',\n 'vertical-align': 'baseline',\n float: 'none',\n 'font-style': 'normal',\n 'font-variant-ligatures': 'normal',\n 'font-variant-caps': 'normal',\n 'font-weight': '400',\n 'letter-spacing': 'normal',\n orphans: '2',\n 'text-align': 'start',\n 'text-indent': '0px',\n 'text-transform': 'none',\n widows: '2',\n 'word-spacing': '0px',\n 'white-space': 'normal',\n};\n\n/**\n * @internal\n */\nexport function sanitizeElement(\n element: HTMLElement,\n allowedTags: ReadonlyArray<string>,\n disallowedTags: ReadonlyArray<string>,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>,\n attributeSanitizers?: Readonly<Record<string, ValueSanitizer>>\n): HTMLElement | null {\n const tag = element.tagName.toLowerCase();\n const sanitizedElement =\n disallowedTags.indexOf(tag) >= 0\n ? null\n : createSanitizedElement(\n element.ownerDocument,\n allowedTags.indexOf(tag) >= 0 ? tag : 'span',\n element.attributes,\n styleSanitizers,\n attributeSanitizers\n );\n\n if (sanitizedElement) {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n const newChild = isNodeOfType(child, 'ELEMENT_NODE')\n ? sanitizeElement(\n child,\n allowedTags,\n disallowedTags,\n styleSanitizers,\n attributeSanitizers\n )\n : isNodeOfType(child, 'TEXT_NODE')\n ? child.cloneNode()\n : null;\n\n if (newChild) {\n sanitizedElement?.appendChild(newChild);\n }\n }\n }\n\n return sanitizedElement;\n}\n\n/**\n * @internal\n */\nexport function createSanitizedElement(\n doc: Document,\n tag: string,\n attributes: NamedNodeMap,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>,\n attributeSanitizers?: Readonly<Record<string, ValueSanitizer>>\n): HTMLElement {\n const element = doc.createElement(tag);\n\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n const name = attribute.name.toLowerCase().trim();\n const value = attribute.value;\n\n const sanitizer = attributeSanitizers?.[name];\n const newValue =\n name == 'style'\n ? processStyles(tag, value, styleSanitizers)\n : typeof sanitizer == 'function'\n ? sanitizer(value, tag)\n : typeof sanitizer === 'boolean'\n ? sanitizer\n ? value\n : null\n : AllowedAttributes.indexOf(name) >= 0 || name.indexOf('data-') == 0\n ? value\n : null;\n\n if (\n newValue !== null &&\n newValue !== undefined &&\n !newValue.match(/s\\n*c\\n*r\\n*i\\n*p\\n*t\\n*:/i) // match script: with any NewLine inside. Browser will ignore those NewLine char and still treat it as script prefix\n ) {\n element.setAttribute(name, newValue);\n }\n }\n\n return element;\n}\n\nfunction processStyles(\n tagName: string,\n value: string,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>\n) {\n const pairs = value.split(';');\n const result: string[] = [];\n\n pairs.forEach(pair => {\n const valueIndex = pair.indexOf(':');\n const name = pair.slice(0, valueIndex).trim();\n let value: string = pair.slice(valueIndex + 1).trim();\n\n if (name && value) {\n if (isCssVariable(value)) {\n value = processCssVariable(value);\n }\n\n const sanitizer = styleSanitizers?.[name];\n const sanitizedValue =\n typeof sanitizer == 'function'\n ? sanitizer(value, tagName)\n : sanitizer === false\n ? null\n : value;\n\n if (\n !!sanitizedValue &&\n sanitizedValue != 'inherit' &&\n sanitizedValue != 'initial' &&\n sanitizedValue.indexOf('expression') < 0 &&\n !name.startsWith('-') &&\n DefaultStyleValue[name] != sanitizedValue\n ) {\n result.push(`${name}:${sanitizedValue}`);\n }\n }\n });\n\n return result.join(';');\n}\n\nfunction processCssVariable(value: string): string {\n const match = VARIABLE_REGEX.exec(value);\n return match?.[2] || ''; // Without fallback value, we don't know what does the original value mean, so ignore it\n}\n\nfunction isCssVariable(value: string): boolean {\n return value.indexOf(VARIABLE_PREFIX) == 0;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/exportContent/exportContent.ts"],"names":[],"mappings":";;;AAAA,2EAIqC;AAGrC;;;;;;;;GAQG;AACH,SAAgB,aAAa,CACzB,MAAe,EACf,IAAgC,EAChC,OAA0B;IAD1B,qBAAA,EAAA,aAAgC;IAGhC,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,IAAA,+CAAiB,EACb,GAAG,EACH,GAAG,EACH,KAAK,EACL,IAAA,qDAAuB,EAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAChE,CAAC;YAEF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC;AA5BD,sCA4BC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type { ExportContentMode, IEditor, ModelToDomOption } from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n * @param options @optional Options for Model to DOM conversion\n */\nexport function exportContent(\n editor: IEditor,\n mode: ExportContentMode = 'HTML',\n options?: ModelToDomOption\n): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('clean');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(\n doc,\n div,\n model,\n createModelToDomContext(undefined /*editorContext*/, options)\n );\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPasteFragment.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/createPasteFragment.ts"],"names":[],"mappings":";;;AAAA,2EAAmE;AAGnE,IAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,IAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,IAAM,UAAU,GAAG,CAAC,CAAC;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AC,CAAC;QACjF,IAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;KAC1C;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { moveChildNodes, wrap } from 'roosterjs-content-model-dom';\nimport type { ClipboardData, PasteType } from 'roosterjs-content-model-types';\n\nconst NBSP_HTML = '\\u00A0';\nconst ENSP_HTML = '\\u2002';\nconst TAB_SPACES = 6;\n\n/**\n * @internal\n */\nexport function createPasteFragment(\n document: Document,\n clipboardData: ClipboardData,\n pasteType: PasteType,\n root: HTMLElement | undefined\n): DocumentFragment {\n const { imageDataUri, text } = clipboardData;\n const fragment = document.createDocumentFragment();\n\n if (\n (pasteType == 'asImage' && imageDataUri) ||\n (pasteType != 'asPlainText' && !text && imageDataUri)\n ) {\n // Paste image\n const img = document.createElement('img');\n img.style.maxWidth = '100%';\n img.src = imageDataUri;\n fragment.appendChild(img);\n } else if (pasteType != 'asPlainText' && root) {\n moveChildNodes(fragment, root);\n } else if (text) {\n text.split('\\n').forEach((line, index, lines) => {\n line = line\n .replace(/^ /g, NBSP_HTML)\n .replace(/ $/g, NBSP_HTML)\n .replace(/\\r/g, '')\n .replace(/ {2}/g, ' ' + NBSP_HTML);\n\n if (line.includes('\\t')) {\n line = transformTabCharacters(line);\n }\n\n const textNode = document.createTextNode(line);\n\n // There are 3 scenarios:\n // 1. Single line: Paste as it is\n // 2. Two lines: Add <br> between the lines\n // 3. 3 or More lines, For first and last line, paste as it is. For middle lines, wrap with DIV, and add BR if it is empty line\n if (lines.length == 2 && index == 0) {\n // 1 of 2 lines scenario, add BR\n fragment.appendChild(textNode);\n fragment.appendChild(document.createElement('br'));\n } else if (index > 0 && index < lines.length - 1) {\n // Middle line of >=3 lines scenario, wrap with DIV\n fragment.appendChild(\n wrap(document, line == '' ? document.createElement('br') : textNode, 'div')\n );\n } else {\n // All others, paste as it is\n fragment.appendChild(textNode);\n }\n });\n }\n\n return fragment;\n}\n\n/**\n * Transform \\t characters into EN SPACE characters\n * @param input string NOT containing \\n characters\n * @example t(\"\\thello\", 2) => \"&ensp;&ensp;&ensp;&ensp;hello\"\n */\nfunction transformTabCharacters(input: string, initialOffset: number = 0) {\n let line = input;\n let tIndex: number;\n while ((tIndex = line.indexOf('\\t')) != -1) {\n const lineBefore = line.slice(0, tIndex);\n const lineAfter = line.slice(tIndex + 1);\n const tabCount = TAB_SPACES - ((lineBefore.length + initialOffset) % TAB_SPACES);\n const tabStr = Array(tabCount).fill(ENSP_HTML).join('');\n line = lineBefore + tabStr + lineAfter;\n }\n return line;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePasteOptionFromPlugins.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/generatePasteOptionFromPlugins.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,SAAgB,8BAA8B,CAC1C,MAAe,EACf,aAA4B,EAC5B,QAA0B,EAC1B,iBAAoC,EACpC,SAAoB;;IAEpB,IAAM,gBAAgB,GAAkC;QACpD,qBAAqB,EAAE,EAAE;QACzB,wBAAwB,EAAE,EAAE;QAC5B,uBAAuB,EAAE,EAAE;QAC3B,oBAAoB,EAAE,EAAE;QACxB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,mBAAmB,EAAE,EAAE;KAC1B,CAAC;IAEF,IAAM,KAAK,GAAqB;QAC5B,SAAS,EAAE,aAAa;QACxB,aAAa,eAAA;QACb,QAAQ,UAAA;QACR,UAAU,EAAE,MAAA,iBAAiB,CAAC,UAAU,mCAAI,EAAE;QAC9C,SAAS,EAAE,MAAA,iBAAiB,CAAC,SAAS,mCAAI,EAAE;QAC5C,cAAc,EAAE,iBAAiB,CAAC,QAAQ;QAC1C,SAAS,EAAE,SAAS;QACpB,gBAAgB,kBAAA;KACnB,CAAC;IAEF,OAAO,SAAS,IAAI,aAAa;QAC7B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AAC1E,CAAC;AA/BD,wEA+BC","sourcesContent":["import type { HtmlFromClipboard } from './retrieveHtmlInfo';\nimport type {\n BeforePasteEvent,\n ClipboardData,\n DomToModelOptionForSanitizing,\n PasteType,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function generatePasteOptionFromPlugins(\n editor: IEditor,\n clipboardData: ClipboardData,\n fragment: DocumentFragment,\n htmlFromClipboard: HtmlFromClipboard,\n pasteType: PasteType\n): BeforePasteEvent {\n const domToModelOption: DomToModelOptionForSanitizing = {\n additionalAllowedTags: [],\n additionalDisallowedTags: [],\n additionalFormatParsers: {},\n formatParserOverride: {},\n processorOverride: {},\n styleSanitizers: {},\n attributeSanitizers: {},\n };\n\n const event: BeforePasteEvent = {\n eventType: 'beforePaste',\n clipboardData,\n fragment,\n htmlBefore: htmlFromClipboard.htmlBefore ?? '',\n htmlAfter: htmlFromClipboard.htmlAfter ?? '',\n htmlAttributes: htmlFromClipboard.metadata,\n pasteType: pasteType,\n domToModelOption,\n };\n\n return pasteType == 'asPlainText'\n ? event\n : editor.triggerEvent('beforePaste', event, true /* broadcast */);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { BeforePasteEvent, ClipboardData, ContentModelDocument, IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function cloneModelForPaste(model: ContentModelDocument): ContentModelDocument;
6
+ /**
7
+ * @internal
8
+ */
9
+ export declare function mergePasteContent(editor: IEditor, eventResult: BeforePasteEvent, clipboardData: ClipboardData): void;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergePasteContent = exports.cloneModelForPaste = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var createDomToModelContextForSanitizing_1 = require("../createModelFromHtml/createDomToModelContextForSanitizing");
6
+ var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
7
+ var EmptySegmentFormat = {
8
+ backgroundColor: '',
9
+ fontFamily: '',
10
+ fontSize: '',
11
+ fontWeight: '',
12
+ italic: false,
13
+ letterSpacing: '',
14
+ lineHeight: '',
15
+ strikethrough: false,
16
+ superOrSubScriptSequence: '',
17
+ textColor: '',
18
+ underline: false,
19
+ };
20
+ var CloneOption = {
21
+ includeCachedElement: function (node, type) { return (type == 'cache' ? undefined : node); },
22
+ };
23
+ /**
24
+ * @internal
25
+ */
26
+ function cloneModelForPaste(model) {
27
+ return (0, roosterjs_content_model_dom_1.cloneModel)(model, CloneOption);
28
+ }
29
+ exports.cloneModelForPaste = cloneModelForPaste;
30
+ /**
31
+ * @internal
32
+ */
33
+ function mergePasteContent(editor, eventResult, clipboardData) {
34
+ var fragment = eventResult.fragment, domToModelOption = eventResult.domToModelOption, customizedMerge = eventResult.customizedMerge, pasteType = eventResult.pasteType;
35
+ editor.formatContentModel(function (model, context) {
36
+ if (clipboardData.modelBeforePaste) {
37
+ var clonedModel = cloneModelForPaste(clipboardData.modelBeforePaste);
38
+ model.blocks = clonedModel.blocks;
39
+ }
40
+ var selectedSegment = (0, roosterjs_content_model_dom_1.getSelectedSegments)(model, true /*includeFormatHolder*/)[0];
41
+ var domToModelContext = (0, createDomToModelContextForSanitizing_1.createDomToModelContextForSanitizing)(editor.getDocument(), undefined /*defaultFormat*/, editor.getEnvironment().domToModelSettings.customized, domToModelOption);
42
+ domToModelContext.segmentFormat = selectedSegment
43
+ ? (0, roosterjs_content_model_dom_1.getSegmentTextFormat)(selectedSegment)
44
+ : {};
45
+ var pasteModel = (0, roosterjs_content_model_dom_1.domToContentModel)(fragment, domToModelContext);
46
+ var mergeOption = {
47
+ mergeFormat: pasteType == 'mergeFormat' ? 'keepSourceEmphasisFormat' : 'none',
48
+ mergeTable: shouldMergeTable(pasteModel),
49
+ };
50
+ var insertPoint = customizedMerge
51
+ ? customizedMerge(model, pasteModel)
52
+ : (0, roosterjs_content_model_dom_1.mergeModel)(model, pasteModel, context, mergeOption);
53
+ if (insertPoint) {
54
+ context.newPendingFormat = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, EmptySegmentFormat), model.format), insertPoint.marker.format);
55
+ }
56
+ return true;
57
+ }, {
58
+ changeSource: roosterjs_content_model_dom_1.ChangeSource.Paste,
59
+ getChangeData: function () { return clipboardData; },
60
+ apiName: 'paste',
61
+ });
62
+ }
63
+ exports.mergePasteContent = mergePasteContent;
64
+ function shouldMergeTable(pasteModel) {
65
+ // If model contains a table and a paragraph element after the table with a single BR segment, remove the Paragraph after the table
66
+ if (pasteModel.blocks.length == 2 &&
67
+ pasteModel.blocks[0].blockType === 'Table' &&
68
+ pasteModel.blocks[1].blockType === 'Paragraph' &&
69
+ pasteModel.blocks[1].segments.length === 1 &&
70
+ pasteModel.blocks[1].segments[0].segmentType === 'Br') {
71
+ pasteModel.blocks.splice(1);
72
+ }
73
+ // Only merge table when the document contain a single table.
74
+ return pasteModel.blocks.length === 1 && pasteModel.blocks[0].blockType === 'Table';
75
+ }
76
+ //# sourceMappingURL=mergePasteContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergePasteContent.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/mergePasteContent.ts"],"names":[],"mappings":";;;;AAAA,oHAAmH;AACnH,2EAOqC;AAWrC,IAAM,kBAAkB,GAAwC;IAC5D,eAAe,EAAE,EAAE;IACnB,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,KAAK;IACb,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,EAAE;IACd,aAAa,EAAE,KAAK;IACpB,wBAAwB,EAAE,EAAE;IAC5B,SAAS,EAAE,E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;IACD,6DAA6D;IAC7D,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACxF,CAAC","sourcesContent":["import { createDomToModelContextForSanitizing } from '../createModelFromHtml/createDomToModelContextForSanitizing';\nimport {\n ChangeSource,\n cloneModel,\n domToContentModel,\n getSegmentTextFormat,\n getSelectedSegments,\n mergeModel,\n} from 'roosterjs-content-model-dom';\nimport type {\n BeforePasteEvent,\n ClipboardData,\n CloneModelOptions,\n ContentModelDocument,\n ContentModelSegmentFormat,\n IEditor,\n MergeModelOption,\n} from 'roosterjs-content-model-types';\n\nconst EmptySegmentFormat: Required<ContentModelSegmentFormat> = {\n backgroundColor: '',\n fontFamily: '',\n fontSize: '',\n fontWeight: '',\n italic: false,\n letterSpacing: '',\n lineHeight: '',\n strikethrough: false,\n superOrSubScriptSequence: '',\n textColor: '',\n underline: false,\n};\n\nconst CloneOption: CloneModelOptions = {\n includeCachedElement: (node, type) => (type == 'cache' ? undefined : node),\n};\n\n/**\n * @internal\n */\nexport function cloneModelForPaste(model: ContentModelDocument) {\n return cloneModel(model, CloneOption);\n}\n\n/**\n * @internal\n */\nexport function mergePasteContent(\n editor: IEditor,\n eventResult: BeforePasteEvent,\n clipboardData: ClipboardData\n) {\n const { fragment, domToModelOption, customizedMerge, pasteType } = eventResult;\n\n editor.formatContentModel(\n (model, context) => {\n if (clipboardData.modelBeforePaste) {\n const clonedModel = cloneModelForPaste(clipboardData.modelBeforePaste);\n model.blocks = clonedModel.blocks;\n }\n\n const selectedSegment = getSelectedSegments(model, true /*includeFormatHolder*/)[0];\n const domToModelContext = createDomToModelContextForSanitizing(\n editor.getDocument(),\n undefined /*defaultFormat*/,\n editor.getEnvironment().domToModelSettings.customized,\n domToModelOption\n );\n\n domToModelContext.segmentFormat = selectedSegment\n ? getSegmentTextFormat(selectedSegment)\n : {};\n\n const pasteModel = domToContentModel(fragment, domToModelContext);\n const mergeOption: MergeModelOption = {\n mergeFormat: pasteType == 'mergeFormat' ? 'keepSourceEmphasisFormat' : 'none',\n mergeTable: shouldMergeTable(pasteModel),\n };\n\n const insertPoint = customizedMerge\n ? customizedMerge(model, pasteModel)\n : mergeModel(model, pasteModel, context, mergeOption);\n\n if (insertPoint) {\n context.newPendingFormat = {\n ...EmptySegmentFormat,\n ...model.format,\n ...insertPoint.marker.format,\n };\n }\n\n return true;\n },\n {\n changeSource: ChangeSource.Paste,\n getChangeData: () => clipboardData,\n apiName: 'paste',\n }\n );\n}\n\nfunction shouldMergeTable(pasteModel: ContentModelDocument): boolean | undefined {\n // If model contains a table and a paragraph element after the table with a single BR segment, remove the Paragraph after the table\n if (\n pasteModel.blocks.length == 2 &&\n pasteModel.blocks[0].blockType === 'Table' &&\n pasteModel.blocks[1].blockType === 'Paragraph' &&\n pasteModel.blocks[1].segments.length === 1 &&\n pasteModel.blocks[1].segments[0].segmentType === 'Br'\n ) {\n pasteModel.blocks.splice(1);\n }\n // Only merge table when the document contain a single table.\n return pasteModel.blocks.length === 1 && pasteModel.blocks[0].blockType === 'Table';\n}\n"]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paste = void 0;
4
+ var mergePasteContent_1 = require("./mergePasteContent");
5
+ var convertInlineCss_1 = require("../createModelFromHtml/convertInlineCss");
6
+ var createPasteFragment_1 = require("./createPasteFragment");
7
+ var generatePasteOptionFromPlugins_1 = require("./generatePasteOptionFromPlugins");
8
+ var retrieveHtmlInfo_1 = require("./retrieveHtmlInfo");
9
+ /**
10
+ * Paste into editor using a clipboardData object
11
+ * @param editor The Editor object.
12
+ * @param clipboardData Clipboard data retrieved from clipboard
13
+ * @param pasteType Type of content to paste. @default normal
14
+ */
15
+ function paste(editor, clipboardData, pasteType) {
16
+ var _a;
17
+ if (pasteType === void 0) { pasteType = 'normal'; }
18
+ editor.focus();
19
+ var trustedHTMLHandler = editor.getTrustedHTMLHandler();
20
+ if (!clipboardData.modelBeforePaste) {
21
+ clipboardData.modelBeforePaste = (0, mergePasteContent_1.cloneModelForPaste)(editor.getContentModelCopy('connected'));
22
+ }
23
+ // 1. Prepare variables
24
+ var doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler);
25
+ // 2. Handle HTML from clipboard
26
+ var htmlFromClipboard = (0, retrieveHtmlInfo_1.retrieveHtmlInfo)(doc, clipboardData);
27
+ // 3. Create target fragment
28
+ var sourceFragment = (0, createPasteFragment_1.createPasteFragment)(editor.getDocument(), clipboardData, pasteType, (_a = (clipboardData.rawHtml == clipboardData.html
29
+ ? doc
30
+ : createDOMFromHtml(clipboardData.html, trustedHTMLHandler))) === null || _a === void 0 ? void 0 : _a.body);
31
+ // 4. Trigger BeforePaste event to allow plugins modify the fragment
32
+ var eventResult = (0, generatePasteOptionFromPlugins_1.generatePasteOptionFromPlugins)(editor, clipboardData, sourceFragment, htmlFromClipboard, pasteType);
33
+ // 5. Convert global CSS to inline CSS
34
+ (0, convertInlineCss_1.convertInlineCss)(eventResult.fragment, htmlFromClipboard.globalCssRules);
35
+ // 6. Merge pasted content into main Content Model
36
+ (0, mergePasteContent_1.mergePasteContent)(editor, eventResult, clipboardData);
37
+ }
38
+ exports.paste = paste;
39
+ function createDOMFromHtml(html, trustedHTMLHandler) {
40
+ return html ? new DOMParser().parseFromString(trustedHTMLHandler(html), 'text/html') : null;
41
+ }
42
+ //# sourceMappingURL=paste.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paste.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/paste.ts"],"names":[],"mappings":";;;AAAA,yDAA4E;AAC5E,4EAA2E;AAC3E,6DAA4D;AAC5D,mFAAkF;AAClF,uDAAsD;AAQtD;;;;;GAKG;AACH,SAAgB,KAAK,CACjB,MAAe,EACf,aAA4B,EAC5B,SAA+B;;IAA/B,0BAAA,EAAA,oBAA+B;IAE/B,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AC,CAAC,CAAC,IAAI,CAAC;AAChG,CAAC","sourcesContent":["import { cloneModelForPaste, mergePasteContent } from './mergePasteContent';\nimport { convertInlineCss } from '../createModelFromHtml/convertInlineCss';\nimport { createPasteFragment } from './createPasteFragment';\nimport { generatePasteOptionFromPlugins } from './generatePasteOptionFromPlugins';\nimport { retrieveHtmlInfo } from './retrieveHtmlInfo';\nimport type {\n PasteType,\n ClipboardData,\n TrustedHTMLHandler,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Paste into editor using a clipboardData object\n * @param editor The Editor object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport function paste(\n editor: IEditor,\n clipboardData: ClipboardData,\n pasteType: PasteType = 'normal'\n) {\n editor.focus();\n\n const trustedHTMLHandler = editor.getTrustedHTMLHandler();\n\n if (!clipboardData.modelBeforePaste) {\n clipboardData.modelBeforePaste = cloneModelForPaste(\n editor.getContentModelCopy('connected')\n );\n }\n\n // 1. Prepare variables\n const doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler);\n\n // 2. Handle HTML from clipboard\n const htmlFromClipboard = retrieveHtmlInfo(doc, clipboardData);\n\n // 3. Create target fragment\n const sourceFragment = createPasteFragment(\n editor.getDocument(),\n clipboardData,\n pasteType,\n (clipboardData.rawHtml == clipboardData.html\n ? doc\n : createDOMFromHtml(clipboardData.html, trustedHTMLHandler)\n )?.body\n );\n\n // 4. Trigger BeforePaste event to allow plugins modify the fragment\n const eventResult = generatePasteOptionFromPlugins(\n editor,\n clipboardData,\n sourceFragment,\n htmlFromClipboard,\n pasteType\n );\n\n // 5. Convert global CSS to inline CSS\n convertInlineCss(eventResult.fragment, htmlFromClipboard.globalCssRules);\n\n // 6. Merge pasted content into main Content Model\n mergePasteContent(editor, eventResult, clipboardData);\n}\n\nfunction createDOMFromHtml(\n html: string | null | undefined,\n trustedHTMLHandler: TrustedHTMLHandler\n): Document | null {\n return html ? new DOMParser().parseFromString(trustedHTMLHandler(html), 'text/html') : null;\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ClipboardData } from 'roosterjs-content-model-types';
2
+ import type { CssRule } from '../createModelFromHtml/convertInlineCss';
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface HtmlFromClipboard {
7
+ metadata: Record<string, string>;
8
+ globalCssRules: CssRule[];
9
+ htmlBefore?: string;
10
+ htmlAfter?: string;
11
+ }
12
+ /**
13
+ * @internal
14
+ */
15
+ export declare function retrieveHtmlInfo(doc: Document | null, clipboardData: Partial<ClipboardData>): HtmlFromClipboard;