Commit Graph

24 Commits

Author SHA1 Message Date
1ilit
9aec2f02d0 Prevent creating duplicates when loading from gist 2024-09-01 19:15:58 +04:00
1ilit
c6c24d02b9 Load diagram from gist 2024-09-01 13:22:04 +04:00
1ilit
ed7fd87f7a Fix gists being controlled on button load 2024-08-31 19:49:43 +04:00
1ilit
7dcecf3c1f Create and update gist on click 2024-08-29 17:05:47 +04:00
tasnim
94a076c9bc rtl-fix address issues 2024-08-05 11:31:11 +03:00
tasnim
5ec54e2445 Display UI in RTL languages correctly 2024-08-04 15:27:31 +03:00
Felix Zedén Yverås
5a56c3b354 refactor: export CanvasContextProvider to follow established context pattern
As noted [in the review](
https://github.com/drawdb-io/drawdb/pull/148#discussion_r1681584836
), I disagree with this pattern. However, I will follow it to get
these features added.
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
3659ba9143 fix: release pointer capture when using onPointerLeave events
Certain input sources (such as touch) are "captured" when they
press an element. This means the pointer is always considered
"inside" the element by the browser, even when they visually are
not. This caused some issues on mobile browsers where touch and
stylus events could not connect table columns with each other.

Just to be safe, I've added the required `releasePointerCapture`
call everywhere `onPointerEnter` or `onPointerLeave` is used.
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
cdecf7c633 feat: add basic touchscreen support
This is basically a migration from mouse events to
[pointer events](
  https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events
).

The `PointerEvent` interface inherits all of the `MouseEvent`
properties, meaning that existing code can essentially be left
as-is. The only major change is making sure we only respond to the
"primary" pointer.

Known issues include:
* stylus hover is not detected
* touchscreens do not have a concept of hover, making it difficult
  to e.g. resize areas
* no touch gesture support, e.g. "pinch-to-zoom"
2024-07-14 15:36:54 +02:00
Felix Zedén Yverås
caae8e7385 fix: improve support for browsers with collapsing url bars
Some mobile browsers (e.g. chrome) uses collapsing url bars (the
bar collapses when you scroll). In such cases, `100vh` typically
refers to the full height of the viewport when the url bar is
collapsed (see also `svh`, `lvh` and `dvh`, e.g. at
<https://ishadeed.com/article/new-viewport-units/#the-small-large-and-dynamic-viewport-units>
). This meant that on my tablet, the editor would extend below the
visible page until I scrolled it into view.

This commit re-uses a fix from some of my other projects
(specifically
<5c7e788d40/src/styles/globals.css (L14-L28)>
) where the root element is set to fill 100% height. This avoids
dealing with viewport units altogether. On my tablet, this means
that the url bar is visible and that the editor does not extend
below the visible page.
2024-07-14 15:36:54 +02:00
1ilit
aecc5a134e Fix choose database not showing on first ever diagram 2024-07-08 01:42:48 +03:00
1ilit
9b606114df Rename TablesContext to DiagramContext 2024-07-04 23:18:20 +03:00
1ilit
a7fd4ec416 Fix select db modal opening after close 2024-07-04 20:57:06 +03:00
1ilit
810afe4bc0 Add enums tab 2024-06-30 13:19:21 +03:00
1ilit
d79b0c205d Return types after import 2024-06-27 11:12:09 +03:00
1ilit
b13d576c5e Require selecting a db on new diagrams 2024-06-09 18:10:51 +03:00
1ilit
be6ecb066c Load types for selected db 2024-06-06 20:24:05 +03:00
pvhieu
e30a84398f Fix: load name of lastest modified diagram 2024-05-19 10:17:01 +07:00
1ilit
83985ba188 Clean up workspace 2024-04-05 22:09:43 +03:00
1ilit
afa8fca00c Fix import 2024-04-05 06:32:35 +03:00
1ilit
8cf95a9a06 Fix imports for hooks 2024-04-05 05:12:50 +03:00
1ilit
9df9527950 Reorganize files 2024-04-01 19:44:50 +03:00
1ilit
3ec93f42c6 Make variable naming consistent 2024-03-15 16:37:22 +02:00
1ilit
1132edbbb3 Abstract save state from editor 2024-03-15 16:00:23 +02:00