roosterjs-content-model-api 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (523) hide show
  1. package/lib/index.d.ts +46 -42
  2. package/lib/index.js +52 -43
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  5. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  6. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  7. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  8. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  9. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  10. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  11. package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  12. package/lib/modelApi/image/applyImageBorderFormat.js +2 -1
  13. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  14. package/lib/modelApi/link/matchLink.d.ts +1 -18
  15. package/lib/modelApi/link/matchLink.js +0 -1
  16. package/lib/modelApi/link/matchLink.js.map +1 -1
  17. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  18. package/lib/modelApi/list/setListType.js.map +1 -1
  19. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  20. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  21. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  22. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  23. package/lib/modelApi/table/alignTable.js.map +1 -1
  24. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  25. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  26. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  27. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  28. package/lib/modelApi/table/deleteTable.js.map +1 -1
  29. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  30. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  31. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  32. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  33. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  34. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  35. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  36. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  37. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  38. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  39. package/lib/publicApi/block/setAlignment.d.ts +1 -1
  40. package/lib/publicApi/block/setAlignment.js +2 -1
  41. package/lib/publicApi/block/setAlignment.js.map +1 -1
  42. package/lib/publicApi/block/setDirection.d.ts +1 -1
  43. package/lib/publicApi/block/setDirection.js +2 -1
  44. package/lib/publicApi/block/setDirection.js.map +1 -1
  45. package/lib/publicApi/block/setHeadingLevel.d.ts +1 -1
  46. package/lib/publicApi/block/setHeadingLevel.js +2 -1
  47. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  48. package/lib/publicApi/block/setIndentation.d.ts +1 -1
  49. package/lib/publicApi/block/setIndentation.js +2 -1
  50. package/lib/publicApi/block/setIndentation.js.map +1 -1
  51. package/lib/publicApi/block/setParagraphMargin.d.ts +1 -1
  52. package/lib/publicApi/block/setParagraphMargin.js +2 -1
  53. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  54. package/lib/publicApi/block/setSpacing.d.ts +1 -1
  55. package/lib/publicApi/block/setSpacing.js +2 -1
  56. package/lib/publicApi/block/setSpacing.js.map +1 -1
  57. package/lib/publicApi/block/toggleBlockQuote.d.ts +1 -1
  58. package/lib/publicApi/block/toggleBlockQuote.js +2 -1
  59. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  60. package/lib/publicApi/entity/insertEntity.d.ts +2 -2
  61. package/lib/publicApi/entity/insertEntity.js +2 -1
  62. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  63. package/lib/publicApi/format/clearFormat.d.ts +1 -1
  64. package/lib/publicApi/format/clearFormat.js +2 -1
  65. package/lib/publicApi/format/clearFormat.js.map +1 -1
  66. package/lib/publicApi/format/getFormatState.d.ts +1 -1
  67. package/lib/publicApi/format/getFormatState.js +2 -1
  68. package/lib/publicApi/format/getFormatState.js.map +1 -1
  69. package/lib/publicApi/image/adjustImageSelection.d.ts +1 -1
  70. package/lib/publicApi/image/adjustImageSelection.js +2 -1
  71. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  72. package/lib/publicApi/image/changeImage.d.ts +1 -1
  73. package/lib/publicApi/image/changeImage.js +3 -2
  74. package/lib/publicApi/image/changeImage.js.map +1 -1
  75. package/lib/publicApi/image/insertImage.d.ts +1 -1
  76. package/lib/publicApi/image/insertImage.js +2 -1
  77. package/lib/publicApi/image/insertImage.js.map +1 -1
  78. package/lib/publicApi/image/setImageAltText.d.ts +1 -1
  79. package/lib/publicApi/image/setImageAltText.js +3 -2
  80. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  81. package/lib/publicApi/image/setImageBorder.d.ts +1 -1
  82. package/lib/publicApi/image/setImageBorder.js +4 -3
  83. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  84. package/lib/publicApi/image/setImageBoxShadow.d.ts +1 -1
  85. package/lib/publicApi/image/setImageBoxShadow.js +3 -2
  86. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  87. package/lib/publicApi/link/adjustLinkSelection.d.ts +1 -1
  88. package/lib/publicApi/link/adjustLinkSelection.js +2 -1
  89. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  90. package/lib/publicApi/link/insertLink.d.ts +1 -1
  91. package/lib/publicApi/link/insertLink.js +2 -1
  92. package/lib/publicApi/link/insertLink.js.map +1 -1
  93. package/lib/publicApi/link/removeLink.d.ts +1 -1
  94. package/lib/publicApi/link/removeLink.js +2 -1
  95. package/lib/publicApi/link/removeLink.js.map +1 -1
  96. package/lib/publicApi/list/setListStartNumber.d.ts +1 -1
  97. package/lib/publicApi/list/setListStartNumber.js +2 -1
  98. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  99. package/lib/publicApi/list/setListStyle.d.ts +1 -1
  100. package/lib/publicApi/list/setListStyle.js +2 -1
  101. package/lib/publicApi/list/setListStyle.js.map +1 -1
  102. package/lib/publicApi/list/toggleBullet.d.ts +1 -1
  103. package/lib/publicApi/list/toggleBullet.js +2 -1
  104. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  105. package/lib/publicApi/list/toggleNumbering.d.ts +1 -1
  106. package/lib/publicApi/list/toggleNumbering.js +2 -1
  107. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  108. package/lib/publicApi/segment/applySegmentFormat.d.ts +1 -1
  109. package/lib/publicApi/segment/applySegmentFormat.js +2 -1
  110. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  111. package/lib/publicApi/segment/changeCapitalization.d.ts +1 -1
  112. package/lib/publicApi/segment/changeCapitalization.js +2 -1
  113. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  114. package/lib/publicApi/segment/changeFontSize.d.ts +1 -1
  115. package/lib/publicApi/segment/changeFontSize.js +2 -1
  116. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  117. package/lib/publicApi/segment/setBackgroundColor.d.ts +1 -1
  118. package/lib/publicApi/segment/setBackgroundColor.js +2 -1
  119. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  120. package/lib/publicApi/segment/setFontName.d.ts +1 -1
  121. package/lib/publicApi/segment/setFontName.js +2 -1
  122. package/lib/publicApi/segment/setFontName.js.map +1 -1
  123. package/lib/publicApi/segment/setFontSize.d.ts +1 -1
  124. package/lib/publicApi/segment/setFontSize.js +2 -2
  125. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  126. package/lib/publicApi/segment/setTextColor.d.ts +1 -1
  127. package/lib/publicApi/segment/setTextColor.js +2 -1
  128. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  129. package/lib/publicApi/segment/toggleBold.d.ts +1 -1
  130. package/lib/publicApi/segment/toggleBold.js +2 -1
  131. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  132. package/lib/publicApi/segment/toggleCode.d.ts +1 -1
  133. package/lib/publicApi/segment/toggleCode.js +2 -1
  134. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  135. package/lib/publicApi/segment/toggleItalic.d.ts +1 -1
  136. package/lib/publicApi/segment/toggleItalic.js +2 -1
  137. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  138. package/lib/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  139. package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
  140. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  141. package/lib/publicApi/segment/toggleSubscript.d.ts +1 -1
  142. package/lib/publicApi/segment/toggleSubscript.js +2 -1
  143. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  144. package/lib/publicApi/segment/toggleSuperscript.d.ts +1 -1
  145. package/lib/publicApi/segment/toggleSuperscript.js +2 -1
  146. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  147. package/lib/publicApi/segment/toggleUnderline.d.ts +1 -1
  148. package/lib/publicApi/segment/toggleUnderline.js +2 -1
  149. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  150. package/lib/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  151. package/lib/publicApi/table/applyTableBorderFormat.js +2 -1
  152. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  153. package/lib/publicApi/table/editTable.d.ts +1 -1
  154. package/lib/publicApi/table/editTable.js +2 -1
  155. package/lib/publicApi/table/editTable.js.map +1 -1
  156. package/lib/publicApi/table/formatTable.d.ts +1 -1
  157. package/lib/publicApi/table/formatTable.js +2 -1
  158. package/lib/publicApi/table/formatTable.js.map +1 -1
  159. package/lib/publicApi/table/insertTable.d.ts +1 -1
  160. package/lib/publicApi/table/insertTable.js +2 -1
  161. package/lib/publicApi/table/insertTable.js.map +1 -1
  162. package/lib/publicApi/table/setTableCellShade.d.ts +1 -1
  163. package/lib/publicApi/table/setTableCellShade.js +2 -1
  164. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  165. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  166. package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
  167. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  168. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  169. package/lib/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  170. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  171. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  172. package/lib/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  173. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  174. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  175. package/lib-amd/index.d.ts +46 -42
  176. package/lib-amd/index.js +48 -44
  177. package/lib-amd/index.js.map +1 -1
  178. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  179. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  180. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  181. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  182. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  183. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  184. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  185. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  186. package/lib-amd/modelApi/image/applyImageBorderFormat.js +2 -1
  187. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  188. package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
  189. package/lib-amd/modelApi/link/matchLink.js +0 -1
  190. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  191. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  192. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  193. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  194. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  195. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  196. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  197. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  198. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  199. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  200. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  201. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  202. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  203. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  204. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  205. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  206. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  207. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  208. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  209. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  210. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  211. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  212. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  213. package/lib-amd/publicApi/block/setAlignment.d.ts +1 -1
  214. package/lib-amd/publicApi/block/setAlignment.js +2 -1
  215. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  216. package/lib-amd/publicApi/block/setDirection.d.ts +1 -1
  217. package/lib-amd/publicApi/block/setDirection.js +2 -1
  218. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  219. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +1 -1
  220. package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
  221. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  222. package/lib-amd/publicApi/block/setIndentation.d.ts +1 -1
  223. package/lib-amd/publicApi/block/setIndentation.js +2 -1
  224. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  225. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +1 -1
  226. package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
  227. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  228. package/lib-amd/publicApi/block/setSpacing.d.ts +1 -1
  229. package/lib-amd/publicApi/block/setSpacing.js +2 -1
  230. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  231. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +1 -1
  232. package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
  233. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  234. package/lib-amd/publicApi/entity/insertEntity.d.ts +2 -2
  235. package/lib-amd/publicApi/entity/insertEntity.js +2 -1
  236. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  237. package/lib-amd/publicApi/format/clearFormat.d.ts +1 -1
  238. package/lib-amd/publicApi/format/clearFormat.js +2 -1
  239. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  240. package/lib-amd/publicApi/format/getFormatState.d.ts +1 -1
  241. package/lib-amd/publicApi/format/getFormatState.js +2 -1
  242. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  243. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +1 -1
  244. package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
  245. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  246. package/lib-amd/publicApi/image/changeImage.d.ts +1 -1
  247. package/lib-amd/publicApi/image/changeImage.js +3 -2
  248. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  249. package/lib-amd/publicApi/image/insertImage.d.ts +1 -1
  250. package/lib-amd/publicApi/image/insertImage.js +2 -1
  251. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  252. package/lib-amd/publicApi/image/setImageAltText.d.ts +1 -1
  253. package/lib-amd/publicApi/image/setImageAltText.js +3 -2
  254. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  255. package/lib-amd/publicApi/image/setImageBorder.d.ts +1 -1
  256. package/lib-amd/publicApi/image/setImageBorder.js +4 -3
  257. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  258. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +1 -1
  259. package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
  260. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  261. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +1 -1
  262. package/lib-amd/publicApi/link/adjustLinkSelection.js +2 -1
  263. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  264. package/lib-amd/publicApi/link/insertLink.d.ts +1 -1
  265. package/lib-amd/publicApi/link/insertLink.js +2 -1
  266. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  267. package/lib-amd/publicApi/link/removeLink.d.ts +1 -1
  268. package/lib-amd/publicApi/link/removeLink.js +2 -1
  269. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  270. package/lib-amd/publicApi/list/setListStartNumber.d.ts +1 -1
  271. package/lib-amd/publicApi/list/setListStartNumber.js +2 -1
  272. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  273. package/lib-amd/publicApi/list/setListStyle.d.ts +1 -1
  274. package/lib-amd/publicApi/list/setListStyle.js +2 -1
  275. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  276. package/lib-amd/publicApi/list/toggleBullet.d.ts +1 -1
  277. package/lib-amd/publicApi/list/toggleBullet.js +2 -1
  278. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  279. package/lib-amd/publicApi/list/toggleNumbering.d.ts +1 -1
  280. package/lib-amd/publicApi/list/toggleNumbering.js +2 -1
  281. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  282. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +1 -1
  283. package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
  284. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  285. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +1 -1
  286. package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
  287. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  288. package/lib-amd/publicApi/segment/changeFontSize.d.ts +1 -1
  289. package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
  290. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  291. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +1 -1
  292. package/lib-amd/publicApi/segment/setBackgroundColor.js +2 -1
  293. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  294. package/lib-amd/publicApi/segment/setFontName.d.ts +1 -1
  295. package/lib-amd/publicApi/segment/setFontName.js +2 -1
  296. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  297. package/lib-amd/publicApi/segment/setFontSize.d.ts +1 -1
  298. package/lib-amd/publicApi/segment/setFontSize.js +2 -2
  299. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  300. package/lib-amd/publicApi/segment/setTextColor.d.ts +1 -1
  301. package/lib-amd/publicApi/segment/setTextColor.js +2 -1
  302. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  303. package/lib-amd/publicApi/segment/toggleBold.d.ts +1 -1
  304. package/lib-amd/publicApi/segment/toggleBold.js +2 -1
  305. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  306. package/lib-amd/publicApi/segment/toggleCode.d.ts +1 -1
  307. package/lib-amd/publicApi/segment/toggleCode.js +2 -1
  308. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  309. package/lib-amd/publicApi/segment/toggleItalic.d.ts +1 -1
  310. package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
  311. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  312. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  313. package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
  314. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  315. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +1 -1
  316. package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
  317. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  318. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +1 -1
  319. package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
  320. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  321. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +1 -1
  322. package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
  323. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  324. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  325. package/lib-amd/publicApi/table/applyTableBorderFormat.js +2 -1
  326. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  327. package/lib-amd/publicApi/table/editTable.d.ts +1 -1
  328. package/lib-amd/publicApi/table/editTable.js +2 -1
  329. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  330. package/lib-amd/publicApi/table/formatTable.d.ts +1 -1
  331. package/lib-amd/publicApi/table/formatTable.js +2 -1
  332. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  333. package/lib-amd/publicApi/table/insertTable.d.ts +1 -1
  334. package/lib-amd/publicApi/table/insertTable.js +2 -1
  335. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  336. package/lib-amd/publicApi/table/setTableCellShade.d.ts +1 -1
  337. package/lib-amd/publicApi/table/setTableCellShade.js +2 -1
  338. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  339. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  340. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
  341. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  342. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  343. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  344. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  345. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  346. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  347. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  348. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  349. package/lib-mjs/index.d.ts +46 -42
  350. package/lib-mjs/index.js +46 -42
  351. package/lib-mjs/index.js.map +1 -1
  352. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  353. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  354. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  355. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  356. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  357. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  358. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  359. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  360. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +1 -1
  361. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  362. package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
  363. package/lib-mjs/modelApi/link/matchLink.js +0 -1
  364. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  365. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  366. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  367. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  368. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  369. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  370. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  371. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  372. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  373. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  374. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  375. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  376. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  377. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  378. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  379. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  380. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  381. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  382. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  383. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  384. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  385. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  386. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  387. package/lib-mjs/publicApi/block/setAlignment.d.ts +1 -1
  388. package/lib-mjs/publicApi/block/setAlignment.js +1 -1
  389. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  390. package/lib-mjs/publicApi/block/setDirection.d.ts +1 -1
  391. package/lib-mjs/publicApi/block/setDirection.js +1 -1
  392. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  393. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +1 -1
  394. package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
  395. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  396. package/lib-mjs/publicApi/block/setIndentation.d.ts +1 -1
  397. package/lib-mjs/publicApi/block/setIndentation.js +1 -1
  398. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  399. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +1 -1
  400. package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
  401. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  402. package/lib-mjs/publicApi/block/setSpacing.d.ts +1 -1
  403. package/lib-mjs/publicApi/block/setSpacing.js +1 -1
  404. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  405. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +1 -1
  406. package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
  407. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  408. package/lib-mjs/publicApi/entity/insertEntity.d.ts +2 -2
  409. package/lib-mjs/publicApi/entity/insertEntity.js +1 -1
  410. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  411. package/lib-mjs/publicApi/format/clearFormat.d.ts +1 -1
  412. package/lib-mjs/publicApi/format/clearFormat.js +1 -1
  413. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  414. package/lib-mjs/publicApi/format/getFormatState.d.ts +1 -1
  415. package/lib-mjs/publicApi/format/getFormatState.js +1 -1
  416. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  417. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +1 -1
  418. package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
  419. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  420. package/lib-mjs/publicApi/image/changeImage.d.ts +1 -1
  421. package/lib-mjs/publicApi/image/changeImage.js +2 -2
  422. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  423. package/lib-mjs/publicApi/image/insertImage.d.ts +1 -1
  424. package/lib-mjs/publicApi/image/insertImage.js +1 -1
  425. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  426. package/lib-mjs/publicApi/image/setImageAltText.d.ts +1 -1
  427. package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
  428. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  429. package/lib-mjs/publicApi/image/setImageBorder.d.ts +1 -1
  430. package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
  431. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  432. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +1 -1
  433. package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
  434. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  435. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +1 -1
  436. package/lib-mjs/publicApi/link/adjustLinkSelection.js +1 -1
  437. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  438. package/lib-mjs/publicApi/link/insertLink.d.ts +1 -1
  439. package/lib-mjs/publicApi/link/insertLink.js +1 -1
  440. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  441. package/lib-mjs/publicApi/link/removeLink.d.ts +1 -1
  442. package/lib-mjs/publicApi/link/removeLink.js +1 -1
  443. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  444. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +1 -1
  445. package/lib-mjs/publicApi/list/setListStartNumber.js +1 -1
  446. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  447. package/lib-mjs/publicApi/list/setListStyle.d.ts +1 -1
  448. package/lib-mjs/publicApi/list/setListStyle.js +1 -1
  449. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  450. package/lib-mjs/publicApi/list/toggleBullet.d.ts +1 -1
  451. package/lib-mjs/publicApi/list/toggleBullet.js +1 -1
  452. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  453. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +1 -1
  454. package/lib-mjs/publicApi/list/toggleNumbering.js +1 -1
  455. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  456. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +1 -1
  457. package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
  458. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  459. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +1 -1
  460. package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
  461. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  462. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +1 -1
  463. package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
  464. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  465. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +1 -1
  466. package/lib-mjs/publicApi/segment/setBackgroundColor.js +1 -1
  467. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  468. package/lib-mjs/publicApi/segment/setFontName.d.ts +1 -1
  469. package/lib-mjs/publicApi/segment/setFontName.js +1 -1
  470. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  471. package/lib-mjs/publicApi/segment/setFontSize.d.ts +1 -1
  472. package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
  473. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  474. package/lib-mjs/publicApi/segment/setTextColor.d.ts +1 -1
  475. package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
  476. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  477. package/lib-mjs/publicApi/segment/toggleBold.d.ts +1 -1
  478. package/lib-mjs/publicApi/segment/toggleBold.js +1 -1
  479. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  480. package/lib-mjs/publicApi/segment/toggleCode.d.ts +1 -1
  481. package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
  482. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  483. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +1 -1
  484. package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
  485. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  486. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  487. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
  488. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  489. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +1 -1
  490. package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
  491. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  492. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +1 -1
  493. package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
  494. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  495. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +1 -1
  496. package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
  497. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  498. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  499. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +1 -1
  500. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  501. package/lib-mjs/publicApi/table/editTable.d.ts +1 -1
  502. package/lib-mjs/publicApi/table/editTable.js +1 -1
  503. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  504. package/lib-mjs/publicApi/table/formatTable.d.ts +1 -1
  505. package/lib-mjs/publicApi/table/formatTable.js +1 -1
  506. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  507. package/lib-mjs/publicApi/table/insertTable.d.ts +1 -1
  508. package/lib-mjs/publicApi/table/insertTable.js +1 -1
  509. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  510. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +1 -1
  511. package/lib-mjs/publicApi/table/setTableCellShade.js +1 -1
  512. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  513. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  514. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
  515. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  516. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  517. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  518. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  519. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  520. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  521. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  522. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  523. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":";;AAAA,2EAAgG;AAChG,kFAAiF;AACjF,6EAMsC;AAGtC;;;;;;;;GAQG;AACH,SAAwB,WAAW,CAC/B,MAAe,EACf,OAAe,EACf,IAAY,EACZ,MAAqC;IAErC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;;QACX,IAAM,cAAc,GAAG,IAAA,8CAAe,EAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,WAAW,CAAC;QAEvE,IAAI,cAAc,EAAE;YAChB,IAAM,GAAG,GAAG,IAAA,wDAA0B,GAAE,CAAC;YACzC,IAAM,KAAK,GAAG,IAAA,2CAAoB,EAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAEvD,IAAA,6CAAc,EAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACjF,gCAAgC;YAChC,MAAM,GAAG,MAAM,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;YAC5C,IAAA,+CAAgB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAChC,IAAA,yCAAU,EAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;gBAC5B,cAAc,gBAAA;gBACd,WAAW,EAAE,UAAU;aAC1B,CAAC,CAAC;YAEH,IAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAEtD,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,KAAI,WAAW,EAAE;gBACtC,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAAC,MAAA,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC;gBACrE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aAC/B;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC;AA1CD,8BA0CC","sourcesContent":["import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { createTableStructure } from '../../modelApi/table/createTableStructure';\nimport {\n applyTableFormat,\n deleteSelection,\n mergeModel,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Insert table into editor at current selection\n * @param editor The editor instance\n * @param columns Number of columns in table, it also controls the default table cell width:\n * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px\n * @param rows Number of rows in table\n * @param format (Optional) The table format. If not passed, the default format will be applied:\n * background color: #FFF; border color: #ABABAB\n */\nexport default function insertTable(\n editor: IEditor,\n columns: number,\n rows: number,\n format?: Partial<TableMetadataFormat>\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const insertPosition = deleteSelection(model, [], context).insertPoint;\n\n if (insertPosition) {\n const doc = createContentModelDocument();\n const table = createTableStructure(doc, columns, rows);\n\n normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);\n // Assign default vertical align\n format = format || { verticalAlign: 'top' };\n applyTableFormat(table, format);\n mergeModel(model, doc, context, {\n insertPosition,\n mergeFormat: 'mergeAll',\n });\n\n const firstBlock = table.rows[0]?.cells[0]?.blocks[0];\n\n if (firstBlock?.blockType == 'Paragraph') {\n const marker = createSelectionMarker(firstBlock.segments[0]?.format);\n firstBlock.segments.unshift(marker);\n setSelection(model, marker);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'insertTable',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"insertTable.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/insertTable.ts"],"names":[],"mappings":";;;AAAA,2EAAgG;AAChG,kFAAiF;AACjF,6EAMsC;AAGtC;;;;;;;;GAQG;AACH,SAAgB,WAAW,CACvB,MAAe,EACf,OAAe,EACf,IAAY,EACZ,MAAqC;IAErC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;;QACX,IAAM,cAAc,GAAG,IAAA,8CAAe,EAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,WAAW,CAAC;QAEvE,IAAI,cAAc,EAAE;YAChB,IAAM,GAAG,GAAG,IAAA,wDAA0B,GAAE,CAAC;YACzC,IAAM,KAAK,GAAG,IAAA,2CAAoB,EAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAEvD,IAAA,6CAAc,EAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,IAAI,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACjF,gCAAgC;YAChC,MAAM,GAAG,MAAM,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;YAC5C,IAAA,+CAAgB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAChC,IAAA,yCAAU,EAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;gBAC5B,cAAc,gBAAA;gBACd,WAAW,EAAE,UAAU;aAC1B,CAAC,CAAC;YAEH,IAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAEtD,IAAI,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,KAAI,WAAW,EAAE;gBACtC,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAAC,MAAA,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC;gBACrE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;aAC/B;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,aAAa;KACzB,CACJ,CAAC;AACN,CAAC;AA1CD,kCA0CC","sourcesContent":["import { createContentModelDocument, createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { createTableStructure } from '../../modelApi/table/createTableStructure';\nimport {\n applyTableFormat,\n deleteSelection,\n mergeModel,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { IEditor, TableMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Insert table into editor at current selection\n * @param editor The editor instance\n * @param columns Number of columns in table, it also controls the default table cell width:\n * if columns &lt;= 4, width = 120px; if columns &lt;= 6, width = 100px; else width = 70px\n * @param rows Number of rows in table\n * @param format (Optional) The table format. If not passed, the default format will be applied:\n * background color: #FFF; border color: #ABABAB\n */\nexport function insertTable(\n editor: IEditor,\n columns: number,\n rows: number,\n format?: Partial<TableMetadataFormat>\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const insertPosition = deleteSelection(model, [], context).insertPoint;\n\n if (insertPosition) {\n const doc = createContentModelDocument();\n const table = createTableStructure(doc, columns, rows);\n\n normalizeTable(table, editor.getPendingFormat() || insertPosition.marker.format);\n // Assign default vertical align\n format = format || { verticalAlign: 'top' };\n applyTableFormat(table, format);\n mergeModel(model, doc, context, {\n insertPosition,\n mergeFormat: 'mergeAll',\n });\n\n const firstBlock = table.rows[0]?.cells[0]?.blocks[0];\n\n if (firstBlock?.blockType == 'Paragraph') {\n const marker = createSelectionMarker(firstBlock.segments[0]?.format);\n firstBlock.segments.unshift(marker);\n setSelection(model, marker);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'insertTable',\n }\n );\n}\n"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor instance
5
5
  * @param color The color to set. Pass null to remove existing shade color
6
6
  */
7
- export default function setTableCellShade(editor: IEditor, color: string | null): void;
7
+ export declare function setTableCellShade(editor: IEditor, color: string | null): void;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setTableCellShade = void 0;
3
4
  var tslib_1 = require("tslib");
4
5
  var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
5
6
  /**
@@ -29,5 +30,5 @@ function setTableCellShade(editor, color) {
29
30
  apiName: 'setTableCellShade',
30
31
  });
31
32
  }
32
- exports.default = setTableCellShade;
33
+ exports.setTableCellShade = setTableCellShade;
33
34
  //# sourceMappingURL=setTableCellShade.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setTableCellShade.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/table/setTableCellShade.ts"],"names":[],"mappings":";;;AAAA,6EAKsC;AAGtC;;;;GAIG;AACH,SAAwB,iBAAiB,CAAC,MAAe,EAAE,KAAoB;IAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,oBAAU,IAAA,oDAAqB,EAAC,KAAK,CAAC,IAAA,EAArC,KAAK,QAAgC,CAAC;QAE7C,IAAI,KAAK,EAAE;YACP,IAAA,6CAAc,EAAC,KAAK,CAAC,CAAC;YAEtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,OAAA,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,IAAI,IAAA,uDAAwB,EAAC,IAAI,CAAC,EAAE;wBAChC,IAAA,0DAA2B,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;qBACtE;gBACL,CAAC,CAAC;YAJF,CAIE,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,mBAAmB;KAC/B,CACJ,CAAC;AACN,CAAC;AA3BD,oCA2BC","sourcesContent":["import {\n hasSelectionInBlockGroup,\n getFirstSelectedTable,\n normalizeTable,\n setTableCellBackgroundColor,\n} from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set table cell shade color\n * @param editor The editor instance\n * @param color The color to set. Pass null to remove existing shade color\n */\nexport default function setTableCellShade(editor: IEditor, color: string | null) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [table] = getFirstSelectedTable(model);\n\n if (table) {\n normalizeTable(table);\n\n table.rows.forEach(row =>\n row.cells.forEach(cell => {\n if (hasSelectionInBlockGroup(cell)) {\n setTableCellBackgroundColor(cell, color, true /*isColorOverride*/);\n }\n })\n );\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setTableCellShade',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setTableCellShade.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/table/setTableCellShade.ts"],"names":[],"mappings":";;;;AAAA,6EAKsC;AAGtC;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,MAAe,EAAE,KAAoB;IACnE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,oBAAU,IAAA,oDAAqB,EAAC,KAAK,CAAC,IAAA,EAArC,KAAK,QAAgC,CAAC;QAE7C,IAAI,KAAK,EAAE;YACP,IAAA,6CAAc,EAAC,KAAK,CAAC,CAAC;YAEtB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;gBAClB,OAAA,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,IAAI,IAAA,uDAAwB,EAAC,IAAI,CAAC,EAAE;wBAChC,IAAA,0DAA2B,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;qBACtE;gBACL,CAAC,CAAC;YAJF,CAIE,CACL,CAAC;YAEF,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,mBAAmB;KAC/B,CACJ,CAAC;AACN,CAAC;AA3BD,8CA2BC","sourcesContent":["import {\n hasSelectionInBlockGroup,\n getFirstSelectedTable,\n normalizeTable,\n setTableCellBackgroundColor,\n} from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set table cell shade color\n * @param editor The editor instance\n * @param color The color to set. Pass null to remove existing shade color\n */\nexport function setTableCellShade(editor: IEditor, color: string | null) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const [table] = getFirstSelectedTable(model);\n\n if (table) {\n normalizeTable(table);\n\n table.rows.forEach(row =>\n row.cells.forEach(cell => {\n if (hasSelectionInBlockGroup(cell)) {\n setTableCellBackgroundColor(cell, color, true /*isColorOverride*/);\n }\n })\n );\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setTableCellShade',\n }\n );\n}\n"]}
