roosterjs-content-model-api 9.43.0 → 9.45.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 (820) hide show
  1. package/lib/index.d.ts +63 -63
  2. package/lib/index.js +131 -131
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
  5. package/lib/modelApi/block/setModelAlignment.js +65 -65
  6. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  7. package/lib/modelApi/block/setModelDirection.d.ts +5 -5
  8. package/lib/modelApi/block/setModelDirection.js +113 -109
  9. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  10. package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
  11. package/lib/modelApi/block/setModelIndentation.js +158 -152
  12. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  13. package/lib/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  14. package/lib/modelApi/block/splitSelectedParagraphByBr.js +71 -71
  15. package/lib/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  16. package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  17. package/lib/modelApi/block/toggleModelBlockQuote.js +53 -53
  18. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  19. package/lib/modelApi/common/adjustIndentation.d.ts +13 -13
  20. package/lib/modelApi/common/adjustIndentation.js +114 -114
  21. package/lib/modelApi/common/adjustIndentation.js.map +1 -1
  22. package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
  23. package/lib/modelApi/common/clearModelFormat.js +143 -143
  24. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  25. package/lib/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  26. package/lib/modelApi/common/queryContentModelBlocks.js +87 -87
  27. package/lib/modelApi/common/queryContentModelBlocks.js.map +1 -1
  28. package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  29. package/lib/modelApi/common/reducedModelChildProcessor.js +63 -63
  30. package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  31. package/lib/modelApi/common/wrapBlock.d.ts +16 -16
  32. package/lib/modelApi/common/wrapBlock.js +52 -52
  33. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  34. package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
  35. package/lib/modelApi/entity/insertEntityModel.js +105 -105
  36. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  37. package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  38. package/lib/modelApi/image/applyImageBorderFormat.js +57 -57
  39. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  40. package/lib/modelApi/link/getLinkUrl.d.ts +5 -5
  41. package/lib/modelApi/link/getLinkUrl.js +28 -28
  42. package/lib/modelApi/link/getLinkUrl.js.map +1 -1
  43. package/lib/modelApi/link/matchLink.d.ts +12 -12
  44. package/lib/modelApi/link/matchLink.js +93 -93
  45. package/lib/modelApi/link/matchLink.js.map +1 -1
  46. package/lib/modelApi/link/promoteLink.d.ts +20 -20
  47. package/lib/modelApi/link/promoteLink.js +54 -54
  48. package/lib/modelApi/link/promoteLink.js.map +1 -1
  49. package/lib/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  50. package/lib/modelApi/list/findListItemsInSameThread.js +113 -113
  51. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  52. package/lib/modelApi/list/getListAnnounceData.d.ts +7 -7
  53. package/lib/modelApi/list/getListAnnounceData.js +68 -68
  54. package/lib/modelApi/list/getListAnnounceData.js.map +1 -1
  55. package/lib/modelApi/list/setListType.d.ts +8 -8
  56. package/lib/modelApi/list/setListType.js +117 -116
  57. package/lib/modelApi/list/setListType.js.map +1 -1
  58. package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -7
  59. package/lib/modelApi/list/setModelListStartNumber.js +21 -21
  60. package/lib/modelApi/list/setModelListStartNumber.js.map +1 -1
  61. package/lib/modelApi/list/setModelListStyle.d.ts +7 -7
  62. package/lib/modelApi/list/setModelListStyle.js +25 -25
  63. package/lib/modelApi/list/setModelListStyle.js.map +1 -1
  64. package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  65. package/lib/modelApi/selection/adjustSegmentSelection.js +47 -47
  66. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  67. package/lib/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  68. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
  69. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  70. package/lib/modelApi/selection/adjustWordSelection.d.ts +8 -8
  71. package/lib/modelApi/selection/adjustWordSelection.js +123 -123
  72. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  73. package/lib/modelApi/selection/collapseTableSelection.d.ts +5 -5
  74. package/lib/modelApi/selection/collapseTableSelection.js +16 -16
  75. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  76. package/lib/modelApi/table/alignTable.d.ts +5 -5
  77. package/lib/modelApi/table/alignTable.js +11 -11
  78. package/lib/modelApi/table/alignTable.js.map +1 -1
  79. package/lib/modelApi/table/alignTableCell.d.ts +9 -9
  80. package/lib/modelApi/table/alignTableCell.js +57 -57
  81. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  82. package/lib/modelApi/table/canMergeCells.d.ts +5 -5
  83. package/lib/modelApi/table/canMergeCells.js +56 -56
  84. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  85. package/lib/modelApi/table/clearSelectedCells.d.ts +7 -7
  86. package/lib/modelApi/table/clearSelectedCells.js +29 -29
  87. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  88. package/lib/modelApi/table/createTableStructure.d.ts +5 -5
  89. package/lib/modelApi/table/createTableStructure.js +19 -19
  90. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  91. package/lib/modelApi/table/deleteTable.d.ts +5 -5
  92. package/lib/modelApi/table/deleteTable.js +10 -10
  93. package/lib/modelApi/table/deleteTable.js.map +1 -1
  94. package/lib/modelApi/table/deleteTableColumn.d.ts +5 -5
  95. package/lib/modelApi/table/deleteTableColumn.js +24 -24
  96. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  97. package/lib/modelApi/table/deleteTableRow.d.ts +5 -5
  98. package/lib/modelApi/table/deleteTableRow.js +23 -23
  99. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  100. package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  101. package/lib/modelApi/table/ensureFocusableParagraphForTable.js +56 -56
  102. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  103. package/lib/modelApi/table/insertTableColumn.d.ts +7 -7
  104. package/lib/modelApi/table/insertTableColumn.js +27 -27
  105. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  106. package/lib/modelApi/table/insertTableRow.d.ts +7 -7
  107. package/lib/modelApi/table/insertTableRow.js +31 -31
  108. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  109. package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
  110. package/lib/modelApi/table/mergeTableCells.js +25 -25
  111. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  112. package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
  113. package/lib/modelApi/table/mergeTableColumn.js +35 -35
  114. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  115. package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
  116. package/lib/modelApi/table/mergeTableRow.js +35 -35
  117. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  118. package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  119. package/lib/modelApi/table/splitTableCellHorizontally.js +54 -54
  120. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  121. package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -5
  122. package/lib/modelApi/table/splitTableCellVertically.js +53 -53
  123. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  124. package/lib/publicApi/block/setAlignment.d.ts +7 -7
  125. package/lib/publicApi/block/setAlignment.js +16 -16
  126. package/lib/publicApi/block/setAlignment.js.map +1 -1
  127. package/lib/publicApi/block/setDirection.d.ts +7 -7
  128. package/lib/publicApi/block/setDirection.js +16 -16
  129. package/lib/publicApi/block/setDirection.js.map +1 -1
  130. package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
  131. package/lib/publicApi/block/setHeadingLevel.js +50 -50
  132. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  133. package/lib/publicApi/block/setIndentation.d.ts +8 -8
  134. package/lib/publicApi/block/setIndentation.js +21 -25
  135. package/lib/publicApi/block/setIndentation.js.map +1 -1
  136. package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
  137. package/lib/publicApi/block/setParagraphMargin.js +33 -33
  138. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  139. package/lib/publicApi/block/setSpacing.d.ts +7 -7
  140. package/lib/publicApi/block/setSpacing.js +21 -21
  141. package/lib/publicApi/block/setSpacing.js.map +1 -1
  142. package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
  143. package/lib/publicApi/block/toggleBlockQuote.js +39 -39
  144. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  145. package/lib/publicApi/entity/insertEntity.d.ts +25 -25
  146. package/lib/publicApi/entity/insertEntity.js +67 -67
  147. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  148. package/lib/publicApi/format/clearFormat.d.ts +6 -6
  149. package/lib/publicApi/format/clearFormat.js +34 -34
  150. package/lib/publicApi/format/clearFormat.js.map +1 -1
  151. package/lib/publicApi/format/getFormatState.d.ts +7 -7
  152. package/lib/publicApi/format/getFormatState.js +31 -31
  153. package/lib/publicApi/format/getFormatState.js.map +1 -1
  154. package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
  155. package/lib/publicApi/image/adjustImageSelection.js +29 -29
  156. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  157. package/lib/publicApi/image/changeImage.d.ts +7 -7
  158. package/lib/publicApi/image/changeImage.js +35 -35
  159. package/lib/publicApi/image/changeImage.js.map +1 -1
  160. package/lib/publicApi/image/insertImage.d.ts +7 -7
  161. package/lib/publicApi/image/insertImage.js +38 -38
  162. package/lib/publicApi/image/insertImage.js.map +1 -1
  163. package/lib/publicApi/image/setImageAltText.d.ts +8 -8
  164. package/lib/publicApi/image/setImageAltText.js +17 -17
  165. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  166. package/lib/publicApi/image/setImageBorder.d.ts +9 -9
  167. package/lib/publicApi/image/setImageBorder.js +19 -19
  168. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  169. package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
  170. package/lib/publicApi/image/setImageBoxShadow.js +29 -29
  171. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  172. package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
  173. package/lib/publicApi/link/adjustLinkSelection.js +34 -34
  174. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  175. package/lib/publicApi/link/insertLink.d.ts +15 -15
  176. package/lib/publicApi/link/insertLink.js +120 -120
  177. package/lib/publicApi/link/insertLink.js.map +1 -1
  178. package/lib/publicApi/link/removeLink.d.ts +8 -8
  179. package/lib/publicApi/link/removeLink.js +32 -32
  180. package/lib/publicApi/link/removeLink.js.map +1 -1
  181. package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
  182. package/lib/publicApi/list/setListStartNumber.js +18 -18
  183. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  184. package/lib/publicApi/list/setListStyle.d.ts +7 -7
  185. package/lib/publicApi/list/setListStyle.js +18 -18
  186. package/lib/publicApi/list/setListStyle.js.map +1 -1
  187. package/lib/publicApi/list/toggleBullet.d.ts +9 -9
  188. package/lib/publicApi/list/toggleBullet.js +22 -22
  189. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  190. package/lib/publicApi/list/toggleNumbering.d.ts +9 -9
  191. package/lib/publicApi/list/toggleNumbering.js +22 -22
  192. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  193. package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
  194. package/lib/publicApi/segment/applySegmentFormat.js +23 -23
  195. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  196. package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
  197. package/lib/publicApi/segment/changeCapitalization.js +49 -49
  198. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  199. package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
  200. package/lib/publicApi/segment/changeFontSize.js +63 -63
  201. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  202. package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -7
  203. package/lib/publicApi/segment/setBackgroundColor.js +35 -35
  204. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  205. package/lib/publicApi/segment/setFontName.d.ts +7 -7
  206. package/lib/publicApi/segment/setFontName.js +19 -19
  207. package/lib/publicApi/segment/setFontName.js.map +1 -1
  208. package/lib/publicApi/segment/setFontSize.d.ts +12 -12
  209. package/lib/publicApi/segment/setFontSize.js +33 -33
  210. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  211. package/lib/publicApi/segment/setTextColor.d.ts +7 -7
  212. package/lib/publicApi/segment/setTextColor.js +26 -26
  213. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  214. package/lib/publicApi/segment/splitTextSegment.d.ts +10 -10
  215. package/lib/publicApi/segment/splitTextSegment.js +30 -30
  216. package/lib/publicApi/segment/splitTextSegment.js.map +1 -1
  217. package/lib/publicApi/segment/toggleBold.d.ts +6 -6
  218. package/lib/publicApi/segment/toggleBold.js +27 -27
  219. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  220. package/lib/publicApi/segment/toggleCode.d.ts +6 -6
  221. package/lib/publicApi/segment/toggleCode.js +28 -28
  222. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  223. package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
  224. package/lib/publicApi/segment/toggleItalic.js +21 -21
  225. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  226. package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  227. package/lib/publicApi/segment/toggleStrikethrough.js +15 -15
  228. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  229. package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
  230. package/lib/publicApi/segment/toggleSubscript.js +15 -15
  231. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  232. package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
  233. package/lib/publicApi/segment/toggleSuperscript.js +15 -15
  234. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  235. package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
  236. package/lib/publicApi/segment/toggleUnderline.js +24 -24
  237. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  238. package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  239. package/lib/publicApi/table/applyTableBorderFormat.js +297 -297
  240. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  241. package/lib/publicApi/table/editTable.d.ts +7 -7
  242. package/lib/publicApi/table/editTable.js +95 -95
  243. package/lib/publicApi/table/editTable.js.map +1 -1
  244. package/lib/publicApi/table/formatTable.d.ts +8 -8
  245. package/lib/publicApi/table/formatTable.js +38 -38
  246. package/lib/publicApi/table/formatTable.js.map +1 -1
  247. package/lib/publicApi/table/insertTable.d.ts +12 -11
  248. package/lib/publicApi/table/insertTable.js +76 -52
  249. package/lib/publicApi/table/insertTable.js.map +1 -1
  250. package/lib/publicApi/table/setTableCellShade.d.ts +7 -7
  251. package/lib/publicApi/table/setTableCellShade.js +32 -32
  252. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  253. package/lib/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  254. package/lib/publicApi/utils/createEditorContextForEntity.js +29 -29
  255. package/lib/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  256. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  257. package/lib/publicApi/utils/formatImageWithContentModel.js +18 -18
  258. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  259. package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  260. package/lib/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
  261. package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  262. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  263. package/lib/publicApi/utils/formatParagraphWithContentModel.js +23 -23
  264. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  265. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  266. package/lib/publicApi/utils/formatSegmentWithContentModel.js +117 -114
  267. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  268. package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  269. package/lib/publicApi/utils/formatTableWithContentModel.js +46 -46
  270. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  271. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  272. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +34 -34
  273. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  274. package/lib-amd/index.d.ts +63 -63
  275. package/lib-amd/index.js +69 -69
  276. package/lib-amd/index.js.map +1 -1
  277. package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -5
  278. package/lib-amd/modelApi/block/setModelAlignment.js +64 -64
  279. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  280. package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -5
  281. package/lib-amd/modelApi/block/setModelDirection.js +112 -108
  282. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  283. package/lib-amd/modelApi/block/setModelIndentation.d.ts +8 -8
  284. package/lib-amd/modelApi/block/setModelIndentation.js +154 -148
  285. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  286. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  287. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js +71 -71
  288. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  289. package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  290. package/lib-amd/modelApi/block/toggleModelBlockQuote.js +52 -52
  291. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  292. package/lib-amd/modelApi/common/adjustIndentation.d.ts +13 -13
  293. package/lib-amd/modelApi/common/adjustIndentation.js +114 -114
  294. package/lib-amd/modelApi/common/adjustIndentation.js.map +1 -1
  295. package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
  296. package/lib-amd/modelApi/common/clearModelFormat.js +142 -142
  297. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  298. package/lib-amd/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  299. package/lib-amd/modelApi/common/queryContentModelBlocks.js +87 -87
  300. package/lib-amd/modelApi/common/queryContentModelBlocks.js.map +1 -1
  301. package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  302. package/lib-amd/modelApi/common/reducedModelChildProcessor.js +63 -63
  303. package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  304. package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
  305. package/lib-amd/modelApi/common/wrapBlock.js +52 -52
  306. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  307. package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -5
  308. package/lib-amd/modelApi/entity/insertEntityModel.js +105 -105
  309. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  310. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  311. package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -58
  312. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  313. package/lib-amd/modelApi/link/getLinkUrl.d.ts +5 -5
  314. package/lib-amd/modelApi/link/getLinkUrl.js +29 -29
  315. package/lib-amd/modelApi/link/getLinkUrl.js.map +1 -1
  316. package/lib-amd/modelApi/link/matchLink.d.ts +12 -12
  317. package/lib-amd/modelApi/link/matchLink.js +93 -93
  318. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  319. package/lib-amd/modelApi/link/promoteLink.d.ts +20 -20
  320. package/lib-amd/modelApi/link/promoteLink.js +54 -54
  321. package/lib-amd/modelApi/link/promoteLink.js.map +1 -1
  322. package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  323. package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -115
  324. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  325. package/lib-amd/modelApi/list/getListAnnounceData.d.ts +7 -7
  326. package/lib-amd/modelApi/list/getListAnnounceData.js +68 -68
  327. package/lib-amd/modelApi/list/getListAnnounceData.js.map +1 -1
  328. package/lib-amd/modelApi/list/setListType.d.ts +8 -8
  329. package/lib-amd/modelApi/list/setListType.js +116 -115
  330. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  331. package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -7
  332. package/lib-amd/modelApi/list/setModelListStartNumber.js +22 -22
  333. package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -1
  334. package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -7
  335. package/lib-amd/modelApi/list/setModelListStyle.js +25 -25
  336. package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -1
  337. package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  338. package/lib-amd/modelApi/selection/adjustSegmentSelection.js +48 -48
  339. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  340. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  341. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
  342. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  343. package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +8 -8
  344. package/lib-amd/modelApi/selection/adjustWordSelection.js +123 -123
  345. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  346. package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +5 -5
  347. package/lib-amd/modelApi/selection/collapseTableSelection.js +17 -17
  348. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  349. package/lib-amd/modelApi/table/alignTable.d.ts +5 -5
  350. package/lib-amd/modelApi/table/alignTable.js +13 -13
  351. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  352. package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -9
  353. package/lib-amd/modelApi/table/alignTableCell.js +58 -58
  354. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  355. package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -5
  356. package/lib-amd/modelApi/table/canMergeCells.js +58 -58
  357. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  358. package/lib-amd/modelApi/table/clearSelectedCells.d.ts +7 -7
  359. package/lib-amd/modelApi/table/clearSelectedCells.js +30 -30
  360. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  361. package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -5
  362. package/lib-amd/modelApi/table/createTableStructure.js +20 -20
  363. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  364. package/lib-amd/modelApi/table/deleteTable.d.ts +5 -5
  365. package/lib-amd/modelApi/table/deleteTable.js +12 -12
  366. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  367. package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -5
  368. package/lib-amd/modelApi/table/deleteTableColumn.js +24 -24
  369. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  370. package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -5
  371. package/lib-amd/modelApi/table/deleteTableRow.js +23 -23
  372. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  373. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  374. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +57 -57
  375. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  376. package/lib-amd/modelApi/table/insertTableColumn.d.ts +7 -7
  377. package/lib-amd/modelApi/table/insertTableColumn.js +27 -27
  378. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  379. package/lib-amd/modelApi/table/insertTableRow.d.ts +7 -7
  380. package/lib-amd/modelApi/table/insertTableRow.js +30 -30
  381. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  382. package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -5
  383. package/lib-amd/modelApi/table/mergeTableCells.js +25 -25
  384. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  385. package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -5
  386. package/lib-amd/modelApi/table/mergeTableColumn.js +35 -35
  387. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  388. package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -5
  389. package/lib-amd/modelApi/table/mergeTableRow.js +35 -35
  390. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  391. package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  392. package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -54
  393. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  394. package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -5
  395. package/lib-amd/modelApi/table/splitTableCellVertically.js +53 -53
  396. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  397. package/lib-amd/publicApi/block/setAlignment.d.ts +7 -7
  398. package/lib-amd/publicApi/block/setAlignment.js +17 -17
  399. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  400. package/lib-amd/publicApi/block/setDirection.d.ts +7 -7
  401. package/lib-amd/publicApi/block/setDirection.js +17 -17
  402. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  403. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -7
  404. package/lib-amd/publicApi/block/setHeadingLevel.js +51 -51
  405. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  406. package/lib-amd/publicApi/block/setIndentation.d.ts +8 -8
  407. package/lib-amd/publicApi/block/setIndentation.js +22 -25
  408. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  409. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -9
  410. package/lib-amd/publicApi/block/setParagraphMargin.js +33 -33
  411. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  412. package/lib-amd/publicApi/block/setSpacing.d.ts +7 -7
  413. package/lib-amd/publicApi/block/setSpacing.js +22 -22
  414. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  415. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -9
  416. package/lib-amd/publicApi/block/toggleBlockQuote.js +39 -39
  417. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  418. package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -25
  419. package/lib-amd/publicApi/entity/insertEntity.js +66 -66
  420. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  421. package/lib-amd/publicApi/format/clearFormat.d.ts +6 -6
  422. package/lib-amd/publicApi/format/clearFormat.js +34 -34
  423. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  424. package/lib-amd/publicApi/format/getFormatState.d.ts +7 -7
  425. package/lib-amd/publicApi/format/getFormatState.js +31 -31
  426. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  427. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -6
  428. package/lib-amd/publicApi/image/adjustImageSelection.js +29 -29
  429. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  430. package/lib-amd/publicApi/image/changeImage.d.ts +7 -7
  431. package/lib-amd/publicApi/image/changeImage.js +35 -35
  432. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  433. package/lib-amd/publicApi/image/insertImage.d.ts +7 -7
  434. package/lib-amd/publicApi/image/insertImage.js +39 -39
  435. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  436. package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -8
  437. package/lib-amd/publicApi/image/setImageAltText.js +18 -18
  438. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  439. package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -9
  440. package/lib-amd/publicApi/image/setImageBorder.js +19 -19
  441. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  442. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -8
  443. package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -30
  444. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  445. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -6
  446. package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -33
  447. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  448. package/lib-amd/publicApi/link/insertLink.d.ts +15 -15
  449. package/lib-amd/publicApi/link/insertLink.js +118 -118
  450. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  451. package/lib-amd/publicApi/link/removeLink.d.ts +8 -8
  452. package/lib-amd/publicApi/link/removeLink.js +32 -32
  453. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  454. package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -7
  455. package/lib-amd/publicApi/list/setListStartNumber.js +19 -19
  456. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  457. package/lib-amd/publicApi/list/setListStyle.d.ts +7 -7
  458. package/lib-amd/publicApi/list/setListStyle.js +19 -19
  459. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  460. package/lib-amd/publicApi/list/toggleBullet.d.ts +9 -9
  461. package/lib-amd/publicApi/list/toggleBullet.js +23 -23
  462. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  463. package/lib-amd/publicApi/list/toggleNumbering.d.ts +9 -9
  464. package/lib-amd/publicApi/list/toggleNumbering.js +23 -23
  465. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  466. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -7
  467. package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -24
  468. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  469. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -10
  470. package/lib-amd/publicApi/segment/changeCapitalization.js +50 -50
  471. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  472. package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -8
  473. package/lib-amd/publicApi/segment/changeFontSize.js +62 -62
  474. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  475. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -7
  476. package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -35
  477. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  478. package/lib-amd/publicApi/segment/setFontName.d.ts +7 -7
  479. package/lib-amd/publicApi/segment/setFontName.js +20 -20
  480. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  481. package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -12
  482. package/lib-amd/publicApi/segment/setFontSize.js +34 -34
  483. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  484. package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -7
  485. package/lib-amd/publicApi/segment/setTextColor.js +27 -27
  486. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  487. package/lib-amd/publicApi/segment/splitTextSegment.d.ts +10 -10
  488. package/lib-amd/publicApi/segment/splitTextSegment.js +30 -30
  489. package/lib-amd/publicApi/segment/splitTextSegment.js.map +1 -1
  490. package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
  491. package/lib-amd/publicApi/segment/toggleBold.js +27 -27
  492. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  493. package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -6
  494. package/lib-amd/publicApi/segment/toggleCode.js +28 -28
  495. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  496. package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -6
  497. package/lib-amd/publicApi/segment/toggleItalic.js +22 -22
  498. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  499. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  500. package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -16
  501. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  502. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -6
  503. package/lib-amd/publicApi/segment/toggleSubscript.js +16 -16
  504. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  505. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -6
  506. package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -16
  507. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  508. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -6
  509. package/lib-amd/publicApi/segment/toggleUnderline.js +25 -25
  510. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  511. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  512. package/lib-amd/publicApi/table/applyTableBorderFormat.js +297 -297
  513. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  514. package/lib-amd/publicApi/table/editTable.d.ts +7 -7
  515. package/lib-amd/publicApi/table/editTable.js +84 -84
  516. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  517. package/lib-amd/publicApi/table/formatTable.d.ts +8 -8
  518. package/lib-amd/publicApi/table/formatTable.js +38 -38
  519. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  520. package/lib-amd/publicApi/table/insertTable.d.ts +12 -11
  521. package/lib-amd/publicApi/table/insertTable.js +74 -50
  522. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  523. package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -7
  524. package/lib-amd/publicApi/table/setTableCellShade.js +32 -32
  525. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  526. package/lib-amd/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  527. package/lib-amd/publicApi/utils/createEditorContextForEntity.js +30 -30
  528. package/lib-amd/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  529. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  530. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +19 -19
  531. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  532. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  533. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
  534. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  535. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  536. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +23 -23
  537. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  538. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  539. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +115 -112
  540. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  541. package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  542. package/lib-amd/publicApi/utils/formatTableWithContentModel.js +45 -45
  543. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  544. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  545. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +35 -35
  546. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  547. package/lib-mjs/index.d.ts +63 -63
  548. package/lib-mjs/index.js +63 -63
  549. package/lib-mjs/index.js.map +1 -1
  550. package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -5
  551. package/lib-mjs/modelApi/block/setModelAlignment.js +61 -61
  552. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  553. package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -5
  554. package/lib-mjs/modelApi/block/setModelDirection.js +109 -105
  555. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  556. package/lib-mjs/modelApi/block/setModelIndentation.d.ts +8 -8
  557. package/lib-mjs/modelApi/block/setModelIndentation.js +154 -148
  558. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  559. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  560. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js +67 -67
  561. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  562. package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  563. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +49 -49
  564. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  565. package/lib-mjs/modelApi/common/adjustIndentation.d.ts +13 -13
  566. package/lib-mjs/modelApi/common/adjustIndentation.js +109 -109
  567. package/lib-mjs/modelApi/common/adjustIndentation.js.map +1 -1
  568. package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
  569. package/lib-mjs/modelApi/common/clearModelFormat.js +139 -139
  570. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  571. package/lib-mjs/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  572. package/lib-mjs/modelApi/common/queryContentModelBlocks.js +83 -83
  573. package/lib-mjs/modelApi/common/queryContentModelBlocks.js.map +1 -1
  574. package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  575. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +59 -59
  576. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  577. package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
  578. package/lib-mjs/modelApi/common/wrapBlock.js +47 -47
  579. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  580. package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -5
  581. package/lib-mjs/modelApi/entity/insertEntityModel.js +101 -101
  582. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  583. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  584. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +53 -53
  585. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  586. package/lib-mjs/modelApi/link/getLinkUrl.d.ts +5 -5
  587. package/lib-mjs/modelApi/link/getLinkUrl.js +24 -24
  588. package/lib-mjs/modelApi/link/getLinkUrl.js.map +1 -1
  589. package/lib-mjs/modelApi/link/matchLink.d.ts +12 -12
  590. package/lib-mjs/modelApi/link/matchLink.js +89 -89
  591. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  592. package/lib-mjs/modelApi/link/promoteLink.d.ts +20 -20
  593. package/lib-mjs/modelApi/link/promoteLink.js +49 -49
  594. package/lib-mjs/modelApi/link/promoteLink.js.map +1 -1
  595. package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  596. package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -109
  597. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  598. package/lib-mjs/modelApi/list/getListAnnounceData.d.ts +7 -7
  599. package/lib-mjs/modelApi/list/getListAnnounceData.js +64 -64
  600. package/lib-mjs/modelApi/list/getListAnnounceData.js.map +1 -1
  601. package/lib-mjs/modelApi/list/setListType.d.ts +8 -8
  602. package/lib-mjs/modelApi/list/setListType.js +113 -112
  603. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  604. package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -7
  605. package/lib-mjs/modelApi/list/setModelListStartNumber.js +17 -17
  606. package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -1
  607. package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -7
  608. package/lib-mjs/modelApi/list/setModelListStyle.js +21 -21
  609. package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -1
  610. package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  611. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +43 -43
  612. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  613. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  614. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +52 -52
  615. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  616. package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +8 -8
  617. package/lib-mjs/modelApi/selection/adjustWordSelection.js +119 -119
  618. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  619. package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +5 -5
  620. package/lib-mjs/modelApi/selection/collapseTableSelection.js +12 -12
  621. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  622. package/lib-mjs/modelApi/table/alignTable.d.ts +5 -5
  623. package/lib-mjs/modelApi/table/alignTable.js +7 -7
  624. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  625. package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -9
  626. package/lib-mjs/modelApi/table/alignTableCell.js +52 -52
  627. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  628. package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -5
  629. package/lib-mjs/modelApi/table/canMergeCells.js +52 -52
  630. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  631. package/lib-mjs/modelApi/table/clearSelectedCells.d.ts +7 -7
  632. package/lib-mjs/modelApi/table/clearSelectedCells.js +25 -25
  633. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  634. package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -5
  635. package/lib-mjs/modelApi/table/createTableStructure.js +15 -15
  636. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  637. package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -5
  638. package/lib-mjs/modelApi/table/deleteTable.js +6 -6
  639. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  640. package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -5
  641. package/lib-mjs/modelApi/table/deleteTableColumn.js +20 -20
  642. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  643. package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -5
  644. package/lib-mjs/modelApi/table/deleteTableRow.js +19 -19
  645. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  646. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  647. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +52 -52
  648. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  649. package/lib-mjs/modelApi/table/insertTableColumn.d.ts +7 -7
  650. package/lib-mjs/modelApi/table/insertTableColumn.js +23 -23
  651. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  652. package/lib-mjs/modelApi/table/insertTableRow.d.ts +7 -7
  653. package/lib-mjs/modelApi/table/insertTableRow.js +27 -27
  654. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  655. package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -5
  656. package/lib-mjs/modelApi/table/mergeTableCells.js +21 -21
  657. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  658. package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -5
  659. package/lib-mjs/modelApi/table/mergeTableColumn.js +31 -31
  660. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  661. package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -5
  662. package/lib-mjs/modelApi/table/mergeTableRow.js +31 -31
  663. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  664. package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  665. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +50 -50
  666. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  667. package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -5
  668. package/lib-mjs/modelApi/table/splitTableCellVertically.js +49 -49
  669. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  670. package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -7
  671. package/lib-mjs/publicApi/block/setAlignment.js +12 -12
  672. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  673. package/lib-mjs/publicApi/block/setDirection.d.ts +7 -7
  674. package/lib-mjs/publicApi/block/setDirection.js +12 -12
  675. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  676. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -7
  677. package/lib-mjs/publicApi/block/setHeadingLevel.js +46 -46
  678. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  679. package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -8
  680. package/lib-mjs/publicApi/block/setIndentation.js +17 -21
  681. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  682. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -9
  683. package/lib-mjs/publicApi/block/setParagraphMargin.js +29 -29
  684. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  685. package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -7
  686. package/lib-mjs/publicApi/block/setSpacing.js +17 -17
  687. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  688. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -9
  689. package/lib-mjs/publicApi/block/toggleBlockQuote.js +35 -35
  690. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  691. package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -25
  692. package/lib-mjs/publicApi/entity/insertEntity.js +63 -63
  693. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  694. package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -6
  695. package/lib-mjs/publicApi/format/clearFormat.js +30 -30
  696. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  697. package/lib-mjs/publicApi/format/getFormatState.d.ts +7 -7
  698. package/lib-mjs/publicApi/format/getFormatState.js +27 -27
  699. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  700. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -6
  701. package/lib-mjs/publicApi/image/adjustImageSelection.js +25 -25
  702. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  703. package/lib-mjs/publicApi/image/changeImage.d.ts +7 -7
  704. package/lib-mjs/publicApi/image/changeImage.js +31 -31
  705. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  706. package/lib-mjs/publicApi/image/insertImage.d.ts +7 -7
  707. package/lib-mjs/publicApi/image/insertImage.js +34 -34
  708. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  709. package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -8
  710. package/lib-mjs/publicApi/image/setImageAltText.js +13 -13
  711. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  712. package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -9
  713. package/lib-mjs/publicApi/image/setImageBorder.js +15 -15
  714. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  715. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -8
  716. package/lib-mjs/publicApi/image/setImageBoxShadow.js +25 -25
  717. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  718. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -6
  719. package/lib-mjs/publicApi/link/adjustLinkSelection.js +30 -30
  720. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  721. package/lib-mjs/publicApi/link/insertLink.d.ts +15 -15
  722. package/lib-mjs/publicApi/link/insertLink.js +116 -116
  723. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  724. package/lib-mjs/publicApi/link/removeLink.d.ts +8 -8
  725. package/lib-mjs/publicApi/link/removeLink.js +28 -28
  726. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  727. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -7
  728. package/lib-mjs/publicApi/list/setListStartNumber.js +14 -14
  729. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  730. package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -7
  731. package/lib-mjs/publicApi/list/setListStyle.js +14 -14
  732. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  733. package/lib-mjs/publicApi/list/toggleBullet.d.ts +9 -9
  734. package/lib-mjs/publicApi/list/toggleBullet.js +18 -18
  735. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  736. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +9 -9
  737. package/lib-mjs/publicApi/list/toggleNumbering.js +18 -18
  738. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  739. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -7
  740. package/lib-mjs/publicApi/segment/applySegmentFormat.js +19 -19
  741. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  742. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -10
  743. package/lib-mjs/publicApi/segment/changeCapitalization.js +45 -45
  744. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  745. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -8
  746. package/lib-mjs/publicApi/segment/changeFontSize.js +59 -59
  747. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  748. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -7
  749. package/lib-mjs/publicApi/segment/setBackgroundColor.js +31 -31
  750. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  751. package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -7
  752. package/lib-mjs/publicApi/segment/setFontName.js +15 -15
  753. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  754. package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -12
  755. package/lib-mjs/publicApi/segment/setFontSize.js +28 -28
  756. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  757. package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -7
  758. package/lib-mjs/publicApi/segment/setTextColor.js +22 -22
  759. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  760. package/lib-mjs/publicApi/segment/splitTextSegment.d.ts +10 -10
  761. package/lib-mjs/publicApi/segment/splitTextSegment.js +26 -26
  762. package/lib-mjs/publicApi/segment/splitTextSegment.js.map +1 -1
  763. package/lib-mjs/publicApi/segment/toggleBold.d.ts +6 -6
  764. package/lib-mjs/publicApi/segment/toggleBold.js +23 -23
  765. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  766. package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -6
  767. package/lib-mjs/publicApi/segment/toggleCode.js +24 -24
  768. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  769. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -6
  770. package/lib-mjs/publicApi/segment/toggleItalic.js +17 -17
  771. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  772. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  773. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +11 -11
  774. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  775. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -6
  776. package/lib-mjs/publicApi/segment/toggleSubscript.js +11 -11
  777. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  778. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -6
  779. package/lib-mjs/publicApi/segment/toggleSuperscript.js +11 -11
  780. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  781. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -6
  782. package/lib-mjs/publicApi/segment/toggleUnderline.js +20 -20
  783. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  784. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  785. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +293 -293
  786. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  787. package/lib-mjs/publicApi/table/editTable.d.ts +7 -7
  788. package/lib-mjs/publicApi/table/editTable.js +91 -91
  789. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  790. package/lib-mjs/publicApi/table/formatTable.d.ts +8 -8
  791. package/lib-mjs/publicApi/table/formatTable.js +34 -34
  792. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  793. package/lib-mjs/publicApi/table/insertTable.d.ts +12 -11
  794. package/lib-mjs/publicApi/table/insertTable.js +72 -48
  795. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  796. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -7
  797. package/lib-mjs/publicApi/table/setTableCellShade.js +28 -28
  798. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  799. package/lib-mjs/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  800. package/lib-mjs/publicApi/utils/createEditorContextForEntity.js +25 -25
  801. package/lib-mjs/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  802. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  803. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +14 -14
  804. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  805. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  806. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +126 -126
  807. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  808. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  809. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +19 -19
  810. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  811. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  812. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +113 -110
  813. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  814. package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  815. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +42 -42
  816. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  817. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  818. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +30 -30
  819. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  820. package/package.json +3 -3
