zt-react-milkdown 0.1.0 → 0.1.2
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/{dist-Cxaq2crg.js → commands-BJpevWrH.js} +123 -123
- package/dist/commands-BmZHd6RL.js +2 -0
- package/dist/{dist-CPVooDwj.cjs → commands-CM7IuhpT.cjs} +2 -2
- package/dist/commands-f4yOm8DQ.cjs +1 -0
- package/dist/{debounce-Bqj_3iJs.cjs → debounce-C_TNzOFT.cjs} +1 -1
- package/dist/{dist-DaM7GJv6.js → dist-CLTsQjPD.js} +319 -318
- package/dist/{dist-CxZn1qUo.js → dist-CZTw9GLV.js} +198 -198
- package/dist/dist-DQnWlYyo.cjs +5 -0
- package/dist/dist-ZPtYoqTI.cjs +1 -0
- package/dist/floating-ui.dom-CV-TLBRq.cjs +1 -0
- package/dist/floating-ui.dom-CoOubeUs.js +762 -0
- package/dist/index.cjs +25 -149
- package/dist/index.mjs +6235 -15737
- package/dist/{lib-C8xOD1Bp.cjs → lib-5pUyY-Tl.cjs} +1 -1
- package/dist/{lib-DkE7Uq2b.js → lib-Bhr5EVOu.js} +110 -112
- package/dist/lib-BmAQCwSQ.cjs +1 -0
- package/dist/{lib-wmHesNI0.js → lib-C1A-pN4b.js} +574 -575
- package/dist/lib-CVebEyb8.cjs +4 -0
- package/dist/lib-ChwoE6v5.js +331 -0
- package/dist/lib-DIx8C5AZ.cjs +1 -0
- package/dist/lib-DVE2k9i1.js +387 -0
- package/dist/{lib-DzK_kn7a.js → lib-D_0WAhKU.js} +3 -3
- package/dist/{lib-m8lKZKxK.js → lib-Dd20rlmV.js} +28 -28
- package/dist/lib-De0djIEV.cjs +5 -0
- package/dist/{lib-D4HMdvmK.cjs → lib-DgEwQN1U.cjs} +1 -1
- package/dist/{dist-Dhukmh4L.js → lib-DmD940Fq.js} +2849 -1735
- package/dist/lib-Dplx6t-N.cjs +3 -0
- package/dist/lib-DzY83R_P.cjs +39 -0
- package/dist/lib-F08NY8fk.cjs +1 -0
- package/dist/{lib-B0rHJ9lJ.js → lib-_NDReOAt.js} +3 -3
- package/dist/{lib-CK9MEMX-.js → lib-bsXGz3fj.js} +28 -27
- package/dist/schema-list-D9Q6QKgo.cjs +1 -0
- package/dist/schema-list-DooYP5HM.js +110 -0
- package/dist/src/core/createEditor.d.ts.map +1 -1
- package/dist/src/local/en-US.d.ts.map +1 -1
- package/dist/src/local/zh-CN.d.ts.map +1 -1
- package/dist/src/plugins/custom/block-transform/block-transform.d.ts +15 -0
- package/dist/src/plugins/custom/block-transform/block-transform.d.ts.map +1 -0
- package/dist/src/plugins/custom/block-transform/index.d.ts +2 -0
- package/dist/src/plugins/custom/block-transform/index.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/index.d.ts +6 -0
- package/dist/src/plugins/custom/math/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/math/math-block-editable.d.ts.map +1 -1
- package/dist/src/plugins/custom/math/math-inline-arrow-navigation.d.ts +5 -0
- package/dist/src/plugins/custom/math/math-inline-arrow-navigation.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-inline-edit-plugin.d.ts +29 -0
- package/dist/src/plugins/custom/math/math-inline-edit-plugin.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-inline-editable.d.ts +7 -0
- package/dist/src/plugins/custom/math/math-inline-editable.d.ts.map +1 -0
- package/dist/src/plugins/custom/math/math-plugin.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts +5 -1
- package/dist/src/plugins/custom/selection-tooltip/constants.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/index.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts +34 -3
- package/dist/src/plugins/custom/selection-tooltip/tooltip-view.d.ts.map +1 -1
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts +16 -1
- package/dist/src/plugins/custom/selection-tooltip/types.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu-commands.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts +4 -0
- package/dist/src/plugins/custom/slash-menu/slash-menu-logic.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu-view.d.ts.map +1 -1
- package/dist/src/plugins/custom/slash-menu/slash-menu.d.ts.map +1 -1
- package/dist/src/plugins/preset-common.d.ts +6 -0
- package/dist/src/plugins/preset-common.d.ts.map +1 -1
- package/dist/src/react/hooks/useMilkdownEditor.d.ts +2 -2
- package/dist/src/react/hooks/useMilkdownEditor.d.ts.map +1 -1
- package/dist/src/types/editor.d.ts +35 -5
- package/dist/src/types/editor.d.ts.map +1 -1
- package/dist/state-BC1dqWPQ.cjs +1 -0
- package/dist/state-BvRk9kiK.cjs +0 -0
- package/dist/state-BvRk9kiK.js +0 -0
- package/dist/state-rTW_1XVf.js +3 -0
- package/dist/style.css +2 -2
- package/package.json +1 -1
- package/dist/commands-CDrea4WB.cjs +0 -1
- package/dist/commands-DoqeX5uJ.js +0 -36
- package/dist/dist-BCCSKc3M.cjs +0 -5
- package/dist/dist-C0PSMrs7.cjs +0 -37
- package/dist/dist-mOpTMw1E.cjs +0 -1
- package/dist/floating-ui.dom-CKbcbmJV.js +0 -883
- package/dist/floating-ui.dom-VaZZ2gzS.cjs +0 -1
- package/dist/index.browser-5LtNN9G9.cjs +0 -1
- package/dist/index.browser-D2DmEB8o.js +0 -26
- package/dist/lib-38nxOnTd.cjs +0 -4
- package/dist/lib-8Tr6mAln.cjs +0 -1
- package/dist/lib-BJgvZywM.cjs +0 -3
- package/dist/lib-BNOSyYeU.cjs +0 -3
- package/dist/lib-C5AzmhNY.cjs +0 -5
- package/dist/lib-CCUU16r8.js +0 -1081
- package/dist/lib-DWZA8C0h.cjs +0 -1
- package/dist/lib-Dbe-cVjv.js +0 -367
- package/dist/lib-IahjxPWM.cjs +0 -3
- package/dist/lib-r5eNG0sa.js +0 -754
- package/dist/rolldown-runtime-CerMd-t8.cjs +0 -1
- package/dist/rolldown-runtime-DnwLefa7.js +0 -23
- package/dist/schema-list-DSdBEAWW.js +0 -171
- package/dist/schema-list-bL8FNes5.cjs +0 -1
- package/dist/state-CHAiIqOA.cjs +0 -1
- package/dist/state-DNxqltZl.js +0 -16
- /package/dist/{debounce-Cuk3VGPr.js → debounce-Z8-khnlZ.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
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}});
|
|
@@ -1,23 +0,0 @@
|
|
|
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 };
|
|
@@ -1,171 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
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}});
|
package/dist/state-CHAiIqOA.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./rolldown-runtime-CerMd-t8.cjs`),t=require(`./dist-BCCSKc3M.cjs`);var n=e.n({AllSelection:()=>t.t,EditorState:()=>t.n,NodeSelection:()=>t.r,Plugin:()=>t.i,PluginKey:()=>t.a,Selection:()=>t.o,SelectionRange:()=>t.s,TextSelection:()=>t.c,Transaction:()=>t.l});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
package/dist/state-DNxqltZl.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-DnwLefa7.js";
|
|
2
|
-
import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "./dist-DaM7GJv6.js";
|
|
3
|
-
//#region node_modules/.pnpm/@milkdown+prose@7.20.0/node_modules/@milkdown/prose/lib/state.js
|
|
4
|
-
var u = /* @__PURE__ */ e({
|
|
5
|
-
AllSelection: () => l,
|
|
6
|
-
EditorState: () => a,
|
|
7
|
-
NodeSelection: () => s,
|
|
8
|
-
Plugin: () => r,
|
|
9
|
-
PluginKey: () => t,
|
|
10
|
-
Selection: () => o,
|
|
11
|
-
SelectionRange: () => c,
|
|
12
|
-
TextSelection: () => n,
|
|
13
|
-
Transaction: () => i
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
export { u as t };
|
|
File without changes
|