@@ -1,5 +1,8 @@
1
1
  import type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
- * @internal
3
+ * Invoke a callback to format the selected image using Content Model
4
+ * @param editor The editor object
5
+ * @param apiName Name of API this calling this function. This is mostly for logging.
6
+ * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.
4
7
  */
5
- export default function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
8
+ export declare function formatImageWithContentModel(editor: IEditor, apiName: string, callback: (segment: ContentModelImage) => void): void;
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatImageWithContentModel = void 0;
3
4
  var formatSegmentWithContentModel_1 = require("./formatSegmentWithContentModel");
4
5
  /**
5
- * @internal
6
+ * Invoke a callback to format the selected image using Content Model
7
+ * @param editor The editor object
8
+ * @param apiName Name of API this calling this function. This is mostly for logging.
9
+ * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.
6
10
  */
7
11
  function formatImageWithContentModel(editor, apiName, callback) {
8
12
  (0, formatSegmentWithContentModel_1.formatSegmentWithContentModel)(editor, apiName, function (_, __, segment) {
@@ -11,5 +15,5 @@ function formatImageWithContentModel(editor, apiName, callback) {
11
15
  }
12
16
  }, undefined /** segmentHasStyleCallback **/, undefined /** includingFormatHolder */);
13
17
  }
14
- exports.default = formatImageWithContentModel;
18
+ exports.formatImageWithContentModel = formatImageWithContentModel;
15
19
  //# sourceMappingURL=formatImageWithContentModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatImageWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatImageWithContentModel.ts"],"names":[],"mappings":";;AAAA,iFAAgF;AAGhF;;GAEG;AACH,SAAwB,2BAA2B,CAC/C,MAAe,EACf,OAAe,EACf,QAA8C;IAE9C,IAAA,6DAA6B,EACzB,MAAM,EACN,OAAO,EACP,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACX,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,OAAO,EAAE;YACjC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrB;IACL,CAAC,EACD,SAAS,CAAC,+BAA+B,EACzC,SAAS,CAAC,4BAA4B,CACzC,CAAC;AACN,CAAC;AAhBD,8CAgBC","sourcesContent":["import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport default function formatImageWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (segment: ContentModelImage) => void\n) {\n formatSegmentWithContentModel(\n editor,\n apiName,\n (_, __, segment) => {\n if (segment?.segmentType == 'Image') {\n callback(segment);\n }\n },\n undefined /** segmentHasStyleCallback **/,\n undefined /** includingFormatHolder */\n );\n}\n"]}
