Skip to content

Commit

Permalink
feat(form): add touch screen support for dnd
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrc committed Jun 27, 2024
1 parent a5d1da9 commit f92f884
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
"markdown-it-texmath": "^1.0.0",
"marked": "^9.0.3",
"object-path": "^0.11.8",
"rdndmb-html5-to-touch": "^8.0.3",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-multi-backend": "^8.0.3",
"react-input-mask": "3.0.0-alpha.2",
"react-markdown-editor-lite": "^1.3.4",
"react-redux": "^8.1.2",
Expand Down
9 changes: 7 additions & 2 deletions src/exposed.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { MultiBackend } from "react-dnd-multi-backend";
import { HTML5toTouch } from "rdndmb-html5-to-touch";
import { initSchemaStructure, combineFieldTypes } from "./admin/utils";
import CustomizationContext from "./contexts/CustomizationContext";
import { ConfigProvider, ThemeConfig } from "antd";
Expand Down Expand Up @@ -41,7 +42,11 @@ export const FormuleContext = ({
<Provider store={store}>
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore */}
<DndProvider backend={HTML5Backend} context={window}>
<DndProvider
backend={MultiBackend}
options={HTML5toTouch}
context={window}
>
<ConfigProvider theme={theme}>
<CustomizationContext.Provider
value={{
Expand Down
35 changes: 35 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,11 @@ dnd-core@^16.0.1:
"@react-dnd/invariant" "^4.0.1"
redux "^4.2.0"

dnd-multi-backend@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/dnd-multi-backend/-/dnd-multi-backend-8.0.3.tgz#2cc8121ad2b6e6164e3044be9ffdfe994ab6bdb0"
integrity sha512-yFFARotr+OEJk787Fsj+V52pi6j7+Pt/CRp3IR2Ai3fnxA/z6J54T7+gxkXzXu4cvxTNE7NiBzzAaJ2f7JjFTw==

doctrine@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
Expand Down Expand Up @@ -5083,13 +5088,43 @@ rc-virtual-list@^3.14.2, rc-virtual-list@^3.5.1, rc-virtual-list@^3.5.2:
rc-resize-observer "^1.0.0"
rc-util "^5.36.0"

rdndmb-html5-to-touch@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/rdndmb-html5-to-touch/-/rdndmb-html5-to-touch-8.0.3.tgz#dca0dd429520650a298f961a75dedd63d59808ad"
integrity sha512-VfIbLjlL9NAnZzc2M5fGPCNkDyK12+ahgILGO5RjS7jkgUlxwB0c/XvxVQNfY/2ocg7isTY/G7tqxJk5fSTZAA==
dependencies:
dnd-multi-backend "^8.0.3"
react-dnd-html5-backend "^16.0.1"
react-dnd-touch-backend "^16.0.1"

react-dnd-html5-backend@^16.0.1:
version "16.0.1"
resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-16.0.1.tgz#87faef15845d512a23b3c08d29ecfd34871688b6"
integrity sha512-Wu3dw5aDJmOGw8WjH1I1/yTH+vlXEL4vmjk5p+MHxP8HuHJS1lAGeIdG/hze1AvNeXWo/JgULV87LyQOr+r5jw==
dependencies:
dnd-core "^16.0.1"

react-dnd-multi-backend@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/react-dnd-multi-backend/-/react-dnd-multi-backend-8.0.3.tgz#4587645539d28d9985e4c39e9d45ddaffc671e87"
integrity sha512-IwH7Mf6R05KIFohX0hHMTluoAvuUD8SO15KCD+9fY0nJ4nc1FGCMCSyMZw8R1XNStKp+JnNg3ZMtiaf5DebSUg==
dependencies:
dnd-multi-backend "^8.0.3"
react-dnd-preview "^8.0.3"

react-dnd-preview@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/react-dnd-preview/-/react-dnd-preview-8.0.3.tgz#71f22ab64b43ddc7ed8a39bb9b03523ec0dba9e4"
integrity sha512-s69Ro47QYDthDhj73iQ0VioMCjtlZ1AytKBDkQaHKm5DTjA8D2bIaFKCBQd330QEW0SIzqLJrZGCSlIY2xraJg==

react-dnd-touch-backend@^16.0.1:
version "16.0.1"
resolved "https://registry.yarnpkg.com/react-dnd-touch-backend/-/react-dnd-touch-backend-16.0.1.tgz#e73f8169e2b9fac0f687970f875cac0a4d02d6e2"
integrity sha512-NonoCABzzjyWGZuDxSG77dbgMZ2Wad7eQiCd/ECtsR2/NBLTjGksPUx9UPezZ1nQ/L7iD130Tz3RUshL/ClKLA==
dependencies:
"@react-dnd/invariant" "^4.0.1"
dnd-core "^16.0.1"

react-dnd@^16.0.1:
version "16.0.1"
resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-16.0.1.tgz#2442a3ec67892c60d40a1559eef45498ba26fa37"
Expand Down

0 comments on commit f92f884

Please sign in to comment.