@@ -1,67 +1,67 @@
1
- define(["require", "exports", "../utils/formatInsertPointWithContentModel", "../../modelApi/entity/insertEntityModel", "roosterjs-content-model-dom"], function (require, exports, formatInsertPointWithContentModel_1, insertEntityModel_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.insertEntity = void 0;
5
- var BlockEntityTag = 'div';
6
- var InlineEntityTag = 'span';
7
- function insertEntity(editor, type, isBlock, position, options) {
8
- var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
9
- var document = editor.getDocument();
10
- var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
11
- var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
12
- wrapper.style.setProperty('display', display || null);
13
- if (display == undefined && isBlock) {
14
- wrapper.style.setProperty('width', '100%');
15
- wrapper.style.setProperty('display', 'inline-block');
16
- }
17
- if (contentNode) {
18
- wrapper.appendChild(contentNode);
19
- }
20
- var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
21
- if (!skipUndoSnapshot) {
22
- editor.takeSnapshot();
23
- }
24
- var formatOptions = {
25
- changeSource: roosterjs_content_model_dom_1.ChangeSource.InsertEntity,
26
- getChangeData: function () { return ({
27
- wrapper: wrapper,
28
- type: type,
29
- id: '',
30
- isReadonly: true,
31
- }); },
32
- apiName: 'insertEntity',
33
- };
34
- var callback = function (model, context, insertPoint) {
35
- (0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context, insertPoint);
36
- (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
37
- context.skipUndoSnapshot = true;
38
- context.newEntities.push(entityModel);
39
- return true;
40
- };
41
- if (typeof position == 'object') {
42
- (0, formatInsertPointWithContentModel_1.formatInsertPointWithContentModel)(editor, position, callback, formatOptions);
43
- }
44
- else {
45
- editor.formatContentModel(callback, formatOptions);
46
- }
47
- if (!skipUndoSnapshot) {
48
- var entityState = void 0;
49
- if (initialEntityState) {
50
- var format = (0, roosterjs_content_model_dom_1.parseEntityFormat)(wrapper);
51
- var id = format.id, entityType = format.entityType;
52
- entityState =
53
- id && entityType
54
- ? {
55
- id: id,
56
- type: entityType,
57
- state: initialEntityState,
58
- }
59
- : undefined;
60
- }
61
- editor.takeSnapshot(entityState);
62
- }
63
- return entityModel;
64
- }
65
- exports.insertEntity = insertEntity;
66
- });
1
+ define(["require", "exports", "../utils/formatInsertPointWithContentModel", "../../modelApi/entity/insertEntityModel", "roosterjs-content-model-dom"], function (require, exports, formatInsertPointWithContentModel_1, insertEntityModel_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.insertEntity = void 0;
5
+ var BlockEntityTag = 'div';
6
+ var InlineEntityTag = 'span';
7
+ function insertEntity(editor, type, isBlock, position, options) {
8
+ var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot, initialEntityState = _a.initialEntityState;
9
+ var document = editor.getDocument();
10
+ var wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);
11
+ var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
12
+ wrapper.style.setProperty('display', display || null);
13
+ if (display == undefined && isBlock) {
14
+ wrapper.style.setProperty('width', '100%');
15
+ wrapper.style.setProperty('display', 'inline-block');
16
+ }
17
+ if (contentNode) {
18
+ wrapper.appendChild(contentNode);
19
+ }
20
+ var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /* isReadonly */, undefined /*format*/, type);
21
+ if (!skipUndoSnapshot) {
22
+ editor.takeSnapshot();
23
+ }
24
+ var formatOptions = {
25
+ changeSource: roosterjs_content_model_dom_1.ChangeSource.InsertEntity,
26
+ getChangeData: function () { return ({
27
+ wrapper: wrapper,
28
+ type: type,
29
+ id: '',
30
+ isReadonly: true,
31
+ }); },
32
+ apiName: 'insertEntity',
33
+ };
34
+ var callback = function (model, context, insertPoint) {
35
+ (0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context, insertPoint);
36
+ (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
37
+ context.skipUndoSnapshot = true;
38
+ context.newEntities.push(entityModel);
39
+ return true;
40
+ };
41
+ if (typeof position == 'object') {
42
+ (0, formatInsertPointWithContentModel_1.formatInsertPointWithContentModel)(editor, position, callback, formatOptions);
43
+ }
44
+ else {
45
+ editor.formatContentModel(callback, formatOptions);
46
+ }
47
+ if (!skipUndoSnapshot) {
48
+ var entityState = void 0;
49
+ if (initialEntityState) {
50
+ var format = (0, roosterjs_content_model_dom_1.parseEntityFormat)(wrapper);
51
+ var id = format.id, entityType = format.entityType;
52
+ entityState =
53
+ id && entityType
54
+ ? {
55
+ id: id,
56
+ type: entityType,
57
+ state: initialEntityState,
58
+ }
59
+ : undefined;
60
+ }
61
+ editor.takeSnapshot(entityState);
62
+ }
63
+ return entityModel;
64
+ }
65
+ exports.insertEntity = insertEntity;
66
+ });
67
67
  //# sourceMappingURL=insertEntity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\nimport {\n ChangeSource,\n createEntity,\n normalizeContentModel,\n parseEntityFormat,\n} from 'roosterjs-content-model-dom';\nimport type {\n ContentModelEntity,\n InsertEntityPosition,\n InsertEntityOptions,\n IEditor,\n EntityState,\n DOMInsertPoint,\n FormatContentModelOptions,\n FormatContentModelContext,\n InsertPoint,\n ShallowMutableContentModelDocument,\n} from 'roosterjs-content-model-types';\n\nconst BlockEntityTag = 'div';\nconst InlineEntityTag = 'span';\n\n/**\n * Insert an entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock True to insert a block entity, false to insert an inline entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position: 'focus' | 'begin' | 'end' | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\n/**\n * Insert a block entity into editor\n * @param editor The editor object\n * @param type Type of entity\n * @param isBlock Must be true for a block entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: true,\n position: InsertEntityPosition | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\nexport function insertEntity(\n editor: IEditor,\n type: string,\n isBlock: boolean,\n position?: InsertEntityPosition | DOMInsertPoint,\n options?: InsertEntityOptions\n): ContentModelEntity | null {\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot, initialEntityState } =\n options || {};\n const document = editor.getDocument();\n const wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\n\n wrapper.style.setProperty('display', display || null);\n\n if (display == undefined && isBlock) {\n wrapper.style.setProperty('width', '100%');\n wrapper.style.setProperty('display', 'inline-block');\n }\n\n if (contentNode) {\n wrapper.appendChild(contentNode);\n }\n\n const entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);\n\n if (!skipUndoSnapshot) {\n editor.takeSnapshot();\n }\n\n const formatOptions: FormatContentModelOptions = {\n changeSource: ChangeSource.InsertEntity,\n getChangeData: () => ({\n wrapper,\n type,\n id: '',\n isReadonly: true,\n }),\n apiName: 'insertEntity',\n };\n\n const callback = (\n model: ShallowMutableContentModelDocument,\n context: FormatContentModelContext,\n insertPoint?: InsertPoint\n ) => {\n insertEntityModel(\n model,\n entityModel,\n typeof position == 'string' ? position : 'focus',\n isBlock,\n focusAfterEntity,\n context,\n insertPoint\n );\n\n normalizeContentModel(model);\n\n context.skipUndoSnapshot = true;\n context.newEntities.push(entityModel);\n\n return true;\n };\n\n if (typeof position == 'object') {\n formatInsertPointWithContentModel(editor, position, callback, formatOptions);\n } else {\n editor.formatContentModel(callback, formatOptions);\n }\n\n if (!skipUndoSnapshot) {\n let entityState: EntityState | undefined;\n\n if (initialEntityState) {\n const format = parseEntityFormat(wrapper);\n const { id, entityType } = format;\n\n entityState =\n id && entityType\n ? {\n id: id,\n type: entityType,\n state: initialEntityState,\n }\n : undefined;\n }\n\n editor.takeSnapshot(entityState);\n }\n\n return entityModel;\n}\n"]}
