zt-react-milkdown 0.1.25 → 0.1.27
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/index.cjs +2 -2
- package/dist/index.mjs +308 -27
- package/dist/src/core/createEditor.d.ts.map +1 -1
- package/dist/src/plugins/custom/inline-code-boundary-dom.d.ts +16 -0
- package/dist/src/plugins/custom/inline-code-boundary-dom.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-boundary-mark.d.ts +15 -0
- package/dist/src/plugins/custom/inline-code-boundary-mark.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-boundary-mouse.d.ts +6 -0
- package/dist/src/plugins/custom/inline-code-boundary-mouse.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-boundary-navigation.d.ts +5 -0
- package/dist/src/plugins/custom/inline-code-boundary-navigation.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-boundary-state.d.ts +15 -0
- package/dist/src/plugins/custom/inline-code-boundary-state.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-boundary-visual.d.ts +13 -0
- package/dist/src/plugins/custom/inline-code-boundary-visual.d.ts.map +1 -0
- package/dist/src/plugins/custom/inline-code-exit-navigation.d.ts +9 -0
- package/dist/src/plugins/custom/inline-code-exit-navigation.d.ts.map +1 -0
- package/dist/src/plugins/preset-common.d.ts +2 -0
- package/dist/src/plugins/preset-common.d.ts.map +1 -1
- package/dist/src/react/components/MilkdownEditor.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -18964,7 +18964,7 @@ var tE = [
|
|
|
18964
18964
|
});
|
|
18965
18965
|
}, aE = (e, t = {}) => {
|
|
18966
18966
|
let n = [], r = t.includeRuntime ?? !0;
|
|
18967
|
-
return iE(n, "listener", e.listener), iE(n, "commonmark", e.commonmark), iE(n, "gfm", e.gfm), iE(n, "history", e.history), iE(n, "code-block-prism", e.codeBlockPrism), iE(n, "code-block-language-picker", e.codeBlockLanguagePicker), r && (iE(n, "clipboard", e.clipboard), iE(n, "indent", e.indent)), iE(n, "image-delete-selection", e.imageDeleteSelection), iE(n, "image-paste", e.imagePaste), iE(n, "table-arrow-entry", e.tableArrowEntry), iE(n, "block-boundary-navigation", e.blockBoundaryNavigation), iE(n, "heading-backspace-empty-paragraph", e.headingBackspaceEmptyParagraph), iE(n, "math-backspace-entry", e.mathBackspaceEntry), iE(n, "blockquote-backspace-lift", e.blockquoteBackspaceLift), iE(n, "table-focus-actions", e.tableFocusActions), iE(n, "selection-tooltip", e.selectionTooltip), iE(n, "gap-cursor", e.gapCursor), iE(n, "drop-cursor", e.dropCursor), iE(n, "math", e.math), iE(n, "math-inline-edit", e.mathInlineEdit), iE(n, "math-inline-arrow-navigation", e.mathInlineArrowNavigation), iE(n, "task-list-toggle", e.taskListToggle), iE(n, "tab-space-indent", e.tabSpaceIndent), iE(n, "code-block-mod-a-select", e.codeBlockModASelect), e.slash && iE(n, "slash", e.slash), n;
|
|
18967
|
+
return iE(n, "listener", e.listener), iE(n, "commonmark", e.commonmark), iE(n, "inline-code-boundary-navigation", e.inlineCodeBoundaryNavigation), iE(n, "gfm", e.gfm), iE(n, "history", e.history), iE(n, "code-block-prism", e.codeBlockPrism), iE(n, "code-block-language-picker", e.codeBlockLanguagePicker), r && (iE(n, "clipboard", e.clipboard), iE(n, "indent", e.indent)), iE(n, "image-delete-selection", e.imageDeleteSelection), iE(n, "image-paste", e.imagePaste), iE(n, "table-arrow-entry", e.tableArrowEntry), iE(n, "block-boundary-navigation", e.blockBoundaryNavigation), iE(n, "heading-backspace-empty-paragraph", e.headingBackspaceEmptyParagraph), iE(n, "math-backspace-entry", e.mathBackspaceEntry), iE(n, "blockquote-backspace-lift", e.blockquoteBackspaceLift), iE(n, "table-focus-actions", e.tableFocusActions), iE(n, "selection-tooltip", e.selectionTooltip), iE(n, "gap-cursor", e.gapCursor), iE(n, "drop-cursor", e.dropCursor), iE(n, "math", e.math), iE(n, "math-inline-edit", e.mathInlineEdit), iE(n, "math-inline-arrow-navigation", e.mathInlineArrowNavigation), iE(n, "task-list-toggle", e.taskListToggle), iE(n, "tab-space-indent", e.tabSpaceIndent), iE(n, "code-block-mod-a-select", e.codeBlockModASelect), e.slash && iE(n, "slash", e.slash), n;
|
|
18968
18968
|
};
|
|
18969
18969
|
//#endregion
|
|
18970
18970
|
//#region node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
@@ -55181,19 +55181,298 @@ var ZJ = (e, t) => {
|
|
|
55181
55181
|
return t.shiftKey ? rX(n, t) : nX(n, t);
|
|
55182
55182
|
} }
|
|
55183
55183
|
})), aX = (e) => {
|
|
55184
|
+
let t = (e instanceof Element ? e : e.parentElement)?.closest("code");
|
|
55185
|
+
return t instanceof HTMLElement && !t.closest("pre") ? t : null;
|
|
55186
|
+
}, oX = (e, t, n) => aX(e.domAtPos(t, n).node), sX = (e) => {
|
|
55187
|
+
let t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT), n = t.nextNode(), r = null;
|
|
55188
|
+
for (; n;) n.data.length > 0 && (r = n), n = t.nextNode();
|
|
55189
|
+
return r;
|
|
55190
|
+
}, cX = (e, t, n) => {
|
|
55191
|
+
let r = e.domAtPos(t, n);
|
|
55192
|
+
e.dom.ownerDocument.getSelection()?.collapse(r.node, r.offset);
|
|
55193
|
+
}, lX = (e, t) => {
|
|
55194
|
+
let n = e.domAtPos(t, -1), r = aX(n.node), i = e.dom.ownerDocument.getSelection();
|
|
55195
|
+
if (!r) {
|
|
55196
|
+
i?.collapse(n.node, n.offset);
|
|
55197
|
+
return;
|
|
55198
|
+
}
|
|
55199
|
+
let a = sX(r);
|
|
55200
|
+
if (!a) {
|
|
55201
|
+
let e = r.childNodes.length;
|
|
55202
|
+
i?.collapse(r, e);
|
|
55203
|
+
return;
|
|
55204
|
+
}
|
|
55205
|
+
let o = a.data.length;
|
|
55206
|
+
i?.collapse(a, o);
|
|
55207
|
+
}, uX = {
|
|
55208
|
+
left: {
|
|
55209
|
+
inwardKey: "ArrowRight",
|
|
55210
|
+
outwardKey: "ArrowLeft"
|
|
55211
|
+
},
|
|
55212
|
+
right: {
|
|
55213
|
+
inwardKey: "ArrowLeft",
|
|
55214
|
+
outwardKey: "ArrowRight"
|
|
55215
|
+
}
|
|
55216
|
+
}, dX = {
|
|
55217
|
+
left: "nodeAfter",
|
|
55218
|
+
right: "nodeBefore"
|
|
55219
|
+
}, fX = (e, t) => {
|
|
55220
|
+
e.dispatch(e.state.tr.setMeta(t, null));
|
|
55221
|
+
}, pX = (e, t, n, r, i) => {
|
|
55222
|
+
if (t.key === "ArrowRight") return fX(e, i), !1;
|
|
55223
|
+
if (t.key !== "ArrowLeft") return !1;
|
|
55224
|
+
t.preventDefault();
|
|
55225
|
+
let a = (e.state.storedMarks ?? e.state.selection.$from.marks()).filter((e) => e.type !== n);
|
|
55226
|
+
return e.dispatch(e.state.tr.setStoredMarks(a).setMeta(i, {
|
|
55227
|
+
...r,
|
|
55228
|
+
placement: "outside"
|
|
55229
|
+
})), !0;
|
|
55230
|
+
}, mX = (e, t, n, r, i) => {
|
|
55231
|
+
if (r.placement === "inside") return pX(e, t, n, r, i);
|
|
55232
|
+
let a = uX[r.side];
|
|
55233
|
+
if (t.key === a.outwardKey) return fX(e, i), !1;
|
|
55234
|
+
if (t.key !== a.inwardKey) return !1;
|
|
55235
|
+
let o = dX[r.side], s = e.state.selection.$from[o], c = s ? n.isInSet(s.marks) : null;
|
|
55236
|
+
if (!c) return fX(e, i), !1;
|
|
55237
|
+
t.preventDefault();
|
|
55238
|
+
let l = e.state.storedMarks ?? e.state.selection.$from.marks(), u = c.addToSet(l);
|
|
55239
|
+
return e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, r.position)).setStoredMarks(u).setMeta(i, r.side === "left" ? {
|
|
55240
|
+
...r,
|
|
55241
|
+
placement: "inside"
|
|
55242
|
+
} : null)), r.side === "right" && lX(e, r.position), !0;
|
|
55243
|
+
}, hX = (e, t) => !!t.isInSet(e), gX = (e, t, n) => {
|
|
55244
|
+
let r = e.state.doc.resolve(t), i = r.nodeBefore, a = r.nodeAfter;
|
|
55245
|
+
return !a || hX(i?.marks ?? [], n) || !hX(a.marks, n) ? null : n.isInSet(a.marks);
|
|
55246
|
+
}, _X = (e, t, n) => {
|
|
55247
|
+
let r = e.state.doc.resolve(t), i = r.nodeBefore, a = r.nodeAfter;
|
|
55248
|
+
return !i || !hX(i.marks, n) || hX(a?.marks ?? [], n) ? null : n.isInSet(i.marks);
|
|
55249
|
+
}, vX = new vr("zt-md-inline-code-boundary-navigation"), yX = "inlineCode", bX = 2, xX = (e, t, n, r) => {
|
|
55250
|
+
let i = t > 0 ? [t, t - 1] : [t];
|
|
55251
|
+
for (let [t, a] of i.entries()) {
|
|
55252
|
+
let i = _X(e, a, r);
|
|
55253
|
+
if (!i) continue;
|
|
55254
|
+
let o = e.state.doc.resolve(a).nodeAfter;
|
|
55255
|
+
if (o !== null && !o.isText) continue;
|
|
55256
|
+
let s = oX(e, a, -1);
|
|
55257
|
+
if (!s) continue;
|
|
55258
|
+
let c = n <= s.getBoundingClientRect().right + bX;
|
|
55259
|
+
if (!(t > 0 && !c)) return {
|
|
55260
|
+
boundaryPosition: a,
|
|
55261
|
+
inlineCodeMark: i,
|
|
55262
|
+
rightPlainTextNode: o,
|
|
55263
|
+
codeElement: s
|
|
55264
|
+
};
|
|
55265
|
+
}
|
|
55266
|
+
return null;
|
|
55267
|
+
}, SX = (e, t) => {
|
|
55268
|
+
if (t.button !== 0 || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || !e.editable) return !1;
|
|
55269
|
+
let n = e.posAtCoords({
|
|
55270
|
+
left: t.clientX,
|
|
55271
|
+
top: t.clientY
|
|
55272
|
+
}), r = e.state.schema.marks[yX];
|
|
55273
|
+
if (!n || !r) return !1;
|
|
55274
|
+
let i = n.pos, a = e.state.doc.resolve(i), o = gX(e, i, r), s = a.nodeBefore;
|
|
55275
|
+
if (o && (!s || s.isText)) {
|
|
55276
|
+
let n = oX(e, i, 1);
|
|
55277
|
+
if (!n) return !1;
|
|
55278
|
+
let c = n.getBoundingClientRect(), l = t.clientX >= c.left, u = (s?.marks ?? a.marks()).filter((e) => e.type !== r), d = l ? o.addToSet(a.marks()) : u, f = l ? {
|
|
55279
|
+
position: i,
|
|
55280
|
+
side: "left",
|
|
55281
|
+
placement: "inside"
|
|
55282
|
+
} : null;
|
|
55283
|
+
return t.preventDefault(), e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, i)).setStoredMarks(d).setMeta(vX, f)), e.focus(), l || cX(e, i, -1), !0;
|
|
55284
|
+
}
|
|
55285
|
+
let c = xX(e, i, t.clientX, r);
|
|
55286
|
+
if (!c) return !1;
|
|
55287
|
+
let l = c.boundaryPosition, u = e.state.doc.resolve(l), d = c.codeElement.getBoundingClientRect(), f = t.clientX >= d.right, p = (c.rightPlainTextNode?.marks ?? u.marks()).filter((e) => e.type !== r), m = f ? p : c.inlineCodeMark.addToSet(u.marks()), h = f ? {
|
|
55288
|
+
position: l,
|
|
55289
|
+
side: "right",
|
|
55290
|
+
placement: "outside"
|
|
55291
|
+
} : null;
|
|
55292
|
+
return t.preventDefault(), e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, l)).setStoredMarks(m).setMeta(vX, h)), e.focus(), f || lX(e, l), !0;
|
|
55293
|
+
}, CX = "inlineCode", wX = "zt-md-inline-code-boundary-indicator", TX = "zt-md-inline-code-boundary-indicator-widget", EX = "zt-md-inline-code-boundary-active", DX = {
|
|
55294
|
+
left: -1,
|
|
55295
|
+
right: 1
|
|
55296
|
+
}, OX = {
|
|
55297
|
+
left: 1,
|
|
55298
|
+
right: -1
|
|
55299
|
+
}, kX = (e) => {
|
|
55300
|
+
let t = document.createElement("span");
|
|
55301
|
+
return t.className = wX, t.dataset.side = e.side, t.dataset.placement = e.placement, t.contentEditable = "false", t.setAttribute("aria-hidden", "true"), t;
|
|
55302
|
+
}, AX = (e, t) => {
|
|
55303
|
+
if (t.placement === "outside") return [];
|
|
55304
|
+
let n = e.schema.marks[CX], r = e.doc.resolve(t.position).nodeAfter, i = r && n ? n.isInSet(r.marks) : null;
|
|
55305
|
+
return i ? [i] : null;
|
|
55306
|
+
}, jX = (e) => {
|
|
55307
|
+
let t = vX.getState(e);
|
|
55308
|
+
if (!t) return Gm.empty;
|
|
55309
|
+
let n = AX(e, t);
|
|
55310
|
+
if (!n) return Gm.empty;
|
|
55311
|
+
let r = t.placement === "inside" ? 1 : DX[t.side], i = kX(t), a = Hm.widget(t.position, i, {
|
|
55312
|
+
side: r,
|
|
55313
|
+
marks: n,
|
|
55314
|
+
key: `${TX}-${t.side}-${t.placement}`,
|
|
55315
|
+
ignoreSelection: !0,
|
|
55316
|
+
relaxedSide: !0
|
|
55317
|
+
});
|
|
55318
|
+
return Gm.create(e.doc, [a]);
|
|
55319
|
+
}, MX = (e, t) => {
|
|
55320
|
+
if (t?.placement !== "outside") return;
|
|
55321
|
+
let n = e.dom.querySelector(`.${wX}[data-side='${t.side}'][data-placement='outside']`), r = OX[t.side], i = oX(e, t.position, r);
|
|
55322
|
+
if (!n || !i) return;
|
|
55323
|
+
let a = n.getBoundingClientRect().left, o = i.getBoundingClientRect(), s = t.side === "left" ? o.left - 1 : o.right + 1, c = Math.round(s - a);
|
|
55324
|
+
n.style.setProperty("--zt-md-inline-code-boundary-offset-x", `${c}px`);
|
|
55325
|
+
}, NX = "inlineCode", PX = (e, t) => {
|
|
55326
|
+
let { selection: n } = e.state;
|
|
55327
|
+
if (!n.empty) return !1;
|
|
55328
|
+
let r = n.$from.nodeBefore, i = n.$from.nodeAfter;
|
|
55329
|
+
return !!(r && hX(r.marks, t) && (!i || !hX(i.marks, t)));
|
|
55330
|
+
}, FX = (e, t) => {
|
|
55331
|
+
let { selection: n } = e.state;
|
|
55332
|
+
if (!n.empty) return !1;
|
|
55333
|
+
let r = n.$from.nodeBefore, i = n.$from.nodeAfter;
|
|
55334
|
+
return !!(i && hX(i.marks, t) && (!r || !hX(r.marks, t)));
|
|
55335
|
+
}, IX = (e, t, n) => {
|
|
55336
|
+
let r = gX(e, t, n);
|
|
55337
|
+
if (!r) return !1;
|
|
55338
|
+
let i = e.state.storedMarks ?? e.state.doc.resolve(t).marks(), a = r.addToSet(i);
|
|
55339
|
+
return e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, t)).setStoredMarks(a).setMeta(vX, {
|
|
55340
|
+
position: t,
|
|
55341
|
+
side: "left",
|
|
55342
|
+
placement: "inside"
|
|
55343
|
+
})), !0;
|
|
55344
|
+
}, LX = (e, t) => t.defaultPrevented || t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || !e.editable, RX = (e, t) => {
|
|
55345
|
+
let { selection: n } = e.state;
|
|
55346
|
+
if (!n.empty) return null;
|
|
55347
|
+
let r = n.$from.nodeBefore;
|
|
55348
|
+
return !r || !hX(r.marks, t) ? null : Array.from(r.textContent).length === 1 ? n.from - r.nodeSize : null;
|
|
55349
|
+
}, zX = (e, t, n) => {
|
|
55350
|
+
if (t.key !== "ArrowLeft") return !1;
|
|
55351
|
+
let r = RX(e, n);
|
|
55352
|
+
if (r === null) return !1;
|
|
55353
|
+
let i = e.state.storedMarks ?? e.state.selection.$from.marks();
|
|
55354
|
+
return hX(i, n) ? (t.preventDefault(), e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, r)).setStoredMarks(i).setMeta(vX, {
|
|
55355
|
+
position: r,
|
|
55356
|
+
side: "left",
|
|
55357
|
+
placement: "inside"
|
|
55358
|
+
})), !0) : !1;
|
|
55359
|
+
}, BX = (e, t, n) => {
|
|
55360
|
+
if (!FX(e, n)) return !1;
|
|
55361
|
+
let r = e.state.storedMarks ?? e.state.selection.$from.marks();
|
|
55362
|
+
if (!hX(r, n)) return qX(e), !1;
|
|
55363
|
+
t.preventDefault();
|
|
55364
|
+
let i = r.filter((e) => e.type !== n);
|
|
55365
|
+
return e.dispatch(e.state.tr.setStoredMarks(i).setMeta(vX, {
|
|
55366
|
+
position: e.state.selection.from,
|
|
55367
|
+
side: "left",
|
|
55368
|
+
placement: "outside"
|
|
55369
|
+
})), cX(e, e.state.selection.from, -1), !0;
|
|
55370
|
+
}, VX = (e, t, n) => {
|
|
55371
|
+
if (t.key !== "ArrowLeft" || !PX(e, n)) return !1;
|
|
55372
|
+
let r = e.state.storedMarks ?? e.state.selection.$from.marks();
|
|
55373
|
+
return hX(r, n) ? !1 : (t.preventDefault(), e.dispatch(e.state.tr.setStoredMarks(r).setMeta(vX, {
|
|
55374
|
+
position: e.state.selection.from,
|
|
55375
|
+
side: "right",
|
|
55376
|
+
placement: "outside"
|
|
55377
|
+
})), cX(e, e.state.selection.from, 1), !0);
|
|
55378
|
+
}, HX = (e, t) => {
|
|
55379
|
+
let { selection: n } = e.state;
|
|
55380
|
+
if (!n.empty) return null;
|
|
55381
|
+
let r = n.$from.nodeBefore;
|
|
55382
|
+
if (!r?.isText || hX(r.marks, t) || Array.from(r.textContent).length !== 1) return null;
|
|
55383
|
+
let i = n.from - r.nodeSize;
|
|
55384
|
+
return _X(e, i, t) ? i : null;
|
|
55385
|
+
}, UX = (e, t, n) => {
|
|
55386
|
+
if (t.key !== "ArrowLeft") return !1;
|
|
55387
|
+
let r = HX(e, n);
|
|
55388
|
+
if (r === null) return !1;
|
|
55389
|
+
let i = (e.state.selection.$from.nodeBefore?.marks ?? []).filter((e) => e.type !== n);
|
|
55390
|
+
return t.preventDefault(), e.dispatch(e.state.tr.setSelection(A.create(e.state.doc, r)).setStoredMarks(i).setMeta(vX, {
|
|
55391
|
+
position: r,
|
|
55392
|
+
side: "right",
|
|
55393
|
+
placement: "outside"
|
|
55394
|
+
})), cX(e, r, 1), !0;
|
|
55395
|
+
}, WX = (e, t, n) => UX(e, t, n) || VX(e, t, n) || zX(e, t, n) || BX(e, t, n), GX = () => null, KX = (e, t) => {
|
|
55396
|
+
let n = e.getMeta(vX);
|
|
55397
|
+
return n === void 0 ? e.docChanged || e.selectionSet || e.storedMarksSet ? null : t : n;
|
|
55398
|
+
}, qX = (e) => {
|
|
55399
|
+
vX.getState(e.state) != null && e.dispatch(e.state.tr.setMeta(vX, null));
|
|
55400
|
+
}, JX = (e) => (qX(e), !1), YX = class {
|
|
55401
|
+
constructor(e) {
|
|
55402
|
+
this.editorDom = e.dom, this.update(e);
|
|
55403
|
+
}
|
|
55404
|
+
update(e) {
|
|
55405
|
+
let t = vX.getState(e.state), n = t != null;
|
|
55406
|
+
this.editorDom.classList.toggle(EX, n), MX(e, t);
|
|
55407
|
+
}
|
|
55408
|
+
destroy() {
|
|
55409
|
+
this.editorDom.classList.remove(EX);
|
|
55410
|
+
}
|
|
55411
|
+
}, XX = (e) => new YX(e), ZX = (e) => {
|
|
55412
|
+
if (!(e instanceof Element)) return !1;
|
|
55413
|
+
let t = e.closest("code");
|
|
55414
|
+
return !!(t && !t.closest("pre"));
|
|
55415
|
+
}, QX = (e, t, n) => {
|
|
55416
|
+
if (!e.state.selection.empty) return !1;
|
|
55417
|
+
if (SX(e, n)) return !0;
|
|
55418
|
+
let r = ZX(n.target), i = e.state.schema.marks[NX];
|
|
55419
|
+
if (i && r && IX(e, t, i)) return n.preventDefault(), !0;
|
|
55420
|
+
let a = vX.getState(e.state);
|
|
55421
|
+
if (!r || !a) return !1;
|
|
55422
|
+
let o = e.state.storedMarks, s = e.state.tr.setMeta(vX, null);
|
|
55423
|
+
return o !== null && i && !hX(o, i) && s.setStoredMarks(null), e.dispatch(s), !1;
|
|
55424
|
+
}, $X = (e, t, n) => t.key !== "ArrowRight" || !FX(e, n) || hX(e.state.storedMarks ?? e.state.selection.$from.marks(), n) || !IX(e, e.state.selection.from, n) ? !1 : (t.preventDefault(), !0), eZ = {
|
|
55425
|
+
ArrowLeft: WX,
|
|
55426
|
+
ArrowRight: (e, t, n) => {
|
|
55427
|
+
if (t.key !== "ArrowRight") return !1;
|
|
55428
|
+
if ($X(e, t, n)) return !0;
|
|
55429
|
+
if (!PX(e, n)) return !1;
|
|
55430
|
+
let r = e.state.storedMarks ?? e.state.selection.$from.marks();
|
|
55431
|
+
if (!hX(r, n)) return qX(e), !1;
|
|
55432
|
+
t.preventDefault();
|
|
55433
|
+
let i = r.filter((e) => e.type !== n);
|
|
55434
|
+
return e.dispatch(e.state.tr.setStoredMarks(i).setMeta(vX, {
|
|
55435
|
+
position: e.state.selection.from,
|
|
55436
|
+
side: "right",
|
|
55437
|
+
placement: "outside"
|
|
55438
|
+
})), cX(e, e.state.selection.from, 1), !0;
|
|
55439
|
+
}
|
|
55440
|
+
}, tZ = (e, t) => {
|
|
55441
|
+
if (LX(e, t)) return !1;
|
|
55442
|
+
let n = eZ[t.key];
|
|
55443
|
+
if (!n) return !1;
|
|
55444
|
+
let r = e.state.schema.marks[NX];
|
|
55445
|
+
if (!r) return !1;
|
|
55446
|
+
let i = vX.getState(e.state);
|
|
55447
|
+
return i ? mX(e, t, r, i, vX) : n(e, t, r);
|
|
55448
|
+
}, nZ = t_(() => new hr({
|
|
55449
|
+
key: vX,
|
|
55450
|
+
view: XX,
|
|
55451
|
+
state: {
|
|
55452
|
+
init: GX,
|
|
55453
|
+
apply: KX
|
|
55454
|
+
},
|
|
55455
|
+
props: {
|
|
55456
|
+
handleKeyDown: tZ,
|
|
55457
|
+
handleClick: QX,
|
|
55458
|
+
decorations: jX,
|
|
55459
|
+
handleDOMEvents: { blur: JX }
|
|
55460
|
+
}
|
|
55461
|
+
})), rZ = (e) => {
|
|
55184
55462
|
let t = e.target;
|
|
55185
55463
|
if (!(t instanceof Element)) return null;
|
|
55186
55464
|
let n = t.closest("a[href]");
|
|
55187
55465
|
return n instanceof HTMLAnchorElement ? n : null;
|
|
55188
|
-
},
|
|
55189
|
-
let n =
|
|
55466
|
+
}, iZ = (e) => e?.type.name === "image", aZ = (e, t) => {
|
|
55467
|
+
let n = rZ(e);
|
|
55190
55468
|
if (!n) return !1;
|
|
55191
55469
|
let r = GO(n.getAttribute("href"));
|
|
55192
55470
|
return !r || t || !e.ctrlKey ? !1 : (e.preventDefault(), e.stopPropagation(), window.open(r, "_blank", "noopener,noreferrer"), !0);
|
|
55193
|
-
},
|
|
55471
|
+
}, oZ = (e, t) => !t || !rZ(e) ? !1 : (e.preventDefault(), e.stopPropagation(), !0), sZ = (e) => {
|
|
55194
55472
|
let t = e.messages ?? LO(), n = BY(e.contentPortalContainer, t), r = TJ(e.contentPortalContainer, t), i = Lq(t, e.contentPortalContainer), a = EU(t, e.contentPortalContainer), o = Zk(e.imageUpload, t), s = $J(e.portalContainer, e.slashMenu, t, e.imageUpload, e.locale), c = s.plugins, l = {
|
|
55195
55473
|
listener: Fv,
|
|
55196
55474
|
commonmark: Bb,
|
|
55475
|
+
inlineCodeBoundaryNavigation: nZ,
|
|
55197
55476
|
gfm: nE,
|
|
55198
55477
|
history: G_,
|
|
55199
55478
|
codeBlockPrism: Xq,
|
|
@@ -55223,11 +55502,11 @@ var ZJ = (e, t) => {
|
|
|
55223
55502
|
LW(n), ik(n, e.imageUpload?.allowedProtocols), n.set(zg, e.root), n.set(Tg, e.markdown), n.set(Rg, {
|
|
55224
55503
|
editable: () => !e.readOnly,
|
|
55225
55504
|
handleDOMEvents: {
|
|
55226
|
-
mousedown: (t, n) => n instanceof MouseEvent ?
|
|
55227
|
-
click: (t, n) => n instanceof MouseEvent ?
|
|
55505
|
+
mousedown: (t, n) => n instanceof MouseEvent ? oZ(n, e.readOnly) : !1,
|
|
55506
|
+
click: (t, n) => n instanceof MouseEvent ? oZ(n, e.readOnly) : !1
|
|
55228
55507
|
},
|
|
55229
|
-
handleClick: (t, n, r) =>
|
|
55230
|
-
handleClickOn: (t, n, r, i, a, o) =>
|
|
55508
|
+
handleClick: (t, n, r) => aZ(r, e.readOnly),
|
|
55509
|
+
handleClickOn: (t, n, r, i, a, o) => aZ(a, e.readOnly) ? !0 : e.readOnly && o && iZ(r) ? (a.preventDefault(), !0) : !1
|
|
55231
55510
|
});
|
|
55232
55511
|
let r = n.get(Hh) ?? [];
|
|
55233
55512
|
n.set(Hh, [
|
|
@@ -55261,24 +55540,24 @@ var ZJ = (e, t) => {
|
|
|
55261
55540
|
installRuntimePlugins: p,
|
|
55262
55541
|
focusEditor: (e) => {
|
|
55263
55542
|
f.action((t) => {
|
|
55264
|
-
let n = t.get(Fh);
|
|
55265
|
-
if (e !== void 0 && e.top >
|
|
55266
|
-
let e = n.state.schema.nodes.paragraph
|
|
55267
|
-
if (!(
|
|
55543
|
+
let n = t.get(Fh), r = n.state.doc.lastChild, i = r ? n.state.doc.content.size - r.nodeSize : null, a = i === null ? null : n.nodeDOM(i), o = a instanceof Element ? a : a?.parentElement ?? null;
|
|
55544
|
+
if (e !== void 0 && o !== null && e.top > o.getBoundingClientRect().bottom) {
|
|
55545
|
+
let e = n.state.schema.nodes.paragraph;
|
|
55546
|
+
if (!(r?.type === e && r.content.size === 0)) {
|
|
55268
55547
|
let t = n.state.tr.insert(n.state.doc.content.size, e.create());
|
|
55269
55548
|
t.setSelection(A.atEnd(t.doc)).scrollIntoView(), n.dispatch(t), n.focus();
|
|
55270
55549
|
return;
|
|
55271
55550
|
}
|
|
55272
55551
|
}
|
|
55273
|
-
let
|
|
55274
|
-
n.state.selection.eq(
|
|
55552
|
+
let s = e ? n.posAtCoords(e) : null, c = s ? A.near(n.state.doc.resolve(s.pos), 1) : A.atEnd(n.state.doc);
|
|
55553
|
+
n.state.selection.eq(c) || n.dispatch(n.state.tr.setSelection(c).scrollIntoView()), n.focus();
|
|
55275
55554
|
});
|
|
55276
55555
|
},
|
|
55277
55556
|
setMarkdown: (e) => {
|
|
55278
55557
|
m(e);
|
|
55279
55558
|
}
|
|
55280
55559
|
};
|
|
55281
|
-
},
|
|
55560
|
+
}, cZ = (e, t, n, r) => {
|
|
55282
55561
|
let i = e, a = i.create.bind(e);
|
|
55283
55562
|
return i.create = async () => {
|
|
55284
55563
|
try {
|
|
@@ -55288,10 +55567,10 @@ var ZJ = (e, t) => {
|
|
|
55288
55567
|
throw console.error("Milkdown init failed:", e), r(e), e;
|
|
55289
55568
|
}
|
|
55290
55569
|
}, i;
|
|
55291
|
-
},
|
|
55570
|
+
}, lZ = (e) => {
|
|
55292
55571
|
let t = d(null), n = d(e.markdown), r = d(e.onMarkdownChange), i = d(e.onInitError), a = d(e.onInitReady), o = d(null), s = ce((r) => {
|
|
55293
55572
|
t.current = null, e.focusEditorRef && (e.focusEditorRef.current = null), n.current = e.markdown;
|
|
55294
|
-
let s =
|
|
55573
|
+
let s = sZ({
|
|
55295
55574
|
root: r,
|
|
55296
55575
|
portalContainer: e.portalContainer,
|
|
55297
55576
|
contentPortalContainer: e.contentPortalContainer,
|
|
@@ -55305,7 +55584,7 @@ var ZJ = (e, t) => {
|
|
|
55305
55584
|
n.current = e, o.current?.(e);
|
|
55306
55585
|
}
|
|
55307
55586
|
});
|
|
55308
|
-
return
|
|
55587
|
+
return cZ(s.editor, s.installRuntimePlugins, () => {
|
|
55309
55588
|
t.current = s, e.focusEditorRef && (e.focusEditorRef.current = s.focusEditor), a.current?.();
|
|
55310
55589
|
}, (e) => {
|
|
55311
55590
|
i.current?.(e);
|
|
@@ -55339,10 +55618,10 @@ var ZJ = (e, t) => {
|
|
|
55339
55618
|
let r = t.current;
|
|
55340
55619
|
!r || s.loading || e.markdown !== n.current && (n.current = e.markdown, r.setMarkdown(e.markdown));
|
|
55341
55620
|
}, [s.loading, e.markdown]);
|
|
55342
|
-
},
|
|
55621
|
+
}, uZ = 160, dZ = {
|
|
55343
55622
|
"zh-CN": "只读",
|
|
55344
55623
|
"en-US": "Read only"
|
|
55345
|
-
},
|
|
55624
|
+
}, fZ = (e) => e.length === 0 ? "\"\"" : `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\r\n|\r|\n/g, "\\A ")}"`, pZ = (e) => (lZ({
|
|
55346
55625
|
markdown: e.markdown,
|
|
55347
55626
|
portalContainer: e.portalContainer,
|
|
55348
55627
|
contentPortalContainer: e.contentPortalContainer,
|
|
@@ -55356,13 +55635,13 @@ var ZJ = (e, t) => {
|
|
|
55356
55635
|
onMarkdownChange: e.onMarkdownChange,
|
|
55357
55636
|
onInitReady: e.onInitReady,
|
|
55358
55637
|
onInitError: e.onInitError
|
|
55359
|
-
}), /* @__PURE__ */ y(oe, {})),
|
|
55360
|
-
let [t, n] = f(""), [r, i] = f(null), [a, s] = f(null), c = d(null), l = e.theme ?? "light", p = e.readOnly ?? !1, m =
|
|
55638
|
+
}), /* @__PURE__ */ y(oe, {})), mZ = (e) => {
|
|
55639
|
+
let [t, n] = f(""), [r, i] = f(null), [a, s] = f(null), c = d(null), l = e.theme ?? "light", p = e.readOnly ?? !1, m = dZ[e.locale ?? "zh-CN"], h = e.debounceMs ?? uZ, { markdown: g, setMarkdown: _ } = de(e.value, e.defaultValue, e.onChange), v = u(() => LO(e.locale, e.messages, e.placeholder), [
|
|
55361
55640
|
e.locale,
|
|
55362
55641
|
e.messages,
|
|
55363
55642
|
e.placeholder
|
|
55364
55643
|
]), x = {
|
|
55365
|
-
"--zt-gap-placeholder-content":
|
|
55644
|
+
"--zt-gap-placeholder-content": fZ(v.placeholder),
|
|
55366
55645
|
...e.maxHeight === void 0 ? {} : {
|
|
55367
55646
|
maxHeight: e.maxHeight,
|
|
55368
55647
|
overflowY: "auto"
|
|
@@ -55376,10 +55655,12 @@ var ZJ = (e, t) => {
|
|
|
55376
55655
|
}, [v.initError]), T = o((e) => {
|
|
55377
55656
|
if (p) return;
|
|
55378
55657
|
let t = e.target;
|
|
55379
|
-
t instanceof Element
|
|
55658
|
+
if (!(t instanceof Element)) return;
|
|
55659
|
+
let n = t.closest(".ProseMirror");
|
|
55660
|
+
t.closest(".zt-md-content-portal") || n !== null && t !== n || (e.preventDefault(), c.current?.({
|
|
55380
55661
|
left: e.clientX,
|
|
55381
55662
|
top: e.clientY
|
|
55382
|
-
}))
|
|
55663
|
+
}));
|
|
55383
55664
|
}, [p]), E = o((e) => {
|
|
55384
55665
|
i(e);
|
|
55385
55666
|
}, []), ee = o((e) => {
|
|
@@ -55405,7 +55686,7 @@ var ZJ = (e, t) => {
|
|
|
55405
55686
|
"aria-readonly": p,
|
|
55406
55687
|
onMouseDown: T,
|
|
55407
55688
|
style: x,
|
|
55408
|
-
children: [r && a ? /* @__PURE__ */ y(se, { children: /* @__PURE__ */ y(
|
|
55689
|
+
children: [r && a ? /* @__PURE__ */ y(se, { children: /* @__PURE__ */ y(pZ, {
|
|
55409
55690
|
markdown: g,
|
|
55410
55691
|
locale: e.locale,
|
|
55411
55692
|
portalContainer: r,
|
|
@@ -55433,4 +55714,4 @@ var ZJ = (e, t) => {
|
|
|
55433
55714
|
});
|
|
55434
55715
|
};
|
|
55435
55716
|
//#endregion
|
|
55436
|
-
export {
|
|
55717
|
+
export { mZ as MilkdownEditor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEditor.d.ts","sourceRoot":"","sources":["../../../src/core/createEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,MAAM,EAKP,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"createEditor.d.ts","sourceRoot":"","sources":["../../../src/core/createEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,MAAM,EAKP,MAAM,gBAAgB,CAAC;AAgDxB;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,cAAc;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,6BAA6B;IAC7B,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,4BAA4B;IAC5B,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC5D,sBAAsB;IACtB,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,cAAc;IACd,IAAI,EAAE,WAAW,CAAC;IAClB,yBAAyB;IACzB,eAAe,EAAE,WAAW,CAAC;IAC7B,2BAA2B;IAC3B,sBAAsB,EAAE,WAAW,CAAC;IACpC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,aAAa;IACb,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,kBAAkB;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,cAAc;IACd,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,qBAAqB;IACrB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAqED;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACtC,SAAS,kCAAkC,KAC1C,qBAsOF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
2
|
+
/** 行内代码边界方向。 */
|
|
3
|
+
export type InlineCodeBoundarySide = 'left' | 'right';
|
|
4
|
+
/**
|
|
5
|
+
* 根据文档边界位置解析相邻的真实行内代码元素。
|
|
6
|
+
*/
|
|
7
|
+
export declare const resolveInlineCodeElementAtBoundary: (view: EditorView, position: number, domBias: -1 | 1) => HTMLElement | null;
|
|
8
|
+
/**
|
|
9
|
+
* 将原生光标放到行内代码指定 DOM 侧。
|
|
10
|
+
*/
|
|
11
|
+
export declare const placeCaretAtInlineCodeBoundary: (view: EditorView, position: number, domBias: -1 | 1) => void;
|
|
12
|
+
/**
|
|
13
|
+
* 将原生光标精确放到行内代码末尾文本节点。
|
|
14
|
+
*/
|
|
15
|
+
export declare const placeCaretInsideInlineCodeEnd: (view: EditorView, position: number) => void;
|
|
16
|
+
//# sourceMappingURL=inline-code-boundary-dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-dom.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,gBAAgB;AAChB,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,CAAC;AAatD;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC7C,MAAM,UAAU,EAChB,UAAU,MAAM,EAChB,SAAS,CAAC,CAAC,GAAG,CAAC,KACd,WAAW,GAAG,IAIhB,CAAC;AAuBF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,MAAM,UAAU,EAChB,UAAU,MAAM,EAChB,SAAS,CAAC,CAAC,GAAG,CAAC,KACd,IAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,UAAU,EAAE,UAAU,MAAM,KAAG,IAwBlF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Mark, MarkType } from '@milkdown/prose/model';
|
|
2
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
3
|
+
/**
|
|
4
|
+
* 判断 mark 集合是否包含指定类型。
|
|
5
|
+
*/
|
|
6
|
+
export declare const hasMarkType: (marks: readonly Mark[], markType: MarkType) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* 解析指定位置右侧的真实行内代码 mark。
|
|
9
|
+
*/
|
|
10
|
+
export declare const resolveInlineCodeStartMark: (view: EditorView, position: number, markType: MarkType) => Mark | null;
|
|
11
|
+
/**
|
|
12
|
+
* 解析指定位置左侧的真实行内代码 mark。
|
|
13
|
+
*/
|
|
14
|
+
export declare const resolveInlineCodeEndMark: (view: EditorView, position: number, markType: MarkType) => Mark | null;
|
|
15
|
+
//# sourceMappingURL=inline-code-boundary-mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-mark.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-mark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,SAAS,IAAI,EAAE,EAAE,UAAU,QAAQ,KAAG,OAExE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,UAAU,EAChB,UAAU,MAAM,EAChB,UAAU,QAAQ,KACjB,IAAI,GAAG,IAgBT,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,MAAM,UAAU,EAChB,UAAU,MAAM,EAChB,UAAU,QAAQ,KACjB,IAAI,GAAG,IAgBT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-mouse.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-mouse.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAwFvD;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,MAAM,UAAU,EAAE,OAAO,UAAU,KAAG,OA8HnF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-navigation.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-navigation.ts"],"names":[],"mappings":"AAimBA;;GAEG;AACH,eAAO,MAAM,kCAAkC,kCAiB7C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PluginKey } from '@milkdown/prose/state';
|
|
2
|
+
import { InlineCodeBoundarySide } from './inline-code-boundary-dom';
|
|
3
|
+
/** 行内代码边界视觉位置。 */
|
|
4
|
+
export type InlineCodeBoundaryPlacement = 'inside' | 'outside';
|
|
5
|
+
/** 行内代码边界视觉状态。 */
|
|
6
|
+
export interface InlineCodeBoundaryVisualState {
|
|
7
|
+
/** 边界对应的文档位置。 */
|
|
8
|
+
position: number;
|
|
9
|
+
/** 边界方向。 */
|
|
10
|
+
side: InlineCodeBoundarySide;
|
|
11
|
+
/** 指示光标位于标签内部或外部。 */
|
|
12
|
+
placement: InlineCodeBoundaryPlacement;
|
|
13
|
+
}
|
|
14
|
+
export declare const inlineCodeBoundaryNavigationPluginKey: PluginKey<InlineCodeBoundaryVisualState | null>;
|
|
15
|
+
//# sourceMappingURL=inline-code-boundary-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-state.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKzE,kBAAkB;AAClB,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,kBAAkB;AAClB,MAAM,WAAW,6BAA6B;IAC5C,iBAAiB;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY;IACZ,IAAI,EAAE,sBAAsB,CAAC;IAC7B,qBAAqB;IACrB,SAAS,EAAE,2BAA2B,CAAC;CACxC;AAGD,eAAO,MAAM,qCAAqC,iDAEL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorState } from '@milkdown/prose/state';
|
|
2
|
+
import { DecorationSet, EditorView } from '@milkdown/prose/view';
|
|
3
|
+
import { InlineCodeBoundaryVisualState } from './inline-code-boundary-state';
|
|
4
|
+
export declare const INLINE_CODE_BOUNDARY_ACTIVE_CLASS_NAME = "zt-md-inline-code-boundary-active";
|
|
5
|
+
/**
|
|
6
|
+
* 创建当前行内代码边界指示线装饰集合。
|
|
7
|
+
*/
|
|
8
|
+
export declare const createInlineCodeBoundaryDecorations: (state: EditorState) => DecorationSet;
|
|
9
|
+
/**
|
|
10
|
+
* 将外部指示光标校正到真实代码外框与相邻内容之间。
|
|
11
|
+
*/
|
|
12
|
+
export declare const alignInlineCodeOutsideIndicator: (view: EditorView, visualState: InlineCodeBoundaryVisualState | null) => void;
|
|
13
|
+
//# sourceMappingURL=inline-code-boundary-visual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-boundary-visual.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-boundary-visual.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAc,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKlF,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,8BAA8B,CAAC;AAStC,eAAO,MAAM,sCAAsC,sCAAsC,CAAC;AAkD1F;;GAEG;AACH,eAAO,MAAM,mCAAmC,GAAI,OAAO,WAAW,KAAG,aAgCxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,MAAM,UAAU,EAChB,aAAa,6BAA6B,GAAG,IAAI,KAChD,IA+BF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MarkType } from '@milkdown/prose/model';
|
|
2
|
+
import { PluginKey } from '@milkdown/prose/state';
|
|
3
|
+
import { EditorView } from '@milkdown/prose/view';
|
|
4
|
+
import { InlineCodeBoundaryVisualState } from './inline-code-boundary-state';
|
|
5
|
+
/**
|
|
6
|
+
* 处理行内代码边界视觉状态下的方向键导航。
|
|
7
|
+
*/
|
|
8
|
+
export declare const handleInlineCodeBoundaryVisualNavigation: (view: EditorView, event: KeyboardEvent, inlineCodeMarkType: MarkType, visualState: InlineCodeBoundaryVisualState, pluginKey: PluginKey<InlineCodeBoundaryVisualState | null>) => boolean;
|
|
9
|
+
//# sourceMappingURL=inline-code-exit-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code-exit-navigation.d.ts","sourceRoot":"","sources":["../../../../src/plugins/custom/inline-code-exit-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAiB,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AA6ElF;;GAEG;AACH,eAAO,MAAM,wCAAwC,GACnD,MAAM,UAAU,EAChB,OAAO,aAAa,EACpB,oBAAoB,QAAQ,EAC5B,aAAa,6BAA6B,EAC1C,WAAW,SAAS,CAAC,6BAA6B,GAAG,IAAI,CAAC,KACzD,OA0DF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-common.d.ts","sourceRoot":"","sources":["../../../src/plugins/preset-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,sBAAsB;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB;IACrB,uBAAuB,EAAE,OAAO,CAAC;IACjC,gCAAgC;IAChC,8BAA8B,EAAE,OAAO,CAAC;IACxC,4BAA4B;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAC9B,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAC1B,kBAAkB;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,qBAAqB;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,kBAAkB;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,yBAAyB;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gCAAgC;IAChC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAoBD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,eAAe,mBAAmB,EAClC,UAAS,2BAAgC,KACxC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"preset-common.d.ts","sourceRoot":"","sources":["../../../src/plugins/preset-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,qBAAqB;IACrB,4BAA4B,EAAE,OAAO,CAAC;IACtC,gBAAgB;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,oBAAoB;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,sBAAsB;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB;IACnB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB;IACrB,uBAAuB,EAAE,OAAO,CAAC;IACjC,gCAAgC;IAChC,8BAA8B,EAAE,OAAO,CAAC;IACxC,4BAA4B;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,8BAA8B;IAC9B,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAC1B,kBAAkB;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,qBAAqB;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,kBAAkB;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,uBAAuB;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,yBAAyB;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gCAAgC;IAChC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAoBD;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,eAAe,mBAAmB,EAClC,UAAS,2BAAgC,KACxC,sBAAsB,EA+CxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MilkdownEditor.d.ts","sourceRoot":"","sources":["../../../../src/react/components/MilkdownEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmE9D;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"MilkdownEditor.d.ts","sourceRoot":"","sources":["../../../../src/react/components/MilkdownEditor.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmE9D;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,KAAG,GAAG,CAAC,OA4I/D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|