roosterjs-content-model-api 0.26.4 → 0.27.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 (295) hide show
  1. package/lib/modelApi/list/setListType.d.ts +2 -1
  2. package/lib/modelApi/list/setListType.js +5 -3
  3. package/lib/modelApi/list/setListType.js.map +1 -1
  4. package/lib/publicApi/block/setAlignment.d.ts +2 -2
  5. package/lib/publicApi/block/setAlignment.js.map +1 -1
  6. package/lib/publicApi/block/setDirection.d.ts +2 -2
  7. package/lib/publicApi/block/setDirection.js.map +1 -1
  8. package/lib/publicApi/block/setHeadingLevel.d.ts +2 -2
  9. package/lib/publicApi/block/setHeadingLevel.js.map +1 -1
  10. package/lib/publicApi/block/setIndentation.d.ts +2 -2
  11. package/lib/publicApi/block/setIndentation.js.map +1 -1
  12. package/lib/publicApi/block/setParagraphMargin.d.ts +2 -2
  13. package/lib/publicApi/block/setParagraphMargin.js.map +1 -1
  14. package/lib/publicApi/block/setSpacing.d.ts +2 -2
  15. package/lib/publicApi/block/setSpacing.js.map +1 -1
  16. package/lib/publicApi/block/toggleBlockQuote.d.ts +2 -2
  17. package/lib/publicApi/block/toggleBlockQuote.js.map +1 -1
  18. package/lib/publicApi/entity/insertEntity.d.ts +5 -5
  19. package/lib/publicApi/entity/insertEntity.js +22 -3
  20. package/lib/publicApi/entity/insertEntity.js.map +1 -1
  21. package/lib/publicApi/format/clearFormat.d.ts +2 -2
  22. package/lib/publicApi/format/clearFormat.js.map +1 -1
  23. package/lib/publicApi/format/getFormatState.d.ts +2 -2
  24. package/lib/publicApi/format/getFormatState.js.map +1 -1
  25. package/lib/publicApi/image/adjustImageSelection.d.ts +2 -2
  26. package/lib/publicApi/image/adjustImageSelection.js.map +1 -1
  27. package/lib/publicApi/image/changeImage.d.ts +2 -2
  28. package/lib/publicApi/image/changeImage.js.map +1 -1
  29. package/lib/publicApi/image/insertImage.d.ts +2 -2
  30. package/lib/publicApi/image/insertImage.js.map +1 -1
  31. package/lib/publicApi/image/setImageAltText.d.ts +2 -2
  32. package/lib/publicApi/image/setImageAltText.js.map +1 -1
  33. package/lib/publicApi/image/setImageBorder.d.ts +2 -2
  34. package/lib/publicApi/image/setImageBorder.js.map +1 -1
  35. package/lib/publicApi/image/setImageBoxShadow.d.ts +2 -2
  36. package/lib/publicApi/image/setImageBoxShadow.js.map +1 -1
  37. package/lib/publicApi/link/adjustLinkSelection.d.ts +2 -2
  38. package/lib/publicApi/link/adjustLinkSelection.js.map +1 -1
  39. package/lib/publicApi/link/insertLink.d.ts +2 -2
  40. package/lib/publicApi/link/insertLink.js.map +1 -1
  41. package/lib/publicApi/link/removeLink.d.ts +2 -2
  42. package/lib/publicApi/link/removeLink.js.map +1 -1
  43. package/lib/publicApi/list/setListStartNumber.d.ts +2 -2
  44. package/lib/publicApi/list/setListStartNumber.js.map +1 -1
  45. package/lib/publicApi/list/setListStyle.d.ts +2 -2
  46. package/lib/publicApi/list/setListStyle.js.map +1 -1
  47. package/lib/publicApi/list/toggleBullet.d.ts +3 -2
  48. package/lib/publicApi/list/toggleBullet.js +4 -2
  49. package/lib/publicApi/list/toggleBullet.js.map +1 -1
  50. package/lib/publicApi/list/toggleNumbering.d.ts +3 -2
  51. package/lib/publicApi/list/toggleNumbering.js +4 -2
  52. package/lib/publicApi/list/toggleNumbering.js.map +1 -1
  53. package/lib/publicApi/segment/applySegmentFormat.d.ts +2 -2
  54. package/lib/publicApi/segment/applySegmentFormat.js.map +1 -1
  55. package/lib/publicApi/segment/changeCapitalization.d.ts +2 -2
  56. package/lib/publicApi/segment/changeCapitalization.js.map +1 -1
  57. package/lib/publicApi/segment/changeFontSize.d.ts +2 -2
  58. package/lib/publicApi/segment/changeFontSize.js.map +1 -1
  59. package/lib/publicApi/segment/setBackgroundColor.d.ts +2 -2
  60. package/lib/publicApi/segment/setBackgroundColor.js.map +1 -1
  61. package/lib/publicApi/segment/setFontName.d.ts +2 -2
  62. package/lib/publicApi/segment/setFontName.js.map +1 -1
  63. package/lib/publicApi/segment/setFontSize.d.ts +2 -2
  64. package/lib/publicApi/segment/setFontSize.js.map +1 -1
  65. package/lib/publicApi/segment/setTextColor.d.ts +2 -2
  66. package/lib/publicApi/segment/setTextColor.js.map +1 -1
  67. package/lib/publicApi/segment/toggleBold.d.ts +2 -2
  68. package/lib/publicApi/segment/toggleBold.js.map +1 -1
  69. package/lib/publicApi/segment/toggleCode.d.ts +2 -2
  70. package/lib/publicApi/segment/toggleCode.js.map +1 -1
  71. package/lib/publicApi/segment/toggleItalic.d.ts +2 -2
  72. package/lib/publicApi/segment/toggleItalic.js.map +1 -1
  73. package/lib/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  74. package/lib/publicApi/segment/toggleStrikethrough.js.map +1 -1
  75. package/lib/publicApi/segment/toggleSubscript.d.ts +2 -2
  76. package/lib/publicApi/segment/toggleSubscript.js.map +1 -1
  77. package/lib/publicApi/segment/toggleSuperscript.d.ts +2 -2
  78. package/lib/publicApi/segment/toggleSuperscript.js.map +1 -1
  79. package/lib/publicApi/segment/toggleUnderline.d.ts +2 -2
  80. package/lib/publicApi/segment/toggleUnderline.js.map +1 -1
  81. package/lib/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  82. package/lib/publicApi/table/applyTableBorderFormat.js.map +1 -1
  83. package/lib/publicApi/table/editTable.d.ts +2 -2
  84. package/lib/publicApi/table/editTable.js.map +1 -1
  85. package/lib/publicApi/table/formatTable.d.ts +2 -2
  86. package/lib/publicApi/table/formatTable.js.map +1 -1
  87. package/lib/publicApi/table/insertTable.d.ts +2 -2
  88. package/lib/publicApi/table/insertTable.js.map +1 -1
  89. package/lib/publicApi/table/setTableCellShade.d.ts +2 -2
  90. package/lib/publicApi/table/setTableCellShade.js.map +1 -1
  91. package/lib/publicApi/utils/formatImageWithContentModel.d.ts +2 -2
  92. package/lib/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  93. package/lib/publicApi/utils/formatParagraphWithContentModel.d.ts +2 -2
  94. package/lib/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  95. package/lib/publicApi/utils/formatSegmentWithContentModel.d.ts +2 -2
  96. package/lib/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  97. package/lib/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  98. package/lib/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  99. package/lib-amd/modelApi/list/setListType.d.ts +2 -1
  100. package/lib-amd/modelApi/list/setListType.js +5 -3
  101. package/lib-amd/modelApi/list/setListType.js.map +1 -1
  102. package/lib-amd/publicApi/block/setAlignment.d.ts +2 -2
  103. package/lib-amd/publicApi/block/setAlignment.js.map +1 -1
  104. package/lib-amd/publicApi/block/setDirection.d.ts +2 -2
  105. package/lib-amd/publicApi/block/setDirection.js.map +1 -1
  106. package/lib-amd/publicApi/block/setHeadingLevel.d.ts +2 -2
  107. package/lib-amd/publicApi/block/setHeadingLevel.js.map +1 -1
  108. package/lib-amd/publicApi/block/setIndentation.d.ts +2 -2
  109. package/lib-amd/publicApi/block/setIndentation.js.map +1 -1
  110. package/lib-amd/publicApi/block/setParagraphMargin.d.ts +2 -2
  111. package/lib-amd/publicApi/block/setParagraphMargin.js.map +1 -1
  112. package/lib-amd/publicApi/block/setSpacing.d.ts +2 -2
  113. package/lib-amd/publicApi/block/setSpacing.js.map +1 -1
  114. package/lib-amd/publicApi/block/toggleBlockQuote.d.ts +2 -2
  115. package/lib-amd/publicApi/block/toggleBlockQuote.js.map +1 -1
  116. package/lib-amd/publicApi/entity/insertEntity.d.ts +5 -5
  117. package/lib-amd/publicApi/entity/insertEntity.js +22 -3
  118. package/lib-amd/publicApi/entity/insertEntity.js.map +1 -1
  119. package/lib-amd/publicApi/format/clearFormat.d.ts +2 -2
  120. package/lib-amd/publicApi/format/clearFormat.js.map +1 -1
  121. package/lib-amd/publicApi/format/getFormatState.d.ts +2 -2
  122. package/lib-amd/publicApi/format/getFormatState.js.map +1 -1
  123. package/lib-amd/publicApi/image/adjustImageSelection.d.ts +2 -2
  124. package/lib-amd/publicApi/image/adjustImageSelection.js.map +1 -1
  125. package/lib-amd/publicApi/image/changeImage.d.ts +2 -2
  126. package/lib-amd/publicApi/image/changeImage.js.map +1 -1
  127. package/lib-amd/publicApi/image/insertImage.d.ts +2 -2
  128. package/lib-amd/publicApi/image/insertImage.js.map +1 -1
  129. package/lib-amd/publicApi/image/setImageAltText.d.ts +2 -2
  130. package/lib-amd/publicApi/image/setImageAltText.js.map +1 -1
  131. package/lib-amd/publicApi/image/setImageBorder.d.ts +2 -2
  132. package/lib-amd/publicApi/image/setImageBorder.js.map +1 -1
  133. package/lib-amd/publicApi/image/setImageBoxShadow.d.ts +2 -2
  134. package/lib-amd/publicApi/image/setImageBoxShadow.js.map +1 -1
  135. package/lib-amd/publicApi/link/adjustLinkSelection.d.ts +2 -2
  136. package/lib-amd/publicApi/link/adjustLinkSelection.js.map +1 -1
  137. package/lib-amd/publicApi/link/insertLink.d.ts +2 -2
  138. package/lib-amd/publicApi/link/insertLink.js.map +1 -1
  139. package/lib-amd/publicApi/link/removeLink.d.ts +2 -2
  140. package/lib-amd/publicApi/link/removeLink.js.map +1 -1
  141. package/lib-amd/publicApi/list/setListStartNumber.d.ts +2 -2
  142. package/lib-amd/publicApi/list/setListStartNumber.js.map +1 -1
  143. package/lib-amd/publicApi/list/setListStyle.d.ts +2 -2
  144. package/lib-amd/publicApi/list/setListStyle.js.map +1 -1
  145. package/lib-amd/publicApi/list/toggleBullet.d.ts +3 -2
  146. package/lib-amd/publicApi/list/toggleBullet.js +4 -2
  147. package/lib-amd/publicApi/list/toggleBullet.js.map +1 -1
  148. package/lib-amd/publicApi/list/toggleNumbering.d.ts +3 -2
  149. package/lib-amd/publicApi/list/toggleNumbering.js +4 -2
  150. package/lib-amd/publicApi/list/toggleNumbering.js.map +1 -1
  151. package/lib-amd/publicApi/segment/applySegmentFormat.d.ts +2 -2
  152. package/lib-amd/publicApi/segment/applySegmentFormat.js.map +1 -1
  153. package/lib-amd/publicApi/segment/changeCapitalization.d.ts +2 -2
  154. package/lib-amd/publicApi/segment/changeCapitalization.js.map +1 -1
  155. package/lib-amd/publicApi/segment/changeFontSize.d.ts +2 -2
  156. package/lib-amd/publicApi/segment/changeFontSize.js.map +1 -1
  157. package/lib-amd/publicApi/segment/setBackgroundColor.d.ts +2 -2
  158. package/lib-amd/publicApi/segment/setBackgroundColor.js.map +1 -1
  159. package/lib-amd/publicApi/segment/setFontName.d.ts +2 -2
  160. package/lib-amd/publicApi/segment/setFontName.js.map +1 -1
  161. package/lib-amd/publicApi/segment/setFontSize.d.ts +2 -2
  162. package/lib-amd/publicApi/segment/setFontSize.js.map +1 -1
  163. package/lib-amd/publicApi/segment/setTextColor.d.ts +2 -2
  164. package/lib-amd/publicApi/segment/setTextColor.js.map +1 -1
  165. package/lib-amd/publicApi/segment/toggleBold.d.ts +2 -2
  166. package/lib-amd/publicApi/segment/toggleBold.js.map +1 -1
  167. package/lib-amd/publicApi/segment/toggleCode.d.ts +2 -2
  168. package/lib-amd/publicApi/segment/toggleCode.js.map +1 -1
  169. package/lib-amd/publicApi/segment/toggleItalic.d.ts +2 -2
  170. package/lib-amd/publicApi/segment/toggleItalic.js.map +1 -1
  171. package/lib-amd/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  172. package/lib-amd/publicApi/segment/toggleStrikethrough.js.map +1 -1
  173. package/lib-amd/publicApi/segment/toggleSubscript.d.ts +2 -2
  174. package/lib-amd/publicApi/segment/toggleSubscript.js.map +1 -1
  175. package/lib-amd/publicApi/segment/toggleSuperscript.d.ts +2 -2
  176. package/lib-amd/publicApi/segment/toggleSuperscript.js.map +1 -1
  177. package/lib-amd/publicApi/segment/toggleUnderline.d.ts +2 -2
  178. package/lib-amd/publicApi/segment/toggleUnderline.js.map +1 -1
  179. package/lib-amd/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  180. package/lib-amd/publicApi/table/applyTableBorderFormat.js.map +1 -1
  181. package/lib-amd/publicApi/table/editTable.d.ts +2 -2
  182. package/lib-amd/publicApi/table/editTable.js.map +1 -1
  183. package/lib-amd/publicApi/table/formatTable.d.ts +2 -2
  184. package/lib-amd/publicApi/table/formatTable.js.map +1 -1
  185. package/lib-amd/publicApi/table/insertTable.d.ts +2 -2
  186. package/lib-amd/publicApi/table/insertTable.js.map +1 -1
  187. package/lib-amd/publicApi/table/setTableCellShade.d.ts +2 -2
  188. package/lib-amd/publicApi/table/setTableCellShade.js.map +1 -1
  189. package/lib-amd/publicApi/utils/formatImageWithContentModel.d.ts +2 -2
  190. package/lib-amd/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  191. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.d.ts +2 -2
  192. package/lib-amd/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  193. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.d.ts +2 -2
  194. package/lib-amd/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  195. package/lib-amd/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  196. package/lib-amd/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  197. package/lib-mjs/modelApi/list/setListType.d.ts +2 -1
  198. package/lib-mjs/modelApi/list/setListType.js +5 -3
  199. package/lib-mjs/modelApi/list/setListType.js.map +1 -1
  200. package/lib-mjs/publicApi/block/setAlignment.d.ts +2 -2
  201. package/lib-mjs/publicApi/block/setAlignment.js.map +1 -1
  202. package/lib-mjs/publicApi/block/setDirection.d.ts +2 -2
  203. package/lib-mjs/publicApi/block/setDirection.js.map +1 -1
  204. package/lib-mjs/publicApi/block/setHeadingLevel.d.ts +2 -2
  205. package/lib-mjs/publicApi/block/setHeadingLevel.js.map +1 -1
  206. package/lib-mjs/publicApi/block/setIndentation.d.ts +2 -2
  207. package/lib-mjs/publicApi/block/setIndentation.js.map +1 -1
  208. package/lib-mjs/publicApi/block/setParagraphMargin.d.ts +2 -2
  209. package/lib-mjs/publicApi/block/setParagraphMargin.js.map +1 -1
  210. package/lib-mjs/publicApi/block/setSpacing.d.ts +2 -2
  211. package/lib-mjs/publicApi/block/setSpacing.js.map +1 -1
  212. package/lib-mjs/publicApi/block/toggleBlockQuote.d.ts +2 -2
  213. package/lib-mjs/publicApi/block/toggleBlockQuote.js.map +1 -1
  214. package/lib-mjs/publicApi/entity/insertEntity.d.ts +5 -5
  215. package/lib-mjs/publicApi/entity/insertEntity.js +22 -3
  216. package/lib-mjs/publicApi/entity/insertEntity.js.map +1 -1
  217. package/lib-mjs/publicApi/format/clearFormat.d.ts +2 -2
  218. package/lib-mjs/publicApi/format/clearFormat.js.map +1 -1
  219. package/lib-mjs/publicApi/format/getFormatState.d.ts +2 -2
  220. package/lib-mjs/publicApi/format/getFormatState.js.map +1 -1
  221. package/lib-mjs/publicApi/image/adjustImageSelection.d.ts +2 -2
  222. package/lib-mjs/publicApi/image/adjustImageSelection.js.map +1 -1
  223. package/lib-mjs/publicApi/image/changeImage.d.ts +2 -2
  224. package/lib-mjs/publicApi/image/changeImage.js.map +1 -1
  225. package/lib-mjs/publicApi/image/insertImage.d.ts +2 -2
  226. package/lib-mjs/publicApi/image/insertImage.js.map +1 -1
  227. package/lib-mjs/publicApi/image/setImageAltText.d.ts +2 -2
  228. package/lib-mjs/publicApi/image/setImageAltText.js.map +1 -1
  229. package/lib-mjs/publicApi/image/setImageBorder.d.ts +2 -2
  230. package/lib-mjs/publicApi/image/setImageBorder.js.map +1 -1
  231. package/lib-mjs/publicApi/image/setImageBoxShadow.d.ts +2 -2
  232. package/lib-mjs/publicApi/image/setImageBoxShadow.js.map +1 -1
  233. package/lib-mjs/publicApi/link/adjustLinkSelection.d.ts +2 -2
  234. package/lib-mjs/publicApi/link/adjustLinkSelection.js.map +1 -1
  235. package/lib-mjs/publicApi/link/insertLink.d.ts +2 -2
  236. package/lib-mjs/publicApi/link/insertLink.js.map +1 -1
  237. package/lib-mjs/publicApi/link/removeLink.d.ts +2 -2
  238. package/lib-mjs/publicApi/link/removeLink.js.map +1 -1
  239. package/lib-mjs/publicApi/list/setListStartNumber.d.ts +2 -2
  240. package/lib-mjs/publicApi/list/setListStartNumber.js.map +1 -1
  241. package/lib-mjs/publicApi/list/setListStyle.d.ts +2 -2
  242. package/lib-mjs/publicApi/list/setListStyle.js.map +1 -1
  243. package/lib-mjs/publicApi/list/toggleBullet.d.ts +3 -2
  244. package/lib-mjs/publicApi/list/toggleBullet.js +4 -2
  245. package/lib-mjs/publicApi/list/toggleBullet.js.map +1 -1
  246. package/lib-mjs/publicApi/list/toggleNumbering.d.ts +3 -2
  247. package/lib-mjs/publicApi/list/toggleNumbering.js +4 -2
  248. package/lib-mjs/publicApi/list/toggleNumbering.js.map +1 -1
  249. package/lib-mjs/publicApi/segment/applySegmentFormat.d.ts +2 -2
  250. package/lib-mjs/publicApi/segment/applySegmentFormat.js.map +1 -1
  251. package/lib-mjs/publicApi/segment/changeCapitalization.d.ts +2 -2
  252. package/lib-mjs/publicApi/segment/changeCapitalization.js.map +1 -1
  253. package/lib-mjs/publicApi/segment/changeFontSize.d.ts +2 -2
  254. package/lib-mjs/publicApi/segment/changeFontSize.js.map +1 -1
  255. package/lib-mjs/publicApi/segment/setBackgroundColor.d.ts +2 -2
  256. package/lib-mjs/publicApi/segment/setBackgroundColor.js.map +1 -1
  257. package/lib-mjs/publicApi/segment/setFontName.d.ts +2 -2
  258. package/lib-mjs/publicApi/segment/setFontName.js.map +1 -1
  259. package/lib-mjs/publicApi/segment/setFontSize.d.ts +2 -2
  260. package/lib-mjs/publicApi/segment/setFontSize.js.map +1 -1
  261. package/lib-mjs/publicApi/segment/setTextColor.d.ts +2 -2
  262. package/lib-mjs/publicApi/segment/setTextColor.js.map +1 -1
  263. package/lib-mjs/publicApi/segment/toggleBold.d.ts +2 -2
  264. package/lib-mjs/publicApi/segment/toggleBold.js.map +1 -1
  265. package/lib-mjs/publicApi/segment/toggleCode.d.ts +2 -2
  266. package/lib-mjs/publicApi/segment/toggleCode.js.map +1 -1
  267. package/lib-mjs/publicApi/segment/toggleItalic.d.ts +2 -2
  268. package/lib-mjs/publicApi/segment/toggleItalic.js.map +1 -1
  269. package/lib-mjs/publicApi/segment/toggleStrikethrough.d.ts +2 -2
  270. package/lib-mjs/publicApi/segment/toggleStrikethrough.js.map +1 -1
  271. package/lib-mjs/publicApi/segment/toggleSubscript.d.ts +2 -2
  272. package/lib-mjs/publicApi/segment/toggleSubscript.js.map +1 -1
  273. package/lib-mjs/publicApi/segment/toggleSuperscript.d.ts +2 -2
  274. package/lib-mjs/publicApi/segment/toggleSuperscript.js.map +1 -1
  275. package/lib-mjs/publicApi/segment/toggleUnderline.d.ts +2 -2
  276. package/lib-mjs/publicApi/segment/toggleUnderline.js.map +1 -1
  277. package/lib-mjs/publicApi/table/applyTableBorderFormat.d.ts +2 -2
  278. package/lib-mjs/publicApi/table/applyTableBorderFormat.js.map +1 -1
  279. package/lib-mjs/publicApi/table/editTable.d.ts +2 -2
  280. package/lib-mjs/publicApi/table/editTable.js.map +1 -1
  281. package/lib-mjs/publicApi/table/formatTable.d.ts +2 -2
  282. package/lib-mjs/publicApi/table/formatTable.js.map +1 -1
  283. package/lib-mjs/publicApi/table/insertTable.d.ts +2 -2
  284. package/lib-mjs/publicApi/table/insertTable.js.map +1 -1
  285. package/lib-mjs/publicApi/table/setTableCellShade.d.ts +2 -2
  286. package/lib-mjs/publicApi/table/setTableCellShade.js.map +1 -1
  287. package/lib-mjs/publicApi/utils/formatImageWithContentModel.d.ts +2 -2
  288. package/lib-mjs/publicApi/utils/formatImageWithContentModel.js.map +1 -1
  289. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.d.ts +2 -2
  290. package/lib-mjs/publicApi/utils/formatParagraphWithContentModel.js.map +1 -1
  291. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.d.ts +2 -2
  292. package/lib-mjs/publicApi/utils/formatSegmentWithContentModel.js.map +1 -1
  293. package/lib-mjs/publicApi/utils/formatTableWithContentModel.d.ts +2 -2
  294. package/lib-mjs/publicApi/utils/formatTableWithContentModel.js.map +1 -1
  295. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