1
+ {"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatInsertPointWithContentModel } from '../utils/formatInsertPointWithContentModel';\r\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\r\nimport {\r\n ChangeSource,\r\n createEntity,\r\n normalizeContentModel,\r\n parseEntityFormat,\r\n} from 'roosterjs-content-model-dom';\r\nimport type {\r\n ContentModelEntity,\r\n InsertEntityPosition,\r\n InsertEntityOptions,\r\n IEditor,\r\n EntityState,\r\n DOMInsertPoint,\r\n FormatContentModelOptions,\r\n FormatContentModelContext,\r\n InsertPoint,\r\n ShallowMutableContentModelDocument,\r\n} from 'roosterjs-content-model-types';\r\n\r\nconst BlockEntityTag = 'div';\r\nconst InlineEntityTag = 'span';\r\n\r\n/**\r\n * Insert an entity into editor\r\n * @param editor The editor object\r\n * @param type Type of entity\r\n * @param isBlock True to insert a block entity, false to insert an inline entity\r\n * @param position Position of the entity to insert. It can be\r\n * Value of InsertEntityPosition: see InsertEntityPosition\r\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\r\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\r\n * @param options Move options to insert. See InsertEntityOptions\r\n */\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: boolean,\r\n position: 'focus' | 'begin' | 'end' | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null;\r\n\r\n/**\r\n * Insert a block entity into editor\r\n * @param editor The editor object\r\n * @param type Type of entity\r\n * @param isBlock Must be true for a block entity\r\n * @param position Position of the entity to insert. It can be\r\n * Value of InsertEntityPosition: see InsertEntityPosition\r\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\r\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\r\n * @param options Move options to insert. See InsertEntityOptions\r\n */\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: true,\r\n position: InsertEntityPosition | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null;\r\n\r\nexport function insertEntity(\r\n editor: IEditor,\r\n type: string,\r\n isBlock: boolean,\r\n position?: InsertEntityPosition | DOMInsertPoint,\r\n options?: InsertEntityOptions\r\n): ContentModelEntity | null {\r\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot, initialEntityState } =\r\n options || {};\r\n const document = editor.getDocument();\r\n const wrapper = document.createElement(isBlock ? BlockEntityTag : InlineEntityTag);\r\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\r\n\r\n wrapper.style.setProperty('display', display || null);\r\n\r\n if (display == undefined && isBlock) {\r\n wrapper.style.setProperty('width', '100%');\r\n wrapper.style.setProperty('display', 'inline-block');\r\n }\r\n\r\n if (contentNode) {\r\n wrapper.appendChild(contentNode);\r\n }\r\n\r\n const entityModel = createEntity(wrapper, true /* isReadonly */, undefined /*format*/, type);\r\n\r\n if (!skipUndoSnapshot) {\r\n editor.takeSnapshot();\r\n }\r\n\r\n const formatOptions: FormatContentModelOptions = {\r\n changeSource: ChangeSource.InsertEntity,\r\n getChangeData: () => ({\r\n wrapper,\r\n type,\r\n id: '',\r\n isReadonly: true,\r\n }),\r\n apiName: 'insertEntity',\r\n };\r\n\r\n const callback = (\r\n model: ShallowMutableContentModelDocument,\r\n context: FormatContentModelContext,\r\n insertPoint?: InsertPoint\r\n ) => {\r\n insertEntityModel(\r\n model,\r\n entityModel,\r\n typeof position == 'string' ? position : 'focus',\r\n isBlock,\r\n focusAfterEntity,\r\n context,\r\n insertPoint\r\n );\r\n\r\n normalizeContentModel(model);\r\n\r\n context.skipUndoSnapshot = true;\r\n context.newEntities.push(entityModel);\r\n\r\n return true;\r\n };\r\n\r\n if (typeof position == 'object') {\r\n formatInsertPointWithContentModel(editor, position, callback, formatOptions);\r\n } else {\r\n editor.formatContentModel(callback, formatOptions);\r\n }\r\n\r\n if (!skipUndoSnapshot) {\r\n let entityState: EntityState | undefined;\r\n\r\n if (initialEntityState) {\r\n const format = parseEntityFormat(wrapper);\r\n const { id, entityType } = format;\r\n\r\n entityState =\r\n id && entityType\r\n ? {\r\n id: id,\r\n type: entityType,\r\n state: initialEntityState,\r\n }\r\n : undefined;\r\n }\r\n\r\n editor.takeSnapshot(entityState);\r\n }\r\n\r\n return entityModel;\r\n}\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { IEditor } from 'roosterjs-content-model-types';
2
- /**
3
- * Clear format of selection
4
- * @param editor The editor to clear format from
5
- */
6
- export declare function clearFormat(editor: IEditor): void;
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Clear format of selection
4
+ * @param editor The editor to clear format from
5
+ */
6
+ export declare function clearFormat(editor: IEditor): void;
@@ -1,35 +1,35 @@
1
- define(["require", "exports", "../../modelApi/common/clearModelFormat", "roosterjs-content-model-dom"], function (require, exports, clearModelFormat_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearFormat = void 0;
5
- var MAX_TRY = 3;
6
- /**
7
- * Clear format of selection
8
- * @param editor The editor to clear format from
9
- */
10
- function clearFormat(editor) {
11
- editor.focus();
12
- editor.formatContentModel(function (model) {
13
- var changed = false;
14
- var needtoRun = true;
15
- var triedTimes = 0;
16
- while (needtoRun && triedTimes++ < MAX_TRY) {
17
- var blocksToClear = [];
18
- var segmentsToClear = [];
19
- var tablesToClear = [];
20
- needtoRun = (0, clearModelFormat_1.clearModelFormat)(model, blocksToClear, segmentsToClear, tablesToClear);
21
- (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
22
- changed =
23
- changed ||
24
- blocksToClear.length > 0 ||
25
- segmentsToClear.length > 0 ||
26
- tablesToClear.length > 0;
27
- }
28
- return changed;
29
- }, {
30
- apiName: 'clearFormat',
31
- });
32
- }
33
- exports.clearFormat = clearFormat;
34
- });
1
+ define(["require", "exports", "../../modelApi/common/clearModelFormat", "roosterjs-content-model-dom"], function (require, exports, clearModelFormat_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.clearFormat = void 0;
5
+ var MAX_TRY = 3;
6
+ /**
7
+ * Clear format of selection
8
+ * @param editor The editor to clear format from
9
+ */
10
+ function clearFormat(editor) {
11
+ editor.focus();
12
+ editor.formatContentModel(function (model) {
13
+ var changed = false;
14
+ var needtoRun = true;
15
+ var triedTimes = 0;
16
+ while (needtoRun && triedTimes++ < MAX_TRY) {
17
+ var blocksToClear = [];
18
+ var segmentsToClear = [];
19
+ var tablesToClear = [];
20
+ needtoRun = (0, clearModelFormat_1.clearModelFormat)(model, blocksToClear, segmentsToClear, tablesToClear);
21
+ (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
22
+ changed =
23
+ changed ||
24
+ blocksToClear.length > 0 ||
25
+ segmentsToClear.length > 0 ||
26
+ tablesToClear.length > 0;
27
+ }
28
+ return changed;
29
+ }, {
30
+ apiName: 'clearFormat',
31
+ });
32
+ }
33
+ exports.clearFormat = clearFormat;
34
+ });
35
35
  //# sourceMappingURL=clearFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clearFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/clearFormat.ts"],"names":[],"mappings":";;;;IAUA,IAAM,OAAO,GAAG,CAAC,CAAC;IAElB;;;OAGG;IACH,SAAgB,WAAW,CAAC,MAAe;QACvC,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,SAAS,GAAG,IAAI,CAAC;YACrB,IAAI,UAAU,GAAG,CAAC,CAAC;YAEnB,OAAO,SAAS,IAAI,UAAU,EAAE,GAAG,OAAO,EAAE;gBACxC,IAAM,aAAa,GAAoD,EAAE,CAAC;gBAC1E,IAAM,eAAe,GAA0B,EAAE,CAAC;gBAClD,IAAM,aAAa,GAAmC,EAAE,CAAC;gBAEzD,SAAS,GAAG,IAAA,mCAAgB,EAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;gBAEnF,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;gBAE7B,OAAO;oBACH,OAAO;wBACP,aAAa,CAAC,MAAM,GAAG,CAAC;wBACxB,eAAe,CAAC,MAAM,GAAG,CAAC;wBAC1B,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;aAChC;YAED,OAAO,OAAO,CAAC;QACnB,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC;IA/BD,kCA+BC","sourcesContent":["import { clearModelFormat } from '../../modelApi/common/clearModelFormat';\nimport { normalizeContentModel } from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n ContentModelBlock,\n ContentModelBlockGroup,\n ContentModelSegment,\n ContentModelTable,\n} from 'roosterjs-content-model-types';\n\nconst MAX_TRY = 3;\n\n/**\n * Clear format of selection\n * @param editor The editor to clear format from\n */\nexport function clearFormat(editor: IEditor) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n let changed = false;\n let needtoRun = true;\n let triedTimes = 0;\n\n while (needtoRun && triedTimes++ < MAX_TRY) {\n const blocksToClear: [ContentModelBlockGroup[], ContentModelBlock][] = [];\n const segmentsToClear: ContentModelSegment[] = [];\n const tablesToClear: [ContentModelTable, boolean][] = [];\n\n needtoRun = clearModelFormat(model, blocksToClear, segmentsToClear, tablesToClear);\n\n normalizeContentModel(model);\n\n changed =\n changed ||\n blocksToClear.length > 0 ||\n segmentsToClear.length > 0 ||\n tablesToClear.length > 0;\n }\n\n return changed;\n },\n {\n apiName: 'clearFormat',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"clearFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/clearFormat.ts"],"names":[],"mappings":";;;;IAUA,IAAM,OAAO,GAAG,CAAC,CAAC;IAElB;;;OAGG;IACH,SAAgB,WAAW,CAAC,MAAe;QACvC,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,SAAS,GAAG,IAAI,CAAC;YACrB,IAAI,UAAU,GAAG,CAAC,CAAC;YAEnB,OAAO,SAAS,IAAI,UAAU,EAAE,GAAG,OAAO,EAAE;gBACxC,IAAM,aAAa,GAAoD,EAAE,CAAC;gBAC1E,IAAM,eAAe,GAA0B,EAAE,CAAC;gBAClD,IAAM,aAAa,GAAmC,EAAE,CAAC;gBAEzD,SAAS,GAAG,IAAA,mCAAgB,EAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;gBAEnF,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;gBAE7B,OAAO;oBACH,OAAO;wBACP,aAAa,CAAC,MAAM,GAAG,CAAC;wBACxB,eAAe,CAAC,MAAM,GAAG,CAAC;wBAC1B,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;aAChC;YAED,OAAO,OAAO,CAAC;QACnB,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC;IA/BD,kCA+BC","sourcesContent":["import { clearModelFormat } from '../../modelApi/common/clearModelFormat';\r\nimport { normalizeContentModel } from 'roosterjs-content-model-dom';\r\nimport type {\r\n IEditor,\r\n ContentModelBlock,\r\n ContentModelBlockGroup,\r\n ContentModelSegment,\r\n ContentModelTable,\r\n} from 'roosterjs-content-model-types';\r\n\r\nconst MAX_TRY = 3;\r\n\r\n/**\r\n * Clear format of selection\r\n * @param editor The editor to clear format from\r\n */\r\nexport function clearFormat(editor: IEditor) {\r\n editor.focus();\r\n\r\n editor.formatContentModel(\r\n model => {\r\n let changed = false;\r\n let needtoRun = true;\r\n let triedTimes = 0;\r\n\r\n while (needtoRun && triedTimes++ < MAX_TRY) {\r\n const blocksToClear: [ContentModelBlockGroup[], ContentModelBlock][] = [];\r\n const segmentsToClear: ContentModelSegment[] = [];\r\n const tablesToClear: [ContentModelTable, boolean][] = [];\r\n\r\n needtoRun = clearModelFormat(model, blocksToClear, segmentsToClear, tablesToClear);\r\n\r\n normalizeContentModel(model);\r\n\r\n changed =\r\n changed ||\r\n blocksToClear.length > 0 ||\r\n segmentsToClear.length > 0 ||\r\n tablesToClear.length > 0;\r\n }\r\n\r\n return changed;\r\n },\r\n {\r\n apiName: 'clearFormat',\r\n }\r\n );\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
- import type { IEditor, ContentModelFormatState, ConflictFormatSolution } from 'roosterjs-content-model-types';
2
- /**
3
- * Get current format state
4
- * @param editor The editor to get format from
5
- * @param conflictSolution The strategy for handling format conflicts
6
- */
7
- export declare function getFormatState(editor: IEditor, conflictSolution?: ConflictFormatSolution): ContentModelFormatState;
1
+ import type { IEditor, ContentModelFormatState, ConflictFormatSolution } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Get current format state
4
+ * @param editor The editor to get format from
5
+ * @param conflictSolution The strategy for handling format conflicts
6
+ */
7
+ export declare function getFormatState(editor: IEditor, conflictSolution?: ConflictFormatSolution): ContentModelFormatState;
@@ -1,32 +1,32 @@
1
- define(["require", "exports", "../../modelApi/common/reducedModelChildProcessor", "roosterjs-content-model-dom"], function (require, exports, reducedModelChildProcessor_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getFormatState = void 0;
5
- /**
6
- * Get current format state
7
- * @param editor The editor to get format from
8
- * @param conflictSolution The strategy for handling format conflicts
9
- */
10
- function getFormatState(editor, conflictSolution) {
11
- if (conflictSolution === void 0) { conflictSolution = 'remove'; }
12
- var pendingFormat = editor.getPendingFormat();
13
- var manager = editor.getSnapshotsManager();
14
- var result = {
15
- canUndo: manager.hasNewContent || manager.canMove(-1),
16
- canRedo: manager.canMove(1),
17
- isDarkMode: editor.isDarkMode(),
18
- };
19
- editor.formatContentModel(function (model) {
20
- (0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution, editor.getDOMHelper(), editor.isDarkMode(), editor.getColorManager());
21
- return false;
22
- }, undefined /*options*/, {
23
- processorOverride: {
24
- child: reducedModelChildProcessor_1.reducedModelChildProcessor,
25
- },
26
- tryGetFromCache: true,
27
- });
28
- return result;
29
- }
30
- exports.getFormatState = getFormatState;
31
- });
1
+ define(["require", "exports", "../../modelApi/common/reducedModelChildProcessor", "roosterjs-content-model-dom"], function (require, exports, reducedModelChildProcessor_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.getFormatState = void 0;
5
+ /**
6
+ * Get current format state
7
+ * @param editor The editor to get format from
8
+ * @param conflictSolution The strategy for handling format conflicts
9
+ */
10
+ function getFormatState(editor, conflictSolution) {
11
+ if (conflictSolution === void 0) { conflictSolution = 'remove'; }
12
+ var pendingFormat = editor.getPendingFormat();
13
+ var manager = editor.getSnapshotsManager();
14
+ var result = {
15
+ canUndo: manager.hasNewContent || manager.canMove(-1),
16
+ canRedo: manager.canMove(1),
17
+ isDarkMode: editor.isDarkMode(),
18
+ };
19
+ editor.formatContentModel(function (model) {
20
+ (0, roosterjs_content_model_dom_1.retrieveModelFormatState)(model, pendingFormat, result, conflictSolution, editor.getDOMHelper(), editor.isDarkMode(), editor.getColorManager());
21
+ return false;
22
+ }, undefined /*options*/, {
23
+ processorOverride: {
24
+ child: reducedModelChildProcessor_1.reducedModelChildProcessor,
25
+ },
26
+ tryGetFromCache: true,
27
+ });
28
+ return result;
29
+ }
30
+ exports.getFormatState = getFormatState;
31
+ });
32
32
  //# sourceMappingURL=getFormatState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;;IAQA;;;;OAIG;IACH,SAAgB,cAAc,CAC1B,MAAe,EACf,gBAAmD;QAAnD,iCAAA,EAAA,2BAAmD;QAEnD,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAChD,IAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC7C,IAAM,MAAM,GAA4B;YACpC,OAAO,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAClC,CAAC;QAEF,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAA,sDAAwB,EACpB,KAAK,EACL,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,CAAC,YAAY,EAAE,EACrB,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,eAAe,EAAE,CAC3B,CAAC;YAEF,OAAO,KAAK,CAAC;QACjB,CAAC,EACD,SAAS,CAAC,WAAW,EACrB;YACI,iBAAiB,EAAE;gBACf,KAAK,EAAE,uDAA0B;aACpC;YACD,eAAe,EAAE,IAAI;SACxB,CACJ,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;IApCD,wCAoCC","sourcesContent":["import { reducedModelChildProcessor } from '../../modelApi/common/reducedModelChildProcessor';\nimport { retrieveModelFormatState } from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n ContentModelFormatState,\n ConflictFormatSolution,\n} from 'roosterjs-content-model-types';\n\n/**\n * Get current format state\n * @param editor The editor to get format from\n * @param conflictSolution The strategy for handling format conflicts\n */\nexport function getFormatState(\n editor: IEditor,\n conflictSolution: ConflictFormatSolution = 'remove'\n): ContentModelFormatState {\n const pendingFormat = editor.getPendingFormat();\n const manager = editor.getSnapshotsManager();\n const result: ContentModelFormatState = {\n canUndo: manager.hasNewContent || manager.canMove(-1),\n canRedo: manager.canMove(1),\n isDarkMode: editor.isDarkMode(),\n };\n\n editor.formatContentModel(\n model => {\n retrieveModelFormatState(\n model,\n pendingFormat,\n result,\n conflictSolution,\n editor.getDOMHelper(),\n editor.isDarkMode(),\n editor.getColorManager()\n );\n\n return false;\n },\n undefined /*options*/,\n {\n processorOverride: {\n child: reducedModelChildProcessor,\n },\n tryGetFromCache: true,\n }\n );\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"getFormatState.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/format/getFormatState.ts"],"names":[],"mappings":";;;;IAQA;;;;OAIG;IACH,SAAgB,cAAc,CAC1B,MAAe,EACf,gBAAmD;QAAnD,iCAAA,EAAA,2BAAmD;QAEnD,IAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAChD,IAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC7C,IAAM,MAAM,GAA4B;YACpC,OAAO,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE;SAClC,CAAC;QAEF,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAA,sDAAwB,EACpB,KAAK,EACL,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,CAAC,YAAY,EAAE,EACrB,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,eAAe,EAAE,CAC3B,CAAC;YAEF,OAAO,KAAK,CAAC;QACjB,CAAC,EACD,SAAS,CAAC,WAAW,EACrB;YACI,iBAAiB,EAAE;gBACf,KAAK,EAAE,uDAA0B;aACpC;YACD,eAAe,EAAE,IAAI;SACxB,CACJ,CAAC;QAEF,OAAO,MAAM,CAAC;IAClB,CAAC;IApCD,wCAoCC","sourcesContent":["import { reducedModelChildProcessor } from '../../modelApi/common/reducedModelChildProcessor';\r\nimport { retrieveModelFormatState } from 'roosterjs-content-model-dom';\r\nimport type {\r\n IEditor,\r\n ContentModelFormatState,\r\n ConflictFormatSolution,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Get current format state\r\n * @param editor The editor to get format from\r\n * @param conflictSolution The strategy for handling format conflicts\r\n */\r\nexport function getFormatState(\r\n editor: IEditor,\r\n conflictSolution: ConflictFormatSolution = 'remove'\r\n): ContentModelFormatState {\r\n const pendingFormat = editor.getPendingFormat();\r\n const manager = editor.getSnapshotsManager();\r\n const result: ContentModelFormatState = {\r\n canUndo: manager.hasNewContent || manager.canMove(-1),\r\n canRedo: manager.canMove(1),\r\n isDarkMode: editor.isDarkMode(),\r\n };\r\n\r\n editor.formatContentModel(\r\n model => {\r\n retrieveModelFormatState(\r\n model,\r\n pendingFormat,\r\n result,\r\n conflictSolution,\r\n editor.getDOMHelper(),\r\n editor.isDarkMode(),\r\n editor.getColorManager()\r\n );\r\n\r\n return false;\r\n },\r\n undefined /*options*/,\r\n {\r\n processorOverride: {\r\n child: reducedModelChildProcessor,\r\n },\r\n tryGetFromCache: true,\r\n }\r\n );\r\n\r\n return result;\r\n}\r\n"]}
@@ -1,6 +1,6 @@
1
- import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
2
- /**
3
- * Adjust selection to make sure select an image if any
4
- * @return Content Model Image object if an image is select, or null
5
- */
6
- export declare function adjustImageSelection(editor: IEditor): ContentModelImage | null;
1
+ import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Adjust selection to make sure select an image if any
4
+ * @return Content Model Image object if an image is select, or null
5
+ */
6
+ export declare function adjustImageSelection(editor: IEditor): ContentModelImage | null;
@@ -1,30 +1,30 @@
1
- define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "roosterjs-content-model-dom"], function (require, exports, adjustSegmentSelection_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.adjustImageSelection = void 0;
5
- /**
6
- * Adjust selection to make sure select an image if any
7
- * @return Content Model Image object if an image is select, or null
8
- */
9
- function adjustImageSelection(editor) {
10
- var image = null;
11
- editor.formatContentModel(function (model) {
12
- return (0, adjustSegmentSelection_1.adjustSegmentSelection)(model, function (target, paragraph) {
13
- if (target.isSelected && target.segmentType == 'Image') {
14
- (0, roosterjs_content_model_dom_1.mutateSegment)(paragraph, target, function (segment) {
15
- image = segment;
16
- });
17
- return true;
18
- }
19
- else {
20
- return false;
21
- }
22
- }, function (target, ref) { return target == ref; });
23
- }, {
24
- apiName: 'adjustImageSelection',
25
- });
26
- return image;
27
- }
28
- exports.adjustImageSelection = adjustImageSelection;
29
- });
1
+ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "roosterjs-content-model-dom"], function (require, exports, adjustSegmentSelection_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.adjustImageSelection = void 0;
5
+ /**
6
+ * Adjust selection to make sure select an image if any
7
+ * @return Content Model Image object if an image is select, or null
8
+ */
9
+ function adjustImageSelection(editor) {
10
+ var image = null;
11
+ editor.formatContentModel(function (model) {
12
+ return (0, adjustSegmentSelection_1.adjustSegmentSelection)(model, function (target, paragraph) {
13
+ if (target.isSelected && target.segmentType == 'Image') {
14
+ (0, roosterjs_content_model_dom_1.mutateSegment)(paragraph, target, function (segment) {
15
+ image = segment;
16
+ });
17
+ return true;
18
+ }
19
+ else {
20
+ return false;
21
+ }
22
+ }, function (target, ref) { return target == ref; });
23
+ }, {
24
+ apiName: 'adjustImageSelection',
25
+ });
26
+ return image;
27
+ }
28
+ exports.adjustImageSelection = adjustImageSelection;
29
+ });
30
30
  //# sourceMappingURL=adjustImageSelection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adjustImageSelection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/adjustImageSelection.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACH,SAAgB,oBAAoB,CAAC,MAAe;QAChD,IAAI,KAAK,GAA6B,IAAI,CAAC;QAE3C,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,OAAA,IAAA,+CAAsB,EAClB,KAAK,EACL,UAAC,MAAM,EAAE,SAAS;gBACd,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE;oBACpD,IAAA,2CAAa,EAAC,SAAS,EAAE,MAAM,EAAE,UAAA,OAAO;wBACpC,KAAK,GAAG,OAAO,CAAC;oBACpB,CAAC,CAAC,CAAC;oBACH,OAAO,IAAI,CAAC;iBACf;qBAAM;oBACH,OAAO,KAAK,CAAC;iBAChB;YACL,CAAC,EACD,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,MAAM,IAAI,GAAG,EAAb,CAAa,CACjC;QAbD,CAaC,EACL;YACI,OAAO,EAAE,sBAAsB;SAClC,CACJ,CAAC;QAEF,OAAO,KAAK,CAAC;IACjB,CAAC;IAzBD,oDAyBC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { mutateSegment } from 'roosterjs-content-model-dom';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Adjust selection to make sure select an image if any\n * @return Content Model Image object if an image is select, or null\n */\nexport function adjustImageSelection(editor: IEditor): ContentModelImage | null {\n let image: ContentModelImage | null = null;\n\n editor.formatContentModel(\n model =>\n adjustSegmentSelection(\n model,\n (target, paragraph) => {\n if (target.isSelected && target.segmentType == 'Image') {\n mutateSegment(paragraph, target, segment => {\n image = segment;\n });\n return true;\n } else {\n return false;\n }\n },\n (target, ref) => target == ref\n ),\n {\n apiName: 'adjustImageSelection',\n }\n );\n\n return image;\n}\n"]}
