feat(editor): add SQL intention actions (Alt+Enter style)

This commit is contained in:
大峰 authored and GitHub committed 2026-08-10 00:07:12 +08:00
1 parent 789482eceb
commit f66a18d88d
16 files changed
+1384 -20

No files matched your search

@@ -1,23 +1,10 @@
<script setup lang="ts">
import { ref, watch, onBeforeUnmount, onMounted, nextTick, type Component } from "vue";
import { ref, watch, onBeforeUnmount, onMounted, nextTick } from "vue";
import { Check, ChevronRight } from "@lucide/vue";
import { shortcutDisplayKeys } from "@/lib/editor/shortcutDisplay";
import { registerGlobalContextMenu, type ContextMenuRegistration } from "@/components/ui/customContextMenuRegistry";
import { registerGlobalContextMenu, type ContextMenuRegistration, type ContextMenuItem } from "@/components/ui/customContextMenuRegistry";
export interface ContextMenuItem {
label: string;
action?: () => void;
disabled?: boolean | (() => boolean);
separator?: boolean;
icon?: Component;
iconClass?: string;
checked?: boolean;
// Raw shortcut syntax such as `Mod+C` or `Shift+Alt+U`; display formatting stays in this component.
shortcut?: string;
variant?: "default" | "destructive";
visible?: boolean;
children?: ContextMenuItem[];
}
export type { ContextMenuItem };
type ContextMenuItemsSource = ContextMenuItem[] | (() => ContextMenuItem[]);
@@ -1,3 +1,20 @@
import type { Component } from "vue";
export interface ContextMenuItem {
label: string;
action?: () => void;
disabled?: boolean | (() => boolean);
separator?: boolean;
icon?: Component;
iconClass?: string;
checked?: boolean;
// Raw shortcut syntax such as `Mod+C` or `Shift+Alt+U`; display formatting stays in this component.
shortcut?: string;
variant?: "default" | "destructive";
visible?: boolean;
children?: ContextMenuItem[];
}
export type ContextMenuClose = () => void;
/** Marker attribute on scrollable context menu / submenu roots. */