zt-react-milkdown 0.1.0
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/README.md +149 -0
- package/dist/commands-CDrea4WB.cjs +1 -0
- package/dist/commands-DoqeX5uJ.js +36 -0
- package/dist/debounce-Bqj_3iJs.cjs +1 -0
- package/dist/debounce-Cuk3VGPr.js +118 -0
- package/dist/dist-BCCSKc3M.cjs +5 -0
- package/dist/dist-C0PSMrs7.cjs +37 -0
- package/dist/dist-CPVooDwj.cjs +2 -0
- package/dist/dist-CxZn1qUo.js +1584 -0
- package/dist/dist-Cxaq2crg.js +409 -0
- package/dist/dist-DaM7GJv6.js +3499 -0
- package/dist/dist-Dhukmh4L.js +7562 -0
- package/dist/dist-mOpTMw1E.cjs +1 -0
- package/dist/floating-ui.dom-CKbcbmJV.js +883 -0
- package/dist/floating-ui.dom-VaZZ2gzS.cjs +1 -0
- package/dist/index.browser-5LtNN9G9.cjs +1 -0
- package/dist/index.browser-D2DmEB8o.js +26 -0
- package/dist/index.cjs +393 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +43325 -0
- package/dist/lib-38nxOnTd.cjs +4 -0
- package/dist/lib-8Tr6mAln.cjs +1 -0
- package/dist/lib-B0rHJ9lJ.js +28 -0
- package/dist/lib-BJgvZywM.cjs +3 -0
- package/dist/lib-BNOSyYeU.cjs +3 -0
- package/dist/lib-C5AzmhNY.cjs +5 -0
- package/dist/lib-C8xOD1Bp.cjs +1 -0
- package/dist/lib-CCUU16r8.js +1081 -0
- package/dist/lib-CK9MEMX-.js +73 -0
- package/dist/lib-D4HMdvmK.cjs +1 -0
- package/dist/lib-DWZA8C0h.cjs +1 -0
- package/dist/lib-Dbe-cVjv.js +367 -0
- package/dist/lib-DkE7Uq2b.js +1886 -0
- package/dist/lib-DzK_kn7a.js +21 -0
- package/dist/lib-IahjxPWM.cjs +3 -0
- package/dist/lib-m8lKZKxK.js +80 -0
- package/dist/lib-r5eNG0sa.js +754 -0
- package/dist/lib-wmHesNI0.js +2223 -0
- package/dist/rolldown-runtime-CerMd-t8.cjs +1 -0
- package/dist/rolldown-runtime-DnwLefa7.js +23 -0
- package/dist/schema-list-DSdBEAWW.js +171 -0
- package/dist/schema-list-bL8FNes5.cjs +1 -0
- package/dist/src/components/ui/button.d.ts +16 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +36 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/popover.d.ts +14 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/core/commands.d.ts +7 -0
- package/dist/src/core/commands.d.ts.map +1 -0
- package/dist/src/core/createEditor.d.ts +6 -0
- package/dist/src/core/createEditor.d.ts.map +1 -0
- package/dist/src/core/schema.d.ts +8 -0
- package/dist/src/core/schema.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/editor-overlay-position.d.ts +83 -0
- package/dist/src/lib/editor-overlay-position.d.ts.map +1 -0
- package/dist/src/lib/global-scroll-listener.d.ts +9 -0
- package/dist/src/lib/global-scroll-listener.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +6 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/local/en-US.d.ts +6 -0
- package/dist/src/local/en-US.d.ts.map +1 -0
- package/dist/src/local/i18n.d.ts +10 -0
- package/dist/src/local/i18n.d.ts.map +1 -0
- package/dist/src/local/zh-CN.d.ts +6 -0
- package/dist/src/local/zh-CN.d.ts.map +1 -0
- package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts +5 -0
- package/dist/src/plugins/custom/blockquote/blockquote-backspace-lift.d.ts.map +1 -0
- package/dist/src/plugins/custom/blockquote/index.d.ts +3 -0
- package/dist/src/plugins/custom/blockquote/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-editable.d.ts +7 -0
- package/dist/src/plugins/custom/code-block/code-block-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts +7 -0
- package/dist/src/plugins/custom/code-block/code-block-language-picker.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts +5 -0
- package/dist/src/plugins/custom/code-block/code-block-mod-a-select.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts +5 -0
- package/dist/src/plugins/custom/code-block/code-block-prism.d.ts.map +1 -0
- package/dist/src/plugins/custom/code-block/index.d.ts +9 -0
- package/dist/src/plugins/custom/code-block/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/drop-cursor.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/drop-cursor.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/gap-cursor.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/gap-cursor.d.ts.map +1 -0
- package/dist/src/plugins/custom/cursor/index.d.ts +5 -0
- package/dist/src/plugins/custom/cursor/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-editable.d.ts +7 -0
- package/dist/src/plugins/custom/image/image-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-resizable-schema.d.ts +41 -0
- package/dist/src/plugins/custom/image/image-resizable-schema.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts +31 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/ImageUploadDialog.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts +20 -0
- package/dist/src/plugins/custom/image/image-upload-dialog/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/image/index.d.ts +7 -0
- package/dist/src/plugins/custom/image/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/indent/index.d.ts +3 -0
- package/dist/src/plugins/custom/indent/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/indent/tab-space-indent.d.ts +5 -0
- package/dist/src/plugins/custom/indent/tab-space-indent.d.ts.map +1 -0
- package/dist/src/plugins/custom/list/index.d.ts +3 -0
- package/dist/src/plugins/custom/list/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/list/task-list-toggle.d.ts +5 -0
- package/dist/src/plugins/custom/list/task-list-toggle.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/index.d.ts +7 -0
- package/dist/src/plugins/custom/math/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-backspace-entry.d.ts +5 -0
- package/dist/src/plugins/custom/math/math-backspace-entry.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-block-editable.d.ts +7 -0
- package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-plugin.d.ts +47 -0
- package/dist/src/plugins/custom/math/math-plugin.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts +7 -0
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts +7 -0
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts +25 -0
- package/dist/src/plugins/custom/selection-tooltip/mark-logic.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +21 -0
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -0
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts +58 -0
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/index.d.ts +9 -0
- package/dist/src/plugins/custom/slash-menu/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts +6 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts +23 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts +50 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts.map +1 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts +15 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/index.d.ts +13 -0
- package/dist/src/plugins/custom/table/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-arrow-entry.d.ts +5 -0
- package/dist/src/plugins/custom/table/table-arrow-entry.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-deletion-actions.d.ts +10 -0
- package/dist/src/plugins/custom/table/table-deletion-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts +7 -0
- package/dist/src/plugins/custom/table/table-focus-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-more-actions.d.ts +37 -0
- package/dist/src/plugins/custom/table/table-more-actions.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-row-insertion.d.ts +35 -0
- package/dist/src/plugins/custom/table/table-row-insertion.d.ts.map +1 -0
- package/dist/src/plugins/custom/table/table-selection.d.ts +30 -0
- package/dist/src/plugins/custom/table/table-selection.d.ts.map +1 -0
- package/dist/src/plugins/preset-common.d.ts +56 -0
- package/dist/src/plugins/preset-common.d.ts.map +1 -0
- package/dist/src/react/components/MilkdownEditor.d.ts +7 -0
- package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -0
- package/dist/src/react/components/index.d.ts +2 -0
- package/dist/src/react/components/index.d.ts.map +1 -0
- package/dist/src/react/context/EditorContext.d.ts +16 -0
- package/dist/src/react/context/EditorContext.d.ts.map +1 -0
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts +5 -0
- package/dist/src/react/hooks/useCloseOnGlobalScroll.d.ts.map +1 -0
- package/dist/src/react/hooks/useControlledState.d.ts +9 -0
- package/dist/src/react/hooks/useControlledState.d.ts.map +1 -0
- package/dist/src/react/hooks/useMilkdownEditor.d.ts +35 -0
- package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -0
- package/dist/src/types/editor.d.ts +233 -0
- package/dist/src/types/editor.d.ts.map +1 -0
- package/dist/src/types/plugin.d.ts +10 -0
- package/dist/src/types/plugin.d.ts.map +1 -0
- package/dist/src/utils/guard.d.ts +5 -0
- package/dist/src/utils/guard.d.ts.map +1 -0
- package/dist/src/utils/markdown.d.ts +9 -0
- package/dist/src/utils/markdown.d.ts.map +1 -0
- package/dist/state-CHAiIqOA.cjs +1 -0
- package/dist/state-DNxqltZl.js +16 -0
- package/dist/style.css +3 -0
- package/package.json +89 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { l as i, s as n, u as r, o as t };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-DnwLefa7.js";
|
|
2
|
+
import { C as t, E as n, _ as r, d as i, h as a, k as o, m as s, o as c, y as l } from "./dist-DaM7GJv6.js";
|
|
3
|
+
//#region node_modules/.pnpm/prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js
|
|
4
|
+
var u = ["ol", 0], d = ["ul", 0], f = ["li", 0], p = {
|
|
5
|
+
attrs: { order: {
|
|
6
|
+
default: 1,
|
|
7
|
+
validate: "number"
|
|
8
|
+
} },
|
|
9
|
+
parseDOM: [{
|
|
10
|
+
tag: "ol",
|
|
11
|
+
getAttrs(e) {
|
|
12
|
+
return { order: e.hasAttribute("start") ? +e.getAttribute("start") : 1 };
|
|
13
|
+
}
|
|
14
|
+
}],
|
|
15
|
+
toDOM(e) {
|
|
16
|
+
return e.attrs.order == 1 ? u : [
|
|
17
|
+
"ol",
|
|
18
|
+
{ start: e.attrs.order },
|
|
19
|
+
0
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}, m = {
|
|
23
|
+
parseDOM: [{ tag: "ul" }],
|
|
24
|
+
toDOM() {
|
|
25
|
+
return d;
|
|
26
|
+
}
|
|
27
|
+
}, h = {
|
|
28
|
+
parseDOM: [{ tag: "li" }],
|
|
29
|
+
toDOM() {
|
|
30
|
+
return f;
|
|
31
|
+
},
|
|
32
|
+
defining: !0
|
|
33
|
+
};
|
|
34
|
+
function g(e, t) {
|
|
35
|
+
let n = {};
|
|
36
|
+
for (let t in e) n[t] = e[t];
|
|
37
|
+
for (let e in t) n[e] = t[e];
|
|
38
|
+
return n;
|
|
39
|
+
}
|
|
40
|
+
function _(e, t, n) {
|
|
41
|
+
return e.append({
|
|
42
|
+
ordered_list: g(p, {
|
|
43
|
+
content: "list_item+",
|
|
44
|
+
group: n
|
|
45
|
+
}),
|
|
46
|
+
bullet_list: g(m, {
|
|
47
|
+
content: "list_item+",
|
|
48
|
+
group: n
|
|
49
|
+
}),
|
|
50
|
+
list_item: g(h, { content: t })
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function v(e, t = null) {
|
|
54
|
+
return function(n, r) {
|
|
55
|
+
let { $from: i, $to: a } = n.selection, o = i.blockRange(a);
|
|
56
|
+
if (!o) return !1;
|
|
57
|
+
let s = r ? n.tr : null;
|
|
58
|
+
return y(s, o, e, t) ? (r && r(s.scrollIntoView()), !0) : !1;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function y(e, t, i, a = null) {
|
|
62
|
+
let o = !1, s = t, c = t.$from.doc;
|
|
63
|
+
if (t.depth >= 2 && t.$from.node(t.depth - 1).type.compatibleContent(i) && t.startIndex == 0) {
|
|
64
|
+
if (t.$from.index(t.depth - 1) == 0) return !1;
|
|
65
|
+
let e = c.resolve(t.start - 2);
|
|
66
|
+
s = new n(e, e, t.depth), t.endIndex < t.parent.childCount && (t = new n(t.$from, c.resolve(t.$to.end(t.depth)), t.depth)), o = !0;
|
|
67
|
+
}
|
|
68
|
+
let l = r(s, i, a, t);
|
|
69
|
+
return l ? (e && b(e, t, l, o, i), !0) : !1;
|
|
70
|
+
}
|
|
71
|
+
function b(e, n, r, s, c) {
|
|
72
|
+
let l = t.empty;
|
|
73
|
+
for (let e = r.length - 1; e >= 0; e--) l = t.from(r[e].type.create(r[e].attrs, l));
|
|
74
|
+
e.step(new i(n.start - (s ? 2 : 0), n.end, n.start, n.end, new o(l, 0, 0), r.length, !0));
|
|
75
|
+
let u = 0;
|
|
76
|
+
for (let e = 0; e < r.length; e++) r[e].type == c && (u = e + 1);
|
|
77
|
+
let d = r.length - u, f = n.start + r.length - (s ? 2 : 0), p = n.parent;
|
|
78
|
+
for (let t = n.startIndex, r = n.endIndex, i = !0; t < r; t++, i = !1) !i && a(e.doc, f, d) && (e.split(f, d), f += 2 * d), f += p.child(t).nodeSize;
|
|
79
|
+
return e;
|
|
80
|
+
}
|
|
81
|
+
function x(e, n) {
|
|
82
|
+
return function(r, i) {
|
|
83
|
+
let { $from: s, $to: l, node: u } = r.selection;
|
|
84
|
+
if (u && u.isBlock || s.depth < 2 || !s.sameParent(l)) return !1;
|
|
85
|
+
let d = s.node(-1);
|
|
86
|
+
if (d.type != e) return !1;
|
|
87
|
+
if (s.parent.content.size == 0 && s.node(-1).childCount == s.indexAfter(-1)) {
|
|
88
|
+
if (s.depth == 3 || s.node(-3).type != e || s.index(-2) != s.node(-2).childCount - 1) return !1;
|
|
89
|
+
if (i) {
|
|
90
|
+
let n = t.empty, a = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
|
|
91
|
+
for (let e = s.depth - a; e >= s.depth - 3; e--) n = t.from(s.node(e).copy(n));
|
|
92
|
+
let l = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
|
|
93
|
+
n = n.append(t.from(e.createAndFill()));
|
|
94
|
+
let u = s.before(s.depth - (a - 1)), d = r.tr.replace(u, s.after(-l), new o(n, 4 - a, 0)), f = -1;
|
|
95
|
+
d.doc.nodesBetween(u, d.doc.content.size, (e, t) => {
|
|
96
|
+
if (f > -1) return !1;
|
|
97
|
+
e.isTextblock && e.content.size == 0 && (f = t + 1);
|
|
98
|
+
}), f > -1 && d.setSelection(c.near(d.doc.resolve(f))), i(d.scrollIntoView());
|
|
99
|
+
}
|
|
100
|
+
return !0;
|
|
101
|
+
}
|
|
102
|
+
let f = l.pos == s.end() ? d.contentMatchAt(0).defaultType : null, p = r.tr.delete(s.pos, l.pos), m = f ? [n ? {
|
|
103
|
+
type: e,
|
|
104
|
+
attrs: n
|
|
105
|
+
} : null, { type: f }] : void 0;
|
|
106
|
+
return a(p.doc, s.pos, 2, m) ? (i && i(p.split(s.pos, 2, m).scrollIntoView()), !0) : !1;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function S(e, t) {
|
|
110
|
+
let n = x(e, t);
|
|
111
|
+
return (e, t) => n(e, t && ((n) => {
|
|
112
|
+
let r = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
113
|
+
r && n.ensureMarks(r), t(n);
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
function C(e) {
|
|
117
|
+
return function(t, n) {
|
|
118
|
+
let { $from: r, $to: i } = t.selection, a = r.blockRange(i, (t) => t.childCount > 0 && t.firstChild.type == e);
|
|
119
|
+
return a ? n ? r.node(a.depth - 1).type == e ? w(t, n, e, a) : T(t, n, a) : !0 : !1;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function w(e, r, a, c) {
|
|
123
|
+
let u = e.tr, d = c.end, f = c.$to.end(c.depth);
|
|
124
|
+
d < f && (u.step(new i(d - 1, f, d, f, new o(t.from(a.create(null, c.parent.copy())), 1, 0), 1, !0)), c = new n(u.doc.resolve(c.$from.pos), u.doc.resolve(f), c.depth));
|
|
125
|
+
let p = l(c);
|
|
126
|
+
if (p == null) return !1;
|
|
127
|
+
u.lift(c, p);
|
|
128
|
+
let m = u.doc.resolve(u.mapping.map(d, -1) - 1);
|
|
129
|
+
return s(u.doc, m.pos) && m.nodeBefore.type == m.nodeAfter.type && u.join(m.pos), r(u.scrollIntoView()), !0;
|
|
130
|
+
}
|
|
131
|
+
function T(e, n, r) {
|
|
132
|
+
let a = e.tr, s = r.parent;
|
|
133
|
+
for (let e = r.end, t = r.endIndex - 1, n = r.startIndex; t > n; t--) e -= s.child(t).nodeSize, a.delete(e - 1, e + 1);
|
|
134
|
+
let c = a.doc.resolve(r.start), l = c.nodeAfter;
|
|
135
|
+
if (a.mapping.map(r.end) != r.start + c.nodeAfter.nodeSize) return !1;
|
|
136
|
+
let u = r.startIndex == 0, d = r.endIndex == s.childCount, f = c.node(-1), p = c.index(-1);
|
|
137
|
+
if (!f.canReplace(p + +!u, p + 1, l.content.append(d ? t.empty : t.from(s)))) return !1;
|
|
138
|
+
let m = c.pos, h = m + l.nodeSize;
|
|
139
|
+
return a.step(new i(m - +!!u, h + +!!d, m + 1, h - 1, new o((u ? t.empty : t.from(s.copy(t.empty))).append(d ? t.empty : t.from(s.copy(t.empty))), +!u, +!d), +!u)), n(a.scrollIntoView()), !0;
|
|
140
|
+
}
|
|
141
|
+
function E(e) {
|
|
142
|
+
return function(n, r) {
|
|
143
|
+
let { $from: a, $to: s } = n.selection, c = a.blockRange(s, (t) => t.childCount > 0 && t.firstChild.type == e);
|
|
144
|
+
if (!c) return !1;
|
|
145
|
+
let l = c.startIndex;
|
|
146
|
+
if (l == 0) return !1;
|
|
147
|
+
let u = c.parent, d = u.child(l - 1);
|
|
148
|
+
if (d.type != e) return !1;
|
|
149
|
+
if (r) {
|
|
150
|
+
let a = d.lastChild && d.lastChild.type == u.type, s = t.from(a ? e.create() : null), l = new o(t.from(e.create(null, t.from(u.type.create(null, s)))), a ? 3 : 1, 0), f = c.start, p = c.end;
|
|
151
|
+
r(n.tr.step(new i(f - (a ? 3 : 1), p, f, p, l, 1, !0)).scrollIntoView());
|
|
152
|
+
}
|
|
153
|
+
return !0;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region node_modules/.pnpm/@milkdown+prose@7.20.0/node_modules/@milkdown/prose/lib/schema-list.js
|
|
158
|
+
var D = /* @__PURE__ */ e({
|
|
159
|
+
addListNodes: () => _,
|
|
160
|
+
bulletList: () => m,
|
|
161
|
+
liftListItem: () => C,
|
|
162
|
+
listItem: () => h,
|
|
163
|
+
orderedList: () => p,
|
|
164
|
+
sinkListItem: () => E,
|
|
165
|
+
splitListItem: () => x,
|
|
166
|
+
splitListItemKeepMarks: () => S,
|
|
167
|
+
wrapInList: () => v,
|
|
168
|
+
wrapRangeInList: () => y
|
|
169
|
+
});
|
|
170
|
+
//#endregion
|
|
171
|
+
export { x as i, C as n, E as r, D as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./rolldown-runtime-CerMd-t8.cjs`),t=require(`./dist-BCCSKc3M.cjs`);var n=[`ol`,0],r=[`ul`,0],i=[`li`,0],a={attrs:{order:{default:1,validate:`number`}},parseDOM:[{tag:`ol`,getAttrs(e){return{order:e.hasAttribute(`start`)?+e.getAttribute(`start`):1}}}],toDOM(e){return e.attrs.order==1?n:[`ol`,{start:e.attrs.order},0]}},o={parseDOM:[{tag:`ul`}],toDOM(){return r}},s={parseDOM:[{tag:`li`}],toDOM(){return i},defining:!0};function c(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)n[e]=t[e];return n}function l(e,t,n){return e.append({ordered_list:c(a,{content:`list_item+`,group:n}),bullet_list:c(o,{content:`list_item+`,group:n}),list_item:c(s,{content:t})})}function u(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return d(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function d(e,n,r,i=null){let a=!1,o=n,s=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(r)&&n.startIndex==0){if(n.$from.index(n.depth-1)==0)return!1;let e=s.resolve(n.start-2);o=new t.E(e,e,n.depth),n.endIndex<n.parent.childCount&&(n=new t.E(n.$from,s.resolve(n.$to.end(n.depth)),n.depth)),a=!0}let c=t._(o,r,i,n);return c?(e&&f(e,n,c,a,r),!0):!1}function f(e,n,r,i,a){let o=t.C.empty;for(let e=r.length-1;e>=0;e--)o=t.C.from(r[e].type.create(r[e].attrs,o));e.step(new t.d(n.start-(i?2:0),n.end,n.start,n.end,new t.k(o,0,0),r.length,!0));let s=0;for(let e=0;e<r.length;e++)r[e].type==a&&(s=e+1);let c=r.length-s,l=n.start+r.length-(i?2:0),u=n.parent;for(let r=n.startIndex,i=n.endIndex,a=!0;r<i;r++,a=!1)!a&&t.h(e.doc,l,c)&&(e.split(l,c),l+=2*c),l+=u.child(r).nodeSize;return e}function p(e,n){return function(r,i){let{$from:a,$to:o,node:s}=r.selection;if(s&&s.isBlock||a.depth<2||!a.sameParent(o))return!1;let c=a.node(-1);if(c.type!=e)return!1;if(a.parent.content.size==0&&a.node(-1).childCount==a.indexAfter(-1)){if(a.depth==3||a.node(-3).type!=e||a.index(-2)!=a.node(-2).childCount-1)return!1;if(i){let n=t.C.empty,o=a.index(-1)?1:a.index(-2)?2:3;for(let e=a.depth-o;e>=a.depth-3;e--)n=t.C.from(a.node(e).copy(n));let s=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3;n=n.append(t.C.from(e.createAndFill()));let c=a.before(a.depth-(o-1)),l=r.tr.replace(c,a.after(-s),new t.k(n,4-o,0)),u=-1;l.doc.nodesBetween(c,l.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size==0&&(u=t+1)}),u>-1&&l.setSelection(t.o.near(l.doc.resolve(u))),i(l.scrollIntoView())}return!0}let l=o.pos==a.end()?c.contentMatchAt(0).defaultType:null,u=r.tr.delete(a.pos,o.pos),d=l?[n?{type:e,attrs:n}:null,{type:l}]:void 0;return t.h(u.doc,a.pos,2,d)?(i&&i(u.split(a.pos,2,d).scrollIntoView()),!0):!1}}function m(e,t){let n=p(e,t);return(e,t)=>n(e,t&&(n=>{let r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)}))}function h(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?g(t,n,e,a):_(t,n,a):!0:!1}}function g(e,n,r,i){let a=e.tr,o=i.end,s=i.$to.end(i.depth);o<s&&(a.step(new t.d(o-1,s,o,s,new t.k(t.C.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new t.E(a.doc.resolve(i.$from.pos),a.doc.resolve(s),i.depth));let c=t.y(i);if(c==null)return!1;a.lift(i,c);let l=a.doc.resolve(a.mapping.map(o,-1)-1);return t.m(a.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&a.join(l.pos),n(a.scrollIntoView()),!0}function _(e,n,r){let i=e.tr,a=r.parent;for(let e=r.end,t=r.endIndex-1,n=r.startIndex;t>n;t--)e-=a.child(t).nodeSize,i.delete(e-1,e+1);let o=i.doc.resolve(r.start),s=o.nodeAfter;if(i.mapping.map(r.end)!=r.start+o.nodeAfter.nodeSize)return!1;let c=r.startIndex==0,l=r.endIndex==a.childCount,u=o.node(-1),d=o.index(-1);if(!u.canReplace(d+ +!c,d+1,s.content.append(l?t.C.empty:t.C.from(a))))return!1;let f=o.pos,p=f+s.nodeSize;return i.step(new t.d(f-+!!c,p+ +!!l,f+1,p-1,new t.k((c?t.C.empty:t.C.from(a.copy(t.C.empty))).append(l?t.C.empty:t.C.from(a.copy(t.C.empty))),+!c,+!l),+!c)),n(i.scrollIntoView()),!0}function v(e){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a,t=>t.childCount>0&&t.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let c=o.parent,l=c.child(s-1);if(l.type!=e)return!1;if(r){let i=l.lastChild&&l.lastChild.type==c.type,a=t.C.from(i?e.create():null),s=new t.k(t.C.from(e.create(null,t.C.from(c.type.create(null,a)))),i?3:1,0),u=o.start,d=o.end;r(n.tr.step(new t.d(u-(i?3:1),d,u,d,s,1,!0)).scrollIntoView())}return!0}}var y=e.n({addListNodes:()=>l,bulletList:()=>o,liftListItem:()=>h,listItem:()=>s,orderedList:()=>a,sinkListItem:()=>v,splitListItem:()=>p,splitListItemKeepMarks:()=>m,wrapInList:()=>u,wrapRangeInList:()=>d});Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
/**
|
|
8
|
+
* 定义按钮组件属性。
|
|
9
|
+
*/
|
|
10
|
+
type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
11
|
+
/** 是否将样式透传给子元素。 */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export { Button, buttonVariants };
|
|
16
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAA;AAED;;GAEG;AACH,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/C,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,mBAAmB;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAGH,QAAA,MAAM,MAAM,oGAyBX,CAAA;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* 渲染弹窗根节点。
|
|
5
|
+
*/
|
|
6
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
/**
|
|
9
|
+
* 渲染弹窗 Portal。
|
|
10
|
+
*/
|
|
11
|
+
declare function DialogPortal({ container, ...props }: React.ComponentProps<typeof DialogPrimitive.Portal> & {
|
|
12
|
+
/** 可选 Portal 容器,未提供时默认挂载到 body。 */
|
|
13
|
+
container?: HTMLElement | null;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const DialogClose: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
18
|
+
/** 是否展示默认关闭按钮。 */
|
|
19
|
+
showCloseButton?: boolean;
|
|
20
|
+
/** 可选 Portal 容器,未提供时默认挂载到 body。 */
|
|
21
|
+
container?: HTMLElement | null;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
/**
|
|
24
|
+
* 渲染弹窗头部。
|
|
25
|
+
*/
|
|
26
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* 渲染弹窗底部。
|
|
29
|
+
*/
|
|
30
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
34
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
35
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
36
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAMpD;;GAEG;AACH,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAGD,QAAA,MAAM,aAAa,oKAYlB,CAAA;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,GAAG;IACvD,mCAAmC;IACnC,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAC/B,2CAEA;AAGD,QAAA,MAAM,WAAW,kKAYhB,CAAA;AAGD,QAAA,MAAM,aAAa,8JAuBlB,CAAA;AAaD,QAAA,MAAM,aAAa;IAPjB,kBAAkB;sBACA,OAAO;IACzB,mCAAmC;gBACvB,WAAW,GAAG,IAAI;wCAgD/B,CAAA;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED;;GAEG;AACH,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,2CAkBA;AAGD,QAAA,MAAM,WAAW,oKAuBhB,CAAA;AAGD,QAAA,MAAM,iBAAiB,8KAuBtB,CAAA;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PopoverContent({ container, className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content> & {
|
|
6
|
+
/** 可选 Portal 容器,未提供时默认挂载到 body。 */
|
|
7
|
+
container?: HTMLElement | null;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
|
|
14
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAItD,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAEpD;AAED,iBAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAEvD;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,GAAG;IACzD,mCAAmC;IACnC,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAC/B,2CAeA;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,2CAEtD;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ1E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQxE;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAQ3B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,GACf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/core/commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,kBAAkB,OAAO,EACzB,QAAQ;IACN,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,KACA,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAQ7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEditor.d.ts","sourceRoot":"","sources":["../../../src/core/createEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAsB7E;;GAEG;AACH,eAAO,MAAM,YAAY,GAAU,SAAS,mBAAmB,KAAG,OAAO,CAAC,gBAAgB,CAsMzF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/core/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { MilkdownEditor } from './react/components/MilkdownEditor';
|
|
2
|
+
export type { EditorChangeHandler, EditorController, EditorI18nMessages, EditorLocale, EditorTheme, ImageUploadConfig, ImageUploadHandler, MilkdownEditorProps, CreateEditorOptions, SlashMenuCommand, SlashMenuConfig, SlashMenuItem } from './types/editor';
|
|
3
|
+
export type { EditorPluginDescriptor } from './types/plugin';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 编辑器浮层展开方向。
|
|
3
|
+
*/
|
|
4
|
+
export type OverlayPlacement = 'top' | 'bottom';
|
|
5
|
+
/**
|
|
6
|
+
* 浮层锚点在编辑器内容坐标系中的稳定坐标。
|
|
7
|
+
*/
|
|
8
|
+
export interface OverlayContentAnchor {
|
|
9
|
+
/** 锚点顶部(内容坐标)。 */
|
|
10
|
+
anchorTopInContent: number;
|
|
11
|
+
/** 锚点底部(内容坐标)。 */
|
|
12
|
+
anchorBottomInContent: number;
|
|
13
|
+
/** 锚点左侧(内容坐标)。 */
|
|
14
|
+
anchorLeftInContent: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 浮层视口坐标(用于 fixed 定位)。
|
|
18
|
+
*/
|
|
19
|
+
export interface OverlayViewportPosition {
|
|
20
|
+
/** 视口顶部坐标。 */
|
|
21
|
+
top: number;
|
|
22
|
+
/** 视口左侧坐标。 */
|
|
23
|
+
left: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 浮层 Portal 内坐标(用于 absolute 定位)。
|
|
27
|
+
*/
|
|
28
|
+
export interface OverlayPortalPosition {
|
|
29
|
+
/** Portal 内顶部坐标。 */
|
|
30
|
+
top: number;
|
|
31
|
+
/** Portal 内左侧坐标。 */
|
|
32
|
+
left: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 浮层换算配置。
|
|
36
|
+
*/
|
|
37
|
+
export interface OverlayPositionConfig {
|
|
38
|
+
/** 编辑器滚动容器。 */
|
|
39
|
+
wrapper: HTMLElement;
|
|
40
|
+
/** 内容坐标锚点。 */
|
|
41
|
+
anchor: OverlayContentAnchor;
|
|
42
|
+
/** 浮层尺寸。 */
|
|
43
|
+
overlaySize: {
|
|
44
|
+
width: number;
|
|
45
|
+
};
|
|
46
|
+
/** 展开方向。 */
|
|
47
|
+
placement: OverlayPlacement;
|
|
48
|
+
/** 主轴偏移。 */
|
|
49
|
+
offsetY: number;
|
|
50
|
+
/** 边界内边距。 */
|
|
51
|
+
boundaryInset: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 解析真实滚动容器:优先 zt-md-editor,兜底回退到编辑器根节点。
|
|
55
|
+
*/
|
|
56
|
+
export declare const resolveEditorWrapper: (viewDom: HTMLElement | null) => HTMLElement | null;
|
|
57
|
+
/**
|
|
58
|
+
* 根据当前光标视口矩形与阈值解析菜单展开方向。
|
|
59
|
+
*/
|
|
60
|
+
export declare const resolvePlacement: (anchorRect: DOMRect, threshold: number) => OverlayPlacement;
|
|
61
|
+
/**
|
|
62
|
+
* 将锚点矩形换算为编辑器内容坐标中的稳定锚点。
|
|
63
|
+
*/
|
|
64
|
+
export declare const toContentAnchor: (anchorRect: DOMRect, wrapper: HTMLElement) => OverlayContentAnchor;
|
|
65
|
+
/**
|
|
66
|
+
* 将内容坐标换算为视口 fixed 坐标。
|
|
67
|
+
*/
|
|
68
|
+
export declare const toViewportPosition: (config: OverlayPositionConfig) => OverlayViewportPosition;
|
|
69
|
+
/**
|
|
70
|
+
* 将内容坐标换算为编辑器 Portal 内 absolute 坐标。
|
|
71
|
+
*/
|
|
72
|
+
export declare const toPortalPosition: (config: OverlayPositionConfig, portalContainer: HTMLElement) => OverlayPortalPosition;
|
|
73
|
+
/**
|
|
74
|
+
* 创建浮层位置刷新调度器(RAF 节流 + 监听绑定/解绑)。
|
|
75
|
+
*/
|
|
76
|
+
export declare const createOverlayRepositionScheduler: (updateFn: () => void) => {
|
|
77
|
+
schedule: () => void;
|
|
78
|
+
bindGlobal: () => void;
|
|
79
|
+
unbindGlobal: () => void;
|
|
80
|
+
bindWrapper: (nextWrapper: HTMLElement | null) => void;
|
|
81
|
+
destroy: () => void;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=editor-overlay-position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-overlay-position.d.ts","sourceRoot":"","sources":["../../../src/lib/editor-overlay-position.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kBAAkB;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB;IAClB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe;IACf,OAAO,EAAE,WAAW,CAAC;IACrB,cAAc;IACd,MAAM,EAAE,oBAAoB,CAAC;IAC7B,YAAY;IACZ,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,YAAY;IACZ,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,WAAW,GAAG,IAAI,KAAG,WAAW,GAAG,IAMhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,YAAY,OAAO,EAAE,WAAW,MAAM,KAAG,gBASzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,OAAO,EAAE,SAAS,WAAW,KAAG,oBAQ3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,qBAAqB,KAAG,uBAkBlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,qBAAqB,EAAE,iBAAiB,WAAW,KAAG,qBAU9F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAAI,UAAU,MAAM,IAAI;oBAW9C,IAAI;sBAgBF,IAAI;wBAUF,IAAI;+BASK,WAAW,GAAG,IAAI,KAAG,IAAI;mBAgBvC,IAAI;CAgBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-scroll-listener.d.ts","sourceRoot":"","sources":["../../../src/lib/global-scroll-listener.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC;AAkD9C;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,oBAAoB,KAAG,CAAC,MAAM,IAAI,CAqBjF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../src/local/en-US.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,kBAsD1B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorI18nMessages, EditorLocale } from '../types/editor';
|
|
2
|
+
/**
|
|
3
|
+
* 编辑器默认语言。
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_EDITOR_LOCALE: EditorLocale;
|
|
6
|
+
/**
|
|
7
|
+
* 合并编辑器语言包与外部覆盖文案。
|
|
8
|
+
*/
|
|
9
|
+
export declare const resolveEditorMessages: (locale?: EditorLocale, messages?: Partial<EditorI18nMessages>, placeholder?: string) => EditorI18nMessages;
|
|
10
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/local/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAKxE;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAsB,CAAC;AA4C3D;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAQ,YAAoC,EAC5C,WAAW,OAAO,CAAC,kBAAkB,CAAC,EACtC,cAAc,MAAM,KACnB,kBAgBF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["../../../src/local/zh-CN.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,kBAsD1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockquote-backspace-lift.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/blockquote/blockquote-backspace-lift.ts"],"names":[],"mappings":"AA4FA;;GAEG;AACH,eAAO,MAAM,6BAA6B,kCAaxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/blockquote/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeViewConstructor } from '@milkdown/prose/view';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 创建 code_block 的 NodeView 构造器。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createCodeBlockEditableNodeView: (messages?: EditorI18nMessages) => NodeViewConstructor;
|
|
7
|
+
//# sourceMappingURL=code-block-editable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-editable.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/code-block/code-block-editable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAmQhE;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,WAAU,kBAA4C,KACrD,mBAaF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { $prose } from '@milkdown/utils';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 创建代码块语言选择器插件。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createCodeBlockLanguagePickerPlugin: (messages: EditorI18nMessages, portalContainer: HTMLElement) => ReturnType<typeof $prose>;
|
|
7
|
+
//# sourceMappingURL=code-block-language-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-language-picker.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/code-block/code-block-language-picker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AA6iBhE;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAC9C,UAAU,kBAAkB,EAC5B,iBAAiB,WAAW,KAC3B,UAAU,CAAC,OAAO,MAAM,CAO1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-mod-a-select.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/code-block/code-block-mod-a-select.ts"],"names":[],"mappings":"AA4EA;;GAEG;AACH,eAAO,MAAM,yBAAyB,kCAapC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-prism.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/code-block/code-block-prism.ts"],"names":[],"mappings":"AAuGA;;GAEG;AACH,eAAO,MAAM,oBAAoB,kCAsB/B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 代码块相关插件导出。 */
|
|
2
|
+
export * from './code-block-editable';
|
|
3
|
+
/** 代码块语言选择器插件导出。 */
|
|
4
|
+
export * from './code-block-language-picker';
|
|
5
|
+
/** 代码块内 Mod-A 全选插件导出。 */
|
|
6
|
+
export * from './code-block-mod-a-select';
|
|
7
|
+
/** 代码块 Prism 高亮插件导出。 */
|
|
8
|
+
export * from './code-block-prism';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/code-block/index.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,cAAc,uBAAuB,CAAC;AACtC,oBAAoB;AACpB,cAAc,8BAA8B,CAAC;AAC7C,yBAAyB;AACzB,cAAc,2BAA2B,CAAC;AAC1C,wBAAwB;AACxB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop-cursor.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/cursor/drop-cursor.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,gBAAgB,kCAK3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gap-cursor.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/cursor/gap-cursor.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,eAAe,kCAE1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/custom/cursor/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,cAAc,eAAe,CAAC;AAC9B,gBAAgB;AAChB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeViewConstructor } from '@milkdown/prose/view';
|
|
2
|
+
import { EditorI18nMessages } from '../../../types/editor';
|
|
3
|
+
/**
|
|
4
|
+
* 创建 image 的 NodeView 构造器。
|
|
5
|
+
*/
|
|
6
|
+
export declare const createImageEditableNodeView: (messages?: EditorI18nMessages) => NodeViewConstructor;
|
|
7
|
+
//# sourceMappingURL=image-editable.d.ts.map
|