1
+ {"version":3,"file":"adjustImageSelection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/adjustImageSelection.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACH,SAAgB,oBAAoB,CAAC,MAAe;QAChD,IAAI,KAAK,GAA6B,IAAI,CAAC;QAE3C,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,OAAA,IAAA,+CAAsB,EAClB,KAAK,EACL,UAAC,MAAM,EAAE,SAAS;gBACd,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE;oBACpD,IAAA,2CAAa,EAAC,SAAS,EAAE,MAAM,EAAE,UAAA,OAAO;wBACpC,KAAK,GAAG,OAAO,CAAC;oBACpB,CAAC,CAAC,CAAC;oBACH,OAAO,IAAI,CAAC;iBACf;qBAAM;oBACH,OAAO,KAAK,CAAC;iBAChB;YACL,CAAC,EACD,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,MAAM,IAAI,GAAG,EAAb,CAAa,CACjC;QAbD,CAaC,EACL;YACI,OAAO,EAAE,sBAAsB;SAClC,CACJ,CAAC;QAEF,OAAO,KAAK,CAAC;IACjB,CAAC;IAzBD,oDAyBC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\r\nimport { mutateSegment } from 'roosterjs-content-model-dom';\r\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Adjust selection to make sure select an image if any\r\n * @return Content Model Image object if an image is select, or null\r\n */\r\nexport function adjustImageSelection(editor: IEditor): ContentModelImage | null {\r\n let image: ContentModelImage | null = null;\r\n\r\n editor.formatContentModel(\r\n model =>\r\n adjustSegmentSelection(\r\n model,\r\n (target, paragraph) => {\r\n if (target.isSelected && target.segmentType == 'Image') {\r\n mutateSegment(paragraph, target, segment => {\r\n image = segment;\r\n });\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n },\r\n (target, ref) => target == ref\r\n ),\r\n {\r\n apiName: 'adjustImageSelection',\r\n }\r\n );\r\n\r\n return image;\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
- import type { IEditor } from 'roosterjs-content-model-types';
2
- /**
3
- * Change the selected image src
4
- * @param editor The editor instance
5
- * @param file The image file
6
- */
7
- export declare function changeImage(editor: IEditor, file: File): void;
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Change the selected image src
4
+ * @param editor The editor instance
5
+ * @param file The image file
6
+ */
7
+ export declare function changeImage(editor: IEditor, file: File): void;
@@ -1,36 +1,36 @@
1
- define(["require", "exports", "../utils/formatImageWithContentModel", "roosterjs-content-model-dom"], function (require, exports, formatImageWithContentModel_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.changeImage = void 0;
5
- /**
6
- * Change the selected image src
7
- * @param editor The editor instance
8
- * @param file The image file
9
- */
10
- function changeImage(editor, file) {
11
- editor.focus();
12
- var selection = editor.getDOMSelection();
13
- (0, roosterjs_content_model_dom_1.readFile)(file, function (dataUrl) {
14
- if (dataUrl && !editor.isDisposed() && (selection === null || selection === void 0 ? void 0 : selection.type) === 'image') {
15
- (0, formatImageWithContentModel_1.formatImageWithContentModel)(editor, 'changeImage', function (image) {
16
- var _a, _b;
17
- var originalSrc = (_b = (_a = (0, roosterjs_content_model_dom_1.getImageMetadata)(image)) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : '';
18
- var previousSrc = image.src;
19
- image.src = dataUrl;
20
- image.dataset = {};
21
- image.format.width = '';
22
- image.format.height = '';
23
- image.alt = '';
24
- editor.triggerEvent('editImage', {
25
- image: selection.image,
26
- previousSrc: previousSrc,
27
- newSrc: dataUrl,
28
- originalSrc: originalSrc,
29
- });
30
- });
31
- }
32
- });
33
- }
34
- exports.changeImage = changeImage;
35
- });
1
+ define(["require", "exports", "../utils/formatImageWithContentModel", "roosterjs-content-model-dom"], function (require, exports, formatImageWithContentModel_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.changeImage = void 0;
5
+ /**
6
+ * Change the selected image src
7
+ * @param editor The editor instance
8
+ * @param file The image file
9
+ */
10
+ function changeImage(editor, file) {
11
+ editor.focus();
12
+ var selection = editor.getDOMSelection();
13
+ (0, roosterjs_content_model_dom_1.readFile)(file, function (dataUrl) {
14
+ if (dataUrl && !editor.isDisposed() && (selection === null || selection === void 0 ? void 0 : selection.type) === 'image') {
15
+ (0, formatImageWithContentModel_1.formatImageWithContentModel)(editor, 'changeImage', function (image) {
16
+ var _a, _b;
17
+ var originalSrc = (_b = (_a = (0, roosterjs_content_model_dom_1.getImageMetadata)(image)) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : '';
18
+ var previousSrc = image.src;
19
+ image.src = dataUrl;
20
+ image.dataset = {};
21
+ image.format.width = '';
22
+ image.format.height = '';
23
+ image.alt = '';
24
+ editor.triggerEvent('editImage', {
25
+ image: selection.image,
26
+ previousSrc: previousSrc,
27
+ newSrc: dataUrl,
28
+ originalSrc: originalSrc,
29
+ });
30
+ });
31
+ }
32
+ });
33
+ }
34
+ exports.changeImage = changeImage;
35
+ });
36
36
  //# sourceMappingURL=changeImage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"changeImage.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/changeImage.ts"],"names":[],"mappings":";;;;IAIA;;;;OAIG;IACH,SAAgB,WAAW,CAAC,MAAe,EAAE,IAAU;QACnD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAM,SAAS,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;QAC3C,IAAA,sCAAQ,EAAC,IAAI,EAAE,UAAA,OAAO;YAClB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,MAAK,OAAO,EAAE;gBAChE,IAAA,yDAA2B,EAAC,MAAM,EAAE,aAAa,EAAE,UAAC,KAAwB;;oBACxE,IAAM,WAAW,GAAG,MAAA,MAAA,IAAA,8CAAgB,EAAC,KAAK,CAAC,0CAAE,GAAG,mCAAI,EAAE,CAAC;oBACvD,IAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC;oBAE9B,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;oBACpB,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;oBACnB,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;oBACxB,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;oBACzB,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;oBAEf,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE;wBAC7B,KAAK,EAAE,SAAS,CAAC,KAAK;wBACtB,WAAW,aAAA;wBACX,MAAM,EAAE,OAAO;wBACf,WAAW,aAAA;qBACd,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAzBD,kCAyBC","sourcesContent":["import { formatImageWithContentModel } from '../utils/formatImageWithContentModel';\nimport { getImageMetadata, readFile } from 'roosterjs-content-model-dom';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Change the selected image src\n * @param editor The editor instance\n * @param file The image file\n */\nexport function changeImage(editor: IEditor, file: File) {\n editor.focus();\n\n const selection = editor.getDOMSelection();\n readFile(file, dataUrl => {\n if (dataUrl && !editor.isDisposed() && selection?.type === 'image') {\n formatImageWithContentModel(editor, 'changeImage', (image: ContentModelImage) => {\n const originalSrc = getImageMetadata(image)?.src ?? '';\n const previousSrc = image.src;\n\n image.src = dataUrl;\n image.dataset = {};\n image.format.width = '';\n image.format.height = '';\n image.alt = '';\n\n editor.triggerEvent('editImage', {\n image: selection.image,\n previousSrc,\n newSrc: dataUrl,\n originalSrc,\n });\n });\n }\n });\n}\n"]}
1
+ {"version":3,"file":"changeImage.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/changeImage.ts"],"names":[],"mappings":";;;;IAIA;;;;OAIG;IACH,SAAgB,WAAW,CAAC,MAAe,EAAE,IAAU;QACnD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAM,SAAS,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;QAC3C,IAAA,sCAAQ,EAAC,IAAI,EAAE,UAAA,OAAO;YAClB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,MAAK,OAAO,EAAE;gBAChE,IAAA,yDAA2B,EAAC,MAAM,EAAE,aAAa,EAAE,UAAC,KAAwB;;oBACxE,IAAM,WAAW,GAAG,MAAA,MAAA,IAAA,8CAAgB,EAAC,KAAK,CAAC,0CAAE,GAAG,mCAAI,EAAE,CAAC;oBACvD,IAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC;oBAE9B,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;oBACpB,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;oBACnB,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;oBACxB,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;oBACzB,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC;oBAEf,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE;wBAC7B,KAAK,EAAE,SAAS,CAAC,KAAK;wBACtB,WAAW,aAAA;wBACX,MAAM,EAAE,OAAO;wBACf,WAAW,aAAA;qBACd,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAzBD,kCAyBC","sourcesContent":["import { formatImageWithContentModel } from '../utils/formatImageWithContentModel';\r\nimport { getImageMetadata, readFile } from 'roosterjs-content-model-dom';\r\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Change the selected image src\r\n * @param editor The editor instance\r\n * @param file The image file\r\n */\r\nexport function changeImage(editor: IEditor, file: File) {\r\n editor.focus();\r\n\r\n const selection = editor.getDOMSelection();\r\n readFile(file, dataUrl => {\r\n if (dataUrl && !editor.isDisposed() && selection?.type === 'image') {\r\n formatImageWithContentModel(editor, 'changeImage', (image: ContentModelImage) => {\r\n const originalSrc = getImageMetadata(image)?.src ?? '';\r\n const previousSrc = image.src;\r\n\r\n image.src = dataUrl;\r\n image.dataset = {};\r\n image.format.width = '';\r\n image.format.height = '';\r\n image.alt = '';\r\n\r\n editor.triggerEvent('editImage', {\r\n image: selection.image,\r\n previousSrc,\r\n newSrc: dataUrl,\r\n originalSrc,\r\n });\r\n });\r\n }\r\n });\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
- import type { IEditor } from 'roosterjs-content-model-types';
2
- /**
3
- * Insert an image into current selected position
4
- * @param editor The editor to operate on
5
- * @param file Image Blob file or source string
6
- */
7
- export declare function insertImage(editor: IEditor, imageFileOrSrc: File | string): void;
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Insert an image into current selected position
4
+ * @param editor The editor to operate on
5
+ * @param file Image Blob file or source string
6
+ */
7
+ export declare function insertImage(editor: IEditor, imageFileOrSrc: File | string): void;