@burdenoff/microfe-support 2026.1031.1 → 2026.1109.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 (147) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +6 -0
  2. package/dist/dev/main.d.ts +0 -0
  3. package/dist/generated/global-operations.d.ts +60 -60
  4. package/dist/node_modules/@tiptap/core/dist/index.js +949 -674
  5. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  6. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  7. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  8. package/dist/node_modules/@tiptap/extension-code/dist/index.js +14 -3
  9. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  10. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
  11. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  12. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  14. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +4 -1
  15. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  16. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  18. package/dist/node_modules/@tiptap/extension-link/dist/index.js +76 -51
  19. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  20. package/dist/node_modules/@tiptap/extension-list/dist/index.js +143 -127
  21. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  22. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
  23. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  24. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  26. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +21 -11
  28. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extensions/dist/index.js +8 -9
  30. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/react/dist/index.js +70 -49
  32. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  34. package/dist/node_modules/fast-equals/dist/es/index.js +108 -76
  35. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  36. package/dist/node_modules/linkifyjs/dist/linkify.js +127 -113
  37. package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
  38. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
  39. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  40. package/dist/node_modules/prosemirror-history/dist/index.js +21 -14
  41. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  42. package/dist/node_modules/prosemirror-model/dist/index.js +98 -105
  43. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  44. package/dist/node_modules/prosemirror-schema-list/dist/index.js +37 -34
  45. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  46. package/dist/node_modules/prosemirror-transform/dist/index.js +153 -101
  47. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  48. package/dist/node_modules/prosemirror-view/dist/index.js +742 -693
  49. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  50. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +96 -17
  51. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  52. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -0
  53. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  54. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -0
  55. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  56. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -0
  57. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  58. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -0
  59. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  60. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  61. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  62. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
  63. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  64. package/dist/support/SupportAdminRoot.d.ts +2 -2
  65. package/dist/support/SupportAdminRoutes.d.ts +1 -1
  66. package/dist/support/SupportUserRoot.d.ts +2 -2
  67. package/dist/support/SupportUserRoutes.d.ts +1 -1
  68. package/dist/support/components/NotificationToast.d.ts +2 -2
  69. package/dist/support/components/PageLayout.d.ts +4 -4
  70. package/dist/support/components/RouteHelpers.d.ts +1 -1
  71. package/dist/support/components/analytics/CategoryBreakdown.d.ts +1 -1
  72. package/dist/support/components/analytics/MetricCard.d.ts +1 -1
  73. package/dist/support/components/analytics/PriorityBreakdown.d.ts +1 -1
  74. package/dist/support/components/analytics/SLAReport.d.ts +1 -1
  75. package/dist/support/components/analytics/SatisfactionDistribution.d.ts +1 -1
  76. package/dist/support/components/analytics/TopAgents.d.ts +1 -1
  77. package/dist/support/components/analytics/TrendChart.d.ts +1 -1
  78. package/dist/support/components/careers/BulkCandidateActionGuidance.d.ts +1 -1
  79. package/dist/support/components/careers/BulkCandidateDialogs.d.ts +7 -7
  80. package/dist/support/components/careers/BulkOperationFeedback.d.ts +8 -8
  81. package/dist/support/components/careers/BulkSelectionSummary.d.ts +2 -2
  82. package/dist/support/components/careers/RichTextEditor.d.ts +1 -2
  83. package/dist/support/components/careers/RichTextEditor.js.map +1 -1
  84. package/dist/support/components/kb/ArticleForm.d.ts +1 -1
  85. package/dist/support/components/settings/CannedResponsesSettings.d.ts +1 -1
  86. package/dist/support/components/settings/SLAPoliciesSettings.d.ts +1 -1
  87. package/dist/support/components/settings/TicketCategoriesSettings.d.ts +1 -1
  88. package/dist/support/components/tickets/AttachmentList.d.ts +1 -1
  89. package/dist/support/components/tickets/MarkdownContent.d.ts +1 -1
  90. package/dist/support/components/tickets/MessageComposer.d.ts +1 -1
  91. package/dist/support/components/tickets/MessageThread.d.ts +2 -2
  92. package/dist/support/components/tickets/TicketDetailHeader.d.ts +2 -2
  93. package/dist/support/components/tickets/TicketHeader.d.ts +2 -2
  94. package/dist/support/components/tickets/TicketSidebar.d.ts +2 -2
  95. package/dist/support/components/tickets/TriagePanel.d.ts +2 -2
  96. package/dist/support/constants/pipeline.d.ts +0 -6
  97. package/dist/support/events/rybbit.d.ts +1 -1
  98. package/dist/support/hooks/useAnalyticsOperations.d.ts +10 -25
  99. package/dist/support/hooks/useAnalyticsOperations.js +40 -39
  100. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
  101. package/dist/support/hooks/useAttachmentsFailedToast.d.ts +1 -1
  102. package/dist/support/hooks/useChatOperations.d.ts +2 -2
  103. package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +7 -13
  104. package/dist/support/hooks/useKnowledgeBaseOperations.js +84 -83
  105. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  106. package/dist/support/hooks/useRegisterFooter.d.ts +1 -1
  107. package/dist/support/hooks/useSettingsOperations.d.ts +7 -16
  108. package/dist/support/hooks/useSupportAttachments.d.ts +1 -1
  109. package/dist/support/hooks/useTicketListOperations.d.ts +3 -6
  110. package/dist/support/hooks/useTicketOperations.d.ts +5 -11
  111. package/dist/support/hooks/useTicketOperations.js +80 -79
  112. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  113. package/dist/support/pages/AnalyticsPage.d.ts +1 -1
  114. package/dist/support/pages/ArticleDetailAdminPage.d.ts +1 -1
  115. package/dist/support/pages/ArticleDetailUserPage.d.ts +1 -1
  116. package/dist/support/pages/ContactInquiriesPage.d.ts +1 -1
  117. package/dist/support/pages/ContactInquiryDetailPage.d.ts +1 -1
  118. package/dist/support/pages/CreateArticlePage.d.ts +1 -1
  119. package/dist/support/pages/CreateTicketPage.d.ts +1 -1
  120. package/dist/support/pages/EditArticlePage.d.ts +1 -1
  121. package/dist/support/pages/InterviewersPage.d.ts +1 -1
  122. package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -2
  123. package/dist/support/pages/JobApplicationsPage.d.ts +1 -1
  124. package/dist/support/pages/JobPostingDetailPage.d.ts +1 -1
  125. package/dist/support/pages/JobPostingsPage.d.ts +1 -1
  126. package/dist/support/pages/KnowledgeBaseAdminPage.d.ts +1 -1
  127. package/dist/support/pages/KnowledgeBaseUserPage.d.ts +1 -1
  128. package/dist/support/pages/SettingsPage.d.ts +1 -1
  129. package/dist/support/pages/SettingsPage.js.map +1 -1
  130. package/dist/support/pages/TicketDetailAdminPage.d.ts +1 -1
  131. package/dist/support/pages/TicketDetailUserPage.d.ts +1 -1
  132. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  133. package/dist/support/pages/TicketListPage.d.ts +1 -1
  134. package/dist/support/providers/SupportProvider.d.ts +2 -2
  135. package/dist/support/store/supportStore.d.ts +2 -2
  136. package/dist/support/utils/bulkCandidateTargetQuery.d.ts +1 -1
  137. package/dist/support/utils/cn.d.ts +1 -1
  138. package/dist/support/utils/index.d.ts +1 -1
  139. package/dist/support/utils/markdown.d.ts +0 -1
  140. package/dist/support/utils/refetch.d.ts +12 -0
  141. package/dist/support/utils/refetch.js +7 -0
  142. package/dist/support/utils/refetch.js.map +1 -0
  143. package/dist/support/utils/ticketFilters.d.ts +2 -2
  144. package/dist/support/utils/uiTokens.d.ts +1 -1
  145. package/dist/test/dom.d.ts +1 -0
  146. package/dist/test/setup.d.ts +1 -0
  147. package/package.json +65 -54
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Underline","Mark","style","mergeAttributes","HTMLAttributes","helpers","token","node","src","match","innerContent","lexer","commands"],"sources":["../../../../../node_modules/@tiptap/extension-underline/dist/index.js"],"sourcesContent":["// src/underline.ts\nimport { Mark, mergeAttributes } from \"@tiptap/core\";\nvar Underline = Mark.create({\n name: \"underline\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"u\"\n },\n {\n style: \"text-decoration\",\n consuming: false,\n getAttrs: (style) => style.includes(\"underline\") ? {} : false\n }\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"u\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n parseMarkdown(token, helpers) {\n return helpers.applyMark(this.name || \"underline\", helpers.parseInline(token.tokens || []));\n },\n renderMarkdown(node, helpers) {\n return `++${helpers.renderChildren(node)}++`;\n },\n markdownTokenizer: {\n name: \"underline\",\n level: \"inline\",\n start(src) {\n return src.indexOf(\"++\");\n },\n tokenize(src, _tokens, lexer) {\n const rule = /^(\\+\\+)([\\s\\S]+?)(\\+\\+)/;\n const match = rule.exec(src);\n if (!match) {\n return void 0;\n }\n const innerContent = match[2].trim();\n return {\n type: \"underline\",\n raw: match[0],\n text: innerContent,\n tokens: lexer.inlineTokens(innerContent)\n };\n }\n },\n addCommands() {\n return {\n setUnderline: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleUnderline: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetUnderline: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-u\": () => this.editor.commands.toggleUnderline(),\n \"Mod-U\": () => this.editor.commands.toggleUnderline()\n };\n }\n});\n\n// src/index.ts\nvar index_default = Underline;\nexport {\n Underline,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAEA,IAAIA,IAAYC,EAAK,OAAO;CAC1B,MAAM;CACN,aAAa;EACX,OAAO,EACL,gBAAgB,CAAC,EACnB;CACF;CACA,YAAY;EACV,OAAO,CACL,EACE,KAAK,IACP,GACA;GACE,OAAO;GACP,WAAW;GACX,WAAW,MAAUC,EAAM,SAAS,WAAW,IAAI,CAAC,IAAI;EAC1D,CACF;CACF;CACA,WAAW,EAAE,qBAAkB;EAC7B,OAAO;GAAC;GAAKC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAAG;EAAC;CAC9E;CACA,cAAc,GAAO,GAAS;EAC5B,OAAOC,EAAQ,UAAU,KAAK,QAAQ,aAAaA,EAAQ,YAAYC,EAAM,UAAU,CAAC,CAAC,CAAC;CAC5F;CACA,eAAe,GAAM,GAAS;EAC5B,OAAO,KAAKD,EAAQ,eAAeE,CAAI,EAAE;CAC3C;CACA,mBAAmB;EACjB,MAAM;EACN,OAAO;EACP,MAAM,GAAK;GACT,OAAOC,EAAI,QAAQ,IAAI;EACzB;EACA,SAAS,GAAK,GAAS,GAAO;GAE5B,IAAMC,IAAQ,0BAAK,KAAKD,CAAG;GAC3B,IAAI,CAACC,GACH;GAEF,IAAMC,IAAeD,EAAM,EAAE,CAAC,KAAK;GACnC,OAAO;IACL,MAAM;IACN,KAAKA,EAAM;IACX,MAAMC;IACN,QAAQC,EAAM,aAAaD,CAAY;GACzC;EACF;CACF;CACA,cAAc;EACZ,OAAO;GACL,qBAAqB,EAAE,kBACdE,EAAS,QAAQ,KAAK,IAAI;GAEnC,wBAAwB,EAAE,kBACjBA,EAAS,WAAW,KAAK,IAAI;GAEtC,uBAAuB,EAAE,kBAChBA,EAAS,UAAU,KAAK,IAAI;EAEvC;CACF;CACA,uBAAuB;EACrB,OAAO;GACL,eAAe,KAAK,OAAO,SAAS,gBAAgB;GACpD,eAAe,KAAK,OAAO,SAAS,gBAAgB;EACtD;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Underline","Mark","style","mergeAttributes","HTMLAttributes","helpers","token","node","src","delimiters","match","codeSpan","text","lexer","commands"],"sources":["../../../../../node_modules/@tiptap/extension-underline/dist/index.js"],"sourcesContent":["import { Mark, mergeAttributes } from \"@tiptap/core\";\n//#region src/underline.ts\n/**\n* This extension allows you to create underline text.\n* @see https://www.tiptap.dev/api/marks/underline\n*/\nconst Underline = Mark.create({\n\tname: \"underline\",\n\taddOptions() {\n\t\treturn { HTMLAttributes: {} };\n\t},\n\tparseHTML() {\n\t\treturn [{ tag: \"u\" }, {\n\t\t\tstyle: \"text-decoration\",\n\t\t\tconsuming: false,\n\t\t\tgetAttrs: (style) => style.includes(\"underline\") ? {} : false\n\t\t}];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"u\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\tparseMarkdown(token, helpers) {\n\t\treturn helpers.applyMark(this.name || \"underline\", helpers.parseInline(token.tokens || []));\n\t},\n\trenderMarkdown(node, helpers) {\n\t\treturn `<u>${helpers.renderChildren(node)}</u>`;\n\t},\n\tmarkdownTokenizer: {\n\t\tname: \"underline\",\n\t\tlevel: \"inline\",\n\t\tstart(src) {\n\t\t\treturn src.toLowerCase().indexOf(\"<u>\");\n\t\t},\n\t\ttokenize(src, _tokens, lexer) {\n\t\t\tif (!/^<u>/i.test(src)) return;\n\t\t\tconst delimiters = /\\\\[\\s\\S]|`+|<\\/u>/gi;\n\t\t\tdelimiters.lastIndex = 3;\n\t\t\tlet match = delimiters.exec(src);\n\t\t\twhile (match) {\n\t\t\t\tif (match[0].startsWith(\"`\")) {\n\t\t\t\t\tconst codeSpan = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/.exec(src.slice(match.index));\n\t\t\t\t\tif (codeSpan) delimiters.lastIndex = match.index + codeSpan[0].length;\n\t\t\t\t} else if (!match[0].startsWith(\"\\\\\")) {\n\t\t\t\t\tconst text = src.slice(3, match.index);\n\t\t\t\t\tif (!text) return;\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"underline\",\n\t\t\t\t\t\traw: src.slice(0, delimiters.lastIndex),\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\ttokens: lexer.inlineTokens(text)\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tmatch = delimiters.exec(src);\n\t\t\t}\n\t\t}\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetUnderline: () => ({ commands }) => {\n\t\t\t\treturn commands.setMark(this.name);\n\t\t\t},\n\t\t\ttoggleUnderline: () => ({ commands }) => {\n\t\t\t\treturn commands.toggleMark(this.name);\n\t\t\t},\n\t\t\tunsetUnderline: () => ({ commands }) => {\n\t\t\t\treturn commands.unsetMark(this.name);\n\t\t\t}\n\t\t};\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-u\": () => this.editor.commands.toggleUnderline(),\n\t\t\t\"Mod-U\": () => this.editor.commands.toggleUnderline()\n\t\t};\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Underline;\n//#endregion\nexport { Underline, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAMA,IAAMA,IAAYC,EAAK,OAAO;CAC7B,MAAM;CACN,aAAa;EACZ,OAAO,EAAE,gBAAgB,CAAC,EAAE;CAC7B;CACA,YAAY;EACX,OAAO,CAAC,EAAE,KAAK,IAAI,GAAG;GACrB,OAAO;GACP,WAAW;GACX,WAAW,MAAUC,EAAM,SAAS,WAAW,IAAI,CAAC,IAAI;EACzD,CAAC;CACF;CACA,WAAW,EAAE,qBAAkB;EAC9B,OAAO;GACN;GACAC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAC3D;EACD;CACD;CACA,cAAc,GAAO,GAAS;EAC7B,OAAO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,8 +222,8 @@ function C(e, t) {
222
222
  }
