@burdenoff/microfe-support 2026.819.2 → 2026.819.4

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 (105) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +7 -0
  2. package/dist/generated/global-types.d.ts +217 -1
  3. package/dist/generated/global-types.js +16 -14
  4. package/dist/generated/global-types.js.map +1 -1
  5. package/dist/microfe-support.css +1 -1
  6. package/dist/node_modules/@tiptap/core/dist/index.js +3453 -0
  7. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -0
  8. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +21 -0
  9. package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -0
  10. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +76 -0
  11. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -0
  12. package/dist/node_modules/@tiptap/extension-bold/dist/index.js +74 -0
  13. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -0
  14. package/dist/node_modules/@tiptap/extension-code/dist/index.js +68 -0
  15. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -0
  16. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +160 -0
  17. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -0
  18. package/dist/node_modules/@tiptap/extension-document/dist/index.js +12 -0
  19. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -0
  20. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +51 -0
  21. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -0
  22. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +68 -0
  23. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -0
  24. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +50 -0
  25. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -0
  26. package/dist/node_modules/@tiptap/extension-italic/dist/index.js +71 -0
  27. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -0
  28. package/dist/node_modules/@tiptap/extension-link/dist/index.js +373 -0
  29. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -0
  30. package/dist/node_modules/@tiptap/extension-list/dist/index.js +964 -0
  31. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -0
  32. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +46 -0
  33. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -0
  34. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +7 -0
  35. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -0
  36. package/dist/node_modules/@tiptap/extension-strike/dist/index.js +56 -0
  37. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -0
  38. package/dist/node_modules/@tiptap/extension-text/dist/index.js +15 -0
  39. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -0
  40. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +63 -0
  41. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -0
  42. package/dist/node_modules/@tiptap/extensions/dist/index.js +459 -0
  43. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -0
  44. package/dist/node_modules/@tiptap/react/dist/index.js +316 -0
  45. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -0
  46. package/dist/node_modules/@tiptap/starter-kit/dist/index.js +29 -0
  47. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -0
  48. package/dist/node_modules/fast-equals/dist/es/index.js +267 -0
  49. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -0
  50. package/dist/node_modules/linkifyjs/dist/linkify.js +514 -0
  51. package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -0
  52. package/dist/node_modules/orderedmap/dist/index.js +69 -0
  53. package/dist/node_modules/orderedmap/dist/index.js.map +1 -0
  54. package/dist/node_modules/prosemirror-commands/dist/index.js +335 -0
  55. package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -0
  56. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +113 -0
  57. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -0
  58. package/dist/node_modules/prosemirror-gapcursor/dist/index.js +173 -0
  59. package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -0
  60. package/dist/node_modules/prosemirror-history/dist/index.js +214 -0
  61. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -0
  62. package/dist/node_modules/prosemirror-keymap/dist/index.js +52 -0
  63. package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -0
  64. package/dist/node_modules/prosemirror-model/dist/index.js +1786 -0
  65. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -0
  66. package/dist/node_modules/prosemirror-schema-list/dist/index.js +75 -0
  67. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -0
  68. package/dist/node_modules/prosemirror-state/dist/index.js +527 -0
  69. package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -0
  70. package/dist/node_modules/prosemirror-transform/dist/index.js +1153 -0
  71. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -0
  72. package/dist/node_modules/prosemirror-view/dist/index.js +3296 -0
  73. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -0
  74. package/dist/node_modules/rope-sequence/dist/index.js +85 -0
  75. package/dist/node_modules/rope-sequence/dist/index.js.map +1 -0
  76. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +56 -0
  77. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  78. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +54 -0
  79. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  80. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +54 -0
  81. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  82. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +46 -0
  83. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  84. package/dist/node_modules/use-sync-external-store/shim/index.js +12 -0
  85. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  86. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +12 -0
  87. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  88. package/dist/node_modules/w3c-keyname/index.js +90 -0
  89. package/dist/node_modules/w3c-keyname/index.js.map +1 -0
  90. package/dist/support/components/careers/BulkCandidateDialogs.d.ts +2 -3
  91. package/dist/support/components/careers/BulkCandidateDialogs.js +178 -188
  92. package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
  93. package/dist/support/components/careers/RichTextEditor.d.ts +16 -0
  94. package/dist/support/components/careers/RichTextEditor.js +87 -0
  95. package/dist/support/components/careers/RichTextEditor.js.map +1 -0
  96. package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -0
  97. package/dist/support/pages/JobApplicationDetailPage.js +338 -336
  98. package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
  99. package/dist/support/pages/JobApplicationsPage.js +383 -339
  100. package/dist/support/pages/JobApplicationsPage.js.map +1 -1
  101. package/dist/support/pages/JobPostingDetailPage.js +310 -303
  102. package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
  103. package/dist/support/utils/bulkCandidateOperations.js +31 -65
  104. package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
  105. package/package.json +4 -1
