Compare commits

...

193 Commits

Author SHA1 Message Date
Dylan Vorster
63b39cba79 Merge pull request #1019 from projectstorm/changeset-release/master
Version Packages
2023-09-23 14:24:05 -06:00
github-actions[bot]
a671b50e09 Version Packages 2023-09-23 20:22:45 +00:00
Dylan Vorster
7a664d5b64 Merge pull request #1018 from projectstorm/pnpm_upgrade
Maintenance
2023-09-23 14:22:03 -06:00
Dylan Vorster
66c687afc6 changeset 2023-09-23 14:18:27 -06:00
Dylan Vorster
23b5467806 upgrade everything 2023-09-23 14:16:35 -06:00
Dylan Vorster
1889c7cb40 lockfile 2023-09-23 14:00:39 -06:00
Dylan Vorster
c3146e1aa8 Update README.md 2023-09-23 13:57:22 -06:00
Dylan Vorster
8fb8d04885 Update README.md
missed a few
2023-09-23 13:56:44 -06:00
Dylan Vorster
74e814ab5a Update README.md
This project uses pnpm instead of yarn
2023-09-23 13:56:17 -06:00
Dylan Vorster
3d4e0b24d7 Merge pull request #1007 from projectstorm/dylanvorster-patch-1
Update CHANGELOG.md
2023-06-04 15:32:08 -06:00
Dylan Vorster
efd64ad278 Update CHANGELOG.md 2023-06-04 15:32:01 -06:00
Dylan Vorster
160b88fccf Merge pull request #990 from projectstorm/changeset-release/master
Version Packages
2023-03-05 10:56:47 -07:00
github-actions[bot]
80cd9c9306 Version Packages 2023-03-05 17:56:31 +00:00
Dylan Vorster
2de55fdf68 Merge pull request #989 from projectstorm/sources
inline sources in source map
2023-03-05 10:55:51 -07:00
Dylan Vorster
b8a4cbdf1a changeset 2023-03-05 10:54:52 -07:00
Dylan Vorster
76a2659948 inline sources 2023-03-05 10:53:27 -07:00
Dylan Vorster
63e33c07d8 Merge pull request #981 from projectstorm/changeset-release/master
Version Packages
2023-01-24 20:25:08 -07:00
github-actions[bot]
70b17a749c Version Packages 2023-01-25 00:17:49 +00:00
Dylan Vorster
4ccc5d58f3 Merge pull request #980 from projectstorm/features
Some Features and fixes
2023-01-24 17:17:09 -07:00
Dylan Vorster
fb7d646bde prettyier and changset 2023-01-24 17:14:38 -07:00
Dylan Vorster
e0d21f1435 pretty and changeset 2023-01-24 17:09:35 -07:00
Dylan Vorster
6ed1e0f89d Merge branch 'features' of github.com:projectstorm/react-diagrams into features 2023-01-24 17:08:12 -07:00
Dylan Vorster
7da7fa4cc9 merge 2023-01-24 17:07:59 -07:00
Dylan Vorster
ed7988f722 Merge branch 'h0111in-Reroute-(redistribute)-links-only,-based-on-current-nodes-positions-#731' into features 2023-01-24 17:06:30 -07:00
Dylan Vorster
e6b86321e2 Merge branch 'Reroute-(redistribute)-links-only,-based-on-current-nodes-positions-#731' of https://github.com/h0111in/react-diagrams into h0111in-Reroute-(redistribute)-links-only,-based-on-current-nodes-positions-#731 2023-01-24 17:00:47 -07:00
Dylan Vorster
17bb78b130 Merge pull request #939 from ToTheHit/update_default_link_widget
Remove hardcode for PointModel in DefaultLinkWidget.tsx
2023-01-24 16:56:27 -07:00
Dylan Vorster
ddeea124b0 Merge pull request #977 from projectstorm/changeset-release/master
Version Packages
2023-01-24 15:11:51 -07:00
github-actions[bot]
fcdbce54b5 Version Packages 2023-01-24 22:11:19 +00:00
Dylan Vorster
f1c38fb84a Merge pull request #979 from projectstorm/changelog
changelog
2023-01-24 15:10:42 -07:00
Dylan Vorster
74f9269869 changelog 2023-01-24 15:08:51 -07:00
Dylan Vorster
a28bcc037d Merge pull request #978 from projectstorm/readme
house keeping
2023-01-24 14:16:06 -07:00
Dylan Vorster
456e6b1b67 house keeping 2023-01-24 14:15:29 -07:00
Dylan Vorster
c9e819d78e Merge pull request #976 from projectstorm/changeset
V7
2023-01-24 13:40:54 -07:00
Dylan Vorster
8a2f5d198f changeset update 2023-01-24 13:32:30 -07:00
Dylan Vorster
251a1f9484 reworked geometry demo 2023-01-24 13:25:26 -07:00
Dylan Vorster
c1eac9873a lockfile 2023-01-23 21:38:49 -07:00
Dylan Vorster
95b35d6778 get rid of puppeteer 2023-01-23 20:47:36 -07:00
Dylan Vorster
d2a197245b pls3 2023-01-23 20:32:57 -07:00
Dylan Vorster
8f06e55127 pls 2023-01-23 20:25:14 -07:00
Dylan Vorster
b0e8e52077 pls2 2023-01-23 20:23:06 -07:00
Dylan Vorster
0d23e933e8 pls 2023-01-23 20:21:32 -07:00
Dylan Vorster
4dfeb403be CI test 4 2023-01-23 20:10:55 -07:00
Dylan Vorster
0e19827675 obviously we need pnpm 2023-01-23 20:07:01 -07:00
Dylan Vorster
2b1f54bbc9 CI test 2 2023-01-23 20:04:32 -07:00
Dylan Vorster
b3a6cc01fa CI test 1 2023-01-23 20:03:19 -07:00
Dylan Vorster
918d8d741b oh 2023-01-23 20:01:09 -07:00
Dylan Vorster
d15fb13adf why this so hard 2023-01-23 19:59:36 -07:00
Dylan Vorster
4f2b6132ba circleci begone 2023-01-23 19:56:17 -07:00
Dylan Vorster
7d9d137c66 test changeset trigger 2023-01-23 19:42:54 -07:00
Dylan Vorster
b051697791 github stuffs 2023-01-23 19:37:49 -07:00
Dylan Vorster
8fc9fe3aae more changes to the bundling and deps 2023-01-23 19:33:49 -07:00
Dylan Vorster
b4185dcb76 got storybook working again 2023-01-23 13:57:51 -07:00
Dylan Vorster
c1fa7ee865 docs fix 2023-01-23 13:47:50 -07:00
Dylan Vorster
05a5afb20e moved over more dependencies 2023-01-23 13:44:43 -07:00
Dylan Vorster
8bcc1436d3 changsets and v7 2023-01-23 12:56:25 -07:00
Dylan Vorster
9b39591d94 Merge pull request #954 from vadimshvetsov/patch-1
Update peer deps in react-canvas-core for working with React 18
2022-11-30 02:36:43 -07:00
Vadim Shvetsov
88296c28b4 Update package.json 2022-07-07 12:32:33 +03:00
Dylan Vorster
2a810ca2d3 changelog 2022-06-03 16:02:08 -06:00
Dylan Vorster
dfcf82e692 v6.7.4 2022-06-03 15:59:56 -06:00
Dylan Vorster
cd93bb96a3 v6.7.3 2022-06-03 15:59:24 -06:00
Dylan Vorster
5f49bbe5b1 v6.7.2 2022-06-03 15:58:45 -06:00
Dylan Vorster
d55790edcf Merge pull request #947 from projectstorm/upgrade
Upgrade all the things
2022-06-03 15:57:57 -06:00
Dylan Vorster
a1b2f6a59e v6.7.2-alpha.0 2022-06-03 15:48:20 -06:00
Dylan Vorster
e7b352644d v6.7.1-alpha.0 2022-06-03 15:47:17 -06:00
Dylan Vorster
2f620ce4af upgrade react storybook 2022-06-03 15:29:48 -06:00
Dylan Vorster
897bde204e upgrades 2022-06-03 15:21:23 -06:00
Dylan Vorster
2d9fca171c Merge pull request #927 from BenjaVR/fix/show-actions-addon
Register and enable the 'actions' addon panel
2022-05-04 09:21:20 -06:00
Dmitry Ushakov
77011af27a Remove hardcode for PointModel in DefaultLinkWidget.tsx 2022-05-04 18:07:31 +03:00
Benjamin Van Renterghem
32d47270cb Register and enable the 'actions' addon 2022-04-10 23:00:50 +02:00
Dylan Vorster
3060496db0 changelog 2022-02-06 22:51:19 -07:00
Dylan Vorster
02a37fcf1f v6.7.0 2022-02-06 22:38:45 -07:00
Dylan Vorster
e4848b4784 Merge pull request #875 from GaryPan-1515/GP-fix-zoom-to-fit-nodes
Fix the zoomToFitNodes offsets calculation
2022-02-06 22:28:29 -07:00
Dylan Vorster
c4d0136402 Merge pull request #877 from lancety/patch-1
Update DefaultPortModel.ts
2022-02-06 22:25:04 -07:00
Dylan Vorster
413838b841 Merge pull request #906 from Joecha95/master
Improve type of baseListener
2022-02-06 22:23:24 -07:00
Dylan Vorster
9b5b14d144 Merge pull request #914 from DaSilvaRemi/patch-1
Correct bug of not deleted link
2022-02-06 22:21:11 -07:00
Dylan Vorster
f8fa5564c1 Merge pull request #915 from carb/master
Add optional PanAndZoomCanvasAction for trackpad support
2022-02-06 22:16:42 -07:00
Carlo Biedenharn
24ff005d9e Add optional PanAndZoomCanvasAction for trackpad support 2021-12-23 17:00:10 -08:00
Da Silva Rémi
04d5bc97f7 Update LinkModel.ts 2021-12-21 16:38:16 +01:00
Da Silva Rémi
d7aa385cf5 Update LinkModel.ts 2021-12-21 16:35:50 +01:00
Da Silva Rémi
b2fa681494 Correct bug of not deleted link
I correct the BUG of the Link doesn't delete when it's not connected to a target port  related on issue #895
2021-12-21 16:30:35 +01:00
Joel Charles
a2ac399632 Improve type of baseObserver 2021-11-19 15:49:11 +01:00
Dylan Vorster
3d0521cc93 Merge pull request #882 from vadimshvetsov/fix-set-position
Fix set position bug
2021-11-12 10:17:34 -07:00
Dylan Vorster
1825076cd4 Merge pull request #891 from parties/patch-1
Update README.md with improved instructions for running the demos
2021-11-12 10:16:02 -07:00
Eric Ogden
00d92392cc Update README.md
Update the `Run the demos` section with additional instructions to get the demos running
2021-10-06 11:50:42 -07:00
Vadim Shvetsov
d07f3a3047 Return setPosition for PortModel 2021-08-25 16:45:53 +03:00
Vadim Shvetsov
d21e8e8860 Fix typo in const vs import 2021-08-24 17:26:44 +03:00
Vadim Shvetsov
25bf056b0a Remove setPosition from PortModel 2021-08-24 17:20:30 +03:00
Vadim Shvetsov
5ebe6f84cd Use this.position instead of this.getPosition() method 2021-08-24 17:13:48 +03:00
Vadim Shvetsov
adc173f689 Change let to const in setPosition methods 2021-08-24 16:39:25 +03:00
Vadim Shvetsov
889108d7fd fix: Fix set position 2021-08-24 16:21:26 +03:00
lancety
09c2014efc Update DefaultPortModel.ts
when making custom port with custom styled link, I need to make a custom port model, which need a custom type in constructor, but options.type is missing in the DefaultPortModel constructor props type. 
So I added it in.
2021-08-17 07:57:21 +10:00
Gary Pan
cd22725103 fix the zoom to fit nodes offsets calculation 2021-08-13 15:09:52 -07:00
Dylan Vorster
dd68d1fe67 changelog 2021-08-10 02:20:52 +02:00
Dylan Vorster
8b2f5c8961 v6.6.1 2021-08-10 02:09:28 +02:00
Dylan Vorster
e23b68b2d1 sigh 2021-07-24 01:36:34 +02:00
Dylan Vorster
77e1abba97 Merge pull request #861 from rkesters/rkesters/fixDeps
Updated deps to newest version and allow both react 16 and 17 as a peer #860
2021-07-24 00:48:41 +02:00
Dylan Vorster
db25ec3cca Merge pull request #871 from vadimshvetsov/fix-touch-mouse-event
Fix touch with mouse event bug on selection box usage
2021-07-24 00:44:02 +02:00
Dylan Vorster
61882f0637 Merge pull request #869 from chensjlv/master
add docs for customizing nodes
2021-07-24 00:43:08 +02:00
Dylan Vorster
c9098377dc Update README.md 2021-07-24 00:42:35 +02:00
Dylan Vorster
a0bbde14cf Merge pull request #870 from vadimshvetsov/fix-port-parent
Fix parent prop on port cloning
2021-07-24 00:41:51 +02:00
Vadim Shvetsov
ee30b45ff0 Fix touch with mouse event bug 2021-07-22 21:14:04 +03:00
Vadim Shvetsov
36a3eddca7 Fix port parent prop on clone 2021-07-22 14:55:35 +03:00
Mike Chen
1ad8d79b4c add docs for customizing nodes 2021-07-19 15:04:36 -07:00
Robert Kesterson
87a75437c3 Change @types/node to v15.6.1, v16 not compatible with jest 2021-07-18 22:46:29 -04:00
Robert Kesterson
ad4efe70e7 updated deps to exact versions and removed use of npx 2021-07-11 17:30:49 -04:00
Robert Kesterson
9460ce8eeb Updated dependecies to support both react 16 and 17
Updated test to work with jest 27

