roosterjs-content-model-api 0.20.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 (723) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +262 -0
  3. package/lib/index.d.ts +45 -0
  4. package/lib/index.js +94 -0
  5. package/lib/index.js.map +1 -0
  6. package/lib/modelApi/block/setModelAlignment.d.ts +5 -0
  7. package/lib/modelApi/block/setModelAlignment.js +53 -0
  8. package/lib/modelApi/block/setModelAlignment.js.map +1 -0
  9. package/lib/modelApi/block/setModelDirection.d.ts +5 -0
  10. package/lib/modelApi/block/setModelDirection.js +53 -0
  11. package/lib/modelApi/block/setModelDirection.js.map +1 -0
  12. package/lib/modelApi/block/setModelIndentation.d.ts +5 -0
  13. package/lib/modelApi/block/setModelIndentation.js +48 -0
  14. package/lib/modelApi/block/setModelIndentation.js.map +1 -0
  15. package/lib/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
  16. package/lib/modelApi/block/toggleModelBlockQuote.js +49 -0
  17. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -0
  18. package/lib/modelApi/common/clearModelFormat.d.ts +5 -0
  19. package/lib/modelApi/common/clearModelFormat.js +130 -0
  20. package/lib/modelApi/common/clearModelFormat.js.map +1 -0
  21. package/lib/modelApi/common/retrieveModelFormatState.d.ts +5 -0
  22. package/lib/modelApi/common/retrieveModelFormatState.js +172 -0
  23. package/lib/modelApi/common/retrieveModelFormatState.js.map +1 -0
  24. package/lib/modelApi/common/wrapBlock.d.ts +16 -0
  25. package/lib/modelApi/common/wrapBlock.js +45 -0
  26. package/lib/modelApi/common/wrapBlock.js.map +1 -0
  27. package/lib/modelApi/domUtils/readFile.d.ts +8 -0
  28. package/lib/modelApi/domUtils/readFile.js +24 -0
  29. package/lib/modelApi/domUtils/readFile.js.map +1 -0
  30. package/lib/modelApi/entity/insertEntityModel.d.ts +5 -0
  31. package/lib/modelApi/entity/insertEntityModel.js +76 -0
  32. package/lib/modelApi/entity/insertEntityModel.js.map +1 -0
  33. package/lib/modelApi/image/applyImageBorderFormat.d.ts +5 -0
  34. package/lib/modelApi/image/applyImageBorderFormat.js +58 -0
  35. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -0
  36. package/lib/modelApi/list/findListItemsInSameThread.d.ts +5 -0
  37. package/lib/modelApi/list/findListItemsInSameThread.js +113 -0
  38. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -0
  39. package/lib/modelApi/list/setListType.d.ts +5 -0
  40. package/lib/modelApi/list/setListType.js +92 -0
  41. package/lib/modelApi/list/setListType.js.map +1 -0
  42. package/lib/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
  43. package/lib/modelApi/selection/adjustSegmentSelection.js +48 -0
  44. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -0
  45. package/lib/modelApi/selection/adjustWordSelection.d.ts +5 -0
  46. package/lib/modelApi/selection/adjustWordSelection.js +122 -0
  47. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -0
  48. package/lib/modelApi/selection/collapseTableSelection.d.ts +6 -0
  49. package/lib/modelApi/selection/collapseTableSelection.js +17 -0
  50. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -0
  51. package/lib/modelApi/table/alignTable.d.ts +5 -0
  52. package/lib/modelApi/table/alignTable.js +13 -0
  53. package/lib/modelApi/table/alignTable.js.map +1 -0
  54. package/lib/modelApi/table/alignTableCell.d.ts +9 -0
  55. package/lib/modelApi/table/alignTableCell.js +60 -0
  56. package/lib/modelApi/table/alignTableCell.js.map +1 -0
  57. package/lib/modelApi/table/canMergeCells.d.ts +5 -0
  58. package/lib/modelApi/table/canMergeCells.js +57 -0
  59. package/lib/modelApi/table/canMergeCells.js.map +1 -0
  60. package/lib/modelApi/table/createTableStructure.d.ts +5 -0
  61. package/lib/modelApi/table/createTableStructure.js +20 -0
  62. package/lib/modelApi/table/createTableStructure.js.map +1 -0
  63. package/lib/modelApi/table/deleteTable.d.ts +5 -0
  64. package/lib/modelApi/table/deleteTable.js +12 -0
  65. package/lib/modelApi/table/deleteTable.js.map +1 -0
  66. package/lib/modelApi/table/deleteTableColumn.d.ts +5 -0
  67. package/lib/modelApi/table/deleteTableColumn.js +25 -0
  68. package/lib/modelApi/table/deleteTableColumn.js.map +1 -0
  69. package/lib/modelApi/table/deleteTableRow.d.ts +5 -0
  70. package/lib/modelApi/table/deleteTableRow.js +24 -0
  71. package/lib/modelApi/table/deleteTableRow.js.map +1 -0
  72. package/lib/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
  73. package/lib/modelApi/table/ensureFocusableParagraphForTable.js +57 -0
  74. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
  75. package/lib/modelApi/table/getSelectedCells.d.ts +14 -0
  76. package/lib/modelApi/table/getSelectedCells.js +32 -0
  77. package/lib/modelApi/table/getSelectedCells.js.map +1 -0
  78. package/lib/modelApi/table/insertTableColumn.d.ts +5 -0
  79. package/lib/modelApi/table/insertTableColumn.js +23 -0
  80. package/lib/modelApi/table/insertTableColumn.js.map +1 -0
  81. package/lib/modelApi/table/insertTableRow.d.ts +5 -0
  82. package/lib/modelApi/table/insertTableRow.js +27 -0
  83. package/lib/modelApi/table/insertTableRow.js.map +1 -0
  84. package/lib/modelApi/table/mergeTableCells.d.ts +5 -0
  85. package/lib/modelApi/table/mergeTableCells.js +26 -0
  86. package/lib/modelApi/table/mergeTableCells.js.map +1 -0
  87. package/lib/modelApi/table/mergeTableColumn.d.ts +5 -0
  88. package/lib/modelApi/table/mergeTableColumn.js +38 -0
  89. package/lib/modelApi/table/mergeTableColumn.js.map +1 -0
  90. package/lib/modelApi/table/mergeTableRow.d.ts +5 -0
  91. package/lib/modelApi/table/mergeTableRow.js +39 -0
  92. package/lib/modelApi/table/mergeTableRow.js.map +1 -0
  93. package/lib/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
  94. package/lib/modelApi/table/splitTableCellHorizontally.js +55 -0
  95. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -0
  96. package/lib/modelApi/table/splitTableCellVertically.d.ts +5 -0
  97. package/lib/modelApi/table/splitTableCellVertically.js +56 -0
  98. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -0
  99. package/lib/publicApi/block/setAlignment.d.ts +7 -0
  100. package/lib/publicApi/block/setAlignment.js +16 -0
  101. package/lib/publicApi/block/setAlignment.js.map +1 -0
  102. package/lib/publicApi/block/setDirection.d.ts +7 -0
  103. package/lib/publicApi/block/setDirection.js +16 -0
  104. package/lib/publicApi/block/setDirection.js.map +1 -0
  105. package/lib/publicApi/block/setHeadingLevel.d.ts +7 -0
  106. package/lib/publicApi/block/setHeadingLevel.js +50 -0
  107. package/lib/publicApi/block/setHeadingLevel.js.map +1 -0
  108. package/lib/publicApi/block/setIndentation.d.ts +8 -0
  109. package/lib/publicApi/block/setIndentation.js +25 -0
  110. package/lib/publicApi/block/setIndentation.js.map +1 -0
  111. package/lib/publicApi/block/setParagraphMargin.d.ts +9 -0
  112. package/lib/publicApi/block/setParagraphMargin.js +33 -0
  113. package/lib/publicApi/block/setParagraphMargin.js.map +1 -0
  114. package/lib/publicApi/block/setSpacing.d.ts +7 -0
  115. package/lib/publicApi/block/setSpacing.js +21 -0
  116. package/lib/publicApi/block/setSpacing.js.map +1 -0
  117. package/lib/publicApi/block/toggleBlockQuote.d.ts +9 -0
  118. package/lib/publicApi/block/toggleBlockQuote.js +35 -0
  119. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -0
  120. package/lib/publicApi/entity/insertEntity.d.ts +25 -0
  121. package/lib/publicApi/entity/insertEntity.js +41 -0
  122. package/lib/publicApi/entity/insertEntity.js.map +1 -0
  123. package/lib/publicApi/format/clearFormat.d.ts +6 -0
  124. package/lib/publicApi/format/clearFormat.js +23 -0
  125. package/lib/publicApi/format/clearFormat.js.map +1 -0
  126. package/lib/publicApi/format/getFormatState.d.ts +26 -0
  127. package/lib/publicApi/format/getFormatState.js +83 -0
  128. package/lib/publicApi/format/getFormatState.js.map +1 -0
  129. package/lib/publicApi/image/adjustImageSelection.d.ts +6 -0
  130. package/lib/publicApi/image/adjustImageSelection.js +26 -0
  131. package/lib/publicApi/image/adjustImageSelection.js.map +1 -0
  132. package/lib/publicApi/image/changeImage.d.ts +7 -0
  133. package/lib/publicApi/image/changeImage.js +36 -0
  134. package/lib/publicApi/image/changeImage.js.map +1 -0
  135. package/lib/publicApi/image/insertImage.d.ts +7 -0
  136. package/lib/publicApi/image/insertImage.js +38 -0
  137. package/lib/publicApi/image/insertImage.js.map +1 -0
  138. package/lib/publicApi/image/setImageAltText.d.ts +8 -0
  139. package/lib/publicApi/image/setImageAltText.js +17 -0
  140. package/lib/publicApi/image/setImageAltText.js.map +1 -0
  141. package/lib/publicApi/image/setImageBorder.d.ts +9 -0
  142. package/lib/publicApi/image/setImageBorder.js +19 -0
  143. package/lib/publicApi/image/setImageBorder.js.map +1 -0
  144. package/lib/publicApi/image/setImageBoxShadow.d.ts +8 -0
  145. package/lib/publicApi/image/setImageBoxShadow.js +29 -0
  146. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -0
  147. package/lib/publicApi/link/adjustLinkSelection.d.ts +6 -0
  148. package/lib/publicApi/link/adjustLinkSelection.js +34 -0
  149. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -0
  150. package/lib/publicApi/link/insertLink.d.ts +15 -0
  151. package/lib/publicApi/link/insertLink.js +127 -0
  152. package/lib/publicApi/link/insertLink.js.map +1 -0
  153. package/lib/publicApi/link/removeLink.d.ts +8 -0
  154. package/lib/publicApi/link/removeLink.js +32 -0
  155. package/lib/publicApi/link/removeLink.js.map +1 -0
  156. package/lib/publicApi/list/setListStartNumber.d.ts +7 -0
  157. package/lib/publicApi/list/setListStartNumber.js +26 -0
  158. package/lib/publicApi/list/setListStartNumber.js.map +1 -0
  159. package/lib/publicApi/list/setListStyle.d.ts +7 -0
  160. package/lib/publicApi/list/setListStyle.js +33 -0
  161. package/lib/publicApi/list/setListStyle.js.map +1 -0
  162. package/lib/publicApi/list/toggleBullet.d.ts +8 -0
  163. package/lib/publicApi/list/toggleBullet.js +20 -0
  164. package/lib/publicApi/list/toggleBullet.js.map +1 -0
  165. package/lib/publicApi/list/toggleNumbering.d.ts +8 -0
  166. package/lib/publicApi/list/toggleNumbering.js +20 -0
  167. package/lib/publicApi/list/toggleNumbering.js.map +1 -0
  168. package/lib/publicApi/segment/applySegmentFormat.d.ts +7 -0
  169. package/lib/publicApi/segment/applySegmentFormat.js +23 -0
  170. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -0
  171. package/lib/publicApi/segment/changeCapitalization.d.ts +10 -0
  172. package/lib/publicApi/segment/changeCapitalization.js +50 -0
  173. package/lib/publicApi/segment/changeCapitalization.js.map +1 -0
  174. package/lib/publicApi/segment/changeFontSize.d.ts +8 -0
  175. package/lib/publicApi/segment/changeFontSize.js +62 -0
  176. package/lib/publicApi/segment/changeFontSize.js.map +1 -0
  177. package/lib/publicApi/segment/setBackgroundColor.d.ts +7 -0
  178. package/lib/publicApi/segment/setBackgroundColor.js +36 -0
  179. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -0
  180. package/lib/publicApi/segment/setFontName.d.ts +7 -0
  181. package/lib/publicApi/segment/setFontName.js +19 -0
  182. package/lib/publicApi/segment/setFontName.js.map +1 -0
  183. package/lib/publicApi/segment/setFontSize.d.ts +12 -0
  184. package/lib/publicApi/segment/setFontSize.js +34 -0
  185. package/lib/publicApi/segment/setFontSize.js.map +1 -0
  186. package/lib/publicApi/segment/setTextColor.d.ts +7 -0
  187. package/lib/publicApi/segment/setTextColor.js +26 -0
  188. package/lib/publicApi/segment/setTextColor.js.map +1 -0
  189. package/lib/publicApi/segment/toggleBold.d.ts +10 -0
  190. package/lib/publicApi/segment/toggleBold.js +28 -0
  191. package/lib/publicApi/segment/toggleBold.js.map +1 -0
  192. package/lib/publicApi/segment/toggleCode.d.ts +6 -0
  193. package/lib/publicApi/segment/toggleCode.js +28 -0
  194. package/lib/publicApi/segment/toggleCode.js.map +1 -0
  195. package/lib/publicApi/segment/toggleItalic.d.ts +6 -0
  196. package/lib/publicApi/segment/toggleItalic.js +15 -0
  197. package/lib/publicApi/segment/toggleItalic.js.map +1 -0
  198. package/lib/publicApi/segment/toggleStrikethrough.d.ts +6 -0
  199. package/lib/publicApi/segment/toggleStrikethrough.js +15 -0
  200. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -0
  201. package/lib/publicApi/segment/toggleSubscript.d.ts +6 -0
  202. package/lib/publicApi/segment/toggleSubscript.js +15 -0
  203. package/lib/publicApi/segment/toggleSubscript.js.map +1 -0
  204. package/lib/publicApi/segment/toggleSuperscript.d.ts +6 -0
  205. package/lib/publicApi/segment/toggleSuperscript.js +15 -0
  206. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -0
  207. package/lib/publicApi/segment/toggleUnderline.d.ts +6 -0
  208. package/lib/publicApi/segment/toggleUnderline.js +18 -0
  209. package/lib/publicApi/segment/toggleUnderline.js.map +1 -0
  210. package/lib/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
  211. package/lib/publicApi/selection/hasSelectionInBlock.js +25 -0
  212. package/lib/publicApi/selection/hasSelectionInBlock.js.map +1 -0
  213. package/lib/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
  214. package/lib/publicApi/selection/hasSelectionInBlockGroup.js +18 -0
  215. package/lib/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
  216. package/lib/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
  217. package/lib/publicApi/selection/hasSelectionInSegment.js +13 -0
  218. package/lib/publicApi/selection/hasSelectionInSegment.js.map +1 -0
  219. package/lib/publicApi/table/applyTableBorderFormat.d.ts +8 -0
  220. package/lib/publicApi/table/applyTableBorderFormat.js +293 -0
  221. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -0
  222. package/lib/publicApi/table/editTable.d.ts +7 -0
  223. package/lib/publicApi/table/editTable.js +104 -0
  224. package/lib/publicApi/table/editTable.js.map +1 -0
  225. package/lib/publicApi/table/formatTable.d.ts +8 -0
  226. package/lib/publicApi/table/formatTable.js +38 -0
  227. package/lib/publicApi/table/formatTable.js.map +1 -0
  228. package/lib/publicApi/table/insertTable.d.ts +11 -0
  229. package/lib/publicApi/table/insertTable.js +47 -0
  230. package/lib/publicApi/table/insertTable.js.map +1 -0
  231. package/lib/publicApi/table/setTableCellShade.d.ts +7 -0
  232. package/lib/publicApi/table/setTableCellShade.js +34 -0
  233. package/lib/publicApi/table/setTableCellShade.js.map +1 -0
  234. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
  235. package/lib/publicApi/utils/formatImageWithContentModel.js +15 -0
  236. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -0
  237. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
  238. package/lib/publicApi/utils/formatParagraphWithContentModel.js +19 -0
  239. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
  240. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
  241. package/lib/publicApi/utils/formatSegmentWithContentModel.js +52 -0
  242. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
  243. package/lib-amd/index.d.ts +45 -0
  244. package/lib-amd/index.js +51 -0
  245. package/lib-amd/index.js.map +1 -0
  246. package/lib-amd/modelApi/block/setModelAlignment.d.ts +5 -0
  247. package/lib-amd/modelApi/block/setModelAlignment.js +53 -0
  248. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -0
  249. package/lib-amd/modelApi/block/setModelDirection.d.ts +5 -0
  250. package/lib-amd/modelApi/block/setModelDirection.js +53 -0
  251. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -0
  252. package/lib-amd/modelApi/block/setModelIndentation.d.ts +5 -0
  253. package/lib-amd/modelApi/block/setModelIndentation.js +48 -0
  254. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -0
  255. package/lib-amd/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
  256. package/lib-amd/modelApi/block/toggleModelBlockQuote.js +48 -0
  257. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -0
  258. package/lib-amd/modelApi/common/clearModelFormat.d.ts +5 -0
  259. package/lib-amd/modelApi/common/clearModelFormat.js +128 -0
  260. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -0
  261. package/lib-amd/modelApi/common/retrieveModelFormatState.d.ts +5 -0
  262. package/lib-amd/modelApi/common/retrieveModelFormatState.js +172 -0
  263. package/lib-amd/modelApi/common/retrieveModelFormatState.js.map +1 -0
  264. package/lib-amd/modelApi/common/wrapBlock.d.ts +16 -0
  265. package/lib-amd/modelApi/common/wrapBlock.js +45 -0
  266. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -0
  267. package/lib-amd/modelApi/domUtils/readFile.d.ts +8 -0
  268. package/lib-amd/modelApi/domUtils/readFile.js +26 -0
  269. package/lib-amd/modelApi/domUtils/readFile.js.map +1 -0
  270. package/lib-amd/modelApi/entity/insertEntityModel.d.ts +5 -0
  271. package/lib-amd/modelApi/entity/insertEntityModel.js +75 -0
  272. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -0
  273. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +5 -0
  274. package/lib-amd/modelApi/image/applyImageBorderFormat.js +58 -0
  275. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -0
  276. package/lib-amd/modelApi/list/findListItemsInSameThread.d.ts +5 -0
  277. package/lib-amd/modelApi/list/findListItemsInSameThread.js +115 -0
  278. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -0
  279. package/lib-amd/modelApi/list/setListType.d.ts +5 -0
  280. package/lib-amd/modelApi/list/setListType.js +92 -0
  281. package/lib-amd/modelApi/list/setListType.js.map +1 -0
  282. package/lib-amd/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
  283. package/lib-amd/modelApi/selection/adjustSegmentSelection.js +49 -0
  284. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -0
  285. package/lib-amd/modelApi/selection/adjustWordSelection.d.ts +5 -0
  286. package/lib-amd/modelApi/selection/adjustWordSelection.js +121 -0
  287. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -0
  288. package/lib-amd/modelApi/selection/collapseTableSelection.d.ts +6 -0
  289. package/lib-amd/modelApi/selection/collapseTableSelection.js +18 -0
  290. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -0
  291. package/lib-amd/modelApi/table/alignTable.d.ts +5 -0
  292. package/lib-amd/modelApi/table/alignTable.js +15 -0
  293. package/lib-amd/modelApi/table/alignTable.js.map +1 -0
  294. package/lib-amd/modelApi/table/alignTableCell.d.ts +9 -0
  295. package/lib-amd/modelApi/table/alignTableCell.js +60 -0
  296. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -0
  297. package/lib-amd/modelApi/table/canMergeCells.d.ts +5 -0
  298. package/lib-amd/modelApi/table/canMergeCells.js +59 -0
  299. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -0
  300. package/lib-amd/modelApi/table/createTableStructure.d.ts +5 -0
  301. package/lib-amd/modelApi/table/createTableStructure.js +21 -0
  302. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -0
  303. package/lib-amd/modelApi/table/deleteTable.d.ts +5 -0
  304. package/lib-amd/modelApi/table/deleteTable.js +14 -0
  305. package/lib-amd/modelApi/table/deleteTable.js.map +1 -0
  306. package/lib-amd/modelApi/table/deleteTableColumn.d.ts +5 -0
  307. package/lib-amd/modelApi/table/deleteTableColumn.js +25 -0
  308. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -0
  309. package/lib-amd/modelApi/table/deleteTableRow.d.ts +5 -0
  310. package/lib-amd/modelApi/table/deleteTableRow.js +24 -0
  311. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -0
  312. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
  313. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js +58 -0
  314. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
  315. package/lib-amd/modelApi/table/getSelectedCells.d.ts +14 -0
  316. package/lib-amd/modelApi/table/getSelectedCells.js +33 -0
  317. package/lib-amd/modelApi/table/getSelectedCells.js.map +1 -0
  318. package/lib-amd/modelApi/table/insertTableColumn.d.ts +5 -0
  319. package/lib-amd/modelApi/table/insertTableColumn.js +23 -0
  320. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -0
  321. package/lib-amd/modelApi/table/insertTableRow.d.ts +5 -0
  322. package/lib-amd/modelApi/table/insertTableRow.js +26 -0
  323. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -0
  324. package/lib-amd/modelApi/table/mergeTableCells.d.ts +5 -0
  325. package/lib-amd/modelApi/table/mergeTableCells.js +26 -0
  326. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -0
  327. package/lib-amd/modelApi/table/mergeTableColumn.d.ts +5 -0
  328. package/lib-amd/modelApi/table/mergeTableColumn.js +38 -0
  329. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -0
  330. package/lib-amd/modelApi/table/mergeTableRow.d.ts +5 -0
  331. package/lib-amd/modelApi/table/mergeTableRow.js +39 -0
  332. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -0
  333. package/lib-amd/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
  334. package/lib-amd/modelApi/table/splitTableCellHorizontally.js +54 -0
  335. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -0
  336. package/lib-amd/modelApi/table/splitTableCellVertically.d.ts +5 -0
  337. package/lib-amd/modelApi/table/splitTableCellVertically.js +55 -0
  338. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -0
  339. package/lib-amd/publicApi/block/setAlignment.d.ts +7 -0
  340. package/lib-amd/publicApi/block/setAlignment.js +17 -0
  341. package/lib-amd/publicApi/block/setAlignment.js.map +1 -0
  342. package/lib-amd/publicApi/block/setDirection.d.ts +7 -0
  343. package/lib-amd/publicApi/block/setDirection.js +17 -0
  344. package/lib-amd/publicApi/block/setDirection.js.map +1 -0
  345. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +7 -0
  346. package/lib-amd/publicApi/block/setHeadingLevel.js +51 -0
  347. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -0
  348. package/lib-amd/publicApi/block/setIndentation.d.ts +8 -0
  349. package/lib-amd/publicApi/block/setIndentation.js +25 -0
  350. package/lib-amd/publicApi/block/setIndentation.js.map +1 -0
  351. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +9 -0
  352. package/lib-amd/publicApi/block/setParagraphMargin.js +33 -0
  353. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -0
  354. package/lib-amd/publicApi/block/setSpacing.d.ts +7 -0
  355. package/lib-amd/publicApi/block/setSpacing.js +22 -0
  356. package/lib-amd/publicApi/block/setSpacing.js.map +1 -0
  357. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +9 -0
  358. package/lib-amd/publicApi/block/toggleBlockQuote.js +35 -0
  359. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -0
  360. package/lib-amd/publicApi/entity/insertEntity.d.ts +25 -0
  361. package/lib-amd/publicApi/entity/insertEntity.js +40 -0
  362. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -0
  363. package/lib-amd/publicApi/format/clearFormat.d.ts +6 -0
  364. package/lib-amd/publicApi/format/clearFormat.js +23 -0
  365. package/lib-amd/publicApi/format/clearFormat.js.map +1 -0
  366. package/lib-amd/publicApi/format/getFormatState.d.ts +26 -0
  367. package/lib-amd/publicApi/format/getFormatState.js +81 -0
  368. package/lib-amd/publicApi/format/getFormatState.js.map +1 -0
  369. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +6 -0
  370. package/lib-amd/publicApi/image/adjustImageSelection.js +27 -0
  371. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -0
  372. package/lib-amd/publicApi/image/changeImage.d.ts +7 -0
  373. package/lib-amd/publicApi/image/changeImage.js +35 -0
  374. package/lib-amd/publicApi/image/changeImage.js.map +1 -0
  375. package/lib-amd/publicApi/image/insertImage.d.ts +7 -0
  376. package/lib-amd/publicApi/image/insertImage.js +37 -0
  377. package/lib-amd/publicApi/image/insertImage.js.map +1 -0
  378. package/lib-amd/publicApi/image/setImageAltText.d.ts +8 -0
  379. package/lib-amd/publicApi/image/setImageAltText.js +18 -0
  380. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -0
  381. package/lib-amd/publicApi/image/setImageBorder.d.ts +9 -0
  382. package/lib-amd/publicApi/image/setImageBorder.js +19 -0
  383. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -0
  384. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +8 -0
  385. package/lib-amd/publicApi/image/setImageBoxShadow.js +30 -0
  386. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -0
  387. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +6 -0
  388. package/lib-amd/publicApi/link/adjustLinkSelection.js +33 -0
  389. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -0
  390. package/lib-amd/publicApi/link/insertLink.d.ts +15 -0
  391. package/lib-amd/publicApi/link/insertLink.js +125 -0
  392. package/lib-amd/publicApi/link/insertLink.js.map +1 -0
  393. package/lib-amd/publicApi/link/removeLink.d.ts +8 -0
  394. package/lib-amd/publicApi/link/removeLink.js +32 -0
  395. package/lib-amd/publicApi/link/removeLink.js.map +1 -0
  396. package/lib-amd/publicApi/list/setListStartNumber.d.ts +7 -0
  397. package/lib-amd/publicApi/list/setListStartNumber.js +27 -0
  398. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -0
  399. package/lib-amd/publicApi/list/setListStyle.d.ts +7 -0
  400. package/lib-amd/publicApi/list/setListStyle.js +33 -0
  401. package/lib-amd/publicApi/list/setListStyle.js.map +1 -0
  402. package/lib-amd/publicApi/list/toggleBullet.d.ts +8 -0
  403. package/lib-amd/publicApi/list/toggleBullet.js +21 -0
  404. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -0
  405. package/lib-amd/publicApi/list/toggleNumbering.d.ts +8 -0
  406. package/lib-amd/publicApi/list/toggleNumbering.js +21 -0
  407. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -0
  408. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +7 -0
  409. package/lib-amd/publicApi/segment/applySegmentFormat.js +24 -0
  410. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -0
  411. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +10 -0
  412. package/lib-amd/publicApi/segment/changeCapitalization.js +51 -0
  413. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -0
  414. package/lib-amd/publicApi/segment/changeFontSize.d.ts +8 -0
  415. package/lib-amd/publicApi/segment/changeFontSize.js +61 -0
  416. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -0
  417. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +7 -0
  418. package/lib-amd/publicApi/segment/setBackgroundColor.js +35 -0
  419. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -0
  420. package/lib-amd/publicApi/segment/setFontName.d.ts +7 -0
  421. package/lib-amd/publicApi/segment/setFontName.js +20 -0
  422. package/lib-amd/publicApi/segment/setFontName.js.map +1 -0
  423. package/lib-amd/publicApi/segment/setFontSize.d.ts +12 -0
  424. package/lib-amd/publicApi/segment/setFontSize.js +35 -0
  425. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -0
  426. package/lib-amd/publicApi/segment/setTextColor.d.ts +7 -0
  427. package/lib-amd/publicApi/segment/setTextColor.js +27 -0
  428. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -0
  429. package/lib-amd/publicApi/segment/toggleBold.d.ts +10 -0
  430. package/lib-amd/publicApi/segment/toggleBold.js +29 -0
  431. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -0
  432. package/lib-amd/publicApi/segment/toggleCode.d.ts +6 -0
  433. package/lib-amd/publicApi/segment/toggleCode.js +28 -0
  434. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -0
  435. package/lib-amd/publicApi/segment/toggleItalic.d.ts +6 -0
  436. package/lib-amd/publicApi/segment/toggleItalic.js +16 -0
  437. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -0
  438. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +6 -0
  439. package/lib-amd/publicApi/segment/toggleStrikethrough.js +16 -0
  440. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -0
  441. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +6 -0
  442. package/lib-amd/publicApi/segment/toggleSubscript.js +16 -0
  443. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -0
  444. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +6 -0
  445. package/lib-amd/publicApi/segment/toggleSuperscript.js +16 -0
  446. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -0
  447. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +6 -0
  448. package/lib-amd/publicApi/segment/toggleUnderline.js +19 -0
  449. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -0
  450. package/lib-amd/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
  451. package/lib-amd/publicApi/selection/hasSelectionInBlock.js +25 -0
  452. package/lib-amd/publicApi/selection/hasSelectionInBlock.js.map +1 -0
  453. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
  454. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js +19 -0
  455. package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
  456. package/lib-amd/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
  457. package/lib-amd/publicApi/selection/hasSelectionInSegment.js +14 -0
  458. package/lib-amd/publicApi/selection/hasSelectionInSegment.js.map +1 -0
  459. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +8 -0
  460. package/lib-amd/publicApi/table/applyTableBorderFormat.js +291 -0
  461. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -0
  462. package/lib-amd/publicApi/table/editTable.d.ts +7 -0
  463. package/lib-amd/publicApi/table/editTable.js +89 -0
  464. package/lib-amd/publicApi/table/editTable.js.map +1 -0
  465. package/lib-amd/publicApi/table/formatTable.d.ts +8 -0
  466. package/lib-amd/publicApi/table/formatTable.js +38 -0
  467. package/lib-amd/publicApi/table/formatTable.js.map +1 -0
  468. package/lib-amd/publicApi/table/insertTable.d.ts +11 -0
  469. package/lib-amd/publicApi/table/insertTable.js +46 -0
  470. package/lib-amd/publicApi/table/insertTable.js.map +1 -0
  471. package/lib-amd/publicApi/table/setTableCellShade.d.ts +7 -0
  472. package/lib-amd/publicApi/table/setTableCellShade.js +33 -0
  473. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -0
  474. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
  475. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +16 -0
  476. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -0
  477. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
  478. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +20 -0
  479. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
  480. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
  481. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +51 -0
  482. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
  483. package/lib-mjs/index.d.ts +45 -0
  484. package/lib-mjs/index.js +46 -0
  485. package/lib-mjs/index.js.map +1 -0
  486. package/lib-mjs/modelApi/block/setModelAlignment.d.ts +5 -0
  487. package/lib-mjs/modelApi/block/setModelAlignment.js +49 -0
  488. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -0
  489. package/lib-mjs/modelApi/block/setModelDirection.d.ts +5 -0
  490. package/lib-mjs/modelApi/block/setModelDirection.js +49 -0
  491. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -0
  492. package/lib-mjs/modelApi/block/setModelIndentation.d.ts +5 -0
  493. package/lib-mjs/modelApi/block/setModelIndentation.js +44 -0
  494. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -0
  495. package/lib-mjs/modelApi/block/toggleModelBlockQuote.d.ts +5 -0
  496. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js +45 -0
  497. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -0
  498. package/lib-mjs/modelApi/common/clearModelFormat.d.ts +5 -0
  499. package/lib-mjs/modelApi/common/clearModelFormat.js +126 -0
  500. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -0
  501. package/lib-mjs/modelApi/common/retrieveModelFormatState.d.ts +5 -0
  502. package/lib-mjs/modelApi/common/retrieveModelFormatState.js +168 -0
  503. package/lib-mjs/modelApi/common/retrieveModelFormatState.js.map +1 -0
  504. package/lib-mjs/modelApi/common/wrapBlock.d.ts +16 -0
  505. package/lib-mjs/modelApi/common/wrapBlock.js +40 -0
  506. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -0
  507. package/lib-mjs/modelApi/domUtils/readFile.d.ts +8 -0
  508. package/lib-mjs/modelApi/domUtils/readFile.js +20 -0
  509. package/lib-mjs/modelApi/domUtils/readFile.js.map +1 -0
  510. package/lib-mjs/modelApi/entity/insertEntityModel.d.ts +5 -0
  511. package/lib-mjs/modelApi/entity/insertEntityModel.js +72 -0
  512. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -0
  513. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +5 -0
  514. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +55 -0
  515. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -0
  516. package/lib-mjs/modelApi/list/findListItemsInSameThread.d.ts +5 -0
  517. package/lib-mjs/modelApi/list/findListItemsInSameThread.js +109 -0
  518. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -0
  519. package/lib-mjs/modelApi/list/setListType.d.ts +5 -0
  520. package/lib-mjs/modelApi/list/setListType.js +88 -0
  521. package/lib-mjs/modelApi/list/setListType.js.map +1 -0
  522. package/lib-mjs/modelApi/selection/adjustSegmentSelection.d.ts +5 -0
  523. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js +44 -0
  524. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -0
  525. package/lib-mjs/modelApi/selection/adjustWordSelection.d.ts +5 -0
  526. package/lib-mjs/modelApi/selection/adjustWordSelection.js +118 -0
  527. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -0
  528. package/lib-mjs/modelApi/selection/collapseTableSelection.d.ts +6 -0
  529. package/lib-mjs/modelApi/selection/collapseTableSelection.js +13 -0
  530. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -0
  531. package/lib-mjs/modelApi/table/alignTable.d.ts +5 -0
  532. package/lib-mjs/modelApi/table/alignTable.js +9 -0
  533. package/lib-mjs/modelApi/table/alignTable.js.map +1 -0
  534. package/lib-mjs/modelApi/table/alignTableCell.d.ts +9 -0
  535. package/lib-mjs/modelApi/table/alignTableCell.js +55 -0
  536. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -0
  537. package/lib-mjs/modelApi/table/canMergeCells.d.ts +5 -0
  538. package/lib-mjs/modelApi/table/canMergeCells.js +53 -0
  539. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -0
  540. package/lib-mjs/modelApi/table/createTableStructure.d.ts +5 -0
  541. package/lib-mjs/modelApi/table/createTableStructure.js +16 -0
  542. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -0
  543. package/lib-mjs/modelApi/table/deleteTable.d.ts +5 -0
  544. package/lib-mjs/modelApi/table/deleteTable.js +8 -0
  545. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -0
  546. package/lib-mjs/modelApi/table/deleteTableColumn.d.ts +5 -0
  547. package/lib-mjs/modelApi/table/deleteTableColumn.js +21 -0
  548. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -0
  549. package/lib-mjs/modelApi/table/deleteTableRow.d.ts +5 -0
  550. package/lib-mjs/modelApi/table/deleteTableRow.js +20 -0
  551. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -0
  552. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.d.ts +8 -0
  553. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js +53 -0
  554. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -0
  555. package/lib-mjs/modelApi/table/getSelectedCells.d.ts +14 -0
  556. package/lib-mjs/modelApi/table/getSelectedCells.js +28 -0
  557. package/lib-mjs/modelApi/table/getSelectedCells.js.map +1 -0
  558. package/lib-mjs/modelApi/table/insertTableColumn.d.ts +5 -0
  559. package/lib-mjs/modelApi/table/insertTableColumn.js +19 -0
  560. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -0
  561. package/lib-mjs/modelApi/table/insertTableRow.d.ts +5 -0
  562. package/lib-mjs/modelApi/table/insertTableRow.js +23 -0
  563. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -0
  564. package/lib-mjs/modelApi/table/mergeTableCells.d.ts +5 -0
  565. package/lib-mjs/modelApi/table/mergeTableCells.js +22 -0
  566. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -0
  567. package/lib-mjs/modelApi/table/mergeTableColumn.d.ts +5 -0
  568. package/lib-mjs/modelApi/table/mergeTableColumn.js +34 -0
  569. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -0
  570. package/lib-mjs/modelApi/table/mergeTableRow.d.ts +5 -0
  571. package/lib-mjs/modelApi/table/mergeTableRow.js +35 -0
  572. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -0
  573. package/lib-mjs/modelApi/table/splitTableCellHorizontally.d.ts +5 -0
  574. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js +51 -0
  575. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -0
  576. package/lib-mjs/modelApi/table/splitTableCellVertically.d.ts +5 -0
  577. package/lib-mjs/modelApi/table/splitTableCellVertically.js +52 -0
  578. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -0
  579. package/lib-mjs/publicApi/block/setAlignment.d.ts +7 -0
  580. package/lib-mjs/publicApi/block/setAlignment.js +13 -0
  581. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -0
  582. package/lib-mjs/publicApi/block/setDirection.d.ts +7 -0
  583. package/lib-mjs/publicApi/block/setDirection.js +13 -0
  584. package/lib-mjs/publicApi/block/setDirection.js.map +1 -0
  585. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +7 -0
  586. package/lib-mjs/publicApi/block/setHeadingLevel.js +47 -0
  587. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -0
  588. package/lib-mjs/publicApi/block/setIndentation.d.ts +8 -0
  589. package/lib-mjs/publicApi/block/setIndentation.js +22 -0
  590. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -0
  591. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +9 -0
  592. package/lib-mjs/publicApi/block/setParagraphMargin.js +30 -0
  593. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -0
  594. package/lib-mjs/publicApi/block/setSpacing.d.ts +7 -0
  595. package/lib-mjs/publicApi/block/setSpacing.js +18 -0
  596. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -0
  597. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +9 -0
  598. package/lib-mjs/publicApi/block/toggleBlockQuote.js +32 -0
  599. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -0
  600. package/lib-mjs/publicApi/entity/insertEntity.d.ts +25 -0
  601. package/lib-mjs/publicApi/entity/insertEntity.js +38 -0
  602. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -0
  603. package/lib-mjs/publicApi/format/clearFormat.d.ts +6 -0
  604. package/lib-mjs/publicApi/format/clearFormat.js +20 -0
  605. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -0
  606. package/lib-mjs/publicApi/format/getFormatState.d.ts +26 -0
  607. package/lib-mjs/publicApi/format/getFormatState.js +78 -0
  608. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -0
  609. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +6 -0
  610. package/lib-mjs/publicApi/image/adjustImageSelection.js +23 -0
  611. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -0
  612. package/lib-mjs/publicApi/image/changeImage.d.ts +7 -0
  613. package/lib-mjs/publicApi/image/changeImage.js +33 -0
  614. package/lib-mjs/publicApi/image/changeImage.js.map +1 -0
  615. package/lib-mjs/publicApi/image/insertImage.d.ts +7 -0
  616. package/lib-mjs/publicApi/image/insertImage.js +35 -0
  617. package/lib-mjs/publicApi/image/insertImage.js.map +1 -0
  618. package/lib-mjs/publicApi/image/setImageAltText.d.ts +8 -0
  619. package/lib-mjs/publicApi/image/setImageAltText.js +14 -0
  620. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -0
  621. package/lib-mjs/publicApi/image/setImageBorder.d.ts +9 -0
  622. package/lib-mjs/publicApi/image/setImageBorder.js +16 -0
  623. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -0
  624. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +8 -0
  625. package/lib-mjs/publicApi/image/setImageBoxShadow.js +26 -0
  626. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -0
  627. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +6 -0
  628. package/lib-mjs/publicApi/link/adjustLinkSelection.js +31 -0
  629. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -0
  630. package/lib-mjs/publicApi/link/insertLink.d.ts +15 -0
  631. package/lib-mjs/publicApi/link/insertLink.js +124 -0
  632. package/lib-mjs/publicApi/link/insertLink.js.map +1 -0
  633. package/lib-mjs/publicApi/link/removeLink.d.ts +8 -0
  634. package/lib-mjs/publicApi/link/removeLink.js +29 -0
  635. package/lib-mjs/publicApi/link/removeLink.js.map +1 -0
  636. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +7 -0
  637. package/lib-mjs/publicApi/list/setListStartNumber.js +23 -0
  638. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -0
  639. package/lib-mjs/publicApi/list/setListStyle.d.ts +7 -0
  640. package/lib-mjs/publicApi/list/setListStyle.js +30 -0
  641. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -0
  642. package/lib-mjs/publicApi/list/toggleBullet.d.ts +8 -0
  643. package/lib-mjs/publicApi/list/toggleBullet.js +17 -0
  644. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -0
  645. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +8 -0
  646. package/lib-mjs/publicApi/list/toggleNumbering.js +17 -0
  647. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -0
  648. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +7 -0
  649. package/lib-mjs/publicApi/segment/applySegmentFormat.js +20 -0
  650. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -0
  651. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +10 -0
  652. package/lib-mjs/publicApi/segment/changeCapitalization.js +47 -0
  653. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -0
  654. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +8 -0
  655. package/lib-mjs/publicApi/segment/changeFontSize.js +59 -0
  656. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -0
  657. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +7 -0
  658. package/lib-mjs/publicApi/segment/setBackgroundColor.js +33 -0
  659. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -0
  660. package/lib-mjs/publicApi/segment/setFontName.d.ts +7 -0
  661. package/lib-mjs/publicApi/segment/setFontName.js +16 -0
  662. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -0
  663. package/lib-mjs/publicApi/segment/setFontSize.d.ts +12 -0
  664. package/lib-mjs/publicApi/segment/setFontSize.js +29 -0
  665. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -0
  666. package/lib-mjs/publicApi/segment/setTextColor.d.ts +7 -0
  667. package/lib-mjs/publicApi/segment/setTextColor.js +23 -0
  668. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -0
  669. package/lib-mjs/publicApi/segment/toggleBold.d.ts +10 -0
  670. package/lib-mjs/publicApi/segment/toggleBold.js +23 -0
  671. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -0
  672. package/lib-mjs/publicApi/segment/toggleCode.d.ts +6 -0
  673. package/lib-mjs/publicApi/segment/toggleCode.js +25 -0
  674. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -0
  675. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +6 -0
  676. package/lib-mjs/publicApi/segment/toggleItalic.js +12 -0
  677. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -0
  678. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +6 -0
  679. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +12 -0
  680. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -0
  681. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +6 -0
  682. package/lib-mjs/publicApi/segment/toggleSubscript.js +12 -0
  683. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -0
  684. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +6 -0
  685. package/lib-mjs/publicApi/segment/toggleSuperscript.js +12 -0
  686. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -0
  687. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +6 -0
  688. package/lib-mjs/publicApi/segment/toggleUnderline.js +15 -0
  689. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -0
  690. package/lib-mjs/publicApi/selection/hasSelectionInBlock.d.ts +6 -0
  691. package/lib-mjs/publicApi/selection/hasSelectionInBlock.js +22 -0
  692. package/lib-mjs/publicApi/selection/hasSelectionInBlock.js.map +1 -0
  693. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.d.ts +6 -0
  694. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js +15 -0
  695. package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js.map +1 -0
  696. package/lib-mjs/publicApi/selection/hasSelectionInSegment.d.ts +6 -0
  697. package/lib-mjs/publicApi/selection/hasSelectionInSegment.js +10 -0
  698. package/lib-mjs/publicApi/selection/hasSelectionInSegment.js.map +1 -0
  699. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +8 -0
  700. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +290 -0
  701. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -0
  702. package/lib-mjs/publicApi/table/editTable.d.ts +7 -0
  703. package/lib-mjs/publicApi/table/editTable.js +101 -0
  704. package/lib-mjs/publicApi/table/editTable.js.map +1 -0
  705. package/lib-mjs/publicApi/table/formatTable.d.ts +8 -0
  706. package/lib-mjs/publicApi/table/formatTable.js +35 -0
  707. package/lib-mjs/publicApi/table/formatTable.js.map +1 -0
  708. package/lib-mjs/publicApi/table/insertTable.d.ts +11 -0
  709. package/lib-mjs/publicApi/table/insertTable.js +44 -0
  710. package/lib-mjs/publicApi/table/insertTable.js.map +1 -0
  711. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +7 -0
  712. package/lib-mjs/publicApi/table/setTableCellShade.js +31 -0
  713. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -0
  714. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -0
  715. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +12 -0
  716. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -0
  717. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +5 -0
  718. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +15 -0
  719. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -0
  720. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +5 -0
  721. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +48 -0
  722. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -0
  723. package/package.json +21 -0
