1
0
Fork 0
Commit graph

174 commits

Author SHA1 Message Date
Joost De Cock
cb01cd6b8e fix(www): Layout fixed to blog pages 2022-05-30 16:40:51 +02:00
Joost De Cock
4e90549dd9 chore(shared): Better styling for prev-next component 2022-05-30 16:26:19 +02:00
Joost De Cock
6c79c0ba8e fix(shared): Let RightIcon take className prop 2022-05-30 16:26:01 +02:00
Joost De Cock
e47f47cf99 wip(org): Added blog post pages 2022-05-30 15:36:39 +02:00
Joost De Cock
6714ce7d52 wip(org): Work on new site 2022-05-29 17:43:43 +02:00
Joost De Cock
f1c291491f wip(org): Added translation support and locale picker 2022-05-29 11:58:48 +02:00
Joost De Cock
36a020642e wip(org): Add showcase icon to primary navigation 2022-05-26 19:35:43 +02:00
Joost De Cock
6353117acb wip(org): Additional icons 2022-05-25 18:48:00 +02:00
Joost De Cock
7aba490544 feat(shared): Use i18n-next for example translations 2022-05-24 19:04:00 +02:00
Joost De Cock
b9d9d4bc14 feat(shared): Handle degree measurements input 2022-05-21 12:40:31 +02:00
Joost De Cock
29fe78843f feat(shared): Better theme support in Dot 2022-05-20 16:27:51 +02:00
Joost De Cock
038588bf9c feat(shared): Support for translation in Dot custom component 2022-05-20 15:34:08 +02:00
Joost De Cock
71e6278c57 feat(shared): Added new Dot custom component 2022-05-20 14:28:42 +02:00
Joost De Cock
8c094dc22e fix(lab): Contain code blocks on mobile screen with break-all 2022-05-15 18:44:36 +02:00
Joost De Cock
7aff532639 fix(lab): Add space in title so it can wrap 2022-05-15 15:12:32 +02:00
Joost De Cock
a395873024 feat(lab): Close navigation when testing options 2022-05-15 15:11:50 +02:00
Joost De Cock
88b19dd2df feat(lab): Require Ctrl-key to zoom with mouse wheel 2022-05-15 15:03:19 +02:00
Joost De Cock
4d59cf59be fix(lab): Be explicit about closing navigation on gist updates 2022-05-15 14:46:03 +02:00
Joost De Cock
c3b9c07236 feat(lab): Close navigation on mobile when switching view in workbench 2022-05-14 19:53:27 +02:00
Joost De Cock
c3e54687fc fix(lab): Add mobile navigation 2022-05-14 19:53:27 +02:00
Joost De Cock
2c5f0fa332 fix(lab): Layout improvements 2022-05-14 14:53:29 +02:00
Joost De Cock
ed535bbe8c feat(lab): Tweaks to pattern overview pages 2022-05-14 14:13:35 +02:00
Joost De Cock
932fa62103 feat(lab): Updated homepage 2022-05-13 21:11:39 +02:00
Joost De Cock
71d03bfb45 chore(freesewing.dev): Layout tweaks 2022-05-12 19:17:51 +02:00
Joost De Cock
be08f0a695 feat(freesewing.dev) Homepage tweaks 2022-05-12 10:27:42 +02:00
Joost De Cock
e4a61c6502 chore(freesewing.dev): Layout composition changes 2022-05-11 17:41:24 +02:00
Joost De Cock
6c41b1d941 feat(freesewing.dev): ToC and layout changes 2022-05-11 16:29:46 +02:00
Joost De Cock
d4833fb6a4 feat(lab): Add support for multiple versions in the lab 2022-03-26 18:06:14 +01:00
Joost De Cock
1ccb1ae4b8 feat(lab): Console log options in xray 2022-03-26 18:06:14 +01:00
Joost De Cock
b505e6123f fix(lab): Grammar issue in error message
Shout-out to @anna-puk for reporting this
2022-03-24 12:45:27 +01:00
Joost De Cock
a912008117 wip(lab): Tweaks to events display 2022-03-24 11:43:00 +01:00
Joost De Cock
9495e9207c wip(lab): Moved error to its own component 2022-03-24 11:43:00 +01:00
Joost De Cock
8a2a13f240 wip(lab): Working on crash reporting in the new dev env 2022-03-18 19:11:00 +01:00
Joost De Cock
5cfcd2e274 wip(lab): Working on preloading pattern settings 2022-03-17 19:05:19 +01:00
Joost De Cock
c639f50a62 fix: Linter warnings 2022-03-13 17:29:22 +01:00
Joost De Cock
10adb33402 fix(lab): Issues after linter fixes 2022-03-13 14:38:48 +01:00
Joost De Cock
9fc3752d8d
Update packages/freesewing.shared/components/workbench/layout/print/pagesize-picker.js
Co-authored-by: Nick Dower <nicholasdower@gmail.com>
2022-03-13 14:33:20 +01:00
Joost De Cock
9bb6dbe179
Update packages/freesewing.shared/components/workbench/layout/print/pagesize-picker.js
Co-authored-by: Nick Dower <nicholasdower@gmail.com>
2022-03-13 14:33:15 +01:00
Joost De Cock
a254baa747
Update packages/freesewing.shared/components/workbench/layout/draft.js
Co-authored-by: Nick Dower <nicholasdower@gmail.com>
2022-03-13 14:33:10 +01:00
Joost De Cock
74cf28b871 chore: Fixed linter warnings 2022-03-13 08:48:21 +01:00
Joost De Cock
67da7dd595 feat(lab): First stab at custom layout
This adds a React component to handle custom layouts.
This React component is a long way from perfect, but it's a start.

