@burdenoff/microfe-support 2026.1115.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.
- package/dist/support/components/careers/RichTextEditor.js +31 -31
- package/dist/support/components/careers/RichTextEditor.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -6
- package/dist/node_modules/@tiptap/core/dist/index.js +0 -3491
- package/dist/node_modules/@tiptap/core/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -44
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +0 -12
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -75
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +0 -73
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +0 -78
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +0 -157
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +0 -11
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -50
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -49
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +0 -70
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +0 -389
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +0 -967
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -46
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +0 -6
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +0 -55
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +0 -14
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +0 -72
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +0 -457
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +0 -332
- package/dist/node_modules/@tiptap/react/dist/index.js.map +0 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +0 -28
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +0 -298
- package/dist/node_modules/fast-equals/dist/es/index.js.map +0 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +0 -527
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +0 -1
- package/dist/node_modules/orderedmap/dist/index.js +0 -68
- package/dist/node_modules/orderedmap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +0 -334
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +0 -112
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +0 -168
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +0 -219
- package/dist/node_modules/prosemirror-history/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +0 -51
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +0 -1775
- package/dist/node_modules/prosemirror-model/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +0 -77
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +0 -526
- package/dist/node_modules/prosemirror-state/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +0 -1204
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +0 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +0 -3355
- package/dist/node_modules/prosemirror-view/dist/index.js.map +0 -1
- package/dist/node_modules/rope-sequence/dist/index.js +0 -84
- package/dist/node_modules/rope-sequence/dist/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -55
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -53
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -53
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -45
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -11
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -11
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -89
- package/dist/node_modules/w3c-keyname/index.js.map +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
2
|
-
var e = /* @__PURE__ */ new WeakSet(), t = /* @__PURE__ */ new WeakSet();
|
|
3
|
-
function n(t) {
|
|
4
|
-
let n = t;
|
|
5
|
-
return e.add(n), n;
|
|
6
|
-
}
|
|
7
|
-
function r(t) {
|
|
8
|
-
return Array.isArray(t) && e.has(t);
|
|
9
|
-
}
|
|
10
|
-
function i(e) {
|
|
11
|
-
return e.flatMap((e) => e == null ? [] : Array.isArray(e) && t.has(e) && !r(e) ? i(e) : [e]);
|
|
12
|
-
}
|
|
13
|
-
function a(e, a) {
|
|
14
|
-
if (e === "slot") return 0;
|
|
15
|
-
if (e instanceof Function) {
|
|
16
|
-
let i = e(a);
|
|
17
|
-
return Array.isArray(i) && !r(i) && !t.has(i) ? n(i) : i;
|
|
18
|
-
}
|
|
19
|
-
let { children: o, ...s } = a ?? {};
|
|
20
|
-
if (e === "svg") throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");
|
|
21
|
-
if (Array.isArray(o)) {
|
|
22
|
-
if (r(o)) return n([
|
|
23
|
-
e,
|
|
24
|
-
s,
|
|
25
|
-
o
|
|
26
|
-
]);
|
|
27
|
-
if (o.length === 0) return n([e, s]);
|
|
28
|
-
let t = i(o);
|
|
29
|
-
return t.length === 0 ? n([e, s]) : n([
|
|
30
|
-
e,
|
|
31
|
-
s,
|
|
32
|
-
...t
|
|
33
|
-
]);
|
|
34
|
-
}
|
|
35
|
-
return n(o == null ? [e, s] : [
|
|
36
|
-
e,
|
|
37
|
-
s,
|
|
38
|
-
o
|
|
39
|
-
]);
|
|
40
|
-
}
|
|
41
|
-
var o = (e, t) => a(e, t);
|
|
42
|
-
export { o as createElement, o as h, o as jsx };
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","names":["jsxElements","jsxFragments","createJSXElement","element","spec","isJSXElement","value","flattenFragmentChildren","children","child","render","tag","result","attributes","rest","flattenedChildren","h"],"sources":["../../../../../../node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js"],"sourcesContent":["//#region src/jsx-runtime.ts\nconst jsxElements = /* @__PURE__ */ new WeakSet();\nconst jsxFragments = /* @__PURE__ */ new WeakSet();\n/** Create a new JSX element from the given spec */\nfunction createJSXElement(spec) {\n\tconst element = spec;\n\tjsxElements.add(element);\n\treturn element;\n}\n/** Check if a spec is a JSX element */\nfunction isJSXElement(value) {\n\treturn Array.isArray(value) && jsxElements.has(value);\n}\nfunction flattenFragmentChildren(children) {\n\treturn children.flatMap((child) => {\n\t\tif (child == null) return [];\n\t\tif (Array.isArray(child) && jsxFragments.has(child) && !isJSXElement(child)) return flattenFragmentChildren(child);\n\t\treturn [child];\n\t});\n}\nfunction Fragment(props) {\n\tjsxFragments.add(props.children);\n\treturn props.children;\n}\nfunction render(tag, attributes) {\n\tif (tag === \"slot\") return 0;\n\tif (tag instanceof Function) {\n\t\tconst result = tag(attributes);\n\t\tif (Array.isArray(result) && !isJSXElement(result) && !jsxFragments.has(result)) return createJSXElement(result);\n\t\treturn result;\n\t}\n\tconst { children, ...rest } = attributes !== null && attributes !== void 0 ? attributes : {};\n\tif (tag === \"svg\") throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");\n\tif (Array.isArray(children)) {\n\t\tif (isJSXElement(children)) return createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\tchildren\n\t\t]);\n\t\tif (children.length === 0) return createJSXElement([tag, rest]);\n\t\tconst flattenedChildren = flattenFragmentChildren(children);\n\t\tif (flattenedChildren.length === 0) return createJSXElement([tag, rest]);\n\t\treturn createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\t...flattenedChildren\n\t\t]);\n\t}\n\tif (children !== void 0 && children !== null) return createJSXElement([\n\t\ttag,\n\t\trest,\n\t\tchildren\n\t]);\n\treturn createJSXElement([tag, rest]);\n}\nconst h = (tag, attributes) => render(tag, attributes);\nconst jsxs = (tag, attributes) => render(tag, attributes);\nconst jsxDEV = (tag, attributes, _key, _isStaticChildren) => {\n\treturn render(tag, attributes);\n};\n//#endregion\nexport { Fragment, h as createElement, h, h as jsx, jsxDEV, jsxs };\n\n//# sourceMappingURL=jsx-runtime.js.map"],"ignoreList":[0],"mappings":";AACA,IAAMA,oBAA8B,IAAI,QAAQ,GAC1CC,oBAA+B,IAAI,QAAQ;AAEjD,SAASC,EAAiB,GAAM;CAC/B,IAAMC,IAAUC;CAEhB,OADAJ,EAAY,IAAIG,CAAO,GAChBA;AACR;AAEA,SAASE,EAAa,GAAO;CAC5B,OAAO,MAAM,QAAQC,CAAK,KAAKN,EAAY,IAAIM,CAAK;AACrD;AACA,SAASC,EAAwB,GAAU;CAC1C,OAAOC,EAAS,SAAS,MACpBC,KAAS,OAAa,CAAC,IACvB,MAAM,QAAQA,CAAK,KAAKR,EAAa,IAAIQ,CAAK,KAAK,CAACJ,EAAaI,CAAK,IAAUF,EAAwBE,CAAK,IAC1G,CAACA,CAAK,CACb;AACF;AAKA,SAASC,EAAO,GAAK,GAAY;CAChC,IAAIC,MAAQ,QAAQ,OAAO;CAC3B,IAAIA,aAAe,UAAU;EAC5B,IAAMC,IAASD,EAAIE,CAAU;EAE7B,OADI,MAAM,QAAQD,CAAM,KAAK,CAACP,EAAaO,CAAM,KAAK,CAACX,EAAa,IAAIW,CAAM,IAAUV,EAAiBU,CAAM,IACxGA;CACR;CACA,IAAM,EAAE,aAAU,GAAGE,MAASD,KAA4D,CAAC;CAC3F,IAAIF,MAAQ,OAAO,MAAU,MAAM,gFAAgF;CACnH,IAAI,MAAM,QAAQH,CAAQ,GAAG;EAC5B,IAAIH,EAAaG,CAAQ,GAAG,OAAON,EAAiB;GACnDS;GACAG;GACAN;EACD,CAAC;EACD,IAAIA,EAAS,WAAW,GAAG,OAAON,EAAiB,CAACS,GAAKG,CAAI,CAAC;EAC9D,IAAMC,IAAoBR,EAAwBC,CAAQ;EAE1D,OADIO,EAAkB,WAAW,IAAUb,EAAiB,CAACS,GAAKG,CAAI,CAAC,IAChEZ,EAAiB;GACvBS;GACAG;GACA,GAAGC;EACJ,CAAC;CACF;CAMA,OAAOb,EALHM,KAAoC,OAKhB,CAACG,GAAKG,CAAI,IALoC;EACrEH;EACAG;EACAN;CACD,CAAC;AAEF;AACA,IAAMQ,KAAK,GAAK,MAAeN,EAAOC,GAAKE,CAAU"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js
|
|
2
|
-
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
-
let r = {};
|
|
4
|
-
for (var i in t) e(r, i, {
|
|
5
|
-
get: t[i],
|
|
6
|
-
enumerable: !0
|
|
7
|
-
});
|
|
8
|
-
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
};
|
|
10
|
-
export { t };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=rolldown-runtime-D7D4PA-g.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolldown-runtime-D7D4PA-g.js","names":["__defProp","__exportAll","target","name","all","no_symbols"],"sources":["../../../../../node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\nexport { __exportAll as t };\n"],"ignoreList":[0],"mappings":";AACA,IAAIA,IAAY,OAAO,gBACnBC,KAAe,GAAK,MAAe;CACtC,IAAIC,IAAS,CAAC;CACd,KAAK,IAAIC,KAAQC,GAAK,EAAUF,GAAQC,GAAM;EAC7C,KAAKC,EAAID;EACT,YAAY;CACb,CAAC;CAED,OADKE,KAAYL,EAAUE,GAAQ,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GACnEA;AACR"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Node as e, mergeAttributes as t, wrappingInputRule as n } from "../../core/dist/index.js";
|
|
2
|
-
import { Slice as r } from "../../../prosemirror-model/dist/index.js";
|
|
3
|
-
import { TextSelection as i } from "../../../prosemirror-state/dist/index.js";
|
|
4
|
-
import { createElement as a } from "../../core/dist/jsx-runtime/jsx-runtime.js";
|
|
5
|
-
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
6
|
-
var o = (e, t) => {
|
|
7
|
-
let { state: n } = e, { selection: a } = n;
|
|
8
|
-
if (!a.empty) return !1;
|
|
9
|
-
let { $from: o } = a;
|
|
10
|
-
if (o.parentOffset !== 0) return !1;
|
|
11
|
-
let s = o.depth - 1;
|
|
12
|
-
if (s < 0) return !1;
|
|
13
|
-
let c = o.node(s), l = o.index(s);
|
|
14
|
-
if (l === 0) return !1;
|
|
15
|
-
if (c.type === t) return e.commands.lift(t.name);
|
|
16
|
-
let u = c.child(l - 1);
|
|
17
|
-
if (u.type !== t || !u.lastChild?.isTextblock) return !1;
|
|
18
|
-
let d = o.before() - 1 - 1;
|
|
19
|
-
return e.commands.command(({ tr: e, dispatch: t }) => {
|
|
20
|
-
if (!t) return !0;
|
|
21
|
-
let n = o.parent.content, a = new r(n, 0, 0);
|
|
22
|
-
return e.replace(d, o.after(), a), e.setSelection(i.create(e.doc, d + n.size)), e.scrollIntoView(), t(e), !0;
|
|
23
|
-
});
|
|
24
|
-
}, s = /^\s*>\s$/, c = e.create({
|
|
25
|
-
name: "blockquote",
|
|
26
|
-
addOptions() {
|
|
27
|
-
return { HTMLAttributes: {} };
|
|
28
|
-
},
|
|
29
|
-
content: "block+",
|
|
30
|
-
group: "block",
|
|
31
|
-
defining: !0,
|
|
32
|
-
parseHTML() {
|
|
33
|
-
return [{ tag: "blockquote" }];
|
|
34
|
-
},
|
|
35
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
36
|
-
return /* @__PURE__ */ a("blockquote", {
|
|
37
|
-
...t(this.options.HTMLAttributes, e),
|
|
38
|
-
children: /* @__PURE__ */ a("slot", {})
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
parseMarkdown: (e, t) => {
|
|
42
|
-
let n = t.parseBlockChildren ?? t.parseChildren;
|
|
43
|
-
return t.createNode("blockquote", void 0, n(e.tokens || []));
|
|
44
|
-
},
|
|
45
|
-
renderMarkdown: (e, t) => {
|
|
46
|
-
if (!e.content) return "";
|
|
47
|
-
let n = [];
|
|
48
|
-
return e.content.forEach((e, r) => {
|
|
49
|
-
let i = (t.renderChild?.call(t, e, r) ?? t.renderChildren([e])).split("\n").map((e) => e.trim() === "" ? ">" : `> ${e}`);
|
|
50
|
-
n.push(i.join("\n"));
|
|
51
|
-
}), n.join("\n>\n");
|
|
52
|
-
},
|
|
53
|
-
addCommands() {
|
|
54
|
-
return {
|
|
55
|
-
setBlockquote: () => ({ commands: e }) => e.wrapIn(this.name),
|
|
56
|
-
toggleBlockquote: () => ({ commands: e }) => e.toggleWrap(this.name),
|
|
57
|
-
unsetBlockquote: () => ({ commands: e }) => e.lift(this.name)
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
addKeyboardShortcuts() {
|
|
61
|
-
return {
|
|
62
|
-
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote(),
|
|
63
|
-
Backspace: () => o(this.editor, this.type)
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
addInputRules() {
|
|
67
|
-
return [n({
|
|
68
|
-
find: s,
|
|
69
|
-
type: this.type
|
|
70
|
-
})];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
export { c as Blockquote, s as inputRegex };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["h","handleBackspace","editor","state","selection","$from","parentDepth","parent","index","type","previous","targetPos","dispatch","content","slice","Slice","tr","TextSelection","inputRegex","Blockquote","Node","mergeAttributes","HTMLAttributes","parseBlockChildren","helpers","token","node","result","linesWithPrefix","child","line","commands","wrappingInputRule"],"sources":["../../../../../node_modules/@tiptap/extension-blockquote/dist/index.js"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from \"@tiptap/core\";\nimport { Slice } from \"@tiptap/pm/model\";\nimport { TextSelection } from \"@tiptap/pm/state\";\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\n//#region src/handleBackspace.ts\n/**\n* Restructure the blockquote boundary at the caret.\n*\n* Two cases are handled in a single backspace:\n*\n* 1. Caret at the start of a non-first child of a blockquote — lift the\n* current child out, splitting the blockquote around it.\n* 2. Caret at the start of a top-level textblock whose previous sibling is\n* a blockquote with a textblock last child — merge the current\n* textblock's inline content into the blockquote's last textblock\n* instead of letting joinBackward pull the paragraph back inside.\n*\n* Returns true when the backspace was consumed.\n*/\nconst handleBackspace = (editor, type) => {\n\tvar _previous$lastChild;\n\tconst { state } = editor;\n\tconst { selection } = state;\n\tif (!selection.empty) return false;\n\tconst { $from } = selection;\n\tif ($from.parentOffset !== 0) return false;\n\tconst parentDepth = $from.depth - 1;\n\tif (parentDepth < 0) return false;\n\tconst parent = $from.node(parentDepth);\n\tconst index = $from.index(parentDepth);\n\tif (index === 0) return false;\n\tif (parent.type === type) return editor.commands.lift(type.name);\n\tconst previous = parent.child(index - 1);\n\tif (previous.type !== type || !((_previous$lastChild = previous.lastChild) === null || _previous$lastChild === void 0 ? void 0 : _previous$lastChild.isTextblock)) return false;\n\tconst targetPos = $from.before() - 1 - 1;\n\treturn editor.commands.command(({ tr, dispatch }) => {\n\t\tif (!dispatch) return true;\n\t\tconst content = $from.parent.content;\n\t\tconst slice = new Slice(content, 0, 0);\n\t\ttr.replace(targetPos, $from.after(), slice);\n\t\ttr.setSelection(TextSelection.create(tr.doc, targetPos + content.size));\n\t\ttr.scrollIntoView();\n\t\tdispatch(tr);\n\t\treturn true;\n\t});\n};\n//#endregion\n//#region src/blockquote.tsx\n/** @jsxImportSource @tiptap/core */\n/**\n* Matches a blockquote to a `>` as input.\n*/\nconst inputRegex = /^\\s*>\\s$/;\n/**\n* This extension allows you to create blockquotes.\n* @see https://tiptap.dev/api/nodes/blockquote\n*/\nconst Blockquote = Node.create({\n\tname: \"blockquote\",\n\taddOptions() {\n\t\treturn { HTMLAttributes: {} };\n\t},\n\tcontent: \"block+\",\n\tgroup: \"block\",\n\tdefining: true,\n\tparseHTML() {\n\t\treturn [{ tag: \"blockquote\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn /* @__PURE__ */ jsx(\"blockquote\", {\n\t\t\t...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\tchildren: /* @__PURE__ */ jsx(\"slot\", {})\n\t\t});\n\t},\n\tparseMarkdown: (token, helpers) => {\n\t\tvar _helpers$parseBlockCh;\n\t\tconst parseBlockChildren = (_helpers$parseBlockCh = helpers.parseBlockChildren) !== null && _helpers$parseBlockCh !== void 0 ? _helpers$parseBlockCh : helpers.parseChildren;\n\t\treturn helpers.createNode(\"blockquote\", void 0, parseBlockChildren(token.tokens || []));\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tif (!node.content) return \"\";\n\t\tconst prefix = \">\";\n\t\tconst result = [];\n\t\tnode.content.forEach((child, index) => {\n\t\t\tvar _h$renderChild, _h$renderChild2;\n\t\t\tconst linesWithPrefix = ((_h$renderChild = (_h$renderChild2 = h.renderChild) === null || _h$renderChild2 === void 0 ? void 0 : _h$renderChild2.call(h, child, index)) !== null && _h$renderChild !== void 0 ? _h$renderChild : h.renderChildren([child])).split(\"\\n\").map((line) => {\n\t\t\t\tif (line.trim() === \"\") return prefix;\n\t\t\t\treturn `${prefix} ${line}`;\n\t\t\t});\n\t\t\tresult.push(linesWithPrefix.join(\"\\n\"));\n\t\t});\n\t\treturn result.join(`\\n${prefix}\\n`);\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetBlockquote: () => ({ commands }) => {\n\t\t\t\treturn commands.wrapIn(this.name);\n\t\t\t},\n\t\t\ttoggleBlockquote: () => ({ commands }) => {\n\t\t\t\treturn commands.toggleWrap(this.name);\n\t\t\t},\n\t\t\tunsetBlockquote: () => ({ commands }) => {\n\t\t\t\treturn commands.lift(this.name);\n\t\t\t}\n\t\t};\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-Shift-b\": () => this.editor.commands.toggleBlockquote(),\n\t\t\tBackspace: () => handleBackspace(this.editor, this.type)\n\t\t};\n\t},\n\taddInputRules() {\n\t\treturn [wrappingInputRule({\n\t\t\tfind: inputRegex,\n\t\t\ttype: this.type\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Blockquote;\n//#endregion\nexport { Blockquote, src_default as default, inputRegex };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;AAmBA,IAAMC,KAAmB,GAAQ,MAAS;CAEzC,IAAM,EAAE,aAAUC,GACZ,EAAE,iBAAcC;CACtB,IAAI,CAACC,EAAU,OAAO,OAAO;CAC7B,IAAM,EAAE,aAAUA;CAClB,IAAIC,EAAM,iBAAiB,GAAG,OAAO;CACrC,IAAMC,IAAcD,EAAM,QAAQ;CAClC,IAAIC,IAAc,GAAG,OAAO;CAC5B,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AC5B,IAAI,CAACC,EAAK,SAAS,OAAO;EAC1B,IACMC,IAAS,CAAC;EAShB,OARAD,EAAK,QAAQ,SAAS,GAAO,MAAU;GAEtC,IAAME,KAAwD5B,EAAE,aAA+E,KAAKA,GAAG6B,GAAOrB,CAAK,KAA4DR,EAAE,eAAe,CAAC6B,CAAK,CAAC,EAAA,CAAG,MAAM,IAAI,CAAC,CAAC,KAAK,MACtQC,EAAK,KAAK,MAAM,KAAW,MACxB,KAAaA,GACpB;GACD,EAAO,KAAKF,EAAgB,KAAK,IAAI,CAAC;EACvC,CAAC,GACMD,EAAO,KAAK,OAAe;CACnC;CACA,cAAc;EACb,OAAO;GACN,sBAAsB,EAAE,kBAChBI,EAAS,OAAO,KAAK,IAAI;GAEjC,yBAAyB,EAAE,kBACnBA,EAAS,WAAW,KAAK,IAAI;GAErC,wBAAwB,EAAE,kBAClBA,EAAS,KAAK,KAAK,IAAI;EAEhC;CACD;CACA,uBAAuB;EACtB,OAAO;GACN,qBAAqB,KAAK,OAAO,SAAS,iBAAiB;GAC3D,iBAAiB9B,EAAgB,KAAK,QAAQ,KAAK,IAAI;EACxD;CACD;CACA,gBAAgB;EACf,OAAO,CAAC+B,EAAkB;GACzB,MAAMd;GACN,MAAM,KAAK;EACZ,CAAC,CAAC;CACH;AACD,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Mark as e, markInputRule as t, markPasteRule as n, mergeAttributes as r } from "../../core/dist/index.js";
|
|
2
|
-
import { createElement as i } from "../../core/dist/jsx-runtime/jsx-runtime.js";
|
|
3
|
-
// node_modules/@tiptap/extension-bold/dist/index.js
|
|
4
|
-
var a = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, o = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, s = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, c = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, l = e.create({
|
|
5
|
-
name: "bold",
|
|
6
|
-
addOptions() {
|
|
7
|
-
return { HTMLAttributes: {} };
|
|
8
|
-
},
|
|
9
|
-
parseHTML() {
|
|
10
|
-
return [
|
|
11
|
-
{ tag: "strong" },
|
|
12
|
-
{
|
|
13
|
-
tag: "b",
|
|
14
|
-
getAttrs: (e) => e.style.fontWeight !== "normal" && null
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
style: "font-weight=400",
|
|
18
|
-
clearMark: (e) => e.type.name === this.name
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
style: "font-weight",
|
|
22
|
-
getAttrs: (e) => /^(bold(er)?|[5-9]\d{2,})$/.test(e) && null
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
},
|
|
26
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
27
|
-
return /* @__PURE__ */ i("strong", {
|
|
28
|
-
...r(this.options.HTMLAttributes, e),
|
|
29
|
-
children: /* @__PURE__ */ i("slot", {})
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
markdownTokenName: "strong",
|
|
33
|
-
parseMarkdown: (e, t) => t.applyMark("bold", t.parseInline(e.tokens || [])),
|
|
34
|
-
markdownOptions: { htmlReopen: {
|
|
35
|
-
open: "<strong>",
|
|
36
|
-
close: "</strong>"
|
|
37
|
-
} },
|
|
38
|
-
renderMarkdown: (e, t) => `**${t.renderChildren(e)}**`,
|
|
39
|
-
addCommands() {
|
|
40
|
-
return {
|
|
41
|
-
setBold: () => ({ commands: e }) => e.setMark(this.name),
|
|
42
|
-
toggleBold: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
43
|
-
unsetBold: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
44
|
-
};
|
|
45
|
-
},
|
|
46
|
-
addKeyboardShortcuts() {
|
|
47
|
-
return {
|
|
48
|
-
"Mod-b": () => this.editor.commands.toggleBold(),
|
|
49
|
-
"Mod-B": () => this.editor.commands.toggleBold()
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
addInputRules() {
|
|
53
|
-
return [t({
|
|
54
|
-
find: a,
|
|
55
|
-
type: this.type
|
|
56
|
-
}), t({
|
|
57
|
-
find: s,
|
|
58
|
-
type: this.type
|
|
59
|
-
})];
|
|
60
|
-
},
|
|
61
|
-
addPasteRules() {
|
|
62
|
-
return [n({
|
|
63
|
-
find: o,
|
|
64
|
-
type: this.type
|
|
65
|
-
}), n({
|
|
66
|
-
find: c,
|
|
67
|
-
type: this.type
|
|
68
|
-
})];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
export { l as Bold, a as starInputRegex, o as starPasteRegex, s as underscoreInputRegex, c as underscorePasteRegex };
|
|
72
|
-
|
|
73
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["h","starInputRegex","starPasteRegex","underscoreInputRegex","underscorePasteRegex","Bold","Mark","node","mark","value","mergeAttributes","HTMLAttributes","helpers","token","commands","markInputRule","markPasteRule"],"sources":["../../../../../node_modules/@tiptap/extension-bold/dist/index.js"],"sourcesContent":["import { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\n//#region src/bold.tsx\n/** @jsxImportSource @tiptap/core */\n/**\n* Matches bold text via `**` as input.\n*/\nconst starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/;\n/**\n* Matches bold text via `**` while pasting.\n*/\nconst starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g;\n/**\n* Matches bold text via `__` as input.\n*/\nconst underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/;\n/**\n* Matches bold text via `__` while pasting.\n*/\nconst underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g;\n/**\n* This extension allows you to mark text as bold.\n* @see https://tiptap.dev/api/marks/bold\n*/\nconst Bold = Mark.create({\n\tname: \"bold\",\n\taddOptions() {\n\t\treturn { HTMLAttributes: {} };\n\t},\n\tparseHTML() {\n\t\treturn [\n\t\t\t{ tag: \"strong\" },\n\t\t\t{\n\t\t\t\ttag: \"b\",\n\t\t\t\tgetAttrs: (node) => node.style.fontWeight !== \"normal\" && null\n\t\t\t},\n\t\t\t{\n\t\t\t\tstyle: \"font-weight=400\",\n\t\t\t\tclearMark: (mark) => mark.type.name === this.name\n\t\t\t},\n\t\t\t{\n\t\t\t\tstyle: \"font-weight\",\n\t\t\t\tgetAttrs: (value) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null\n\t\t\t}\n\t\t];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn /* @__PURE__ */ jsx(\"strong\", {\n\t\t\t...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\tchildren: /* @__PURE__ */ jsx(\"slot\", {})\n\t\t});\n\t},\n\tmarkdownTokenName: \"strong\",\n\tparseMarkdown: (token, helpers) => {\n\t\treturn helpers.applyMark(\"bold\", helpers.parseInline(token.tokens || []));\n\t},\n\tmarkdownOptions: { htmlReopen: {\n\t\topen: \"<strong>\",\n\t\tclose: \"</strong>\"\n\t} },\n\trenderMarkdown: (node, h) => {\n\t\treturn `**${h.renderChildren(node)}**`;\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetBold: () => ({ commands }) => {\n\t\t\t\treturn commands.setMark(this.name);\n\t\t\t},\n\t\t\ttoggleBold: () => ({ commands }) => {\n\t\t\t\treturn commands.toggleMark(this.name);\n\t\t\t},\n\t\t\tunsetBold: () => ({ commands }) => {\n\t\t\t\treturn commands.unsetMark(this.name);\n\t\t\t}\n\t\t};\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-b\": () => this.editor.commands.toggleBold(),\n\t\t\t\"Mod-B\": () => this.editor.commands.toggleBold()\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 = Bold;\n//#endregion\nexport { Bold, src_default as default, starInputRegex, starPasteRegex, underscoreInputRegex, underscorePasteRegex };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;AAOA,IAAMC,IAAiB,wDAIjBC,IAAiB,wDAIjBC,IAAuB,gDAIvBC,IAAuB,gDAKvBC,IAAOC,EAAK,OAAO;CACxB,MAAM;CACN,aAAa;EACZ,OAAO,EAAE,gBAAgB,CAAC,EAAE;CAC7B;CACA,YAAY;EACX,OAAO;GACN,EAAE,KAAK,SAAS;GAChB;IACC,KAAK;IACL,WAAW,MAASC,EAAK,MAAM,eAAe,YAAY;GAC3D;GACA;IACC,OAAO;IACP,YAAY,MAASC,EAAK,KAAK,SAAS,KAAK;GAC9C;GACA;IACC,OAAO;IACP,WAAW,MAAU,4BAA4B,KAAKC,CAAK,KAAK;GACjE;EACD;CACD;CACA,WAAW,EAAE,qBAAkB;EAC9B,OAAuB,kBAAI,UAAU;GACpC,GAAGC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAC9D,UAA0B,kBAAI,QAAQ,CAAC,CAAC;EACzC,CAAC;CACF;CACA,mBAAmB;CACnB,gBAAgB,GAAO,MACfC,EAAQ,UAAU,QAAQA,EAAQ,YAAYC,EAAM,UAAU,CAAC,CAAC,CAAC;CAEzE,iBAAiB,EAAE,YAAY;EAC9B,MAAM;EACN,OAAO;CACR,EAAE;CACF,iBAAiB,GAAM,MACf,KAAKb,EAAE,eAAeO,CAAI,EAAE;CAEpC,cAAc;EACb,OAAO;GACN,gBAAgB,EAAE,kBACVO,EAAS,QAAQ,KAAK,IAAI;GAElC,mBAAmB,EAAE,kBACbA,EAAS,WAAW,KAAK,IAAI;GAErC,kBAAkB,EAAE,kBACZA,EAAS,UAAU,KAAK,IAAI;EAErC;CACD;CACA,uBAAuB;EACtB,OAAO;GACN,eAAe,KAAK,OAAO,SAAS,WAAW;GAC/C,eAAe,KAAK,OAAO,SAAS,WAAW;EAChD;CACD;CACA,gBAAgB;EACf,OAAO,CAACC,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,78 +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-code/dist/index.js
|
|
3
|
-
var i = (e) => {
|
|
4
|
-
let t = /`([^`]+)`(?!`)$/.exec(e);
|
|
5
|
-
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
6
|
-
index: t.index,
|
|
7
|
-
text: t[0],
|
|
8
|
-
replaceWith: t[1]
|
|
9
|
-
};
|
|
10
|
-
}, a = (e) => {
|
|
11
|
-
let t = /`([^`]+)`(?!`)/g, n = [], r;
|
|
12
|
-
for (; (r = t.exec(e)) !== null;) r.index > 0 && e[r.index - 1] === "`" || n.push({
|
|
13
|
-
index: r.index,
|
|
14
|
-
text: r[0],
|
|
15
|
-
replaceWith: r[1]
|
|
16
|
-
});
|
|
17
|
-
return n;
|
|
18
|
-
};
|
|
19
|
-
function o(e) {
|
|
20
|
-
let t = new Set((e.match(/`+/g) || []).map((e) => e.length)), n = 1;
|
|
21
|
-
for (; t.has(n);) n += 1;
|
|
22
|
-
return n;
|
|
23
|
-
}
|
|
24
|
-
var s = e.create({
|
|
25
|
-
name: "code",
|
|
26
|
-
addOptions() {
|
|
27
|
-
return { HTMLAttributes: {} };
|
|
28
|
-
},
|
|
29
|
-
excludes: "_",
|
|
30
|
-
code: !0,
|
|
31
|
-
exitable: !0,
|
|
32
|
-
parseHTML() {
|
|
33
|
-
return [{ tag: "code" }];
|
|
34
|
-
},
|
|
35
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
36
|
-
return [
|
|
37
|
-
"code",
|
|
38
|
-
r(this.options.HTMLAttributes, e),
|
|
39
|
-
0
|
|
40
|
-
];
|
|
41
|
-
},
|
|
42
|
-
markdownTokenName: "codespan",
|
|
43
|
-
parseMarkdown: (e, t) => t.applyMark("code", [{
|
|
44
|
-
type: "text",
|
|
45
|
-
text: e.text || ""
|
|
46
|
-
}]),
|
|
47
|
-
renderMarkdown: (e, t, n) => {
|
|
48
|
-
var r;
|
|
49
|
-
if (!e.content) return "";
|
|
50
|
-
let i = typeof (n == null || (r = n.meta) == null ? void 0 : r.markText) == "string" ? n.meta.markText : "", a = "`".repeat(o(i)), s = i.startsWith("`") || i.endsWith("`") ? " " : "";
|
|
51
|
-
return `${a}${s}${t.renderChildren(e.content)}${s}${a}`;
|
|
52
|
-
},
|
|
53
|
-
addCommands() {
|
|
54
|
-
return {
|
|
55
|
-
setCode: () => ({ commands: e }) => e.setMark(this.name),
|
|
56
|
-
toggleCode: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
57
|
-
unsetCode: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
addKeyboardShortcuts() {
|
|
61
|
-
return { "Mod-e": () => this.editor.commands.toggleCode() };
|
|
62
|
-
},
|
|
63
|
-
addInputRules() {
|
|
64
|
-
return [t({
|
|
65
|
-
find: i,
|
|
66
|
-
type: this.type
|
|
67
|
-
})];
|
|
68
|
-
},
|
|
69
|
-
addPasteRules() {
|
|
70
|
-
return [n({
|
|
71
|
-
find: a,
|
|
72
|
-
type: this.type
|
|
73
|
-
})];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
export { s as Code, i as inputRegexMatch, a as pasteRegexMatch };
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["inputRegexMatch","match","text","pasteRegexMatch","regex","matches","shortestUnusedBacktickRun","runs","run","length","Code","Mark","mergeAttributes","HTMLAttributes","helpers","token","_context$meta","node","markText","context","fence","padding","h","commands","markInputRule","markPasteRule"],"sources":["../../../../../node_modules/@tiptap/extension-code/dist/index.js"],"sourcesContent":["import { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\n//#region src/code.ts\n/**\n* The regular expression used for the inline code input rule.\n* @deprecated The extension now uses a function-based finder internally.\n* This regex is kept for backward compatibility.\n*/\nconst inputRegex = /(^|[^`])`([^`]+)`(?!`)$/;\n/**\n* The regular expression used for the inline code paste rule.\n* @deprecated The extension now uses a function-based finder internally.\n* This regex is kept for backward compatibility.\n*/\nconst pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;\n/**\n* A function-based finder for the inline code input rule.\n* Used internally by the extension to ensure the preceding character\n* is not consumed as part of the match, preventing it from being deleted.\n*/\nconst inputRegexMatch = (text) => {\n\tconst match = /`([^`]+)`(?!`)$/.exec(text);\n\tif (!match) return null;\n\tif (match.index > 0 && text[match.index - 1] === \"`\") return null;\n\treturn {\n\t\tindex: match.index,\n\t\ttext: match[0],\n\t\treplaceWith: match[1]\n\t};\n};\n/**\n* A function-based finder for the inline code paste rule.\n* Used internally by the extension to avoid consuming the preceding\n* character as part of the match.\n*/\nconst pasteRegexMatch = (text) => {\n\tconst regex = /`([^`]+)`(?!`)/g;\n\tconst matches = [];\n\tlet match;\n\twhile ((match = regex.exec(text)) !== null) {\n\t\tif (match.index > 0 && text[match.index - 1] === \"`\") continue;\n\t\tmatches.push({\n\t\t\tindex: match.index,\n\t\t\ttext: match[0],\n\t\t\treplaceWith: match[1]\n\t\t});\n\t}\n\treturn matches;\n};\nfunction shortestUnusedBacktickRun(text) {\n\tconst runs = new Set((text.match(/`+/g) || []).map((run) => run.length));\n\tlet length = 1;\n\twhile (runs.has(length)) length += 1;\n\treturn length;\n}\n/**\n* This extension allows you to mark text as inline code.\n* @see https://tiptap.dev/api/marks/code\n*/\nconst Code = Mark.create({\n\tname: \"code\",\n\taddOptions() {\n\t\treturn { HTMLAttributes: {} };\n\t},\n\texcludes: \"_\",\n\tcode: true,\n\texitable: true,\n\tparseHTML() {\n\t\treturn [{ tag: \"code\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"code\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\tmarkdownTokenName: \"codespan\",\n\tparseMarkdown: (token, helpers) => {\n\t\treturn helpers.applyMark(\"code\", [{\n\t\t\ttype: \"text\",\n\t\t\ttext: token.text || \"\"\n\t\t}]);\n\t},\n\trenderMarkdown: (node, h, context) => {\n\t\tvar _context$meta;\n\t\tif (!node.content) return \"\";\n\t\tconst markText = typeof (context === null || context === void 0 || (_context$meta = context.meta) === null || _context$meta === void 0 ? void 0 : _context$meta.markText) === \"string\" ? context.meta.markText : \"\";\n\t\tconst fence = \"`\".repeat(shortestUnusedBacktickRun(markText));\n\t\tconst padding = markText.startsWith(\"`\") || markText.endsWith(\"`\") ? \" \" : \"\";\n\t\treturn `${fence}${padding}${h.renderChildren(node.content)}${padding}${fence}`;\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetCode: () => ({ commands }) => {\n\t\t\t\treturn commands.setMark(this.name);\n\t\t\t},\n\t\t\ttoggleCode: () => ({ commands }) => {\n\t\t\t\treturn commands.toggleMark(this.name);\n\t\t\t},\n\t\t\tunsetCode: () => ({ commands }) => {\n\t\t\t\treturn commands.unsetMark(this.name);\n\t\t\t}\n\t\t};\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn { \"Mod-e\": () => this.editor.commands.toggleCode() };\n\t},\n\taddInputRules() {\n\t\treturn [markInputRule({\n\t\t\tfind: inputRegexMatch,\n\t\t\ttype: this.type\n\t\t})];\n\t},\n\taddPasteRules() {\n\t\treturn [markPasteRule({\n\t\t\tfind: pasteRegexMatch,\n\t\t\ttype: this.type\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Code;\n//#endregion\nexport { Code, src_default as default, inputRegex, inputRegexMatch, pasteRegex, pasteRegexMatch };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAmBA,IAAMA,KAAmB,MAAS;CACjC,IAAMC,IAAQ,kBAAkB,KAAKC,CAAI;CAGzC,OAFI,CAACD,KACDA,EAAM,QAAQ,KAAKC,EAAKD,EAAM,QAAQ,OAAO,MAAY,OACtD;EACN,OAAOA,EAAM;EACb,MAAMA,EAAM;EACZ,aAAaA,EAAM;CACpB;AACD,GAMME,KAAmB,MAAS;CACjC,IAAMC,IAAQ,mBACRC,IAAU,CAAC,GACbJ;CACJ,QAAQ,IAAQG,EAAM,KAAKF,CAAI,OAAO,OACrC,AAAID,EAAM,QAAQ,KAAKC,EAAKD,EAAM,QAAQ,OAAO,OACjDI,EAAQ,KAAK;EACZ,OAAOJ,EAAM;EACb,MAAMA,EAAM;EACZ,aAAaA,EAAM;CACpB,CAAC;CAEF,OAAOI;AACR;AACA,SAASC,EAA0B,GAAM;CACxC,IAAMC,IAAO,IAAI,KAAKL,EAAK,MAAM,KAAK,KAAK,CAAC,EAAA,CAAG,KAAK,MAAQM,EAAI,MAAM,CAAC,GACnEC,IAAS;CACb,OA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AAgB;EACf,OAAO,CAACyB,EAAc;GACrB,MAAMtB;GACN,MAAM,KAAK;EACZ,CAAC,CAAC;CACH;AACD,CAAC"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { Node as e, mergeAttributes as t, textblockTypeInputRule as n } from "../../core/dist/index.js";
|
|
2
|
-
import { Plugin as r, PluginKey as i, Selection as a, TextSelection as o } from "../../../prosemirror-state/dist/index.js";
|
|
3
|
-
// node_modules/@tiptap/extension-code-block/dist/index.js
|
|
4
|
-
var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = e.create({
|
|
5
|
-
name: "codeBlock",
|
|
6
|
-
addOptions() {
|
|
7
|
-
return {
|
|
8
|
-
languageClassPrefix: "language-",
|
|
9
|
-
exitOnTripleEnter: !0,
|
|
10
|
-
exitOnArrowDown: !0,
|
|
11
|
-
exitOnArrowUp: !0,
|
|
12
|
-
defaultLanguage: null,
|
|
13
|
-
enableTabIndentation: !1,
|
|
14
|
-
tabSize: s,
|
|
15
|
-
HTMLAttributes: {}
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
content: "text*",
|
|
19
|
-
marks: "",
|
|
20
|
-
group: "block",
|
|
21
|
-
code: !0,
|
|
22
|
-
defining: !0,
|
|
23
|
-
addAttributes() {
|
|
24
|
-
return { language: {
|
|
25
|
-
default: this.options.defaultLanguage,
|
|
26
|
-
parseHTML: (e) => {
|
|
27
|
-
let { languageClassPrefix: t } = this.options;
|
|
28
|
-
return t && [...e.firstElementChild?.classList || []].filter((e) => e.startsWith(t)).map((e) => e.replace(t, ""))[0] || null;
|
|
29
|
-
},
|
|
30
|
-
rendered: !1
|
|
31
|
-
} };
|
|
32
|
-
},
|
|
33
|
-
parseHTML() {
|
|
34
|
-
return [{
|
|
35
|
-
tag: "pre",
|
|
36
|
-
preserveWhitespace: "full"
|
|
37
|
-
}];
|
|
38
|
-
},
|
|
39
|
-
renderHTML({ node: e, HTMLAttributes: n }) {
|
|
40
|
-
return [
|
|
41
|
-
"pre",
|
|
42
|
-
t(this.options.HTMLAttributes, n),
|
|
43
|
-
[
|
|
44
|
-
"code",
|
|
45
|
-
{ class: e.attrs.language ? this.options.languageClassPrefix + e.attrs.language : null },
|
|
46
|
-
0
|
|
47
|
-
]
|
|
48
|
-
];
|
|
49
|
-
},
|
|
50
|
-
markdownTokenName: "code",
|
|
51
|
-
parseMarkdown: (e, t) => e.raw?.startsWith("```") === !1 && e.raw?.startsWith("~~~") === !1 && e.codeBlockStyle !== "indented" ? [] : t.createNode("codeBlock", { language: e.lang || null }, e.text ? [t.createTextNode(e.text)] : []),
|
|
52
|
-
renderMarkdown: (e, t) => {
|
|
53
|
-
let n = "", r = e.attrs?.language || "";
|
|
54
|
-
return n = e.content ? [
|
|
55
|
-
`\`\`\`${r}`,
|
|
56
|
-
t.renderChildren(e.content),
|
|
57
|
-
"```"
|
|
58
|
-
].join("\n") : `\`\`\`${r}\n\n\`\`\``, n;
|
|
59
|
-
},
|
|
60
|
-
addCommands() {
|
|
61
|
-
return {
|
|
62
|
-
setCodeBlock: (e) => ({ commands: t }) => t.setNode(this.name, e),
|
|
63
|
-
toggleCodeBlock: (e) => ({ commands: t }) => t.toggleNode(this.name, "paragraph", e)
|
|
64
|
-
};
|
|
65
|
-
},
|
|
66
|
-
addKeyboardShortcuts() {
|
|
67
|
-
return {
|
|
68
|
-
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
|
|
69
|
-
Backspace: () => {
|
|
70
|
-
let { empty: e, $anchor: t } = this.editor.state.selection, n = t.pos === 1;
|
|
71
|
-
return !e || t.parent.type.name !== this.name ? !1 : n || !t.parent.textContent.length ? this.editor.commands.clearNodes() : !1;
|
|
72
|
-
},
|
|
73
|
-
Tab: ({ editor: e }) => {
|
|
74
|
-
if (!this.options.enableTabIndentation) return !1;
|
|
75
|
-
let t = this.options.tabSize ?? s, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
|
|
76
|
-
if (i.parent.type !== this.type) return !1;
|
|
77
|
-
let o = " ".repeat(t);
|
|
78
|
-
return a ? e.commands.insertContent(o) : e.commands.command(({ tr: e }) => {
|
|
79
|
-
let { from: t, to: i } = r, a = n.doc.textBetween(t, i, "\n", "\n").split("\n").map((e) => o + e).join("\n");
|
|
80
|
-
return e.replaceWith(t, i, n.schema.text(a)), !0;
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
"Shift-Tab": ({ editor: e }) => {
|
|
84
|
-
if (!this.options.enableTabIndentation) return !1;
|
|
85
|
-
let t = this.options.tabSize ?? s, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
|
|
86
|
-
return i.parent.type === this.type ? a ? e.commands.command(({ tr: e }) => {
|
|
87
|
-
let { pos: r } = i, a = i.start(), s = i.end(), c = n.doc.textBetween(a, s, "\n", "\n").split("\n"), l = 0, u = 0, d = r - a;
|
|
88
|
-
for (let e = 0; e < c.length; e += 1) {
|
|
89
|
-
if (u + c[e].length >= d) {
|
|
90
|
-
l = e;
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
u += c[e].length + 1;
|
|
94
|
-
}
|
|
95
|
-
let f = c[l].match(/^ */)?.[0] || "", p = Math.min(f.length, t);
|
|
96
|
-
if (p === 0) return !0;
|
|
97
|
-
let m = a;
|
|
98
|
-
for (let e = 0; e < l; e += 1) m += c[e].length + 1;
|
|
99
|
-
return e.delete(m, m + p), r - m <= p && e.setSelection(o.create(e.doc, m)), !0;
|
|
100
|
-
}) : e.commands.command(({ tr: e }) => {
|
|
101
|
-
let { from: i, to: a } = r, o = n.doc.textBetween(i, a, "\n", "\n").split("\n").map((e) => {
|
|
102
|
-
let n = e.match(/^ */)?.[0] || "", r = Math.min(n.length, t);
|
|
103
|
-
return e.slice(r);
|
|
104
|
-
}).join("\n");
|
|
105
|
-
return e.replaceWith(i, a, n.schema.text(o)), !0;
|
|
106
|
-
}) : !1;
|
|
107
|
-
},
|
|
108
|
-
Enter: ({ editor: e }) => {
|
|
109
|
-
if (!this.options.exitOnTripleEnter) return !1;
|
|
110
|
-
let { state: t } = e, { selection: n } = t, { $from: r, empty: i } = n;
|
|
111
|
-
if (!i || r.parent.type !== this.type) return !1;
|
|
112
|
-
let a = r.parentOffset === r.parent.nodeSize - 2, o = r.parent.textContent.endsWith("\n\n");
|
|
113
|
-
return !a || !o ? !1 : e.chain().command(({ tr: e }) => (e.delete(r.pos - 2, r.pos), !0)).exitCode().run();
|
|
114
|
-
},
|
|
115
|
-
ArrowUp: ({ editor: e }) => {
|
|
116
|
-
if (!this.options.exitOnArrowUp) return !1;
|
|
117
|
-
let { state: t } = e, { selection: n } = t, { $from: r, empty: i } = n;
|
|
118
|
-
if (!i || r.parent.type !== this.type || r.parentOffset !== 0) return !1;
|
|
119
|
-
let a = r.before();
|
|
120
|
-
return a > 0 ? !1 : e.commands.insertDefaultBlock({ pos: a });
|
|
121
|
-
},
|
|
122
|
-
ArrowDown: ({ editor: e }) => {
|
|
123
|
-
if (!this.options.exitOnArrowDown) return !1;
|
|
124
|
-
let { state: t } = e, { selection: n, doc: r } = t, { $from: i, empty: o } = n;
|
|
125
|
-
if (!o || i.parent.type !== this.type || i.parentOffset !== i.parent.nodeSize - 2) return !1;
|
|
126
|
-
let s = i.after();
|
|
127
|
-
return s === void 0 ? !1 : r.nodeAt(s) ? e.commands.command(({ tr: e }) => (e.setSelection(a.near(r.resolve(s))), !0)) : e.commands.exitCode();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
},
|
|
131
|
-
addInputRules() {
|
|
132
|
-
return [n({
|
|
133
|
-
find: c,
|
|
134
|
-
type: this.type,
|
|
135
|
-
getAttributes: (e) => ({ language: e[1] })
|
|
136
|
-
}), n({
|
|
137
|
-
find: l,
|
|
138
|
-
type: this.type,
|
|
139
|
-
getAttributes: (e) => ({ language: e[1] })
|
|
140
|
-
})];
|
|
141
|
-
},
|
|
142
|
-
addProseMirrorPlugins() {
|
|
143
|
-
return [new r({
|
|
144
|
-
key: new i("codeBlockVSCodeHandler"),
|
|
145
|
-
props: { handlePaste: (e, t) => {
|
|
146
|
-
if (!t.clipboardData || this.editor.isActive(this.type.name)) return !1;
|
|
147
|
-
let n = t.clipboardData.getData("text/plain"), r = t.clipboardData.getData("vscode-editor-data"), i = (r ? JSON.parse(r) : void 0)?.mode;
|
|
148
|
-
if (!n || !i) return !1;
|
|
149
|
-
let { tr: a, schema: s } = e.state, c = s.text(n.replace(/\r\n?/g, "\n"));
|
|
150
|
-
return a.replaceSelectionWith(this.type.create({ language: i }, c)), a.selection.$from.parent.type !== this.type && a.setSelection(o.near(a.doc.resolve(Math.max(0, a.selection.from - 2)))), a.setMeta("paste", !0), e.dispatch(a), !0;
|
|
151
|
-
} }
|
|
152
|
-
})];
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
export { u as CodeBlock, c as backtickInputRegex, l as tildeInputRegex };
|
|
156
|
-
|
|
157
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DEFAULT_TAB_SIZE","backtickInputRegex","tildeInputRegex","CodeBlock","Node","languageClassPrefix","element","className","mergeAttributes","HTMLAttributes","node","token","helpers","output","language","h","commands","attributes","isAtStart","$anchor","empty","tabSize","editor","state","selection","$from","indent","indentedText","from","to","line","tr","codeBlockStart","codeBlockEnd","lines","currentLineIndex","charCount","relativeCursorPos","pos","i","leadingSpaces","spacesToRemove","lineStartPos","TextSelection","reverseIndentText","isAtEnd","endsWithDoubleNewline","before","after","doc","Selection","textblockTypeInputRule","match","Plugin","PluginKey","event","text","vscode","view","textNode","schema"],"sources":["../../../../../node_modules/@tiptap/extension-code-block/dist/index.js"],"sourcesContent":["import { Node, mergeAttributes, textblockTypeInputRule } from \"@tiptap/core\";\nimport { Plugin, PluginKey, Selection, TextSelection } from \"@tiptap/pm/state\";\n//#region src/code-block.ts\nconst DEFAULT_TAB_SIZE = 4;\n/**\n* Matches a code block with backticks.\n*/\nconst backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/;\n/**\n* Matches a code block with tildes.\n*/\nconst tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/;\n/**\n* This extension allows you to create code blocks.\n* @see https://tiptap.dev/api/nodes/code-block\n*/\nconst CodeBlock = Node.create({\n\tname: \"codeBlock\",\n\taddOptions() {\n\t\treturn {\n\t\t\tlanguageClassPrefix: \"language-\",\n\t\t\texitOnTripleEnter: true,\n\t\t\texitOnArrowDown: true,\n\t\t\texitOnArrowUp: true,\n\t\t\tdefaultLanguage: null,\n\t\t\tenableTabIndentation: false,\n\t\t\ttabSize: DEFAULT_TAB_SIZE,\n\t\t\tHTMLAttributes: {}\n\t\t};\n\t},\n\tcontent: \"text*\",\n\tmarks: \"\",\n\tgroup: \"block\",\n\tcode: true,\n\tdefining: true,\n\taddAttributes() {\n\t\treturn { language: {\n\t\t\tdefault: this.options.defaultLanguage,\n\t\t\tparseHTML: (element) => {\n\t\t\t\tvar _element$firstElement;\n\t\t\t\tconst { languageClassPrefix } = this.options;\n\t\t\t\tif (!languageClassPrefix) return null;\n\t\t\t\tconst language = [...((_element$firstElement = element.firstElementChild) === null || _element$firstElement === void 0 ? void 0 : _element$firstElement.classList) || []].filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, \"\"))[0];\n\t\t\t\tif (!language) return null;\n\t\t\t\treturn language;\n\t\t\t},\n\t\t\trendered: false\n\t\t} };\n\t},\n\tparseHTML() {\n\t\treturn [{\n\t\t\ttag: \"pre\",\n\t\t\tpreserveWhitespace: \"full\"\n\t\t}];\n\t},\n\trenderHTML({ node, HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"pre\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t[\n\t\t\t\t\"code\",\n\t\t\t\t{ class: node.attrs.language ? this.options.languageClassPrefix + node.attrs.language : null },\n\t\t\t\t0\n\t\t\t]\n\t\t];\n\t},\n\tmarkdownTokenName: \"code\",\n\tparseMarkdown: (token, helpers) => {\n\t\tvar _token$raw, _token$raw2;\n\t\tif (((_token$raw = token.raw) === null || _token$raw === void 0 ? void 0 : _token$raw.startsWith(\"```\")) === false && ((_token$raw2 = token.raw) === null || _token$raw2 === void 0 ? void 0 : _token$raw2.startsWith(\"~~~\")) === false && token.codeBlockStyle !== \"indented\") return [];\n\t\treturn helpers.createNode(\"codeBlock\", { language: token.lang || null }, token.text ? [helpers.createTextNode(token.text)] : []);\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tvar _node$attrs;\n\t\tlet output = \"\";\n\t\tconst language = ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language) || \"\";\n\t\tif (!node.content) output = `\\`\\`\\`${language}\\n\\n\\`\\`\\``;\n\t\telse output = [\n\t\t\t`\\`\\`\\`${language}`,\n\t\t\th.renderChildren(node.content),\n\t\t\t\"```\"\n\t\t].join(\"\\n\");\n\t\treturn output;\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tsetCodeBlock: (attributes) => ({ commands }) => {\n\t\t\t\treturn commands.setNode(this.name, attributes);\n\t\t\t},\n\t\t\ttoggleCodeBlock: (attributes) => ({ commands }) => {\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 {\n\t\t\t\"Mod-Alt-c\": () => this.editor.commands.toggleCodeBlock(),\n\t\t\tBackspace: () => {\n\t\t\t\tconst { empty, $anchor } = this.editor.state.selection;\n\t\t\t\tconst isAtStart = $anchor.pos === 1;\n\t\t\t\tif (!empty || $anchor.parent.type.name !== this.name) return false;\n\t\t\t\tif (isAtStart || !$anchor.parent.textContent.length) return this.editor.commands.clearNodes();\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tTab: ({ editor }) => {\n\t\t\t\tvar _this$options$tabSize;\n\t\t\t\tif (!this.options.enableTabIndentation) return false;\n\t\t\t\tconst tabSize = (_this$options$tabSize = this.options.tabSize) !== null && _this$options$tabSize !== void 0 ? _this$options$tabSize : DEFAULT_TAB_SIZE;\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { selection } = state;\n\t\t\t\tconst { $from, empty } = selection;\n\t\t\t\tif ($from.parent.type !== this.type) return false;\n\t\t\t\tconst indent = \" \".repeat(tabSize);\n\t\t\t\tif (empty) return editor.commands.insertContent(indent);\n\t\t\t\treturn editor.commands.command(({ tr }) => {\n\t\t\t\t\tconst { from, to } = selection;\n\t\t\t\t\tconst indentedText = state.doc.textBetween(from, to, \"\\n\", \"\\n\").split(\"\\n\").map((line) => indent + line).join(\"\\n\");\n\t\t\t\t\ttr.replaceWith(from, to, state.schema.text(indentedText));\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t},\n\t\t\t\"Shift-Tab\": ({ editor }) => {\n\t\t\t\tvar _this$options$tabSize2;\n\t\t\t\tif (!this.options.enableTabIndentation) return false;\n\t\t\t\tconst tabSize = (_this$options$tabSize2 = this.options.tabSize) !== null && _this$options$tabSize2 !== void 0 ? _this$options$tabSize2 : DEFAULT_TAB_SIZE;\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { selection } = state;\n\t\t\t\tconst { $from, empty } = selection;\n\t\t\t\tif ($from.parent.type !== this.type) return false;\n\t\t\t\tif (empty) return editor.commands.command(({ tr }) => {\n\t\t\t\t\tvar _currentLine$match;\n\t\t\t\t\tconst { pos } = $from;\n\t\t\t\t\tconst codeBlockStart = $from.start();\n\t\t\t\t\tconst codeBlockEnd = $from.end();\n\t\t\t\t\tconst lines = state.doc.textBetween(codeBlockStart, codeBlockEnd, \"\\n\", \"\\n\").split(\"\\n\");\n\t\t\t\t\tlet currentLineIndex = 0;\n\t\t\t\t\tlet charCount = 0;\n\t\t\t\t\tconst relativeCursorPos = pos - codeBlockStart;\n\t\t\t\t\tfor (let i = 0; i < lines.length; i += 1) {\n\t\t\t\t\t\tif (charCount + lines[i].length >= relativeCursorPos) {\n\t\t\t\t\t\t\tcurrentLineIndex = i;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcharCount += lines[i].length + 1;\n\t\t\t\t\t}\n\t\t\t\t\tconst leadingSpaces = ((_currentLine$match = lines[currentLineIndex].match(/^ */)) === null || _currentLine$match === void 0 ? void 0 : _currentLine$match[0]) || \"\";\n\t\t\t\t\tconst spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n\t\t\t\t\tif (spacesToRemove === 0) return true;\n\t\t\t\t\tlet lineStartPos = codeBlockStart;\n\t\t\t\t\tfor (let i = 0; i < currentLineIndex; i += 1) lineStartPos += lines[i].length + 1;\n\t\t\t\t\ttr.delete(lineStartPos, lineStartPos + spacesToRemove);\n\t\t\t\t\tif (pos - lineStartPos <= spacesToRemove) tr.setSelection(TextSelection.create(tr.doc, lineStartPos));\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\treturn editor.commands.command(({ tr }) => {\n\t\t\t\t\tconst { from, to } = selection;\n\t\t\t\t\tconst reverseIndentText = state.doc.textBetween(from, to, \"\\n\", \"\\n\").split(\"\\n\").map((line) => {\n\t\t\t\t\t\tvar _line$match;\n\t\t\t\t\t\tconst leadingSpaces = ((_line$match = line.match(/^ */)) === null || _line$match === void 0 ? void 0 : _line$match[0]) || \"\";\n\t\t\t\t\t\tconst spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n\t\t\t\t\t\treturn line.slice(spacesToRemove);\n\t\t\t\t\t}).join(\"\\n\");\n\t\t\t\t\ttr.replaceWith(from, to, state.schema.text(reverseIndentText));\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t},\n\t\t\tEnter: ({ editor }) => {\n\t\t\t\tif (!this.options.exitOnTripleEnter) return false;\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { selection } = state;\n\t\t\t\tconst { $from, empty } = selection;\n\t\t\t\tif (!empty || $from.parent.type !== this.type) return false;\n\t\t\t\tconst isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;\n\t\t\t\tconst endsWithDoubleNewline = $from.parent.textContent.endsWith(\"\\n\\n\");\n\t\t\t\tif (!isAtEnd || !endsWithDoubleNewline) return false;\n\t\t\t\treturn editor.chain().command(({ tr }) => {\n\t\t\t\t\ttr.delete($from.pos - 2, $from.pos);\n\t\t\t\t\treturn true;\n\t\t\t\t}).exitCode().run();\n\t\t\t},\n\t\t\tArrowUp: ({ editor }) => {\n\t\t\t\tif (!this.options.exitOnArrowUp) return false;\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { selection } = state;\n\t\t\t\tconst { $from, empty } = selection;\n\t\t\t\tif (!empty || $from.parent.type !== this.type) return false;\n\t\t\t\tif ($from.parentOffset !== 0) return false;\n\t\t\t\tconst before = $from.before();\n\t\t\t\tif (before > 0) return false;\n\t\t\t\treturn editor.commands.insertDefaultBlock({ pos: before });\n\t\t\t},\n\t\t\tArrowDown: ({ editor }) => {\n\t\t\t\tif (!this.options.exitOnArrowDown) return false;\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst { selection, doc } = state;\n\t\t\t\tconst { $from, empty } = selection;\n\t\t\t\tif (!empty || $from.parent.type !== this.type) return false;\n\t\t\t\tif (!($from.parentOffset === $from.parent.nodeSize - 2)) return false;\n\t\t\t\tconst after = $from.after();\n\t\t\t\tif (after === void 0) return false;\n\t\t\t\tif (doc.nodeAt(after)) return editor.commands.command(({ tr }) => {\n\t\t\t\t\ttr.setSelection(Selection.near(doc.resolve(after)));\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t\treturn editor.commands.exitCode();\n\t\t\t}\n\t\t};\n\t},\n\taddInputRules() {\n\t\treturn [textblockTypeInputRule({\n\t\t\tfind: backtickInputRegex,\n\t\t\ttype: this.type,\n\t\t\tgetAttributes: (match) => ({ language: match[1] })\n\t\t}), textblockTypeInputRule({\n\t\t\tfind: tildeInputRegex,\n\t\t\ttype: this.type,\n\t\t\tgetAttributes: (match) => ({ language: match[1] })\n\t\t})];\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"codeBlockVSCodeHandler\"),\n\t\t\tprops: { handlePaste: (view, event) => {\n\t\t\t\tif (!event.clipboardData) return false;\n\t\t\t\tif (this.editor.isActive(this.type.name)) return false;\n\t\t\t\tconst text = event.clipboardData.getData(\"text/plain\");\n\t\t\t\tconst vscode = event.clipboardData.getData(\"vscode-editor-data\");\n\t\t\t\tconst vscodeData = vscode ? JSON.parse(vscode) : void 0;\n\t\t\t\tconst language = vscodeData === null || vscodeData === void 0 ? void 0 : vscodeData.mode;\n\t\t\t\tif (!text || !language) return false;\n\t\t\t\tconst { tr, schema } = view.state;\n\t\t\t\tconst textNode = schema.text(text.replace(/\\r\\n?/g, \"\\n\"));\n\t\t\t\ttr.replaceSelectionWith(this.type.create({ language }, textNode));\n\t\t\t\tif (tr.selection.$from.parent.type !== this.type) tr.setSelection(TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2))));\n\t\t\t\ttr.setMeta(\"paste\", true);\n\t\t\t\tview.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t} }\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = CodeBlock;\n//#endregion\nexport { CodeBlock, backtickInputRegex, src_default as default, tildeInputRegex };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;AAGA,IAAMA,IAAmB,GAInBC,IAAqB,wBAIrBC,IAAkB,wBAKlBC,IAAYC,EAAK,OAAO;CAC7B,MAAM;CACN,aAAa;EACZ,OAAO;GACN,qBAAqB;GACrB,mBAAmB;GACnB,iBAAiB;GACjB,eAAe;GACf,iBAAiB;GACjB,sBAAsB;GACtB,SAASJ;GACT,gBAAgB,CAAC;EAClB;CACD;CACA,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,UAAU;CACV,gBAAgB;EACf,OAAO,EAAE,UAAU;GAClB,SAAS,KAAK,QAAQ;GACtB,YA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0 @@
|
|
|
1
|
-
import { Node as e } from "../../core/dist/index.js";
|
|
2
|
-
// node_modules/@tiptap/extension-document/dist/index.js
|
|
3
|
-
var t = e.create({
|
|
4
|
-
name: "doc",
|
|
5
|
-
topNode: !0,
|
|
6
|
-
content: "block+",
|
|
7
|
-
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
|
|
8
|
-
});
|
|
9
|
-
export { t as Document };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Document","Node","node","h"],"sources":["../../../../../node_modules/@tiptap/extension-document/dist/index.js"],"sourcesContent":["import { Node } from \"@tiptap/core\";\n//#region src/document.ts\n/**\n* The default document node which represents the top level node of the editor.\n* @see https://tiptap.dev/api/nodes/document\n*/\nconst Document = Node.create({\n\tname: \"doc\",\n\ttopNode: true,\n\tcontent: \"block+\",\n\trenderMarkdown: (node, h) => {\n\t\tif (!node.content) return \"\";\n\t\treturn h.renderChildren(node.content, \"\\n\\n\");\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = Document;\n//#endregion\nexport { Document, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAMA,IAAMA,IAAWC,EAAK,OAAO;CAC5B,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB,GAAM,MACjBC,EAAK,UACHC,EAAE,eAAeD,EAAK,SAAS,MAAM,IADlB;AAG5B,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Node as e, mergeAttributes as t } from "../../core/dist/index.js";
|
|
2
|
-
// node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
3
|
-
var n = e.create({
|
|
4
|
-
name: "hardBreak",
|
|
5
|
-
markdownTokenName: "br",
|
|
6
|
-
addOptions() {
|
|
7
|
-
return {
|
|
8
|
-
keepMarks: !0,
|
|
9
|
-
HTMLAttributes: {}
|
|
10
|
-
};
|
|
11
|
-
},
|
|
12
|
-
inline: !0,
|
|
13
|
-
group: "inline",
|
|
14
|
-
selectable: !1,
|
|
15
|
-
linebreakReplacement: !0,
|
|
16
|
-
parseHTML() {
|
|
17
|
-
return [{ tag: "br" }];
|
|
18
|
-
},
|
|
19
|
-
renderHTML({ HTMLAttributes: e }) {
|
|
20
|
-
return ["br", t(this.options.HTMLAttributes, e)];
|
|
21
|
-
},
|
|
22
|
-
renderText() {
|
|
23
|
-
return "\n";
|
|
24
|
-
},
|
|
25
|
-
renderMarkdown: () => " \n",
|
|
26
|
-
parseMarkdown: () => ({ type: "hardBreak" }),
|
|
27
|
-
addCommands() {
|
|
28
|
-
return { setHardBreak: () => ({ commands: e, chain: t, state: n, editor: r }) => e.first([() => e.exitCode(), () => e.command(() => {
|
|
29
|
-
let { selection: e, storedMarks: i } = n;
|
|
30
|
-
if (e.$from.parent.type.spec.isolating) return !1;
|
|
31
|
-
let { keepMarks: a } = this.options, { splittableMarks: o } = r.extensionManager, s = i || e.$to.parentOffset && e.$from.marks();
|
|
32
|
-
return t().insertContent({ type: this.name }).command(({ tr: e, dispatch: t }) => {
|
|
33
|
-
if (t && s && a) {
|
|
34
|
-
let t = s.filter((e) => o.includes(e.type.name));
|
|
35
|
-
e.ensureMarks(t);
|
|
36
|
-
}
|
|
37
|
-
return !0;
|
|
38
|
-
}).scrollIntoView().run();
|
|
39
|
-
})]) };
|
|
40
|
-
},
|
|
41
|
-
addKeyboardShortcuts() {
|
|
42
|
-
return {
|
|
43
|
-
"Mod-Enter": () => this.editor.commands.setHardBreak(),
|
|
44
|
-
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export { n as HardBreak };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HardBreak","Node","mergeAttributes","HTMLAttributes","commands","state","selection","editor","marks","storedMarks","chain","dispatch","keepMarks","filteredMarks","splittableMarks","mark"],"sources":["../../../../../node_modules/@tiptap/extension-hard-break/dist/index.js"],"sourcesContent":["import { Node, mergeAttributes } from \"@tiptap/core\";\n//#region src/hard-break.ts\n/**\n* This extension allows you to insert hard breaks.\n* @see https://www.tiptap.dev/api/nodes/hard-break\n*/\nconst HardBreak = Node.create({\n\tname: \"hardBreak\",\n\tmarkdownTokenName: \"br\",\n\taddOptions() {\n\t\treturn {\n\t\t\tkeepMarks: true,\n\t\t\tHTMLAttributes: {}\n\t\t};\n\t},\n\tinline: true,\n\tgroup: \"inline\",\n\tselectable: false,\n\tlinebreakReplacement: true,\n\tparseHTML() {\n\t\treturn [{ tag: \"br\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\"br\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n\t},\n\trenderText() {\n\t\treturn \"\\n\";\n\t},\n\trenderMarkdown: () => ` \\n`,\n\tparseMarkdown: () => {\n\t\treturn { type: \"hardBreak\" };\n\t},\n\taddCommands() {\n\t\treturn { setHardBreak: () => ({ commands, chain, state, editor }) => {\n\t\t\treturn commands.first([() => commands.exitCode(), () => commands.command(() => {\n\t\t\t\tconst { selection, storedMarks } = state;\n\t\t\t\tif (selection.$from.parent.type.spec.isolating) return false;\n\t\t\t\tconst { keepMarks } = this.options;\n\t\t\t\tconst { splittableMarks } = editor.extensionManager;\n\t\t\t\tconst marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();\n\t\t\t\treturn chain().insertContent({ type: this.name }).command(({ tr, dispatch }) => {\n\t\t\t\t\tif (dispatch && marks && keepMarks) {\n\t\t\t\t\t\tconst filteredMarks = marks.filter((mark) => splittableMarks.includes(mark.type.name));\n\t\t\t\t\t\ttr.ensureMarks(filteredMarks);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}).scrollIntoView().run();\n\t\t\t})]);\n\t\t} };\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-Enter\": () => this.editor.commands.setHardBreak(),\n\t\t\t\"Shift-Enter\": () => this.editor.commands.setHardBreak()\n\t\t};\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = HardBreak;\n//#endregion\nexport { HardBreak, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAMA,IAAMA,IAAYC,EAAK,OAAO;CAC7B,MAAM;CACN,mBAAmB;CACnB,aAAa;EACZ,OAAO;GACN,WAAW;GACX,gBAAgB,CAAC;EAClB;CACD;CACA,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,sBAAsB;CACtB,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,aAAa;EACZ,OAAO;CACR;CACA,sBAAsB;CACtB,sBACQ,EAAE,MAAM,YAAY;CAE5B,cAAc;EACb,OAAO,EAAE,qBAAqB,EAAE,aAAU,UAAO,UAAO,gBAChDC,EAAS,MAAM,OAAOA,EAAS,SAAS,SAASA,EAAS,cAAc;GAC9E,IAAM,EAAE,cAAW,mBAAgBC;GACnC,IAAIC,EAAU,MAAM,OAAO,KAAK,KAAK,WAAW,OAAO;GACvD,IAAM,EAAE,iBAAc,KAAK,SACrB,EAAE,uBAAoBC,EAAO,kBAC7BC,IAAQC,KAAeH,EAAU,IAAI,gBAAgBA,EAAU,MAAM,MAAM;GACjF,OAAOI,EAAM,CAAC,CAAC,cAAc,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,OAAI,kBAAe;IAC/E,IAAIC,KAAYH,KAASI,GAAW;KACnC,IAAMC,IAAgBL,EAAM,QAAQ,MAASM,EAAgB,SAASC,EAAK,KAAK,IAAI,CAAC;KACrF,EAAG,YAAYF,CAAa;IAC7B;IACA,OAA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