handle drag n drop
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import type { FlutterEvent, FlutterTimelineState } from "@/lib/flutter-bridge";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -28,8 +29,8 @@ declare global {
|
||||
}
|
||||
|
||||
type FlutterViewProps = {
|
||||
state: Record<string, unknown>;
|
||||
onEvent: (event: { type: string; payload?: Record<string, unknown> }) => void;
|
||||
state: FlutterTimelineState;
|
||||
onEvent: (event: FlutterEvent) => void;
|
||||
className?: string;
|
||||
height?: number;
|
||||
};
|
||||
@@ -60,10 +61,7 @@ export function FlutterView({
|
||||
window.__zendegi__ = {
|
||||
getState: () => JSON.stringify(stateRef.current),
|
||||
onEvent: (json: string) => {
|
||||
const event = JSON.parse(json) as {
|
||||
type: string;
|
||||
payload?: Record<string, unknown>;
|
||||
};
|
||||
const event = JSON.parse(json) as FlutterEvent;
|
||||
onEventRef.current(event);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user