feat(editor): Add support for fallback nodes and new addNodes node render type in new canvas (no-changelog) (#10004)

This commit is contained in:
Alex Grozav
2024-07-11 13:03:46 +03:00
committed by GitHub
parent f9e9d274b9
commit 57dfefd0f6
24 changed files with 509 additions and 224 deletions

View File

@@ -5,11 +5,12 @@
import { CanvasNodeKey } from '@/constants';
import { computed, inject } from 'vue';
import type { CanvasElementData } from '@/types';
import type { CanvasNodeData } from '@/types';
import { CanvasNodeRenderType } from '@/types';
export function useCanvasNode() {
const node = inject(CanvasNodeKey);
const data = computed<CanvasElementData>(
const data = computed<CanvasNodeData>(
() =>
node?.data.value ?? {
id: '',
@@ -26,7 +27,7 @@ export function useCanvasNode() {
},
runData: { count: 0, visible: false },
render: {
type: 'default',
type: CanvasNodeRenderType.Default,
options: {},
},
},