|
@@ -1,6 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import type { EditorView } from "prosemirror-view"
|
|
import type { EditorView } from "prosemirror-view"
|
|
|
-import { computed, nextTick, ref, useSlots, watch } from "vue"
|
|
|
|
|
|
|
+import { computed, nextTick, ref, watch } from "vue"
|
|
|
import Block from "@/components/Block.vue"
|
|
import Block from "@/components/Block.vue"
|
|
|
import InsertionZone from "@/components/InsertionZone.vue"
|
|
import InsertionZone from "@/components/InsertionZone.vue"
|
|
|
import {
|
|
import {
|
|
@@ -56,7 +56,6 @@ const blocks = ref<EditorBlock[]>([])
|
|
|
const registry = useFocusRegistry()
|
|
const registry = useFocusRegistry()
|
|
|
|
|
|
|
|
const log = createLogger("Editor", props.debug)
|
|
const log = createLogger("Editor", props.debug)
|
|
|
-const slots = useSlots()
|
|
|
|
|
|
|
|
|
|
const blockRefs: { setContent: (md: string) => void }[] = []
|
|
const blockRefs: { setContent: (md: string) => void }[] = []
|
|
|
const zoneRefs: HTMLElement[] = []
|
|
const zoneRefs: HTMLElement[] = []
|
|
@@ -67,8 +66,6 @@ function focusZone(index: number) {
|
|
|
zone.focus()
|
|
zone.focus()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const editorShellRef = ref<HTMLElement | null>(null)
|
|
|
|
|
-
|
|
|
|
|
// ── Undo / Redo history ──────────────────────────────────────────
|
|
// ── Undo / Redo history ──────────────────────────────────────────
|
|
|
|
|
|
|
|
const history: OperationHistory = createOperationHistory(100)
|
|
const history: OperationHistory = createOperationHistory(100)
|
|
@@ -477,7 +474,7 @@ defineExpose({ undo, redo, canUndo, canRedo })
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
- <div ref="editorShellRef" class="editor-shell" :style="themeCSSVars" @keydown="onShellKeydown">
|
|
|
|
|
|
|
+ <div class="editor-shell" :style="themeCSSVars" @keydown="onShellKeydown">
|
|
|
<div v-if="$slots.toolbar" class="editor-toolbar-wrapper">
|
|
<div v-if="$slots.toolbar" class="editor-toolbar-wrapper">
|
|
|
<slot
|
|
<slot
|
|
|
name="toolbar"
|
|
name="toolbar"
|