@burdenoff/microfe-support 2026.1029.2 → 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 (260) 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.d.ts +8 -0
  180. package/dist/support/hooks/useTicketOperations.js +92 -93
  181. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  182. package/dist/support/hooks/useTr.js +1 -2
  183. package/dist/support/hooks/useTr.js.map +1 -1
  184. package/dist/support/index.js +4 -4
  185. package/dist/support/pages/AnalyticsPage.js +34 -35
  186. package/dist/support/pages/AnalyticsPage.js.map +1 -1
  187. package/dist/support/pages/ArticleDetailAdminPage.js +33 -38
  188. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
  189. package/dist/support/pages/ArticleDetailUserPage.js +22 -23
  190. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
  191. package/dist/support/pages/ContactInquiriesPage.js +5 -6
  192. package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
  193. package/dist/support/pages/ContactInquiryDetailPage.js +13 -14
  194. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
  195. package/dist/support/pages/CreateArticlePage.js +15 -16
  196. package/dist/support/pages/CreateArticlePage.js.map +1 -1
  197. package/dist/support/pages/CreateTicketPage.js +37 -44
  198. package/dist/support/pages/CreateTicketPage.js.map +1 -1
  199. package/dist/support/pages/EditArticlePage.js +20 -21
  200. package/dist/support/pages/EditArticlePage.js.map +1 -1
  201. package/dist/support/pages/InterviewersPage.js +121 -122
  202. package/dist/support/pages/InterviewersPage.js.map +1 -1
  203. package/dist/support/pages/JobApplicationDetailPage.js +322 -332
  204. package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
  205. package/dist/support/pages/JobApplicationsPage.js +556 -561
  206. package/dist/support/pages/JobApplicationsPage.js.map +1 -1
  207. package/dist/support/pages/JobPostingDetailPage.js +489 -490
  208. package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
  209. package/dist/support/pages/JobPostingsPage.js +279 -280
  210. package/dist/support/pages/JobPostingsPage.js.map +1 -1
  211. package/dist/support/pages/KnowledgeBaseAdminPage.js +26 -27
  212. package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
  213. package/dist/support/pages/KnowledgeBaseUserPage.js +23 -24
  214. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
  215. package/dist/support/pages/SettingsPage.js +43 -44
  216. package/dist/support/pages/SettingsPage.js.map +1 -1
  217. package/dist/support/pages/TicketDetailAdminPage.js +54 -55
  218. package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
  219. package/dist/support/pages/TicketDetailUserPage.js +61 -62
  220. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  221. package/dist/support/pages/TicketListPage.js +77 -78
  222. package/dist/support/pages/TicketListPage.js.map +1 -1
  223. package/dist/support/providers/SupportProvider.js +1 -2
  224. package/dist/support/providers/SupportProvider.js.map +1 -1
  225. package/dist/support/store/supportStore.js +1 -2
  226. package/dist/support/store/supportStore.js.map +1 -1
  227. package/dist/support/translations/en.js +1 -2
  228. package/dist/support/translations/en.js.map +1 -1
  229. package/dist/support/utils/attachments.js +1 -2
  230. package/dist/support/utils/attachments.js.map +1 -1
  231. package/dist/support/utils/breadcrumbRegistry.js +3 -4
  232. package/dist/support/utils/breadcrumbRegistry.js.map +1 -1
  233. package/dist/support/utils/bulkCandidateOperations.js +0 -1
  234. package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
  235. package/dist/support/utils/bulkCandidateTargetQuery.js +1 -2
  236. package/dist/support/utils/bulkCandidateTargetQuery.js.map +1 -1
  237. package/dist/support/utils/categoryColors.js +1 -2
  238. package/dist/support/utils/categoryColors.js.map +1 -1
  239. package/dist/support/utils/cn.js +1 -2
  240. package/dist/support/utils/cn.js.map +1 -1
  241. package/dist/support/utils/context.js +3 -4
  242. package/dist/support/utils/context.js.map +1 -1
  243. package/dist/support/utils/errors.js +1 -2
  244. package/dist/support/utils/errors.js.map +1 -1
  245. package/dist/support/utils/i18n.js +1 -2
  246. package/dist/support/utils/i18n.js.map +1 -1
  247. package/dist/support/utils/index.js +1 -2
  248. package/dist/support/utils/index.js.map +1 -1
  249. package/dist/support/utils/jobApplicationFilterParams.js +1 -2
  250. package/dist/support/utils/jobApplicationFilterParams.js.map +1 -1
  251. package/dist/support/utils/markdown.js +1 -2
  252. package/dist/support/utils/markdown.js.map +1 -1
  253. package/dist/support/utils/supportFiles.js +2 -11
  254. package/dist/support/utils/supportFiles.js.map +1 -1
  255. package/dist/support/utils/ticketFilters.js +1 -2
  256. package/dist/support/utils/ticketFilters.js.map +1 -1
  257. package/dist/support/utils/uiTokens.js +1 -2
  258. package/dist/support/utils/uiTokens.js.map +1 -1
  259. package/dist/utils/nativeBridge.js +1 -2
  260. package/package.json +21 -14
@@ -1,10 +1,10 @@
1
- import { Plugin as e, PluginKey as t } from "../../../prosemirror-state/dist/index.js";
2
- import { Decoration as n, DecorationSet as r } from "../../../prosemirror-view/dist/index.js";
3
- import { Extension as i, callOrReturn as a, getChangedRanges as o, getExtensionField as s, isNodeEmpty as c, isNodeSelection as l } from "../../core/dist/index.js";
4
- import { dropCursor as u } from "../../../prosemirror-dropcursor/dist/index.js";
1
+ import { Extension as e, callOrReturn as t, getChangedRanges as n, getExtensionField as r, isNodeEmpty as i, isNodeSelection as a } from "../../core/dist/index.js";
2
+ import { Plugin as o, PluginKey as s } from "../../../prosemirror-state/dist/index.js";
3
+ import { dropCursor as c } from "../../../prosemirror-dropcursor/dist/index.js";
4
+ import { Decoration as l, DecorationSet as u } from "../../../prosemirror-view/dist/index.js";
5
5
  import { gapCursor as d } from "../../../prosemirror-gapcursor/dist/index.js";
6
6
  import { history as f, redo as p, undo as m } from "../../../prosemirror-history/dist/index.js";
