From d436aa0727bdaa381e3acf90e647c84ef92c62b6 Mon Sep 17 00:00:00 2001 From: Harry Vangberg Date: Tue, 17 Dec 2024 11:31:01 +0100 Subject: [PATCH] remove remnants of react-beautiful-dnd --- package-lock.json | 133 ------------------ package.json | 3 +- .../renderer/components/Card.tsx | 21 +-- .../renderer/components/DropStream.tsx | 7 - .../renderer/components/NoteCard.tsx | 7 +- .../renderer/components/SearchCard.tsx | 14 +- .../renderer/components/Stream.tsx | 14 +- .../renderer/containers/AppContainer.tsx | 24 +--- .../renderer/containers/NoteCardContainer.tsx | 1 - .../containers/SearchCardContainer.tsx | 2 - .../renderer/interfaces/draggableIds.tsx | 9 -- .../renderer/interfaces/droppableIds.tsx | 11 -- 12 files changed, 9 insertions(+), 237 deletions(-) delete mode 100644 src/skrift-electron/renderer/interfaces/draggableIds.tsx delete mode 100644 src/skrift-electron/renderer/interfaces/droppableIds.tsx diff --git a/package-lock.json b/package-lock.json index 56911b4..02436a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,6 @@ "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.37.0", "react": "^18.0.0", - "react-beautiful-dnd": "^13.1.0", "react-dom": "^18.0.0", "sqlite": "^5.1.1", "sqlite3": "^5.1.6", @@ -3168,17 +3167,6 @@ "@types/node": "*" } }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.6.tgz", - "integrity": "sha512-lPByRJUer/iN/xa4qpyL0qmL11DqNW81iU/IG1S3uvRUq4oKagz8VCxZjiWkumgt66YT3vOdDgZ0o32sGKtCEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -3424,19 +3412,6 @@ "@types/react": "^18.0.0" } }, - "node_modules/@types/react-redux": { - "version": "7.1.34", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.34.tgz", - "integrity": "sha512-GdFaVjEbYv4Fthm2ZLvj1VSCedV7TqE5y1kNwnjSdBOTXuRSgowux6J8TAct15T3CKBr63UMk+2CO7ilRhyrAQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hoist-non-react-statics": "^3.3.0", - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0", - "redux": "^4.0.0" - } - }, "node_modules/@types/responselike": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", @@ -6134,16 +6109,6 @@ "node": ">= 8" } }, - "node_modules/css-box-model": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", - "integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tiny-invariant": "^1.0.6" - } - }, "node_modules/css-loader": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", @@ -8935,23 +8900,6 @@ "he": "bin/he" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "react-is": "^16.7.0" - } - }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, - "license": "MIT" - }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -11551,13 +11499,6 @@ "url": "https://github.com/sponsors/streamich" } }, - "node_modules/memoize-one": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", - "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", - "dev": true, - "license": "MIT" - }, "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", @@ -13561,27 +13502,6 @@ "node": ">=0.10.0" } }, - "node_modules/react-beautiful-dnd": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/react-beautiful-dnd/-/react-beautiful-dnd-13.1.1.tgz", - "integrity": "sha512-0Lvs4tq2VcrEjEgDXHjT98r+63drkKEgqyxdA7qD3mvKwga6a5SscbdLPO2IExotU1jW8L0Ksdl0Cj2AF67nPQ==", - "deprecated": "react-beautiful-dnd is now deprecated. Context and options: https://github.com/atlassian/react-beautiful-dnd/issues/2672", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/runtime": "^7.9.2", - "css-box-model": "^1.2.0", - "memoize-one": "^5.1.1", - "raf-schd": "^4.0.2", - "react-redux": "^7.2.0", - "redux": "^4.0.4", - "use-memo-one": "^1.1.1" - }, - "peerDependencies": { - "react": "^16.8.5 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.5 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -13596,39 +13516,6 @@ "react": "^18.3.1" } }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true, - "license": "MIT" - }, - "node_modules/react-redux": { - "version": "7.2.9", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.9.tgz", - "integrity": "sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.15.4", - "@types/react-redux": "^7.1.20", - "hoist-non-react-statics": "^3.3.2", - "loose-envify": "^1.4.0", - "prop-types": "^15.7.2", - "react-is": "^17.0.2" - }, - "peerDependencies": { - "react": "^16.8.3 || ^17 || ^18" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } - } - }, "node_modules/read-binary-file-arch": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/read-binary-file-arch/-/read-binary-file-arch-1.0.6.tgz", @@ -13736,16 +13623,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.8.tgz", @@ -16356,16 +16233,6 @@ "react": "^16.8.0 || ^17.0.1 || ^18.0.0" } }, - "node_modules/use-memo-one": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.3.tgz", - "integrity": "sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/utf8-byte-length": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", diff --git a/package.json b/package.json index 8a122d0..f778f7b 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,6 @@ "prosemirror-transform": "^1.10.2", "prosemirror-view": "^1.37.0", "react": "^18.0.0", - "react-beautiful-dnd": "^13.1.0", "react-dom": "^18.0.0", "sqlite": "^5.1.1", "sqlite3": "^5.1.6", @@ -129,4 +128,4 @@ "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.2.0" } -} +} \ No newline at end of file diff --git a/src/skrift-electron/renderer/components/Card.tsx b/src/skrift-electron/renderer/components/Card.tsx index ce6c551..c13b90c 100644 --- a/src/skrift-electron/renderer/components/Card.tsx +++ b/src/skrift-electron/renderer/components/Card.tsx @@ -1,29 +1,14 @@ import clsx from "clsx"; -import React, { useEffect, useMemo, useRef } from "react"; -// import { Draggable, DraggableChildrenFn } from "react-beautiful-dnd"; -import { useUniqueId } from "../hooks/useUniqueId"; -import { DraggableIds } from "../interfaces/draggableIds"; -import { Path } from "../interfaces/path"; -import { Card as CardType } from "../interfaces/state"; +import React from "react"; interface Props { - path: Path; - card: CardType; className?: string; - // children: DraggableChildrenFn; children: React.ReactNode; } -export const Card: React.FC = ({ card, path, className, children }) => { - const draggableId = DraggableIds.serialize(card.meta.key); - - +export const Card: React.FC = ({ className, children }) => { return ( - // - // {(provided, snapshot, ...rest) => (
= ({ card, path, className, children }) => { {children}
- // )} - //
); }; diff --git a/src/skrift-electron/renderer/components/DropStream.tsx b/src/skrift-electron/renderer/components/DropStream.tsx index e168d6c..c8e636b 100644 --- a/src/skrift-electron/renderer/components/DropStream.tsx +++ b/src/skrift-electron/renderer/components/DropStream.tsx @@ -29,17 +29,12 @@ export const DropStream: React.FC = ({ mode, onDrop }) => { }, []); return ( - // - // {(provided, snapshot) => (
= ({ mode, onDrop }) => { */}
- // )} - //
); }; diff --git a/src/skrift-electron/renderer/components/NoteCard.tsx b/src/skrift-electron/renderer/components/NoteCard.tsx index dd656d6..d44ce4f 100644 --- a/src/skrift-electron/renderer/components/NoteCard.tsx +++ b/src/skrift-electron/renderer/components/NoteCard.tsx @@ -8,13 +8,11 @@ import { Card } from "./Card"; import { CardToolbar } from "./CardToolbar"; import { CardBody } from "./CardBody"; import { CardToolbarItem } from "./CardToolbarItem"; -import { Path } from "../interfaces/path"; import { NoteCard as NoteCardType, OpenCardMode } from "../interfaces/state"; import { NoteCardTitle } from "./NoteCardTitle"; import { CardTitle } from "./CardTitle"; type Props = { - path: Path; card: NoteCardType; note: NoteWithLinks; focus: number; @@ -26,7 +24,6 @@ type Props = { }; export const NoteCard: React.FC = ({ - path, card, note, focus, @@ -57,8 +54,7 @@ export const NoteCard: React.FC = ({ }, [note]); return ( - - {/* {(provided) => ( */} + <> Delete @@ -75,7 +71,6 @@ export const NoteCard: React.FC = ({ - {/* )} */} ); }; diff --git a/src/skrift-electron/renderer/components/SearchCard.tsx b/src/skrift-electron/renderer/components/SearchCard.tsx index 4bd57e8..e35e21f 100644 --- a/src/skrift-electron/renderer/components/SearchCard.tsx +++ b/src/skrift-electron/renderer/components/SearchCard.tsx @@ -6,15 +6,9 @@ import { Card } from "./Card"; import { CardBody } from "./CardBody"; import { CardToolbarItem } from "./CardToolbarItem"; import { SearchCardResults } from "./SearchCardResults"; -import { Path } from "../interfaces/path"; -import { - OpenCardMode, - SearchCard as SearchCardType, -} from "../interfaces/state"; +import { OpenCardMode } from "../interfaces/state"; type Props = { - path: Path; - card: SearchCardType; query: string; results: Note[]; onOpen: (id: string, mode: OpenCardMode) => void; @@ -24,8 +18,6 @@ type Props = { }; export const SearchCard: React.FC = ({ - path, - card, query, results, onOpen, @@ -34,8 +26,7 @@ export const SearchCard: React.FC = ({ onSearch, }) => { return ( - - {/* {(provided) => ( */} + <> Close @@ -52,7 +43,6 @@ export const SearchCard: React.FC = ({ - {/* )} */} ); }; diff --git a/src/skrift-electron/renderer/components/Stream.tsx b/src/skrift-electron/renderer/components/Stream.tsx index e261c93..903ce35 100644 --- a/src/skrift-electron/renderer/components/Stream.tsx +++ b/src/skrift-electron/renderer/components/Stream.tsx @@ -1,10 +1,7 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; -// import { Droppable } from "react-beautiful-dnd"; -import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter' +import React, { useCallback } from "react"; import { NoteCardContainer } from "../containers/NoteCardContainer"; import { SearchCardContainer } from "../containers/SearchCardContainer"; -import { DroppableIds } from "../interfaces/droppableIds"; -import { Path, StreamPath } from "../interfaces/path"; +import { StreamPath } from "../interfaces/path"; import { OpenCardMode, Stream as StreamType } from "../interfaces/state"; import { mouseEventToMode } from "../mouseEventToMode"; import { DragDropCardContainer } from "../containers/DragDropCardContainer"; @@ -57,11 +54,7 @@ export const Stream: React.FC = ({ ); return ( - // - // {(provided, snapshot) => (
@@ -87,9 +80,6 @@ export const Stream: React.FC = ({
{cards} - {/* {provided.placeholder} */} - // )} - //
); }; diff --git a/src/skrift-electron/renderer/containers/AppContainer.tsx b/src/skrift-electron/renderer/containers/AppContainer.tsx index 8362c32..d7bc6c7 100644 --- a/src/skrift-electron/renderer/containers/AppContainer.tsx +++ b/src/skrift-electron/renderer/containers/AppContainer.tsx @@ -1,11 +1,9 @@ -import React, { useCallback, useEffect, useMemo, useState } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { Splash } from "../components/Splash"; import { useImmer } from "use-immer"; import { CacheContext } from "../hooks/useCache"; import { Ipc } from "../ipc"; import { createStateActions, State, StateContext } from "../interfaces/state"; -import { DroppableIds } from "../interfaces/droppableIds"; -import { Path } from "../interfaces/path"; import { StreamsContainer } from "./StreamsContainer"; export const AppContainer: React.FC = () => { @@ -46,33 +44,13 @@ export const AppContainer: React.FC = () => { return deregister; }, [actions]); - // const handleDragEnd: OnDragEndResponder = useCallback( - // (result) => { - // const from: Path = [ - // ...DroppableIds.deserialize(result.source.droppableId), - // result.source.index, - // ]; - - // if (result.destination) { - // const to: Path = [ - // ...DroppableIds.deserialize(result.destination.droppableId), - // result.destination.index, - // ]; - // actions.move(from, to); - // } - // }, - // [actions] - // ); - return ( {loading ? ( ) : ( - // - // d )} diff --git a/src/skrift-electron/renderer/containers/NoteCardContainer.tsx b/src/skrift-electron/renderer/containers/NoteCardContainer.tsx index a1ad856..8b466a9 100644 --- a/src/skrift-electron/renderer/containers/NoteCardContainer.tsx +++ b/src/skrift-electron/renderer/containers/NoteCardContainer.tsx @@ -35,7 +35,6 @@ export const NoteCardContainer: React.FC = ({ card, path }) => { return ( = ({ path, card }) => { return (