1
0
Fork 0
Commit graph

59 commits

Author SHA1 Message Date
Joost De Cock
3671f44e90 chore: Move core files to .mjs 2022-08-26 18:51:02 +02:00
Joost De Cock
eccdd23ded Merge branch 'proposal-parts' into v3-phase1 2022-08-26 12:38:39 +02:00
Enoch Riese
10fe19455d don't render empty pdf pages 2022-08-17 00:34:25 -05:00
joostdecock
681a1fc657 wip: Handle backwards compatibility for passing parts as array
This was broken by some earlier changes, but not it's ok again
2022-08-15 10:48:35 +02:00
joostdecock
7f684d8c17 wip: Pass parts to design constructor as array
Since the part name needs to be set in the part, this makes
it more clear as there's no key associated with the part.
2022-08-14 18:16:15 +02:00
joostdecock
2b254c721d wip: Recursive resolving of (non-injected) dependencies
We started out with following dependencies that are injected
(from) and now added dependencies that are merely required to
be drafted first (after).

This also adds further support for part-level configuration.
2022-08-14 16:59:51 +02:00
joostdecock
4cf9c3bd47 wip: Added part-level dependencies
Restructured code a bit to handle all part-level config in one call.

Removed check in shorthand for debug as it's no longer used.
Updated tests to not fall over on different error message format in
newer NodeJS versions
2022-08-13 18:33:06 +02:00
joostdecock
689f908f68 wip: Allow runtime adding of parts
Just call `pattern.addPart()` and pass it either:
 - a part object with all it entails
 - a draft method as first and name as second parameter

This will overwrite any existing parts without any warning
2022-08-13 15:11:33 +02:00
Joost De Cock
a1a3e1c194 fix(core): Fixes for backwards compatibility 2022-08-10 16:24:25 +02:00
joostdecock
70bd946bdc wip(core/brian/aaron): Support for 2022 style part inheritance
This is very rough around the edges, but it's kinda working, so
I'm committing this now.

What this enabled is the ability to extend a part by importing
only that part and then just saying you want a part `from` the
imported one.

The imported part comes with all options, it does not currently
come with all measurements.

This also *follows* dependencies. For example in Brian, we never
explicitly add the base and sleevecap parts, they are simply
added automatically because other parts are buily *from* them.

Best to look at the source code of designs/brian and designs/aaron
to understand what's going on and how it is different.
2022-08-09 20:17:35 +02:00
joostdecock
ac9b616b99 wip(core): Support for 2022 style Design constructor
This is the first commit to tackle some exploratory work
in the context of discussion #2538 that deals with a number
of things, such as:

- Making it easier to attach parts to designs
- Making it easier to attach parts at run-time
- Simplify part inheritance into other designs
- Find ways to handle dependenices across designs
- Find ways to keep the part-specific config with the part

In this initial commit, I've update the Design constructor to
handle two different ways of calling it:

- legacy: new Design(config, plugins, conditionalPlugins)
- 2022: new Design(config)

I didn't want to call this the `new` way because that doesn't
age well, so I went with `legacy` and `2022` and this is how I
will refer to them from now on.

This is very much a work in progress and while I will create a PR
to keep on eye on the tests, I don't expect to merge this as-is.
2022-08-07 17:29:33 +02:00
joostdecock
6acb9f976a feat(core): Added pattern.getCutList() method 2022-07-31 14:32:24 +02:00
joostdecock
1c87769e87 chore(core): Syntax change for better test coverage 2022-07-30 15:16:17 +02:00
Enoch Riese
404718c776 clean up and document 2022-06-28 16:41:44 -05:00
Enoch Riese
b2fcee3037 consistently set up part transforms 2022-06-28 16:13:21 -05:00
Joost De Cock
0b1137f09b chore: Linter run 2022-03-28 19:38:18 +02:00
Joost De Cock
9b5c8a8751 wip(core): Changes to facilitate manual layouts 2022-03-06 18:55:13 +01:00
Joost De Cock
9541fea78c feat(core): Added autoLayout pattern prop 2022-02-25 08:29:28 +01:00
Joost De Cock
f4ee97a626 feat(core): Added the postLayout lifecycle hook 2022-02-20 18:45:44 +01:00
Joost De Cock
6dad5ca833 chore(core): Always raise debug
Currently we check in many different places whether debug is enabled
prior to raising a debug event.