@@ -0,0 +1,39 @@
1
+ define(["require", "exports", "./canMergeCells", "./getSelectedCells"], function (require, exports, canMergeCells_1, getSelectedCells_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.mergeTableRow = void 0;
5
+ /**
6
+ * @internal
7
+ */
8
+ function mergeTableRow(table, operation) {
9
+ var _a, _b, _c;
10
+ var sel = (0, getSelectedCells_1.getSelectedCells)(table);
11
+ var mergeAbove = operation == 'mergeAbove';
12
+ if (sel) {
13
+ var mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;
14
+ if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {
15
+ for (var colIndex = sel.firstCol; colIndex <= sel.lastCol; colIndex++) {
16
+ var cell = table.rows[mergingRowIndex].cells[colIndex];
17
+ if (cell &&
18
+ (0, canMergeCells_1.canMergeCells)(table.rows, mergingRowIndex - 1, colIndex, mergingRowIndex, colIndex)) {
19
+ cell.spanAbove = true;
20
+ var newSelectedRow = mergingRowIndex;
21
+ while ((_b = (_a = table.rows[newSelectedRow]) === null || _a === void 0 ? void 0 : _a.cells[colIndex]) === null || _b === void 0 ? void 0 : _b.spanAbove) {
22
+ delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
23
+ delete table.rows[newSelectedRow].cachedElement;
24
+ newSelectedRow--;
25
+ }
26
+ if ((_c = table.rows[newSelectedRow]) === null || _c === void 0 ? void 0 : _c.cells[colIndex]) {
27
+ table.rows[newSelectedRow].cells[colIndex].isSelected = true;
28
+ delete table.rows[newSelectedRow].cells[colIndex].cachedElement;
29
+ delete table.rows[newSelectedRow].cachedElement;
30
+ }
31
+ delete cell.cachedElement;
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ exports.mergeTableRow = mergeTableRow;
38
+ });
39
+ //# sourceMappingURL=mergeTableRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeTableRow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/mergeTableRow.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,SAAsC;;QAC1F,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;QACpC,IAAM,UAAU,GAAG,SAAS,IAAI,YAAY,CAAC;QAE7C,IAAI,GAAG,EAAE;YACL,IAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC;YAEpE,IAAI,eAAe,GAAG,CAAC,IAAI,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE;gBAC5D,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;oBACnE,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAEzD,IACI,IAAI;wBACJ,IAAA,6BAAa,EACT,KAAK,CAAC,IAAI,EACV,eAAe,GAAG,CAAC,EACnB,QAAQ,EACR,eAAe,EACf,QAAQ,CACX,EACH;wBACE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;wBAEtB,IAAI,cAAc,GAAG,eAAe,CAAC;wBAErC,OAAO,MAAA,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,0CAAE,SAAS,EAAE;4BAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;4BAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;4BAChD,cAAc,EAAE,CAAC;yBACpB;wBAED,IAAI,MAAA,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,0CAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;4BAC7C,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;4BAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;4BAChE,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;yBACnD;wBAED,OAAO,IAAI,CAAC,aAAa,CAAC;qBAC7B;iBACJ;aACJ;SACJ;IACL,CAAC;IA3CD,sCA2CC","sourcesContent":["import { canMergeCells } from './canMergeCells';\nimport { getSelectedCells } from './getSelectedCells';\nimport type { ContentModelTable, TableVerticalMergeOperation } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function mergeTableRow(table: ContentModelTable, operation: TableVerticalMergeOperation) {\n const sel = getSelectedCells(table);\n const mergeAbove = operation == 'mergeAbove';\n\n if (sel) {\n const mergingRowIndex = mergeAbove ? sel.firstRow : sel.lastRow + 1;\n\n if (mergingRowIndex > 0 && mergingRowIndex < table.rows.length) {\n for (let colIndex = sel.firstCol; colIndex <= sel.lastCol; colIndex++) {\n const cell = table.rows[mergingRowIndex].cells[colIndex];\n\n if (\n cell &&\n canMergeCells(\n table.rows,\n mergingRowIndex - 1,\n colIndex,\n mergingRowIndex,\n colIndex\n )\n ) {\n cell.spanAbove = true;\n\n let newSelectedRow = mergingRowIndex;\n\n while (table.rows[newSelectedRow]?.cells[colIndex]?.spanAbove) {\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n newSelectedRow--;\n }\n\n if (table.rows[newSelectedRow]?.cells[colIndex]) {\n table.rows[newSelectedRow].cells[colIndex].isSelected = true;\n\n delete table.rows[newSelectedRow].cells[colIndex].cachedElement;\n delete table.rows[newSelectedRow].cachedElement;\n }\n\n delete cell.cachedElement;\n }\n }\n }\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ContentModelTable } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function splitTableCellHorizontally(table: ContentModelTable): void;
@@ -0,0 +1,54 @@
1
+ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "./getSelectedCells"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, getSelectedCells_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.splitTableCellHorizontally = void 0;
5
+ var MIN_WIDTH = 30;
6
+ /**
7
+ * @internal
8
+ */
9
+ function splitTableCellHorizontally(table) {
10
+ var sel = (0, getSelectedCells_1.getSelectedCells)(table);
11
+ if (sel) {
12
+ var _loop_1 = function (colIndex) {
13
+ if (table.rows.every(function (row, rowIndex) {
14
+ var _a;
15
+ return rowIndex < sel.firstRow ||
16
+ rowIndex > sel.lastRow ||
17
+ ((_a = row.cells[colIndex + 1]) === null || _a === void 0 ? void 0 : _a.spanLeft);
18
+ })) {
19
+ table.rows.forEach(function (row, rowIndex) {
20
+ delete row.cells[colIndex].cachedElement;
21
+ if (rowIndex >= sel.firstRow && rowIndex <= sel.lastRow) {
22
+ row.cells[colIndex + 1].spanLeft = false;
23
+ delete row.cells[colIndex + 1].cachedElement;
24
+ }
25
+ });
26
+ }
27
+ else {
28
+ table.rows.forEach(function (row, rowIndex) {
29
+ var cell = row.cells[colIndex];
30
+ if (cell) {
31
+ var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format);
32
+ newCell.dataset = (0, tslib_1.__assign)({}, cell.dataset);
33
+ if (rowIndex < sel.firstRow || rowIndex > sel.lastRow) {
34
+ newCell.spanLeft = true;
35
+ }
36
+ else {
37
+ newCell.isSelected = cell.isSelected;
38
+ }
39
+ row.cells.splice(colIndex + 1, 0, newCell);
40
+ delete row.cells[colIndex].cachedElement;
41
+ }
42
+ });
43
+ var newWidth = Math.max(table.widths[colIndex] / 2, MIN_WIDTH);
44
+ table.widths.splice(colIndex, 1, newWidth, newWidth);
45
+ }
46
+ };
47
+ for (var colIndex = sel.lastCol; colIndex >= sel.firstCol; colIndex--) {
48
+ _loop_1(colIndex);
49
+ }
50
+ }
51
+ }
52
+ exports.splitTableCellHorizontally = splitTableCellHorizontally;
53
+ });
54
+ //# sourceMappingURL=splitTableCellHorizontally.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitTableCellHorizontally.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/splitTableCellHorizontally.ts"],"names":[],"mappings":";;;;IAIA,IAAM,SAAS,GAAG,EAAE,CAAC;IAErB;;OAEG;IACH,SAAgB,0BAA0B,CAAC,KAAwB;QAC/D,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;oCACI,QAAQ;gBACb,IACI,KAAK,CAAC,IAAI,CAAC,KAAK,CACZ,UAAC,GAAG,EAAE,QAAQ;;oBACV,OAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ;wBACvB,QAAQ,GAAG,GAAG,CAAC,OAAO;yBACtB,MAAA,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,0CAAE,QAAQ,CAAA,CAAA;iBAAA,CACxC,EACH;oBACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;wBAC7B,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;wBAEzC,IAAI,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE;4BACrD,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,KAAK,CAAC;4BACzC,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC;yBAChD;oBACL,CAAC,CAAC,CAAC;iBACN;qBAAM;oBACH,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG,EAAE,QAAQ;wBAC7B,IAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;wBACjC,IAAI,IAAI,EAAE;4BACN,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;4BAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;4BAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE;gCACnD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;6BAC3B;iCAAM;gCACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;6BACxC;4BACD,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;4BAE3C,OAAO,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;yBAC5C;oBACL,CAAC,CAAC,CAAC;oBAEH,IAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;oBAEjE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBACxD;;YA5CL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE;wBAA5D,QAAQ;aA6ChB;SACJ;IACL,CAAC;IAnDD,gEAmDC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from './getSelectedCells';\nimport type { ContentModelTable } from 'roosterjs-content-model-types';\n\nconst MIN_WIDTH = 30;\n\n/**\n * @internal\n */\nexport function splitTableCellHorizontally(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n for (let colIndex = sel.lastCol; colIndex >= sel.firstCol; colIndex--) {\n if (\n table.rows.every(\n (row, rowIndex) =>\n rowIndex < sel.firstRow ||\n rowIndex > sel.lastRow ||\n row.cells[colIndex + 1]?.spanLeft\n )\n ) {\n table.rows.forEach((row, rowIndex) => {\n delete row.cells[colIndex].cachedElement;\n\n if (rowIndex >= sel.firstRow && rowIndex <= sel.lastRow) {\n row.cells[colIndex + 1].spanLeft = false;\n delete row.cells[colIndex + 1].cachedElement;\n }\n });\n } else {\n table.rows.forEach((row, rowIndex) => {\n const cell = row.cells[colIndex];\n if (cell) {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format\n );\n\n newCell.dataset = { ...cell.dataset };\n\n if (rowIndex < sel.firstRow || rowIndex > sel.lastRow) {\n newCell.spanLeft = true;\n } else {\n newCell.isSelected = cell.isSelected;\n }\n row.cells.splice(colIndex + 1, 0, newCell);\n\n delete row.cells[colIndex].cachedElement;\n }\n });\n\n const newWidth = Math.max(table.widths[colIndex] / 2, MIN_WIDTH);\n\n table.widths.splice(colIndex, 1, newWidth, newWidth);\n }\n }\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ContentModelTable } from 'roosterjs-content-model-types';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function splitTableCellVertically(table: ContentModelTable): void;
@@ -0,0 +1,55 @@
1
+ define(["require", "exports", "tslib", "roosterjs-content-model-dom", "./getSelectedCells"], function (require, exports, tslib_1, roosterjs_content_model_dom_1, getSelectedCells_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.splitTableCellVertically = void 0;
5
+ var MIN_HEIGHT = 22;
6
+ /**
7
+ * @internal
8
+ */
9
+ function splitTableCellVertically(table) {
10
+ var sel = (0, getSelectedCells_1.getSelectedCells)(table);
11
+ if (sel) {
12
+ for (var rowIndex = sel.lastRow; rowIndex >= sel.firstRow; rowIndex--) {
13
+ var row = table.rows[rowIndex];
14
+ var belowRow = table.rows[rowIndex + 1];
15
+ row.cells.forEach(function (cell) {
16
+ delete cell.cachedElement;
17
+ });
18
+ delete row.cachedElement;
19
+ if (belowRow === null || belowRow === void 0 ? void 0 : belowRow.cells.every(function (belowCell, colIndex) {
20
+ return colIndex < sel.firstCol || colIndex > sel.lastCol || belowCell.spanAbove;
21
+ })) {
22
+ belowRow.cells.forEach(function (belowCell, colIndex) {
23
+ if (colIndex >= sel.firstCol && colIndex <= sel.lastCol) {
24
+ belowCell.spanAbove = false;
25
+ delete belowCell.cachedElement;
26
+ }
27
+ });
28
+ delete belowRow.cachedElement;
29
+ }
30
+ else {
31
+ var newHeight = Math.max((row.height /= 2), MIN_HEIGHT);
32
+ var newRow = {
33
+ format: (0, tslib_1.__assign)({}, row.format),
34
+ height: newHeight,
35
+ cells: row.cells.map(function (cell, colIndex) {
36
+ var newCell = (0, roosterjs_content_model_dom_1.createTableCell)(cell.spanLeft, cell.spanAbove, cell.isHeader, cell.format);
37
+ newCell.dataset = (0, tslib_1.__assign)({}, cell.dataset);
38
+ if (colIndex < sel.firstCol || colIndex > sel.lastCol) {
39
+ newCell.spanAbove = true;
40
+ }
41
+ else {
42
+ newCell.isSelected = cell.isSelected;
43
+ }
44
+ return newCell;
45
+ }),
46
+ };
47
+ row.height = newHeight;
48
+ table.rows.splice(rowIndex + 1, 0, newRow);
49
+ }
50
+ }
51
+ }
52
+ }
53
+ exports.splitTableCellVertically = splitTableCellVertically;
54
+ });
55
+ //# sourceMappingURL=splitTableCellVertically.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitTableCellVertically.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/modelApi/table/splitTableCellVertically.ts"],"names":[],"mappings":";;;;IAIA,IAAM,UAAU,GAAG,EAAE,CAAC;IAEtB;;OAEG;IACH,SAAgB,wBAAwB,CAAC,KAAwB;QAC7D,IAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,GAAG,EAAE;YACL,KAAK,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;gBACnE,IAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjC,IAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;gBAE1C,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;oBAClB,OAAO,IAAI,CAAC,aAAa,CAAC;gBAC9B,CAAC,CAAC,CAAC;gBAEH,OAAO,GAAG,CAAC,aAAa,CAAC;gBAEzB,IACI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,CAAC,KAAK,CACjB,UAAC,SAAS,EAAE,QAAQ;oBAChB,OAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC,SAAS;gBAAxE,CAAwE,CAC/E,EACH;oBACE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,UAAC,SAAS,EAAE,QAAQ;wBACvC,IAAI,QAAQ,IAAI,GAAG,CAAC,QAAQ,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,EAAE;4BACrD,SAAS,CAAC,SAAS,GAAG,KAAK,CAAC;4BAC5B,OAAO,SAAS,CAAC,aAAa,CAAC;yBAClC;oBACL,CAAC,CAAC,CAAC;oBAEH,OAAO,QAAQ,CAAC,aAAa,CAAC;iBACjC;qBAAM;oBACH,IAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;oBAC1D,IAAM,MAAM,GAAyB;wBACjC,MAAM,4BAAO,GAAG,CAAC,MAAM,CAAE;wBACzB,MAAM,EAAE,SAAS;wBACjB,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,QAAQ;4BAChC,IAAM,OAAO,GAAG,IAAA,6CAAe,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACd,CAAC;4BAEF,OAAO,CAAC,OAAO,6BAAQ,IAAI,CAAC,OAAO,CAAE,CAAC;4BAEtC,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE;gCACnD,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;6BAC5B;iCAAM;gCACH,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;6BACxC;4BAED,OAAO,OAAO,CAAC;wBACnB,CAAC,CAAC;qBACL,CAAC;oBAEF,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC;oBACvB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;iBAC9C;aACJ;SACJ;IACL,CAAC;IA1DD,4DA0DC","sourcesContent":["import { createTableCell } from 'roosterjs-content-model-dom';\nimport { getSelectedCells } from './getSelectedCells';\nimport type { ContentModelTable, ContentModelTableRow } from 'roosterjs-content-model-types';\n\nconst MIN_HEIGHT = 22;\n\n/**\n * @internal\n */\nexport function splitTableCellVertically(table: ContentModelTable) {\n const sel = getSelectedCells(table);\n\n if (sel) {\n for (let rowIndex = sel.lastRow; rowIndex >= sel.firstRow; rowIndex--) {\n const row = table.rows[rowIndex];\n const belowRow = table.rows[rowIndex + 1];\n\n row.cells.forEach(cell => {\n delete cell.cachedElement;\n });\n\n delete row.cachedElement;\n\n if (\n belowRow?.cells.every(\n (belowCell, colIndex) =>\n colIndex < sel.firstCol || colIndex > sel.lastCol || belowCell.spanAbove\n )\n ) {\n belowRow.cells.forEach((belowCell, colIndex) => {\n if (colIndex >= sel.firstCol && colIndex <= sel.lastCol) {\n belowCell.spanAbove = false;\n delete belowCell.cachedElement;\n }\n });\n\n delete belowRow.cachedElement;\n } else {\n const newHeight = Math.max((row.height /= 2), MIN_HEIGHT);\n const newRow: ContentModelTableRow = {\n format: { ...row.format },\n height: newHeight,\n cells: row.cells.map((cell, colIndex) => {\n const newCell = createTableCell(\n cell.spanLeft,\n cell.spanAbove,\n cell.isHeader,\n cell.format\n );\n\n newCell.dataset = { ...cell.dataset };\n\n if (colIndex < sel.firstCol || colIndex > sel.lastCol) {\n newCell.spanAbove = true;\n } else {\n newCell.isSelected = cell.isSelected;\n }\n\n return newCell;\n }),\n };\n\n row.height = newHeight;\n table.rows.splice(rowIndex + 1, 0, newRow);\n }\n }\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Set text alignment of selected paragraphs
4
+ * @param editor The editor to set alignment
5
+ * @param alignment Alignment value: left, center or right
6
+ */
7
+ export default function setAlignment(editor: IStandaloneEditor, alignment: 'left' | 'center' | 'right'): void;
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "../../modelApi/block/setModelAlignment"], function (require, exports, setModelAlignment_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Set text alignment of selected paragraphs
6
+ * @param editor The editor to set alignment
7
+ * @param alignment Alignment value: left, center or right
8
+ */
9
+ function setAlignment(editor, alignment) {
10
+ editor.focus();
11
+ editor.formatContentModel(function (model) { return (0, setModelAlignment_1.setModelAlignment)(model, alignment); }, {
12
+ apiName: 'setAlignment',
13
+ });
14
+ }
15
+ exports.default = setAlignment;
16
+ });
17
+ //# sourceMappingURL=setAlignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setAlignment.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setAlignment.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,YAAY,CAChC,MAAyB,EACzB,SAAsC;QAEtC,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;YACpE,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;IACP,CAAC;IATD,+BASC","sourcesContent":["import { setModelAlignment } from '../../modelApi/block/setModelAlignment';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text alignment of selected paragraphs\n * @param editor The editor to set alignment\n * @param alignment Alignment value: left, center or right\n */\nexport default function setAlignment(\n editor: IStandaloneEditor,\n alignment: 'left' | 'center' | 'right'\n) {\n editor.focus();\n\n editor.formatContentModel(model => setModelAlignment(model, alignment), {\n apiName: 'setAlignment',\n });\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Set text direction of selected paragraphs (Left to right or Right to left)
4
+ * @param editor The editor to set alignment
5
+ * @param direction Direction value: ltr (Left to right) or rtl (Right to left)
6
+ */
7
+ export default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl'): void;
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "../../modelApi/block/setModelDirection"], function (require, exports, setModelDirection_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Set text direction of selected paragraphs (Left to right or Right to left)
6
+ * @param editor The editor to set alignment
7
+ * @param direction Direction value: ltr (Left to right) or rtl (Right to left)
8
+ */
9
+ function setDirection(editor, direction) {
10
+ editor.focus();
11
+ editor.formatContentModel(function (model) { return (0, setModelDirection_1.setModelDirection)(model, direction); }, {
12
+ apiName: 'setDirection',
13
+ });
14
+ }
15
+ exports.default = setDirection;
16
+ });
17
+ //# sourceMappingURL=setDirection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setDirection.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setDirection.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAyB,EAAE,SAAwB;QACpF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CAAC,UAAA,KAAK,IAAI,OAAA,IAAA,qCAAiB,EAAC,KAAK,EAAE,SAAS,CAAC,EAAnC,CAAmC,EAAE;YACpE,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;IACP,CAAC;IAND,+BAMC","sourcesContent":["import { setModelDirection } from '../../modelApi/block/setModelDirection';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text direction of selected paragraphs (Left to right or Right to left)\n * @param editor The editor to set alignment\n * @param direction Direction value: ltr (Left to right) or rtl (Right to left)\n */\nexport default function setDirection(editor: IStandaloneEditor, direction: 'ltr' | 'rtl') {\n editor.focus();\n\n editor.formatContentModel(model => setModelDirection(model, direction), {\n apiName: 'setDirection',\n });\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Set heading level of selected paragraphs
4
+ * @param editor The editor to set heading level to
5
+ * @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
6
+ */
7
+ export default function setHeadingLevel(editor: IStandaloneEditor, headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6): void;
@@ -0,0 +1,51 @@
1
+ define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var HeaderFontSizes = {
5
+ h1: '2em',
6
+ h2: '1.5em',
7
+ h3: '1.17em',
8
+ h4: '1em',
9
+ h5: '0.83em',
10
+ h6: '0.67em',
11
+ };
12
+ /**
13
+ * Set heading level of selected paragraphs
14
+ * @param editor The editor to set heading level to
15
+ * @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph
16
+ */
17
+ function setHeadingLevel(editor, headingLevel) {
18
+ editor.focus();
19
+ (0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setHeadingLevel', function (para) {
20
+ var tagName = headingLevel > 0
21
+ ? ('h' + headingLevel)
22
+ : getExistingHeadingTag(para.decorator);
23
+ if (headingLevel > 0) {
24
+ para.decorator = {
25
+ tagName: tagName,
26
+ format: tagName
27
+ ? {
28
+ fontWeight: 'bold',
29
+ fontSize: HeaderFontSizes[tagName],
30
+ }
31
+ : {},
32
+ };
33
+ // Remove existing formats since tags have default font size and weight
34
+ para.segments.forEach(function (segment) {
35
+ delete segment.format.fontSize;
36
+ delete segment.format.fontWeight;
37
+ });
38
+ }
39
+ else if (tagName) {
40
+ delete para.decorator;
41
+ }
42
+ });
43
+ }
44
+ exports.default = setHeadingLevel;
45
+ function getExistingHeadingTag(decorator) {
46
+ var tag = (decorator === null || decorator === void 0 ? void 0 : decorator.tagName) || '';
47
+ var level = parseInt(tag.substring(1));
48
+ return level >= 1 && level <= 6 ? tag : null;
49
+ }
50
+ });
51
+ //# sourceMappingURL=setHeadingLevel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setHeadingLevel.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setHeadingLevel.ts"],"names":[],"mappings":";;;IAQA,IAAM,eAAe,GAAqC;QACtD,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,OAAO;QACX,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;KACf,CAAC;IAEF;;;;OAIG;IACH,SAAwB,eAAe,CACnC,MAAyB,EACzB,YAAuC;QAEvC,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,iBAAiB,EAAE,UAAA,IAAI;YAC3D,IAAM,OAAO,GACT,YAAY,GAAG,CAAC;gBACZ,CAAC,CAAE,CAAC,GAAG,GAAG,YAAY,CAA6B;gBACnD,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAEhD,IAAI,YAAY,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,SAAS,GAAG;oBACb,OAAO,EAAE,OAAQ;oBACjB,MAAM,EAAE,OAAO;wBACX,CAAC,CAAC;4BACI,UAAU,EAAE,MAAM;4BAClB,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC;yBACrC;wBACH,CAAC,CAAC,EAAE;iBACX,CAAC;gBAEF,uEAAuE;gBACvE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;oBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;oBAC/B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;gBACrC,CAAC,CAAC,CAAC;aACN;iBAAM,IAAI,OAAO,EAAE;gBAChB,OAAO,IAAI,CAAC,SAAS,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAhCD,kCAgCC;IAED,SAAS,qBAAqB,CAC1B,SAA0C;QAE1C,IAAM,GAAG,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,EAAE,CAAC;QACrC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzC,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAE,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC;IACvE,CAAC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type {\n ContentModelParagraphDecorator,\n IStandaloneEditor,\n} from 'roosterjs-content-model-types';\n\ntype HeadingLevelTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nconst HeaderFontSizes: Record<HeadingLevelTags, string> = {\n h1: '2em',\n h2: '1.5em',\n h3: '1.17em',\n h4: '1em',\n h5: '0.83em',\n h6: '0.67em',\n};\n\n/**\n * Set heading level of selected paragraphs\n * @param editor The editor to set heading level to\n * @param headingLevel Level of heading, from 1 to 6. Set to 0 means set it back to a regular paragraph\n */\nexport default function setHeadingLevel(\n editor: IStandaloneEditor,\n headingLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6\n) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setHeadingLevel', para => {\n const tagName =\n headingLevel > 0\n ? (('h' + headingLevel) as HeadingLevelTags | null)\n : getExistingHeadingTag(para.decorator);\n\n if (headingLevel > 0) {\n para.decorator = {\n tagName: tagName!,\n format: tagName\n ? {\n fontWeight: 'bold',\n fontSize: HeaderFontSizes[tagName],\n }\n : {},\n };\n\n // Remove existing formats since tags have default font size and weight\n para.segments.forEach(segment => {\n delete segment.format.fontSize;\n delete segment.format.fontWeight;\n });\n } else if (tagName) {\n delete para.decorator;\n }\n });\n}\n\nfunction getExistingHeadingTag(\n decorator?: ContentModelParagraphDecorator\n): HeadingLevelTags | null {\n const tag = decorator?.tagName || '';\n const level = parseInt(tag.substring(1));\n\n return level >= 1 && level <= 6 ? (tag as HeadingLevelTags) : null;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Indent or outdent to selected paragraphs
4
+ * @param editor The editor to operate on
5
+ * @param indentation Whether indent or outdent
6
+ * @param length The length of pixel to indent/outdent @default 40
7
+ */
8
+ export default function setIndentation(editor: IStandaloneEditor, indentation: 'indent' | 'outdent', length?: number): void;
@@ -0,0 +1,25 @@
1
+ define(["require", "exports", "roosterjs-content-model-dom", "../../modelApi/block/setModelIndentation"], function (require, exports, roosterjs_content_model_dom_1, setModelIndentation_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Indent or outdent to selected paragraphs
6
+ * @param editor The editor to operate on
7
+ * @param indentation Whether indent or outdent
8
+ * @param length The length of pixel to indent/outdent @default 40
9
+ */
10
+ function setIndentation(editor, indentation, length) {
11
+ editor.focus();
12
+ editor.formatContentModel(function (model, context) {
13
+ var result = (0, setModelIndentation_1.setModelIndentation)(model, indentation, length);
14
+ if (result) {
15
+ (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
16
+ }
17
+ context.newPendingFormat = 'preserve';
18
+ return result;
19
+ }, {
20
+ apiName: 'setIndentation',
21
+ });
22
+ }
23
+ exports.default = setIndentation;
24
+ });
25
+ //# sourceMappingURL=setIndentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setIndentation.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setIndentation.ts"],"names":[],"mappings":";;;IAIA;;;;;OAKG;IACH,SAAwB,cAAc,CAClC,MAAyB,EACzB,WAAiC,EACjC,MAAe;QAEf,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAM,MAAM,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;YAE/D,IAAI,MAAM,EAAE;gBACR,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;aAChC;YAED,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,MAAM,CAAC;QAClB,CAAC,EACD;YACI,OAAO,EAAE,gBAAgB;SAC5B,CACJ,CAAC;IACN,CAAC;IAvBD,iCAuBC","sourcesContent":["import { normalizeContentModel } from 'roosterjs-content-model-dom';\nimport { setModelIndentation } from '../../modelApi/block/setModelIndentation';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Indent or outdent to selected paragraphs\n * @param editor The editor to operate on\n * @param indentation Whether indent or outdent\n * @param length The length of pixel to indent/outdent @default 40\n */\nexport default function setIndentation(\n editor: IStandaloneEditor,\n indentation: 'indent' | 'outdent',\n length?: number\n) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n const result = setModelIndentation(model, indentation, length);\n\n if (result) {\n normalizeContentModel(model);\n }\n\n context.newPendingFormat = 'preserve';\n\n return result;\n },\n {\n apiName: 'setIndentation',\n }\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Toggles the current block(s) margin properties.
4
+ * null deletes any existing value, undefined is ignored
5
+ * @param editor The editor to operate on
6
+ * @param marginTop value for top margin
7
+ * @param marginBottom value for bottom margin
8
+ */
9
+ export default function setParagraphMargin(editor: IStandaloneEditor, marginTop?: string | null, marginBottom?: string | null): void;
@@ -0,0 +1,33 @@
1
+ define(["require", "exports", "roosterjs-content-model-dom", "../utils/formatParagraphWithContentModel"], function (require, exports, roosterjs_content_model_dom_1, formatParagraphWithContentModel_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Toggles the current block(s) margin properties.
6
+ * null deletes any existing value, undefined is ignored
7
+ * @param editor The editor to operate on
8
+ * @param marginTop value for top margin
9
+ * @param marginBottom value for bottom margin
10
+ */
11
+ function setParagraphMargin(editor, marginTop, marginBottom) {
12
+ editor.focus();
13
+ (0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setParagraphMargin', function (para) {
14
+ if (!para.decorator) {
15
+ para.decorator = (0, roosterjs_content_model_dom_1.createParagraphDecorator)('p');
16
+ }
17
+ if (marginTop) {
18
+ para.format.marginTop = marginTop;
19
+ }
20
+ else if (marginTop === null) {
21
+ delete para.format.marginTop;
22
+ }
23
+ if (marginBottom) {
24
+ para.format.marginBottom = marginBottom;
25
+ }
26
+ else if (marginBottom === null) {
27
+ delete para.format.marginBottom;
28
+ }
29
+ });
30
+ }
31
+ exports.default = setParagraphMargin;
32
+ });
33
+ //# sourceMappingURL=setParagraphMargin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setParagraphMargin.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setParagraphMargin.ts"],"names":[],"mappings":";;;IAIA;;;;;;OAMG;IACH,SAAwB,kBAAkB,CACtC,MAAyB,EACzB,SAAyB,EACzB,YAA4B;QAE5B,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,oBAAoB,EAAE,UAAA,IAAI;YAC9D,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACjB,IAAI,CAAC,SAAS,GAAG,IAAA,sDAAwB,EAAC,GAAG,CAAC,CAAC;aAClD;YAED,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;aACrC;iBAAM,IAAI,SAAS,KAAK,IAAI,EAAE;gBAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;aAChC;YAED,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;aAC3C;iBAAM,IAAI,YAAY,KAAK,IAAI,EAAE;gBAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;aACnC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAxBD,qCAwBC","sourcesContent":["import { createParagraphDecorator } from 'roosterjs-content-model-dom';\nimport { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggles the current block(s) margin properties.\n * null deletes any existing value, undefined is ignored\n * @param editor The editor to operate on\n * @param marginTop value for top margin\n * @param marginBottom value for bottom margin\n */\nexport default function setParagraphMargin(\n editor: IStandaloneEditor,\n marginTop?: string | null,\n marginBottom?: string | null\n) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setParagraphMargin', para => {\n if (!para.decorator) {\n para.decorator = createParagraphDecorator('p');\n }\n\n if (marginTop) {\n para.format.marginTop = marginTop;\n } else if (marginTop === null) {\n delete para.format.marginTop;\n }\n\n if (marginBottom) {\n para.format.marginBottom = marginBottom;\n } else if (marginBottom === null) {\n delete para.format.marginBottom;\n }\n });\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Sets current selected block(s) line-height property and wipes such property from child segments
4
+ * @param editor The editor to operate on
5
+ * @param spacing Unitless/px value to set line height
6
+ */
7
+ export default function setSpacing(editor: IStandaloneEditor, spacing: number | string): void;
@@ -0,0 +1,22 @@
1
+ define(["require", "exports", "../utils/formatParagraphWithContentModel"], function (require, exports, formatParagraphWithContentModel_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * Sets current selected block(s) line-height property and wipes such property from child segments
6
+ * @param editor The editor to operate on
7
+ * @param spacing Unitless/px value to set line height
8
+ */
9
+ function setSpacing(editor, spacing) {
10
+ editor.focus();
11
+ (0, formatParagraphWithContentModel_1.formatParagraphWithContentModel)(editor, 'setSpacing', function (paragraph) {
12
+ paragraph.format.lineHeight = spacing.toString();
13
+ paragraph.segments.forEach(function (segment) {
14
+ if (segment.format.lineHeight) {
15
+ delete segment.format.lineHeight;
16
+ }
17
+ });
18
+ });
19
+ }
20
+ exports.default = setSpacing;
21
+ });
22
+ //# sourceMappingURL=setSpacing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setSpacing.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/setSpacing.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,UAAU,CAAC,MAAyB,EAAE,OAAwB;QAClF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,iEAA+B,EAAC,MAAM,EAAE,YAAY,EAAE,UAAA,SAAS;YAC3D,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;YACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBAC9B,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;oBAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;iBACpC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAXD,6BAWC","sourcesContent":["import { formatParagraphWithContentModel } from '../utils/formatParagraphWithContentModel';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Sets current selected block(s) line-height property and wipes such property from child segments\n * @param editor The editor to operate on\n * @param spacing Unitless/px value to set line height\n */\nexport default function setSpacing(editor: IStandaloneEditor, spacing: number | string) {\n editor.focus();\n\n formatParagraphWithContentModel(editor, 'setSpacing', paragraph => {\n paragraph.format.lineHeight = spacing.toString();\n paragraph.segments.forEach(segment => {\n if (segment.format.lineHeight) {\n delete segment.format.lineHeight;\n }\n });\n });\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ContentModelFormatContainerFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Toggle BLOCKQUOTE state of selected paragraphs.
4
+ * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
5
+ * Otherwise, unwrap all related BLOCKQUOTEs.
6
+ * @param editor The editor object to toggle BLOCKQUOTE onto
7
+ * @param quoteFormat @optional Block format for the new quote object
8
+ */
9
+ export default function toggleBlockQuote(editor: IStandaloneEditor, quoteFormat?: ContentModelFormatContainerFormat): void;
@@ -0,0 +1,35 @@
1
+ define(["require", "exports", "tslib", "../../modelApi/block/toggleModelBlockQuote"], function (require, exports, tslib_1, toggleModelBlockQuote_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var DefaultQuoteFormat = {
5
+ borderLeft: '3px solid rgb(200, 200, 200)',
6
+ textColor: 'rgb(102, 102, 102)',
7
+ };
8
+ var BuildInQuoteFormat = {
9
+ marginTop: '1em',
10
+ marginBottom: '1em',
11
+ marginLeft: '40px',
12
+ marginRight: '40px',
13
+ paddingLeft: '10px',
14
+ };
15
+ /**
16
+ * Toggle BLOCKQUOTE state of selected paragraphs.
17
+ * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.
18
+ * Otherwise, unwrap all related BLOCKQUOTEs.
19
+ * @param editor The editor object to toggle BLOCKQUOTE onto
20
+ * @param quoteFormat @optional Block format for the new quote object
21
+ */
22
+ function toggleBlockQuote(editor, quoteFormat) {
23
+ if (quoteFormat === void 0) { quoteFormat = DefaultQuoteFormat; }
24
+ var fullQuoteFormat = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, BuildInQuoteFormat), quoteFormat);
25
+ editor.focus();
26
+ editor.formatContentModel(function (model, context) {
27
+ context.newPendingFormat = 'preserve';
28
+ return (0, toggleModelBlockQuote_1.toggleModelBlockQuote)(model, fullQuoteFormat);
29
+ }, {
30
+ apiName: 'toggleBlockQuote',
31
+ });
32
+ }
33
+ exports.default = toggleBlockQuote;
34
+ });
35
+ //# sourceMappingURL=toggleBlockQuote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggleBlockQuote.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/block/toggleBlockQuote.ts"],"names":[],"mappings":";;;IAMA,IAAM,kBAAkB,GAAsC;QAC1D,UAAU,EAAE,8BAA8B;QAC1C,SAAS,EAAE,oBAAoB;KAClC,CAAC;IACF,IAAM,kBAAkB,GAAsC;QAC1D,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,KAAK;QACnB,UAAU,EAAE,MAAM;QAClB,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,MAAM;KACtB,CAAC;IAEF;;;;;;OAMG;IACH,SAAwB,gBAAgB,CACpC,MAAyB,EACzB,WAAmE;QAAnE,4BAAA,EAAA,gCAAmE;QAEnE,IAAM,eAAe,mDACd,kBAAkB,GAClB,WAAW,CACjB,CAAC;QAEF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,6CAAqB,EAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QACzD,CAAC,EACD;YACI,OAAO,EAAE,kBAAkB;SAC9B,CACJ,CAAC;IACN,CAAC;IArBD,mCAqBC","sourcesContent":["import { toggleModelBlockQuote } from '../../modelApi/block/toggleModelBlockQuote';\nimport type {\n ContentModelFormatContainerFormat,\n IStandaloneEditor,\n} from 'roosterjs-content-model-types';\n\nconst DefaultQuoteFormat: ContentModelFormatContainerFormat = {\n borderLeft: '3px solid rgb(200, 200, 200)', // TODO: Support RTL\n textColor: 'rgb(102, 102, 102)',\n};\nconst BuildInQuoteFormat: ContentModelFormatContainerFormat = {\n marginTop: '1em',\n marginBottom: '1em',\n marginLeft: '40px',\n marginRight: '40px',\n paddingLeft: '10px',\n};\n\n/**\n * Toggle BLOCKQUOTE state of selected paragraphs.\n * If any selected paragraph is not under a BLOCKQUOTE, wrap them into a BLOCKQUOTE.\n * Otherwise, unwrap all related BLOCKQUOTEs.\n * @param editor The editor object to toggle BLOCKQUOTE onto\n * @param quoteFormat @optional Block format for the new quote object\n */\nexport default function toggleBlockQuote(\n editor: IStandaloneEditor,\n quoteFormat: ContentModelFormatContainerFormat = DefaultQuoteFormat\n) {\n const fullQuoteFormat = {\n ...BuildInQuoteFormat,\n ...quoteFormat,\n };\n\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return toggleModelBlockQuote(model, fullQuoteFormat);\n },\n {\n apiName: 'toggleBlockQuote',\n }\n );\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import type { ContentModelEntity, DOMSelection, InsertEntityPosition, InsertEntityOptions, IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Insert an entity into editor
4
+ * @param editor The Content Model editor
5
+ * @param type Type of entity
6
+ * @param isBlock True to insert a block entity, false to insert an inline entity
7
+ * @param position Position of the entity to insert. It can be
8
+ * Value of InsertEntityPosition: see InsertEntityPosition
9
+ * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
10
+ * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
11
+ * @param options Move options to insert. See InsertEntityOptions
12
+ */
13
+ export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: boolean, position: 'focus' | 'begin' | 'end' | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
14
+ /**
15
+ * Insert a block entity into editor
16
+ * @param editor The Content Model editor
17
+ * @param type Type of entity
18
+ * @param isBlock Must be true for a block entity
19
+ * @param position Position of the entity to insert. It can be
20
+ * Value of InsertEntityPosition: see InsertEntityPosition
21
+ * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to
22
+ * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)
23
+ * @param options Move options to insert. See InsertEntityOptions
24
+ */
25
+ export default function insertEntity(editor: IStandaloneEditor, type: string, isBlock: true, position: InsertEntityPosition | DOMSelection, options?: InsertEntityOptions): ContentModelEntity | null;
@@ -0,0 +1,40 @@
1
+ define(["require", "exports", "roosterjs-content-model-core", "roosterjs-content-model-dom", "../../modelApi/entity/insertEntityModel"], function (require, exports, roosterjs_content_model_core_1, roosterjs_content_model_dom_1, insertEntityModel_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var BlockEntityTag = 'div';
5
+ var InlineEntityTag = 'span';
6
+ function insertEntity(editor, type, isBlock, position, options) {
7
+ var _a = options || {}, contentNode = _a.contentNode, focusAfterEntity = _a.focusAfterEntity, wrapperDisplay = _a.wrapperDisplay, skipUndoSnapshot = _a.skipUndoSnapshot;
8
+ var wrapper = editor.getDocument().createElement(isBlock ? BlockEntityTag : InlineEntityTag);
9
+ var display = wrapperDisplay !== null && wrapperDisplay !== void 0 ? wrapperDisplay : (isBlock ? undefined : 'inline-block');
10
+ wrapper.style.setProperty('display', display || null);
11
+ if (contentNode) {
12
+ wrapper.appendChild(contentNode);
13
+ }
14
+ var entityModel = (0, roosterjs_content_model_dom_1.createEntity)(wrapper, true /*isReadonly*/, undefined /*format*/, type);
15
+ editor.formatContentModel(function (model, context) {
16
+ (0, insertEntityModel_1.insertEntityModel)(model, entityModel, typeof position == 'string' ? position : 'focus', isBlock, focusAfterEntity, context);
17
+ (0, roosterjs_content_model_dom_1.normalizeContentModel)(model);
18
+ context.skipUndoSnapshot = skipUndoSnapshot;
19
+ context.newEntities.push(entityModel);
20
+ return true;
21
+ }, {
22
+ selectionOverride: typeof position === 'object' ? position : undefined,
23
+ changeSource: roosterjs_content_model_core_1.ChangeSource.InsertEntity,
24
+ getChangeData: function () {
25
+ // TODO: Remove this entity when we have standalone editor
26
+ var entity = {
27
+ wrapper: wrapper,
28
+ type: type,
29
+ id: '',
30
+ isReadonly: true,
31
+ };
32
+ return entity;
33
+ },
34
+ apiName: 'insertEntity',
35
+ });
36
+ return entityModel;
37
+ }
38
+ exports.default = insertEntity;
39
+ });
40
+ //# sourceMappingURL=insertEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insertEntity.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/entity/insertEntity.ts"],"names":[],"mappings":";;;IAYA,IAAM,cAAc,GAAG,KAAK,CAAC;IAC7B,IAAM,eAAe,GAAG,MAAM,CAAC;IAwC/B,SAAwB,YAAY,CAChC,MAAyB,EACzB,IAAY,EACZ,OAAgB,EAChB,QAA8C,EAC9C,OAA6B;QAEvB,IAAA,KAAsE,OAAO,IAAI,EAAE,EAAjF,WAAW,iBAAA,EAAE,gBAAgB,sBAAA,EAAE,cAAc,oBAAA,EAAE,gBAAgB,sBAAkB,CAAC;QAC1F,IAAM,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QAC/F,IAAM,OAAO,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;QAEzE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,IAAI,IAAI,CAAC,CAAC;QAEtD,IAAI,WAAW,EAAE;YACb,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;SACpC;QAED,IAAM,WAAW,GAAG,IAAA,0CAAY,EAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAE3F,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAA,qCAAiB,EACb,KAAK,EACL,WAAW,EACX,OAAO,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAChD,OAAO,EACP,gBAAgB,EAChB,OAAO,CACV,CAAC;YAEF,IAAA,mDAAqB,EAAC,KAAK,CAAC,CAAC;YAE7B,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;YAC5C,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEtC,OAAO,IAAI,CAAC;QAChB,CAAC,EACD;YACI,iBAAiB,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACtE,YAAY,EAAE,2CAAY,CAAC,YAAY;YACvC,aAAa,EAAE;gBACX,0DAA0D;gBAC1D,IAAM,MAAM,GAAW;oBACnB,OAAO,SAAA;oBACP,IAAI,MAAA;oBACJ,EAAE,EAAE,EAAE;oBACN,UAAU,EAAE,IAAI;iBACnB,CAAC;gBAEF,OAAO,MAAM,CAAC;YAClB,CAAC;YACD,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;QAEF,OAAO,WAAW,CAAC;IACvB,CAAC;IAxDD,+BAwDC","sourcesContent":["import { ChangeSource } from 'roosterjs-content-model-core';\nimport { createEntity, normalizeContentModel } from 'roosterjs-content-model-dom';\nimport { insertEntityModel } from '../../modelApi/entity/insertEntityModel';\nimport type {\n ContentModelEntity,\n DOMSelection,\n InsertEntityPosition,\n InsertEntityOptions,\n IStandaloneEditor,\n} from 'roosterjs-content-model-types';\nimport type { Entity } from 'roosterjs-editor-types';\n\nconst BlockEntityTag = 'div';\nconst InlineEntityTag = 'span';\n\n/**\n * Insert an entity into editor\n * @param editor The Content Model editor\n * @param type Type of entity\n * @param isBlock True to insert a block entity, false to insert an inline entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport default function insertEntity(\n editor: IStandaloneEditor,\n type: string,\n isBlock: boolean,\n position: 'focus' | 'begin' | 'end' | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\n/**\n * Insert a block entity into editor\n * @param editor The Content Model editor\n * @param type Type of entity\n * @param isBlock Must be true for a block entity\n * @param position Position of the entity to insert. It can be\n * Value of InsertEntityPosition: see InsertEntityPosition\n * selectionRangeEx: Use this range instead of current focus position to insert. After insert, focus will be moved to\n * the beginning of this range (when focusAfterEntity is not set to true) or after the new entity (when focusAfterEntity is set to true)\n * @param options Move options to insert. See InsertEntityOptions\n */\nexport default function insertEntity(\n editor: IStandaloneEditor,\n type: string,\n isBlock: true,\n position: InsertEntityPosition | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null;\n\nexport default function insertEntity(\n editor: IStandaloneEditor,\n type: string,\n isBlock: boolean,\n position?: InsertEntityPosition | DOMSelection,\n options?: InsertEntityOptions\n): ContentModelEntity | null {\n const { contentNode, focusAfterEntity, wrapperDisplay, skipUndoSnapshot } = options || {};\n const wrapper = editor.getDocument().createElement(isBlock ? BlockEntityTag : InlineEntityTag);\n const display = wrapperDisplay ?? (isBlock ? undefined : 'inline-block');\n\n wrapper.style.setProperty('display', display || null);\n\n if (contentNode) {\n wrapper.appendChild(contentNode);\n }\n\n const entityModel = createEntity(wrapper, true /*isReadonly*/, undefined /*format*/, type);\n\n editor.formatContentModel(\n (model, context) => {\n insertEntityModel(\n model,\n entityModel,\n typeof position == 'string' ? position : 'focus',\n isBlock,\n focusAfterEntity,\n context\n );\n\n normalizeContentModel(model);\n\n context.skipUndoSnapshot = skipUndoSnapshot;\n context.newEntities.push(entityModel);\n\n return true;\n },\n {\n selectionOverride: typeof position === 'object' ? position : undefined,\n changeSource: ChangeSource.InsertEntity,\n getChangeData: () => {\n // TODO: Remove this entity when we have standalone editor\n const entity: Entity = {\n wrapper,\n type,\n id: '',\n isReadonly: true,\n };\n\n return entity;\n },\n apiName: 'insertEntity',\n }\n );\n\n return entityModel;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
2
+ /**
3
+ * Clear format of selection
4
+ * @param editor The editor to clear format from
5
+ */
6
+ export default function clearFormat(editor: IStandaloneEditor): void;