1
+ {"version":3,"file":"formatImageWithContentModel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/utils/formatImageWithContentModel.ts"],"names":[],"mappings":";;;AAAA,iFAAgF;AAGhF;;;;;GAKG;AACH,SAAgB,2BAA2B,CACvC,MAAe,EACf,OAAe,EACf,QAA8C;IAE9C,IAAA,6DAA6B,EACzB,MAAM,EACN,OAAO,EACP,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACX,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,OAAO,EAAE;YACjC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrB;IACL,CAAC,EACD,SAAS,CAAC,+BAA+B,EACzC,SAAS,CAAC,4BAA4B,CACzC,CAAC;AACN,CAAC;AAhBD,kEAgBC","sourcesContent":["import { formatSegmentWithContentModel } from './formatSegmentWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected image using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param callback The callback to format the image. It will be called with current selected table. If no table is selected, it will not be called.\n */\nexport function formatImageWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (segment: ContentModelImage) => void\n) {\n formatSegmentWithContentModel(\n editor,\n apiName,\n (_, __, segment) => {\n if (segment?.segmentType == 'Image') {\n callback(segment);\n }\n },\n undefined /** segmentHasStyleCallback **/,\n undefined /** includingFormatHolder */\n );\n}\n"]}
@@ -1,5 +1,8 @@
1
1
  import type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
- * @internal
3
+ * Invoke a callback to format the selected paragraph using Content Model
4
+ * @param editor The editor object
5
+ * @param apiName Name of API this calling this function. This is mostly for logging.
6
+ * @param setStyleCallback The callback to format the paragraph. It will be called with current selected table. If no table is selected, it will not be called.
4
7
  */
5
8
  export declare function formatParagraphWithContentModel(editor: IEditor, apiName: string, setStyleCallback: (paragraph: ContentModelParagraph) => void): void;
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatParagraphWithContentModel = void 0;
4
4
  var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
5
5
  /**
6
- * @internal
6
+ * Invoke a callback to format the selected paragraph using Content Model
7
+ * @param editor The editor object
8
+ * @param apiName Name of API this calling this function. This is mostly for logging.
9
+ * @param setStyleCallback The callback to format the paragraph. It will be called with current selected table. If no table is selected, it will not be called.
7
10
  */
