Commit Graph

663 Commits

Author SHA1 Message Date
1ilit
653f4010d3 Merge branch 'main' into main 2024-07-26 11:09:49 +03:00
volkankoc
835c1dd41f correction made 2024-07-25 23:29:07 +03:00
1ilit
ab5b02355d
Merge pull request #166 from kartik1112/main
Add French and Punjabi locales
2024-07-26 00:00:15 +04:00
Kartik Buttan
28fa40bfb8 Add Punjabi locale 2024-07-25 23:13:34 +05:30
Kartik Buttan
82b7949e68 Add French locale 2024-07-25 22:59:21 +05:30
volkankoc
7005e0ca53 added Turkish Language 2024-07-25 15:25:13 +03:00
1ilit
faf1699022
Merge pull request #163 from Ameychopde/feat/adding_marathi_in_local
Add marathi translation
2024-07-25 04:50:22 +04:00
1ilit
65960da99c Update registry to ghcr 2024-07-25 03:26:46 +03:00
1ilit
5922fc6575 Merge branch 'joao-zanutto-patch-1' 2024-07-25 03:01:42 +03:00
1ilit
342b9db435 Rename secret
Renamed GITHUB_TOKEN to GH_TOKEN because for some reason secret names starting with GITHUB are not allowed
2024-07-25 02:59:44 +03:00
1ilit
1044e4f797 Merge branch 'patch-1' of https://github.com/joao-zanutto/drawdb into joao-zanutto-patch-1 2024-07-25 02:54:29 +03:00
Amey
c9174deb88 add marathi to local 2024-07-25 00:56:45 +05:30
1ilit
805fc70c0b
Merge pull request #162 from TheMohit2003/issueExternalLinks
User routed to different tab for external links
2024-07-24 11:50:24 +04:00
Mohit
04c38b2992 rel attribute added to anchor tags 2024-07-24 13:15:45 +05:30
Mohit
f9efe66389 User routed to different tab for external links 2024-07-24 10:41:37 +05:30
1ilit
e18122aec0
Merge pull request #159 from eltociear/patch-1
Fix typo in template 3
2024-07-23 20:47:49 +04:00
Ikko Eltociear Ashimine
20de37dc52
chore: update template3.js
recieved -> received
2024-07-24 00:57:29 +09:00
1ilit
85504f317c
Merge pull request #157 from huyjs9/fix/update-title
Fix update title on first page load
2024-07-23 16:47:24 +04:00
1ilit
16b2d30b8c Fix message in timeline for panning 2024-07-22 19:53:11 +03:00
1ilit
faf4b157ff Fix moving tables not working in simple canvas 2024-07-22 09:23:24 +03:00
1ilit
d38713eaa0
Update LICENSE
Update LICENSE to use AGPL instead of MIT
2024-07-21 17:00:32 +03:00
Huy Bui
4485bf73a7 fix: change approach to use key for reconciliation 2024-07-21 17:22:23 +07:00
Huy Bui
1bff574d56 fix: update title on mounted 2024-07-21 16:58:47 +07:00
1ilit
90ee0962d3
Merge pull request #135 from vsn4ik/fullscreen-indicator
Fullscreen native indicator
2024-07-20 11:41:35 +04:00
Vasilii A
9f66df90b1 fullscreen indicator 2024-07-19 23:22:48 +00:00
1ilit
9393f5c933
Merge pull request #156 from FelixZY/fzy/scroll-x/1
feat: support horizontal scrolling
2024-07-18 22:13:26 +04:00
Felix Zedén Yverås
8a736b5ef9 feat: support horizontal scrolling
Certain input devices, such as laptop touchpads, support horizontal
scrolling. This commit adds support for such horizontal scroll
inputs.
2024-07-18 19:47:47 +02:00
1ilit
4d0983b3f7
Merge pull request #148 from FelixZY/fzy/mobile/1
Basic touchscreen support (#147) and rewrite of coordinate management
2024-07-18 00:42:28 +04: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
471d2ebdf0 style: remove //@ts-lint which caused warning 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
47fce123d3 feat: support scroll wheel panning
This is similar to tools like figma, where the scroll wheel pans
the view and scroll is only done if the control key is pressed.

New bindings:
scroll wheel: pan y
shift + scroll wheel: pan x
ctrl + scroll wheel: zoom
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
67851dad8f fix: reduce jitter by disabling pointer events on line 2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
e4e22dee20 fix: rewrite coordinate management
After some initial smaller fixes, it turned out that I had broken
the red line used when linking fields. Fixing this was not trivial
as I found myself battling a lot of small bugs relating to scale
and translation in the existing code. This was made extra difficult
as a lot of coordinates were calculated when necessary in
Canvas.jsx.

This commit attempts to simplify the coordinate management in a few
different ways:
* There are now two distinct coordinate systems in use, typically
  referred to as "spaces". Screen space and diagram space.
* Diagram space is no longer measured in pixels (though the
  dimension-less measure used instead still maps to pixels at 100%
  zoom).
* The canvas now exposes helper methods for transforming between
  spaces.
* Zoom and translation is now managed via the svg viewBox property.
  * This makes moving items in diagram space much easier as the
    coordinates remain constant regardless of zoom level.
* The canvas now wraps the current mouse position in a context
  object, making mouse movement much easier to work with.
* The transform.pan property now refers to the center of the screen.

A new feature in this commit is that scroll wheel zoom is now based
on the current cursor location, making the diagram more convenient
to move around in.

I have tried to focus on Canvas.jsx and avoid changes that might be
desctructive on existing save files. I also believe more refactors
and abstractions could be introduced based on these changes to make
the diagram even easier to work with. However, I deem that out of
scope for now.
2024-07-17 22:22:52 +02:00
Felix Zedén Yverås
32c82168fe feat: add debug coordinate overlay
Makes debugging issues in conversion from screen space
to diagram space easier.

Only adding english translations as I do not speak the
other languages.
2024-07-14 15:36:54 +02:00
Felix Zedén Yverås
354ea47529 fix: validate transform data before storage
During testing I accidentally managed to submit `NaN` as a pan
coordinate. This had the unfortunate side effect of bricking the
editor.

Given the serverity of an accidental `NaN` and that `NaN`s are not
impossible considering the amount of math involved in mouse move
operations, this commit introduces a simple validation step.

The new validation step should additionally be able to unstuck
anyone who have happened into this state by accident already.
2024-07-14 15:36:54 +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
075a98d444 fix: remove unused ref 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
lilit
4a7d312e2a
Merge pull request #153 from FelixZY/fzy/url/1
fix: update remaining vercel urls to drawdb.app
2024-07-14 00:45:53 +04:00
Felix Zedén Yverås
95e84705fb fix: update remaining vercel urls to drawdb.app
@1ilit started making similar changes in 4cc0811.

This commit performs a full search and replace for
`drawdb.vercel.app` to `drawdb.app`, fixing remaining "bad" urls.
2024-07-13 12:58:36 +02:00
1ilit
a459f36f58 Fix increment being deleted when type is updated 2024-07-10 21:23:30 +03:00
1ilit
84abae7d06 Save database type and enums for templates 2024-07-08 11:54:04 +03:00
1ilit
6fee6553f1 Remove unnecessary commas in export index statements 2024-07-08 04:22:44 +03:00
1ilit
159dcca4dc Fix import diagram 2024-07-08 04:03:41 +03:00
1ilit
09f9117b72 Remove unused console.logs 2024-07-08 03:39:01 +03:00
1ilit
f682abdafe Fix import index for postgres 2024-07-08 03:34:01 +03:00
1ilit
52455a75d0 Make databases a proxy 2024-07-08 03:21:43 +03:00
1ilit
c84990ca6d Fix loading the diagram on open to load in types and enums 2024-07-08 02:18:12 +03:00
1ilit
c907cfea47 Add database icon to diagrams 2024-07-08 02:09:51 +03:00