roosterjs-content-model-api 0.26.4 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (532) hide show
  1. package/lib/index.d.ts +46 -42
  2. package/lib/index.js +52 -43
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  5. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  6. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  7. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  8. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  9. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  10. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  11. package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  12. package/lib/modelApi/image/applyImageBorderFormat.js +2 -1
  13. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  14. package/lib/modelApi/link/matchLink.d.ts +1 -18
  15. package/lib/modelApi/link/matchLink.js +0 -1
  16. package/lib/modelApi/link/matchLink.js.map +1 -1
  17. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  18. package/lib/modelApi/list/setListType.d.ts +2 -1
  19. package/lib/modelApi/list/setListType.js +5 -3
  20. package/lib/modelApi/list/setListType.js.map +1 -1
  21. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  22. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  23. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  24. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  25. package/lib/modelApi/table/alignTable.js.map +1 -1
  26. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  27. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  28. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  29. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  30. package/lib/modelApi/table/deleteTable.js.map +1 -1
  31. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  32. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  33. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  34. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  35. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  36. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  37. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  38. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  39. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  40. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  41. package/lib/publicApi/block/setAlignment.d.ts +2 -2
  42. package/lib/publicApi/block/setAlignment.js +2 -1
  43. package/lib/publicApi/block/setAlignment.js.map +1 -1
  44. package/lib/publicApi/block/setDirection.d.ts +2 -2
  45. package/lib/publicApi/block/setDirection.js +2 -1
  46. package/lib/publicApi/block/setDirection.js.map +1 -1
  47. package/lib/publicApi/block/setHeadingLevel.d.ts +2 -2
  48. package/lib/publicApi/block/setHeadingLevel.js +2 -1
  49. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  50. package/lib/publicApi/block/setIndentation.d.ts +2 -2
  51. package/lib/publicApi/block/setIndentation.js +2 -1
  52. package/lib/publicApi/block/setIndentation.js.map +1 -1
  53. package/lib/publicApi/block/setParagraphMargin.d.ts +2 -2
  54. package/lib/publicApi/block/setParagraphMargin.js +2 -1
  55. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  56. package/lib/publicApi/block/setSpacing.d.ts +2 -2
  57. package/lib/publicApi/block/setSpacing.js +2 -1
  58. package/lib/publicApi/block/setSpacing.js.map +1 -1
  59. package/lib/publicApi/block/toggleBlockQuote.d.ts +2 -2
  60. package/lib/publicApi/block/toggleBlockQuote.js +2 -1
  61. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  62. package/lib/publicApi/entity/insertEntity.d.ts +5 -5
  63. package/lib/publicApi/entity/insertEntity.js +24 -4
  64. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  65. package/lib/publicApi/format/clearFormat.d.ts +2 -2
  66. package/lib/publicApi/format/clearFormat.js +2 -1
  67. package/lib/publicApi/format/clearFormat.js.map +1 -1
  68. package/lib/publicApi/format/getFormatState.d.ts +2 -2
  69. package/lib/publicApi/format/getFormatState.js +2 -1
  70. package/lib/publicApi/format/getFormatState.js.map +1 -1
  71. package/lib/publicApi/image/adjustImageSelection.d.ts +2 -2
  72. package/lib/publicApi/image/adjustImageSelection.js +2 -1
  73. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  74. package/lib/publicApi/image/changeImage.d.ts +2 -2
  75. package/lib/publicApi/image/changeImage.js +3 -2
  76. package/lib/publicApi/image/changeImage.js.map +1 -1
  77. package/lib/publicApi/image/insertImage.d.ts +2 -2
  78. package/lib/publicApi/image/insertImage.js +2 -1
  79. package/lib/publicApi/image/insertImage.js.map +1 -1
  80. package/lib/publicApi/image/setImageAltText.d.ts +2 -2
  81. package/lib/publicApi/image/setImageAltText.js +3 -2
  82. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  83. package/lib/publicApi/image/setImageBorder.d.ts +2 -2
  84. package/lib/publicApi/image/setImageBorder.js +4 -3
  85. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  86. package/lib/publicApi/image/setImageBoxShadow.d.ts +2 -2
  87. package/lib/publicApi/image/setImageBoxShadow.js +3 -2
  88. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  89. package/lib/publicApi/link/adjustLinkSelection.d.ts +2 -2
  90. package/lib/publicApi/link/adjustLinkSelection.js +2 -1
  91. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  92. package/lib/publicApi/link/insertLink.d.ts +2 -2
  93. package/lib/publicApi/link/insertLink.js +2 -1
  94. package/lib/publicApi/link/insertLink.js.map +1 -1
  95. package/lib/publicApi/link/removeLink.d.ts +2 -2
  96. package/lib/publicApi/link/removeLink.js +2 -1
  97. package/lib/publicApi/link/removeLink.js.map +1 -1
  98. package/lib/publicApi/list/setListStartNumber.d.ts +2 -2
  99. package/lib/publicApi/list/setListStartNumber.js +2 -1
  100. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  101. package/lib/publicApi/list/setListStyle.d.ts +2 -2
  102. package/lib/publicApi/list/setListStyle.js +2 -1
  103. package/lib/publicApi/list/setListStyle.js.map +1 -1
  104. package/lib/publicApi/list/toggleBullet.d.ts +3 -2
  105. package/lib/publicApi/list/toggleBullet.js +6 -3
  106. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  107. package/lib/publicApi/list/toggleNumbering.d.ts +3 -2
  108. package/lib/publicApi/list/toggleNumbering.js +6 -3
  109. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  110. package/lib/publicApi/segment/applySegmentFormat.d.ts +2 -2
  111. package/lib/publicApi/segment/applySegmentFormat.js +2 -1
  112. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  113. package/lib/publicApi/segment/changeCapitalization.d.ts +2 -2
  114. package/lib/publicApi/segment/changeCapitalization.js +2 -1
  115. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  116. package/lib/publicApi/segment/changeFontSize.d.ts +2 -2
  117. package/lib/publicApi/segment/changeFontSize.js +2 -1
  118. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  119. package/lib/publicApi/segment/setBackgroundColor.d.ts +2 -2
  120. package/lib/publicApi/segment/setBackgroundColor.js +2 -1
  121. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  122. package/lib/publicApi/segment/setFontName.d.ts +2 -2
  123. package/lib/publicApi/segment/setFontName.js +2 -1
  124. package/lib/publicApi/segment/setFontName.js.map +1 -1
  125. package/lib/publicApi/segment/setFontSize.d.ts +2 -2
  126. package/lib/publicApi/segment/setFontSize.js +2 -2
  127. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  128. package/lib/publicApi/segment/setTextColor.d.ts +2 -2
  129. package/lib/publicApi/segment/setTextColor.js +2 -1
  130. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  131. package/lib/publicApi/segment/toggleBold.d.ts +2 -2
  132. package/lib/publicApi/segment/toggleBold.js +2 -1
  133. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  134. package/lib/publicApi/segment/toggleCode.d.ts +2 -2
  135. package/lib/publicApi/segment/toggleCode.js +2 -1
  136. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  137. package/lib/publicApi/segment/toggleItalic.d.ts +2 -2
  138. package/lib/publicApi/segment/toggleItalic.js +2 -1
  139. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  140. package/lib/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  141. package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
  142. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  143. package/lib/publicApi/segment/toggleSubscript.d.ts +2 -2
  144. package/lib/publicApi/segment/toggleSubscript.js +2 -1
  145. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  146. package/lib/publicApi/segment/toggleSuperscript.d.ts +2 -2
  147. package/lib/publicApi/segment/toggleSuperscript.js +2 -1
  148. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  149. package/lib/publicApi/segment/toggleUnderline.d.ts +2 -2
  150. package/lib/publicApi/segment/toggleUnderline.js +2 -1
  151. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  152. package/lib/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  153. package/lib/publicApi/table/applyTableBorderFormat.js +2 -1
  154. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  155. package/lib/publicApi/table/editTable.d.ts +2 -2
  156. package/lib/publicApi/table/editTable.js +2 -1
  157. package/lib/publicApi/table/editTable.js.map +1 -1
  158. package/lib/publicApi/table/formatTable.d.ts +2 -2
  159. package/lib/publicApi/table/formatTable.js +2 -1
  160. package/lib/publicApi/table/formatTable.js.map +1 -1
  161. package/lib/publicApi/table/insertTable.d.ts +2 -2
  162. package/lib/publicApi/table/insertTable.js +2 -1
  163. package/lib/publicApi/table/insertTable.js.map +1 -1
  164. package/lib/publicApi/table/setTableCellShade.d.ts +2 -2
  165. package/lib/publicApi/table/setTableCellShade.js +2 -1
  166. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  167. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +6 -3
  168. package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
  169. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  170. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +6 -3
  171. package/lib/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  172. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  173. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +9 -3
  174. package/lib/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  175. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  176. package/lib/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  177. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  178. package/lib-amd/index.d.ts +46 -42
  179. package/lib-amd/index.js +48 -44
  180. package/lib-amd/index.js.map +1 -1
  181. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  182. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  183. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  184. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  185. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  186. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  187. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  188. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  189. package/lib-amd/modelApi/image/applyImageBorderFormat.js +2 -1
  190. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  191. package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
  192. package/lib-amd/modelApi/link/matchLink.js +0 -1
  193. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  194. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  195. package/lib-amd/modelApi/list/setListType.d.ts +2 -1
  196. package/lib-amd/modelApi/list/setListType.js +5 -3
  197. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  198. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  199. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  200. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  201. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  202. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  203. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  204. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  205. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  206. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  207. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  208. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  209. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  210. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  211. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  212. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  213. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  214. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  215. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  216. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  217. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  218. package/lib-amd/publicApi/block/setAlignment.d.ts +2 -2
  219. package/lib-amd/publicApi/block/setAlignment.js +2 -1
  220. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  221. package/lib-amd/publicApi/block/setDirection.d.ts +2 -2
  222. package/lib-amd/publicApi/block/setDirection.js +2 -1
  223. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  224. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +2 -2
  225. package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
  226. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  227. package/lib-amd/publicApi/block/setIndentation.d.ts +2 -2
  228. package/lib-amd/publicApi/block/setIndentation.js +2 -1
  229. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  230. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +2 -2
  231. package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
  232. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  233. package/lib-amd/publicApi/block/setSpacing.d.ts +2 -2
  234. package/lib-amd/publicApi/block/setSpacing.js +2 -1
  235. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  236. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +2 -2
  237. package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
  238. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  239. package/lib-amd/publicApi/entity/insertEntity.d.ts +5 -5
  240. package/lib-amd/publicApi/entity/insertEntity.js +24 -4
  241. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  242. package/lib-amd/publicApi/format/clearFormat.d.ts +2 -2
  243. package/lib-amd/publicApi/format/clearFormat.js +2 -1
  244. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  245. package/lib-amd/publicApi/format/getFormatState.d.ts +2 -2
  246. package/lib-amd/publicApi/format/getFormatState.js +2 -1
  247. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  248. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +2 -2
  249. package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
  250. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  251. package/lib-amd/publicApi/image/changeImage.d.ts +2 -2
  252. package/lib-amd/publicApi/image/changeImage.js +3 -2
  253. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  254. package/lib-amd/publicApi/image/insertImage.d.ts +2 -2
  255. package/lib-amd/publicApi/image/insertImage.js +2 -1
  256. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  257. package/lib-amd/publicApi/image/setImageAltText.d.ts +2 -2
  258. package/lib-amd/publicApi/image/setImageAltText.js +3 -2
  259. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  260. package/lib-amd/publicApi/image/setImageBorder.d.ts +2 -2
  261. package/lib-amd/publicApi/image/setImageBorder.js +4 -3
  262. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  263. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +2 -2
  264. package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
  265. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  266. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +2 -2
  267. package/lib-amd/publicApi/link/adjustLinkSelection.js +2 -1
  268. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  269. package/lib-amd/publicApi/link/insertLink.d.ts +2 -2
  270. package/lib-amd/publicApi/link/insertLink.js +2 -1
  271. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  272. package/lib-amd/publicApi/link/removeLink.d.ts +2 -2
  273. package/lib-amd/publicApi/link/removeLink.js +2 -1
  274. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  275. package/lib-amd/publicApi/list/setListStartNumber.d.ts +2 -2
  276. package/lib-amd/publicApi/list/setListStartNumber.js +2 -1
  277. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  278. package/lib-amd/publicApi/list/setListStyle.d.ts +2 -2
  279. package/lib-amd/publicApi/list/setListStyle.js +2 -1
  280. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  281. package/lib-amd/publicApi/list/toggleBullet.d.ts +3 -2
  282. package/lib-amd/publicApi/list/toggleBullet.js +6 -3
  283. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  284. package/lib-amd/publicApi/list/toggleNumbering.d.ts +3 -2
  285. package/lib-amd/publicApi/list/toggleNumbering.js +6 -3
  286. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  287. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +2 -2
  288. package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
  289. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  290. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +2 -2
  291. package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
  292. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  293. package/lib-amd/publicApi/segment/changeFontSize.d.ts +2 -2
  294. package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
  295. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  296. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +2 -2
  297. package/lib-amd/publicApi/segment/setBackgroundColor.js +2 -1
  298. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  299. package/lib-amd/publicApi/segment/setFontName.d.ts +2 -2
  300. package/lib-amd/publicApi/segment/setFontName.js +2 -1
  301. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  302. package/lib-amd/publicApi/segment/setFontSize.d.ts +2 -2
  303. package/lib-amd/publicApi/segment/setFontSize.js +2 -2
  304. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  305. package/lib-amd/publicApi/segment/setTextColor.d.ts +2 -2
  306. package/lib-amd/publicApi/segment/setTextColor.js +2 -1
  307. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  308. package/lib-amd/publicApi/segment/toggleBold.d.ts +2 -2
  309. package/lib-amd/publicApi/segment/toggleBold.js +2 -1
  310. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  311. package/lib-amd/publicApi/segment/toggleCode.d.ts +2 -2
  312. package/lib-amd/publicApi/segment/toggleCode.js +2 -1
  313. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  314. package/lib-amd/publicApi/segment/toggleItalic.d.ts +2 -2
  315. package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
  316. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  317. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  318. package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
  319. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  320. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +2 -2
  321. package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
  322. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  323. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +2 -2
  324. package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
  325. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  326. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +2 -2
  327. package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
  328. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  329. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  330. package/lib-amd/publicApi/table/applyTableBorderFormat.js +2 -1
  331. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  332. package/lib-amd/publicApi/table/editTable.d.ts +2 -2
  333. package/lib-amd/publicApi/table/editTable.js +2 -1
  334. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  335. package/lib-amd/publicApi/table/formatTable.d.ts +2 -2
  336. package/lib-amd/publicApi/table/formatTable.js +2 -1
  337. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  338. package/lib-amd/publicApi/table/insertTable.d.ts +2 -2
  339. package/lib-amd/publicApi/table/insertTable.js +2 -1
  340. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  341. package/lib-amd/publicApi/table/setTableCellShade.d.ts +2 -2
  342. package/lib-amd/publicApi/table/setTableCellShade.js +2 -1
  343. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  344. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +6 -3
  345. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
  346. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  347. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +6 -3
  348. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  349. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  350. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +9 -3
  351. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  352. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  353. package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  354. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  355. package/lib-mjs/index.d.ts +46 -42
  356. package/lib-mjs/index.js +46 -42
  357. package/lib-mjs/index.js.map +1 -1
  358. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  359. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  360. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  361. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  362. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  363. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  364. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  365. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  366. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +1 -1
  367. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  368. package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
  369. package/lib-mjs/modelApi/link/matchLink.js +0 -1
  370. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  371. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  372. package/lib-mjs/modelApi/list/setListType.d.ts +2 -1
  373. package/lib-mjs/modelApi/list/setListType.js +5 -3
  374. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  375. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  376. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  377. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  378. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  379. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  380. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  381. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  382. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  383. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  384. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  385. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  386. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  387. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  388. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  389. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  390. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  391. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  392. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  393. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  394. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  395. package/lib-mjs/publicApi/block/setAlignment.d.ts +2 -2
  396. package/lib-mjs/publicApi/block/setAlignment.js +1 -1
  397. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  398. package/lib-mjs/publicApi/block/setDirection.d.ts +2 -2
  399. package/lib-mjs/publicApi/block/setDirection.js +1 -1
  400. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  401. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +2 -2
  402. package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
  403. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  404. package/lib-mjs/publicApi/block/setIndentation.d.ts +2 -2
  405. package/lib-mjs/publicApi/block/setIndentation.js +1 -1
  406. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  407. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +2 -2
  408. package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
  409. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  410. package/lib-mjs/publicApi/block/setSpacing.d.ts +2 -2
  411. package/lib-mjs/publicApi/block/setSpacing.js +1 -1
  412. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  413. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +2 -2
  414. package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
  415. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  416. package/lib-mjs/publicApi/entity/insertEntity.d.ts +5 -5
  417. package/lib-mjs/publicApi/entity/insertEntity.js +23 -4
  418. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  419. package/lib-mjs/publicApi/format/clearFormat.d.ts +2 -2
  420. package/lib-mjs/publicApi/format/clearFormat.js +1 -1
  421. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  422. package/lib-mjs/publicApi/format/getFormatState.d.ts +2 -2
  423. package/lib-mjs/publicApi/format/getFormatState.js +1 -1
  424. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  425. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +2 -2
  426. package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
  427. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  428. package/lib-mjs/publicApi/image/changeImage.d.ts +2 -2
  429. package/lib-mjs/publicApi/image/changeImage.js +2 -2
  430. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  431. package/lib-mjs/publicApi/image/insertImage.d.ts +2 -2
  432. package/lib-mjs/publicApi/image/insertImage.js +1 -1
  433. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  434. package/lib-mjs/publicApi/image/setImageAltText.d.ts +2 -2
  435. package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
  436. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  437. package/lib-mjs/publicApi/image/setImageBorder.d.ts +2 -2
  438. package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
  439. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  440. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +2 -2
  441. package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
  442. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  443. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +2 -2
  444. package/lib-mjs/publicApi/link/adjustLinkSelection.js +1 -1
  445. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  446. package/lib-mjs/publicApi/link/insertLink.d.ts +2 -2
  447. package/lib-mjs/publicApi/link/insertLink.js +1 -1
  448. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  449. package/lib-mjs/publicApi/link/removeLink.d.ts +2 -2
  450. package/lib-mjs/publicApi/link/removeLink.js +1 -1
  451. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  452. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +2 -2
  453. package/lib-mjs/publicApi/list/setListStartNumber.js +1 -1
  454. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  455. package/lib-mjs/publicApi/list/setListStyle.d.ts +2 -2
  456. package/lib-mjs/publicApi/list/setListStyle.js +1 -1
  457. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  458. package/lib-mjs/publicApi/list/toggleBullet.d.ts +3 -2
  459. package/lib-mjs/publicApi/list/toggleBullet.js +4 -2
  460. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  461. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +3 -2
  462. package/lib-mjs/publicApi/list/toggleNumbering.js +4 -2
  463. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  464. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +2 -2
  465. package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
  466. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  467. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +2 -2
  468. package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
  469. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  470. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +2 -2
  471. package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
  472. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  473. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +2 -2
  474. package/lib-mjs/publicApi/segment/setBackgroundColor.js +1 -1
  475. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  476. package/lib-mjs/publicApi/segment/setFontName.d.ts +2 -2
  477. package/lib-mjs/publicApi/segment/setFontName.js +1 -1
  478. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  479. package/lib-mjs/publicApi/segment/setFontSize.d.ts +2 -2
  480. package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
  481. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  482. package/lib-mjs/publicApi/segment/setTextColor.d.ts +2 -2
  483. package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
  484. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  485. package/lib-mjs/publicApi/segment/toggleBold.d.ts +2 -2
  486. package/lib-mjs/publicApi/segment/toggleBold.js +1 -1
  487. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  488. package/lib-mjs/publicApi/segment/toggleCode.d.ts +2 -2
  489. package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
  490. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  491. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +2 -2
  492. package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
  493. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  494. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  495. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
  496. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  497. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +2 -2
  498. package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
  499. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  500. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +2 -2
  501. package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
  502. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  503. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +2 -2
  504. package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
  505. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  506. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  507. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +1 -1
  508. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  509. package/lib-mjs/publicApi/table/editTable.d.ts +2 -2
  510. package/lib-mjs/publicApi/table/editTable.js +1 -1
  511. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  512. package/lib-mjs/publicApi/table/formatTable.d.ts +2 -2
  513. package/lib-mjs/publicApi/table/formatTable.js +1 -1
  514. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  515. package/lib-mjs/publicApi/table/insertTable.d.ts +2 -2
  516. package/lib-mjs/publicApi/table/insertTable.js +1 -1
  517. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  518. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +2 -2
  519. package/lib-mjs/publicApi/table/setTableCellShade.js +1 -1
  520. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  521. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +6 -3
  522. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
  523. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  524. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +6 -3
  525. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  526. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  527. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +9 -3
  528. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  529. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  530. package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  531. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  532. package/package.json +4 -4
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_dom_1, roosterjs_content_model_core_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.insertImage = void 0;
4
5
  /**
5
6
  * Insert an image into current selected position
6
7
  * @param editor The editor to operate on
@@ -19,7 +20,7 @@ define(["require", "exports", "roosterjs-content-model-dom", "roosterjs-content-
19
20
  });
20
21
  }
21
22
  }
22
- exports.default = insertImage;
23
+ exports.insertImage = insertImage;
23
24
  function insertImageWithSrc(editor, src) {
24
25
  editor.formatContentModel(function (model, context) {
25
26
  var image = (0, roosterjs_content_model_dom_1.createImage)(src, { backgroundColor: '' });
@@ -1 +1 @@
1
- {"version":3,"file":"insertImage.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/image/insertImage.ts"],"names":[],"mappings":";;;IAIA;;;;OAIG;IACH,SAAwB,WAAW,CAAC,MAAyB,EAAE,cAA6B;QACxF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAI,OAAO,cAAc,IAAI,QAAQ,EAAE;YACnC,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;SAC9C;aAAM;YACH,IAAA,uCAAQ,EAAC,cAAc,EAAE,UAAA,OAAO;gBAC5B,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;oBACjC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;iBACvC;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAZD,8BAYC;IAED,SAAS,kBAAkB,CAAC,MAAyB,EAAE,GAAW;QAC9D,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAM,KAAK,GAAG,IAAA,yCAAW,EAAC,GAAG,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;YACxD,IAAM,GAAG,GAAG,IAAA,wDAA0B,GAAE,CAAC;YAEzC,IAAA,wCAAU,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvB,IAAA,yCAAU,EAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;gBAC5B,WAAW,EAAE,UAAU;aAC1B,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QAChB,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC","sourcesContent":["import { addSegment, createContentModelDocument, createImage } from 'roosterjs-content-model-dom';\nimport { mergeModel, readFile } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Insert an image into current selected position\n * @param editor The editor to operate on\n * @param file Image Blob file or source string\n */\nexport default function insertImage(editor: IStandaloneEditor, imageFileOrSrc: File | string) {\n editor.focus();\n\n if (typeof imageFileOrSrc == 'string') {\n insertImageWithSrc(editor, imageFileOrSrc);\n } else {\n readFile(imageFileOrSrc, dataUrl => {\n if (dataUrl && !editor.isDisposed()) {\n insertImageWithSrc(editor, dataUrl);\n }\n });\n }\n}\n\nfunction insertImageWithSrc(editor: IStandaloneEditor, src: string) {\n editor.formatContentModel(\n (model, context) => {\n const image = createImage(src, { backgroundColor: '' });\n const doc = createContentModelDocument();\n\n addSegment(doc, image);\n mergeModel(model, doc, context, {\n mergeFormat: 'mergeAll',\n });\n\n return true;\n },\n {\n apiName: 'insertImage',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"insertImage.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/insertImage.ts"],"names":[],"mappings":";;;;IAIA;;;;OAIG;IACH,SAAgB,WAAW,CAAC,MAAe,EAAE,cAA6B;QACtE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAI,OAAO,cAAc,IAAI,QAAQ,EAAE;YACnC,kBAAkB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;SAC9C;aAAM;YACH,IAAA,uCAAQ,EAAC,cAAc,EAAE,UAAA,OAAO;gBAC5B,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;oBACjC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;iBACvC;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAZD,kCAYC;IAED,SAAS,kBAAkB,CAAC,MAAe,EAAE,GAAW;QACpD,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,IAAM,KAAK,GAAG,IAAA,yCAAW,EAAC,GAAG,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;YACxD,IAAM,GAAG,GAAG,IAAA,wDAA0B,GAAE,CAAC;YAEzC,IAAA,wCAAU,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvB,IAAA,yCAAU,EAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE;gBAC5B,WAAW,EAAE,UAAU;aAC1B,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QAChB,CAAC,EACD;YACI,OAAO,EAAE,aAAa;SACzB,CACJ,CAAC;IACN,CAAC","sourcesContent":["import { addSegment, createContentModelDocument, createImage } from 'roosterjs-content-model-dom';\nimport { mergeModel, readFile } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Insert an image into current selected position\n * @param editor The editor to operate on\n * @param file Image Blob file or source string\n */\nexport function insertImage(editor: IEditor, imageFileOrSrc: File | string) {\n editor.focus();\n\n if (typeof imageFileOrSrc == 'string') {\n insertImageWithSrc(editor, imageFileOrSrc);\n } else {\n readFile(imageFileOrSrc, dataUrl => {\n if (dataUrl && !editor.isDisposed()) {\n insertImageWithSrc(editor, dataUrl);\n }\n });\n }\n}\n\nfunction insertImageWithSrc(editor: IEditor, src: string) {\n editor.formatContentModel(\n (model, context) => {\n const image = createImage(src, { backgroundColor: '' });\n const doc = createContentModelDocument();\n\n addSegment(doc, image);\n mergeModel(model, doc, context, {\n mergeFormat: 'mergeAll',\n });\n\n return true;\n },\n {\n apiName: 'insertImage',\n }\n );\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set image alt text for all selected images at selection. If no images is contained
4
4
  * in selection, do nothing.
5
5
  * @param editor The editor instance
6
6
  * @param altText The image alt text
7
7
  */
8
- export default function setImageAltText(editor: IStandaloneEditor, altText: string): void;
8
+ export declare function setImageAltText(editor: IEditor, altText: string): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../utils/formatImageWithContentModel"], function (require, exports, formatImageWithContentModel_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setImageAltText = void 0;
4
5
  /**
5
6
  * Set image alt text for all selected images at selection. If no images is contained
6
7
  * in selection, do nothing.
@@ -9,10 +10,10 @@ define(["require", "exports", "../utils/formatImageWithContentModel"], function
9
10
  */
10
11
  function setImageAltText(editor, altText) {
11
12
  editor.focus();
12
- (0, formatImageWithContentModel_1.default)(editor, 'setImageAltText', function (image) {
13
+ (0, formatImageWithContentModel_1.formatImageWithContentModel)(editor, 'setImageAltText', function (image) {
13
14
  image.alt = altText;
14
15
  });
15
16
  }
16
- exports.default = setImageAltText;
17
+ exports.setImageAltText = setImageAltText;
17
18
  });
18
19
  //# sourceMappingURL=setImageAltText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setImageAltText.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/image/setImageAltText.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,eAAe,CAAC,MAAyB,EAAE,OAAe;QAC9E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,qCAA2B,EAAC,MAAM,EAAE,iBAAiB,EAAE,UAAC,KAAwB;YAC5E,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;IAND,kCAMC","sourcesContent":["import formatImageWithContentModel from '../utils/formatImageWithContentModel';\nimport type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image alt text for all selected images at selection. If no images is contained\n * in selection, do nothing.\n * @param editor The editor instance\n * @param altText The image alt text\n */\nexport default function setImageAltText(editor: IStandaloneEditor, altText: string) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageAltText', (image: ContentModelImage) => {\n image.alt = altText;\n });\n}\n"]}
1
+ {"version":3,"file":"setImageAltText.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/setImageAltText.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACH,SAAgB,eAAe,CAAC,MAAe,EAAE,OAAe;QAC5D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,yDAA2B,EAAC,MAAM,EAAE,iBAAiB,EAAE,UAAC,KAAwB;YAC5E,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;IAND,0CAMC","sourcesContent":["import { formatImageWithContentModel } from '../utils/formatImageWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image alt text for all selected images at selection. If no images is contained\n * in selection, do nothing.\n * @param editor The editor instance\n * @param altText The image alt text\n */\nexport function setImageAltText(editor: IEditor, altText: string) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageAltText', (image: ContentModelImage) => {\n image.alt = altText;\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { Border, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set image border style for all selected images at selection.
4
4
  * @param editor The editor instance
@@ -6,4 +6,4 @@ import type { Border, IStandaloneEditor } from 'roosterjs-content-model-types';
6
6
  * its value will not be changed. Passing null instead of an object will remove the border
7
7
  * @param borderRadius the border radius value, if undefined, the border radius will keep the actual value
8
8
  */
9
- export default function setImageBorder(editor: IStandaloneEditor, border: Border | null, borderRadius?: string): void;
9
+ export declare function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: string): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../../modelApi/image/applyImageBorderFormat", "../utils/formatImageWithContentModel"], function (require, exports, applyImageBorderFormat_1, formatImageWithContentModel_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setImageBorder = void 0;
4
5
  /**
5
6
  * Set image border style for all selected images at selection.
6
7
  * @param editor The editor instance
@@ -10,10 +11,10 @@ define(["require", "exports", "../../modelApi/image/applyImageBorderFormat", "..
10
11
  */
11
12
  function setImageBorder(editor, border, borderRadius) {
12
13
  editor.focus();
13
- (0, formatImageWithContentModel_1.default)(editor, 'setImageBorder', function (image) {
14
- (0, applyImageBorderFormat_1.default)(image, border, borderRadius);
14
+ (0, formatImageWithContentModel_1.formatImageWithContentModel)(editor, 'setImageBorder', function (image) {
15
+ (0, applyImageBorderFormat_1.applyImageBorderFormat)(image, border, borderRadius);
15
16
  });
16
17
  }
17
- exports.default = setImageBorder;
18
+ exports.setImageBorder = setImageBorder;
18
19
  });
19
20
  //# sourceMappingURL=setImageBorder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setImageBorder.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/image/setImageBorder.ts"],"names":[],"mappings":";;;IAIA;;;;;;OAMG;IACH,SAAwB,cAAc,CAClC,MAAyB,EACzB,MAAqB,EACrB,YAAqB;QAErB,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,qCAA2B,EAAC,MAAM,EAAE,gBAAgB,EAAE,UAAC,KAAwB;YAC3E,IAAA,gCAAsB,EAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC;IAVD,iCAUC","sourcesContent":["import applyImageBorderFormat from '../../modelApi/image/applyImageBorderFormat';\nimport formatImageWithContentModel from '../utils/formatImageWithContentModel';\nimport type { Border, ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image border style for all selected images at selection.\n * @param editor The editor instance\n * @param border the border format object. Ex: { color: 'red', width: '10px', style: 'solid'}, if one of the value in object is undefined\n * its value will not be changed. Passing null instead of an object will remove the border\n * @param borderRadius the border radius value, if undefined, the border radius will keep the actual value\n */\nexport default function setImageBorder(\n editor: IStandaloneEditor,\n border: Border | null,\n borderRadius?: string\n) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageBorder', (image: ContentModelImage) => {\n applyImageBorderFormat(image, border, borderRadius);\n });\n}\n"]}
1
+ {"version":3,"file":"setImageBorder.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/setImageBorder.ts"],"names":[],"mappings":";;;;IAIA;;;;;;OAMG;IACH,SAAgB,cAAc,CAAC,MAAe,EAAE,MAAqB,EAAE,YAAqB;QACxF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,yDAA2B,EAAC,MAAM,EAAE,gBAAgB,EAAE,UAAC,KAAwB;YAC3E,IAAA,+CAAsB,EAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC;IAND,wCAMC","sourcesContent":["import { applyImageBorderFormat } from '../../modelApi/image/applyImageBorderFormat';\nimport { formatImageWithContentModel } from '../utils/formatImageWithContentModel';\nimport type { Border, ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image border style for all selected images at selection.\n * @param editor The editor instance\n * @param border the border format object. Ex: { color: 'red', width: '10px', style: 'solid'}, if one of the value in object is undefined\n * its value will not be changed. Passing null instead of an object will remove the border\n * @param borderRadius the border radius value, if undefined, the border radius will keep the actual value\n */\nexport function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: string) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageBorder', (image: ContentModelImage) => {\n applyImageBorderFormat(image, border, borderRadius);\n });\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set image box shadow for all selected images at selection.
4
4
  * @param editor The editor instance
5
5
  * @param boxShadow The image box boxShadow
6
6
  * @param margin The image margin for all sides (eg. "4px"), null to remove margin
7
7
  */
8
- export default function setImageBoxShadow(editor: IStandaloneEditor, boxShadow: string, margin?: string | null): void;
8
+ export declare function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../utils/formatImageWithContentModel"], function (require, exports, formatImageWithContentModel_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setImageBoxShadow = void 0;
4
5
  /**
5
6
  * Set image box shadow for all selected images at selection.
6
7
  * @param editor The editor instance
@@ -9,7 +10,7 @@ define(["require", "exports", "../utils/formatImageWithContentModel"], function
9
10
  */
10
11
  function setImageBoxShadow(editor, boxShadow, margin) {
11
12
  editor.focus();
12
- (0, formatImageWithContentModel_1.default)(editor, 'setImageBoxShadow', function (image) {
13
+ (0, formatImageWithContentModel_1.formatImageWithContentModel)(editor, 'setImageBoxShadow', function (image) {
13
14
  image.format.boxShadow = boxShadow;
14
15
  if (margin) {
15
16
  image.format.marginBottom = margin;
@@ -25,6 +26,6 @@ define(["require", "exports", "../utils/formatImageWithContentModel"], function
25
26
  }
26
27
  });
27
28
  }
28
- exports.default = setImageBoxShadow;
29
+ exports.setImageBoxShadow = setImageBoxShadow;
29
30
  });
30
31
  //# sourceMappingURL=setImageBoxShadow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setImageBoxShadow.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/image/setImageBoxShadow.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,iBAAiB,CACrC,MAAyB,EACzB,SAAiB,EACjB,MAAsB;QAEtB,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,qCAA2B,EAAC,MAAM,EAAE,mBAAmB,EAAE,UAAC,KAAwB;YAC9E,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YACnC,IAAI,MAAM,EAAE;gBACR,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;gBACnC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC;gBACjC,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC;gBAClC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC;aACnC;iBAAM,IAAI,MAAM,KAAK,IAAI,EAAE;gBACxB,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;gBACjC,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;gBAChC,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;aACjC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IArBD,oCAqBC","sourcesContent":["import formatImageWithContentModel from '../utils/formatImageWithContentModel';\nimport type { ContentModelImage, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image box shadow for all selected images at selection.\n * @param editor The editor instance\n * @param boxShadow The image box boxShadow\n * @param margin The image margin for all sides (eg. \"4px\"), null to remove margin\n */\nexport default function setImageBoxShadow(\n editor: IStandaloneEditor,\n boxShadow: string,\n margin?: string | null\n) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageBoxShadow', (image: ContentModelImage) => {\n image.format.boxShadow = boxShadow;\n if (margin) {\n image.format.marginBottom = margin;\n image.format.marginLeft = margin;\n image.format.marginRight = margin;\n image.format.marginTop = margin;\n } else if (margin === null) {\n delete image.format.marginBottom;\n delete image.format.marginLeft;\n delete image.format.marginRight;\n delete image.format.marginTop;\n }\n });\n}\n"]}
1
+ {"version":3,"file":"setImageBoxShadow.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/image/setImageBoxShadow.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACH,SAAgB,iBAAiB,CAAC,MAAe,EAAE,SAAiB,EAAE,MAAsB;QACxF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,yDAA2B,EAAC,MAAM,EAAE,mBAAmB,EAAE,UAAC,KAAwB;YAC9E,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YACnC,IAAI,MAAM,EAAE;gBACR,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;gBACnC,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC;gBACjC,KAAK,CAAC,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC;gBAClC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC;aACnC;iBAAM,IAAI,MAAM,KAAK,IAAI,EAAE;gBACxB,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;gBACjC,OAAO,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;gBAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC;gBAChC,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;aACjC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAjBD,8CAiBC","sourcesContent":["import { formatImageWithContentModel } from '../utils/formatImageWithContentModel';\nimport type { ContentModelImage, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set image box shadow for all selected images at selection.\n * @param editor The editor instance\n * @param boxShadow The image box boxShadow\n * @param margin The image margin for all sides (eg. \"4px\"), null to remove margin\n */\nexport function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null) {\n editor.focus();\n\n formatImageWithContentModel(editor, 'setImageBoxShadow', (image: ContentModelImage) => {\n image.format.boxShadow = boxShadow;\n if (margin) {\n image.format.marginBottom = margin;\n image.format.marginLeft = margin;\n image.format.marginRight = margin;\n image.format.marginTop = margin;\n } else if (margin === null) {\n delete image.format.marginBottom;\n delete image.format.marginLeft;\n delete image.format.marginRight;\n delete image.format.marginTop;\n }\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed
4
4
  * @return A combination of existing link display text and url if any. If there is no existing link, return selected text and null
5
5
  */
6
- export default function adjustLinkSelection(editor: IStandaloneEditor): [string, string | null];
6
+ export declare function adjustLinkSelection(editor: IEditor): [string, string | null];
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "../../modelApi/selection/adjustWordSelection", "roosterjs-content-model-core"], function (require, exports, adjustSegmentSelection_1, adjustWordSelection_1, roosterjs_content_model_core_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.adjustLinkSelection = void 0;
4
5
  /**
5
6
  * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed
6
7
  * @return A combination of existing link display text and url if any. If there is no existing link, return selected text and null
@@ -28,6 +29,6 @@ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection",
28
29
  });
29
30
  return [text, url];
30
31
  }
31
- exports.default = adjustLinkSelection;
32
+ exports.adjustLinkSelection = adjustLinkSelection;
32
33
  });
33
34
  //# sourceMappingURL=adjustLinkSelection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adjustLinkSelection.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/adjustLinkSelection.ts"],"names":[],"mappings":";;;IAKA;;;OAGG;IACH,SAAwB,mBAAmB,CAAC,MAAyB;QACjE,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,GAAG,GAAkB,IAAI,CAAC;QAE9B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;;YACD,IAAI,OAAO,GAAG,IAAA,+CAAsB,EAChC,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,EAAjE,CAAiE,CACrF,CAAC;YACF,IAAI,QAAQ,GAAG,IAAA,kDAAmB,EAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC3E,IAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAEjC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,IAAI,YAAY,CAAC,WAAW,IAAI,iBAAiB,EAAE;gBACvE,QAAQ,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,YAAY,CAAC,CAAC;gBAEpD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;oBACrB,OAAO,GAAG,IAAI,CAAC;oBACf,IAAA,2CAAY,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;iBACnE;aACJ;YAED,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAvC,CAAuC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3E,GAAG,GAAG,CAAA,MAAA,MAAA,QAAQ,CAAC,CAAC,CAAC,0CAAE,IAAI,0CAAE,MAAM,CAAC,IAAI,KAAI,IAAI,CAAC;YAE7C,OAAO,OAAO,CAAC;QACnB,CAAC,EACD;YACI,OAAO,EAAE,qBAAqB;SACjC,CACJ,CAAC;QAEF,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;IAlCD,sCAkCC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { adjustWordSelection } from '../../modelApi/selection/adjustWordSelection';\nimport { getSelectedSegments, setSelection } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed\n * @return A combination of existing link display text and url if any. If there is no existing link, return selected text and null\n */\nexport default function adjustLinkSelection(editor: IStandaloneEditor): [string, string | null] {\n let text = '';\n let url: string | null = null;\n\n editor.formatContentModel(\n model => {\n let changed = adjustSegmentSelection(\n model,\n target => !!target.isSelected && !!target.link,\n (target, ref) => !!target.link && target.link.format.href == ref.link!.format.href\n );\n let segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n const firstSegment = segments[0];\n\n if (segments.length == 1 && firstSegment.segmentType == 'SelectionMarker') {\n segments = adjustWordSelection(model, firstSegment);\n\n if (segments.length > 1) {\n changed = true;\n setSelection(model, segments[0], segments[segments.length - 1]);\n }\n }\n\n text = segments.map(x => (x.segmentType == 'Text' ? x.text : '')).join('');\n url = segments[0]?.link?.format.href || null;\n\n return changed;\n },\n {\n apiName: 'adjustLinkSelection',\n }\n );\n\n return [text, url];\n}\n"]}
1
+ {"version":3,"file":"adjustLinkSelection.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/link/adjustLinkSelection.ts"],"names":[],"mappings":";;;;IAKA;;;OAGG;IACH,SAAgB,mBAAmB,CAAC,MAAe;QAC/C,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,GAAG,GAAkB,IAAI,CAAC;QAE9B,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;;YACD,IAAI,OAAO,GAAG,IAAA,+CAAsB,EAChC,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG,IAAK,OAAA,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,EAAjE,CAAiE,CACrF,CAAC;YACF,IAAI,QAAQ,GAAG,IAAA,kDAAmB,EAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC3E,IAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAEjC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC,IAAI,YAAY,CAAC,WAAW,IAAI,iBAAiB,EAAE;gBACvE,QAAQ,GAAG,IAAA,yCAAmB,EAAC,KAAK,EAAE,YAAY,CAAC,CAAC;gBAEpD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;oBACrB,OAAO,GAAG,IAAI,CAAC;oBACf,IAAA,2CAAY,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;iBACnE;aACJ;YAED,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAvC,CAAuC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3E,GAAG,GAAG,CAAA,MAAA,MAAA,QAAQ,CAAC,CAAC,CAAC,0CAAE,IAAI,0CAAE,MAAM,CAAC,IAAI,KAAI,IAAI,CAAC;YAE7C,OAAO,OAAO,CAAC;QACnB,CAAC,EACD;YACI,OAAO,EAAE,qBAAqB;SACjC,CACJ,CAAC;QAEF,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;IAlCD,kDAkCC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { adjustWordSelection } from '../../modelApi/selection/adjustWordSelection';\nimport { getSelectedSegments, setSelection } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Adjust selection to make sure select a hyperlink if any, or a word if original selection is collapsed\n * @return A combination of existing link display text and url if any. If there is no existing link, return selected text and null\n */\nexport function adjustLinkSelection(editor: IEditor): [string, string | null] {\n let text = '';\n let url: string | null = null;\n\n editor.formatContentModel(\n model => {\n let changed = adjustSegmentSelection(\n model,\n target => !!target.isSelected && !!target.link,\n (target, ref) => !!target.link && target.link.format.href == ref.link!.format.href\n );\n let segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n const firstSegment = segments[0];\n\n if (segments.length == 1 && firstSegment.segmentType == 'SelectionMarker') {\n segments = adjustWordSelection(model, firstSegment);\n\n if (segments.length > 1) {\n changed = true;\n setSelection(model, segments[0], segments[segments.length - 1]);\n }\n }\n\n text = segments.map(x => (x.segmentType == 'Text' ? x.text : '')).join('');\n url = segments[0]?.link?.format.href || null;\n\n return changed;\n },\n {\n apiName: 'adjustLinkSelection',\n }\n );\n\n return [text, url];\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Insert a hyperlink at cursor.
4
4
  * When there is a selection, hyperlink will be applied to the selection,
@@ -12,4 +12,4 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
12
12
  * If specified, the display text of link will be replaced with this text.
13
13
  * If not specified and there wasn't a link, the link url will be used as display text.
14
14
  */
15
- export default function insertLink(editor: IStandaloneEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;
15
+ export declare function insertLink(editor: IEditor, link: string, anchorTitle?: string, displayText?: string, target?: string): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "tslib", "../../modelApi/selection/adjustTrailingSpaceSelection", "roosterjs-content-model-core", "../../modelApi/link/matchLink", "roosterjs-content-model-dom"], function (require, exports, tslib_1, adjustTrailingSpaceSelection_1, roosterjs_content_model_core_1, matchLink_1, roosterjs_content_model_dom_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.insertLink = void 0;
4
5
  // Regex matching Uri scheme
5
6
  var URI_REGEX = /^[a-zA-Z]+:/i;
6
7
  // Regex matching begin of email address
@@ -73,7 +74,7 @@ define(["require", "exports", "tslib", "../../modelApi/selection/adjustTrailingS
73
74
  });
74
75
  }
75
76
  }
76
- exports.default = insertLink;
77
+ exports.insertLink = insertLink;
77
78
  var createLink = function (url, anchorTitle, target, underline) {
78
79
  if (underline === void 0) { underline = true; }
79
80
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":"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","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { ChangeSource, getSelectedSegments, mergeModel } from 'roosterjs-content-model-core';\nimport { matchLink } from '../../modelApi/link/matchLink';\nimport type { ContentModelLink, IStandaloneEditor } from 'roosterjs-content-model-types';\nimport {\n addLink,\n addSegment,\n createContentModelDocument,\n createText,\n} from 'roosterjs-content-model-dom';\n\n// Regex matching Uri scheme\nconst URI_REGEX = /^[a-zA-Z]+:/i;\n// Regex matching begin of email address\nconst MAILTO_REGEX = /^[\\w.%+-]+@/i;\n// Regex matching begin of ftp, i.e. ftp.microsoft.com\nconst FTP_REGEX = /^ftp\\./i;\n\n/**\n * Insert a hyperlink at cursor.\n * When there is a selection, hyperlink will be applied to the selection,\n * otherwise a hyperlink will be inserted to the cursor position.\n * @param editor Editor object\n * @param link Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais.\n * When protocol is not specified, a best matched protocol will be predicted.\n * @param anchorTitle Optional alt text of the link, will be shown when hover on the link\n * @param displayText Optional display text for the link.\n * @param target Optional display target for the link (\"_blank\"|\"_self\"|\"_parent\"|\"_top\"|\"{framename}\")\n * If specified, the display text of link will be replaced with this text.\n * If not specified and there wasn't a link, the link url will be used as display text.\n */\nexport default function insertLink(\n editor: IStandaloneEditor,\n link: string,\n anchorTitle?: string,\n displayText?: string,\n target?: string\n) {\n editor.focus();\n\n const url = (checkXss(link) || '').trim();\n if (url) {\n const linkData = matchLink(url);\n const linkUrl = linkData ? linkData.normalizedUrl : applyLinkPrefix(url);\n const links: ContentModelLink[] = [];\n let anchorNode: Node | undefined;\n\n editor.formatContentModel(\n (model, context) => {\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n const originalText = segments\n .map(x => (x.segmentType == 'Text' ? x.text : ''))\n .join('');\n const text = displayText || originalText || '';\n\n if (\n segments.some(x => x.segmentType != 'SelectionMarker') &&\n originalText == text\n ) {\n segments.forEach(x => {\n const link = createLink(\n linkUrl,\n anchorTitle,\n target,\n x.segmentType == 'Text'\n );\n addLink(x, link);\n if (x.link) {\n links.push(x.link);\n }\n });\n } else if (\n segments.every(x => x.segmentType == 'SelectionMarker') ||\n (!!text && text != originalText)\n ) {\n const segment = createText(text || (linkData ? linkData.originalUrl : url), {\n ...segments[0]?.format,\n ...editor.getPendingFormat(),\n });\n const doc = createContentModelDocument();\n const link = createLink(linkUrl, anchorTitle, target);\n\n addLink(segment, link);\n addSegment(doc, segment);\n\n if (segment.link) {\n links.push(segment.link);\n }\n\n mergeModel(model, doc, context, {\n mergeFormat: 'mergeAll',\n });\n }\n\n adjustTrailingSpaceSelection(model);\n return segments.length > 0;\n },\n {\n changeSource: ChangeSource.CreateLink,\n onNodeCreated: (modelElement, node) => {\n if (!anchorNode && links.indexOf(modelElement as ContentModelLink) >= 0) {\n anchorNode = node;\n }\n },\n getChangeData: () => anchorNode,\n apiName: 'insertLink',\n }\n );\n }\n}\n\nconst createLink = (\n url: string,\n anchorTitle?: string,\n target?: string,\n underline: boolean = true\n): ContentModelLink => {\n return {\n dataset: {},\n format: {\n href: url,\n anchorTitle,\n target,\n underline: underline,\n },\n };\n};\n\nfunction applyLinkPrefix(url: string): string {\n if (!url) {\n return url;\n }\n\n // Add link prefix per rule:\n // (a) if the url always starts with a URI scheme, leave it as it is\n // (b) if the url is an email address, xxx@... add mailto: prefix\n // (c) if the url starts with ftp., add ftp:// prefix\n // (d) rest, add http:// prefix\n let prefix = '';\n if (url.search(URI_REGEX) < 0) {\n if (url.search(MAILTO_REGEX) == 0) {\n prefix = 'mailto:';\n } else if (url.search(FTP_REGEX) == 0) {\n prefix = 'ftp://';\n } else {\n // fallback to http://\n prefix = 'http://';\n }\n }\n\n return prefix + url;\n}\n\nfunction checkXss(link: string): string {\n return link.match(/s\\n*c\\n*r\\n*i\\n*p\\n*t\\n*:/i) ? '' : link;\n}\n"]}
1
+ {"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":"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","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { ChangeSource, getSelectedSegments, mergeModel } from 'roosterjs-content-model-core';\nimport { matchLink } from '../../modelApi/link/matchLink';\nimport type { ContentModelLink, IEditor } from 'roosterjs-content-model-types';\nimport {\n addLink,\n addSegment,\n createContentModelDocument,\n createText,\n} from 'roosterjs-content-model-dom';\n\n// Regex matching Uri scheme\nconst URI_REGEX = /^[a-zA-Z]+:/i;\n// Regex matching begin of email address\nconst MAILTO_REGEX = /^[\\w.%+-]+@/i;\n// Regex matching begin of ftp, i.e. ftp.microsoft.com\nconst FTP_REGEX = /^ftp\\./i;\n\n/**\n * Insert a hyperlink at cursor.\n * When there is a selection, hyperlink will be applied to the selection,\n * otherwise a hyperlink will be inserted to the cursor position.\n * @param editor Editor object\n * @param link Link address, can be http(s), mailto, notes, file, unc, ftp, news, telnet, gopher, wais.\n * When protocol is not specified, a best matched protocol will be predicted.\n * @param anchorTitle Optional alt text of the link, will be shown when hover on the link\n * @param displayText Optional display text for the link.\n * @param target Optional display target for the link (\"_blank\"|\"_self\"|\"_parent\"|\"_top\"|\"{framename}\")\n * If specified, the display text of link will be replaced with this text.\n * If not specified and there wasn't a link, the link url will be used as display text.\n */\nexport function insertLink(\n editor: IEditor,\n link: string,\n anchorTitle?: string,\n displayText?: string,\n target?: string\n) {\n editor.focus();\n\n const url = (checkXss(link) || '').trim();\n if (url) {\n const linkData = matchLink(url);\n const linkUrl = linkData ? linkData.normalizedUrl : applyLinkPrefix(url);\n const links: ContentModelLink[] = [];\n let anchorNode: Node | undefined;\n\n editor.formatContentModel(\n (model, context) => {\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n const originalText = segments\n .map(x => (x.segmentType == 'Text' ? x.text : ''))\n .join('');\n const text = displayText || originalText || '';\n\n if (\n segments.some(x => x.segmentType != 'SelectionMarker') &&\n originalText == text\n ) {\n segments.forEach(x => {\n const link = createLink(\n linkUrl,\n anchorTitle,\n target,\n x.segmentType == 'Text'\n );\n addLink(x, link);\n if (x.link) {\n links.push(x.link);\n }\n });\n } else if (\n segments.every(x => x.segmentType == 'SelectionMarker') ||\n (!!text && text != originalText)\n ) {\n const segment = createText(text || (linkData ? linkData.originalUrl : url), {\n ...segments[0]?.format,\n ...editor.getPendingFormat(),\n });\n const doc = createContentModelDocument();\n const link = createLink(linkUrl, anchorTitle, target);\n\n addLink(segment, link);\n addSegment(doc, segment);\n\n if (segment.link) {\n links.push(segment.link);\n }\n\n mergeModel(model, doc, context, {\n mergeFormat: 'mergeAll',\n });\n }\n\n adjustTrailingSpaceSelection(model);\n return segments.length > 0;\n },\n {\n changeSource: ChangeSource.CreateLink,\n onNodeCreated: (modelElement, node) => {\n if (!anchorNode && links.indexOf(modelElement as ContentModelLink) >= 0) {\n anchorNode = node;\n }\n },\n getChangeData: () => anchorNode,\n apiName: 'insertLink',\n }\n );\n }\n}\n\nconst createLink = (\n url: string,\n anchorTitle?: string,\n target?: string,\n underline: boolean = true\n): ContentModelLink => {\n return {\n dataset: {},\n format: {\n href: url,\n anchorTitle,\n target,\n underline: underline,\n },\n };\n};\n\nfunction applyLinkPrefix(url: string): string {\n if (!url) {\n return url;\n }\n\n // Add link prefix per rule:\n // (a) if the url always starts with a URI scheme, leave it as it is\n // (b) if the url is an email address, xxx@... add mailto: prefix\n // (c) if the url starts with ftp., add ftp:// prefix\n // (d) rest, add http:// prefix\n let prefix = '';\n if (url.search(URI_REGEX) < 0) {\n if (url.search(MAILTO_REGEX) == 0) {\n prefix = 'mailto:';\n } else if (url.search(FTP_REGEX) == 0) {\n prefix = 'ftp://';\n } else {\n // fallback to http://\n prefix = 'http://';\n }\n }\n\n return prefix + url;\n}\n\nfunction checkXss(link: string): string {\n return link.match(/s\\n*c\\n*r\\n*i\\n*p\\n*t\\n*:/i) ? '' : link;\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Remove link at selection. If no links at selection, do nothing.
4
4
  * If selection contains multiple links, all of the link styles will be removed.
5
5
  * If only part of a link is selected, the whole link style will be removed.
6
6
  * @param editor The editor instance
7
7
  */
8
- export default function removeLink(editor: IStandaloneEditor): void;
8
+ export declare function removeLink(editor: IEditor): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection", "roosterjs-content-model-core"], function (require, exports, adjustSegmentSelection_1, roosterjs_content_model_core_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.removeLink = void 0;
4
5
  /**
5
6
  * Remove link at selection. If no links at selection, do nothing.
6
7
  * If selection contains multiple links, all of the link styles will be removed.
@@ -27,6 +28,6 @@ define(["require", "exports", "../../modelApi/selection/adjustSegmentSelection",
27
28
  apiName: 'removeLink',
28
29
  });
29
30
  }
30
- exports.default = removeLink;
31
+ exports.removeLink = removeLink;
31
32
  });
32
33
  //# sourceMappingURL=removeLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":";;;IAIA;;;;;OAKG;IACH,SAAwB,UAAU,CAAC,MAAyB;QACxD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAA,+CAAsB,EAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;gBACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;oBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;YADnE,CACmE,CAC1E,CAAC;YAEF,IAAM,QAAQ,GAAG,IAAA,kDAAmB,EAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBACpB,IAAI,OAAO,CAAC,IAAI,EAAE;oBACd,SAAS,GAAG,IAAI,CAAC;oBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;iBACvB;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC;QACrB,CAAC,EACD;YACI,OAAO,EAAE,YAAY;SACxB,CACJ,CAAC;IACN,CAAC;IA9BD,6BA8BC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { getSelectedSegments } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Remove link at selection. If no links at selection, do nothing.\n * If selection contains multiple links, all of the link styles will be removed.\n * If only part of a link is selected, the whole link style will be removed.\n * @param editor The editor instance\n */\nexport default function removeLink(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n adjustSegmentSelection(\n model,\n target => !!target.isSelected && !!target.link,\n (target, ref) =>\n target.isSelected || // Expand the selection to any link that is involved. So we can remove multiple links together\n (!!target.link && target.link.format.href == ref.link!.format.href)\n );\n\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n let isChanged = false;\n\n segments.forEach(segment => {\n if (segment.link) {\n isChanged = true;\n\n delete segment.link;\n }\n });\n\n return isChanged;\n },\n {\n apiName: 'removeLink',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":";;;;IAIA;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,MAAe;QACtC,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAA,+CAAsB,EAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;gBACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;oBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;YADnE,CACmE,CAC1E,CAAC;YAEF,IAAM,QAAQ,GAAG,IAAA,kDAAmB,EAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBACpB,IAAI,OAAO,CAAC,IAAI,EAAE;oBACd,SAAS,GAAG,IAAI,CAAC;oBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;iBACvB;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC;QACrB,CAAC,EACD;YACI,OAAO,EAAE,YAAY;SACxB,CACJ,CAAC;IACN,CAAC;IA9BD,gCA8BC","sourcesContent":["import { adjustSegmentSelection } from '../../modelApi/selection/adjustSegmentSelection';\nimport { getSelectedSegments } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Remove link at selection. If no links at selection, do nothing.\n * If selection contains multiple links, all of the link styles will be removed.\n * If only part of a link is selected, the whole link style will be removed.\n * @param editor The editor instance\n */\nexport function removeLink(editor: IEditor) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n adjustSegmentSelection(\n model,\n target => !!target.isSelected && !!target.link,\n (target, ref) =>\n target.isSelected || // Expand the selection to any link that is involved. So we can remove multiple links together\n (!!target.link && target.link.format.href == ref.link!.format.href)\n );\n\n const segments = getSelectedSegments(model, false /*includingFormatHolder*/);\n let isChanged = false;\n\n segments.forEach(segment => {\n if (segment.link) {\n isChanged = true;\n\n delete segment.link;\n }\n });\n\n return isChanged;\n },\n {\n apiName: 'removeLink',\n }\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set start number of a list item
4
4
  * @param editor The editor to operate on
5
5
  * @param value The number to set to, must be equal or greater than 1
6
6
  */
7
- export default function setListStartNumber(editor: IStandaloneEditor, value: number): void;
7
+ export declare function setListStartNumber(editor: IEditor, value: number): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "roosterjs-content-model-core"], function (require, exports, roosterjs_content_model_core_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setListStartNumber = void 0;
4
5
  /**
5
6
  * Set start number of a list item
6
7
  * @param editor The editor to operate on
@@ -22,6 +23,6 @@ define(["require", "exports", "roosterjs-content-model-core"], function (require
22
23
  apiName: 'setListStartNumber',
23
24
  });
24
25
  }
25
- exports.default = setListStartNumber;
26
+ exports.setListStartNumber = setListStartNumber;
26
27
  });
27
28
  //# sourceMappingURL=setListStartNumber.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,kBAAkB,CAAC,MAAyB,EAAE,KAAa;QAC/E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YACjD,IAAM,KAAK,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,MAAM,IAAG,CAAC,CAAC,CAAC;YAE5D,IAAI,KAAK,EAAE;gBACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;gBAEzC,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,oBAAoB;SAChC,CACJ,CAAC;IACN,CAAC;IApBD,qCAoBC","sourcesContent":["import { getFirstSelectedListItem } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set start number of a list item\n * @param editor The editor to operate on\n * @param value The number to set to, must be equal or greater than 1\n */\nexport default function setListStartNumber(editor: IStandaloneEditor, value: number) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n const level = listItem?.levels[listItem?.levels.length - 1];\n\n if (level) {\n level.format.startNumberOverride = value;\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStartNumber',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":";;;;IAGA;;;;OAIG;IACH,SAAgB,kBAAkB,CAAC,MAAe,EAAE,KAAa;QAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YACjD,IAAM,KAAK,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,MAAM,IAAG,CAAC,CAAC,CAAC;YAE5D,IAAI,KAAK,EAAE;gBACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;gBAEzC,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,oBAAoB;SAChC,CACJ,CAAC;IACN,CAAC;IApBD,gDAoBC","sourcesContent":["import { getFirstSelectedListItem } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set start number of a list item\n * @param editor The editor to operate on\n * @param value The number to set to, must be equal or greater than 1\n */\nexport function setListStartNumber(editor: IEditor, value: number) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n const level = listItem?.levels[listItem?.levels.length - 1];\n\n if (level) {\n level.format.startNumberOverride = value;\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStartNumber',\n }\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
1
+ import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set style of list items with in same thread of current item
4
4
  * @param editor The editor to operate on
5
5
  * @param style The target list item style to set
6
6
  */
7
- export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
7
+ export declare function setListStyle(editor: IEditor, style: ListMetadataFormat): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../../modelApi/list/findListItemsInSameThread", "roosterjs-content-model-core"], function (require, exports, findListItemsInSameThread_1, roosterjs_content_model_core_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setListStyle = void 0;
4
5
  /**
5
6
  * Set style of list items with in same thread of current item
6
7
  * @param editor The editor to operate on
@@ -28,6 +29,6 @@ define(["require", "exports", "../../modelApi/list/findListItemsInSameThread", "
28
29
  apiName: 'setListStyle',
29
30
  });
30
31
  }
31
- exports.default = setListStyle;
32
+ exports.setListStyle = setListStyle;
32
33
  });
33
34
  //# sourceMappingURL=setListStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":";;;IAIA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAyB,EAAE,KAAyB;QACrF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YAEjD,IAAI,QAAQ,EAAE;gBACV,IAAM,SAAS,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;gBAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;oBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;oBAE1C,IAAI,KAAK,EAAE;wBACP,IAAA,iDAAkB,EAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;qBAC7E;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IA5BD,+BA4BC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\nimport { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Set style of list items with in same thread of current item\n * @param editor The editor to operate on\n * @param style The target list item style to set\n */\nexport default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n\n if (listItem) {\n const listItems = findListItemsInSameThread(model, listItem);\n const levelIndex = listItem.levels.length - 1;\n\n listItems.forEach(listItem => {\n const level = listItem.levels[levelIndex];\n\n if (level) {\n updateListMetadata(level, metadata => Object.assign({}, metadata, style));\n }\n });\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStyle',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":";;;;IAIA;;;;OAIG;IACH,SAAgB,YAAY,CAAC,MAAe,EAAE,KAAyB;QACnE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YAEjD,IAAI,QAAQ,EAAE;gBACV,IAAM,SAAS,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;gBAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;oBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;oBAE1C,IAAI,KAAK,EAAE;wBACP,IAAA,iDAAkB,EAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;qBAC7E;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IA5BD,oCA4BC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\nimport { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';\nimport type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Set style of list items with in same thread of current item\n * @param editor The editor to operate on\n * @param style The target list item style to set\n */\nexport function setListStyle(editor: IEditor, style: ListMetadataFormat) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n\n if (listItem) {\n const listItems = findListItemsInSameThread(model, listItem);\n const levelIndex = listItem.levels.length - 1;\n\n listItems.forEach(listItem => {\n const level = listItem.levels[levelIndex];\n\n if (level) {\n updateListMetadata(level, metadata => Object.assign({}, metadata, style));\n }\n });\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStyle',\n }\n );\n}\n"]}
@@ -1,8 +1,9 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle bullet list type
4
4
  * - When there are some blocks not in bullet list, set all blocks to the given type
5
5
  * - When all blocks are already in bullet list, turn off / outdent there list type
6
6
  * @param editor The editor to operate on
7
+ * @param removeMargins true to remove margins, false to keep margins @default false
7
8
  */
8
- export default function toggleBullet(editor: IStandaloneEditor): void;
9
+ export declare function toggleBullet(editor: IEditor, removeMargins?: boolean): void;
@@ -1,21 +1,24 @@
1
1
  define(["require", "exports", "../../modelApi/list/setListType"], function (require, exports, setListType_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.toggleBullet = void 0;
4
5
  /**
5
6
  * Toggle bullet list type
6
7
  * - When there are some blocks not in bullet list, set all blocks to the given type
7
8
  * - When all blocks are already in bullet list, turn off / outdent there list type
8
9
  * @param editor The editor to operate on
10
+ * @param removeMargins true to remove margins, false to keep margins @default false
9
11
  */
10
- function toggleBullet(editor) {
12
+ function toggleBullet(editor, removeMargins) {
13
+ if (removeMargins === void 0) { removeMargins = false; }
11
14
  editor.focus();
12
15
  editor.formatContentModel(function (model, context) {
13
16
  context.newPendingFormat = 'preserve';
14
- return (0, setListType_1.setListType)(model, 'UL');
17
+ return (0, setListType_1.setListType)(model, 'UL', removeMargins);
15
18
  }, {
16
19
  apiName: 'toggleBullet',
17
20
  });
18
21
  }
19
- exports.default = toggleBullet;
22
+ exports.toggleBullet = toggleBullet;
20
23
  });
21
24
  //# sourceMappingURL=toggleBullet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,YAAY,CAAC,MAAyB;QAC1D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IAbD,+BAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bullet list type\n * - When there are some blocks not in bullet list, set all blocks to the given type\n * - When all blocks are already in bullet list, turn off / outdent there list type\n * @param editor The editor to operate on\n */\nexport default function toggleBullet(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'UL');\n },\n {\n apiName: 'toggleBullet',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":";;;;IAGA;;;;;;OAMG;IACH,SAAgB,YAAY,CAAC,MAAe,EAAE,aAA8B;QAA9B,8BAAA,EAAA,qBAA8B;QACxE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IAbD,oCAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bullet list type\n * - When there are some blocks not in bullet list, set all blocks to the given type\n * - When all blocks are already in bullet list, turn off / outdent there list type\n * @param editor The editor to operate on\n * @param removeMargins true to remove margins, false to keep margins @default false\n */\nexport function toggleBullet(editor: IEditor, removeMargins: boolean = false) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'UL', removeMargins);\n },\n {\n apiName: 'toggleBullet',\n }\n );\n}\n"]}
@@ -1,8 +1,9 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle numbering list type
4
4
  * - When there are some blocks not in numbering list, set all blocks to the given type
5
5
  * - When all blocks are already in numbering list, turn off / outdent there list type
6
6
  * @param editor The editor to operate on
7
+ * @param removeMargins true to remove margins, false to keep margins @default false
7
8
  */
8
- export default function toggleNumbering(editor: IStandaloneEditor): void;
9
+ export declare function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;
@@ -1,21 +1,24 @@
1
1
  define(["require", "exports", "../../modelApi/list/setListType"], function (require, exports, setListType_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.toggleNumbering = void 0;
4
5
  /**
5
6
  * Toggle numbering list type
6
7
  * - When there are some blocks not in numbering list, set all blocks to the given type
7
8
  * - When all blocks are already in numbering list, turn off / outdent there list type
8
9
  * @param editor The editor to operate on
10
+ * @param removeMargins true to remove margins, false to keep margins @default false
9
11
  */
10
- function toggleNumbering(editor) {
12
+ function toggleNumbering(editor, removeMargins) {
13
+ if (removeMargins === void 0) { removeMargins = false; }
11
14
  editor.focus();
12
15
  editor.formatContentModel(function (model, context) {
13
16
  context.newPendingFormat = 'preserve';
14
- return (0, setListType_1.setListType)(model, 'OL');
17
+ return (0, setListType_1.setListType)(model, 'OL', removeMargins);
15
18
  }, {
16
19
  apiName: 'toggleNumbering',
17
20
  });
18
21
  }
19
- exports.default = toggleNumbering;
22
+ exports.toggleNumbering = toggleNumbering;
20
23
  });
21
24
  //# sourceMappingURL=toggleNumbering.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,eAAe,CAAC,MAAyB;QAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,EACD;YACI,OAAO,EAAE,iBAAiB;SAC7B,CACJ,CAAC;IACN,CAAC;IAbD,kCAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle numbering list type\n * - When there are some blocks not in numbering list, set all blocks to the given type\n * - When all blocks are already in numbering list, turn off / outdent there list type\n * @param editor The editor to operate on\n */\nexport default function toggleNumbering(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'OL');\n },\n {\n apiName: 'toggleNumbering',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":";;;;IAGA;;;;;;OAMG;IACH,SAAgB,eAAe,CAAC,MAAe,EAAE,aAA8B;QAA9B,8BAAA,EAAA,qBAA8B;QAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC,EACD;YACI,OAAO,EAAE,iBAAiB;SAC7B,CACJ,CAAC;IACN,CAAC;IAbD,0CAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle numbering list type\n * - When there are some blocks not in numbering list, set all blocks to the given type\n * - When all blocks are already in numbering list, turn off / outdent there list type\n * @param editor The editor to operate on\n * @param removeMargins true to remove margins, false to keep margins @default false\n */\nexport function toggleNumbering(editor: IEditor, removeMargins: boolean = false) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'OL', removeMargins);\n },\n {\n apiName: 'toggleNumbering',\n }\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
- import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Bulk apply segment format to all selected content. This is usually used for format painter.
4
4
  * @param editor The editor to operate on
5
5
  * @param newFormat The segment format to apply
6
6
  */
7
- export default function applySegmentFormat(editor: IStandaloneEditor, newFormat: ContentModelSegmentFormat): void;
7
+ export declare function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;
@@ -1,6 +1,7 @@
1
1
  define(["require", "exports", "../utils/formatSegmentWithContentModel"], function (require, exports, formatSegmentWithContentModel_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.applySegmentFormat = void 0;
4
5
  /**
5
6
  * Bulk apply segment format to all selected content. This is usually used for format painter.
6
7
  * @param editor The editor to operate on
@@ -19,6 +20,6 @@ define(["require", "exports", "../utils/formatSegmentWithContentModel"], functio
19
20
  format.underline = newFormat.underline;
20
21
  }, undefined /* segmentHasStyleCallback*/, true /*includingFormatHandler*/);
21
22
  }
22
- exports.default = applySegmentFormat;
23
+ exports.applySegmentFormat = applySegmentFormat;
23
24
  });
24
25
  //# sourceMappingURL=applySegmentFormat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,kBAAkB,CACtC,MAAyB,EACzB,SAAoC;QAEpC,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;YACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;YACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;YACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;YAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;YACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IArBD,qCAqBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Bulk apply segment format to all selected content. This is usually used for format painter.\n * @param editor The editor to operate on\n * @param newFormat The segment format to apply\n */\nexport default function applySegmentFormat(\n editor: IStandaloneEditor,\n newFormat: ContentModelSegmentFormat\n) {\n formatSegmentWithContentModel(\n editor,\n 'applySegmentFormat',\n format => {\n format.backgroundColor = newFormat.backgroundColor;\n format.fontFamily = newFormat.fontFamily;\n format.fontSize = newFormat.fontSize;\n format.fontWeight = newFormat.fontWeight;\n format.italic = newFormat.italic;\n format.strikethrough = newFormat.strikethrough;\n format.superOrSubScriptSequence = newFormat.superOrSubScriptSequence;\n format.textColor = newFormat.textColor;\n format.underline = newFormat.underline;\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
1
+ {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":";;;;IAGA;;;;OAIG;IACH,SAAgB,kBAAkB,CAAC,MAAe,EAAE,SAAoC;QACpF,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;YACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;YACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;YACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;YAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;YACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAlBD,gDAkBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Bulk apply segment format to all selected content. This is usually used for format painter.\n * @param editor The editor to operate on\n * @param newFormat The segment format to apply\n */\nexport function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat) {\n formatSegmentWithContentModel(\n editor,\n 'applySegmentFormat',\n format => {\n format.backgroundColor = newFormat.backgroundColor;\n format.fontFamily = newFormat.fontFamily;\n format.fontSize = newFormat.fontSize;\n format.fontWeight = newFormat.fontWeight;\n format.italic = newFormat.italic;\n format.strikethrough = newFormat.strikethrough;\n format.superOrSubScriptSequence = newFormat.superOrSubScriptSequence;\n format.textColor = newFormat.textColor;\n format.underline = newFormat.underline;\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Change the capitalization of text in the selection
4
4
  * @param editor The editor instance
@@ -7,4 +7,4 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
7
7
  * Identifying Languages". For example: 'en' or 'en-US' for English, 'tr' for Turkish.
8
8
  * Default is the host environment’s current locale.
9
9
  */
10
- export default function changeCapitalization(editor: IStandaloneEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
10
+ export declare function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;