roosterjs-content-model-api 0.27.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (629) hide show
  1. package/README.md +47 -37
  2. package/lib/index.d.ts +48 -42
  3. package/lib/index.js +56 -43
  4. package/lib/index.js.map +1 -1
  5. package/lib/modelApi/block/setModelAlignment.js +2 -2
  6. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  7. package/lib/modelApi/block/setModelDirection.js +5 -5
  8. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  9. package/lib/modelApi/block/setModelIndentation.js +6 -7
  10. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  11. package/lib/modelApi/block/toggleModelBlockQuote.js +3 -4
  12. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  13. package/lib/modelApi/common/clearModelFormat.js +6 -7
  14. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  15. package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
  16. package/lib/modelApi/common/reducedModelChildProcessor.js +64 -0
  17. package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -0
  18. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  19. package/lib/modelApi/entity/insertEntityModel.d.ts +2 -2
  20. package/lib/modelApi/entity/insertEntityModel.js +19 -10
  21. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  22. package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  23. package/lib/modelApi/image/applyImageBorderFormat.js +3 -3
  24. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  25. package/lib/modelApi/link/matchLink.d.ts +1 -18
  26. package/lib/modelApi/link/matchLink.js +0 -1
  27. package/lib/modelApi/link/matchLink.js.map +1 -1
  28. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  29. package/lib/modelApi/list/setListType.js +3 -4
  30. package/lib/modelApi/list/setListType.js.map +1 -1
  31. package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -0
  32. package/lib/modelApi/list/setModelListStartNumber.js +22 -0
  33. package/lib/modelApi/list/setModelListStartNumber.js.map +1 -0
  34. package/lib/modelApi/list/setModelListStyle.d.ts +7 -0
  35. package/lib/modelApi/list/setModelListStyle.js +26 -0
  36. package/lib/modelApi/list/setModelListStyle.js.map +1 -0
  37. package/lib/modelApi/selection/adjustSegmentSelection.js +3 -3
  38. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  39. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +1 -2
  40. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  41. package/lib/modelApi/selection/adjustWordSelection.js +3 -4
  42. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  43. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  44. package/lib/modelApi/table/alignTable.js.map +1 -1
  45. package/lib/modelApi/table/alignTableCell.js +3 -3
  46. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  47. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  48. package/lib/modelApi/table/clearSelectedCells.js +2 -2
  49. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  50. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  51. package/lib/modelApi/table/deleteTable.js.map +1 -1
  52. package/lib/modelApi/table/deleteTableColumn.js +2 -2
  53. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  54. package/lib/modelApi/table/deleteTableRow.js +2 -2
  55. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  56. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  57. package/lib/modelApi/table/insertTableColumn.js +1 -2
  58. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  59. package/lib/modelApi/table/insertTableRow.js +1 -2
  60. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  61. package/lib/modelApi/table/mergeTableCells.js +2 -2
  62. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  63. package/lib/modelApi/table/mergeTableColumn.js +2 -2
  64. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  65. package/lib/modelApi/table/mergeTableRow.js +2 -2
  66. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  67. package/lib/modelApi/table/splitTableCellHorizontally.js +1 -2
  68. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  69. package/lib/modelApi/table/splitTableCellVertically.js +1 -2
  70. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  71. package/lib/publicApi/block/setAlignment.d.ts +1 -1
  72. package/lib/publicApi/block/setAlignment.js +2 -1
  73. package/lib/publicApi/block/setAlignment.js.map +1 -1
  74. package/lib/publicApi/block/setDirection.d.ts +1 -1
  75. package/lib/publicApi/block/setDirection.js +2 -1
  76. package/lib/publicApi/block/setDirection.js.map +1 -1
  77. package/lib/publicApi/block/setHeadingLevel.d.ts +1 -1
  78. package/lib/publicApi/block/setHeadingLevel.js +2 -1
  79. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  80. package/lib/publicApi/block/setIndentation.d.ts +1 -1
  81. package/lib/publicApi/block/setIndentation.js +2 -1
  82. package/lib/publicApi/block/setIndentation.js.map +1 -1
  83. package/lib/publicApi/block/setParagraphMargin.d.ts +1 -1
  84. package/lib/publicApi/block/setParagraphMargin.js +2 -1
  85. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  86. package/lib/publicApi/block/setSpacing.d.ts +1 -1
  87. package/lib/publicApi/block/setSpacing.js +2 -1
  88. package/lib/publicApi/block/setSpacing.js.map +1 -1
  89. package/lib/publicApi/block/toggleBlockQuote.d.ts +1 -1
  90. package/lib/publicApi/block/toggleBlockQuote.js +2 -1
  91. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  92. package/lib/publicApi/entity/insertEntity.d.ts +3 -3
  93. package/lib/publicApi/entity/insertEntity.js +19 -12
  94. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  95. package/lib/publicApi/format/clearFormat.d.ts +1 -1
  96. package/lib/publicApi/format/clearFormat.js +2 -1
  97. package/lib/publicApi/format/clearFormat.js.map +1 -1
  98. package/lib/publicApi/format/getFormatState.d.ts +1 -1
  99. package/lib/publicApi/format/getFormatState.js +13 -4
  100. package/lib/publicApi/format/getFormatState.js.map +1 -1
  101. package/lib/publicApi/image/adjustImageSelection.d.ts +1 -1
  102. package/lib/publicApi/image/adjustImageSelection.js +2 -1
  103. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  104. package/lib/publicApi/image/changeImage.d.ts +1 -1
  105. package/lib/publicApi/image/changeImage.js +6 -5
  106. package/lib/publicApi/image/changeImage.js.map +1 -1
  107. package/lib/publicApi/image/insertImage.d.ts +1 -1
  108. package/lib/publicApi/image/insertImage.js +4 -4
  109. package/lib/publicApi/image/insertImage.js.map +1 -1
  110. package/lib/publicApi/image/setImageAltText.d.ts +1 -1
  111. package/lib/publicApi/image/setImageAltText.js +3 -2
  112. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  113. package/lib/publicApi/image/setImageBorder.d.ts +1 -1
  114. package/lib/publicApi/image/setImageBorder.js +4 -3
  115. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  116. package/lib/publicApi/image/setImageBoxShadow.d.ts +1 -1
  117. package/lib/publicApi/image/setImageBoxShadow.js +3 -2
  118. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  119. package/lib/publicApi/link/adjustLinkSelection.d.ts +1 -1
  120. package/lib/publicApi/link/adjustLinkSelection.js +5 -4
  121. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  122. package/lib/publicApi/link/insertLink.d.ts +1 -1
  123. package/lib/publicApi/link/insertLink.js +5 -5
  124. package/lib/publicApi/link/insertLink.js.map +1 -1
  125. package/lib/publicApi/link/removeLink.d.ts +1 -1
  126. package/lib/publicApi/link/removeLink.js +4 -3
  127. package/lib/publicApi/link/removeLink.js.map +1 -1
  128. package/lib/publicApi/list/setListStartNumber.d.ts +1 -1
  129. package/lib/publicApi/list/setListStartNumber.js +4 -11
  130. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  131. package/lib/publicApi/list/setListStyle.d.ts +1 -1
  132. package/lib/publicApi/list/setListStyle.js +4 -18
  133. package/lib/publicApi/list/setListStyle.js.map +1 -1
  134. package/lib/publicApi/list/toggleBullet.d.ts +1 -1
  135. package/lib/publicApi/list/toggleBullet.js +2 -1
  136. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  137. package/lib/publicApi/list/toggleNumbering.d.ts +1 -1
  138. package/lib/publicApi/list/toggleNumbering.js +2 -1
  139. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  140. package/lib/publicApi/segment/applySegmentFormat.d.ts +1 -1
  141. package/lib/publicApi/segment/applySegmentFormat.js +2 -1
  142. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  143. package/lib/publicApi/segment/changeCapitalization.d.ts +1 -1
  144. package/lib/publicApi/segment/changeCapitalization.js +2 -1
  145. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  146. package/lib/publicApi/segment/changeFontSize.d.ts +1 -1
  147. package/lib/publicApi/segment/changeFontSize.js +2 -1
  148. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  149. package/lib/publicApi/segment/setBackgroundColor.d.ts +1 -1
  150. package/lib/publicApi/segment/setBackgroundColor.js +3 -3
  151. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  152. package/lib/publicApi/segment/setFontName.d.ts +1 -1
  153. package/lib/publicApi/segment/setFontName.js +2 -1
  154. package/lib/publicApi/segment/setFontName.js.map +1 -1
  155. package/lib/publicApi/segment/setFontSize.d.ts +1 -1
  156. package/lib/publicApi/segment/setFontSize.js +2 -2
  157. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  158. package/lib/publicApi/segment/setTextColor.d.ts +1 -1
  159. package/lib/publicApi/segment/setTextColor.js +2 -1
  160. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  161. package/lib/publicApi/segment/toggleBold.d.ts +1 -1
  162. package/lib/publicApi/segment/toggleBold.js +4 -3
  163. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  164. package/lib/publicApi/segment/toggleCode.d.ts +1 -1
  165. package/lib/publicApi/segment/toggleCode.js +2 -1
  166. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  167. package/lib/publicApi/segment/toggleItalic.d.ts +1 -1
  168. package/lib/publicApi/segment/toggleItalic.js +2 -1
  169. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  170. package/lib/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  171. package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
  172. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  173. package/lib/publicApi/segment/toggleSubscript.d.ts +1 -1
  174. package/lib/publicApi/segment/toggleSubscript.js +2 -1
  175. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  176. package/lib/publicApi/segment/toggleSuperscript.d.ts +1 -1
  177. package/lib/publicApi/segment/toggleSuperscript.js +2 -1
  178. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  179. package/lib/publicApi/segment/toggleUnderline.d.ts +1 -1
  180. package/lib/publicApi/segment/toggleUnderline.js +2 -1
  181. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  182. package/lib/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  183. package/lib/publicApi/table/applyTableBorderFormat.js +6 -6
  184. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  185. package/lib/publicApi/table/editTable.d.ts +1 -1
  186. package/lib/publicApi/table/editTable.js +2 -1
  187. package/lib/publicApi/table/editTable.js.map +1 -1
  188. package/lib/publicApi/table/formatTable.d.ts +1 -1
  189. package/lib/publicApi/table/formatTable.js +6 -5
  190. package/lib/publicApi/table/formatTable.js.map +1 -1
  191. package/lib/publicApi/table/insertTable.d.ts +1 -1
  192. package/lib/publicApi/table/insertTable.js +8 -8
  193. package/lib/publicApi/table/insertTable.js.map +1 -1
  194. package/lib/publicApi/table/setTableCellShade.d.ts +1 -1
  195. package/lib/publicApi/table/setTableCellShade.js +7 -6
  196. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  197. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  198. package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
  199. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  200. package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
  201. package/lib/publicApi/utils/formatInsertPointWithContentModel.js +127 -0
  202. package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
  203. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  204. package/lib/publicApi/utils/formatParagraphWithContentModel.js +6 -3
  205. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  206. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  207. package/lib/publicApi/utils/formatSegmentWithContentModel.js +9 -3
  208. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  209. package/lib/publicApi/utils/formatTableWithContentModel.js +5 -6
  210. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  211. package/lib-amd/index.d.ts +48 -42
  212. package/lib-amd/index.js +50 -44
  213. package/lib-amd/index.js.map +1 -1
  214. package/lib-amd/modelApi/block/setModelAlignment.js +2 -2
  215. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  216. package/lib-amd/modelApi/block/setModelDirection.js +5 -5
  217. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  218. package/lib-amd/modelApi/block/setModelIndentation.js +6 -6
  219. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  220. package/lib-amd/modelApi/block/toggleModelBlockQuote.js +3 -3
  221. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  222. package/lib-amd/modelApi/common/clearModelFormat.js +7 -7
  223. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  224. package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
  225. package/lib-amd/modelApi/common/reducedModelChildProcessor.js +64 -0
  226. package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -0
  227. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  228. package/lib-amd/modelApi/entity/insertEntityModel.d.ts +2 -2
  229. package/lib-amd/modelApi/entity/insertEntityModel.js +20 -10
  230. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  231. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  232. package/lib-amd/modelApi/image/applyImageBorderFormat.js +4 -3
  233. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  234. package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
  235. package/lib-amd/modelApi/link/matchLink.js +0 -1
  236. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  237. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  238. package/lib-amd/modelApi/list/setListType.js +4 -4
  239. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  240. package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -0
  241. package/lib-amd/modelApi/list/setModelListStartNumber.js +23 -0
  242. package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -0
  243. package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -0
  244. package/lib-amd/modelApi/list/setModelListStyle.js +26 -0
  245. package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -0
  246. package/lib-amd/modelApi/selection/adjustSegmentSelection.js +3 -3
  247. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  248. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +2 -2
  249. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  250. package/lib-amd/modelApi/selection/adjustWordSelection.js +4 -4
  251. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  252. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  253. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  254. package/lib-amd/modelApi/table/alignTableCell.js +3 -3
  255. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  256. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  257. package/lib-amd/modelApi/table/clearSelectedCells.js +2 -2
  258. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  259. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  260. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  261. package/lib-amd/modelApi/table/deleteTableColumn.js +2 -2
  262. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  263. package/lib-amd/modelApi/table/deleteTableRow.js +2 -2
  264. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  265. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  266. package/lib-amd/modelApi/table/insertTableColumn.js +2 -2
  267. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  268. package/lib-amd/modelApi/table/insertTableRow.js +2 -2
  269. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  270. package/lib-amd/modelApi/table/mergeTableCells.js +2 -2
  271. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  272. package/lib-amd/modelApi/table/mergeTableColumn.js +2 -2
  273. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  274. package/lib-amd/modelApi/table/mergeTableRow.js +2 -2
  275. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  276. package/lib-amd/modelApi/table/splitTableCellHorizontally.js +2 -2
  277. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  278. package/lib-amd/modelApi/table/splitTableCellVertically.js +2 -2
  279. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  280. package/lib-amd/publicApi/block/setAlignment.d.ts +1 -1
  281. package/lib-amd/publicApi/block/setAlignment.js +2 -1
  282. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  283. package/lib-amd/publicApi/block/setDirection.d.ts +1 -1
  284. package/lib-amd/publicApi/block/setDirection.js +2 -1
  285. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  286. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +1 -1
  287. package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
  288. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  289. package/lib-amd/publicApi/block/setIndentation.d.ts +1 -1
  290. package/lib-amd/publicApi/block/setIndentation.js +2 -1
  291. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  292. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +1 -1
  293. package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
  294. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  295. package/lib-amd/publicApi/block/setSpacing.d.ts +1 -1
  296. package/lib-amd/publicApi/block/setSpacing.js +2 -1
  297. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  298. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +1 -1
  299. package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
  300. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  301. package/lib-amd/publicApi/entity/insertEntity.d.ts +3 -3
  302. package/lib-amd/publicApi/entity/insertEntity.js +19 -12
  303. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  304. package/lib-amd/publicApi/format/clearFormat.d.ts +1 -1
  305. package/lib-amd/publicApi/format/clearFormat.js +2 -1
  306. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  307. package/lib-amd/publicApi/format/getFormatState.d.ts +1 -1
  308. package/lib-amd/publicApi/format/getFormatState.js +12 -4
  309. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  310. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +1 -1
  311. package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
  312. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  313. package/lib-amd/publicApi/image/changeImage.d.ts +1 -1
  314. package/lib-amd/publicApi/image/changeImage.js +6 -5
  315. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  316. package/lib-amd/publicApi/image/insertImage.d.ts +1 -1
  317. package/lib-amd/publicApi/image/insertImage.js +5 -4
  318. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  319. package/lib-amd/publicApi/image/setImageAltText.d.ts +1 -1
  320. package/lib-amd/publicApi/image/setImageAltText.js +3 -2
  321. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  322. package/lib-amd/publicApi/image/setImageBorder.d.ts +1 -1
  323. package/lib-amd/publicApi/image/setImageBorder.js +4 -3
  324. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  325. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +1 -1
  326. package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
  327. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  328. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +1 -1
  329. package/lib-amd/publicApi/link/adjustLinkSelection.js +5 -4
  330. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  331. package/lib-amd/publicApi/link/insertLink.d.ts +1 -1
  332. package/lib-amd/publicApi/link/insertLink.js +6 -5
  333. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  334. package/lib-amd/publicApi/link/removeLink.d.ts +1 -1
  335. package/lib-amd/publicApi/link/removeLink.js +4 -3
  336. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  337. package/lib-amd/publicApi/list/setListStartNumber.d.ts +1 -1
  338. package/lib-amd/publicApi/list/setListStartNumber.js +4 -11
  339. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  340. package/lib-amd/publicApi/list/setListStyle.d.ts +1 -1
  341. package/lib-amd/publicApi/list/setListStyle.js +4 -17
  342. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  343. package/lib-amd/publicApi/list/toggleBullet.d.ts +1 -1
  344. package/lib-amd/publicApi/list/toggleBullet.js +2 -1
  345. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  346. package/lib-amd/publicApi/list/toggleNumbering.d.ts +1 -1
  347. package/lib-amd/publicApi/list/toggleNumbering.js +2 -1
  348. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  349. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +1 -1
  350. package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
  351. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  352. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +1 -1
  353. package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
  354. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  355. package/lib-amd/publicApi/segment/changeFontSize.d.ts +1 -1
  356. package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
  357. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  358. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +1 -1
  359. package/lib-amd/publicApi/segment/setBackgroundColor.js +4 -3
  360. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  361. package/lib-amd/publicApi/segment/setFontName.d.ts +1 -1
  362. package/lib-amd/publicApi/segment/setFontName.js +2 -1
  363. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  364. package/lib-amd/publicApi/segment/setFontSize.d.ts +1 -1
  365. package/lib-amd/publicApi/segment/setFontSize.js +2 -2
  366. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  367. package/lib-amd/publicApi/segment/setTextColor.d.ts +1 -1
  368. package/lib-amd/publicApi/segment/setTextColor.js +2 -1
  369. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  370. package/lib-amd/publicApi/segment/toggleBold.d.ts +1 -1
  371. package/lib-amd/publicApi/segment/toggleBold.js +4 -3
  372. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  373. package/lib-amd/publicApi/segment/toggleCode.d.ts +1 -1
  374. package/lib-amd/publicApi/segment/toggleCode.js +2 -1
  375. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  376. package/lib-amd/publicApi/segment/toggleItalic.d.ts +1 -1
  377. package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
  378. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  379. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  380. package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
  381. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  382. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +1 -1
  383. package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
  384. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  385. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +1 -1
  386. package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
  387. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  388. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +1 -1
  389. package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
  390. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  391. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  392. package/lib-amd/publicApi/table/applyTableBorderFormat.js +7 -6
  393. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  394. package/lib-amd/publicApi/table/editTable.d.ts +1 -1
  395. package/lib-amd/publicApi/table/editTable.js +2 -1
  396. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  397. package/lib-amd/publicApi/table/formatTable.d.ts +1 -1
  398. package/lib-amd/publicApi/table/formatTable.js +6 -5
  399. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  400. package/lib-amd/publicApi/table/insertTable.d.ts +1 -1
  401. package/lib-amd/publicApi/table/insertTable.js +8 -7
  402. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  403. package/lib-amd/publicApi/table/setTableCellShade.d.ts +1 -1
  404. package/lib-amd/publicApi/table/setTableCellShade.js +7 -6
  405. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  406. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  407. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
  408. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  409. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
  410. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +127 -0
  411. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
  412. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  413. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +6 -3
  414. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  415. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  416. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +9 -3
  417. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  418. package/lib-amd/publicApi/utils/formatTableWithContentModel.js +6 -6
  419. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  420. package/lib-mjs/index.d.ts +48 -42
  421. package/lib-mjs/index.js +48 -42
  422. package/lib-mjs/index.js.map +1 -1
  423. package/lib-mjs/modelApi/block/setModelAlignment.js +1 -1
  424. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  425. package/lib-mjs/modelApi/block/setModelDirection.js +1 -1
  426. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  427. package/lib-mjs/modelApi/block/setModelIndentation.js +1 -2
  428. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  429. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +1 -2
  430. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  431. package/lib-mjs/modelApi/common/clearModelFormat.js +1 -2
  432. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  433. package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -0
  434. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +60 -0
  435. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -0
  436. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  437. package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +2 -2
  438. package/lib-mjs/modelApi/entity/insertEntityModel.js +18 -9
  439. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  440. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  441. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +2 -3
  442. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  443. package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
  444. package/lib-mjs/modelApi/link/matchLink.js +0 -1
  445. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  446. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  447. package/lib-mjs/modelApi/list/setListType.js +1 -2
  448. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  449. package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -0
  450. package/lib-mjs/modelApi/list/setModelListStartNumber.js +18 -0
  451. package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -0
  452. package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -0
  453. package/lib-mjs/modelApi/list/setModelListStyle.js +22 -0
  454. package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -0
  455. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +1 -1
  456. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  457. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +1 -2
  458. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  459. package/lib-mjs/modelApi/selection/adjustWordSelection.js +1 -2
  460. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  461. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  462. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  463. package/lib-mjs/modelApi/table/alignTableCell.js +1 -1
  464. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  465. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  466. package/lib-mjs/modelApi/table/clearSelectedCells.js +1 -1
  467. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  468. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  469. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  470. package/lib-mjs/modelApi/table/deleteTableColumn.js +1 -1
  471. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  472. package/lib-mjs/modelApi/table/deleteTableRow.js +1 -1
  473. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  474. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  475. package/lib-mjs/modelApi/table/insertTableColumn.js +1 -2
  476. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  477. package/lib-mjs/modelApi/table/insertTableRow.js +1 -2
  478. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  479. package/lib-mjs/modelApi/table/mergeTableCells.js +1 -1
  480. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  481. package/lib-mjs/modelApi/table/mergeTableColumn.js +1 -1
  482. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  483. package/lib-mjs/modelApi/table/mergeTableRow.js +1 -1
  484. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  485. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +1 -2
  486. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  487. package/lib-mjs/modelApi/table/splitTableCellVertically.js +1 -2
  488. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  489. package/lib-mjs/publicApi/block/setAlignment.d.ts +1 -1
  490. package/lib-mjs/publicApi/block/setAlignment.js +1 -1
  491. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  492. package/lib-mjs/publicApi/block/setDirection.d.ts +1 -1
  493. package/lib-mjs/publicApi/block/setDirection.js +1 -1
  494. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  495. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +1 -1
  496. package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
  497. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  498. package/lib-mjs/publicApi/block/setIndentation.d.ts +1 -1
  499. package/lib-mjs/publicApi/block/setIndentation.js +1 -1
  500. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  501. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +1 -1
  502. package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
  503. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  504. package/lib-mjs/publicApi/block/setSpacing.d.ts +1 -1
  505. package/lib-mjs/publicApi/block/setSpacing.js +1 -1
  506. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  507. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +1 -1
  508. package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
  509. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  510. package/lib-mjs/publicApi/entity/insertEntity.d.ts +3 -3
  511. package/lib-mjs/publicApi/entity/insertEntity.js +18 -12
  512. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  513. package/lib-mjs/publicApi/format/clearFormat.d.ts +1 -1
  514. package/lib-mjs/publicApi/format/clearFormat.js +1 -1
  515. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  516. package/lib-mjs/publicApi/format/getFormatState.d.ts +1 -1
  517. package/lib-mjs/publicApi/format/getFormatState.js +12 -4
  518. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  519. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +1 -1
  520. package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
  521. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  522. package/lib-mjs/publicApi/image/changeImage.d.ts +1 -1
  523. package/lib-mjs/publicApi/image/changeImage.js +3 -3
  524. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  525. package/lib-mjs/publicApi/image/insertImage.d.ts +1 -1
  526. package/lib-mjs/publicApi/image/insertImage.js +2 -3
  527. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  528. package/lib-mjs/publicApi/image/setImageAltText.d.ts +1 -1
  529. package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
  530. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  531. package/lib-mjs/publicApi/image/setImageBorder.d.ts +1 -1
  532. package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
  533. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  534. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +1 -1
  535. package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
  536. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  537. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +1 -1
  538. package/lib-mjs/publicApi/link/adjustLinkSelection.js +2 -2
  539. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  540. package/lib-mjs/publicApi/link/insertLink.d.ts +1 -1
  541. package/lib-mjs/publicApi/link/insertLink.js +2 -3
  542. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  543. package/lib-mjs/publicApi/link/removeLink.d.ts +1 -1
  544. package/lib-mjs/publicApi/link/removeLink.js +2 -2
  545. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  546. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +1 -1
  547. package/lib-mjs/publicApi/list/setListStartNumber.js +3 -11
  548. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  549. package/lib-mjs/publicApi/list/setListStyle.d.ts +1 -1
  550. package/lib-mjs/publicApi/list/setListStyle.js +3 -18
  551. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  552. package/lib-mjs/publicApi/list/toggleBullet.d.ts +1 -1
  553. package/lib-mjs/publicApi/list/toggleBullet.js +1 -1
  554. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  555. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +1 -1
  556. package/lib-mjs/publicApi/list/toggleNumbering.js +1 -1
  557. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  558. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +1 -1
  559. package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
  560. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  561. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +1 -1
  562. package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
  563. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  564. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +1 -1
  565. package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
  566. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  567. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +1 -1
  568. package/lib-mjs/publicApi/segment/setBackgroundColor.js +2 -3
  569. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  570. package/lib-mjs/publicApi/segment/setFontName.d.ts +1 -1
  571. package/lib-mjs/publicApi/segment/setFontName.js +1 -1
  572. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  573. package/lib-mjs/publicApi/segment/setFontSize.d.ts +1 -1
  574. package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
  575. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  576. package/lib-mjs/publicApi/segment/setTextColor.d.ts +1 -1
  577. package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
  578. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  579. package/lib-mjs/publicApi/segment/toggleBold.d.ts +1 -1
  580. package/lib-mjs/publicApi/segment/toggleBold.js +2 -2
  581. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  582. package/lib-mjs/publicApi/segment/toggleCode.d.ts +1 -1
  583. package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
  584. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  585. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +1 -1
  586. package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
  587. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  588. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  589. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
  590. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  591. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +1 -1
  592. package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
  593. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  594. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +1 -1
  595. package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
  596. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  597. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +1 -1
  598. package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
  599. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  600. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  601. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +2 -3
  602. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  603. package/lib-mjs/publicApi/table/editTable.d.ts +1 -1
  604. package/lib-mjs/publicApi/table/editTable.js +1 -1
  605. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  606. package/lib-mjs/publicApi/table/formatTable.d.ts +1 -1
  607. package/lib-mjs/publicApi/table/formatTable.js +2 -2
  608. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  609. package/lib-mjs/publicApi/table/insertTable.d.ts +1 -1
  610. package/lib-mjs/publicApi/table/insertTable.js +2 -3
  611. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  612. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +1 -1
  613. package/lib-mjs/publicApi/table/setTableCellShade.js +2 -2
  614. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  615. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  616. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
  617. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  618. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +5 -0
  619. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +123 -0
  620. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -0
  621. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  622. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +5 -2
  623. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  624. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  625. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +8 -2
  626. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  627. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +1 -2
  628. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  629. package/package.json +4 -5
