@burdenoff/microfe-support 2026.1114.1 → 2026.1118.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 (206) hide show
  1. package/dist/generated/global-operations.d.ts +62 -0
  2. package/dist/generated/global-operations.js +104 -69
  3. package/dist/generated/global-operations.js.map +1 -1
  4. package/dist/generated/global-types.js +17 -15
  5. package/dist/generated/global-types.js.map +1 -1
  6. package/dist/support/SupportUserRoot.js +32 -28
  7. package/dist/support/SupportUserRoot.js.map +1 -1
  8. package/dist/support/SupportUserRoutes.d.ts +1 -0
  9. package/dist/support/SupportUserRoutes.js +31 -28
  10. package/dist/support/SupportUserRoutes.js.map +1 -1
  11. package/dist/support/components/PageLayout.js +35 -35
  12. package/dist/support/components/RouteHelpers.d.ts +2 -1
  13. package/dist/support/components/RouteHelpers.js +3 -3
  14. package/dist/support/components/RouteHelpers.js.map +1 -1
  15. package/dist/support/components/careers/RichTextEditor.js +31 -31
  16. package/dist/support/components/careers/RichTextEditor.js.map +1 -1
  17. package/dist/support/components/help/RelatedArticles.d.ts +12 -0
  18. package/dist/support/components/help/RelatedArticles.js +55 -0
  19. package/dist/support/components/help/RelatedArticles.js.map +1 -0
  20. package/dist/support/components/help/RequestDetailHeader.d.ts +18 -0
  21. package/dist/support/components/help/RequestDetailHeader.js +129 -0
  22. package/dist/support/components/help/RequestDetailHeader.js.map +1 -0
  23. package/dist/support/components/help/SatisfactionReview.d.ts +18 -0
  24. package/dist/support/components/help/SatisfactionReview.js +103 -0
  25. package/dist/support/components/help/SatisfactionReview.js.map +1 -0
  26. package/dist/support/components/help/StarRating.d.ts +16 -0
  27. package/dist/support/components/help/StarRating.js +63 -0
  28. package/dist/support/components/help/StarRating.js.map +1 -0
  29. package/dist/support/components/help/StatusGroupPill.d.ts +11 -0
  30. package/dist/support/components/help/StatusGroupPill.js +19 -0
  31. package/dist/support/components/help/StatusGroupPill.js.map +1 -0
  32. package/dist/support/components/settings/TicketCategoriesSettings.js +69 -69
  33. package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
  34. package/dist/support/components/tickets/MessageComposer.js +7 -7
  35. package/dist/support/components/tickets/MessageComposer.js.map +1 -1
  36. package/dist/support/components/tickets/TicketDetailHeader.js +54 -60
  37. package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
  38. package/dist/support/components/ui.js +1 -1
  39. package/dist/support/constants.d.ts +23 -0
  40. package/dist/support/constants.js +2 -2
  41. package/dist/support/constants.js.map +1 -1
  42. package/dist/support/hooks/useDebouncedValue.d.ts +6 -0
  43. package/dist/support/hooks/useDebouncedValue.js +12 -0
  44. package/dist/support/hooks/useDebouncedValue.js.map +1 -0
  45. package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +8 -1
  46. package/dist/support/hooks/useKnowledgeBaseOperations.js +86 -81
  47. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  48. package/dist/support/hooks/useSupportVariant.d.ts +11 -0
  49. package/dist/support/hooks/useSupportVariant.js +11 -0
  50. package/dist/support/hooks/useSupportVariant.js.map +1 -0
  51. package/dist/support/hooks/useTicketCreatedToast.d.ts +16 -0
  52. package/dist/support/hooks/useTicketCreatedToast.js +25 -0
  53. package/dist/support/hooks/useTicketCreatedToast.js.map +1 -0
  54. package/dist/support/hooks/useTicketLabels.d.ts +22 -0
  55. package/dist/support/hooks/useTicketLabels.js +40 -0
  56. package/dist/support/hooks/useTicketLabels.js.map +1 -0
  57. package/dist/support/index.d.ts +1 -1
  58. package/dist/support/pages/ArticleDetailAdminPage.js +84 -84
  59. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
  60. package/dist/support/pages/ArticleDetailUserPage.d.ts +5 -0
  61. package/dist/support/pages/ArticleDetailUserPage.js +133 -69
  62. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
  63. package/dist/support/pages/AskForHelpPage.d.ts +11 -0
  64. package/dist/support/pages/AskForHelpPage.js +396 -0
  65. package/dist/support/pages/AskForHelpPage.js.map +1 -0
  66. package/dist/support/pages/ContactInquiriesPage.js +73 -73
  67. package/dist/support/pages/ContactInquiryDetailPage.js +47 -47
  68. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
  69. package/dist/support/pages/CreateTicketPage.d.ts +4 -0
  70. package/dist/support/pages/CreateTicketPage.js +121 -117
  71. package/dist/support/pages/CreateTicketPage.js.map +1 -1
  72. package/dist/support/pages/HelpHubPage.d.ts +9 -0
  73. package/dist/support/pages/HelpHubPage.js +272 -0
  74. package/dist/support/pages/HelpHubPage.js.map +1 -0
  75. package/dist/support/pages/JobApplicationDetailPage.js +388 -388
  76. package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
  77. package/dist/support/pages/JobApplicationsPage.js +35 -35
  78. package/dist/support/pages/JobPostingDetailPage.js +236 -236
  79. package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
  80. package/dist/support/pages/KnowledgeBaseUserPage.d.ts +6 -1
  81. package/dist/support/pages/KnowledgeBaseUserPage.js +188 -137
  82. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
  83. package/dist/support/pages/MyRequestsPage.d.ts +16 -0
  84. package/dist/support/pages/MyRequestsPage.js +389 -0
  85. package/dist/support/pages/MyRequestsPage.js.map +1 -0
  86. package/dist/support/pages/TicketDetailUserPage.d.ts +5 -0
  87. package/dist/support/pages/TicketDetailUserPage.js +285 -192
  88. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  89. package/dist/support/pages/TicketListPage.d.ts +7 -0
  90. package/dist/support/pages/TicketListPage.js +150 -153
  91. package/dist/support/pages/TicketListPage.js.map +1 -1
  92. package/dist/support/providers/SupportProvider.js +8 -7
  93. package/dist/support/providers/SupportProvider.js.map +1 -1
  94. package/dist/support/store/supportStore.d.ts +5 -0
  95. package/dist/support/store/supportStore.js +1 -0
  96. package/dist/support/store/supportStore.js.map +1 -1
  97. package/dist/support/translations/en.d.ts +279 -0
  98. package/dist/support/translations/en.js +270 -1
  99. package/dist/support/translations/en.js.map +1 -1
  100. package/dist/support/types/index.d.ts +13 -0
  101. package/dist/support/utils/cameFrom.d.ts +16 -0
  102. package/dist/support/utils/cameFrom.js +22 -0
  103. package/dist/support/utils/cameFrom.js.map +1 -0
  104. package/dist/support/utils/dates.d.ts +15 -0
  105. package/dist/support/utils/dates.js +35 -0
  106. package/dist/support/utils/dates.js.map +1 -0
  107. package/dist/support/utils/reopen.d.ts +27 -0
  108. package/dist/support/utils/reopen.js +27 -0
  109. package/dist/support/utils/reopen.js.map +1 -0
  110. package/dist/support/utils/requestTechnicalDetails.d.ts +13 -0
  111. package/dist/support/utils/requestTechnicalDetails.js +38 -0
  112. package/dist/support/utils/requestTechnicalDetails.js.map +1 -0
  113. package/dist/support/utils/ticketFilters.d.ts +16 -0
  114. package/dist/support/utils/ticketFilters.js +24 -12
  115. package/dist/support/utils/ticketFilters.js.map +1 -1
  116. package/dist/support/utils/ticketStatusGroups.d.ts +20 -0
  117. package/dist/support/utils/ticketStatusGroups.js +39 -0
  118. package/dist/support/utils/ticketStatusGroups.js.map +1 -0
  119. package/package.json +2 -2
  120. package/dist/_virtual/_rolldown/runtime.js +0 -6
  121. package/dist/node_modules/@tiptap/core/dist/index.js +0 -3491
  122. package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
  123. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -44
  124. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
  125. package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +0 -12
  126. package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +0 -1
  127. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -75
  128. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
  129. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -73
  130. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
  131. package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -78
  132. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
  133. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -157
  134. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
  135. package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -11
  136. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
  137. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -50
  138. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
  139. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -70
  140. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
  141. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -49
  142. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
  143. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -70
  144. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
  145. package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -389
  146. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
  147. package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -967
  148. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
  149. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -46
  150. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
  151. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -6
  152. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
  153. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -55
  154. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
  155. package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -14
  156. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
  157. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -72
  158. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
  159. package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -457
  160. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
  161. package/dist/node_modules/@tiptap/react/dist/index.js +0 -332
  162. package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
  163. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -28
  164. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
  165. package/dist/node_modules/fast-equals/dist/es/index.js +0 -298
  166. package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
  167. package/dist/node_modules/linkifyjs/dist/linkify.js +0 -527
  168. package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
  169. package/dist/node_modules/orderedmap/dist/index.js +0 -68
  170. package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
  171. package/dist/node_modules/prosemirror-commands/dist/index.js +0 -334
  172. package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
  173. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -112
  174. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
  175. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -168
  176. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
  177. package/dist/node_modules/prosemirror-history/dist/index.js +0 -219
  178. package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
  179. package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -51
  180. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
  181. package/dist/node_modules/prosemirror-model/dist/index.js +0 -1775
  182. package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
  183. package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -77
  184. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
  185. package/dist/node_modules/prosemirror-state/dist/index.js +0 -526
  186. package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
  187. package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1204
  188. package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
  189. package/dist/node_modules/prosemirror-view/dist/index.js +0 -3355
  190. package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
  191. package/dist/node_modules/rope-sequence/dist/index.js +0 -84
  192. package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
  193. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -55
  194. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
  195. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -53
  196. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
  197. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -53
  198. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
  199. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -45
  200. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
  201. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -11
  202. package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
  203. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -11
  204. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
  205. package/dist/node_modules/w3c-keyname/index.js +0 -89
  206. package/dist/node_modules/w3c-keyname/index.js.map +0 -1
