feat(editor): Overhaul handle rendering to allow dragging of plus button (no-changelog) (#10512)
This commit is contained in:
12
packages/editor-ui/src/composables/useCanvas.ts
Normal file
12
packages/editor-ui/src/composables/useCanvas.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { computed, inject } from 'vue';
|
||||
import { CanvasKey } from '@/constants';
|
||||
|
||||
export function useCanvas() {
|
||||
const canvas = inject(CanvasKey);
|
||||
|
||||
const connectingHandle = computed(() => canvas?.connectingHandle.value);
|
||||
|
||||
return {
|
||||
connectingHandle,
|
||||
};
|
||||
}
|
||||
@@ -12,13 +12,15 @@ export function useCanvasNodeHandle() {
|
||||
const handle = inject(CanvasNodeHandleKey);
|
||||
|
||||
const label = computed(() => handle?.label.value ?? '');
|
||||
const connected = computed(() => handle?.connected.value ?? false);
|
||||
const isConnected = computed(() => handle?.isConnected.value ?? false);
|
||||
const isConnecting = computed(() => handle?.isConnecting.value ?? false);
|
||||
const type = computed(() => handle?.type.value ?? NodeConnectionType.Main);
|
||||
const mode = computed(() => handle?.mode.value ?? CanvasConnectionMode.Input);
|
||||
|
||||
return {
|
||||
label,
|
||||
connected,
|
||||
isConnected,
|
||||
isConnecting,
|
||||
type,
|
||||
mode,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user