@@ -0,0 +1,50 @@
1
+ import { NodeSelection as e, TextSelection as t } from "../../../prosemirror-state/dist/index.js";
2
+ import { Node as n, canInsertNode as r, isNodeSelection as i, mergeAttributes as a, nodeInputRule as o } from "../../core/dist/index.js";
3
+ //#region node_modules/@tiptap/extension-horizontal-rule/dist/index.js
4
+ var s = n.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", a(this.options.HTMLAttributes, e)];
18
+ },
19
+ markdownTokenName: "hr",
20
+ parseMarkdown: (e, t) => t.createNode("horizontalRule"),
21
+ renderMarkdown: () => "---",
22
+ addCommands() {
23
+ return { setHorizontalRule: () => ({ chain: n, state: a }) => {
24
+ if (!r(a, a.schema.nodes[this.name])) return !1;
25
+ let { selection: o } = a, { $to: s } = o, c = n();
26
+ return i(o) ? c.insertContentAt(s.pos, { type: this.name }) : c.insertContent({ type: this.name }), c.command(({ state: n, tr: r, dispatch: i }) => {
27
+ if (i) {
28
+ let { $to: i } = r.selection, a = i.end();
29
+ if (i.nodeAfter) i.nodeAfter.isTextblock ? r.setSelection(t.create(r.doc, i.pos + 1)) : i.nodeAfter.isBlock ? r.setSelection(e.create(r.doc, i.pos)) : r.setSelection(t.create(r.doc, i.pos));
30
+ else {
31
+ let e = (n.schema.nodes[this.options.nextNodeType] || i.parent.type.contentMatch.defaultType)?.create();
32
+ e && (r.insert(a, e), r.setSelection(t.create(r.doc, a + 1)));
33
+ }
34
+ r.scrollIntoView();
35
+ }
36
+ return !0;
37
+ }).run();
38
+ } };
39
+ },
40
+ addInputRules() {
41
+ return [o({
42
+ find: /^(?:---|—-|___\s|\*\*\*\s)$/,
43
+ type: this.type
44
+ })];
45
+ }
46
+ });
47
+ //#endregion
48
+ export { s as HorizontalRule };
49
+
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Node"],"sources":["../../../../../node_modules/@tiptap/extension-horizontal-rule/dist/index.js"],"sourcesContent":["// src/horizontal-rule.ts\nimport { canInsertNode, isNodeSelection, mergeAttributes, Node, nodeInputRule } from \"@tiptap/core\";\nimport { NodeSelection, TextSelection } from \"@tiptap/pm/state\";\nvar HorizontalRule = Node.create({\n name: \"horizontalRule\",\n addOptions() {\n return {\n HTMLAttributes: {},\n nextNodeType: \"paragraph\"\n };\n },\n group: \"block\",\n parseHTML() {\n return [{ tag: \"hr\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"hr\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n markdownTokenName: \"hr\",\n parseMarkdown: (token, helpers) => {\n return helpers.createNode(\"horizontalRule\");\n },\n renderMarkdown: () => {\n return \"---\";\n },\n addCommands() {\n return {\n setHorizontalRule: () => ({ chain, state }) => {\n if (!canInsertNode(state, state.schema.nodes[this.name])) {\n return false;\n }\n const { selection } = state;\n const { $to: $originTo } = selection;\n const currentChain = chain();\n if (isNodeSelection(selection)) {\n currentChain.insertContentAt($originTo.pos, {\n type: this.name\n });\n } else {\n currentChain.insertContent({ type: this.name });\n }\n return currentChain.command(({ state: chainState, tr, dispatch }) => {\n if (dispatch) {\n const { $to } = tr.selection;\n const posAfter = $to.end();\n if ($to.nodeAfter) {\n if ($to.nodeAfter.isTextblock) {\n tr.setSelection(TextSelection.create(tr.doc, $to.pos + 1));\n } else if ($to.nodeAfter.isBlock) {\n tr.setSelection(NodeSelection.create(tr.doc, $to.pos));\n } else {\n tr.setSelection(TextSelection.create(tr.doc, $to.pos));\n }\n } else {\n const nodeType = chainState.schema.nodes[this.options.nextNodeType] || $to.parent.type.contentMatch.defaultType;\n const node = nodeType == null ? void 0 : nodeType.create();\n if (node) {\n tr.insert(posAfter, node);\n tr.setSelection(TextSelection.create(tr.doc, posAfter + 1));\n }\n }\n tr.scrollIntoView();\n }\n return true;\n }).run();\n }\n };\n },\n addInputRules() {\n return [\n nodeInputRule({\n find: /^(?:---|—-|___\\s|\\*\\*\\*\\s)$/,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = HorizontalRule;\nexport {\n Horizontal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MACF,EAAG,OAAO,GAAU,CAAI,GACxB,EAAG,aAAa,EAAc,OAAO,EAAG,KAAK,IAAW,CAAC,CAAC;KAE9D;KACA,EAAG,eAAe;IACpB;IACA,OAAO;GACT,CAAC,CAAC,CAAC,IAAI;EACT,EACF;CACF;CACA,gBAAgB;EACd,OAAO,CACL,EAAc;GACZ,MAAM;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;AACF,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { Mark as e, markInputRule as t, markPasteRule as n, mergeAttributes as r } from "../../core/dist/index.js";
2
+ //#region 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
+ //#endregion
69
+ export { c as Italic, i as starInputRegex, a as starPasteRegex, o as underscoreInputRegex, s as underscorePasteRegex };
70
+
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-italic/dist/index.js"],"sourcesContent":["// src/italic.ts\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nvar starInputRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/;\nvar starPasteRegex = /(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g;\nvar underscoreInputRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/;\nvar underscorePasteRegex = /(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g;\nvar Italic = Mark.create({\n name: \"italic\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"em\"\n },\n {\n tag: \"i\",\n getAttrs: (node) => node.style.fontStyle !== \"normal\" && null\n },\n {\n style: \"font-style=normal\",\n clearMark: (mark) => mark.type.name === this.name\n },\n {\n style: \"font-style=italic\"\n }\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"em\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n addCommands() {\n return {\n setItalic: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleItalic: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetItalic: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n markdownTokenName: \"em\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"italic\", helpers.parseInline(token.tokens || []));\n },\n markdownOptions: {\n htmlReopen: {\n open: \"<em>\",\n close: \"</em>\"\n }\n },\n renderMarkdown: (node, h) => {\n return `*${h.renderChildren(node)}*`;\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-i\": () => this.editor.commands.toggleItalic(),\n \"Mod-I\": () => this.editor.commands.toggleItalic()\n };\n },\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Italic;\nexport {\n Italic,\n index_default as default,\n starInputRegex,\n starPasteRegex,\n underscoreInputRegex,\n underscorePasteRegex\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;AAEA,IAAI,IAAiB,gDACjB,IAAiB,gDACjB,IAAuB,4CACvB,IAAuB,4CACvB,IAAS,EAAK,OAAO;CACvB,MAAM;CACN,aAAa;EACX,OAAO,EACL,gBAAgB,CAAC,EACnB;CACF;CACA,YAAY;EACV,OAAO;GACL,EACE,KAAK,KACP;GACA;IACE,KAAK;IACL,WAAW,MAAS,EAAK,MAAM,cAAc,YAAY;GAC3D;GACA;IACE,OAAO;IACP,YAAY,MAAS,EAAK,KAAK,SAAS,KAAK;GAC/C;GACA,EACE,OAAO,oBACT;EACF;CACF;CACA,WAAW,EAAE,qBAAkB;EAC7B,OAAO;GAAC;GAAM,EAAgB,KAAK,QAAQ,gBAAgB,CAAc;GAAG;EAAC;CAC/E;CACA,cAAc;EACZ,OAAO;GACL,kBAAkB,EAAE,kBACX,EAAS,QAAQ,KAAK,IAAI;GAEnC,qBAAqB,EAAE,kBACd,EAAS,WAAW,KAAK,IAAI;GAEtC,oBAAoB,EAAE,kBACb,EAAS,UAAU,KAAK,IAAI;EAEvC;CACF;CACA,mBAAmB;CACnB,gBAAgB,GAAO,MACd,EAAQ,UAAU,UAAU,EAAQ,YAAY,EAAM,UAAU,CAAC,CAAC,CAAC;CAE5E,iBAAiB,EACf,YAAY;EACV,MAAM;EACN,OAAO;CACT,EACF;CACA,iBAAiB,GAAM,MACd,IAAI,EAAE,eAAe,CAAI,EAAE;CAEpC,uBAAuB;EACrB,OAAO;GACL,eAAe,KAAK,OAAO,SAAS,aAAa;GACjD,eAAe,KAAK,OAAO,SAAS,aAAa;EACnD;CACF;CACA,gBAAgB;EACd,OAAO,CACL,EAAc;GACZ,MAAM;GACN,MAAM,KAAK;EACb,CAAC,GACD,EAAc;GACZ,MAAM;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;CACA,gBAAgB;EACd,OAAO,CACL,EAAc;GACZ,MAAM;GACN,MAAM,KAAK;EACb,CAAC,GACD,EAAc;GACZ,MAAM;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;AACF,CAAC"}
@@ -0,0 +1,373 @@
1
+ import { Plugin as e, PluginKey as t } from "../../../prosemirror-state/dist/index.js";
2
+ import { InputRule as n, Mark as r, PasteRule as i, combineTransactionSteps as a, findChildrenInRange as o, getAttributes as s, getChangedRanges as c, getMarksBetween as l, markInputRule as u, markPasteRule as d, mergeAttributes as f } from "../../core/dist/index.js";
3
+ import { find as p, registerCustomProtocol as m, reset as h, tokenize as g } from "../../../linkifyjs/dist/linkify.js";
4
+ //#region node_modules/@tiptap/extension-link/dist/index.js
5
+ var _ = "[\0- \xA0 ᠎ -\u2029  ]", v = new RegExp(_), y = RegExp(`${_}$`), b = new RegExp(_, "g");
6
+ function x(e) {
7
+ return e.length === 1 ? e[0].isLink : e.length === 3 && e[1].isLink ? ["()", "[]"].includes(e[0].value + e[2].value) : !1;
8
+ }
9
+ function S(n) {
10
+ return new e({
11
+ key: new t("autolink"),
12
+ appendTransaction: (e, t, r) => {
13
+ let i = e.some((e) => e.docChanged) && !t.doc.eq(r.doc), s = e.some((e) => e.getMeta("preventAutolink"));
14
+ if (!i || s) return;
15
+ let { tr: u } = r, d = a(t.doc, [...e]);
16
+ if (c(d).forEach(({ newRange: e }) => {
17
+ let t = o(r.doc, e, (e) => e.isTextblock), i, a;
18
+ if (t.length > 1) i = t[0], a = r.doc.textBetween(i.pos, i.pos + i.node.nodeSize, void 0, " ");
19
+ else if (t.length) {
20
+ let n = r.doc.textBetween(e.from, e.to, " ", " ");
21
+ if (!y.test(n)) return;
22
+ i = t[0], a = r.doc.textBetween(i.pos, e.to, void 0, " ");
23
+ }
24
+ if (i && a) {
25
+ let e = a.split(v).filter(Boolean);
26
+ if (e.length <= 0) return !1;
27
+ let t = e[e.length - 1], o = i.pos + a.lastIndexOf(t);
28
+ if (!t) return !1;
29
+ let s = g(t).map((e) => e.toObject(n.defaultProtocol));
30
+ if (!x(s)) return !1;
31
+ s.filter((e) => e.isLink).map((e) => ({
32
+ ...e,
33
+ from: o + e.start + 1,
34
+ to: o + e.end + 1
35
+ })).filter((e) => !r.schema.marks.code || !r.doc.rangeHasMark(e.from, e.to, r.schema.marks.code)).filter((e) => n.validate(e.value)).filter((e) => n.shouldAutoLink(e.value)).forEach((e) => {
36
+ l(e.from, e.to, r.doc).some((e) => e.mark.type === n.type) || u.addMark(e.from, e.to, n.type.create({ href: e.href }));
37
+ });
38
+ }
39
+ }), u.steps.length) return u;
40
+ }
41
+ });
42
+ }
43
+ function C(n) {
44
+ return new e({
45
+ key: new t("handleClickLink"),
46
+ props: { handleClick: (e, t, r) => {
47
+ if (r.button !== 0 || !e.editable) return !1;
48
+ let i = null;
49
+ if (r.target instanceof HTMLAnchorElement) i = r.target;
50
+ else {
51
+ let e = r.target;
52
+ if (!e) return !1;
53
+ let t = n.editor.view.dom;
54
+ i = e.closest("a"), i && !t.contains(i) && (i = null);
55
+ }
56
+ if (!i) return !1;
57
+ let a = !1;
58
+ if (n.enableClickSelection && (a = n.editor.commands.extendMarkRange(n.type.name)), n.openOnClick) {
59
+ let t = s(e.state, n.type.name), r = i.href ?? t.href, o = i.target ?? t.target;
60
+ r && (window.open(r, o), a = !0);
61
+ }
62
+ return a;
63
+ } }
64
+ });
65
+ }
66
+ var w = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/, T = /\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;
67
+ function E(e, t) {
68
+ let n = 0;
69
+ for (let r = t - 1; r >= 0 && e[r] === "\\"; --r) n += 1;
70
+ return n % 2 == 1;
71
+ }
72
+ function D(e, t) {
73
+ let n = 0, r = 0;
74
+ for (; r < t;) {
75
+ if (e[r] !== "`") {
76
+ r += 1;
77
+ continue;
78
+ }
79
+ if (n === 0 && E(e, r)) {
80
+ r += 1;
81
+ continue;
82
+ }
83
+ let i = 0;
84
+ for (; r < t && e[r] === "`";) i += 1, r += 1;
85
+ n === 0 ? n = i : i === n && (n = 0);
86
+ }
87
+ return n > 0;
88
+ }
89
+ function O(e, t, n) {
90
+ let [, r, i] = t;
91
+ return (t.index ? e[t.index - 1] : void 0) === "!" || E(e, t.index ?? 0) || D(e, t.index ?? 0) ? !1 : !!r.trim() && n(i);
92
+ }
93
+ function k(e) {
94
+ let [t, n, r, , i, a, o] = e, s = i ?? a ?? o;
95
+ return {
96
+ index: e.index ?? 0,
97
+ text: t,
98
+ replaceWith: n,
99
+ data: {
100
+ href: r,
101
+ title: s || null,
102
+ markdown: !0
103
+ }
104
+ };
105
+ }
106
+ function A(e, t) {
107
+ return e.index < t.index + t.text.length && t.index < e.index + e.text.length;
108
+ }
109
+ function j(e) {
110
+ return {
111
+ href: e.data?.href,
112
+ title: e.data?.title ?? null
113
+ };
114
+ }
115
+ function M(e) {
116
+ let t = u({
117
+ find: (t) => {
118
+ let n = w.exec(t);
119
+ return !n || !O(t, n, e.isAllowedHref) ? null : k(n);
120
+ },
121
+ type: e.type,
122
+ getAttributes: j
123
+ });
124
+ return new n({
125
+ find: t.find,
126
+ handler: (e) => {
127
+ let n = t.handler(e);
128
+ return n !== null && e.state.tr.steps.length && e.state.tr.setMeta("preventAutolink", !0), n;
129
+ }
130
+ });
131
+ }
132
+ function N(e) {
133
+ let t = d({
134
+ find: (t) => {
135
+ let n = [];
136
+ for (let r of t.matchAll(T)) O(t, r, e.isAllowedHref) && n.push(k(r));
137
+ let r = (e.findPlainUrls?.call(e, t) ?? []).filter((e) => !n.some((t) => A(t, e)));
138
+ return [...n, ...r];
139
+ },
140
+ type: e.type,
141
+ getAttributes: j
142
+ });
143
+ return new i({
144
+ find: t.find,
145
+ handler: (e) => {
146
+ let n = t.handler(e);
147
+ return n !== null && e.state.tr.steps.length && e.match.data?.markdown && e.state.tr.setMeta("preventAutolink", !0), n;
148
+ }
149
+ });
150
+ }
151
+ function P(n) {
152
+ return new e({
153
+ key: new t("handlePasteLink"),
154
+ props: { handlePaste: (e, t, r) => {
155
+ let { shouldAutoLink: i } = n, { state: a } = e, { selection: o } = a, { empty: s } = o;
156
+ if (s) return !1;
157
+ let c = "";
158
+ r.content.forEach((e) => {
159
+ c += e.textContent;
160
+ });
161
+ let l = p(c, { defaultProtocol: n.defaultProtocol }).find((e) => e.isLink && e.value === c);
162
+ return !c || !l || i !== void 0 && !i(l.value) ? !1 : n.editor.commands.setMark(n.type, { href: l.href });
163
+ } }
164
+ });
165
+ }
166
+ function F(e, t) {
167
+ let n = [
168
+ "http",
169
+ "https",
170
+ "ftp",
171
+ "ftps",
172
+ "mailto",
173
+ "tel",
174
+ "callto",
175
+ "sms",
176
+ "cid",
177
+ "xmpp"
178
+ ];
179
+ return t && t.forEach((e) => {
180
+ let t = typeof e == "string" ? e : e.scheme;
181
+ t && n.push(t);
182
+ }), !e || e.replace(b, "").match(RegExp(`^(?:(?:${n.map((e) => e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`, "i"));
183
+ }
184
+ var I = r.create({
185
+ name: "link",
186
+ priority: 1e3,
187
+ keepOnSplit: !1,
188
+ exitable: !0,
189
+ onCreate() {
190
+ 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) => {
191
+ if (typeof e == "string") {
192
+ m(e);
193
+ return;
194
+ }
195
+ m(e.scheme, e.optionalSlashes);
196
+ });
197
+ },
198
+ onDestroy() {
199
+ h();
200
+ },
201
+ inclusive() {
202
+ return this.options.autolink;
203
+ },
204
+ addOptions() {
205
+ return {
206
+ openOnClick: !0,
207
+ enableClickSelection: !1,
208
+ linkOnPaste: !0,
209
+ markdownLinks: !1,
210
+ autolink: !0,
211
+ protocols: [],
212
+ defaultProtocol: "http",
213
+ HTMLAttributes: {
214
+ target: "_blank",
215
+ rel: "noopener noreferrer nofollow",
216
+ class: null
217
+ },
218
+ isAllowedUri: (e, t) => !!F(e, t.protocols),
219
+ validate: (e) => !!e,
220
+ shouldAutoLink: (e) => {
221
+ let t = /^[a-z][a-z0-9+.-]*:\/\//i.test(e), n = /^[a-z][a-z0-9+.-]*:/i.test(e);
222
+ if (t || n && !e.includes("@")) return !0;
223
+ let r = (e.includes("@") ? e.split("@").pop() : e).split(/[/?#:]/)[0];
224
+ return !(/^\d{1,3}(\.\d{1,3}){3}$/.test(r) || !/\./.test(r));
225
+ }
226
+ };
227
+ },
228
+ addAttributes() {
229
+ return {
230
+ href: {
231
+ default: null,
232
+ parseHTML(e) {
233
+ return e.getAttribute("href");
234
+ }
235
+ },
236
+ target: { default: this.options.HTMLAttributes.target ?? null },
237
+ rel: { default: this.options.HTMLAttributes.rel ?? null },
238
+ class: { default: this.options.HTMLAttributes.class ?? null },
239
+ title: { default: null }
240
+ };
241
+ },
242
+ parseHTML() {
243
+ return [{
244
+ tag: "a[href]",
245
+ getAttrs: (e) => {
246
+ let t = e.getAttribute("href");
247
+ return !t || !this.options.isAllowedUri(t, {
248
+ defaultValidate: (e) => !!F(e, this.options.protocols),
249
+ protocols: this.options.protocols,
250
+ defaultProtocol: this.options.defaultProtocol
251
+ }) ? !1 : null;
252
+ }
253
+ }];
254
+ },
255
+ renderHTML({ HTMLAttributes: e }) {
256
+ return this.options.isAllowedUri(e.href, {
257
+ defaultValidate: (e) => !!F(e, this.options.protocols),
258
+ protocols: this.options.protocols,
259
+ defaultProtocol: this.options.defaultProtocol
260
+ }) ? [
261
+ "a",
262
+ f(this.options.HTMLAttributes, e),
263
+ 0
264
+ ] : [
265
+ "a",
266
+ f(this.options.HTMLAttributes, {
267
+ ...e,
268
+ href: ""
269
+ }),
270
+ 0
271
+ ];
272
+ },
273
+ markdownTokenName: "link",
274
+ parseMarkdown: (e, t) => t.applyMark("link", t.parseInline(e.tokens || []), {
275
+ href: e.href,
276
+ title: e.title || null
277
+ }),
278
+ renderMarkdown: (e, t) => {
279
+ let n = e.attrs?.href ?? "", r = e.attrs?.title ?? "", i = t.renderChildren(e);
280
+ return r ? `[${i}](${n} "${r}")` : `[${i}](${n})`;
281
+ },
282
+ addCommands() {
283
+ return {
284
+ setLink: (e) => ({ chain: t }) => {
285
+ let { href: n } = e;
286
+ return this.options.isAllowedUri(n, {
287
+ defaultValidate: (e) => !!F(e, this.options.protocols),
288
+ protocols: this.options.protocols,
289
+ defaultProtocol: this.options.defaultProtocol
290
+ }) ? t().setMark(this.name, e).setMeta("preventAutolink", !0).run() : !1;
291
+ },
292
+ toggleLink: (e) => ({ chain: t }) => {
293
+ let { href: n } = e || {};
294
+ return n && !this.options.isAllowedUri(n, {
295
+ defaultValidate: (e) => !!F(e, this.options.protocols),
296
+ protocols: this.options.protocols,
297
+ defaultProtocol: this.options.defaultProtocol
298
+ }) ? !1 : t().toggleMark(this.name, e, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run();
299
+ },
300
+ unsetLink: () => ({ chain: e }) => e().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
301
+ };
302
+ },
303
+ addInputRules() {
304
+ return this.options.markdownLinks ? [M({
305
+ type: this.type,
306
+ isAllowedHref: (e) => this.options.isAllowedUri(e, {
307
+ defaultValidate: (e) => !!F(e, this.options.protocols),
308
+ protocols: this.options.protocols,
309
+ defaultProtocol: this.options.defaultProtocol
310
+ })
311
+ })] : [];
312
+ },
313
+ addPasteRules() {
314
+ let e = (e) => {
315
+ let t = [];
316
+ if (e) {
317
+ let { protocols: n, defaultProtocol: r } = this.options;
318
+ p(e).filter((e) => e.isLink && this.options.isAllowedUri(e.value, {
319
+ defaultValidate: (e) => !!F(e, n),
320
+ protocols: n,
321
+ defaultProtocol: r
322
+ })).forEach((e) => {
323
+ this.options.shouldAutoLink(e.value) && t.push({
324
+ text: e.value,
325
+ data: { href: e.href },
326
+ index: e.start
327
+ });
328
+ });
329
+ }
330
+ return t;
331
+ };
332
+ return this.options.markdownLinks ? [N({
333
+ type: this.type,
334
+ isAllowedHref: (e) => this.options.isAllowedUri(e, {
335
+ defaultValidate: (e) => !!F(e, this.options.protocols),
336
+ protocols: this.options.protocols,
337
+ defaultProtocol: this.options.defaultProtocol
338
+ }),
339
+ findPlainUrls: e
340
+ })] : [d({
341
+ find: e,
342
+ type: this.type,
343
+ getAttributes: (e) => ({ href: e.data?.href })
344
+ })];
345
+ },
346
+ addProseMirrorPlugins() {
347
+ let e = [], { protocols: t, defaultProtocol: n } = this.options;
348
+ return this.options.autolink && e.push(S({
349
+ type: this.type,
350
+ defaultProtocol: this.options.defaultProtocol,
351
+ validate: (e) => this.options.isAllowedUri(e, {
352
+ defaultValidate: (e) => !!F(e, t),
353
+ protocols: t,
354
+ defaultProtocol: n
355
+ }),
356
+ shouldAutoLink: this.options.shouldAutoLink
357
+ })), e.push(C({
358
+ type: this.type,
359
+ editor: this.editor,
360
+ openOnClick: this.options.openOnClick === "whenNotEditable" || this.options.openOnClick,
361
+ enableClickSelection: this.options.enableClickSelection
362
+ })), this.options.linkOnPaste && e.push(P({
363
+ editor: this.editor,
364
+ defaultProtocol: this.options.defaultProtocol,
365
+ type: this.type,
366
+ shouldAutoLink: this.options.shouldAutoLink
367
+ })), e;
368
+ }
369
+ });
370
+ //#endregion
371
+ export { I as Link, F as isAllowedUri };
372
+
373
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["Plugin2","PluginKey2","Plugin3","PluginKey3","find2","markPasteRule2"],"sources":["../../../../../node_modules/@tiptap/extension-link/dist/index.js"],"sourcesContent":["// src/link.ts\nimport { Mark, markPasteRule as markPasteRule2, mergeAttributes } from \"@tiptap/core\";\nimport { find as find2, registerCustomProtocol, reset } from \"linkifyjs\";\n\n// src/helpers/autolink.ts\nimport {\n combineTransactionSteps,\n findChildrenInRange,\n getChangedRanges,\n getMarksBetween\n} from \"@tiptap/core\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport { tokenize } from \"linkifyjs\";\n\n// src/helpers/whitespace.ts\nvar UNICODE_WHITESPACE_PATTERN = \"[\\0- \\xA0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]\";\nvar UNICODE_WHITESPACE_REGEX = new RegExp(UNICODE_WHITESPACE_PATTERN);\nvar UNICODE_WHITESPACE_REGEX_END = new RegExp(`${UNICODE_WHITESPACE_PATTERN}$`);\nvar UNICODE_WHITESPACE_REGEX_GLOBAL = new RegExp(UNICODE_WHITESPACE_PATTERN, \"g\");\n\n// src/helpers/autolink.ts\nfunction isValidLinkStructure(tokens) {\n if (tokens.length === 1) {\n return tokens[0].isLink;\n }\n if (tokens.length === 3 && tokens[1].isLink) {\n return [\"()\", \"[]\"].includes(tokens[0].value + tokens[2].value);\n }\n return false;\n}\nfunction autolink(options) {\n return new Plugin({\n key: new PluginKey(\"autolink\"),\n appendTransaction: (transactions, oldState, newState) => {\n const docChanges = transactions.some((transaction) => transaction.docChanged) && !oldState.doc.eq(newState.doc);\n const preventAutolink = transactions.some(\n (transaction) => transaction.getMeta(\"preventAutolink\")\n );\n if (!docChanges || preventAutolink) {\n return;\n }\n const { tr } = newState;\n const transform = combineTransactionSteps(oldState.doc, [...transactions]);\n const changes = getChangedRanges(transform);\n changes.forEach(({ newRange }) => {\n const nodesInChangedRanges = findChildrenInRange(\n newState.doc,\n newRange,\n (node) => node.isTextblock\n );\n let textBlock;\n let textBeforeWhitespace;\n if (nodesInChangedRanges.length > 1) {\n textBlock = nodesInChangedRanges[0];\n textBeforeWhitespace = newState.doc.textBetween(\n textBlock.pos,\n textBlock.pos + textBlock.node.nodeSize,\n void 0,\n \" \"\n );\n } else if (nodesInChangedRanges.length) {\n const endText = newState.doc.textBetween(newRange.from, newRange.to, \" \", \" \");\n if (!UNICODE_WHITESPACE_REGEX_END.test(endText)) {\n return;\n }\n textBlock = nodesInChangedRanges[0];\n textBeforeWhitespace = newState.doc.textBetween(\n textBlock.pos,\n newRange.to,\n void 0,\n \" \"\n );\n }\n if (textBlock && textBeforeWhitespace) {\n const wordsBeforeWhitespace = textBeforeWhitespace.split(UNICODE_WHITESPACE_REGEX).filter(Boolean);\n if (wordsBeforeWhitespace.length <= 0) {\n return false;\n }\n const lastWordBeforeSpace = wordsBeforeWhitespace[wordsBeforeWhitespace.length - 1];\n const lastWordAndBlockOffset = textBlock.pos + textBeforeWhitespace.lastIndexOf(lastWordBeforeSpace);\n if (!lastWordBeforeSpace) {\n return false;\n }\n const linksBeforeSpace = tokenize(lastWordBeforeSpace).map(\n (t) => t.toObject(options.defaultProtocol)\n );\n if (!isValidLinkStructure(linksBeforeSpace)) {\n return false;\n }\n linksBeforeSpace.filter((link) => link.isLink).map((link) => ({\n ...link,\n from: lastWordAndBlockOffset + link.start + 1,\n to: lastWordAndBlockOffset + link.end + 1\n })).filter((link) => {\n if (!newState.schema.marks.code) {\n return true;\n }\n return !newState.doc.rangeHasMark(link.from, link.to, newState.schema.marks.code);\n }).filter((link) => options.validate(link.value)).filter((link) => options.shouldAutoLink(link.value)).forEach((link) => {\n if (getMarksBetween(link.from, link.to, newState.doc).some(\n (item) => item.mark.type === options.type\n )) {\n return;\n }\n tr.addMark(\n link.from,\n link.to,\n options.type.create({\n href: link.href\n })\n );\n });\n }\n });\n if (!tr.steps.length) {\n return;\n }\n return tr;\n }\n });\n}\n\n// src/helpers/clickHandler.ts\nimport { getAttributes } from \"@tiptap/core\";\nimport { Plugin as Plugin2, PluginKey as PluginKey2 } from \"@tiptap/pm/state\";\nfunction clickHandler(options) {\n return new Plugin2({\n key: new PluginKey2(\"handleClickLink\"),\n props: {\n handleClick: (view, pos, event) => {\n var _a, _b;\n if (event.button !== 0) {\n return false;\n }\n if (!view.editable) {\n return false;\n }\n let link = null;\n if (event.target instanceof HTMLAnchorElement) {\n link = event.target;\n } else {\n const target = event.target;\n if (!target) {\n return false;\n }\n const root = options.editor.view.dom;\n link = target.closest(\"a\");\n if (link && !root.contains(link)) {\n link = null;\n }\n }\n if (!link) {\n return false;\n }\n let handled = false;\n if (options.enableClickSelection) {\n const commandResult = options.editor.commands.extendMarkRange(options.type.name);\n handled = commandResult;\n }\n if (options.openOnClick) {\n const attrs = getAttributes(view.state, options.type.name);\n const href = (_a = link.href) != null ? _a : attrs.href;\n const target = (_b = link.target) != null ? _b : attrs.target;\n if (href) {\n window.open(href, target);\n handled = true;\n }\n }\n return handled;\n }\n }\n });\n}\n\n// src/helpers/markdownLink.ts\nimport { InputRule, markInputRule, markPasteRule, PasteRule } from \"@tiptap/core\";\nvar MARKDOWN_LINK_INPUT_REGEX = /\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)$/;\nvar MARKDOWN_LINK_PASTE_REGEX = /\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)/g;\nfunction isEscaped(text, index) {\n let backslashes = 0;\n for (let position = index - 1; position >= 0 && text[position] === \"\\\\\"; position -= 1) {\n backslashes += 1;\n }\n return backslashes % 2 === 1;\n}\nfunction isInsideCodeSpan(text, matchIndex) {\n let openRunLength = 0;\n let index = 0;\n while (index < matchIndex) {\n if (text[index] !== \"`\") {\n index += 1;\n continue;\n }\n if (openRunLength === 0 && isEscaped(text, index)) {\n index += 1;\n continue;\n }\n let runLength = 0;\n while (index < matchIndex && text[index] === \"`\") {\n runLength += 1;\n index += 1;\n }\n if (openRunLength === 0) {\n openRunLength = runLength;\n } else if (runLength === openRunLength) {\n openRunLength = 0;\n }\n }\n return openRunLength > 0;\n}\nfunction isConvertibleLink(text, match, isAllowedHref) {\n var _a, _b;\n const [, linkText, href] = match;\n const characterBefore = match.index ? text[match.index - 1] : void 0;\n if (characterBefore === \"!\" || isEscaped(text, (_a = match.index) != null ? _a : 0)) {\n return false;\n }\n if (isInsideCodeSpan(text, (_b = match.index) != null ? _b : 0)) {\n return false;\n }\n return !!linkText.trim() && isAllowedHref(href);\n}\nfunction toRuleMatch(match) {\n var _a, _b;\n const [linkSyntax, linkText, href, , straightQuotedTitle, curlyDoubleTitle, curlySingleTitle] = match;\n const title = (_a = straightQuotedTitle != null ? straightQuotedTitle : curlyDoubleTitle) != null ? _a : curlySingleTitle;\n return {\n index: (_b = match.index) != null ? _b : 0,\n text: linkSyntax,\n replaceWith: linkText,\n data: {\n href,\n // an empty title (\"\") counts as no title, as in CommonMark\n title: title || null,\n markdown: true\n }\n };\n}\nfunction matchesOverlap(a, b) {\n return a.index < b.index + b.text.length && b.index < a.index + a.text.length;\n}\nfunction getMarkdownLinkAttributes(match) {\n var _a, _b, _c;\n return {\n href: (_a = match.data) == null ? void 0 : _a.href,\n title: (_c = (_b = match.data) == null ? void 0 : _b.title) != null ? _c : null\n };\n}\nfunction markdownLinkInputRule(config) {\n const rule = markInputRule({\n find: (text) => {\n const match = MARKDOWN_LINK_INPUT_REGEX.exec(text);\n if (!match || !isConvertibleLink(text, match, config.isAllowedHref)) {\n return null;\n }\n return toRuleMatch(match);\n },\n type: config.type,\n getAttributes: getMarkdownLinkAttributes\n });\n return new InputRule({\n find: rule.find,\n handler: (props) => {\n const result = rule.handler(props);\n if (result !== null && props.state.tr.steps.length) {\n props.state.tr.setMeta(\"preventAutolink\", true);\n }\n return result;\n }\n });\n}\nfunction markdownLinkPasteRule(config) {\n const rule = markPasteRule({\n find: (text) => {\n var _a, _b;\n const markdownMatches = [];\n for (const match of text.matchAll(MARKDOWN_LINK_PASTE_REGEX)) {\n if (isConvertibleLink(text, match, config.isAllowedHref)) {\n markdownMatches.push(toRuleMatch(match));\n }\n }\n const plainUrlMatches = ((_b = (_a = config.findPlainUrls) == null ? void 0 : _a.call(config, text)) != null ? _b : []).filter(\n (urlMatch) => !markdownMatches.some((markdownMatch) => matchesOverlap(markdownMatch, urlMatch))\n );\n return [...markdownMatches, ...plainUrlMatches];\n },\n type: config.type,\n getAttributes: getMarkdownLinkAttributes\n });\n return new PasteRule({\n find: rule.find,\n handler: (props) => {\n var _a;\n const result = rule.handler(props);\n if (result !== null && props.state.tr.steps.length && ((_a = props.match.data) == null ? void 0 : _a.markdown)) {\n props.state.tr.setMeta(\"preventAutolink\", true);\n }\n return result;\n }\n });\n}\n\n// src/helpers/pasteHandler.ts\nimport { Plugin as Plugin3, PluginKey as PluginKey3 } from \"@tiptap/pm/state\";\nimport { find } from \"linkifyjs\";\nfunction pasteHandler(options) {\n return new Plugin3({\n key: new PluginKey3(\"handlePasteLink\"),\n props: {\n handlePaste: (view, _event, slice) => {\n const { shouldAutoLink } = options;\n const { state } = view;\n const { selection } = state;\n const { empty } = selection;\n if (empty) {\n return false;\n }\n let textContent = \"\";\n slice.content.forEach((node) => {\n textContent += node.textContent;\n });\n const link = find(textContent, { defaultProtocol: options.defaultProtocol }).find(\n (item) => item.isLink && item.value === textContent\n );\n if (!textContent || !link || shouldAutoLink !== void 0 && !shouldAutoLink(link.value)) {\n return false;\n }\n return options.editor.commands.setMark(options.type, {\n href: link.href\n });\n }\n }\n });\n}\n\n// src/link.ts\nvar pasteRegex = /https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z]{2,}\\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi;\nfunction isAllowedUri(uri, protocols) {\n const allowedProtocols = [\n \"http\",\n \"https\",\n \"ftp\",\n \"ftps\",\n \"mailto\",\n \"tel\",\n \"callto\",\n \"sms\",\n \"cid\",\n \"xmpp\"\n ];\n if (protocols) {\n protocols.forEach((protocol) => {\n const nextProtocol = typeof protocol === \"string\" ? protocol : protocol.scheme;\n if (nextProtocol) {\n allowedProtocols.push(nextProtocol);\n }\n });\n }\n return !uri || uri.replace(UNICODE_WHITESPACE_REGEX_GLOBAL, \"\").match(\n new RegExp(\n `^(?:(?:${allowedProtocols.map((protocol) => protocol.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\")).join(\"|\")}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,\n \"i\"\n )\n );\n}\nvar Link = Mark.create({\n name: \"link\",\n priority: 1e3,\n keepOnSplit: false,\n exitable: true,\n onCreate() {\n if (this.options.validate && !this.options.shouldAutoLink) {\n this.options.shouldAutoLink = this.options.validate;\n console.warn(\n \"The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.\"\n );\n }\n this.options.protocols.forEach((protocol) => {\n if (typeof protocol === \"string\") {\n registerCustomProtocol(protocol);\n return;\n }\n registerCustomProtocol(protocol.scheme, protocol.optionalSlashes);\n });\n },\n onDestroy() {\n reset();\n },\n inclusive() {\n return this.options.autolink;\n },\n addOptions() {\n return {\n openOnClick: true,\n enableClickSelection: false,\n linkOnPaste: true,\n markdownLinks: false,\n // TODO (major) - default to true on next major version\n autolink: true,\n protocols: [],\n defaultProtocol: \"http\",\n HTMLAttributes: {\n target: \"_blank\",\n rel: \"noopener noreferrer nofollow\",\n class: null\n },\n isAllowedUri: (url, ctx) => !!isAllowedUri(url, ctx.protocols),\n validate: (url) => !!url,\n shouldAutoLink: (url) => {\n const hasProtocol = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(url);\n const hasMaybeProtocol = /^[a-z][a-z0-9+.-]*:/i.test(url);\n if (hasProtocol || hasMaybeProtocol && !url.includes(\"@\")) {\n return true;\n }\n const urlWithoutUserinfo = url.includes(\"@\") ? url.split(\"@\").pop() : url;\n const hostname = urlWithoutUserinfo.split(/[/?#:]/)[0];\n if (/^\\d{1,3}(\\.\\d{1,3}){3}$/.test(hostname)) {\n return false;\n }\n if (!/\\./.test(hostname)) {\n return false;\n }\n return true;\n }\n };\n },\n addAttributes() {\n var _a, _b, _c;\n return {\n href: {\n default: null,\n parseHTML(element) {\n return element.getAttribute(\"href\");\n }\n },\n target: {\n // Coerce `undefined` to `null` because `undefined` is an invalid attribute value\n default: (_a = this.options.HTMLAttributes.target) != null ? _a : null\n },\n rel: {\n // Coerce `undefined` to `null` because `undefined` is an invalid attribute value\n default: (_b = this.options.HTMLAttributes.rel) != null ? _b : null\n },\n class: {\n // Coerce `undefined` to `null` because `undefined` is an invalid attribute value\n default: (_c = this.options.HTMLAttributes.class) != null ? _c : null\n },\n title: {\n default: null\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: \"a[href]\",\n getAttrs: (dom) => {\n const href = dom.getAttribute(\"href\");\n if (!href || !this.options.isAllowedUri(href, {\n defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n })) {\n return false;\n }\n return null;\n }\n }\n ];\n },\n renderHTML({ HTMLAttributes }) {\n if (!this.options.isAllowedUri(HTMLAttributes.href, {\n defaultValidate: (href) => !!isAllowedUri(href, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n })) {\n return [\"a\", mergeAttributes(this.options.HTMLAttributes, { ...HTMLAttributes, href: \"\" }), 0];\n }\n return [\"a\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n markdownTokenName: \"link\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"link\", helpers.parseInline(token.tokens || []), {\n href: token.href,\n title: token.title || null\n });\n },\n renderMarkdown: (node, h) => {\n var _a, _b, _c, _d;\n const href = (_b = (_a = node.attrs) == null ? void 0 : _a.href) != null ? _b : \"\";\n const title = (_d = (_c = node.attrs) == null ? void 0 : _c.title) != null ? _d : \"\";\n const text = h.renderChildren(node);\n return title ? `[${text}](${href} \"${title}\")` : `[${text}](${href})`;\n },\n addCommands() {\n return {\n setLink: (attributes) => ({ chain }) => {\n const { href } = attributes;\n if (!this.options.isAllowedUri(href, {\n defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n })) {\n return false;\n }\n return chain().setMark(this.name, attributes).setMeta(\"preventAutolink\", true).run();\n },\n toggleLink: (attributes) => ({ chain }) => {\n const { href } = attributes || {};\n if (href && !this.options.isAllowedUri(href, {\n defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n })) {\n return false;\n }\n return chain().toggleMark(this.name, attributes, { extendEmptyMarkRange: true }).setMeta(\"preventAutolink\", true).run();\n },\n unsetLink: () => ({ chain }) => {\n return chain().unsetMark(this.name, { extendEmptyMarkRange: true }).setMeta(\"preventAutolink\", true).run();\n }\n };\n },\n addInputRules() {\n if (!this.options.markdownLinks) {\n return [];\n }\n return [\n markdownLinkInputRule({\n type: this.type,\n isAllowedHref: (href) => this.options.isAllowedUri(href, {\n defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n })\n })\n ];\n },\n addPasteRules() {\n const findPlainUrls = (text) => {\n const foundLinks = [];\n if (text) {\n const { protocols, defaultProtocol } = this.options;\n const links = find2(text).filter(\n (item) => item.isLink && this.options.isAllowedUri(item.value, {\n defaultValidate: (href) => !!isAllowedUri(href, protocols),\n protocols,\n defaultProtocol\n })\n );\n links.forEach((link) => {\n if (!this.options.shouldAutoLink(link.value)) {\n return;\n }\n foundLinks.push({\n text: link.value,\n data: {\n href: link.href\n },\n index: link.start\n });\n });\n }\n return foundLinks;\n };\n if (this.options.markdownLinks) {\n return [\n markdownLinkPasteRule({\n type: this.type,\n isAllowedHref: (href) => this.options.isAllowedUri(href, {\n defaultValidate: (url) => !!isAllowedUri(url, this.options.protocols),\n protocols: this.options.protocols,\n defaultProtocol: this.options.defaultProtocol\n }),\n findPlainUrls\n })\n ];\n }\n return [\n markPasteRule2({\n find: findPlainUrls,\n type: this.type,\n getAttributes: (match) => {\n var _a;\n return {\n href: (_a = match.data) == null ? void 0 : _a.href\n };\n }\n })\n ];\n },\n addProseMirrorPlugins() {\n const plugins = [];\n const { protocols, defaultProtocol } = this.options;\n if (this.options.autolink) {\n plugins.push(\n autolink({\n type: this.type,\n defaultProtocol: this.options.defaultProtocol,\n validate: (url) => this.options.isAllowedUri(url, {\n defaultValidate: (href) => !!isAllowedUri(href, protocols),\n protocols,\n defaultProtocol\n }),\n shouldAutoLink: this.options.shouldAutoLink\n })\n );\n }\n plugins.push(\n clickHandler({\n type: this.type,\n editor: this.editor,\n openOnClick: this.options.openOnClick === \"whenNotEditable\" ? true : this.options.openOnClick,\n enableClickSelection: this.options.enableClickSelection\n })\n );\n if (this.options.linkOnPaste) {\n plugins.push(\n pasteHandler({\n editor: this.editor,\n defaultProtocol: this.options.defaultProtocol,\n type: this.type,\n shouldAutoLink: this.options.shouldAutoLink\n })\n );\n }\n return plugins;\n }\n});\n\n// src/index.ts\nvar index_default = Link;\nexport {\n Link,\n index_default as default,\n isAllowedUri,\n pasteRegex\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AAeA,IAAI,IAA6B,0BAC7B,IAA2B,IAAI,OAAO,CAA0B,GAChE,IAAmC,OAAO,GAAG,EAA2B,EAAE,GAC1E,IAAkC,IAAI,OAAO,GAA4B,GAAG;AAGhF,SAAS,EAAqB,GAAQ;CAOpC,OANI,EAAO,WAAW,IACb,EAAO,EAAE,CAAC,SAEf,EAAO,WAAW,KAAK,EAAO,EAAE,CAAC,SAC5B,CAAC,MAAM,IAAI,CAAC,CAAC,SAAS,EAAO,EAAE,CAAC,QAAQ,EAAO,EAAE,CAAC,KAAK,IAEzD;AACT;AACA,SAAS,EAAS,GAAS;CACzB,OAAO,IAAI,EAAO;EAChB,KAAK,IAAI,EAAU,UAAU;EAC7B,oBAAoB,GAAc,GAAU,MAAa;GACvD,IAAM,IAAa,EAAa,MAAM,MAAgB,EAAY,UAAU,KAAK,CAAC,EAAS,IAAI,GAAG,EAAS,GAAG,GACxG,IAAkB,EAAa,MAClC,MAAgB,EAAY,QAAQ,iBAAiB,CACxD;GACA,IAAI,CAAC,KAAc,GACjB;GAEF,IAAM,EAAE,UAAO,GACT,IAAY,EAAwB,EAAS,KAAK,CAAC,GAAG,CAAY,CAAC;GAEzE,MADiC,CAC3B,CAAC,CAAC,SAAS,EAAE,kBAAe;IAChC,IAAM,IAAuB,EAC3B,EAAS,KACT,IACC,MAAS,EAAK,WACjB,GACI,GACA;IACJ,IAAI,EAAqB,SAAS,GAEhC,AADA,IAAY,EAAqB,IACjC,IAAuB,EAAS,IAAI,YAClC,EAAU,KACV,EAAU,MAAM,EAAU,KAAK,UAC/B,KAAK,GACL,GACF;SACK,IAAI,EAA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