roosterjs-content-model-api 0.26.0 → 0.26.2

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 (703) hide show
  1. package/lib/index.d.ts +48 -48
  2. package/lib/index.js +99 -99
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
  5. package/lib/modelApi/block/setModelAlignment.js +62 -62
  6. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  7. package/lib/modelApi/block/setModelDirection.d.ts +5 -5
  8. package/lib/modelApi/block/setModelDirection.js +68 -68
  9. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  10. package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
  11. package/lib/modelApi/block/setModelIndentation.js +138 -138
  12. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  13. package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  14. package/lib/modelApi/block/toggleModelBlockQuote.js +50 -50
  15. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  16. package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
  17. package/lib/modelApi/common/clearModelFormat.js +129 -129
  18. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  19. package/lib/modelApi/common/wrapBlock.d.ts +16 -16
  20. package/lib/modelApi/common/wrapBlock.js +48 -48
  21. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  22. package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
  23. package/lib/modelApi/entity/insertEntityModel.js +79 -79
  24. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  25. package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  26. package/lib/modelApi/image/applyImageBorderFormat.js +57 -57
  27. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  28. package/lib/modelApi/link/matchLink.d.ts +29 -29
  29. package/lib/modelApi/link/matchLink.js +94 -94
  30. package/lib/modelApi/link/matchLink.js.map +1 -1
  31. package/lib/modelApi/list/findListItemsInSameThread.d.ts +7 -7
  32. package/lib/modelApi/list/findListItemsInSameThread.js +114 -114
  33. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  34. package/lib/modelApi/list/setListType.d.ts +7 -7
  35. package/lib/modelApi/list/setListType.js +113 -113
  36. package/lib/modelApi/list/setListType.js.map +1 -1
  37. package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  38. package/lib/modelApi/selection/adjustSegmentSelection.js +47 -47
  39. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  40. package/lib/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  41. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +55 -55
  42. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  43. package/lib/modelApi/selection/adjustWordSelection.d.ts +5 -5
  44. package/lib/modelApi/selection/adjustWordSelection.js +121 -121
  45. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  46. package/lib/modelApi/selection/collapseTableSelection.d.ts +5 -5
  47. package/lib/modelApi/selection/collapseTableSelection.js +16 -16
  48. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  49. package/lib/modelApi/table/alignTable.d.ts +5 -5
  50. package/lib/modelApi/table/alignTable.js +12 -12
  51. package/lib/modelApi/table/alignTable.js.map +1 -1
  52. package/lib/modelApi/table/alignTableCell.d.ts +9 -9
  53. package/lib/modelApi/table/alignTableCell.js +58 -58
  54. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  55. package/lib/modelApi/table/canMergeCells.d.ts +5 -5
  56. package/lib/modelApi/table/canMergeCells.js +56 -56
  57. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  58. package/lib/modelApi/table/clearSelectedCells.d.ts +8 -8
  59. package/lib/modelApi/table/clearSelectedCells.js +26 -26
  60. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  61. package/lib/modelApi/table/createTableStructure.d.ts +5 -5
  62. package/lib/modelApi/table/createTableStructure.js +19 -19
  63. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  64. package/lib/modelApi/table/deleteTable.d.ts +5 -5
  65. package/lib/modelApi/table/deleteTable.js +11 -11
  66. package/lib/modelApi/table/deleteTable.js.map +1 -1
  67. package/lib/modelApi/table/deleteTableColumn.d.ts +5 -5
  68. package/lib/modelApi/table/deleteTableColumn.js +24 -24
  69. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  70. package/lib/modelApi/table/deleteTableRow.d.ts +5 -5
  71. package/lib/modelApi/table/deleteTableRow.js +23 -23
  72. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  73. package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  74. package/lib/modelApi/table/ensureFocusableParagraphForTable.js +56 -56
  75. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  76. package/lib/modelApi/table/insertTableColumn.d.ts +7 -7
  77. package/lib/modelApi/table/insertTableColumn.js +28 -28
  78. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  79. package/lib/modelApi/table/insertTableRow.d.ts +7 -7
  80. package/lib/modelApi/table/insertTableRow.js +32 -32
  81. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  82. package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
  83. package/lib/modelApi/table/mergeTableCells.js +26 -26
  84. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  85. package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
  86. package/lib/modelApi/table/mergeTableColumn.js +37 -37
  87. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  88. package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
  89. package/lib/modelApi/table/mergeTableRow.js +38 -38
  90. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  91. package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  92. package/lib/modelApi/table/splitTableCellHorizontally.js +54 -54
  93. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  94. package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -5
  95. package/lib/modelApi/table/splitTableCellVertically.js +57 -57
  96. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  97. package/lib/publicApi/block/setAlignment.d.ts +7 -7
  98. package/lib/publicApi/block/setAlignment.js +15 -15
  99. package/lib/publicApi/block/setAlignment.js.map +1 -1
  100. package/lib/publicApi/block/setDirection.d.ts +7 -7
  101. package/lib/publicApi/block/setDirection.js +15 -15
  102. package/lib/publicApi/block/setDirection.js.map +1 -1
  103. package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
  104. package/lib/publicApi/block/setHeadingLevel.js +49 -49
  105. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  106. package/lib/publicApi/block/setIndentation.d.ts +8 -8
  107. package/lib/publicApi/block/setIndentation.js +24 -24
  108. package/lib/publicApi/block/setIndentation.js.map +1 -1
  109. package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
  110. package/lib/publicApi/block/setParagraphMargin.js +32 -32
  111. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  112. package/lib/publicApi/block/setSpacing.d.ts +7 -7
  113. package/lib/publicApi/block/setSpacing.js +20 -20
  114. package/lib/publicApi/block/setSpacing.js.map +1 -1
  115. package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
  116. package/lib/publicApi/block/toggleBlockQuote.js +38 -38
  117. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  118. package/lib/publicApi/entity/insertEntity.d.ts +25 -25
  119. package/lib/publicApi/entity/insertEntity.js +41 -41
  120. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  121. package/lib/publicApi/format/clearFormat.d.ts +6 -6
  122. package/lib/publicApi/format/clearFormat.js +22 -22
  123. package/lib/publicApi/format/clearFormat.js.map +1 -1
  124. package/lib/publicApi/format/getFormatState.d.ts +6 -6
  125. package/lib/publicApi/format/getFormatState.js +20 -20
  126. package/lib/publicApi/format/getFormatState.js.map +1 -1
  127. package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
  128. package/lib/publicApi/image/adjustImageSelection.js +25 -25
  129. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  130. package/lib/publicApi/image/changeImage.d.ts +7 -7
  131. package/lib/publicApi/image/changeImage.js +34 -34
  132. package/lib/publicApi/image/changeImage.js.map +1 -1
  133. package/lib/publicApi/image/insertImage.d.ts +7 -7
  134. package/lib/publicApi/image/insertImage.js +36 -36
  135. package/lib/publicApi/image/insertImage.js.map +1 -1
  136. package/lib/publicApi/image/setImageAltText.d.ts +8 -8
  137. package/lib/publicApi/image/setImageAltText.js +16 -16
  138. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  139. package/lib/publicApi/image/setImageBorder.d.ts +9 -9
  140. package/lib/publicApi/image/setImageBorder.js +18 -18
  141. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  142. package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
  143. package/lib/publicApi/image/setImageBoxShadow.js +28 -28
  144. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  145. package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
  146. package/lib/publicApi/link/adjustLinkSelection.js +33 -33
  147. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  148. package/lib/publicApi/link/insertLink.d.ts +15 -15
  149. package/lib/publicApi/link/insertLink.js +119 -119
  150. package/lib/publicApi/link/insertLink.js.map +1 -1
  151. package/lib/publicApi/link/removeLink.d.ts +8 -8
  152. package/lib/publicApi/link/removeLink.js +31 -31
  153. package/lib/publicApi/link/removeLink.js.map +1 -1
  154. package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
  155. package/lib/publicApi/list/setListStartNumber.js +25 -25
  156. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  157. package/lib/publicApi/list/setListStyle.d.ts +7 -7
  158. package/lib/publicApi/list/setListStyle.js +32 -32
  159. package/lib/publicApi/list/setListStyle.js.map +1 -1
  160. package/lib/publicApi/list/toggleBullet.d.ts +8 -8
  161. package/lib/publicApi/list/toggleBullet.js +19 -19
  162. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  163. package/lib/publicApi/list/toggleNumbering.d.ts +8 -8
  164. package/lib/publicApi/list/toggleNumbering.js +19 -19
  165. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  166. package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
  167. package/lib/publicApi/segment/applySegmentFormat.js +22 -22
  168. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  169. package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
  170. package/lib/publicApi/segment/changeCapitalization.js +48 -48
  171. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  172. package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
  173. package/lib/publicApi/segment/changeFontSize.js +61 -61
  174. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  175. package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -7
  176. package/lib/publicApi/segment/setBackgroundColor.js +35 -35
  177. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  178. package/lib/publicApi/segment/setFontName.d.ts +7 -7
  179. package/lib/publicApi/segment/setFontName.js +18 -18
  180. package/lib/publicApi/segment/setFontName.js.map +1 -1
  181. package/lib/publicApi/segment/setFontSize.d.ts +12 -12
  182. package/lib/publicApi/segment/setFontSize.js +33 -33
  183. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  184. package/lib/publicApi/segment/setTextColor.d.ts +7 -7
  185. package/lib/publicApi/segment/setTextColor.js +25 -25
  186. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  187. package/lib/publicApi/segment/toggleBold.d.ts +6 -6
  188. package/lib/publicApi/segment/toggleBold.js +20 -20
  189. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  190. package/lib/publicApi/segment/toggleCode.d.ts +6 -6
  191. package/lib/publicApi/segment/toggleCode.js +27 -27
  192. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  193. package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
  194. package/lib/publicApi/segment/toggleItalic.js +14 -14
  195. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  196. package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  197. package/lib/publicApi/segment/toggleStrikethrough.js +14 -14
  198. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  199. package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
  200. package/lib/publicApi/segment/toggleSubscript.js +14 -14
  201. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  202. package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
  203. package/lib/publicApi/segment/toggleSuperscript.js +14 -14
  204. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  205. package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
  206. package/lib/publicApi/segment/toggleUnderline.js +18 -18
  207. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  208. package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  209. package/lib/publicApi/table/applyTableBorderFormat.js +293 -293
  210. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  211. package/lib/publicApi/table/editTable.d.ts +7 -7
  212. package/lib/publicApi/table/editTable.js +77 -77
  213. package/lib/publicApi/table/editTable.js.map +1 -1
  214. package/lib/publicApi/table/formatTable.d.ts +8 -8
  215. package/lib/publicApi/table/formatTable.js +37 -37
  216. package/lib/publicApi/table/formatTable.js.map +1 -1
  217. package/lib/publicApi/table/insertTable.d.ts +11 -11
  218. package/lib/publicApi/table/insertTable.js +46 -46
  219. package/lib/publicApi/table/insertTable.js.map +1 -1
  220. package/lib/publicApi/table/setTableCellShade.d.ts +7 -7
  221. package/lib/publicApi/table/setTableCellShade.js +32 -32
  222. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  223. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -5
  224. package/lib/publicApi/utils/formatImageWithContentModel.js +14 -14
  225. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  226. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
  227. package/lib/publicApi/utils/formatParagraphWithContentModel.js +18 -18
  228. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  229. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
  230. package/lib/publicApi/utils/formatSegmentWithContentModel.js +46 -46
  231. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  232. package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  233. package/lib/publicApi/utils/formatTableWithContentModel.js +43 -43
  234. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  235. package/lib-amd/index.d.ts +48 -48
  236. package/lib-amd/index.js +53 -53
  237. package/lib-amd/index.js.map +1 -1
  238. package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -5
  239. package/lib-amd/modelApi/block/setModelAlignment.js +62 -62
  240. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  241. package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -5
  242. package/lib-amd/modelApi/block/setModelDirection.js +68 -68
  243. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  244. package/lib-amd/modelApi/block/setModelIndentation.d.ts +8 -8
  245. package/lib-amd/modelApi/block/setModelIndentation.js +137 -137
  246. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  247. package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  248. package/lib-amd/modelApi/block/toggleModelBlockQuote.js +49 -49
  249. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  250. package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
  251. package/lib-amd/modelApi/common/clearModelFormat.js +127 -127
  252. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  253. package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
  254. package/lib-amd/modelApi/common/wrapBlock.js +48 -48
  255. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  256. package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -5
  257. package/lib-amd/modelApi/entity/insertEntityModel.js +78 -78
  258. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  259. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  260. package/lib-amd/modelApi/image/applyImageBorderFormat.js +57 -57
  261. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  262. package/lib-amd/modelApi/link/matchLink.d.ts +29 -29
  263. package/lib-amd/modelApi/link/matchLink.js +94 -94
  264. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  265. package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +7 -7
  266. package/lib-amd/modelApi/list/findListItemsInSameThread.js +116 -116
  267. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  268. package/lib-amd/modelApi/list/setListType.d.ts +7 -7
  269. package/lib-amd/modelApi/list/setListType.js +113 -113
  270. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  271. package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  272. package/lib-amd/modelApi/selection/adjustSegmentSelection.js +48 -48
  273. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  274. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  275. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +54 -54
  276. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  277. package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +5 -5
  278. package/lib-amd/modelApi/selection/adjustWordSelection.js +120 -120
  279. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  280. package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +5 -5
  281. package/lib-amd/modelApi/selection/collapseTableSelection.js +17 -17
  282. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  283. package/lib-amd/modelApi/table/alignTable.d.ts +5 -5
  284. package/lib-amd/modelApi/table/alignTable.js +14 -14
  285. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  286. package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -9
  287. package/lib-amd/modelApi/table/alignTableCell.js +59 -59
  288. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  289. package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -5
  290. package/lib-amd/modelApi/table/canMergeCells.js +58 -58
  291. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  292. package/lib-amd/modelApi/table/clearSelectedCells.d.ts +8 -8
  293. package/lib-amd/modelApi/table/clearSelectedCells.js +27 -27
  294. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  295. package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -5
  296. package/lib-amd/modelApi/table/createTableStructure.js +20 -20
  297. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  298. package/lib-amd/modelApi/table/deleteTable.d.ts +5 -5
  299. package/lib-amd/modelApi/table/deleteTable.js +13 -13
  300. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  301. package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -5
  302. package/lib-amd/modelApi/table/deleteTableColumn.js +24 -24
  303. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  304. package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -5
  305. package/lib-amd/modelApi/table/deleteTableRow.js +23 -23
  306. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  307. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  308. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +57 -57
  309. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  310. package/lib-amd/modelApi/table/insertTableColumn.d.ts +7 -7
  311. package/lib-amd/modelApi/table/insertTableColumn.js +27 -27
  312. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  313. package/lib-amd/modelApi/table/insertTableRow.d.ts +7 -7
  314. package/lib-amd/modelApi/table/insertTableRow.js +30 -30
  315. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  316. package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -5
  317. package/lib-amd/modelApi/table/mergeTableCells.js +26 -26
  318. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  319. package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -5
  320. package/lib-amd/modelApi/table/mergeTableColumn.js +37 -37
  321. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  322. package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -5
  323. package/lib-amd/modelApi/table/mergeTableRow.js +38 -38
  324. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  325. package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  326. package/lib-amd/modelApi/table/splitTableCellHorizontally.js +53 -53
  327. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  328. package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -5
  329. package/lib-amd/modelApi/table/splitTableCellVertically.js +56 -56
  330. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  331. package/lib-amd/publicApi/block/setAlignment.d.ts +7 -7
  332. package/lib-amd/publicApi/block/setAlignment.js +16 -16
  333. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  334. package/lib-amd/publicApi/block/setDirection.d.ts +7 -7
  335. package/lib-amd/publicApi/block/setDirection.js +16 -16
  336. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  337. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -7
  338. package/lib-amd/publicApi/block/setHeadingLevel.js +50 -50
  339. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  340. package/lib-amd/publicApi/block/setIndentation.d.ts +8 -8
  341. package/lib-amd/publicApi/block/setIndentation.js +24 -24
  342. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  343. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -9
  344. package/lib-amd/publicApi/block/setParagraphMargin.js +32 -32
  345. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  346. package/lib-amd/publicApi/block/setSpacing.d.ts +7 -7
  347. package/lib-amd/publicApi/block/setSpacing.js +21 -21
  348. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  349. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -9
  350. package/lib-amd/publicApi/block/toggleBlockQuote.js +38 -38
  351. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  352. package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -25
  353. package/lib-amd/publicApi/entity/insertEntity.js +40 -40
  354. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  355. package/lib-amd/publicApi/format/clearFormat.d.ts +6 -6
  356. package/lib-amd/publicApi/format/clearFormat.js +22 -22
  357. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  358. package/lib-amd/publicApi/format/getFormatState.d.ts +6 -6
  359. package/lib-amd/publicApi/format/getFormatState.js +21 -21
  360. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  361. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -6
  362. package/lib-amd/publicApi/image/adjustImageSelection.js +26 -26
  363. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  364. package/lib-amd/publicApi/image/changeImage.d.ts +7 -7
  365. package/lib-amd/publicApi/image/changeImage.js +34 -34
  366. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  367. package/lib-amd/publicApi/image/insertImage.d.ts +7 -7
  368. package/lib-amd/publicApi/image/insertImage.js +36 -36
  369. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  370. package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -8
  371. package/lib-amd/publicApi/image/setImageAltText.js +17 -17
  372. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  373. package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -9
  374. package/lib-amd/publicApi/image/setImageBorder.js +18 -18
  375. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  376. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -8
  377. package/lib-amd/publicApi/image/setImageBoxShadow.js +29 -29
  378. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  379. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -6
  380. package/lib-amd/publicApi/link/adjustLinkSelection.js +32 -32
  381. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  382. package/lib-amd/publicApi/link/insertLink.d.ts +15 -15
  383. package/lib-amd/publicApi/link/insertLink.js +116 -116
  384. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  385. package/lib-amd/publicApi/link/removeLink.d.ts +8 -8
  386. package/lib-amd/publicApi/link/removeLink.js +31 -31
  387. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  388. package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -7
  389. package/lib-amd/publicApi/list/setListStartNumber.js +26 -26
  390. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  391. package/lib-amd/publicApi/list/setListStyle.d.ts +7 -7
  392. package/lib-amd/publicApi/list/setListStyle.js +32 -32
  393. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  394. package/lib-amd/publicApi/list/toggleBullet.d.ts +8 -8
  395. package/lib-amd/publicApi/list/toggleBullet.js +20 -20
  396. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  397. package/lib-amd/publicApi/list/toggleNumbering.d.ts +8 -8
  398. package/lib-amd/publicApi/list/toggleNumbering.js +20 -20
  399. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  400. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -7
  401. package/lib-amd/publicApi/segment/applySegmentFormat.js +23 -23
  402. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  403. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -10
  404. package/lib-amd/publicApi/segment/changeCapitalization.js +49 -49
  405. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  406. package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -8
  407. package/lib-amd/publicApi/segment/changeFontSize.js +60 -60
  408. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  409. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -7
  410. package/lib-amd/publicApi/segment/setBackgroundColor.js +34 -34
  411. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  412. package/lib-amd/publicApi/segment/setFontName.d.ts +7 -7
  413. package/lib-amd/publicApi/segment/setFontName.js +19 -19
  414. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  415. package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -12
  416. package/lib-amd/publicApi/segment/setFontSize.js +34 -34
  417. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  418. package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -7
  419. package/lib-amd/publicApi/segment/setTextColor.js +26 -26
  420. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  421. package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
  422. package/lib-amd/publicApi/segment/toggleBold.js +20 -20
  423. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  424. package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -6
  425. package/lib-amd/publicApi/segment/toggleCode.js +27 -27
  426. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  427. package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -6
  428. package/lib-amd/publicApi/segment/toggleItalic.js +15 -15
  429. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  430. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  431. package/lib-amd/publicApi/segment/toggleStrikethrough.js +15 -15
  432. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  433. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -6
  434. package/lib-amd/publicApi/segment/toggleSubscript.js +15 -15
  435. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  436. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -6
  437. package/lib-amd/publicApi/segment/toggleSuperscript.js +15 -15
  438. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  439. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -6
  440. package/lib-amd/publicApi/segment/toggleUnderline.js +18 -18
  441. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  442. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  443. package/lib-amd/publicApi/table/applyTableBorderFormat.js +292 -292
  444. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  445. package/lib-amd/publicApi/table/editTable.d.ts +7 -7
  446. package/lib-amd/publicApi/table/editTable.js +66 -66
  447. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  448. package/lib-amd/publicApi/table/formatTable.d.ts +8 -8
  449. package/lib-amd/publicApi/table/formatTable.js +37 -37
  450. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  451. package/lib-amd/publicApi/table/insertTable.d.ts +11 -11
  452. package/lib-amd/publicApi/table/insertTable.js +45 -45
  453. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  454. package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -7
  455. package/lib-amd/publicApi/table/setTableCellShade.js +32 -32
  456. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  457. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -5
  458. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +15 -15
  459. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  460. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
  461. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +19 -19
  462. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  463. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
  464. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +45 -45
  465. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  466. package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  467. package/lib-amd/publicApi/utils/formatTableWithContentModel.js +41 -41
  468. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  469. package/lib-mjs/index.d.ts +48 -48
  470. package/lib-mjs/index.js +48 -48
  471. package/lib-mjs/index.js.map +1 -1
  472. package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -5
  473. package/lib-mjs/modelApi/block/setModelAlignment.js +58 -58
  474. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  475. package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -5
  476. package/lib-mjs/modelApi/block/setModelDirection.js +64 -64
  477. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  478. package/lib-mjs/modelApi/block/setModelIndentation.d.ts +8 -8
  479. package/lib-mjs/modelApi/block/setModelIndentation.js +134 -134
  480. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  481. package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  482. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +46 -46
  483. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  484. package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
  485. package/lib-mjs/modelApi/common/clearModelFormat.js +125 -125
  486. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  487. package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
  488. package/lib-mjs/modelApi/common/wrapBlock.js +43 -43
  489. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  490. package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -5
  491. package/lib-mjs/modelApi/entity/insertEntityModel.js +75 -75
  492. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  493. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  494. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +54 -54
  495. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  496. package/lib-mjs/modelApi/link/matchLink.d.ts +29 -29
  497. package/lib-mjs/modelApi/link/matchLink.js +90 -90
  498. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  499. package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +7 -7
  500. package/lib-mjs/modelApi/list/findListItemsInSameThread.js +110 -110
  501. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  502. package/lib-mjs/modelApi/list/setListType.d.ts +7 -7
  503. package/lib-mjs/modelApi/list/setListType.js +109 -109
  504. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  505. package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  506. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +43 -43
  507. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  508. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  509. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +51 -51
  510. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  511. package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +5 -5
  512. package/lib-mjs/modelApi/selection/adjustWordSelection.js +117 -117
  513. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  514. package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +5 -5
  515. package/lib-mjs/modelApi/selection/collapseTableSelection.js +12 -12
  516. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  517. package/lib-mjs/modelApi/table/alignTable.d.ts +5 -5
  518. package/lib-mjs/modelApi/table/alignTable.js +8 -8
  519. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  520. package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -9
  521. package/lib-mjs/modelApi/table/alignTableCell.js +53 -53
  522. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  523. package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -5
  524. package/lib-mjs/modelApi/table/canMergeCells.js +52 -52
  525. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  526. package/lib-mjs/modelApi/table/clearSelectedCells.d.ts +8 -8
  527. package/lib-mjs/modelApi/table/clearSelectedCells.js +22 -22
  528. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  529. package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -5
  530. package/lib-mjs/modelApi/table/createTableStructure.js +15 -15
  531. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  532. package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -5
  533. package/lib-mjs/modelApi/table/deleteTable.js +7 -7
  534. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  535. package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -5
  536. package/lib-mjs/modelApi/table/deleteTableColumn.js +20 -20
  537. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  538. package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -5
  539. package/lib-mjs/modelApi/table/deleteTableRow.js +19 -19
  540. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  541. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  542. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +52 -52
  543. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  544. package/lib-mjs/modelApi/table/insertTableColumn.d.ts +7 -7
  545. package/lib-mjs/modelApi/table/insertTableColumn.js +24 -24
  546. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  547. package/lib-mjs/modelApi/table/insertTableRow.d.ts +7 -7
  548. package/lib-mjs/modelApi/table/insertTableRow.js +28 -28
  549. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  550. package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -5
  551. package/lib-mjs/modelApi/table/mergeTableCells.js +22 -22
  552. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  553. package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -5
  554. package/lib-mjs/modelApi/table/mergeTableColumn.js +33 -33
  555. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  556. package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -5
  557. package/lib-mjs/modelApi/table/mergeTableRow.js +34 -34
  558. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  559. package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  560. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +50 -50
  561. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  562. package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -5
  563. package/lib-mjs/modelApi/table/splitTableCellVertically.js +53 -53
  564. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  565. package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -7
  566. package/lib-mjs/publicApi/block/setAlignment.js +12 -12
  567. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  568. package/lib-mjs/publicApi/block/setDirection.d.ts +7 -7
  569. package/lib-mjs/publicApi/block/setDirection.js +12 -12
  570. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  571. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -7
  572. package/lib-mjs/publicApi/block/setHeadingLevel.js +46 -46
  573. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  574. package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -8
  575. package/lib-mjs/publicApi/block/setIndentation.js +21 -21
  576. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  577. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -9
  578. package/lib-mjs/publicApi/block/setParagraphMargin.js +29 -29
  579. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  580. package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -7
  581. package/lib-mjs/publicApi/block/setSpacing.js +17 -17
  582. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  583. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -9
  584. package/lib-mjs/publicApi/block/toggleBlockQuote.js +35 -35
  585. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  586. package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -25
  587. package/lib-mjs/publicApi/entity/insertEntity.js +38 -38
  588. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  589. package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -6
  590. package/lib-mjs/publicApi/format/clearFormat.js +19 -19
  591. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  592. package/lib-mjs/publicApi/format/getFormatState.d.ts +6 -6
  593. package/lib-mjs/publicApi/format/getFormatState.js +17 -17
  594. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  595. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -6
  596. package/lib-mjs/publicApi/image/adjustImageSelection.js +22 -22
  597. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  598. package/lib-mjs/publicApi/image/changeImage.d.ts +7 -7
  599. package/lib-mjs/publicApi/image/changeImage.js +31 -31
  600. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  601. package/lib-mjs/publicApi/image/insertImage.d.ts +7 -7
  602. package/lib-mjs/publicApi/image/insertImage.js +33 -33
  603. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  604. package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -8
  605. package/lib-mjs/publicApi/image/setImageAltText.js +13 -13
  606. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  607. package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -9
  608. package/lib-mjs/publicApi/image/setImageBorder.js +15 -15
  609. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  610. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -8
  611. package/lib-mjs/publicApi/image/setImageBoxShadow.js +25 -25
  612. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  613. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -6
  614. package/lib-mjs/publicApi/link/adjustLinkSelection.js +30 -30
  615. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  616. package/lib-mjs/publicApi/link/insertLink.d.ts +15 -15
  617. package/lib-mjs/publicApi/link/insertLink.js +116 -116
  618. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  619. package/lib-mjs/publicApi/link/removeLink.d.ts +8 -8
  620. package/lib-mjs/publicApi/link/removeLink.js +28 -28
  621. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  622. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -7
  623. package/lib-mjs/publicApi/list/setListStartNumber.js +22 -22
  624. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  625. package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -7
  626. package/lib-mjs/publicApi/list/setListStyle.js +29 -29
  627. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  628. package/lib-mjs/publicApi/list/toggleBullet.d.ts +8 -8
  629. package/lib-mjs/publicApi/list/toggleBullet.js +16 -16
  630. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  631. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +8 -8
  632. package/lib-mjs/publicApi/list/toggleNumbering.js +16 -16
  633. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  634. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -7
  635. package/lib-mjs/publicApi/segment/applySegmentFormat.js +19 -19
  636. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  637. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -10
  638. package/lib-mjs/publicApi/segment/changeCapitalization.js +45 -45
  639. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  640. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -8
  641. package/lib-mjs/publicApi/segment/changeFontSize.js +58 -58
  642. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  643. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -7
  644. package/lib-mjs/publicApi/segment/setBackgroundColor.js +32 -32
  645. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  646. package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -7
  647. package/lib-mjs/publicApi/segment/setFontName.js +15 -15
  648. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  649. package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -12
  650. package/lib-mjs/publicApi/segment/setFontSize.js +28 -28
  651. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  652. package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -7
  653. package/lib-mjs/publicApi/segment/setTextColor.js +22 -22
  654. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  655. package/lib-mjs/publicApi/segment/toggleBold.d.ts +6 -6
  656. package/lib-mjs/publicApi/segment/toggleBold.js +17 -17
  657. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  658. package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -6
  659. package/lib-mjs/publicApi/segment/toggleCode.js +24 -24
  660. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  661. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -6
  662. package/lib-mjs/publicApi/segment/toggleItalic.js +11 -11
  663. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  664. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  665. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +11 -11
  666. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  667. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -6
  668. package/lib-mjs/publicApi/segment/toggleSubscript.js +11 -11
  669. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  670. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -6
  671. package/lib-mjs/publicApi/segment/toggleSuperscript.js +11 -11
  672. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  673. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -6
  674. package/lib-mjs/publicApi/segment/toggleUnderline.js +15 -15
  675. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  676. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  677. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +290 -290
  678. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  679. package/lib-mjs/publicApi/table/editTable.d.ts +7 -7
  680. package/lib-mjs/publicApi/table/editTable.js +74 -74
  681. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  682. package/lib-mjs/publicApi/table/formatTable.d.ts +8 -8
  683. package/lib-mjs/publicApi/table/formatTable.js +34 -34
  684. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  685. package/lib-mjs/publicApi/table/insertTable.d.ts +11 -11
  686. package/lib-mjs/publicApi/table/insertTable.js +43 -43
  687. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  688. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -7
  689. package/lib-mjs/publicApi/table/setTableCellShade.js +29 -29
  690. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  691. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -5
  692. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +11 -11
  693. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  694. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -5
  695. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +14 -14
  696. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  697. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -5
  698. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +42 -42
  699. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  700. package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  701. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +39 -39
  702. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  703. package/package.json +4 -4
