diff --git a/package.json b/package.json index 165780e..e10dbea 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@repath-project/react-timeline-editor", + "name": "react-timeline-editor", "version": "0.1.10", "author": "xzdarcy", "license": "MIT", @@ -27,21 +27,20 @@ "prepublishOnly": "npm run build" }, "files": [ - "dist" + "src" ], - "main": "dist/index.js", - "module": "dist/index.esm.js", - "typings": "dist/index.d.ts", + "main": "src/index.tsx", + "types": "src/index.tsx", "peerDependencies": { "react": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "dependencies": { "@interactjs/types": "^1.10.11", - "@types/react-virtualized": "^9.21.14", + "@types/react-virtualized": "^9.22.0", "framework-utils": "^1.1.0", "interactjs": "^1.10.11", - "react-virtualized": "^9.22.3" + "react-virtualized": "workspace:*" }, "devDependencies": { "@types/howler": "^2.2.4", @@ -49,7 +48,7 @@ "@types/react": "^17.0.17", "@types/react-dom": "^17.0.17", "@umijs/test": "^3.0.5", - "antd": "^4.16.13", + "antd": "^5.23.1", "dumi": "^1.0.17", "father-build": "^1.17.2", "gh-pages": "^3.0.0", @@ -58,8 +57,8 @@ "lodash": "^4.17.21", "lottie-web": "^5.8.1", "prettier": "^2.2.1", - "react": "^17.0.0", - "react-dom": "^17.0.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", "yorkie": "^2.0.0" } -} +} \ No newline at end of file diff --git a/src/components/row_rnd/interactable.tsx b/src/components/row_rnd/interactable.tsx index 0b334e4..6dc2385 100644 --- a/src/components/row_rnd/interactable.tsx +++ b/src/components/row_rnd/interactable.tsx @@ -2,15 +2,15 @@ import { DraggableOptions } from "@interactjs/actions/drag/plugin"; import { ResizableOptions } from "@interactjs/actions/resize/plugin"; import { DragEvent, Interactable } from "@interactjs/types"; import interact from "interactjs"; -import { cloneElement, FC, ReactElement, useEffect, useRef } from "react"; +import { cloneElement, FC, ReactElement, useEffect, useRef, PropsWithChildren } from "react"; -export const InteractComp: FC<{ +export const InteractComp: FC; draggable: boolean; draggableOptions: DraggableOptions; resizable: boolean; resizableOptions: ResizableOptions; -}> = ({ children, interactRef, draggable, resizable, draggableOptions, resizableOptions }) => { +}>> = ({ children, interactRef, draggable, resizable, draggableOptions, resizableOptions }) => { const nodeRef = useRef(); const interactable = useRef(); const draggableOptionsRef = useRef(); @@ -36,7 +36,7 @@ export const InteractComp: FC<{ onmove: (e) => draggableOptionsRef.current.onmove && (draggableOptionsRef.current.onmove as (e: DragEvent) => any)(e), onend: (e) => draggableOptionsRef.current.onend && (draggableOptionsRef.current.onend as (e: DragEvent) => any)(e), }); - if (resizable) interactable.current.resizable({ + if (resizable) interactable.current.resizable({ ...resizableOptionsRef.current, onstart: (e) => resizableOptionsRef.current.onstart && (resizableOptionsRef.current.onstart as (e: DragEvent) => any)(e), onmove: (e) => resizableOptionsRef.current.onmove && (resizableOptionsRef.current.onmove as (e: DragEvent) => any)(e), diff --git a/src/components/timeline.less b/src/components/timeline.less index 81b2458..7dcd702 100644 --- a/src/components/timeline.less +++ b/src/components/timeline.less @@ -1,8 +1,6 @@ .timeline-editor { - height: 600px; - width: 600px; - min-height: 32px; + min-height: 80vh; position: relative; font-size: 12px; font-family: "PingFang SC"; diff --git a/tsconfig.json b/tsconfig.json.bak similarity index 100% rename from tsconfig.json rename to tsconfig.json.bak