223
223
  function w(e, t) {
224
224
  return {
225
- from: Math.max(0, t.from - 1),
226
- to: Math.min(e.content.size, t.to - 1)
225
+ from: Math.max(0, t.from),
226
+ to: Math.min(e.content.size, t.to)
227
227
  };
228
228
  }
229
229
  function T(e, t, n) {
@@ -387,11 +387,10 @@ e.create({
387
387
  })];
388
388
  }
389
389
  });
390
- var z = "skipTrailingNode";
391
- function B({ types: e, node: t }) {
390
+ function z({ types: e, node: t }) {
392
391
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
393
392
  }
394
- var V = e.create({
393
+ var B = e.create({
395
394
  name: "trailingNode",
396
395
  addOptions() {
397
396
  return {
@@ -410,7 +409,7 @@ var V = e.create({
410
409
  state: {
411
410
  init: (e, t) => {
412
411
  let r = t.tr.doc.lastChild;
413
- return !B({
412
+ return !z({
414
413
  node: r,
415
414
  types: n
416
415
  });
@@ -418,7 +417,7 @@ var V = e.create({
418
417
  apply: (e, t) => {
419
418
  if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
420
419
  let r = e.doc.lastChild;
421
- return !B({
420
+ return !z({
422
421
  node: r,
423
422
  types: n
424
423
  });
@@ -426,7 +425,7 @@ var V = e.create({
426
425
  }
427
426
  })];
428
427
  }
429
- }), H = e.create({
428
+ }), V = e.create({
430
429
  name: "undoRedo",
431
430
  addOptions() {
432
431
  return {
@@ -453,6 +452,6 @@ var V = e.create({
453
452
  };
454
453
  }
455
454
  });
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 };
455
+ export { _ as DEFAULT_DATA_ATTRIBUTE, h as Dropcursor, g as Gapcursor, v as PLUGIN_KEY, P as Placeholder, B as TrailingNode, V as UndoRedo, M as preparePlaceholderAttribute };
457
456
 
458
457
  //# 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","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;CACpC,MAAM;CACN,aAAa;EACX,OAAO;GACL,OAAO;GACP,UAAU;GACV,MAAM;GACN,cAAc,MAASC,EAAK;GAC5B,cAAc,MAASA,EAAK,MAAM,GAAG,CAAC,CAAC,QAAQ,MAASC,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,IAAMC,IAAQC,GAAmC,QAAS,KAAK,OAAO,MAAM;GAE5E,KADcA,GAAmC,QAAS,KAAK,QAAQ,UAC1D,YAAY;IACvB,IAAMH,IAAOE,EAAK,YAAY,GAAGA,EAAK,QAAQ,MAAM,KAAK,GAAG,GAAG;IAC/D,OAAO,KAAK,QAAQ,YAAYF,CAAI;GACtC;GACA,OAAOE,EAAK;EACd,GACA,KAAK,QAAQ,SAAS,MAAY;GAChC,IAAMA,IAAQC,GAAmC,QAAS,KAAK,OAAO,MAAM,KACtEH,IAAOE,EAAK,YAAY,GAAGA,EAAK,QAAQ,MAAM,KAAK,GAAG;GAC5D,OAAO,KAAK,QAAQ,YAAYF,CAAI;EACtC;CACF;CACA,wBAAwB;EACtB,IAAII,IAAwB;EAC5B,OAAO,CACL,IAAIC,EAAO;GACT,KAAK,IAAIC,EAAU,gBAAgB;GACnC,oBAAoB,GAAc,GAAU,MAAa;IACvD,IAAIF,GACF;IAEF,IAAMG,IAAQ,KAAK,QAAQ,OACrBC,IAAW,KAAK,QAAQ;IAC9B,IAAID,KAAU,QAA4BA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AOC,EAAO,MAAMN;IAC1B,IAAI,GAAa,MAAM,MAAgBhG,EAAY,QAAA,kBAA4B,CAAC,KAG3EmG,GAGL,OAAOpG,EAAG,OAAOqG,GAAaC,EAAK,OAAO,CAAC;GAC7C;GACA,OAAO;IACL,OAAO,GAAG,MAAU;KAClB,IAAME,IAAWrG,EAAM,GAAG,IAAI;KAC9B,OAAO,CAAC0F,EAAe;MAAE,MAAMW;MAAU,OAAON;KAAc,CAAC;IACjE;IACA,QAAQ,GAAI,MAAU;KAIpB,IAHI,CAAClG,EAAG,cAGJA,EAAG,QAAQ,uBAAuB,GACpC,OAAOmG;KAET,IAAMK,IAAWxG,EAAG,IAAI;KACxB,OAAO,CAAC6F,EAAe;MAAE,MAAMW;MAAU,OAAON;KAAc,CAAC;IACjE;GACF;EACF,CAAC,CACH;CACF;AACF,CAAC,GAKGO,IAAWvH,EAAW,OAAO;CAC/B,MAAM;CACN,aAAa;EACX,OAAO;GACL,OAAO;GACP,eAAe;EACjB;CACF;CACA,cAAc;EACZ,OAAO;GACL,aAAa,EAAE,UAAO,kBACbwH,EAAKvG,GAAOwG,CAAQ;GAE7B,aAAa,EAAE,UAAO,kBACbC,EAAKzG,GAAOwG,CAAQ;EAE/B;CACF;CACA,wBAAwB;EACtB,OAAO,CAACE,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":["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","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","_window$getSelection","restoreDomSelection","view","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":["import { Extension, callOrReturn, getChangedRanges, getExtensionField, isNodeEmpty, isNodeSelection } from \"@tiptap/core\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport { dropCursor } from \"@tiptap/pm/dropcursor\";\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\nimport { gapCursor } from \"@tiptap/pm/gapcursor\";\nimport { history, redo, undo } from \"@tiptap/pm/history\";\n//#region src/character-count/character-count.ts\n/**\n* This extension allows you to count the characters and words of your document.\n* @see https://tiptap.dev/api/extensions/character-count\n*/\nconst CharacterCount = Extension.create({\n\tname: \"characterCount\",\n\taddOptions() {\n\t\treturn {\n\t\t\tlimit: null,\n\t\t\tautoTrim: true,\n\t\t\tmode: \"textSize\",\n\t\t\ttextCounter: (text) => text.length,\n\t\t\twordCounter: (text) => text.split(\" \").filter((word) => word !== \"\").length\n\t\t};\n\t},\n\taddStorage() {\n\t\treturn {\n\t\t\tcharacters: () => 0,\n\t\t\twords: () => 0\n\t\t};\n\t},\n\tonBeforeCreate() {\n\t\tthis.storage.characters = (options) => {\n\t\t\tconst node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;\n\t\t\tif (((options === null || options === void 0 ? void 0 : options.mode) || this.options.mode) === \"textSize\") {\n\t\t\t\tconst text = node.textBetween(0, node.content.size, void 0, \" \");\n\t\t\t\treturn this.options.textCounter(text);\n\t\t\t}\n\t\t\treturn node.nodeSize;\n\t\t};\n\t\tthis.storage.words = (options) => {\n\t\t\tconst node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;\n\t\t\tconst text = node.textBetween(0, node.content.size, \" \", \" \");\n\t\t\treturn this.options.wordCounter(text);\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\tlet initialEvaluationDone = false;\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"characterCount\"),\n\t\t\tappendTransaction: (transactions, oldState, newState) => {\n\t\t\t\tif (initialEvaluationDone) return;\n\t\t\t\tconst limit = this.options.limit;\n\t\t\t\tconst autoTrim = this.options.autoTrim;\n\t\t\t\tif (limit === null || limit === void 0 || limit === 0 || autoTrim === false) {\n\t\t\t\t\tinitialEvaluationDone = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst initialContentSize = this.storage.characters({ node: newState.doc });\n\t\t\t\tif (initialContentSize > limit) {\n\t\t\t\t\tconst over = initialContentSize - limit;\n\t\t\t\t\tconst from = 0;\n\t\t\t\t\tconst to = over;\n\t\t\t\t\tconsole.warn(`[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`);\n\t\t\t\t\tconst tr = newState.tr.deleteRange(from, to);\n\t\t\t\t\tinitialEvaluationDone = true;\n\t\t\t\t\treturn tr;\n\t\t\t\t}\n\t\t\t\tinitialEvaluationDone = true;\n\t\t\t},\n\t\t\tfilterTransaction: (transaction, state) => {\n\t\t\t\tconst limit = this.options.limit;\n\t\t\t\tif (!transaction.docChanged || limit === 0 || limit === null || limit === void 0) return true;\n\t\t\t\tconst oldSize = this.storage.characters({ node: state.doc });\n\t\t\t\tconst newSize = this.storage.characters({ node: transaction.doc });\n\t\t\t\tif (newSize <= limit) return true;\n\t\t\t\tif (oldSize > limit && newSize > limit && newSize <= oldSize) return true;\n\t\t\t\tif (oldSize > limit && newSize > limit && newSize > oldSize) return false;\n\t\t\t\tif (!transaction.getMeta(\"paste\")) return false;\n\t\t\t\tconst pos = transaction.selection.$head.pos;\n\t\t\t\tconst from = pos - (newSize - limit);\n\t\t\t\tconst to = pos;\n\t\t\t\ttransaction.deleteRange(from, to);\n\t\t\t\tif (this.storage.characters({ node: transaction.doc }) > limit) return false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/drop-cursor/drop-cursor.ts\n/**\n* This extension allows you to add a drop cursor to your editor.\n* A drop cursor is a line that appears when you drag and drop content\n* in-between nodes.\n* @see https://tiptap.dev/api/extensions/dropcursor\n*/\nconst Dropcursor = Extension.create({\n\tname: \"dropCursor\",\n\taddOptions() {\n\t\treturn {\n\t\t\tcolor: \"currentColor\",\n\t\t\twidth: 1,\n\t\t\tclass: void 0\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [dropCursor(this.options)];\n\t}\n});\n//#endregion\n//#region src/focus/focus.ts\n/**\n* This extension allows you to add a class to the focused node.\n* @see https://www.tiptap.dev/api/extensions/focus\n*/\nconst Focus = Extension.create({\n\tname: \"focus\",\n\taddOptions() {\n\t\treturn {\n\t\t\tclassName: \"has-focus\",\n\t\t\tmode: \"all\"\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"focus\"),\n\t\t\tprops: { decorations: ({ doc, selection }) => {\n\t\t\t\tconst { isEditable, isFocused } = this.editor;\n\t\t\t\tconst { anchor } = selection;\n\t\t\t\tconst decorations = [];\n\t\t\t\tif (!isEditable || !isFocused) return DecorationSet.create(doc, []);\n\t\t\t\tlet maxLevels = 0;\n\t\t\t\tif (this.options.mode === \"deepest\") doc.descendants((node, pos) => {\n\t\t\t\t\tif (node.isText) return;\n\t\t\t\t\tif (!(anchor >= pos && anchor <= pos + node.nodeSize - 1)) return false;\n\t\t\t\t\tmaxLevels += 1;\n\t\t\t\t});\n\t\t\t\tlet currentLevel = 0;\n\t\t\t\tdoc.descendants((node, pos) => {\n\t\t\t\t\tif (node.isText) return false;\n\t\t\t\t\tif (!(anchor >= pos && anchor <= pos + node.nodeSize - 1)) return false;\n\t\t\t\t\tcurrentLevel += 1;\n\t\t\t\t\tif (this.options.mode === \"deepest\" && maxLevels - currentLevel > 0 || this.options.mode === \"shallowest\" && currentLevel > 1) return this.options.mode === \"deepest\";\n\t\t\t\t\tdecorations.push(Decoration.node(pos, pos + node.nodeSize, { class: this.options.className }));\n\t\t\t\t});\n\t\t\t\treturn DecorationSet.create(doc, decorations);\n\t\t\t} }\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/gap-cursor/gap-cursor.ts\n/**\n* This extension allows you to add a gap cursor to your editor.\n* A gap cursor is a cursor that appears when you click on a place\n* where no content is present, for example inbetween nodes.\n* @see https://tiptap.dev/api/extensions/gapcursor\n*/\nconst Gapcursor = Extension.create({\n\tname: \"gapCursor\",\n\taddProseMirrorPlugins() {\n\t\treturn [gapCursor()];\n\t},\n\textendNodeSchema(extension) {\n\t\tvar _callOrReturn;\n\t\tconst context = {\n\t\t\tname: extension.name,\n\t\t\toptions: extension.options,\n\t\t\tstorage: extension.storage\n\t\t};\n\t\treturn { allowGapCursor: (_callOrReturn = callOrReturn(getExtensionField(extension, \"allowGapCursor\", context))) !== null && _callOrReturn !== void 0 ? _callOrReturn : null };\n\t}\n});\n//#endregion\n//#region src/placeholder/constants.ts\n/** The default data attribute label */\nconst DEFAULT_DATA_ATTRIBUTE = \"placeholder\";\n/** The plugin key used to store and read the placeholder decoration set */\nconst PLUGIN_KEY = new PluginKey(\"tiptap__placeholder\");\n//#endregion\n//#region src/placeholder/utils/createPlaceholderDecoration.ts\n/**\n* Creates a ProseMirror node decoration that applies a placeholder\n* CSS class and data attribute to an empty node.\n* @param options.editor - The editor instance\n* @param options.pos - The position of the node in the document\n* @param options.node - The ProseMirror node\n* @param options.isEmptyDoc - Whether the entire document is empty\n* @param options.hasAnchor - Whether the selection anchor is within the node\n* @param options.dataAttribute - The data attribute name (e.g. `data-placeholder`)\n* @param options.classes - CSS classes for empty nodes and the empty editor\n* @param options.placeholder - The placeholder text or a function that returns it\n* @returns A ProseMirror node decoration with placeholder classes and data attribute\n*/\nfunction createPlaceholderDecoration(options) {\n\tconst { editor, placeholder, dataAttribute, pos, node, isEmptyDoc, hasAnchor, classes: { emptyNode, emptyEditor } } = options;\n\tconst classes = [emptyNode];\n\tif (isEmptyDoc) classes.push(emptyEditor);\n\treturn Decoration.node(pos, pos + node.nodeSize, {\n\t\tclass: classes.join(\" \"),\n\t\t[dataAttribute]: typeof placeholder === \"function\" ? placeholder({\n\t\t\teditor,\n\t\t\tnode,\n\t\t\tpos,\n\t\t\thasAnchor\n\t\t}) : placeholder\n\t});\n}\n//#endregion\n//#region src/placeholder/utils/buildPlaceholderDecorations.ts\nfunction resolveEmptyNodeClass(emptyNodeClass, props) {\n\treturn typeof emptyNodeClass === \"function\" ? emptyNodeClass(props) : emptyNodeClass;\n}\n/**\n* Scans a document range for empty textblocks that should receive placeholder\n* decorations. Used by the slow path and incremental state updates.\n*/\nfunction scanRangeForDecorations({ editor, options, dataAttribute, doc, selection, from, to }) {\n\tconst { anchor } = selection;\n\tconst decorations = [];\n\tconst isEmptyDoc = editor.isEmpty;\n\tdoc.nodesBetween(from, to, (node, pos) => {\n\t\tconst hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;\n\t\tconst isEmpty = !node.isLeaf && isNodeEmpty(node);\n\t\tif (!node.type.isTextblock) return options.includeChildren;\n\t\tif ((hasAnchor || !options.showOnlyCurrent) && isEmpty) decorations.push(createPlaceholderDecoration({\n\t\t\teditor,\n\t\t\tisEmptyDoc,\n\t\t\tdataAttribute,\n\t\t\thasAnchor,\n\t\t\tplaceholder: options.placeholder,\n\t\t\tclasses: {\n\t\t\t\temptyEditor: options.emptyEditorClass,\n\t\t\t\temptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n\t\t\t\t\teditor,\n\t\t\t\t\tnode,\n\t\t\t\t\tpos,\n\t\t\t\t\thasAnchor\n\t\t\t\t})\n\t\t\t},\n\t\t\tnode,\n\t\t\tpos\n\t\t}));\n\t\treturn options.includeChildren;\n\t});\n\treturn decorations;\n}\n/**\n* Builds the placeholder decorations for the current document state.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @param options.dataAttribute - The prepared `data-*` attribute name.\n* @param options.doc - The current document node.\n* @param options.selection - The current selection.\n* @returns A decoration set, or `null` when no placeholders should be shown.\n*/\nfunction buildPlaceholderDecorations({ editor, options, dataAttribute, doc, selection }) {\n\tif (!(editor.isEditable || !options.showOnlyWhenEditable)) return null;\n\tconst { anchor } = selection;\n\tconst decorations = [];\n\tconst isEmptyDoc = editor.isEmpty;\n\tif (options.showOnlyCurrent && !options.includeChildren) {\n\t\tconst resolved = doc.resolve(anchor);\n\t\tconst node = resolved.depth > 0 ? resolved.node(1) : resolved.nodeAfter;\n\t\tconst nodeStart = resolved.depth > 0 ? resolved.before(1) : anchor;\n\t\tif (node && node.type.isTextblock && isNodeEmpty(node)) {\n\t\t\tconst hasAnchor = anchor >= nodeStart && anchor <= nodeStart + node.nodeSize;\n\t\t\tdecorations.push(createPlaceholderDecoration({\n\t\t\t\teditor,\n\t\t\t\tisEmptyDoc,\n\t\t\t\tdataAttribute,\n\t\t\t\thasAnchor,\n\t\t\t\tplaceholder: options.placeholder,\n\t\t\t\tclasses: {\n\t\t\t\t\temptyEditor: options.emptyEditorClass,\n\t\t\t\t\temptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n\t\t\t\t\t\teditor,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tpos: nodeStart,\n\t\t\t\t\t\thasAnchor\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tnode,\n\t\t\t\tpos: nodeStart\n\t\t\t}));\n\t\t}\n\t} else decorations.push(...scanRangeForDecorations({\n\t\teditor,\n\t\toptions,\n\t\tdataAttribute,\n\t\tdoc,\n\t\tselection,\n\t\tfrom: 0,\n\t\tto: doc.content.size\n\t}));\n\treturn DecorationSet.create(doc, decorations);\n}\n//#endregion\n//#region src/placeholder/utils/resolveTopLevelRange.ts\n/**\n* Resolves a document position to the `[from, to)` range of its containing\n* top-level block node in absolute document positions.\n*/\nfunction resolveTopLevelRange(doc, pos) {\n\tconst resolved = doc.resolve(pos);\n\tif (resolved.depth === 0) {\n\t\tvar _resolved$nodeAfter;\n\t\tconst node = (_resolved$nodeAfter = resolved.nodeAfter) !== null && _resolved$nodeAfter !== void 0 ? _resolved$nodeAfter : resolved.nodeBefore;\n\t\tif (!node) return {\n\t\t\tfrom: pos,\n\t\t\tto: pos\n\t\t};\n\t\tconst nodePos = resolved.nodeAfter ? pos : pos - node.nodeSize;\n\t\treturn {\n\t\t\tfrom: nodePos,\n\t\t\tto: nodePos + node.nodeSize\n\t\t};\n\t}\n\tconst topLevelPos = resolved.before(1);\n\treturn {\n\t\tfrom: topLevelPos,\n\t\tto: topLevelPos + resolved.node(1).nodeSize\n\t};\n}\n/**\n* Clamps a top-level block range from `resolveTopLevelRange` to the document\n* content, giving the positions used by `Node#nodesBetween` and `Node#forEach`\n* offsets.\n*\n* A top-level node at `Node#forEach` offset `n` already sits at document\n* position `n`, so the range must not be shifted: a node decoration spans\n* exactly `[n, n + nodeSize]` and has to stay inside the range to be replaced.\n*/\nfunction toContentRelativeRange(doc, range) {\n\treturn {\n\t\tfrom: Math.max(0, range.from),\n\t\tto: Math.min(doc.content.size, range.to)\n\t};\n}\n/**\n* Returns the top-level block ranges that intersect a document change range.\n* Input `from`/`to` are absolute positions (e.g. from `getChangedRanges`).\n* Returned ranges are content-relative, matching `Node#forEach` offsets.\n*/\nfunction getTopLevelBlocksInRange(doc, from, to) {\n\tconst ranges = [];\n\tdoc.forEach((node, offset) => {\n\t\tconst nodeStart = offset;\n\t\tconst nodeEnd = nodeStart + node.nodeSize;\n\t\tconst absNodeStart = nodeStart + 1;\n\t\tconst absNodeEnd = nodeEnd + 1;\n\t\tif (absNodeStart < to && absNodeEnd > from) ranges.push({\n\t\t\tfrom: nodeStart,\n\t\t\tto: nodeEnd\n\t\t});\n\t});\n\treturn ranges;\n}\n/**\n* Sorts ranges by start position and merges overlapping or adjacent ranges.\n*/\nfunction mergeRanges(ranges) {\n\tif (ranges.length === 0) return [];\n\tconst sorted = [...ranges].sort((a, b) => a.from - b.from);\n\tconst merged = [{ ...sorted[0] }];\n\tfor (let i = 1; i < sorted.length; i += 1) {\n\t\tconst last = merged[merged.length - 1];\n\t\tconst current = sorted[i];\n\t\tif (current.from <= last.to) last.to = Math.max(last.to, current.to);\n\t\telse merged.push({ ...current });\n\t}\n\treturn merged;\n}\n//#endregion\n//#region src/placeholder/utils/placeholderStateField.ts\n/**\n* Expands a single changed range to the top-level blocks it touches.\n* Also resolves blocks at range boundaries so split/merge edits update\n* adjacent empty nodes (e.g. a new paragraph after Enter).\n*/\nfunction collectBlocksForChange(doc, change) {\n\tconst ranges = getTopLevelBlocksInRange(doc, change.from, change.to);\n\tranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, change.from)));\n\tif (change.to > change.from) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.to, doc.content.size + 1) - 1)));\n\telse if (change.from < doc.content.size + 1) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.from + 1, doc.content.size))));\n\treturn ranges;\n}\n/**\n* Collects content-relative top-level block ranges that need placeholder\n* decorations recomputed after a transaction.\n*/\nfunction collectRescanRanges(tr, oldState, newState) {\n\tconst ranges = [];\n\tif (tr.docChanged) {\n\t\tconst changes = getChangedRanges(tr);\n\t\tfor (const change of changes) ranges.push(...collectBlocksForChange(newState.doc, change.newRange));\n\t}\n\tif (tr.selectionSet) {\n\t\tranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, tr.mapping.map(oldState.selection.anchor))));\n\t\tranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, newState.selection.anchor)));\n\t}\n\treturn mergeRanges(ranges);\n}\n/** Clamps a content-relative range to `[0, doc.content.size]`. */\nfunction clampRange(from, to, doc) {\n\tconst clampedFrom = Math.max(0, Math.min(from, doc.content.size));\n\treturn {\n\t\tfrom: clampedFrom,\n\t\tto: Math.max(clampedFrom, Math.min(to, doc.content.size))\n\t};\n}\n/**\n* Removes and rebuilds placeholder decorations within the given ranges.\n* Only drops decorations fully contained in a range so mapped decorations\n* on neighbouring blocks (e.g. at a block boundary) are kept intact.\n*/\nfunction updateDecorationsInRanges({ decorations, ranges, editor, options, dataAttribute, doc, selection }) {\n\tlet next = decorations;\n\tfor (const range of ranges) {\n\t\tconst { from, to } = clampRange(range.from, range.to, doc);\n\t\tconst existing = next.find(from, to).filter((decoration) => decoration.from >= from && decoration.to <= to);\n\t\tif (existing.length) next = next.remove(existing);\n\t\tconst newDecos = scanRangeForDecorations({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute,\n\t\t\tdoc,\n\t\t\tselection,\n\t\t\tfrom,\n\t\t\tto\n\t\t});\n\t\tif (newDecos.length) next = next.add(doc, newDecos);\n\t}\n\treturn next;\n}\n/**\n* Creates the incremental `StateField<DecorationSet>` used by the slow path\n* (`showOnlyCurrent: false` or `includeChildren: true`).\n*\n* Decorations are mapped through each transaction and only recomputed for\n* top-level blocks touched by document or selection changes.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @param options.dataAttribute - The prepared `data-*` attribute name.\n* @returns A ProseMirror state field storing the placeholder decoration set.\n*/\nfunction createPlaceholderStateField({ editor, options, dataAttribute }) {\n\treturn {\n\t\tinit(_config, state) {\n\t\t\tconst decorations = buildPlaceholderDecorations({\n\t\t\t\teditor,\n\t\t\t\toptions,\n\t\t\t\tdataAttribute,\n\t\t\t\tdoc: state.doc,\n\t\t\t\tselection: state.selection\n\t\t\t});\n\t\t\treturn decorations !== null && decorations !== void 0 ? decorations : DecorationSet.empty;\n\t\t},\n\t\tapply(tr, prev, oldState, newState) {\n\t\t\tif (!tr.docChanged && !tr.selectionSet) return prev;\n\t\t\treturn updateDecorationsInRanges({\n\t\t\t\tdecorations: prev.map(tr.mapping, tr.doc),\n\t\t\t\tranges: collectRescanRanges(tr, oldState, newState),\n\t\t\t\teditor,\n\t\t\t\toptions,\n\t\t\t\tdataAttribute,\n\t\t\t\tdoc: newState.doc,\n\t\t\t\tselection: newState.selection\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/placeholder/utils/preparePlaceholderAttribute.ts\n/**\n* Prepares the placeholder attribute by ensuring it is properly formatted.\n* @param attr - The placeholder attribute string.\n* @returns The prepared placeholder attribute string.\n*/\nfunction preparePlaceholderAttribute(attr) {\n\treturn attr.replace(/\\s+/g, \"-\").replace(/[^a-zA-Z0-9-]/g, \"\").replace(/^[0-9-]+/, \"\").replace(/^-+/, \"\").toLowerCase();\n}\n//#endregion\n//#region src/placeholder/plugins/PlaceholderPlugin.ts\n/**\n* Creates the ProseMirror plugin that renders placeholder decorations.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @returns The configured placeholder plugin.\n*/\nfunction createPlaceholderPlugin({ editor, options }) {\n\tconst dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;\n\tconst useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n\treturn new Plugin({\n\t\tkey: PLUGIN_KEY,\n\t\t...useResolvedPath ? {} : { state: createPlaceholderStateField({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute\n\t\t}) },\n\t\tprops: { decorations: useResolvedPath ? ({ doc, selection }) => buildPlaceholderDecorations({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute,\n\t\t\tdoc,\n\t\t\tselection\n\t\t}) : (state) => {\n\t\t\tvar _PLUGIN_KEY$getState;\n\t\t\tif (options.showOnlyWhenEditable && !editor.isEditable) return DecorationSet.empty;\n\t\t\treturn (_PLUGIN_KEY$getState = PLUGIN_KEY.getState(state)) !== null && _PLUGIN_KEY$getState !== void 0 ? _PLUGIN_KEY$getState : DecorationSet.empty;\n\t\t} }\n\t});\n}\n//#endregion\n//#region src/placeholder/placeholder.ts\n/**\n* This extension allows you to add a placeholder to your editor.\n* A placeholder is a text that appears when the editor or a node is empty.\n* @see https://www.tiptap.dev/api/extensions/placeholder\n*/\nconst Placeholder = Extension.create({\n\tname: \"placeholder\",\n\taddOptions() {\n\t\treturn {\n\t\t\temptyEditorClass: \"is-editor-empty\",\n\t\t\temptyNodeClass: \"is-empty\",\n\t\t\tdataAttribute: DEFAULT_DATA_ATTRIBUTE,\n\t\t\tplaceholder: \"Write something …\",\n\t\t\tshowOnlyWhenEditable: true,\n\t\t\tshowOnlyCurrent: true,\n\t\t\tincludeChildren: false\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [createPlaceholderPlugin({\n\t\t\teditor: this.editor,\n\t\t\toptions: this.options\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/selection/selection.ts\n/**\n* Whether the native browser selection should be cleared on blur and restored on focus.\n* Only applies to non-empty text selections in an editable editor.\n*/\nfunction shouldSyncDomSelection(state, editor) {\n\treturn !state.selection.empty && !isNodeSelection(state.selection) && editor.isEditable;\n}\n/**\n* Whether the selection decoration should be rendered to keep the selection\n* visible while the editor is blurred (and not dragging).\n*/\nfunction shouldPreserveSelection(state, editor) {\n\treturn shouldSyncDomSelection(state, editor) && !editor.isFocused && !editor.view.dragging;\n}\nfunction clearDomSelection() {\n\tvar _window$getSelection;\n\t(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();\n}\n/**\n* Sync the native selection from the editor state.\n* @see https://prosemirror.net/docs/ref/#view.EditorView.focus\n*/\nfunction restoreDomSelection(view) {\n\tview.focus();\n}\n/**\n* This extension allows you to add a class to the selected text when the editor is blurred.\n* It clears the native browser selection on blur (so `::selection` styles do not overlap the\n* decoration) and restores it when the editor is focused again.\n* @see https://www.tiptap.dev/api/extensions/selection\n*/\nconst Selection = Extension.create({\n\tname: \"selection\",\n\taddOptions() {\n\t\treturn { className: \"selection\" };\n\t},\n\taddProseMirrorPlugins() {\n\t\tconst { editor, options } = this;\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"selection\"),\n\t\t\tprops: {\n\t\t\t\tdecorations(state) {\n\t\t\t\t\tif (!shouldPreserveSelection(state, editor)) return null;\n\t\t\t\t\treturn DecorationSet.create(state.doc, [Decoration.inline(state.selection.from, state.selection.to, { class: options.className })]);\n\t\t\t\t},\n\t\t\t\thandleDOMEvents: {\n\t\t\t\t\tblur(view) {\n\t\t\t\t\t\tif (!shouldSyncDomSelection(view.state, editor)) return false;\n\t\t\t\t\t\tclearDomSelection();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\tfocus(view) {\n\t\t\t\t\t\tif (!shouldSyncDomSelection(view.state, editor)) return false;\n\t\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\t\tif (!editor.isDestroyed && view.hasFocus()) restoreDomSelection(view);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/trailing-node/trailing-node.ts\nconst skipTrailingNodeMeta = \"skipTrailingNode\";\nfunction nodeEqualsType({ types, node }) {\n\treturn node && Array.isArray(types) && types.includes(node.type) || (node === null || node === void 0 ? void 0 : node.type) === types;\n}\n/**\n* This extension allows you to add an extra node at the end of the document.\n* @see https://www.tiptap.dev/api/extensions/trailing-node\n*/\nconst TrailingNode = Extension.create({\n\tname: \"trailingNode\",\n\taddOptions() {\n\t\treturn {\n\t\t\tnode: void 0,\n\t\t\tnotAfter: []\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\tvar _this$editor$schema$t;\n\t\tconst plugin = new PluginKey(this.name);\n\t\tconst defaultNode = this.options.node || ((_this$editor$schema$t = this.editor.schema.topNodeType.contentMatch.defaultType) === null || _this$editor$schema$t === void 0 ? void 0 : _this$editor$schema$t.name) || \"paragraph\";\n\t\tconst disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));\n\t\treturn [new Plugin({\n\t\t\tkey: plugin,\n\t\t\tappendTransaction: (transactions, __, state) => {\n\t\t\t\tconst { doc, tr, schema } = state;\n\t\t\t\tconst shouldInsertNodeAtEnd = plugin.getState(state);\n\t\t\t\tconst endPosition = doc.content.size;\n\t\t\t\tconst type = schema.nodes[defaultNode];\n\t\t\t\tif (transactions.some((transaction) => transaction.getMeta(\"skipTrailingNode\"))) return;\n\t\t\t\tif (!shouldInsertNodeAtEnd) return;\n\t\t\t\treturn tr.insert(endPosition, type.create());\n\t\t\t},\n\t\t\tstate: {\n\t\t\t\tinit: (_, state) => {\n\t\t\t\t\tconst lastNode = state.tr.doc.lastChild;\n\t\t\t\t\treturn !nodeEqualsType({\n\t\t\t\t\t\tnode: lastNode,\n\t\t\t\t\t\ttypes: disabledNodes\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tapply: (tr, value) => {\n\t\t\t\t\tif (!tr.docChanged) return value;\n\t\t\t\t\tif (tr.getMeta(\"__uniqueIDTransaction\")) return value;\n\t\t\t\t\tconst lastNode = tr.doc.lastChild;\n\t\t\t\t\treturn !nodeEqualsType({\n\t\t\t\t\t\tnode: lastNode,\n\t\t\t\t\t\ttypes: disabledNodes\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/undo-redo/undo-redo.ts\n/**\n* This extension allows you to undo and redo recent changes.\n* @see https://www.tiptap.dev/api/extensions/undo-redo\n*\n* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n* the `undo-redo` extension, as it is not compatible with the `collaboration` extension.\n*\n* `@tiptap/extension-collaboration` uses its own history implementation.\n*/\nconst UndoRedo = Extension.create({\n\tname: \"undoRedo\",\n\taddOptions() {\n\t\treturn {\n\t\t\tdepth: 100,\n\t\t\tnewGroupDelay: 500\n\t\t};\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tundo: () => ({ state, dispatch }) => {\n\t\t\t\treturn undo(state, dispatch);\n\t\t\t},\n\t\t\tredo: () => ({ state, dispatch }) => {\n\t\t\t\treturn redo(state, dispatch);\n\t\t\t}\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [history(this.options)];\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-z\": () => this.editor.commands.undo(),\n\t\t\t\"Shift-Mod-z\": () => this.editor.commands.redo(),\n\t\t\t\"Mod-y\": () => this.editor.commands.redo(),\n\t\t\t\"Mod-я\": () => this.editor.commands.undo(),\n\t\t\t\"Shift-Mod-я\": () => this.editor.commands.redo()\n\t\t};\n\t}\n});\n//#endregion\nexport { CharacterCount, DEFAULT_DATA_ATTRIBUTE, Dropcursor, Focus, Gapcursor, PLUGIN_KEY, Placeholder, Selection, TrailingNode, UndoRedo, preparePlaceholderAttribute, skipTrailingNodeMeta };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;AAWuBA,EAAU,OAAO;CACvC,MAAM;CACN,aAAa;EACZ,OAAO;GACN,OAAO;GACP,UAAU;GACV,MAAM;GACN,cAAc,MAASC,EAAK;GAC5B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MAAU;KAErB,IADI,CAAChG,EAAG,cACJA,EAAG,QAAQ,uBAAuB,GAAG,OAAOiG;KAChD,IAAMK,IAAWtG,EAAG,IAAI;KACxB,OAAO,CAAC2F,EAAe;MACtB,MAAMW;MACN,OAAON;KACR,CAAC;IACF;GACD;EACD,CAAC,CAAC;CACH;AACD,CAAC,GAYKO,IAAWpH,EAAU,OAAO;CACjC,MAAM;CACN,aAAa;EACZ,OAAO;GACN,OAAO;GACP,eAAe;EAChB;CACD;CACA,cAAc;EACb,OAAO;GACN,aAAa,EAAE,UAAO,kBACdqH,EAAKrG,GAAOsG,CAAQ;GAE5B,aAAa,EAAE,UAAO,kBACdC,EAAKvG,GAAOsG,CAAQ;EAE7B;CACD;CACA,wBAAwB;EACvB,OAAO,CAACE,EAAQ,KAAK,OAAO,CAAC;CAC9B;CACA,uBAAuB;EACtB,OAAO;GACN,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,qBAAqB,KAAK,OAAO,SAAS,KAAK;GAC/C,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,eAAe,KAAK,OAAO,SAAS,KAAK;GACzC,qBAAqB,KAAK,OAAO,SAAS,KAAK;EAChD;CACD;AACD,CAAC"}
@@ -1,19 +1,37 @@
1
1
  "use client";
2
- import { CommandManager as e, DECORATION_MANAGER_PLUGIN_KEY as t, DecorationManager as n, Editor as r, Extendable as i, Extension as ee, InputRule as te, MappablePosition as ne, Mark as re, Node as ie, NodePos as ae, PasteRule as oe, callOrReturn as se, canInsertNode as ce, combineTransactionSteps as le, commands as ue, createChainableState as de, createDocument as fe, createMappablePosition as pe, createNodeFromContent as me, createStyleTag as he, defaultBlockAt as ge, deleteProps as _e, elementFromString as ve, findChildrenInRange as ye, findDuplicates as be, findParentNode as xe, findParentNodeClosestToPos as Se, flattenExtensions as Ce, fromString as we, getAttributes as a, getAttributesFromExtensions as o, getChangedRanges as s, getExtensionField as c, getHTMLFromFragment as l, getMarkAttributes as u, getMarkRange as d, getMarkType as f, getMarksBetween as p, getNodeAtPosition as m, getNodeAttributes as h, getNodeType as g, getPreviousBlockSibling as _, getRenderedAttributes as v, getSchemaByResolvedExtensions as y, getSchemaTypeByName as b, getSchemaTypeNameByName as x, getSplittedAttributes as S, getText as C, getTextBetween as w, getTextContentFromNodes as T, getTextSerializersFromSchema as E, getUpdatedPosition as D, injectExtensionAttributesToParseRule as O, inputRulesPlugin as k, isActive as Te, isAndroid as Ee, isAtEndOfNode as De, isAtStartOfNode as Oe, isEmptyObject as ke, isExtensionRulesEnabled as Ae, isFunction as je, isList as Me, isMacOS as Ne, isMarkActive as Pe, isNodeActive as Fe, isNodeEmpty as Ie, isNodeSelection as Le, isNumber as Re, isPlainObject as ze, isRegExp as Be, isSafari as Ve, isTextSelection as A, isiOS as He, markInputRule as Ue, markPasteRule as We, mergeAttributes as Ge, mergeDeep as Ke, minMax as qe, nodeInputRule as Je, objectIncludes as Ye, parseIndentedBlocks as Xe, pasteRulesPlugin as Ze, removeDuplicates as Qe, renderNestedMarkdownContent as $e, resolveExtensions as et, resolveFocusPosition as tt, selectionToInsertionEnd as nt, sortExtensions as rt, splitExtensions as it, textblockTypeInputRule as at, updateMarkViewAttributes as ot, wrappingInputRule as st } from "../../core/dist/index.js";
3
- import { deepEqual as ct } from "../../../fast-equals/dist/es/index.js";
4
- import j, { createContext as M, forwardRef as lt, useContext as N, useDebugValue as P, useEffect as F, useLayoutEffect as ut, useMemo as I, useRef as dt, useState as L } from "react";
5
- import { Fragment as R, jsx as z, jsxs as ft } from "react/jsx-runtime";
6
- import pt from "react-dom";
7
- import { useSyncExternalStore as B } from "use-sync-external-store/shim/index.js";
8
- import { useSyncExternalStoreWithSelector as mt } from "use-sync-external-store/shim/with-selector.js";
2
+ import { Plugin as e, PluginKey as t } from "../../../prosemirror-state/dist/index.js";
3
+ import { require_shim as n } from "../../../use-sync-external-store/shim/index.js";
4
+ import { CommandManager as r, DECORATION_MANAGER_PLUGIN_KEY as i, DecorationManager as a, Editor as o, Extendable as s, Extension as ee, InputRule as te, MappablePosition as ne, Mark as re, Node as ie, NodePos as ae, PasteRule as oe, callOrReturn as se, canInsertNode as ce, combineTransactionSteps as le, commands as ue, createChainableState as de, createDocument as fe, createMappablePosition as pe, createNodeFromContent as me, createStyleTag as he, defaultBlockAt as ge, deleteProps as _e, elementFromString as ve, findChildrenInRange as ye, findDuplicates as be, findParentNode as xe, findParentNodeClosestToPos as Se, flattenExtensions as Ce, fromString as we, getAttributes as Te, getAttributesFromExtensions as Ee, getChangedRanges as De, getExtensionField as c, getHTMLFromFragment as l, getMarkAttributes as u, getMarkRange as d, getMarkType as f, getMarksBetween as p, getNodeAtPosition as m, getNodeAttributes as h, getNodeType as g, getPreviousBlockSibling as _, getRenderedAttributes as v, getSchemaByResolvedExtensions as y, getSchemaTypeByName as b, getSchemaTypeNameByName as x, getSplittedAttributes as S, getText as C, getTextBetween as w, getTextContentFromNodes as T, getTextSerializersFromSchema as E, getUpdatedPosition as Oe, injectExtensionAttributesToParseRule as ke, inputRulesPlugin as Ae, isActive as je, isAndroid as D, isAtEndOfNode as Me, isAtStartOfNode as Ne, isEmptyObject as Pe, isExtensionRulesEnabled as Fe, isFunction as Ie, isList as Le, isMacOS as Re, isMarkActive as ze, isNodeActive as Be, isNodeEmpty as Ve, isNodeSelection as He, isNumber as Ue, isPlainObject as We, isProseMirrorReplaceStep as Ge, isProseMirrorStep as Ke, isRegExp as qe, isSafari as O, isTextSelection as Je, isiOS as k, markInputRule as Ye, markPasteRule as Xe, mergeAttributes as Ze, mergeDeep as Qe, minMax as $e, nodeInputRule as et, objectIncludes as tt, parseIndentedBlocks as nt, pasteRulesPlugin as rt, removeDuplicates as it, renderNestedMarkdownContent as at, resolveExtensions as ot, resolveFocusPosition as st, selectionToInsertionEnd as ct, sortExtensions as lt, splitExtensions as ut, textblockTypeInputRule as dt, updateMarkViewAttributes as ft, wrappingInputRule as pt } from "../../core/dist/index.js";
5
+ import { circularDeepEqual as mt } from "../../../fast-equals/dist/es/index.js";
6
+ import { require_with_selector as ht } from "../../../use-sync-external-store/shim/with-selector.js";
7
+ import A, { createContext as j, forwardRef as gt, useContext as M, useDebugValue as N, useEffect as P, useLayoutEffect as _t, useMemo as F, useRef as vt, useState as I } from "react";
8
+ import { Fragment as L, jsx as R, jsxs as yt } from "react/jsx-runtime";
9
+ import bt from "react-dom";
9
10
  // node_modules/@tiptap/react/dist/index.js
10
- var ht = (...e) => (t) => {
11
+ var z = n(), xt = ht();
12
+ function St(e, t) {
13
+ if (e.isDestroyed || t.defaultPrevented || !t.cancelable || !e.isEditable || t.inputType !== "insertParagraph" && t.inputType !== "insertLineBreak" || !k() && !D()) return;
14
+ let n = e.view, r = n.root, i = (r.getSelection?.call(r) ?? n.dom.ownerDocument.getSelection())?.anchorNode, a = (i?.nodeType === 1 ? i : i?.parentElement)?.closest("[data-node-view-content-react]");
15
+ if (!a || !n.dom.contains(a)) return;
16
+ let o = n.input.lastKeyCode;
17
+ o === 13 && (n.input.lastKeyCode = null), n.domObserver.forceFlush(), n.domObserver.flush();
18
+ let s = new KeyboardEvent("keydown", {
19
+ key: "Enter",
20
+ code: "Enter",
21
+ keyCode: 13,
22
+ shiftKey: t.inputType === "insertLineBreak",
23
+ bubbles: !0,
24
+ cancelable: !0
25
+ });
26
+ n.someProp("handleKeyDown", (e) => e(n, s)) ? (t.preventDefault(), n.input.lastIOSEnter = 0, clearTimeout(n.input.lastIOSEnterFallbackTimeout)) : o === 13 && (n.input.lastKeyCode = o);
27
+ }
28
+ var B = new t("reactMobileEnter"), Ct = (...e) => (t) => {
11
29
  e.forEach((e) => {
12
30
  typeof e == "function" ? e(t) : e && (e.current = t);
13
31
  });
14
- }, gt = ({ contentComponent: e }) => {
15
- let t = B(e.subscribe, e.getSnapshot, e.getServerSnapshot);
16
- return /* @__PURE__ */ z(R, { children: Object.values(t) });
32
+ }, wt = ({ contentComponent: e }) => {
33
+ let t = (0, z.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
34
+ return /* @__PURE__ */ R(L, { children: Object.values(t) });
17
35
  };
18
36
  function V() {
19
37
  let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
@@ -36,7 +54,7 @@ function V() {
36
54
  setRenderer(e, n) {
37
55
  t = {
38
56
  ...t,
39
- [e]: pt.createPortal(n.reactElement, n.element, e)
57
+ [e]: bt.createPortal(n.reactElement, n.element, e)
40
58
  }, r();
41
59
  },
42
60
  removeRenderer(e) {
@@ -45,9 +63,9 @@ function V() {
45
63
  }
46
64
  };
47
65
  }
48
- var H = class extends j.Component {
66
+ var H = class extends A.Component {
49
67
  constructor(e) {
50
- super(e), this.editorContentRef = j.createRef();
68
+ super(e), this.editorContentRef = A.createRef();
51
69
  }
52
70
  componentDidMount() {
53
71
  this.init();
@@ -56,17 +74,20 @@ var H = class extends j.Component {
56
74
  this.init();
57
75
  }
58
76
  init() {
59
- let e = this.props.editor;
60
- if (e && !e.isDestroyed && e.view.dom?.parentNode) {
61
- if (e.contentComponent) return;
62
- let t = this.editorContentRef.current;
63
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = V(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
77
+ let t = this.props.editor;
78
+ if (t && !t.isDestroyed && t.view.dom?.parentNode) {
79
+ if (t.contentComponent) return;
80
+ let n = this.editorContentRef.current;
81
+ n.append(...t.view.dom.parentNode.childNodes), t.view.updateRoot(), t.setOptions({ element: n }), t.contentComponent = V(), t.createNodeViews(), t.registerPlugin(new e({
82
+ key: B,
83
+ props: { handleDOMEvents: { beforeinput: (e, n) => St(t, n) } }
84
+ })), t.isEditorContentInitialized = !0, this.forceUpdate();
64
85
  }
65
86
  }
66
87
  componentWillUnmount() {
67
88
  let e = this.props.editor;
68
89
  if (e) {
69
- e.isEditorContentInitialized = !1, e.isDestroyed || e.view.setProps({ nodeViews: {} }), e.contentComponent = null;
90
+ e.isEditorContentInitialized = !1, e.isDestroyed || (e.unregisterPlugin(B), e.view.setProps({ nodeViews: {} })), e.contentComponent = null;
70
91
  try {
71
92
  if (!e.view.dom?.parentNode) return;
72
93
  let t = document.createElement("div");
@@ -76,19 +97,19 @@ var H = class extends j.Component {
76
97
  }
77
98
  render() {
78
99
  let { editor: e, innerRef: t, ...n } = this.props;
79
- return /* @__PURE__ */ ft(R, { children: [/* @__PURE__ */ z("div", {
80
- ref: ht(t, this.editorContentRef),
100
+ return /* @__PURE__ */ yt(L, { children: [/* @__PURE__ */ R("div", {
101
+ ref: Ct(t, this.editorContentRef),
81
102
  ...n
82
- }), e?.contentComponent && /* @__PURE__ */ z(gt, { contentComponent: e.contentComponent })] });
103
+ }), e?.contentComponent && /* @__PURE__ */ R(wt, { contentComponent: e.contentComponent })] });
83
104
  }
84
- }, _t = lt((e, t) => {
85
- let n = j.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
86
- return j.createElement(H, {
105
+ }, Tt = gt((e, t) => {
106
+ let n = A.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
107
+ return A.createElement(H, {
87
108
  key: n,
88
109
  innerRef: t,
89
110
  ...e
90
111
  });
91
- }), U = j.memo(_t), vt = typeof window < "u" ? ut : F, yt = class {
112
+ }), U = A.memo(Tt), Et = typeof window < "u" ? _t : P, Dt = class {
92
113
  constructor(e) {
93
114
  this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
94
115
  editor: e,
@@ -124,10 +145,10 @@ var H = class extends j.Component {
124
145
  }
125
146
  };
126
147
  function W(e) {
127
- let [t] = L(() => new yt(e.editor)), n = mt(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? ct);
128
- return vt(() => t.watch(e.editor), [e.editor, t]), P(n), n;
148
+ let [t] = I(() => new Dt(e.editor)), n = (0, xt.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? mt);
149
+ return Et(() => t.watch(e.editor), [e.editor, t]), N(n), n;
129
150
  }
130
- var G = process.env.NODE_ENV !== "production", K = typeof window > "u", bt = K || !!(typeof window < "u" && window.next), xt = class e {
151
+ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Ot = K || !!(typeof window < "u" && window.next), kt = class e {
131
152
  constructor(e) {
132
153
  this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
133
154
  }
@@ -136,7 +157,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", bt = K |
136
157
  }
137
158
  getInitialEditor() {
138
159
  let e = this.options.current.immediatelyRender, t = e ?? !0;
139
- return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : bt && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
160
+ return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : Ot && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
140
161
  }
141
162
  createEditor() {
142
163
  let e = {
@@ -198,7 +219,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", bt = K |
198
219
  return (t = this.options.current).onUnmount?.call(t, ...e);
199
220
  }
200
221
  };
201
- return new r(e);
222
+ return new o(e);
202
223
  }
203
224
  getEditor() {
204
225
  return this.editor;
@@ -251,25 +272,25 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", bt = K |
251
272
  }, 1);
252
273
  }
253
274
  };
254
- function St(e = {}, t = []) {
255
- let n = dt(e);
275
+ function At(e = {}, t = []) {
276
+ let n = vt(e);
256
277
  n.current = e;
257
- let [r] = L(() => new xt(n)), i = B(r.subscribe, r.getEditor, r.getServerSnapshot);
258
- return P(i), F(r.onRender(t)), W({
278
+ let [r] = I(() => new kt(n)), i = (0, z.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
279
+ return N(i), P(r.onRender(t)), W({
259
280
  editor: i,
260
281
  selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
261
282
  }), i;
262
283
  }
263
- var q = M({ editor: null });
284
+ var q = j({ editor: null });
264
285
  q.Consumer;
265
- var J = M({
286
+ var J = j({
266
287
  onDragStart: () => {},
267
288
  nodeViewContentChildren: void 0,
268
289
  nodeViewContentRef: () => {}
269
- }), Y = () => N(J);
270
- j.forwardRef((e, t) => {
290
+ }), Y = () => M(J);
291
+ A.forwardRef((e, t) => {
271
292
  let { onDragStart: n } = Y(), r = e.as || "div";
272
- return /* @__PURE__ */ z(r, {
293
+ return /* @__PURE__ */ R(r, {
273
294
  ...e,
274
295
  ref: t,
275
296
  "data-node-view-wrapper": "",
@@ -279,19 +300,19 @@ j.forwardRef((e, t) => {
279
300
  ...e.style
280
301
  }
281
302
  });
282
- }), j.createContext({ markViewContentRef: () => {} });
283
- var X = M({ get editor() {
303
+ }), A.createContext({ markViewContentRef: () => {} });
304
+ var X = j({ get editor() {
284
305
  throw Error("useTiptap must be used within a <Tiptap> provider");
285
306
  } });
286
307
  X.displayName = "TiptapContext";
287
- var Z = () => N(X);
308
+ var Z = () => M(X);
288
309
  function Q({ children: e, ...t }) {
289
310
  let n = "editor" in t ? t.editor : t.instance;
290
311
  if (!n) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
291
- let r = I(() => ({ editor: n }), [n]), i = I(() => ({ editor: n }), [n]);
292
- return /* @__PURE__ */ z(q.Provider, {
312
+ let r = F(() => ({ editor: n }), [n]), i = F(() => ({ editor: n }), [n]);
313
+ return /* @__PURE__ */ R(q.Provider, {
293
314
  value: i,
294
- children: /* @__PURE__ */ z(X.Provider, {
315
+ children: /* @__PURE__ */ R(X.Provider, {
295
316
  value: r,
296
317
  children: e
297
318
  })
@@ -300,12 +321,12 @@ function Q({ children: e, ...t }) {
300
321
  Q.displayName = "Tiptap";
301
322
  function $({ ...e }) {
302
323
  let { editor: t } = Z();
303
- return /* @__PURE__ */ z(U, {
324
+ return /* @__PURE__ */ R(U, {
304
325
  editor: t,
305
326
  ...e
306
327
  });
307
328
  }
308
329
  $.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
309
- export { e as CommandManager, t as DECORATION_MANAGER_PLUGIN_KEY, n as DecorationManager, r as Editor, U as EditorContent, q as EditorContext, i as Extendable, ee as Extension, te as InputRule, ne as MappablePosition, re as Mark, ie as Node, ae as NodePos, oe as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, se as callOrReturn, ce as canInsertNode, le as combineTransactionSteps, ue as commands, de as createChainableState, V as createContentComponent, fe as createDocument, pe as createMappablePosition, me as createNodeFromContent, he as createStyleTag, ge as defaultBlockAt, _e as deleteProps, ve as elementFromString, ye as findChildrenInRange, be as findDuplicates, xe as findParentNode, Se as findParentNodeClosestToPos, Ce as flattenExtensions, we as fromString, a as getAttributes, o as getAttributesFromExtensions, s as getChangedRanges, c as getExtensionField, l as getHTMLFromFragment, u as getMarkAttributes, d as getMarkRange, f as getMarkType, p as getMarksBetween, m as getNodeAtPosition, h as getNodeAttributes, g as getNodeType, _ as getPreviousBlockSibling, v as getRenderedAttributes, y as getSchemaByResolvedExtensions, b as getSchemaTypeByName, x as getSchemaTypeNameByName, S as getSplittedAttributes, C as getText, w as getTextBetween, T as getTextContentFromNodes, E as getTextSerializersFromSchema, D as getUpdatedPosition, O as injectExtensionAttributesToParseRule, k as inputRulesPlugin, Te as isActive, Ee as isAndroid, De as isAtEndOfNode, Oe as isAtStartOfNode, ke as isEmptyObject, Ae as isExtensionRulesEnabled, je as isFunction, Me as isList, Ne as isMacOS, Pe as isMarkActive, Fe as isNodeActive, Ie as isNodeEmpty, Le as isNodeSelection, Re as isNumber, ze as isPlainObject, Be as isRegExp, Ve as isSafari, A as isTextSelection, He as isiOS, Ue as markInputRule, We as markPasteRule, Ge as mergeAttributes, Ke as mergeDeep, qe as minMax, Je as nodeInputRule, Ye as objectIncludes, Xe as parseIndentedBlocks, Ze as pasteRulesPlugin, Qe as removeDuplicates, $e as renderNestedMarkdownContent, et as resolveExtensions, tt as resolveFocusPosition, nt as selectionToInsertionEnd, rt as sortExtensions, it as splitExtensions, at as textblockTypeInputRule, ot as updateMarkViewAttributes, St as useEditor, W as useEditorState, Y as useReactNodeView, Z as useTiptap, st as wrappingInputRule };
330
+ export { r as CommandManager, i as DECORATION_MANAGER_PLUGIN_KEY, a as DecorationManager, o as Editor, U as EditorContent, q as EditorContext, s as Extendable, ee as Extension, te as InputRule, ne as MappablePosition, re as Mark, ie as Node, ae as NodePos, oe as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, se as callOrReturn, ce as canInsertNode, le as combineTransactionSteps, ue as commands, de as createChainableState, V as createContentComponent, fe as createDocument, pe as createMappablePosition, me as createNodeFromContent, he as createStyleTag, ge as defaultBlockAt, _e as deleteProps, ve as elementFromString, ye as findChildrenInRange, be as findDuplicates, xe as findParentNode, Se as findParentNodeClosestToPos, Ce as flattenExtensions, we as fromString, Te as getAttributes, Ee as getAttributesFromExtensions, De as getChangedRanges, c as getExtensionField, l as getHTMLFromFragment, u as getMarkAttributes, d as getMarkRange, f as getMarkType, p as getMarksBetween, m as getNodeAtPosition, h as getNodeAttributes, g as getNodeType, _ as getPreviousBlockSibling, v as getRenderedAttributes, y as getSchemaByResolvedExtensions, b as getSchemaTypeByName, x as getSchemaTypeNameByName, S as getSplittedAttributes, C as getText, w as getTextBetween, T as getTextContentFromNodes, E as getTextSerializersFromSchema, Oe as getUpdatedPosition, ke as injectExtensionAttributesToParseRule, Ae as inputRulesPlugin, je as isActive, D as isAndroid, Me as isAtEndOfNode, Ne as isAtStartOfNode, Pe as isEmptyObject, Fe as isExtensionRulesEnabled, Ie as isFunction, Le as isList, Re as isMacOS, ze as isMarkActive, Be as isNodeActive, Ve as isNodeEmpty, He as isNodeSelection, Ue as isNumber, We as isPlainObject, Ge as isProseMirrorReplaceStep, Ke as isProseMirrorStep, qe as isRegExp, O as isSafari, Je as isTextSelection, k as isiOS, Ye as markInputRule, Xe as markPasteRule, Ze as mergeAttributes, Qe as mergeDeep, $e as minMax, et as nodeInputRule, tt as objectIncludes, nt as parseIndentedBlocks, rt as pasteRulesPlugin, it as removeDuplicates, at as renderNestedMarkdownContent, ot as resolveExtensions, st as resolveFocusPosition, ct as selectionToInsertionEnd, lt as sortExtensions, ut as splitExtensions, dt as textblockTypeInputRule, ft as updateMarkViewAttributes, At as useEditor, W as useEditorState, Y as useReactNodeView, Z as useTiptap, pt as wrappingInputRule };
310
331
 
311
332
  //# sourceMappingURL=index.js.map