Prettier changes
2021-07-11 17:27:31 -04:00
Dylan Vorster
8e7b7cd05e changelog 2021-07-11 18:25:29 +02:00
Dylan Vorster
f661824282 v6.6.0 2021-07-11 18:21:20 +02:00
Dylan Vorster
5b2ceabfd4 bump 2021-07-11 18:18:18 +02:00
Dylan Vorster
bb6e1d52af Merge pull request #852 from ELennard/fix-removeMiddlePoints
Fixes removeMiddlePoints in LinkModel.ts.
2021-07-11 18:12:15 +02:00
Dylan Vorster
be422431d2 Merge pull request #828 from renato-bohler/touch-events
Adds support for touch events, enabling touch dragging the canvas
2021-07-11 18:09:41 +02:00
Dylan Vorster
66184bd0fa Merge pull request #860 from vadimshvetsov/fix-label
Fix LabelModel deserialization and react incompatibility with react-dom which refutes Storybook to run
2021-07-11 18:08:10 +02:00
Vadim Shvetsov
ef4439d895 fix: Fix LabelWidget deserialization bug with calling canvas.offsetWidth before it's set 2021-07-06 17:13:51 +03:00
Vadim Shvetsov
ee66f8ad61 chore(deps): Fix unable to run storybook with incompatible react and react-dom 2021-07-06 17:12:06 +03:00
Dylan Vorster
6a4e17aca6 Merge pull request #856 from ferhatsahin/patch-1
Update the url for 'demo-custom-link1'
2021-07-03 13:31:36 +02:00
Dylan Vorster
10d6a286b4 Merge pull request #857 from vadimshvetsov/patch-1
fix: MoveItemsState should use BasePositionModel instead BaseModel
2021-07-03 13:31:14 +02:00
Renato Böhler
1bdc6c7624 fixes SelectionBoxWidget returning undefined 2021-06-23 11:32:40 -03:00
Vadim Shvetsov
f5bc087e7a Remove BaseModel from file 2021-06-21 12:00:16 +03:00
Vadim Shvetsov
369ca9cf91 Update MoveItemsState.ts 2021-06-21 11:51:33 +03:00
Ferhat Şahin
ba4fbe101d Update the url for 'demo-custom-link1' 2021-06-15 18:24:13 +03:00
Dylan Vorster
5b642a1d1b Merge pull request #809 from vadimshvetsov/fix-smartrouting-selection
Fix smart routing selection issue
2021-06-04 23:55:03 +02:00
Dylan Vorster
df9b076140 Merge pull request #834 from ajthinking/master
DOCS: Add missing peer dependencies
2021-06-04 23:54:10 +02:00
Dylan Vorster
0f403bb71c Merge pull request #847 from wyattdanger/patch-1
Update broken link to diagrams-demo-gallery in README
2021-06-04 23:53:41 +02:00
Dylan Vorster
abadce19ac Merge pull request #838 from vadimshvetsov/fix-set-port
Fix CI failure on master and bug `Cannot read property 'reportedPosition' of null on link.setSourcePort and link.setSourceTarget`
2021-06-04 23:52:46 +02:00
Lennard Engel
eb59992bc3 Fixes removeMiddlePoints in LinkModel.ts.
RemoveMiddlePoints removed the first point from points, while it should not delete the start- and endpoint.
2021-06-02 12:21:36 +02:00
swb
b0f0379329 Update broken link to diagrams-demo-gallery in README
When following instructions locally, I noticed that references to `packages/diagrams-demo-gallery` should be updated to remove `packages` from the path
2021-05-17 11:11:28 -05:00
Vadim Shvetsov
63a41c634f fix(CI): Fix Pathfinding import at CI 2021-04-27 12:12:21 +03:00
Vadim Shvetsov
e34c73ca00 fix: Check if port exist before checking reportPosition 2021-04-27 12:06:17 +03:00
Renato Böhler
44fae73a52 removes code duplication on AbstractDisplacementState 2021-04-15 19:16:31 -03:00
Anders Jürisoo
81f26a19ca Remove @emotion/core peer dependency 2021-04-15 17:06:50 +02:00
Anders Jürisoo
2d5ae2fb44 DOCS: Add missing peer dependencies 2021-04-15 09:20:02 +02:00
Dylan Vorster
d2f05438b8 Merge pull request #830 from projectstorm/more_fixes
More fixes and maintenance
2021-04-14 11:05:53 +02:00
Dylan Vorster
d9bd430f82 v6.5.2 2021-04-14 11:05:32 +02:00
Dylan Vorster
df308897b7 changelog 2021-04-14 11:00:59 +02:00
Dylan Vorster
590ba09c3c more fixes 2021-04-14 10:58:04 +02:00
Dylan Vorster
3c8912bc86 Merge pull request #829 from projectstorm/zoom_to_fit
Zoom to fit
2021-04-12 19:40:15 +02:00
Dylan Vorster
291241cacb v6.5.1 2021-04-12 19:39:04 +02:00
Dylan Vorster
1ac3a8de78 zoom to fit 2021-04-12 19:34:49 +02:00
Dylan Vorster
e974627fd0 some fixes 2021-04-12 14:59:50 +02:00
Renato Böhler
ade86f215c adds support for touch events, enabling touch dragging the canvas 2021-04-11 20:57:27 -03:00
Dylan Vorster
e7a606d987 changelog and readme 2021-03-20 22:46:10 +02:00
Dylan Vorster
67be47b4ae v6.5.0 2021-03-20 22:42:33 +02:00
Dylan Vorster
43b75505fe Merge pull request #814 from projectstorm/some_fixes
Small fixes and improvements
2021-03-20 22:35:46 +02:00
Dylan Vorster
3c79850c85 more reformatting 2021-03-20 22:32:44 +02:00
Dylan Vorster
8173b70834 add a few small fixes and improvements 2021-03-20 22:20:24 +02:00
Dylan Vorster
53eee3f518 remove old scripts 2021-03-14 13:27:19 +02:00
Dylan Vorster
4649597a97 v6.4.2 2021-03-14 13:00:53 +02:00
Dylan Vorster
89adc1ee38 more oops 2021-03-14 13:00:10 +02:00
Dylan Vorster
ff0f7188fa oops 2021-03-14 12:55:47 +02:00
Dylan Vorster
c6556d7475 v6.4.1 2021-03-13 23:54:50 +02:00
Dylan Vorster
8497c1bf6c Merge pull request #813 from projectstorm/updates
Project upgrade
2021-03-13 23:50:25 +02:00
Dylan Vorster
a15191bcef dont need watch 2021-03-13 23:49:34 +02:00
Dylan Vorster
d7c7dcf0b1 fix build script 2021-03-13 23:47:30 +02:00
Dylan Vorster
57a65aec20 lol 2021-03-13 23:43:40 +02:00
Dylan Vorster
b0343daf6f v6.4.0 2021-03-13 23:43:13 +02:00
Dylan Vorster
5d7bfd81d4 few fixes 2021-03-13 23:42:40 +02:00
Dylan Vorster
d42087a3ac fix tests 2021-03-13 12:31:32 +02:00
Dylan Vorster
6adff81ae7 fix demos 2021-03-13 12:30:49 +02:00
Dylan Vorster
4f3df60758 fixes 2021-03-12 23:55:45 +02:00
Dylan Vorster
2f366d21f7 fix storybook 2021-03-12 23:46:18 +02:00
Dylan Vorster
b7dfa6da21 fix demos 2021-03-12 22:58:46 +02:00
Dylan Vorster
293123b5c6 project updates 2021-03-12 22:35:25 +02:00
Vadim Shvetsov
00c2a41c0c Fix smart routing selection issue 2021-03-01 14:29:20 +03:00
Dylan Vorster
63dbe41df0 v6.3.0 2020-12-03 22:02:46 +02:00
Dylan Vorster
c1485224ba Merge pull request #741 from artturik/patch-1
fix port background color
2020-10-29 19:05:30 +02:00
Hosein Nourani
580a26c73d miners 2020-10-28 17:52:26 -04:00
Hosein Nourani
4c03583d91 auto-redistribute-without-nodes 2020-10-13 04:41:41 -04:00
artturik
9b58fa3963 fix port background color
rgba(white, 0.1) is not valid css, changed it to valid
rgba syntax - <rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) from https://developer.mozilla.org/en-US/docs/Web/CSS/background-color
2020-10-12 23:52:13 +03:00
Dylan Vorster
3e69dafef9 Merge pull request #736 from adaladam/master
Fixed failing tests in CircleCI & fixing a typo
2020-10-11 13:39:59 +02:00
adaladam
442462af2d Merge pull request #1 from adaladam/dev
fixed failing tests
2020-09-28 16:04:27 +06:00
samat
0d9ba41c9a fixed failing tests 2020-09-28 16:01:22 +06:00
samat
73ef7df153 fixing a typo: should be LinkLayerModel instead of NodeLayerModel 2020-09-28 11:29:42 +06:00
Dylan Vorster
5fe7b37fc2 typo 2020-09-23 10:53:34 +02:00
Dylan Vorster
093e1f6a08 bump everything 2020-09-23 10:52:25 +02:00
Dylan Vorster
1e95edbc6f pretty 2020-09-23 10:24:36 +02:00
Alexander Nestorov
c92313f9b1 Remove ml-matrix 2020-09-14 00:35:03 +02:00
Dylan Vorster
b8b66642d5 Merge pull request #681 from paulocfjunior/fix-drag-canvas-state
Fix DragCanvasState to stop handling events after mouse is released
2020-08-01 16:23:12 +02:00
Paulo Junior
39dbbe3db9 Move MouseDown check from DragCanvasState to AbstractDisplacementState 2020-07-28 10:32:57 -03:00
Dylan Vorster
1ba35fd518 Merge pull request #682 from buddhikajay/master
Add missing dependencies in the documentation
2020-07-21 11:27:54 +02:00
Buddhika Jayawardhana
04443ad85e Merge pull request #1 from buddhikajay/add-missing-dependencies
Add Missing Dependencies
2020-07-21 18:29:17 +10:00
Buddhika Jayawardhana
17952c8829 Add Missing Dependencies
`@emotion/styled` and `resize-observer-polyfill` dependencies were missing from the doc
2020-07-21 18:28:37 +10:00
Paulo Junior
a8234a1a8d Fix DragCanvasState to stop handling events after mouse is released 2020-07-20 20:35:55 -03:00
Dylan Vorster
3f86c36c44 Merge pull request #668 from tkolanko/master
fix: closes #665. guard against null elements
2020-07-21 00:42:13 +02:00
Dylan Vorster
a2cf7483f1 Merge pull request #676 from Soarex16/master
Add custom link label demo #317
2020-07-21 00:39:55 +02:00
Lovpache Shumaf
72739dc3d3 Run code through 'yarn run pretty' 2020-07-17 11:06:13 +03:00
Lovpache Shumaf
07df1fd6f5 Add custom link label demo #317 2020-07-17 11:03:27 +03:00
tkolanko
ef9e72ed3a add yarn.lock to fix issue with is-promise module 2020-06-30 15:35:17 -04:00
tkolanko
8df5ff94b6 fix: closes #665. guard against null elements
elements can potentially be null if the mouse event opens a dialog
see #665 for details
2020-06-30 15:00:24 -04:00
Dylan Vorster
17c5a3cfb9 Merge pull request #656 from iddan/patch-1
Remove @next from installation instructions
2020-06-27 10:29:48 +02:00
Dylan Vorster
a69ec38a5a Merge pull request #660 from bogomya/fix-canvas
Enable/disable canvas drag
2020-06-27 10:29:38 +02:00
Dmitry Bogomya
2c66c18f6d Enable/disable canvas drag 2020-06-13 21:48:49 +03:00
Iddan Aaronsohn
012418741d Remove @next from installation instructions
Using @next incorrectly installs latest beta release instead of the latest stable release which is currently newer than the latest beta release.
2020-06-06 00:50:58 +03:00
Dylan Vorster
3d71f5a80b housekeeping 2020-06-03 21:13:39 +02:00
194 changed files with 14349 additions and 16164 deletions

