@burdenoff/microfe-support 2026.1029.3 → 2026.1031.1

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 (259) hide show
  1. package/dist/generated/global-operations.js +1 -2
  2. package/dist/generated/global-operations.js.map +1 -1
  3. package/dist/generated/global-types.js +1 -2
  4. package/dist/generated/global-types.js.map +1 -1
  5. package/dist/node_modules/@tiptap/core/dist/index.js +701 -712
  6. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  7. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +1 -2
  8. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -1
  9. package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +1 -2
  10. package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +1 -1
  11. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +15 -16
  12. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +1 -2
  14. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  15. package/dist/node_modules/@tiptap/extension-code/dist/index.js +1 -2
  16. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +25 -26
  18. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  19. package/dist/node_modules/@tiptap/extension-document/dist/index.js +1 -2
  20. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  21. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -2
  22. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  23. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +1 -2
  24. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +16 -17
  26. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +1 -2
  28. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extension-link/dist/index.js +71 -80
  30. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/extension-list/dist/index.js +77 -90
  32. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -2
  34. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  35. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -2
  36. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  37. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +1 -2
  38. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  39. package/dist/node_modules/@tiptap/extension-text/dist/index.js +1 -2
  40. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  41. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +1 -2
  42. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  43. package/dist/node_modules/@tiptap/extensions/dist/index.js +112 -113
  44. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  45. package/dist/node_modules/@tiptap/react/dist/index.js +5 -10
  46. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  47. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +1 -2
  48. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  49. package/dist/node_modules/clsx/dist/clsx.js +1 -2
  50. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  51. package/dist/node_modules/dompurify/dist/purify.es.js +357 -347
  52. package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
  53. package/dist/node_modules/fast-equals/dist/es/index.js +1 -2
  54. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  55. package/dist/node_modules/linkifyjs/dist/linkify.js +1 -2
  56. package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
  57. package/dist/node_modules/marked/lib/marked.esm.js +10 -70
  58. package/dist/node_modules/marked/lib/marked.esm.js.map +1 -1
  59. package/dist/node_modules/orderedmap/dist/index.js +1 -2
  60. package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
  61. package/dist/node_modules/prosemirror-commands/dist/index.js +107 -108
  62. package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
  63. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +12 -13
  64. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  65. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +42 -47
  66. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
  67. package/dist/node_modules/prosemirror-history/dist/index.js +47 -49
  68. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  69. package/dist/node_modules/prosemirror-keymap/dist/index.js +15 -16
  70. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
  71. package/dist/node_modules/prosemirror-model/dist/index.js +37 -41
  72. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  73. package/dist/node_modules/prosemirror-schema-list/dist/index.js +36 -37
  74. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  75. package/dist/node_modules/prosemirror-state/dist/index.js +1 -2
  76. package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
  77. package/dist/node_modules/prosemirror-transform/dist/index.js +1 -2
  78. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  79. package/dist/node_modules/prosemirror-view/dist/index.js +302 -304
  80. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  81. package/dist/node_modules/rope-sequence/dist/index.js +1 -2
  82. package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
  83. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
  84. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  85. package/dist/node_modules/w3c-keyname/index.js +0 -1
  86. package/dist/node_modules/w3c-keyname/index.js.map +1 -1
  87. package/dist/support/SupportAdminRoot.js +14 -15
  88. package/dist/support/SupportAdminRoot.js.map +1 -1
  89. package/dist/support/SupportAdminRoutes.js +5 -6
  90. package/dist/support/SupportAdminRoutes.js.map +1 -1
  91. package/dist/support/SupportUserRoot.js +10 -11
  92. package/dist/support/SupportUserRoot.js.map +1 -1
  93. package/dist/support/SupportUserRoutes.js +1 -2
  94. package/dist/support/SupportUserRoutes.js.map +1 -1
  95. package/dist/support/components/NotificationToast.js +1 -2
  96. package/dist/support/components/NotificationToast.js.map +1 -1
  97. package/dist/support/components/PageLayout.js +15 -16
  98. package/dist/support/components/PageLayout.js.map +1 -1
  99. package/dist/support/components/RouteHelpers.js +1 -2
  100. package/dist/support/components/RouteHelpers.js.map +1 -1
  101. package/dist/support/components/analytics/CategoryBreakdown.js +9 -10
  102. package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
  103. package/dist/support/components/analytics/MetricCard.js +1 -2
  104. package/dist/support/components/analytics/MetricCard.js.map +1 -1
  105. package/dist/support/components/analytics/PriorityBreakdown.js +9 -10
  106. package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
  107. package/dist/support/components/analytics/SLAReport.js +5 -6
  108. package/dist/support/components/analytics/SLAReport.js.map +1 -1
  109. package/dist/support/components/analytics/SatisfactionDistribution.js +5 -6
  110. package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
  111. package/dist/support/components/analytics/TopAgents.js +5 -6
  112. package/dist/support/components/analytics/TopAgents.js.map +1 -1
  113. package/dist/support/components/analytics/TrendChart.js +5 -6
  114. package/dist/support/components/analytics/TrendChart.js.map +1 -1
  115. package/dist/support/components/careers/BulkCandidateActionGuidance.js +1 -2
  116. package/dist/support/components/careers/BulkCandidateActionGuidance.js.map +1 -1
  117. package/dist/support/components/careers/BulkCandidateDialogs.js +321 -322
  118. package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
  119. package/dist/support/components/careers/BulkOperationFeedback.js +1 -2
  120. package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
  121. package/dist/support/components/careers/BulkSelectionSummary.js +1 -2
  122. package/dist/support/components/careers/BulkSelectionSummary.js.map +1 -1
  123. package/dist/support/components/careers/JobApplicationFilterContextGuard.js +1 -2
  124. package/dist/support/components/careers/JobApplicationFilterContextGuard.js.map +1 -1
  125. package/dist/support/components/careers/RichTextEditor.js +17 -18
  126. package/dist/support/components/careers/RichTextEditor.js.map +1 -1
  127. package/dist/support/components/kb/ArticleForm.js +10 -11
  128. package/dist/support/components/kb/ArticleForm.js.map +1 -1
  129. package/dist/support/components/settings/CannedResponsesSettings.js +2 -3
  130. package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
  131. package/dist/support/components/settings/SLAPoliciesSettings.js +1 -2
  132. package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
  133. package/dist/support/components/settings/TicketCategoriesSettings.js +3 -8
  134. package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
  135. package/dist/support/components/tickets/AttachmentList.js +4 -5
  136. package/dist/support/components/tickets/AttachmentList.js.map +1 -1
  137. package/dist/support/components/tickets/MarkdownContent.js +1 -2
  138. package/dist/support/components/tickets/MarkdownContent.js.map +1 -1
  139. package/dist/support/components/tickets/MessageComposer.js +1 -2
  140. package/dist/support/components/tickets/MessageComposer.js.map +1 -1
  141. package/dist/support/components/tickets/MessageThread.js +13 -14
  142. package/dist/support/components/tickets/MessageThread.js.map +1 -1
  143. package/dist/support/components/tickets/TicketDetailHeader.js +13 -14
  144. package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
  145. package/dist/support/components/tickets/TicketHeader.js +1 -2
  146. package/dist/support/components/tickets/TicketHeader.js.map +1 -1
  147. package/dist/support/components/tickets/TicketSidebar.js +6 -7
  148. package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
  149. package/dist/support/components/tickets/TriagePanel.js +25 -26
  150. package/dist/support/components/tickets/TriagePanel.js.map +1 -1
  151. package/dist/support/components/ui.js +1 -2
  152. package/dist/support/constants/pipeline.js +1 -2
  153. package/dist/support/constants/pipeline.js.map +1 -1
  154. package/dist/support/constants.js +1 -2
  155. package/dist/support/constants.js.map +1 -1
  156. package/dist/support/events/rybbit.js +1 -2
  157. package/dist/support/events/rybbit.js.map +1 -1
  158. package/dist/support/hooks/index.js +6 -6
  159. package/dist/support/hooks/useAnalyticsOperations.js +1 -2
  160. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
  161. package/dist/support/hooks/useAttachmentsFailedToast.js +1 -2
  162. package/dist/support/hooks/useAttachmentsFailedToast.js.map +1 -1
  163. package/dist/support/hooks/useChatOperations.js +14 -15
  164. package/dist/support/hooks/useChatOperations.js.map +1 -1
  165. package/dist/support/hooks/useDebouncedUrlText.js +1 -2
  166. package/dist/support/hooks/useDebouncedUrlText.js.map +1 -1
  167. package/dist/support/hooks/useKnowledgeBaseOperations.js +62 -63
  168. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  169. package/dist/support/hooks/useNotification.js +1 -2
  170. package/dist/support/hooks/useNotification.js.map +1 -1
  171. package/dist/support/hooks/useRegisterFooter.js +1 -2
  172. package/dist/support/hooks/useRegisterFooter.js.map +1 -1
  173. package/dist/support/hooks/useSettingsOperations.js +1 -2
  174. package/dist/support/hooks/useSettingsOperations.js.map +1 -1
  175. package/dist/support/hooks/useSupportAttachments.js +1 -2
  176. package/dist/support/hooks/useSupportAttachments.js.map +1 -1
  177. package/dist/support/hooks/useTicketListOperations.js +9 -10
  178. package/dist/support/hooks/useTicketListOperations.js.map +1 -1
  179. package/dist/support/hooks/useTicketOperations.js +57 -58
  180. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  181. package/dist/support/hooks/useTr.js +1 -2
  182. package/dist/support/hooks/useTr.js.map +1 -1
  183. package/dist/support/index.js +4 -4
  184. package/dist/support/pages/AnalyticsPage.js +34 -35
  185. package/dist/support/pages/AnalyticsPage.js.map +1 -1
  186. package/dist/support/pages/ArticleDetailAdminPage.js +33 -38
  187. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
  188. package/dist/support/pages/ArticleDetailUserPage.js +22 -23
  189. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
  190. package/dist/support/pages/ContactInquiriesPage.js +5 -6
  191. package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
  192. package/dist/support/pages/ContactInquiryDetailPage.js +13 -14
  193. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
  194. package/dist/support/pages/CreateArticlePage.js +15 -16
  195. package/dist/support/pages/CreateArticlePage.js.map +1 -1
  196. package/dist/support/pages/CreateTicketPage.js +37 -44
  197. package/dist/support/pages/CreateTicketPage.js.map +1 -1
  198. package/dist/support/pages/EditArticlePage.js +20 -21
  199. package/dist/support/pages/EditArticlePage.js.map +1 -1
  200. package/dist/support/pages/InterviewersPage.js +121 -122
  201. package/dist/support/pages/InterviewersPage.js.map +1 -1
  202. package/dist/support/pages/JobApplicationDetailPage.js +322 -332
  203. package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
  204. package/dist/support/pages/JobApplicationsPage.js +556 -561
  205. package/dist/support/pages/JobApplicationsPage.js.map +1 -1
  206. package/dist/support/pages/JobPostingDetailPage.js +489 -490
  207. package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
  208. package/dist/support/pages/JobPostingsPage.js +279 -280
  209. package/dist/support/pages/JobPostingsPage.js.map +1 -1
  210. package/dist/support/pages/KnowledgeBaseAdminPage.js +26 -27
  211. package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
  212. package/dist/support/pages/KnowledgeBaseUserPage.js +23 -24
  213. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
  214. package/dist/support/pages/SettingsPage.js +43 -44
  215. package/dist/support/pages/SettingsPage.js.map +1 -1
  216. package/dist/support/pages/TicketDetailAdminPage.js +54 -55
  217. package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
  218. package/dist/support/pages/TicketDetailUserPage.js +61 -62
  219. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  220. package/dist/support/pages/TicketListPage.js +77 -78
  221. package/dist/support/pages/TicketListPage.js.map +1 -1
  222. package/dist/support/providers/SupportProvider.js +1 -2
  223. package/dist/support/providers/SupportProvider.js.map +1 -1
  224. package/dist/support/store/supportStore.js +1 -2
  225. package/dist/support/store/supportStore.js.map +1 -1
  226. package/dist/support/translations/en.js +1 -2
  227. package/dist/support/translations/en.js.map +1 -1
  228. package/dist/support/utils/attachments.js +1 -2
  229. package/dist/support/utils/attachments.js.map +1 -1
  230. package/dist/support/utils/breadcrumbRegistry.js +3 -4
  231. package/dist/support/utils/breadcrumbRegistry.js.map +1 -1
  232. package/dist/support/utils/bulkCandidateOperations.js +0 -1
  233. package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
  234. package/dist/support/utils/bulkCandidateTargetQuery.js +1 -2
  235. package/dist/support/utils/bulkCandidateTargetQuery.js.map +1 -1
  236. package/dist/support/utils/categoryColors.js +1 -2
  237. package/dist/support/utils/categoryColors.js.map +1 -1
  238. package/dist/support/utils/cn.js +1 -2
  239. package/dist/support/utils/cn.js.map +1 -1
  240. package/dist/support/utils/context.js +3 -4
  241. package/dist/support/utils/context.js.map +1 -1
  242. package/dist/support/utils/errors.js +1 -2
  243. package/dist/support/utils/errors.js.map +1 -1
  244. package/dist/support/utils/i18n.js +1 -2
  245. package/dist/support/utils/i18n.js.map +1 -1
  246. package/dist/support/utils/index.js +1 -2
  247. package/dist/support/utils/index.js.map +1 -1
  248. package/dist/support/utils/jobApplicationFilterParams.js +1 -2
  249. package/dist/support/utils/jobApplicationFilterParams.js.map +1 -1
  250. package/dist/support/utils/markdown.js +1 -2
  251. package/dist/support/utils/markdown.js.map +1 -1
  252. package/dist/support/utils/supportFiles.js +2 -11
  253. package/dist/support/utils/supportFiles.js.map +1 -1
  254. package/dist/support/utils/ticketFilters.js +1 -2
  255. package/dist/support/utils/ticketFilters.js.map +1 -1
  256. package/dist/support/utils/uiTokens.js +1 -2
  257. package/dist/support/utils/uiTokens.js.map +1 -1
  258. package/dist/utils/nativeBridge.js +1 -2
  259. package/package.json +21 -14
