roosterjs-content-model-api 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (523) hide show
  1. package/lib/index.d.ts +46 -42
  2. package/lib/index.js +52 -43
  3. package/lib/index.js.map +1 -1
  4. package/lib/modelApi/block/setModelAlignment.js.map +1 -1
  5. package/lib/modelApi/block/setModelDirection.js.map +1 -1
  6. package/lib/modelApi/block/setModelIndentation.js.map +1 -1
  7. package/lib/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  8. package/lib/modelApi/common/clearModelFormat.js.map +1 -1
  9. package/lib/modelApi/common/wrapBlock.js.map +1 -1
  10. package/lib/modelApi/entity/insertEntityModel.js.map +1 -1
  11. package/lib/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  12. package/lib/modelApi/image/applyImageBorderFormat.js +2 -1
  13. package/lib/modelApi/image/applyImageBorderFormat.js.map +1 -1
  14. package/lib/modelApi/link/matchLink.d.ts +1 -18
  15. package/lib/modelApi/link/matchLink.js +0 -1
  16. package/lib/modelApi/link/matchLink.js.map +1 -1
  17. package/lib/modelApi/list/findListItemsInSameThread.js.map +1 -1
  18. package/lib/modelApi/list/setListType.js.map +1 -1
  19. package/lib/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  20. package/lib/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  21. package/lib/modelApi/selection/adjustWordSelection.js.map +1 -1
  22. package/lib/modelApi/selection/collapseTableSelection.js.map +1 -1
  23. package/lib/modelApi/table/alignTable.js.map +1 -1
  24. package/lib/modelApi/table/alignTableCell.js.map +1 -1
  25. package/lib/modelApi/table/canMergeCells.js.map +1 -1
  26. package/lib/modelApi/table/clearSelectedCells.js.map +1 -1
  27. package/lib/modelApi/table/createTableStructure.js.map +1 -1
  28. package/lib/modelApi/table/deleteTable.js.map +1 -1
  29. package/lib/modelApi/table/deleteTableColumn.js.map +1 -1
  30. package/lib/modelApi/table/deleteTableRow.js.map +1 -1
  31. package/lib/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  32. package/lib/modelApi/table/insertTableColumn.js.map +1 -1
  33. package/lib/modelApi/table/insertTableRow.js.map +1 -1
  34. package/lib/modelApi/table/mergeTableCells.js.map +1 -1
  35. package/lib/modelApi/table/mergeTableColumn.js.map +1 -1
  36. package/lib/modelApi/table/mergeTableRow.js.map +1 -1
  37. package/lib/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  38. package/lib/modelApi/table/splitTableCellVertically.js.map +1 -1
  39. package/lib/publicApi/block/setAlignment.d.ts +1 -1
  40. package/lib/publicApi/block/setAlignment.js +2 -1
  41. package/lib/publicApi/block/setAlignment.js.map +1 -1
  42. package/lib/publicApi/block/setDirection.d.ts +1 -1
  43. package/lib/publicApi/block/setDirection.js +2 -1
  44. package/lib/publicApi/block/setDirection.js.map +1 -1
  45. package/lib/publicApi/block/setHeadingLevel.d.ts +1 -1
  46. package/lib/publicApi/block/setHeadingLevel.js +2 -1
  47. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  48. package/lib/publicApi/block/setIndentation.d.ts +1 -1
  49. package/lib/publicApi/block/setIndentation.js +2 -1
  50. package/lib/publicApi/block/setIndentation.js.map +1 -1
  51. package/lib/publicApi/block/setParagraphMargin.d.ts +1 -1
  52. package/lib/publicApi/block/setParagraphMargin.js +2 -1
  53. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  54. package/lib/publicApi/block/setSpacing.d.ts +1 -1
  55. package/lib/publicApi/block/setSpacing.js +2 -1
  56. package/lib/publicApi/block/setSpacing.js.map +1 -1
  57. package/lib/publicApi/block/toggleBlockQuote.d.ts +1 -1
  58. package/lib/publicApi/block/toggleBlockQuote.js +2 -1
  59. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  60. package/lib/publicApi/entity/insertEntity.d.ts +2 -2
  61. package/lib/publicApi/entity/insertEntity.js +2 -1
  62. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  63. package/lib/publicApi/format/clearFormat.d.ts +1 -1
  64. package/lib/publicApi/format/clearFormat.js +2 -1
  65. package/lib/publicApi/format/clearFormat.js.map +1 -1
  66. package/lib/publicApi/format/getFormatState.d.ts +1 -1
  67. package/lib/publicApi/format/getFormatState.js +2 -1
  68. package/lib/publicApi/format/getFormatState.js.map +1 -1
  69. package/lib/publicApi/image/adjustImageSelection.d.ts +1 -1
  70. package/lib/publicApi/image/adjustImageSelection.js +2 -1
  71. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  72. package/lib/publicApi/image/changeImage.d.ts +1 -1
  73. package/lib/publicApi/image/changeImage.js +3 -2
  74. package/lib/publicApi/image/changeImage.js.map +1 -1
  75. package/lib/publicApi/image/insertImage.d.ts +1 -1
  76. package/lib/publicApi/image/insertImage.js +2 -1
  77. package/lib/publicApi/image/insertImage.js.map +1 -1
  78. package/lib/publicApi/image/setImageAltText.d.ts +1 -1
  79. package/lib/publicApi/image/setImageAltText.js +3 -2
  80. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  81. package/lib/publicApi/image/setImageBorder.d.ts +1 -1
  82. package/lib/publicApi/image/setImageBorder.js +4 -3
  83. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  84. package/lib/publicApi/image/setImageBoxShadow.d.ts +1 -1
  85. package/lib/publicApi/image/setImageBoxShadow.js +3 -2
  86. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  87. package/lib/publicApi/link/adjustLinkSelection.d.ts +1 -1
  88. package/lib/publicApi/link/adjustLinkSelection.js +2 -1
  89. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  90. package/lib/publicApi/link/insertLink.d.ts +1 -1
  91. package/lib/publicApi/link/insertLink.js +2 -1
  92. package/lib/publicApi/link/insertLink.js.map +1 -1
  93. package/lib/publicApi/link/removeLink.d.ts +1 -1
  94. package/lib/publicApi/link/removeLink.js +2 -1
  95. package/lib/publicApi/link/removeLink.js.map +1 -1
  96. package/lib/publicApi/list/setListStartNumber.d.ts +1 -1
  97. package/lib/publicApi/list/setListStartNumber.js +2 -1
  98. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  99. package/lib/publicApi/list/setListStyle.d.ts +1 -1
  100. package/lib/publicApi/list/setListStyle.js +2 -1
  101. package/lib/publicApi/list/setListStyle.js.map +1 -1
  102. package/lib/publicApi/list/toggleBullet.d.ts +1 -1
  103. package/lib/publicApi/list/toggleBullet.js +2 -1
  104. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  105. package/lib/publicApi/list/toggleNumbering.d.ts +1 -1
  106. package/lib/publicApi/list/toggleNumbering.js +2 -1
  107. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  108. package/lib/publicApi/segment/applySegmentFormat.d.ts +1 -1
  109. package/lib/publicApi/segment/applySegmentFormat.js +2 -1
  110. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  111. package/lib/publicApi/segment/changeCapitalization.d.ts +1 -1
  112. package/lib/publicApi/segment/changeCapitalization.js +2 -1
  113. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  114. package/lib/publicApi/segment/changeFontSize.d.ts +1 -1
  115. package/lib/publicApi/segment/changeFontSize.js +2 -1
  116. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  117. package/lib/publicApi/segment/setBackgroundColor.d.ts +1 -1
  118. package/lib/publicApi/segment/setBackgroundColor.js +2 -1
  119. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  120. package/lib/publicApi/segment/setFontName.d.ts +1 -1
  121. package/lib/publicApi/segment/setFontName.js +2 -1
  122. package/lib/publicApi/segment/setFontName.js.map +1 -1
  123. package/lib/publicApi/segment/setFontSize.d.ts +1 -1
  124. package/lib/publicApi/segment/setFontSize.js +2 -2
  125. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  126. package/lib/publicApi/segment/setTextColor.d.ts +1 -1
  127. package/lib/publicApi/segment/setTextColor.js +2 -1
  128. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  129. package/lib/publicApi/segment/toggleBold.d.ts +1 -1
  130. package/lib/publicApi/segment/toggleBold.js +2 -1
  131. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  132. package/lib/publicApi/segment/toggleCode.d.ts +1 -1
  133. package/lib/publicApi/segment/toggleCode.js +2 -1
  134. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  135. package/lib/publicApi/segment/toggleItalic.d.ts +1 -1
  136. package/lib/publicApi/segment/toggleItalic.js +2 -1
  137. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  138. package/lib/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  139. package/lib/publicApi/segment/toggleStrikethrough.js +2 -1
  140. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  141. package/lib/publicApi/segment/toggleSubscript.d.ts +1 -1
  142. package/lib/publicApi/segment/toggleSubscript.js +2 -1
  143. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  144. package/lib/publicApi/segment/toggleSuperscript.d.ts +1 -1
  145. package/lib/publicApi/segment/toggleSuperscript.js +2 -1
  146. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  147. package/lib/publicApi/segment/toggleUnderline.d.ts +1 -1
  148. package/lib/publicApi/segment/toggleUnderline.js +2 -1
  149. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  150. package/lib/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  151. package/lib/publicApi/table/applyTableBorderFormat.js +2 -1
  152. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  153. package/lib/publicApi/table/editTable.d.ts +1 -1
  154. package/lib/publicApi/table/editTable.js +2 -1
  155. package/lib/publicApi/table/editTable.js.map +1 -1
  156. package/lib/publicApi/table/formatTable.d.ts +1 -1
  157. package/lib/publicApi/table/formatTable.js +2 -1
  158. package/lib/publicApi/table/formatTable.js.map +1 -1
  159. package/lib/publicApi/table/insertTable.d.ts +1 -1
  160. package/lib/publicApi/table/insertTable.js +2 -1
  161. package/lib/publicApi/table/insertTable.js.map +1 -1
  162. package/lib/publicApi/table/setTableCellShade.d.ts +1 -1
  163. package/lib/publicApi/table/setTableCellShade.js +2 -1
  164. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  165. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  166. package/lib/publicApi/utils/formatImageWithContentModel.js +6 -2
  167. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  168. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  169. package/lib/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  170. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  171. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  172. package/lib/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  173. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  174. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  175. package/lib-amd/index.d.ts +46 -42
  176. package/lib-amd/index.js +48 -44
  177. package/lib-amd/index.js.map +1 -1
  178. package/lib-amd/modelApi/block/setModelAlignment.js.map +1 -1
  179. package/lib-amd/modelApi/block/setModelDirection.js.map +1 -1
  180. package/lib-amd/modelApi/block/setModelIndentation.js.map +1 -1
  181. package/lib-amd/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  182. package/lib-amd/modelApi/common/clearModelFormat.js.map +1 -1
  183. package/lib-amd/modelApi/common/wrapBlock.js.map +1 -1
  184. package/lib-amd/modelApi/entity/insertEntityModel.js.map +1 -1
  185. package/lib-amd/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  186. package/lib-amd/modelApi/image/applyImageBorderFormat.js +2 -1
  187. package/lib-amd/modelApi/image/applyImageBorderFormat.js.map +1 -1
  188. package/lib-amd/modelApi/link/matchLink.d.ts +1 -18
  189. package/lib-amd/modelApi/link/matchLink.js +0 -1
  190. package/lib-amd/modelApi/link/matchLink.js.map +1 -1
  191. package/lib-amd/modelApi/list/findListItemsInSameThread.js.map +1 -1
  192. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  193. package/lib-amd/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  194. package/lib-amd/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  195. package/lib-amd/modelApi/selection/adjustWordSelection.js.map +1 -1
  196. package/lib-amd/modelApi/selection/collapseTableSelection.js.map +1 -1
  197. package/lib-amd/modelApi/table/alignTable.js.map +1 -1
  198. package/lib-amd/modelApi/table/alignTableCell.js.map +1 -1
  199. package/lib-amd/modelApi/table/canMergeCells.js.map +1 -1
  200. package/lib-amd/modelApi/table/clearSelectedCells.js.map +1 -1
  201. package/lib-amd/modelApi/table/createTableStructure.js.map +1 -1
  202. package/lib-amd/modelApi/table/deleteTable.js.map +1 -1
  203. package/lib-amd/modelApi/table/deleteTableColumn.js.map +1 -1
  204. package/lib-amd/modelApi/table/deleteTableRow.js.map +1 -1
  205. package/lib-amd/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  206. package/lib-amd/modelApi/table/insertTableColumn.js.map +1 -1
  207. package/lib-amd/modelApi/table/insertTableRow.js.map +1 -1
  208. package/lib-amd/modelApi/table/mergeTableCells.js.map +1 -1
  209. package/lib-amd/modelApi/table/mergeTableColumn.js.map +1 -1
  210. package/lib-amd/modelApi/table/mergeTableRow.js.map +1 -1
  211. package/lib-amd/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  212. package/lib-amd/modelApi/table/splitTableCellVertically.js.map +1 -1
  213. package/lib-amd/publicApi/block/setAlignment.d.ts +1 -1
  214. package/lib-amd/publicApi/block/setAlignment.js +2 -1
  215. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  216. package/lib-amd/publicApi/block/setDirection.d.ts +1 -1
  217. package/lib-amd/publicApi/block/setDirection.js +2 -1
  218. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  219. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +1 -1
  220. package/lib-amd/publicApi/block/setHeadingLevel.js +2 -1
  221. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  222. package/lib-amd/publicApi/block/setIndentation.d.ts +1 -1
  223. package/lib-amd/publicApi/block/setIndentation.js +2 -1
  224. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  225. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +1 -1
  226. package/lib-amd/publicApi/block/setParagraphMargin.js +2 -1
  227. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  228. package/lib-amd/publicApi/block/setSpacing.d.ts +1 -1
  229. package/lib-amd/publicApi/block/setSpacing.js +2 -1
  230. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  231. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +1 -1
  232. package/lib-amd/publicApi/block/toggleBlockQuote.js +2 -1
  233. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  234. package/lib-amd/publicApi/entity/insertEntity.d.ts +2 -2
  235. package/lib-amd/publicApi/entity/insertEntity.js +2 -1
  236. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  237. package/lib-amd/publicApi/format/clearFormat.d.ts +1 -1
  238. package/lib-amd/publicApi/format/clearFormat.js +2 -1
  239. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  240. package/lib-amd/publicApi/format/getFormatState.d.ts +1 -1
  241. package/lib-amd/publicApi/format/getFormatState.js +2 -1
  242. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  243. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +1 -1
  244. package/lib-amd/publicApi/image/adjustImageSelection.js +2 -1
  245. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  246. package/lib-amd/publicApi/image/changeImage.d.ts +1 -1
  247. package/lib-amd/publicApi/image/changeImage.js +3 -2
  248. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  249. package/lib-amd/publicApi/image/insertImage.d.ts +1 -1
  250. package/lib-amd/publicApi/image/insertImage.js +2 -1
  251. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  252. package/lib-amd/publicApi/image/setImageAltText.d.ts +1 -1
  253. package/lib-amd/publicApi/image/setImageAltText.js +3 -2
  254. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  255. package/lib-amd/publicApi/image/setImageBorder.d.ts +1 -1
  256. package/lib-amd/publicApi/image/setImageBorder.js +4 -3
  257. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  258. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +1 -1
  259. package/lib-amd/publicApi/image/setImageBoxShadow.js +3 -2
  260. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  261. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +1 -1
  262. package/lib-amd/publicApi/link/adjustLinkSelection.js +2 -1
  263. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  264. package/lib-amd/publicApi/link/insertLink.d.ts +1 -1
  265. package/lib-amd/publicApi/link/insertLink.js +2 -1
  266. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  267. package/lib-amd/publicApi/link/removeLink.d.ts +1 -1
  268. package/lib-amd/publicApi/link/removeLink.js +2 -1
  269. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  270. package/lib-amd/publicApi/list/setListStartNumber.d.ts +1 -1
  271. package/lib-amd/publicApi/list/setListStartNumber.js +2 -1
  272. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  273. package/lib-amd/publicApi/list/setListStyle.d.ts +1 -1
  274. package/lib-amd/publicApi/list/setListStyle.js +2 -1
  275. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  276. package/lib-amd/publicApi/list/toggleBullet.d.ts +1 -1
  277. package/lib-amd/publicApi/list/toggleBullet.js +2 -1
  278. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  279. package/lib-amd/publicApi/list/toggleNumbering.d.ts +1 -1
  280. package/lib-amd/publicApi/list/toggleNumbering.js +2 -1
  281. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  282. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +1 -1
  283. package/lib-amd/publicApi/segment/applySegmentFormat.js +2 -1
  284. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  285. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +1 -1
  286. package/lib-amd/publicApi/segment/changeCapitalization.js +2 -1
  287. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  288. package/lib-amd/publicApi/segment/changeFontSize.d.ts +1 -1
  289. package/lib-amd/publicApi/segment/changeFontSize.js +2 -1
  290. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  291. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +1 -1
  292. package/lib-amd/publicApi/segment/setBackgroundColor.js +2 -1
  293. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  294. package/lib-amd/publicApi/segment/setFontName.d.ts +1 -1
  295. package/lib-amd/publicApi/segment/setFontName.js +2 -1
  296. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  297. package/lib-amd/publicApi/segment/setFontSize.d.ts +1 -1
  298. package/lib-amd/publicApi/segment/setFontSize.js +2 -2
  299. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  300. package/lib-amd/publicApi/segment/setTextColor.d.ts +1 -1
  301. package/lib-amd/publicApi/segment/setTextColor.js +2 -1
  302. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  303. package/lib-amd/publicApi/segment/toggleBold.d.ts +1 -1
  304. package/lib-amd/publicApi/segment/toggleBold.js +2 -1
  305. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  306. package/lib-amd/publicApi/segment/toggleCode.d.ts +1 -1
  307. package/lib-amd/publicApi/segment/toggleCode.js +2 -1
  308. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  309. package/lib-amd/publicApi/segment/toggleItalic.d.ts +1 -1
  310. package/lib-amd/publicApi/segment/toggleItalic.js +2 -1
  311. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  312. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  313. package/lib-amd/publicApi/segment/toggleStrikethrough.js +2 -1
  314. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  315. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +1 -1
  316. package/lib-amd/publicApi/segment/toggleSubscript.js +2 -1
  317. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  318. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +1 -1
  319. package/lib-amd/publicApi/segment/toggleSuperscript.js +2 -1
  320. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  321. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +1 -1
  322. package/lib-amd/publicApi/segment/toggleUnderline.js +2 -1
  323. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  324. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  325. package/lib-amd/publicApi/table/applyTableBorderFormat.js +2 -1
  326. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  327. package/lib-amd/publicApi/table/editTable.d.ts +1 -1
  328. package/lib-amd/publicApi/table/editTable.js +2 -1
  329. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  330. package/lib-amd/publicApi/table/formatTable.d.ts +1 -1
  331. package/lib-amd/publicApi/table/formatTable.js +2 -1
  332. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  333. package/lib-amd/publicApi/table/insertTable.d.ts +1 -1
  334. package/lib-amd/publicApi/table/insertTable.js +2 -1
  335. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  336. package/lib-amd/publicApi/table/setTableCellShade.d.ts +1 -1
  337. package/lib-amd/publicApi/table/setTableCellShade.js +2 -1
  338. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  339. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  340. package/lib-amd/publicApi/utils/formatImageWithContentModel.js +6 -2
  341. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  342. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  343. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  344. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  345. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  346. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  347. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  348. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  349. package/lib-mjs/index.d.ts +46 -42
  350. package/lib-mjs/index.js +46 -42
  351. package/lib-mjs/index.js.map +1 -1
  352. package/lib-mjs/modelApi/block/setModelAlignment.js.map +1 -1
  353. package/lib-mjs/modelApi/block/setModelDirection.js.map +1 -1
  354. package/lib-mjs/modelApi/block/setModelIndentation.js.map +1 -1
  355. package/lib-mjs/modelApi/block/toggleModelBlockQuote.js.map +1 -1
  356. package/lib-mjs/modelApi/common/clearModelFormat.js.map +1 -1
  357. package/lib-mjs/modelApi/common/wrapBlock.js.map +1 -1
  358. package/lib-mjs/modelApi/entity/insertEntityModel.js.map +1 -1
  359. package/lib-mjs/modelApi/image/applyImageBorderFormat.d.ts +1 -1
  360. package/lib-mjs/modelApi/image/applyImageBorderFormat.js +1 -1
  361. package/lib-mjs/modelApi/image/applyImageBorderFormat.js.map +1 -1
  362. package/lib-mjs/modelApi/link/matchLink.d.ts +1 -18
  363. package/lib-mjs/modelApi/link/matchLink.js +0 -1
  364. package/lib-mjs/modelApi/link/matchLink.js.map +1 -1
  365. package/lib-mjs/modelApi/list/findListItemsInSameThread.js.map +1 -1
  366. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  367. package/lib-mjs/modelApi/selection/adjustSegmentSelection.js.map +1 -1
  368. package/lib-mjs/modelApi/selection/adjustTrailingSpaceSelection.js.map +1 -1
  369. package/lib-mjs/modelApi/selection/adjustWordSelection.js.map +1 -1
  370. package/lib-mjs/modelApi/selection/collapseTableSelection.js.map +1 -1
  371. package/lib-mjs/modelApi/table/alignTable.js.map +1 -1
  372. package/lib-mjs/modelApi/table/alignTableCell.js.map +1 -1
  373. package/lib-mjs/modelApi/table/canMergeCells.js.map +1 -1
  374. package/lib-mjs/modelApi/table/clearSelectedCells.js.map +1 -1
  375. package/lib-mjs/modelApi/table/createTableStructure.js.map +1 -1
  376. package/lib-mjs/modelApi/table/deleteTable.js.map +1 -1
  377. package/lib-mjs/modelApi/table/deleteTableColumn.js.map +1 -1
  378. package/lib-mjs/modelApi/table/deleteTableRow.js.map +1 -1
  379. package/lib-mjs/modelApi/table/ensureFocusableParagraphForTable.js.map +1 -1
  380. package/lib-mjs/modelApi/table/insertTableColumn.js.map +1 -1
  381. package/lib-mjs/modelApi/table/insertTableRow.js.map +1 -1
  382. package/lib-mjs/modelApi/table/mergeTableCells.js.map +1 -1
  383. package/lib-mjs/modelApi/table/mergeTableColumn.js.map +1 -1
  384. package/lib-mjs/modelApi/table/mergeTableRow.js.map +1 -1
  385. package/lib-mjs/modelApi/table/splitTableCellHorizontally.js.map +1 -1
  386. package/lib-mjs/modelApi/table/splitTableCellVertically.js.map +1 -1
  387. package/lib-mjs/publicApi/block/setAlignment.d.ts +1 -1
  388. package/lib-mjs/publicApi/block/setAlignment.js +1 -1
  389. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  390. package/lib-mjs/publicApi/block/setDirection.d.ts +1 -1
  391. package/lib-mjs/publicApi/block/setDirection.js +1 -1
  392. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  393. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +1 -1
  394. package/lib-mjs/publicApi/block/setHeadingLevel.js +1 -1
  395. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  396. package/lib-mjs/publicApi/block/setIndentation.d.ts +1 -1
  397. package/lib-mjs/publicApi/block/setIndentation.js +1 -1
  398. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  399. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +1 -1
  400. package/lib-mjs/publicApi/block/setParagraphMargin.js +1 -1
  401. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  402. package/lib-mjs/publicApi/block/setSpacing.d.ts +1 -1
  403. package/lib-mjs/publicApi/block/setSpacing.js +1 -1
  404. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  405. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +1 -1
  406. package/lib-mjs/publicApi/block/toggleBlockQuote.js +1 -1
  407. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  408. package/lib-mjs/publicApi/entity/insertEntity.d.ts +2 -2
  409. package/lib-mjs/publicApi/entity/insertEntity.js +1 -1
  410. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  411. package/lib-mjs/publicApi/format/clearFormat.d.ts +1 -1
  412. package/lib-mjs/publicApi/format/clearFormat.js +1 -1
  413. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  414. package/lib-mjs/publicApi/format/getFormatState.d.ts +1 -1
  415. package/lib-mjs/publicApi/format/getFormatState.js +1 -1
  416. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  417. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +1 -1
  418. package/lib-mjs/publicApi/image/adjustImageSelection.js +1 -1
  419. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  420. package/lib-mjs/publicApi/image/changeImage.d.ts +1 -1
  421. package/lib-mjs/publicApi/image/changeImage.js +2 -2
  422. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  423. package/lib-mjs/publicApi/image/insertImage.d.ts +1 -1
  424. package/lib-mjs/publicApi/image/insertImage.js +1 -1
  425. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  426. package/lib-mjs/publicApi/image/setImageAltText.d.ts +1 -1
  427. package/lib-mjs/publicApi/image/setImageAltText.js +2 -2
  428. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  429. package/lib-mjs/publicApi/image/setImageBorder.d.ts +1 -1
  430. package/lib-mjs/publicApi/image/setImageBorder.js +3 -3
  431. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  432. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +1 -1
  433. package/lib-mjs/publicApi/image/setImageBoxShadow.js +2 -2
  434. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  435. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +1 -1
  436. package/lib-mjs/publicApi/link/adjustLinkSelection.js +1 -1
  437. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  438. package/lib-mjs/publicApi/link/insertLink.d.ts +1 -1
  439. package/lib-mjs/publicApi/link/insertLink.js +1 -1
  440. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  441. package/lib-mjs/publicApi/link/removeLink.d.ts +1 -1
  442. package/lib-mjs/publicApi/link/removeLink.js +1 -1
  443. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  444. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +1 -1
  445. package/lib-mjs/publicApi/list/setListStartNumber.js +1 -1
  446. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  447. package/lib-mjs/publicApi/list/setListStyle.d.ts +1 -1
  448. package/lib-mjs/publicApi/list/setListStyle.js +1 -1
  449. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  450. package/lib-mjs/publicApi/list/toggleBullet.d.ts +1 -1
  451. package/lib-mjs/publicApi/list/toggleBullet.js +1 -1
  452. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  453. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +1 -1
  454. package/lib-mjs/publicApi/list/toggleNumbering.js +1 -1
  455. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  456. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +1 -1
  457. package/lib-mjs/publicApi/segment/applySegmentFormat.js +1 -1
  458. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  459. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +1 -1
  460. package/lib-mjs/publicApi/segment/changeCapitalization.js +1 -1
  461. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  462. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +1 -1
  463. package/lib-mjs/publicApi/segment/changeFontSize.js +1 -1
  464. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  465. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +1 -1
  466. package/lib-mjs/publicApi/segment/setBackgroundColor.js +1 -1
  467. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  468. package/lib-mjs/publicApi/segment/setFontName.d.ts +1 -1
  469. package/lib-mjs/publicApi/segment/setFontName.js +1 -1
  470. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  471. package/lib-mjs/publicApi/segment/setFontSize.d.ts +1 -1
  472. package/lib-mjs/publicApi/segment/setFontSize.js +1 -1
  473. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  474. package/lib-mjs/publicApi/segment/setTextColor.d.ts +1 -1
  475. package/lib-mjs/publicApi/segment/setTextColor.js +1 -1
  476. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  477. package/lib-mjs/publicApi/segment/toggleBold.d.ts +1 -1
  478. package/lib-mjs/publicApi/segment/toggleBold.js +1 -1
  479. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  480. package/lib-mjs/publicApi/segment/toggleCode.d.ts +1 -1
  481. package/lib-mjs/publicApi/segment/toggleCode.js +1 -1
  482. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  483. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +1 -1
  484. package/lib-mjs/publicApi/segment/toggleItalic.js +1 -1
  485. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  486. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +1 -1
  487. package/lib-mjs/publicApi/segment/toggleStrikethrough.js +1 -1
  488. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  489. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +1 -1
  490. package/lib-mjs/publicApi/segment/toggleSubscript.js +1 -1
  491. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  492. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +1 -1
  493. package/lib-mjs/publicApi/segment/toggleSuperscript.js +1 -1
  494. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  495. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +1 -1
  496. package/lib-mjs/publicApi/segment/toggleUnderline.js +1 -1
  497. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  498. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +1 -1
  499. package/lib-mjs/publicApi/table/applyTableBorderFormat.js +1 -1
  500. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  501. package/lib-mjs/publicApi/table/editTable.d.ts +1 -1
  502. package/lib-mjs/publicApi/table/editTable.js +1 -1
  503. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  504. package/lib-mjs/publicApi/table/formatTable.d.ts +1 -1
  505. package/lib-mjs/publicApi/table/formatTable.js +1 -1
  506. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  507. package/lib-mjs/publicApi/table/insertTable.d.ts +1 -1
  508. package/lib-mjs/publicApi/table/insertTable.js +1 -1
  509. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  510. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +1 -1
  511. package/lib-mjs/publicApi/table/setTableCellShade.js +1 -1
  512. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  513. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +5 -2
  514. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js +5 -2
  515. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  516. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +4 -1
  517. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js +4 -1
  518. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  519. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +7 -1
  520. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js +7 -1
  521. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  522. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  523. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EACH,OAAO,EACP,UAAU,EACV,0BAA0B,EAC1B,UAAU,GACb,MAAM,6BAA6B,CAAC;AAErC,4BAA4B;AAC5B,IAAM,SAAS,GAAG,cAAc,CAAC;AACjC,wCAAwC;AACxC,IAAM,YAAY,GAAG,cAAc,CAAC;AACpC,sDAAsD;AACtD,IAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAC9B,MAAe,EACf,IAAY,EACZ,WAAoB,EACpB,WAAoB,EACpB,MAAe;IAEf,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC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ACJ,CAAC;KACL;AACL,CAAC;AAED,IAAM,UAAU,GAAG,UACf,GAAW,EACX,WAAoB,EACpB,MAAe,EACf,SAAyB;IAAzB,0BAAA,EAAA,gBAAyB;IAEzB,OAAO;QACH,OAAO,EAAE,EAAE;QACX,MAAM,EAAE;YACJ,IAAI,EAAE,GAAG;YACT,WAAW,aAAA;YACX,MAAM,QAAA;YACN,SAAS,EAAE,SAAS;SACvB;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAChC,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,GAAG,CAAC;KACd;IAED,4BAA4B;IAC5B,oEAAoE;IACpE,iEAAiE;IACjE,qDAAqD;IACrD,+BAA+B;IAC/B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QAC3B,IAAI,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;YAC/B,MAAM,GAAG,SAAS,CAAC;SACtB;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;YACnC,MAAM,GAAG,QAAQ,CAAC;SACrB;aAAM;YACH,sBAAsB;YACtB,MAAM,GAAG,SAAS,CAAC;SACtB;KACJ;IAED,OAAO,MAAM,GAAG,GAAG,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC","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 default 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