8
11
  function formatParagraphWithContentModel(editor, apiName, setStyleCallback) {
9
12
  editor.formatContentModel(function (model, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"formatParagraphWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatParagraphWithContentModel.ts"],"names":[],"mappings":";;;AAAA,6EAAqE;AAGrE;;GAEG;AACH,SAAgB,+BAA+B,CAC3C,MAAe,EACf,OAAe,EACf,gBAA4D;IAE5D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,UAAU,GAAG,IAAA,oDAAqB,EAAC,KAAK,CAAC,CAAC;QAEhD,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACrC,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AAlBD,0EAkBC","sourcesContent":["import { getSelectedParagraphs } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function formatParagraphWithContentModel(\n editor: IEditor,\n apiName: string,\n setStyleCallback: (paragraph: ContentModelParagraph) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n const paragraphs = getSelectedParagraphs(model);\n\n paragraphs.forEach(setStyleCallback);\n context.newPendingFormat = 'preserve';\n\n return paragraphs.length > 0;\n },\n {\n apiName,\n }\n );\n}\n"]}
1
+ {"version":3,"file":"formatParagraphWithContentModel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/utils/formatParagraphWithContentModel.ts"],"names":[],"mappings":";;;AAAA,6EAAqE;AAGrE;;;;;GAKG;AACH,SAAgB,+BAA+B,CAC3C,MAAe,EACf,OAAe,EACf,gBAA4D;IAE5D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAM,UAAU,GAAG,IAAA,oDAAqB,EAAC,KAAK,CAAC,CAAC;QAEhD,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACrC,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AAlBD,0EAkBC","sourcesContent":["import { getSelectedParagraphs } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected paragraph using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param setStyleCallback The callback to format the paragraph. It will be called with current selected table. If no table is selected, it will not be called.\n */\nexport function formatParagraphWithContentModel(\n editor: IEditor,\n apiName: string,\n setStyleCallback: (paragraph: ContentModelParagraph) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n const paragraphs = getSelectedParagraphs(model);\n\n paragraphs.forEach(setStyleCallback);\n context.newPendingFormat = 'preserve';\n\n return paragraphs.length > 0;\n },\n {\n apiName,\n }\n );\n}\n"]}
@@ -1,5 +1,11 @@
1
1
  import type { ContentModelDocument, ContentModelParagraph, ContentModelSegment, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
- * @internal
3
+ * Invoke a callback to format the selected segment using Content Model
4
+ * @param editor The editor object
5
+ * @param apiName Name of API this calling this function. This is mostly for logging.
6
+ * @param toggleStyleCallback The callback to format the segment. It will be called with current selected table. If no table is selected, it will not be called.
7
+ * @param segmentHasStyleCallback The callback used for checking if the given segment already has required format
8
+ * @param includingFormatHolder True to also include format holder of list item when search selected segments
9
+ * @param afterFormatCallback A callback to invoke after format is applied to all selected segments and before the change is applied to DOM tree
4
10
  */
5
11
  export declare function formatSegmentWithContentModel(editor: IEditor, apiName: string, toggleStyleCallback: (format: ContentModelSegmentFormat, isTuringOn: boolean, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => void, segmentHasStyleCallback?: (format: ContentModelSegmentFormat, segment: ContentModelSegment | null, paragraph: ContentModelParagraph | null) => boolean, includingFormatHolder?: boolean, afterFormatCallback?: (model: ContentModelDocument) => void): void;
@@ -5,7 +5,13 @@ var tslib_1 = require("tslib");
5
5
  var adjustWordSelection_1 = require("../../modelApi/selection/adjustWordSelection");
6
6
  var roosterjs_content_model_core_1 = require("roosterjs-content-model-core");
7
7
  /**
8
- * @internal
8
+ * Invoke a callback to format the selected segment using Content Model
9
+ * @param editor The editor object
10
+ * @param apiName Name of API this calling this function. This is mostly for logging.
11
+ * @param toggleStyleCallback The callback to format the segment. It will be called with current selected table. If no table is selected, it will not be called.
12
+ * @param segmentHasStyleCallback The callback used for checking if the given segment already has required format
13
+ * @param includingFormatHolder True to also include format holder of list item when search selected segments
14
+ * @param afterFormatCallback A callback to invoke after format is applied to all selected segments and before the change is applied to DOM tree
9
15
  */
10
16
  function formatSegmentWithContentModel(editor, apiName, toggleStyleCallback, segmentHasStyleCallback, includingFormatHolder, afterFormatCallback) {
11
17
  editor.formatContentModel(function (model, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"formatSegmentWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatSegmentWithContentModel.ts"],"names":[],"mappings":";;;;AAAA,oFAAmF;AACnF,6EAAgF;AAShF;;GAEG;AACH,SAAgB,6BAA6B,CACzC,MAAe,EACf,OAAe,EACf,mBAKS,EACT,uBAIY,EACZ,qBAA+B,EAC/B,mBAA2D;IAE3D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAI,oBAAoB,GAAG,IAAA,+DAAgC,EACvD,KAAK,EACL,CAAC,CAAC,qBAAqB,CAC1B,CAAC;QACF,IAAI,oBAAoB,GACpB,oBAAoB,CAAC,MAAM,IAAI,CAAC;YAChC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,iBAAiB,CAAC;QAEhE,IAAI,oBAAoB,EAAE;YACtB,IAAM,MAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAExC,oBAAoB,GAAG,IAAA,yCAAmB,EACtC,KAAK,EACL,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,MAAI,CAAC,EAAT,CAAS,CAAC,CAAC;YAEtB,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjC,oBAAoB,GAAG,KAAK,CAAC;aAChC;SACJ;QAED,IAAM,kBAAkB,GAIlB,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAlC,CAAkC,CAAC,CAAC;QAE3E,IAAM,YAAY,GAAG,uBAAuB;YACxC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,UAAC,EAA4B;oBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;gBACjD,OAAA,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;YAAnD,CAAmD,CACtD;YACH,CAAC,CAAC,KAAK,CAAC;QAEZ,kBAAkB,CAAC,OAAO,CAAC,UAAC,EAA4B;gBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;YACnD,OAAA,mBAAmB,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC;QAA9D,CAA8D,CACjE,CAAC;QAEF,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,KAAK,CAAC,CAAC;QAE7B,IAAI,oBAAoB,EAAE;YACtB,OAAO,CAAC,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;SAChB;aAAM;YACH,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC;IACL,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AAtED,sEAsEC","sourcesContent":["import { adjustWordSelection } from '../../modelApi/selection/adjustWordSelection';\nimport { getSelectedSegmentsAndParagraphs } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelParagraph,\n ContentModelSegment,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function formatSegmentWithContentModel(\n editor: IEditor,\n apiName: string,\n toggleStyleCallback: (\n format: ContentModelSegmentFormat,\n isTuringOn: boolean,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => void,\n segmentHasStyleCallback?: (\n format: ContentModelSegmentFormat,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => boolean,\n includingFormatHolder?: boolean,\n afterFormatCallback?: (model: ContentModelDocument) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n let segmentAndParagraphs = getSelectedSegmentsAndParagraphs(\n model,\n !!includingFormatHolder\n );\n let isCollapsedSelection =\n segmentAndParagraphs.length == 1 &&\n segmentAndParagraphs[0][0].segmentType == 'SelectionMarker';\n\n if (isCollapsedSelection) {\n const para = segmentAndParagraphs[0][1];\n\n segmentAndParagraphs = adjustWordSelection(\n model,\n segmentAndParagraphs[0][0]\n ).map(x => [x, para]);\n\n if (segmentAndParagraphs.length > 1) {\n isCollapsedSelection = false;\n }\n }\n\n const formatsAndSegments: [\n ContentModelSegmentFormat,\n ContentModelSegment | null,\n ContentModelParagraph | null\n ][] = segmentAndParagraphs.map(item => [item[0].format, item[0], item[1]]);\n\n const isTurningOff = segmentHasStyleCallback\n ? formatsAndSegments.every(([format, segment, paragraph]) =>\n segmentHasStyleCallback(format, segment, paragraph)\n )\n : false;\n\n formatsAndSegments.forEach(([format, segment, paragraph]) =>\n toggleStyleCallback(format, !isTurningOff, segment, paragraph)\n );\n\n afterFormatCallback?.(model);\n\n if (isCollapsedSelection) {\n context.newPendingFormat = segmentAndParagraphs[0][0].format;\n editor.focus();\n return false;\n } else {\n return formatsAndSegments.length > 0;\n }\n },\n {\n apiName,\n }\n );\n}\n"]}
1
+ {"version":3,"file":"formatSegmentWithContentModel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/utils/formatSegmentWithContentModel.ts"],"names":[],"mappings":";;;;AAAA,oFAAmF;AACnF,6EAAgF;AAShF;;;;;;;;GAQG;AACH,SAAgB,6BAA6B,CACzC,MAAe,EACf,OAAe,EACf,mBAKS,EACT,uBAIY,EACZ,qBAA+B,EAC/B,mBAA2D;IAE3D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,IAAI,oBAAoB,GAAG,IAAA,+DAAgC,EACvD,KAAK,EACL,CAAC,CAAC,qBAAqB,CAC1B,CAAC;QACF,IAAI,oBAAoB,GACpB,oBAAoB,CAAC,MAAM,IAAI,CAAC;YAChC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,iBAAiB,CAAC;QAEhE,IAAI,oBAAoB,EAAE;YACtB,IAAM,MAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAExC,oBAAoB,GAAG,IAAA,yCAAmB,EACtC,KAAK,EACL,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,MAAI,CAAC,EAAT,CAAS,CAAC,CAAC;YAEtB,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjC,oBAAoB,GAAG,KAAK,CAAC;aAChC;SACJ;QAED,IAAM,kBAAkB,GAIlB,oBAAoB,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAlC,CAAkC,CAAC,CAAC;QAE3E,IAAM,YAAY,GAAG,uBAAuB;YACxC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,UAAC,EAA4B;oBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;gBACjD,OAAA,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC;YAAnD,CAAmD,CACtD;YACH,CAAC,CAAC,KAAK,CAAC;QAEZ,kBAAkB,CAAC,OAAO,CAAC,UAAC,EAA4B;gBAA5B,KAAA,0BAA4B,EAA3B,MAAM,QAAA,EAAE,OAAO,QAAA,EAAE,SAAS,QAAA;YACnD,OAAA,mBAAmB,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC;QAA9D,CAA8D,CACjE,CAAC;QAEF,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,KAAK,CAAC,CAAC;QAE7B,IAAI,oBAAoB,EAAE;YACtB,OAAO,CAAC,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;SAChB;aAAM;YACH,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC;IACL,CAAC,EACD;QACI,OAAO,SAAA;KACV,CACJ,CAAC;AACN,CAAC;AAtED,sEAsEC","sourcesContent":["import { adjustWordSelection } from '../../modelApi/selection/adjustWordSelection';\nimport { getSelectedSegmentsAndParagraphs } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelParagraph,\n ContentModelSegment,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected segment using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param toggleStyleCallback The callback to format the segment. It will be called with current selected table. If no table is selected, it will not be called.\n * @param segmentHasStyleCallback The callback used for checking if the given segment already has required format\n * @param includingFormatHolder True to also include format holder of list item when search selected segments\n * @param afterFormatCallback A callback to invoke after format is applied to all selected segments and before the change is applied to DOM tree\n */\nexport function formatSegmentWithContentModel(\n editor: IEditor,\n apiName: string,\n toggleStyleCallback: (\n format: ContentModelSegmentFormat,\n isTuringOn: boolean,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => void,\n segmentHasStyleCallback?: (\n format: ContentModelSegmentFormat,\n segment: ContentModelSegment | null,\n paragraph: ContentModelParagraph | null\n ) => boolean,\n includingFormatHolder?: boolean,\n afterFormatCallback?: (model: ContentModelDocument) => void\n) {\n editor.formatContentModel(\n (model, context) => {\n let segmentAndParagraphs = getSelectedSegmentsAndParagraphs(\n model,\n !!includingFormatHolder\n );\n let isCollapsedSelection =\n segmentAndParagraphs.length == 1 &&\n segmentAndParagraphs[0][0].segmentType == 'SelectionMarker';\n\n if (isCollapsedSelection) {\n const para = segmentAndParagraphs[0][1];\n\n segmentAndParagraphs = adjustWordSelection(\n model,\n segmentAndParagraphs[0][0]\n ).map(x => [x, para]);\n\n if (segmentAndParagraphs.length > 1) {\n isCollapsedSelection = false;\n }\n }\n\n const formatsAndSegments: [\n ContentModelSegmentFormat,\n ContentModelSegment | null,\n ContentModelParagraph | null\n ][] = segmentAndParagraphs.map(item => [item[0].format, item[0], item[1]]);\n\n const isTurningOff = segmentHasStyleCallback\n ? formatsAndSegments.every(([format, segment, paragraph]) =>\n segmentHasStyleCallback(format, segment, paragraph)\n )\n : false;\n\n formatsAndSegments.forEach(([format, segment, paragraph]) =>\n toggleStyleCallback(format, !isTurningOff, segment, paragraph)\n );\n\n afterFormatCallback?.(model);\n\n if (isCollapsedSelection) {\n context.newPendingFormat = segmentAndParagraphs[0][0].format;\n editor.focus();\n return false;\n } else {\n return formatsAndSegments.length > 0;\n }\n },\n {\n apiName,\n }\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"formatTableWithContentModel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/utils/formatTableWithContentModel.ts"],"names":[],"mappings":";;;;AAAA,0GAAyG;AACzG,2EAIqC;AACrC,6EAMsC;AAGtC;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACvC,MAAe,EACf,OAAe,EACf,QAAiD,EACjD,iBAAkC;IAElC,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,oBAAqB,IAAA,oDAAqB,EAAC,KAAK,CAAC,IAAA,EAAhD,UAAU,QAAA,EAAE,IAAI,QAAgC,CAAC;QAExD,IAAI,UAAU,EAAE;YACZ,QAAQ,CAAC,UAAU,CAAC,CAAC;YAErB,IAAI,CAAC,IAAA,kDAAmB,EAAC,UAAU,CAAC,EAAE;gBAClC,IAAM,SAAS,GAAG,IAAA,mEAAgC,EAAC,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;gBAE5E,IAAI,SAAS,EAAE;oBACX,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBACnC,IAAA,qDAAuB,EAAC,SAAS,CAAC,CAAC;oBACnC,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;iBAC/B;aACJ;YAED,IAAA,6CAAc,EAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAEzC,IAAI,IAAA,yCAAW,EAAC,UAAU,CAAC,EAAE;gBACzB,IAAA,+CAAgB,EAAC,UAAU,EAAE,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;aACjF;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,SAAA;QACP,iBAAiB,mBAAA;KACpB,CACJ,CAAC;AACN,CAAC;AAzCD,kEAyCC","sourcesContent":["import { ensureFocusableParagraphForTable } from '../../modelApi/table/ensureFocusableParagraphForTable';\nimport {\n createSelectionMarker,\n hasMetadata,\n setParagraphNotImplicit,\n} from 'roosterjs-content-model-dom';\nimport {\n hasSelectionInBlock,\n applyTableFormat,\n getFirstSelectedTable,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { ContentModelTable, IEditor, TableSelection } from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected table using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param callback The callback to format the table. It will be called with current selected table. If no table is selected, it will not be called.\n * @param selectionOverride Override the current selection. If we want to format a table even currently it is not selected, we can use this parameter to override current selection\n */\nexport function formatTableWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (tableModel: ContentModelTable) => void,\n selectionOverride?: TableSelection\n) {\n editor.formatContentModel(\n model => {\n const [tableModel, path] = getFirstSelectedTable(model);\n\n if (tableModel) {\n callback(tableModel);\n\n if (!hasSelectionInBlock(tableModel)) {\n const paragraph = ensureFocusableParagraphForTable(model, path, tableModel);\n\n if (paragraph) {\n const marker = createSelectionMarker(model.format);\n\n paragraph.segments.unshift(marker);\n setParagraphNotImplicit(paragraph);\n setSelection(model, marker);\n }\n }\n\n normalizeTable(tableModel, model.format);\n\n if (hasMetadata(tableModel)) {\n applyTableFormat(tableModel, undefined /*newFormat*/, true /*keepCellShade*/);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName,\n selectionOverride,\n }\n );\n}\n"]}
1
+ {"version":3,"file":"formatTableWithContentModel.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/utils/formatTableWithContentModel.ts"],"names":[],"mappings":";;;;AAAA,0GAAyG;AACzG,2EAIqC;AACrC,6EAMsC;AAGtC;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACvC,MAAe,EACf,OAAe,EACf,QAAiD,EACjD,iBAAkC;IAElC,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACK,IAAA,KAAA,oBAAqB,IAAA,oDAAqB,EAAC,KAAK,CAAC,IAAA,EAAhD,UAAU,QAAA,EAAE,IAAI,QAAgC,CAAC;QAExD,IAAI,UAAU,EAAE;YACZ,QAAQ,CAAC,UAAU,CAAC,CAAC;YAErB,IAAI,CAAC,IAAA,kDAAmB,EAAC,UAAU,CAAC,EAAE;gBAClC,IAAM,SAAS,GAAG,IAAA,mEAAgC,EAAC,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;gBAE5E,IAAI,SAAS,EAAE;oBACX,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBACnC,IAAA,qDAAuB,EAAC,SAAS,CAAC,CAAC;oBACnC,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;iBAC/B;aACJ;YAED,IAAA,6CAAc,EAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAEzC,IAAI,IAAA,yCAAW,EAAC,UAAU,CAAC,EAAE;gBACzB,IAAA,+CAAgB,EAAC,UAAU,EAAE,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;aACjF;YAED,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,SAAA;QACP,iBAAiB,mBAAA;KACpB,CACJ,CAAC;AACN,CAAC;AAzCD,kEAyCC","sourcesContent":["import { ensureFocusableParagraphForTable } from '../../modelApi/table/ensureFocusableParagraphForTable';\nimport {\n createSelectionMarker,\n hasMetadata,\n setParagraphNotImplicit,\n} from 'roosterjs-content-model-dom';\nimport {\n hasSelectionInBlock,\n applyTableFormat,\n getFirstSelectedTable,\n normalizeTable,\n setSelection,\n} from 'roosterjs-content-model-core';\nimport type { ContentModelTable, IEditor, TableSelection } from 'roosterjs-content-model-types';\n\n/**\n * Invoke a callback to format the selected table using Content Model\n * @param editor The editor object\n * @param apiName Name of API this calling this function. This is mostly for logging.\n * @param callback The callback to format the table. It will be called with current selected table. If no table is selected, it will not be called.\n * @param selectionOverride Override the current selection. If we want to format a table even currently it is not selected, we can use this parameter to override current selection\n */\nexport function formatTableWithContentModel(\n editor: IEditor,\n apiName: string,\n callback: (tableModel: ContentModelTable) => void,\n selectionOverride?: TableSelection\n) {\n editor.formatContentModel(\n model => {\n const [tableModel, path] = getFirstSelectedTable(model);\n\n if (tableModel) {\n callback(tableModel);\n\n if (!hasSelectionInBlock(tableModel)) {\n const paragraph = ensureFocusableParagraphForTable(model, path, tableModel);\n\n if (paragraph) {\n const marker = createSelectionMarker(model.format);\n\n paragraph.segments.unshift(marker);\n setParagraphNotImplicit(paragraph);\n setSelection(model, marker);\n }\n }\n\n normalizeTable(tableModel, model.format);\n\n if (hasMetadata(tableModel)) {\n applyTableFormat(tableModel, undefined /*newFormat*/, true /*keepCellShade*/);\n }\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName,\n selectionOverride,\n }\n );\n}\n"]}
@@ -1,48 +1,52 @@
1
- export { default as insertTable } from './publicApi/table/insertTable';
2
- export { default as formatTable } from './publicApi/table/formatTable';
3
- export { default as setTableCellShade } from './publicApi/table/setTableCellShade';
4
- export { default as editTable } from './publicApi/table/editTable';
5
- export { default as applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';
6
- export { default as toggleBullet } from './publicApi/list/toggleBullet';
7
- export { default as toggleNumbering } from './publicApi/list/toggleNumbering';
8
- export { default as toggleBold } from './publicApi/segment/toggleBold';
9
- export { default as toggleItalic } from './publicApi/segment/toggleItalic';
10
- export { default as toggleUnderline } from './publicApi/segment/toggleUnderline';
11
- export { default as toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';
12
- export { default as toggleSubscript } from './publicApi/segment/toggleSubscript';
13
- export { default as toggleSuperscript } from './publicApi/segment/toggleSuperscript';
14
- export { default as setBackgroundColor } from './publicApi/segment/setBackgroundColor';
15
- export { default as setFontName } from './publicApi/segment/setFontName';
16
- export { default as setFontSize } from './publicApi/segment/setFontSize';
17
- export { default as setTextColor } from './publicApi/segment/setTextColor';
18
- export { default as changeFontSize } from './publicApi/segment/changeFontSize';
19
- export { default as applySegmentFormat } from './publicApi/segment/applySegmentFormat';
20
- export { default as changeCapitalization } from './publicApi/segment/changeCapitalization';
21
- export { default as insertImage } from './publicApi/image/insertImage';
22
- export { default as setListStyle } from './publicApi/list/setListStyle';
23
- export { default as setListStartNumber } from './publicApi/list/setListStartNumber';
24
- export { default as setIndentation } from './publicApi/block/setIndentation';
25
- export { default as setAlignment } from './publicApi/block/setAlignment';
26
- export { default as setDirection } from './publicApi/block/setDirection';
27
- export { default as setHeadingLevel } from './publicApi/block/setHeadingLevel';
28
- export { default as toggleBlockQuote } from './publicApi/block/toggleBlockQuote';
29
- export { default as setSpacing } from './publicApi/block/setSpacing';
30
- export { default as setImageBorder } from './publicApi/image/setImageBorder';
31
- export { default as setImageBoxShadow } from './publicApi/image/setImageBoxShadow';
32
- export { default as changeImage } from './publicApi/image/changeImage';
33
- export { default as getFormatState } from './publicApi/format/getFormatState';
34
- export { default as clearFormat } from './publicApi/format/clearFormat';
35
- export { default as insertLink } from './publicApi/link/insertLink';
36
- export { default as removeLink } from './publicApi/link/removeLink';
37
- export { default as adjustLinkSelection } from './publicApi/link/adjustLinkSelection';
38
- export { default as setImageAltText } from './publicApi/image/setImageAltText';
39
- export { default as adjustImageSelection } from './publicApi/image/adjustImageSelection';
40
- export { default as setParagraphMargin } from './publicApi/block/setParagraphMargin';
41
- export { default as toggleCode } from './publicApi/segment/toggleCode';
42
- export { default as insertEntity } from './publicApi/entity/insertEntity';
1
+ export { insertTable } from './publicApi/table/insertTable';
2
+ export { formatTable } from './publicApi/table/formatTable';
3
+ export { setTableCellShade } from './publicApi/table/setTableCellShade';
4
+ export { editTable } from './publicApi/table/editTable';
5
+ export { applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';
6
+ export { toggleBullet } from './publicApi/list/toggleBullet';
7
+ export { toggleNumbering } from './publicApi/list/toggleNumbering';
8
+ export { toggleBold } from './publicApi/segment/toggleBold';
9
+ export { toggleItalic } from './publicApi/segment/toggleItalic';
10
+ export { toggleUnderline } from './publicApi/segment/toggleUnderline';
11
+ export { toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';
12
+ export { toggleSubscript } from './publicApi/segment/toggleSubscript';
13
+ export { toggleSuperscript } from './publicApi/segment/toggleSuperscript';
14
+ export { setBackgroundColor } from './publicApi/segment/setBackgroundColor';
15
+ export { setFontName } from './publicApi/segment/setFontName';
16
+ export { setFontSize } from './publicApi/segment/setFontSize';
17
+ export { setTextColor } from './publicApi/segment/setTextColor';
18
+ export { changeFontSize } from './publicApi/segment/changeFontSize';
19
+ export { applySegmentFormat } from './publicApi/segment/applySegmentFormat';
20
+ export { changeCapitalization } from './publicApi/segment/changeCapitalization';
21
+ export { insertImage } from './publicApi/image/insertImage';
22
+ export { setListStyle } from './publicApi/list/setListStyle';
23
+ export { setListStartNumber } from './publicApi/list/setListStartNumber';
24
+ export { setIndentation } from './publicApi/block/setIndentation';
25
+ export { setAlignment } from './publicApi/block/setAlignment';
26
+ export { setDirection } from './publicApi/block/setDirection';
27
+ export { setHeadingLevel } from './publicApi/block/setHeadingLevel';
28
+ export { toggleBlockQuote } from './publicApi/block/toggleBlockQuote';
29
+ export { setSpacing } from './publicApi/block/setSpacing';
30
+ export { setImageBorder } from './publicApi/image/setImageBorder';
31
+ export { setImageBoxShadow } from './publicApi/image/setImageBoxShadow';
32
+ export { changeImage } from './publicApi/image/changeImage';
33
+ export { getFormatState } from './publicApi/format/getFormatState';
34
+ export { clearFormat } from './publicApi/format/clearFormat';
35
+ export { insertLink } from './publicApi/link/insertLink';
36
+ export { removeLink } from './publicApi/link/removeLink';
37
+ export { adjustLinkSelection } from './publicApi/link/adjustLinkSelection';
38
+ export { setImageAltText } from './publicApi/image/setImageAltText';
39
+ export { adjustImageSelection } from './publicApi/image/adjustImageSelection';
40
+ export { setParagraphMargin } from './publicApi/block/setParagraphMargin';
41
+ export { toggleCode } from './publicApi/segment/toggleCode';
42
+ export { insertEntity } from './publicApi/entity/insertEntity';
43
43
  export { insertTableRow } from './modelApi/table/insertTableRow';
44
44
  export { insertTableColumn } from './modelApi/table/insertTableColumn';
45
45
  export { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';
46
+ export { formatImageWithContentModel } from './publicApi/utils/formatImageWithContentModel';
47
+ export { formatParagraphWithContentModel } from './publicApi/utils/formatParagraphWithContentModel';
48
+ export { formatSegmentWithContentModel } from './publicApi/utils/formatSegmentWithContentModel';
46
49
  export { setListType } from './modelApi/list/setListType';
47
50
  export { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';
48
51
  export { setModelIndentation } from './modelApi/block/setModelIndentation';
52
+ export { matchLink } from './modelApi/link/matchLink';
package/lib-amd/index.js CHANGED
@@ -1,54 +1,58 @@
1
- define(["require", "exports", "./publicApi/table/insertTable", "./publicApi/table/formatTable", "./publicApi/table/setTableCellShade", "./publicApi/table/editTable", "./publicApi/table/applyTableBorderFormat", "./publicApi/list/toggleBullet", "./publicApi/list/toggleNumbering", "./publicApi/segment/toggleBold", "./publicApi/segment/toggleItalic", "./publicApi/segment/toggleUnderline", "./publicApi/segment/toggleStrikethrough", "./publicApi/segment/toggleSubscript", "./publicApi/segment/toggleSuperscript", "./publicApi/segment/setBackgroundColor", "./publicApi/segment/setFontName", "./publicApi/segment/setFontSize", "./publicApi/segment/setTextColor", "./publicApi/segment/changeFontSize", "./publicApi/segment/applySegmentFormat", "./publicApi/segment/changeCapitalization", "./publicApi/image/insertImage", "./publicApi/list/setListStyle", "./publicApi/list/setListStartNumber", "./publicApi/block/setIndentation", "./publicApi/block/setAlignment", "./publicApi/block/setDirection", "./publicApi/block/setHeadingLevel", "./publicApi/block/toggleBlockQuote", "./publicApi/block/setSpacing", "./publicApi/image/setImageBorder", "./publicApi/image/setImageBoxShadow", "./publicApi/image/changeImage", "./publicApi/format/getFormatState", "./publicApi/format/clearFormat", "./publicApi/link/insertLink", "./publicApi/link/removeLink", "./publicApi/link/adjustLinkSelection", "./publicApi/image/setImageAltText", "./publicApi/image/adjustImageSelection", "./publicApi/block/setParagraphMargin", "./publicApi/segment/toggleCode", "./publicApi/entity/insertEntity", "./modelApi/table/insertTableRow", "./modelApi/table/insertTableColumn", "./publicApi/utils/formatTableWithContentModel", "./modelApi/list/setListType", "./modelApi/list/findListItemsInSameThread", "./modelApi/block/setModelIndentation"], function (require, exports, insertTable_1, formatTable_1, setTableCellShade_1, editTable_1, applyTableBorderFormat_1, toggleBullet_1, toggleNumbering_1, toggleBold_1, toggleItalic_1, toggleUnderline_1, toggleStrikethrough_1, toggleSubscript_1, toggleSuperscript_1, setBackgroundColor_1, setFontName_1, setFontSize_1, setTextColor_1, changeFontSize_1, applySegmentFormat_1, changeCapitalization_1, insertImage_1, setListStyle_1, setListStartNumber_1, setIndentation_1, setAlignment_1, setDirection_1, setHeadingLevel_1, toggleBlockQuote_1, setSpacing_1, setImageBorder_1, setImageBoxShadow_1, changeImage_1, getFormatState_1, clearFormat_1, insertLink_1, removeLink_1, adjustLinkSelection_1, setImageAltText_1, adjustImageSelection_1, setParagraphMargin_1, toggleCode_1, insertEntity_1, insertTableRow_1, insertTableColumn_1, formatTableWithContentModel_1, setListType_1, findListItemsInSameThread_1, setModelIndentation_1) {
1
+ define(["require", "exports", "./publicApi/table/insertTable", "./publicApi/table/formatTable", "./publicApi/table/setTableCellShade", "./publicApi/table/editTable", "./publicApi/table/applyTableBorderFormat", "./publicApi/list/toggleBullet", "./publicApi/list/toggleNumbering", "./publicApi/segment/toggleBold", "./publicApi/segment/toggleItalic", "./publicApi/segment/toggleUnderline", "./publicApi/segment/toggleStrikethrough", "./publicApi/segment/toggleSubscript", "./publicApi/segment/toggleSuperscript", "./publicApi/segment/setBackgroundColor", "./publicApi/segment/setFontName", "./publicApi/segment/setFontSize", "./publicApi/segment/setTextColor", "./publicApi/segment/changeFontSize", "./publicApi/segment/applySegmentFormat", "./publicApi/segment/changeCapitalization", "./publicApi/image/insertImage", "./publicApi/list/setListStyle", "./publicApi/list/setListStartNumber", "./publicApi/block/setIndentation", "./publicApi/block/setAlignment", "./publicApi/block/setDirection", "./publicApi/block/setHeadingLevel", "./publicApi/block/toggleBlockQuote", "./publicApi/block/setSpacing", "./publicApi/image/setImageBorder", "./publicApi/image/setImageBoxShadow", "./publicApi/image/changeImage", "./publicApi/format/getFormatState", "./publicApi/format/clearFormat", "./publicApi/link/insertLink", "./publicApi/link/removeLink", "./publicApi/link/adjustLinkSelection", "./publicApi/image/setImageAltText", "./publicApi/image/adjustImageSelection", "./publicApi/block/setParagraphMargin", "./publicApi/segment/toggleCode", "./publicApi/entity/insertEntity", "./modelApi/table/insertTableRow", "./modelApi/table/insertTableColumn", "./publicApi/utils/formatTableWithContentModel", "./publicApi/utils/formatImageWithContentModel", "./publicApi/utils/formatParagraphWithContentModel", "./publicApi/utils/formatSegmentWithContentModel", "./modelApi/list/setListType", "./modelApi/list/findListItemsInSameThread", "./modelApi/block/setModelIndentation", "./modelApi/link/matchLink"], function (require, exports, insertTable_1, formatTable_1, setTableCellShade_1, editTable_1, applyTableBorderFormat_1, toggleBullet_1, toggleNumbering_1, toggleBold_1, toggleItalic_1, toggleUnderline_1, toggleStrikethrough_1, toggleSubscript_1, toggleSuperscript_1, setBackgroundColor_1, setFontName_1, setFontSize_1, setTextColor_1, changeFontSize_1, applySegmentFormat_1, changeCapitalization_1, insertImage_1, setListStyle_1, setListStartNumber_1, setIndentation_1, setAlignment_1, setDirection_1, setHeadingLevel_1, toggleBlockQuote_1, setSpacing_1, setImageBorder_1, setImageBoxShadow_1, changeImage_1, getFormatState_1, clearFormat_1, insertLink_1, removeLink_1, adjustLinkSelection_1, setImageAltText_1, adjustImageSelection_1, setParagraphMargin_1, toggleCode_1, insertEntity_1, insertTableRow_1, insertTableColumn_1, formatTableWithContentModel_1, formatImageWithContentModel_1, formatParagraphWithContentModel_1, formatSegmentWithContentModel_1, setListType_1, findListItemsInSameThread_1, setModelIndentation_1, matchLink_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.setModelIndentation = exports.findListItemsInSameThread = exports.setListType = exports.formatTableWithContentModel = exports.insertTableColumn = exports.insertTableRow = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
5
- Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.default; } });
6
- Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.default; } });
7
- Object.defineProperty(exports, "setTableCellShade", { enumerable: true, get: function () { return setTableCellShade_1.default; } });
8
- Object.defineProperty(exports, "editTable", { enumerable: true, get: function () { return editTable_1.default; } });
9
- Object.defineProperty(exports, "applyTableBorderFormat", { enumerable: true, get: function () { return applyTableBorderFormat_1.default; } });
10
- Object.defineProperty(exports, "toggleBullet", { enumerable: true, get: function () { return toggleBullet_1.default; } });
11
- Object.defineProperty(exports, "toggleNumbering", { enumerable: true, get: function () { return toggleNumbering_1.default; } });
12
- Object.defineProperty(exports, "toggleBold", { enumerable: true, get: function () { return toggleBold_1.default; } });
13
- Object.defineProperty(exports, "toggleItalic", { enumerable: true, get: function () { return toggleItalic_1.default; } });
14
- Object.defineProperty(exports, "toggleUnderline", { enumerable: true, get: function () { return toggleUnderline_1.default; } });
15
- Object.defineProperty(exports, "toggleStrikethrough", { enumerable: true, get: function () { return toggleStrikethrough_1.default; } });
16
- Object.defineProperty(exports, "toggleSubscript", { enumerable: true, get: function () { return toggleSubscript_1.default; } });
17
- Object.defineProperty(exports, "toggleSuperscript", { enumerable: true, get: function () { return toggleSuperscript_1.default; } });
18
- Object.defineProperty(exports, "setBackgroundColor", { enumerable: true, get: function () { return setBackgroundColor_1.default; } });
19
- Object.defineProperty(exports, "setFontName", { enumerable: true, get: function () { return setFontName_1.default; } });
20
- Object.defineProperty(exports, "setFontSize", { enumerable: true, get: function () { return setFontSize_1.default; } });
21
- Object.defineProperty(exports, "setTextColor", { enumerable: true, get: function () { return setTextColor_1.default; } });
22
- Object.defineProperty(exports, "changeFontSize", { enumerable: true, get: function () { return changeFontSize_1.default; } });
23
- Object.defineProperty(exports, "applySegmentFormat", { enumerable: true, get: function () { return applySegmentFormat_1.default; } });
24
- Object.defineProperty(exports, "changeCapitalization", { enumerable: true, get: function () { return changeCapitalization_1.default; } });
25
- Object.defineProperty(exports, "insertImage", { enumerable: true, get: function () { return insertImage_1.default; } });
26
- Object.defineProperty(exports, "setListStyle", { enumerable: true, get: function () { return setListStyle_1.default; } });
27
- Object.defineProperty(exports, "setListStartNumber", { enumerable: true, get: function () { return setListStartNumber_1.default; } });
28
- Object.defineProperty(exports, "setIndentation", { enumerable: true, get: function () { return setIndentation_1.default; } });
29
- Object.defineProperty(exports, "setAlignment", { enumerable: true, get: function () { return setAlignment_1.default; } });
30
- Object.defineProperty(exports, "setDirection", { enumerable: true, get: function () { return setDirection_1.default; } });
31
- Object.defineProperty(exports, "setHeadingLevel", { enumerable: true, get: function () { return setHeadingLevel_1.default; } });
32
- Object.defineProperty(exports, "toggleBlockQuote", { enumerable: true, get: function () { return toggleBlockQuote_1.default; } });
33
- Object.defineProperty(exports, "setSpacing", { enumerable: true, get: function () { return setSpacing_1.default; } });
34
- Object.defineProperty(exports, "setImageBorder", { enumerable: true, get: function () { return setImageBorder_1.default; } });
35
- Object.defineProperty(exports, "setImageBoxShadow", { enumerable: true, get: function () { return setImageBoxShadow_1.default; } });
36
- Object.defineProperty(exports, "changeImage", { enumerable: true, get: function () { return changeImage_1.default; } });
37
- Object.defineProperty(exports, "getFormatState", { enumerable: true, get: function () { return getFormatState_1.default; } });
38
- Object.defineProperty(exports, "clearFormat", { enumerable: true, get: function () { return clearFormat_1.default; } });
39
- Object.defineProperty(exports, "insertLink", { enumerable: true, get: function () { return insertLink_1.default; } });
40
- Object.defineProperty(exports, "removeLink", { enumerable: true, get: function () { return removeLink_1.default; } });
41
- Object.defineProperty(exports, "adjustLinkSelection", { enumerable: true, get: function () { return adjustLinkSelection_1.default; } });
42
- Object.defineProperty(exports, "setImageAltText", { enumerable: true, get: function () { return setImageAltText_1.default; } });
43
- Object.defineProperty(exports, "adjustImageSelection", { enumerable: true, get: function () { return adjustImageSelection_1.default; } });
44
- Object.defineProperty(exports, "setParagraphMargin", { enumerable: true, get: function () { return setParagraphMargin_1.default; } });
45
- Object.defineProperty(exports, "toggleCode", { enumerable: true, get: function () { return toggleCode_1.default; } });
46
- Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.default; } });
4
+ exports.matchLink = exports.setModelIndentation = exports.findListItemsInSameThread = exports.setListType = exports.formatSegmentWithContentModel = exports.formatParagraphWithContentModel = exports.formatImageWithContentModel = exports.formatTableWithContentModel = exports.insertTableColumn = exports.insertTableRow = exports.insertEntity = exports.toggleCode = exports.setParagraphMargin = exports.adjustImageSelection = exports.setImageAltText = exports.adjustLinkSelection = exports.removeLink = exports.insertLink = exports.clearFormat = exports.getFormatState = exports.changeImage = exports.setImageBoxShadow = exports.setImageBorder = exports.setSpacing = exports.toggleBlockQuote = exports.setHeadingLevel = exports.setDirection = exports.setAlignment = exports.setIndentation = exports.setListStartNumber = exports.setListStyle = exports.insertImage = exports.changeCapitalization = exports.applySegmentFormat = exports.changeFontSize = exports.setTextColor = exports.setFontSize = exports.setFontName = exports.setBackgroundColor = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleUnderline = exports.toggleItalic = exports.toggleBold = exports.toggleNumbering = exports.toggleBullet = exports.applyTableBorderFormat = exports.editTable = exports.setTableCellShade = exports.formatTable = exports.insertTable = void 0;
5
+ Object.defineProperty(exports, "insertTable", { enumerable: true, get: function () { return insertTable_1.insertTable; } });
6
+ Object.defineProperty(exports, "formatTable", { enumerable: true, get: function () { return formatTable_1.formatTable; } });
7
+ Object.defineProperty(exports, "setTableCellShade", { enumerable: true, get: function () { return setTableCellShade_1.setTableCellShade; } });
8
+ Object.defineProperty(exports, "editTable", { enumerable: true, get: function () { return editTable_1.editTable; } });
9
+ Object.defineProperty(exports, "applyTableBorderFormat", { enumerable: true, get: function () { return applyTableBorderFormat_1.applyTableBorderFormat; } });
10
+ Object.defineProperty(exports, "toggleBullet", { enumerable: true, get: function () { return toggleBullet_1.toggleBullet; } });
11
+ Object.defineProperty(exports, "toggleNumbering", { enumerable: true, get: function () { return toggleNumbering_1.toggleNumbering; } });
12
+ Object.defineProperty(exports, "toggleBold", { enumerable: true, get: function () { return toggleBold_1.toggleBold; } });
13
+ Object.defineProperty(exports, "toggleItalic", { enumerable: true, get: function () { return toggleItalic_1.toggleItalic; } });
14
+ Object.defineProperty(exports, "toggleUnderline", { enumerable: true, get: function () { return toggleUnderline_1.toggleUnderline; } });
15
+ Object.defineProperty(exports, "toggleStrikethrough", { enumerable: true, get: function () { return toggleStrikethrough_1.toggleStrikethrough; } });
16
+ Object.defineProperty(exports, "toggleSubscript", { enumerable: true, get: function () { return toggleSubscript_1.toggleSubscript; } });
17
+ Object.defineProperty(exports, "toggleSuperscript", { enumerable: true, get: function () { return toggleSuperscript_1.toggleSuperscript; } });
18
+ Object.defineProperty(exports, "setBackgroundColor", { enumerable: true, get: function () { return setBackgroundColor_1.setBackgroundColor; } });
19
+ Object.defineProperty(exports, "setFontName", { enumerable: true, get: function () { return setFontName_1.setFontName; } });
20
+ Object.defineProperty(exports, "setFontSize", { enumerable: true, get: function () { return setFontSize_1.setFontSize; } });
21
+ Object.defineProperty(exports, "setTextColor", { enumerable: true, get: function () { return setTextColor_1.setTextColor; } });
22
+ Object.defineProperty(exports, "changeFontSize", { enumerable: true, get: function () { return changeFontSize_1.changeFontSize; } });
23
+ Object.defineProperty(exports, "applySegmentFormat", { enumerable: true, get: function () { return applySegmentFormat_1.applySegmentFormat; } });
24
+ Object.defineProperty(exports, "changeCapitalization", { enumerable: true, get: function () { return changeCapitalization_1.changeCapitalization; } });
25
+ Object.defineProperty(exports, "insertImage", { enumerable: true, get: function () { return insertImage_1.insertImage; } });
26
+ Object.defineProperty(exports, "setListStyle", { enumerable: true, get: function () { return setListStyle_1.setListStyle; } });
27
+ Object.defineProperty(exports, "setListStartNumber", { enumerable: true, get: function () { return setListStartNumber_1.setListStartNumber; } });
28
+ Object.defineProperty(exports, "setIndentation", { enumerable: true, get: function () { return setIndentation_1.setIndentation; } });
29
+ Object.defineProperty(exports, "setAlignment", { enumerable: true, get: function () { return setAlignment_1.setAlignment; } });
30
+ Object.defineProperty(exports, "setDirection", { enumerable: true, get: function () { return setDirection_1.setDirection; } });
31
+ Object.defineProperty(exports, "setHeadingLevel", { enumerable: true, get: function () { return setHeadingLevel_1.setHeadingLevel; } });
32
+ Object.defineProperty(exports, "toggleBlockQuote", { enumerable: true, get: function () { return toggleBlockQuote_1.toggleBlockQuote; } });
33
+ Object.defineProperty(exports, "setSpacing", { enumerable: true, get: function () { return setSpacing_1.setSpacing; } });
34
+ Object.defineProperty(exports, "setImageBorder", { enumerable: true, get: function () { return setImageBorder_1.setImageBorder; } });
35
+ Object.defineProperty(exports, "setImageBoxShadow", { enumerable: true, get: function () { return setImageBoxShadow_1.setImageBoxShadow; } });
36
+ Object.defineProperty(exports, "changeImage", { enumerable: true, get: function () { return changeImage_1.changeImage; } });
37
+ Object.defineProperty(exports, "getFormatState", { enumerable: true, get: function () { return getFormatState_1.getFormatState; } });
38
+ Object.defineProperty(exports, "clearFormat", { enumerable: true, get: function () { return clearFormat_1.clearFormat; } });
39
+ Object.defineProperty(exports, "insertLink", { enumerable: true, get: function () { return insertLink_1.insertLink; } });
40
+ Object.defineProperty(exports, "removeLink", { enumerable: true, get: function () { return removeLink_1.removeLink; } });
41
+ Object.defineProperty(exports, "adjustLinkSelection", { enumerable: true, get: function () { return adjustLinkSelection_1.adjustLinkSelection; } });
42
+ Object.defineProperty(exports, "setImageAltText", { enumerable: true, get: function () { return setImageAltText_1.setImageAltText; } });
43
+ Object.defineProperty(exports, "adjustImageSelection", { enumerable: true, get: function () { return adjustImageSelection_1.adjustImageSelection; } });
44
+ Object.defineProperty(exports, "setParagraphMargin", { enumerable: true, get: function () { return setParagraphMargin_1.setParagraphMargin; } });
45
+ Object.defineProperty(exports, "toggleCode", { enumerable: true, get: function () { return toggleCode_1.toggleCode; } });
46
+ Object.defineProperty(exports, "insertEntity", { enumerable: true, get: function () { return insertEntity_1.insertEntity; } });
47
47
  Object.defineProperty(exports, "insertTableRow", { enumerable: true, get: function () { return insertTableRow_1.insertTableRow; } });
48
48
  Object.defineProperty(exports, "insertTableColumn", { enumerable: true, get: function () { return insertTableColumn_1.insertTableColumn; } });
49
49
  Object.defineProperty(exports, "formatTableWithContentModel", { enumerable: true, get: function () { return formatTableWithContentModel_1.formatTableWithContentModel; } });
50
+ Object.defineProperty(exports, "formatImageWithContentModel", { enumerable: true, get: function () { return formatImageWithContentModel_1.formatImageWithContentModel; } });
51
+ Object.defineProperty(exports, "formatParagraphWithContentModel", { enumerable: true, get: function () { return formatParagraphWithContentModel_1.formatParagraphWithContentModel; } });
52
+ Object.defineProperty(exports, "formatSegmentWithContentModel", { enumerable: true, get: function () { return formatSegmentWithContentModel_1.formatSegmentWithContentModel; } });
50
53
  Object.defineProperty(exports, "setListType", { enumerable: true, get: function () { return setListType_1.setListType; } });
51
54
  Object.defineProperty(exports, "findListItemsInSameThread", { enumerable: true, get: function () { return findListItemsInSameThread_1.findListItemsInSameThread; } });
52
55
  Object.defineProperty(exports, "setModelIndentation", { enumerable: true, get: function () { return setModelIndentation_1.setModelIndentation; } });
56
+ Object.defineProperty(exports, "matchLink", { enumerable: true, get: function () { return matchLink_1.matchLink; } });
53
57
  });
54
58
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages-content-model/roosterjs-content-model-api/lib/index.ts"],"names":[],"mappings":";;;;IAAS,0GAAA,OAAO,OAAe;IACtB,0GAAA,OAAO,OAAe;IACtB,sHAAA,OAAO,OAAqB;IAC5B,sGAAA,OAAO,OAAa;IACpB,gIAAA,OAAO,OAA0B;IACjC,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,wGAAA,OAAO,OAAc;IACrB,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,0HAAA,OAAO,OAAuB;IAC9B,kHAAA,OAAO,OAAmB;IAC1B,sHAAA,OAAO,OAAqB;IAC5B,wHAAA,OAAO,OAAsB;IAC7B,0GAAA,OAAO,OAAe;IACtB,0GAAA,OAAO,OAAe;IACtB,4GAAA,OAAO,OAAgB;IACvB,gHAAA,OAAO,OAAkB;IACzB,wHAAA,OAAO,OAAsB;IAC7B,4HAAA,OAAO,OAAwB;IAC/B,0GAAA,OAAO,OAAe;IACtB,4GAAA,OAAO,OAAgB;IACvB,wHAAA,OAAO,OAAsB;IAC7B,gHAAA,OAAO,OAAkB;IACzB,4GAAA,OAAO,OAAgB;IACvB,4GAAA,OAAO,OAAgB;IACvB,kHAAA,OAAO,OAAmB;IAC1B,oHAAA,OAAO,OAAoB;IAC3B,wGAAA,OAAO,OAAc;IACrB,gHAAA,OAAO,OAAkB;IACzB,sHAAA,OAAO,OAAqB;IAC5B,0GAAA,OAAO,OAAe;IACtB,gHAAA,OAAO,OAAkB;IACzB,0GAAA,OAAO,OAAe;IACtB,wGAAA,OAAO,OAAc;IACrB,wGAAA,OAAO,OAAc;IACrB,0HAAA,OAAO,OAAuB;IAC9B,kHAAA,OAAO,OAAmB;IAC1B,4HAAA,OAAO,OAAwB;IAC/B,wHAAA,OAAO,OAAsB;IAC7B,wGAAA,OAAO,OAAc;IACrB,4GAAA,OAAO,OAAgB;IACvB,gHAAA,cAAc,OAAA;IACd,sHAAA,iBAAiB,OAAA;IAEjB,0IAAA,2BAA2B,OAAA;IAC3B,0GAAA,WAAW,OAAA;IACX,sIAAA,yBAAyB,OAAA;IACzB,0HAAA,mBAAmB,OAAA","sourcesContent":["export { default as insertTable } from './publicApi/table/insertTable';\nexport { default as formatTable } from './publicApi/table/formatTable';\nexport { default as setTableCellShade } from './publicApi/table/setTableCellShade';\nexport { default as editTable } from './publicApi/table/editTable';\nexport { default as applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';\nexport { default as toggleBullet } from './publicApi/list/toggleBullet';\nexport { default as toggleNumbering } from './publicApi/list/toggleNumbering';\nexport { default as toggleBold } from './publicApi/segment/toggleBold';\nexport { default as toggleItalic } from './publicApi/segment/toggleItalic';\nexport { default as toggleUnderline } from './publicApi/segment/toggleUnderline';\nexport { default as toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';\nexport { default as toggleSubscript } from './publicApi/segment/toggleSubscript';\nexport { default as toggleSuperscript } from './publicApi/segment/toggleSuperscript';\nexport { default as setBackgroundColor } from './publicApi/segment/setBackgroundColor';\nexport { default as setFontName } from './publicApi/segment/setFontName';\nexport { default as setFontSize } from './publicApi/segment/setFontSize';\nexport { default as setTextColor } from './publicApi/segment/setTextColor';\nexport { default as changeFontSize } from './publicApi/segment/changeFontSize';\nexport { default as applySegmentFormat } from './publicApi/segment/applySegmentFormat';\nexport { default as changeCapitalization } from './publicApi/segment/changeCapitalization';\nexport { default as insertImage } from './publicApi/image/insertImage';\nexport { default as setListStyle } from './publicApi/list/setListStyle';\nexport { default as setListStartNumber } from './publicApi/list/setListStartNumber';\nexport { default as setIndentation } from './publicApi/block/setIndentation';\nexport { default as setAlignment } from './publicApi/block/setAlignment';\nexport { default as setDirection } from './publicApi/block/setDirection';\nexport { default as setHeadingLevel } from './publicApi/block/setHeadingLevel';\nexport { default as toggleBlockQuote } from './publicApi/block/toggleBlockQuote';\nexport { default as setSpacing } from './publicApi/block/setSpacing';\nexport { default as setImageBorder } from './publicApi/image/setImageBorder';\nexport { default as setImageBoxShadow } from './publicApi/image/setImageBoxShadow';\nexport { default as changeImage } from './publicApi/image/changeImage';\nexport { default as getFormatState } from './publicApi/format/getFormatState';\nexport { default as clearFormat } from './publicApi/format/clearFormat';\nexport { default as insertLink } from './publicApi/link/insertLink';\nexport { default as removeLink } from './publicApi/link/removeLink';\nexport { default as adjustLinkSelection } from './publicApi/link/adjustLinkSelection';\nexport { default as setImageAltText } from './publicApi/image/setImageAltText';\nexport { default as adjustImageSelection } from './publicApi/image/adjustImageSelection';\nexport { default as setParagraphMargin } from './publicApi/block/setParagraphMargin';\nexport { default as toggleCode } from './publicApi/segment/toggleCode';\nexport { default as insertEntity } from './publicApi/entity/insertEntity';\nexport { insertTableRow } from './modelApi/table/insertTableRow';\nexport { insertTableColumn } from './modelApi/table/insertTableColumn';\n\nexport { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';\nexport { setListType } from './modelApi/list/setListType';\nexport { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';\nexport { setModelIndentation } from './modelApi/block/setModelIndentation';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/roosterjs-content-model-api/lib/index.ts"],"names":[],"mappings":";;;;IAAS,0GAAA,WAAW,OAAA;IACX,0GAAA,WAAW,OAAA;IACX,sHAAA,iBAAiB,OAAA;IACjB,sGAAA,SAAS,OAAA;IACT,gIAAA,sBAAsB,OAAA;IACtB,4GAAA,YAAY,OAAA;IACZ,kHAAA,eAAe,OAAA;IACf,wGAAA,UAAU,OAAA;IACV,4GAAA,YAAY,OAAA;IACZ,kHAAA,eAAe,OAAA;IACf,0HAAA,mBAAmB,OAAA;IACnB,kHAAA,eAAe,OAAA;IACf,sHAAA,iBAAiB,OAAA;IACjB,wHAAA,kBAAkB,OAAA;IAClB,0GAAA,WAAW,OAAA;IACX,0GAAA,WAAW,OAAA;IACX,4GAAA,YAAY,OAAA;IACZ,gHAAA,cAAc,OAAA;IACd,wHAAA,kBAAkB,OAAA;IAClB,4HAAA,oBAAoB,OAAA;IACpB,0GAAA,WAAW,OAAA;IACX,4GAAA,YAAY,OAAA;IACZ,wHAAA,kBAAkB,OAAA;IAClB,gHAAA,cAAc,OAAA;IACd,4GAAA,YAAY,OAAA;IACZ,4GAAA,YAAY,OAAA;IACZ,kHAAA,eAAe,OAAA;IACf,oHAAA,gBAAgB,OAAA;IAChB,wGAAA,UAAU,OAAA;IACV,gHAAA,cAAc,OAAA;IACd,sHAAA,iBAAiB,OAAA;IACjB,0GAAA,WAAW,OAAA;IACX,gHAAA,cAAc,OAAA;IACd,0GAAA,WAAW,OAAA;IACX,wGAAA,UAAU,OAAA;IACV,wGAAA,UAAU,OAAA;IACV,0HAAA,mBAAmB,OAAA;IACnB,kHAAA,eAAe,OAAA;IACf,4HAAA,oBAAoB,OAAA;IACpB,wHAAA,kBAAkB,OAAA;IAClB,wGAAA,UAAU,OAAA;IACV,4GAAA,YAAY,OAAA;IACZ,gHAAA,cAAc,OAAA;IACd,sHAAA,iBAAiB,OAAA;IAEjB,0IAAA,2BAA2B,OAAA;IAC3B,0IAAA,2BAA2B,OAAA;IAC3B,kJAAA,+BAA+B,OAAA;IAC/B,8IAAA,6BAA6B,OAAA;IAE7B,0GAAA,WAAW,OAAA;IACX,sIAAA,yBAAyB,OAAA;IACzB,0HAAA,mBAAmB,OAAA;IACnB,sGAAA,SAAS,OAAA","sourcesContent":["export { insertTable } from './publicApi/table/insertTable';\nexport { formatTable } from './publicApi/table/formatTable';\nexport { setTableCellShade } from './publicApi/table/setTableCellShade';\nexport { editTable } from './publicApi/table/editTable';\nexport { applyTableBorderFormat } from './publicApi/table/applyTableBorderFormat';\nexport { toggleBullet } from './publicApi/list/toggleBullet';\nexport { toggleNumbering } from './publicApi/list/toggleNumbering';\nexport { toggleBold } from './publicApi/segment/toggleBold';\nexport { toggleItalic } from './publicApi/segment/toggleItalic';\nexport { toggleUnderline } from './publicApi/segment/toggleUnderline';\nexport { toggleStrikethrough } from './publicApi/segment/toggleStrikethrough';\nexport { toggleSubscript } from './publicApi/segment/toggleSubscript';\nexport { toggleSuperscript } from './publicApi/segment/toggleSuperscript';\nexport { setBackgroundColor } from './publicApi/segment/setBackgroundColor';\nexport { setFontName } from './publicApi/segment/setFontName';\nexport { setFontSize } from './publicApi/segment/setFontSize';\nexport { setTextColor } from './publicApi/segment/setTextColor';\nexport { changeFontSize } from './publicApi/segment/changeFontSize';\nexport { applySegmentFormat } from './publicApi/segment/applySegmentFormat';\nexport { changeCapitalization } from './publicApi/segment/changeCapitalization';\nexport { insertImage } from './publicApi/image/insertImage';\nexport { setListStyle } from './publicApi/list/setListStyle';\nexport { setListStartNumber } from './publicApi/list/setListStartNumber';\nexport { setIndentation } from './publicApi/block/setIndentation';\nexport { setAlignment } from './publicApi/block/setAlignment';\nexport { setDirection } from './publicApi/block/setDirection';\nexport { setHeadingLevel } from './publicApi/block/setHeadingLevel';\nexport { toggleBlockQuote } from './publicApi/block/toggleBlockQuote';\nexport { setSpacing } from './publicApi/block/setSpacing';\nexport { setImageBorder } from './publicApi/image/setImageBorder';\nexport { setImageBoxShadow } from './publicApi/image/setImageBoxShadow';\nexport { changeImage } from './publicApi/image/changeImage';\nexport { getFormatState } from './publicApi/format/getFormatState';\nexport { clearFormat } from './publicApi/format/clearFormat';\nexport { insertLink } from './publicApi/link/insertLink';\nexport { removeLink } from './publicApi/link/removeLink';\nexport { adjustLinkSelection } from './publicApi/link/adjustLinkSelection';\nexport { setImageAltText } from './publicApi/image/setImageAltText';\nexport { adjustImageSelection } from './publicApi/image/adjustImageSelection';\nexport { setParagraphMargin } from './publicApi/block/setParagraphMargin';\nexport { toggleCode } from './publicApi/segment/toggleCode';\nexport { insertEntity } from './publicApi/entity/insertEntity';\nexport { insertTableRow } from './modelApi/table/insertTableRow';\nexport { insertTableColumn } from './modelApi/table/insertTableColumn';\n\nexport { formatTableWithContentModel } from './publicApi/utils/formatTableWithContentModel';\nexport { formatImageWithContentModel } from './publicApi/utils/formatImageWithContentModel';\nexport { formatParagraphWithContentModel } from './publicApi/utils/formatParagraphWithContentModel';\nexport { formatSegmentWithContentModel } from './publicApi/utils/formatSegmentWithContentModel';\n\nexport { setListType } from './modelApi/list/setListType';\nexport { findListItemsInSameThread } from './modelApi/list/findListItemsInSameThread';\nexport { setModelIndentation } from './modelApi/block/setModelIndentation';\nexport { matchLink } from './modelApi/link/matchLink';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setModelAlignment.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/setModelAlignment.ts"],"names":[],"mappings":";;;;IAQA,IAAM,SAAS,GAGX;QACA,IAAI,EAAE;YACF,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,KAAK;SACb;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SAChB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,OAAO;SACf;QACD,OAAO,EAAE;YACL,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;SACjB;KACJ,CAAC;IAEF,IAAM,aAAa,GAGf;QACA,IAAI,EAAE;YACF,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,YAAY;SACpB;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,aAAa;YAClB,GAAG,EAAE,aAAa;SACrB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,WAAW;SACnB;KACJ,CAAC;IAEF;;OAEG;IACH,SAAgB,iBAAiB,CAC7B,KAA2B,EAC3B,SAAkD;QAElD,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC3F,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,SAAS,EAAE;gBACxD,IAAA,uBAAU,EACN,KAAK,EACL,aAAa,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAC5E,CAAC;aACL;iBAAM,IAAI,KAAK,EAAE;gBACd,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,IAAI,KAAK,CAAC,cAAc,KAAK,UAAU,EAAE;oBACzE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;wBACV,IAAA,MAAM,GAAK,CAAC,OAAN,CAAO;wBACrB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;oBACpC,CAAC,CAAC,CAAC;iBACN;gBACO,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;gBACzB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;aACnC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IA9BD,8CA8BC","sourcesContent":["import { alignTable } from '../table/alignTable';\nimport { getOperationalBlocks } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelListItem,\n TableAlignOperation,\n} from 'roosterjs-content-model-types';\n\nconst ResultMap: Record<\n 'left' | 'center' | 'right' | 'justify',\n Record<'ltr' | 'rtl', 'start' | 'center' | 'end' | 'justify'>\n> = {\n left: {\n ltr: 'start',\n rtl: 'end',\n },\n center: {\n ltr: 'center',\n rtl: 'center',\n },\n right: {\n ltr: 'end',\n rtl: 'start',\n },\n justify: {\n ltr: 'justify',\n rtl: 'justify',\n },\n};\n\nconst TableAlignMap: Record<\n 'left' | 'center' | 'right',\n Record<'ltr' | 'rtl', TableAlignOperation>\n> = {\n left: {\n ltr: 'alignLeft',\n rtl: 'alignRight',\n },\n center: {\n ltr: 'alignCenter',\n rtl: 'alignCenter',\n },\n right: {\n ltr: 'alignRight',\n rtl: 'alignLeft',\n },\n};\n\n/**\n * @internal\n */\nexport function setModelAlignment(\n model: ContentModelDocument,\n alignment: 'left' | 'center' | 'right' | 'justify'\n) {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n const newAlignment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];\n if (block.blockType === 'Table' && alignment !== 'justify') {\n alignTable(\n block,\n TableAlignMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr']\n );\n } else if (block) {\n if (block.blockType === 'BlockGroup' && block.blockGroupType === 'ListItem') {\n block.blocks.forEach(b => {\n const { format } = b;\n format.textAlign = newAlignment;\n });\n }\n const { format } = block;\n format.textAlign = newAlignment;\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n"]}
1
+ {"version":3,"file":"setModelAlignment.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/block/setModelAlignment.ts"],"names":[],"mappings":";;;;IAQA,IAAM,SAAS,GAGX;QACA,IAAI,EAAE;YACF,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,KAAK;SACb;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SAChB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,OAAO;SACf;QACD,OAAO,EAAE;YACL,GAAG,EAAE,SAAS;YACd,GAAG,EAAE,SAAS;SACjB;KACJ,CAAC;IAEF,IAAM,aAAa,GAGf;QACA,IAAI,EAAE;YACF,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,YAAY;SACpB;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,aAAa;YAClB,GAAG,EAAE,aAAa;SACrB;QACD,KAAK,EAAE;YACH,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,WAAW;SACnB;KACJ,CAAC;IAEF;;OAEG;IACH,SAAgB,iBAAiB,CAC7B,KAA2B,EAC3B,SAAkD;QAElD,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAM,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC3F,IAAI,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,SAAS,EAAE;gBACxD,IAAA,uBAAU,EACN,KAAK,EACL,aAAa,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAC5E,CAAC;aACL;iBAAM,IAAI,KAAK,EAAE;gBACd,IAAI,KAAK,CAAC,SAAS,KAAK,YAAY,IAAI,KAAK,CAAC,cAAc,KAAK,UAAU,EAAE;oBACzE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;wBACV,IAAA,MAAM,GAAK,CAAC,OAAN,CAAO;wBACrB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;oBACpC,CAAC,CAAC,CAAC;iBACN;gBACO,IAAA,MAAM,GAAK,KAAK,OAAV,CAAW;gBACzB,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC;aACnC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IA9BD,8CA8BC","sourcesContent":["import { alignTable } from '../table/alignTable';\nimport { getOperationalBlocks } from 'roosterjs-content-model-core';\nimport type {\n ContentModelDocument,\n ContentModelListItem,\n TableAlignOperation,\n} from 'roosterjs-content-model-types';\n\nconst ResultMap: Record<\n 'left' | 'center' | 'right' | 'justify',\n Record<'ltr' | 'rtl', 'start' | 'center' | 'end' | 'justify'>\n> = {\n left: {\n ltr: 'start',\n rtl: 'end',\n },\n center: {\n ltr: 'center',\n rtl: 'center',\n },\n right: {\n ltr: 'end',\n rtl: 'start',\n },\n justify: {\n ltr: 'justify',\n rtl: 'justify',\n },\n};\n\nconst TableAlignMap: Record<\n 'left' | 'center' | 'right',\n Record<'ltr' | 'rtl', TableAlignOperation>\n> = {\n left: {\n ltr: 'alignLeft',\n rtl: 'alignRight',\n },\n center: {\n ltr: 'alignCenter',\n rtl: 'alignCenter',\n },\n right: {\n ltr: 'alignRight',\n rtl: 'alignLeft',\n },\n};\n\n/**\n * @internal\n */\nexport function setModelAlignment(\n model: ContentModelDocument,\n alignment: 'left' | 'center' | 'right' | 'justify'\n) {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n const newAlignment = ResultMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr'];\n if (block.blockType === 'Table' && alignment !== 'justify') {\n alignTable(\n block,\n TableAlignMap[alignment][block.format.direction == 'rtl' ? 'rtl' : 'ltr']\n );\n } else if (block) {\n if (block.blockType === 'BlockGroup' && block.blockGroupType === 'ListItem') {\n block.blocks.forEach(b => {\n const { format } = b;\n format.textAlign = newAlignment;\n });\n }\n const { format } = block;\n format.textAlign = newAlignment;\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setModelDirection.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/block/setModelDirection.ts"],"names":[],"mappings":";;;;IAiBA;;OAEG;IACH,SAAgB,iBAAiB,CAAC,KAA2B,EAAE,SAAwB;QACnF,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAI,IAAA,iDAAkB,EAAuB,KAAK,EAAE,UAAU,CAAC,EAAE;gBAC7D,IAAM,KAAK,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAEtD,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;wBACrB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;oBACvC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAA7C,CAA6C,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,KAAK,EAAE;gBACd,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;aACxD;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IAxBD,8CAwBC;IAED,SAAS,oBAAoB,CACzB,MAA+B,EAC/B,SAAwB,EACxB,KAAyB;QAEzB,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;QACzC,IAAM,KAAK,GAAG,SAAS,IAAI,KAAK,CAAC;QAEjC,IAAI,MAAM,IAAI,KAAK,EAAE;YACjB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YAE7B,sCAAsC;YACtC,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACrC,IAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;YAEvC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;YACtD,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;YAC/C,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACxD,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;YAEjD,2DAA2D;YAC3D,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,OAAO,EAAE;gBACrC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBAClB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;wBAClB,oDAAoD;wBACpD,IAAA,sDAAuB,EAAC,IAAI,EAAE,UAAA,QAAQ;4BAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,EAAE;gCAC1B,IAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;gCAC/C,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gCAChE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;6BAC5D;4BACD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBAEH,wBAAwB;gBACxB,IAAA,+CAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;aAC/E;SACJ;IACL,CAAC;IAED,SAAS,WAAW,CAChB,MAAmD,EACnD,GAAwD,EACxD,KAAyB;QAEzB,IAAI,KAAK,EAAE;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACvB;aAAM;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;SACtB;IACL,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../list/findListItemsInSameThread';\nimport {\n applyTableFormat,\n getOperationalBlocks,\n isBlockGroupOfType,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type {\n BorderFormat,\n ContentModelBlock,\n ContentModelBlockFormat,\n ContentModelDocument,\n ContentModelListItem,\n MarginFormat,\n PaddingFormat,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setModelDirection(model: ContentModelDocument, direction: 'ltr' | 'rtl') {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n if (isBlockGroupOfType<ContentModelListItem>(block, 'ListItem')) {\n const items = findListItemsInSameThread(model, block);\n\n items.forEach(item => {\n item.levels.forEach(level => {\n level.format.direction = direction;\n });\n\n item.blocks.forEach(block => internalSetDirection(block.format, direction));\n });\n } else if (block) {\n internalSetDirection(block.format, direction, block);\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n\nfunction internalSetDirection(\n format: ContentModelBlockFormat,\n direction: 'ltr' | 'rtl',\n block?: ContentModelBlock\n) {\n const wasRtl = format.direction == 'rtl';\n const isRtl = direction == 'rtl';\n\n if (wasRtl != isRtl) {\n format.direction = direction;\n\n // Adjust margin when change direction\n const marginLeft = format.marginLeft;\n const paddingLeft = format.paddingLeft;\n\n setProperty(format, 'marginLeft', format.marginRight);\n setProperty(format, 'marginRight', marginLeft);\n setProperty(format, 'paddingLeft', format.paddingRight);\n setProperty(format, 'paddingRight', paddingLeft);\n\n // If whole Table direction changed, flip cell side borders\n if (block && block.blockType == 'Table') {\n block.rows.forEach(row => {\n row.cells.forEach(cell => {\n // Optimise by skipping cells with unchanged borders\n updateTableCellMetadata(cell, metadata => {\n if (metadata?.borderOverride) {\n const storeBorderLeft = cell.format.borderLeft;\n setProperty(cell.format, 'borderLeft', cell.format.borderRight);\n setProperty(cell.format, 'borderRight', storeBorderLeft);\n }\n return metadata;\n });\n });\n });\n\n // Apply changed borders\n applyTableFormat(block, undefined /* newFormat */, true /* keepCellShade*/);\n }\n }\n}\n\nfunction setProperty(\n format: MarginFormat & PaddingFormat & BorderFormat,\n key: keyof (MarginFormat & PaddingFormat & BorderFormat),\n value: string | undefined\n) {\n if (value) {\n format[key] = value;\n } else {\n delete format[key];\n }\n}\n"]}
1
+ {"version":3,"file":"setModelDirection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/modelApi/block/setModelDirection.ts"],"names":[],"mappings":";;;;IAiBA;;OAEG;IACH,SAAgB,iBAAiB,CAAC,KAA2B,EAAE,SAAwB;QACnF,IAAM,0BAA0B,GAAG,IAAA,mDAAoB,EACnD,KAAK,EACL,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,CAAC,CAChB,CAAC;QAEF,0BAA0B,CAAC,OAAO,CAAC,UAAC,EAAS;gBAAP,KAAK,WAAA;YACvC,IAAI,IAAA,iDAAkB,EAAuB,KAAK,EAAE,UAAU,CAAC,EAAE;gBAC7D,IAAM,KAAK,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAEtD,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBACd,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;wBACrB,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;oBACvC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAA7C,CAA6C,CAAC,CAAC;gBAChF,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,KAAK,EAAE;gBACd,oBAAoB,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;aACxD;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,MAAM,GAAG,CAAC,CAAC;IACjD,CAAC;IAxBD,8CAwBC;IAED,SAAS,oBAAoB,CACzB,MAA+B,EAC/B,SAAwB,EACxB,KAAyB;QAEzB,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC;QACzC,IAAM,KAAK,GAAG,SAAS,IAAI,KAAK,CAAC;QAEjC,IAAI,MAAM,IAAI,KAAK,EAAE;YACjB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YAE7B,sCAAsC;YACtC,IAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACrC,IAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;YAEvC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;YACtD,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;YAC/C,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACxD,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;YAEjD,2DAA2D;YAC3D,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,IAAI,OAAO,EAAE;gBACrC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBAClB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;wBAClB,oDAAoD;wBACpD,IAAA,sDAAuB,EAAC,IAAI,EAAE,UAAA,QAAQ;4BAClC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,EAAE;gCAC1B,IAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;gCAC/C,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;gCAChE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;6BAC5D;4BACD,OAAO,QAAQ,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;gBAEH,wBAAwB;gBACxB,IAAA,+CAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;aAC/E;SACJ;IACL,CAAC;IAED,SAAS,WAAW,CAChB,MAAmD,EACnD,GAAwD,EACxD,KAAyB;QAEzB,IAAI,KAAK,EAAE;YACP,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACvB;aAAM;YACH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;SACtB;IACL,CAAC","sourcesContent":["import { findListItemsInSameThread } from '../list/findListItemsInSameThread';\nimport {\n applyTableFormat,\n getOperationalBlocks,\n isBlockGroupOfType,\n updateTableCellMetadata,\n} from 'roosterjs-content-model-core';\nimport type {\n BorderFormat,\n ContentModelBlock,\n ContentModelBlockFormat,\n ContentModelDocument,\n ContentModelListItem,\n MarginFormat,\n PaddingFormat,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function setModelDirection(model: ContentModelDocument, direction: 'ltr' | 'rtl') {\n const paragraphOrListItemOrTable = getOperationalBlocks<ContentModelListItem>(\n model,\n ['ListItem'],\n ['TableCell']\n );\n\n paragraphOrListItemOrTable.forEach(({ block }) => {\n if (isBlockGroupOfType<ContentModelListItem>(block, 'ListItem')) {\n const items = findListItemsInSameThread(model, block);\n\n items.forEach(item => {\n item.levels.forEach(level => {\n level.format.direction = direction;\n });\n\n item.blocks.forEach(block => internalSetDirection(block.format, direction));\n });\n } else if (block) {\n internalSetDirection(block.format, direction, block);\n }\n });\n\n return paragraphOrListItemOrTable.length > 0;\n}\n\nfunction internalSetDirection(\n format: ContentModelBlockFormat,\n direction: 'ltr' | 'rtl',\n block?: ContentModelBlock\n) {\n const wasRtl = format.direction == 'rtl';\n const isRtl = direction == 'rtl';\n\n if (wasRtl != isRtl) {\n format.direction = direction;\n\n // Adjust margin when change direction\n const marginLeft = format.marginLeft;\n const paddingLeft = format.paddingLeft;\n\n setProperty(format, 'marginLeft', format.marginRight);\n setProperty(format, 'marginRight', marginLeft);\n setProperty(format, 'paddingLeft', format.paddingRight);\n setProperty(format, 'paddingRight', paddingLeft);\n\n // If whole Table direction changed, flip cell side borders\n if (block && block.blockType == 'Table') {\n block.rows.forEach(row => {\n row.cells.forEach(cell => {\n // Optimise by skipping cells with unchanged borders\n updateTableCellMetadata(cell, metadata => {\n if (metadata?.borderOverride) {\n const storeBorderLeft = cell.format.borderLeft;\n setProperty(cell.format, 'borderLeft', cell.format.borderRight);\n setProperty(cell.format, 'borderRight', storeBorderLeft);\n }\n return metadata;\n });\n });\n });\n\n // Apply changed borders\n applyTableFormat(block, undefined /* newFormat */, true /* keepCellShade*/);\n }\n }\n}\n\nfunction setProperty(\n format: MarginFormat & PaddingFormat & BorderFormat,\n key: keyof (MarginFormat & PaddingFormat & BorderFormat),\n value: string | undefined\n) {\n if (value) {\n format[key] = value;\n } else {\n delete format[key];\n }\n}\n"]}