There are two reasons that (at least in my opinion) implementing this is non-trivial:

1) React re-render vs DOM updates

   For performance reasons, we can't re-render with React when the user drags a
   pattern part (or rotates it). It would kill performance.
   So, we don't re-render with React upon dragging/rotating, but instead manipulate
   the DOM directly.

   So far so good, but of course we don't want a pattern that's only correctly laid
   out in the DOM. We want to updat the pattern gist so that the new layout is stored.
   For this, we re-render with React on the end of the drag (or rotate).

   Handling this balance between DOM updates and React re-renders is a first contributing
   factor to why this component is non-trivial

2) SVG vs DOM coordinates

   When we drag or rotate with the mouse, all the events are giving us coordinates of
   where the mouse is in the DOM.

   The layout uses coordinates from the embedded SVG which are completely different.
   So we need to make this translation and that adds complexity.

3) Part-level transforms

   It's not just that the DOM coordinates and SVG coordinate system is different, each
   part also has it's own transforms applied and because of this behaves as if they have
   their own coordinate system.

   In other words, a point (0,0) in the part is not the top-left corner of the page.
   In the best-case scenario, it's the top-left corner of the part. But even this is
   often not the case as parts will have transforms applied to them.

4) Flip along X or Y axis

   Parts can be flipped along the X or Y axis to facilitate a custom layout.
   This is handled in a transform, so the part's coordinate's don't actually change. They
   are flipped late into the rendering process (by the browser displaying the SVG).

   Handling this adds yet more mental overhead

5) Bounding box

   While moving and rotating parts around is one thing. Recalculating the bounding box
   (think auto-cropping the pattern) gets kinda complicated because of the reasons
   outlined above.

   We are currently handling a lot in the frontend code. It might be more elegant to move
   some of this to core. For example, core expects the custom layout to set the widht and height
   rather than figuring it out on its own as it does for auto-generated layouts.

 Known issues

 - Rotating gets a little weird sometimes as the part rotates around it's center in the
   SVG coordinate system, but the mouse uses it's own coordinates as the center point that's
   used to calculate the angle of the rotation

 - Moving parts into the negative space (minus X or Y coordinated) does not extend the bounding box.

 - Rotation gets weird when a part is mirrored

 - The bounding box update when a part is rotated is not entirely accurate

I've sort of left it at this because I'm starting to wonder if we should perhaps re-think
how custom layouts are supported in the core. And I would like to discuss this with the core team.
2022-03-12 18:54:47 +01:00
Joost De Cock
b948904de1 wip(lab): Working on handling layout 2022-03-06 18:54:30 +01:00
Joost De Cock
dd5599c5d6 wip(lab): Working on layout feature 2022-02-25 08:30:03 +01:00
Joost De Cock
a4906eac64 feat(workbench): Show page count on layout 2022-02-20 19:29:14 +01:00
Joost De Cock
99232fe020 chore(workbench): move xray to _state in gist 2022-02-20 19:02:25 +01:00
Joost De Cock
34c8a6b2a5 wip(shared): Working on custom layout 2022-02-20 18:46:21 +01:00
Joost De Cock
2473e225ed feat(workbench): Added export 2022-02-19 17:01:28 +01:00
Joost De Cock
e260d9c634 feat(shared): Added link components 2022-02-19 17:01:05 +01:00
Joost De Cock
daa0c7b488 feat(shared): Popout now takes compact, noP props 2022-02-19 17:00:46 +01:00
Joost De Cock
60321d2342 fix(shared): Correct namespace for translation 2022-02-19 14:21:54 +01:00