8
.changeset/README.md Normal file
View File

@@ -0,0 +1,8 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

11
.changeset/config.json Normal file
View File

@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}

View File

@@ -1,23 +0,0 @@
version: 2
jobs:
build:
docker:
- image: buildkite/puppeteer
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
# test building project
- run: yarn run build
# test e2e tests and jest snapshots
- run: cd packages/diagrams-demo-gallery && yarn run test --ci
- run: cd packages/react-diagrams-routing && yarn run test --ci

View File

@@ -1,27 +0,0 @@
FROM node:8-slim
# Install latest chrome dev package.
# Note: this installs the necessary libs to make the bundled version of Chromium that Pupppeteer
# installs, work.
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y curl \
&& rm -rf /src/*.deb
RUN yarn add puppeteer
# Add pptr user.
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /node_modules
# Run user as non privileged.
USER pptruser
CMD ["google-chrome-unstable"]

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 231 KiB

View File

@@ -1,24 +1,16 @@
# Checklist
- [ ] The code has been run through pretty `yarn run pretty`
- [ ] The tests pass on CircleCI
- [ ] You have referenced the issue(s) or other PR(s) this fixes/relates-to
- [ ] The PR Template has been filled out (see below)
- [ ] Had a beer/coffee because you are awesome
- [ ] The tests pass
- [ ] I have referenced the issue(s) or other PR(s) this fixes/relates-to
- [ ] I have run ```pnpm changeset``` and followed the instructions
- [ ] I have explained in this PR, what I did and why
- [ ] I replaced the image below
- [ ] Had a beer/coffee/tea because I did something cool today
## What?
## What, why and how?
## Why?
## How?
## Feel good image:
(Add your own one below :])
![LOL](https://i.pinimg.com/originals/7f/1b/c3/7f1bc3fb2e123dd3255a85c04db22f19.jpg)
![LOL](https://i.pinimg.com/originals/7f/1b/c3/7f1bc3fb2e123dd3255a85c04db22f19.jpg)

23
.github/workflows/prettier.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Prettier check
# This action works with pull requests and pushes
on:
pull_request:
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- uses: actions/checkout@v2 # Check out the repository first.
- uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --check --ignore-path .prettierignore --config .prettierrc '**/*.{ts,tsx,js,jsx}'

47
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Release
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Dependencies
run: pnpm install
- name: Create Release Pull Request
uses: changesets/action@v1
id: changesets
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: publish storybook
if: steps.changesets.outputs.published == 'true'
run: pnpm release:storybook

30
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Build and Test
on:
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build

3
.gitignore vendored
View File

@@ -5,4 +5,5 @@ dist
*.zip
.env
node_modules
yarn-error.log
tsconfig.tsbuildinfo
.vscode

View File