@@ -1,53 +1,53 @@
1
- import { createBr, createParagraph } from 'roosterjs-content-model-dom';
2
- /**
3
- * @internal
4
- * After edit table, it maybe in a abnormal state, e.g. selected table cell is removed, or all rows are removed causes no place to put cursor.
5
- * We need to make sure table is in normal state, and there is a place to put cursor.
6
- * @returns a new paragraph that can but put focus in, or undefined if not needed
7
- */
8
- export function ensureFocusableParagraphForTable(model, path, table) {
9
- var _a, _b;
10
- var paragraph;
11
- var firstCell = (_a = table.rows.filter(function (row) { return row.cells.length > 0; })[0]) === null || _a === void 0 ? void 0 : _a.cells[0];
12
- if (firstCell) {
13
- // When there is a valid cell to put focus, use it
14
- paragraph = firstCell.blocks.filter(function (block) { return block.blockType == 'Paragraph'; })[0];
15
- if (!paragraph) {
16
- // If there is not a paragraph under this cell, create one
17
- paragraph = createEmptyParagraph(model);
18
- firstCell.blocks.push(paragraph);
19
- }
20
- }
21
- else {
22
- // No table cell at all, which means the whole table is deleted. So we need to remove it from content model.
23
- var block = table;
24
- var parent_1;
25
- paragraph = createEmptyParagraph(model);
26
- // If the table is the only block of its parent and parent is a FormatContainer, remove the parent as well.
27
- // We need to do this in a loop in case there are multiple layer of FormatContainer that match this case
28
- while ((parent_1 = path.shift())) {
29
- var index = (_b = parent_1.blocks.indexOf(block)) !== null && _b !== void 0 ? _b : -1;
30
- if (parent_1 && index >= 0) {
31
- parent_1.blocks.splice(index, 1, paragraph);
32
- }
33
- if (parent_1.blockGroupType == 'FormatContainer' &&
34
- parent_1.blocks.length == 1 &&
35
- parent_1.blocks[0] == paragraph) {
36
- // If the new paragraph is the only child of parent format container, unwrap parent as well
37
- block = parent_1;
38
- }
39
- else {
40
- // Otherwise, just stop here and keep processing the new paragraph
41
- break;
42
- }
43
- }
44
- }
45
- return paragraph;
46
- }
47
- function createEmptyParagraph(model) {
48
- var newPara = createParagraph(false /*isImplicit*/, undefined /*blockFormat*/, model.format);
49
- var br = createBr(model.format);
50
- newPara.segments.push(br);
51
- return newPara;
52
- }
1
+ import { createBr, createParagraph } from 'roosterjs-content-model-dom';
2
+ /**
3
+ * @internal
4
+ * After edit table, it maybe in a abnormal state, e.g. selected table cell is removed, or all rows are removed causes no place to put cursor.
5
+ * We need to make sure table is in normal state, and there is a place to put cursor.
6
+ * @returns a new paragraph that can but put focus in, or undefined if not needed
7
+ */
8
+ export function ensureFocusableParagraphForTable(model, path, table) {
9
+ var _a, _b;
10
+ var paragraph;
11
+ var firstCell = (_a = table.rows.filter(function (row) { return row.cells.length > 0; })[0]) === null || _a === void 0 ? void 0 : _a.cells[0];
12
+ if (firstCell) {
13
+ // When there is a valid cell to put focus, use it
14
+ paragraph = firstCell.blocks.filter(function (block) { return block.blockType == 'Paragraph'; })[0];
15
+ if (!paragraph) {
16
+ // If there is not a paragraph under this cell, create one
17
+ paragraph = createEmptyParagraph(model);
18
+ firstCell.blocks.push(paragraph);
19
+ }
20
+ }
21
+ else {
22
+ // No table cell at all, which means the whole table is deleted. So we need to remove it from content model.
23
+ var block = table;
24
+ var parent_1;
25
+ paragraph = createEmptyParagraph(model);
26
+ // If the table is the only block of its parent and parent is a FormatContainer, remove the parent as well.
27
+ // We need to do this in a loop in case there are multiple layer of FormatContainer that match this case
28
+ while ((parent_1 = path.shift())) {
29
+ var index = (_b = parent_1.blocks.indexOf(block)) !== null && _b !== void 0 ? _b : -1;
30
+ if (parent_1 && index >= 0) {
31
+ parent_1.blocks.splice(index, 1, paragraph);
32
+ }
33
+ if (parent_1.blockGroupType == 'FormatContainer' &&
34
+ parent_1.blocks.length == 1 &&
35
+ parent_1.blocks[0] == paragraph) {
36
+ // If the new paragraph is the only child of parent format container, unwrap parent as well
37
+ block = parent_1;
38
+ }
39
+ else {
40
+ // Otherwise, just stop here and keep processing the new paragraph
41
+ break;
42
+ }
43
+ }
44
+ }
45
+ return paragraph;
46
+ }
47
+ function createEmptyParagraph(model) {
48
+ var newPara = createParagraph(false /*isImplicit*/, undefined /*blockFormat*/, model.format);
49
+ var br = createBr(model.format);
50
+ newPara.segments.push(br);
51
+ return newPara;
52
+ }
53
53
  //# sourceMappingURL=ensureFocusableParagraphForTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureFocusableParagraphForTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/ensureFocusableParagraphForTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AASxE;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC5C,KAA2B,EAC3B,IAA8B,EAC9B,KAAwB;;IAExB,IAAI,SAA4C,CAAC;IACjD,IAAM,SAAS,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAApB,CAAoB,CAAC,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAE9E,IAAI,SAAS,EAAE;QACX,kDAAkD;QAClD,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAC/B,UAAC,KAAK,IAAqC,OAAA,KAAK,CAAC,SAAS,IAAI,WAAW,EAA9B,CAA8B,CAC5E,CAAC,CAAC,CAAC,CAAC;QAEL,IAAI,CAAC,SAAS,EAAE;YACZ,0DAA0D;YAC1D,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACxC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpC;KACJ;SAAM;QACH,4GAA4G;QAC5G,IAAI,KAAK,GAAsB,KAAK,CAAC;QACrC,IAAI,QAA0C,CAAC;QAC/C,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAExC,2GAA2G;QAC3G,wGAAwG;QACxG,OAAO,CAAC,QAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;YAC5B,IAAM,KAAK,GAAG,MAAA,QAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC,CAAC;YAEjD,IAAI,QAAM,IAAI,KAAK,IAAI,CAAC,EAAE;gBACtB,QAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IACI,QAAM,CAAC,cAAc,IAAI,iBAAiB;gBAC1C,QAAM,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC;gBACzB,QAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,EAC/B;gBACE,2FAA2F;gBAC3F,KAAK,GAAG,QAAM,CAAC;aAClB;iBAAM;gBACH,kEAAkE;gBAClE,MAAM;aACT;SACJ;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,oBAAoB,CAAC,KAA2B;IACrD,IAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,cAAc,EAAE,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/F,IAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1B,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import { createBr, createParagraph } from 'roosterjs-content-model-dom';\r\nimport type {\r\n ContentModelBlock,\r\n ContentModelBlockGroup,\r\n ContentModelDocument,\r\n ContentModelParagraph,\r\n ContentModelTable,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n * After edit table, it maybe in a abnormal state, e.g. selected table cell is removed, or all rows are removed causes no place to put cursor.\r\n * We need to make sure table is in normal state, and there is a place to put cursor.\r\n * @returns a new paragraph that can but put focus in, or undefined if not needed\r\n */\r\nexport function ensureFocusableParagraphForTable(\r\n model: ContentModelDocument,\r\n path: ContentModelBlockGroup[],\r\n table: ContentModelTable\r\n): ContentModelParagraph | undefined {\r\n let paragraph: ContentModelParagraph | undefined;\r\n const firstCell = table.rows.filter(row => row.cells.length > 0)[0]?.cells[0];\r\n\r\n if (firstCell) {\r\n // When there is a valid cell to put focus, use it\r\n paragraph = firstCell.blocks.filter(\r\n (block): block is ContentModelParagraph => block.blockType == 'Paragraph'\r\n )[0];\r\n\r\n if (!paragraph) {\r\n // If there is not a paragraph under this cell, create one\r\n paragraph = createEmptyParagraph(model);\r\n firstCell.blocks.push(paragraph);\r\n }\r\n } else {\r\n // No table cell at all, which means the whole table is deleted. So we need to remove it from content model.\r\n let block: ContentModelBlock = table;\r\n let parent: ContentModelBlockGroup | undefined;\r\n paragraph = createEmptyParagraph(model);\r\n\r\n // If the table is the only block of its parent and parent is a FormatContainer, remove the parent as well.\r\n // We need to do this in a loop in case there are multiple layer of FormatContainer that match this case\r\n while ((parent = path.shift())) {\r\n const index = parent.blocks.indexOf(block) ?? -1;\r\n\r\n if (parent && index >= 0) {\r\n parent.blocks.splice(index, 1, paragraph);\r\n }\r\n\r\n if (\r\n parent.blockGroupType == 'FormatContainer' &&\r\n parent.blocks.length == 1 &&\r\n parent.blocks[0] == paragraph\r\n ) {\r\n // If the new paragraph is the only child of parent format container, unwrap parent as well\r\n block = parent;\r\n } else {\r\n // Otherwise, just stop here and keep processing the new paragraph\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return paragraph;\r\n}\r\n\r\nfunction createEmptyParagraph(model: ContentModelDocument) {\r\n const newPara = createParagraph(false /*isImplicit*/, undefined /*blockFormat*/, model.format);\r\n const br = createBr(model.format);\r\n\r\n newPara.segments.push(br);\r\n\r\n return newPara;\r\n}\r\n"]}
