|
@@ -6,7 +6,7 @@ import { Essentials } from "@ckeditor/ckeditor5-essentials";
|
|
|
import { FontFamily, FontSize } from "@ckeditor/ckeditor5-font";
|
|
|
import { Link } from "@ckeditor/ckeditor5-link";
|
|
|
import { Paragraph } from "@ckeditor/ckeditor5-paragraph";
|
|
|
-import { defineComponent } from "vue";
|
|
|
+import { defineComponent, reactive } from "vue";
|
|
|
import { string } from "vue-types";
|
|
|
import { View } from "../View";
|
|
|
import { css } from "@linaria/core";
|
|
@@ -30,14 +30,14 @@ export const Text = defineComponent({
|
|
|
Alignment,
|
|
|
],
|
|
|
fontSize: {
|
|
|
- options: [9, 11, 13, "default", 17, 19, 21],
|
|
|
+ options: [12, 14, 16, 18, 20, 24, 28],
|
|
|
},
|
|
|
toolbar: {
|
|
|
items: [
|
|
|
- "undo",
|
|
|
- "redo",
|
|
|
- "|",
|
|
|
- "fontFamily",
|
|
|
+ // "undo",
|
|
|
+ // "redo",
|
|
|
+ // "|",
|
|
|
+ // "fontFamily",
|
|
|
"fontsize",
|
|
|
"bold",
|
|
|
"italic",
|
|
@@ -48,14 +48,21 @@ export const Text = defineComponent({
|
|
|
],
|
|
|
},
|
|
|
};
|
|
|
+
|
|
|
+ const state = reactive({
|
|
|
+ focus: false,
|
|
|
+ });
|
|
|
+
|
|
|
return () => (
|
|
|
- <View>
|
|
|
+ <View class={[state.focus && "drag-disable"]}>
|
|
|
<ckeditor
|
|
|
class={textStyle}
|
|
|
editor={InlineEditor}
|
|
|
- onBlur={(e: any, editor: InlineEditor) =>
|
|
|
- emit("update:value", editor.getData())
|
|
|
- }
|
|
|
+ onBlur={(e: any, editor: InlineEditor) => {
|
|
|
+ state.focus = false;
|
|
|
+ emit("update:value", editor.getData());
|
|
|
+ }}
|
|
|
+ onFocus={() => (state.focus = true)}
|
|
|
onReady={(editor: InlineEditor) => {
|
|
|
editor.setData(props.value);
|
|
|
if (!store.isEditMode) {
|