@prosekit/extensions 0.12.2 → 0.14.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 (324) hide show
  1. package/dist/{drop-indicator-B1QHFb5m.js → drop-indicator-B_oMfeVP.js} +11 -10
  2. package/dist/drop-indicator-B_oMfeVP.js.map +1 -0
  3. package/dist/{enter-rule-CzWOZF_Z.js → enter-rule-D-p4ykfv.js} +1 -1
  4. package/dist/enter-rule-D-p4ykfv.js.map +1 -0
  5. package/dist/{file-DrfcSid-.js → file-iLVR0eM0.js} +3 -3
  6. package/dist/file-iLVR0eM0.js.map +1 -0
  7. package/dist/{index-oIc1a2f2.d.ts → index-cp1u4e0e.d.ts} +1 -1
  8. package/dist/index-cp1u4e0e.d.ts.map +1 -0
  9. package/dist/{input-rule-dmsb3j6w.js → input-rule-COGr_GBb.js} +1 -1
  10. package/dist/input-rule-COGr_GBb.js.map +1 -0
  11. package/dist/list/style.css +5 -5
  12. package/dist/list/style.css.map +1 -1
  13. package/dist/{mark-rule-BcLB4Uv2.js → mark-rule-CYe8zk4q.js} +6 -6
  14. package/dist/mark-rule-CYe8zk4q.js.map +1 -0
  15. package/dist/{paste-rule-pVb4sqvJ.js → paste-rule-BaDghcaU.js} +7 -7
  16. package/dist/paste-rule-BaDghcaU.js.map +1 -0
  17. package/dist/prosekit-extensions-autocomplete.d.ts +11 -3
  18. package/dist/prosekit-extensions-autocomplete.d.ts.map +1 -1
  19. package/dist/prosekit-extensions-autocomplete.js +171 -60
  20. package/dist/prosekit-extensions-autocomplete.js.map +1 -1
  21. package/dist/prosekit-extensions-background-color.d.ts +62 -0
  22. package/dist/prosekit-extensions-background-color.d.ts.map +1 -0
  23. package/dist/prosekit-extensions-background-color.js +76 -0
  24. package/dist/prosekit-extensions-background-color.js.map +1 -0
  25. package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
  26. package/dist/prosekit-extensions-blockquote.js +2 -2
  27. package/dist/prosekit-extensions-blockquote.js.map +1 -1
  28. package/dist/prosekit-extensions-bold.d.ts.map +1 -1
  29. package/dist/prosekit-extensions-bold.js +1 -1
  30. package/dist/prosekit-extensions-bold.js.map +1 -1
  31. package/dist/prosekit-extensions-code-block.d.ts +1 -1
  32. package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
  33. package/dist/prosekit-extensions-code-block.js +4 -4
  34. package/dist/prosekit-extensions-code-block.js.map +1 -1
  35. package/dist/prosekit-extensions-code.d.ts.map +1 -1
  36. package/dist/prosekit-extensions-code.js +1 -1
  37. package/dist/prosekit-extensions-code.js.map +1 -1
  38. package/dist/prosekit-extensions-commit.d.ts +0 -1
  39. package/dist/prosekit-extensions-commit.d.ts.map +1 -1
  40. package/dist/prosekit-extensions-commit.js +1 -1
  41. package/dist/prosekit-extensions-commit.js.map +1 -1
  42. package/dist/prosekit-extensions-doc.d.ts +0 -1
  43. package/dist/prosekit-extensions-doc.d.ts.map +1 -1
  44. package/dist/prosekit-extensions-doc.js.map +1 -1
  45. package/dist/prosekit-extensions-drop-cursor.d.ts.map +1 -1
  46. package/dist/prosekit-extensions-drop-cursor.js.map +1 -1
  47. package/dist/prosekit-extensions-drop-indicator.d.ts +0 -1
  48. package/dist/prosekit-extensions-drop-indicator.d.ts.map +1 -1
  49. package/dist/prosekit-extensions-drop-indicator.js +1 -1
  50. package/dist/prosekit-extensions-enter-rule.d.ts +0 -1
  51. package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
  52. package/dist/prosekit-extensions-enter-rule.js +1 -1
  53. package/dist/prosekit-extensions-file.d.ts +1 -1
  54. package/dist/prosekit-extensions-file.js +1 -1
  55. package/dist/prosekit-extensions-gap-cursor.d.ts +0 -1
  56. package/dist/prosekit-extensions-gap-cursor.d.ts.map +1 -1
  57. package/dist/prosekit-extensions-gap-cursor.js.map +1 -1
  58. package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
  59. package/dist/prosekit-extensions-hard-break.js.map +1 -1
  60. package/dist/prosekit-extensions-heading.d.ts.map +1 -1
  61. package/dist/prosekit-extensions-heading.js +7 -7
  62. package/dist/prosekit-extensions-heading.js.map +1 -1
  63. package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
  64. package/dist/prosekit-extensions-horizontal-rule.js +1 -1
  65. package/dist/prosekit-extensions-horizontal-rule.js.map +1 -1
  66. package/dist/prosekit-extensions-image.d.ts +9 -2
  67. package/dist/prosekit-extensions-image.d.ts.map +1 -1
  68. package/dist/prosekit-extensions-image.js +17 -4
  69. package/dist/prosekit-extensions-image.js.map +1 -1
  70. package/dist/prosekit-extensions-input-rule.d.ts +0 -1
  71. package/dist/prosekit-extensions-input-rule.d.ts.map +1 -1
  72. package/dist/prosekit-extensions-input-rule.js +1 -1
  73. package/dist/prosekit-extensions-italic.d.ts.map +1 -1
  74. package/dist/prosekit-extensions-italic.js +1 -1
  75. package/dist/prosekit-extensions-italic.js.map +1 -1
  76. package/dist/prosekit-extensions-link.d.ts +0 -1
  77. package/dist/prosekit-extensions-link.d.ts.map +1 -1
  78. package/dist/prosekit-extensions-link.js +4 -4
  79. package/dist/prosekit-extensions-link.js.map +1 -1
  80. package/dist/prosekit-extensions-list.d.ts +0 -1
  81. package/dist/prosekit-extensions-list.d.ts.map +1 -1
  82. package/dist/prosekit-extensions-list.js +3 -3
  83. package/dist/prosekit-extensions-list.js.map +1 -1
  84. package/dist/prosekit-extensions-loro.d.ts +16 -17
  85. package/dist/prosekit-extensions-loro.d.ts.map +1 -1
  86. package/dist/prosekit-extensions-loro.js +14 -7
  87. package/dist/prosekit-extensions-loro.js.map +1 -1
  88. package/dist/prosekit-extensions-mark-rule.d.ts +0 -1
  89. package/dist/prosekit-extensions-mark-rule.d.ts.map +1 -1
  90. package/dist/prosekit-extensions-mark-rule.js +1 -1
  91. package/dist/prosekit-extensions-mention.d.ts.map +1 -1
  92. package/dist/prosekit-extensions-mention.js.map +1 -1
  93. package/dist/prosekit-extensions-mod-click-prevention.d.ts +0 -1
  94. package/dist/prosekit-extensions-mod-click-prevention.d.ts.map +1 -1
  95. package/dist/prosekit-extensions-mod-click-prevention.js.map +1 -1
  96. package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
  97. package/dist/prosekit-extensions-paragraph.js +1 -1
  98. package/dist/prosekit-extensions-paragraph.js.map +1 -1
  99. package/dist/prosekit-extensions-paste-rule.d.ts +0 -1
  100. package/dist/prosekit-extensions-paste-rule.d.ts.map +1 -1
  101. package/dist/prosekit-extensions-paste-rule.js +1 -1
  102. package/dist/prosekit-extensions-placeholder.d.ts.map +1 -1
  103. package/dist/prosekit-extensions-placeholder.js +3 -4
  104. package/dist/prosekit-extensions-placeholder.js.map +1 -1
  105. package/dist/prosekit-extensions-readonly.d.ts +0 -1
  106. package/dist/prosekit-extensions-readonly.d.ts.map +1 -1
  107. package/dist/prosekit-extensions-readonly.js.map +1 -1
  108. package/dist/prosekit-extensions-search.d.ts +0 -1
  109. package/dist/prosekit-extensions-search.d.ts.map +1 -1
  110. package/dist/prosekit-extensions-search.js.map +1 -1
  111. package/dist/prosekit-extensions-strike.d.ts +0 -1
  112. package/dist/prosekit-extensions-strike.d.ts.map +1 -1
  113. package/dist/prosekit-extensions-strike.js +3 -3
  114. package/dist/prosekit-extensions-strike.js.map +1 -1
  115. package/dist/prosekit-extensions-table.d.ts.map +1 -1
  116. package/dist/prosekit-extensions-table.js +1 -2
  117. package/dist/prosekit-extensions-text-align.d.ts +0 -1
  118. package/dist/prosekit-extensions-text-align.d.ts.map +1 -1
  119. package/dist/prosekit-extensions-text-align.js +6 -6
  120. package/dist/prosekit-extensions-text-align.js.map +1 -1
  121. package/dist/prosekit-extensions-text-color.d.ts +62 -0
  122. package/dist/prosekit-extensions-text-color.d.ts.map +1 -0
  123. package/dist/prosekit-extensions-text-color.js +76 -0
  124. package/dist/prosekit-extensions-text-color.js.map +1 -0
  125. package/dist/prosekit-extensions-text.d.ts +0 -1
  126. package/dist/prosekit-extensions-text.d.ts.map +1 -1
  127. package/dist/prosekit-extensions-text.js.map +1 -1
  128. package/dist/prosekit-extensions-underline.d.ts +0 -1
  129. package/dist/prosekit-extensions-underline.d.ts.map +1 -1
  130. package/dist/prosekit-extensions-virtual-selection.d.ts +0 -1
  131. package/dist/prosekit-extensions-virtual-selection.d.ts.map +1 -1
  132. package/dist/prosekit-extensions-virtual-selection.js.map +1 -1
  133. package/dist/prosekit-extensions-yjs.d.ts +9 -2
  134. package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
  135. package/dist/prosekit-extensions-yjs.js +1 -1
  136. package/dist/prosekit-extensions-yjs.js.map +1 -1
  137. package/dist/{shiki-highlighter-chunk-rkzofy4z.d.ts → shiki-highlighter-chunk-DNNm2Vow.d.ts} +1 -1
  138. package/dist/shiki-highlighter-chunk-DNNm2Vow.d.ts.map +1 -0
  139. package/dist/shiki-highlighter-chunk.d.ts +1 -1
  140. package/dist/shiki-highlighter-chunk.js.map +1 -1
  141. package/dist/{table-BRDh_9mG.js → table-4oHfV-Ql.js} +2 -2
  142. package/dist/table-4oHfV-Ql.js.map +1 -0
  143. package/package.json +33 -18
  144. package/src/autocomplete/autocomplete-helpers.ts +19 -14
  145. package/src/autocomplete/autocomplete-plugin.ts +260 -126
  146. package/src/autocomplete/autocomplete-rule.ts +3 -3
  147. package/src/autocomplete/autocomplete.spec.ts +244 -40
  148. package/src/autocomplete/autocomplete.ts +9 -7
  149. package/src/background-color/background-color-commands.spec.ts +71 -0
  150. package/src/background-color/background-color-commands.ts +35 -0
  151. package/src/background-color/background-color-spec.spec.ts +286 -0
  152. package/src/background-color/background-color-spec.ts +58 -0
  153. package/src/background-color/background-color.ts +21 -0
  154. package/src/background-color/index.ts +8 -0
  155. package/src/blockquote/blockquote-commands.ts +1 -7
  156. package/src/blockquote/blockquote-keymap.spec.ts +5 -9
  157. package/src/blockquote/blockquote-keymap.ts +2 -7
  158. package/src/blockquote/blockquote-spec.ts +1 -4
  159. package/src/blockquote/blockquote.ts +3 -12
  160. package/src/blockquote/index.ts +3 -12
  161. package/src/bold/bold-commands.ts +1 -5
  162. package/src/bold/bold-input-rule.spec.ts +1 -5
  163. package/src/bold/bold-input-rule.ts +1 -4
  164. package/src/bold/bold-keymap.ts +1 -5
  165. package/src/bold/bold-spec.ts +1 -4
  166. package/src/bold/bold.ts +3 -12
  167. package/src/bold/index.ts +3 -12
  168. package/src/code/code-commands.ts +1 -5
  169. package/src/code/code-input-rule.ts +1 -4
  170. package/src/code/code-keymap.ts +1 -5
  171. package/src/code/code-spec.ts +1 -4
  172. package/src/code/code.ts +3 -12
  173. package/src/code/index.ts +3 -12
  174. package/src/code-block/code-block-commands.ts +1 -8
  175. package/src/code-block/code-block-highlight.ts +2 -8
  176. package/src/code-block/code-block-keymap.ts +2 -9
  177. package/src/code-block/code-block-shiki.ts +1 -4
  178. package/src/code-block/code-block-spec.spec.ts +4 -11
  179. package/src/code-block/code-block-spec.ts +1 -4
  180. package/src/code-block/code-block.ts +4 -16
  181. package/src/code-block/index.ts +5 -21
  182. package/src/code-block/shiki-highlighter-chunk.ts +1 -7
  183. package/src/code-block/shiki-highlighter.ts +1 -4
  184. package/src/code-block/shiki-parser.ts +1 -4
  185. package/src/commit/index.ts +7 -36
  186. package/src/doc/index.ts +1 -4
  187. package/src/drop-cursor/drop-cursor.ts +1 -4
  188. package/src/drop-cursor/index.ts +1 -5
  189. package/src/drop-indicator/drop-indicator-facet.ts +12 -21
  190. package/src/drop-indicator/index.ts +1 -5
  191. package/src/enter-rule/index.ts +2 -11
  192. package/src/file/file-paste-handler.spec.ts +3 -16
  193. package/src/file/index.ts +3 -16
  194. package/src/gap-cursor/gap-cursor.ts +1 -4
  195. package/src/gap-cursor/index.ts +1 -4
  196. package/src/hard-break/hard-break-commands.ts +1 -5
  197. package/src/hard-break/hard-break-keymap.spec.ts +6 -12
  198. package/src/hard-break/hard-break-keymap.ts +1 -4
  199. package/src/hard-break/hard-break-spec.ts +1 -4
  200. package/src/hard-break/hard-break.ts +3 -12
  201. package/src/hard-break/index.ts +3 -12
  202. package/src/heading/heading-commands.ts +1 -7
  203. package/src/heading/heading-keymap.spec.ts +8 -12
  204. package/src/heading/heading-keymap.ts +7 -14
  205. package/src/heading/heading-spec.ts +1 -4
  206. package/src/heading/heading.ts +3 -12
  207. package/src/heading/index.ts +3 -12
  208. package/src/horizontal-rule/horizontal-rule-commands.spec.ts +1 -5
  209. package/src/horizontal-rule/horizontal-rule-commands.ts +2 -9
  210. package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +5 -9
  211. package/src/horizontal-rule/horizontal-rule-input-rule.ts +1 -5
  212. package/src/horizontal-rule/horizontal-rule-spec.ts +1 -4
  213. package/src/horizontal-rule/horizontal-rule.ts +3 -12
  214. package/src/horizontal-rule/index.ts +3 -13
  215. package/src/image/image-commands/upload-image.spec.ts +245 -0
  216. package/src/image/image-commands/upload-image.ts +46 -11
  217. package/src/image/image-commands.ts +2 -8
  218. package/src/image/image-spec.ts +1 -4
  219. package/src/image/image-upload-handler.ts +2 -8
  220. package/src/image/image.ts +3 -12
  221. package/src/image/index.ts +3 -13
  222. package/src/input-rule/index.ts +2 -13
  223. package/src/italic/index.ts +3 -12
  224. package/src/italic/italic-commands.spec.ts +2 -10
  225. package/src/italic/italic-commands.ts +1 -5
  226. package/src/italic/italic-input-rule.spec.ts +1 -5
  227. package/src/italic/italic-input-rule.ts +1 -4
  228. package/src/italic/italic-keymap.ts +1 -5
  229. package/src/italic/italic-spec.ts +1 -4
  230. package/src/italic/italic.ts +3 -12
  231. package/src/link/index.spec.ts +10 -13
  232. package/src/link/index.ts +1 -5
  233. package/src/link/link-paste-rule.spec.ts +2 -9
  234. package/src/link/link-regex.spec.ts +1 -5
  235. package/src/list/index.ts +3 -12
  236. package/src/list/list-commands.ts +1 -5
  237. package/src/list/list-input-rules.ts +1 -4
  238. package/src/list/list-keymap.spec.ts +6 -10
  239. package/src/list/list-keymap.ts +2 -8
  240. package/src/list/list-plugins.ts +1 -4
  241. package/src/list/list-serializer.ts +2 -9
  242. package/src/list/list-spec.ts +3 -13
  243. package/src/list/list.spec.ts +10 -21
  244. package/src/list/list.ts +3 -12
  245. package/src/list/style.css +5 -5
  246. package/src/loro/index.ts +3 -13
  247. package/src/loro/loro-commands.ts +2 -8
  248. package/src/loro/loro-cursor-plugin.ts +21 -21
  249. package/src/loro/loro-keymap.ts +3 -11
  250. package/src/loro/loro-sync-plugin.ts +2 -8
  251. package/src/loro/loro-undo-plugin.ts +2 -8
  252. package/src/loro/loro.ts +16 -21
  253. package/src/mark-rule/apply.ts +3 -13
  254. package/src/mark-rule/mark-rule.spec.ts +2 -13
  255. package/src/mark-rule/mark-rule.ts +2 -13
  256. package/src/mark-rule/range.ts +2 -8
  257. package/src/mark-rule/types.ts +1 -4
  258. package/src/mention/index.ts +1 -8
  259. package/src/mod-click-prevention/index.ts +2 -9
  260. package/src/paragraph/paragraph-commands.ts +1 -5
  261. package/src/paragraph/paragraph-keymap.ts +2 -5
  262. package/src/paragraph/paragraph-spec.ts +1 -4
  263. package/src/paragraph/paragraph.ts +3 -14
  264. package/src/paste-rule/index.ts +2 -10
  265. package/src/paste-rule/mark-paste-rule.spec.ts +3 -13
  266. package/src/paste-rule/mark-paste-rule.ts +4 -14
  267. package/src/paste-rule/paste-rule-plugin.ts +2 -11
  268. package/src/paste-rule/paste-rule.spec.ts +4 -19
  269. package/src/paste-rule/split-text-by-regex.spec.ts +1 -5
  270. package/src/placeholder/index.ts +4 -16
  271. package/src/readonly/index.ts +2 -8
  272. package/src/search/index.ts +1 -6
  273. package/src/strike/index.ts +2 -2
  274. package/src/table/index.ts +10 -40
  275. package/src/table/table-commands/delete-cell-selection.spec.ts +1 -5
  276. package/src/table/table-commands/exit-table.spec.ts +1 -5
  277. package/src/table/table-commands/insert-table.spec.ts +1 -5
  278. package/src/table/table-commands/insert-table.ts +1 -4
  279. package/src/table/table-commands/move-table-column.spec.ts +1 -5
  280. package/src/table/table-commands/move-table-column.ts +1 -4
  281. package/src/table/table-commands/move-table-row.spec.ts +1 -5
  282. package/src/table/table-commands/move-table-row.ts +1 -4
  283. package/src/table/table-commands/select-table-cell.spec.ts +1 -5
  284. package/src/table/table-commands/select-table-column.spec.ts +1 -5
  285. package/src/table/table-commands/select-table-row.spec.ts +1 -5
  286. package/src/table/table-commands/select-table.spec.ts +1 -5
  287. package/src/table/table-commands/select-table.ts +1 -4
  288. package/src/table/table-commands.ts +8 -32
  289. package/src/table/table-plugins.ts +2 -8
  290. package/src/table/table-spec.spec.ts +2 -11
  291. package/src/table/table-spec.ts +2 -8
  292. package/src/table/table-utils.ts +2 -6
  293. package/src/table/table.ts +2 -8
  294. package/src/table/test-utils.ts +1 -4
  295. package/src/testing/clipboard.ts +1 -2
  296. package/src/testing/index.ts +9 -14
  297. package/src/testing/keyboard.ts +0 -30
  298. package/src/text/index.ts +1 -4
  299. package/src/text-align/index.ts +6 -6
  300. package/src/text-color/index.ts +3 -0
  301. package/src/text-color/text-color-commands.spec.ts +71 -0
  302. package/src/text-color/text-color-commands.ts +35 -0
  303. package/src/text-color/text-color-spec.spec.ts +297 -0
  304. package/src/text-color/text-color-spec.ts +58 -0
  305. package/src/text-color/text-color.ts +21 -0
  306. package/src/virtual-selection/index.ts +3 -14
  307. package/src/yjs/index.ts +5 -20
  308. package/src/yjs/yjs-commands.ts +2 -8
  309. package/src/yjs/yjs-cursor-plugin.ts +3 -5
  310. package/src/yjs/yjs-keymap.ts +3 -11
  311. package/src/yjs/yjs-sync-plugin.ts +1 -4
  312. package/src/yjs/yjs-types.ts +10 -0
  313. package/src/yjs/yjs-undo-plugin.ts +2 -8
  314. package/src/yjs/yjs.ts +6 -24
  315. package/dist/drop-indicator-B1QHFb5m.js.map +0 -1
  316. package/dist/enter-rule-CzWOZF_Z.js.map +0 -1
  317. package/dist/file-DrfcSid-.js.map +0 -1
  318. package/dist/index-oIc1a2f2.d.ts.map +0 -1
  319. package/dist/input-rule-dmsb3j6w.js.map +0 -1
  320. package/dist/mark-rule-BcLB4Uv2.js.map +0 -1
  321. package/dist/paste-rule-pVb4sqvJ.js.map +0 -1
  322. package/dist/shiki-highlighter-chunk-rkzofy4z.d.ts.map +0 -1
  323. package/dist/table-BRDh_9mG.js.map +0 -1
  324. package/src/testing/format-html.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAUY,KAAA,0BAAA,GAA6B,SAAA,CAAA;EAgBzB,QAAA,EAAA;;;;;AENhB;;AAAgE,iBFMhD,uBAAA,CAAA,CENgD,EFMrB,0BENqB;;;;;;AFVpD,KCDA,sBAAA,GAAyB,SDCI,CAAA;EAgBzB,KAAA,EAAA;eCfD;;;AAFf;AAWA;;;;ACAY,iBDAI,mBAAA,CAAA,CCAc,EDAS,sBCAT;;;;;AFV9B;AAgBgB,KENJ,kBAAA,GAAqB,KFMM,CAAA,CENC,sBFMG,EENqB,0BFMK,CAAA,CAAA;;;;ACjBrE;AAWA;;;;ACAY,iBAUI,eAAA,CAAA,CAVc,EAUK,kBAVL;;;;;;iBCVd,qBAAA,CAAA,GAAyB"}