1
+ {"version":3,"file":"ensureFocusableParagraphForTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/ensureFocusableParagraphForTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AASxE;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC5C,KAA2B,EAC3B,IAA8B,EAC9B,KAAwB;;IAExB,IAAI,SAA4C,CAAC;IACjD,IAAM,SAAS,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAApB,CAAoB,CAAC,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAE9E,IAAI,SAAS,EAAE;QACX,kDAAkD;QAClD,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAC/B,UAAC,KAAK,IAAqC,OAAA,KAAK,CAAC,SAAS,IAAI,WAAW,EAA9B,CAA8B,CAC5E,CAAC,CAAC,CAAC,CAAC;QAEL,IAAI,CAAC,SAAS,EAAE;YACZ,0DAA0D;YAC1D,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACxC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpC;KACJ;SAAM;QACH,4GAA4G;QAC5G,IAAI,KAAK,GAAsB,KAAK,CAAC;QACrC,IAAI,QAA0C,CAAC;QAC/C,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAExC,2GAA2G;QAC3G,wGAAwG;QACxG,OAAO,CAAC,QAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE;YAC5B,IAAM,KAAK,GAAG,MAAA,QAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,mCAAI,CAAC,CAAC,CAAC;YAEjD,IAAI,QAAM,IAAI,KAAK,IAAI,CAAC,EAAE;gBACtB,QAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IACI,QAAM,CAAC,cAAc,IAAI,iBAAiB;gBAC1C,QAAM,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC;gBACzB,QAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,EAC/B;gBACE,2FAA2F;gBAC3F,KAAK,GAAG,QAAM,CAAC;aAClB;iBAAM;gBACH,kEAAkE;gBAClE,MAAM;aACT;SACJ;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,oBAAoB,CAAC,KAA2B;IACrD,IAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,cAAc,EAAE,SAAS,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/F,IAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE1B,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import { createBr, createParagraph } from 'roosterjs-content-model-dom';\nimport type {\n ContentModelBlock,\n ContentModelBlockGroup,\n ContentModelDocument,\n ContentModelParagraph,\n ContentModelTable,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * After edit table, it maybe in a abnormal state, e.g. selected table cell is removed, or all rows are removed causes no place to put cursor.\n * We need to make sure table is in normal state, and there is a place to put cursor.\n * @returns a new paragraph that can but put focus in, or undefined if not needed\n */\nexport function ensureFocusableParagraphForTable(\n model: ContentModelDocument,\n path: ContentModelBlockGroup[],\n table: ContentModelTable\n): ContentModelParagraph | undefined {\n let paragraph: ContentModelParagraph | undefined;\n const firstCell = table.rows.filter(row => row.cells.length > 0)[0]?.cells[0];\n\n if (firstCell) {\n // When there is a valid cell to put focus, use it\n paragraph = firstCell.blocks.filter(\n (block): block is ContentModelParagraph => block.blockType == 'Paragraph'\n )[0];\n\n if (!paragraph) {\n // If there is not a paragraph under this cell, create one\n paragraph = createEmptyParagraph(model);\n firstCell.blocks.push(paragraph);\n }\n } else {\n // No table cell at all, which means the whole table is deleted. So we need to remove it from content model.\n let block: ContentModelBlock = table;\n let parent: ContentModelBlockGroup | undefined;\n paragraph = createEmptyParagraph(model);\n\n // If the table is the only block of its parent and parent is a FormatContainer, remove the parent as well.\n // We need to do this in a loop in case there are multiple layer of FormatContainer that match this case\n while ((parent = path.shift())) {\n const index = parent.blocks.indexOf(block) ?? -1;\n\n if (parent && index >= 0) {\n parent.blocks.splice(index, 1, paragraph);\n }\n\n if (\n parent.blockGroupType == 'FormatContainer' &&\n parent.blocks.length == 1 &&\n parent.blocks[0] == paragraph\n ) {\n // If the new paragraph is the only child of parent format container, unwrap parent as well\n block = parent;\n } else {\n // Otherwise, just stop here and keep processing the new paragraph\n break;\n }\n }\n }\n\n return paragraph;\n}\n\nfunction createEmptyParagraph(model: ContentModelDocument) {\n const newPara = createParagraph(false /*isImplicit*/, undefined /*blockFormat*/, model.format);\n const br = createBr(model.format);\n\n newPara.segments.push(br);\n\n return newPara;\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { ContentModelTable, TableHorizontalInsertOperation } from 'roosterjs-content-model-types';
2
- /**
3
- * Insert a column to the table
4
- * @param table The table model where the column is to be inserted
5
- * @param operation The operation to be performed
6
- */
7
- export declare function insertTableColumn(table: ContentModelTable, operation: TableHorizontalInsertOperation): void;
1
+ import type { ContentModelTable, TableHorizontalInsertOperation } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Insert a column to the table
4
+ * @param table The table model where the column is to be inserted
5
+ * @param operation The operation to be performed
6
+ */
7
+ export declare function insertTableColumn(table: ContentModelTable, operation: TableHorizontalInsertOperation): void;
@@ -1,25 +1,25 @@
1
- import { clearSelectedCells } from './clearSelectedCells';
2
- import { createTableCell } from 'roosterjs-content-model-dom';
3
- import { getSelectedCells } from 'roosterjs-content-model-core';
4
- /**
5
- * Insert a column to the table
6
- * @param table The table model where the column is to be inserted
7
- * @param operation The operation to be performed
8
- */
9
- export function insertTableColumn(table, operation) {
10
- var sel = getSelectedCells(table);
11
- var insertLeft = operation == 'insertLeft';
12
- if (sel) {
13
- clearSelectedCells(table, sel);
14
- for (var i = sel === null || sel === void 0 ? void 0 : sel.firstColumn; i <= sel.lastColumn; i++) {
15
- table.rows.forEach(function (row) {
16
- var cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];
17
- var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
18
- newCell.isSelected = true;
19
- row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);
20
- });
21
- table.widths.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]);
22
- }
23
- }
24
- }
1
+ import { clearSelectedCells } from './clearSelectedCells';
2
+ import { createTableCell } from 'roosterjs-content-model-dom';
3
+ import { getSelectedCells } from 'roosterjs-content-model-core';
4
+ /**
5
+ * Insert a column to the table
6
+ * @param table The table model where the column is to be inserted
7
+ * @param operation The operation to be performed
8
+ */
9
+ export function insertTableColumn(table, operation) {
10
+ var sel = getSelectedCells(table);
11
+ var insertLeft = operation == 'insertLeft';
12
+ if (sel) {
13
+ clearSelectedCells(table, sel);
14
+ for (var i = sel === null || sel === void 0 ? void 0 : sel.firstColumn; i <= sel.lastColumn; i++) {
15
+ table.rows.forEach(function (row) {
16
+ var cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];
17
+ var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
18
+ newCell.isSelected = true;
19
+ row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);
20
+ });
21
+ table.widths.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]);
22
+ }
23
+ }
24
+ }
25
25
  //# sourceMappingURL=insertTableColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"insertTableColumn.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/insertTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC7B,KAAwB,EACxB,SAAyC;IAEzC,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;IAE7C,IAAI,GAAG,EAAE;QACL,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;YACrD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAEtE,IAAM,OAAO,GAAG,eAAe,CAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;gBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;gBAE1B,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;YACpF,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,MAAM,CACf,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EACjD,CAAC,EACD,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAC9D,CAAC;SACL;KACJ;AACL,CAAC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\r\nimport { createTableCell } from 'roosterjs-content-model-dom';\r\nimport { getSelectedCells } from 'roosterjs-content-model-core';\r\nimport type {\r\n ContentModelTable,\r\n TableHorizontalInsertOperation,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Insert a column to the table\r\n * @param table The table model where the column is to be inserted\r\n * @param operation The operation to be performed\r\n */\r\nexport function insertTableColumn(\r\n table: ContentModelTable,\r\n operation: TableHorizontalInsertOperation\r\n) {\r\n const sel = getSelectedCells(table);\r\n const insertLeft = operation == 'insertLeft';\r\n\r\n if (sel) {\r\n clearSelectedCells(table, sel);\r\n for (let i = sel?.firstColumn; i <= sel.lastColumn; i++) {\r\n table.rows.forEach(row => {\r\n const cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];\r\n\r\n const newCell = createTableCell(\r\n cell.spanLeft,\r\n cell.spanAbove,\r\n cell.isHeader,\r\n cell.format,\r\n cell.dataset\r\n );\r\n newCell.isSelected = true;\r\n\r\n row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);\r\n });\r\n table.widths.splice(\r\n insertLeft ? sel.firstColumn : sel.lastColumn + 1,\r\n 0,\r\n table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]\r\n );\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"insertTableColumn.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/insertTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC7B,KAAwB,EACxB,SAAyC;IAEzC,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;IAE7C,IAAI,GAAG,EAAE;QACL,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,WAAW,EAAE,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;YACrD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAEtE,IAAM,OAAO,GAAG,eAAe,CAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;gBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;gBAE1B,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;YACpF,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,MAAM,CACf,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EACjD,CAAC,EACD,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAC9D,CAAC;SACL;KACJ;AACL,CAAC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\nimport { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableHorizontalInsertOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * Insert a column to the table\n * @param table The table model where the column is to be inserted\n * @param operation The operation to be performed\n */\nexport function insertTableColumn(\n table: ContentModelTable,\n operation: TableHorizontalInsertOperation\n) {\n const sel = getSelectedCells(table);\n const insertLeft = operation == 'insertLeft';\n\n if (sel) {\n clearSelectedCells(table, sel);\n for (let i = sel?.firstColumn; i <= sel.lastColumn; i++) {\n table.rows.forEach(row => {\n const cell = row.cells[insertLeft ? sel.firstColumn : sel.lastColumn];\n\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format,\n cell.dataset\n );\n newCell.isSelected = true;\n\n row.cells.splice(insertLeft ? sel.firstColumn : sel.lastColumn + 1, 0, newCell);\n });\n table.widths.splice(\n insertLeft ? sel.firstColumn : sel.lastColumn + 1,\n 0,\n table.widths[insertLeft ? sel.firstColumn : sel.lastColumn]\n );\n }\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { ContentModelTable, TableVerticalInsertOperation } from 'roosterjs-content-model-types';
