roosterjs-content-model-api 9.45.0 → 9.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (820) hide show
  1. package/lib/index.d.ts +63 -63
  2. package/lib/index.js +131 -131
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.d.ts +5 -5
  5. package/lib/modelApi/block/setModelAlignment.js +65 -65
  6. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  7. package/lib/modelApi/block/setModelDirection.d.ts +5 -5
  8. package/lib/modelApi/block/setModelDirection.js +113 -113
  9. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  10. package/lib/modelApi/block/setModelIndentation.d.ts +8 -8
  11. package/lib/modelApi/block/setModelIndentation.js +158 -158
  12. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  13. package/lib/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  14. package/lib/modelApi/block/splitSelectedParagraphByBr.js +71 -71
  15. package/lib/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  16. package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  17. package/lib/modelApi/block/toggleModelBlockQuote.js +53 -53
  18. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  19. package/lib/modelApi/common/adjustIndentation.d.ts +13 -13
  20. package/lib/modelApi/common/adjustIndentation.js +114 -114
  21. package/lib/modelApi/common/adjustIndentation.js.map +1 -1
  22. package/lib/modelApi/common/clearModelFormat.d.ts +5 -5
  23. package/lib/modelApi/common/clearModelFormat.js +143 -143
  24. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  25. package/lib/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  26. package/lib/modelApi/common/queryContentModelBlocks.js +87 -87
  27. package/lib/modelApi/common/queryContentModelBlocks.js.map +1 -1
  28. package/lib/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  29. package/lib/modelApi/common/reducedModelChildProcessor.js +63 -63
  30. package/lib/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  31. package/lib/modelApi/common/wrapBlock.d.ts +16 -16
  32. package/lib/modelApi/common/wrapBlock.js +52 -52
  33. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  34. package/lib/modelApi/entity/insertEntityModel.d.ts +5 -5
  35. package/lib/modelApi/entity/insertEntityModel.js +105 -105
  36. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  37. package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  38. package/lib/modelApi/image/applyImageBorderFormat.js +57 -57
  39. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  40. package/lib/modelApi/link/getLinkUrl.d.ts +5 -5
  41. package/lib/modelApi/link/getLinkUrl.js +28 -28
  42. package/lib/modelApi/link/getLinkUrl.js.map +1 -1
  43. package/lib/modelApi/link/matchLink.d.ts +12 -12
  44. package/lib/modelApi/link/matchLink.js +93 -93
  45. package/lib/modelApi/link/matchLink.js.map +1 -1
  46. package/lib/modelApi/link/promoteLink.d.ts +20 -20
  47. package/lib/modelApi/link/promoteLink.js +54 -54
  48. package/lib/modelApi/link/promoteLink.js.map +1 -1
  49. package/lib/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  50. package/lib/modelApi/list/findListItemsInSameThread.js +113 -113
  51. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  52. package/lib/modelApi/list/getListAnnounceData.d.ts +7 -7
  53. package/lib/modelApi/list/getListAnnounceData.js +68 -68
  54. package/lib/modelApi/list/getListAnnounceData.js.map +1 -1
  55. package/lib/modelApi/list/setListType.d.ts +8 -8
  56. package/lib/modelApi/list/setListType.js +117 -117
  57. package/lib/modelApi/list/setListType.js.map +1 -1
  58. package/lib/modelApi/list/setModelListStartNumber.d.ts +7 -7
  59. package/lib/modelApi/list/setModelListStartNumber.js +21 -21
  60. package/lib/modelApi/list/setModelListStartNumber.js.map +1 -1
  61. package/lib/modelApi/list/setModelListStyle.d.ts +7 -7
  62. package/lib/modelApi/list/setModelListStyle.js +25 -25
  63. package/lib/modelApi/list/setModelListStyle.js.map +1 -1
  64. package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  65. package/lib/modelApi/selection/adjustSegmentSelection.js +47 -47
  66. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  67. package/lib/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  68. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
  69. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  70. package/lib/modelApi/selection/adjustWordSelection.d.ts +8 -8
  71. package/lib/modelApi/selection/adjustWordSelection.js +123 -123
  72. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  73. package/lib/modelApi/selection/collapseTableSelection.d.ts +5 -5
  74. package/lib/modelApi/selection/collapseTableSelection.js +16 -16
  75. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  76. package/lib/modelApi/table/alignTable.d.ts +5 -5
  77. package/lib/modelApi/table/alignTable.js +11 -11
  78. package/lib/modelApi/table/alignTable.js.map +1 -1
  79. package/lib/modelApi/table/alignTableCell.d.ts +9 -9
  80. package/lib/modelApi/table/alignTableCell.js +67 -57
  81. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  82. package/lib/modelApi/table/canMergeCells.d.ts +5 -5
  83. package/lib/modelApi/table/canMergeCells.js +56 -56
  84. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  85. package/lib/modelApi/table/clearSelectedCells.d.ts +7 -7
  86. package/lib/modelApi/table/clearSelectedCells.js +29 -29
  87. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  88. package/lib/modelApi/table/createTableStructure.d.ts +5 -5
  89. package/lib/modelApi/table/createTableStructure.js +19 -19
  90. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  91. package/lib/modelApi/table/deleteTable.d.ts +5 -5
  92. package/lib/modelApi/table/deleteTable.js +10 -10
  93. package/lib/modelApi/table/deleteTable.js.map +1 -1
  94. package/lib/modelApi/table/deleteTableColumn.d.ts +5 -5
  95. package/lib/modelApi/table/deleteTableColumn.js +24 -24
  96. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  97. package/lib/modelApi/table/deleteTableRow.d.ts +5 -5
  98. package/lib/modelApi/table/deleteTableRow.js +23 -23
  99. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  100. package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  101. package/lib/modelApi/table/ensureFocusableParagraphForTable.js +56 -56
  102. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  103. package/lib/modelApi/table/insertTableColumn.d.ts +7 -7
  104. package/lib/modelApi/table/insertTableColumn.js +27 -27
  105. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  106. package/lib/modelApi/table/insertTableRow.d.ts +7 -7
  107. package/lib/modelApi/table/insertTableRow.js +31 -31
  108. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  109. package/lib/modelApi/table/mergeTableCells.d.ts +5 -5
  110. package/lib/modelApi/table/mergeTableCells.js +25 -25
  111. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  112. package/lib/modelApi/table/mergeTableColumn.d.ts +5 -5
  113. package/lib/modelApi/table/mergeTableColumn.js +35 -35
  114. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  115. package/lib/modelApi/table/mergeTableRow.d.ts +5 -5
  116. package/lib/modelApi/table/mergeTableRow.js +35 -35
  117. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  118. package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  119. package/lib/modelApi/table/splitTableCellHorizontally.js +54 -54
  120. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  121. package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -5
  122. package/lib/modelApi/table/splitTableCellVertically.js +53 -53
  123. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  124. package/lib/publicApi/block/setAlignment.d.ts +7 -7
  125. package/lib/publicApi/block/setAlignment.js +16 -16
  126. package/lib/publicApi/block/setAlignment.js.map +1 -1
  127. package/lib/publicApi/block/setDirection.d.ts +7 -7
  128. package/lib/publicApi/block/setDirection.js +16 -16
  129. package/lib/publicApi/block/setDirection.js.map +1 -1
  130. package/lib/publicApi/block/setHeadingLevel.d.ts +7 -7
  131. package/lib/publicApi/block/setHeadingLevel.js +50 -50
  132. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  133. package/lib/publicApi/block/setIndentation.d.ts +8 -8
  134. package/lib/publicApi/block/setIndentation.js +21 -21
  135. package/lib/publicApi/block/setIndentation.js.map +1 -1
  136. package/lib/publicApi/block/setParagraphMargin.d.ts +9 -9
  137. package/lib/publicApi/block/setParagraphMargin.js +33 -33
  138. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  139. package/lib/publicApi/block/setSpacing.d.ts +7 -7
  140. package/lib/publicApi/block/setSpacing.js +21 -21
  141. package/lib/publicApi/block/setSpacing.js.map +1 -1
  142. package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -9
  143. package/lib/publicApi/block/toggleBlockQuote.js +39 -39
  144. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  145. package/lib/publicApi/entity/insertEntity.d.ts +25 -25
  146. package/lib/publicApi/entity/insertEntity.js +67 -67
  147. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  148. package/lib/publicApi/format/clearFormat.d.ts +6 -6
  149. package/lib/publicApi/format/clearFormat.js +34 -34
  150. package/lib/publicApi/format/clearFormat.js.map +1 -1
  151. package/lib/publicApi/format/getFormatState.d.ts +7 -7
  152. package/lib/publicApi/format/getFormatState.js +31 -31
  153. package/lib/publicApi/format/getFormatState.js.map +1 -1
  154. package/lib/publicApi/image/adjustImageSelection.d.ts +6 -6
  155. package/lib/publicApi/image/adjustImageSelection.js +29 -29
  156. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  157. package/lib/publicApi/image/changeImage.d.ts +7 -7
  158. package/lib/publicApi/image/changeImage.js +35 -35
  159. package/lib/publicApi/image/changeImage.js.map +1 -1
  160. package/lib/publicApi/image/insertImage.d.ts +7 -7
  161. package/lib/publicApi/image/insertImage.js +38 -38
  162. package/lib/publicApi/image/insertImage.js.map +1 -1
  163. package/lib/publicApi/image/setImageAltText.d.ts +8 -8
  164. package/lib/publicApi/image/setImageAltText.js +17 -17
  165. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  166. package/lib/publicApi/image/setImageBorder.d.ts +9 -9
  167. package/lib/publicApi/image/setImageBorder.js +19 -19
  168. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  169. package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -8
  170. package/lib/publicApi/image/setImageBoxShadow.js +29 -29
  171. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  172. package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -6
  173. package/lib/publicApi/link/adjustLinkSelection.js +34 -34
  174. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  175. package/lib/publicApi/link/insertLink.d.ts +15 -15
  176. package/lib/publicApi/link/insertLink.js +120 -120
  177. package/lib/publicApi/link/insertLink.js.map +1 -1
  178. package/lib/publicApi/link/removeLink.d.ts +8 -8
  179. package/lib/publicApi/link/removeLink.js +32 -32
  180. package/lib/publicApi/link/removeLink.js.map +1 -1
  181. package/lib/publicApi/list/setListStartNumber.d.ts +7 -7
  182. package/lib/publicApi/list/setListStartNumber.js +18 -18
  183. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  184. package/lib/publicApi/list/setListStyle.d.ts +7 -7
  185. package/lib/publicApi/list/setListStyle.js +18 -18
  186. package/lib/publicApi/list/setListStyle.js.map +1 -1
  187. package/lib/publicApi/list/toggleBullet.d.ts +9 -9
  188. package/lib/publicApi/list/toggleBullet.js +22 -22
  189. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  190. package/lib/publicApi/list/toggleNumbering.d.ts +9 -9
  191. package/lib/publicApi/list/toggleNumbering.js +22 -22
  192. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  193. package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -7
  194. package/lib/publicApi/segment/applySegmentFormat.js +23 -23
  195. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  196. package/lib/publicApi/segment/changeCapitalization.d.ts +10 -10
  197. package/lib/publicApi/segment/changeCapitalization.js +49 -49
  198. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  199. package/lib/publicApi/segment/changeFontSize.d.ts +8 -8
  200. package/lib/publicApi/segment/changeFontSize.js +63 -63
  201. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  202. package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -7
  203. package/lib/publicApi/segment/setBackgroundColor.js +35 -35
  204. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  205. package/lib/publicApi/segment/setFontName.d.ts +7 -7
  206. package/lib/publicApi/segment/setFontName.js +19 -19
  207. package/lib/publicApi/segment/setFontName.js.map +1 -1
  208. package/lib/publicApi/segment/setFontSize.d.ts +12 -12
  209. package/lib/publicApi/segment/setFontSize.js +33 -33
  210. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  211. package/lib/publicApi/segment/setTextColor.d.ts +7 -7
  212. package/lib/publicApi/segment/setTextColor.js +26 -26
  213. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  214. package/lib/publicApi/segment/splitTextSegment.d.ts +10 -10
  215. package/lib/publicApi/segment/splitTextSegment.js +30 -30
  216. package/lib/publicApi/segment/splitTextSegment.js.map +1 -1
  217. package/lib/publicApi/segment/toggleBold.d.ts +6 -6
  218. package/lib/publicApi/segment/toggleBold.js +27 -27
  219. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  220. package/lib/publicApi/segment/toggleCode.d.ts +6 -6
  221. package/lib/publicApi/segment/toggleCode.js +28 -28
  222. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  223. package/lib/publicApi/segment/toggleItalic.d.ts +6 -6
  224. package/lib/publicApi/segment/toggleItalic.js +21 -21
  225. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  226. package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  227. package/lib/publicApi/segment/toggleStrikethrough.js +15 -15
  228. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  229. package/lib/publicApi/segment/toggleSubscript.d.ts +6 -6
  230. package/lib/publicApi/segment/toggleSubscript.js +15 -15
  231. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  232. package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -6
  233. package/lib/publicApi/segment/toggleSuperscript.js +15 -15
  234. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  235. package/lib/publicApi/segment/toggleUnderline.d.ts +6 -6
  236. package/lib/publicApi/segment/toggleUnderline.js +24 -24
  237. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  238. package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  239. package/lib/publicApi/table/applyTableBorderFormat.js +297 -297
  240. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  241. package/lib/publicApi/table/editTable.d.ts +7 -7
  242. package/lib/publicApi/table/editTable.js +95 -95
  243. package/lib/publicApi/table/editTable.js.map +1 -1
  244. package/lib/publicApi/table/formatTable.d.ts +8 -8
  245. package/lib/publicApi/table/formatTable.js +38 -38
  246. package/lib/publicApi/table/formatTable.js.map +1 -1
  247. package/lib/publicApi/table/insertTable.d.ts +12 -12
  248. package/lib/publicApi/table/insertTable.js +76 -76
  249. package/lib/publicApi/table/insertTable.js.map +1 -1
  250. package/lib/publicApi/table/setTableCellShade.d.ts +7 -7
  251. package/lib/publicApi/table/setTableCellShade.js +32 -32
  252. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  253. package/lib/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  254. package/lib/publicApi/utils/createEditorContextForEntity.js +29 -29
  255. package/lib/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  256. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  257. package/lib/publicApi/utils/formatImageWithContentModel.js +18 -18
  258. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  259. package/lib/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  260. package/lib/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
  261. package/lib/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  262. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  263. package/lib/publicApi/utils/formatParagraphWithContentModel.js +23 -23
  264. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  265. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  266. package/lib/publicApi/utils/formatSegmentWithContentModel.js +117 -117
  267. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  268. package/lib/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  269. package/lib/publicApi/utils/formatTableWithContentModel.js +46 -46
  270. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  271. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  272. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +34 -34
  273. package/lib/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  274. package/lib-amd/index.d.ts +63 -63
  275. package/lib-amd/index.js +69 -69
  276. package/lib-amd/index.js.map +1 -1
  277. package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -5
  278. package/lib-amd/modelApi/block/setModelAlignment.js +64 -64
  279. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  280. package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -5
  281. package/lib-amd/modelApi/block/setModelDirection.js +112 -112
  282. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  283. package/lib-amd/modelApi/block/setModelIndentation.d.ts +8 -8
  284. package/lib-amd/modelApi/block/setModelIndentation.js +154 -154
  285. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  286. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  287. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js +71 -71
  288. package/lib-amd/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  289. package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  290. package/lib-amd/modelApi/block/toggleModelBlockQuote.js +52 -52
  291. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  292. package/lib-amd/modelApi/common/adjustIndentation.d.ts +13 -13
  293. package/lib-amd/modelApi/common/adjustIndentation.js +114 -114
  294. package/lib-amd/modelApi/common/adjustIndentation.js.map +1 -1
  295. package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -5
  296. package/lib-amd/modelApi/common/clearModelFormat.js +142 -142
  297. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  298. package/lib-amd/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  299. package/lib-amd/modelApi/common/queryContentModelBlocks.js +87 -87
  300. package/lib-amd/modelApi/common/queryContentModelBlocks.js.map +1 -1
  301. package/lib-amd/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  302. package/lib-amd/modelApi/common/reducedModelChildProcessor.js +63 -63
  303. package/lib-amd/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  304. package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -16
  305. package/lib-amd/modelApi/common/wrapBlock.js +52 -52
  306. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  307. package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -5
  308. package/lib-amd/modelApi/entity/insertEntityModel.js +105 -105
  309. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  310. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  311. package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -58
  312. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  313. package/lib-amd/modelApi/link/getLinkUrl.d.ts +5 -5
  314. package/lib-amd/modelApi/link/getLinkUrl.js +29 -29
  315. package/lib-amd/modelApi/link/getLinkUrl.js.map +1 -1
  316. package/lib-amd/modelApi/link/matchLink.d.ts +12 -12
  317. package/lib-amd/modelApi/link/matchLink.js +93 -93
  318. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  319. package/lib-amd/modelApi/link/promoteLink.d.ts +20 -20
  320. package/lib-amd/modelApi/link/promoteLink.js +54 -54
  321. package/lib-amd/modelApi/link/promoteLink.js.map +1 -1
  322. package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  323. package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -115
  324. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  325. package/lib-amd/modelApi/list/getListAnnounceData.d.ts +7 -7
  326. package/lib-amd/modelApi/list/getListAnnounceData.js +68 -68
  327. package/lib-amd/modelApi/list/getListAnnounceData.js.map +1 -1
  328. package/lib-amd/modelApi/list/setListType.d.ts +8 -8
  329. package/lib-amd/modelApi/list/setListType.js +116 -116
  330. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  331. package/lib-amd/modelApi/list/setModelListStartNumber.d.ts +7 -7
  332. package/lib-amd/modelApi/list/setModelListStartNumber.js +22 -22
  333. package/lib-amd/modelApi/list/setModelListStartNumber.js.map +1 -1
  334. package/lib-amd/modelApi/list/setModelListStyle.d.ts +7 -7
  335. package/lib-amd/modelApi/list/setModelListStyle.js +25 -25
  336. package/lib-amd/modelApi/list/setModelListStyle.js.map +1 -1
  337. package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  338. package/lib-amd/modelApi/selection/adjustSegmentSelection.js +48 -48
  339. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  340. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  341. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js +56 -56
  342. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  343. package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +8 -8
  344. package/lib-amd/modelApi/selection/adjustWordSelection.js +123 -123
  345. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  346. package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +5 -5
  347. package/lib-amd/modelApi/selection/collapseTableSelection.js +17 -17
  348. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  349. package/lib-amd/modelApi/table/alignTable.d.ts +5 -5
  350. package/lib-amd/modelApi/table/alignTable.js +13 -13
  351. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  352. package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -9
  353. package/lib-amd/modelApi/table/alignTableCell.js +68 -58
  354. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  355. package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -5
  356. package/lib-amd/modelApi/table/canMergeCells.js +58 -58
  357. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  358. package/lib-amd/modelApi/table/clearSelectedCells.d.ts +7 -7
  359. package/lib-amd/modelApi/table/clearSelectedCells.js +30 -30
  360. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  361. package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -5
  362. package/lib-amd/modelApi/table/createTableStructure.js +20 -20
  363. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  364. package/lib-amd/modelApi/table/deleteTable.d.ts +5 -5
  365. package/lib-amd/modelApi/table/deleteTable.js +12 -12
  366. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  367. package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -5
  368. package/lib-amd/modelApi/table/deleteTableColumn.js +24 -24
  369. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  370. package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -5
  371. package/lib-amd/modelApi/table/deleteTableRow.js +23 -23
  372. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  373. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  374. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +57 -57
  375. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  376. package/lib-amd/modelApi/table/insertTableColumn.d.ts +7 -7
  377. package/lib-amd/modelApi/table/insertTableColumn.js +27 -27
  378. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  379. package/lib-amd/modelApi/table/insertTableRow.d.ts +7 -7
  380. package/lib-amd/modelApi/table/insertTableRow.js +30 -30
  381. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  382. package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -5
  383. package/lib-amd/modelApi/table/mergeTableCells.js +25 -25
  384. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  385. package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -5
  386. package/lib-amd/modelApi/table/mergeTableColumn.js +35 -35
  387. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  388. package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -5
  389. package/lib-amd/modelApi/table/mergeTableRow.js +35 -35
  390. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  391. package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  392. package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -54
  393. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  394. package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -5
  395. package/lib-amd/modelApi/table/splitTableCellVertically.js +53 -53
  396. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  397. package/lib-amd/publicApi/block/setAlignment.d.ts +7 -7
  398. package/lib-amd/publicApi/block/setAlignment.js +17 -17
  399. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  400. package/lib-amd/publicApi/block/setDirection.d.ts +7 -7
  401. package/lib-amd/publicApi/block/setDirection.js +17 -17
  402. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  403. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -7
  404. package/lib-amd/publicApi/block/setHeadingLevel.js +51 -51
  405. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  406. package/lib-amd/publicApi/block/setIndentation.d.ts +8 -8
  407. package/lib-amd/publicApi/block/setIndentation.js +22 -22
  408. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  409. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -9
  410. package/lib-amd/publicApi/block/setParagraphMargin.js +33 -33
  411. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  412. package/lib-amd/publicApi/block/setSpacing.d.ts +7 -7
  413. package/lib-amd/publicApi/block/setSpacing.js +22 -22
  414. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  415. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -9
  416. package/lib-amd/publicApi/block/toggleBlockQuote.js +39 -39
  417. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  418. package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -25
  419. package/lib-amd/publicApi/entity/insertEntity.js +66 -66
  420. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  421. package/lib-amd/publicApi/format/clearFormat.d.ts +6 -6
  422. package/lib-amd/publicApi/format/clearFormat.js +34 -34
  423. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  424. package/lib-amd/publicApi/format/getFormatState.d.ts +7 -7
  425. package/lib-amd/publicApi/format/getFormatState.js +31 -31
  426. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  427. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -6
  428. package/lib-amd/publicApi/image/adjustImageSelection.js +29 -29
  429. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  430. package/lib-amd/publicApi/image/changeImage.d.ts +7 -7
  431. package/lib-amd/publicApi/image/changeImage.js +35 -35
  432. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  433. package/lib-amd/publicApi/image/insertImage.d.ts +7 -7
  434. package/lib-amd/publicApi/image/insertImage.js +39 -39
  435. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  436. package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -8
  437. package/lib-amd/publicApi/image/setImageAltText.js +18 -18
  438. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  439. package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -9
  440. package/lib-amd/publicApi/image/setImageBorder.js +19 -19
  441. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  442. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -8
  443. package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -30
  444. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  445. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -6
  446. package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -33
  447. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  448. package/lib-amd/publicApi/link/insertLink.d.ts +15 -15
  449. package/lib-amd/publicApi/link/insertLink.js +118 -118
  450. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  451. package/lib-amd/publicApi/link/removeLink.d.ts +8 -8
  452. package/lib-amd/publicApi/link/removeLink.js +32 -32
  453. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  454. package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -7
  455. package/lib-amd/publicApi/list/setListStartNumber.js +19 -19
  456. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  457. package/lib-amd/publicApi/list/setListStyle.d.ts +7 -7
  458. package/lib-amd/publicApi/list/setListStyle.js +19 -19
  459. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  460. package/lib-amd/publicApi/list/toggleBullet.d.ts +9 -9
  461. package/lib-amd/publicApi/list/toggleBullet.js +23 -23
  462. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  463. package/lib-amd/publicApi/list/toggleNumbering.d.ts +9 -9
  464. package/lib-amd/publicApi/list/toggleNumbering.js +23 -23
  465. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  466. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -7
  467. package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -24
  468. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  469. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -10
  470. package/lib-amd/publicApi/segment/changeCapitalization.js +50 -50
  471. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  472. package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -8
  473. package/lib-amd/publicApi/segment/changeFontSize.js +62 -62
  474. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  475. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -7
  476. package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -35
  477. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  478. package/lib-amd/publicApi/segment/setFontName.d.ts +7 -7
  479. package/lib-amd/publicApi/segment/setFontName.js +20 -20
  480. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  481. package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -12
  482. package/lib-amd/publicApi/segment/setFontSize.js +34 -34
  483. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  484. package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -7
  485. package/lib-amd/publicApi/segment/setTextColor.js +27 -27
  486. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  487. package/lib-amd/publicApi/segment/splitTextSegment.d.ts +10 -10
  488. package/lib-amd/publicApi/segment/splitTextSegment.js +30 -30
  489. package/lib-amd/publicApi/segment/splitTextSegment.js.map +1 -1
  490. package/lib-amd/publicApi/segment/toggleBold.d.ts +6 -6
  491. package/lib-amd/publicApi/segment/toggleBold.js +27 -27
  492. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  493. package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -6
  494. package/lib-amd/publicApi/segment/toggleCode.js +28 -28
  495. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  496. package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -6
  497. package/lib-amd/publicApi/segment/toggleItalic.js +22 -22
  498. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  499. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  500. package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -16
  501. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  502. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -6
  503. package/lib-amd/publicApi/segment/toggleSubscript.js +16 -16
  504. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  505. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -6
  506. package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -16
  507. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  508. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -6
  509. package/lib-amd/publicApi/segment/toggleUnderline.js +25 -25
  510. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  511. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  512. package/lib-amd/publicApi/table/applyTableBorderFormat.js +297 -297
  513. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  514. package/lib-amd/publicApi/table/editTable.d.ts +7 -7
  515. package/lib-amd/publicApi/table/editTable.js +84 -84
  516. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  517. package/lib-amd/publicApi/table/formatTable.d.ts +8 -8
  518. package/lib-amd/publicApi/table/formatTable.js +38 -38
  519. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  520. package/lib-amd/publicApi/table/insertTable.d.ts +12 -12
  521. package/lib-amd/publicApi/table/insertTable.js +74 -74
  522. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  523. package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -7
  524. package/lib-amd/publicApi/table/setTableCellShade.js +32 -32
  525. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  526. package/lib-amd/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  527. package/lib-amd/publicApi/utils/createEditorContextForEntity.js +30 -30
  528. package/lib-amd/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  529. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  530. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +19 -19
  531. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  532. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  533. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js +130 -130
  534. package/lib-amd/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  535. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  536. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +23 -23
  537. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  538. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  539. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +115 -115
  540. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  541. package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  542. package/lib-amd/publicApi/utils/formatTableWithContentModel.js +45 -45
  543. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  544. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  545. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +35 -35
  546. package/lib-amd/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  547. package/lib-mjs/index.d.ts +63 -63
  548. package/lib-mjs/index.js +63 -63
  549. package/lib-mjs/index.js.map +1 -1
  550. package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -5
  551. package/lib-mjs/modelApi/block/setModelAlignment.js +61 -61
  552. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  553. package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -5
  554. package/lib-mjs/modelApi/block/setModelDirection.js +109 -109
  555. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  556. package/lib-mjs/modelApi/block/setModelIndentation.d.ts +8 -8
  557. package/lib-mjs/modelApi/block/setModelIndentation.js +154 -154
  558. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  559. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.d.ts +7 -7
  560. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js +67 -67
  561. package/lib-mjs/modelApi/block/splitSelectedParagraphByBr.js.map +1 -1
  562. package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -5
  563. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +49 -49
  564. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  565. package/lib-mjs/modelApi/common/adjustIndentation.d.ts +13 -13
  566. package/lib-mjs/modelApi/common/adjustIndentation.js +109 -109
  567. package/lib-mjs/modelApi/common/adjustIndentation.js.map +1 -1
  568. package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -5
  569. package/lib-mjs/modelApi/common/clearModelFormat.js +139 -139
  570. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  571. package/lib-mjs/modelApi/common/queryContentModelBlocks.d.ts +10 -10
  572. package/lib-mjs/modelApi/common/queryContentModelBlocks.js +83 -83
  573. package/lib-mjs/modelApi/common/queryContentModelBlocks.js.map +1 -1
  574. package/lib-mjs/modelApi/common/reducedModelChildProcessor.d.ts +20 -20
  575. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js +59 -59
  576. package/lib-mjs/modelApi/common/reducedModelChildProcessor.js.map +1 -1
  577. package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -16
  578. package/lib-mjs/modelApi/common/wrapBlock.js +47 -47
  579. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  580. package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -5
  581. package/lib-mjs/modelApi/entity/insertEntityModel.js +101 -101
  582. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  583. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -5
  584. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +53 -53
  585. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  586. package/lib-mjs/modelApi/link/getLinkUrl.d.ts +5 -5
  587. package/lib-mjs/modelApi/link/getLinkUrl.js +24 -24
  588. package/lib-mjs/modelApi/link/getLinkUrl.js.map +1 -1
  589. package/lib-mjs/modelApi/link/matchLink.d.ts +12 -12
  590. package/lib-mjs/modelApi/link/matchLink.js +89 -89
  591. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  592. package/lib-mjs/modelApi/link/promoteLink.d.ts +20 -20
  593. package/lib-mjs/modelApi/link/promoteLink.js +49 -49
  594. package/lib-mjs/modelApi/link/promoteLink.js.map +1 -1
  595. package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +13 -13
  596. package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -109
  597. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  598. package/lib-mjs/modelApi/list/getListAnnounceData.d.ts +7 -7
  599. package/lib-mjs/modelApi/list/getListAnnounceData.js +64 -64
  600. package/lib-mjs/modelApi/list/getListAnnounceData.js.map +1 -1
  601. package/lib-mjs/modelApi/list/setListType.d.ts +8 -8
  602. package/lib-mjs/modelApi/list/setListType.js +113 -113
  603. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  604. package/lib-mjs/modelApi/list/setModelListStartNumber.d.ts +7 -7
  605. package/lib-mjs/modelApi/list/setModelListStartNumber.js +17 -17
  606. package/lib-mjs/modelApi/list/setModelListStartNumber.js.map +1 -1
  607. package/lib-mjs/modelApi/list/setModelListStyle.d.ts +7 -7
  608. package/lib-mjs/modelApi/list/setModelListStyle.js +21 -21
  609. package/lib-mjs/modelApi/list/setModelListStyle.js.map +1 -1
  610. package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -5
  611. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +43 -43
  612. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  613. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.d.ts +6 -6
  614. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js +52 -52
  615. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  616. package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +8 -8
  617. package/lib-mjs/modelApi/selection/adjustWordSelection.js +119 -119
  618. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  619. package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +5 -5
  620. package/lib-mjs/modelApi/selection/collapseTableSelection.js +12 -12
  621. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  622. package/lib-mjs/modelApi/table/alignTable.d.ts +5 -5
  623. package/lib-mjs/modelApi/table/alignTable.js +7 -7
  624. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  625. package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -9
  626. package/lib-mjs/modelApi/table/alignTableCell.js +62 -52
  627. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  628. package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -5
  629. package/lib-mjs/modelApi/table/canMergeCells.js +52 -52
  630. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  631. package/lib-mjs/modelApi/table/clearSelectedCells.d.ts +7 -7
  632. package/lib-mjs/modelApi/table/clearSelectedCells.js +25 -25
  633. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  634. package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -5
  635. package/lib-mjs/modelApi/table/createTableStructure.js +15 -15
  636. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  637. package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -5
  638. package/lib-mjs/modelApi/table/deleteTable.js +6 -6
  639. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  640. package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -5
  641. package/lib-mjs/modelApi/table/deleteTableColumn.js +20 -20
  642. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  643. package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -5
  644. package/lib-mjs/modelApi/table/deleteTableRow.js +19 -19
  645. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  646. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -8
  647. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +52 -52
  648. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  649. package/lib-mjs/modelApi/table/insertTableColumn.d.ts +7 -7
  650. package/lib-mjs/modelApi/table/insertTableColumn.js +23 -23
  651. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  652. package/lib-mjs/modelApi/table/insertTableRow.d.ts +7 -7
  653. package/lib-mjs/modelApi/table/insertTableRow.js +27 -27
  654. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  655. package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -5
  656. package/lib-mjs/modelApi/table/mergeTableCells.js +21 -21
  657. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  658. package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -5
  659. package/lib-mjs/modelApi/table/mergeTableColumn.js +31 -31
  660. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  661. package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -5
  662. package/lib-mjs/modelApi/table/mergeTableRow.js +31 -31
  663. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  664. package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -5
  665. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +50 -50
  666. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  667. package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -5
  668. package/lib-mjs/modelApi/table/splitTableCellVertically.js +49 -49
  669. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  670. package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -7
  671. package/lib-mjs/publicApi/block/setAlignment.js +12 -12
  672. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  673. package/lib-mjs/publicApi/block/setDirection.d.ts +7 -7
  674. package/lib-mjs/publicApi/block/setDirection.js +12 -12
  675. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  676. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -7
  677. package/lib-mjs/publicApi/block/setHeadingLevel.js +46 -46
  678. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  679. package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -8
  680. package/lib-mjs/publicApi/block/setIndentation.js +17 -17
  681. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  682. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -9
  683. package/lib-mjs/publicApi/block/setParagraphMargin.js +29 -29
  684. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  685. package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -7
  686. package/lib-mjs/publicApi/block/setSpacing.js +17 -17
  687. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  688. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -9
  689. package/lib-mjs/publicApi/block/toggleBlockQuote.js +35 -35
  690. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  691. package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -25
  692. package/lib-mjs/publicApi/entity/insertEntity.js +63 -63
  693. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  694. package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -6
  695. package/lib-mjs/publicApi/format/clearFormat.js +30 -30
  696. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  697. package/lib-mjs/publicApi/format/getFormatState.d.ts +7 -7
  698. package/lib-mjs/publicApi/format/getFormatState.js +27 -27
  699. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  700. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -6
  701. package/lib-mjs/publicApi/image/adjustImageSelection.js +25 -25
  702. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  703. package/lib-mjs/publicApi/image/changeImage.d.ts +7 -7
  704. package/lib-mjs/publicApi/image/changeImage.js +31 -31
  705. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  706. package/lib-mjs/publicApi/image/insertImage.d.ts +7 -7
  707. package/lib-mjs/publicApi/image/insertImage.js +34 -34
  708. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  709. package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -8
  710. package/lib-mjs/publicApi/image/setImageAltText.js +13 -13
  711. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  712. package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -9
  713. package/lib-mjs/publicApi/image/setImageBorder.js +15 -15
  714. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  715. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -8
  716. package/lib-mjs/publicApi/image/setImageBoxShadow.js +25 -25
  717. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  718. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -6
  719. package/lib-mjs/publicApi/link/adjustLinkSelection.js +30 -30
  720. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  721. package/lib-mjs/publicApi/link/insertLink.d.ts +15 -15
  722. package/lib-mjs/publicApi/link/insertLink.js +116 -116
  723. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  724. package/lib-mjs/publicApi/link/removeLink.d.ts +8 -8
  725. package/lib-mjs/publicApi/link/removeLink.js +28 -28
  726. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  727. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -7
  728. package/lib-mjs/publicApi/list/setListStartNumber.js +14 -14
  729. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  730. package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -7
  731. package/lib-mjs/publicApi/list/setListStyle.js +14 -14
  732. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  733. package/lib-mjs/publicApi/list/toggleBullet.d.ts +9 -9
  734. package/lib-mjs/publicApi/list/toggleBullet.js +18 -18
  735. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  736. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +9 -9
  737. package/lib-mjs/publicApi/list/toggleNumbering.js +18 -18
  738. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  739. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -7
  740. package/lib-mjs/publicApi/segment/applySegmentFormat.js +19 -19
  741. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  742. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -10
  743. package/lib-mjs/publicApi/segment/changeCapitalization.js +45 -45
  744. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  745. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -8
  746. package/lib-mjs/publicApi/segment/changeFontSize.js +59 -59
  747. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  748. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -7
  749. package/lib-mjs/publicApi/segment/setBackgroundColor.js +31 -31
  750. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  751. package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -7
  752. package/lib-mjs/publicApi/segment/setFontName.js +15 -15
  753. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  754. package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -12
  755. package/lib-mjs/publicApi/segment/setFontSize.js +28 -28
  756. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  757. package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -7
  758. package/lib-mjs/publicApi/segment/setTextColor.js +22 -22
  759. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  760. package/lib-mjs/publicApi/segment/splitTextSegment.d.ts +10 -10
  761. package/lib-mjs/publicApi/segment/splitTextSegment.js +26 -26
  762. package/lib-mjs/publicApi/segment/splitTextSegment.js.map +1 -1
  763. package/lib-mjs/publicApi/segment/toggleBold.d.ts +6 -6
  764. package/lib-mjs/publicApi/segment/toggleBold.js +23 -23
  765. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  766. package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -6
  767. package/lib-mjs/publicApi/segment/toggleCode.js +24 -24
  768. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  769. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -6
  770. package/lib-mjs/publicApi/segment/toggleItalic.js +17 -17
  771. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  772. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -6
  773. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +11 -11
  774. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  775. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -6
  776. package/lib-mjs/publicApi/segment/toggleSubscript.js +11 -11
  777. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  778. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -6
  779. package/lib-mjs/publicApi/segment/toggleSuperscript.js +11 -11
  780. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  781. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -6
  782. package/lib-mjs/publicApi/segment/toggleUnderline.js +20 -20
  783. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  784. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -8
  785. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +293 -293
  786. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  787. package/lib-mjs/publicApi/table/editTable.d.ts +7 -7
  788. package/lib-mjs/publicApi/table/editTable.js +91 -91
  789. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  790. package/lib-mjs/publicApi/table/formatTable.d.ts +8 -8
  791. package/lib-mjs/publicApi/table/formatTable.js +34 -34
  792. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  793. package/lib-mjs/publicApi/table/insertTable.d.ts +12 -12
  794. package/lib-mjs/publicApi/table/insertTable.js +72 -72
  795. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  796. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -7
  797. package/lib-mjs/publicApi/table/setTableCellShade.js +28 -28
  798. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  799. package/lib-mjs/publicApi/utils/createEditorContextForEntity.d.ts +8 -8
  800. package/lib-mjs/publicApi/utils/createEditorContextForEntity.js +25 -25
  801. package/lib-mjs/publicApi/utils/createEditorContextForEntity.js.map +1 -1
  802. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +8 -8
  803. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +14 -14
  804. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  805. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.d.ts +9 -9
  806. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js +126 -126
  807. package/lib-mjs/publicApi/utils/formatInsertPointWithContentModel.js.map +1 -1
  808. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +8 -8
  809. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +19 -19
  810. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  811. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +11 -11
  812. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +113 -113
  813. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  814. package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +9 -9
  815. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js +42 -42
  816. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  817. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.d.ts +8 -8
  818. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js +30 -30
  819. package/lib-mjs/publicApi/utils/formatTextSegmentBeforeSelectionMarker.js.map +1 -1
  820. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";;;;IAqCA;;;;;OAKG;IACH,SAAgB,sBAAsB,CAClC,MAAe,EACf,MAAc,EACd,SAA2B;QAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACK,IAAA,KAAA,oBAAe,IAAA,mDAAqB,EAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QA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Unit,\r\n setFirstColumnFormatBorders,\r\n updateTableCellMetadata,\r\n} from 'roosterjs-content-model-dom';\r\nimport type {\r\n IEditor,\r\n Border,\r\n BorderOperations,\r\n TableSelectionCoordinates,\r\n ReadonlyContentModelTableCell,\r\n ReadonlyContentModelTable,\r\n} from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * @internal\r\n * Border positions\r\n */\r\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\r\n\r\n/**\r\n * @internal\r\n * Perimeter of the table selection\r\n * Used to determine where to apply border to the cells adjacent to the selection.\r\n */\r\ntype Perimeter = {\r\n Top: boolean;\r\n Bottom: boolean;\r\n Left: boolean;\r\n Right: boolean;\r\n};\r\n\r\n/**\r\n * Operations to apply border\r\n * @param editor The editor instance\r\n * @param border The border to apply\r\n * @param operation The operation to apply\r\n */\r\nexport function applyTableBorderFormat(\r\n editor: IEditor,\r\n border: Border,\r\n operation: BorderOperations\r\n) {\r\n editor.formatContentModel(\r\n model => {\r\n const [tableModel] = getFirstSelectedTable(model);\r\n\r\n if (tableModel) {\r\n const sel = getSelectedCells(tableModel);\r\n const perimeter: Perimeter = {\r\n Top: false,\r\n Bottom: false,\r\n Left: false,\r\n Right: false,\r\n };\r\n\r\n // Create border format with table format as backup\r\n let borderFormat = '';\r\n const format = tableModel.format;\r\n const { width, style, color } = border;\r\n const extractedBorder = extractBorderValues(format.borderTop);\r\n const borderColor = extractedBorder.color;\r\n const borderWidth = extractedBorder.width;\r\n const borderStyle = extractedBorder.style;\r\n\r\n if (width) {\r\n borderFormat = parseValueWithUnit(width) + 'px';\r\n } else if (borderWidth) {\r\n borderFormat = borderWidth;\r\n } else {\r\n borderFormat = '1px';\r\n }\r\n\r\n if (style) {\r\n borderFormat = `${borderFormat} ${style}`;\r\n } else if (borderStyle) {\r\n borderFormat = `${borderFormat} ${borderStyle}`;\r\n } else {\r\n borderFormat = `${borderFormat} solid`;\r\n }\r\n\r\n if (color) {\r\n borderFormat = `${borderFormat} ${color}`;\r\n } else if (borderColor) {\r\n borderFormat = `${borderFormat} ${borderColor}`;\r\n }\r\n\r\n // undefined is treated as Left to Right\r\n const isRtl = tableModel.format.direction == 'rtl';\r\n\r\n if (sel) {\r\n const operations: BorderOperations[] = [operation];\r\n while (operations.length) {\r\n switch (operations.pop()) {\r\n case 'noBorders':\r\n // Do All borders but with empty border format\r\n borderFormat = '';\r\n operations.push('allBorders');\r\n break;\r\n case 'allBorders':\r\n const allBorders: BorderPositions[] = [\r\n 'borderTop',\r\n 'borderBottom',\r\n 'borderLeft',\r\n 'borderRight',\r\n ];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[colIndex];\r\n // Format cells - All borders\r\n applyBorderFormat(cell, borderFormat, allBorders);\r\n }\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Top = true;\r\n perimeter.Bottom = true;\r\n perimeter.Left = true;\r\n perimeter.Right = true;\r\n break;\r\n case 'leftBorders':\r\n const leftBorder: BorderPositions[] = ['borderLeft'];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ];\r\n // Format cells - Left border\r\n applyBorderFormat(cell, borderFormat, leftBorder);\r\n }\r\n\r\n // Format perimeter\r\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\r\n break;\r\n case 'rightBorders':\r\n const rightBorder: BorderPositions[] = ['borderRight'];\r\n for (\r\n let rowIndex = sel.firstRow;\r\n rowIndex <= sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ];\r\n // Format cells - Right border\r\n applyBorderFormat(cell, borderFormat, rightBorder);\r\n }\r\n\r\n // Format perimeter\r\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\r\n break;\r\n case 'topBorders':\r\n const topBorder: BorderPositions[] = ['borderTop'];\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n // Format cells - Top border\r\n applyBorderFormat(cell, borderFormat, topBorder);\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Top = true;\r\n break;\r\n case 'bottomBorders':\r\n const bottomBorder: BorderPositions[] = ['borderBottom'];\r\n for (\r\n let colIndex = sel.firstColumn;\r\n colIndex <= sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\r\n // Format cells - Bottom border\r\n applyBorderFormat(cell, borderFormat, bottomBorder);\r\n }\r\n\r\n // Format perimeter\r\n perimeter.Bottom = true;\r\n break;\r\n case 'insideBorders':\r\n // Format cells - Inside borders\r\n const singleCol = sel.lastColumn == sel.firstColumn;\r\n const singleRow = sel.lastRow == sel.firstRow;\r\n // Single cell selection\r\n if (singleCol && singleRow) {\r\n break;\r\n }\r\n // Single column selection\r\n if (singleCol) {\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\r\n borderFormat,\r\n ['borderBottom']\r\n );\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex <= sel.lastRow - 1;\r\n rowIndex++\r\n ) {\r\n const cell =\r\n tableModel.rows[rowIndex].cells[sel.firstColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n ]);\r\n }\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\r\n borderFormat,\r\n ['borderTop']\r\n );\r\n break;\r\n }\r\n // Single row selection\r\n if (singleRow) {\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderRight']\r\n );\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex <= sel.lastColumn - 1;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderLeft']\r\n );\r\n break;\r\n }\r\n\r\n // For multiple rows and columns selections\r\n // Top left cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderBottom', 'borderRight']\r\n );\r\n // Top right cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.firstRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderBottom', 'borderLeft']\r\n );\r\n // Bottom left cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[\r\n isRtl ? sel.lastColumn : sel.firstColumn\r\n ],\r\n borderFormat,\r\n ['borderTop', 'borderRight']\r\n );\r\n // Bottom right cell\r\n applyBorderFormat(\r\n tableModel.rows[sel.lastRow].cells[\r\n isRtl ? sel.firstColumn : sel.lastColumn\r\n ],\r\n borderFormat,\r\n ['borderTop', 'borderLeft']\r\n );\r\n // First row\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex < sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderBottom',\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n // Last row\r\n for (\r\n let colIndex = sel.firstColumn + 1;\r\n colIndex < sel.lastColumn;\r\n colIndex++\r\n ) {\r\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderLeft',\r\n 'borderRight',\r\n ]);\r\n }\r\n // First column\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex < sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n isRtl ? 'borderLeft' : 'borderRight',\r\n ]);\r\n }\r\n // Last column\r\n for (\r\n let rowIndex = sel.firstRow + 1;\r\n rowIndex < sel.lastRow;\r\n rowIndex++\r\n ) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\r\n applyBorderFormat(cell, borderFormat, [\r\n 'borderTop',\r\n 'borderBottom',\r\n isRtl ? 'borderRight' : 'borderLeft',\r\n ]);\r\n }\r\n // Inner cells\r\n sel.firstColumn++;\r\n sel.firstRow++;\r\n sel.lastColumn--;\r\n sel.lastRow--;\r\n operations.push('allBorders');\r\n break;\r\n case 'outsideBorders':\r\n // Format cells - Outside borders\r\n operations.push('topBorders');\r\n operations.push('bottomBorders');\r\n operations.push('leftBorders');\r\n operations.push('rightBorders');\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n //Format perimeter if necessary or possible\r\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\r\n }\r\n\r\n const tableMeta = getTableMetadata(tableModel);\r\n if (tableMeta) {\r\n // Enforce first column format if necessary\r\n setFirstColumnFormatBorders(mutateBlock(tableModel).rows, tableMeta);\r\n }\r\n\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n },\r\n {\r\n apiName: 'tableBorder',\r\n }\r\n );\r\n}\r\n\r\n/**\r\n * @internal\r\n * Apply border format to a cell\r\n * @param cell The cell to apply border format\r\n * @param borderFormat The border format to apply\r\n * @param positions The positions to apply\r\n */\r\nfunction applyBorderFormat(\r\n cell: ReadonlyContentModelTableCell,\r\n borderFormat: string,\r\n positions: BorderPositions[]\r\n) {\r\n const mutableCell = mutateBlock(cell);\r\n\r\n positions.forEach(pos => {\r\n mutableCell.format[pos] = borderFormat;\r\n });\r\n\r\n updateTableCellMetadata(mutableCell, metadata => {\r\n metadata = metadata || {};\r\n metadata.borderOverride = true;\r\n return metadata;\r\n });\r\n}\r\n\r\n/**\r\n * @internal\r\n * Modify the perimeter of the table selection\r\n * @param tableModel The table model\r\n * @param sel The table selection\r\n * @param borderFormat The border format to apply\r\n * If borderFormat is empty, the border will be removed\r\n * @param perimeter Where in the perimeter to apply\r\n */\r\nfunction modifyPerimeter(\r\n tableModel: ReadonlyContentModelTable,\r\n sel: TableSelectionCoordinates,\r\n borderFormat: string,\r\n perimeter: Perimeter,\r\n isRtl: boolean\r\n) {\r\n // Top of selection\r\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\r\n }\r\n }\r\n // Bottom of selection\r\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\r\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\r\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\r\n applyBorderFormat(cell, borderFormat, ['borderTop']);\r\n }\r\n }\r\n // Left of selection\r\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\r\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\r\n }\r\n }\r\n // Right of selection\r\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\r\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\r\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\r\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"applyTableBorderFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/applyTableBorderFormat.ts"],"names":[],"mappings":";;;;IAqCA;;;;;OAKG;IACH,SAAgB,sBAAsB,CAClC,MAAe,EACf,MAAc,EACd,SAA2B;QAE3B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACK,IAAA,KAAA,oBAAe,IAAA,mDAAqB,EAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;YAElD,IAAI,UAAU,EAAE;gBACZ,IAAM,GAAG,GAAG,IAAA,8CAAgB,EAAC,UAAU,CAAC,CAAC;gBACzC,IAAM,SAAS,GAAc;oBACzB,GAAG,EAAE,KAAK;oBACV,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,KAAK;iBACf,CAAC;gBAEF,mDAAmD;gBACnD,IAAI,YAAY,GAAG,EAAE,CAAC;gBACtB,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;gBACzB,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,KAAK,GAAY,MAAM,MAAlB,EAAE,KAAK,GAAK,MAAM,MAAX,CAAY;gBACvC,IAAM,eAAe,GAAG,IAAA,iDAAmB,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAC9D,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;gBAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;gBAC1C,IAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;gBAE1C,IAAI,KAAK,EAAE;oBACP,YAAY,GAAG,IAAA,gDAAkB,EA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,CAAC,MAAM,EAAE;YACzE,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;gBACjE,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;aACjF;SACJ;IACL,CAAC","sourcesContent":["import {\n extractBorderValues,\n getFirstSelectedTable,\n getSelectedCells,\n mutateBlock,\n getTableMetadata,\n parseValueWithUnit,\n setFirstColumnFormatBorders,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-dom';\nimport type {\n IEditor,\n Border,\n BorderOperations,\n TableSelectionCoordinates,\n ReadonlyContentModelTableCell,\n ReadonlyContentModelTable,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n * Border positions\n */\ntype BorderPositions = 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight';\n\n/**\n * @internal\n * Perimeter of the table selection\n * Used to determine where to apply border to the cells adjacent to the selection.\n */\ntype Perimeter = {\n Top: boolean;\n Bottom: boolean;\n Left: boolean;\n Right: boolean;\n};\n\n/**\n * Operations to apply border\n * @param editor The editor instance\n * @param border The border to apply\n * @param operation The operation to apply\n */\nexport function applyTableBorderFormat(\n editor: IEditor,\n border: Border,\n operation: BorderOperations\n) {\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n const sel = getSelectedCells(tableModel);\n const perimeter: Perimeter = {\n Top: false,\n Bottom: false,\n Left: false,\n Right: false,\n };\n\n // Create border format with table format as backup\n let borderFormat = '';\n const format = tableModel.format;\n const { width, style, color } = border;\n const extractedBorder = extractBorderValues(format.borderTop);\n const borderColor = extractedBorder.color;\n const borderWidth = extractedBorder.width;\n const borderStyle = extractedBorder.style;\n\n if (width) {\n borderFormat = parseValueWithUnit(width) + 'px';\n } else if (borderWidth) {\n borderFormat = borderWidth;\n } else {\n borderFormat = '1px';\n }\n\n if (style) {\n borderFormat = `${borderFormat} ${style}`;\n } else if (borderStyle) {\n borderFormat = `${borderFormat} ${borderStyle}`;\n } else {\n borderFormat = `${borderFormat} solid`;\n }\n\n if (color) {\n borderFormat = `${borderFormat} ${color}`;\n } else if (borderColor) {\n borderFormat = `${borderFormat} ${borderColor}`;\n }\n\n // undefined is treated as Left to Right\n const isRtl = tableModel.format.direction == 'rtl';\n\n if (sel) {\n const operations: BorderOperations[] = [operation];\n while (operations.length) {\n switch (operations.pop()) {\n case 'noBorders':\n // Do All borders but with empty border format\n borderFormat = '';\n operations.push('allBorders');\n break;\n case 'allBorders':\n const allBorders: BorderPositions[] = [\n 'borderTop',\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[colIndex];\n // Format cells - All borders\n applyBorderFormat(cell, borderFormat, allBorders);\n }\n }\n\n // Format perimeter\n perimeter.Top = true;\n perimeter.Bottom = true;\n perimeter.Left = true;\n perimeter.Right = true;\n break;\n case 'leftBorders':\n const leftBorder: BorderPositions[] = ['borderLeft'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ];\n // Format cells - Left border\n applyBorderFormat(cell, borderFormat, leftBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Right = true) : (perimeter.Left = true);\n break;\n case 'rightBorders':\n const rightBorder: BorderPositions[] = ['borderRight'];\n for (\n let rowIndex = sel.firstRow;\n rowIndex <= sel.lastRow;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ];\n // Format cells - Right border\n applyBorderFormat(cell, borderFormat, rightBorder);\n }\n\n // Format perimeter\n isRtl ? (perimeter.Left = true) : (perimeter.Right = true);\n break;\n case 'topBorders':\n const topBorder: BorderPositions[] = ['borderTop'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n // Format cells - Top border\n applyBorderFormat(cell, borderFormat, topBorder);\n }\n\n // Format perimeter\n perimeter.Top = true;\n break;\n case 'bottomBorders':\n const bottomBorder: BorderPositions[] = ['borderBottom'];\n for (\n let colIndex = sel.firstColumn;\n colIndex <= sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n // Format cells - Bottom border\n applyBorderFormat(cell, borderFormat, bottomBorder);\n }\n\n // Format perimeter\n perimeter.Bottom = true;\n break;\n case 'insideBorders':\n // Format cells - Inside borders\n const singleCol = sel.lastColumn == sel.firstColumn;\n const singleRow = sel.lastRow == sel.firstRow;\n // Single cell selection\n if (singleCol && singleRow) {\n break;\n }\n // Single column selection\n if (singleCol) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[sel.firstColumn],\n borderFormat,\n ['borderBottom']\n );\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex <= sel.lastRow - 1;\n rowIndex++\n ) {\n const cell =\n tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[sel.firstColumn],\n borderFormat,\n ['borderTop']\n );\n break;\n }\n // Single row selection\n if (singleRow) {\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderRight']\n );\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex <= sel.lastColumn - 1;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderLeft',\n 'borderRight',\n ]);\n }\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderLeft']\n );\n break;\n }\n\n // For multiple rows and columns selections\n // Top left cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderBottom', 'borderRight']\n );\n // Top right cell\n applyBorderFormat(\n tableModel.rows[sel.firstRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderBottom', 'borderLeft']\n );\n // Bottom left cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.lastColumn : sel.firstColumn\n ],\n borderFormat,\n ['borderTop', 'borderRight']\n );\n // Bottom right cell\n applyBorderFormat(\n tableModel.rows[sel.lastRow].cells[\n isRtl ? sel.firstColumn : sel.lastColumn\n ],\n borderFormat,\n ['borderTop', 'borderLeft']\n );\n // First row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.firstRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderBottom',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // Last row\n for (\n let colIndex = sel.firstColumn + 1;\n colIndex < sel.lastColumn;\n colIndex++\n ) {\n const cell = tableModel.rows[sel.lastRow].cells[colIndex];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderLeft',\n 'borderRight',\n ]);\n }\n // First column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderLeft' : 'borderRight',\n ]);\n }\n // Last column\n for (\n let rowIndex = sel.firstRow + 1;\n rowIndex < sel.lastRow;\n rowIndex++\n ) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn];\n applyBorderFormat(cell, borderFormat, [\n 'borderTop',\n 'borderBottom',\n isRtl ? 'borderRight' : 'borderLeft',\n ]);\n }\n // Inner cells\n sel.firstColumn++;\n sel.firstRow++;\n sel.lastColumn--;\n sel.lastRow--;\n operations.push('allBorders');\n break;\n case 'outsideBorders':\n // Format cells - Outside borders\n operations.push('topBorders');\n operations.push('bottomBorders');\n operations.push('leftBorders');\n operations.push('rightBorders');\n break;\n default:\n break;\n }\n }\n\n //Format perimeter if necessary or possible\n modifyPerimeter(tableModel, sel, borderFormat, perimeter, isRtl);\n }\n\n const tableMeta = getTableMetadata(tableModel);\n if (tableMeta) {\n // Enforce first column format if necessary\n setFirstColumnFormatBorders(mutateBlock(tableModel).rows, tableMeta);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'tableBorder',\n }\n );\n}\n\n/**\n * @internal\n * Apply border format to a cell\n * @param cell The cell to apply border format\n * @param borderFormat The border format to apply\n * @param positions The positions to apply\n */\nfunction applyBorderFormat(\n cell: ReadonlyContentModelTableCell,\n borderFormat: string,\n positions: BorderPositions[]\n) {\n const mutableCell = mutateBlock(cell);\n\n positions.forEach(pos => {\n mutableCell.format[pos] = borderFormat;\n });\n\n updateTableCellMetadata(mutableCell, metadata => {\n metadata = metadata || {};\n metadata.borderOverride = true;\n return metadata;\n });\n}\n\n/**\n * @internal\n * Modify the perimeter of the table selection\n * @param tableModel The table model\n * @param sel The table selection\n * @param borderFormat The border format to apply\n * If borderFormat is empty, the border will be removed\n * @param perimeter Where in the perimeter to apply\n */\nfunction modifyPerimeter(\n tableModel: ReadonlyContentModelTable,\n sel: TableSelectionCoordinates,\n borderFormat: string,\n perimeter: Perimeter,\n isRtl: boolean\n) {\n // Top of selection\n if (perimeter.Top && sel.firstRow - 1 >= 0) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.firstRow - 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderBottom']);\n }\n }\n // Bottom of selection\n if (perimeter.Bottom && sel.lastRow + 1 < tableModel.rows.length) {\n for (let colIndex = sel.firstColumn; colIndex <= sel.lastColumn; colIndex++) {\n const cell = tableModel.rows[sel.lastRow + 1].cells[colIndex];\n applyBorderFormat(cell, borderFormat, ['borderTop']);\n }\n }\n // Left of selection\n if (perimeter.Left && sel.firstColumn - 1 >= 0) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.firstColumn - 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderLeft' : 'borderRight']);\n }\n }\n // Right of selection\n if (perimeter.Right && sel.lastColumn + 1 < tableModel.rows[0].cells.length) {\n for (let rowIndex = sel.firstRow; rowIndex <= sel.lastRow; rowIndex++) {\n const cell = tableModel.rows[rowIndex].cells[sel.lastColumn + 1];\n applyBorderFormat(cell, borderFormat, [isRtl ? 'borderRight' : 'borderLeft']);\n }\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
2
- /**
3
- * Format current focused table with the given format
4
- * @param editor The editor instance
5
- * @param operation The table operation to apply
6
- */
7
- export declare function editTable(editor: IEditor, operation: TableOperation): void;
1
+ import type { TableOperation, IEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Format current focused table with the given format
4
+ * @param editor The editor instance
5
+ * @param operation The table operation to apply
6
+ */
7
+ export declare function editTable(editor: IEditor, operation: TableOperation): void;
@@ -1,85 +1,85 @@
1
- define(["require", "exports", "../../modelApi/table/alignTable", "../../modelApi/table/deleteTable", "../../modelApi/table/deleteTableColumn", "../../modelApi/table/deleteTableRow", "../utils/formatTableWithContentModel", "../../modelApi/table/insertTableColumn", "../../modelApi/table/insertTableRow", "../../modelApi/table/mergeTableCells", "../../modelApi/table/mergeTableColumn", "../../modelApi/table/mergeTableRow", "../../modelApi/table/splitTableCellHorizontally", "../../modelApi/table/splitTableCellVertically", "../../modelApi/table/alignTableCell"], function (require, exports, alignTable_1, deleteTable_1, deleteTableColumn_1, deleteTableRow_1, formatTableWithContentModel_1, insertTableColumn_1, insertTableRow_1, mergeTableCells_1, mergeTableColumn_1, mergeTableRow_1, splitTableCellHorizontally_1, splitTableCellVertically_1, alignTableCell_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.editTable = void 0;
5
- /**
6
- * Format current focused table with the given format
7
- * @param editor The editor instance
8
- * @param operation The table operation to apply
9
- */
10
- function editTable(editor, operation) {
11
- editor.focus();
12
- fixUpSafariSelection(editor);
13
- (0, formatTableWithContentModel_1.formatTableWithContentModel)(editor, 'editTable', function (tableModel) {
14
- switch (operation) {
15
- case 'alignCellLeft':
16
- case 'alignCellCenter':
17
- case 'alignCellRight':
18
- (0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
19
- break;
20
- case 'alignCellTop':
21
- case 'alignCellMiddle':
22
- case 'alignCellBottom':
23
- (0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
24
- break;
25
- case 'alignCenter':
26
- case 'alignLeft':
27
- case 'alignRight':
28
- (0, alignTable_1.alignTable)(tableModel, operation);
29
- break;
30
- case 'deleteColumn':
31
- (0, deleteTableColumn_1.deleteTableColumn)(tableModel);
32
- break;
33
- case 'deleteRow':
34
- (0, deleteTableRow_1.deleteTableRow)(tableModel);
35
- break;
36
- case 'deleteTable':
37
- (0, deleteTable_1.deleteTable)(tableModel);
38
- break;
39
- case 'insertAbove':
40
- case 'insertBelow':
41
- (0, insertTableRow_1.insertTableRow)(tableModel, operation);
42
- break;
43
- case 'insertLeft':
44
- case 'insertRight':
45
- (0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
46
- break;
47
- case 'mergeAbove':
48
- case 'mergeBelow':
49
- (0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
50
- break;
51
- case 'mergeCells':
52
- (0, mergeTableCells_1.mergeTableCells)(tableModel);
53
- break;
54
- case 'mergeLeft':
55
- case 'mergeRight':
56
- (0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
57
- break;
58
- case 'splitHorizontally':
59
- (0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
60
- break;
61
- case 'splitVertically':
62
- (0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
63
- break;
64
- }
65
- });
66
- }
67
- exports.editTable = editTable;
68
- // In safari, when open context menu under a table, it may expand the range selection to the beginning of next table cell.
69
- // So we make a workaround here to collapse the selection when need, to avoid unexpected table editing behavior
70
- // (e.g. insert two columns but actually need one only)
71
- function fixUpSafariSelection(editor) {
72
- if (editor.getEnvironment().isSafari) {
73
- var selection = editor.getDOMSelection();
74
- if ((selection === null || selection === void 0 ? void 0 : selection.type) == 'range' && !selection.range.collapsed) {
75
- selection.range.collapse(true /*toStart*/);
76
- editor.setDOMSelection({
77
- type: 'range',
78
- range: selection.range,
79
- isReverted: false,
80
- });
81
- }
82
- }
83
- }
84
- });
1
+ define(["require", "exports", "../../modelApi/table/alignTable", "../../modelApi/table/deleteTable", "../../modelApi/table/deleteTableColumn", "../../modelApi/table/deleteTableRow", "../utils/formatTableWithContentModel", "../../modelApi/table/insertTableColumn", "../../modelApi/table/insertTableRow", "../../modelApi/table/mergeTableCells", "../../modelApi/table/mergeTableColumn", "../../modelApi/table/mergeTableRow", "../../modelApi/table/splitTableCellHorizontally", "../../modelApi/table/splitTableCellVertically", "../../modelApi/table/alignTableCell"], function (require, exports, alignTable_1, deleteTable_1, deleteTableColumn_1, deleteTableRow_1, formatTableWithContentModel_1, insertTableColumn_1, insertTableRow_1, mergeTableCells_1, mergeTableColumn_1, mergeTableRow_1, splitTableCellHorizontally_1, splitTableCellVertically_1, alignTableCell_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.editTable = void 0;
5
+ /**
6
+ * Format current focused table with the given format
7
+ * @param editor The editor instance
8
+ * @param operation The table operation to apply
9
+ */
10
+ function editTable(editor, operation) {
11
+ editor.focus();
12
+ fixUpSafariSelection(editor);
13
+ (0, formatTableWithContentModel_1.formatTableWithContentModel)(editor, 'editTable', function (tableModel) {
14
+ switch (operation) {
15
+ case 'alignCellLeft':
16
+ case 'alignCellCenter':
17
+ case 'alignCellRight':
18
+ (0, alignTableCell_1.alignTableCellHorizontally)(tableModel, operation);
19
+ break;
20
+ case 'alignCellTop':
21
+ case 'alignCellMiddle':
22
+ case 'alignCellBottom':
23
+ (0, alignTableCell_1.alignTableCellVertically)(tableModel, operation);
24
+ break;
25
+ case 'alignCenter':
26
+ case 'alignLeft':
27
+ case 'alignRight':
28
+ (0, alignTable_1.alignTable)(tableModel, operation);
29
+ break;
30
+ case 'deleteColumn':
31
+ (0, deleteTableColumn_1.deleteTableColumn)(tableModel);
32
+ break;
33
+ case 'deleteRow':
34
+ (0, deleteTableRow_1.deleteTableRow)(tableModel);
35
+ break;
36
+ case 'deleteTable':
37
+ (0, deleteTable_1.deleteTable)(tableModel);
38
+ break;
39
+ case 'insertAbove':
40
+ case 'insertBelow':
41
+ (0, insertTableRow_1.insertTableRow)(tableModel, operation);
42
+ break;
43
+ case 'insertLeft':
44
+ case 'insertRight':
45
+ (0, insertTableColumn_1.insertTableColumn)(tableModel, operation);
46
+ break;
47
+ case 'mergeAbove':
48
+ case 'mergeBelow':
49
+ (0, mergeTableRow_1.mergeTableRow)(tableModel, operation);
50
+ break;
51
+ case 'mergeCells':
52
+ (0, mergeTableCells_1.mergeTableCells)(tableModel);
53
+ break;
54
+ case 'mergeLeft':
55
+ case 'mergeRight':
56
+ (0, mergeTableColumn_1.mergeTableColumn)(tableModel, operation);
57
+ break;
58
+ case 'splitHorizontally':
59
+ (0, splitTableCellHorizontally_1.splitTableCellHorizontally)(tableModel);
60
+ break;
61
+ case 'splitVertically':
62
+ (0, splitTableCellVertically_1.splitTableCellVertically)(tableModel);
63
+ break;
64
+ }
65
+ });
66
+ }
67
+ exports.editTable = editTable;
68
+ // In safari, when open context menu under a table, it may expand the range selection to the beginning of next table cell.
69
+ // So we make a workaround here to collapse the selection when need, to avoid unexpected table editing behavior
70
+ // (e.g. insert two columns but actually need one only)
71
+ function fixUpSafariSelection(editor) {
72
+ if (editor.getEnvironment().isSafari) {
73
+ var selection = editor.getDOMSelection();
74
+ if ((selection === null || selection === void 0 ? void 0 : selection.type) == 'range' && !selection.range.collapsed) {
75
+ selection.range.collapse(true /*toStart*/);
76
+ editor.setDOMSelection({
77
+ type: 'range',
78
+ range: selection.range,
79
+ isReverted: false,
80
+ });
81
+ }
82
+ }
83
+ }
84
+ });
85
85
  //# sourceMappingURL=editTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/editTable.ts"],"names":[],"mappings":";;;;IAkBA;;;;OAIG;IACH,SAAgB,SAAS,CAAC,MAAe,EAAE,SAAyB;QAChE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,oBAAoB,CAAC,MAAM,CAAC,CAAC;QAE7B,IAAA,yDAA2B,EAAC,MAAM,EAAE,WAAW,EAAE,UAAA,UAAU;YACvD,QAAQ,SAAS,EAAE;gBACf,KAAK,eAAe,CAAC;gBACrB,KAAK,iBAAiB,CAAC;gBACvB,KAAK,gBAAgB;oBACjB,IAAA,2CAA0B,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;oBAClD,MAAM;gBACV,KAAK,cAAc,CAAC;gBACpB,KAAK,iBAAiB,CAAC;gBACvB,KAAK,iBAAiB;oBAClB,IAAA,yCAAwB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;oBAChD,MAAM;gBACV,KAAK,aAAa,CAAC;gBACnB,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,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;YAE3C,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,KAAI,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;gBAC1D,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3C,MAAM,CAAC,eAAe,CAAC;oBACnB,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,UAAU,EAAE,KAAK;iBACpB,CAAC,CAAC;aACN;SACJ;IACL,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\r\nimport { deleteTable } from '../../modelApi/table/deleteTable';\r\nimport { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';\r\nimport { deleteTableRow } from '../../modelApi/table/deleteTableRow';\r\nimport { formatTableWithContentModel } from '../utils/formatTableWithContentModel';\r\nimport { insertTableColumn } from '../../modelApi/table/insertTableColumn';\r\nimport { insertTableRow } from '../../modelApi/table/insertTableRow';\r\nimport { mergeTableCells } from '../../modelApi/table/mergeTableCells';\r\nimport { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';\r\nimport { mergeTableRow } from '../../modelApi/table/mergeTableRow';\r\nimport { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';\r\nimport { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';\r\nimport type { TableOperation, IEditor } from 'roosterjs-content-model-types';\r\nimport {\r\n alignTableCellHorizontally,\r\n alignTableCellVertically,\r\n} from '../../modelApi/table/alignTableCell';\r\n\r\n/**\r\n * Format current focused table with the given format\r\n * @param editor The editor instance\r\n * @param operation The table operation to apply\r\n */\r\nexport function editTable(editor: IEditor, operation: TableOperation) {\r\n editor.focus();\r\n\r\n fixUpSafariSelection(editor);\r\n\r\n formatTableWithContentModel(editor, 'editTable', tableModel => {\r\n switch (operation) {\r\n case 'alignCellLeft':\r\n case 'alignCellCenter':\r\n case 'alignCellRight':\r\n alignTableCellHorizontally(tableModel, operation);\r\n break;\r\n case 'alignCellTop':\r\n case 'alignCellMiddle':\r\n case 'alignCellBottom':\r\n alignTableCellVertically(tableModel, operation);\r\n break;\r\n case 'alignCenter':\r\n case 'alignLeft':\r\n case 'alignRight':\r\n alignTable(tableModel, operation);\r\n break;\r\n\r\n case 'deleteColumn':\r\n deleteTableColumn(tableModel);\r\n break;\r\n\r\n case 'deleteRow':\r\n deleteTableRow(tableModel);\r\n break;\r\n\r\n case 'deleteTable':\r\n deleteTable(tableModel);\r\n break;\r\n\r\n case 'insertAbove':\r\n case 'insertBelow':\r\n insertTableRow(tableModel, operation);\r\n break;\r\n\r\n case 'insertLeft':\r\n case 'insertRight':\r\n insertTableColumn(tableModel, operation);\r\n break;\r\n\r\n case 'mergeAbove':\r\n case 'mergeBelow':\r\n mergeTableRow(tableModel, operation);\r\n break;\r\n\r\n case 'mergeCells':\r\n mergeTableCells(tableModel);\r\n break;\r\n\r\n case 'mergeLeft':\r\n case 'mergeRight':\r\n mergeTableColumn(tableModel, operation);\r\n break;\r\n\r\n case 'splitHorizontally':\r\n splitTableCellHorizontally(tableModel);\r\n break;\r\n\r\n case 'splitVertically':\r\n splitTableCellVertically(tableModel);\r\n break;\r\n }\r\n });\r\n}\r\n\r\n// In safari, when open context menu under a table, it may expand the range selection to the beginning of next table cell.\r\n// So we make a workaround here to collapse the selection when need, to avoid unexpected table editing behavior\r\n// (e.g. insert two columns but actually need one only)\r\nfunction fixUpSafariSelection(editor: IEditor) {\r\n if (editor.getEnvironment().isSafari) {\r\n const selection = editor.getDOMSelection();\r\n\r\n if (selection?.type == 'range' && !selection.range.collapsed) {\r\n selection.range.collapse(true /*toStart*/);\r\n editor.setDOMSelection({\r\n type: 'range',\r\n range: selection.range,\r\n isReverted: false,\r\n });\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"editTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content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AE,SAAS,CAAC,CAAC;oBACrC,MAAM;gBAEV,KAAK,YAAY;oBACb,IAAA,iCAAe,EAAC,UAAU,CAAC,CAAC;oBAC5B,MAAM;gBAEV,KAAK,WAAW,CAAC;gBACjB,KAAK,YAAY;oBACb,IAAA,mCAAgB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;oBACxC,MAAM;gBAEV,KAAK,mBAAmB;oBACpB,IAAA,uDAA0B,EAAC,UAAU,CAAC,CAAC;oBACvC,MAAM;gBAEV,KAAK,iBAAiB;oBAClB,IAAA,mDAAwB,EAAC,UAAU,CAAC,CAAC;oBACrC,MAAM;aACb;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IApED,8BAoEC;IAED,0HAA0H;IAC1H,+GAA+G;IAC/G,uDAAuD;IACvD,SAAS,oBAAoB,CAAC,MAAe;QACzC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE;YAClC,IAAM,SAAS,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;YAE3C,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,KAAI,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE;gBAC1D,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC3C,MAAM,CAAC,eAAe,CAAC;oBACnB,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,SAAS,CAAC,KAAK;oBACtB,UAAU,EAAE,KAAK;iBACpB,CAAC,CAAC;aACN;SACJ;IACL,CAAC","sourcesContent":["import { alignTable } from '../../modelApi/table/alignTable';\nimport { deleteTable } from '../../modelApi/table/deleteTable';\nimport { deleteTableColumn } from '../../modelApi/table/deleteTableColumn';\nimport { deleteTableRow } from '../../modelApi/table/deleteTableRow';\nimport { formatTableWithContentModel } from '../utils/formatTableWithContentModel';\nimport { insertTableColumn } from '../../modelApi/table/insertTableColumn';\nimport { insertTableRow } from '../../modelApi/table/insertTableRow';\nimport { mergeTableCells } from '../../modelApi/table/mergeTableCells';\nimport { mergeTableColumn } from '../../modelApi/table/mergeTableColumn';\nimport { mergeTableRow } from '../../modelApi/table/mergeTableRow';\nimport { splitTableCellHorizontally } from '../../modelApi/table/splitTableCellHorizontally';\nimport { splitTableCellVertically } from '../../modelApi/table/splitTableCellVertically';\nimport type { TableOperation, IEditor } from 'roosterjs-content-model-types';\nimport {\n alignTableCellHorizontally,\n alignTableCellVertically,\n} from '../../modelApi/table/alignTableCell';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param operation The table operation to apply\n */\nexport function editTable(editor: IEditor, operation: TableOperation) {\n editor.focus();\n\n fixUpSafariSelection(editor);\n\n formatTableWithContentModel(editor, 'editTable', tableModel => {\n switch (operation) {\n case 'alignCellLeft':\n case 'alignCellCenter':\n case 'alignCellRight':\n alignTableCellHorizontally(tableModel, operation);\n break;\n case 'alignCellTop':\n case 'alignCellMiddle':\n case 'alignCellBottom':\n alignTableCellVertically(tableModel, operation);\n break;\n case 'alignCenter':\n case 'alignLeft':\n case 'alignRight':\n alignTable(tableModel, operation);\n break;\n\n case 'deleteColumn':\n deleteTableColumn(tableModel);\n break;\n\n case 'deleteRow':\n deleteTableRow(tableModel);\n break;\n\n case 'deleteTable':\n deleteTable(tableModel);\n break;\n\n case 'insertAbove':\n case 'insertBelow':\n insertTableRow(tableModel, operation);\n break;\n\n case 'insertLeft':\n case 'insertRight':\n insertTableColumn(tableModel, operation);\n break;\n\n case 'mergeAbove':\n case 'mergeBelow':\n mergeTableRow(tableModel, operation);\n break;\n\n case 'mergeCells':\n mergeTableCells(tableModel);\n break;\n\n case 'mergeLeft':\n case 'mergeRight':\n mergeTableColumn(tableModel, operation);\n break;\n\n case 'splitHorizontally':\n splitTableCellHorizontally(tableModel);\n break;\n\n case 'splitVertically':\n splitTableCellVertically(tableModel);\n break;\n }\n });\n}\n\n// In safari, when open context menu under a table, it may expand the range selection to the beginning of next table cell.\n// So we make a workaround here to collapse the selection when need, to avoid unexpected table editing behavior\n// (e.g. insert two columns but actually need one only)\nfunction fixUpSafariSelection(editor: IEditor) {\n if (editor.getEnvironment().isSafari) {\n const selection = editor.getDOMSelection();\n\n if (selection?.type == 'range' && !selection.range.collapsed) {\n selection.range.collapse(true /*toStart*/);\n editor.setDOMSelection({\n type: 'range',\n range: selection.range,\n isReverted: false,\n });\n }\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
2
- /**
3
- * Format current focused table with the given format
4
- * @param editor The editor instance
5
- * @param format The table format to apply
6
- * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
7
- */
8
- export declare function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
1
+ import type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Format current focused table with the given format
4
+ * @param editor The editor instance
5
+ * @param format The table format to apply
6
+ * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
7
+ */
8
+ export declare function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean): void;
@@ -1,39 +1,39 @@
1
- define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.formatTable = void 0;
5
- /**
6
- * Format current focused table with the given format
7
- * @param editor The editor instance
8
- * @param format The table format to apply
9
- * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
10
- */
11
- function formatTable(editor, format, keepCellShade) {
12
- editor.focus();
13
- editor.formatContentModel(function (model) {
14
- var _a = (0, tslib_1.__read)((0, roosterjs_content_model_dom_1.getFirstSelectedTable)(model), 1), tableModel = _a[0];
15
- if (tableModel) {
16
- // Wipe border metadata
17
- tableModel.rows.forEach(function (row) {
18
- row.cells.forEach(function (cell) {
19
- (0, roosterjs_content_model_dom_1.updateTableCellMetadata)((0, roosterjs_content_model_dom_1.mutateBlock)(cell), function (metadata) {
20
- if (metadata) {
21
- delete metadata.borderOverride;
22
- }
23
- return metadata;
24
- });
25
- });
26
- });
27
- (0, roosterjs_content_model_dom_1.applyTableFormat)(tableModel, format, keepCellShade);
28
- return true;
29
- }
30
- else {
31
- return false;
32
- }
33
- }, {
34
- apiName: 'formatTable',
35
- });
36
- }
37
- exports.formatTable = formatTable;
38
- });
1
+ define(["require", "exports", "tslib", "roosterjs-content-model-dom"], function (require, exports, tslib_1, roosterjs_content_model_dom_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.formatTable = void 0;
5
+ /**
6
+ * Format current focused table with the given format
7
+ * @param editor The editor instance
8
+ * @param format The table format to apply
9
+ * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color
10
+ */
11
+ function formatTable(editor, format, keepCellShade) {
12
+ editor.focus();
13
+ editor.formatContentModel(function (model) {
14
+ var _a = (0, tslib_1.__read)((0, roosterjs_content_model_dom_1.getFirstSelectedTable)(model), 1), tableModel = _a[0];
15
+ if (tableModel) {
16
+ // Wipe border metadata
17
+ tableModel.rows.forEach(function (row) {
18
+ row.cells.forEach(function (cell) {
19
+ (0, roosterjs_content_model_dom_1.updateTableCellMetadata)((0, roosterjs_content_model_dom_1.mutateBlock)(cell), function (metadata) {
20
+ if (metadata) {
21
+ delete metadata.borderOverride;
22
+ }
23
+ return metadata;
24
+ });
25
+ });
26
+ });
27
+ (0, roosterjs_content_model_dom_1.applyTableFormat)(tableModel, format, keepCellShade);
28
+ return true;
29
+ }
30
+ else {
31
+ return false;
32
+ }
33
+ }, {
34
+ apiName: 'formatTable',
35
+ });
36
+ }
37
+ exports.formatTable = formatTable;
38
+ });
39
39
  //# sourceMappingURL=formatTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";;;;IAQA;;;;;OAKG;IACH,SAAgB,WAAW,CAAC,MAAe,EAAE,MAA2B,EAAE,aAAuB;QAC7F,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACK,IAAA,KAAA,oBAAe,IAAA,mDAAqB,EAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;YAElD,IAAI,UAAU,EAAE;gBACZ,uBAAuB;gBACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;wBAClB,IAAA,qDAAuB,EAAC,IAAA,yCAAW,EAAC,IAAI,CAAC,EAAE,UAAA,QAAQ;4BAC/C,IAAI,QAAQ,EAAE;gCACV,OAAO,QAAQ,CAAC,cAAc,CAAC;6BAClC;4BACD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBACH,IAAA,8CAAgB,EAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;gBACpD,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC;IA7BD,kCA6BC","sourcesContent":["import {\r\n applyTableFormat,\r\n getFirstSelectedTable,\r\n mutateBlock,\r\n updateTableCellMetadata,\r\n} from 'roosterjs-content-model-dom';\r\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\r\n\r\n/**\r\n * Format current focused table with the given format\r\n * @param editor The editor instance\r\n * @param format The table format to apply\r\n * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color\r\n */\r\nexport function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean) {\r\n editor.focus();\r\n\r\n editor.formatContentModel(\r\n model => {\r\n const [tableModel] = getFirstSelectedTable(model);\r\n\r\n if (tableModel) {\r\n // Wipe border metadata\r\n tableModel.rows.forEach(row => {\r\n row.cells.forEach(cell => {\r\n updateTableCellMetadata(mutateBlock(cell), metadata => {\r\n if (metadata) {\r\n delete metadata.borderOverride;\r\n }\r\n return metadata;\r\n });\r\n });\r\n });\r\n applyTableFormat(tableModel, format, keepCellShade);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n },\r\n {\r\n apiName: 'formatTable',\r\n }\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"formatTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/formatTable.ts"],"names":[],"mappings":";;;;IAQA;;;;;OAKG;IACH,SAAgB,WAAW,CAAC,MAAe,EAAE,MAA2B,EAAE,aAAuB;QAC7F,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACK,IAAA,KAAA,oBAAe,IAAA,mDAAqB,EAAC,KAAK,CAAC,IAAA,EAA1C,UAAU,QAAgC,CAAC;YAElD,IAAI,UAAU,EAAE;gBACZ,uBAAuB;gBACvB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBACvB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;wBAClB,IAAA,qDAAuB,EAAC,IAAA,yCAAW,EAAC,IAAI,CAAC,EAAE,UAAA,QAAQ;4BAC/C,IAAI,QAAQ,EAAE;gCACV,OAAO,QAAQ,CAAC,cAAc,CAAC;6BAClC;4BACD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBACH,IAAA,8CAAgB,EAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;gBACpD,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC;IA7BD,kCA6BC","sourcesContent":["import {\n applyTableFormat,\n getFirstSelectedTable,\n mutateBlock,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-dom';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Format current focused table with the given format\n * @param editor The editor instance\n * @param format The table format to apply\n * @param keepCellShade Whether keep existing shade color when apply format if there is a manually set shade color\n */\nexport function formatTable(editor: IEditor, format: TableMetadataFormat, keepCellShade?: boolean) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [tableModel] = getFirstSelectedTable(model);\n\n if (tableModel) {\n // Wipe border metadata\n tableModel.rows.forEach(row => {\n row.cells.forEach(cell => {\n updateTableCellMetadata(mutateBlock(cell), metadata => {\n if (metadata) {\n delete metadata.borderOverride;\n }\n return metadata;\n });\n });\n });\n applyTableFormat(tableModel, format, keepCellShade);\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'formatTable',\n }\n );\n}\n"]}
@@ -1,12 +1,12 @@
1
- import type { ContentModelTableFormat, IEditor, TableMetadataFormat, ContentModelTableCellFormat } from 'roosterjs-content-model-types';
2
- /**
3
- * Insert table into editor at current selection
4
- * @param editor The editor instance
5
- * @param columns Number of columns in table, it also controls the default table cell width:
6
- * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px
7
- * @param rows Number of rows in table
8
- * @param tableMetadataFormat (Optional) The table format that are stored as metadata. If not passed, the default format will be applied: background color: #FFF; border color: #ABABAB
9
- * @param format (Optional) The table format used for style attributes
10
- * @param cellFormat (Optional) custom format for table cells, except for borders styles, for borders use tableMetadataFormat
11
- */
12
- export declare function insertTable(editor: IEditor, columns: number, rows: number, tableMetadataFormat?: Partial<TableMetadataFormat>, format?: ContentModelTableFormat, customCellFormat?: ContentModelTableCellFormat): void;
1
+ import type { ContentModelTableFormat, IEditor, TableMetadataFormat, ContentModelTableCellFormat } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Insert table into editor at current selection
4
+ * @param editor The editor instance
5
+ * @param columns Number of columns in table, it also controls the default table cell width:
6
+ * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px
7
+ * @param rows Number of rows in table
8
+ * @param tableMetadataFormat (Optional) The table format that are stored as metadata. If not passed, the default format will be applied: background color: #FFF; border color: #ABABAB
9
+ * @param format (Optional) The table format used for style attributes
10
+ * @param cellFormat (Optional) custom format for table cells, except for borders styles, for borders use tableMetadataFormat
11
+ */
12
+ export declare function insertTable(editor: IEditor, columns: number, rows: number, tableMetadataFormat?: Partial<TableMetadataFormat>, format?: ContentModelTableFormat, customCellFormat?: ContentModelTableCellFormat): void;