- import type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
1
+ import type { IEditor, ListMetadataFormat } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set style of list items with in same thread of current item
4
4
  * @param editor The editor to operate on
5
5
  * @param style The target list item style to set
6
6
  */
7
- export default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat): void;
7
+ export default function setListStyle(editor: IEditor, style: ListMetadataFormat): void;
@@ -1 +1 @@
1
- {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":";;;IAIA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAyB,EAAE,KAAyB;QACrF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YAEjD,IAAI,QAAQ,EAAE;gBACV,IAAM,SAAS,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;gBAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;oBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;oBAE1C,IAAI,KAAK,EAAE;wBACP,IAAA,iDAAkB,EAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;qBAC7E;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IA5BD,+BA4BC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\nimport { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor, ListMetadataFormat } from 'roosterjs-content-model-types';\n\n/**\n * Set style of list items with in same thread of current item\n * @param editor The editor to operate on\n * @param style The target list item style to set\n */\nexport default function setListStyle(editor: IStandaloneEditor, style: ListMetadataFormat) {\n editor.focus();\n\n editor.formatContentModel(\n model => {\n const listItem = getFirstSelectedListItem(model);\n\n if (listItem) {\n const listItems = findListItemsInSameThread(model, listItem);\n const levelIndex = listItem.levels.length - 1;\n\n listItems.forEach(listItem => {\n const level = listItem.levels[levelIndex];\n\n if (level) {\n updateListMetadata(level, metadata => Object.assign({}, metadata, style));\n }\n });\n\n return true;\n } else {\n return false;\n }\n },\n {\n apiName: 'setListStyle',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"setListStyle.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/setListStyle.ts"],"names":[],"mappings":";;;IAIA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAe,EAAE,KAAyB;QAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAA,KAAK;YACD,IAAM,QAAQ,GAAG,IAAA,uDAAwB,EAAC,KAAK,CAAC,CAAC;YAEjD,IAAI,QAAQ,EAAE;gBACV,IAAM,SAAS,GAAG,IAAA,qDAAyB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC7D,IAAM,YAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;gBAE9C,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;oBACtB,IAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAU,CAAC,CAAC;oBAE1C,IAAI,KAAK,EAAE;wBACP,IAAA,iDAAkB,EAAC,KAAK,EAAE,UAAA,QAAQ,IAAI,OAAA,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAlC,CAAkC,CAAC,CAAC;qBAC7E;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,IAAI,CAAC;aACf;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IA5BD,+BA4BC","sourcesContent":["import { findListItemsInSameThread } from '../../modelApi/list/findListItemsInSameThread';\nimport { getFirstSelectedListItem, updateListMetadata } from 'roosterjs-content-model-core';\nimport type { 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,8 +1,9 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle bullet list type
4
4
  * - When there are some blocks not in bullet list, set all blocks to the given type
5
5
  * - When all blocks are already in bullet list, turn off / outdent there list type
6
6
  * @param editor The editor to operate on
7
+ * @param removeMargins true to remove margins, false to keep margins @default false
7
8
  */
8
- export default function toggleBullet(editor: IStandaloneEditor): void;
9
+ export default function toggleBullet(editor: IEditor, removeMargins?: boolean): void;
@@ -6,12 +6,14 @@ define(["require", "exports", "../../modelApi/list/setListType"], function (requ
6
6
  * - When there are some blocks not in bullet list, set all blocks to the given type
7
7
  * - When all blocks are already in bullet list, turn off / outdent there list type
8
8
  * @param editor The editor to operate on
9
+ * @param removeMargins true to remove margins, false to keep margins @default false
9
10
  */
10
- function toggleBullet(editor) {
11
+ function toggleBullet(editor, removeMargins) {
12
+ if (removeMargins === void 0) { removeMargins = false; }
11
13
  editor.focus();
12
14
  editor.formatContentModel(function (model, context) {
13
15
  context.newPendingFormat = 'preserve';
14
- return (0, setListType_1.setListType)(model, 'UL');
16
+ return (0, setListType_1.setListType)(model, 'UL', removeMargins);
15
17
  }, {
16
18
  apiName: 'toggleBullet',
17
19
  });
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,YAAY,CAAC,MAAyB;QAC1D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IAbD,+BAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle bullet list type\n * - When there are some blocks not in bullet list, set all blocks to the given type\n * - When all blocks are already in bullet list, turn off / outdent there list type\n * @param editor The editor to operate on\n */\nexport default function toggleBullet(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'UL');\n },\n {\n apiName: 'toggleBullet',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"toggleBullet.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleBullet.ts"],"names":[],"mappings":";;;IAGA;;;;;;OAMG;IACH,SAAwB,YAAY,CAAC,MAAe,EAAE,aAA8B;QAA9B,8BAAA,EAAA,qBAA8B;QAChF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC,EACD;YACI,OAAO,EAAE,cAAc;SAC1B,CACJ,CAAC;IACN,CAAC;IAbD,+BAaC","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,8 +1,9 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle numbering list type
4
4
  * - When there are some blocks not in numbering list, set all blocks to the given type
5
5
  * - When all blocks are already in numbering list, turn off / outdent there list type
6
6
  * @param editor The editor to operate on
7
+ * @param removeMargins true to remove margins, false to keep margins @default false
7
8
  */
8
- export default function toggleNumbering(editor: IStandaloneEditor): void;
9
+ export default function toggleNumbering(editor: IEditor, removeMargins?: boolean): void;
@@ -6,12 +6,14 @@ define(["require", "exports", "../../modelApi/list/setListType"], function (requ
6
6
  * - When there are some blocks not in numbering list, set all blocks to the given type
7
7
  * - When all blocks are already in numbering list, turn off / outdent there list type
8
8
  * @param editor The editor to operate on
9
+ * @param removeMargins true to remove margins, false to keep margins @default false
9
10
  */
10
- function toggleNumbering(editor) {
11
+ function toggleNumbering(editor, removeMargins) {
12
+ if (removeMargins === void 0) { removeMargins = false; }
11
13
  editor.focus();
12
14
  editor.formatContentModel(function (model, context) {
13
15
  context.newPendingFormat = 'preserve';
14
- return (0, setListType_1.setListType)(model, 'OL');
16
+ return (0, setListType_1.setListType)(model, 'OL', removeMargins);
15
17
  }, {
16
18
  apiName: 'toggleNumbering',
17
19
  });
@@ -1 +1 @@
1
- {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":";;;IAGA;;;;;OAKG;IACH,SAAwB,eAAe,CAAC,MAAyB;QAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,EACD;YACI,OAAO,EAAE,iBAAiB;SAC7B,CACJ,CAAC;IACN,CAAC;IAbD,kCAaC","sourcesContent":["import { setListType } from '../../modelApi/list/setListType';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle numbering list type\n * - When there are some blocks not in numbering list, set all blocks to the given type\n * - When all blocks are already in numbering list, turn off / outdent there list type\n * @param editor The editor to operate on\n */\nexport default function toggleNumbering(editor: IStandaloneEditor) {\n editor.focus();\n\n editor.formatContentModel(\n (model, context) => {\n context.newPendingFormat = 'preserve';\n\n return setListType(model, 'OL');\n },\n {\n apiName: 'toggleNumbering',\n }\n );\n}\n"]}
1
+ {"version":3,"file":"toggleNumbering.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/list/toggleNumbering.ts"],"names":[],"mappings":";;;IAGA;;;;;;OAMG;IACH,SAAwB,eAAe,CAAC,MAAe,EAAE,aAA8B;QAA9B,8BAAA,EAAA,qBAA8B;QACnF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,MAAM,CAAC,kBAAkB,CACrB,UAAC,KAAK,EAAE,OAAO;YACX,OAAO,CAAC,gBAAgB,GAAG,UAAU,CAAC;YAEtC,OAAO,IAAA,yBAAW,EAAC,KAAK,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC,EACD;YACI,OAAO,EAAE,iBAAiB;SAC7B,CACJ,CAAC;IACN,CAAC;IAbD,kCAaC","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,7 +1,7 @@
1
- import type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Bulk apply segment format to all selected content. This is usually used for format painter.
4
4
  * @param editor The editor to operate on
5
5
  * @param newFormat The segment format to apply
6
6
  */
7
- export default function applySegmentFormat(editor: IStandaloneEditor, newFormat: ContentModelSegmentFormat): void;
7
+ export default function applySegmentFormat(editor: IEditor, newFormat: ContentModelSegmentFormat): void;
@@ -1 +1 @@
1
- {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,kBAAkB,CACtC,MAAyB,EACzB,SAAoC;QAEpC,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;YACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;YACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;YACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;YAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;YACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IArBD,qCAqBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Bulk apply segment format to all selected content. This is usually used for format painter.\n * @param editor The editor to operate on\n * @param newFormat The segment format to apply\n */\nexport default function applySegmentFormat(\n editor: IStandaloneEditor,\n newFormat: ContentModelSegmentFormat\n) {\n formatSegmentWithContentModel(\n editor,\n 'applySegmentFormat',\n format => {\n format.backgroundColor = newFormat.backgroundColor;\n format.fontFamily = newFormat.fontFamily;\n format.fontSize = newFormat.fontSize;\n format.fontWeight = newFormat.fontWeight;\n format.italic = newFormat.italic;\n format.strikethrough = newFormat.strikethrough;\n format.superOrSubScriptSequence = newFormat.superOrSubScriptSequence;\n format.textColor = newFormat.textColor;\n format.underline = newFormat.underline;\n },\n undefined /* segmentHasStyleCallback*/,\n true /*includingFormatHandler*/\n );\n}\n"]}
1
+ {"version":3,"file":"applySegmentFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/applySegmentFormat.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,kBAAkB,CAAC,MAAe,EAAE,SAAoC;QAC5F,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAA,MAAM;YACF,MAAM,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;YACnD,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;YACrC,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;YACzC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YACjC,MAAM,CAAC,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;YAC/C,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC,wBAAwB,CAAC;YACrE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACvC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;QAC3C,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAlBD,qCAkBC","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,4 +1,4 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Change the capitalization of text in the selection
4
4
  * @param editor The editor instance
@@ -7,4 +7,4 @@ import type { IStandaloneEditor } from 'roosterjs-content-model-types';
7
7
  * Identifying Languages". For example: 'en' or 'en-US' for English, 'tr' for Turkish.
8
8
  * Default is the host environment’s current locale.
9
9
  */
10
- export default function changeCapitalization(editor: IStandaloneEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
10
+ export default function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"changeCapitalization.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeCapitalization.ts"],"names":[],"mappings":";;;IAGA;;;;;;;OAOG;IACH,SAAwB,oBAAoB,CACxC,MAAyB,EACzB,cAAqE,EACrE,QAAiB;QAEjB,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EAAC,MAAM,EAAE,sBAAsB,EAAE,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;YACzE,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,MAAM,EAAE;gBAChC,QAAQ,cAAc,EAAE;oBACpB,KAAK,WAAW;wBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;wBACxD,MAAM;oBAEV,KAAK,WAAW;wBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;wBACxD,MAAM;oBAEV,KAAK,YAAY;wBACb,IAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;4BACvC,SAAS,CAAC,CAAC,CAAC;gCACR,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC;oCAClD,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;yBAC7B;wBAED,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBACnC,MAAM;oBAEV,KAAK,UAAU;wBACX,IAAM,gBAAgB,GAAG,aAAa,CAAC;wBACvC,2CAA2C;wBAC3C,2EAA2E;wBAC3E,2EAA2E;wBAC3E,uEAAuE;wBACvE,sDAAsD;wBACtD,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,GAAG,gBAAgB,GAAG,SAAS,EAAE,GAAG,CAAC,CAAC;wBAE1E,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;6BACtB,iBAAiB,CAAC,QAAQ,CAAC;6BAC3B,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAjC,CAAiC,CAAC,CAAC;wBAChE,MAAM;iBACb;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IA9CD,uCA8CC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } 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: IStandaloneEditor,\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeCapitalization.ts"],"names":[],"mappings":";;;IAGA;;;;;;;OAOG;IACH,SAAwB,oBAAoB,CACxC,MAAe,EACf,cAAqE,EACrE,QAAiB;QAEjB,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EAAC,MAAM,EAAE,sBAAsB,EAAE,UAAC,CAAC,EAAE,EAAE,EAAE,OAAO;YACzE,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,MAAM,EAAE;gBAChC,QAAQ,cAAc,EAAE;oBACpB,KAAK,WAAW;wBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;wBACxD,MAAM;oBAEV,KAAK,WAAW;wBACZ,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;wBACxD,MAAM;oBAEV,KAAK,YAAY;wBACb,IAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBAEtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;4BACvC,SAAS,CAAC,CAAC,CAAC;gCACR,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,QAAQ,CAAC;oCAClD,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;yBAC7B;wBAED,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBACnC,MAAM;oBAEV,KAAK,UAAU;wBACX,IAAM,gBAAgB,GAAG,aAAa,CAAC;wBACvC,2CAA2C;wBAC3C,2EAA2E;wBAC3E,2EAA2E;wBAC3E,uEAAuE;wBACvE,sDAAsD;wBACtD,IAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,GAAG,gBAAgB,GAAG,SAAS,EAAE,GAAG,CAAC,CAAC;wBAE1E,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;6BACtB,iBAAiB,CAAC,QAAQ,CAAC;6BAC3B,OAAO,CAAC,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAjC,CAAiC,CAAC,CAAC;wBAChE,MAAM;iBACb;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IA9CD,uCA8CC","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,8 +1,8 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Increase or decrease font size in selection
4
4
  * @param editor The editor instance
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: IStandaloneEditor, change: 'increase' | 'decrease'): void;
8
+ export default function changeFontSize(editor: IEditor, change: 'increase' | 'decrease'): void;
@@ -1 +1 @@
1
- {"version":3,"file":"changeFontSize.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeFontSize.ts"],"names":[],"mappings":"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","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { parseValueWithUnit } from 'roosterjs-content-model-dom';\nimport { setFontSizeInternal } from './setFontSize';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IStandaloneEditor,\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: IStandaloneEditor, 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-content-model/roosterjs-content-model-api/lib/publicApi/segment/changeFontSize.ts"],"names":[],"mappings":"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","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,7 +1,7 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set background color
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: IStandaloneEditor, backgroundColor: string | null): void;
7
+ export default function setBackgroundColor(editor: IEditor, backgroundColor: string | null): void;
@@ -1 +1 @@
1
- {"version":3,"file":"setBackgroundColor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setBackgroundColor.ts"],"names":[],"mappings":";;;IAKA;;;;OAIG;IACH,SAAwB,kBAAkB,CACtC,MAAyB,EACzB,eAA8B;QAE9B,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAI,aAAa,GAAiC,IAAI,CAAC;QACvD,IAAI,gBAAgB,GAAW,CAAC,CAAC,CAAC;QAElC,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS;YAC1B,IAAI,eAAe,KAAK,IAAI,EAAE;gBAC1B,OAAO,MAAM,CAAC,eAAe,CAAC;aACjC;iBAAM;gBACH,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;aAC5C;YAED,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,WAAW,IAAI,iBAAiB,EAAE;gBAClE,aAAa,GAAG,SAAS,CAAC;gBAC1B,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aAC9D;QACL,CAAC,EACD,SAAS,CAAC,2BAA2B,EACrC,SAAS,CAAC,yBAAyB,EACnC,UAAA,KAAK;;YACD,IAAI,aAAa,IAAI,gBAAgB,IAAI,CAAC,EAAE;gBACxC,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAChC,MAAA,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,0CAAE,MAAM,CACnD,CAAC;gBAEF,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC/D,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;aACvC;QACL,CAAC,CACJ,CAAC;IACN,CAAC;IArCD,qCAqCC","sourcesContent":["import { createSelectionMarker } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { setSelection } from 'roosterjs-content-model-core';\nimport type { ContentModelParagraph, IStandaloneEditor } 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(\n editor: IStandaloneEditor,\n backgroundColor: string | null\n) {\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/setBackgroundColor.ts"],"names":[],"mappings":";;;IAKA;;;;OAIG;IACH,SAAwB,kBAAkB,CAAC,MAAe,EAAE,eAA8B;QACtF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAI,aAAa,GAAiC,IAAI,CAAC;QACvD,IAAI,gBAAgB,GAAW,CAAC,CAAC,CAAC;QAElC,IAAA,6DAA6B,EACzB,MAAM,EACN,oBAAoB,EACpB,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS;YAC1B,IAAI,eAAe,KAAK,IAAI,EAAE;gBAC1B,OAAO,MAAM,CAAC,eAAe,CAAC;aACjC;iBAAM;gBACH,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC;aAC5C;YAED,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,WAAW,IAAI,iBAAiB,EAAE;gBAClE,aAAa,GAAG,SAAS,CAAC;gBAC1B,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aAC9D;QACL,CAAC,EACD,SAAS,CAAC,2BAA2B,EACrC,SAAS,CAAC,yBAAyB,EACnC,UAAA,KAAK;;YACD,IAAI,aAAa,IAAI,gBAAgB,IAAI,CAAC,EAAE;gBACxC,IAAM,MAAM,GAAG,IAAA,mDAAqB,EAChC,MAAA,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,0CAAE,MAAM,CACnD,CAAC;gBAEF,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBAC/D,IAAA,2CAAY,EAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;aACvC;QACL,CAAC,CACJ,CAAC;IACN,CAAC;IAlCD,qCAkCC","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,7 +1,7 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set font name
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: IStandaloneEditor, fontName: string): void;
7
+ export default function setFontName(editor: IEditor, fontName: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"setFontName.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontName.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,WAAW,CAAC,MAAyB,EAAE,QAAgB;QAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;YAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;aAC7C;QACL,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAhBD,8BAgBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } 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: IStandaloneEditor, 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-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontName.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,WAAW,CAAC,MAAe,EAAE,QAAgB;QACjE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,aAAa,EACb,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;YACf,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;YAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC;aAC7C;QACL,CAAC,EACD,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAhBD,8BAgBC","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,10 +1,10 @@
1
- import type { ContentModelParagraph, ContentModelSegmentFormat, IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { ContentModelParagraph, ContentModelSegmentFormat, IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set font size
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: IStandaloneEditor, fontSize: string): void;
7
+ export default function setFontSize(editor: IEditor, fontSize: string): void;
8
8
  /**
9
9
  * @internal
10
10
  * Internal set font function shared by setFontSize and changeFontSize
@@ -1 +1 @@
1
- {"version":3,"file":"setFontSize.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontSize.ts"],"names":[],"mappings":";;;;IAOA;;;;OAIG;IACH,SAAwB,WAAW,CAAC,MAAyB,EAAE,QAAgB;QAC3E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,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;IACN,CAAC;IAVD,8BAUC;IAED;;;OAGG;IACH,SAAgB,mBAAmB,CAC/B,QAAgB,EAChB,MAAiC,EACjC,SAAuC;;QAEvC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAE3B,iIAAiI;QACjI,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,QAAQ,EAAE;YACpC,IAAM,MAAI,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;YAE9C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAI,CAAC;iBAClC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;SAC3C;IACL,CAAC;IAnBD,kDAmBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type {\n ContentModelParagraph,\n ContentModelSegmentFormat,\n IStandaloneEditor,\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: IStandaloneEditor, 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-content-model/roosterjs-content-model-api/lib/publicApi/segment/setFontSize.ts"],"names":[],"mappings":";;;;IAOA;;;;OAIG;IACH,SAAwB,WAAW,CAAC,MAAe,EAAE,QAAgB;QACjE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,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;IACN,CAAC;IAVD,8BAUC;IAED;;;OAGG;IACH,SAAgB,mBAAmB,CAC/B,QAAgB,EAChB,MAAiC,EACjC,SAAuC;;QAEvC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAE3B,iIAAiI;QACjI,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,aAAa,0CAAE,QAAQ,EAAE;YACpC,IAAM,MAAI,GAAG,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;YAE9C,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,OAAO;gBAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAC1B,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,MAAI,CAAC;iBAClC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC;SAC3C;IACL,CAAC;IAnBD,kDAmBC","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,7 +1,7 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Set text color
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: IStandaloneEditor, textColor: string | null): void;
7
+ export default function setTextColor(editor: IEditor, textColor: string | null): void;
@@ -1 +1 @@
1
- {"version":3,"file":"setTextColor.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/setTextColor.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAyB,EAAE,SAAwB;QACpF,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,cAAc,EACd,SAAS,KAAK,IAAI;YACd,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;gBACf,OAAO,MAAM,CAAC,SAAS,CAAC;gBAExB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;oBACf,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;iBACxC;YACL,CAAC;YACH,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;gBACf,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;gBAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;oBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;iBAC7C;YACL,CAAC,EACP,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAxBD,+BAwBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } 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: IStandaloneEditor, 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-content-model/roosterjs-content-model-api/lib/publicApi/segment/setTextColor.ts"],"names":[],"mappings":";;;IAGA;;;;OAIG;IACH,SAAwB,YAAY,CAAC,MAAe,EAAE,SAAwB;QAC1E,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,cAAc,EACd,SAAS,KAAK,IAAI;YACd,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;gBACf,OAAO,MAAM,CAAC,SAAS,CAAC;gBAExB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;oBACf,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;iBACxC;YACL,CAAC;YACH,CAAC,CAAC,UAAC,MAAM,EAAE,CAAC,EAAE,OAAO;gBACf,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;gBAE7B,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;oBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;iBAC7C;YACL,CAAC,EACP,SAAS,CAAC,4BAA4B,EACtC,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;IAxBD,+BAwBC","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,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle bold style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleBold(editor: IStandaloneEditor): void;
6
+ export default function toggleBold(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleBold.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":";;;IAIA;;;OAGG;IACH,SAAwB,UAAU,CAAC,MAAyB;QACxD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;YACjB,OAAA,IAAA,qCAAM,EACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;gBACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;gBACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;SAAA,CACR,CAAC;IACN,CAAC;IAhBD,6BAgBC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport { isBold } from 'roosterjs-content-model-core';\nimport type { IStandaloneEditor } 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: IStandaloneEditor) {\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleBold.ts"],"names":[],"mappings":";;;IAIA;;;OAGG;IACH,SAAwB,UAAU,CAAC,MAAe;QAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,YAAY,EACZ,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;QACxD,CAAC,EACD,UAAC,MAAM,EAAE,CAAC,EAAE,SAAS;;YACjB,OAAA,IAAA,qCAAM,EACF,OAAO,MAAM,CAAC,UAAU,IAAI,WAAW;gBACnC,CAAC,CAAC,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,MAAM,CAAC,UAAU;gBACzC,CAAC,CAAC,MAAM,CAAC,UAAU,CAC1B,CAAA;SAAA,CACR,CAAC;IACN,CAAC;IAhBD,6BAgBC","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,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleCode(editor: IStandaloneEditor): void;
6
+ export default function toggleCode(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleCode.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":";;;IAIA,IAAM,WAAW,GAAqB;QAClC,MAAM,EAAE;YACJ,UAAU,EAAE,WAAW;SAC1B;KACJ,CAAC;IAEF;;;OAGG;IACH,SAAwB,UAAU,CAAC,MAAyB;QACxD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;YACpB,IAAI,OAAO,EAAE;gBACT,IAAI,WAAW,EAAE;oBACb,IAAA,qCAAO,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;iBACjC;qBAAM;oBACH,OAAO,OAAO,CAAC,IAAI,CAAC;iBACvB;aACJ;QACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;IACN,CAAC;IAjBD,6BAiBC","sourcesContent":["import { addCode } from 'roosterjs-content-model-dom';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { ContentModelCode, IStandaloneEditor } 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: IStandaloneEditor) {\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleCode.ts"],"names":[],"mappings":";;;IAIA,IAAM,WAAW,GAAqB;QAClC,MAAM,EAAE;YACJ,UAAU,EAAE,WAAW;SAC1B;KACJ,CAAC;IAEF;;;OAGG;IACH,SAAwB,UAAU,CAAC,MAAe;QAC9C,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,YAAY,EACZ,UAAC,CAAC,EAAE,WAAW,EAAE,OAAO;YACpB,IAAI,OAAO,EAAE;gBACT,IAAI,WAAW,EAAE;oBACb,IAAA,qCAAO,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;iBACjC;qBAAM;oBACH,OAAO,OAAO,CAAC,IAAI,CAAC;iBACvB;aACJ;QACL,CAAC,EACD,UAAC,CAAC,EAAE,OAAO,IAAK,OAAA,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAf,CAAe,CAClC,CAAC;IACN,CAAC;IAjBD,6BAiBC","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,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle italic style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleItalic(editor: IStandaloneEditor): void;
6
+ export default function toggleItalic(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleItalic.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,YAAY,CAAC,MAAyB;QAC1D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;QAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;IACN,CAAC;IAXD,+BAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } 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: IStandaloneEditor) {\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleItalic.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,YAAY,CAAC,MAAe;QAChD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,cAAc,EACd,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;QAClC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,MAAM,EAAf,CAAe,CAC5B,CAAC;IACN,CAAC;IAXD,+BAWC","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,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle strikethrough style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleStrikethrough(editor: IStandaloneEditor): void;
6
+ export default function toggleStrikethrough(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleStrikethrough.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,mBAAmB,CAAC,MAAyB;QACjE,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;QACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;IACN,CAAC;IAXD,sCAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } 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: IStandaloneEditor) {\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-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleStrikethrough.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,mBAAmB,CAAC,MAAe;QACvD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,qBAAqB,EACrB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,CAAC;QACzC,CAAC,EACD,UAAA,MAAM,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,aAAa,EAAtB,CAAsB,CACnC,CAAC;IACN,CAAC;IAXD,sCAWC","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,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle subscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSubscript(editor: IStandaloneEditor): void;
6
+ export default function toggleSubscript(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleSubscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSubscript.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,eAAe,CAAC,MAAyB;QAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,KAAK,CAAA,EAAA,CACvE,CAAC;IACN,CAAC;IAXD,kCAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle subscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSubscript(editor: IStandaloneEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSubscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'sub' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'sub'\n );\n}\n"]}
1
+ {"version":3,"file":"toggleSubscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSubscript.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,eAAe,CAAC,MAAe;QACnD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,KAAK,CAAA,EAAA,CACvE,CAAC;IACN,CAAC;IAXD,kCAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle subscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSubscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSubscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'sub' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'sub'\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle superscript style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleSuperscript(editor: IStandaloneEditor): void;
6
+ export default function toggleSuperscript(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleSuperscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSuperscript.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,iBAAiB,CAAC,MAAyB;QAC/D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,mBAAmB,EACnB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,OAAO,CAAA,EAAA,CACzE,CAAC;IACN,CAAC;IAXD,oCAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle superscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSuperscript(editor: IStandaloneEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSuperscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'super' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'super'\n );\n}\n"]}
1
+ {"version":3,"file":"toggleSuperscript.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleSuperscript.ts"],"names":[],"mappings":";;;IAGA;;;OAGG;IACH,SAAwB,iBAAiB,CAAC,MAAe;QACrD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,mBAAmB,EACnB,UAAC,MAAM,EAAE,WAAW;YAChB,MAAM,CAAC,wBAAwB,GAAG,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,CAAC,EACD,UAAA,MAAM,YAAI,OAAA,CAAA,MAAA,MAAM,CAAC,wBAAwB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,KAAI,OAAO,CAAA,EAAA,CACzE,CAAC;IACN,CAAC;IAXD,oCAWC","sourcesContent":["import { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle superscript style\n * @param editor The editor to operate on\n */\nexport default function toggleSuperscript(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleSuperscript',\n (format, isTurningOn) => {\n format.superOrSubScriptSequence = isTurningOn ? 'super' : '';\n },\n format => format.superOrSubScriptSequence?.split(' ').pop() == 'super'\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { IStandaloneEditor } from 'roosterjs-content-model-types';
1
+ import type { IEditor } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Toggle underline style
4
4
  * @param editor The editor to operate on
5
5
  */
6
- export default function toggleUnderline(editor: IStandaloneEditor): void;
6
+ export default function toggleUnderline(editor: IEditor): void;
@@ -1 +1 @@
1
- {"version":3,"file":"toggleUnderline.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleUnderline.ts"],"names":[],"mappings":";;;IAIA;;;OAGG;IACH,SAAwB,eAAe,CAAC,MAAyB;QAC7D,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW,EAAE,OAAO;YACzB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;YAEjC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;aACjD;QACL,CAAC,EACD,UAAC,MAAM,EAAE,OAAO,gBAAK,OAAA,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,0CAAE,SAAS,CAAA,CAAA,EAAA,EAC7E,KAAK,CAAC,yBAAyB,EAC/B,2DAA4B,CAC/B,CAAC;IACN,CAAC;IAjBD,kCAiBC","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IStandaloneEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle underline style\n * @param editor The editor to operate on\n */\nexport default function toggleUnderline(editor: IStandaloneEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleUnderline',\n (format, isTurningOn, segment) => {\n format.underline = !!isTurningOn;\n\n if (segment?.link) {\n segment.link.format.underline = !!isTurningOn;\n }\n },\n (format, segment) => !!format.underline || !!segment?.link?.format?.underline,\n false /*includingFormatHolder*/,\n adjustTrailingSpaceSelection\n );\n}\n"]}
1
+ {"version":3,"file":"toggleUnderline.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-api/lib/publicApi/segment/toggleUnderline.ts"],"names":[],"mappings":";;;IAIA;;;OAGG;IACH,SAAwB,eAAe,CAAC,MAAe;QACnD,MAAM,CAAC,KAAK,EAAE,CAAC;QAEf,IAAA,6DAA6B,EACzB,MAAM,EACN,iBAAiB,EACjB,UAAC,MAAM,EAAE,WAAW,EAAE,OAAO;YACzB,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;YAEjC,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE;gBACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC,WAAW,CAAC;aACjD;QACL,CAAC,EACD,UAAC,MAAM,EAAE,OAAO,gBAAK,OAAA,CAAC,CAAC,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,CAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,0CAAE,MAAM,0CAAE,SAAS,CAAA,CAAA,EAAA,EAC7E,KAAK,CAAC,yBAAyB,EAC/B,2DAA4B,CAC/B,CAAC;IACN,CAAC;IAjBD,kCAiBC","sourcesContent":["import { adjustTrailingSpaceSelection } from '../../modelApi/selection/adjustTrailingSpaceSelection';\nimport { formatSegmentWithContentModel } from '../utils/formatSegmentWithContentModel';\nimport type { IEditor } from 'roosterjs-content-model-types';\n\n/**\n * Toggle underline style\n * @param editor The editor to operate on\n */\nexport default function toggleUnderline(editor: IEditor) {\n editor.focus();\n\n formatSegmentWithContentModel(\n editor,\n 'toggleUnderline',\n (format, isTurningOn, segment) => {\n format.underline = !!isTurningOn;\n\n if (segment?.link) {\n segment.link.format.underline = !!isTurningOn;\n }\n },\n (format, segment) => !!format.underline || !!segment?.link?.format?.underline,\n false /*includingFormatHolder*/,\n adjustTrailingSpaceSelection\n );\n}\n"]}
@@ -1,8 +1,8 @@
1
- import type { IStandaloneEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
1
+ import type { IEditor, Border, BorderOperations } from 'roosterjs-content-model-types';
2
2
  /**
3
3
  * Operations to apply border
4
4
  * @param editor The editor instance
5
5
  * @param border The border to apply
6
6
  * @param operation The operation to apply
7
7
  */
8
- export default function applyTableBorderFormat(editor: IStandaloneEditor, border: Border, operation: BorderOperations): void;
8
+ export default function applyTableBorderFormat(editor: IEditor, border: Border, operation: BorderOperations): void;