2
- /**
3
- * Insert a row to the table
4
- * @param table The table model where the row is to be inserted
5
- * @param operation The operation to be performed
6
- */
7
- export declare function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation): void;
1
+ import type { ContentModelTable, TableVerticalInsertOperation } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Insert a row to the table
4
+ * @param table The table model where the row is to be inserted
5
+ * @param operation The operation to be performed
6
+ */
7
+ export declare function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation): void;
@@ -1,29 +1,29 @@
1
- import { __assign } from "tslib";
2
- import { clearSelectedCells } from './clearSelectedCells';
3
- import { createTableCell } from 'roosterjs-content-model-dom';
4
- import { getSelectedCells } from 'roosterjs-content-model-core';
5
- /**
6
- * Insert a row to the table
7
- * @param table The table model where the row is to be inserted
8
- * @param operation The operation to be performed
9
- */
10
- export function insertTableRow(table, operation) {
11
- var sel = getSelectedCells(table);
12
- var insertAbove = operation == 'insertAbove';
13
- if (sel) {
14
- clearSelectedCells(table, sel);
15
- for (var i = sel.firstRow; i <= sel.lastRow; i++) {
16
- var sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];
17
- table.rows.splice(insertAbove ? sel.firstRow : sel.lastRow + 1, 0, {
18
- format: __assign({}, sourceRow.format),
19
- cells: sourceRow.cells.map(function (cell) {
20
- var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
21
- newCell.isSelected = true;
22
- return newCell;
23
- }),
24
- height: sourceRow.height,
25
- });
26
- }
27
- }
28
- }
1
+ import { __assign } from "tslib";
2
+ import { clearSelectedCells } from './clearSelectedCells';
3
+ import { createTableCell } from 'roosterjs-content-model-dom';
4
+ import { getSelectedCells } from 'roosterjs-content-model-core';
5
+ /**
6
+ * Insert a row to the table
7
+ * @param table The table model where the row is to be inserted
8
+ * @param operation The operation to be performed
9
+ */
10
+ export function insertTableRow(table, operation) {
11
+ var sel = getSelectedCells(table);
12
+ var insertAbove = operation == 'insertAbove';
13
+ if (sel) {
14
+ clearSelectedCells(table, sel);
15
+ for (var i = sel.firstRow; i <= sel.lastRow; i++) {
16
+ var sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];
17
+ table.rows.splice(insertAbove ? sel.firstRow : sel.lastRow + 1, 0, {
18
+ format: __assign({}, sourceRow.format),
19
+ cells: sourceRow.cells.map(function (cell) {
20
+ var newCell = createTableCell(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format, cell.dataset);
21
+ newCell.isSelected = true;
22
+ return newCell;
23
+ }),
24
+ height: sourceRow.height,
25
+ });
26
+ }
27
+ }
28
+ }
29
29
  //# sourceMappingURL=insertTableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"insertTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/insertTableRow.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,SAAuC;IAC5F,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,WAAW,GAAG,SAAS,IAAI,aAAa,CAAC;IAE/C,IAAI,GAAG,EAAE;QACL,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;YAC9C,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAEvE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE;gBAC/D,MAAM,eAAO,SAAS,CAAC,MAAM,CAAE;gBAC/B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;oBAC3B,IAAM,OAAO,GAAG,eAAe,CAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;oBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;oBAC1B,OAAO,OAAO,CAAC;gBACnB,CAAC,CAAC;gBACF,MAAM,EAAE,SAAS,CAAC,MAAM;aAC3B,CAAC,CAAC;SACN;KACJ;AACL,CAAC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\r\nimport { createTableCell } from 'roosterjs-content-model-dom';\r\nimport { getSelectedCells } from 'roosterjs-content-model-core';\r\nimport type {\r\n ContentModelTable,\r\n TableVerticalInsertOperation,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Insert a row to the table\r\n * @param table The table model where the row is to be inserted\r\n * @param operation The operation to be performed\r\n */\r\nexport function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation) {\r\n const sel = getSelectedCells(table);\r\n const insertAbove = operation == 'insertAbove';\r\n\r\n if (sel) {\r\n clearSelectedCells(table, sel);\r\n for (let i = sel.firstRow; i <= sel.lastRow; i++) {\r\n const sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];\r\n\r\n table.rows.splice(insertAbove ? sel.firstRow : sel.lastRow + 1, 0, {\r\n format: { ...sourceRow.format },\r\n cells: sourceRow.cells.map(cell => {\r\n const newCell = createTableCell(\r\n cell.spanLeft,\r\n cell.spanAbove,\r\n cell.isHeader,\r\n cell.format,\r\n cell.dataset\r\n );\r\n newCell.isSelected = true;\r\n return newCell;\r\n }),\r\n height: sourceRow.height,\r\n });\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"insertTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/insertTableRow.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,SAAuC;IAC5F,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,WAAW,GAAG,SAAS,IAAI,aAAa,CAAC;IAE/C,IAAI,GAAG,EAAE;QACL,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;YAC9C,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAEvE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC,EAAE;gBAC/D,MAAM,eAAO,SAAS,CAAC,MAAM,CAAE;gBAC/B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI;oBAC3B,IAAM,OAAO,GAAG,eAAe,CAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,OAAO,CACf,CAAC;oBACF,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;oBAC1B,OAAO,OAAO,CAAC;gBACnB,CAAC,CAAC;gBACF,MAAM,EAAE,SAAS,CAAC,MAAM;aAC3B,CAAC,CAAC;SACN;KACJ;AACL,CAAC","sourcesContent":["import { clearSelectedCells } from './clearSelectedCells';\nimport { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableVerticalInsertOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * Insert a row to the table\n * @param table The table model where the row is to be inserted\n * @param operation The operation to be performed\n */\nexport function insertTableRow(table: ContentModelTable, operation: TableVerticalInsertOperation) {\n const sel = getSelectedCells(table);\n const insertAbove = operation == 'insertAbove';\n\n if (sel) {\n clearSelectedCells(table, sel);\n for (let i = sel.firstRow; i <= sel.lastRow; i++) {\n const sourceRow = table.rows[insertAbove ? sel.firstRow : sel.lastRow];\n\n table.rows.splice(insertAbove ? sel.firstRow : sel.lastRow + 1, 0, {\n format: { ...sourceRow.format },\n cells: sourceRow.cells.map(cell => {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format,\n cell.dataset\n );\n newCell.isSelected = true;\n return newCell;\n }),\n height: sourceRow.height,\n });\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { ContentModelTable } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- */