7
- i.create({
7
+ e.create({
8
8
  name: "characterCount",
9
9
  addOptions() {
10
10
  return {
@@ -35,24 +35,24 @@ i.create({
35
35
  };
36
36
  },
37
37
  addProseMirrorPlugins() {
38
- let n = !1;
39
- return [new e({
40
- key: new t("characterCount"),
41
- appendTransaction: (e, t, r) => {
42
- if (n) return;
38
+ let e = !1;
39
+ return [new o({
40
+ key: new s("characterCount"),
41
+ appendTransaction: (t, n, r) => {
42
+ if (e) return;
43
43
  let i = this.options.limit, a = this.options.autoTrim;
44
44
  if (i == null || i === 0 || a === !1) {
45
- n = !0;
45
+ e = !0;
46
46
  return;
47
47
  }
48
48
  let o = this.storage.characters({ node: r.doc });
49
49
  if (o > i) {
50
- let e = o - i;
50
+ let t = o - i;
51
51
  console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);
52
- let t = r.tr.deleteRange(0, e);
53
- return n = !0, t;
52
+ let n = r.tr.deleteRange(0, t);
53
+ return e = !0, n;
54
54
  }
55
- n = !0;
55
+ e = !0;
56
56
  },
57
57
  filterTransaction: (e, t) => {
58
58
  let n = this.options.limit;
@@ -66,7 +66,7 @@ i.create({
66
66
  })];
67
67
  }
68
68
  });
69
- var h = i.create({
69
+ var h = e.create({
70
70
  name: "dropCursor",
71
71
  addOptions() {
72
72
  return {
@@ -76,10 +76,10 @@ var h = i.create({
76
76
  };
77
77
  },
78
78
  addProseMirrorPlugins() {
79
- return [u(this.options)];
79
+ return [c(this.options)];
80
80
  }
81
81
  });
82
- i.create({
82
+ e.create({
83
83
  name: "focus",
84
84
  addOptions() {
85
85
  return {
@@ -88,91 +88,91 @@ i.create({
88
88
  };
89
89
  },
90
90
  addProseMirrorPlugins() {
91
- return [new e({
92
- key: new t("focus"),
91
+ return [new o({
92
+ key: new s("focus"),
93
93
  props: { decorations: ({ doc: e, selection: t }) => {
94
- let { isEditable: i, isFocused: a } = this.editor, { anchor: o } = t, s = [];
95
- if (!i || !a) return r.create(e, []);
96
- let c = 0;
94
+ let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
95
+ if (!n || !r) return u.create(e, []);
96
+ let o = 0;
97
97
  this.options.mode === "deepest" && e.descendants((e, t) => {
98
98
  if (!e.isText) {
99
- if (!(o >= t && o <= t + e.nodeSize - 1)) return !1;
100
- c += 1;
99
+ if (!(i >= t && i <= t + e.nodeSize - 1)) return !1;
100
+ o += 1;
101
101
  }
102
102
  });
103
- let l = 0;
103
+ let s = 0;
104
104
  return e.descendants((e, t) => {
105
- if (e.isText || !(o >= t && o <= t + e.nodeSize - 1)) return !1;
106
- if (l += 1, this.options.mode === "deepest" && c - l > 0 || this.options.mode === "shallowest" && l > 1) return this.options.mode === "deepest";
107
- s.push(n.node(t, t + e.nodeSize, { class: this.options.className }));
108
- }), r.create(e, s);
105
+ if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
106
+ if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
107
+ a.push(l.node(t, t + e.nodeSize, { class: this.options.className }));
108
+ }), u.create(e, a);
109
109
  } }
110
110
  })];
111
111
  }
112
112
  });
113
- var g = i.create({
113
+ var g = e.create({
114
114
  name: "gapCursor",
115
115
  addProseMirrorPlugins() {
116
116
  return [d()];
117
117
  },
118
118
  extendNodeSchema(e) {
119
- let t = {
119
+ let n = {
120
120
  name: e.name,
121
121
  options: e.options,
122
122
  storage: e.storage
123
123
  };
124
- return { allowGapCursor: a(s(e, "allowGapCursor", t)) ?? null };
124
+ return { allowGapCursor: t(r(e, "allowGapCursor", n)) ?? null };
125
125
  }
126
- }), _ = "placeholder", v = new t("tiptap__placeholder");
126
+ }), _ = "placeholder", v = new s("tiptap__placeholder");
127
127
  function y(e) {
128
- let { editor: t, placeholder: r, dataAttribute: i, pos: a, node: o, isEmptyDoc: s, hasAnchor: c, classes: { emptyNode: l, emptyEditor: u } } = e, d = [l];
129
- return s && d.push(u), n.node(a, a + o.nodeSize, {
128
+ let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: u } } = e, d = [c];
129
+ return o && d.push(u), l.node(i, i + a.nodeSize, {
130
130
  class: d.join(" "),
131
- [i]: typeof r == "function" ? r({
131
+ [r]: typeof n == "function" ? n({
132
132
  editor: t,
133
- node: o,
134
- pos: a,
135
- hasAnchor: c
136
- }) : r
133
+ node: a,
134
+ pos: i,
135
+ hasAnchor: s
136
+ }) : n
137
137
  });
138
138
  }
139
139
  function b(e, t) {
140
140
  return typeof e == "function" ? e(t) : e;
141
141
  }
142
- function x({ editor: e, options: t, dataAttribute: n, doc: r, selection: i, from: a, to: o }) {
143
- let { anchor: s } = i, l = [], u = e.isEmpty;
144
- return r.nodesBetween(a, o, (r, i) => {
145
- let a = s >= i && s <= i + r.nodeSize, o = !r.isLeaf && c(r);
146
- return r.type.isTextblock && (a || !t.showOnlyCurrent) && o && l.push(y({
142
+ function x({ editor: e, options: t, dataAttribute: n, doc: r, selection: a, from: o, to: s }) {
143
+ let { anchor: c } = a, l = [], u = e.isEmpty;
144
+ return r.nodesBetween(o, s, (r, a) => {
145
+ let o = c >= a && c <= a + r.nodeSize, s = !r.isLeaf && i(r);
146
+ return r.type.isTextblock && (o || !t.showOnlyCurrent) && s && l.push(y({
147
147
  editor: e,
148
148
  isEmptyDoc: u,
149
149
  dataAttribute: n,
150
- hasAnchor: a,
150
+ hasAnchor: o,
151
151
  placeholder: t.placeholder,
152
152
  classes: {
153
153
  emptyEditor: t.emptyEditorClass,
154
154
  emptyNode: b(t.emptyNodeClass, {
155
155
  editor: e,
156
156
  node: r,
157
- pos: i,
158
- hasAnchor: a
157
+ pos: a,
158
+ hasAnchor: o
159
159
  })
160
160
  },
161
161
  node: r,
162
- pos: i
162
+ pos: a
163
163
  })), t.includeChildren;
164
164
  }), l;
165
165
  }
166
- function S({ editor: e, options: t, dataAttribute: n, doc: i, selection: a }) {
167
- if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
168
- let { anchor: o } = a, s = [], l = e.isEmpty;
166
+ function S({ editor: e, options: t, dataAttribute: n, doc: r, selection: a }) {
167
+ if (!e.isEditable && t.showOnlyWhenEditable) return null;
168
+ let { anchor: o } = a, s = [], c = e.isEmpty;
169
169
  if (t.showOnlyCurrent && !t.includeChildren) {
170
- let r = i.resolve(o), a = r.depth > 0 ? r.node(1) : r.nodeAfter, u = r.depth > 0 ? r.before(1) : o;
171
- if (a && a.type.isTextblock && c(a)) {
172
- let r = o >= u && o <= u + a.nodeSize;
170
+ let a = r.resolve(o), l = a.depth > 0 ? a.node(1) : a.nodeAfter, u = a.depth > 0 ? a.before(1) : o;
171
+ if (l && l.type.isTextblock && i(l)) {
172
+ let r = o >= u && o <= u + l.nodeSize;
173
173
  s.push(y({
174
174
  editor: e,
175
- isEmptyDoc: l,
175
+ isEmptyDoc: c,
176
176
  dataAttribute: n,
177
177
  hasAnchor: r,
178
178
  placeholder: t.placeholder,
@@ -180,12 +180,12 @@ function S({ editor: e, options: t, dataAttribute: n, doc: i, selection: a }) {
180
180
  emptyEditor: t.emptyEditorClass,
181
181
  emptyNode: b(t.emptyNodeClass, {
182
182
  editor: e,
183
- node: a,
183
+ node: l,
184
184
  pos: u,
185
185
  hasAnchor: r
186
186
  })
187
187
  },
188
- node: a,
188
+ node: l,
189
189
  pos: u
190
190
  }));
191
191
  }
@@ -193,12 +193,12 @@ function S({ editor: e, options: t, dataAttribute: n, doc: i, selection: a }) {
193
193
  editor: e,
194
194
  options: t,
195
195
  dataAttribute: n,
196
- doc: i,
196
+ doc: r,
197
197
  selection: a,
198
198
  from: 0,
199
- to: i.content.size
199
+ to: r.content.size
200
200
  }));
201
- return r.create(i, s);
201
+ return u.create(r, s);
202
202
  }
203
203
  function C(e, t) {
204
204
  let n = e.resolve(t);
@@ -249,13 +249,13 @@ function D(e, t) {
249
249
  let n = T(e, t.from, t.to);
250
250
  return n.push(w(e, C(e, t.from))), t.to > t.from ? n.push(w(e, C(e, Math.min(t.to, e.content.size + 1) - 1))) : t.from < e.content.size + 1 && n.push(w(e, C(e, Math.min(t.from + 1, e.content.size)))), n;
251
251
  }
252
- function O(e, t, n) {
253
- let r = [];
252
+ function O(e, t, r) {
253
+ let i = [];
254
254
  if (e.docChanged) {
255
- let t = o(e);
256
- for (let e of t) r.push(...D(n.doc, e.newRange));
255
+ let t = n(e);
256
+ for (let e of t) i.push(...D(r.doc, e.newRange));
257
257
  }
258
- return e.selectionSet && (r.push(w(n.doc, C(n.doc, e.mapping.map(t.selection.anchor)))), r.push(w(n.doc, C(n.doc, n.selection.anchor)))), E(r);
258
+ return e.selectionSet && (i.push(w(r.doc, C(r.doc, e.mapping.map(t.selection.anchor)))), i.push(w(r.doc, C(r.doc, r.selection.anchor)))), E(i);
259
259
  }
260
260
  function k(e, t, n) {
261
261
  let r = Math.max(0, Math.min(e, n.content.size));
@@ -284,14 +284,14 @@ function A({ decorations: e, ranges: t, editor: n, options: r, dataAttribute: i,
284
284
  }
285
285
  function j({ editor: e, options: t, dataAttribute: n }) {
286
286
  return {
287
- init(i, a) {
287
+ init(r, i) {
288
288
  return S({
289
289
  editor: e,
290
290
  options: t,
291
291
  dataAttribute: n,
292
- doc: a.doc,
293
- selection: a.selection
294
- }) ?? r.empty;
292
+ doc: i.doc,
293
+ selection: i.selection
294
+ }) ?? u.empty;
295
295
  },
296
296
  apply(r, i, a, o) {
297
297
  return !r.docChanged && !r.selectionSet ? i : A({
@@ -309,25 +309,25 @@ function j({ editor: e, options: t, dataAttribute: n }) {
309
309
  function M(e) {
310
310
  return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
311
311
  }
312
- function N({ editor: t, options: n }) {
313
- let i = n.dataAttribute ? `data-${M(n.dataAttribute)}` : `data-${_}`, a = n.showOnlyCurrent && !n.includeChildren;
314
- return new e({
312
+ function N({ editor: e, options: t }) {
313
+ let n = t.dataAttribute ? `data-${M(t.dataAttribute)}` : `data-${_}`, r = t.showOnlyCurrent && !t.includeChildren;
314
+ return new o({
315
315
  key: v,
316
- ...a ? {} : { state: j({
317
- editor: t,
318
- options: n,
319
- dataAttribute: i
316
+ ...r ? {} : { state: j({
317
+ editor: e,
318
+ options: t,
319
+ dataAttribute: n
320
320
  }) },
321
- props: { decorations: a ? ({ doc: e, selection: r }) => S({
322
- editor: t,
323
- options: n,
324
- dataAttribute: i,
325
- doc: e,
326
- selection: r
327
- }) : (e) => n.showOnlyWhenEditable && !t.isEditable ? r.empty : v.getState(e) ?? r.empty }
321
+ props: { decorations: r ? ({ doc: r, selection: i }) => S({
322
+ editor: e,
323
+ options: t,
324
+ dataAttribute: n,
325
+ doc: r,
326
+ selection: i
327
+ }) : (n) => t.showOnlyWhenEditable && !e.isEditable ? u.empty : v.getState(n) ?? u.empty }
328
328
  });
329
329
  }
330
- var P = i.create({
330
+ var P = e.create({
331
331
  name: "placeholder",
332
332
  addOptions() {
333
333
  return {
@@ -348,7 +348,7 @@ var P = i.create({
348
348
  }
349
349
  });
350
350
  function F(e, t) {
351
- return !e.selection.empty && !l(e.selection) && t.isEditable;
351
+ return !e.selection.empty && !a(e.selection) && t.isEditable;
352
352
  }
353
353
  function I(e, t) {
354
354
  return F(e, t) && !t.isFocused && !t.view.dragging;
@@ -360,26 +360,26 @@ function L() {
360
360
  function R(e) {
361
361
  e.focus();
362
362
  }
363
- i.create({
363
+ e.create({
364
364
  name: "selection",
365
365
  addOptions() {
366
366
  return { className: "selection" };
367
367
  },
368
368
  addProseMirrorPlugins() {
369
- let { editor: i, options: a } = this;
370
- return [new e({
371
- key: new t("selection"),
369
+ let { editor: e, options: t } = this;
370
+ return [new o({
371
+ key: new s("selection"),
372
372
  props: {
373
- decorations(e) {
374
- return I(e, i) ? r.create(e.doc, [n.inline(e.selection.from, e.selection.to, { class: a.className })]) : null;
373
+ decorations(n) {
374
+ return I(n, e) ? u.create(n.doc, [l.inline(n.selection.from, n.selection.to, { class: t.className })]) : null;
375
375
  },
376
376
  handleDOMEvents: {
377
- blur(e) {
378
- return F(e.state, i) && L(), !1;
377
+ blur(t) {
378
+ return F(t.state, e) && L(), !1;
379
379
  },
380
- focus(e) {
381
- return F(e.state, i) && requestAnimationFrame(() => {
382
- !i.isDestroyed && e.hasFocus() && R(e);
380
+ focus(t) {
381
+ return F(t.state, e) && requestAnimationFrame(() => {
382
+ !e.isDestroyed && t.hasFocus() && R(t);
383
383
  }), !1;
384
384
  }
385
385
  }
@@ -391,7 +391,7 @@ var z = "skipTrailingNode";
391
391
  function B({ types: e, node: t }) {
392
392
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
393
393
  }
394
- var V = i.create({
394
+ var V = e.create({
395
395
  name: "trailingNode",
396
396
  addOptions() {
397
397
  return {
@@ -400,33 +400,33 @@ var V = i.create({
400
400
  };
401
401
  },
402
402
  addProseMirrorPlugins() {
403
- let n = new t(this.name), r = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", i = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(r).includes(e.name));
404
- return [new e({
405
- key: n,
406
- appendTransaction: (e, t, i) => {
407
- let { doc: a, tr: o, schema: s } = i, c = n.getState(i), l = a.content.size, u = s.nodes[r];
408
- if (!e.some((e) => e.getMeta("skipTrailingNode")) && c) return o.insert(l, u.create());
403
+ let e = new s(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
404
+ return [new o({
405
+ key: e,
406
+ appendTransaction: (n, r, i) => {
407
+ let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
408
+ if (!n.some((e) => e.getMeta("skipTrailingNode")) && c) return o.insert(l, u.create());
409
409
  },
410
410
  state: {
411
411
  init: (e, t) => {
412
- let n = t.tr.doc.lastChild;
412
+ let r = t.tr.doc.lastChild;
413
413
  return !B({
414
- node: n,
415
- types: i
414
+ node: r,
415
+ types: n
416
416
  });
417
417
  },
418
418
  apply: (e, t) => {
419
419
  if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
420
- let n = e.doc.lastChild;
420
+ let r = e.doc.lastChild;
421
421
  return !B({
422
- node: n,
423
- types: i
422
+ node: r,
423
+ types: n
424
424
  });
425
425
  }
426
426
  }
427
427
  })];
428
428
  }
429
- }), H = i.create({
429
+ }), H = e.create({
430
430
  name: "undoRedo",
431
431
  addOptions() {
432
432
  return {
@@ -453,7 +453,6 @@ var V = i.create({
453
453
  };
454
454
  }
455
455
  });
456
- //#endregion
457
456
  export { _ as DEFAULT_DATA_ATTRIBUTE, h as Dropcursor, g as Gapcursor, v as PLUGIN_KEY, P as Placeholder, V as TrailingNode, H as UndoRedo, M as preparePlaceholderAttribute, z as skipTrailingNodeMeta };
458
457
 
459
458
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Extension2","Extension3","Plugin2","PluginKey2","Extension4","PluginKey3","Decoration2","DecorationSet2","DecorationSet3","Plugin3","DecorationSet4","Extension5","Extension6","Plugin4","PluginKey4","DecorationSet5","Decoration3","Extension7","PluginKey5","Plugin5","Extension8"],"sources":["../../../../../node_modules/@tiptap/extensions/dist/index.js"],"sourcesContent":["// src/character-count/character-count.ts\nimport { Extension } from \"@tiptap/core\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nvar CharacterCount = Extension.create({\n name: \"characterCount\",\n addOptions() {\n return {\n limit: null,\n autoTrim: true,\n mode: \"textSize\",\n textCounter: (text) => text.length,\n wordCounter: (text) => text.split(\" \").filter((word) => word !== \"\").length\n };\n },\n addStorage() {\n return {\n characters: () => 0,\n words: () => 0\n };\n },\n onBeforeCreate() {\n this.storage.characters = (options) => {\n const node = (options == null ? void 0 : options.node) || this.editor.state.doc;\n const mode = (options == null ? void 0 : options.mode) || this.options.mode;\n if (mode === \"textSize\") {\n const text = node.textBetween(0, node.content.size, void 0, \" \");\n return this.options.textCounter(text);\n }\n return node.nodeSize;\n };\n this.storage.words = (options) => {\n const node = (options == null ? void 0 : options.node) || this.editor.state.doc;\n const text = node.textBetween(0, node.content.size, \" \", \" \");\n return this.options.wordCounter(text);\n };\n },\n addProseMirrorPlugins() {\n let initialEvaluationDone = false;\n return [\n new Plugin({\n key: new PluginKey(\"characterCount\"),\n appendTransaction: (transactions, oldState, newState) => {\n if (initialEvaluationDone) {\n return;\n }\n const limit = this.options.limit;\n const autoTrim = this.options.autoTrim;\n if (limit === null || limit === void 0 || limit === 0 || autoTrim === false) {\n initialEvaluationDone = true;\n return;\n }\n const initialContentSize = this.storage.characters({ node: newState.doc });\n if (initialContentSize > limit) {\n const over = initialContentSize - limit;\n const from = 0;\n const to = over;\n console.warn(\n `[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`\n );\n const tr = newState.tr.deleteRange(from, to);\n initialEvaluationDone = true;\n return tr;\n }\n initialEvaluationDone = true;\n },\n filterTransaction: (transaction, state) => {\n const limit = this.options.limit;\n if (!transaction.docChanged || limit === 0 || limit === null || limit === void 0) {\n return true;\n }\n const oldSize = this.storage.characters({ node: state.doc });\n const newSize = this.storage.characters({ node: transaction.doc });\n if (newSize <= limit) {\n return true;\n }\n if (oldSize > limit && newSize > limit && newSize <= oldSize) {\n return true;\n }\n if (oldSize > limit && newSize > limit && newSize > oldSize) {\n return false;\n }\n const isPaste = transaction.getMeta(\"paste\");\n if (!isPaste) {\n return false;\n }\n const pos = transaction.selection.$head.pos;\n const over = newSize - limit;\n const from = pos - over;\n const to = pos;\n transaction.deleteRange(from, to);\n const updatedSize = this.storage.characters({ node: transaction.doc });\n if (updatedSize > limit) {\n return false;\n }\n return true;\n }\n })\n ];\n }\n});\n\n// src/drop-cursor/drop-cursor.ts\nimport { Extension as Extension2 } from \"@tiptap/core\";\nimport { dropCursor } from \"@tiptap/pm/dropcursor\";\nvar Dropcursor = Extension2.create({\n name: \"dropCursor\",\n addOptions() {\n return {\n color: \"currentColor\",\n width: 1,\n class: void 0\n };\n },\n addProseMirrorPlugins() {\n return [dropCursor(this.options)];\n }\n});\n\n// src/focus/focus.ts\nimport { Extension as Extension3 } from \"@tiptap/core\";\nimport { Plugin as Plugin2, PluginKey as PluginKey2 } from \"@tiptap/pm/state\";\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\nvar Focus = Extension3.create({\n name: \"focus\",\n addOptions() {\n return {\n className: \"has-focus\",\n mode: \"all\"\n };\n },\n addProseMirrorPlugins() {\n return [\n new Plugin2({\n key: new PluginKey2(\"focus\"),\n props: {\n decorations: ({ doc, selection }) => {\n const { isEditable, isFocused } = this.editor;\n const { anchor } = selection;\n const decorations = [];\n if (!isEditable || !isFocused) {\n return DecorationSet.create(doc, []);\n }\n let maxLevels = 0;\n if (this.options.mode === \"deepest\") {\n doc.descendants((node, pos) => {\n if (node.isText) {\n return;\n }\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;\n if (!isCurrent) {\n return false;\n }\n maxLevels += 1;\n });\n }\n let currentLevel = 0;\n doc.descendants((node, pos) => {\n if (node.isText) {\n return false;\n }\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;\n if (!isCurrent) {\n return false;\n }\n currentLevel += 1;\n const outOfScope = this.options.mode === \"deepest\" && maxLevels - currentLevel > 0 || this.options.mode === \"shallowest\" && currentLevel > 1;\n if (outOfScope) {\n return this.options.mode === \"deepest\";\n }\n decorations.push(\n Decoration.node(pos, pos + node.nodeSize, {\n class: this.options.className\n })\n );\n });\n return DecorationSet.create(doc, decorations);\n }\n }\n })\n ];\n }\n});\n\n// src/gap-cursor/gap-cursor.ts\nimport { callOrReturn, Extension as Extension4, getExtensionField } from \"@tiptap/core\";\nimport { gapCursor } from \"@tiptap/pm/gapcursor\";\nvar Gapcursor = Extension4.create({\n name: \"gapCursor\",\n addProseMirrorPlugins() {\n return [gapCursor()];\n },\n extendNodeSchema(extension) {\n var _a;\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage\n };\n return {\n allowGapCursor: (_a = callOrReturn(getExtensionField(extension, \"allowGapCursor\", context))) != null ? _a : null\n };\n }\n});\n\n// src/placeholder/constants.ts\nimport { PluginKey as PluginKey3 } from \"@tiptap/pm/state\";\nvar DEFAULT_DATA_ATTRIBUTE = \"placeholder\";\nvar PLUGIN_KEY = new PluginKey3(\"tiptap__placeholder\");\n\n// src/placeholder/placeholder.ts\nimport { Extension as Extension5 } from \"@tiptap/core\";\n\n// src/placeholder/plugins/PlaceholderPlugin.ts\nimport { Plugin as Plugin3 } from \"@tiptap/pm/state\";\nimport { DecorationSet as DecorationSet4 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/buildPlaceholderDecorations.ts\nimport { isNodeEmpty } from \"@tiptap/core\";\nimport { DecorationSet as DecorationSet2 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/createPlaceholderDecoration.ts\nimport { Decoration as Decoration2 } from \"@tiptap/pm/view\";\nfunction createPlaceholderDecoration(options) {\n const {\n editor,\n placeholder,\n dataAttribute,\n pos,\n node,\n isEmptyDoc,\n hasAnchor,\n classes: { emptyNode, emptyEditor }\n } = options;\n const classes = [emptyNode];\n if (isEmptyDoc) {\n classes.push(emptyEditor);\n }\n return Decoration2.node(pos, pos + node.nodeSize, {\n class: classes.join(\" \"),\n [dataAttribute]: typeof placeholder === \"function\" ? placeholder({\n editor,\n node,\n pos,\n hasAnchor\n }) : placeholder\n });\n}\n\n// src/placeholder/utils/buildPlaceholderDecorations.ts\nfunction resolveEmptyNodeClass(emptyNodeClass, props) {\n return typeof emptyNodeClass === \"function\" ? emptyNodeClass(props) : emptyNodeClass;\n}\nfunction scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from,\n to\n}) {\n const { anchor } = selection;\n const decorations = [];\n const isEmptyDoc = editor.isEmpty;\n doc.nodesBetween(from, to, (node, pos) => {\n const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;\n const isEmpty = !node.isLeaf && isNodeEmpty(node);\n if (!node.type.isTextblock) {\n return options.includeChildren;\n }\n if ((hasAnchor || !options.showOnlyCurrent) && isEmpty) {\n decorations.push(\n createPlaceholderDecoration({\n editor,\n isEmptyDoc,\n dataAttribute,\n hasAnchor,\n placeholder: options.placeholder,\n classes: {\n emptyEditor: options.emptyEditorClass,\n emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n editor,\n node,\n pos,\n hasAnchor\n })\n },\n node,\n pos\n })\n );\n }\n return options.includeChildren;\n });\n return decorations;\n}\nfunction buildPlaceholderDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection\n}) {\n const active = editor.isEditable || !options.showOnlyWhenEditable;\n if (!active) {\n return null;\n }\n const { anchor } = selection;\n const decorations = [];\n const isEmptyDoc = editor.isEmpty;\n const useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n if (useResolvedPath) {\n const resolved = doc.resolve(anchor);\n const node = resolved.depth > 0 ? resolved.node(1) : resolved.nodeAfter;\n const nodeStart = resolved.depth > 0 ? resolved.before(1) : anchor;\n if (node && node.type.isTextblock && isNodeEmpty(node)) {\n const hasAnchor = anchor >= nodeStart && anchor <= nodeStart + node.nodeSize;\n decorations.push(\n createPlaceholderDecoration({\n editor,\n isEmptyDoc,\n dataAttribute,\n hasAnchor,\n placeholder: options.placeholder,\n classes: {\n emptyEditor: options.emptyEditorClass,\n emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n editor,\n node,\n pos: nodeStart,\n hasAnchor\n })\n },\n node,\n pos: nodeStart\n })\n );\n }\n } else {\n decorations.push(\n ...scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from: 0,\n to: doc.content.size\n })\n );\n }\n return DecorationSet2.create(doc, decorations);\n}\n\n// src/placeholder/utils/placeholderStateField.ts\nimport { getChangedRanges } from \"@tiptap/core\";\nimport { DecorationSet as DecorationSet3 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/resolveTopLevelRange.ts\nfunction resolveTopLevelRange(doc, pos) {\n var _a;\n const resolved = doc.resolve(pos);\n if (resolved.depth === 0) {\n const node2 = (_a = resolved.nodeAfter) != null ? _a : resolved.nodeBefore;\n if (!node2) {\n return { from: pos, to: pos };\n }\n const nodePos = resolved.nodeAfter ? pos : pos - node2.nodeSize;\n return { from: nodePos, to: nodePos + node2.nodeSize };\n }\n const topLevelPos = resolved.before(1);\n const node = resolved.node(1);\n return { from: topLevelPos, to: topLevelPos + node.nodeSize };\n}\nfunction toContentRelativeRange(doc, range) {\n return {\n from: Math.max(0, range.from - 1),\n to: Math.min(doc.content.size, range.to - 1)\n };\n}\nfunction getTopLevelBlocksInRange(doc, from, to) {\n const ranges = [];\n doc.forEach((node, offset) => {\n const nodeStart = offset;\n const nodeEnd = nodeStart + node.nodeSize;\n const absNodeStart = nodeStart + 1;\n const absNodeEnd = nodeEnd + 1;\n if (absNodeStart < to && absNodeEnd > from) {\n ranges.push({ from: nodeStart, to: nodeEnd });\n }\n });\n return ranges;\n}\nfunction mergeRanges(ranges) {\n if (ranges.length === 0) {\n return [];\n }\n const sorted = [...ranges].sort((a, b) => a.from - b.from);\n const merged = [{ ...sorted[0] }];\n for (let i = 1; i < sorted.length; i += 1) {\n const last = merged[merged.length - 1];\n const current = sorted[i];\n if (current.from <= last.to) {\n last.to = Math.max(last.to, current.to);\n } else {\n merged.push({ ...current });\n }\n }\n return merged;\n}\n\n// src/placeholder/utils/placeholderStateField.ts\nfunction collectBlocksForChange(doc, change) {\n const ranges = getTopLevelBlocksInRange(doc, change.from, change.to);\n ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, change.from)));\n if (change.to > change.from) {\n ranges.push(\n toContentRelativeRange(\n doc,\n resolveTopLevelRange(doc, Math.min(change.to, doc.content.size + 1) - 1)\n )\n );\n } else if (change.from < doc.content.size + 1) {\n ranges.push(\n toContentRelativeRange(\n doc,\n resolveTopLevelRange(doc, Math.min(change.from + 1, doc.content.size))\n )\n );\n }\n return ranges;\n}\nfunction collectRescanRanges(tr, oldState, newState) {\n const ranges = [];\n if (tr.docChanged) {\n const changes = getChangedRanges(tr);\n for (const change of changes) {\n ranges.push(...collectBlocksForChange(newState.doc, change.newRange));\n }\n }\n if (tr.selectionSet) {\n ranges.push(\n toContentRelativeRange(\n newState.doc,\n resolveTopLevelRange(newState.doc, tr.mapping.map(oldState.selection.anchor))\n )\n );\n ranges.push(\n toContentRelativeRange(\n newState.doc,\n resolveTopLevelRange(newState.doc, newState.selection.anchor)\n )\n );\n }\n return mergeRanges(ranges);\n}\nfunction clampRange(from, to, doc) {\n const clampedFrom = Math.max(0, Math.min(from, doc.content.size));\n const clampedTo = Math.max(clampedFrom, Math.min(to, doc.content.size));\n return { from: clampedFrom, to: clampedTo };\n}\nfunction updateDecorationsInRanges({\n decorations,\n ranges,\n editor,\n options,\n dataAttribute,\n doc,\n selection\n}) {\n let next = decorations;\n for (const range of ranges) {\n const { from, to } = clampRange(range.from, range.to, doc);\n const existing = next.find(from, to).filter((decoration) => decoration.from >= from && decoration.to <= to);\n if (existing.length) {\n next = next.remove(existing);\n }\n const newDecos = scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from,\n to\n });\n if (newDecos.length) {\n next = next.add(doc, newDecos);\n }\n }\n return next;\n}\nfunction createPlaceholderStateField({\n editor,\n options,\n dataAttribute\n}) {\n return {\n init(_config, state) {\n const decorations = buildPlaceholderDecorations({\n editor,\n options,\n dataAttribute,\n doc: state.doc,\n selection: state.selection\n });\n return decorations != null ? decorations : DecorationSet3.empty;\n },\n apply(tr, prev, oldState, newState) {\n if (!tr.docChanged && !tr.selectionSet) {\n return prev;\n }\n const mapped = prev.map(tr.mapping, tr.doc);\n const ranges = collectRescanRanges(tr, oldState, newState);\n return updateDecorationsInRanges({\n decorations: mapped,\n ranges,\n editor,\n options,\n dataAttribute,\n doc: newState.doc,\n selection: newState.selection\n });\n }\n };\n}\n\n// src/placeholder/utils/preparePlaceholderAttribute.ts\nfunction preparePlaceholderAttribute(attr) {\n return attr.replace(/\\s+/g, \"-\").replace(/[^a-zA-Z0-9-]/g, \"\").replace(/^[0-9-]+/, \"\").replace(/^-+/, \"\").toLowerCase();\n}\n\n// src/placeholder/plugins/PlaceholderPlugin.ts\nfunction createPlaceholderPlugin({ editor, options }) {\n const dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;\n const useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n return new Plugin3({\n key: PLUGIN_KEY,\n ...useResolvedPath ? {} : {\n state: createPlaceholderStateField({ editor, options, dataAttribute })\n },\n props: {\n decorations: useResolvedPath ? ({ doc, selection }) => buildPlaceholderDecorations({ editor, options, dataAttribute, doc, selection }) : (state) => {\n var _a;\n if (options.showOnlyWhenEditable && !editor.isEditable) {\n return DecorationSet4.empty;\n }\n return (_a = PLUGIN_KEY.getState(state)) != null ? _a : DecorationSet4.empty;\n }\n }\n });\n}\n\n// src/placeholder/placeholder.ts\nvar Placeholder = Extension5.create({\n name: \"placeholder\",\n addOptions() {\n return {\n emptyEditorClass: \"is-editor-empty\",\n emptyNodeClass: \"is-empty\",\n dataAttribute: DEFAULT_DATA_ATTRIBUTE,\n placeholder: \"Write something \\u2026\",\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n includeChildren: false\n };\n },\n addProseMirrorPlugins() {\n return [createPlaceholderPlugin({ editor: this.editor, options: this.options })];\n }\n});\n\n// src/selection/selection.ts\nimport { Extension as Extension6, isNodeSelection } from \"@tiptap/core\";\nimport { Plugin as Plugin4, PluginKey as PluginKey4 } from \"@tiptap/pm/state\";\nimport { Decoration as Decoration3, DecorationSet as DecorationSet5 } from \"@tiptap/pm/view\";\nfunction shouldSyncDomSelection(state, editor) {\n return !state.selection.empty && !isNodeSelection(state.selection) && editor.isEditable;\n}\nfunction shouldPreserveSelection(state, editor) {\n return shouldSyncDomSelection(state, editor) && !editor.isFocused && !editor.view.dragging;\n}\nfunction clearDomSelection() {\n var _a;\n (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();\n}\nfunction restoreDomSelection(view) {\n view.focus();\n}\nvar Selection = Extension6.create({\n name: \"selection\",\n addOptions() {\n return {\n className: \"selection\"\n };\n },\n addProseMirrorPlugins() {\n const { editor, options } = this;\n return [\n new Plugin4({\n key: new PluginKey4(\"selection\"),\n props: {\n decorations(state) {\n if (!shouldPreserveSelection(state, editor)) {\n return null;\n }\n return DecorationSet5.create(state.doc, [\n Decoration3.inline(state.selection.from, state.selection.to, {\n class: options.className\n })\n ]);\n },\n handleDOMEvents: {\n blur(view) {\n if (!shouldSyncDomSelection(view.state, editor)) {\n return false;\n }\n clearDomSelection();\n return false;\n },\n focus(view) {\n if (!shouldSyncDomSelection(view.state, editor)) {\n return false;\n }\n requestAnimationFrame(() => {\n if (!editor.isDestroyed && view.hasFocus()) {\n restoreDomSelection(view);\n }\n });\n return false;\n }\n }\n }\n })\n ];\n }\n});\n\n// src/trailing-node/trailing-node.ts\nimport { Extension as Extension7 } from \"@tiptap/core\";\nimport { Plugin as Plugin5, PluginKey as PluginKey5 } from \"@tiptap/pm/state\";\nvar skipTrailingNodeMeta = \"skipTrailingNode\";\nfunction nodeEqualsType({\n types,\n node\n}) {\n return node && Array.isArray(types) && types.includes(node.type) || (node == null ? void 0 : node.type) === types;\n}\nvar TrailingNode = Extension7.create({\n name: \"trailingNode\",\n addOptions() {\n return {\n node: void 0,\n notAfter: []\n };\n },\n addProseMirrorPlugins() {\n var _a;\n const plugin = new PluginKey5(this.name);\n const defaultNode = this.options.node || ((_a = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : _a.name) || \"paragraph\";\n const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));\n return [\n new Plugin5({\n key: plugin,\n appendTransaction: (transactions, __, state) => {\n const { doc, tr, schema } = state;\n const shouldInsertNodeAtEnd = plugin.getState(state);\n const endPosition = doc.content.size;\n const type = schema.nodes[defaultNode];\n if (transactions.some((transaction) => transaction.getMeta(skipTrailingNodeMeta))) {\n return;\n }\n if (!shouldInsertNodeAtEnd) {\n return;\n }\n return tr.insert(endPosition, type.create());\n },\n state: {\n init: (_, state) => {\n const lastNode = state.tr.doc.lastChild;\n return !nodeEqualsType({ node: lastNode, types: disabledNodes });\n },\n apply: (tr, value) => {\n if (!tr.docChanged) {\n return value;\n }\n if (tr.getMeta(\"__uniqueIDTransaction\")) {\n return value;\n }\n const lastNode = tr.doc.lastChild;\n return !nodeEqualsType({ node: lastNode, types: disabledNodes });\n }\n }\n })\n ];\n }\n});\n\n// src/undo-redo/undo-redo.ts\nimport { Extension as Extension8 } from \"@tiptap/core\";\nimport { history, redo, undo } from \"@tiptap/pm/history\";\nvar UndoRedo = Extension8.create({\n name: \"undoRedo\",\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500\n };\n },\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch);\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch);\n }\n };\n },\n addProseMirrorPlugins() {\n return [history(this.options)];\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-z\": () => this.editor.commands.undo(),\n \"Shift-Mod-z\": () => this.editor.commands.redo(),\n \"Mod-y\": () => this.editor.commands.redo(),\n // Russian keyboard layouts\n \"Mod-\\u044F\": () => this.editor.commands.undo(),\n \"Shift-Mod-\\u044F\": () => this.editor.commands.redo()\n };\n }\n});\nexport {\n CharacterCount,\n DEFAULT_DATA_ATTRIBUTE,\n Dropcursor,\n Focus,\n Gapcursor,\n PLUGIN_KEY,\n Placeholder,\n Selection,\n TrailingNode,\n UndoRedo,\n preparePlaceholderAttribute,\n skipTrailingNodeMeta\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAGqB,EAAU,OAAO;CACpC,MAAM;CACN,aAAa;EACX,OAAO;GACL,OAAO;GACP,UAAU;GACV,MAAM;GACN,cAAc,MAAS,EAAK;GAC5B,cAAc,MAAS,EAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAS,MAAS,EAAE,CAAC,CAAC;EACvE;CACF;CACA,aAAa;EACX,OAAO;GACL,kBAAkB;GAClB,aAAa;EACf;CACF;CACA,iBAAiB;EAUf,AATA,KAAK,QAAQ,cAAc,MAAY;GACrC,IAA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AAY,QAAA,kBAA4B,CAAC,KAG3E,GAGL,OAAO,EAAG,OAAO,GAAa,EAAK,OAAO,CAAC;GAC7C;GACA,OAAO;IACL,OAAO,GAAG,MAAU;KAClB,IAAM,IAAW,EAAM,GAAG,IAAI;KAC9B,OAAO,CAAC,EAAe;MAAE,MAAM;MAAU,OAAO;KAAc,CAAC;IACjE;IACA,QAAQ,GAAI,MAAU;KAIpB,IAHI,CAAC,EAAG,cAGJ,EAAG,QAAQ,uBAAuB,GACpC,OAAO;KAET,IAAM,IAAW,EAAG,IAAI;KACxB,OAAO,CAAC,EAAe;MAAE,MAAM;MAAU,OAAO;KAAc,CAAC;IACjE;GACF;EACF,CAAC,CACH;CACF;AACF,CAAC,GAKG,IAAWC,EAAW,OAAO;CAC/B,MAAM;CACN,aAAa;EACX,OAAO;GACL,OAAO;GACP,eAAe;EACjB;CACF;CACA,cAAc;EACZ,OAAO;GACL,aAAa,EAAE,UAAO,kBACb,EAAK,GAAO,CAAQ;GAE7B,aAAa,EAAE,UAAO,kBACb,EAAK,GAAO,CAAQ;EAE/B;CACF;CACA,wBAAwB;EACtB,OAAO,CAAC,EAAQ,KAAK,OAAO,CAAC;CAC/B;CACA,uBAAuB;EACrB,OAAO;GACL,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,qBAAqB,KAAK,OAAO,SAAS,KAAK;GAC/C,eAAe,KAAK,OAAO,SAAS,KAAK;GAEzC,eAAoB,KAAK,OAAO,SAAS,KAAK;GAC9C,qBAA0B,KAAK,OAAO,SAAS,KAAK;EACtD;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Extension2","Extension3","Plugin2","PluginKey2","Extension4","PluginKey3","Decoration2","DecorationSet2","DecorationSet3","Plugin3","DecorationSet4","Extension5","Extension6","Plugin4","PluginKey4","DecorationSet5","Decoration3","Extension7","PluginKey5","Plugin5","Extension8","Extension","text","word","node","options","initialEvaluationDone","Plugin","PluginKey","limit","autoTrim","initialContentSize","newState","to","tr","transaction","oldSize","state","newSize","pos","from","Dropcursor","dropCursor","selection","decorations","isEditable","isFocused","DecorationSet","doc","maxLevels","anchor","currentLevel","Decoration","Gapcursor","gapCursor","context","extension","callOrReturn","getExtensionField","DEFAULT_DATA_ATTRIBUTE","PLUGIN_KEY","createPlaceholderDecoration","classes","emptyNode","isEmptyDoc","emptyEditor","dataAttribute","placeholder","resolveEmptyNodeClass","emptyNodeClass","props","scanRangeForDecorations","editor","hasAnchor","isEmpty","isNodeEmpty","buildPlaceholderDecorations","resolved","nodeStart","resolveTopLevelRange","node2","nodePos","topLevelPos","toContentRelativeRange","range","getTopLevelBlocksInRange","ranges","offset","nodeEnd","absNodeStart","absNodeEnd","mergeRanges","sorted","a","b","merged","i","last","current","collectBlocksForChange","change","collectRescanRanges","changes","getChangedRanges","oldState","clampRange","clampedFrom","updateDecorationsInRanges","next","existing","decoration","newDecos","createPlaceholderStateField","prev","preparePlaceholderAttribute","attr","createPlaceholderPlugin","useResolvedPath","Placeholder","shouldSyncDomSelection","isNodeSelection","shouldPreserveSelection","clearDomSelection","_a","restoreDomSelection","view","skipTrailingNodeMeta","nodeEqualsType","types","TrailingNode","plugin","defaultNode","disabledNodes","value","shouldInsertNodeAtEnd","endPosition","type","schema","lastNode","UndoRedo","undo","dispatch","redo","history"],"sources":["../../../../../node_modules/@tiptap/extensions/dist/index.js"],"sourcesContent":["// src/character-count/character-count.ts\nimport { Extension } from \"@tiptap/core\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nvar CharacterCount = Extension.create({\n name: \"characterCount\",\n addOptions() {\n return {\n limit: null,\n autoTrim: true,\n mode: \"textSize\",\n textCounter: (text) => text.length,\n wordCounter: (text) => text.split(\" \").filter((word) => word !== \"\").length\n };\n },\n addStorage() {\n return {\n characters: () => 0,\n words: () => 0\n };\n },\n onBeforeCreate() {\n this.storage.characters = (options) => {\n const node = (options == null ? void 0 : options.node) || this.editor.state.doc;\n const mode = (options == null ? void 0 : options.mode) || this.options.mode;\n if (mode === \"textSize\") {\n const text = node.textBetween(0, node.content.size, void 0, \" \");\n return this.options.textCounter(text);\n }\n return node.nodeSize;\n };\n this.storage.words = (options) => {\n const node = (options == null ? void 0 : options.node) || this.editor.state.doc;\n const text = node.textBetween(0, node.content.size, \" \", \" \");\n return this.options.wordCounter(text);\n };\n },\n addProseMirrorPlugins() {\n let initialEvaluationDone = false;\n return [\n new Plugin({\n key: new PluginKey(\"characterCount\"),\n appendTransaction: (transactions, oldState, newState) => {\n if (initialEvaluationDone) {\n return;\n }\n const limit = this.options.limit;\n const autoTrim = this.options.autoTrim;\n if (limit === null || limit === void 0 || limit === 0 || autoTrim === false) {\n initialEvaluationDone = true;\n return;\n }\n const initialContentSize = this.storage.characters({ node: newState.doc });\n if (initialContentSize > limit) {\n const over = initialContentSize - limit;\n const from = 0;\n const to = over;\n console.warn(\n `[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`\n );\n const tr = newState.tr.deleteRange(from, to);\n initialEvaluationDone = true;\n return tr;\n }\n initialEvaluationDone = true;\n },\n filterTransaction: (transaction, state) => {\n const limit = this.options.limit;\n if (!transaction.docChanged || limit === 0 || limit === null || limit === void 0) {\n return true;\n }\n const oldSize = this.storage.characters({ node: state.doc });\n const newSize = this.storage.characters({ node: transaction.doc });\n if (newSize <= limit) {\n return true;\n }\n if (oldSize > limit && newSize > limit && newSize <= oldSize) {\n return true;\n }\n if (oldSize > limit && newSize > limit && newSize > oldSize) {\n return false;\n }\n const isPaste = transaction.getMeta(\"paste\");\n if (!isPaste) {\n return false;\n }\n const pos = transaction.selection.$head.pos;\n const over = newSize - limit;\n const from = pos - over;\n const to = pos;\n transaction.deleteRange(from, to);\n const updatedSize = this.storage.characters({ node: transaction.doc });\n if (updatedSize > limit) {\n return false;\n }\n return true;\n }\n })\n ];\n }\n});\n\n// src/drop-cursor/drop-cursor.ts\nimport { Extension as Extension2 } from \"@tiptap/core\";\nimport { dropCursor } from \"@tiptap/pm/dropcursor\";\nvar Dropcursor = Extension2.create({\n name: \"dropCursor\",\n addOptions() {\n return {\n color: \"currentColor\",\n width: 1,\n class: void 0\n };\n },\n addProseMirrorPlugins() {\n return [dropCursor(this.options)];\n }\n});\n\n// src/focus/focus.ts\nimport { Extension as Extension3 } from \"@tiptap/core\";\nimport { Plugin as Plugin2, PluginKey as PluginKey2 } from \"@tiptap/pm/state\";\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\nvar Focus = Extension3.create({\n name: \"focus\",\n addOptions() {\n return {\n className: \"has-focus\",\n mode: \"all\"\n };\n },\n addProseMirrorPlugins() {\n return [\n new Plugin2({\n key: new PluginKey2(\"focus\"),\n props: {\n decorations: ({ doc, selection }) => {\n const { isEditable, isFocused } = this.editor;\n const { anchor } = selection;\n const decorations = [];\n if (!isEditable || !isFocused) {\n return DecorationSet.create(doc, []);\n }\n let maxLevels = 0;\n if (this.options.mode === \"deepest\") {\n doc.descendants((node, pos) => {\n if (node.isText) {\n return;\n }\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;\n if (!isCurrent) {\n return false;\n }\n maxLevels += 1;\n });\n }\n let currentLevel = 0;\n doc.descendants((node, pos) => {\n if (node.isText) {\n return false;\n }\n const isCurrent = anchor >= pos && anchor <= pos + node.nodeSize - 1;\n if (!isCurrent) {\n return false;\n }\n currentLevel += 1;\n const outOfScope = this.options.mode === \"deepest\" && maxLevels - currentLevel > 0 || this.options.mode === \"shallowest\" && currentLevel > 1;\n if (outOfScope) {\n return this.options.mode === \"deepest\";\n }\n decorations.push(\n Decoration.node(pos, pos + node.nodeSize, {\n class: this.options.className\n })\n );\n });\n return DecorationSet.create(doc, decorations);\n }\n }\n })\n ];\n }\n});\n\n// src/gap-cursor/gap-cursor.ts\nimport { callOrReturn, Extension as Extension4, getExtensionField } from \"@tiptap/core\";\nimport { gapCursor } from \"@tiptap/pm/gapcursor\";\nvar Gapcursor = Extension4.create({\n name: \"gapCursor\",\n addProseMirrorPlugins() {\n return [gapCursor()];\n },\n extendNodeSchema(extension) {\n var _a;\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage\n };\n return {\n allowGapCursor: (_a = callOrReturn(getExtensionField(extension, \"allowGapCursor\", context))) != null ? _a : null\n };\n }\n});\n\n// src/placeholder/constants.ts\nimport { PluginKey as PluginKey3 } from \"@tiptap/pm/state\";\nvar DEFAULT_DATA_ATTRIBUTE = \"placeholder\";\nvar PLUGIN_KEY = new PluginKey3(\"tiptap__placeholder\");\n\n// src/placeholder/placeholder.ts\nimport { Extension as Extension5 } from \"@tiptap/core\";\n\n// src/placeholder/plugins/PlaceholderPlugin.ts\nimport { Plugin as Plugin3 } from \"@tiptap/pm/state\";\nimport { DecorationSet as DecorationSet4 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/buildPlaceholderDecorations.ts\nimport { isNodeEmpty } from \"@tiptap/core\";\nimport { DecorationSet as DecorationSet2 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/createPlaceholderDecoration.ts\nimport { Decoration as Decoration2 } from \"@tiptap/pm/view\";\nfunction createPlaceholderDecoration(options) {\n const {\n editor,\n placeholder,\n dataAttribute,\n pos,\n node,\n isEmptyDoc,\n hasAnchor,\n classes: { emptyNode, emptyEditor }\n } = options;\n const classes = [emptyNode];\n if (isEmptyDoc) {\n classes.push(emptyEditor);\n }\n return Decoration2.node(pos, pos + node.nodeSize, {\n class: classes.join(\" \"),\n [dataAttribute]: typeof placeholder === \"function\" ? placeholder({\n editor,\n node,\n pos,\n hasAnchor\n }) : placeholder\n });\n}\n\n// src/placeholder/utils/buildPlaceholderDecorations.ts\nfunction resolveEmptyNodeClass(emptyNodeClass, props) {\n return typeof emptyNodeClass === \"function\" ? emptyNodeClass(props) : emptyNodeClass;\n}\nfunction scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from,\n to\n}) {\n const { anchor } = selection;\n const decorations = [];\n const isEmptyDoc = editor.isEmpty;\n doc.nodesBetween(from, to, (node, pos) => {\n const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;\n const isEmpty = !node.isLeaf && isNodeEmpty(node);\n if (!node.type.isTextblock) {\n return options.includeChildren;\n }\n if ((hasAnchor || !options.showOnlyCurrent) && isEmpty) {\n decorations.push(\n createPlaceholderDecoration({\n editor,\n isEmptyDoc,\n dataAttribute,\n hasAnchor,\n placeholder: options.placeholder,\n classes: {\n emptyEditor: options.emptyEditorClass,\n emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n editor,\n node,\n pos,\n hasAnchor\n })\n },\n node,\n pos\n })\n );\n }\n return options.includeChildren;\n });\n return decorations;\n}\nfunction buildPlaceholderDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection\n}) {\n const active = editor.isEditable || !options.showOnlyWhenEditable;\n if (!active) {\n return null;\n }\n const { anchor } = selection;\n const decorations = [];\n const isEmptyDoc = editor.isEmpty;\n const useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n if (useResolvedPath) {\n const resolved = doc.resolve(anchor);\n const node = resolved.depth > 0 ? resolved.node(1) : resolved.nodeAfter;\n const nodeStart = resolved.depth > 0 ? resolved.before(1) : anchor;\n if (node && node.type.isTextblock && isNodeEmpty(node)) {\n const hasAnchor = anchor >= nodeStart && anchor <= nodeStart + node.nodeSize;\n decorations.push(\n createPlaceholderDecoration({\n editor,\n isEmptyDoc,\n dataAttribute,\n hasAnchor,\n placeholder: options.placeholder,\n classes: {\n emptyEditor: options.emptyEditorClass,\n emptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n editor,\n node,\n pos: nodeStart,\n hasAnchor\n })\n },\n node,\n pos: nodeStart\n })\n );\n }\n } else {\n decorations.push(\n ...scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from: 0,\n to: doc.content.size\n })\n );\n }\n return DecorationSet2.create(doc, decorations);\n}\n\n// src/placeholder/utils/placeholderStateField.ts\nimport { getChangedRanges } from \"@tiptap/core\";\nimport { DecorationSet as DecorationSet3 } from \"@tiptap/pm/view\";\n\n// src/placeholder/utils/resolveTopLevelRange.ts\nfunction resolveTopLevelRange(doc, pos) {\n var _a;\n const resolved = doc.resolve(pos);\n if (resolved.depth === 0) {\n const node2 = (_a = resolved.nodeAfter) != null ? _a : resolved.nodeBefore;\n if (!node2) {\n return { from: pos, to: pos };\n }\n const nodePos = resolved.nodeAfter ? pos : pos - node2.nodeSize;\n return { from: nodePos, to: nodePos + node2.nodeSize };\n }\n const topLevelPos = resolved.before(1);\n const node = resolved.node(1);\n return { from: topLevelPos, to: topLevelPos + node.nodeSize };\n}\nfunction toContentRelativeRange(doc, range) {\n return {\n from: Math.max(0, range.from - 1),\n to: Math.min(doc.content.size, range.to - 1)\n };\n}\nfunction getTopLevelBlocksInRange(doc, from, to) {\n const ranges = [];\n doc.forEach((node, offset) => {\n const nodeStart = offset;\n const nodeEnd = nodeStart + node.nodeSize;\n const absNodeStart = nodeStart + 1;\n const absNodeEnd = nodeEnd + 1;\n if (absNodeStart < to && absNodeEnd > from) {\n ranges.push({ from: nodeStart, to: nodeEnd });\n }\n });\n return ranges;\n}\nfunction mergeRanges(ranges) {\n if (ranges.length === 0) {\n return [];\n }\n const sorted = [...ranges].sort((a, b) => a.from - b.from);\n const merged = [{ ...sorted[0] }];\n for (let i = 1; i < sorted.length; i += 1) {\n const last = merged[merged.length - 1];\n const current = sorted[i];\n if (current.from <= last.to) {\n last.to = Math.max(last.to, current.to);\n } else {\n merged.push({ ...current });\n }\n }\n return merged;\n}\n\n// src/placeholder/utils/placeholderStateField.ts\nfunction collectBlocksForChange(doc, change) {\n const ranges = getTopLevelBlocksInRange(doc, change.from, change.to);\n ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, change.from)));\n if (change.to > change.from) {\n ranges.push(\n toContentRelativeRange(\n doc,\n resolveTopLevelRange(doc, Math.min(change.to, doc.content.size + 1) - 1)\n )\n );\n } else if (change.from < doc.content.size + 1) {\n ranges.push(\n toContentRelativeRange(\n doc,\n resolveTopLevelRange(doc, Math.min(change.from + 1, doc.content.size))\n )\n );\n }\n return ranges;\n}\nfunction collectRescanRanges(tr, oldState, newState) {\n const ranges = [];\n if (tr.docChanged) {\n const changes = getChangedRanges(tr);\n for (const change of changes) {\n ranges.push(...collectBlocksForChange(newState.doc, change.newRange));\n }\n }\n if (tr.selectionSet) {\n ranges.push(\n toContentRelativeRange(\n newState.doc,\n resolveTopLevelRange(newState.doc, tr.mapping.map(oldState.selection.anchor))\n )\n );\n ranges.push(\n toContentRelativeRange(\n newState.doc,\n resolveTopLevelRange(newState.doc, newState.selection.anchor)\n )\n );\n }\n return mergeRanges(ranges);\n}\nfunction clampRange(from, to, doc) {\n const clampedFrom = Math.max(0, Math.min(from, doc.content.size));\n const clampedTo = Math.max(clampedFrom, Math.min(to, doc.content.size));\n return { from: clampedFrom, to: clampedTo };\n}\nfunction updateDecorationsInRanges({\n decorations,\n ranges,\n editor,\n options,\n dataAttribute,\n doc,\n selection\n}) {\n let next = decorations;\n for (const range of ranges) {\n const { from, to } = clampRange(range.from, range.to, doc);\n const existing = next.find(from, to).filter((decoration) => decoration.from >= from && decoration.to <= to);\n if (existing.length) {\n next = next.remove(existing);\n }\n const newDecos = scanRangeForDecorations({\n editor,\n options,\n dataAttribute,\n doc,\n selection,\n from,\n to\n });\n if (newDecos.length) {\n next = next.add(doc, newDecos);\n }\n }\n return next;\n}\nfunction createPlaceholderStateField({\n editor,\n options,\n dataAttribute\n}) {\n return {\n init(_config, state) {\n const decorations = buildPlaceholderDecorations({\n editor,\n options,\n dataAttribute,\n doc: state.doc,\n selection: state.selection\n });\n return decorations != null ? decorations : DecorationSet3.empty;\n },\n apply(tr, prev, oldState, newState) {\n if (!tr.docChanged && !tr.selectionSet) {\n return prev;\n }\n const mapped = prev.map(tr.mapping, tr.doc);\n const ranges = collectRescanRanges(tr, oldState, newState);\n return updateDecorationsInRanges({\n decorations: mapped,\n ranges,\n editor,\n options,\n dataAttribute,\n doc: newState.doc,\n selection: newState.selection\n });\n }\n };\n}\n\n// src/placeholder/utils/preparePlaceholderAttribute.ts\nfunction preparePlaceholderAttribute(attr) {\n return attr.replace(/\\s+/g, \"-\").replace(/[^a-zA-Z0-9-]/g, \"\").replace(/^[0-9-]+/, \"\").replace(/^-+/, \"\").toLowerCase();\n}\n\n// src/placeholder/plugins/PlaceholderPlugin.ts\nfunction createPlaceholderPlugin({ editor, options }) {\n const dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;\n const useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n return new Plugin3({\n key: PLUGIN_KEY,\n ...useResolvedPath ? {} : {\n state: createPlaceholderStateField({ editor, options, dataAttribute })\n },\n props: {\n decorations: useResolvedPath ? ({ doc, selection }) => buildPlaceholderDecorations({ editor, options, dataAttribute, doc, selection }) : (state) => {\n var _a;\n if (options.showOnlyWhenEditable && !editor.isEditable) {\n return DecorationSet4.empty;\n }\n return (_a = PLUGIN_KEY.getState(state)) != null ? _a : DecorationSet4.empty;\n }\n }\n });\n}\n\n// src/placeholder/placeholder.ts\nvar Placeholder = Extension5.create({\n name: \"placeholder\",\n addOptions() {\n return {\n emptyEditorClass: \"is-editor-empty\",\n emptyNodeClass: \"is-empty\",\n dataAttribute: DEFAULT_DATA_ATTRIBUTE,\n placeholder: \"Write something \\u2026\",\n showOnlyWhenEditable: true,\n showOnlyCurrent: true,\n includeChildren: false\n };\n },\n addProseMirrorPlugins() {\n return [createPlaceholderPlugin({ editor: this.editor, options: this.options })];\n }\n});\n\n// src/selection/selection.ts\nimport { Extension as Extension6, isNodeSelection } from \"@tiptap/core\";\nimport { Plugin as Plugin4, PluginKey as PluginKey4 } from \"@tiptap/pm/state\";\nimport { Decoration as Decoration3, DecorationSet as DecorationSet5 } from \"@tiptap/pm/view\";\nfunction shouldSyncDomSelection(state, editor) {\n return !state.selection.empty && !isNodeSelection(state.selection) && editor.isEditable;\n}\nfunction shouldPreserveSelection(state, editor) {\n return shouldSyncDomSelection(state, editor) && !editor.isFocused && !editor.view.dragging;\n}\nfunction clearDomSelection() {\n var _a;\n (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();\n}\nfunction restoreDomSelection(view) {\n view.focus();\n}\nvar Selection = Extension6.create({\n name: \"selection\",\n addOptions() {\n return {\n className: \"selection\"\n };\n },\n addProseMirrorPlugins() {\n const { editor, options } = this;\n return [\n new Plugin4({\n key: new PluginKey4(\"selection\"),\n props: {\n decorations(state) {\n if (!shouldPreserveSelection(state, editor)) {\n return null;\n }\n return DecorationSet5.create(state.doc, [\n Decoration3.inline(state.selection.from, state.selection.to, {\n class: options.className\n })\n ]);\n },\n handleDOMEvents: {\n blur(view) {\n if (!shouldSyncDomSelection(view.state, editor)) {\n return false;\n }\n clearDomSelection();\n return false;\n },\n focus(view) {\n if (!shouldSyncDomSelection(view.state, editor)) {\n return false;\n }\n requestAnimationFrame(() => {\n if (!editor.isDestroyed && view.hasFocus()) {\n restoreDomSelection(view);\n }\n });\n return false;\n }\n }\n }\n })\n ];\n }\n});\n\n// src/trailing-node/trailing-node.ts\nimport { Extension as Extension7 } from \"@tiptap/core\";\nimport { Plugin as Plugin5, PluginKey as PluginKey5 } from \"@tiptap/pm/state\";\nvar skipTrailingNodeMeta = \"skipTrailingNode\";\nfunction nodeEqualsType({\n types,\n node\n}) {\n return node && Array.isArray(types) && types.includes(node.type) || (node == null ? void 0 : node.type) === types;\n}\nvar TrailingNode = Extension7.create({\n name: \"trailingNode\",\n addOptions() {\n return {\n node: void 0,\n notAfter: []\n };\n },\n addProseMirrorPlugins() {\n var _a;\n const plugin = new PluginKey5(this.name);\n const defaultNode = this.options.node || ((_a = this.editor.schema.topNodeType.contentMatch.defaultType) == null ? void 0 : _a.name) || \"paragraph\";\n const disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));\n return [\n new Plugin5({\n key: plugin,\n appendTransaction: (transactions, __, state) => {\n const { doc, tr, schema } = state;\n const shouldInsertNodeAtEnd = plugin.getState(state);\n const endPosition = doc.content.size;\n const type = schema.nodes[defaultNode];\n if (transactions.some((transaction) => transaction.getMeta(skipTrailingNodeMeta))) {\n return;\n }\n if (!shouldInsertNodeAtEnd) {\n return;\n }\n return tr.insert(endPosition, type.create());\n },\n state: {\n init: (_, state) => {\n const lastNode = state.tr.doc.lastChild;\n return !nodeEqualsType({ node: lastNode, types: disabledNodes });\n },\n apply: (tr, value) => {\n if (!tr.docChanged) {\n return value;\n }\n if (tr.getMeta(\"__uniqueIDTransaction\")) {\n return value;\n }\n const lastNode = tr.doc.lastChild;\n return !nodeEqualsType({ node: lastNode, types: disabledNodes });\n }\n }\n })\n ];\n }\n});\n\n// src/undo-redo/undo-redo.ts\nimport { Extension as Extension8 } from \"@tiptap/core\";\nimport { history, redo, undo } from \"@tiptap/pm/history\";\nvar UndoRedo = Extension8.create({\n name: \"undoRedo\",\n addOptions() {\n return {\n depth: 100,\n newGroupDelay: 500\n };\n },\n addCommands() {\n return {\n undo: () => ({ state, dispatch }) => {\n return undo(state, dispatch);\n },\n redo: () => ({ state, dispatch }) => {\n return redo(state, dispatch);\n }\n };\n },\n addProseMirrorPlugins() {\n return [history(this.options)];\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-z\": () => this.editor.commands.undo(),\n \"Shift-Mod-z\": () => this.editor.commands.redo(),\n \"Mod-y\": () => this.editor.commands.redo(),\n // Russian keyboard layouts\n \"Mod-\\u044F\": () => this.editor.commands.undo(),\n \"Shift-Mod-\\u044F\": () => this.editor.commands.redo()\n };\n }\n});\nexport {\n CharacterCount,\n DEFAULT_DATA_ATTRIBUTE,\n Dropcursor,\n Focus,\n Gapcursor,\n PLUGIN_KEY,\n Placeholder,\n Selection,\n TrailingNode,\n UndoRedo,\n preparePlaceholderAttribute,\n skipTrailingNodeMeta\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;AAGqBqB,EAAU,OAAO;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