1
+ {"version":3,"file":"prosekit-extensions-paragraph.d.ts","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts","../src/paragraph/paragraph-keymap.ts"],"mappings":";;;;;;;;KAMY,0BAAA,GAA6B,SAAA;EACvC,QAAA;IACE,YAAA;EAAA;AAAA;AAcJ;;;AAAA,iBAAgB,uBAAA,CAAA,GAA2B,0BAAA;;;;;;KChB/B,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,KAAA;EAAA;AAAA;;;;;ADcf;iBCLgB,mBAAA,CAAA,GAAuB,sBAAA;;;;;ADXvC;KEGY,kBAAA,GAAqB,KAAA,EAAO,sBAAA,EAAwB,0BAAA;;;;;;;;AFahE;iBEHgB,eAAA,CAAA,GAAmB,kBAAA;;;;;;iBCZnB,qBAAA,CAAA,GAAyB,cAAA"}
@@ -20,7 +20,7 @@ function defineParagraphCommands() {
20
20
  * @internal
21
21
  */
22
22
  function defineParagraphKeymap() {
23
- return defineKeymap({ "mod-alt-0": setParagraph() });
23
+ return defineKeymap({ "Mod-Alt-0": setParagraph() });
24
24
  }
25
25
 
26
26
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-paragraph.js","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-keymap.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts"],"sourcesContent":["import {\n defineCommands,\n setBlockType,\n type Extension,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @internal\n */\nexport type ParagraphCommandsExtension = Extension<{\n Commands: {\n setParagraph: []\n }\n}>\n\n/**\n * @internal\n */\nexport function setParagraph(): Command {\n return setBlockType({ type: 'paragraph' })\n}\n\n/**\n * @internal\n */\nexport function defineParagraphCommands(): ParagraphCommandsExtension {\n return defineCommands({ setParagraph })\n}\n","import {\n defineKeymap,\n type PlainExtension,\n} from '@prosekit/core'\n\nimport { setParagraph } from './paragraph-commands'\n\n/**\n * @internal\n */\nexport function defineParagraphKeymap(): PlainExtension {\n return defineKeymap({\n 'mod-alt-0': setParagraph(),\n })\n}\n","import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type ParagraphSpecExtension = Extension<{\n Nodes: {\n paragraph: Attrs\n }\n}>\n\n/**\n * @internal\n *\n * Defines a paragraph node spec.\n */\nexport function defineParagraphSpec(): ParagraphSpecExtension {\n return defineNodeSpec({\n name: 'paragraph',\n content: 'inline*',\n group: 'block',\n parseDOM: [{ tag: 'p' }],\n toDOM() {\n return ['p', 0]\n },\n })\n}\n","import {\n Priority,\n union,\n withPriority,\n type Union,\n} from '@prosekit/core'\n\nimport {\n defineParagraphCommands,\n type ParagraphCommandsExtension,\n} from './paragraph-commands'\nimport { defineParagraphKeymap } from './paragraph-keymap'\nimport {\n defineParagraphSpec,\n type ParagraphSpecExtension,\n} from './paragraph-spec'\n\n/**\n * @internal\n */\nexport type ParagraphExtension = Union<[ParagraphSpecExtension, ParagraphCommandsExtension]>\n\n/**\n * @public\n *\n * Defines a paragraph node.\n *\n * The paragraph node spec has the highest priority, because it should be the\n * default block node for most cases.\n */\nexport function defineParagraph(): ParagraphExtension {\n return union(\n withPriority(defineParagraphSpec(), Priority.highest),\n defineParagraphCommands(),\n defineParagraphKeymap(),\n )\n}\n"],"mappings":";;;;;;AAmBA,SAAgB,eAAwB;AACtC,QAAO,aAAa,EAAE,MAAM,aAAa,CAAC;;;;;AAM5C,SAAgB,0BAAsD;AACpE,QAAO,eAAe,EAAE,cAAc,CAAC;;;;;;;;ACjBzC,SAAgB,wBAAwC;AACtD,QAAO,aAAa,EAClB,aAAa,cAAc,EAC5B,CAAC;;;;;;;;;;ACOJ,SAAgB,sBAA8C;AAC5D,QAAO,eAAe;EACpB,MAAM;EACN,SAAS;EACT,OAAO;EACP,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC;EACxB,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;;;;;;;;;ACCJ,SAAgB,kBAAsC;AACpD,QAAO,MACL,aAAa,qBAAqB,EAAE,SAAS,QAAQ,EACrD,yBAAyB,EACzB,uBAAuB,CACxB"}
1
+ {"version":3,"file":"prosekit-extensions-paragraph.js","names":[],"sources":["../src/paragraph/paragraph-commands.ts","../src/paragraph/paragraph-keymap.ts","../src/paragraph/paragraph-spec.ts","../src/paragraph/paragraph.ts"],"sourcesContent":["import { defineCommands, setBlockType, type Extension } from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @internal\n */\nexport type ParagraphCommandsExtension = Extension<{\n Commands: {\n setParagraph: []\n }\n}>\n\n/**\n * @internal\n */\nexport function setParagraph(): Command {\n return setBlockType({ type: 'paragraph' })\n}\n\n/**\n * @internal\n */\nexport function defineParagraphCommands(): ParagraphCommandsExtension {\n return defineCommands({ setParagraph })\n}\n","import { defineKeymap, type PlainExtension } from '@prosekit/core'\n\nimport { setParagraph } from './paragraph-commands'\n\n/**\n * @internal\n */\nexport function defineParagraphKeymap(): PlainExtension {\n return defineKeymap({\n 'Mod-Alt-0': setParagraph(),\n })\n}\n","import { defineNodeSpec, type Extension } from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type ParagraphSpecExtension = Extension<{\n Nodes: {\n paragraph: Attrs\n }\n}>\n\n/**\n * @internal\n *\n * Defines a paragraph node spec.\n */\nexport function defineParagraphSpec(): ParagraphSpecExtension {\n return defineNodeSpec({\n name: 'paragraph',\n content: 'inline*',\n group: 'block',\n parseDOM: [{ tag: 'p' }],\n toDOM() {\n return ['p', 0]\n },\n })\n}\n","import { Priority, union, withPriority, type Union } from '@prosekit/core'\n\nimport { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands'\nimport { defineParagraphKeymap } from './paragraph-keymap'\nimport { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec'\n\n/**\n * @internal\n */\nexport type ParagraphExtension = Union<[ParagraphSpecExtension, ParagraphCommandsExtension]>\n\n/**\n * @public\n *\n * Defines a paragraph node.\n *\n * The paragraph node spec has the highest priority, because it should be the\n * default block node for most cases.\n */\nexport function defineParagraph(): ParagraphExtension {\n return union(\n withPriority(defineParagraphSpec(), Priority.highest),\n defineParagraphCommands(),\n defineParagraphKeymap(),\n )\n}\n"],"mappings":";;;;;;AAeA,SAAgB,eAAwB;AACtC,QAAO,aAAa,EAAE,MAAM,aAAa,CAAC;;;;;AAM5C,SAAgB,0BAAsD;AACpE,QAAO,eAAe,EAAE,cAAc,CAAC;;;;;;;;AChBzC,SAAgB,wBAAwC;AACtD,QAAO,aAAa,EAClB,aAAa,cAAc,EAC5B,CAAC;;;;;;;;;;ACOJ,SAAgB,sBAA8C;AAC5D,QAAO,eAAe;EACpB,MAAM;EACN,SAAS;EACT,OAAO;EACP,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC;EACxB,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;;;;;;;;;ACPJ,SAAgB,kBAAsC;AACpD,QAAO,MACL,aAAa,qBAAqB,EAAE,SAAS,QAAQ,EACrD,yBAAyB,EACzB,uBAAuB,CACxB"}
@@ -3,7 +3,6 @@ import { EditorView } from "@prosekit/pm/view";
3
3
  import { Attrs, MarkType, ProseMirrorNode, Slice } from "@prosekit/pm/model";
4
4
 
5
5
  //#region src/paste-rule/mark-paste-rule.d.ts
6
-
7
6
  /**
8
7
  * The options for {@link defineMarkPasteRule}.
9
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAsBA;;AAUiB,UAVA,oBAAA,CAUA;EAQI;;;;EAcL,KAAA,EA3BP,MA2BO;;;;EC3CC,IAAA,EAAA,MAAA,GDqBA,QCrBA;EAwBL;AAOZ;AAeA;;;;EAA8E,QAAA,CAAA,EAAA,CAAA,KAAA,EDjBzD,eCiByD,EAAA,GDjBrC,KCiBqC,GAAA,IAAA,GAAA,SAAA,GAAA,KAAA;;;;;sBDXxD;;;;;;;iBAQN,mBAAA,UAA6B,uBAAuB;;;;;AAhCpE;;;AAkBqB,UC7BJ,uBAAA,CD6BI;EAAoB;;;EAczB,KAAA,ECvCP,KDuCO;;;;EC3CC,IAAA,EAST,UATS;EAwBL;AAOZ;AAeA;;EAA6C,KAAA,EAAA,OAAA;;;;;;;;KAtBjC,gBAAA,aAA6B,4BAA4B;;;;;;UAOpD,gBAAA;;;;WAIN;;;;;;;;;;iBAWK,eAAA;;GAA6B,mBAAmB"}
1
+ {"version":3,"file":"prosekit-extensions-paste-rule.d.ts","names":[],"sources":["../src/paste-rule/mark-paste-rule.ts","../src/paste-rule/paste-rule.ts"],"mappings":";;;;;;;;AAYA;;UAAiB,oBAAA;EAKR;;;;EAAP,KAAA,EAAO,MAAA;EAmB4B;;;EAdnC,IAAA,WAAe,QAAA;EAAf;;;;;;EAQA,QAAA,IAAY,KAAA,EAAO,eAAA,KAAoB,KAAA;EAMnB;;;;EAApB,UAAA,IAAc,IAAA,EAAM,eAAA;AAAA;;;;;;iBAQN,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAuB,cAAA;;;;;AAhCpE;;;UCDiB,uBAAA;EDWA;;;ECPf,KAAA,EAAO,KAAA;EDqB4B;;;EChBnC,IAAA,EAAM,UAAA;EDEN;;;;ECIA,KAAA;AAAA;;;;;;ADkBF;KCTY,gBAAA,IAAoB,OAAA,EAAS,uBAAA,KAA4B,KAAA;;;;;;UAOpD,gBAAA;EDEiE;;;ECEhF,OAAA,EAAS,gBAAA;AAAA;;;;;;;;;iBAWK,eAAA,CAAA;EAAkB;AAAA,GAAW,gBAAA,GAAmB,cAAA"}
@@ -1,3 +1,3 @@
1
- import { n as definePasteRule, t as defineMarkPasteRule } from "./paste-rule-pVb4sqvJ.js";
1
+ import { n as definePasteRule, t as defineMarkPasteRule } from "./paste-rule-BaDghcaU.js";
2
2
 
3
3
  export { defineMarkPasteRule, definePasteRule };
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":[],"mappings":";;;;UAmBiB,kBAAA;;AAAjB;AA4BA;;iCAvBiC;;;;;;;;;;;;;;;wCAgBO;;;;;;iBAOxB,iBAAA,UAA2B,qBAAqB"}
1
+ {"version":3,"file":"prosekit-extensions-placeholder.d.ts","names":[],"sources":["../src/placeholder/index.ts"],"mappings":";;;;UAOiB,kBAAA;;AAAjB;;;EAKE,WAAA,aAAwB,KAAA,EAAO,WAAA;EAA/B;;;;;;;;AAuBF;;;;;;EAPE,QAAA,uBAA+B,KAAA,EAAO,WAAA;AAAA;;;;;iBAOxB,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,cAAA"}
@@ -1,6 +1,5 @@
1
- import "./drop-indicator-B1QHFb5m.js";
2
- import { p as findTable } from "./table-BRDh_9mG.js";
3
- import { definePlugin, isInCodeBlock, maybeRun } from "@prosekit/core";
1
+ import { p as findTable } from "./table-4oHfV-Ql.js";
2
+ import { definePlugin, isInCodeBlock, isTextSelection, maybeRun } from "@prosekit/core";
4
3
  import { Plugin, PluginKey } from "@prosekit/pm/state";
5
4
  import { Decoration, DecorationSet } from "@prosekit/pm/view";
6
5
 
@@ -35,7 +34,7 @@ function isDocEmpty(doc) {
35
34
  function createPlaceholderDecoration(state, placeholderText) {
36
35
  if (!placeholderText) return null;
37
36
  const { selection } = state;
38
- if (!selection.empty) return null;
37
+ if (!selection.empty || !isTextSelection(selection)) return null;
39
38
  const $pos = selection.$anchor;
40
39
  const node = $pos.parent;
41
40
  if (node.content.size > 0) return null;
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-placeholder.js","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":["import {\n definePlugin,\n isInCodeBlock,\n maybeRun,\n type PlainExtension,\n} from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\nimport {\n Plugin,\n PluginKey,\n type EditorState,\n} from '@prosekit/pm/state'\nimport {\n Decoration,\n DecorationSet,\n} from '@prosekit/pm/view'\n\nimport { findTable } from '../table'\n\nexport interface PlaceholderOptions {\n /**\n * The placeholder to use. It can be a static string or a function that\n * receives the current editor state and returns a string.\n */\n placeholder: string | ((state: EditorState) => string)\n\n /**\n * By default, the placeholder text will be shown whenever the current text\n * cursor is in an empty text node and it's not inside a code block or a\n * table node.\n *\n * If you only want to show the placeholder when the whole doc is empty, you\n * can set this option to 'doc'.\n *\n * You can also pass a function that receives the current editor state and\n * returns a boolean value to determine whether the placeholder should be\n * shown.\n *\n * @default 'block'\n */\n strategy?: 'doc' | 'block' | ((state: EditorState) => boolean)\n}\n\n/**\n * Add a placeholder text to the editor when the current block or document is\n * empty.\n */\nexport function definePlaceholder(options: PlaceholderOptions): PlainExtension {\n return definePlugin(createPlaceholderPlugin(options))\n}\n\nfunction createPlaceholderPlugin({\n placeholder,\n strategy = 'block',\n}: PlaceholderOptions): Plugin {\n return new Plugin({\n key: new PluginKey('prosekit-placeholder'),\n props: {\n decorations: (state) => {\n const strategyFn = typeof strategy === 'function'\n ? strategy\n : strategy === 'doc'\n ? docStrategy\n : defaultStrategy\n\n if (!strategyFn(state)) {\n return null\n }\n\n const placeholderText: string = maybeRun(placeholder, state)\n const deco = createPlaceholderDecoration(state, placeholderText)\n if (!deco) {\n return null\n }\n\n return DecorationSet.create(state.doc, [deco])\n },\n },\n })\n}\n\nfunction defaultStrategy(state: EditorState): boolean {\n return !isInCodeBlock(state.selection) && !findTable(state.selection.$from)\n}\n\nfunction docStrategy(state: EditorState): boolean {\n return isDocEmpty(state.doc) && defaultStrategy(state)\n}\n\nfunction isDocEmpty(doc: ProseMirrorNode) {\n return doc.childCount <= 1 && !doc.firstChild?.content.size\n}\n\nfunction createPlaceholderDecoration(\n state: EditorState,\n placeholderText: string,\n): Decoration | null {\n if (!placeholderText) return null\n\n const { selection } = state\n if (!selection.empty) return null\n\n const $pos = selection.$anchor\n const node = $pos.parent\n if (node.content.size > 0) return null\n\n const before = $pos.before()\n\n return Decoration.node(before, before + node.nodeSize, {\n 'class': 'prosekit-placeholder',\n 'data-placeholder': placeholderText,\n })\n}\n"],"mappings":";;;;;;;;;;;AA+CA,SAAgB,kBAAkB,SAA6C;AAC7E,QAAO,aAAa,wBAAwB,QAAQ,CAAC;;AAGvD,SAAS,wBAAwB,EAC/B,aACA,WAAW,WACkB;AAC7B,QAAO,IAAI,OAAO;EAChB,KAAK,IAAI,UAAU,uBAAuB;EAC1C,OAAO,EACL,cAAc,UAAU;AAOtB,OAAI,EANe,OAAO,aAAa,aACnC,WACA,aAAa,QACb,cACA,iBAEY,MAAM,CACpB,QAAO;GAIT,MAAM,OAAO,4BAA4B,OADT,SAAS,aAAa,MAAM,CACI;AAChE,OAAI,CAAC,KACH,QAAO;AAGT,UAAO,cAAc,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC;KAEjD;EACF,CAAC;;AAGJ,SAAS,gBAAgB,OAA6B;AACpD,QAAO,CAAC,cAAc,MAAM,UAAU,IAAI,CAAC,UAAU,MAAM,UAAU,MAAM;;AAG7E,SAAS,YAAY,OAA6B;AAChD,QAAO,WAAW,MAAM,IAAI,IAAI,gBAAgB,MAAM;;AAGxD,SAAS,WAAW,KAAsB;AACxC,QAAO,IAAI,cAAc,KAAK,CAAC,IAAI,YAAY,QAAQ;;AAGzD,SAAS,4BACP,OACA,iBACmB;AACnB,KAAI,CAAC,gBAAiB,QAAO;CAE7B,MAAM,EAAE,cAAc;AACtB,KAAI,CAAC,UAAU,MAAO,QAAO;CAE7B,MAAM,OAAO,UAAU;CACvB,MAAM,OAAO,KAAK;AAClB,KAAI,KAAK,QAAQ,OAAO,EAAG,QAAO;CAElC,MAAM,SAAS,KAAK,QAAQ;AAE5B,QAAO,WAAW,KAAK,QAAQ,SAAS,KAAK,UAAU;EACrD,SAAS;EACT,oBAAoB;EACrB,CAAC"}
1
+ {"version":3,"file":"prosekit-extensions-placeholder.js","names":[],"sources":["../src/placeholder/index.ts"],"sourcesContent":["import { definePlugin, isInCodeBlock, isTextSelection, maybeRun, type PlainExtension } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\nimport { Plugin, PluginKey, type EditorState } from '@prosekit/pm/state'\nimport { Decoration, DecorationSet } from '@prosekit/pm/view'\n\nimport { findTable } from '../table'\n\nexport interface PlaceholderOptions {\n /**\n * The placeholder to use. It can be a static string or a function that\n * receives the current editor state and returns a string.\n */\n placeholder: string | ((state: EditorState) => string)\n\n /**\n * By default, the placeholder text will be shown whenever the current text\n * cursor is in an empty text node and it's not inside a code block or a\n * table node.\n *\n * If you only want to show the placeholder when the whole doc is empty, you\n * can set this option to 'doc'.\n *\n * You can also pass a function that receives the current editor state and\n * returns a boolean value to determine whether the placeholder should be\n * shown.\n *\n * @default 'block'\n */\n strategy?: 'doc' | 'block' | ((state: EditorState) => boolean)\n}\n\n/**\n * Add a placeholder text to the editor when the current block or document is\n * empty.\n */\nexport function definePlaceholder(options: PlaceholderOptions): PlainExtension {\n return definePlugin(createPlaceholderPlugin(options))\n}\n\nfunction createPlaceholderPlugin({\n placeholder,\n strategy = 'block',\n}: PlaceholderOptions): Plugin {\n return new Plugin({\n key: new PluginKey('prosekit-placeholder'),\n props: {\n decorations: (state) => {\n const strategyFn = typeof strategy === 'function'\n ? strategy\n : strategy === 'doc'\n ? docStrategy\n : defaultStrategy\n\n if (!strategyFn(state)) {\n return null\n }\n\n const placeholderText: string = maybeRun(placeholder, state)\n const deco = createPlaceholderDecoration(state, placeholderText)\n if (!deco) {\n return null\n }\n\n return DecorationSet.create(state.doc, [deco])\n },\n },\n })\n}\n\nfunction defaultStrategy(state: EditorState): boolean {\n return !isInCodeBlock(state.selection) && !findTable(state.selection.$from)\n}\n\nfunction docStrategy(state: EditorState): boolean {\n return isDocEmpty(state.doc) && defaultStrategy(state)\n}\n\nfunction isDocEmpty(doc: ProseMirrorNode) {\n return doc.childCount <= 1 && !doc.firstChild?.content.size\n}\n\nfunction createPlaceholderDecoration(\n state: EditorState,\n placeholderText: string,\n): Decoration | null {\n if (!placeholderText) return null\n\n const { selection } = state\n if (!selection.empty || !isTextSelection(selection)) return null\n\n const $pos = selection.$anchor\n const node = $pos.parent\n if (node.content.size > 0) return null\n\n const before = $pos.before()\n\n return Decoration.node(before, before + node.nodeSize, {\n 'class': 'prosekit-placeholder',\n 'data-placeholder': placeholderText,\n })\n}\n"],"mappings":";;;;;;;;;;AAmCA,SAAgB,kBAAkB,SAA6C;AAC7E,QAAO,aAAa,wBAAwB,QAAQ,CAAC;;AAGvD,SAAS,wBAAwB,EAC/B,aACA,WAAW,WACkB;AAC7B,QAAO,IAAI,OAAO;EAChB,KAAK,IAAI,UAAU,uBAAuB;EAC1C,OAAO,EACL,cAAc,UAAU;AAOtB,OAAI,EANe,OAAO,aAAa,aACnC,WACA,aAAa,QACb,cACA,iBAEY,MAAM,CACpB,QAAO;GAIT,MAAM,OAAO,4BAA4B,OADT,SAAS,aAAa,MAAM,CACI;AAChE,OAAI,CAAC,KACH,QAAO;AAGT,UAAO,cAAc,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC;KAEjD;EACF,CAAC;;AAGJ,SAAS,gBAAgB,OAA6B;AACpD,QAAO,CAAC,cAAc,MAAM,UAAU,IAAI,CAAC,UAAU,MAAM,UAAU,MAAM;;AAG7E,SAAS,YAAY,OAA6B;AAChD,QAAO,WAAW,MAAM,IAAI,IAAI,gBAAgB,MAAM;;AAGxD,SAAS,WAAW,KAAsB;AACxC,QAAO,IAAI,cAAc,KAAK,CAAC,IAAI,YAAY,QAAQ;;AAGzD,SAAS,4BACP,OACA,iBACmB;AACnB,KAAI,CAAC,gBAAiB,QAAO;CAE7B,MAAM,EAAE,cAAc;AACtB,KAAI,CAAC,UAAU,SAAS,CAAC,gBAAgB,UAAU,CAAE,QAAO;CAE5D,MAAM,OAAO,UAAU;CACvB,MAAM,OAAO,KAAK;AAClB,KAAI,KAAK,QAAQ,OAAO,EAAG,QAAO;CAElC,MAAM,SAAS,KAAK,QAAQ;AAE5B,QAAO,WAAW,KAAK,QAAQ,SAAS,KAAK,UAAU;EACrD,SAAS;EACT,oBAAoB;EACrB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { PlainExtension } from "@prosekit/core";
2
2
 
3
3
  //#region src/readonly/index.d.ts
4
-
5
4
  /**
6
5
  * Make the editor read-only.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-readonly.d.ts","names":[],"sources":["../src/readonly/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;iBAAgB,cAAA,CAAA,GAAkB"}
1
+ {"version":3,"file":"prosekit-extensions-readonly.d.ts","names":[],"sources":["../src/readonly/index.ts"],"mappings":";;;;;AAMA;iBAAgB,cAAA,CAAA,GAAkB,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-readonly.js","names":[],"sources":["../src/readonly/index.ts"],"sourcesContent":["import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n PluginKey,\n ProseMirrorPlugin,\n} from '@prosekit/pm/state'\n\n/**\n * Make the editor read-only.\n */\nexport function defineReadonly(): PlainExtension {\n return definePlugin(plugin)\n}\n\nconst plugin = new ProseMirrorPlugin({\n key: new PluginKey('prosekey-readonly'),\n props: {\n editable: () => false,\n },\n})\n"],"mappings":";;;;;;;AAYA,SAAgB,iBAAiC;AAC/C,QAAO,aAAa,OAAO;;AAG7B,MAAM,SAAS,IAAI,kBAAkB;CACnC,KAAK,IAAI,UAAU,oBAAoB;CACvC,OAAO,EACL,gBAAgB,OACjB;CACF,CAAC"}
1
+ {"version":3,"file":"prosekit-extensions-readonly.js","names":[],"sources":["../src/readonly/index.ts"],"sourcesContent":["import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { PluginKey, ProseMirrorPlugin } from '@prosekit/pm/state'\n\n/**\n * Make the editor read-only.\n */\nexport function defineReadonly(): PlainExtension {\n return definePlugin(plugin)\n}\n\nconst plugin = new ProseMirrorPlugin({\n key: new PluginKey('prosekey-readonly'),\n props: {\n editable: () => false,\n },\n})\n"],"mappings":";;;;;;;AAMA,SAAgB,iBAAiC;AAC/C,QAAO,aAAa,OAAO;;AAG7B,MAAM,SAAS,IAAI,kBAAkB;CACnC,KAAK,IAAI,UAAU,oBAAoB;CACvC,OAAO,EACL,gBAAgB,OACjB;CACF,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { Extension, PlainExtension } from "@prosekit/core";
2
2
 
3
3
  //#region src/search/index.d.ts
4
-
5
4
  /**
6
5
  * Options for {@link defineSearchQuery}
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"sourcesContent":[],"mappings":";;;;;;AA0BA;AA+CA;AAqCA;AAkBgB,UAtGC,kBAAA,CAsGmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAvDpB,iBAAA,UAA2B,qBAAqB;;;;KAqCpD,uBAAA,GAA0B;;;;;;;;;;;;;;;;;iBAkBtB,oBAAA,CAAA,GAAwB"}
1
+ {"version":3,"file":"prosekit-extensions-search.d.ts","names":[],"sources":["../src/search/index.ts"],"mappings":";;;;;AAqBA;;;UAAiB,kBAAA;EAIf;;;EAAA,MAAA;EA4BA;;;EAvBA,OAAA;EAsCc;;;;;EA/Bd,aAAA;EA+B8D;;;AAqChE;;;;EA3DE,OAAA;EA4DA;;;;;EArDA,MAAA;EA2DE;;;;;EApDF,SAAA;AAAA;;;;;;iBAQc,iBAAA,CAAkB,OAAA,EAAS,kBAAA,GAAqB,cAAA;;;;KAqCpD,uBAAA,GAA0B,SAAA;EACpC,QAAA;IACE,QAAA;IACA,QAAA;IACA,cAAA;IACA,cAAA;IACA,WAAA;IACA,iBAAA;IACA,cAAA;IACA,UAAA;EAAA;AAAA;;;;;;iBASY,oBAAA,CAAA,GAAwB,uBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-search.js","names":[],"sources":["../src/search/index.ts"],"sourcesContent":["import {\n defineCommands,\n definePlugin,\n type Extension,\n type PlainExtension,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\nimport type { EditorView } from '@prosekit/pm/view'\nimport {\n findNext,\n findNextNoWrap,\n findPrev,\n findPrevNoWrap,\n replaceAll,\n replaceCurrent,\n replaceNext,\n replaceNextNoWrap,\n search,\n SearchQuery,\n} from 'prosemirror-search'\n\n/**\n * Options for {@link defineSearchQuery}\n *\n * @public\n */\nexport interface SearchQueryOptions {\n /**\n * The search string (or regular expression).\n */\n search: string\n\n /**\n * The replace text.\n */\n replace?: string\n\n /**\n * Indicates whether the search is case-sensitive\n *\n * @default false\n */\n caseSensitive?: boolean\n\n /**\n * By default, string search will replace `\\n`, `\\r`, and `\\t` in the query\n * with newline, return, and tab characters. When this is set to true, that\n * behavior is disabled.\n *\n * @default false\n */\n literal?: boolean\n\n /**\n * When true, the search string is interpreted as a regular expression.\n *\n * @default false\n */\n regexp?: boolean\n\n /**\n * Enable whole-word matching.\n *\n * @default false\n */\n wholeWord?: boolean\n}\n\n/**\n * Defines an extension that stores a current search query and replace string.\n *\n * @public\n */\nexport function defineSearchQuery(options: SearchQueryOptions): PlainExtension {\n const query = new SearchQuery(options)\n return definePlugin(search({ initialQuery: query }))\n}\n\n/**\n * Scrolls the active search match into view.\n */\nfunction scrollActiveIntoView(view: EditorView) {\n if (view.isDestroyed) return\n const active = view.dom.querySelector('.ProseMirror-active-search-match')\n active?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n })\n}\n\n/**\n * Wraps a command and scrolls the active search match into view when the command\n * is applied.\n */\nfunction withScrollActiveIntoView(command: Command): Command {\n return (state, dispatch, view) => {\n const result = command(state, dispatch, view)\n if (result && dispatch && view) {\n // Add a small delay because the command itself will handle scrolling if\n // the view is focused.\n setTimeout(() => scrollActiveIntoView(view), 50)\n }\n return result\n }\n}\n\n/**\n * @internal\n */\nexport type SearchCommandsExtension = Extension<{\n Commands: {\n findNext: []\n findPrev: []\n findNextNoWrap: []\n findPrevNoWrap: []\n replaceNext: []\n replaceNextNoWrap: []\n replaceCurrent: []\n replaceAll: []\n }\n}>\n\n/**\n * Defines commands for search and replace.\n *\n * @public\n */\nexport function defineSearchCommands(): SearchCommandsExtension {\n return defineCommands({\n findNext: () => withScrollActiveIntoView(findNext),\n findPrev: () => withScrollActiveIntoView(findPrev),\n findNextNoWrap: () => withScrollActiveIntoView(findNextNoWrap),\n findPrevNoWrap: () => withScrollActiveIntoView(findPrevNoWrap),\n replaceNext: () => withScrollActiveIntoView(replaceNext),\n replaceNextNoWrap: () => withScrollActiveIntoView(replaceNextNoWrap),\n replaceCurrent: () => withScrollActiveIntoView(replaceCurrent),\n replaceAll: () => withScrollActiveIntoView(replaceAll),\n })\n}\n"],"mappings":";;;;;;;;;AAyEA,SAAgB,kBAAkB,SAA6C;AAE7E,QAAO,aAAa,OAAO,EAAE,cADf,IAAI,YAAY,QAAQ,EACY,CAAC,CAAC;;;;;AAMtD,SAAS,qBAAqB,MAAkB;AAC9C,KAAI,KAAK,YAAa;AAEtB,CADe,KAAK,IAAI,cAAc,mCAAmC,EACjE,eAAe;EACrB,OAAO;EACP,QAAQ;EACR,UAAU;EACX,CAAC;;;;;;AAOJ,SAAS,yBAAyB,SAA2B;AAC3D,SAAQ,OAAO,UAAU,SAAS;EAChC,MAAM,SAAS,QAAQ,OAAO,UAAU,KAAK;AAC7C,MAAI,UAAU,YAAY,KAGxB,kBAAiB,qBAAqB,KAAK,EAAE,GAAG;AAElD,SAAO;;;;;;;;AAyBX,SAAgB,uBAAgD;AAC9D,QAAO,eAAe;EACpB,gBAAgB,yBAAyB,SAAS;EAClD,gBAAgB,yBAAyB,SAAS;EAClD,sBAAsB,yBAAyB,eAAe;EAC9D,sBAAsB,yBAAyB,eAAe;EAC9D,mBAAmB,yBAAyB,YAAY;EACxD,yBAAyB,yBAAyB,kBAAkB;EACpE,sBAAsB,yBAAyB,eAAe;EAC9D,kBAAkB,yBAAyB,WAAW;EACvD,CAAC"}
1
+ {"version":3,"file":"prosekit-extensions-search.js","names":[],"sources":["../src/search/index.ts"],"sourcesContent":["import { defineCommands, definePlugin, type Extension, type PlainExtension } from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\nimport type { EditorView } from '@prosekit/pm/view'\nimport {\n findNext,\n findNextNoWrap,\n findPrev,\n findPrevNoWrap,\n replaceAll,\n replaceCurrent,\n replaceNext,\n replaceNextNoWrap,\n search,\n SearchQuery,\n} from 'prosemirror-search'\n\n/**\n * Options for {@link defineSearchQuery}\n *\n * @public\n */\nexport interface SearchQueryOptions {\n /**\n * The search string (or regular expression).\n */\n search: string\n\n /**\n * The replace text.\n */\n replace?: string\n\n /**\n * Indicates whether the search is case-sensitive\n *\n * @default false\n */\n caseSensitive?: boolean\n\n /**\n * By default, string search will replace `\\n`, `\\r`, and `\\t` in the query\n * with newline, return, and tab characters. When this is set to true, that\n * behavior is disabled.\n *\n * @default false\n */\n literal?: boolean\n\n /**\n * When true, the search string is interpreted as a regular expression.\n *\n * @default false\n */\n regexp?: boolean\n\n /**\n * Enable whole-word matching.\n *\n * @default false\n */\n wholeWord?: boolean\n}\n\n/**\n * Defines an extension that stores a current search query and replace string.\n *\n * @public\n */\nexport function defineSearchQuery(options: SearchQueryOptions): PlainExtension {\n const query = new SearchQuery(options)\n return definePlugin(search({ initialQuery: query }))\n}\n\n/**\n * Scrolls the active search match into view.\n */\nfunction scrollActiveIntoView(view: EditorView) {\n if (view.isDestroyed) return\n const active = view.dom.querySelector('.ProseMirror-active-search-match')\n active?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n behavior: 'smooth',\n })\n}\n\n/**\n * Wraps a command and scrolls the active search match into view when the command\n * is applied.\n */\nfunction withScrollActiveIntoView(command: Command): Command {\n return (state, dispatch, view) => {\n const result = command(state, dispatch, view)\n if (result && dispatch && view) {\n // Add a small delay because the command itself will handle scrolling if\n // the view is focused.\n setTimeout(() => scrollActiveIntoView(view), 50)\n }\n return result\n }\n}\n\n/**\n * @internal\n */\nexport type SearchCommandsExtension = Extension<{\n Commands: {\n findNext: []\n findPrev: []\n findNextNoWrap: []\n findPrevNoWrap: []\n replaceNext: []\n replaceNextNoWrap: []\n replaceCurrent: []\n replaceAll: []\n }\n}>\n\n/**\n * Defines commands for search and replace.\n *\n * @public\n */\nexport function defineSearchCommands(): SearchCommandsExtension {\n return defineCommands({\n findNext: () => withScrollActiveIntoView(findNext),\n findPrev: () => withScrollActiveIntoView(findPrev),\n findNextNoWrap: () => withScrollActiveIntoView(findNextNoWrap),\n findPrevNoWrap: () => withScrollActiveIntoView(findPrevNoWrap),\n replaceNext: () => withScrollActiveIntoView(replaceNext),\n replaceNextNoWrap: () => withScrollActiveIntoView(replaceNextNoWrap),\n replaceCurrent: () => withScrollActiveIntoView(replaceCurrent),\n replaceAll: () => withScrollActiveIntoView(replaceAll),\n })\n}\n"],"mappings":";;;;;;;;;AAoEA,SAAgB,kBAAkB,SAA6C;AAE7E,QAAO,aAAa,OAAO,EAAE,cADf,IAAI,YAAY,QAAQ,EACY,CAAC,CAAC;;;;;AAMtD,SAAS,qBAAqB,MAAkB;AAC9C,KAAI,KAAK,YAAa;AAEtB,CADe,KAAK,IAAI,cAAc,mCAAmC,EACjE,eAAe;EACrB,OAAO;EACP,QAAQ;EACR,UAAU;EACX,CAAC;;;;;;AAOJ,SAAS,yBAAyB,SAA2B;AAC3D,SAAQ,OAAO,UAAU,SAAS;EAChC,MAAM,SAAS,QAAQ,OAAO,UAAU,KAAK;AAC7C,MAAI,UAAU,YAAY,KAGxB,kBAAiB,qBAAqB,KAAK,EAAE,GAAG;AAElD,SAAO;;;;;;;;AAyBX,SAAgB,uBAAgD;AAC9D,QAAO,eAAe;EACpB,gBAAgB,yBAAyB,SAAS;EAClD,gBAAgB,yBAAyB,SAAS;EAClD,sBAAsB,yBAAyB,eAAe;EAC9D,sBAAsB,yBAAyB,eAAe;EAC9D,mBAAmB,yBAAyB,YAAY;EACxD,yBAAyB,yBAAyB,kBAAkB;EACpE,sBAAsB,yBAAyB,eAAe;EAC9D,kBAAkB,yBAAyB,WAAW;EACvD,CAAC"}
@@ -2,7 +2,6 @@ import { Extension, PlainExtension, Union } from "@prosekit/core";
2
2
  import { Attrs } from "@prosekit/pm/model";
3
3
 
4
4
  //#region src/strike/index.d.ts
5
-
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;AASgB,KATJ,mBAAA,GAAsB,SASE,CAAA;EAmBxB,KAAA,EAAA;IASI,MAAA,EAnCJ,KAmCI;EASA,CAAA;AAUhB,CAAA,CAAA;AAYA;;;AAA8B,iBA3Dd,gBAAA,CAAA,CA2Dc,EA3DM,mBA2DN;;AAO9B;;KA/CY,uBAAA,GAA0B;;;;;;;;iBAStB,oBAAA,CAAA,GAAwB;;;;iBASxB,kBAAA,CAAA,GAAsB;;;;iBAUtB,qBAAA,CAAA,GAAyB;;;;KAY7B,eAAA,GAAkB,OAC3B,qBAAqB;;;;iBAMR,YAAA,CAAA,GAAgB"}
1
+ {"version":3,"file":"prosekit-extensions-strike.d.ts","names":[],"sources":["../src/strike/index.ts"],"mappings":";;;;;;AAkBA;KAAY,mBAAA,GAAsB,SAAA;EAChC,KAAA;IACE,MAAA,EAAQ,KAAA;EAAA;AAAA;;;;iBAOI,gBAAA,CAAA,GAAoB,mBAAA;AAApC;;;AAAA,KAmBY,uBAAA,GAA0B,SAAA;EACpC,QAAA;IACE,YAAA;EAAA;AAAA;;;;iBAOY,oBAAA,CAAA,GAAwB,uBAAA;;;AAAxC;iBASgB,kBAAA,CAAA,GAAsB,cAAA;;;;iBAUtB,qBAAA,CAAA,GAAyB,cAAA;;;;KAY7B,eAAA,GAAkB,KAAA,EAC3B,mBAAA,EAAqB,uBAAA;;;AADxB;iBAOgB,YAAA,CAAA,GAAgB,eAAA"}
@@ -1,4 +1,4 @@
1
- import { r as defineMarkInputRule } from "./input-rule-dmsb3j6w.js";
1
+ import { r as defineMarkInputRule } from "./input-rule-COGr_GBb.js";
2
2
  import { canUseRegexLookbehind, defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
3
3
 
4
4
  //#region src/strike/index.ts
@@ -31,8 +31,8 @@ function defineStrikeCommands() {
31
31
  */
32
32
  function defineStrikeKeymap() {
33
33
  return defineKeymap({
34
- "Mod-shift-s": toggleMark({ type: "strike" }),
35
- "Mod-shift-x": toggleMark({ type: "strike" })
34
+ "Mod-S": toggleMark({ type: "strike" }),
35
+ "Mod-X": toggleMark({ type: "strike" })
36
36
  });
37
37
  }
38
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-strike.js","names":[],"sources":["../src/strike/index.ts"],"sourcesContent":["import {\n canUseRegexLookbehind,\n defineCommands,\n defineKeymap,\n defineMarkSpec,\n toggleMark,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\nimport { defineMarkInputRule } from '../input-rule'\n\n/**\n * @internal\n */\nexport type StrikeSpecExtension = Extension<{\n Marks: {\n strike: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineStrikeSpec(): StrikeSpecExtension {\n return defineMarkSpec({\n name: 'strike',\n parseDOM: [\n { tag: 's' },\n { tag: 'strike' },\n { tag: 'del' },\n { style: 'text-decoration=line-through' },\n { style: 'text-decoration-line=line-through' },\n ],\n toDOM() {\n return ['s', 0]\n },\n })\n}\n\n/**\n * @internal\n */\nexport type StrikeCommandsExtension = Extension<{\n Commands: {\n toggleStrike: []\n }\n}>\n\n/**\n * @internal\n */\nexport function defineStrikeCommands(): StrikeCommandsExtension {\n return defineCommands({\n toggleStrike: () => toggleMark({ type: 'strike' }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineStrikeKeymap(): PlainExtension {\n return defineKeymap({\n 'Mod-shift-s': toggleMark({ type: 'strike' }),\n 'Mod-shift-x': toggleMark({ type: 'strike' }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineStrikeInputRule(): PlainExtension {\n return defineMarkInputRule({\n regex: canUseRegexLookbehind()\n ? /(?<=\\s|^)~~([^\\s~]|[^\\s~][^~]*[^\\s~])~~$/\n : /~~([^\\s~]|[^\\s~][^~]*[^\\s~])~~$/,\n type: 'strike',\n })\n}\n\n/**\n * @internal\n */\nexport type StrikeExtension = Union<\n [StrikeSpecExtension, StrikeCommandsExtension]\n>\n\n/**\n * @public\n */\nexport function defineStrike(): StrikeExtension {\n return union(\n defineStrikeSpec(),\n defineStrikeCommands(),\n defineStrikeKeymap(),\n defineStrikeInputRule(),\n )\n}\n"],"mappings":";;;;;;;AA2BA,SAAgB,mBAAwC;AACtD,QAAO,eAAe;EACpB,MAAM;EACN,UAAU;GACR,EAAE,KAAK,KAAK;GACZ,EAAE,KAAK,UAAU;GACjB,EAAE,KAAK,OAAO;GACd,EAAE,OAAO,gCAAgC;GACzC,EAAE,OAAO,qCAAqC;GAC/C;EACD,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;AAeJ,SAAgB,uBAAgD;AAC9D,QAAO,eAAe,EACpB,oBAAoB,WAAW,EAAE,MAAM,UAAU,CAAC,EACnD,CAAC;;;;;AAMJ,SAAgB,qBAAqC;AACnD,QAAO,aAAa;EAClB,eAAe,WAAW,EAAE,MAAM,UAAU,CAAC;EAC7C,eAAe,WAAW,EAAE,MAAM,UAAU,CAAC;EAC9C,CAAC;;;;;AAMJ,SAAgB,wBAAwC;AACtD,QAAO,oBAAoB;EACzB,OAAO,uBAAuB,GAC1B,6CACA;EACJ,MAAM;EACP,CAAC;;;;;AAaJ,SAAgB,eAAgC;AAC9C,QAAO,MACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,CACxB"}
1
+ {"version":3,"file":"prosekit-extensions-strike.js","names":[],"sources":["../src/strike/index.ts"],"sourcesContent":["import {\n canUseRegexLookbehind,\n defineCommands,\n defineKeymap,\n defineMarkSpec,\n toggleMark,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\nimport { defineMarkInputRule } from '../input-rule'\n\n/**\n * @internal\n */\nexport type StrikeSpecExtension = Extension<{\n Marks: {\n strike: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineStrikeSpec(): StrikeSpecExtension {\n return defineMarkSpec({\n name: 'strike',\n parseDOM: [\n { tag: 's' },\n { tag: 'strike' },\n { tag: 'del' },\n { style: 'text-decoration=line-through' },\n { style: 'text-decoration-line=line-through' },\n ],\n toDOM() {\n return ['s', 0]\n },\n })\n}\n\n/**\n * @internal\n */\nexport type StrikeCommandsExtension = Extension<{\n Commands: {\n toggleStrike: []\n }\n}>\n\n/**\n * @internal\n */\nexport function defineStrikeCommands(): StrikeCommandsExtension {\n return defineCommands({\n toggleStrike: () => toggleMark({ type: 'strike' }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineStrikeKeymap(): PlainExtension {\n return defineKeymap({\n 'Mod-S': toggleMark({ type: 'strike' }),\n 'Mod-X': toggleMark({ type: 'strike' }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineStrikeInputRule(): PlainExtension {\n return defineMarkInputRule({\n regex: canUseRegexLookbehind()\n ? /(?<=\\s|^)~~([^\\s~]|[^\\s~][^~]*[^\\s~])~~$/\n : /~~([^\\s~]|[^\\s~][^~]*[^\\s~])~~$/,\n type: 'strike',\n })\n}\n\n/**\n * @internal\n */\nexport type StrikeExtension = Union<\n [StrikeSpecExtension, StrikeCommandsExtension]\n>\n\n/**\n * @public\n */\nexport function defineStrike(): StrikeExtension {\n return union(\n defineStrikeSpec(),\n defineStrikeCommands(),\n defineStrikeKeymap(),\n defineStrikeInputRule(),\n )\n}\n"],"mappings":";;;;;;;AA2BA,SAAgB,mBAAwC;AACtD,QAAO,eAAe;EACpB,MAAM;EACN,UAAU;GACR,EAAE,KAAK,KAAK;GACZ,EAAE,KAAK,UAAU;GACjB,EAAE,KAAK,OAAO;GACd,EAAE,OAAO,gCAAgC;GACzC,EAAE,OAAO,qCAAqC;GAC/C;EACD,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;AAeJ,SAAgB,uBAAgD;AAC9D,QAAO,eAAe,EACpB,oBAAoB,WAAW,EAAE,MAAM,UAAU,CAAC,EACnD,CAAC;;;;;AAMJ,SAAgB,qBAAqC;AACnD,QAAO,aAAa;EAClB,SAAS,WAAW,EAAE,MAAM,UAAU,CAAC;EACvC,SAAS,WAAW,EAAE,MAAM,UAAU,CAAC;EACxC,CAAC;;;;;AAMJ,SAAgB,wBAAwC;AACtD,QAAO,oBAAoB;EACzB,OAAO,uBAAuB,GAC1B,6CACA;EACJ,MAAM;EACP,CAAC;;;;;AAaJ,SAAgB,eAAgC;AAC9C,QAAO,MACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UA8CiB,kBAAA;;AAAjB;AA2BA;;;;AC9DA;EAWgB,GAAA,EAAA,MAAA;;;;ACdhB;AAWA;;;;ACXA;AAiBA;;;;ACjBA;AAiBA;iBJgDgB,WAAA,UAAqB,qBAAqB;;;;;;UC9DzC,kBAAA;;ADmCjB;AA2BA;;;;AC9DA;AAWA;;iBAAgB,WAAA,WAAsB,qBAAqB;;;;;;UCd1C,sBAAA;;AFsCjB;AA2BA;;;;AC9DA;AAWA;;iBCHgB,eAAA,WAA0B,yBAAyB;;;;;;UCXlD,wBAAA;;AHsCjB;AA2BA;;;;AC9DA;AAWA;;;;ACdA;AAWA;;iBCMgB,iBAAA,WAA4B,2BAA2B;;;;;;UCjBtD,qBAAA;;AJsCjB;AA2BA;;;;AC9DA;AAWA;;;;ACdA;AAWA;;iBEMgB,cAAA,WAAyB,wBAAwB;;;;;;AHdhD,KIuCL,sBAAA,GAAyB,SJvCF,CAAA;EAWnB,QAAA,EAAA;2BI8BW;;4BAGC;IH/CX,eAAA,EAAA,CAAA,OAAsB,GGgDP,sBHhDO,CAAA;IAWvB,iBAAe,EAAA,CAAA,OAAW,GGsCR,wBHtCiC,CAAA;+BGuCpC;;;IFlDd,gBAAA,EAAA,EAAA;IAiBD,gBAAiB,EAAA,EAAA;;;;ICjBhB,mBAAA,EAAqB,EAAA;IAiBtB,eAAc,EAAA,EAAA;;4BCgDF;+BACG;EAxBnB,CAAA;CAEe,CAAA;;;;;;AAsBI,iBASf,mBAAA,CAAA,CATe,EASQ,sBATR;;;;;;UC3Dd,SAAA;EN+BA,OAAA,CAAA,EAAA,MAAA;EA2BD,OAAA,CAAA,EAAA,MAAW;;;;AC9D3B;AAWA;KKQY,kBAAA,GAAqB;;WAEtB;EJxBM,CAAA;AAWjB,CAAA,CAAA;;;;ACXiB,iBGqCD,eAAA,CAAA,CHrCyB,EGqCN,kBHrCM;AAiBzC;;;KG+BY,qBAAA,GAAwB;EFhDnB,KAAA,EAAA;IAiBD,QAAA,EEiCF,KFjCgB;;;;ACyB9B;;AAK4B,iBCUZ,kBAAA,CAAA,CDVY,ECUU,qBDVV;;;;AAkBA,KCGhB,sBAAA,GAAyB,SDHT,CAAA;EACG,KAAA,EAAA;IAxBM,SAAA,EC4BtB,SD5BsB;EAAS,CAAA;AAiC9C,CAAA,CAAA;;;;ACpEiB,iBAsED,mBAAA,CAAA,CAtEU,EAsEa,sBAtEb;AAe1B;AAeA;AAWA;AASgB,KA+BJ,4BAAA,GAA+B,SA/BL,CAAA;EAW1B,KAAA,EAAA;IASI,eAAA,EAaK,SAbc;EAWvB,CAAA;AAMZ,CAAA,CAAA;iBAAgB,yBAAA,CAAA,GAA6B;;;;;;ANxD5B,KOrBL,cAAA,GAAiB,KPqBM,CAAA,COnB/B,kBP8CuB,EO7CvB,uBACA,wBACA,8BACA,sBNpB+B,CAWnC,CAAA;;;;ACdiB,iBK8BD,WAAA,CAAA,CL9BuB,EK8BR,cL9BQ;;;;;;;;AFsCvC;AA2BgB,cQ9DH,SR8Dc,EQ9DH,OR8Da;;;;;;;;AA3BrC;AA2BgB,iBS9DA,wBAAA,CAAA,CT8DqB,ES9DO,cT8DqB;;;;;;iBU7DjD,kBAAA,CAAA,GAAsB;;;;;;;AVkCtC;AA2BgB,iBW5DA,eAAA,CX4DqB,KAAA,EAAA,OAAqB,CAAA,EAAA,KAAO,IW5DP,aX4DO"}
1
+ {"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"mappings":";;;;;;;;;UA2CiB,kBAAA;;AAAjB;;EAIE,GAAA;EAJiC;;;EASjC,GAAA;EAOM;;AAWR;;;EAXE,MAAA;AAAA;;;;;;;;ACnDF;iBD8DgB,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,OAAA;;;;;;UC9DzC,kBAAA;;ADmCjB;;;EC9BE,GAAA;AAAA;;;;iBAMc,WAAA,CAAY,OAAA,GAAU,kBAAA,GAAqB,OAAA;;;;;;UCX1C,sBAAA;;AFmCjB;;;EE9BE,GAAA;AAAA;;;;iBAMc,eAAA,CAAgB,OAAA,GAAU,sBAAA,GAAyB,OAAA;;;;;;UCXlD,wBAAA;;AHmCjB;;;EG9BE,MAAA;EHkCA;;;;EG5BA,IAAA;AAAA;;;;iBAMc,iBAAA,CAAkB,OAAA,GAAU,wBAAA,GAA2B,OAAA;;;;;;UCjBtD,qBAAA;;AJmCjB;;;EI9BE,MAAA;EJkCA;;;;EI5BA,IAAA;AAAA;;;;iBAMc,cAAA,CAAe,OAAA,GAAU,qBAAA,GAAwB,OAAA;;;;;;KCCrD,sBAAA,GAAyB,SAAA;EACnC,QAAA;IACE,WAAA,GAAc,OAAA,EAAS,kBAAA;IACvB,SAAA;IAEA,WAAA,GAAc,OAAA,GAAU,kBAAA;IACxB,eAAA,GAAkB,OAAA,GAAU,sBAAA;IAC5B,iBAAA,GAAoB,OAAA,GAAU,wBAAA;IAC9B,cAAA,GAAiB,OAAA,GAAU,qBAAA;IAE3B,oBAAA;IACA,mBAAA;IACA,gBAAA;IACA,gBAAA;IAEA,WAAA;IACA,iBAAA;IACA,cAAA;IACA,mBAAA;IAEA,eAAA;IACA,cAAA;IAEA,YAAA,GAAe,OAAA,EAAS,mBAAA;IACxB,eAAA,GAAkB,OAAA,EAAS,sBAAA;EAAA;AAAA;;;;;;iBASf,mBAAA,CAAA,GAAuB,sBAAA;;;;;;UClDtB,SAAA;EACf,OAAA;EACA,OAAA;EACA,QAAA;AAAA;;;;KAYU,kBAAA,GAAqB,SAAA;EAC/B,KAAA;IACE,KAAA,EAAO,KAAA;EAAA;AAAA;;;;iBAaK,eAAA,CAAA,GAAmB,kBAAA;;;;KAWvB,qBAAA,GAAwB,SAAA;EAClC,KAAA;IACE,QAAA,EAAU,KAAA;EAAA;AAAA;;;ALjCd;iBKwCgB,kBAAA,CAAA,GAAsB,qBAAA;;;;KAW1B,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,SAAA;EAAA;AAAA;;;AJhEf;iBIuEgB,mBAAA,CAAA,GAAuB,sBAAA;;;;KAW3B,4BAAA,GAA+B,SAAA;EACzC,KAAA;IACE,eAAA,EAAiB,SAAA;EAAA;AAAA;AAAA,iBAIL,yBAAA,CAAA,GAA6B,4BAAA;;;;;;KC7EjC,cAAA,GAAiB,KAAA,EAEzB,kBAAA,EACA,qBAAA,EACA,sBAAA,EACA,4BAAA,EACA,sBAAA;;;AP6CJ;iBOtCgB,WAAA,CAAA,GAAe,cAAA;;;;;;;;APW/B;cQhCa,SAAA,EAAW,OAAA;;;;;;;;ARgCxB;iBShCgB,wBAAA,CAAA,GAA4B,cAAA;;;;;;iBCL5B,kBAAA,CAAA,GAAsB,cAAA;;;;;;;AVqCtC;iBWlCgB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAA"}
@@ -1,4 +1,3 @@
1
- import "./drop-indicator-B1QHFb5m.js";
2
- import { _ as insertTable, a as defineTableSpec, c as defineTableCommands, d as selectTableCell, f as selectTable, g as moveTableColumn, h as moveTableRow, i as defineTableRowSpec, l as selectTableRow, m as isCellSelection, n as defineTableCellSpec, o as defineTablePlugins, p as findTable, r as defineTableHeaderCellSpec, s as defineTableDropIndicator, t as defineTable, u as selectTableColumn, v as exitTable } from "./table-BRDh_9mG.js";
1
+ import { _ as insertTable, a as defineTableSpec, c as defineTableCommands, d as selectTableCell, f as selectTable, g as moveTableColumn, h as moveTableRow, i as defineTableRowSpec, l as selectTableRow, m as isCellSelection, n as defineTableCellSpec, o as defineTablePlugins, p as findTable, r as defineTableHeaderCellSpec, s as defineTableDropIndicator, t as defineTable, u as selectTableColumn, v as exitTable } from "./table-4oHfV-Ql.js";
3
2
 
4
3
  export { defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
@@ -2,7 +2,6 @@ import { Extension, PlainExtension, Union } from "@prosekit/core";
2
2
  import { Command } from "@prosekit/pm/state";
3
3
 
4
4
  //#region src/text-align/index.d.ts
5
-
6
5
  /**
7
6
  * @public
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-text-align.d.ts","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AAqCY,UArCK,gBAqCkB,CAAA,iBAClB,MAAA,GAD8C,MAAA,CAAA,CAAA;EAiB/C;;;;;AAahB;AASA;EAWgB,KAAA,EA/EP,QA+EO,EAAA;EAYJ;;;;;EAAmD,OAAA,CAAA,EAAA,MAAA;AAU/D;;;;AAEG,KA1ES,uBA0ET,CAAA,iBAAA,MAAA,CAAA,GA1E4D,SA0E5D,CAAA;EAAkB,KAAA,EAAA,QAzEJ;;;;;;;iBAgBD,YAAA;;;;;;IAMZ;;;;KAOQ,0BAAA,GAA6B;;;;;;;;iBASzB,uBAAA,mBAEb;;;;iBASa,qBAAA,mBAAwC;;;;KAY5C,8CAA8C,OACvD,wBAAwB,WAAW;;;;;;;iBAStB,2DACL,iBAAiB,YACzB,mBAAmB"}
1
+ {"version":3,"file":"prosekit-extensions-text-align.d.ts","names":[],"sources":["../src/text-align/index.ts"],"mappings":";;;;;;AAeA;UAAiB,gBAAA;EAAgB;;;;;;;EAQ/B,KAAA,EAAO,QAAA;EA6BG;;;;;EAtBV,OAAA;AAAA;;;;KAsBU,uBAAA,4BAAmD,SAAA;EAC7D,KAAA,UAAe,QAAA;IAAa,SAAA;EAAA;AAAA;;;;iBAgBd,YAAA,CAAA;EACd,KAAA;EACA;AAAA;EAEA,KAAA;EACA,KAAA;AAAA,IACE,OAAA;;;;KAOQ,0BAAA,GAA6B,SAAA;EACvC,QAAA;IACE,YAAA,GAAe,KAAA;EAAA;AAAA;;;;iBAOH,uBAAA,CACd,KAAA,aACC,0BAAA;;;;iBASa,qBAAA,CAAsB,KAAA,aAAkB,cAAA;;;;KAY5C,kBAAA,4BAA8C,KAAA,EACvD,uBAAA,CAAwB,QAAA,GAAW,0BAAA;;;AADtC;;;;iBAUgB,eAAA,kCAAA,CACd,OAAA,EAAS,gBAAA,CAAiB,QAAA,IACzB,kBAAA,CAAmB,QAAA"}
@@ -1,4 +1,4 @@
1
- import { defineCommands, defineKeymap, defineNodeAttr, setNodeAttrs, union } from "@prosekit/core";
1
+ import { defineCommands, defineKeymap, defineNodeAttr, setNodeAttrsBetween, union } from "@prosekit/core";
2
2
 
3
3
  //#region src/text-align/index.ts
4
4
  function defineTextAlignAttr(type, defaultValue) {
@@ -23,7 +23,7 @@ function defineTextAlignAttrs(types, defaultValue) {
23
23
  * @internal
24
24
  */
25
25
  function setTextAlign({ types, value }) {
26
- return setNodeAttrs({
26
+ return setNodeAttrsBetween({
27
27
  type: types,
28
28
  attrs: { textAlign: value }
29
29
  });
@@ -42,19 +42,19 @@ function defineTextAlignCommands(types) {
42
42
  */
43
43
  function defineTextAlignKeymap(types) {
44
44
  return defineKeymap({
45
- "mod-shift-l": setTextAlign({
45
+ "Mod-L": setTextAlign({
46
46
  types,
47
47
  value: "left"
48
48
  }),
49
- "mod-shift-e": setTextAlign({
49
+ "Mod-E": setTextAlign({
50
50
  types,
51
51
  value: "center"
52
52
  }),
53
- "mod-shift-r": setTextAlign({
53
+ "Mod-R": setTextAlign({
54
54
  types,
55
55
  value: "right"
56
56
  }),
57
- "mod-shift-j": setTextAlign({
57
+ "Mod-J": setTextAlign({
58
58
  types,
59
59
  value: "justify"
60
60
  })
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-text-align.js","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":["import {\n defineCommands,\n defineKeymap,\n defineNodeAttr,\n setNodeAttrs,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @public\n */\nexport interface TextAlignOptions<NodeName extends string = string> {\n /**\n * The names of node to add the attribute to.\n *\n * @example\n *\n * [\"paragraph\", \"heading\"]\n */\n types: NodeName[]\n\n /**\n * The default value for the attribute.\n *\n * @default \"left\"\n */\n default?: string\n}\n\nfunction defineTextAlignAttr<NodeName extends string>(\n type: NodeName,\n defaultValue: string | null,\n) {\n return defineNodeAttr<NodeName, 'textAlign', string | null>({\n type,\n attr: 'textAlign',\n default: defaultValue,\n splittable: true,\n toDOM: (value: any) => (value ? ['style', `text-align:${value};`] : null),\n parseDOM: (node: HTMLElement) => {\n return node.style.getPropertyValue('text-align') || null\n },\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignAttrsExtension<NodeName extends string> = Extension<{\n Nodes: { [K in NodeName]: { textAlign: string | null } }\n}>\n\n/**\n * @internal\n */\nfunction defineTextAlignAttrs<NodeName extends string>(\n types: NodeName[],\n defaultValue: string | null,\n): TextAlignAttrsExtension<NodeName> {\n return union(types.map((type) => defineTextAlignAttr(type, defaultValue)))\n}\n\n/**\n * @internal\n */\nexport function setTextAlign({\n types,\n value,\n}: {\n types: string[]\n value: string | null\n}): Command {\n return setNodeAttrs({ type: types, attrs: { textAlign: value } })\n}\n\n/**\n * @internal\n */\nexport type TextAlignCommandsExtension = Extension<{\n Commands: {\n setTextAlign: [value: string | null]\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTextAlignCommands(\n types: string[],\n): TextAlignCommandsExtension {\n return defineCommands({\n setTextAlign: (value: string | null) => setTextAlign({ types, value }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineTextAlignKeymap(types: string[]): PlainExtension {\n return defineKeymap({\n 'mod-shift-l': setTextAlign({ types, value: 'left' }),\n 'mod-shift-e': setTextAlign({ types, value: 'center' }),\n 'mod-shift-r': setTextAlign({ types, value: 'right' }),\n 'mod-shift-j': setTextAlign({ types, value: 'justify' }),\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignExtension<NodeName extends string> = Union<\n [TextAlignAttrsExtension<NodeName>, TextAlignCommandsExtension]\n>\n\n/**\n * Adds a `textAlign` attribute to the specified nodes. This will be rendered as\n * a CSS `text-align` style.\n *\n * @public\n */\nexport function defineTextAlign<NodeName extends string = string>(\n options: TextAlignOptions<NodeName>,\n): TextAlignExtension<NodeName> {\n return union(\n defineTextAlignAttrs<NodeName>(options.types, options.default || 'left'),\n defineTextAlignKeymap(options.types),\n defineTextAlignCommands(options.types),\n )\n}\n"],"mappings":";;;AAiCA,SAAS,oBACP,MACA,cACA;AACA,QAAO,eAAqD;EAC1D;EACA,MAAM;EACN,SAAS;EACT,YAAY;EACZ,QAAQ,UAAgB,QAAQ,CAAC,SAAS,cAAc,MAAM,GAAG,GAAG;EACpE,WAAW,SAAsB;AAC/B,UAAO,KAAK,MAAM,iBAAiB,aAAa,IAAI;;EAEvD,CAAC;;;;;AAaJ,SAAS,qBACP,OACA,cACmC;AACnC,QAAO,MAAM,MAAM,KAAK,SAAS,oBAAoB,MAAM,aAAa,CAAC,CAAC;;;;;AAM5E,SAAgB,aAAa,EAC3B,OACA,SAIU;AACV,QAAO,aAAa;EAAE,MAAM;EAAO,OAAO,EAAE,WAAW,OAAO;EAAE,CAAC;;;;;AAenE,SAAgB,wBACd,OAC4B;AAC5B,QAAO,eAAe,EACpB,eAAe,UAAyB,aAAa;EAAE;EAAO;EAAO,CAAC,EACvE,CAAC;;;;;AAMJ,SAAgB,sBAAsB,OAAiC;AACrE,QAAO,aAAa;EAClB,eAAe,aAAa;GAAE;GAAO,OAAO;GAAQ,CAAC;EACrD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAU,CAAC;EACvD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAS,CAAC;EACtD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAW,CAAC;EACzD,CAAC;;;;;;;;AAgBJ,SAAgB,gBACd,SAC8B;AAC9B,QAAO,MACL,qBAA+B,QAAQ,OAAO,QAAQ,WAAW,OAAO,EACxE,sBAAsB,QAAQ,MAAM,EACpC,wBAAwB,QAAQ,MAAM,CACvC"}
1
+ {"version":3,"file":"prosekit-extensions-text-align.js","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":["import {\n defineCommands,\n defineKeymap,\n defineNodeAttr,\n setNodeAttrsBetween,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @public\n */\nexport interface TextAlignOptions<NodeName extends string = string> {\n /**\n * The names of node to add the attribute to.\n *\n * @example\n *\n * [\"paragraph\", \"heading\"]\n */\n types: NodeName[]\n\n /**\n * The default value for the attribute.\n *\n * @default \"left\"\n */\n default?: string\n}\n\nfunction defineTextAlignAttr<NodeName extends string>(\n type: NodeName,\n defaultValue: string | null,\n) {\n return defineNodeAttr<NodeName, 'textAlign', string | null>({\n type,\n attr: 'textAlign',\n default: defaultValue,\n splittable: true,\n toDOM: (value: any) => (value ? ['style', `text-align:${value};`] : null),\n parseDOM: (node: HTMLElement) => {\n return node.style.getPropertyValue('text-align') || null\n },\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignAttrsExtension<NodeName extends string> = Extension<{\n Nodes: { [K in NodeName]: { textAlign: string | null } }\n}>\n\n/**\n * @internal\n */\nfunction defineTextAlignAttrs<NodeName extends string>(\n types: NodeName[],\n defaultValue: string | null,\n): TextAlignAttrsExtension<NodeName> {\n return union(types.map((type) => defineTextAlignAttr(type, defaultValue)))\n}\n\n/**\n * @internal\n */\nexport function setTextAlign({\n types,\n value,\n}: {\n types: string[]\n value: string | null\n}): Command {\n return setNodeAttrsBetween({ type: types, attrs: { textAlign: value } })\n}\n\n/**\n * @internal\n */\nexport type TextAlignCommandsExtension = Extension<{\n Commands: {\n setTextAlign: [value: string | null]\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTextAlignCommands(\n types: string[],\n): TextAlignCommandsExtension {\n return defineCommands({\n setTextAlign: (value: string | null) => setTextAlign({ types, value }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineTextAlignKeymap(types: string[]): PlainExtension {\n return defineKeymap({\n 'Mod-L': setTextAlign({ types, value: 'left' }),\n 'Mod-E': setTextAlign({ types, value: 'center' }),\n 'Mod-R': setTextAlign({ types, value: 'right' }),\n 'Mod-J': setTextAlign({ types, value: 'justify' }),\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignExtension<NodeName extends string> = Union<\n [TextAlignAttrsExtension<NodeName>, TextAlignCommandsExtension]\n>\n\n/**\n * Adds a `textAlign` attribute to the specified nodes. This will be rendered as\n * a CSS `text-align` style.\n *\n * @public\n */\nexport function defineTextAlign<NodeName extends string = string>(\n options: TextAlignOptions<NodeName>,\n): TextAlignExtension<NodeName> {\n return union(\n defineTextAlignAttrs<NodeName>(options.types, options.default || 'left'),\n defineTextAlignKeymap(options.types),\n defineTextAlignCommands(options.types),\n )\n}\n"],"mappings":";;;AAiCA,SAAS,oBACP,MACA,cACA;AACA,QAAO,eAAqD;EAC1D;EACA,MAAM;EACN,SAAS;EACT,YAAY;EACZ,QAAQ,UAAgB,QAAQ,CAAC,SAAS,cAAc,MAAM,GAAG,GAAG;EACpE,WAAW,SAAsB;AAC/B,UAAO,KAAK,MAAM,iBAAiB,aAAa,IAAI;;EAEvD,CAAC;;;;;AAaJ,SAAS,qBACP,OACA,cACmC;AACnC,QAAO,MAAM,MAAM,KAAK,SAAS,oBAAoB,MAAM,aAAa,CAAC,CAAC;;;;;AAM5E,SAAgB,aAAa,EAC3B,OACA,SAIU;AACV,QAAO,oBAAoB;EAAE,MAAM;EAAO,OAAO,EAAE,WAAW,OAAO;EAAE,CAAC;;;;;AAe1E,SAAgB,wBACd,OAC4B;AAC5B,QAAO,eAAe,EACpB,eAAe,UAAyB,aAAa;EAAE;EAAO;EAAO,CAAC,EACvE,CAAC;;;;;AAMJ,SAAgB,sBAAsB,OAAiC;AACrE,QAAO,aAAa;EAClB,SAAS,aAAa;GAAE;GAAO,OAAO;GAAQ,CAAC;EAC/C,SAAS,aAAa;GAAE;GAAO,OAAO;GAAU,CAAC;EACjD,SAAS,aAAa;GAAE;GAAO,OAAO;GAAS,CAAC;EAChD,SAAS,aAAa;GAAE;GAAO,OAAO;GAAW,CAAC;EACnD,CAAC;;;;;;;;AAgBJ,SAAgB,gBACd,SAC8B;AAC9B,QAAO,MACL,qBAA+B,QAAQ,OAAO,QAAQ,WAAW,OAAO,EACxE,sBAAsB,QAAQ,MAAM,EACpC,wBAAwB,QAAQ,MAAM,CACvC"}
@@ -0,0 +1,62 @@
1
+ import { Extension, Union } from "@prosekit/core";
2
+ import { Command } from "@prosekit/pm/state";
3
+
4
+ //#region src/text-color/text-color-spec.d.ts
5
+ /**
6
+ * Attributes for the `textColor` mark.
7
+ *
8
+ * @public
9
+ */
10
+ interface TextColorAttrs {
11
+ color: string;
12
+ }
13
+ /**
14
+ * @internal
15
+ */
16
+ type TextColorSpecExtension = Extension<{
17
+ Marks: {
18
+ textColor: TextColorAttrs;
19
+ };
20
+ }>;
21
+ /**
22
+ * @internal
23
+ */
24
+ declare function defineTextColorSpec(): TextColorSpecExtension;
25
+ //#endregion
26
+ //#region src/text-color/text-color-commands.d.ts
27
+ /**
28
+ * @internal
29
+ */
30
+ declare function addTextColor(attrs: TextColorAttrs): Command;
31
+ /**
32
+ * @internal
33
+ */
34
+ declare function removeTextColor(): Command;
35
+ /**
36
+ * @internal
37
+ */
38
+ type TextColorCommandsExtension = Extension<{
39
+ Commands: {
40
+ addTextColor: [attrs: TextColorAttrs];
41
+ removeTextColor: [];
42
+ };
43
+ }>;
44
+ /**
45
+ * @internal
46
+ */
47
+ declare function defineTextColorCommands(): TextColorCommandsExtension;
48
+ //#endregion
49
+ //#region src/text-color/text-color.d.ts
50
+ /**
51
+ * @internal
52
+ */
53
+ type TextColorExtension = Union<[TextColorSpecExtension, TextColorCommandsExtension]>;
54
+ /**
55
+ * Defines the `textColor` mark and some commands for it.
56
+ *
57
+ * @public
58
+ */
59
+ declare function defineTextColor(): TextColorExtension;
60
+ //#endregion
61
+ export { type TextColorAttrs, type TextColorCommandsExtension, type TextColorExtension, type TextColorSpecExtension, addTextColor, defineTextColor, defineTextColorCommands, defineTextColorSpec, removeTextColor };
62
+ //# sourceMappingURL=prosekit-extensions-text-color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosekit-extensions-text-color.d.ts","names":[],"sources":["../src/text-color/text-color-spec.ts","../src/text-color/text-color-commands.ts","../src/text-color/text-color.ts"],"mappings":";;;;;;;AAOA;;UAAiB,cAAA;EACf,KAAA;AAAA;AAMF;;;AAAA,KAAY,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,cAAA;EAAA;AAAA;;;AAOf;iBAAgB,mBAAA,CAAA,GAAuB,sBAAA;;;;AAhBvC;;iBCCgB,YAAA,CAAa,KAAA,EAAO,cAAA,GAAiB,OAAA;;;ADMrD;iBCCgB,eAAA,CAAA,GAAmB,OAAA;;;;KAOvB,0BAAA,GAA6B,SAAA;EACvC,QAAA;IACE,YAAA,GAAe,KAAA,EAAO,cAAA;IACtB,eAAA;EAAA;AAAA;;;;iBAOY,uBAAA,CAAA,GAA2B,0BAAA;;;;ADzB3C;;KECY,kBAAA,GAAqB,KAAA,EAAO,sBAAA,EAAwB,0BAAA;;;AFMhE;;;iBECgB,eAAA,CAAA,GAAmB,kBAAA"}
@@ -0,0 +1,76 @@
1
+ import { addMark, defineCommands, defineMarkSpec, removeMark, union } from "@prosekit/core";
2
+
3
+ //#region src/text-color/text-color-commands.ts
4
+ /**
5
+ * @internal
6
+ */
7
+ function addTextColor(attrs) {
8
+ return addMark({
9
+ type: "textColor",
10
+ attrs
11
+ });
12
+ }
13
+ /**
14
+ * @internal
15
+ */
16
+ function removeTextColor() {
17
+ return removeMark({ type: "textColor" });
18
+ }
19
+ /**
20
+ * @internal
21
+ */
22
+ function defineTextColorCommands() {
23
+ return defineCommands({
24
+ addTextColor,
25
+ removeTextColor
26
+ });
27
+ }
28
+
29
+ //#endregion
30
+ //#region src/text-color/text-color-spec.ts
31
+ /**
32
+ * @internal
33
+ */
34
+ function defineTextColorSpec() {
35
+ return defineMarkSpec({
36
+ name: "textColor",
37
+ attrs: { color: { validate: "string" } },
38
+ parseDOM: [{
39
+ tag: ":where([style*=\"color:\"], [data-text-color])",
40
+ getAttrs: (node) => {
41
+ const value = node.getAttribute("data-text-color");
42
+ if (value && value !== "inherit") return { color: value };
43
+ const color = node.style.color;
44
+ if (color && color !== "inherit") return { color };
45
+ return false;
46
+ },
47
+ consuming: false
48
+ }],
49
+ toDOM(mark) {
50
+ const color = mark.attrs.color;
51
+ return [
52
+ "span",
53
+ {
54
+ "style": `color: ${color};`,
55
+ "data-text-color": color
56
+ },
57
+ 0
58
+ ];
59
+ }
60
+ });
61
+ }
62
+
63
+ //#endregion
64
+ //#region src/text-color/text-color.ts
65
+ /**
66
+ * Defines the `textColor` mark and some commands for it.
67
+ *
68
+ * @public
69
+ */
70
+ function defineTextColor() {
71
+ return union(defineTextColorSpec(), defineTextColorCommands());
72
+ }
73
+
74
+ //#endregion
75
+ export { addTextColor, defineTextColor, defineTextColorCommands, defineTextColorSpec, removeTextColor };
76
+ //# sourceMappingURL=prosekit-extensions-text-color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prosekit-extensions-text-color.js","names":[],"sources":["../src/text-color/text-color-commands.ts","../src/text-color/text-color-spec.ts","../src/text-color/text-color.ts"],"sourcesContent":["import { addMark, defineCommands, removeMark, type Extension } from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\nimport type { TextColorAttrs } from './text-color-spec'\n\n/**\n * @internal\n */\nexport function addTextColor(attrs: TextColorAttrs): Command {\n return addMark({ type: 'textColor', attrs })\n}\n\n/**\n * @internal\n */\nexport function removeTextColor(): Command {\n return removeMark({ type: 'textColor' })\n}\n\n/**\n * @internal\n */\nexport type TextColorCommandsExtension = Extension<{\n Commands: {\n addTextColor: [attrs: TextColorAttrs]\n removeTextColor: []\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTextColorCommands(): TextColorCommandsExtension {\n return defineCommands({ addTextColor, removeTextColor })\n}\n","import { defineMarkSpec, type Extension } from '@prosekit/core'\n\n/**\n * Attributes for the `textColor` mark.\n *\n * @public\n */\nexport interface TextColorAttrs {\n color: string\n}\n\n/**\n * @internal\n */\nexport type TextColorSpecExtension = Extension<{\n Marks: {\n textColor: TextColorAttrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTextColorSpec(): TextColorSpecExtension {\n return defineMarkSpec<'textColor', TextColorAttrs>({\n name: 'textColor',\n attrs: {\n color: {\n validate: 'string',\n },\n },\n parseDOM: [\n {\n tag: ':where([style*=\"color:\"], [data-text-color])',\n getAttrs: (node): TextColorAttrs | false => {\n // When both `data-text-color` and `style=\"color\"` are present, we\n // prioritize the `data-text-color` attribute. This avoids the\n // browser's default behavior of changing hex colors to rgba in style\n // attribute.\n const value = node.getAttribute('data-text-color')\n if (value && value !== 'inherit') {\n return { color: value }\n }\n const color = node.style.color\n if (color && color !== 'inherit') {\n return { color }\n }\n return false\n },\n consuming: false,\n },\n ],\n toDOM(mark) {\n const color = (mark.attrs as TextColorAttrs).color\n return ['span', { 'style': `color: ${color};`, 'data-text-color': color }, 0]\n },\n })\n}\n","import { union, type Union } from '@prosekit/core'\n\nimport { defineTextColorCommands, type TextColorCommandsExtension } from './text-color-commands'\nimport { defineTextColorSpec, type TextColorSpecExtension } from './text-color-spec'\n\n/**\n * @internal\n */\nexport type TextColorExtension = Union<[TextColorSpecExtension, TextColorCommandsExtension]>\n\n/**\n * Defines the `textColor` mark and some commands for it.\n *\n * @public\n */\nexport function defineTextColor(): TextColorExtension {\n return union(\n defineTextColorSpec(),\n defineTextColorCommands(),\n )\n}\n"],"mappings":";;;;;;AAQA,SAAgB,aAAa,OAAgC;AAC3D,QAAO,QAAQ;EAAE,MAAM;EAAa;EAAO,CAAC;;;;;AAM9C,SAAgB,kBAA2B;AACzC,QAAO,WAAW,EAAE,MAAM,aAAa,CAAC;;;;;AAgB1C,SAAgB,0BAAsD;AACpE,QAAO,eAAe;EAAE;EAAc;EAAiB,CAAC;;;;;;;;ACV1D,SAAgB,sBAA8C;AAC5D,QAAO,eAA4C;EACjD,MAAM;EACN,OAAO,EACL,OAAO,EACL,UAAU,UACX,EACF;EACD,UAAU,CACR;GACE,KAAK;GACL,WAAW,SAAiC;IAK1C,MAAM,QAAQ,KAAK,aAAa,kBAAkB;AAClD,QAAI,SAAS,UAAU,UACrB,QAAO,EAAE,OAAO,OAAO;IAEzB,MAAM,QAAQ,KAAK,MAAM;AACzB,QAAI,SAAS,UAAU,UACrB,QAAO,EAAE,OAAO;AAElB,WAAO;;GAET,WAAW;GACZ,CACF;EACD,MAAM,MAAM;GACV,MAAM,QAAS,KAAK,MAAyB;AAC7C,UAAO;IAAC;IAAQ;KAAE,SAAS,UAAU,MAAM;KAAI,mBAAmB;KAAO;IAAE;IAAE;;EAEhF,CAAC;;;;;;;;;;ACzCJ,SAAgB,kBAAsC;AACpD,QAAO,MACL,qBAAqB,EACrB,yBAAyB,CAC1B"}
@@ -2,7 +2,6 @@ import { Extension } from "@prosekit/core";
2
2
  import { Attrs } from "@prosekit/pm/model";
3
3
 
4
4
  //#region src/text/index.d.ts
5
-
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-text.d.ts","names":[],"sources":["../src/text/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;AASgB,KATJ,aAAA,GAAgB,SASE,CAAA;;UAPpB;;;;;;iBAOM,UAAA,CAAA,GAAc"}
1
+ {"version":3,"file":"prosekit-extensions-text.d.ts","names":[],"sources":["../src/text/index.ts"],"mappings":";;;;;;AAMA;KAAY,aAAA,GAAgB,SAAA;EAC1B,KAAA;IACE,IAAA,EAAM,KAAA;EAAA;AAAA;;;;iBAOM,UAAA,CAAA,GAAc,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-text.js","names":[],"sources":["../src/text/index.ts"],"sourcesContent":["import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type TextExtension = Extension<{\n Nodes: {\n text: Attrs\n }\n}>\n\n/**\n * @public\n */\nexport function defineText(): TextExtension {\n return defineNodeSpec({\n name: 'text',\n group: 'inline',\n })\n}\n"],"mappings":";;;;;;AAkBA,SAAgB,aAA4B;AAC1C,QAAO,eAAe;EACpB,MAAM;EACN,OAAO;EACR,CAAC"}
1
+ {"version":3,"file":"prosekit-extensions-text.js","names":[],"sources":["../src/text/index.ts"],"sourcesContent":["import { defineNodeSpec, type Extension } from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type TextExtension = Extension<{\n Nodes: {\n text: Attrs\n }\n}>\n\n/**\n * @public\n */\nexport function defineText(): TextExtension {\n return defineNodeSpec({\n name: 'text',\n group: 'inline',\n })\n}\n"],"mappings":";;;;;;AAeA,SAAgB,aAA4B;AAC1C,QAAO,eAAe;EACpB,MAAM;EACN,OAAO;EACR,CAAC"}
@@ -2,7 +2,6 @@ import { Extension, PlainExtension, Union } from "@prosekit/core";
2
2
  import { Attrs } from "@prosekit/pm/model";
3
3
 
4
4
  //#region src/underline/index.d.ts
5
-
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-underline.d.ts","names":[],"sources":["../src/underline/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AASgB,KATJ,sBAAA,GAAyB,SASE,CAAA;EAkB3B,KAAA,EAAA;IASI,SAAA,EAlCD,KAkCC;EASA,CAAA;AAShB,CAAA,CAAA;;;;AAAsC,iBA7CtB,mBAAA,CAAA,CA6CsB,EA7CC,sBA6CD;AAOtC;;;KAlCY,0BAAA,GAA6B;;;;;;;;iBASzB,uBAAA,CAAA,GAA2B;;;;iBAS3B,qBAAA,CAAA,GAAyB;;;;KAS7B,kBAAA,GAAqB,OAC9B,wBAAwB;;;;iBAMX,eAAA,CAAA,GAAmB"}
1
+ {"version":3,"file":"prosekit-extensions-underline.d.ts","names":[],"sources":["../src/underline/index.ts"],"mappings":";;;;;;AAeA;KAAY,sBAAA,GAAyB,SAAA;EACnC,KAAA;IACE,SAAA,EAAW,KAAA;EAAA;AAAA;;;;iBAOC,mBAAA,CAAA,GAAuB,sBAAA;AAAvC;;;AAAA,KAkBY,0BAAA,GAA6B,SAAA;EACvC,QAAA;IACE,eAAA;EAAA;AAAA;;;;iBAOY,uBAAA,CAAA,GAA2B,0BAAA;;;AAA3C;iBASgB,qBAAA,CAAA,GAAyB,cAAA;;;;KAS7B,kBAAA,GAAqB,KAAA,EAC9B,sBAAA,EAAwB,0BAAA;;AAD3B;;iBAOgB,eAAA,CAAA,GAAmB,kBAAA"}
@@ -1,7 +1,6 @@
1
1
  import { PlainExtension } from "@prosekit/core";
2
2
 
3
3
  //#region src/virtual-selection/index.d.ts
4
-
5
4
  /**
6
5
  * @internal
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-virtual-selection.d.ts","names":[],"sources":["../src/virtual-selection/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkBA;AAYgB,KAZJ,yBAAA,GAA4B,cAYE;;;;;;;;;;;iBAA1B,sBAAA,CAAA,GAA0B"}
1
+ {"version":3,"file":"prosekit-extensions-virtual-selection.d.ts","names":[],"sources":["../src/virtual-selection/index.ts"],"mappings":";;;;;AAOA;KAAY,yBAAA,GAA4B,cAAA;;;;AAYxC;;;;;;;iBAAgB,sBAAA,CAAA,GAA0B,yBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-virtual-selection.js","names":[],"sources":["../src/virtual-selection/index.ts"],"sourcesContent":["import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n PluginKey,\n ProseMirrorPlugin,\n type EditorState,\n type Transaction,\n} from '@prosekit/pm/state'\nimport {\n Decoration,\n DecorationSet,\n} from '@prosekit/pm/view'\n\n/**\n * @internal\n */\nexport type VirtualSelectionExtension = PlainExtension\n\n/**\n * Shows a virtual selection when the editor is not focused. When the editor is\n * not focused, the selected inline content will be wrapped in a `<span>`\n * element with the class `prosekit-virtual-selection`.\n *\n * This is useful when you want to move the focus to an element outside the\n * editor, but still want to show the selection.\n *\n * @public\n */\nexport function defineVirtualSelection(): VirtualSelectionExtension {\n return definePlugin(virtualSelectionPlugin)\n}\n\n// Show the decoration when this is true.\ntype PluginState = boolean\n\nconst key = new PluginKey<PluginState>('prosekit-virtual-selection')\n\nfunction getFocusMeta(tr: Transaction): PluginState | undefined {\n return tr.getMeta(key) as PluginState | undefined\n}\n\nfunction setFocusMeta(tr: Transaction, value: PluginState) {\n return tr.setMeta(key, value)\n}\n\nfunction getFocusState(state: EditorState): PluginState | undefined {\n return key.getState(state)\n}\n\nconst virtualSelectionPlugin = new ProseMirrorPlugin<PluginState>({\n key,\n state: {\n init: () => false,\n apply: (tr, value) => {\n return getFocusMeta(tr) ?? value\n },\n },\n props: {\n handleDOMEvents: {\n focus: (view) => {\n view.dispatch(setFocusMeta(view.state.tr, false))\n },\n\n blur: (view) => {\n const { dom, root } = view\n const activeElement = root.activeElement\n\n // Don't show the decoration if the dom is blurred because the focus\n // moved outside the browser window.\n if (activeElement === dom) return\n\n view.dispatch(setFocusMeta(view.state.tr, true))\n },\n },\n decorations: (state) => {\n const { selection, doc } = state\n\n if (\n selection.empty\n || !getFocusState(state)\n // When `selection.visible` is false, it indicates that the selection is\n // rendered by the editor and it's not a native browser selection. An\n // example of this is `NodeSelection`. In this situation, since the\n // editor already shows the selection, we don't need to display a\n // virtual selection.\n || !selection.visible\n ) {\n return null\n }\n\n return DecorationSet.create(doc, [\n Decoration.inline(selection.from, selection.to, {\n class: 'prosekit-virtual-selection',\n }),\n ])\n },\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,SAAgB,yBAAoD;AAClE,QAAO,aAAa,uBAAuB;;AAM7C,MAAM,MAAM,IAAI,UAAuB,6BAA6B;AAEpE,SAAS,aAAa,IAA0C;AAC9D,QAAO,GAAG,QAAQ,IAAI;;AAGxB,SAAS,aAAa,IAAiB,OAAoB;AACzD,QAAO,GAAG,QAAQ,KAAK,MAAM;;AAG/B,SAAS,cAAc,OAA6C;AAClE,QAAO,IAAI,SAAS,MAAM;;AAG5B,MAAM,yBAAyB,IAAI,kBAA+B;CAChE;CACA,OAAO;EACL,YAAY;EACZ,QAAQ,IAAI,UAAU;AACpB,UAAO,aAAa,GAAG,IAAI;;EAE9B;CACD,OAAO;EACL,iBAAiB;GACf,QAAQ,SAAS;AACf,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,MAAM,CAAC;;GAGnD,OAAO,SAAS;IACd,MAAM,EAAE,KAAK,SAAS;AAKtB,QAJsB,KAAK,kBAIL,IAAK;AAE3B,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,KAAK,CAAC;;GAEnD;EACD,cAAc,UAAU;GACtB,MAAM,EAAE,WAAW,QAAQ;AAE3B,OACE,UAAU,SACP,CAAC,cAAc,MAAM,IAMrB,CAAC,UAAU,QAEd,QAAO;AAGT,UAAO,cAAc,OAAO,KAAK,CAC/B,WAAW,OAAO,UAAU,MAAM,UAAU,IAAI,EAC9C,OAAO,8BACR,CAAC,CACH,CAAC;;EAEL;CACF,CAAC"}
1
+ {"version":3,"file":"prosekit-extensions-virtual-selection.js","names":[],"sources":["../src/virtual-selection/index.ts"],"sourcesContent":["import { definePlugin, type PlainExtension } from '@prosekit/core'\nimport { PluginKey, ProseMirrorPlugin, type EditorState, type Transaction } from '@prosekit/pm/state'\nimport { Decoration, DecorationSet } from '@prosekit/pm/view'\n\n/**\n * @internal\n */\nexport type VirtualSelectionExtension = PlainExtension\n\n/**\n * Shows a virtual selection when the editor is not focused. When the editor is\n * not focused, the selected inline content will be wrapped in a `<span>`\n * element with the class `prosekit-virtual-selection`.\n *\n * This is useful when you want to move the focus to an element outside the\n * editor, but still want to show the selection.\n *\n * @public\n */\nexport function defineVirtualSelection(): VirtualSelectionExtension {\n return definePlugin(virtualSelectionPlugin)\n}\n\n// Show the decoration when this is true.\ntype PluginState = boolean\n\nconst key = new PluginKey<PluginState>('prosekit-virtual-selection')\n\nfunction getFocusMeta(tr: Transaction): PluginState | undefined {\n return tr.getMeta(key) as PluginState | undefined\n}\n\nfunction setFocusMeta(tr: Transaction, value: PluginState) {\n return tr.setMeta(key, value)\n}\n\nfunction getFocusState(state: EditorState): PluginState | undefined {\n return key.getState(state)\n}\n\nconst virtualSelectionPlugin = new ProseMirrorPlugin<PluginState>({\n key,\n state: {\n init: () => false,\n apply: (tr, value) => {\n return getFocusMeta(tr) ?? value\n },\n },\n props: {\n handleDOMEvents: {\n focus: (view) => {\n view.dispatch(setFocusMeta(view.state.tr, false))\n },\n\n blur: (view) => {\n const { dom, root } = view\n const activeElement = root.activeElement\n\n // Don't show the decoration if the dom is blurred because the focus\n // moved outside the browser window.\n if (activeElement === dom) return\n\n view.dispatch(setFocusMeta(view.state.tr, true))\n },\n },\n decorations: (state) => {\n const { selection, doc } = state\n\n if (\n selection.empty\n || !getFocusState(state)\n // When `selection.visible` is false, it indicates that the selection is\n // rendered by the editor and it's not a native browser selection. An\n // example of this is `NodeSelection`. In this situation, since the\n // editor already shows the selection, we don't need to display a\n // virtual selection.\n || !selection.visible\n ) {\n return null\n }\n\n return DecorationSet.create(doc, [\n Decoration.inline(selection.from, selection.to, {\n class: 'prosekit-virtual-selection',\n }),\n ])\n },\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,yBAAoD;AAClE,QAAO,aAAa,uBAAuB;;AAM7C,MAAM,MAAM,IAAI,UAAuB,6BAA6B;AAEpE,SAAS,aAAa,IAA0C;AAC9D,QAAO,GAAG,QAAQ,IAAI;;AAGxB,SAAS,aAAa,IAAiB,OAAoB;AACzD,QAAO,GAAG,QAAQ,KAAK,MAAM;;AAG/B,SAAS,cAAc,OAA6C;AAClE,QAAO,IAAI,SAAS,MAAM;;AAG5B,MAAM,yBAAyB,IAAI,kBAA+B;CAChE;CACA,OAAO;EACL,YAAY;EACZ,QAAQ,IAAI,UAAU;AACpB,UAAO,aAAa,GAAG,IAAI;;EAE9B;CACD,OAAO;EACL,iBAAiB;GACf,QAAQ,SAAS;AACf,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,MAAM,CAAC;;GAGnD,OAAO,SAAS;IACd,MAAM,EAAE,KAAK,SAAS;AAKtB,QAJsB,KAAK,kBAIL,IAAK;AAE3B,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,KAAK,CAAC;;GAEnD;EACD,cAAc,UAAU;GACtB,MAAM,EAAE,WAAW,QAAQ;AAE3B,OACE,UAAU,SACP,CAAC,cAAc,MAAM,IAMrB,CAAC,UAAU,QAEd,QAAO;AAGT,UAAO,cAAc,OAAO,KAAK,CAC/B,WAAW,OAAO,UAAU,MAAM,UAAU,IAAI,EAC9C,OAAO,8BACR,CAAC,CACH,CAAC;;EAEL;CACF,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { Extension, PlainExtension, Union } from "@prosekit/core";
2
2
  import { yCursorPlugin, ySyncPlugin, yUndoPlugin } from "y-prosemirror";
3
- import { Awareness } from "y-protocols/awareness";
4
3
  import * as Y from "yjs";
5
4
 
6
5
  //#region src/yjs/yjs-commands.d.ts
@@ -15,6 +14,14 @@ type YjsCommandsExtension = Extension<{
15
14
  }>;
16
15
  declare function defineYjsCommands(): YjsCommandsExtension;
17
16
  //#endregion
17
+ //#region src/yjs/yjs-types.d.ts
18
+ /**
19
+ * @internal
20
+ *
21
+ * The type `Awareness` is not exported by `y-prosemirror` so we need to define it like this.
22
+ */
23
+ type Awareness = Parameters<typeof yCursorPlugin>[0];
24
+ //#endregion
18
25
  //#region src/yjs/yjs-cursor-plugin.d.ts
19
26
  /**
20
27
  * Options for `y-prosemirror`'s `yCursorPlugin`.
@@ -86,5 +93,5 @@ declare function defineYjs(options: YjsOptions): YjsExtension;
86
93
  //#region src/yjs/yjs-keymap.d.ts
87
94
  declare function defineYjsKeymap(): PlainExtension;
88
95
  //#endregion
89
- export { type YjsCursorOptions, type YjsCursorPluginOptions, type YjsExtension, type YjsOptions, type YjsSyncOptions, type YjsSyncPluginOptions, type YjsUndoOptions, type YjsUndoPluginOptions, defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
96
+ export { type Awareness, type YjsCursorOptions, type YjsCursorPluginOptions, type YjsExtension, type YjsOptions, type YjsSyncOptions, type YjsSyncPluginOptions, type YjsUndoOptions, type YjsUndoPluginOptions, defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
90
97
  //# sourceMappingURL=prosekit-extensions-yjs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-extensions-yjs.d.ts","names":[],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/yjs-sync-plugin.ts","../src/yjs/yjs-undo-plugin.ts","../src/yjs/yjs.ts","../src/yjs/yjs-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAiBY,oBAAA,GAAuB;;IAAvB,IAAA,EAAA,EAAA;IAOI,IAAA,EAAA,EAAA;;;iBAAA,iBAAA,CAAA,GAAqB;;;;;;AAPzB,KCNA,sBAAA,GAAyB,WDMF,CCLjC,UDK0C,CAAA,OCLxB,aDKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UCTC,gBAAA,SAAyB,sBDSe,CAAA;aCR5C;;iBAGG,qBAAA,UACL,mBACR;;;;;;ADJS,KENA,oBAAA,GAAuB,WFMA,CELjC,UFK0C,CAAA,OELxB,WFKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UETC,cAAA,SAAuB,oBFSiB,CAAA;YER7C,CAAA,CAAE;;iBAGE,mBAAA,UAA6B,iBAAiB;;;;;;KC+ClD,oBAAA,GAAuB,YACjC,kBAAkB;AHlDR,UGqDK,cAAA,SAAuB,oBHrDI,CAAA,CAO5C;;;;ACbY,iBEyEI,mBAAA,CFzEkB,OAAA,EEyEW,cFzEX,CAAA,EEyE4B,cFzE5B;;;ADalB,UIIC,UAAA,CJJgB;;;;ECbrB,GAAA,EGqBL,CAAA,CAAE,GHrBG;EACQ;;;EAD4B,SAAA,EG0BnC,SH1BmC;EAI/B;AAIjB;;;aGwBa,CAAA,CAAE;EFhCH;;;EAAuB,IAAA,CAAA,EEqC1B,oBFrC0B;EAAW;AAI9C;AAIA;SEkCS;;;ADaT;EACoB,MAAA,CAAA,ECTT,sBDSS;;;;AAGpB;AAcgB,KCpBJ,YAAA,GAAe,KDoBQ,CAAA,CCpBD,oBDoBW,ECpBW,cDoBoB,CAAA,CAAA;;;;ACxD3D,iBAyCD,SAAA,CAzCW,OAAA,EAyCQ,UAzCR,CAAA,EAyCqB,YAzCrB;;;iBCRX,eAAA,CAAA,GAAmB"}
1
+ {"version":3,"file":"prosekit-extensions-yjs.d.ts","names":[],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-types.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/yjs-sync-plugin.ts","../src/yjs/yjs-undo-plugin.ts","../src/yjs/yjs.ts","../src/yjs/yjs-keymap.ts"],"mappings":";;;;;;;;KAWY,oBAAA,GAAuB,SAAA;EACjC,QAAA;IACE,IAAA;IACA,IAAA;EAAA;AAAA;AAAA,iBAIY,iBAAA,CAAA,GAAqB,oBAAA;;;;;;;AAPrC;KCFY,SAAA,GAAY,UAAA,QAAkB,aAAA;;;;;ADE1C;KEFY,sBAAA,GAAyB,WAAA,CACnC,UAAA,QAAkB,aAAA;AAAA,UAGH,gBAAA,SAAyB,sBAAA;EACxC,SAAA,EAAW,SAAA;AAAA;AAAA,iBAGG,qBAAA,CACd,OAAA,EAAS,gBAAA,GACR,cAAA;;;;;AFRH;KGHY,oBAAA,GAAuB,WAAA,CACjC,UAAA,QAAkB,WAAA;AAAA,UAGH,cAAA,SAAuB,oBAAA;EACtC,QAAA,EAAU,CAAA,CAAE,WAAA;AAAA;AAAA,iBAGE,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,cAAA;;;;;;KC4ClD,oBAAA,GAAuB,WAAA,CACjC,UAAA,QAAkB,WAAA;AAAA,UAGH,cAAA,SAAuB,oBAAA;;;;iBAcxB,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,cAAA;;;UCpE7C,UAAA;ELC2B;;;EKG1C,GAAA,EAAK,CAAA,CAAE,GAAA;ELAL;;;EKKF,SAAA,EAAW,SAAA;ELDoB;;;;EKO/B,QAAA,GAAW,CAAA,CAAE,WAAA;;;AJhBf;EIqBE,IAAA,GAAO,oBAAA;;;;EAKP,IAAA,GAAO,oBAAA;;;AH1BT;EG+BE,MAAA,GAAS,sBAAA;AAAA;;;;KAMC,YAAA,GAAe,KAAA,EAAO,oBAAA,EAAsB,cAAA;;;;iBAKxC,SAAA,CAAU,OAAA,EAAS,UAAA,GAAa,YAAA;;;iBCvChC,eAAA,CAAA,GAAmB,cAAA"}