5
- export declare function mergeTableCells(table: ContentModelTable): void;
1
+ import type { ContentModelTable } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function mergeTableCells(table: ContentModelTable): void;
@@ -1,23 +1,23 @@
1
- import { canMergeCells } from './canMergeCells';
2
- import { getSelectedCells } from 'roosterjs-content-model-core';
3
- /**
4
- * @internal
5
- */
6
- export function mergeTableCells(table) {
7
- var sel = getSelectedCells(table);
8
- if (sel &&
9
- canMergeCells(table.rows, sel.firstRow, sel.firstColumn, sel.lastRow, sel.lastColumn)) {
10
- for (var rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {
11
- for (var colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {
12
- var cell = table.rows[rowIndex].cells[colIndex];
13
- if (cell) {
14
- cell.spanLeft = colIndex > sel.firstColumn;
15
- cell.spanAbove = rowIndex > sel.firstRow;
16
- delete cell.cachedElement;
17
- }
18
- }
19
- delete table.rows[rowIndex].cachedElement;
20
- }
21
- }
22
- }
1
+ import { canMergeCells } from './canMergeCells';
2
+ import { getSelectedCells } from 'roosterjs-content-model-core';
3
+ /**
4
+ * @internal
5
+ */
6
+ export function mergeTableCells(table) {
7
+ var sel = getSelectedCells(table);
8
+ if (sel &&
9
+ canMergeCells(table.rows, sel.firstRow, sel.firstColumn, sel.lastRow, sel.lastColumn)) {
10
+ for (var rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {
11
+ for (var colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {
12
+ var cell = table.rows[rowIndex].cells[colIndex];
13
+ if (cell) {
14
+ cell.spanLeft = colIndex > sel.firstColumn;
15
+ cell.spanAbove = rowIndex > sel.firstRow;
16
+ delete cell.cachedElement;
17
+ }
18
+ }
19
+ delete table.rows[rowIndex].cachedElement;
20
+ }
21
+ }
22
+ }
23
23
  //# sourceMappingURL=mergeTableCells.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTableCells.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableCells.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEpC,IACI,GAAG;QACH,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,EACvF;QACE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACnE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAElD,IAAI,IAAI,EAAE;oBACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC;oBAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;oBAEzC,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;aACJ;YAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;SAC7C;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\r\nimport { getSelectedCells } from 'roosterjs-content-model-core';\r\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function mergeTableCells(table: ContentModelTable) {\r\n const sel = getSelectedCells(table);\r\n\r\n if (\r\n sel &&\r\n canMergeCells(table.rows, sel.firstRow, sel.firstColumn, sel.lastRow, sel.lastColumn)\r\n ) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = table.rows[rowIndex].cells[colIndex];\r\n\r\n if (cell) {\r\n cell.spanLeft = colIndex > sel.firstColumn;\r\n cell.spanAbove = rowIndex > sel.firstRow;\r\n\r\n delete cell.cachedElement;\r\n }\r\n }\r\n\r\n delete table.rows[rowIndex].cachedElement;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"mergeTableCells.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableCells.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEpC,IACI,GAAG;QACH,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,EACvF;QACE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACnE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAElD,IAAI,IAAI,EAAE;oBACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC;oBAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;oBAEzC,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;aACJ;YAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;SAC7C;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableCells(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (\n sel &&\n canMergeCells(table.rows, sel.firstRow, sel.firstColumn, sel.lastRow, sel.lastColumn)\n ) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = table.rows[rowIndex].cells[colIndex];\n\n if (cell) {\n cell.spanLeft = colIndex > sel.firstColumn;\n cell.spanAbove = rowIndex > sel.firstRow;\n\n delete cell.cachedElement;\n }\n }\n\n delete table.rows[rowIndex].cachedElement;\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { ContentModelTable, TableHorizontalMergeOperation } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- */
5
- export declare function mergeTableColumn(table: ContentModelTable, operation: TableHorizontalMergeOperation): void;
1
+ import type { ContentModelTable, TableHorizontalMergeOperation } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function mergeTableColumn(table: ContentModelTable, operation: TableHorizontalMergeOperation): void;
@@ -1,34 +1,34 @@
1
- import { canMergeCells } from './canMergeCells';
2
- import { getSelectedCells } from 'roosterjs-content-model-core';
3
- /**
4
- * @internal
5
- */
6
- export function mergeTableColumn(table, operation) {
7
- var _a, _b, _c, _d;
8
- var sel = getSelectedCells(table);
9
- var mergeLeft = operation == 'mergeLeft';
10
- if (sel) {
11
- var mergingColIndex = mergeLeft ? sel.firstColumn : sel.lastColumn + 1;
12
- if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {
13
- for (var rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {
14
- var cell = (_a = table.rows[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells[mergingColIndex];
15
- if (cell &&
16
- canMergeCells(table.rows, rowIndex, mergingColIndex - 1, rowIndex, mergingColIndex)) {
17
- cell.spanLeft = true;
18
- var newSelectedCol = mergingColIndex;
19
- while ((_c = (_b = table.rows[rowIndex]) === null || _b === void 0 ? void 0 : _b.cells[newSelectedCol]) === null || _c === void 0 ? void 0 : _c.spanLeft) {
20
- delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
21
- newSelectedCol--;
22
- }
23
- if ((_d = table.rows[rowIndex]) === null || _d === void 0 ? void 0 : _d.cells[newSelectedCol]) {
24
- table.rows[rowIndex].cells[newSelectedCol].isSelected = true;
25
- delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
26
- }
27
- delete cell.cachedElement;
28
- }
29
- delete table.rows[rowIndex].cachedElement;
30
- }
31
- }
32
- }
33
- }
1
+ import { canMergeCells } from './canMergeCells';
2
+ import { getSelectedCells } from 'roosterjs-content-model-core';
3
+ /**
4
+ * @internal
5
+ */
6
+ export function mergeTableColumn(table, operation) {
7
+ var _a, _b, _c, _d;
8
+ var sel = getSelectedCells(table);
9
+ var mergeLeft = operation == 'mergeLeft';
10
+ if (sel) {
11
+ var mergingColIndex = mergeLeft ? sel.firstColumn : sel.lastColumn + 1;
12
+ if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {
13
+ for (var rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {
14
+ var cell = (_a = table.rows[rowIndex]) === null || _a === void 0 ? void 0 : _a.cells[mergingColIndex];
15
+ if (cell &&
16
+ canMergeCells(table.rows, rowIndex, mergingColIndex - 1, rowIndex, mergingColIndex)) {
17
+ cell.spanLeft = true;
18
+ var newSelectedCol = mergingColIndex;
19
+ while ((_c = (_b = table.rows[rowIndex]) === null || _b === void 0 ? void 0 : _b.cells[newSelectedCol]) === null || _c === void 0 ? void 0 : _c.spanLeft) {
20
+ delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
21
+ newSelectedCol--;
22
+ }
23
+ if ((_d = table.rows[rowIndex]) === null || _d === void 0 ? void 0 : _d.cells[newSelectedCol]) {
24
+ table.rows[rowIndex].cells[newSelectedCol].isSelected = true;
25
+ delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;
26
+ }
27
+ delete cell.cachedElement;
28
+ }
29
+ delete table.rows[rowIndex].cachedElement;
30
+ }
31
+ }
32
+ }
33
+ }
34
34
  //# sourceMappingURL=mergeTableColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTableColumn.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,KAAwB,EACxB,SAAwC;;IAExC,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,SAAS,GAAG,SAAS,IAAI,WAAW,CAAC;IAE3C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;QAEzE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YACrE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBAE1D,IACI,IAAI;oBACJ,aAAa,CACT,KAAK,CAAC,IAAI,EACV,QAAQ,EACR,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,CAClB,EACH;oBACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAErB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,0CAAE,QAAQ,EAAE;wBAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChE,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnE;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;aAC7C;SACJ;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\r\nimport { getSelectedCells } from 'roosterjs-content-model-core';\r\nimport type {\r\n ContentModelTable,\r\n TableHorizontalMergeOperation,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function mergeTableColumn(\r\n table: ContentModelTable,\r\n operation: TableHorizontalMergeOperation\r\n) {\r\n const sel = getSelectedCells(table);\r\n const mergeLeft = operation == 'mergeLeft';\r\n\r\n if (sel) {\r\n const mergingColIndex = mergeLeft ? sel.firstColumn : sel.lastColumn + 1;\r\n\r\n if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n const cell = table.rows[rowIndex]?.cells[mergingColIndex];\r\n\r\n if (\r\n cell &&\r\n canMergeCells(\r\n table.rows,\r\n rowIndex,\r\n mergingColIndex - 1,\r\n rowIndex,\r\n mergingColIndex\r\n )\r\n ) {\r\n cell.spanLeft = true;\r\n\r\n let newSelectedCol = mergingColIndex;\r\n\r\n while (table.rows[rowIndex]?.cells[newSelectedCol]?.spanLeft) {\r\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\r\n newSelectedCol--;\r\n }\r\n\r\n if (table.rows[rowIndex]?.cells[newSelectedCol]) {\r\n table.rows[rowIndex].cells[newSelectedCol].isSelected = true;\r\n\r\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\r\n }\r\n\r\n delete cell.cachedElement;\r\n }\r\n\r\n delete table.rows[rowIndex].cachedElement;\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"mergeTableColumn.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMhE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC5B,KAAwB,EACxB,SAAwC;;IAExC,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,SAAS,GAAG,SAAS,IAAI,WAAW,CAAC;IAE3C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;QAEzE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YACrE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,IAAI,GAAG,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBAE1D,IACI,IAAI;oBACJ,aAAa,CACT,KAAK,CAAC,IAAI,EACV,QAAQ,EACR,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,CAClB,EACH;oBACE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAErB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,0CAAE,QAAQ,EAAE;wBAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChE,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,0CAAE,KAAK,CAAC,cAAc,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnE;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;aAC7C;SACJ;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type {\n ContentModelTable,\n TableHorizontalMergeOperation,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableColumn(\n table: ContentModelTable,\n operation: TableHorizontalMergeOperation\n) {\n const sel = getSelectedCells(table);\n const mergeLeft = operation == 'mergeLeft';\n\n if (sel) {\n const mergingColIndex = mergeLeft ? sel.firstColumn : sel.lastColumn + 1;\n\n if (mergingColIndex > 0 && mergingColIndex < table.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = table.rows[rowIndex]?.cells[mergingColIndex];\n\n if (\n cell &&\n canMergeCells(\n table.rows,\n rowIndex,\n mergingColIndex - 1,\n rowIndex,\n mergingColIndex\n )\n ) {\n cell.spanLeft = true;\n\n let newSelectedCol = mergingColIndex;\n\n while (table.rows[rowIndex]?.cells[newSelectedCol]?.spanLeft) {\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\n newSelectedCol--;\n }\n\n if (table.rows[rowIndex]?.cells[newSelectedCol]) {\n table.rows[rowIndex].cells[newSelectedCol].isSelected = true;\n\n delete table.rows[rowIndex].cells[newSelectedCol].cachedElement;\n }\n\n delete cell.cachedElement;\n }\n\n delete table.rows[rowIndex].cachedElement;\n }\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- */
5
- export declare function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation): void;
1
+ import type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation): void;
@@ -1,35 +1,35 @@
1
- import { canMergeCells } from './canMergeCells';
2
- import { getSelectedCells } from 'roosterjs-content-model-core';
3
- /**
4
- * @internal
5
- */
6
- export function mergeTableRow(table, operation) {
7
- var _a, _b, _c;
8
- var sel = getSelectedCells(table);
9
- var mergeAbove = operation == 'mergeAbove';
10
- if (sel) {
11
- var mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;
12
- if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {
13
- for (var colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {
14
- var cell = table.rows[mergingRowIndex].cells[colIndex];
15
- if (cell &&
16
- canMergeCells(table.rows, mergingRowIndex - 1, colIndex, mergingRowIndex, colIndex)) {
17
- cell.spanAbove = true;
18
- var newSelectedRow = mergingRowIndex;
19
- while ((_b = (_a = table.rows[newSelectedRow]) === null || _a === void 0 ? void 0 : _a.cells[colIndex]) === null || _b === void 0 ? void 0 : _b.spanAbove) {
20
- delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
21
- delete table.rows[newSelectedRow].cachedElement;
22
- newSelectedRow--;
23
- }
24
- if ((_c = table.rows[newSelectedRow]) === null || _c === void 0 ? void 0 : _c.cells[colIndex]) {
25
- table.rows[newSelectedRow].cells[colIndex].isSelected = true;
26
- delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
27
- delete table.rows[newSelectedRow].cachedElement;
28
- }
29
- delete cell.cachedElement;
30
- }
31
- }
32
- }
33
- }
34
- }
1
+ import { canMergeCells } from './canMergeCells';
2
+ import { getSelectedCells } from 'roosterjs-content-model-core';
3
+ /**
4
+ * @internal
5
+ */
6
+ export function mergeTableRow(table, operation) {
7
+ var _a, _b, _c;
8
+ var sel = getSelectedCells(table);
9
+ var mergeAbove = operation == 'mergeAbove';
10
+ if (sel) {
11
+ var mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;
12
+ if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {
13
+ for (var colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {
14
+ var cell = table.rows[mergingRowIndex].cells[colIndex];
15
+ if (cell &&
16
+ canMergeCells(table.rows, mergingRowIndex - 1, colIndex, mergingRowIndex, colIndex)) {
17
+ cell.spanAbove = true;
18
+ var newSelectedRow = mergingRowIndex;
19
+ while ((_b = (_a = table.rows[newSelectedRow]) === null || _a === void 0 ? void 0 : _a.cells[colIndex]) === null || _b === void 0 ? void 0 : _b.spanAbove) {
20
+ delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
21
+ delete table.rows[newSelectedRow].cachedElement;
22
+ newSelectedRow--;
23
+ }
24
+ if ((_c = table.rows[newSelectedRow]) === null || _c === void 0 ? void 0 : _c.cells[colIndex]) {
25
+ table.rows[newSelectedRow].cells[colIndex].isSelected = true;
26
+ delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
27
+ delete table.rows[newSelectedRow].cachedElement;
28
+ }
29
+ delete cell.cachedElement;
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
35
  //# sourceMappingURL=mergeTableRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,SAAsC;;IAC1F,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;IAE7C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;QAEpE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5D,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAEzD,IACI,IAAI;oBACJ,aAAa,CACT,KAAK,CAAC,IAAI,EACV,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,EACf,QAAQ,CACX,EACH;oBACE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBAEtB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,0CAAE,SAAS,EAAE;wBAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChD,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnD;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;aACJ;SACJ;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\r\nimport { getSelectedCells } from 'roosterjs-content-model-core';\r\nimport type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation) {\r\n const sel = getSelectedCells(table);\r\n const mergeAbove = operation == 'mergeAbove';\r\n\r\n if (sel) {\r\n const mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;\r\n\r\n if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = table.rows[mergingRowIndex].cells[colIndex];\r\n\r\n if (\r\n cell &&\r\n canMergeCells(\r\n table.rows,\r\n mergingRowIndex - 1,\r\n colIndex,\r\n mergingRowIndex,\r\n colIndex\r\n )\r\n ) {\r\n cell.spanAbove = true;\r\n\r\n let newSelectedRow = mergingRowIndex;\r\n\r\n while (table.rows[newSelectedRow]?.cells[colIndex]?.spanAbove) {\r\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\r\n delete table.rows[newSelectedRow].cachedElement;\r\n newSelectedRow--;\r\n }\r\n\r\n if (table.rows[newSelectedRow]?.cells[colIndex]) {\r\n table.rows[newSelectedRow].cells[colIndex].isSelected = true;\r\n\r\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\r\n delete table.rows[newSelectedRow].cachedElement;\r\n }\r\n\r\n delete cell.cachedElement;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableRow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,SAAsC;;IAC1F,IAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;IAE7C,IAAI,GAAG,EAAE;QACL,IAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;QAEpE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;YAC5D,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,WAAW,EAAE,QAAQ,IAAI,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;gBACzE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAEzD,IACI,IAAI;oBACJ,aAAa,CACT,KAAK,CAAC,IAAI,EACV,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,EACf,QAAQ,CACX,EACH;oBACE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;oBAEtB,IAAI,cAAc,GAAG,eAAe,CAAC;oBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,0CAAE,SAAS,EAAE;wBAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;wBAChD,cAAc,EAAE,CAAC;qBACpB;oBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;wBAC7C,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;wBAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;qBACnD;oBAED,OAAO,IAAI,CAAC,aAAa,CAAC;iBAC7B;aACJ;SACJ;KACJ;AACL,CAAC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from 'roosterjs-content-model-core';\nimport type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation) {\n const sel = getSelectedCells(table);\n const mergeAbove = operation == 'mergeAbove';\n\n if (sel) {\n const mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;\n\n if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = table.rows[mergingRowIndex].cells[colIndex];\n\n if (\n cell &&\n canMergeCells(\n table.rows,\n mergingRowIndex - 1,\n colIndex,\n mergingRowIndex,\n colIndex\n )\n ) {\n cell.spanAbove = true;\n\n let newSelectedRow = mergingRowIndex;\n\n while (table.rows[newSelectedRow]?.cells[colIndex]?.spanAbove) {\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n newSelectedRow--;\n }\n\n if (table.rows[newSelectedRow]?.cells[colIndex]) {\n table.rows[newSelectedRow].cells[colIndex].isSelected = true;\n\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n }\n\n delete cell.cachedElement;\n }\n }\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import type { ContentModelTable } from 'roosterjs-content-model-types';
2
- /**
3
- * @internal
4
- */
5
- export declare function splitTableCellHorizontally(table: ContentModelTable): void;
1
+ import type { ContentModelTable } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function splitTableCellHorizontally(table: ContentModelTable): void;