@@ -1,10 +1,10 @@
1
1
  import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';
2
- import { isBold } from 'roosterjs-content-model-core';
2
+ import { isBold } from 'roosterjs-content-model-dom';
3
3
  /**
4
4
  * Toggle bold style
5
5
  * @param editor The editor to operate on
6
6
  */
7
- export default function toggleBold(editor) {
7
+ export function toggleBold(editor) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'toggleBold', function (format, isTurningOn) {
10
10
  format.fontWeight = isTurningOn ? 'bold' : 'normal';
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBold.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;QACjB,OAAA,MAAM,CACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;YACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;YACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;KAAA,CACR,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { isBold } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bold style\n * @param editor The editor to operate on\n */\nexport default function toggleBold(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleBold',\n (format, isTurningOn) => {\n format.fontWeight = isTurningOn ? 'bold' : 'normal';\n },\n (format, _, paragraph) =>\n isBold(\n typeof format.fontWeight == 'undefined'\n ? paragraph?.decorator?.format.fontWeight\n : format.fontWeight\n )\n );\n}\n"]}
1
+ {"version":3,"file":"toggleBold.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;QACjB,OAAA,MAAM,CACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;YACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;YACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;KAAA,CACR,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { isBold } from 'roosterjs-content-model-dom';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bold style\n * @param editor The editor to operate on\n */\nexport function toggleBold(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleBold',\n (format, isTurningOn) => {\n format.fontWeight = isTurningOn ? 'bold' : 'normal';\n },\n (format, _, paragraph) =>\n isBold(\n typeof format.fontWeight == 'undefined'\n ? paragraph?.decorator?.format.fontWeight\n : format.fontWeight\n )\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleCode(editor: IEditor): void;
6
+ export declare function toggleCode(editor: IEditor): void;
@@ -9,7 +9,7 @@ var DefaultCode = {
9
9
  * Toggle italic style
10
10
  * @param editor The editor to operate on
11
11
  */
12
- export default function toggleCode(editor) {
12
+ export function toggleCode(editor) {
13
13
  editor.focus();
14
14
  formatSegmentWithContentModel(editor, 'toggleCode', function (_, isTurningOn, segment) {
15
15
  if (segment) {
@@ -1 +1 @@
1
- {"version":3,"file":"toggleCode.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF,IAAM,WAAW,GAAqB;IAClC,MAAM,EAAE;QACJ,UAAU,EAAE,WAAW;KAC1B;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;QACpB,IAAI,OAAO,EAAE;YACT,IAAI,WAAW,EAAE;gBACb,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACH,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;SACJ;IACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { addCode } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelCode, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultCode: ContentModelCode = {\n format: {\n fontFamily: 'monospace',\n },\n};\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport default function toggleCode(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleCode',\n (_, isTurningOn, segment) => {\n if (segment) {\n if (isTurningOn) {\n addCode(segment, DefaultCode);\n } else {\n delete segment.code;\n }\n }\n },\n (_, segment) => !!segment?.code\n );\n}\n"]}
1
+ {"version":3,"file":"toggleCode.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF,IAAM,WAAW,GAAqB;IAClC,MAAM,EAAE;QACJ,UAAU,EAAE,WAAW;KAC1B;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;QACpB,IAAI,OAAO,EAAE;YACT,IAAI,WAAW,EAAE;gBACb,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACH,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;SACJ;IACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { addCode } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelCode, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultCode: ContentModelCode = {\n format: {\n fontFamily: 'monospace',\n },\n};\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport function toggleCode(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleCode',\n (_, isTurningOn, segment) => {\n if (segment) {\n if (isTurningOn) {\n addCode(segment, DefaultCode);\n } else {\n delete segment.code;\n }\n }\n },\n (_, segment) => !!segment?.code\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleItalic(editor: IEditor): void;
6
+ export declare function toggleItalic(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleItalic(editor) {
6
+ export function toggleItalic(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleItalic', function (format, isTurningOn) {
9
9
  format.italic = !!isTurningOn;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleItalic.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAe;IAChD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport default function toggleItalic(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleItalic',\n (format, isTurningOn) => {\n format.italic = !!isTurningOn;\n },\n format => !!format.italic\n );\n}\n"]}
1
+ {"version":3,"file":"toggleItalic.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe;IACxC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport function toggleItalic(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleItalic',\n (format, isTurningOn) => {\n format.italic = !!isTurningOn;\n },\n format => !!format.italic\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle strikethrough style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleStrikethrough(editor: IEditor): void;
6
+ export declare function toggleStrikethrough(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle strikethrough style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleStrikethrough(editor) {
6
+ export function toggleStrikethrough(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleStrikethrough', function (format, isTurningOn) {
9
9
  format.strikethrough = !!isTurningOn;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleStrikethrough.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,MAAe;IACvD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle strikethrough style\n * @param editor The editor to operate on\n */\nexport default function toggleStrikethrough(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleStrikethrough',\n (format, isTurningOn) => {\n format.strikethrough = !!isTurningOn;\n },\n format => !!format.strikethrough\n );\n}\n"]}
1
+ {"version":3,"file":"toggleStrikethrough.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAe;IAC/C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle strikethrough style\n * @param editor The editor to operate on\n */\nexport function toggleStrikethrough(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleStrikethrough',\n (format, isTurningOn) => {\n format.strikethrough = !!isTurningOn;\n },\n format => !!format.strikethrough\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle subscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSubscript(editor: IEditor): void;
6
+ export declare function toggleSubscript(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle subscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSubscript(editor) {
6
+ export function toggleSubscript(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleSubscript', function (format, isTurningOn) {
9
9
  format.superOrSubScriptSequence = isTurningOn ? 'sub' : '';
@@ -1 +1 @@
1
- {"version":3,"file":"toggleSubscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSubscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,MAAe;IACnD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,KAAK,CAAA,EAAA,CACvE,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle subscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSubscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSubscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'sub' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'sub'\n );\n}\n"]}
1
+ {"version":3,"file":"toggleSubscript.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleSubscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAe;IAC3C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,KAAK,CAAA,EAAA,CACvE,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle subscript style\n * @param editor The editor to operate on\n */\nexport function toggleSubscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSubscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'sub' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'sub'\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle superscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSuperscript(editor: IEditor): void;
6
+ export declare function toggleSuperscript(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle superscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSuperscript(editor) {
6
+ export function toggleSuperscript(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleSuperscript', function (format, isTurningOn) {
9
9
  format.superOrSubScriptSequence = isTurningOn ? 'super' : '';
@@ -1 +1 @@
1
- {"version":3,"file":"toggleSuperscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSuperscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAe;IACrD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,mBAAmB,EACnB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,OAAO,CAAA,EAAA,CACzE,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle superscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSuperscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSuperscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'super' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'super'\n );\n}\n"]}
1
+ {"version":3,"file":"toggleSuperscript.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleSuperscript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAe;IAC7C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,mBAAmB,EACnB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,OAAO,CAAA,EAAA,CACzE,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle superscript style\n * @param editor The editor to operate on\n */\nexport function toggleSuperscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSuperscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'super' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'super'\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle underline style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleUnderline(editor: IEditor): void;
6
+ export declare function toggleUnderline(editor: IEditor): void;
@@ -4,7 +4,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
4
4
  * Toggle underline style
5
5
  * @param editor The editor to operate on
6
6
  */
7
- export default function toggleUnderline(editor) {
7
+ export function toggleUnderline(editor) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'toggleUnderline', function (format, isTurningOn, segment) {
10
10
  format.underline = !!isTurningOn;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleUnderline.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleUnderline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,MAAe;IACnD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW,EAAE,OAAO;QACzB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;QAEjC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;SACjD;IACL,CAAC,EACD,UAAC,MAAM,EAAE,OAAO,gBAAK,OAAA,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,0CAAE,SAAS,CAAA,CAAA,EAAA,EAC7E,KAAK,CAAC,yBAAyB,EAC/B,4BAA4B,CAC/B,CAAC;AACN,CAAC","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle underline style\n * @param editor The editor to operate on\n */\nexport default function toggleUnderline(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleUnderline',\n (format, isTurningOn, segment) => {\n format.underline = !!isTurningOn;\n\n if (segment?.link) {\n segment.link.format.underline = !!isTurningOn;\n }\n },\n (format, segment) => !!format.underline || !!segment?.link?.format?.underline,\n false /*includingFormatHolder*/,\n adjustTrailingSpaceSelection\n );\n}\n"]}
1
+ {"version":3,"file":"toggleUnderline.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleUnderline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,MAAe;IAC3C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW,EAAE,OAAO;QACzB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;QAEjC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;SACjD;IACL,CAAC,EACD,UAAC,MAAM,EAAE,OAAO,gBAAK,OAAA,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,0CAAE,SAAS,CAAA,CAAA,EAAA,EAC7E,KAAK,CAAC,yBAAyB,EAC/B,4BAA4B,CAC/B,CAAC;AACN,CAAC","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle underline style\n * @param editor The editor to operate on\n */\nexport function toggleUnderline(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleUnderline',\n (format, isTurningOn, segment) => {\n format.underline = !!isTurningOn;\n\n if (segment?.link) {\n segment.link.format.underline = !!isTurningOn;\n }\n },\n (format, segment) => !!format.underline || !!segment?.link?.format?.underline,\n false /*includingFormatHolder*/,\n adjustTrailingSpaceSelection\n );\n}\n"]}
@@ -5,4 +5,4 @@ import type { IEditor, Border, BorderOperations } from 'roosterjs-content-model-
5
5
  * @param border The border to apply
6
6
  * @param operation The operation to apply
7
7
  */
8
- export default function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;
8
+ export declare function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;
@@ -1,13 +1,12 @@
1
1
  import { __read } from "tslib";
2
- import { parseValueWithUnit } from 'roosterjs-content-model-dom';
3
- import { extractBorderValues, getFirstSelectedTable, getSelectedCells, updateTableCellMetadata, } from 'roosterjs-content-model-core';
2
+ import { extractBorderValues, getFirstSelectedTable, getSelectedCells, parseValueWithUnit, updateTableCellMetadata, } from 'roosterjs-content-model-dom';
4
3
  /**
5
4
  * Operations to apply border
6
5
  * @param editor The editor instance
7
6
  * @param border The border to apply
8
7
  * @param operation The operation to apply
9
8
  */
10
- export default function applyTableBorderFormat(editor, border, operation) {
9
+ export function applyTableBorderFormat(editor, border, operation) {
11
10
  editor.formatContentModel(function (model) {
12
11
  var _a = __read(getFirstSelectedTable(model), 1), tableModel = _a[0];
13
12
  if (tableModel) {
@@ -1 +1 @@
1
- {"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AA4BtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC1C,MAAe,EACf,MAAc,EACd,SAA2B;IAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,IAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACzC,IAAM,SAAS,GAAc;gBACzB,GAAG,EAAE,KAAK;gBACV,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;aACf,CAAC;YAEF,mDAAmD;YACnD,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YACzB,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,KAAK,GAAY,MAAM,MAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;YACvC,IAAM,eAAe,GAAG,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC9D,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;YAC1C,IAAM,WAAW,GAAG,eAAe,CAA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AAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YACjE,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SACjF;KACJ;AACL,CAAC","sourcesContent":["import { parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport {\n extractBorderValues,\n getFirstSelectedTable,\n getSelectedCells,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type {\n IEditor,\n Border,\n ContentModelTable,\n ContentModelTableCell,\n BorderOperations,\n TableSelectionCoordinates,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * Border positions\n */\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\n\n/**\n * @internal\n * Perimeter of the table selection\n * Used to determine where to apply border to the cells adjacent to the selection.\n */\ntype Perimeter = {\n Top: boolean;\n Bottom: boolean;\n Left: boolean;\n Right: boolean;\n};\n\n/**\n * Operations to apply border\n * @param editor The editor instance\n * @param border The border to apply\n * @param operation The operation to apply\n */\nexport default function applyTableBorderFormat(\n editor: IEditor,\n border: Border,\n operation: BorderOperations\n) {\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n const sel = getSelectedCells(tableModel);\n const perimeter: Perimeter = {\n Top: false,\n Bottom: false,\n Left: false,\n Right: false,\n };\n\n // Create border format with table format as backup\n let borderFormat = '';\n const format = tableModel.format;\n const { width, style, color } = border;\n const extractedBorder = extractBorderValues(format.borderTop);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n if (width) {\n borderFormat = parseValueWithUnit(width) + 'px';\n } else if (borderWidth) {\n borderFormat = borderWidth;\n } else {\n borderFormat = '1px';\n }\n\n if (style) {\n borderFormat = `${borderFormat} ${style}`;\n } else if (borderStyle) {\n borderFormat = `${borderFormat} ${borderStyle}`;\n } else {\n borderFormat = `${borderFormat} solid`;\n }\n\n if (color) {\n borderFormat = `${borderFormat} ${color}`;\n } else if (borderColor) {\n borderFormat = `${borderFormat} ${borderColor}`;\n }\n\n // undefined is treated as Left to Right\n const isRtl = tableModel.format.direction == 'rtl';\n\n if (sel) {\n const operations: BorderOperations[] = [operation];\n while (operations.length) {\n switch (operations.pop()) {\n case 'noBorders':\n // Do All borders but with empty border format\n borderFormat = '';\n operations.push('allBorders');\n break;\n case 'allBorders':\n const allBorders: BorderPositions[] = [\n 'borderTop',\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[colIndex];\n // Format cells - All borders\n applyBorderFormat(cell, borderFormat, allBorders);\n }\n }\n\n // Format perimeter\n perimeter.Top = true;\n perimeter.Bottom = true;\n perimeter.Left = true;\n perimeter.Right = true;\n break;\n case 'leftBorders':\n const leftBorder: BorderPositions[] = ['borderLeft'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ];\n // Format cells - Left border\n applyBorderFormat(cell, borderFormat, leftBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\n break;\n case 'rightBorders':\n const rightBorder: BorderPositions[] = ['borderRight'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ];\n // Format cells - Right border\n applyBorderFormat(cell, borderFormat, rightBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\n break;\n case 'topBorders':\n const topBorder: BorderPositions[] = ['borderTop'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n // Format cells - Top border\n applyBorderFormat(cell, borderFormat, topBorder);\n }\n\n // Format perimeter\n perimeter.Top = true;\n break;\n case 'bottomBorders':\n const bottomBorder: BorderPositions[] = ['borderBottom'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n // Format cells - Bottom border\n applyBorderFormat(cell, borderFormat, bottomBorder);\n }\n\n // Format perimeter\n perimeter.Bottom = true;\n break;\n case 'insideBorders':\n // Format cells - Inside borders\n const singleCol = sel.lastColumn == sel.firstColumn;\n const singleRow = sel.lastRow == sel.firstRow;\n // Single cell selection\n if (singleCol && singleRow) {\n break;\n }\n // Single column selection\n if (singleCol) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\n borderFormat,\n ['borderBottom']\n );\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex <= sel.lastRow - 1;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\n borderFormat,\n ['borderTop']\n );\n break;\n }\n // Single row selection\n if (singleRow) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderRight']\n );\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex <= sel.lastColumn - 1;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderLeft',\n 'borderRight',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderLeft']\n );\n break;\n }\n\n // For multiple rows and columns selections\n // Top left cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderBottom', 'borderRight']\n );\n // Top right cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderBottom', 'borderLeft']\n );\n // Bottom left cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderTop', 'borderRight']\n );\n // Bottom right cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderTop', 'borderLeft']\n );\n // First row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // Last row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // First column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderLeft' : 'borderRight',\n ]);\n }\n // Last column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderRight' : 'borderLeft',\n ]);\n }\n // Inner cells\n sel.firstColumn++;\n sel.firstRow++;\n sel.lastColumn--;\n sel.lastRow--;\n operations.push('allBorders');\n break;\n case 'outsideBorders':\n // Format cells - Outside borders\n operations.push('topBorders');\n operations.push('bottomBorders');\n operations.push('leftBorders');\n operations.push('rightBorders');\n break;\n default:\n break;\n }\n }\n\n //Format perimeter if necessary or possible\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'tableBorder',\n }\n );\n}\n\n/**\n * @internal\n * Apply border format to a cell\n * @param cell The cell to apply border format\n * @param borderFormat The border format to apply\n * @param positions The positions to apply\n */\nfunction applyBorderFormat(\n cell: ContentModelTableCell,\n borderFormat: string,\n positions: BorderPositions[]\n) {\n positions.forEach(pos => {\n cell.format[pos] = borderFormat;\n });\n\n updateTableCellMetadata(cell, metadata => {\n metadata = metadata || {};\n metadata.borderOverride = true;\n return metadata;\n });\n\n // Cell was modified, so delete cached element\n delete cell.cachedElement;\n}\n\n/**\n * @internal\n * Modify the perimeter of the table selection\n * @param tableModel The table model\n * @param sel The table selection\n * @param borderFormat The border format to apply\n * If borderFormat is empty, the border will be removed\n * @param perimeter Where in the perimeter to apply\n */\nfunction modifyPerimeter(\n tableModel: ContentModelTable,\n sel: TableSelectionCoordinates,\n borderFormat: string,\n perimeter: Perimeter,\n isRtl: boolean\n) {\n // Top of selection\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\n }\n }\n // Bottom of selection\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderTop']);\n }\n }\n // Left of selection\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\n }\n }\n // Right of selection\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,GAC1B,MAAM,6BAA6B,CAAC;AA4BrC;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAClC,MAAe,EACf,MAAc,EACd,SAA2B;IAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,IAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACzC,IAAM,SAAS,GAAc;gBACzB,GAAG,EAAE,KAAK;gBACV,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;aACf,CAAC;YAEF,mDAAmD;YACnD,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,IAAM,MA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C;SACjF;KACJ;IACD,qBAAqB;IACrB,IAAI,SAAS,CAAC,KAAK,IAAI,GAAG,CAAC,UAAU,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;QACzE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACnE,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YACjE,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;SACjF;KACJ;AACL,CAAC","sourcesContent":["import {\n extractBorderValues,\n getFirstSelectedTable,\n getSelectedCells,\n parseValueWithUnit,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n Border,\n ContentModelTable,\n ContentModelTableCell,\n BorderOperations,\n TableSelectionCoordinates,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * Border positions\n */\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\n\n/**\n * @internal\n * Perimeter of the table selection\n * Used to determine where to apply border to the cells adjacent to the selection.\n */\ntype Perimeter = {\n Top: boolean;\n Bottom: boolean;\n Left: boolean;\n Right: boolean;\n};\n\n/**\n * Operations to apply border\n * @param editor The editor instance\n * @param border The border to apply\n * @param operation The operation to apply\n */\nexport function applyTableBorderFormat(\n editor: IEditor,\n border: Border,\n operation: BorderOperations\n) {\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n const sel = getSelectedCells(tableModel);\n const perimeter: Perimeter = {\n Top: false,\n Bottom: false,\n Left: false,\n Right: false,\n };\n\n // Create border format with table format as backup\n let borderFormat = '';\n const format = tableModel.format;\n const { width, style, color } = border;\n const extractedBorder = extractBorderValues(format.borderTop);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n if (width) {\n borderFormat = parseValueWithUnit(width) + 'px';\n } else if (borderWidth) {\n borderFormat = borderWidth;\n } else {\n borderFormat = '1px';\n }\n\n if (style) {\n borderFormat = `${borderFormat} ${style}`;\n } else if (borderStyle) {\n borderFormat = `${borderFormat} ${borderStyle}`;\n } else {\n borderFormat = `${borderFormat} solid`;\n }\n\n if (color) {\n borderFormat = `${borderFormat} ${color}`;\n } else if (borderColor) {\n borderFormat = `${borderFormat} ${borderColor}`;\n }\n\n // undefined is treated as Left to Right\n const isRtl = tableModel.format.direction == 'rtl';\n\n if (sel) {\n const operations: BorderOperations[] = [operation];\n while (operations.length) {\n switch (operations.pop()) {\n case 'noBorders':\n // Do All borders but with empty border format\n borderFormat = '';\n operations.push('allBorders');\n break;\n case 'allBorders':\n const allBorders: BorderPositions[] = [\n 'borderTop',\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[colIndex];\n // Format cells - All borders\n applyBorderFormat(cell, borderFormat, allBorders);\n }\n }\n\n // Format perimeter\n perimeter.Top = true;\n perimeter.Bottom = true;\n perimeter.Left = true;\n perimeter.Right = true;\n break;\n case 'leftBorders':\n const leftBorder: BorderPositions[] = ['borderLeft'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ];\n // Format cells - Left border\n applyBorderFormat(cell, borderFormat, leftBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\n break;\n case 'rightBorders':\n const rightBorder: BorderPositions[] = ['borderRight'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ];\n // Format cells - Right border\n applyBorderFormat(cell, borderFormat, rightBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\n break;\n case 'topBorders':\n const topBorder: BorderPositions[] = ['borderTop'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n // Format cells - Top border\n applyBorderFormat(cell, borderFormat, topBorder);\n }\n\n // Format perimeter\n perimeter.Top = true;\n break;\n case 'bottomBorders':\n const bottomBorder: BorderPositions[] = ['borderBottom'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n // Format cells - Bottom border\n applyBorderFormat(cell, borderFormat, bottomBorder);\n }\n\n // Format perimeter\n perimeter.Bottom = true;\n break;\n case 'insideBorders':\n // Format cells - Inside borders\n const singleCol = sel.lastColumn == sel.firstColumn;\n const singleRow = sel.lastRow == sel.firstRow;\n // Single cell selection\n if (singleCol && singleRow) {\n break;\n }\n // Single column selection\n if (singleCol) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\n borderFormat,\n ['borderBottom']\n );\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex <= sel.lastRow - 1;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\n borderFormat,\n ['borderTop']\n );\n break;\n }\n // Single row selection\n if (singleRow) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderRight']\n );\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex <= sel.lastColumn - 1;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderLeft',\n 'borderRight',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderLeft']\n );\n break;\n }\n\n // For multiple rows and columns selections\n // Top left cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderBottom', 'borderRight']\n );\n // Top right cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderBottom', 'borderLeft']\n );\n // Bottom left cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderTop', 'borderRight']\n );\n // Bottom right cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderTop', 'borderLeft']\n );\n // First row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // Last row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // First column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderLeft' : 'borderRight',\n ]);\n }\n // Last column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderRight' : 'borderLeft',\n ]);\n }\n // Inner cells\n sel.firstColumn++;\n sel.firstRow++;\n sel.lastColumn--;\n sel.lastRow--;\n operations.push('allBorders');\n break;\n case 'outsideBorders':\n // Format cells - Outside borders\n operations.push('topBorders');\n operations.push('bottomBorders');\n operations.push('leftBorders');\n operations.push('rightBorders');\n break;\n default:\n break;\n }\n }\n\n //Format perimeter if necessary or possible\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'tableBorder',\n }\n );\n}\n\n/**\n * @internal\n * Apply border format to a cell\n * @param cell The cell to apply border format\n * @param borderFormat The border format to apply\n * @param positions The positions to apply\n */\nfunction applyBorderFormat(\n cell: ContentModelTableCell,\n borderFormat: string,\n positions: BorderPositions[]\n) {\n positions.forEach(pos => {\n cell.format[pos] = borderFormat;\n });\n\n updateTableCellMetadata(cell, metadata => {\n metadata = metadata || {};\n metadata.borderOverride = true;\n return metadata;\n });\n\n // Cell was modified, so delete cached element\n delete cell.cachedElement;\n}\n\n/**\n * @internal\n * Modify the perimeter of the table selection\n * @param tableModel The table model\n * @param sel The table selection\n * @param borderFormat The border format to apply\n * If borderFormat is empty, the border will be removed\n * @param perimeter Where in the perimeter to apply\n */\nfunction modifyPerimeter(\n tableModel: ContentModelTable,\n sel: TableSelectionCoordinates,\n borderFormat: string,\n perimeter: Perimeter,\n isRtl: boolean\n) {\n // Top of selection\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\n }\n }\n // Bottom of selection\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderTop']);\n }\n }\n // Left of selection\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\n }\n }\n // Right of selection\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\n }\n }\n}\n"]}
@@ -4,4 +4,4 @@ import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor instance
5
5
  * @param operation The table operation to apply
6
6
  */
7
- export default function editTable(editor: IEditor, operation: TableOperation): void;
7
+ export declare function editTable(editor: IEditor, operation: TableOperation): void;
@@ -16,7 +16,7 @@ import { alignTableCellHorizontally, alignTableCellVertically, } from '../../mod
16
16
  * @param editor The editor instance
17
17
  * @param operation The table operation to apply
18
18
  */
19
- export default function editTable(editor, operation) {
19
+ export function editTable(editor, operation) {
20
20
  editor.focus();
21
21
  formatTableWithContentModel(editor, 'editTable', function (tableModel) {
22
22
  switch (operation) {
@@ -1 +1 @@
1
- {"version":3,"file":"editTable.js","source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AAM;YACV,KAAK,aAAa,CAAC;YACnB,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBACb,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBAClC,MAAM;YAEV,KAAK,cAAc;gBACf,iBAAiB,CAAC,UAAU,CAAC,CAAC;gBAC9B,MAAM;YAEV,KAAK,WAAW;gBACZ,cAAc,CAAC,UAAU,CAAC,CAAC;gBAC3B,MAAM;YAEV,KAAK,aAAa;gBACd,WAAW,CAAC,UAAU,CAAC,CAAC;gBACxB,MAAM;YAEV,KAAK,aAAa,CAAC;YACnB,KAAK,aAAa;gBACd,cAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACtC,MAAM;YAEV,KAAK,YAAY,CAAC;YAClB,KAAK,aAAa;gBACd,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACzC,MAAM;YAEV,KAAK,YAAY,CAAC;YAClB,KAAK,YAAY;gBACb,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAEV,KAAK,YAAY;gBACb,eAAe,CAAC,UAAU,CAAC,CAAC;gBAC5B,MAAM;YAEV,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBACb,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACxC,MAAM;YAEV,KAAK,mBAAmB;gBACpB,0BAA0B,CAAC,UAAU,CAAC,CAAC;gBACvC,MAAM;YAEV,KAAK,iBAAiB;gBAClB,wBAAwB,CAAC,UAAU,CAAC,CAAC;gBACrC,MAAM;SACb;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\nimport { deleteTable } from '../../modelApi/table/deleteTable';\nimport { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';\nimport { deleteTableRow } from '../../modelApi/table/deleteTableRow';\nimport { formatTableWithContentModel } from '../utils/formatTableWithContentModel';\nimport { insertTableColumn } from '../../modelApi/table/insertTableColumn';\nimport { insertTableRow } from '../../modelApi/table/insertTableRow';\nimport { mergeTableCells } from '../../modelApi/table/mergeTableCells';\nimport { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';\nimport { mergeTableRow } from '../../modelApi/table/mergeTableRow';\nimport { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';\nimport { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';\nimport type { TableOperation, IEditor } from 'roosterjs-content-model-types';\nimport {\n alignTableCellHorizontally,\n alignTableCellVertically,\n} from '../../modelApi/table/alignTableCell';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param operation The table operation to apply\n */\nexport default function editTable(editor: IEditor, operation: TableOperation) {\n editor.focus();\n\n formatTableWithContentModel(editor, 'editTable', tableModel => {\n switch (operation) {\n case 'alignCellLeft':\n case 'alignCellCenter':\n case 'alignCellRight':\n alignTableCellHorizontally(tableModel, operation);\n break;\n case 'alignCellTop':\n case 'alignCellMiddle':\n case 'alignCellBottom':\n alignTableCellVertically(tableModel, operation);\n break;\n case 'alignCenter':\n case 'alignLeft':\n case 'alignRight':\n alignTable(tableModel, operation);\n break;\n\n case 'deleteColumn':\n deleteTableColumn(tableModel);\n break;\n\n case 'deleteRow':\n deleteTableRow(tableModel);\n break;\n\n case 'deleteTable':\n deleteTable(tableModel);\n break;\n\n case 'insertAbove':\n case 'insertBelow':\n insertTableRow(tableModel, operation);\n break;\n\n case 'insertLeft':\n case 'insertRight':\n insertTableColumn(tableModel, operation);\n break;\n\n case 'mergeAbove':\n case 'mergeBelow':\n mergeTableRow(tableModel, operation);\n break;\n\n case 'mergeCells':\n mergeTableCells(tableModel);\n break;\n\n case 'mergeLeft':\n case 'mergeRight':\n mergeTableColumn(tableModel, operation);\n break;\n\n case 'splitHorizontally':\n splitTableCellHorizontally(tableModel);\n break;\n\n case 'splitVertically':\n splitTableCellVertically(tableModel);\n break;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"editTable.js","sourceRoot":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CAAC;YACnB,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBACb,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBAClC,MAAM;YAEV,KAAK,cAAc;gBACf,iBAAiB,CAAC,UAAU,CAAC,CAAC;gBAC9B,MAAM;YAEV,KAAK,WAAW;gBACZ,cAAc,CAAC,UAAU,CAAC,CAAC;gBAC3B,MAAM;YAEV,KAAK,aAAa;gBACd,WAAW,CAAC,UAAU,CAAC,CAAC;gBACxB,MAAM;YAEV,KAAK,aAAa,CAAC;YACnB,KAAK,aAAa;gBACd,cAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACtC,MAAM;YAEV,KAAK,YAAY,CAAC;YAClB,KAAK,aAAa;gBACd,iBAAiB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACzC,MAAM;YAEV,KAAK,YAAY,CAAC;YAClB,KAAK,YAAY;gBACb,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACrC,MAAM;YAEV,KAAK,YAAY;gBACb,eAAe,CAAC,UAAU,CAAC,CAAC;gBAC5B,MAAM;YAEV,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBACb,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;gBACxC,MAAM;YAEV,KAAK,mBAAmB;gBACpB,0BAA0B,CAAC,UAAU,CAAC,CAAC;gBACvC,MAAM;YAEV,KAAK,iBAAiB;gBAClB,wBAAwB,CAAC,UAAU,CAAC,CAAC;gBACrC,MAAM;SACb;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\nimport { deleteTable } from '../../modelApi/table/deleteTable';\nimport { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';\nimport { deleteTableRow } from '../../modelApi/table/deleteTableRow';\nimport { formatTableWithContentModel } from '../utils/formatTableWithContentModel';\nimport { insertTableColumn } from '../../modelApi/table/insertTableColumn';\nimport { insertTableRow } from '../../modelApi/table/insertTableRow';\nimport { mergeTableCells } from '../../modelApi/table/mergeTableCells';\nimport { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';\nimport { mergeTableRow } from '../../modelApi/table/mergeTableRow';\nimport { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';\nimport { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';\nimport type { TableOperation, IEditor } from 'roosterjs-content-model-types';\nimport {\n alignTableCellHorizontally,\n alignTableCellVertically,\n} from '../../modelApi/table/alignTableCell';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param operation The table operation to apply\n */\nexport function editTable(editor: IEditor, operation: TableOperation) {\n editor.focus();\n\n formatTableWithContentModel(editor, 'editTable', tableModel => {\n switch (operation) {\n case 'alignCellLeft':\n case 'alignCellCenter':\n case 'alignCellRight':\n alignTableCellHorizontally(tableModel, operation);\n break;\n case 'alignCellTop':\n case 'alignCellMiddle':\n case 'alignCellBottom':\n alignTableCellVertically(tableModel, operation);\n break;\n case 'alignCenter':\n case 'alignLeft':\n case 'alignRight':\n alignTable(tableModel, operation);\n break;\n\n case 'deleteColumn':\n deleteTableColumn(tableModel);\n break;\n\n case 'deleteRow':\n deleteTableRow(tableModel);\n break;\n\n case 'deleteTable':\n deleteTable(tableModel);\n break;\n\n case 'insertAbove':\n case 'insertBelow':\n insertTableRow(tableModel, operation);\n break;\n\n case 'insertLeft':\n case 'insertRight':\n insertTableColumn(tableModel, operation);\n break;\n\n case 'mergeAbove':\n case 'mergeBelow':\n mergeTableRow(tableModel, operation);\n break;\n\n case 'mergeCells':\n mergeTableCells(tableModel);\n break;\n\n case 'mergeLeft':\n case 'mergeRight':\n mergeTableColumn(tableModel, operation);\n break;\n\n case 'splitHorizontally':\n splitTableCellHorizontally(tableModel);\n break;\n\n case 'splitVertically':\n splitTableCellVertically(tableModel);\n break;\n }\n });\n}\n"]}
@@ -5,4 +5,4 @@ import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types
5
5
  * @param format The table format to apply
6
6
  * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
7
7
  */
8
- export default function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
8
+ export declare function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
@@ -1,12 +1,12 @@
1
1
  import { __read } from "tslib";
2
- import { applyTableFormat, getFirstSelectedTable, updateTableCellMetadata, } from 'roosterjs-content-model-core';
2
+ import { applyTableFormat, getFirstSelectedTable, updateTableCellMetadata, } from 'roosterjs-content-model-dom';
3
3
  /**
4
4
  * Format current focused table with the given format
5
5
  * @param editor The editor instance
6
6
  * @param format The table format to apply
7
7
  * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
8
8
  */
9
- export default function formatTable(editor, format, keepCellShade) {
9
+ export function formatTable(editor, format, keepCellShade) {
10
10
  editor.focus();
11
11
  editor.formatContentModel(function (model) {
12
12
  var _a = __read(getFirstSelectedTable(model), 1), tableModel = _a[0];
@@ -1 +1 @@
1
- {"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,8BAA8B,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,MAAe,EACf,MAA2B,EAC3B,aAAuB;IAEvB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,uBAAuB;YACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,uBAAuB,CAAC,IAAI,EAAE,UAAA,QAAQ;wBAClC,IAAI,QAAQ,EAAE;4BACV,OAAO,QAAQ,CAAC,cAAc,CAAC;yBAClC;wBACD,OAAO,QAAQ,CAAC;oBACpB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\n applyTableFormat,\n getFirstSelectedTable,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param format The table format to apply\n * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color\n */\nexport default function formatTable(\n editor: IEditor,\n format: TableMetadataFormat,\n keepCellShade?: boolean\n) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n // Wipe border metadata\n tableModel.rows.forEach(row => {\n row.cells.forEach(cell => {\n updateTableCellMetadata(cell, metadata => {\n if (metadata) {\n delete metadata.borderOverride;\n }\n return metadata;\n });\n });\n });\n applyTableFormat(tableModel, format, keepCellShade);\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'formatTable',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,6BAA6B,CAAC;AAGrC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,MAA2B,EAAE,aAAuB;IAC7F,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAe,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;QAElD,IAAI,UAAU,EAAE;YACZ,uBAAuB;YACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,uBAAuB,CAAC,IAAI,EAAE,UAAA,QAAQ;wBAClC,IAAI,QAAQ,EAAE;4BACV,OAAO,QAAQ,CAAC,cAAc,CAAC;yBAClC;wBACD,OAAO,QAAQ,CAAC;oBACpB,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;YACpD,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\n applyTableFormat,\n getFirstSelectedTable,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-dom';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param format The table format to apply\n * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color\n */\nexport function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n // Wipe border metadata\n tableModel.rows.forEach(row => {\n row.cells.forEach(cell => {\n updateTableCellMetadata(cell, metadata => {\n if (metadata) {\n delete metadata.borderOverride;\n }\n return metadata;\n });\n });\n });\n applyTableFormat(tableModel, format, keepCellShade);\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'formatTable',\n }\n );\n}\n"]}
@@ -8,4 +8,4 @@ import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types
8
8
  * @param format (Optional) The table format. If not passed, the default format will be applied:
9
9
  * background color: #FFF; border color: #ABABAB
10
10
  */
11
- export default function insertTable(editor: IEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
11
+ export declare function insertTable(editor: IEditor, columns: number, rows: number, format?: Partial<TableMetadataFormat>): void;
@@ -1,6 +1,5 @@
1
- import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';
2
1
  import { createTableStructure } from '../../modelApi/table/createTableStructure';
3
- import { applyTableFormat, deleteSelection, mergeModel, normalizeTable, setSelection, } from 'roosterjs-content-model-core';
2
+ import { createContentModelDocument, createSelectionMarker, applyTableFormat, deleteSelection, mergeModel, normalizeTable, setSelection, } from 'roosterjs-content-model-dom';
4
3
  /**
5
4
  * Insert table into editor at current selection
6
5
  * @param editor The editor instance
@@ -10,7 +9,7 @@ import { applyTableFormat, deleteSelection, mergeModel, normalizeTable, setSelec
10
9
  * @param format (Optional) The table format. If not passed, the default format will be applied:
11
10
  * background color: #FFF; border color: #ABABAB
12
11
  */
13
- export default function insertTable(editor, columns, rows, format) {
12
+ export function insertTable(editor, columns, rows, format) {
14
13
  editor.focus();
15
14
  editor.formatContentModel(function (model, context) {
16
15
  var _a, _b, _c;
@@ -1 +1 @@
1
- {"version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,GACf,MAAM,8BAA8B,CAAC;AAG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;aAC/B;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { createTableStructure } from '../../modelApi/table/createTableStructure';\nimport {\n applyTableFormat,\n deleteSelection,\n mergeModel,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Insert table into editor at current selection\n * @param editor The editor instance\n * @param columns Number of columns in table, it also controls the default table cell width:\n * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px\n * @param rows Number of rows in table\n * @param format (Optional) The table format. If not passed, the default format will be applied:\n * background color: #FFF; border color: #ABABAB\n */\nexport default function insertTable(\n editor: IEditor,\n columns: number,\n rows: number,\n format?: Partial<TableMetadataFormat>\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const insertPosition = deleteSelection(model, [], context).insertPoint;\n\n if (insertPosition) {\n const doc = createContentModelDocument();\n const table = createTableStructure(doc, columns, rows);\n\n normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);\n // Assign default vertical align\n format = format || { verticalAlign: 'top' };\n applyTableFormat(table, format);\n mergeModel(model, doc, context, {\n insertPosition,\n mergeFormat: 'mergeAll',\n });\n\n const firstBlock = table.rows[0]?.cells[0]?.blocks[0];\n\n if (firstBlock?.blockType == 'Paragraph') {\n const marker = createSelectionMarker(firstBlock.segments[0]?.format);\n firstBlock.segments.unshift(marker);\n setSelection(model, marker);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'insertTable',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oB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CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC;gBACrE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aAC/B;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { createTableStructure } from '../../modelApi/table/createTableStructure';\nimport {\n createContentModelDocument,\n createSelectionMarker,\n applyTableFormat,\n deleteSelection,\n mergeModel,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-dom';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Insert table into editor at current selection\n * @param editor The editor instance\n * @param columns Number of columns in table, it also controls the default table cell width:\n * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px\n * @param rows Number of rows in table\n * @param format (Optional) The table format. If not passed, the default format will be applied:\n * background color: #FFF; border color: #ABABAB\n */\nexport function insertTable(\n editor: IEditor,\n columns: number,\n rows: number,\n format?: Partial<TableMetadataFormat>\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const insertPosition = deleteSelection(model, [], context).insertPoint;\n\n if (insertPosition) {\n const doc = createContentModelDocument();\n const table = createTableStructure(doc, columns, rows);\n\n normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);\n // Assign default vertical align\n format = format || { verticalAlign: 'top' };\n applyTableFormat(table, format);\n mergeModel(model, doc, context, {\n insertPosition,\n mergeFormat: 'mergeAll',\n });\n\n const firstBlock = table.rows[0]?.cells[0]?.blocks[0];\n\n if (firstBlock?.blockType == 'Paragraph') {\n const marker = createSelectionMarker(firstBlock.segments[0]?.format);\n firstBlock.segments.unshift(marker);\n setSelection(model, marker);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'insertTable',\n }\n );\n}\n"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor instance
5
5
  * @param color The color to set. Pass null to remove existing shade color
6
6
  */
7
- export default function setTableCellShade(editor: IEditor, color: string | null): void;
7
+ export declare function setTableCellShade(editor: IEditor, color: string | null): void;
@@ -1,11 +1,11 @@
1
1
  import { __read } from "tslib";
2
- import { hasSelectionInBlockGroup, getFirstSelectedTable, normalizeTable, setTableCellBackgroundColor, } from 'roosterjs-content-model-core';
2
+ import { hasSelectionInBlockGroup, getFirstSelectedTable, normalizeTable, setTableCellBackgroundColor, } from 'roosterjs-content-model-dom';
3
3
  /**
4
4
  * Set table cell shade color
5
5
  * @param editor The editor instance
6
6
  * @param color The color to set. Pass null to remove existing shade color
7
7
  */
8
- export default function setTableCellShade(editor, color) {
8
+ export function setTableCellShade(editor, color) {
9
9
  editor.focus();
10
10
  editor.formatContentModel(function (model) {
11
11
  var _a = __read(getFirstSelectedTable(model), 1), table = _a[0];
@@ -1 +1 @@
1
- {"version":3,"file":"setTableCellShade.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/setTableCellShade.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,GAC9B,MAAM,8BAA8B,CAAC;AAGtC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,MAAe,EAAE,KAAoB;IAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAU,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAArC,KAAK,QAAgC,CAAC;QAE7C,IAAI,KAAK,EAAE;YACP,cAAc,CAAC,KAAK,CAAC,CAAC;YAEtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,OAAA,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE;wBAChC,2BAA2B,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;qBACtE;gBACL,CAAC,CAAC;YAJF,CAIE,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,mBAAmB;KAC/B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\n hasSelectionInBlockGroup,\n getFirstSelectedTable,\n normalizeTable,\n setTableCellBackgroundColor,\n} from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set table cell shade color\n * @param editor The editor instance\n * @param color The color to set. Pass null to remove existing shade color\n */\nexport default function setTableCellShade(editor: IEditor, color: string | null) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [table] = getFirstSelectedTable(model);\n\n if (table) {\n normalizeTable(table);\n\n table.rows.forEach(row =>\n row.cells.forEach(cell => {\n if (hasSelectionInBlockGroup(cell)) {\n setTableCellBackgroundColor(cell, color, true /*isColorOverride*/);\n }\n })\n );\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setTableCellShade',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setTableCellShade.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/setTableCellShade.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACd,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC;AAGrC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAe,EAAE,KAAoB;IACnE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,OAAU,qBAAqB,CAAC,KAAK,CAAC,IAAA,EAArC,KAAK,QAAgC,CAAC;QAE7C,IAAI,KAAK,EAAE;YACP,cAAc,CAAC,KAAK,CAAC,CAAC;YAEtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,OAAA,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE;wBAChC,2BAA2B,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;qBACtE;gBACL,CAAC,CAAC;YAJF,CAIE,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,mBAAmB;KAC/B,CACJ,CAAC;AACN,CAAC","sourcesContent":["import {\n hasSelectionInBlockGroup,\n getFirstSelectedTable,\n normalizeTable,\n setTableCellBackgroundColor,\n} from 'roosterjs-content-model-dom';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set table cell shade color\n * @param editor The editor instance\n * @param color The color to set. Pass null to remove existing shade color\n */\nexport function setTableCellShade(editor: IEditor, color: string | null) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [table] = getFirstSelectedTable(model);\n\n if (table) {\n normalizeTable(table);\n\n table.rows.forEach(row =>\n row.cells.forEach(cell => {\n if (hasSelectionInBlockGroup(cell)) {\n setTableCellBackgroundColor(cell, color, true /*isColorOverride*/);\n }\n })\n );\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setTableCellShade',\n }\n );\n}\n"]}
@@ -1,5 +1,8 @@
1
1
  import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
- * @internal
3
+ * Invoke a callback to format the selected image using Content Model
4
+ * @param editor The editor object
5
+ * @param apiName Name of API this calling this function. This is mostly for logging.
6
+ * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.
4
7
  */
5
- export default function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
8
+ export declare function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
@@ -1,8 +1,11 @@
1
1
  import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';
2
2
  /**
3
- * @internal
3
+ * Invoke a callback to format the selected image using Content Model
4
+ * @param editor The editor object
5
+ * @param apiName Name of API this calling this function. This is mostly for logging.
6
+ * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.
4
7
  */
5
- export default function formatImageWithContentModel(editor, apiName, callback) {
8
+ export function formatImageWithContentModel(editor, apiName, callback) {
6
9
  formatSegmentWithContentModel(editor, apiName, function (_, __, segment) {
7
10
  if ((segment === null || segment === void 0 ? void 0 : segment.segmentType) == 'Image') {
8
11
  callback(segment);
@@ -1 +1 @@
1
- {"version":3,"file":"formatImageWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatImageWithContentModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAC/C,MAAe,EACf,OAAe,EACf,QAA8C;IAE9C,6BAA6B,CACzB,MAAM,EACN,OAAO,EACP,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACX,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,OAAO,EAAE;YACjC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrB;IACL,CAAC,EACD,SAAS,CAAC,+BAA+B,EACzC,SAAS,CAAC,4BAA4B,CACzC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport default function formatImageWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (segment: ContentModelImage) => void\n) {\n formatSegmentWithContentModel(\n editor,\n apiName,\n (_, __, segment) => {\n if (segment?.segmentType == 'Image') {\n callback(segment);\n }\n },\n undefined /** segmentHasStyleCallback **/,\n undefined /** includingFormatHolder */\n );\n}\n"]}
1
+ {"version":3,"file":"formatImageWithContentModel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/utils/formatImageWithContentModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACvC,MAAe,EACf,OAAe,EACf,QAA8C;IAE9C,6BAA6B,CACzB,MAAM,EACN,OAAO,EACP,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACX,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,OAAO,EAAE;YACjC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrB;IACL,CAAC,EACD,SAAS,CAAC,+BAA+B,EACzC,SAAS,CAAC,4BAA4B,CACzC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected image using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.\n */\nexport function formatImageWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (segment: ContentModelImage) => void\n) {\n formatSegmentWithContentModel(\n editor,\n apiName,\n (_, __, segment) => {\n if (segment?.segmentType == 'Image') {\n callback(segment);\n }\n },\n undefined /** segmentHasStyleCallback **/,\n undefined /** includingFormatHolder */\n );\n}\n"]}