@@ -1,34 +1,34 @@
1
- import { Fragment as e, Slice as t } from "../../prosemirror-model/dist/index.js";
2
- import { ReplaceAroundStep as n, ReplaceStep as r, canJoin as i, canSplit as a, findWrapping as o, joinPoint as s, liftTarget as c, replaceStep as l } from "../../prosemirror-transform/dist/index.js";
1
+ import { ReplaceAroundStep as e, ReplaceStep as t, canJoin as n, canSplit as r, findWrapping as i, joinPoint as a, liftTarget as o, replaceStep as s } from "../../prosemirror-transform/dist/index.js";
2
+ import { Fragment as c, Slice as l } from "../../prosemirror-model/dist/index.js";
3
3
  import { AllSelection as u, NodeSelection as d, Selection as f, TextSelection as p } from "../../prosemirror-state/dist/index.js";
4
- //#region node_modules/prosemirror-commands/dist/index.js
4
+ // node_modules/prosemirror-commands/dist/index.js
5
5
  var m = (e, t) => !e.selection.empty && (t && t(e.tr.deleteSelection().scrollIntoView()), !0);
6
6
  function h(e, t) {
7
7
  let { $cursor: n } = e.selection;
8
8
  return !n || (t ? !t.endOfTextblock("backward", e) : n.parentOffset > 0) ? null : n;
9
9
  }