+ {"version":3,"file":"insertLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/link/insertLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE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,GAAG,SAAS,CAAC;SACtB;KACJ;IAED,OAAO,MAAM,GAAG,GAAG,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC","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"]}
@@ -5,4 +5,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
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: IEditor): void;
8
+ export declare function removeLink(editor: IEditor): void;
@@ -6,7 +6,7 @@ import { getSelectedSegments } from 'roosterjs-content-model-core';
6
6
  * If only part of a link is selected, the whole link style will be removed.
7
7
  * @param editor The editor instance
8
8
  */
9
- export default function removeLink(editor) {
9
+ export function removeLink(editor) {
10
10
  editor.focus();
11
11
  editor.formatContentModel(function (model) {
12
12
  adjustSegmentSelection(model, function (target) { return !!target.isSelected && !!target.link; }, function (target, ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,sBAAsB,CAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;YACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;gBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QADnE,CACmE,CAC1E,CAAC;QAEF,IAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YACpB,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,SAAS,GAAG,IAAI,CAAC;gBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACrB,CAAC,EACD;QACI,OAAO,EAAE,YAAY;KACxB,CACJ,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"removeLink.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/link/removeLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,sBAAsB,CAClB,KAAK,EACL,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,EAApC,CAAoC,EAC9C,UAAC,MAAM,EAAE,GAAG;YACR,OAAA,MAAM,CAAC,UAAU,IAAI,8FAA8F;gBACnH,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QADnE,CACmE,CAC1E,CAAC;QAEF,IAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7E,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YACpB,IAAI,OAAO,CAAC,IAAI,EAAE;gBACd,SAAS,GAAG,IAAI,CAAC;gBAEjB,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACrB,CAAC,EACD;QACI,OAAO,EAAE,YAAY;KACxB,CACJ,CAAC;AACN,CAAC","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"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
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: IEditor, value: number): void;
7
+ export declare function setListStartNumber(editor: IEditor, value: number): void;
@@ -4,7 +4,7 @@ import { getFirstSelectedListItem } from 'roosterjs-content-model-core';
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, value) {
7
+ export function setListStartNumber(editor, value) {
8
8
  editor.focus();
9
9
  editor.formatContentModel(function (model) {
10
10
  var listItem = getFirstSelectedListItem(model);
@@ -1 +1 @@
1
- {"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAGxE;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAe,EAAE,KAAa;IACrE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACjD,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;QAE5D,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;YAEzC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,oBAAoB;KAChC,CACJ,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"setListStartNumber.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/setListStartNumber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAGxE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,KAAa;IAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACjD,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;QAE5D,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;YAEzC,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,oBAAoB;KAChC,CACJ,CAAC;AACN,CAAC","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"]}
@@ -4,4 +4,4 @@ import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types'
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: IEditor, style: ListMetadataFormat): void;
7
+ export declare function setListStyle(editor: IEditor, style: ListMetadataFormat): void;
@@ -5,7 +5,7 @@ import { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-
5
5
  * @param editor The editor to operate on
6
6
  * @param style The target list item style to set
7
7
  */
8
- export default function setListStyle(editor, style) {
8
+ export function setListStyle(editor, style) {
9
9
  editor.focus();
10
10
  editor.formatContentModel(function (model) {
11
11
  var listItem = getFirstSelectedListItem(model);
@@ -1 +1 @@
1
- {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG5F;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAe,EAAE,KAAyB;IAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,QAAQ,EAAE;YACV,IAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;gBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;gBAE1C,IAAI,KAAK,EAAE;oBACP,kBAAkB,CAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;iBAC7E;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG5F;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,KAAyB;IACnE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;QACD,IAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,QAAQ,EAAE;YACV,IAAM,SAAS,GAAG,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;gBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;gBAE1C,IAAI,KAAK,EAAE;oBACP,kBAAkB,CAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;iBAC7E;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","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"]}
@@ -6,4 +6,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
6
6
  * @param editor The editor to operate on
7
7
  * @param removeMargins true to remove margins, false to keep margins @default false
8
8
  */
9
- export default function toggleBullet(editor: IEditor, removeMargins?: boolean): void;
9
+ export declare function toggleBullet(editor: IEditor, removeMargins?: boolean): void;
@@ -6,7 +6,7 @@ import { setListType } from '../../modelApi/list/setListType';
6
6
  * @param editor The editor to operate on
7
7
  * @param removeMargins true to remove margins, false to keep margins @default false
8
8
  */
9
- export default function toggleBullet(editor, removeMargins) {
9
+ export function toggleBullet(editor, removeMargins) {
10
10
  if (removeMargins === void 0) { removeMargins = false; }
11
11
  editor.focus();
12
12
  editor.formatContentModel(function (model, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAe,EAAE,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;IAChF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;IACxE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC,EACD;QACI,OAAO,EAAE,cAAc;KAC1B,CACJ,CAAC;AACN,CAAC","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"]}
@@ -6,4 +6,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
6
6
  * @param editor The editor to operate on
7
7
  * @param removeMargins true to remove margins, false to keep margins @default false
8
8
  */
9
- export default function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;
9
+ export declare function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;
@@ -6,7 +6,7 @@ import { setListType } from '../../modelApi/list/setListType';
6
6
  * @param editor The editor to operate on
7
7
  * @param removeMargins true to remove margins, false to keep margins @default false
8
8
  */
9
- export default function toggleNumbering(editor, removeMargins) {
9
+ export function toggleNumbering(editor, removeMargins) {
10
10
  if (removeMargins === void 0) { removeMargins = false; }
11
11
  editor.focus();
12
12
  editor.formatContentModel(function (model, context) {
@@ -1 +1 @@
1
- {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,MAAe,EAAE,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;IACnF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC,EACD;QACI,OAAO,EAAE,iBAAiB;KAC7B,CACJ,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAe,EAAE,aAA8B;IAA9B,8BAAA,EAAA,qBAA8B;IAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;QACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;QAEtC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC,EACD;QACI,OAAO,EAAE,iBAAiB;KAC7B,CACJ,CAAC;AACN,CAAC","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"]}
@@ -4,4 +4,4 @@ import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model
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: IEditor, newFormat: ContentModelSegmentFormat): void;
7
+ export declare function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;
@@ -4,7 +4,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
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, newFormat) {
7
+ export function applySegmentFormat(editor, newFormat) {
8
8
  formatSegmentWithContentModel(editor, 'applySegmentFormat', function (format) {
9
9
  format.backgroundColor = newFormat.backgroundColor;
10
10
  format.fontFamily = newFormat.fontFamily;
@@ -1 +1 @@
1
- {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAe,EAAE,SAAoC;IAC5F,6BAA6B,CACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;QACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;QACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;QACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;QAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;QACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;IAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","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 default 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
+ {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,SAAoC;IACpF,6BAA6B,CACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;QACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;QACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;QACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;QACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;QAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;QACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;IAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","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"]}
@@ -7,4 +7,4 @@ import type { IEditor } 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: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
10
+ export declare function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
@@ -7,7 +7,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
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, capitalization, language) {
10
+ export function changeCapitalization(editor, capitalization, language) {
11
11
  editor.focus();
12
12
  formatSegmentWithContentModel(editor, 'changeCapitalization', function (_, __, segment) {
13
13
  if ((segment === null || segment === void 0 ? void 0 : segment.segmentType) == 'Text') {
@@ -1 +1 @@
1
- {"version":3,"file":"changeCapitalization.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeCapitalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CACxC,MAAe,EACf,cAAqE,EACrE,QAAiB;IAEjB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CAAC,MAAM,EAAE,sBAAsB,EAAE,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACzE,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,MAAM,EAAE;YAChC,QAAQ,cAAc,EAAE;gBACpB,KAAK,WAAW;oBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;oBACxD,MAAM;gBAEV,KAAK,WAAW;oBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;oBACxD,MAAM;gBAEV,KAAK,YAAY;oBACb,IAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACvC,SAAS,CAAC,CAAC,CAAC;4BACR,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC;gCAClD,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBAC7B;oBAED,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACnC,MAAM;gBAEV,KAAK,UAAU;oBACX,IAAM,gBAAgB,GAAG,aAAa,CAAC;oBACvC,2CAA2C;oBAC3C,2EAA2E;oBAC3E,2EAA2E;oBAC3E,uEAAuE;oBACvE,sDAAsD;oBACtD,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,GAAG,gBAAgB,GAAG,SAAS,EAAE,GAAG,CAAC,CAAC;oBAE1E,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;yBACtB,iBAAiB,CAAC,QAAQ,CAAC;yBAC3B,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAjC,CAAiC,CAAC,CAAC;oBAChE,MAAM;aACb;SACJ;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Change the capitalization of text in the selection\n * @param editor The editor instance\n * @param capitalization The case option\n * @param language Optional parameter for language string that should comply to \"IETF BCP 47 Tags for\n * Identifying Languages\". For example: 'en' or 'en-US' for English, 'tr' for Turkish.\n * Default is the host environment’s current locale.\n */\nexport default function changeCapitalization(\n editor: IEditor,\n capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize',\n language?: string\n) {\n editor.focus();\n\n formatSegmentWithContentModel(editor, 'changeCapitalization', (_, __, segment) => {\n if (segment?.segmentType == 'Text') {\n switch (capitalization) {\n case 'lowerCase':\n segment.text = segment.text.toLocaleLowerCase(language);\n break;\n\n case 'upperCase':\n segment.text = segment.text.toLocaleUpperCase(language);\n break;\n\n case 'capitalize':\n const wordArray = segment.text.toLocaleLowerCase(language).split(' ');\n\n for (let i = 0; i < wordArray.length; i++) {\n wordArray[i] =\n wordArray[i].charAt(0).toLocaleUpperCase(language) +\n wordArray[i].slice(1);\n }\n\n segment.text = wordArray.join(' ');\n break;\n\n case 'sentence':\n const punctuationMarks = '[\\\\.\\\\!\\\\?]';\n // Find a match of a word character either:\n // - At the beginning of a string with or without preceding whitespace, for\n // example: ' hello world' and 'hello world' strings would both match 'h'.\n // - Or preceded by a punctuation mark and at least one whitespace, for\n // example 'yes. hello world' would match 'y' and 'h'.\n const regex = new RegExp('^\\\\s*\\\\w|' + punctuationMarks + '\\\\s+\\\\w', 'g');\n\n segment.text = segment.text\n .toLocaleLowerCase(language)\n .replace(regex, match => match.toLocaleUpperCase(language));\n break;\n }\n }\n });\n}\n"]}
1
+ {"version":3,"file":"changeCapitalization.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/changeCapitalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAChC,MAAe,EACf,cAAqE,EACrE,QAAiB;IAEjB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CAAC,MAAM,EAAE,sBAAsB,EAAE,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;QACzE,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,MAAM,EAAE;YAChC,QAAQ,cAAc,EAAE;gBACpB,KAAK,WAAW;oBACZ,OAAO,CAAC,IAAI,GA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SegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Change the capitalization of text in the selection\n * @param editor The editor instance\n * @param capitalization The case option\n * @param language Optional parameter for language string that should comply to \"IETF BCP 47 Tags for\n * Identifying Languages\". For example: 'en' or 'en-US' for English, 'tr' for Turkish.\n * Default is the host environment’s current locale.\n */\nexport function changeCapitalization(\n editor: IEditor,\n capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize',\n language?: string\n) {\n editor.focus();\n\n formatSegmentWithContentModel(editor, 'changeCapitalization', (_, __, segment) => {\n if (segment?.segmentType == 'Text') {\n switch (capitalization) {\n case 'lowerCase':\n segment.text = segment.text.toLocaleLowerCase(language);\n break;\n\n case 'upperCase':\n segment.text = segment.text.toLocaleUpperCase(language);\n break;\n\n case 'capitalize':\n const wordArray = segment.text.toLocaleLowerCase(language).split(' ');\n\n for (let i = 0; i < wordArray.length; i++) {\n wordArray[i] =\n wordArray[i].charAt(0).toLocaleUpperCase(language) +\n wordArray[i].slice(1);\n }\n\n segment.text = wordArray.join(' ');\n break;\n\n case 'sentence':\n const punctuationMarks = '[\\\\.\\\\!\\\\?]';\n // Find a match of a word character either:\n // - At the beginning of a string with or without preceding whitespace, for\n // example: ' hello world' and 'hello world' strings would both match 'h'.\n // - Or preceded by a punctuation mark and at least one whitespace, for\n // example 'yes. hello world' would match 'y' and 'h'.\n const regex = new RegExp('^\\\\s*\\\\w|' + punctuationMarks + '\\\\s+\\\\w', 'g');\n\n segment.text = segment.text\n .toLocaleLowerCase(language)\n .replace(regex, match => match.toLocaleUpperCase(language));\n break;\n }\n }\n });\n}\n"]}
@@ -5,4 +5,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
5
5
  * @param change Whether increase or decrease font size
6
6
  * @param fontSizes A sorted font size array, in pt. Default value is FONT_SIZES
7
7
  */
8
- export default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;
8
+ export declare function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;
@@ -14,7 +14,7 @@ var MAX_FONT_SIZE = 1000;
14
14
  * @param change Whether increase or decrease font size
15
15
  * @param fontSizes A sorted font size array, in pt. Default value is FONT_SIZES
16
16
  */
17
- export default function changeFontSize(editor, change) {
17
+ export function changeFontSize(editor, change) {
18
18
  editor.focus();
19
19
  formatSegmentWithContentModel(editor, 'changeFontSize', function (format, _, __, paragraph) { return changeFontSizeInternal(change, format, paragraph); }, undefined /* segmentHasStyleCallback*/, true /*includingFormatHandler*/);
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"changeFontSize.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeFontSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAOpD;;;GAGG;AACH,IAAM,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAClF,IAAM,aAAa,GAAG,CAAC,CAAC;AACxB,IAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAe,EAAE,MAA+B;IACnF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,gBAAgB,EAChB,UAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,IAAK,OAAA,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAjD,CAAiD,EAC/E,SA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AAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;KACxE;SAAM,IAAI,UAAU,IAAI,CAAC,EAAE;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACvC,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE;gBACnB,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBAClB,MAAM;aACT;SACJ;KACJ;SAAM;QACH,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5C,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE;gBACnB,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBAClB,MAAM;aACT;SACJ;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport { setFontSizeInternal } from './setFontSize';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Default font size sequence, in pt. Suggest editor UI use this sequence as your font size list,\n * So that when increase/decrease font size, the font size can match the sequence of your font size picker\n */\nconst FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];\nconst MIN_FONT_SIZE = 1;\nconst MAX_FONT_SIZE = 1000;\n\n/**\n * Increase or decrease font size in selection\n * @param editor The editor instance\n * @param change Whether increase or decrease font size\n * @param fontSizes A sorted font size array, in pt. Default value is FONT_SIZES\n */\nexport default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease') {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'changeFontSize',\n (format, _, __, paragraph) => changeFontSizeInternal(change, format, paragraph),\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n\nfunction changeFontSizeInternal(\n change: 'increase' | 'decrease',\n format: ContentModelSegmentFormat,\n paragraph: ContentModelParagraph | null\n) {\n if (format.fontSize) {\n const sizeInPt = parseValueWithUnit(format.fontSize, undefined /*element*/, 'pt');\n\n if (sizeInPt > 0) {\n const newSize = getNewFontSize(sizeInPt, change == 'increase' ? 1 : -1, FONT_SIZES);\n\n setFontSizeInternal(newSize + 'pt', format, paragraph);\n }\n }\n}\n\nfunction getNewFontSize(pt: number, changeBase: 1 | -1, fontSizes: number[]): number {\n pt = changeBase == 1 ? Math.floor(pt) : Math.ceil(pt);\n const last = fontSizes[fontSizes.length - 1];\n if (pt <= fontSizes[0]) {\n pt = Math.max(pt + changeBase, MIN_FONT_SIZE);\n } else if (pt > last || (pt == last && changeBase == 1)) {\n pt = pt / 10;\n pt = changeBase == 1 ? Math.floor(pt) : Math.ceil(pt);\n pt = Math.min(Math.max((pt + changeBase) * 10, last), MAX_FONT_SIZE);\n } else if (changeBase == 1) {\n for (let i = 0; i < fontSizes.length; i++) {\n if (pt < fontSizes[i]) {\n pt = fontSizes[i];\n break;\n }\n }\n } else {\n for (let i = fontSizes.length - 1; i >= 0; i--) {\n if (pt > fontSizes[i]) {\n pt = fontSizes[i];\n break;\n }\n }\n }\n return pt;\n}\n"]}
1
+ {"version":3,"file":"changeFontSize.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/changeFontSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,mBA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AS,CAAC,CAAC,CAAC,EAAE;gBACnB,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;gBAClB,MAAM;aACT;SACJ;KACJ;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport { setFontSizeInternal } from './setFontSize';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Default font size sequence, in pt. Suggest editor UI use this sequence as your font size list,\n * So that when increase/decrease font size, the font size can match the sequence of your font size picker\n */\nconst FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];\nconst MIN_FONT_SIZE = 1;\nconst MAX_FONT_SIZE = 1000;\n\n/**\n * Increase or decrease font size in selection\n * @param editor The editor instance\n * @param change Whether increase or decrease font size\n * @param fontSizes A sorted font size array, in pt. Default value is FONT_SIZES\n */\nexport function changeFontSize(editor: IEditor, change: 'increase' | 'decrease') {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'changeFontSize',\n (format, _, __, paragraph) => changeFontSizeInternal(change, format, paragraph),\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n\nfunction changeFontSizeInternal(\n change: 'increase' | 'decrease',\n format: ContentModelSegmentFormat,\n paragraph: ContentModelParagraph | null\n) {\n if (format.fontSize) {\n const sizeInPt = parseValueWithUnit(format.fontSize, undefined /*element*/, 'pt');\n\n if (sizeInPt > 0) {\n const newSize = getNewFontSize(sizeInPt, change == 'increase' ? 1 : -1, FONT_SIZES);\n\n setFontSizeInternal(newSize + 'pt', format, paragraph);\n }\n }\n}\n\nfunction getNewFontSize(pt: number, changeBase: 1 | -1, fontSizes: number[]): number {\n pt = changeBase == 1 ? Math.floor(pt) : Math.ceil(pt);\n const last = fontSizes[fontSizes.length - 1];\n if (pt <= fontSizes[0]) {\n pt = Math.max(pt + changeBase, MIN_FONT_SIZE);\n } else if (pt > last || (pt == last && changeBase == 1)) {\n pt = pt / 10;\n pt = changeBase == 1 ? Math.floor(pt) : Math.ceil(pt);\n pt = Math.min(Math.max((pt + changeBase) * 10, last), MAX_FONT_SIZE);\n } else if (changeBase == 1) {\n for (let i = 0; i < fontSizes.length; i++) {\n if (pt < fontSizes[i]) {\n pt = fontSizes[i];\n break;\n }\n }\n } else {\n for (let i = fontSizes.length - 1; i >= 0; i--) {\n if (pt > fontSizes[i]) {\n pt = fontSizes[i];\n break;\n }\n }\n }\n return pt;\n}\n"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor to operate on
5
5
  * @param backgroundColor The color to set. Pass null to remove existing color.
6
6
  */
7
- export default function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;
7
+ export declare function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;
@@ -6,7 +6,7 @@ import { setSelection } from 'roosterjs-content-model-core';
6
6
  * @param editor The editor to operate on
7
7
  * @param backgroundColor The color to set. Pass null to remove existing color.
8
8
  */
9
- export default function setBackgroundColor(editor, backgroundColor) {
9
+ export function setBackgroundColor(editor, backgroundColor) {
10
10
  editor.focus();
11
11
  var lastParagraph = null;
12
12
  var lastSegmentIndex = -1;
@@ -1 +1 @@
1
- {"version":3,"file":"setBackgroundColor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setBackgroundColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,MAAe,EAAE,eAA8B;IACtF,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAI,aAAa,GAAiC,IAAI,CAAC;IACvD,IAAI,gBAAgB,GAAW,CAAC,CAAC,CAAC;IAElC,6BAA6B,CACzB,MAAM,EACN,oBAAoB,EACpB,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS;QAC1B,IAAI,eAAe,KAAK,IAAI,EAAE;YAC1B,OAAO,MAAM,CAAC,eAAe,CAAC;SACjC;aAAM;YACH,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;SAC5C;QAED,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,WAAW,IAAI,iBAAiB,EAAE;YAClE,aAAa,GAAG,SAAS,CAAC;YAC1B,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC9D;IACL,CAAC,EACD,SAAS,CAAC,2BAA2B,EACrC,SAAS,CAAC,yBAAyB,EACnC,UAAA,KAAK;;QACD,IAAI,aAAa,IAAI,gBAAgB,IAAI,CAAC,EAAE;YACxC,IAAM,MAAM,GAAG,qBAAqB,CAChC,MAAA,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,0CAAE,MAAM,CACnD,CAAC;YAEF,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;YAC/D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SACvC;IACL,CAAC,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { setSelection } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set background color\n * @param editor The editor to operate on\n * @param backgroundColor The color to set. Pass null to remove existing color.\n */\nexport default function setBackgroundColor(editor: IEditor, backgroundColor: string | null) {\n editor.focus();\n\n let lastParagraph: ContentModelParagraph | null = null;\n let lastSegmentIndex: number = -1;\n\n formatSegmentWithContentModel(\n editor,\n 'setBackgroundColor',\n (format, _, segment, paragraph) => {\n if (backgroundColor === null) {\n delete format.backgroundColor;\n } else {\n format.backgroundColor = backgroundColor;\n }\n\n if (segment && paragraph && segment.segmentType != 'SelectionMarker') {\n lastParagraph = paragraph;\n lastSegmentIndex = lastParagraph.segments.indexOf(segment);\n }\n },\n undefined /*segmentHasStyleCallback*/,\n undefined /*includingFormatHolder*/,\n model => {\n if (lastParagraph && lastSegmentIndex >= 0) {\n const marker = createSelectionMarker(\n lastParagraph.segments[lastSegmentIndex]?.format\n );\n\n lastParagraph.segments.splice(lastSegmentIndex + 1, 0, marker);\n setSelection(model, marker, marker);\n }\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setBackgroundColor.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/setBackgroundColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,eAA8B;IAC9E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,IAAI,aAAa,GAAiC,IAAI,CAAC;IACvD,IAAI,gBAAgB,GAAW,CAAC,CAAC,CAAC;IAElC,6BAA6B,CACzB,MAAM,EACN,oBAAoB,EACpB,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS;QAC1B,IAAI,eAAe,KAAK,IAAI,EAAE;YAC1B,OAAO,MAAM,CAAC,eAAe,CAAC;SACjC;aAAM;YACH,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;SAC5C;QAED,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,WAAW,IAAI,iBAAiB,EAAE;YAClE,aAAa,GAAG,SAAS,CAAC;YAC1B,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC9D;IACL,CAAC,EACD,SAAS,CAAC,2BAA2B,EACrC,SAAS,CAAC,yBAAyB,EACnC,UAAA,KAAK;;QACD,IAAI,aAAa,IAAI,gBAAgB,IAAI,CAAC,EAAE;YACxC,IAAM,MAAM,GAAG,qBAAqB,CAChC,MAAA,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,0CAAE,MAAM,CACnD,CAAC;YAEF,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;YAC/D,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SACvC;IACL,CAAC,CACJ,CAAC;AACN,CAAC","sourcesContent":["import { createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { setSelection } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set background color\n * @param editor The editor to operate on\n * @param backgroundColor The color to set. Pass null to remove existing color.\n */\nexport function setBackgroundColor(editor: IEditor, backgroundColor: string | null) {\n editor.focus();\n\n let lastParagraph: ContentModelParagraph | null = null;\n let lastSegmentIndex: number = -1;\n\n formatSegmentWithContentModel(\n editor,\n 'setBackgroundColor',\n (format, _, segment, paragraph) => {\n if (backgroundColor === null) {\n delete format.backgroundColor;\n } else {\n format.backgroundColor = backgroundColor;\n }\n\n if (segment && paragraph && segment.segmentType != 'SelectionMarker') {\n lastParagraph = paragraph;\n lastSegmentIndex = lastParagraph.segments.indexOf(segment);\n }\n },\n undefined /*segmentHasStyleCallback*/,\n undefined /*includingFormatHolder*/,\n model => {\n if (lastParagraph && lastSegmentIndex >= 0) {\n const marker = createSelectionMarker(\n lastParagraph.segments[lastSegmentIndex]?.format\n );\n\n lastParagraph.segments.splice(lastSegmentIndex + 1, 0, marker);\n setSelection(model, marker, marker);\n }\n }\n );\n}\n"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor to operate on
5
5
  * @param fontName The font name to set
6
6
  */
7
- export default function setFontName(editor: IEditor, fontName: string): void;
7
+ export declare function setFontName(editor: IEditor, fontName: string): void;
@@ -4,7 +4,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
4
4
  * @param editor The editor to operate on
5
5
  * @param fontName The font name to set
6
6
  */
7
- export default function setFontName(editor, fontName) {
7
+ export function setFontName(editor, fontName) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'setFontName', function (format, _, segment) {
10
10
  format.fontFamily = fontName;
@@ -1 +1 @@
1
- {"version":3,"file":"setFontName.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAe,EAAE,QAAgB;IACjE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;QACf,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;QAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;SAC7C;IACL,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set font name\n * @param editor The editor to operate on\n * @param fontName The font name to set\n */\nexport default function setFontName(editor: IEditor, fontName: string) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setFontName',\n (format, _, segment) => {\n format.fontFamily = fontName;\n\n if (segment?.code) {\n segment.code.format.fontFamily = fontName;\n }\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
1
+ {"version":3,"file":"setFontName.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/setFontName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,QAAgB;IACzD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;QACf,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;QAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;SAC7C;IACL,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set font name\n * @param editor The editor to operate on\n * @param fontName The font name to set\n */\nexport function setFontName(editor: IEditor, fontName: string) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setFontName',\n (format, _, segment) => {\n format.fontFamily = fontName;\n\n if (segment?.code) {\n segment.code.format.fontFamily = fontName;\n }\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
@@ -4,7 +4,7 @@ import type { ContentModelParagraph, ContentModelSegmentFormat, IEditor } from '
4
4
  * @param editor The editor to operate on
5
5
  * @param fontSize The font size to set
6
6
  */
7
- export default function setFontSize(editor: IEditor, fontSize: string): void;
7
+ export declare function setFontSize(editor: IEditor, fontSize: string): void;
8
8
  /**
9
9
  * @internal
10
10
  * Internal set font function shared by setFontSize and changeFontSize
@@ -4,7 +4,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
4
4
  * @param editor The editor to operate on
5
5
  * @param fontSize The font size to set
6
6
  */
7
- export default function setFontSize(editor, fontSize) {
7
+ export function setFontSize(editor, fontSize) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'setFontSize', function (format, _, __, paragraph) { return setFontSizeInternal(fontSize, format, paragraph); }, undefined /* segmentHasStyleCallback*/, true /*includingFormatHandler*/);
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setFontSize.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAOvF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,MAAe,EAAE,QAAgB;IACjE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,IAAK,OAAA,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAhD,CAAgD,EAC9E,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAC/B,QAAgB,EAChB,MAAiC,EACjC,SAAuC;;IAEvC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,iIAAiI;IACjI,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,QAAQ,EAAE;QACpC,IAAM,MAAI,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;QAE9C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAI,CAAC;aAClC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;KAC3C;AACL,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Set font size\n * @param editor The editor to operate on\n * @param fontSize The font size to set\n */\nexport default function setFontSize(editor: IEditor, fontSize: string) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setFontSize',\n (format, _, __, paragraph) => setFontSizeInternal(fontSize, format, paragraph),\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n\n/**\n * @internal\n * Internal set font function shared by setFontSize and changeFontSize\n */\nexport function setFontSizeInternal(\n fontSize: string,\n format: ContentModelSegmentFormat,\n paragraph: ContentModelParagraph | null\n) {\n format.fontSize = fontSize;\n\n // Since we have set font size to segment, it can be smaller than the one in paragraph format, so delete font size from paragraph\n if (paragraph?.segmentFormat?.fontSize) {\n const size = paragraph.segmentFormat.fontSize;\n\n paragraph.segments.forEach(segment => {\n if (!segment.format.fontSize) {\n segment.format.fontSize = size;\n }\n });\n\n delete paragraph.segmentFormat.fontSize;\n }\n}\n"]}
1
+ {"version":3,"file":"setFontSize.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/setFontSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAOvF;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,QAAgB;IACzD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,IAAK,OAAA,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAhD,CAAgD,EAC9E,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAC/B,QAAgB,EAChB,MAAiC,EACjC,SAAuC;;IAEvC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE3B,iIAAiI;IACjI,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,QAAQ,EAAE;QACpC,IAAM,MAAI,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;QAE9C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;YAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAI,CAAC;aAClC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;KAC3C;AACL,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Set font size\n * @param editor The editor to operate on\n * @param fontSize The font size to set\n */\nexport function setFontSize(editor: IEditor, fontSize: string) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setFontSize',\n (format, _, __, paragraph) => setFontSizeInternal(fontSize, format, paragraph),\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n\n/**\n * @internal\n * Internal set font function shared by setFontSize and changeFontSize\n */\nexport function setFontSizeInternal(\n fontSize: string,\n format: ContentModelSegmentFormat,\n paragraph: ContentModelParagraph | null\n) {\n format.fontSize = fontSize;\n\n // Since we have set font size to segment, it can be smaller than the one in paragraph format, so delete font size from paragraph\n if (paragraph?.segmentFormat?.fontSize) {\n const size = paragraph.segmentFormat.fontSize;\n\n paragraph.segments.forEach(segment => {\n if (!segment.format.fontSize) {\n segment.format.fontSize = size;\n }\n });\n\n delete paragraph.segmentFormat.fontSize;\n }\n}\n"]}
@@ -4,4 +4,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
4
4
  * @param editor The editor to operate on
5
5
  * @param textColor The text color to set. Pass null to remove existing color.
6
6
  */
7
- export default function setTextColor(editor: IEditor, textColor: string | null): void;
7
+ export declare function setTextColor(editor: IEditor, textColor: string | null): void;
@@ -4,7 +4,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
4
4
  * @param editor The editor to operate on
5
5
  * @param textColor The text color to set. Pass null to remove existing color.
6
6
  */
7
- export default function setTextColor(editor, textColor) {
7
+ export function setTextColor(editor, textColor) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'setTextColor', textColor === null
10
10
  ? function (format, _, segment) {
@@ -1 +1 @@
1
- {"version":3,"file":"setTextColor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setTextColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAe,EAAE,SAAwB;IAC1E,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,SAAS,KAAK,IAAI;QACd,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,OAAO,MAAM,CAAC,SAAS,CAAC;YAExB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;aACxC;QACL,CAAC;QACH,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;aAC7C;QACL,CAAC,EACP,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text color\n * @param editor The editor to operate on\n * @param textColor The text color to set. Pass null to remove existing color.\n */\nexport default function setTextColor(editor: IEditor, textColor: string | null) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setTextColor',\n textColor === null\n ? (format, _, segment) => {\n delete format.textColor;\n\n if (segment?.link) {\n delete segment.link.format.textColor;\n }\n }\n : (format, _, segment) => {\n format.textColor = textColor;\n\n if (segment?.link) {\n segment.link.format.textColor = textColor;\n }\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
1
+ {"version":3,"file":"setTextColor.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/setTextColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,SAAwB;IAClE,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,SAAS,KAAK,IAAI;QACd,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,OAAO,MAAM,CAAC,SAAS,CAAC;YAExB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;aACxC;QACL,CAAC;QACH,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;YAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;aAC7C;QACL,CAAC,EACP,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Set text color\n * @param editor The editor to operate on\n * @param textColor The text color to set. Pass null to remove existing color.\n */\nexport function setTextColor(editor: IEditor, textColor: string | null) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'setTextColor',\n textColor === null\n ? (format, _, segment) => {\n delete format.textColor;\n\n if (segment?.link) {\n delete segment.link.format.textColor;\n }\n }\n : (format, _, segment) => {\n format.textColor = textColor;\n\n if (segment?.link) {\n segment.link.format.textColor = textColor;\n }\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle bold style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleBold(editor: IEditor): void;
6
+ export declare function toggleBold(editor: IEditor): void;
@@ -4,7 +4,7 @@ import { isBold } from 'roosterjs-content-model-core';
4
4
  * Toggle bold style
5
5
  * @param editor The editor to operate on
6
6
  */
7
- export default function toggleBold(editor) {
7
+ export function toggleBold(editor) {
8
8
  editor.focus();
9
9
  formatSegmentWithContentModel(editor, 'toggleBold', function (format, isTurningOn) {
10
10
  format.fontWeight = isTurningOn ? 'bold' : 'normal';
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBold.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;QACjB,OAAA,MAAM,CACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;YACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;YACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;KAAA,CACR,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { isBold } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bold style\n * @param editor The editor to operate on\n */\nexport default function toggleBold(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleBold',\n (format, isTurningOn) => {\n format.fontWeight = isTurningOn ? 'bold' : 'normal';\n },\n (format, _, paragraph) =>\n isBold(\n typeof format.fontWeight == 'undefined'\n ? paragraph?.decorator?.format.fontWeight\n : format.fontWeight\n )\n );\n}\n"]}
1
+ {"version":3,"file":"toggleBold.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAGtD;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;QACjB,OAAA,MAAM,CACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;YACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;YACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;KAAA,CACR,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { isBold } from 'roosterjs-content-model-core';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bold style\n * @param editor The editor to operate on\n */\nexport function toggleBold(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleBold',\n (format, isTurningOn) => {\n format.fontWeight = isTurningOn ? 'bold' : 'normal';\n },\n (format, _, paragraph) =>\n isBold(\n typeof format.fontWeight == 'undefined'\n ? paragraph?.decorator?.format.fontWeight\n : format.fontWeight\n )\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleCode(editor: IEditor): void;
6
+ export declare function toggleCode(editor: IEditor): void;
@@ -9,7 +9,7 @@ var DefaultCode = {
9
9
  * Toggle italic style
10
10
  * @param editor The editor to operate on
11
11
  */
12
- export default function toggleCode(editor) {
12
+ export function toggleCode(editor) {
13
13
  editor.focus();
14
14
  formatSegmentWithContentModel(editor, 'toggleCode', function (_, isTurningOn, segment) {
15
15
  if (segment) {
@@ -1 +1 @@
1
- {"version":3,"file":"toggleCode.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF,IAAM,WAAW,GAAqB;IAClC,MAAM,EAAE;QACJ,UAAU,EAAE,WAAW;KAC1B;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAe;IAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;QACpB,IAAI,OAAO,EAAE;YACT,IAAI,WAAW,EAAE;gBACb,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACH,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;SACJ;IACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { addCode } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelCode, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultCode: ContentModelCode = {\n format: {\n fontFamily: 'monospace',\n },\n};\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport default function toggleCode(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleCode',\n (_, isTurningOn, segment) => {\n if (segment) {\n if (isTurningOn) {\n addCode(segment, DefaultCode);\n } else {\n delete segment.code;\n }\n }\n },\n (_, segment) => !!segment?.code\n );\n}\n"]}
1
+ {"version":3,"file":"toggleCode.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF,IAAM,WAAW,GAAqB;IAClC,MAAM,EAAE;QACJ,UAAU,EAAE,WAAW;KAC1B;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe;IACtC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;QACpB,IAAI,OAAO,EAAE;YACT,IAAI,WAAW,EAAE;gBACb,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACjC;iBAAM;gBACH,OAAO,OAAO,CAAC,IAAI,CAAC;aACvB;SACJ;IACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;AACN,CAAC","sourcesContent":["import { addCode } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelCode, IEditor } from 'roosterjs-content-model-types';\n\nconst DefaultCode: ContentModelCode = {\n format: {\n fontFamily: 'monospace',\n },\n};\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport function toggleCode(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleCode',\n (_, isTurningOn, segment) => {\n if (segment) {\n if (isTurningOn) {\n addCode(segment, DefaultCode);\n } else {\n delete segment.code;\n }\n }\n },\n (_, segment) => !!segment?.code\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleItalic(editor: IEditor): void;
6
+ export declare function toggleItalic(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleItalic(editor) {
6
+ export function toggleItalic(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleItalic', function (format, isTurningOn) {
9
9
  format.italic = !!isTurningOn;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleItalic.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAe;IAChD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport default function toggleItalic(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleItalic',\n (format, isTurningOn) => {\n format.italic = !!isTurningOn;\n },\n format => !!format.italic\n );\n}\n"]}
1
+ {"version":3,"file":"toggleItalic.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe;IACxC,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;IAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle italic style\n * @param editor The editor to operate on\n */\nexport function toggleItalic(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleItalic',\n (format, isTurningOn) => {\n format.italic = !!isTurningOn;\n },\n format => !!format.italic\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle strikethrough style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleStrikethrough(editor: IEditor): void;
6
+ export declare function toggleStrikethrough(editor: IEditor): void;
@@ -3,7 +3,7 @@ import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContent
3
3
  * Toggle strikethrough style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleStrikethrough(editor) {
6
+ export function toggleStrikethrough(editor) {
7
7
  editor.focus();
8
8
  formatSegmentWithContentModel(editor, 'toggleStrikethrough', function (format, isTurningOn) {
9
9
  format.strikethrough = !!isTurningOn;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleStrikethrough.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,MAAe;IACvD,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle strikethrough style\n * @param editor The editor to operate on\n */\nexport default function toggleStrikethrough(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleStrikethrough',\n (format, isTurningOn) => {\n format.strikethrough = !!isTurningOn;\n },\n format => !!format.strikethrough\n );\n}\n"]}
1
+ {"version":3,"file":"toggleStrikethrough.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAGvF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAe;IAC/C,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,6BAA6B,CACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;QAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;IACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;AACN,CAAC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle strikethrough style\n * @param editor The editor to operate on\n */\nexport function toggleStrikethrough(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleStrikethrough',\n (format, isTurningOn) => {\n format.strikethrough = !!isTurningOn;\n },\n format => !!format.strikethrough\n );\n}\n"]}
@@ -3,4 +3,4 @@ import type { IEditor } from 'roosterjs-content-model-types';
3
3
  * Toggle subscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSubscript(editor: IEditor): void;
6
+ export declare function toggleSubscript(editor: IEditor): void;