This changes that to always raise debug, but let the debug.raise()
method only store it on the pattern object if/when debug is
enabled.
2022-01-28 18:18:37 +01:00
Joost De Cock
c13b063bb5 fix(core): Use default import for JSON 2022-01-25 09:29:09 +01:00
Joost De Cock
2234155052 chore: Fixed linter warnings 2022-01-20 09:07:38 +01:00
Joost De Cock
bb8a3a960e wip(core): Changes to support settings.scale. See #1638 2022-01-15 21:28:48 +01:00
Joost De Cock
e4a87f3324 feat(core): Added scale setting 2021-12-24 14:47:42 +01:00
Joost De Cock
5343427e0d chore: linter warnings 2021-11-13 14:55:04 +01:00
joostdecock
7ec07d9db2 fix(core): Remove unneeded warning 2021-10-16 12:28:45 +02:00
joostdecock
1d3a4acd60 chore: Linter run 2021-10-08 17:32:12 +02:00
joostdecock
9f9f3e7f7a Merge branch 'snap-proposal' into develop 2021-10-06 18:35:41 +02:00
joostdecock
dde9de28dc feat(core): Pattern.on() now returns pattern and is chainable 2021-09-28 19:16:35 +02:00
joostdecock
025cf9b88e feat(core): Snapping of percentage options
This commit implements the snapping of percentage options as
outlined in this proposal:

https://github.com/freesewing/freesewing/discussions/1331

Please refer to the link above for all details
2021-09-15 20:20:59 +02:00
Joost De Cock
f191151ee4 chore: Linter changes 2021-04-24 10:16:31 +02:00
Joost De Cock
5c72645d45 fix(core): Treat dependencies as array
This is for #971
2021-04-23 20:09:16 +02:00
Joost De Cock
c7395cd9d9 Fix(core): Resolve array-based dependencies
Tentative fix for #971
2021-04-23 17:42:03 +02:00
Sanne Kalkman
fc4124e62e remove space in translate svg 2020-11-23 16:50:32 +01:00
Joost De Cock
1a5b2769aa feat(components): Better snippet support in Draft component
The Draft react component would load the snippets that are part of our
plugin bundle. However, any additional snippets that are created by
plugins would not not get added to the `defs` section, and thus not
be rendered.

This changes the behavior by doing two things:

 - in `core` it adds an SVG object to the renderProps, and makes
   sure to run the `preRender` hook on this SVG object prior to
   returning the renderProps. This way, svg.defs now holds all
   defs, including any that may have been added by custom plugins
 - in the `Draft` component, we no longer add a list of predefined
   snippets to the defs section, but instead just use the svg.defs
   section verbatim. This removes any discrepancies in how SVG
   rendering and React rendering handles the defs section of the
   SVG document, and thus displays snippets.
2020-11-08 18:19:10 +01:00
Joost De Cock
72c2a6c9e7 feat(core): Added support for conditional plugins 2020-09-12 19:01:12 +02:00
Joost De Cock
a76ae76fb0 feat(core): Added info type to raise method 2020-09-12 16:31:55 +02:00
Joost De Cock
39d1cdd0ca feat(core): Added name property to parts to hold the part name 2020-08-30 11:48:09 +02:00
Joost De Cock
9125b49841 chore(core): Fixed linter warnings 2020-08-23 17:09:09 +02:00
Joost De Cock
01ab30656d chore(core): Removed info event type 2020-07-23 10:27:03 +02:00
Joost De Cock
9ace3b6255 fix(core): Fixed typo in debug code 2020-07-21 13:07:31 +02:00
Joost De Cock
4ac64e05cb chore: Further tweaks to pattern events 2020-07-19 13:01:01 +02:00
Joost De Cock
03da84b824 feat(core): Added new debug event type and debug system 2020-07-18 16:48:29 +02:00
Joost De Cock
b360359cf6 feat(core): Added debug as event type 2020-07-17 14:44:16 +02:00
Joost De Cock
583abb0236 feat(core): Added support for raising events 2020-07-11 18:04:29 +02:00
Joost De Cock
7d3815939b feat(core): Added support for custom sample styles 2020-07-11 15:15:02 +02:00
Joost De Cock
673743faae feat(core): Add support for injecting sample styles
This allows you to override the (path) styles when we
sample the pattern by setting `settings.sample.styles`.

This closes #380
2020-05-30 14:02:37 +02:00
Joost De Cock
ff82e2568b feat: Do not set plugin configuration object on pattern.use()
Plugins can pass a configuration object (or any
sort of data) when loaded with `pattern.use()`.

We use to set that parameter to `false` when loading, but
now we leave it `undefined`. This makes is easy for plugins
to use a default parameter for the configuration/data passed
to it.
2020-04-18 11:36:02 +02:00
Joost De Cock
6710d76b08 🎨 Updated prettier config 2019-08-03 15:03:33 +02:00
Joost De Cock
45498afbba 🐛 Prevent draft method from forcing render of hidden part 2019-07-08 15:37:27 +02:00