@@ -1,7 +1,6 @@
{
"semi": true,
"singleQuote": true,
"jsxBracketSameLine": true,
"useTabs": true,
"printWidth": 120,
"trailingComma": "none"

View File

@@ -1 +0,0 @@
--ignore-engines true

View File

@@ -1,13 +1,101 @@
__6.1.1__
__V7!__
we are now using changesets! you can see the changes for individual packages in their corresponding folders.
Here is the main changeset for the core package which depends on everything:
[Changelog for @projectstorm/react-diagrams](./packages/react-diagrams/CHANGELOG.md)
---
__6.7.4__
.0 -> .4 because I messed up the version / publishing
* (upgrade all dependencies, including a move to React 18)
* https://github.com/projectstorm/react-diagrams/pull/947
__6.7.0__
bug fixes:
* https://github.com/projectstorm/react-diagrams/pull/882
* https://github.com/projectstorm/react-diagrams/pull/914
* https://github.com/projectstorm/react-diagrams/pull/875
types
* https://github.com/projectstorm/react-diagrams/pull/906
features:
* https://github.com/projectstorm/react-diagrams/pull/915
* https://github.com/projectstorm/react-diagrams/pull/877
__6.6.1__
bug fixes:
* https://github.com/projectstorm/react-diagrams/pull/861
* https://github.com/projectstorm/react-diagrams/pull/871
* https://github.com/projectstorm/react-diagrams/pull/870
Some maintenance:
* https://github.com/projectstorm/react-diagrams/pull/861
__6.6.0__
* (docs-broken) https://github.com/projectstorm/react-diagrams/pull/834
* (bug) https://github.com/projectstorm/react-diagrams/pull/838
* (docs-broken) https://github.com/projectstorm/react-diagrams/pull/847
* (bug) https://github.com/projectstorm/react-diagrams/pull/852
* (docs-broken) https://github.com/projectstorm/react-diagrams/pull/856
* (improvement) https://github.com/projectstorm/react-diagrams/pull/857
* (bug) https://github.com/projectstorm/react-diagrams/pull/860
Also includes a bump on all packages using `ncu` recursively.
__6.5.2__
https://github.com/projectstorm/react-diagrams/pull/830
* (fix) issue with zoom to fit selected
* (improvement) properly export PathFinding
* (maintenance) bump all dependencies
__6.5.1__
https://github.com/projectstorm/react-diagrams/pull/829
* (improved) zoom to fit now centers correctly
* (fix) remove wrong peer dependency (@emotion/core)
__6.5.0__
https://github.com/projectstorm/react-diagrams/pull/814
* Some rendering fixes
* small api change around `zoomToFit`
* more api options with the `DefaultLink`
__6.4.0__
https://github.com/projectstorm/react-diagrams/pull/813
* Bump all packages and move to Emotion 11 and React 17
* Move to the latest Storybook
__6.2.0__
* (improvement) Move away fromn math-js (https://github.com/projectstorm/react-diagrams/pull/651)
* (fix) https://github.com/projectstorm/react-diagrams/pull/639
* (fix) Fixing link spawning at (0,0) when clicking port once (inspired by https://github.com/projectstorm/react-diagrams/pull/637)
__6.1.1__
* (feature) https://github.com/projectstorm/react-diagrams/pull/576 [Add zoom to fit nodes feature, fixes #568]
* (improvement) https://github.com/projectstorm/react-diagrams/pull/621 [Support deriving from DefaultLabelModel]
* (fix) https://github.com/projectstorm/react-diagrams/pull/603
* (fix) https://github.com/projectstorm/react-diagrams/pull/603
[Fixes selectionChanged listener not being deregistered on NodeWidget, Fixes unchecked access to this.props.link.getSourcePort() on LinkWidget]
* (maintenance) bump everything
* fix serialize/deserialize issue with example project raw JS node
__6.0.0__
__6.0.0__
Note: This is a complete rewrite of the library, a good place to start to see how the new system works
is with the new demo project which illustrates the new capability.
@@ -21,7 +109,7 @@ I would also recommend taking a look at the new updated DiamondPort widget which
* Introduce multiple layers (can now have multiple node and link layers)
* Rewrote the deserialization system to be promise based
* Completely overhauled the observer framework on the models
* Moved all the logic in the DiagramWidget into a a new hierarchical state machine
* Moved all the logic in the DiagramWidget into a a new hierarchical state machine
* Introduces new states for editing
* Introduced faster layout rendering when transforming the canvas directly
* Moved all canvas smart routing into its own link-type under routing package
@@ -37,7 +125,7 @@ I would also recommend taking a look at the new updated DiamondPort widget which
* Completely removed the double render state system that required nodes to render before links, this is done when ports report their new positions
* Ports can now dynamically be added and removed without having to tell the system it happeend
* Port widgets are now containers dumb containers for you own ports
* Port widgets report new sizing information to their target links when they change position, you no longer need to invalidate them
* Port widgets report new sizing information to their target links when they change position, you no longer need to invalidate them
__5.3.2__
@@ -58,7 +146,7 @@ __5.2.1__
* (bug) https://github.com/projectstorm/react-diagrams/commit/75ef02dd4d131a0e7c08b2680c69efc390e50b84
-> and other improvements, also checkout the foundation work happening over at https://github.com/projectstorm/react-canvas
__5.1.0__
__5.1.0__
* (api) Rename XXXFactory into AbstractXXXFactory
* (refactor) tslint and prettier are now the same
@@ -69,7 +157,7 @@ __5.1.0__
* (refactor) consistently use lodash where possible
* (maintenance) upgrade node modules
__5.0.0__ http://dylanv.blog/2018/03/03/storm-react-diagrams-5-0-0/
__5.0.0__ [http://dylanv.blog/2018/03/03/storm-react-diagrams-5-0-0/](https://dylanvorster.com/storm-react-diagrams-v5-0/)
PR: https://github.com/projectstorm/react-diagrams/pull/145
@@ -86,7 +174,7 @@ PR: https://github.com/projectstorm/react-diagrams/pull/145
* (tests) automatically load JEST Snapshots
* (feature) Link labels!
__4.0.0__ http://dylanv.blog/2018/01/18/storm-react-diagrams-v4-0-0/
__4.0.0__ [http://dylanv.blog/2018/01/18/storm-react-diagrams-v4-0-0/](https://dylanvorster.com/storm-react-diagrams-v4-0/)
* (refactor) Events system was completely overhauled
* (demo) Custom Link Sizes
@@ -98,9 +186,9 @@ __4.0.0__ http://dylanv.blog/2018/01/18/storm-react-diagrams-v4-0-0/
* (refactor) Merged the concept of instance factories and widget factories into one
* (feature) Models can now be cloned at various parts of the model graph
* (demo) Cloning
* (feature) models control isLocked
* (feature) models control isLocked
__3.2.0__ http://dylanv.blog/2017/11/22/storm-react-diagrams-3-2-0/
__3.2.0__ [http://dylanv.blog/2017/11/22/storm-react-diagrams-3-2-0/](https://dylanvorster.com/storm-react-diagrams-3-2-0/)
* (feature) zoom to fit
* added Circle CI tests
* (demo) dagre automatic layouts
@@ -113,24 +201,24 @@ __3.2.0__ http://dylanv.blog/2017/11/22/storm-react-diagrams-3-2-0/
* (bugs) issues with the rendering pipeline #107
* added ci badge to Readme
__3.1.3__
__3.1.3__
* Refactor links slightly
* use min extension for css
* bump package versions
* export more classes
__3.1.2__
__3.1.2__
* Hotfix: fix zooming when canvas not in the top left corner
(https://github.com/projectstorm/react-diagrams/pull/88)
__3.1.0__ http://dylanv.blog/2017/09/15/storm-react-diagrams-3-1-0/
__3.1.0__ [http://dylanv.blog/2017/09/15/storm-react-diagrams-3-1-0/](https://dylanvorster.com/storm-react-diagrams-3-1-0/)
* Zoom relative to mouse location
* Fixed links not connecting when grid is larger than port size
* Prevented points from dragging when connected to a port and the node itself is not selected
* API fixes
* Code cleanup
* Code cleanup
__3.0.0__ http://dylanv.blog/2017/09/13/storm-react-diagrams-v3/
__3.0.0__ [http://dylanv.blog/2017/09/13/storm-react-diagrams-v3/](https://dylanvorster.com/storm-react-diagrams-3-0/)
* Massive performance updates
* Complete rewrite
* Started a changelog and design documents for each revision

View File

@@ -1,11 +1,9 @@
# Introduction
[![Join the chat at https://gitter.im/projectstorm/react-diagrams](https://badges.gitter.im/projectstorm/react-diagrams.svg)](https://gitter.im/projectstorm/react-diagrams?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![NPM](https://img.shields.io/npm/v/@projectstorm/react-diagrams.svg)](https://npmjs.org/package/@projectstorm/react-diagrams) [![Package Quality](https://npm.packagequality.com/shield/storm-react-diagrams.svg)](https://packagequality.com/#?package=storm-react-diagrams) [![CircleCI](https://circleci.com/gh/projectstorm/react-diagrams/tree/master.svg?style=svg)](https://circleci.com/gh/projectstorm/react-diagrams/tree/master) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![Join the chat at https://gitter.im/projectstorm/react-diagrams](https://badges.gitter.im/projectstorm/react-diagrams.svg)](https://gitter.im/projectstorm/react-diagrams?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![NPM](https://img.shields.io/npm/v/@projectstorm/react-diagrams.svg)](https://npmjs.org/package/@projectstorm/react-diagrams) [![Package Quality](https://npm.packagequality.com/shield/storm-react-diagrams.svg)](https://packagequality.com/#?package=storm-react-diagrams)
![](.gitbook/assets/logo.jpg)
[pssst! Looking for the old version 5?](https://github.com/projectstorm/react-diagrams/tree/v5.3.2)
**DEMO**: [http://projectstorm.cloud/react-diagrams](http://projectstorm.cloud/react-diagrams)
**DOCS \(wip\)** [https://projectstorm.gitbook.io/react-diagrams](https://projectstorm.gitbook.io/react-diagrams)
@@ -26,7 +24,7 @@ A flow & process orientated diagramming library inspired by **Blender**, **Labvi
Example implementation using custom models: \(Dylan's personal code\)
![Personal Project](.gitbook/assets/example1.jpg)
![Personal Project](.gitbook/assets/example1.jpg)
![](.gitbook/assets/example2.jpg)
Get started with the default models right out of the box:
@@ -38,7 +36,7 @@ Get started with the default models right out of the box:
For all the bells and whistles:
```text
yarn add @projectstorm/react-diagrams@next
yarn add @projectstorm/react-diagrams
```
This includes all the packages listed below \(and works \(mostly and conceptually\) like it used to in version 5.0\)
@@ -48,35 +46,38 @@ This includes all the packages listed below \(and works \(mostly and conceptuall
This library now has a more modular design and you can import just the core \(contains no default factories or routing\)
```text
yarn add @projectstorm/react-diagrams-core@next
yarn add @projectstorm/react-diagrams-core
```
this is built ontop of the evolving **react-canvas-core** library
```text
yarn add @projectstorm/react-canvas-core@next
yarn add @projectstorm/react-canvas-core
```
which makes use of
```text
yarn add @projectstorm/react-geometry@next
yarn add @projectstorm/geometry
```
and of course, you can add some extras:
```text
yarn add @projectstorm/react-diagrams-defaults@next
yarn add @projectstorm/react-diagrams-routing@next
yarn add @projectstorm/react-diagrams-defaults
yarn add @projectstorm/react-diagrams-routing
```
## How to use
Take a look at the [diagram demos](https://github.com/projectstorm/react-diagrams/tree/master/packages/diagrams-demo-gallery/demos)
Before running any of the examples, please run `pnpm build` in the root. This project is a monorepo, and the packages (including the demos) require the packages to first be built.
Take a look at the [diagram demos](https://github.com/projectstorm/react-diagrams/tree/master/diagrams-demo-gallery/demos)
**or**
Take a look at the [demo project](https://github.com/projectstorm/react-diagrams/tree/master/packages/diagrams-demo-project) which contains an example for ES6 as well as Typescript
Take a look at the [demo project](https://github.com/projectstorm/react-diagrams/tree/master/diagrams-demo-project) which contains an example for ES6 as well as Typescript
**or**
@@ -84,11 +85,12 @@ Take a look at the [demo project](https://github.com/projectstorm/react-diagrams
## Run the demos
After running `yarn install` you must then run: `cd packages/diagrams-demo-gallery && yarn run start`
After running `pnpm install` and `pnpm build`, you must then run: `cd diagrams-demo-gallery && pnpm run start`
## Building from source
Simply run `yarn` then `yarn build` or `yarn build:prod` in the root directory and it will spit out the transpiled code and typescript definitions into the dist directory as a single file.
Simply run `pnpm` then `pnpm build` or `pnpm build:prod` in the root directory and it will spit out the transpiled code and typescript definitions into the dist directory as a single file.
## Built with react-diagrams
> Do you have an interesting project built with *react-diagrams*? PR it into this section for others to see.

View File

@@ -0,0 +1,18 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": []
}

View File

@@ -0,0 +1,8 @@
module.exports = {
stories: ['../demos/*.stories.tsx'],
addons: ['@storybook/addon-actions'],
framework: {
name: '@storybook/react-webpack5',
options: {}
}
};

View File

@@ -0,0 +1,7 @@
import { addons } from '@storybook/addons';
import diagramsTheme from './theme';
addons.setConfig({
theme: diagramsTheme
});

View File

@@ -0,0 +1,5 @@
<style>
html, body, #storybook-root {
height: 100%;
}
</style>

View File

@@ -0,0 +1,3 @@
export const parameters = {
layout: 'fullscreen'
};

View File

@@ -0,0 +1,7 @@
import { create } from '@storybook/theming';
export default create({
base: 'dark',
brandTitle: 'STORM React Diagrams',
brandUrl: 'https://github.com/projectstorm/react-diagrams'
});

View File

@@ -0,0 +1,70 @@
# @projectstorm/react-diagrams-gallery
## 7.1.2
### Patch Changes
- 66c687a: Upgrade all dependencies and fix Storybook after upgrade
- Updated dependencies [66c687a]
- @projectstorm/react-diagrams-defaults@7.1.2
- @projectstorm/react-diagrams-core@7.0.2
- @projectstorm/react-canvas-core@7.0.2
- @projectstorm/react-diagrams@7.0.3
## 7.1.1
### Patch Changes
- b8a4cbd: Inline sources in sourcemap
- Updated dependencies [b8a4cbd]
- @projectstorm/react-canvas-core@7.0.1
- @projectstorm/react-diagrams@7.0.2
- @projectstorm/react-diagrams-core@7.0.1
- @projectstorm/react-diagrams-defaults@7.1.1
## 7.1.0
### Minor Changes
- e0d21f1: - [feature] new ability to refresh links in auto distribute system [PR 756](https://github.com/projectstorm/react-diagrams/pull/756)
- [fix] Default link now uses the correct method for creating a point allowing this to be overridden [PR 939](https://github.com/projectstorm/react-diagrams/pull/939)
Big thanks to @ToTheHit and @h0111in for your help on these, even though its very delayed on my part :)
### Patch Changes
- Updated dependencies [e0d21f1]
- @projectstorm/react-diagrams-defaults@7.1.0
- @projectstorm/react-diagrams@7.0.1
## 7.0.0
### Major Changes
- b051697: - [internal] moves to `Pnpm` (instead of yarn -\_-)
- [internal]moves to `Changesets` for releases
- [internal]removes `Lerna`
- [internal] upgrades all dependencies
- [internal] switches to workspace protocol syntax (Changesets will bake in the correct version when a publish occurs)
- [internal] Changesets will open a release PR which can wrap up several changes in 1 go
- [internal] Changesets will run the storybook deploy automatically upon merging the release PR
- [internal] removes a lot of the stuff from the root package.json
- [internal] cleans up the build and clean commands
- [internal] remove E2E tests, they are a nightmare to maintain and the ROI is far too low
- [fix] Wrong type name for react-canvas model listener
- [fix] export more stuff form the main react-diagrams package
- [fix] circular deps with Rectangle and Polygon (turns out this was a problem but only with UMD builds, sorry @everyone who I doubted, but this is also why I could never reproduce the issue)
- [breaking change] compile both ES6 and UMD
- [breaking change] moves dependencies back to each package. (After years of working on libraries, I've come to actually hate peer dependencies, and this is easily solved with build systems / package managers).
- [breaking change] static methods on `Polygon` and `Rectangle` moved to standalone methods
- [breaking change] static construction methods to rather deal with different Rectangle constructor overloads (I now consider this bad design)
- [breaking change] introduce `Bounds` as a simpler point-array type to deal with boundary computation instead
### Patch Changes
- Updated dependencies [b051697]
- @projectstorm/react-diagrams-defaults@7.0.0
- @projectstorm/react-diagrams-core@7.0.0
- @projectstorm/react-canvas-core@7.0.0
- @projectstorm/react-diagrams@7.0.0

View File

@@ -0,0 +1,32 @@
import { Toolkit } from '@projectstorm/react-canvas-core';
Toolkit.TESTING = true;
export default {
title: 'Simple Usage'
};
import demo_simple from './demo-simple';
import demo_flow from './demo-simple-flow';
import demo_performance from './demo-performance';
import demo_locks from './demo-locks';
import demo_grid from './demo-grid';
import demo_listeners from './demo-listeners';
import demo_zoom from './demo-zoom-to-fit';
import demo_zoom_nodes from './demo-zoom-to-fit-nodes';
import demo_canvas_drag from './demo-canvas-drag';
import demo_pan_and_zoom from './demo-pan-and-zoom';
import demo_dynamic_ports from './demo-dynamic-ports';
import demo_labels from './demo-labelled-links';
export const DemoSimple = demo_simple;
export const SimpleFlowExample = demo_flow;
export const PerformanceDemo = demo_performance;
export const LockedWidget = demo_locks;
export const CanvasGridSize = demo_grid;
export const EventsAndListeners = demo_listeners;
export const ZoomToFit = demo_zoom;
export const ZoomToFitSelectNodes = demo_zoom_nodes;
export const CanvasDrag = demo_canvas_drag;
export const CanvasPanAndZoom = demo_pan_and_zoom;
export const DynamicPorts = demo_dynamic_ports;
export const LinksWithLabels = demo_labels;

View File

@@ -0,0 +1,24 @@
import { Toolkit } from '@projectstorm/react-canvas-core';
Toolkit.TESTING = true;
export default {
title: 'Advanced Usage'
};
import demo_adv_clone_selected from './demo-cloning';
import demo_adv_ser_des from './demo-serializing';
import demo_adv_prog from './demo-mutate-graph';
import demo_adv_dnd from './demo-drag-and-drop';
import demo_smart_routing from './demo-smart-routing';
import demo_right_angles_routing from './demo-right-angles-routing';
import demo_alternative_linking from './demo-alternative-linking';
import demo_custom_delete_keys from './demo-custom_delete_keys';
export const CloneSelected = demo_adv_clone_selected;
export const SerializingAndDeSerializing = demo_adv_ser_des;
export const ProgramaticallyModifyingGraph = demo_adv_prog;
export const DragAndDrop = demo_adv_dnd;
export const SmartRouting = demo_smart_routing;
export const RightAnglesRouting = demo_right_angles_routing;
export const LinkingByClickingInsteadOfDragging = demo_alternative_linking;
export const SettingCustomDeleteKeys = demo_custom_delete_keys;

View File

@@ -0,0 +1,18 @@
import { Toolkit } from '@projectstorm/react-canvas-core';
Toolkit.TESTING = true;
export default {
title: 'Customization'
};
import demo_custom_link_label from './demo-custom-link-label';
import demo_custom_action from './demo-custom-action';
import demo_cust_nodes from './demo-custom-node1';
import demo_cust_links from './demo-custom-link1';
import demo_cust_links2 from './demo-custom-link2';
export const CustomDiamondNode = demo_cust_nodes;
export const CustomAnimatedLinks = demo_cust_links;
export const CustomLinkEndsWithArrows = demo_cust_links2;
export const CustomLinkLabel = demo_custom_link_label;
export const CustomEvent = demo_custom_action;

View File

@@ -0,0 +1,12 @@
import { Toolkit } from '@projectstorm/react-canvas-core';
Toolkit.TESTING = true;
export default {
title: 'External Libs'
};
import demo_3rd_dagre from './demo-dagre';
import demo_gsap from './demo-animation';
export const DagreDistribute = demo_3rd_dagre;
export const GsapAnimation = demo_gsap;

View File

@@ -1,4 +1,4 @@
import { MouseEvent } from 'react';
import { MouseEvent, TouchEvent } from 'react';
import {
SelectingState,
State,
@@ -45,6 +45,16 @@ export class DefaultState extends State<DiagramEngine> {
})
);
// touch drags the canvas
this.registerAction(
new Action({
type: InputType.TOUCH_START,
fire: (event: ActionEvent<TouchEvent>) => {
this.transitionWithEvent(new DragCanvasState(), event);
}
})
);
this.registerAction(
new Action({
type: InputType.MOUSE_UP,

View File

@@ -0,0 +1,72 @@
import * as React from 'react';
import createEngine, { DiagramModel, DefaultNodeModel } from '@projectstorm/react-diagrams';
import { DemoButton, DemoWorkspaceWidget } from '../helpers/DemoWorkspaceWidget';
import { CanvasWidget } from '@projectstorm/react-canvas-core';
import { DemoCanvasWidget } from '../helpers/DemoCanvasWidget';
/**
* Tests the drag on/off
*/
class CanvasDragToggle extends React.Component<any, any> {
enableDrag = () => {
const { engine } = this.props;
const state = engine.getStateMachine().getCurrentState();
state.dragCanvas.config.allowDrag = true;
};
disableDrag = () => {
const { engine } = this.props;
const state = engine.getStateMachine().getCurrentState();
state.dragCanvas.config.allowDrag = false;
};
render() {
const { engine } = this.props;
return (
<DemoWorkspaceWidget
buttons={[
<DemoButton key={1} onClick={this.enableDrag}>
Enable canvas drag
</DemoButton>,
<DemoButton key={2} onClick={this.disableDrag}>
Disable canvas drag
</DemoButton>
]}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>
</DemoWorkspaceWidget>
);
}
}
export default () => {
//1) setup the diagram engine
var engine = createEngine();
//2) setup the diagram model
var model = new DiagramModel();
//3-A) create a default node
var node1 = new DefaultNodeModel('Node 1', 'rgb(0,192,255)');
var port1 = node1.addOutPort('Out');
node1.setPosition(100, 100);
//3-B) create another default node
var node2 = new DefaultNodeModel('Node 2', 'rgb(192,255,0)');
var port2 = node2.addInPort('In');
node2.setPosition(400, 100);
//3-C) link the 2 nodes together
var link1 = port1.link(port2);
//4) add the models to the root graph
model.addAll(node1, node2, link1);
//5) load model into engine
engine.setModel(model);
//6) render the diagram!
return <CanvasDragToggle engine={engine} model={model} />;
};

View File

@@ -0,0 +1,20 @@
import * as React from 'react';
import { AbstractReactFactory, GenerateWidgetEvent } from '@projectstorm/react-canvas-core';
import { DiagramEngine } from '@projectstorm/react-diagrams';
import { EditableLabelModel } from './EditableLabelModel';
import { EditableLabelWidget } from './EditableLabelWidget';
export class EditableLabelFactory extends AbstractReactFactory<EditableLabelModel, DiagramEngine> {
constructor() {
super('editable-label');
}
generateModel(): EditableLabelModel {
return new EditableLabelModel();
}
generateReactWidget(event: GenerateWidgetEvent<EditableLabelModel>): JSX.Element {
return <EditableLabelWidget model={event.model} />;
}
}

View File

@@ -0,0 +1,30 @@
import { LabelModel } from '@projectstorm/react-diagrams';
import { BaseModelOptions, DeserializeEvent } from '@projectstorm/react-canvas-core';
export interface EditableLabelOptions extends BaseModelOptions {
value?: string;
}
export class EditableLabelModel extends LabelModel {
value: string;
constructor(options: EditableLabelOptions = {}) {
super({
...options,
type: 'editable-label'
});
this.value = options.value || '';
}
serialize() {
return {
...super.serialize(),
value: this.value
};
}
deserialize(event: DeserializeEvent<this>): void {
super.deserialize(event);
this.value = event.data.value;
}
}

View File

@@ -0,0 +1,40 @@
import * as React from 'react';
import { EditableLabelModel } from './EditableLabelModel';
import styled from '@emotion/styled';
import { action } from '@storybook/addon-actions';
export interface FlowAliasLabelWidgetProps {
model: EditableLabelModel;
}
namespace S {
// NOTE: this CSS rules allows to interact with elements in label
export const Label = styled.div`
user-select: none;
pointer-events: auto;
`;
}
// now we can render all what we want in the label
export const EditableLabelWidget: React.FunctionComponent<FlowAliasLabelWidgetProps> = (props) => {
const [str, setStr] = React.useState(props.model.value);
return (
<S.Label>
<input
value={str}
onChange={(event) => {
const newVal = event.target.value;
// update value both in internal component state
setStr(newVal);
// and in model object
props.model.value = newVal;
}}
/>
<button onClick={() => action('model eventDidFire')('You clicked the button')}>Click me!</button>
</S.Label>
);
};

View File

@@ -0,0 +1,55 @@
import * as React from 'react';
import createEngine, { DefaultNodeModel, DiagramModel } from '@projectstorm/react-diagrams';
import { CanvasWidget } from '@projectstorm/react-canvas-core';
import { DemoCanvasWidget } from '../helpers/DemoCanvasWidget';
import { EditableLabelFactory } from './EditableLabelFactory';
import { EditableLabelModel } from './EditableLabelModel';
/**
* @Author Shumaf Lovpache (aka Soarex16)
*/
export default () => {
// engine setup
const engine = createEngine();
// register our label factory
engine.getLabelFactories().registerFactory(new EditableLabelFactory());
// setup diagram model
const model = new DiagramModel();
// create some nodes
const node1 = new DefaultNodeModel('Node1', 'red');
const port1 = node1.addOutPort('out');
node1.setPosition(250, 100);
const node2 = new DefaultNodeModel('Node2', 'green');
const port2 = node2.addInPort('in');
node2.setPosition(800, 300);
// link nodes together
const link1 = port1.link(port2);
// !!!
// add our custom label to link
link1.addLabel(
new EditableLabelModel({
value: 'Hello, I am label!'
})
);
// add models to the root graph
model.addAll(node1, port1, node2, port2, link1);
// load model into engine
engine.setModel(model);
// render diagram
return (
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>
);
};

View File

@@ -3,14 +3,14 @@ import createEngine, {
DefaultNodeModel,
DefaultPortModel,
DefaultLinkFactory,
DefaultLinkPointWidget,
DefaultLinkModel,
DefaultLinkWidget
} from '@projectstorm/react-diagrams';
import { DiagramEngine, LinkWidget, PointModel } from '@projectstorm/react-diagrams-core';
import { LinkWidget, PointModel } from '@projectstorm/react-diagrams-core';
import * as React from 'react';
import { CanvasWidget } from '@projectstorm/react-canvas-core';
import { DemoCanvasWidget } from '../helpers/DemoCanvasWidget';
import { MouseEvent } from 'react';
export class AdvancedLinkModel extends DefaultLinkModel {
constructor() {
@@ -47,14 +47,9 @@ const CustomLinkArrowWidget = (props) => {
<polygon
points="0,10 8,30 -8,30"
fill={props.color}
onMouseLeave={() => {
this.setState({ selected: false });
}}
onMouseEnter={() => {
this.setState({ selected: true });
}}
data-id={point.getID()}
data-linkid={point.getLink().getID()}></polygon>
data-linkid={point.getLink().getID()}
/>
</g>
</g>
</g>
@@ -125,6 +120,7 @@ export class AdvancedLinkFactory extends DefaultLinkFactory {
return <AdvancedLinkWidget link={event.model} diagramEngine={this.engine} />;
}
}
/**
*
* Simple link styling demo

View File

@@ -36,7 +36,8 @@ export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
position: 'relative',
width: this.props.size,
height: this.props.size
}}>
}}
>
<svg
width={this.props.size}
height={this.props.size}
@@ -72,7 +73,8 @@ export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.LEFT)}
engine={this.props.engine}>
engine={this.props.engine}
>
<S.Port />
</PortWidget>
<PortWidget
@@ -82,7 +84,8 @@ export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.TOP)}
engine={this.props.engine}>
engine={this.props.engine}
>
<S.Port />
</PortWidget>
<PortWidget
@@ -92,7 +95,8 @@ export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.RIGHT)}
engine={this.props.engine}>
engine={this.props.engine}
>
<S.Port />
</PortWidget>
<PortWidget
@@ -102,7 +106,8 @@ export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.BOTTOM)}
engine={this.props.engine}>
engine={this.props.engine}
>
<S.Port />
</PortWidget>
</div>

View File

@@ -45,7 +45,8 @@ class DemoWidget extends React.Component<{ model: DiagramModel; engine: DiagramE
marginx: 25,
marginy: 25
},
includeLinks: true
includeLinks: true,
nodeMargin: 25
});
}
@@ -57,6 +58,13 @@ class DemoWidget extends React.Component<{ model: DiagramModel; engine: DiagramE
this.props.engine.repaintCanvas();
};
autoRefreshLinks = () => {
this.engine.refreshLinks(this.props.model);
// only happens if pathfing is enabled (check line 25)
this.reroute();
this.props.engine.repaintCanvas();
};
componentDidMount(): void {
setTimeout(() => {
this.autoDistribute();
@@ -72,7 +80,14 @@ class DemoWidget extends React.Component<{ model: DiagramModel; engine: DiagramE
render() {
return (
<DemoWorkspaceWidget buttons={<DemoButton onClick={this.autoDistribute}>Re-distribute</DemoButton>}>
<DemoWorkspaceWidget
buttons={
<div>
<DemoButton onClick={this.autoDistribute}>Re-distribute</DemoButton>
<DemoButton onClick={this.autoRefreshLinks}>Refresh Links</DemoButton>
</div>
}
>
<DemoCanvasWidget>
<CanvasWidget engine={this.props.engine} />
</DemoCanvasWidget>
@@ -106,9 +121,11 @@ export default () => {
});
// more links for more complicated diagram
links.push(connectNodes(nodesFrom[0], nodesTo[1], engine));
links.push(connectNodes(nodesTo[0], nodesFrom[1], engine));
links.push(connectNodes(nodesFrom[1], nodesTo[2], engine));
links.push(connectNodes(nodesTo[0], nodesTo[1], engine));
links.push(connectNodes(nodesTo[1], nodesTo[2], engine));
links.push(connectNodes(nodesTo[0], nodesTo[2], engine));
links.push(connectNodes(nodesFrom[0], nodesFrom[2], engine));
links.push(connectNodes(nodesFrom[0], nodesTo[2], engine));
// initial random position
nodesFrom.forEach((node, index) => {

View File

@@ -74,7 +74,8 @@ export class BodyWidget extends React.Component<BodyWidgetProps> {
}}
onDragOver={(event) => {
event.preventDefault();
}}>
}}
>
<DemoCanvasWidget>
<CanvasWidget engine={this.props.app.getDiagramEngine()} />
</DemoCanvasWidget>

View File

@@ -29,7 +29,8 @@ export class TrayItemWidget extends React.Component<TrayItemWidgetProps> {
onDragStart={(event) => {
event.dataTransfer.setData('storm-diagram-node', JSON.stringify(this.props.model));
}}
className="tray-item">
className="tray-item"
>
{this.props.name}
</S.Tray>
);

View File

@@ -53,10 +53,12 @@ export default () => {
<DemoButton
onClick={() => {
action('Serialized Graph')(JSON.stringify(model.serializeDiagram(), null, 2));
}}>
}}
>
Serialize Graph
</DemoButton>
}>
}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -49,7 +49,8 @@ class NodeDelayedPosition extends React.Component<any, any> {
<DemoButton key={2} onClick={this.updatePositionViaSerialize}>
Update position via serialize
</DemoButton>
]}>
]}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -0,0 +1,57 @@
import * as React from 'react';
import createEngine, { DiagramModel, DefaultNodeModel } from '@projectstorm/react-diagrams';
import { DemoButton, DemoWorkspaceWidget } from '../helpers/DemoWorkspaceWidget';
import { CanvasWidget } from '@projectstorm/react-canvas-core';
import { DemoCanvasWidget } from '../helpers/DemoCanvasWidget';
/**
* Tests the pan and zoom action, which is intended as a trackpad/mobile
* alternative to the standard ZoomCanvasAction
*/
class CanvasPanAndZoomToggle extends React.Component<any, any> {
render() {
const { engine } = this.props;
return (
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>
);
}
}
export default () => {
/**
* 1) setup the diagram engine
* PandAndZoomCanvasAction and ZoomCanvasAction are mutually exclusive
* If both are enabled, ZoomCanvasAction will override.
*/
var engine = createEngine({
registerDefaultPanAndZoomCanvasAction: true,
registerDefaultZoomCanvasAction: false
});
//2) setup the diagram model
var model = new DiagramModel();
//3-A) create a default node
var node1 = new DefaultNodeModel('Node 1', 'rgb(0,192,255)');
var port1 = node1.addOutPort('Out');
node1.setPosition(100, 100);
//3-B) create another default node
var node2 = new DefaultNodeModel('Node 2', 'rgb(192,255,0)');
var port2 = node2.addInPort('In');
node2.setPosition(400, 100);
//3-C) link the 2 nodes together
var link1 = port1.link(port2);
//4) add the models to the root graph
model.addAll(node1, node2, link1);
//5) load model into engine
engine.setModel(model);
//6) render the diagram!
return <CanvasPanAndZoomToggle engine={engine} model={model} />;
};

View File

@@ -58,10 +58,12 @@ export default () => {
<DemoButton
onClick={() => {
action('Serialized Graph')(JSON.stringify(model.serialize(), null, 2));
}}>
}}
>
Serialize Graph
</DemoButton>
}>
}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -1,4 +1,4 @@
import createEngine, { DiagramModel, DefaultNodeModel } from '@projectstorm/react-diagrams';
import createEngine, { DiagramModel, DefaultNodeModel, DefaultLabelModel } from '@projectstorm/react-diagrams';
import * as React from 'react';
import { DemoButton, DemoWorkspaceWidget } from '../helpers/DemoWorkspaceWidget';
import { action } from '@storybook/addon-actions';
@@ -25,6 +25,7 @@ export default () => {
//3-C) link the 2 nodes together
var link1 = port1.link(port2);
link1.addLabel(new DefaultLabelModel({ label: 'Label' }));
//4) add the models to the root graph
model.addAll(node1, node2, link1);
@@ -48,10 +49,12 @@ export default () => {
<DemoButton
onClick={() => {
action('Serialized Graph')(beautify(model2.serialize(), null, 2, 80));
}}>
}}
>
Serialize Graph
</DemoButton>
}>
}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -60,10 +60,12 @@ export default () => {
<DemoButton
onClick={() => {
action('Serialized Graph')(JSON.stringify(model.serialize(), null, 2));
}}>
}}
>
Serialize Graph
</DemoButton>
}>
}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -28,7 +28,9 @@ export default () => {
//6) render the diagram!
return (
<DemoWorkspaceWidget buttons={<DemoButton onClick={() => engine.zoomToFitNodes(50)}>Zoom to fit</DemoButton>}>
<DemoWorkspaceWidget
buttons={<DemoButton onClick={() => engine.zoomToFitSelectedNodes(50)}>Zoom to fit</DemoButton>}
>
<DemoCanvasWidget>
<CanvasWidget engine={engine} />
</DemoCanvasWidget>

View File

@@ -1,5 +1,6 @@
import * as React from 'react';
import styled from '@emotion/styled';
import { css, Global } from '@emotion/react';
export interface DemoCanvasWidgetProps {
color?: string;
@@ -18,6 +19,7 @@ namespace S {
min-height: 100%;
width: 100%;
}
background-image: linear-gradient(
0deg,
transparent 24%,
@@ -43,16 +45,28 @@ namespace S {
transparent
);
`;
export const Expand = css`
html,
body,
#root {
height: 100%;
}
`;
}
export class DemoCanvasWidget extends React.Component<DemoCanvasWidgetProps> {
export class DemoCanvasWidget extends React.Component<React.PropsWithChildren<DemoCanvasWidgetProps>> {
render() {
return (
<S.Container
background={this.props.background || 'rgb(60, 60, 60)'}
color={this.props.color || 'rgba(255,255,255, 0.05)'}>
{this.props.children}
</S.Container>
<>
<Global styles={S.Expand} />
<S.Container
background={this.props.background || 'rgb(60, 60, 60)'}
color={this.props.color || 'rgba(255,255,255, 0.05)'}
>
{this.props.children}
</S.Container>
</>
);
}
}

View File

@@ -43,7 +43,7 @@ export const DemoButton = styled.button`
}
`;
export class DemoWorkspaceWidget extends React.Component<DemoWorkspaceWidgetProps> {
export class DemoWorkspaceWidget extends React.Component<React.PropsWithChildren<DemoWorkspaceWidgetProps>> {
render() {
return (
<S.Container>

View File

@@ -1,6 +1,6 @@
html,
body,
#root {
#storybook-root {
height: 100%;
padding: 0;
margin: 0;

View File

@@ -0,0 +1,53 @@
{
"name": "@projectstorm/react-diagrams-gallery",
"version": "7.1.2",
"author": "dylanvorster",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/projectstorm/react-diagrams.git"
},
"scripts": {
"start": "pnpm storybook dev",
"storybook:build": "./node_modules/.bin/build-storybook -c .storybook -o .out"
},
"keywords": [
"web",
"diagram",
"diagrams",
"react",
"typescript",
"flowchart",
"simple",
"links",
"nodes"
],
"dependencies": {
"@projectstorm/react-canvas-core": "workspace:*",
"@projectstorm/react-diagrams": "workspace:*",
"@projectstorm/react-diagrams-core": "workspace:*",
"@projectstorm/react-diagrams-defaults": "workspace:*",
"gsap": "^3.12.2",
"json-beautify": "^1.1.1",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/preset-env": "^7.22.20",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@storybook/addon-actions": "^7.4.4",
"@storybook/addon-options": "^5.3.21",
"@storybook/addons": "^7.4.4",
"@storybook/react": "^7.4.4",
"@storybook/react-webpack5": "^7.4.4",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/theming": "^7.4.4",
"@types/lodash": "^4.14.199",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"storybook": "^7.4.4"
}
}

View File

@@ -0,0 +1,23 @@
{
"compileOnSave": false,
"compilerOptions": {
"suppressExcessPropertyErrors": true,
"declaration": true,
"composite": true,
"incremental": true,
"strictNullChecks": false,
"sourceMap": true,
"skipLibCheck": true,
"jsx": "react",
"target": "ES6",
"module": "commonjs",
"strict": false,
"lib": [
"DOM",
"ES6"
]
},
"include": [
"demos"
]
}

View File

@@ -0,0 +1,50 @@
# @projectstorm/react-diagrams-demo
## 7.0.3
### Patch Changes
- 66c687a: Upgrade all dependencies and fix Storybook after upgrade
- @projectstorm/react-diagrams@7.0.3
## 7.0.2
### Patch Changes
- b8a4cbd: Inline sources in sourcemap
- Updated dependencies [b8a4cbd]
- @projectstorm/react-diagrams@7.0.2
## 7.0.1
### Patch Changes
- @projectstorm/react-diagrams@7.0.1
## 7.0.0
### Major Changes
- b051697: - [internal] moves to `Pnpm` (instead of yarn -\_-)
- [internal]moves to `Changesets` for releases
- [internal]removes `Lerna`
- [internal] upgrades all dependencies
- [internal] switches to workspace protocol syntax (Changesets will bake in the correct version when a publish occurs)
- [internal] Changesets will open a release PR which can wrap up several changes in 1 go
- [internal] Changesets will run the storybook deploy automatically upon merging the release PR
- [internal] removes a lot of the stuff from the root package.json
- [internal] cleans up the build and clean commands
- [internal] remove E2E tests, they are a nightmare to maintain and the ROI is far too low
- [fix] Wrong type name for react-canvas model listener
- [fix] export more stuff form the main react-diagrams package
- [fix] circular deps with Rectangle and Polygon (turns out this was a problem but only with UMD builds, sorry @everyone who I doubted, but this is also why I could never reproduce the issue)
- [breaking change] compile both ES6 and UMD
- [breaking change] moves dependencies back to each package. (After years of working on libraries, I've come to actually hate peer dependencies, and this is easily solved with build systems / package managers).
- [breaking change] static methods on `Polygon` and `Rectangle` moved to standalone methods
- [breaking change] static construction methods to rather deal with different Rectangle constructor overloads (I now consider this bad design)
- [breaking change] introduce `Bounds` as a simpler point-array type to deal with boundary computation instead
### Patch Changes
- Updated dependencies [b051697]
- @projectstorm/react-diagrams@7.0.0

View File

@@ -5,8 +5,8 @@
In this repo you will find a simple webpack-dev-server project
that shows how to get started with the library.
It contains an example of how to implement a custom node in both Vanilla ES6 as well
It contains an example of how to implement a custom node in both Vanilla ES6 as-well
as typescript (the recommended way).
Simply run `yarn start` and the server will start on port `9000`.
Simply run `yarn start` which will also open your browser.

View File

@@ -0,0 +1,46 @@
{
"name": "@projectstorm/react-diagrams-demo",
"version": "7.0.3",
"author": "dylanvorster",
"license": "MIT",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/projectstorm/react-diagrams.git"
},
"scripts": {
"start": "./node_modules/.bin/webpack serve --open"
},
"keywords": [
"web",
"diagram",
"diagrams",
"react",
"typescript",
"flowchart",
"simple",
"links",
"nodes"
],
"main": "./dist/index.js",
"typings": "./dist/@types/index",
"dependencies": {
"@projectstorm/react-diagrams": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"source-map-loader": "^4.0.1",
"html-webpack-plugin": "^5.5.3",
"@babel/core": "^7.22.20",
"@babel/preset-react": "^7.22.15",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"babel-loader": "^9.1.3",
"css-loader": "^6.8.1",
"style-loader": "^3.3.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}

View File

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 263 KiB

View File

@@ -1,6 +1,5 @@
import * as React from 'react';
import { DiagramEngine } from '@projectstorm/react-diagrams';
import { CanvasWidget } from '@projectstorm/react-canvas-core';
import { DiagramEngine, CanvasWidget } from '@projectstorm/react-diagrams';
export interface BodyWidgetProps {
engine: DiagramEngine;

View File

@@ -1,7 +1,7 @@
import * as React from 'react';
import { JSCustomNodeModel } from './JSCustomNodeModel';
import { JSCustomNodeWidget } from './JSCustomNodeWidget';
import { AbstractReactFactory } from '@projectstorm/react-canvas-core';
import { AbstractReactFactory } from '@projectstorm/react-diagrams';
export class JSCustomNodeFactory extends AbstractReactFactory {
constructor() {

View File

@@ -1,8 +1,8 @@
import * as React from 'react';
import { TSCustomNodeModel } from './TSCustomNodeModel';
import { TSCustomNodeWidget } from './TSCustomNodeWidget';
import { AbstractReactFactory } from '@projectstorm/react-canvas-core';
import { DiagramEngine } from '@projectstorm/react-diagrams-core';
import { AbstractReactFactory } from '@projectstorm/react-diagrams';
import { DiagramEngine } from '@projectstorm/react-diagrams';
export class TSCustomNodeFactory extends AbstractReactFactory<TSCustomNodeModel, DiagramEngine> {
constructor() {

View File

@@ -1,5 +1,4 @@
import { NodeModel, DefaultPortModel } from '@projectstorm/react-diagrams';
import { BaseModelOptions } from '@projectstorm/react-canvas-core';
import { BaseModelOptions, DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';
export interface TSCustomNodeModelOptions extends BaseModelOptions {
color?: string;

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { DiagramEngine, PortWidget } from '@projectstorm/react-diagrams-core';
import { DiagramEngine, PortWidget } from '@projectstorm/react-diagrams';
import { TSCustomNodeModel } from './TSCustomNodeModel';
export interface TSCustomNodeWidgetProps {

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import './main.css';
import createEngine, { DefaultLinkModel, DiagramModel } from '@projectstorm/react-diagrams';
import { JSCustomNodeFactory } from './custom-node-js/JSCustomNodeFactory';
@@ -39,5 +39,6 @@ model.addAll(node1, node2, link1);
engine.setModel(model);
document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(<BodyWidget engine={engine} />, document.querySelector('#application'));
const root = createRoot(document.querySelector('#application'));
root.render(<BodyWidget engine={engine} />);
});

View File

@@ -5,7 +5,7 @@
"jsx": "react",
"allowJs": true,
"target": "es6",
"moduleResolution": "node"
"module": "CommonJS"
},
"include": [
"./src"

View File

@@ -1,6 +1,7 @@
const path = require('path');
const production = process.env.NODE_ENV === 'production';
const TerserPlugin = require('terser-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
mode: production ? 'production' : 'development',
@@ -23,8 +24,18 @@ module.exports = {
})
]
},
plugins: [
new HtmlWebpackPlugin({
template: 'index.html'
})
],
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
loader: 'source-map-loader'
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
@@ -36,19 +47,15 @@ module.exports = {
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true
}
loader: 'ts-loader'
}
]
},
devServer: {
host: '0.0.0.0',
compress: true,
port: 9000,
disableHostCheck: true,
overlay: true
client: {
overlay: true
},
hot: false,
compress: true
}
};

View File

@@ -5,6 +5,7 @@
* [Using the library](getting-started/using-the-library.md)
* [Customizing](customizing/README.md)
* [Extending DefaultLinkModel](customizing/extending-default-links.md)
* [Custom Nodes](customizing/nodes.md)
* [Custom Ports](customizing/ports.md)
* [About the project](about-the-project/README.md)
* [Testing](about-the-project/testing.md)

View File

@@ -8,7 +8,7 @@ Joint JS \(a fantastic library\) + my need for rich HTML nodes + LabView + Blend
## Why render the nodes as HTML Elements and not SVG's?
My original requirement for this library stemmed from the requirement of wanting HTML nodes that would allow me to embed rich controls such as input fields, drop downs and have the system treat such nodes as first class citizens. I originally tried to make this work in JointJS, but ran into a number of problems of which this was a relatively big one.
My original requirement for this library stemmed from the requirement of wanting HTML nodes that would allow me to embed rich controls such as input fields, dropdowns and have the system treat such nodes as first class citizens. I originally tried to make this work in JointJS, but ran into a number of problems of which this was a relatively big one.
JointJS does allow you to do this, but at the time of writing this library originally, I was having a lot of trouble to make it work exactly like I needed it, and therefore decided from the very beginning that I would attempt this with an HTML first mindset.
@@ -16,7 +16,7 @@ JointJS does allow you to do this, but at the time of writing this library origi
Firstly, because it can transpile into any level of ECMAScript. This means that I don't need to break our the refactor tractor every time ECMAScript decides it wants to add features which it should have done years ago.
I also ported it to Typescript to accommodate the heavy architectural changes I was starting to make. Since porting the library to typescript, and seeing the project explode in size and complexity, I consider this the best decision made with regards to this library so far.
I also ported it to Typescript to accommodate the heavy architectural changes I was starting to make. Since porting the library to typescript, and seeing the project explode in size and complexity, I consider this the best decision made with regard to this library so far.
Porting to typescript also afforded us a set of powerful features such as generics and static analysis that all the project contributors have made exclusive use of.
@@ -24,11 +24,11 @@ Typescript is &lt;3 typescript is life.
## Why not Flow instead of Typescript?
At the time when I first started evaluating languages that could transpile to ECMAScript, I was not so sold on the supporting environment surrounding flow, and and found that there was better tooling to support typescript, they are ultimately trying to do the same thing though, and I guess in the end, typescript just made more sense.
At the time when I first started evaluating languages that could transpile to ECMAScript, I was not so sold on the supporting environment surrounding flow, and found that there was better tooling to support typescript, they are ultimately trying to do the same thing though, and I guess in the end, typescript just made more sense.
## Why React ?
React is really efficient at rendering and managing HTML in a declarative manner. React has also become one of the bigger industry standards and has a rich eco system that plays really well with typescript. Apart from these notable points, I am really fond of React and wanted a diagramming library that takes full advantage of it, and makes it easy for engineers to use its power as well, when extending this library.
React is really efficient at rendering and managing HTML in a declarative manner. React has also become one of the bigger industry standards and has a rich ecosystem that plays really well with typescript. Apart from these notable points, I am really fond of React and wanted a diagramming library that takes full advantage of it, and makes it easy for engineers to use its power as well, when extending this library.
## Why cant the Default models and widgets do this or that ?

View File

@@ -2,7 +2,7 @@
## End to end testing
To test the functionality of the library, we make use of e2e tests \(end to end tests\). In this library, we spin up a headless chrome using pupeteer and interactively and programmatically tell the mouse pointer to click and drag on various elements while making assertions along the way.
To test the functionality of the library, we make use of e2e tests \(end to end tests\). In this library, we spin up a headless chrome using puppeteer and interactively and programmatically tell the mouse pointer to click and drag on various elements while making assertions along the way.
We use Jest for the assertions and the interactivity is handled by puppeteer. Due to the laborious nature of writing e2e tests, there is a helper method that is provided in each test that makes interacting with the diagrams a lot easier. Using this helper, you can easily tell the mouse to drag links between nodes, select them and also easily assert information about them. The important thing here, is that this helper does not touch the model in any way, but is purely a helper for writing the tests themselves. Please make use of this helper when writing tests, as it ensure that the tests are defensive in nature, and also reduces the overhead of physically writing them.

View File

@@ -1,5 +1,13 @@
# Customizing
Almost all components in react-diagrams are customizable. While some customization is better documented than others, the best way to learn about customization is through the examples in the codebase and by looking at the type annotations that come with the library.
Most UI customization can be done through extending existing base classes. While node, port, and link have different data models, they share the same customization pattern:
- they need a **model factory** extended off `AbstractModelFactory`, and that factory needs to be registered with the engine under a different model type
- optionally, if you data model is different from the default, you can extend existing base classes such as `NodeModel`, `PortModel`, `DefaultLinkModel`, etc.
- they need to have a **custom component** which renders using its default or customized data model. Some component such as the port can also be extended with composition such as port if you want to simply change the appearance.
## Working with custom links
This is the easiest way to get started:
@@ -8,4 +16,6 @@ This is the easiest way to get started:
## Working with custom nodes
[Working with Ports](./ports.md)
[Working with Nodes](./nodes.md)
[Working with Ports](./ports.md)

View File

@@ -47,6 +47,6 @@ export class AdvancedLinkFactory extends DefaultLinkFactory {
}
```
The actual code for the `AdvancedLinkSegment` [can be found here](https://github.com/projectstorm/react-diagrams/blob/master/packages/diagrams-demo-gallery/demos/demo-custom-link1/index.tsx) (it is in the `demo-custom-link1` folder in the demo gallery).
The actual code for the `AdvancedLinkSegment` [can be found here](https://github.com/projectstorm/react-diagrams/tree/master/diagrams-demo-gallery/demos/demo-custom-link1) (it is in the `demo-custom-link1` folder in the demo gallery).
This is the easiest and most simple way to get started with custom links.
This is the easiest and most simple way to get started with custom links.

180
docs/customizing/nodes.md Normal file
View File

@@ -0,0 +1,180 @@
# Nodes
A node contains the node content itself and its ports. Check [NodeModel source code](https://github.com/projectstorm/react-diagrams/blob/master/packages/react-diagrams-core/src/entities/node/NodeModel.ts#L24), if you want to see what class methods can be extended.
## Extending the NodeModel
If you want to create a custom node that looks entirely different, then you need to create a component that renders using its default or customized data mode. In the example below, it uses a customized data model `DiamondNodeModel` to render `DiamondNodeWidget`, and both of them are being created in the model factory `DiamondNodeFactory`.
![](./images/diamond-node.png)
Because our Diamond node always has four ports, we add four default port models into the `DiamondNodeModel`. Depending on the type of node you are creating, this is basically where you store your vertex data in the graph theory sense.
```typescript
// DiamondNodeModel.ts
import { NodeModel, NodeModelGenerics, PortModelAlignment } from '@projectstorm/react-diagrams';
import { DiamondPortModel } from './DiamondPortModel';
export interface DiamondNodeModelGenerics {
PORT: DiamondPortModel;
}
// this can be further extended for more complicated node types
export class DiamondNodeModel extends NodeModel<NodeModelGenerics & DiamondNodeModelGenerics> {
constructor() {
super({
type: 'diamond'
});
this.addPort(new DiamondPortModel(PortModelAlignment.TOP));
this.addPort(new DiamondPortModel(PortModelAlignment.LEFT));
this.addPort(new DiamondPortModel(PortModelAlignment.BOTTOM));
this.addPort(new DiamondPortModel(PortModelAlignment.RIGHT));
}
}
```
This is where we create our customized component. This component can be any customized react component as long as they respect the node and engine props. Ports also need to be rendered inside the node component.
```typescript
// DiamondNodeWidget.tsx
import * as React from 'react';
import { DiamondNodeModel } from './DiamondNodeModel';
import { DiagramEngine, PortModelAlignment, PortWidget } from '@projectstorm/react-diagrams';
import styled from '@emotion/styled';
export interface DiamondNodeWidgetProps {
// node and engine props are required
node: DiamondNodeModel;
engine: DiagramEngine;
size?: number;
}
namespace S {
export const Port = styled.div`
width: 16px;
height: 16px;
z-index: 10;
background: rgba(0, 0, 0, 0.5);
border-radius: 8px;
cursor: pointer;
&:hover {
background: rgba(0, 0, 0, 1);
}
`;
}
// this can be any customized react component as long as they respect
// the node and engine props
export class DiamondNodeWidget extends React.Component<DiamondNodeWidgetProps> {
render() {
return (
<div
className={'diamond-node'}
style={{
position: 'relative',
width: this.props.size,
height: this.props.size
}}>
<svg
width={this.props.size}
height={this.props.size}
dangerouslySetInnerHTML={{
__html:
`
<g id="Layer_1">
</g>
<g id="Layer_2">
<polygon fill="mediumpurple" stroke="${
this.props.node.isSelected() ? 'white' : '#000000'
}" stroke-width="3" stroke-miterlimit="10" points="10,` +
this.props.size / 2 +
` ` +
this.props.size / 2 +
`,10 ` +
(this.props.size - 10) +
`,` +
this.props.size / 2 +
` ` +
this.props.size / 2 +
`,` +
(this.props.size - 10) +
` "/>
</g>
`
}}
/>
<PortWidget
style={{
top: this.props.size / 2 - 8,
left: -8,
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.LEFT)}
engine={this.props.engine}>
<S.Port />
</PortWidget>
<PortWidget
style={{
left: this.props.size / 2 - 8,
top: -8,
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.TOP)}
engine={this.props.engine}>
<S.Port />
</PortWidget>
<PortWidget
style={{
left: this.props.size - 8,
top: this.props.size / 2 - 8,
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.RIGHT)}
engine={this.props.engine}>
<S.Port />
</PortWidget>
<PortWidget
style={{
left: this.props.size / 2 - 8,
top: this.props.size - 8,
position: 'absolute'
}}
port={this.props.node.getPort(PortModelAlignment.BOTTOM)}
engine={this.props.engine}>
<S.Port />
</PortWidget>
</div>
);
}
}
```
Now we need to create a new node factory to tell the system how our new node model fits into the core system. We specifically are going to extend the `DefaultLinkFactory` because we want to render a `DiamondNodeWidget` with data model being `DiamondNodeModel`. To accomplish that, we simply extend `generateReactWidget(event)` to return a `DiamondNodeWidget` and extend `generateModel` to return a `DiamondNodeModel` instance.
```typescript
// DiamondNodeFactory.tsx
import { DiamondNodeWidget } from './DiamondNodeWidget';
import { DiamondNodeModel } from './DiamondNodeModel';
import * as React from 'react';
import { AbstractReactFactory } from '@projectstorm/react-canvas-core';
import { DiagramEngine } from '@projectstorm/react-diagrams-core';
export class DiamondNodeFactory extends AbstractReactFactory<DiamondNodeModel, DiagramEngine> {
constructor() {
super('diamond');
}
generateReactWidget(event): JSX.Element {
// event.model is basically what's returned from generateModel()
return <DiamondNodeWidget engine={this.engine} size={50} node={event.model} />;
}
generateModel(event) {
return new DiamondNodeModel();
}
}
```
The actual code for the `DiamondNode` [can be found here](https://github.com/projectstorm/react-diagrams/tree/master/diagrams-demo-gallery/demos/demo-custom-node1) (it is in the `demo-custom-node1` folder in the demo gallery).
This is the easiest and most simple way to get started with custom nodes.

View File

@@ -2,31 +2,24 @@
## Get the package
The first thing you need to do, is grab the distribution files on NPM. You can do this either using **yarn** or **npm.**
The first thing you need to do, is grab the distribution files on NPM.
**Via yarn:**
```text
yarn add @projectstorm/react-diagrams@next
yarn add @projectstorm/react-diagrams
```
**Via npm:**
```text
npm install @projectstorm/react-diagrams@next
npm install @projectstorm/react-diagrams
```
When you run this in your project directory, this will install the library into `./node_modules/@projectstorm/react-diagrams`. You will then find a **dist** folder that contains all the minified and production ready code.
## Install the peer dependencies
The library includes it's dependencies as peer-dependencies, so yarn will output warnings letting you know which ones are missing. Simple install them, specifically these ones:
**Via pnpm:**
```text
yarn add closest lodash react mathjs dagre pathfinding paths-js @emotion/core
pnpm add @projectstorm/react-diagrams
```
We do this, so that you can better control the versions of these libraries yourself since you might make use of `Lodash` in other parts of your software.
When you run this in your project directory, this will install the library into `./node_modules/@projectstorm/react-diagrams`. You will then find a **dist** folder that contains all the minified and production ready code.

View File

@@ -1,5 +0,0 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "6.2.0"
}

View File

@@ -6,9 +6,6 @@
"type": "git",
"url": "https://github.com/projectstorm/react-diagrams.git"
},
"workspaces": [
"packages/*"
],
"keywords": [
"web",
"diagram",
@@ -21,82 +18,31 @@
"nodes"
],
"scripts": {
"build": "yarn build:clean && lerna run build --stream",
"build:es": "lerna run build:es --stream",
"build:prod": "yarn build:clean && lerna run build:prod --stream",
"watch": "yarn build:clean && lerna run watch --stream",
"publish:dev": "yarn build:prod && lerna publish --force-publish --dist-tag=next",
"publish:prod": "yarn build:prod && lerna publish --force-publish",
"publish:storybook": "cd packages/diagrams-demo-gallery && yarn storybook:build && ../../node_modules/.bin/storybook-to-ghpages --existing-output-dir .out",
"build:clean": "lerna run clean --stream",
"test:ci": "lerna run test --stream -- --runInBand --ci ",
"pretty": "prettier --write \"packages/**/*.{ts,tsx,scss,js,jsx}\""
},
"peerDependencies": {
"closest": "^0.0.1",
"emotion": "10.*",
"lodash": "4.*",
"pathfinding": "^0.4.18",
"paths-js": "^0.4.10",
"react": "16.*"
"ncu": "ncu -u && pnpm recursive exec -- ncu -u",
"format": "prettier --write \"**/*.{ts,tsx,js,jsx}\"",
"clean": "rm -rf packages/*/dist",
"test": "pnpm run -r test",
"build": "tsc --build && pnpm run -r build",
"build:prod": "NODE_ENV=production pnpm build",
"release": "pnpm build:prod && pnpm changeset publish",
"release:storybook": "tsc --build && cd diagrams-demo-gallery && pnpm storybook:build && ./node_modules/.bin/storybook-to-ghpages --existing-output-dir .out"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@storybook/addon-actions": "^5.3.19",
"@storybook/addon-options": "^5.3.19",
"@storybook/addons": "^5.3.19",
"@storybook/react": "^5.3.19",
"@storybook/storybook-deployer": "^2.8.6",
"@storybook/theming": "^5.3.19",
"@types/dagre": "^0.7.44",
"@types/jest": "^25.2.3",
"@types/jest-environment-puppeteer": "^4.3.1",
"@types/lodash": "^4.14.155",
"@types/node": "^14.0.9",
"@types/promise": "^7.1.30",
"@types/puppeteer": "^3.0.0",
"@types/react": "^16.9.35",
"babel-loader": "^8.1.0",
"closest": "^0.0.1",
"cross-env": "^7.0.2",
"css-loader": "^3.5.3",
"dagre": "^0.8.5",
"enzyme": "^3.11.0",
"file-loader": "^6.0.0",
"glob": "^7.1.6",
"jest": "^26.0.1",
"jest-cli": "^26.0.1",
"jest-puppeteer": "^4.4.0",
"json-beautify": "^1.1.1",
"lerna": "^3.22.0",
"lodash": "4.*",
"ml-matrix": "^6.5.0",
"pathfinding": "^0.4.18",
"paths-js": "^0.4.10",
"prettier": "^2.0.5",
"puppeteer": "^3.3.0",
"raf": "^3.4.1",
"raw-loader": "^4.0.1",
"react": "^16.8.6",
"react-dom": "^16.13.1",
"react-test-renderer": "^16.13.1",
"resize-observer-polyfill": "^1.5.1",
"rimraf": "^3.0.2",
"source-map-loader": "^1.0.0",
"storybook-host": "^5.1.0",
"storybook-readme": "^5.0.8",
"style-loader": "^1.2.1",
"terser-webpack-plugin": "^3.0.3",
"ts-jest": "^26.1.0",
"ts-loader": "^7.0.5",
"typescript": "^3.9.3",
"val-loader": "^2.1.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0",
"webpack-node-externals": "^1.7.2"
"@changesets/cli": "^2.26.2",
"@types/jest": "^29.5.5",
"@types/node": "^20.6.3",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.1",
"source-map-loader": "^4.0.1",
"terser-webpack-plugin": "^5.3.9",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-node-externals": "^3.0.0"
}
}

View File

@@ -1,2 +0,0 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-options/register';

View File

@@ -1,8 +0,0 @@
import { configure } from '@storybook/react';
function loadStories() {
require('../index.tsx');
// You can require as many demos as you need.
}
configure(loadStories, module);

Some files were not shown because too many files have changed in this diff Show More