10
- var g = (e, n, r) => {
11
- let i = h(e, r);
12
- if (!i) return !1;
13
- let a = S(i);
14
- if (!a) {
15
- let t = i.blockRange(), r = t && c(t);
16
- return r != null && (n && n(e.tr.lift(t, r).scrollIntoView()), !0);
10
+ var g = (e, t, n) => {
11
+ let r = h(e, n);
12
+ if (!r) return !1;
13
+ let i = S(r);
14
+ if (!i) {
15
+ let n = r.blockRange(), i = n && o(n);
16
+ return i != null && (t && t(e.tr.lift(n, i).scrollIntoView()), !0);
17
17
  }
18
- let o = a.nodeBefore;
19
- if (B(e, a, n, -1)) return !0;
20
- if (i.parent.content.size == 0 && (b(o, "end") || d.isSelectable(o))) for (let r = i.depth;; r--) {
21
- let s = l(e.doc, i.before(r), i.after(r), t.empty);
22
- if (s && s.slice.size < s.to - s.from) {
23
- if (n) {
24
- let t = e.tr.step(s);
25
- t.setSelection(b(o, "end") ? f.findFrom(t.doc.resolve(t.mapping.map(a.pos, -1)), -1) : d.create(t.doc, a.pos - o.nodeSize)), n(t.scrollIntoView());
18
+ let a = i.nodeBefore;
19
+ if (B(e, i, t, -1)) return !0;
20
+ if (r.parent.content.size == 0 && (b(a, "end") || d.isSelectable(a))) for (let n = r.depth;; n--) {
21
+ let o = s(e.doc, r.before(n), r.after(n), l.empty);
22
+ if (o && o.slice.size < o.to - o.from) {
23
+ if (t) {
24
+ let n = e.tr.step(o);
25
+ n.setSelection(b(a, "end") ? f.findFrom(n.doc.resolve(n.mapping.map(i.pos, -1)), -1) : d.create(n.doc, i.pos - a.nodeSize)), t(n.scrollIntoView());
26
26
  }
27
27
  return !0;
28
28
  }
29
- if (r == 1 || i.node(r - 1).childCount > 1) break;
29
+ if (n == 1 || r.node(n - 1).childCount > 1) break;
30
30
  }
31
- return o.isAtom && a.depth == i.depth - 1 ? (n && n(e.tr.delete(a.pos - o.nodeSize, a.pos).scrollIntoView()), !0) : !1;
31
+ return a.isAtom && i.depth == r.depth - 1 ? (t && t(e.tr.delete(i.pos - a.nodeSize, i.pos).scrollIntoView()), !0) : !1;
32
32
  }, _ = (e, t, n) => {
33
33
  let r = h(e, n);
34
34
  if (!r) return !1;
@@ -40,26 +40,26 @@ var g = (e, n, r) => {
40
40
  let i = E(r);
41
41
  return i ? y(e, i, t) : !1;
42
42
  };
43
- function y(e, n, i) {
44
- let a = n.nodeBefore, o = n.pos - 1;
45
- for (; !a.isTextblock; o--) {
46
- if (a.type.spec.isolating) return !1;
47
- let e = a.lastChild;
43
+ function y(e, n, r) {
44
+ let i = n.nodeBefore, a = n.pos - 1;
45
+ for (; !i.isTextblock; a--) {
46
+ if (i.type.spec.isolating) return !1;
47
+ let e = i.lastChild;
48
48
  if (!e) return !1;
49
- a = e;
49
+ i = e;
50
50
  }
51
- let s = n.nodeAfter, c = n.pos + 1;
52
- for (; !s.isTextblock; c++) {
53
- if (s.type.spec.isolating) return !1;
54
- let e = s.firstChild;
51
+ let o = n.nodeAfter, c = n.pos + 1;
52
+ for (; !o.isTextblock; c++) {
53
+ if (o.type.spec.isolating) return !1;
54
+ let e = o.firstChild;
55
55
  if (!e) return !1;
56
- s = e;
56
+ o = e;
57
57
  }
58
- let u = l(e.doc, o, c, t.empty);
59
- if (!u || u.from != o || u instanceof r && u.slice.size >= c - o) return !1;
60
- if (i) {
58
+ let u = s(e.doc, a, c, l.empty);
59
+ if (!u || u.from != a || u instanceof t && u.slice.size >= c - a) return !1;
60
+ if (r) {
61
61
  let t = e.tr.step(u);
62
- t.setSelection(p.create(t.doc, o)), i(t.scrollIntoView());
62
+ t.setSelection(p.create(t.doc, a)), r(t.scrollIntoView());
63
63
  }
64
64
  return !0;
65
65
  }
@@ -91,24 +91,24 @@ function C(e, t) {
91
91
  let { $cursor: n } = e.selection;
92
92
  return !n || (t ? !t.endOfTextblock("forward", e) : n.parentOffset < n.parent.content.size) ? null : n;
93
93
  }
94
- var w = (e, n, r) => {
95
- let i = C(e, r);
94
+ var w = (e, t, n) => {
95
+ let r = C(e, n);
96
+ if (!r) return !1;
97
+ let i = E(r);
96
98
  if (!i) return !1;
97
- let a = E(i);
98
- if (!a) return !1;
99
- let o = a.nodeAfter;
100
- if (B(e, a, n, 1)) return !0;
101
- if (i.parent.content.size == 0 && (b(o, "start") || d.isSelectable(o))) {
102
- let r = l(e.doc, i.before(), i.after(), t.empty);
103
- if (r && r.slice.size < r.to - r.from) {
104
- if (n) {
105
- let t = e.tr.step(r);
106
- t.setSelection(b(o, "start") ? f.findFrom(t.doc.resolve(t.mapping.map(a.pos)), 1) : d.create(t.doc, t.mapping.map(a.pos))), n(t.scrollIntoView());
99
+ let a = i.nodeAfter;
100
+ if (B(e, i, t, 1)) return !0;
101
+ if (r.parent.content.size == 0 && (b(a, "start") || d.isSelectable(a))) {
102
+ let n = s(e.doc, r.before(), r.after(), l.empty);
103
+ if (n && n.slice.size < n.to - n.from) {
104
+ if (t) {
105
+ let r = e.tr.step(n);
106
+ r.setSelection(b(a, "start") ? f.findFrom(r.doc.resolve(r.mapping.map(i.pos)), 1) : d.create(r.doc, r.mapping.map(i.pos))), t(r.scrollIntoView());
107
107
  }
108
108
  return !0;
109
109
  }
110
110
  }
111
- return o.isAtom && a.depth == i.depth - 1 ? (n && n(e.tr.delete(a.pos, a.pos + o.nodeSize).scrollIntoView()), !0) : !1;
111
+ return a.isAtom && i.depth == r.depth - 1 ? (t && t(e.tr.delete(i.pos, i.pos + a.nodeSize).scrollIntoView()), !0) : !1;
112
112
  }, T = (e, t, n) => {
113
113
  let { $head: r, empty: i } = e.selection, a = r;
114
114
  if (!i) return !1;
@@ -128,25 +128,25 @@ function E(e) {
128
128
  return null;
129
129
  }
130
130
  var D = (e, t) => {
131
- let n = e.selection, r = n instanceof d, a;
132
- if (r) {
133
- if (n.node.isTextblock || !i(e.doc, n.from)) return !1;
134
- a = n.from;
135
- } else if (a = s(e.doc, n.from, -1), a == null) return !1;
131
+ let r = e.selection, i = r instanceof d, o;
132
+ if (i) {
133
+ if (r.node.isTextblock || !n(e.doc, r.from)) return !1;
134
+ o = r.from;
135
+ } else if (o = a(e.doc, r.from, -1), o == null) return !1;
136
136
  if (t) {
137
- let n = e.tr.join(a);
138
- r && n.setSelection(d.create(n.doc, a - e.doc.resolve(a).nodeBefore.nodeSize)), t(n.scrollIntoView());
137
+ let n = e.tr.join(o);
138
+ i && n.setSelection(d.create(n.doc, o - e.doc.resolve(o).nodeBefore.nodeSize)), t(n.scrollIntoView());
139
139
  }
140
140
  return !0;
141
141
  }, O = (e, t) => {
142
- let n = e.selection, r;
143
- if (n instanceof d) {
144
- if (n.node.isTextblock || !i(e.doc, n.to)) return !1;
145
- r = n.to;
146
- } else if (r = s(e.doc, n.to, 1), r == null) return !1;
147
- return t && t(e.tr.join(r).scrollIntoView()), !0;
142
+ let r = e.selection, i;
143
+ if (r instanceof d) {
144
+ if (r.node.isTextblock || !n(e.doc, r.to)) return !1;
145
+ i = r.to;
146
+ } else if (i = a(e.doc, r.to, 1), i == null) return !1;
147
+ return t && t(e.tr.join(i).scrollIntoView()), !0;
148
148
  }, k = (e, t) => {
149
- let { $from: n, $to: r } = e.selection, i = n.blockRange(r), a = i && c(i);
149
+ let { $from: n, $to: r } = e.selection, i = n.blockRange(r), a = i && o(i);
150
150
  return a != null && (t && t(e.tr.lift(i, a).scrollIntoView()), !0);
151
151
  }, A = (e, t) => {
152
152
  let { $head: n, $anchor: r } = e.selection;
@@ -183,74 +183,74 @@ var M = (e, t) => {
183
183
  let { $cursor: n } = e.selection;
184
184
  if (!n || n.parent.content.size) return !1;
185
185
  if (n.depth > 1 && n.after() != n.end(-1)) {
186
- let r = n.before();
187
- if (a(e.doc, r)) return t && t(e.tr.split(r).scrollIntoView()), !0;
186
+ let i = n.before();
187
+ if (r(e.doc, i)) return t && t(e.tr.split(i).scrollIntoView()), !0;
188
188
  }
189
- let r = n.blockRange(), i = r && c(r);
190
- return i != null && (t && t(e.tr.lift(r, i).scrollIntoView()), !0);
189
+ let i = n.blockRange(), a = i && o(i);
190
+ return a != null && (t && t(e.tr.lift(i, a).scrollIntoView()), !0);
191
191
  };
192
192
  function F(e) {
193
193
  return (t, n) => {
194
194
  if (t.selection instanceof d && t.selection.node.isBlock) {
195
195
  let { $from: e } = t.selection;
196
- return !e.parentOffset || !a(t.doc, e.pos) ? !1 : (n && n(t.tr.split(e.pos).scrollIntoView()), !0);
196
+ return !e.parentOffset || !r(t.doc, e.pos) ? !1 : (n && n(t.tr.split(e.pos).scrollIntoView()), !0);
197
197
  }
198
198
  if (!t.selection.$from.depth) return !1;
199
- let r = t.tr;
200
- !t.selection.empty && (t.selection instanceof p || t.selection instanceof u) && r.deleteSelection();
201
- let { $from: i } = r.selection, o = r.steps.length, s = [], c, l, f = !1, m = !1;
202
- for (let t = i.depth;; t--) if (i.node(t).isBlock) {
203
- f = i.end(t) == i.pos + (i.depth - t), m = i.start(t) == i.pos - (i.depth - t), l = j(i.node(t - 1).contentMatchAt(i.indexAfter(t - 1)));
204
- let n = e && e(i.parent, f, i);
199
+ let i = t.tr;
200
+ !t.selection.empty && (t.selection instanceof p || t.selection instanceof u) && i.deleteSelection();
201
+ let { $from: a } = i.selection, o = i.steps.length, s = [], c, l, f = !1, m = !1;
202
+ for (let t = a.depth;; t--) if (a.node(t).isBlock) {
203
+ f = a.end(t) == a.pos + (a.depth - t), m = a.start(t) == a.pos - (a.depth - t), l = j(a.node(t - 1).contentMatchAt(a.indexAfter(t - 1)));
204
+ let n = e && e(a.parent, f, a);
205
205
  s.unshift(n || (f && l ? { type: l } : null)), c = t;
206
206
  break;
207
207
  } else {
208
208
  if (t == 1) return !1;
209
209
  s.unshift(null);
210
210
  }
211
- let h = i.pos, g = a(r.doc, h, s.length, s);
212
- if (g ||= (s[0] = l ? { type: l } : null, a(r.doc, h, s.length, s)), !g) return !1;
213
- if (r.split(h, s.length, s), !f && m && i.node(c).type != l) {
214
- let e = r.mapping.slice(o), t = e.map(i.before(c)), n = r.doc.resolve(t);
215
- l && i.node(c - 1).canReplaceWith(n.index(), n.index() + 1, l) && r.setNodeMarkup(e.map(i.before(c)), l);
211
+ let h = a.pos, g = r(i.doc, h, s.length, s);
212
+ if (g ||= (s[0] = l ? { type: l } : null, r(i.doc, h, s.length, s)), !g) return !1;
213
+ if (i.split(h, s.length, s), !f && m && a.node(c).type != l) {
214
+ let e = i.mapping.slice(o), t = e.map(a.before(c)), n = i.doc.resolve(t);
215
+ l && a.node(c - 1).canReplaceWith(n.index(), n.index() + 1, l) && i.setNodeMarkup(e.map(a.before(c)), l);
216
216
  }
217
- return n && n(r.scrollIntoView()), !0;
217
+ return n && n(i.scrollIntoView()), !0;
218
218
  };
219
219
  }
220
220
  var I = F(), L = (e, t) => {
221
221
  let { $from: n, to: r } = e.selection, i, a = n.sharedDepth(r);
222
222
  return a != 0 && (i = n.before(a), t && t(e.tr.setSelection(d.create(e.doc, i))), !0);
223
223
  }, R = (e, t) => (t && t(e.tr.setSelection(new u(e.doc))), !0);
224
- function z(e, t, n) {
225
- let r = t.nodeBefore, a = t.nodeAfter, o = t.index();
226
- return !r || !a || !r.type.compatibleContent(a.type) ? !1 : !r.content.size && t.parent.canReplace(o - 1, o) ? (n && n(e.tr.delete(t.pos - r.nodeSize, t.pos).scrollIntoView()), !0) : !t.parent.canReplace(o, o + 1) || !(a.isTextblock || i(e.doc, t.pos)) ? !1 : (n && n(e.tr.join(t.pos).scrollIntoView()), !0);
224
+ function z(e, t, r) {
225
+ let i = t.nodeBefore, a = t.nodeAfter, o = t.index();
226
+ return !i || !a || !i.type.compatibleContent(a.type) ? !1 : !i.content.size && t.parent.canReplace(o - 1, o) ? (r && r(e.tr.delete(t.pos - i.nodeSize, t.pos).scrollIntoView()), !0) : !t.parent.canReplace(o, o + 1) || !(a.isTextblock || n(e.doc, t.pos)) ? !1 : (r && r(e.tr.join(t.pos).scrollIntoView()), !0);
227
227
  }
228
- function B(r, a, o, s) {
229
- let l = a.nodeBefore, u = a.nodeAfter, d, p, m = l.type.spec.isolating || u.type.spec.isolating;
230
- if (!m && z(r, a, o)) return !0;
231
- let h = !m && a.parent.canReplace(a.index(), a.index() + 1);
232
- if (h && (d = (p = l.contentMatchAt(l.childCount)).findWrapping(u.type)) && p.matchType(d[0] || u.type).validEnd) {
233
- if (o) {
234
- let s = a.pos + u.nodeSize, c = e.empty;
235
- for (let t = d.length - 1; t >= 0; t--) c = e.from(d[t].create(null, c));
236
- c = e.from(l.copy(c));
237
- let f = r.tr.step(new n(a.pos - 1, s, a.pos, s, new t(c, 1, 0), d.length, !0)), p = f.doc.resolve(s + 2 * d.length);
238
- p.nodeAfter && p.nodeAfter.type == l.type && i(f.doc, p.pos) && f.join(p.pos), o(f.scrollIntoView());
228
+ function B(t, r, i, a) {
229
+ let s = r.nodeBefore, u = r.nodeAfter, d, p, m = s.type.spec.isolating || u.type.spec.isolating;
230
+ if (!m && z(t, r, i)) return !0;
231
+ let h = !m && r.parent.canReplace(r.index(), r.index() + 1);
232
+ if (h && (d = (p = s.contentMatchAt(s.childCount)).findWrapping(u.type)) && p.matchType(d[0] || u.type).validEnd) {
233
+ if (i) {
234
+ let a = r.pos + u.nodeSize, o = c.empty;
235
+ for (let e = d.length - 1; e >= 0; e--) o = c.from(d[e].create(null, o));
236
+ o = c.from(s.copy(o));
237
+ let f = t.tr.step(new e(r.pos - 1, a, r.pos, a, new l(o, 1, 0), d.length, !0)), p = f.doc.resolve(a + 2 * d.length);
238
+ p.nodeAfter && p.nodeAfter.type == s.type && n(f.doc, p.pos) && f.join(p.pos), i(f.scrollIntoView());
239
239
  }
240
240
  return !0;
241
241
  }
242
- let g = u.type.spec.isolating || s > 0 && m ? null : f.findFrom(a, 1), _ = g && g.$from.blockRange(g.$to), v = _ && c(_);
243
- if (v != null && v >= a.depth) return o && o(r.tr.lift(_, v).scrollIntoView()), !0;
244
- if (h && b(u, "start", !0) && b(l, "end")) {
245
- let i = l, s = [];
246
- for (; s.push(i), !i.isTextblock;) i = i.lastChild;
247
- let c = u, d = 1;
248
- for (; !c.isTextblock; c = c.firstChild) d++;
249
- if (i.canReplace(i.childCount, i.childCount, c.content)) {
250
- if (o) {
251
- let i = e.empty;
252
- for (let t = s.length - 1; t >= 0; t--) i = e.from(s[t].copy(i));
253
- o(r.tr.step(new n(a.pos - s.length, a.pos + u.nodeSize, a.pos + d, a.pos + u.nodeSize - d, new t(i, s.length, 0), 0, !0)).scrollIntoView());
242
+ let g = u.type.spec.isolating || a > 0 && m ? null : f.findFrom(r, 1), _ = g && g.$from.blockRange(g.$to), v = _ && o(_);
243
+ if (v != null && v >= r.depth) return i && i(t.tr.lift(_, v).scrollIntoView()), !0;
244
+ if (h && b(u, "start", !0) && b(s, "end")) {
245
+ let n = s, a = [];
246
+ for (; a.push(n), !n.isTextblock;) n = n.lastChild;
247
+ let o = u, d = 1;
248
+ for (; !o.isTextblock; o = o.firstChild) d++;
249
+ if (n.canReplace(n.childCount, n.childCount, o.content)) {
250
+ if (i) {
251
+ let n = c.empty;
252
+ for (let e = a.length - 1; e >= 0; e--) n = c.from(a[e].copy(n));
253
+ i(t.tr.step(new e(r.pos - a.length, r.pos + u.nodeSize, r.pos + d, r.pos + u.nodeSize - d, new l(n, a.length, 0), 0, !0)).scrollIntoView());
254
254
  }
255
255
  return !0;
256
256
  }
@@ -270,7 +270,7 @@ function V(e) {
270
270
  var H = V(-1), U = V(1);
271
271
  function W(e, t = null) {
272
272
  return function(n, r) {
273
- let { $from: i, $to: a } = n.selection, s = i.blockRange(a), c = s && o(s, e, t);
273
+ let { $from: a, $to: o } = n.selection, s = a.blockRange(o), c = s && i(s, e, t);
274
274
  return c ? (r && r(n.tr.wrap(s, c).scrollIntoView()), !0) : !1;
275
275
  };
276
276
  }
@@ -281,7 +281,7 @@ function G(e, t = null) {
281
281
  let { $from: { pos: a }, $to: { pos: o } } = n.selection.ranges[r];
282
282
  n.doc.nodesBetween(a, o, (r, a) => {
283
283
  if (i) return !1;
284
- if (!(!r.isTextblock || r.hasMarkup(e, t))) {
284
+ if (r.isTextblock && !r.hasMarkup(e, t)) {
285
285
  if (r.type == e) i = !0;
286
286
  else {
287
287
  let t = n.doc.resolve(a), r = t.index();
@@ -329,7 +329,6 @@ var q = K(m, g, x), J = K(m, w, T), Y = {
329
329
  };
330
330
  for (let e in Y) X[e] = Y[e];
331
331
  typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform();
332
- //#endregion
333
332
  export { K as chainCommands, N as createParagraphNear, m as deleteSelection, M as exitCode, g as joinBackward, O as joinDown, w as joinForward, _ as joinTextblockBackward, v as joinTextblockForward, D as joinUp, k as lift, P as liftEmptyBlock, X as macBaseKeymap, A as newlineInCode, Y as pcBaseKeymap, R as selectAll, x as selectNodeBackward, T as selectNodeForward, L as selectParentNode, U as selectTextblockEnd, H as selectTextblockStart, G as setBlockType, I as splitBlock, F as splitBlockAs, W as wrapIn };
334
333
 
335
334
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../node_modules/prosemirror-commands/dist/index.js"],"sourcesContent":["import { liftTarget, replaceStep, ReplaceStep, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { NodeSelection, Selection, TextSelection, AllSelection, SelectionRange } from 'prosemirror-state';\n\n/**\nDelete the selection, if there is one.\n*/\nconst deleteSelection = (state, dispatch) => {\n if (state.selection.empty)\n return false;\n if (dispatch)\n dispatch(state.tr.deleteSelection().scrollIntoView());\n return true;\n};\nfunction atBlockStart(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and at the start of a textblock, try to\nreduce the distance between that block and the one before it—if\nthere's a block directly before it that can be joined, join them.\nIf not, try to move the selected block closer to the next one in\nthe document structure by lifting it out of its parent or moving it\ninto a parent of the previous block. Will use the view for accurate\n(bidi-aware) start-of-textblock detection if given.\n*/\nconst joinBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n // If there is no node before this, try to lift\n if (!$cut) {\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n let before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, -1))\n return true;\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || NodeSelection.isSelectable(before))) {\n for (let depth = $cursor.depth;; depth--) {\n let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(before, \"end\")\n ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n if (depth == 1 || $cursor.node(depth - 1).childCount > 1)\n break;\n }\n }\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nA more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)\nthat only tries to join the current textblock to the one before\nit, if the cursor is at the start of a textblock.\n*/\nconst joinTextblockBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\n/**\nA more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)\nthat only tries to join the current textblock to the one after\nit, if the cursor is at the end of a textblock.\n*/\nconst joinTextblockForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\nfunction joinTextblocksAround(state, $cut, dispatch) {\n let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;\n for (; !beforeText.isTextblock; beforePos--) {\n if (beforeText.type.spec.isolating)\n return false;\n let child = beforeText.lastChild;\n if (!child)\n return false;\n beforeText = child;\n }\n let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;\n for (; !afterText.isTextblock; afterPos++) {\n if (afterText.type.spec.isolating)\n return false;\n let child = afterText.firstChild;\n if (!child)\n return false;\n afterText = child;\n }\n let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);\n if (!step || step.from != beforePos ||\n step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos)\n return false;\n if (dispatch) {\n let tr = state.tr.step(step);\n tr.setSelection(TextSelection.create(tr.doc, beforePos));\n dispatch(tr.scrollIntoView());\n }\n return true;\n}\nfunction textblockAt(node, side, only = false) {\n for (let scan = node; scan; scan = (side == \"start\" ? scan.firstChild : scan.lastChild)) {\n if (scan.isTextblock)\n return true;\n if (only && scan.childCount != 1)\n return false;\n }\n return false;\n}\n/**\nWhen the selection is empty and at the start of a textblock, select\nthe node before that textblock, if possible. This is intended to be\nbound to keys like backspace, after\n[`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward) or other deleting\ncommands, as a fall-back behavior when the schema doesn't allow\ndeletion at the selected point.\n*/\nconst selectNodeBackward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"backward\", state) : $head.parentOffset > 0)\n return false;\n $cut = findCutBefore($head);\n }\n let node = $cut && $cut.nodeBefore;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView());\n return true;\n};\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0)\n return $pos.doc.resolve($pos.before(i + 1));\n if ($pos.node(i).type.spec.isolating)\n break;\n }\n return null;\n}\nfunction atBlockEnd(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and the cursor is at the end of a\ntextblock, try to reduce or remove the boundary between that block\nand the one after it, either by joining them or by moving the other\nblock closer to this one in the tree structure. Will use the view\nfor accurate start-of-textblock detection if given.\n*/\nconst joinForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n // If there is no node after this, there's nothing to do\n if (!$cut)\n return false;\n let after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, 1))\n return true;\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || NodeSelection.isSelectable(after))) {\n let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(after, \"start\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nWhen the selection is empty and at the end of a textblock, select\nthe node coming after that textblock, if possible. This is intended\nto be bound to keys like delete, after\n[`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward) and similar deleting\ncommands, to provide a fall-back behavior when the schema doesn't\nallow deletion at the selected point.\n*/\nconst selectNodeForward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"forward\", state) : $head.parentOffset < $head.parent.content.size)\n return false;\n $cut = findCutAfter($head);\n }\n let node = $cut && $cut.nodeAfter;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());\n return true;\n};\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n let parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount)\n return $pos.doc.resolve($pos.after(i + 1));\n if (parent.type.spec.isolating)\n break;\n }\n return null;\n}\n/**\nJoin the selected block or, if there is a text selection, the\nclosest ancestor block of the selection that can be joined, with\nthe sibling above it.\n*/\nconst joinUp = (state, dispatch) => {\n let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;\n if (nodeSel) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.from))\n return false;\n point = sel.from;\n }\n else {\n point = joinPoint(state.doc, sel.from, -1);\n if (point == null)\n return false;\n }\n if (dispatch) {\n let tr = state.tr.join(point);\n if (nodeSel)\n tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nJoin the selected block, or the closest ancestor of the selection\nthat can be joined, with the sibling after it.\n*/\nconst joinDown = (state, dispatch) => {\n let sel = state.selection, point;\n if (sel instanceof NodeSelection) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.to))\n return false;\n point = sel.to;\n }\n else {\n point = joinPoint(state.doc, sel.to, 1);\n if (point == null)\n return false;\n }\n if (dispatch)\n dispatch(state.tr.join(point).scrollIntoView());\n return true;\n};\n/**\nLift the selected block, or the closest ancestor block of the\nselection that can be lifted, out of its parent node.\n*/\nconst lift = (state, dispatch) => {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nIf the selection is in a node whose type has a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the\nselection with a newline character.\n*/\nconst newlineInCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n if (dispatch)\n dispatch(state.tr.insertText(\"\\n\").scrollIntoView());\n return true;\n};\nfunction defaultBlockAt(match) {\n for (let i = 0; i < match.edgeCount; i++) {\n let { type } = match.edge(i);\n if (type.isTextblock && !type.hasRequiredAttrs())\n return type;\n }\n return null;\n}\n/**\nWhen the selection is in a node with a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, create a\ndefault block after the code block, and move the cursor there.\n*/\nconst exitCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n let above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!type || !above.canReplaceWith(after, after, type))\n return false;\n if (dispatch) {\n let pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf a block node is selected, create an empty paragraph before (if\nit is its parent's first child) or after it.\n*/\nconst createParagraphNear = (state, dispatch) => {\n let sel = state.selection, { $from, $to } = sel;\n if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent)\n return false;\n let type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock)\n return false;\n if (dispatch) {\n let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n let tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(TextSelection.create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf the cursor is in an empty textblock that can be lifted, lift the\nblock.\n*/\nconst liftEmptyBlock = (state, dispatch) => {\n let { $cursor } = state.selection;\n if (!$cursor || $cursor.parent.content.size)\n return false;\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n let before = $cursor.before();\n if (canSplit(state.doc, before)) {\n if (dispatch)\n dispatch(state.tr.split(before).scrollIntoView());\n return true;\n }\n }\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nCreate a variant of [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock) that uses\na custom function to determine the type of the newly split off block.\n*/\nfunction splitBlockAs(splitNode) {\n return (state, dispatch) => {\n if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {\n let { $from } = state.selection;\n if (!$from.parentOffset || !canSplit(state.doc, $from.pos))\n return false;\n if (dispatch)\n dispatch(state.tr.split($from.pos).scrollIntoView());\n return true;\n }\n if (!state.selection.$from.depth)\n return false;\n let tr = state.tr;\n if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection))\n tr.deleteSelection();\n let { $from } = tr.selection, mapFrom = tr.steps.length;\n let types = [];\n let splitDepth, deflt, atEnd = false, atStart = false;\n for (let d = $from.depth;; d--) {\n let node = $from.node(d);\n if (node.isBlock) {\n atEnd = $from.end(d) == $from.pos + ($from.depth - d);\n atStart = $from.start(d) == $from.pos - ($from.depth - d);\n deflt = defaultBlockAt($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));\n let splitType = splitNode && splitNode($from.parent, atEnd, $from);\n types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));\n splitDepth = d;\n break;\n }\n else {\n if (d == 1)\n return false;\n types.unshift(null);\n }\n }\n let splitPos = $from.pos;\n let can = canSplit(tr.doc, splitPos, types.length, types);\n if (!can) {\n types[0] = deflt ? { type: deflt } : null;\n can = canSplit(tr.doc, splitPos, types.length, types);\n }\n if (!can)\n return false;\n tr.split(splitPos, types.length, types);\n if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {\n let mapping = tr.mapping.slice(mapFrom);\n let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);\n if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))\n tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);\n }\n if (dispatch)\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n/**\nSplit the parent block of the selection. If the selection is a text\nselection, also delete its content.\n*/\nconst splitBlock = splitBlockAs();\n/**\nActs like [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock), but without\nresetting the set of active marks at the cursor.\n*/\nconst splitBlockKeepMarks = (state, dispatch) => {\n return splitBlock(state, dispatch && (tr => {\n let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks)\n tr.ensureMarks(marks);\n dispatch(tr);\n }));\n};\n/**\nMove the selection to the node wrapping the current selection, if\nany. (Will not select the document node.)\n*/\nconst selectParentNode = (state, dispatch) => {\n let { $from, to } = state.selection, pos;\n let same = $from.sharedDepth(to);\n if (same == 0)\n return false;\n pos = $from.before(same);\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));\n return true;\n};\n/**\nSelect the whole document.\n*/\nconst selectAll = (state, dispatch) => {\n if (dispatch)\n dispatch(state.tr.setSelection(new AllSelection(state.doc)));\n return true;\n};\nfunction joinMaybeClear(state, $pos, dispatch) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type))\n return false;\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch)\n dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());\n return true;\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))\n return false;\n if (dispatch)\n dispatch(state.tr.join($pos.pos).scrollIntoView());\n return true;\n}\nfunction deleteBarrier(state, $cut, dispatch, dir) {\n let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n let isolated = before.type.spec.isolating || after.type.spec.isolating;\n if (!isolated && joinMaybeClear(state, $cut, dispatch))\n return true;\n let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);\n if (canDelAfter &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n let end = $cut.pos + after.nodeSize, wrap = Fragment.empty;\n for (let i = conn.length - 1; i >= 0; i--)\n wrap = Fragment.from(conn[i].create(null, wrap));\n wrap = Fragment.from(before.copy(wrap));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));\n let $joinAt = tr.doc.resolve(end + 2 * conn.length);\n if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type &&\n canJoin(tr.doc, $joinAt.pos))\n tr.join($joinAt.pos);\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection.findFrom($cut, 1);\n let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n if (canDelAfter && textblockAt(after, \"start\", true) && textblockAt(before, \"end\")) {\n let at = before, wrap = [];\n for (;;) {\n wrap.push(at);\n if (at.isTextblock)\n break;\n at = at.lastChild;\n }\n let afterText = after, afterDepth = 1;\n for (; !afterText.isTextblock; afterText = afterText.firstChild)\n afterDepth++;\n if (at.canReplace(at.childCount, at.childCount, afterText.content)) {\n if (dispatch) {\n let end = Fragment.empty;\n for (let i = wrap.length - 1; i >= 0; i--)\n end = Fragment.from(wrap[i].copy(end));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap.length, 0), 0, true));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n return false;\n}\nfunction selectTextblockSide(side) {\n return function (state, dispatch) {\n let sel = state.selection, $pos = side < 0 ? sel.$from : sel.$to;\n let depth = $pos.depth;\n while ($pos.node(depth).isInline) {\n if (!depth)\n return false;\n depth--;\n }\n if (!$pos.node(depth).isTextblock)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));\n return true;\n };\n}\n/**\nMoves the cursor to the start of current text block.\n*/\nconst selectTextblockStart = selectTextblockSide(-1);\n/**\nMoves the cursor to the end of current text block.\n*/\nconst selectTextblockEnd = selectTextblockSide(1);\n// Parameterized commands\n/**\nWrap the selection in a node of the given type with the given\nattributes.\n*/\nfunction wrapIn(nodeType, attrs = null) {\n return function (state, dispatch) {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping)\n return false;\n if (dispatch)\n dispatch(state.tr.wrap(range, wrapping).scrollIntoView());\n return true;\n };\n}\n/**\nReturns a command that tries to set the selected textblocks to the\ngiven node type with the given attributes.\n*/\nfunction setBlockType(nodeType, attrs = null) {\n return function (state, dispatch) {\n let applicable = false;\n for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (applicable)\n return false;\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs))\n return;\n if (node.type == nodeType) {\n applicable = true;\n }\n else {\n let $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n }\n if (!applicable)\n return false;\n if (dispatch) {\n let tr = state.tr;\n for (let i = 0; i < state.selection.ranges.length; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n tr.setBlockType(from, to, nodeType, attrs);\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\nfunction markApplies(doc, ranges, type, enterAtoms) {\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (can || !enterAtoms && node.isAtom && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos)\n return false;\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can)\n return true;\n }\n return false;\n}\nfunction removeInlineAtoms(ranges) {\n let result = [];\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n $from.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (node.isAtom && node.content.size && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos) {\n if (pos + 1 > $from.pos)\n result.push(new SelectionRange($from, $from.doc.resolve(pos + 1)));\n $from = $from.doc.resolve(pos + 1 + node.content.size);\n return false;\n }\n });\n if ($from.pos < $to.pos)\n result.push(new SelectionRange($from, $to));\n }\n return result;\n}\n/**\nCreate a command function that toggles the given mark with the\ngiven attributes. Will return `false` when the current selection\ndoesn't support that mark. This will remove the mark if any marks\nof that type exist in the selection, or add it otherwise. If the\nselection is empty, this applies to the [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the\ndocument.\n*/\nfunction toggleMark(markType, attrs = null, options) {\n let removeWhenPresent = (options && options.removeWhenPresent) !== false;\n let enterAtoms = (options && options.enterInlineAtoms) !== false;\n let dropSpace = !(options && options.includeWhitespace);\n return function (state, dispatch) {\n let { empty, $cursor, ranges } = state.selection;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType, enterAtoms))\n return false;\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n dispatch(state.tr.removeStoredMark(markType));\n else\n dispatch(state.tr.addStoredMark(markType.create(attrs)));\n }\n else {\n let add, tr = state.tr;\n if (!enterAtoms)\n ranges = removeInlineAtoms(ranges);\n if (removeWhenPresent) {\n add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));\n }\n else {\n add = !ranges.every(r => {\n let missing = false;\n tr.doc.nodesBetween(r.$from.pos, r.$to.pos, (node, pos, parent) => {\n if (missing)\n return false;\n missing = !markType.isInSet(node.marks) && !!parent && parent.type.allowsMarkType(markType) &&\n !(node.isText && /^\\s*$/.test(node.textBetween(Math.max(0, r.$from.pos - pos), Math.min(node.nodeSize, r.$to.pos - pos))));\n });\n return !missing;\n });\n }\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n if (!add) {\n tr.removeMark($from.pos, $to.pos, markType);\n }\n else {\n let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;\n let spaceStart = dropSpace && start && start.isText ? /^\\s*/.exec(start.text)[0].length : 0;\n let spaceEnd = dropSpace && end && end.isText ? /\\s*$/.exec(end.text)[0].length : 0;\n if (from + spaceStart < to) {\n from += spaceStart;\n to -= spaceEnd;\n }\n tr.addMark(from, to, markType.create(attrs));\n }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true;\n };\n}\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return (tr) => {\n if (!tr.isGeneric)\n return dispatch(tr);\n let ranges = [];\n for (let i = 0; i < tr.mapping.maps.length; i++) {\n let map = tr.mapping.maps[i];\n for (let j = 0; j < ranges.length; j++)\n ranges[j] = map.map(ranges[j]);\n map.forEach((_s, _e, from, to) => ranges.push(from, to));\n }\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n let joinable = [];\n for (let i = 0; i < ranges.length; i += 2) {\n let from = ranges[i], to = ranges[i + 1];\n let $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (let index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n let after = parent.maybeChild(index);\n if (!after)\n break;\n if (index && joinable.indexOf(pos) == -1) {\n let before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n joinable.push(pos);\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort((a, b) => a - b);\n for (let i = joinable.length - 1; i >= 0; i--) {\n if (canJoin(tr.doc, joinable[i]))\n tr.join(joinable[i]);\n }\n dispatch(tr);\n };\n}\n/**\nWrap a command so that, when it produces a transform that causes\ntwo joinable nodes to end up next to each other, those are joined.\nNodes are considered joinable when they are of the same type and\nwhen the `isJoinable` predicate returns true for them or, if an\narray of strings was passed, if their node type name is in that\narray.\n*/\nfunction autoJoin(command, isJoinable) {\n let canJoin = Array.isArray(isJoinable) ? (node) => isJoinable.indexOf(node.type.name) > -1\n : isJoinable;\n return (state, dispatch, view) => command(state, dispatch && wrapDispatchForJoin(dispatch, canJoin), view);\n}\n/**\nCombine a number of command functions into a single function (which\ncalls them one by one until one returns true).\n*/\nfunction chainCommands(...commands) {\n return function (state, dispatch, view) {\n for (let i = 0; i < commands.length; i++)\n if (commands[i](state, dispatch, view))\n return true;\n return false;\n };\n}\nlet backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nlet del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n/**\nA basic keymap containing bindings not specific to any schema.\nBinds the following keys (when multiple commands are listed, they\nare chained with [`chainCommands`](https://prosemirror.net/docs/ref/#commands.chainCommands)):\n\n* **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n* **Mod-Enter** to `exitCode`\n* **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n* **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-a** to `selectAll`\n*/\nconst pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Shift-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n/**\nA copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n**Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n**Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\nCtrl-Delete.\n*/\nconst macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"],\n \"Ctrl-a\": selectTextblockStart,\n \"Ctrl-e\": selectTextblockEnd\n};\nfor (let key in pcBaseKeymap)\n macBaseKeymap[key] = pcBaseKeymap[key];\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform)\n // @ts-ignore\n : typeof os != \"undefined\" && os.platform ? os.platform() == \"darwin\" : false;\n/**\nDepending on the detected platform, this will hold\n[`pcBasekeymap`](https://prosemirror.net/docs/ref/#commands.pcBaseKeymap) or\n[`macBaseKeymap`](https://prosemirror.net/docs/ref/#commands.macBaseKeymap).\n*/\nconst baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\nexport { autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinTextblockBackward, joinTextblockForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, setBlockType, splitBlock, splitBlockAs, splitBlockKeepMarks, toggleMark, wrapIn };\n"],"x_google_ignoreList":[0],"mappings":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AAM;MACtD,IAAa,EAAK,OAAO,eAAe,GAAO,IAAQ,GAAG,CAAQ;KACtE;;GACJ,CAAC;EACL;EACA,IAAI,CAAC,GACD,OAAO;EACX,IAAI,GAAU;GACV,IAAI,IAAK,EAAM;GACf,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,UAAU,OAAO,QAAQ,KAAK;IACpD,IAAI,EAAE,OAAO,EAAE,KAAK,KAAQ,KAAK,EAAE,KAAK,QAAS,EAAM,UAAU,OAAO;IACxE,EAAG,aAAa,GAAM,GAAI,GAAU,CAAK;GAC7C;GACA,EAAS,EAAG,eAAe,CAAC;EAChC;EACA,OAAO;CACX;AACJ;AAwJA,SAAS,EAAc,GAAG,GAAU;CAChC,OAAO,SAAU,GAAO,GAAU,GAAM;EACpC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAS,QAAQ,KACjC,IAAI,EAAS,EAAE,CAAC,GAAO,GAAU,CAAI,GACjC,OAAO;EACf,OAAO;CACX;AACJ;AACA,IAAI,IAAY,EAAc,GAAiB,GAAc,CAAkB,GAC3E,IAAM,EAAc,GAAiB,GAAa,CAAiB,GAajE,IAAe;CACjB,OAAS,EAAc,GAAe,GAAqB,GAAgB,CAAU;CACrF,aAAa;CACb,WAAa;CACb,iBAAiB;CACjB,mBAAmB;CACnB,QAAU;CACV,cAAc;CACd,SAAS;AACb,GAOM,IAAgB;CAClB,UAAU,EAAa;CACvB,iBAAiB,EAAa;CAC9B,UAAU,EAAa;CACvB,sBAAsB,EAAa;CACnC,cAAc,EAAa;CAC3B,SAAS,EAAa;CACtB,UAAU;CACV,UAAU;AACd;AACA,KAAK,IAAI,KAAO,GACZ,EAAc,KAAO,EAAa;AAC1B,OAAO,YAAa,MAAc,qBAAqB,KAAK,UAAU,QAAQ,IAEpF,OAAO,KAAM,OAAe,GAAG,YAAW,GAAG,SAAS"}
1
+ {"version":3,"file":"index.js","names":["deleteSelection","state","dispatch","atBlockStart","$cursor","view","joinBackward","$cut","findCutBefore","range","target","liftTarget","before","deleteBarrier","textblockAt","NodeSelection","depth","delStep","replaceStep","Slice","tr","Selection","joinTextblockBackward","joinTextblocksAround","joinTextblockForward","atBlockEnd","findCutAfter","beforeText","beforePos","child","afterText","afterPos","step","ReplaceStep","TextSelection","scan","node","side","only","selectNodeBackward","$head","empty","$pos","i","joinForward","after","selectNodeForward","parent","joinUp","sel","nodeSel","point","canJoin","joinPoint","joinDown","lift","$from","$to","newlineInCode","$anchor","defaultBlockAt","match","type","exitCode","above","pos","createParagraphNear","AllSelection","liftEmptyBlock","canSplit","splitBlockAs","mapFrom","types","splitDepth","deflt","atEnd","atStart","d","splitType","splitNode","splitPos","can","mapping","first","$first","splitBlock","selectParentNode","same","to","selectAll","joinMaybeClear","index","conn","isolated","canDelAfter","end","wrap","Fragment","ReplaceAroundStep","$joinAt","selAfter","dir","at","afterDepth","selectTextblockSide","selectTextblockStart","selectTextblockEnd","wrapIn","wrapping","findWrapping","nodeType","attrs","setBlockType","applicable","from","chainCommands","commands","backspace","del","pcBaseKeymap","\"Enter\"","\"Backspace\"","\"Delete\"","macBaseKeymap","key"],"sources":["../../../../node_modules/prosemirror-commands/dist/index.js"],"sourcesContent":["import { liftTarget, replaceStep, ReplaceStep, canJoin, joinPoint, canSplit, ReplaceAroundStep, findWrapping } from 'prosemirror-transform';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { NodeSelection, Selection, TextSelection, AllSelection, SelectionRange } from 'prosemirror-state';\n\n/**\nDelete the selection, if there is one.\n*/\nconst deleteSelection = (state, dispatch) => {\n if (state.selection.empty)\n return false;\n if (dispatch)\n dispatch(state.tr.deleteSelection().scrollIntoView());\n return true;\n};\nfunction atBlockStart(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and at the start of a textblock, try to\nreduce the distance between that block and the one before it—if\nthere's a block directly before it that can be joined, join them.\nIf not, try to move the selected block closer to the next one in\nthe document structure by lifting it out of its parent or moving it\ninto a parent of the previous block. Will use the view for accurate\n(bidi-aware) start-of-textblock detection if given.\n*/\nconst joinBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n // If there is no node before this, try to lift\n if (!$cut) {\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n let before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, -1))\n return true;\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || NodeSelection.isSelectable(before))) {\n for (let depth = $cursor.depth;; depth--) {\n let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(before, \"end\")\n ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n if (depth == 1 || $cursor.node(depth - 1).childCount > 1)\n break;\n }\n }\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nA more limited form of [`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward)\nthat only tries to join the current textblock to the one before\nit, if the cursor is at the start of a textblock.\n*/\nconst joinTextblockBackward = (state, dispatch, view) => {\n let $cursor = atBlockStart(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutBefore($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\n/**\nA more limited form of [`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward)\nthat only tries to join the current textblock to the one after\nit, if the cursor is at the end of a textblock.\n*/\nconst joinTextblockForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n return $cut ? joinTextblocksAround(state, $cut, dispatch) : false;\n};\nfunction joinTextblocksAround(state, $cut, dispatch) {\n let before = $cut.nodeBefore, beforeText = before, beforePos = $cut.pos - 1;\n for (; !beforeText.isTextblock; beforePos--) {\n if (beforeText.type.spec.isolating)\n return false;\n let child = beforeText.lastChild;\n if (!child)\n return false;\n beforeText = child;\n }\n let after = $cut.nodeAfter, afterText = after, afterPos = $cut.pos + 1;\n for (; !afterText.isTextblock; afterPos++) {\n if (afterText.type.spec.isolating)\n return false;\n let child = afterText.firstChild;\n if (!child)\n return false;\n afterText = child;\n }\n let step = replaceStep(state.doc, beforePos, afterPos, Slice.empty);\n if (!step || step.from != beforePos ||\n step instanceof ReplaceStep && step.slice.size >= afterPos - beforePos)\n return false;\n if (dispatch) {\n let tr = state.tr.step(step);\n tr.setSelection(TextSelection.create(tr.doc, beforePos));\n dispatch(tr.scrollIntoView());\n }\n return true;\n}\nfunction textblockAt(node, side, only = false) {\n for (let scan = node; scan; scan = (side == \"start\" ? scan.firstChild : scan.lastChild)) {\n if (scan.isTextblock)\n return true;\n if (only && scan.childCount != 1)\n return false;\n }\n return false;\n}\n/**\nWhen the selection is empty and at the start of a textblock, select\nthe node before that textblock, if possible. This is intended to be\nbound to keys like backspace, after\n[`joinBackward`](https://prosemirror.net/docs/ref/#commands.joinBackward) or other deleting\ncommands, as a fall-back behavior when the schema doesn't allow\ndeletion at the selected point.\n*/\nconst selectNodeBackward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"backward\", state) : $head.parentOffset > 0)\n return false;\n $cut = findCutBefore($head);\n }\n let node = $cut && $cut.nodeBefore;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView());\n return true;\n};\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0)\n return $pos.doc.resolve($pos.before(i + 1));\n if ($pos.node(i).type.spec.isolating)\n break;\n }\n return null;\n}\nfunction atBlockEnd(state, view) {\n let { $cursor } = state.selection;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n return null;\n return $cursor;\n}\n/**\nIf the selection is empty and the cursor is at the end of a\ntextblock, try to reduce or remove the boundary between that block\nand the one after it, either by joining them or by moving the other\nblock closer to this one in the tree structure. Will use the view\nfor accurate start-of-textblock detection if given.\n*/\nconst joinForward = (state, dispatch, view) => {\n let $cursor = atBlockEnd(state, view);\n if (!$cursor)\n return false;\n let $cut = findCutAfter($cursor);\n // If there is no node after this, there's nothing to do\n if (!$cut)\n return false;\n let after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch, 1))\n return true;\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || NodeSelection.isSelectable(after))) {\n let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);\n if (delStep && delStep.slice.size < delStep.to - delStep.from) {\n if (dispatch) {\n let tr = state.tr.step(delStep);\n tr.setSelection(textblockAt(after, \"start\") ? Selection.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : NodeSelection.create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch)\n dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView());\n return true;\n }\n return false;\n};\n/**\nWhen the selection is empty and at the end of a textblock, select\nthe node coming after that textblock, if possible. This is intended\nto be bound to keys like delete, after\n[`joinForward`](https://prosemirror.net/docs/ref/#commands.joinForward) and similar deleting\ncommands, to provide a fall-back behavior when the schema doesn't\nallow deletion at the selected point.\n*/\nconst selectNodeForward = (state, dispatch, view) => {\n let { $head, empty } = state.selection, $cut = $head;\n if (!empty)\n return false;\n if ($head.parent.isTextblock) {\n if (view ? !view.endOfTextblock(\"forward\", state) : $head.parentOffset < $head.parent.content.size)\n return false;\n $cut = findCutAfter($head);\n }\n let node = $cut && $cut.nodeAfter;\n if (!node || !NodeSelection.isSelectable(node))\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, $cut.pos)).scrollIntoView());\n return true;\n};\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating)\n for (let i = $pos.depth - 1; i >= 0; i--) {\n let parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount)\n return $pos.doc.resolve($pos.after(i + 1));\n if (parent.type.spec.isolating)\n break;\n }\n return null;\n}\n/**\nJoin the selected block or, if there is a text selection, the\nclosest ancestor block of the selection that can be joined, with\nthe sibling above it.\n*/\nconst joinUp = (state, dispatch) => {\n let sel = state.selection, nodeSel = sel instanceof NodeSelection, point;\n if (nodeSel) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.from))\n return false;\n point = sel.from;\n }\n else {\n point = joinPoint(state.doc, sel.from, -1);\n if (point == null)\n return false;\n }\n if (dispatch) {\n let tr = state.tr.join(point);\n if (nodeSel)\n tr.setSelection(NodeSelection.create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nJoin the selected block, or the closest ancestor of the selection\nthat can be joined, with the sibling after it.\n*/\nconst joinDown = (state, dispatch) => {\n let sel = state.selection, point;\n if (sel instanceof NodeSelection) {\n if (sel.node.isTextblock || !canJoin(state.doc, sel.to))\n return false;\n point = sel.to;\n }\n else {\n point = joinPoint(state.doc, sel.to, 1);\n if (point == null)\n return false;\n }\n if (dispatch)\n dispatch(state.tr.join(point).scrollIntoView());\n return true;\n};\n/**\nLift the selected block, or the closest ancestor block of the\nselection that can be lifted, out of its parent node.\n*/\nconst lift = (state, dispatch) => {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nIf the selection is in a node whose type has a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, replace the\nselection with a newline character.\n*/\nconst newlineInCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n if (dispatch)\n dispatch(state.tr.insertText(\"\\n\").scrollIntoView());\n return true;\n};\nfunction defaultBlockAt(match) {\n for (let i = 0; i < match.edgeCount; i++) {\n let { type } = match.edge(i);\n if (type.isTextblock && !type.hasRequiredAttrs())\n return type;\n }\n return null;\n}\n/**\nWhen the selection is in a node with a truthy\n[`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) property in its spec, create a\ndefault block after the code block, and move the cursor there.\n*/\nconst exitCode = (state, dispatch) => {\n let { $head, $anchor } = state.selection;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor))\n return false;\n let above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!type || !above.canReplaceWith(after, after, type))\n return false;\n if (dispatch) {\n let pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(Selection.near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf a block node is selected, create an empty paragraph before (if\nit is its parent's first child) or after it.\n*/\nconst createParagraphNear = (state, dispatch) => {\n let sel = state.selection, { $from, $to } = sel;\n if (sel instanceof AllSelection || $from.parent.inlineContent || $to.parent.inlineContent)\n return false;\n let type = defaultBlockAt($to.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock)\n return false;\n if (dispatch) {\n let side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n let tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(TextSelection.create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true;\n};\n/**\nIf the cursor is in an empty textblock that can be lifted, lift the\nblock.\n*/\nconst liftEmptyBlock = (state, dispatch) => {\n let { $cursor } = state.selection;\n if (!$cursor || $cursor.parent.content.size)\n return false;\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n let before = $cursor.before();\n if (canSplit(state.doc, before)) {\n if (dispatch)\n dispatch(state.tr.split(before).scrollIntoView());\n return true;\n }\n }\n let range = $cursor.blockRange(), target = range && liftTarget(range);\n if (target == null)\n return false;\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n};\n/**\nCreate a variant of [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock) that uses\na custom function to determine the type of the newly split off block.\n*/\nfunction splitBlockAs(splitNode) {\n return (state, dispatch) => {\n if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {\n let { $from } = state.selection;\n if (!$from.parentOffset || !canSplit(state.doc, $from.pos))\n return false;\n if (dispatch)\n dispatch(state.tr.split($from.pos).scrollIntoView());\n return true;\n }\n if (!state.selection.$from.depth)\n return false;\n let tr = state.tr;\n if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection))\n tr.deleteSelection();\n let { $from } = tr.selection, mapFrom = tr.steps.length;\n let types = [];\n let splitDepth, deflt, atEnd = false, atStart = false;\n for (let d = $from.depth;; d--) {\n let node = $from.node(d);\n if (node.isBlock) {\n atEnd = $from.end(d) == $from.pos + ($from.depth - d);\n atStart = $from.start(d) == $from.pos - ($from.depth - d);\n deflt = defaultBlockAt($from.node(d - 1).contentMatchAt($from.indexAfter(d - 1)));\n let splitType = splitNode && splitNode($from.parent, atEnd, $from);\n types.unshift(splitType || (atEnd && deflt ? { type: deflt } : null));\n splitDepth = d;\n break;\n }\n else {\n if (d == 1)\n return false;\n types.unshift(null);\n }\n }\n let splitPos = $from.pos;\n let can = canSplit(tr.doc, splitPos, types.length, types);\n if (!can) {\n types[0] = deflt ? { type: deflt } : null;\n can = canSplit(tr.doc, splitPos, types.length, types);\n }\n if (!can)\n return false;\n tr.split(splitPos, types.length, types);\n if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {\n let mapping = tr.mapping.slice(mapFrom);\n let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);\n if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))\n tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);\n }\n if (dispatch)\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n/**\nSplit the parent block of the selection. If the selection is a text\nselection, also delete its content.\n*/\nconst splitBlock = splitBlockAs();\n/**\nActs like [`splitBlock`](https://prosemirror.net/docs/ref/#commands.splitBlock), but without\nresetting the set of active marks at the cursor.\n*/\nconst splitBlockKeepMarks = (state, dispatch) => {\n return splitBlock(state, dispatch && (tr => {\n let marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks)\n tr.ensureMarks(marks);\n dispatch(tr);\n }));\n};\n/**\nMove the selection to the node wrapping the current selection, if\nany. (Will not select the document node.)\n*/\nconst selectParentNode = (state, dispatch) => {\n let { $from, to } = state.selection, pos;\n let same = $from.sharedDepth(to);\n if (same == 0)\n return false;\n pos = $from.before(same);\n if (dispatch)\n dispatch(state.tr.setSelection(NodeSelection.create(state.doc, pos)));\n return true;\n};\n/**\nSelect the whole document.\n*/\nconst selectAll = (state, dispatch) => {\n if (dispatch)\n dispatch(state.tr.setSelection(new AllSelection(state.doc)));\n return true;\n};\nfunction joinMaybeClear(state, $pos, dispatch) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type))\n return false;\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch)\n dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView());\n return true;\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || canJoin(state.doc, $pos.pos)))\n return false;\n if (dispatch)\n dispatch(state.tr.join($pos.pos).scrollIntoView());\n return true;\n}\nfunction deleteBarrier(state, $cut, dispatch, dir) {\n let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n let isolated = before.type.spec.isolating || after.type.spec.isolating;\n if (!isolated && joinMaybeClear(state, $cut, dispatch))\n return true;\n let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);\n if (canDelAfter &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n let end = $cut.pos + after.nodeSize, wrap = Fragment.empty;\n for (let i = conn.length - 1; i >= 0; i--)\n wrap = Fragment.from(conn[i].create(null, wrap));\n wrap = Fragment.from(before.copy(wrap));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap, 1, 0), conn.length, true));\n let $joinAt = tr.doc.resolve(end + 2 * conn.length);\n if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type &&\n canJoin(tr.doc, $joinAt.pos))\n tr.join($joinAt.pos);\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection.findFrom($cut, 1);\n let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch)\n dispatch(state.tr.lift(range, target).scrollIntoView());\n return true;\n }\n if (canDelAfter && textblockAt(after, \"start\", true) && textblockAt(before, \"end\")) {\n let at = before, wrap = [];\n for (;;) {\n wrap.push(at);\n if (at.isTextblock)\n break;\n at = at.lastChild;\n }\n let afterText = after, afterDepth = 1;\n for (; !afterText.isTextblock; afterText = afterText.firstChild)\n afterDepth++;\n if (at.canReplace(at.childCount, at.childCount, afterText.content)) {\n if (dispatch) {\n let end = Fragment.empty;\n for (let i = wrap.length - 1; i >= 0; i--)\n end = Fragment.from(wrap[i].copy(end));\n let tr = state.tr.step(new ReplaceAroundStep($cut.pos - wrap.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap.length, 0), 0, true));\n dispatch(tr.scrollIntoView());\n }\n return true;\n }\n }\n return false;\n}\nfunction selectTextblockSide(side) {\n return function (state, dispatch) {\n let sel = state.selection, $pos = side < 0 ? sel.$from : sel.$to;\n let depth = $pos.depth;\n while ($pos.node(depth).isInline) {\n if (!depth)\n return false;\n depth--;\n }\n if (!$pos.node(depth).isTextblock)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(TextSelection.create(state.doc, side < 0 ? $pos.start(depth) : $pos.end(depth))));\n return true;\n };\n}\n/**\nMoves the cursor to the start of current text block.\n*/\nconst selectTextblockStart = selectTextblockSide(-1);\n/**\nMoves the cursor to the end of current text block.\n*/\nconst selectTextblockEnd = selectTextblockSide(1);\n// Parameterized commands\n/**\nWrap the selection in a node of the given type with the given\nattributes.\n*/\nfunction wrapIn(nodeType, attrs = null) {\n return function (state, dispatch) {\n let { $from, $to } = state.selection;\n let range = $from.blockRange($to), wrapping = range && findWrapping(range, nodeType, attrs);\n if (!wrapping)\n return false;\n if (dispatch)\n dispatch(state.tr.wrap(range, wrapping).scrollIntoView());\n return true;\n };\n}\n/**\nReturns a command that tries to set the selected textblocks to the\ngiven node type with the given attributes.\n*/\nfunction setBlockType(nodeType, attrs = null) {\n return function (state, dispatch) {\n let applicable = false;\n for (let i = 0; i < state.selection.ranges.length && !applicable; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (applicable)\n return false;\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs))\n return;\n if (node.type == nodeType) {\n applicable = true;\n }\n else {\n let $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n }\n if (!applicable)\n return false;\n if (dispatch) {\n let tr = state.tr;\n for (let i = 0; i < state.selection.ranges.length; i++) {\n let { $from: { pos: from }, $to: { pos: to } } = state.selection.ranges[i];\n tr.setBlockType(from, to, nodeType, attrs);\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\nfunction markApplies(doc, ranges, type, enterAtoms) {\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n let can = $from.depth == 0 ? doc.inlineContent && doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (can || !enterAtoms && node.isAtom && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos)\n return false;\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can)\n return true;\n }\n return false;\n}\nfunction removeInlineAtoms(ranges) {\n let result = [];\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n $from.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (node.isAtom && node.content.size && node.isInline && pos >= $from.pos && pos + node.nodeSize <= $to.pos) {\n if (pos + 1 > $from.pos)\n result.push(new SelectionRange($from, $from.doc.resolve(pos + 1)));\n $from = $from.doc.resolve(pos + 1 + node.content.size);\n return false;\n }\n });\n if ($from.pos < $to.pos)\n result.push(new SelectionRange($from, $to));\n }\n return result;\n}\n/**\nCreate a command function that toggles the given mark with the\ngiven attributes. Will return `false` when the current selection\ndoesn't support that mark. This will remove the mark if any marks\nof that type exist in the selection, or add it otherwise. If the\nselection is empty, this applies to the [stored\nmarks](https://prosemirror.net/docs/ref/#state.EditorState.storedMarks) instead of a range of the\ndocument.\n*/\nfunction toggleMark(markType, attrs = null, options) {\n let removeWhenPresent = (options && options.removeWhenPresent) !== false;\n let enterAtoms = (options && options.enterInlineAtoms) !== false;\n let dropSpace = !(options && options.includeWhitespace);\n return function (state, dispatch) {\n let { empty, $cursor, ranges } = state.selection;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType, enterAtoms))\n return false;\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n dispatch(state.tr.removeStoredMark(markType));\n else\n dispatch(state.tr.addStoredMark(markType.create(attrs)));\n }\n else {\n let add, tr = state.tr;\n if (!enterAtoms)\n ranges = removeInlineAtoms(ranges);\n if (removeWhenPresent) {\n add = !ranges.some(r => state.doc.rangeHasMark(r.$from.pos, r.$to.pos, markType));\n }\n else {\n add = !ranges.every(r => {\n let missing = false;\n tr.doc.nodesBetween(r.$from.pos, r.$to.pos, (node, pos, parent) => {\n if (missing)\n return false;\n missing = !markType.isInSet(node.marks) && !!parent && parent.type.allowsMarkType(markType) &&\n !(node.isText && /^\\s*$/.test(node.textBetween(Math.max(0, r.$from.pos - pos), Math.min(node.nodeSize, r.$to.pos - pos))));\n });\n return !missing;\n });\n }\n for (let i = 0; i < ranges.length; i++) {\n let { $from, $to } = ranges[i];\n if (!add) {\n tr.removeMark($from.pos, $to.pos, markType);\n }\n else {\n let from = $from.pos, to = $to.pos, start = $from.nodeAfter, end = $to.nodeBefore;\n let spaceStart = dropSpace && start && start.isText ? /^\\s*/.exec(start.text)[0].length : 0;\n let spaceEnd = dropSpace && end && end.isText ? /\\s*$/.exec(end.text)[0].length : 0;\n if (from + spaceStart < to) {\n from += spaceStart;\n to -= spaceEnd;\n }\n tr.addMark(from, to, markType.create(attrs));\n }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true;\n };\n}\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return (tr) => {\n if (!tr.isGeneric)\n return dispatch(tr);\n let ranges = [];\n for (let i = 0; i < tr.mapping.maps.length; i++) {\n let map = tr.mapping.maps[i];\n for (let j = 0; j < ranges.length; j++)\n ranges[j] = map.map(ranges[j]);\n map.forEach((_s, _e, from, to) => ranges.push(from, to));\n }\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n let joinable = [];\n for (let i = 0; i < ranges.length; i += 2) {\n let from = ranges[i], to = ranges[i + 1];\n let $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (let index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n let after = parent.maybeChild(index);\n if (!after)\n break;\n if (index && joinable.indexOf(pos) == -1) {\n let before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n joinable.push(pos);\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort((a, b) => a - b);\n for (let i = joinable.length - 1; i >= 0; i--) {\n if (canJoin(tr.doc, joinable[i]))\n tr.join(joinable[i]);\n }\n dispatch(tr);\n };\n}\n/**\nWrap a command so that, when it produces a transform that causes\ntwo joinable nodes to end up next to each other, those are joined.\nNodes are considered joinable when they are of the same type and\nwhen the `isJoinable` predicate returns true for them or, if an\narray of strings was passed, if their node type name is in that\narray.\n*/\nfunction autoJoin(command, isJoinable) {\n let canJoin = Array.isArray(isJoinable) ? (node) => isJoinable.indexOf(node.type.name) > -1\n : isJoinable;\n return (state, dispatch, view) => command(state, dispatch && wrapDispatchForJoin(dispatch, canJoin), view);\n}\n/**\nCombine a number of command functions into a single function (which\ncalls them one by one until one returns true).\n*/\nfunction chainCommands(...commands) {\n return function (state, dispatch, view) {\n for (let i = 0; i < commands.length; i++)\n if (commands[i](state, dispatch, view))\n return true;\n return false;\n };\n}\nlet backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nlet del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n/**\nA basic keymap containing bindings not specific to any schema.\nBinds the following keys (when multiple commands are listed, they\nare chained with [`chainCommands`](https://prosemirror.net/docs/ref/#commands.chainCommands)):\n\n* **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n* **Mod-Enter** to `exitCode`\n* **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n* **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n* **Mod-a** to `selectAll`\n*/\nconst pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Shift-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n/**\nA copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n**Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n**Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\nCtrl-Delete.\n*/\nconst macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"],\n \"Ctrl-a\": selectTextblockStart,\n \"Ctrl-e\": selectTextblockEnd\n};\nfor (let key in pcBaseKeymap)\n macBaseKeymap[key] = pcBaseKeymap[key];\nconst mac = typeof navigator != \"undefined\" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform)\n // @ts-ignore\n : typeof os != \"undefined\" && os.platform ? os.platform() == \"darwin\" : false;\n/**\nDepending on the detected platform, this will hold\n[`pcBasekeymap`](https://prosemirror.net/docs/ref/#commands.pcBaseKeymap) or\n[`macBaseKeymap`](https://prosemirror.net/docs/ref/#commands.macBaseKeymap).\n*/\nconst baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\nexport { autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinTextblockBackward, joinTextblockForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, setBlockType, splitBlock, splitBlockAs, splitBlockKeepMarks, toggleMark, wrapIn };\n"],"ignoreList":[0],"mappings":";;;;AAOA,IAAMA,KAAmB,GAAO,MAC5B,CAAIC,EAAM,UAAU,UAEhBC,KACAA,EAASD,EAAM,GAAG,gBAAgB,CAAC,CAAC,eAAe,CAAC,GACjD;AAEX,SAASE,EAAa,GAAO,GAAM;CAC/B,IAAI,EAAE,eAAYF,EAAM;CAIxB,OAHI,CAACG,MAAYC,IAAO,CAACA,EAAK,eAAe,YAAYJ,CAAK,IACxDG,EAAQ,eAAe,KAClB,OACJA;AACX;AAUA,IAAME,KAAgB,GAAO,GAAU,MAAS;CAC5C,IAAIF,IAAUD,EAAaF,GAAOI,CAAI;CACtC,IAAI,CAACD,GACD,OAAO;CACX,IAAIG,IAAOC,EAAcJ,CAAO;CAEhC,IAAI,CAACG,GAAM;EACP,IAAIE,IAAQL,EAAQ,WAAW,GAAGM,IAASD,KAASE,EAAWF,CAAK;EAKpE,OAJIC,KAAU,SAEVR,KACAA,EAASD,EAAM,GAAG,KAAKQ,GAAOC,CAAM,CAAC,CAAC,eAAe,CAAC,GACnD;CACX;CACA,IAAIE,IAASL,EAAK;CAElB,IAAIM,EAAcZ,GAAOM,GAAML,GAAU,EAAE,GACvC,OAAO;CAGX,IAAIE,EAAQ,OAAO,QAAQ,QAAQ,MAC9BU,EAAYF,GAAQ,KAAK,KAAKG,EAAc,aAAaH,CAAM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CACjBC,OAASL,EAAczD,GAAeQ,GAAqBE,GAAgBiB,CAAU;CACrF,aAAatB;CACb0D,WAAaJ;CACb,iBAAiBA;CACjB,mBAAmBA;CACnBK,QAAUJ;CACV,cAAcA;CACd,SAAS7B;AACb,GAOMkC,IAAgB;CAClB,UAAUJ,EAAaE;CACvB,iBAAiBF,EAAa;CAC9B,UAAUA,EAAaG;CACvB,sBAAsBH,EAAa;CACnC,cAAcA,EAAa;CAC3B,SAASA,EAAa;CACtB,UAAUd;CACV,UAAUC;AACd;AACA,KAAK,IAAIkB,KAAOL,GACZ,EAAcK,KAAOL,EAAaK;AAC1B,OAAO,YAAa,MAAc,qBAAqB,KAAK,UAAU,QAAQ,IAEpF,OAAO,KAAM,OAAe,GAAG,YAAW,GAAG,SAAS"}
@@ -1,9 +1,9 @@
1
- import { dropPoint as e } from "../../prosemirror-transform/dist/index.js";
2
- import { Plugin as t } from "../../prosemirror-state/dist/index.js";
3
- //#region node_modules/prosemirror-dropcursor/dist/index.js
4
- function n(e = {}) {
5
- return new t({ view(t) {
6
- return new r(t, e);
1
+ import { Plugin as e } from "../../prosemirror-state/dist/index.js";
2
+ import { dropPoint as t } from "../../prosemirror-transform/dist/index.js";
3
+ // node_modules/prosemirror-dropcursor/dist/index.js
4
+ function n(t = {}) {
5
+ return new e({ view(e) {
6
+ return new r(e, t);
7
7
  } });
8
8
  }
9
9
  var r = class {
@@ -78,16 +78,16 @@ var r = class {
78
78
  scheduleRemoval(e) {
79
79
  clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
80
80
  }
81
- computeTarget(t) {
81
+ computeTarget(e) {
82
82
  let n = this.editorView.posAtCoords({
83
- left: t.clientX,
84
- top: t.clientY
85
- }), r = n && n.inside >= 0 && this.editorView.state.doc.nodeAt(n.inside), i = r && r.type.spec.disableDropCursor, a = typeof i == "function" ? i(this.editorView, n, t) : i;
83
+ left: e.clientX,
84
+ top: e.clientY
85
+ }), r = n && n.inside >= 0 && this.editorView.state.doc.nodeAt(n.inside), i = r && r.type.spec.disableDropCursor, a = typeof i == "function" ? i(this.editorView, n, e) : i;
86
86
  if (!n || a) return null;
87
87
  let o = n.pos;
88
88
  if (this.editorView.dragging && this.editorView.dragging.slice) {
89
- let t = e(this.editorView.state.doc, o, this.editorView.dragging.slice);
90
- t != null && (o = t);
89
+ let e = t(this.editorView.state.doc, o, this.editorView.dragging.slice);
90
+ e != null && (o = e);
91
91
  }
92
92
  return o;
93
93
  }
@@ -107,7 +107,6 @@ var r = class {
107
107
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
108
108
  }
109
109
  };
110
- //#endregion
111
110
  export { n as dropCursor };
112
111
 
113
112
  //# sourceMappingURL=index.js.map