@@ -1,70 +0,0 @@
1
- import { Node as e, mergeAttributes as t, textblockTypeInputRule as n } from "../../core/dist/index.js";
2
- // node_modules/@tiptap/extension-heading/dist/index.js
3
- var r = e.create({
4
- name: "heading",
5
- addOptions() {
6
- return {
7
- levels: [
8
- 1,
9
- 2,
10
- 3,
11
- 4,
12
- 5,
13
- 6
14
- ],
15
- HTMLAttributes: {}
16
- };
17
- },
18
- content: "inline*",
19
- group: "block",
20
- defining: !0,
21
- addAttributes() {
22
- return { level: {
23
- default: 1,
24
- rendered: !1
25
- } };
26
- },
27
- parseHTML() {
28
- return this.options.levels.map((e) => ({
29
- tag: `h${e}`,
30
- attrs: { level: e }
31
- }));
32
- },
33
- renderHTML({ node: e, HTMLAttributes: n }) {
34
- return [
35
- `h${this.options.levels.includes(e.attrs.level) ? e.attrs.level : this.options.levels[0]}`,
36
- t(this.options.HTMLAttributes, n),
37
- 0
38
- ];
39
- },
40
- parseMarkdown(e, t) {
41
- let n = e.depth || 1;
42
- return this.options.levels.includes(n) ? t.createNode("heading", { level: n }, t.parseInline(e.tokens || [])) : t.createNode("paragraph", void 0, t.parseInline(e.tokens || []));
43
- },
44
- renderMarkdown: (e, t) => {
45
- let n = e.attrs?.level ? parseInt(e.attrs.level, 10) : 1, r = "#".repeat(n);
46
- return e.content ? `${r} ${t.renderChildren(e.content)}` : "";
47
- },
48
- addCommands() {
49
- return {
50
- setHeading: (e) => ({ commands: t }) => this.options.levels.includes(e.level) ? t.setNode(this.name, e) : !1,
51
- toggleHeading: (e) => ({ commands: t }) => this.options.levels.includes(e.level) ? t.toggleNode(this.name, "paragraph", e) : !1
52
- };
53
- },
54
- addKeyboardShortcuts() {
55
- return this.options.levels.reduce((e, t) => ({
56
- ...e,
57
- [`Mod-Alt-${t}`]: () => this.editor.commands.toggleHeading({ level: t })
58
- }), {});
59
- },
60
- addInputRules() {
61
- return this.options.levels.map((e) => n({
62
- find: RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),
63
- type: this.type,
64
- getAttributes: { level: e }
65
- }));
66
- }
67
- });
68
- export { r as Heading };
69
-
70
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["Heading","Node","level","node","mergeAttributes","HTMLAttributes","token","helpers","headingChars","h","attributes","commands","items","textblockTypeInputRule"],"sources":["../../../../../node_modules/@tiptap/extension-heading/dist/index.js"],"sourcesContent":["import { Node, mergeAttributes, textblockTypeInputRule } from \"@tiptap/core\";\n//#region src/heading.ts\n/**\n* This extension allows you to create headings.\n* @see https://www.tiptap.dev/api/nodes/heading\n*/\nconst Heading = Node.create({\n\tname: \"heading\",\n\taddOptions() {\n\t\treturn {\n\t\t\tlevels: [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t\t3,\n\t\t\t\t4,\n\t\t\t\t5,\n\t\t\t\t6\n\t\t\t],\n\t\t\tHTMLAttributes: {}\n\t\t};\n\t},\n\tcontent: \"inline*\",\n\tgroup: \"block\",\n\tdefining: true,\n\taddAttributes() {\n\t\treturn { level: {\n\t\t\tdefault: 1,\n\t\t\trendered: false\n\t\t} };\n\t},\n\tparseHTML() {\n\t\treturn this.options.levels.map((level) => ({\n\t\t\ttag: `h${level}`,\n\t\t\tattrs: { level }\n\t\t}));\n\t},\n\trenderHTML({ node, HTMLAttributes }) {\n\t\treturn [\n\t\t\t`h${this.options.levels.includes(node.attrs.level) ? node.attrs.level : this.options.levels[0]}`,\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\tparseMarkdown(token, helpers) {\n\t\tconst level = token.depth || 1;\n\t\tif (!this.options.levels.includes(level)) return helpers.createNode(\"paragraph\", void 0, helpers.parseInline(token.tokens || []));\n\t\treturn helpers.createNode(\"heading\", { level }, helpers.parseInline(token.tokens || []));\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tvar _node$attrs;\n\t\tconst level = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.level) ? parseInt(node.attrs.level, 10) : 1;\n\t\tconst headingChars = \"#\".repeat(level);\n\t\tif (!node.content) return \"\";\n\t\treturn `${headingChars} ${h.renderChildren(node.content)}`;\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetHeading: (attributes) => ({ commands }) => {\n\t\t\t\tif (!this.options.levels.includes(attributes.level)) return false;\n\t\t\t\treturn commands.setNode(this.name, attributes);\n\t\t\t},\n\t\t\ttoggleHeading: (attributes) => ({ commands }) => {\n\t\t\t\tif (!this.options.levels.includes(attributes.level)) return false;\n\t\t\t\treturn commands.toggleNode(this.name, \"paragraph\", attributes);\n\t\t\t}\n\t\t};\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn this.options.levels.reduce((items, level) => ({\n\t\t\t...items,\n\t\t\t[`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level })\n\t\t}), {});\n\t},\n\taddInputRules() {\n\t\treturn this.options.levels.map((level) => {\n\t\t\treturn textblockTypeInputRule({\n\t\t\t\tfind: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\\\s$`),\n\t\t\t\ttype: this.type,\n\t\t\t\tgetAttributes: { level }\n\t\t\t});\n\t\t});\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Heading;\n//#endregion\nexport { Heading, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAMA,IAAMA,IAAUC,EAAK,OAAO;CAC3B,MAAM;CACN,aAAa;EACZ,OAAO;GACN,QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;GACD;GACA,gBAAgB,CAAC;EAClB;CACD;CACA,SAAS;CACT,OAAO;CACP,UAAU;CACV,gBAAgB;EACf,OAAO,EAAE,OAAO;GACf,SAAS;GACT,UAAU;EACX,EAAE;CACH;CACA,YAAY;EACX,OAAO,KAAK,QAAQ,OAAO,KAAK,OAAW;GAC1C,KAAK,IAAIC;GACT,OAAO,EAAE,SAAM;EAChB,EAAE;CACH;CACA,WAAW,EAAE,SAAM,qBAAkB;EACpC,OAAO;GACN,IAAI,KAAK,QAAQ,OAAO,SAASC,EAAK,MAAM,KAAK,IAAIA,EAAK,MAAM,QAAQ,KAAK,QAAQ,OAAO;GAC5FC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAC3D;EACD;CACD;CACA,cAAc,GAAO,GAAS;EAC7B,IAAMH,IAAQI,EAAM,SAAS;EAE7B,OADK,KAAK,QAAQ,OAAO,SAASJ,CAAK,IAChCK,EAAQ,WAAW,WAAW,EAAE,SAAM,GAAGA,EAAQ,YAAYD,EAAM,UAAU,CAAC,CAAC,CAAC,IADtCC,EAAQ,WAAW,aAAa,KAAK,GAAGA,EAAQ,YAAYD,EAAM,UAAU,CAAC,CAAC,CAAC;CAEjI;CACA,iBAAiB,GAAM,MAAM;EAE5B,IAAMJ,IAAwBC,EAAK,OAAiE,QAAS,SAASA,EAAK,MAAM,OAAO,EAAE,IAAI,GACxIK,IAAe,IAAI,OAAON,CAAK;EAErC,OADKC,EAAK,UACH,GAAGK,EAAa,GAAGC,EAAE,eAAeN,EAAK,OAAO,MAD7B;CAE3B;CACA,cAAc;EACb,OAAO;GACN,aAAa,OAAgB,EAAE,kBACzB,KAAK,QAAQ,OAAO,SAASO,EAAW,KAAK,IAC3CC,EAAS,QAAQ,KAAK,MAAMD,CAAU,IADe;GAG7D,gBAAgB,OAAgB,EAAE,kBAC5B,KAAK,QAAQ,OAAO,SAASA,EAAW,KAAK,IAC3CC,EAAS,WAAW,KAAK,MAAM,aAAaD,CAAU,IADD;EAG9D;CACD;CACA,uBAAuB;EACtB,OAAO,KAAK,QAAQ,OAAO,QAAQ,GAAO,OAAW;GACpD,GAAGE;IACF,WAAWV,YAAgB,KAAK,OAAO,SAAS,cAAc,EAAE,SAAM,CAAC;EACzE,IAAI,CAAC,CAAC;CACP;CACA,gBAAgB;EACf,OAAO,KAAK,QAAQ,OAAO,KAAK,MACxBW,EAAuB;GAC7B,MAAU,OAAO,OAAO,KAAK,IAAI,GAAG,KAAK,QAAQ,MAAM,EAAE,GAAGX,EAAM,OAAO;GACzE,MAAM,KAAK;GACX,eAAe,EAAE,SAAM;EACxB,CAAC,CACD;CACF;AACD,CAAC"}
@@ -1,49 +0,0 @@
1
- import { Node as e, canInsertNode as t, isNodeSelection as n, mergeAttributes as r, nodeInputRule as i } from "../../core/dist/index.js";
2
- import { NodeSelection as a, TextSelection as o } from "../../../prosemirror-state/dist/index.js";
3
- // node_modules/@tiptap/extension-horizontal-rule/dist/index.js
4
- var s = e.create({
5
- name: "horizontalRule",
6
- addOptions() {
7
- return {
8
- HTMLAttributes: {},
9
- nextNodeType: "paragraph"
10
- };
11
- },
12
- group: "block",
13
- parseHTML() {
14
- return [{ tag: "hr" }];
15
- },
16
- renderHTML({ HTMLAttributes: e }) {
17
- return ["hr", r(this.options.HTMLAttributes, e)];
18
- },
19
- markdownTokenName: "hr",
20
- parseMarkdown: (e, t) => t.createNode("horizontalRule"),
21
- renderMarkdown: () => "---",
22
- addCommands() {
23
- return { setHorizontalRule: () => ({ chain: e, state: r }) => {
24
- if (!t(r, r.schema.nodes[this.name])) return !1;
25
- let { selection: i } = r, { $to: s } = i, c = e();
26
- return n(i) ? c.insertContentAt(s.pos, { type: this.name }) : c.insertContent({ type: this.name }), c.command(({ state: e, tr: t, dispatch: n }) => {
27
- if (n) {
28
- let { $to: n } = t.selection, r = n.end();
29
- if (n.nodeAfter) n.nodeAfter.isTextblock ? t.setSelection(o.create(t.doc, n.pos + 1)) : n.nodeAfter.isBlock ? t.setSelection(a.create(t.doc, n.pos)) : t.setSelection(o.create(t.doc, n.pos));
30
- else {
31
- let i = (e.schema.nodes[this.options.nextNodeType] || n.parent.type.contentMatch.defaultType)?.create();
32
- i && (t.insert(r, i), t.setSelection(o.create(t.doc, r + 1)));
33
- }
34
- t.scrollIntoView();
35
- }
36
- return !0;
37
- }).run();
38
- } };
39
- },
40
- addInputRules() {
41
- return [i({
42
- find: /^(?:---|—-|___\s|\*\*\*\s)$/,
43
- type: this.type
44
- })];
45
- }
46
- });
47
- export { s as HorizontalRule };
48
-
49
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["HorizontalRule","Node","mergeAttributes","HTMLAttributes","helpers","canInsertNode","state","$originTo","selection","currentChain","chain","isNodeSelection","chainState","dispatch","tr","posAfter","$to","TextSelection","NodeSelection","node","nodeInputRule"],"sources":["../../../../../node_modules/@tiptap/extension-horizontal-rule/dist/index.js"],"sourcesContent":["import { Node, canInsertNode, isNodeSelection, mergeAttributes, nodeInputRule } from \"@tiptap/core\";\nimport { NodeSelection, TextSelection } from \"@tiptap/pm/state\";\n//#region src/horizontal-rule.ts\n/**\n* This extension allows you to insert horizontal rules.\n* @see https://www.tiptap.dev/api/nodes/horizontal-rule\n*/\nconst HorizontalRule = Node.create({\n\tname: \"horizontalRule\",\n\taddOptions() {\n\t\treturn {\n\t\t\tHTMLAttributes: {},\n\t\t\tnextNodeType: \"paragraph\"\n\t\t};\n\t},\n\tgroup: \"block\",\n\tparseHTML() {\n\t\treturn [{ tag: \"hr\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\"hr\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n\t},\n\tmarkdownTokenName: \"hr\",\n\tparseMarkdown: (token, helpers) => {\n\t\treturn helpers.createNode(\"horizontalRule\");\n\t},\n\trenderMarkdown: () => {\n\t\treturn \"---\";\n\t},\n\taddCommands() {\n\t\treturn { setHorizontalRule: () => ({ chain, state }) => {\n\t\t\tif (!canInsertNode(state, state.schema.nodes[this.name])) return false;\n\t\t\tconst { selection } = state;\n\t\t\tconst { $to: $originTo } = selection;\n\t\t\tconst currentChain = chain();\n\t\t\tif (isNodeSelection(selection)) currentChain.insertContentAt($originTo.pos, { type: this.name });\n\t\t\telse currentChain.insertContent({ type: this.name });\n\t\t\treturn currentChain.command(({ state: chainState, tr, dispatch }) => {\n\t\t\t\tif (dispatch) {\n\t\t\t\t\tconst { $to } = tr.selection;\n\t\t\t\t\tconst posAfter = $to.end();\n\t\t\t\t\tif ($to.nodeAfter) {\n\t\t\t\t\t\tif ($to.nodeAfter.isTextblock) tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1));\n\t\t\t\t\t\telse if ($to.nodeAfter.isBlock) tr.setSelection(NodeSelection.create(tr.doc, $to.pos));\n\t\t\t\t\t\telse tr.setSelection(TextSelection.create(tr.doc, $to.pos));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;\n\t\t\t\t\t\tconst node = nodeType === null || nodeType === void 0 ? void 0 : nodeType.create();\n\t\t\t\t\t\tif (node) {\n\t\t\t\t\t\t\ttr.insert(posAfter, node);\n\t\t\t\t\t\t\ttr.setSelection(TextSelection.create(tr.doc, posAfter + 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttr.scrollIntoView();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}).run();\n\t\t} };\n\t},\n\taddInputRules() {\n\t\treturn [nodeInputRule({\n\t\t\tfind: /^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,\n\t\t\ttype: this.type\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = HorizontalRule;\n//#endregion\nexport { HorizontalRule, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;AAOA,IAAMA,IAAiBC,EAAK,OAAO;CAClC,MAAM;CACN,aAAa;EACZ,OAAO;GACN,gBAAgB,CAAC;GACjB,cAAc;EACf;CACD;CACA,OAAO;CACP,YAAY;EACX,OAAO,CAAC,EAAE,KAAK,KAAK,CAAC;CACtB;CACA,WAAW,EAAE,qBAAkB;EAC9B,OAAO,CAAC,MAAMC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc,CAAC;CAC3E;CACA,mBAAmB;CACnB,gBAAgB,GAAO,MACfC,EAAQ,WAAW,gBAAgB;CAE3C,sBACQ;CAER,cAAc;EACb,OAAO,EAAE,0BAA0B,EAAE,UAAO,eAAY;GACvD,IAAI,CAACC,EAAcC,GAAOA,EAAM,OAAO,MAAM,KAAK,KAAK,GAAG,OAAO;GACjE,IAAM,EAAE,iBAAcA,GAChB,EAAE,KAAKC,MAAcC,GACrBC,IAAeC,EAAM;GAG3B,OAFIC,EAAgBH,CAAS,IAAGC,EAAa,gBAAgBF,EAAU,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,IAC1FE,EAAa,cAAc,EAAE,MAAM,KAAK,KAAK,CAAC,GAC5CA,EAAa,SAAS,EAAE,OAAOG,GAAY,OAAI,kBAAe;IACpE,IAAIC,GAAU;KACb,IAAM,EAAE,WAAQC,EAAG,WACbC,IAAWC,EAAI,IAAI;KACzB,IAAIA,EAAI,WACP,AAAIA,EAAI,UAAU,cAAaF,EAAG,aAAaG,EAAc,OAAOH,EAAG,KAAKE,EAAI,MAAM,CAAC,CAAC,IAC/EA,EAAI,UAAU,UAASF,EAAG,aAAaI,EAAc,OAAOJ,EAAG,KAAKE,EAAI,GAAG,CAAC,IAChFF,EAAG,aAAaG,EAAc,OAAOH,EAAG,KAAKE,EAAI,GAAG,CAAC;UACpD;MACN,IACMG,KADWP,EAAW,OAAO,MAAM,KAAK,QAAQ,iBAAiBI,EAAI,OAAO,KAAK,aAAa,YACvF,EAA6D,OAAO;MACjF,AAAIG,MACHL,EAAG,OAAOC,GAAUI,CAAI,GACxBL,EAAG,aAAaG,EAAc,OAAOH,EAAG,KAAKC,IAAW,CAAC,CAAC;KAE5D;KACA,EAAG,eAAe;IACnB;IACA,OAAO;GACR,CAAC,CAAC,CAAC,IAAI;EACR,EAAE;CACH;CACA,gBAAgB;EACf,OAAO,CAACK,EAAc;GACrB,MAAM;GACN,MAAM,KAAK;EACZ,CAAC,CAAC;CACH;AACD,CAAC"}
@@ -1,70 +0,0 @@
1
- import { Mark as e, markInputRule as t, markPasteRule as n, mergeAttributes as r } from "../../core/dist/index.js";
2
- // node_modules/@tiptap/extension-italic/dist/index.js
3
- var i = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, a = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, o = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, s = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, c = e.create({
4
- name: "italic",
5
- addOptions() {
6
- return { HTMLAttributes: {} };
7
- },
8
- parseHTML() {
9
- return [
10
- { tag: "em" },
11
- {
12
- tag: "i",
13
- getAttrs: (e) => e.style.fontStyle !== "normal" && null
14
- },
15
- {
16
- style: "font-style=normal",
17
- clearMark: (e) => e.type.name === this.name
18
- },
19
- { style: "font-style=italic" }
20
- ];
21
- },
22
- renderHTML({ HTMLAttributes: e }) {
23
- return [
24
- "em",
25
- r(this.options.HTMLAttributes, e),
26
- 0
27
- ];
28
- },
29
- addCommands() {
30
- return {
31
- setItalic: () => ({ commands: e }) => e.setMark(this.name),
32
- toggleItalic: () => ({ commands: e }) => e.toggleMark(this.name),
33
- unsetItalic: () => ({ commands: e }) => e.unsetMark(this.name)
34
- };
35
- },
36
- markdownTokenName: "em",
37
- parseMarkdown: (e, t) => t.applyMark("italic", t.parseInline(e.tokens || [])),
38
- markdownOptions: { htmlReopen: {
39
- open: "<em>",
40
- close: "</em>"
41
- } },
42
- renderMarkdown: (e, t) => `*${t.renderChildren(e)}*`,
43
- addKeyboardShortcuts() {
44
- return {
45
- "Mod-i": () => this.editor.commands.toggleItalic(),
46
- "Mod-I": () => this.editor.commands.toggleItalic()
47
- };
48
- },
49
- addInputRules() {
50
- return [t({
51
- find: i,
52
- type: this.type
53
- }), t({
54
- find: o,
55
- type: this.type
56
- })];
57
- },
58
- addPasteRules() {
59
- return [n({
60
- find: a,
61
- type: this.type
62
- }), n({
63
- find: s,
64
- type: this.type
65
- })];
66
- }
67
- });
68
- export { c as Italic, i as starInputRegex, a as starPasteRegex, o as underscoreInputRegex, s as underscorePasteRegex };
69
-
70
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["starInputRegex","starPasteRegex","underscoreInputRegex","underscorePasteRegex","Italic","Mark","node","mark","mergeAttributes","HTMLAttributes","commands","helpers","token","h","markInputRule","markPasteRule"],"sources":["../../../../../node_modules/@tiptap/extension-italic/dist/index.js"],"sourcesContent":["import { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\n//#region src/italic.ts\n/**\n* Matches an italic to a *italic* on input.\n*/\nconst starInputRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/;\n/**\n* Matches an italic to a *italic* on paste.\n*/\nconst starPasteRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g;\n/**\n* Matches an italic to a _italic_ on input.\n*/\nconst underscoreInputRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/;\n/**\n* Matches an italic to a _italic_ on paste.\n*/\nconst underscorePasteRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g;\n/**\n* This extension allows you to create italic text.\n* @see https://www.tiptap.dev/api/marks/italic\n*/\nconst Italic = Mark.create({\n\tname: \"italic\",\n\taddOptions() {\n\t\treturn { HTMLAttributes: {} };\n\t},\n\tparseHTML() {\n\t\treturn [\n\t\t\t{ tag: \"em\" },\n\t\t\t{\n\t\t\t\ttag: \"i\",\n\t\t\t\tgetAttrs: (node) => node.style.fontStyle !== \"normal\" && null\n\t\t\t},\n\t\t\t{\n\t\t\t\tstyle: \"font-style=normal\",\n\t\t\t\tclearMark: (mark) => mark.type.name === this.name\n\t\t\t},\n\t\t\t{ style: \"font-style=italic\" }\n\t\t];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"em\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetItalic: () => ({ commands }) => {\n\t\t\t\treturn commands.setMark(this.name);\n\t\t\t},\n\t\t\ttoggleItalic: () => ({ commands }) => {\n\t\t\t\treturn commands.toggleMark(this.name);\n\t\t\t},\n\t\t\tunsetItalic: () => ({ commands }) => {\n\t\t\t\treturn commands.unsetMark(this.name);\n\t\t\t}\n\t\t};\n\t},\n\tmarkdownTokenName: \"em\",\n\tparseMarkdown: (token, helpers) => {\n\t\treturn helpers.applyMark(\"italic\", helpers.parseInline(token.tokens || []));\n\t},\n\tmarkdownOptions: { htmlReopen: {\n\t\topen: \"<em>\",\n\t\tclose: \"</em>\"\n\t} },\n\trenderMarkdown: (node, h) => {\n\t\treturn `*${h.renderChildren(node)}*`;\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-i\": () => this.editor.commands.toggleItalic(),\n\t\t\t\"Mod-I\": () => this.editor.commands.toggleItalic()\n\t\t};\n\t},\n\taddInputRules() {\n\t\treturn [markInputRule({\n\t\t\tfind: starInputRegex,\n\t\t\ttype: this.type\n\t\t}), markInputRule({\n\t\t\tfind: underscoreInputRegex,\n\t\t\ttype: this.type\n\t\t})];\n\t},\n\taddPasteRules() {\n\t\treturn [markPasteRule({\n\t\t\tfind: starPasteRegex,\n\t\t\ttype: this.type\n\t\t}), markPasteRule({\n\t\t\tfind: underscorePasteRegex,\n\t\t\ttype: this.type\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Italic;\n//#endregion\nexport { Italic, src_default as default, starInputRegex, starPasteRegex, underscoreInputRegex, underscorePasteRegex };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAKA,IAAMA,IAAiB,gDAIjBC,IAAiB,gDAIjBC,IAAuB,4CAIvBC,IAAuB,4CAKvBC,IAASC,EAAK,OAAO;CAC1B,MAAM;CACN,aAAa;EACZ,OAAO,EAAE,gBAAgB,CAAC,EAAE;CAC7B;CACA,YAAY;EACX,OAAO;GACN,EAAE,KAAK,KAAK;GACZ;IACC,KAAK;IACL,WAAW,MAASC,EAAK,MAAM,cAAc,YAAY;GAC1D;GACA;IACC,OAAO;IACP,YAAY,MAASC,EAAK,KAAK,SAAS,KAAK;GAC9C;GACA,EAAE,OAAO,oBAAoB;EAC9B;CACD;CACA,WAAW,EAAE,qBAAkB;EAC9B,OAAO;GACN;GACAC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAC3D;EACD;CACD;CACA,cAAc;EACb,OAAO;GACN,kBAAkB,EAAE,kBACZC,EAAS,QAAQ,KAAK,IAAI;GAElC,qBAAqB,EAAE,kBACfA,EAAS,WAAW,KAAK,IAAI;GAErC,oBAAoB,EAAE,kBACdA,EAAS,UAAU,KAAK,IAAI;EAErC;CACD;CACA,mBAAmB;CACnB,gBAAgB,GAAO,MACfC,EAAQ,UAAU,UAAUA,EAAQ,YAAYC,EAAM,UAAU,CAAC,CAAC,CAAC;CAE3E,iBAAiB,EAAE,YAAY;EAC9B,MAAM;EACN,OAAO;CACR,EAAE;CACF,iBAAiB,GAAM,MACf,IAAIC,EAAE,eAAeP,CAAI,EAAE;CAEnC,uBAAuB;EACtB,OAAO;GACN,eAAe,KAAK,OAAO,SAAS,aAAa;GACjD,eAAe,KAAK,OAAO,SAAS,aAAa;EAClD;CACD;CACA,gBAAgB;EACf,OAAO,CAACQ,EAAc;GACrB,MAAMd;GACN,MAAM,KAAK;EACZ,CAAC,GAAGc,EAAc;GACjB,MAAMZ;GACN,MAAM,KAAK;EACZ,CAAC,CAAC;CACH;CACA,gBAAgB;EACf,OAAO,CAACa,EAAc;GACrB,MAAMd;GACN,MAAM,KAAK;EACZ,CAAC,GAAGc,EAAc;GACjB,MAAMZ;GACN,MAAM,KAAK;EACZ,CAAC,CAAC;CACH;AACD,CAAC"}
@@ -1,389 +0,0 @@
1
- import { InputRule as e, Mark as t, PasteRule as n, combineTransactionSteps as r, findChildrenInRange as i, getAttributes as a, getChangedRanges as o, getMarksBetween as s, markInputRule as c, markPasteRule as l, mergeAttributes as u } from "../../core/dist/index.js";
2
- import { find as d, registerCustomProtocol as f, reset as p, tokenize as m } from "../../../linkifyjs/dist/linkify.js";
3
- import { isHistoryTransaction as h } from "../../../prosemirror-history/dist/index.js";
4
- import { Plugin as g, PluginKey as _ } from "../../../prosemirror-state/dist/index.js";
5
- import { ReplaceStep as v } from "../../../prosemirror-transform/dist/index.js";
6
- // node_modules/@tiptap/extension-link/dist/index.js
7
- var y = "[\0- \xA0 ᠎ -\u2029  ]", b = new RegExp(y), x = RegExp(`${y}$`), S = RegExp(`${y}+$`), C = new RegExp(y, "g");
8
- function w(e, t, n) {
9
- let r = e.doc.resolve(t.to);
10
- if (!r.nodeBefore?.isText) return;
11
- let i = e.doc.textBetween(t.from, t.to, "", "").match(S)?.[0];
12
- if (!i) return;
13
- let a = t.to - i.length, o = s(a, t.to, e.doc).filter((e) => e.mark.type === n);
14
- if (!o.length) return;
15
- let { nodeAfter: c } = r;
16
- if (c && o.some((e) => e.mark.isInSet(c.marks))) return;
17
- let l = e.storedMarks;
18
- e.removeMark(a, t.to, n), e.setStoredMarks(l), e.selection.empty && e.selection.from === t.to && e.removeStoredMark(n);
19
- }
20
- function T(e) {
21
- return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
22
- }
23
- function E(e) {
24
- return new g({
25
- key: new _("autolink"),
26
- appendTransaction: (t, n, a) => {
27
- let c = t.some((e) => e.docChanged) && !n.doc.eq(a.doc), l = t.some((e) => e.getMeta("preventAutolink"));
28
- if (!c || l) return;
29
- let { tr: u } = a, d = r(n.doc, [...t]);
30
- if (!t.some(h)) {
31
- let t = [];
32
- d.steps.forEach((e, n) => {
33
- if (!(e instanceof v) || !e.slice.size) return;
34
- let r = d.mapping.slice(n + 1), i = r.map(e.from, 1), a = r.map(e.from + e.slice.size, -1);
35
- i < a && t.push({
36
- from: i,
37
- to: a
38
- });
39
- }), t.sort((e, t) => t.to - e.to), t.forEach((t) => w(u, t, e.type));
40
- }
41
- if (o(d).forEach(({ newRange: t }) => {
42
- let n = i(a.doc, t, (e) => e.isTextblock), r, o;
43
- if (n.length > 1) r = n[0], o = a.doc.textBetween(r.pos, r.pos + r.node.nodeSize, void 0, " ");
44
- else if (n.length) {
45
- let e = a.doc.textBetween(t.from, t.to, " ", " ");
46
- if (!x.test(e)) return;
47
- r = n[0], o = a.doc.textBetween(r.pos, t.to, void 0, " ");
48
- }
49
- if (r && o) {
50
- let t = o.split(b).filter(Boolean);
51
- if (t.length <= 0) return !1;
52
- let n = t[t.length - 1], i = r.pos + o.lastIndexOf(n);
53
- if (!n) return !1;
54
- let c = m(n).map((t) => t.toObject(e.defaultProtocol));
55
- if (!T(c)) return !1;
56
- c.filter((e) => e.isLink).map((e) => ({
57
- ...e,
58
- from: i + e.start + 1,
59
- to: i + e.end + 1
60
- })).filter((e) => !a.schema.marks.code || !a.doc.rangeHasMark(e.from, e.to, a.schema.marks.code)).filter((t) => e.validate(t.value)).filter((t) => e.shouldAutoLink(t.value)).forEach((t) => {
61
- s(t.from, t.to, a.doc).some((t) => t.mark.type === e.type) || u.addMark(t.from, t.to, e.type.create({ href: t.href }));
62
- });
63
- }
64
- }), u.steps.length) return u;
65
- }
66
- });
67
- }
68
- function D(e) {
69
- return new g({
70
- key: new _("handleClickLink"),
71
- props: { handleClick: (t, n, r) => {
72
- if (r.button !== 0 || !t.editable) return !1;
73
- let i = null;
74
- if (r.target instanceof HTMLAnchorElement) i = r.target;
75
- else {
76
- let t = r.target;
77
- if (!t) return !1;
78
- let n = e.editor.view.dom;
79
- i = t.closest("a"), i && !n.contains(i) && (i = null);
80
- }
81
- if (!i) return !1;
82
- let o = !1;
83
- if (e.enableClickSelection && (o = e.editor.commands.extendMarkRange(e.type.name)), e.openOnClick) {
84
- let n = a(t.state, e.type.name), r = i.href ?? n.href, s = i.target ?? n.target;
85
- r && (window.open(r, s), o = !0);
86
- }
87
- return o;
88
- } }
89
- });
90
- }
91
- var O = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/, k = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;
92
- function A(e, t) {
93
- let n = 0;
94
- for (let r = t - 1; r >= 0 && e[r] === "\\"; --r) n += 1;
95
- return n % 2 == 1;
96
- }
97
- function j(e, t) {
98
- let n = 0, r = 0;
99
- for (; r < t;) {
100
- if (e[r] !== "`" || n === 0 && A(e, r)) {
101
- r += 1;
102
- continue;
103
- }
104
- let i = 0;
105
- for (; r < t && e[r] === "`";) i += 1, r += 1;
106
- n === 0 ? n = i : i === n && (n = 0);
107
- }
108
- return n > 0;
109
- }
110
- function M(e, t, n) {
111
- let [, r, i] = t;
112
- return (t.index ? e[t.index - 1] : void 0) === "!" || A(e, t.index ?? 0) || j(e, t.index ?? 0) ? !1 : !!r.trim() && n(i);
113
- }
114
- function N(e) {
115
- let [t, n, r, , i, a, o] = e, s = i ?? a ?? o;
116
- return {
117
- index: e.index ?? 0,
118
- text: t,
119
- replaceWith: n,
120
- data: {
121
- href: r,
122
- title: s || null,
123
- markdown: !0
124
- }
125
- };
126
- }
127
- function P(e, t) {
128
- return e.index < t.index + t.text.length && t.index < e.index + e.text.length;
129
- }
130
- function F(e) {
131
- return {
132
- href: e.data?.href,
133
- title: e.data?.title ?? null
134
- };
135
- }
136
- function I(t) {
137
- let n = c({
138
- find: (e) => {
139
- let n = O.exec(e);
140
- return !n || !M(e, n, t.isAllowedHref) ? null : N(n);
141
- },
142
- type: t.type,
143
- getAttributes: F
144
- });
145
- return new e({
146
- find: n.find,
147
- handler: (e) => {
148
- let t = n.handler(e);
149
- return t !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), t;
150
- }
151
- });
152
- }
153
- function L(e) {
154
- let t = l({
155
- find: (t) => {
156
- let n = [];
157
- for (let r of t.matchAll(k)) M(t, r, e.isAllowedHref) && n.push(N(r));
158
- let r = (e.findPlainUrls?.call(e, t) ?? []).filter((e) => !n.some((t) => P(t, e)));
159
- return [...n, ...r];
160
- },
161
- type: e.type,
162
- getAttributes: F
163
- });
164
- return new n({
165
- find: t.find,
166
- handler: (e) => {
167
- let n = t.handler(e);
168
- return n !== null && e.state.tr.steps.length && e.match.data?.markdown && e.state.tr.setMeta("preventAutolink", !0), n;
169
- }
170
- });
171
- }
172
- function R(e) {
173
- return new g({
174
- key: new _("handlePasteLink"),
175
- props: { handlePaste: (t, n, r) => {
176
- let { shouldAutoLink: i } = e, { state: a } = t, { selection: o } = a, { empty: s } = o;
177
- if (s) return !1;
178
- let c = "";
179
- r.content.forEach((e) => {
180
- c += e.textContent;
181
- });
182
- let l = d(c, { defaultProtocol: e.defaultProtocol }).find((e) => e.isLink && e.value === c);
183
- return !c || !l || i !== void 0 && !i(l.value) ? !1 : e.editor.commands.setMark(e.type, { href: l.href });
184
- } }
185
- });
186
- }
187
- function z(e, t) {
188
- let n = [
189
- "http",
190
- "https",
191
- "ftp",
192
- "ftps",
193
- "mailto",
194
- "tel",
195
- "callto",
196
- "sms",
197
- "cid",
198
- "xmpp"
199
- ];
200
- return t && t.forEach((e) => {
201
- let t = typeof e == "string" ? e : e.scheme;
202
- t && n.push(t);
203
- }), !e || e.replace(C, "").match(RegExp(`^(?:(?:${n.map((e) => e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`, "i"));
204
- }
205
- var B = t.create({
206
- name: "link",
207
- priority: 1e3,
208
- keepOnSplit: !1,
209
- exitable: !0,
210
- onCreate() {
211
- this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")), this.options.protocols.forEach((e) => {
212
- typeof e == "string" ? f(e) : f(e.scheme, e.optionalSlashes);
213
- });
214
- },
215
- onDestroy() {
216
- p();
217
- },
218
- inclusive() {
219
- return this.options.autolink;
220
- },
221
- addOptions() {
222
- return {
223
- openOnClick: !0,
224
- enableClickSelection: !1,
225
- linkOnPaste: !0,
226
- markdownLinks: !1,
227
- autolink: !0,
228
- protocols: [],
229
- defaultProtocol: "http",
230
- HTMLAttributes: {
231
- target: "_blank",
232
- rel: "noopener noreferrer nofollow",
233
- class: null
234
- },
235
- isAllowedUri: (e, t) => !!z(e, t.protocols),
236
- validate: (e) => !!e,
237
- shouldAutoLink: (e) => {
238
- let t = /^[a-z][a-z0-9+.-]*:\/\//i.test(e), n = /^[a-z][a-z0-9+.-]*:/i.test(e);
239
- if (t || n && !e.includes("@")) return !0;
240
- let r = (e.includes("@") ? e.split("@").pop() : e).split(/[/?#:]/)[0];
241
- return !(/^\d{1,3}(\.\d{1,3}){3}$/.test(r) || !/\./.test(r));
242
- }
243
- };
244
- },
245
- addAttributes() {
246
- return {
247
- href: {
248
- default: null,
249
- parseHTML(e) {
250
- return e.getAttribute("href");
251
- }
252
- },
253
- target: { default: this.options.HTMLAttributes.target ?? null },
254
- rel: { default: this.options.HTMLAttributes.rel ?? null },
255
- class: { default: this.options.HTMLAttributes.class ?? null },
256
- title: { default: null }
257
- };
258
- },
259
- parseHTML() {
260
- return [{
261
- tag: "a[href]",
262
- getAttrs: (e) => {
263
- let t = e.getAttribute("href");
264
- return !t || !this.options.isAllowedUri(t, {
265
- defaultValidate: (e) => !!z(e, this.options.protocols),
266
- protocols: this.options.protocols,
267
- defaultProtocol: this.options.defaultProtocol
268
- }) ? !1 : null;
269
- }
270
- }];
271
- },
272
- renderHTML({ HTMLAttributes: e }) {
273
- return this.options.isAllowedUri(e.href, {
274
- defaultValidate: (e) => !!z(e, this.options.protocols),
275
- protocols: this.options.protocols,
276
- defaultProtocol: this.options.defaultProtocol
277
- }) ? [
278
- "a",
279
- u(this.options.HTMLAttributes, e),
280
- 0
281
- ] : [
282
- "a",
283
- u(this.options.HTMLAttributes, {
284
- ...e,
285
- href: ""
286
- }),
287
- 0
288
- ];
289
- },
290
- markdownTokenName: "link",
291
- parseMarkdown: (e, t) => t.applyMark("link", t.parseInline(e.tokens || []), {
292
- href: e.href,
293
- title: e.title || null
294
- }),
295
- renderMarkdown: (e, t) => {
296
- let n = e.attrs?.href ?? "", r = e.attrs?.title ?? "", i = t.renderChildren(e);
297
- return r ? `[${i}](${n} "${r}")` : `[${i}](${n})`;
298
- },
299
- addCommands() {
300
- return {
301
- setLink: (e) => ({ chain: t }) => {
302
- let { href: n } = e;
303
- return this.options.isAllowedUri(n, {
304
- defaultValidate: (e) => !!z(e, this.options.protocols),
305
- protocols: this.options.protocols,
306
- defaultProtocol: this.options.defaultProtocol
307
- }) ? t().setMark(this.name, e).setMeta("preventAutolink", !0).run() : !1;
308
- },
309
- toggleLink: (e) => ({ chain: t }) => {
310
- let { href: n } = e || {};
311
- return n && !this.options.isAllowedUri(n, {
312
- defaultValidate: (e) => !!z(e, this.options.protocols),
313
- protocols: this.options.protocols,
314
- defaultProtocol: this.options.defaultProtocol
315
- }) ? !1 : t().toggleMark(this.name, e, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
316
- },
317
- unsetLink: () => ({ chain: e }) => e().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
318
- };
319
- },
320
- addInputRules() {
321
- return this.options.markdownLinks ? [I({
322
- type: this.type,
323
- isAllowedHref: (e) => this.options.isAllowedUri(e, {
324
- defaultValidate: (e) => !!z(e, this.options.protocols),
325
- protocols: this.options.protocols,
326
- defaultProtocol: this.options.defaultProtocol
327
- })
328
- })] : [];
329
- },
330
- addPasteRules() {
331
- let e = (e) => {
332
- let t = [];
333
- if (e) {
334
- let { protocols: n, defaultProtocol: r } = this.options;
335
- d(e, { defaultProtocol: r }).filter((e) => e.isLink && this.options.isAllowedUri(e.value, {
336
- defaultValidate: (e) => !!z(e, n),
337
- protocols: n,
338
- defaultProtocol: r
339
- })).forEach((e) => {
340
- this.options.shouldAutoLink(e.value) && t.push({
341
- text: e.value,
342
- data: { href: e.href },
343
- index: e.start
344
- });
345
- });
346
- }
347
- return t;
348
- };
349
- return this.options.markdownLinks ? [L({
350
- type: this.type,
351
- isAllowedHref: (e) => this.options.isAllowedUri(e, {
352
- defaultValidate: (e) => !!z(e, this.options.protocols),
353
- protocols: this.options.protocols,
354
- defaultProtocol: this.options.defaultProtocol
355
- }),
356
- findPlainUrls: e
357
- })] : [l({
358
- find: e,
359
- type: this.type,
360
- getAttributes: (e) => ({ href: e.data?.href })
361
- })];
362
- },
363
- addProseMirrorPlugins() {
364
- let e = [], { protocols: t, defaultProtocol: n } = this.options;
365
- return this.options.autolink && e.push(E({
366
- type: this.type,
367
- defaultProtocol: this.options.defaultProtocol,
368
- validate: (e) => this.options.isAllowedUri(e, {
369
- defaultValidate: (e) => !!z(e, t),
370
- protocols: t,
371
- defaultProtocol: n
372
- }),
373
- shouldAutoLink: this.options.shouldAutoLink
374
- })), e.push(D({
375
- type: this.type,
376
- editor: this.editor,
377
- openOnClick: this.options.openOnClick === "whenNotEditable" || this.options.openOnClick,
378
- enableClickSelection: this.options.enableClickSelection
379
- })), this.options.linkOnPaste && e.push(R({
380
- editor: this.editor,
381
- defaultProtocol: this.options.defaultProtocol,
382
- type: this.type,
383
- shouldAutoLink: this.options.shouldAutoLink
384
- })), e;
385
- }
386
- });
387
- export { B as Link, z as isAllowedUri };
388
-
389
- //# sourceMappingURL=index.js.map