@jvs-milkdown/crepe 1.2.8 → 1.2.10
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/lib/cjs/index.js +17 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +17 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/feature/fixed-toolbar/document-header.d.ts.map +1 -1
- package/lib/types/feature/fixed-toolbar/index.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/feature/fixed-toolbar/document-header.tsx +21 -0
- package/src/feature/fixed-toolbar/index.ts +2 -1
package/lib/cjs/index.js
CHANGED
|
@@ -9003,6 +9003,23 @@ const DocumentHeader = vue.defineComponent({
|
|
|
9003
9003
|
title.value = e.target.value;
|
|
9004
9004
|
adjustTitleHeight();
|
|
9005
9005
|
},
|
|
9006
|
+
onKeydown: (e) => {
|
|
9007
|
+
if (e.key !== "Enter") return;
|
|
9008
|
+
e.preventDefault();
|
|
9009
|
+
if (e.ctrlKey || e.metaKey) {
|
|
9010
|
+
const target = e.target;
|
|
9011
|
+
const start = target.selectionStart;
|
|
9012
|
+
const end = target.selectionEnd;
|
|
9013
|
+
title.value = title.value.slice(0, start) + "\n" + title.value.slice(end);
|
|
9014
|
+
requestAnimationFrame(() => {
|
|
9015
|
+
target.selectionStart = target.selectionEnd = start + 1;
|
|
9016
|
+
adjustTitleHeight();
|
|
9017
|
+
});
|
|
9018
|
+
} else {
|
|
9019
|
+
const view = props.ctx.get(core.editorViewCtx);
|
|
9020
|
+
view == null ? void 0 : view.focus();
|
|
9021
|
+
}
|
|
9022
|
+
},
|
|
9006
9023
|
rows: 1,
|
|
9007
9024
|
style: {
|
|
9008
9025
|
width: "100%",
|