Skip to content

Merge development into master #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 316 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
79b4c6a
Patch the patch. #168 #155
epost May 28, 2019
e886d55
Merge pull request #170 from statebox/155/tests
epost May 29, 2019
2062e9d
Undo stbx.js FP API patch. #177 #168 #155
epost May 29, 2019
1ff0b2b
Merge pull request #172 from statebox/171/undo-stbxjs-patch
epost May 29, 2019
1747725
Introduce evalTxSum and clean up around it. #155
epost May 29, 2019
2056193
Merge pull request #173 from statebox/evalTxSum
epost May 30, 2019
952f7a2
Explain encodings and glueing better. #176
epost May 30, 2019
ce825c9
Rename nets and transitions for clarity. #176
epost May 30, 2019
c5d8e2a
Merge pull request #177 from statebox/176/doc
epost May 30, 2019
93668cd
Elaborate 'Wiring' documentation. #176
epost May 31, 2019
d426973
Merge pull request #178 from statebox/176/doc
epost May 31, 2019
00e271f
Add 'Normal' to 'TransitionSort'. #181
epost Jun 4, 2019
2a33330
Merge pull request #183 from statebox/181/transitionsort-normal
epost Jun 4, 2019
4c830e1
Move Transaction codec from Statebox.Client into Statebox.Core.Transa…
epost Jun 4, 2019
c8038be
Merge pull request #184 from statebox/181/mv-tx-codec
epost Jun 4, 2019
8a6db65
Move types around.
epost Jun 5, 2019
dc74d9a
Merge pull request #185 from statebox/move-types-around
epost Jun 5, 2019
b9d82ed
Sort out Statebox.Core 'path' field types.
epost Jun 5, 2019
6bb41b0
normal transition sort is actually called "vanilla"
marcosh Jun 5, 2019
78ce7d6
add more complicated test cases for executions
marcosh Jun 5, 2019
07866ff
More sorting out of Statebox.Core 'path' field types.
epost Jun 5, 2019
ea26c53
Merge pull request #186 from statebox/move-types-around
epost Jun 5, 2019
acf2b61
Merge pull request #187 from statebox/add-execution-tests
epost Jun 5, 2019
9c927d2
(De)serialise TransitionSort Normal as "vanilla".
epost Jun 5, 2019
dc2d2ea
156/decode root tx (#189)
epost Jun 6, 2019
621ea3e
Remove README note about resolved issue #168.
epost Jun 6, 2019
82c773a
Small improvements on executions tests (#188)
marcosh Jun 7, 2019
8d9aac8
Introduce über-root constructor UberRoot #190 (WIP) (#193)
epost Jun 10, 2019
3fc85af
Create stbx-service-rest spago build. #194 (WIP) (#197)
epost Jun 10, 2019
8732c32
Rename stbx-client-http to stbx-client-rest. #199 (#200)
epost Jun 10, 2019
9a70f51
Add Netlify badge to README
epost Jun 10, 2019
9aa7ae6
Add Netlify badge to README.md in project root
epost Jun 10, 2019
b2fb223
Depend on our own fork of purescript-halogen-svg. #1 (#202)
epost Jun 10, 2019
e2ca3f7
Move ObjectTree to TreeMenu in its own Spago module 'halogen-tree-men…
epost Jun 10, 2019
289d751
Create stbx-example-data Spago module. #206
marcosh Jun 12, 2019
73b9cf3
Publish generated source docs for stbx-core. #192 (#209)
epost Jun 13, 2019
0a9bd33
Add source code docs badge to README. #192 (#211)
epost Jun 17, 2019
6bac4de
Load transactions up to root. #212 (#215)
epost Jun 21, 2019
d6b367e
Stream fetched API transactions into menu. #212 (WIP) (#217)
epost Jul 3, 2019
62c045e
halogen-petrinet-editor: create Spago module. #218 (WIP) (#221)
epost Jul 4, 2019
3ae9d27
halogen-petrinet-editor: Restructure dependencies. #218 (WIP) (#223)
epost Jul 5, 2019
5afa92a
halogen-petrinet-editor: Remove stbx-core dependency. #218
epost Jul 9, 2019
089f853
Create PetrinetEditor example project. #222 (WIP) (#227)
epost Jul 10, 2019
9450cc3
stbx-service-rest: Create API transactions endpoint '/tx' (WIP) (#213)
marcosh Jul 11, 2019
7bbd092
studio: Fix animations in PetrinetEditor components. #228 (#232)
epost Jul 11, 2019
a961a41
stbx-service-rest: Some minor rearranging and polish. #204 (#233)
epost Jul 15, 2019
ecfd461
stbx-service-rest: Serve example transactions. #235 (WIP) (#236)
epost Jul 22, 2019
95605fa
stbx-service-rest: Rename Err to Status. #235
epost Jul 22, 2019
ab00b39
Update TreeMenu to Halogen v5
Aug 22, 2019
b753728
Update petrinet-editor to Halogen v5
Aug 23, 2019
fcd2155
Update the petrinet-editor example to Halogen v5
Aug 23, 2019
e4367d5
Add dhall files to studio-common
Aug 23, 2019
3ac470d
Update studio to Halogen v5
Aug 25, 2019
cebc090
Clean up spago files
Aug 27, 2019
d0a4ba5
PR feedback
Aug 27, 2019
8bfcdcf
npm audit fix
Aug 28, 2019
e9277d2
Merge pull request #238 from statebox/174/halogen-v5
sjoerdvisscher Aug 28, 2019
8d5537e
fix broken Spago build (issue #239) (#240)
epost Aug 30, 2019
90b7968
Fix PureScript versions in package.json files. #239
epost Aug 30, 2019
4965a17
Make subprojects depend on central /packages.dhall file. #198 (#243)
epost Aug 30, 2019
1dac8cf
stbx-core: Fix test compilation error. #239 (#244)
epost Aug 31, 2019
26730c6
Refactor layouting. #141 (#245)
epost Sep 4, 2019
9aacd5c
Move layout computation outside of netToSVG. #141
epost Sep 4, 2019
bc6e6b2
Add basic Travis build. #246
epost Sep 4, 2019
7c29868
Remove a comment to trigger Travis build.
epost Sep 4, 2019
8943599
Rename travis.yml to .travis.yml. #246
epost Sep 4, 2019
326bf1a
Fix .travis.yml syntax (hopefully). #246
epost Sep 4, 2019
aea869d
Add 'language: node_js' to .Travis.yml. #246
epost Sep 4, 2019
d5a3e1d
Use different .travis.yml altogether. #246
epost Sep 4, 2019
1a98255
More pleading with Travis. #246
epost Sep 4, 2019
16d9af0
Add Travis badge. #246
epost Sep 4, 2019
4355097
Bump stbx-js version of studio/studio to 0.0.31. #242
epost Sep 4, 2019
c37946b
Update package-lock.json files across monorepo.
epost Sep 4, 2019
92833f8
halogen-petrinet-editor-example: Use NetLayout. #141
epost Sep 4, 2019
6191ccb
Remove some import warnings.
epost Sep 4, 2019
fe7a072
Add stbx-core/generated-docs to .gitignore.
epost Sep 4, 2019
0c9d7f4
Segregate model, view bits from Studio module. #247 (WIP) (#248)
epost Sep 6, 2019
e1a219e
More flexible layouting + tx and history views. #247 (WIP) (#249)
epost Sep 10, 2019
cfe0fb9
Remove obsolete imports from PetriNetEditor.purs (#251)
epost Sep 11, 2019
5997415
Studio WIP (#252)
epost Sep 12, 2019
c8f3d77
studio: Make API URL configurable. #247 (#255)
epost Sep 13, 2019
e9bacc5
Move 'home' view into its own function. #247
epost Sep 18, 2019
e8bd392
Petri net rendering improvements (#261)
epost Oct 17, 2019
bf67cb1
Diagram editor: add keyboard controls. (#262)
clayrat Oct 22, 2019
5b350ce
halogen-petrinet-editor: auto layout using dagre-js. (#263)
epost Oct 23, 2019
cbc3459
Fix studio
Oct 23, 2019
d080646
Ignore dagre.min.js
Oct 23, 2019
f96d9c9
switch from (Int /\ Int) to vectors (#268)
clayrat Oct 29, 2019
69b64c1
Initial version of Statebox language compiler. #260 (#269)
epost Nov 4, 2019
b5b3d92
WIP: connect api to domain (#254)
marcosh Nov 5, 2019
2651a98
Patch wiring decoder broken by merge conflict. #230
epost Nov 5, 2019
3fc670c
stbx-tx-store: Create Spago module. #271
epost Nov 5, 2019
95d9433
stbx-tx-store: Generalise (hash, transaction) store actions to (key, …
epost Nov 6, 2019
15c2b3c
stbx-tx-store: Refactor things. #271
epost Nov 6, 2019
d126f73
stbx-service-rest: Put tx dict in a eparate field in AppState. #271
epost Nov 7, 2019
dc55899
stbx-service-rest: Fully qualify Ref.{new, read, write}. #271
epost Nov 7, 2019
2905740
stbx-core: Fix tests. #217
epost Nov 8, 2019
e87531d
stbx-core: Statebox.Core: add tx decoding tests. #217
epost Nov 8, 2019
45f0713
stbx-service-rest: Decode transactions from hex instead of JSON. #271
epost Nov 8, 2019
879b72a
stbx-service-rest: Compute hashes for POSTed transactions. #271
epost Nov 8, 2019
033390d
Make stbx-lang build
Nov 11, 2019
3c6fc19
Correct error message
Nov 11, 2019
e0b3399
stbx-service-rest: Define errors handling according to js cloud code.…
epost Nov 13, 2019
c2fdada
Commit forgotten TransitionF'.
epost Nov 13, 2019
c4b99ac
Vec spago module (#274)
clayrat Nov 13, 2019
fdfff1a
stbx-lang: wirings #270 (PR #275)
sjoerdvisscher Nov 13, 2019
17daa74
Fix remaining warnings in Wiring code
Nov 14, 2019
f235142
stbx-service-rest: Rename Statebox.Service.Err to TxError. #271
epost Nov 14, 2019
8a68e28
stbx-service-rest: Add tests that POST our example transaction sequen…
epost Nov 14, 2019
696ac2d
stbx-service-rest: Remove stbx-example data and ExampleData.purs. #271
epost Nov 14, 2019
32242a6
stbx-service-rest: Decode and save transactions into the tx store. #2…
epost Nov 14, 2019
bb4cade
Add wiring -> diagram test
Nov 19, 2019
f214105
Move halogen-diagram-editor into its own Spago package. (#280)
clayrat Nov 19, 2019
a78b623
Generate kdmoncat diagrams from a list of edges
Nov 22, 2019
862e4fa
Generate DiagramV2s from Wirings directly
Nov 26, 2019
6309702
stbx-service-rest: Create and enable integration tests #271 (#277)
epost Nov 28, 2019
224a997
Rename Wiring and Diagram-related functions and rearrange tests. #278
epost Nov 29, 2019
cc4cc1b
Add a bunch of newlines. #278
epost Dec 2, 2019
1bbeca0
Merge pull request #281 from statebox/diagramv2
sjoerdvisscher Dec 2, 2019
be16565
halogen-diagram-editor: Persist updated diagrams in memory. (#286)
clayrat Dec 9, 2019
cb9bc97
halogen-graphical package #292
sjoerdvisscher Dec 16, 2019
effef70
Add ReactiveInput component #295
sjoerdvisscher Dec 16, 2019
99aeba8
Add canvas component with grid
sjoerdvisscher Dec 16, 2019
ad3697a
Add grid spacing slider
sjoerdvisscher Dec 16, 2019
a2c1bb1
halogen-kdmoncat: integrate kdmoncat codebase via git subtree (WIP) (…
epost Dec 17, 2019
14b42ae
Merge branch 'development' into halogen-graphical
sjoerdvisscher Dec 18, 2019
cb4257e
rename to grid-kit
sjoerdvisscher Dec 18, 2019
bd8fcd5
Don't rerender if the input is the same
sjoerdvisscher Dec 18, 2019
6983f51
build: Upgrade to spago 0.12.1.0. #287 (#300)
epost Dec 19, 2019
325631f
Clarify grid code
sjoerdvisscher Dec 19, 2019
9bb38c9
build: Upgrade to spago 0.13 and Purescript 0.13.5. #287 (#302)
epost Dec 20, 2019
61ef5ad
Affine transformations
sjoerdvisscher Dec 24, 2019
60bf8b4
Simplify mul implementation for affine transformations
sjoerdvisscher Dec 24, 2019
8bf8dc1
Move example code to purescript
sjoerdvisscher Dec 24, 2019
c3ad1c0
Expand grid to cover all visible area (#292)
sjoerdvisscher Dec 24, 2019
5d88f45
Use more affine transforms in Canvas
sjoerdvisscher Dec 31, 2019
14ef41b
Canvas -> Grid, add Points to example (#292)
sjoerdvisscher Jan 7, 2020
1034ea1
halogen-grid-kit: Syntactic noodling. #292
epost Jan 8, 2020
45744b7
halogen-grid-kit: Remove trailing newlines. #292
epost Jan 8, 2020
b8664f9
Add GridKit.KeyHandler
sjoerdvisscher Jan 8, 2020
d7694b0
Add key help popup (#306)
sjoerdvisscher Jan 13, 2020
484f6d5
PR feedback
sjoerdvisscher Jan 13, 2020
b6f9681
Merge branch 'halogen-graphical' into 306/keyboard-helpers
sjoerdvisscher Jan 13, 2020
dbc43c1
Clean up
sjoerdvisscher Jan 13, 2020
d41f4c1
Add AffineTransform tests and fix detected bug
sjoerdvisscher Jan 13, 2020
ae6301c
Merge branch 'halogen-graphical' into 306/keyboard-helpers
sjoerdvisscher Jan 14, 2020
f7bd83c
Apply ReactiveInput to KDMonCat
sjoerdvisscher Jan 14, 2020
3d626f3
Merge branch 'development' into 306/keyboard-helpers
sjoerdvisscher Jan 14, 2020
f420607
Use grid-kit in KDMonCat (#295, #306)
sjoerdvisscher Jan 14, 2020
185180c
Fix GridKit example (#292)
sjoerdvisscher Jan 15, 2020
2ad30fc
halogen-grid-kit: Create package. (#303)
sjoerdvisscher Jan 16, 2020
49f39df
Merge branch 'development' into 306/keyboard-helpers
sjoerdvisscher Jan 16, 2020
ce93cd7
Run build.sh and test.sh sequentially (Fixes #311)
sjoerdvisscher Jan 16, 2020
2fcbba1
stbx-service-rest: POST transaction + error handling and test suite. …
marcosh Jan 16, 2020
064c06c
stbx-core: Add 'enabledTransitionIds' function. #307
epost Jan 17, 2020
5bdfb7d
Merge branch 'development' into execution-folding
epost Jan 17, 2020
ef6450e
Merge pull request #319 from statebox/execution-folding
marcosh Jan 17, 2020
fccdb08
PR feedback
sjoerdvisscher Jan 20, 2020
aec052a
Merge branch 'development' into 306/keyboard-helpers
sjoerdvisscher Jan 20, 2020
50d17e9
Merge pull request #315 from statebox/306/keyboard-helpers
sjoerdvisscher Jan 20, 2020
36bb5df
studio: Map brick clicks back to wiring nodes (#310) (#314)
sjoerdvisscher Jan 20, 2020
05596fa
stbx-core: Fix arc multiplicity in conversion from NLL to NetRep. #322
epost Jan 21, 2020
c694ab3
studio: highlight selected kdmoncat bricks in diagram view #321
sjoerdvisscher Jan 21, 2020
963e328
Replace S.attr with exisiting functions that I missed
sjoerdvisscher Jan 22, 2020
c85b1ac
Fix build
sjoerdvisscher Jan 22, 2020
e4ce0c4
Always output input/output types in JSON
sjoerdvisscher Jan 22, 2020
a4d7afb
studio: Show GluedTransitionId history for a given firing. #307 (#324)
epost Jan 23, 2020
73bfda2
studio: Get transaction hash from studio URL. #153 (#327)
epost Jan 23, 2020
6eb4db6
stbx-protocol: Define transaction processing flow. #273 (#318)
marcosh Jan 27, 2020
1c39bb8
[] [stbx-core] fix imports to avoid warnings
marcosh Jan 28, 2020
c2ff689
Render arc waypoints from dagre layout data (#38) (#330)
sjoerdvisscher Jan 28, 2020
9e83b59
Added generic cursorKeyHandler
sjoerdvisscher Jan 30, 2020
b57cc3e
Apply GridKit.KeyHandler to diagram editor
sjoerdvisscher Jan 30, 2020
2c102a4
Pass Input to handleAction of ReactiveInputs
sjoerdvisscher Jan 30, 2020
6795b26
Fix input updating bug in ReativeInput
sjoerdvisscher Jan 30, 2020
98d21af
Use ReactiveInput for DiagramEditor
sjoerdvisscher Jan 30, 2020
175aa50
Refactor Wirings. #331 (WIP) (#333)
epost Jan 31, 2020
dc4774f
halogen-diagram-editor: Superficial syntactic noodling. #316
epost Feb 1, 2020
2e9f4a3
Make the inspector collapsible in diagram viewer (#335)
clayrat Feb 1, 2020
68bdcd2
Merge branch 'development' into 316/diagram-editor-grid-kit
epost Feb 1, 2020
fba7076
Fix unused imports
sjoerdvisscher Feb 3, 2020
25f1db6
Merge pull request #332 from statebox/316/diagram-editor-grid-kit
sjoerdvisscher Feb 3, 2020
7572230
Show unconnected nodes in kdmoncat (#326)
sjoerdvisscher Feb 4, 2020
9317283
stbx-core: Fix stbx-core Spago module name.
epost Feb 6, 2020
4916130
halogen-petrinet-editor: Clean up and trim dependencies. #338 (WIP) (…
epost Feb 7, 2020
a8a2d21
Extract KDMonCat core (#341)
sjoerdvisscher Feb 10, 2020
6bd4519
Bundle studio using build-module and parcel #343 (#345)
sjoerdvisscher Feb 10, 2020
6ce1d46
halogen-tx-explorer: create package #344 (WIP) (#346)
epost Feb 10, 2020
88f9087
studio: Depend on lib cssnano, gone missing during a merge. #344
epost Feb 11, 2020
e422004
Detect kdmoncat errors #342
sjoerdvisscher Feb 11, 2020
7707de8
studio: Revert dependency on cssnano. #344
epost Feb 11, 2020
1df4623
tx-browser: Commit package-lock.json. #344 (#350)
epost Feb 11, 2020
63a1e27
tx-browser: Copy studio web assets rather than referencing them. #344…
epost Feb 11, 2020
acaef27
tx-browser: Add gitignore
sjoerdvisscher Feb 12, 2020
38b5550
Add transition firing output message to halogen-petrinet-editor (#353)
sjoerdvisscher Feb 13, 2020
669dd9a
halogen-diagram-editor: fix x offset of cursor #354 (#357)
clayrat Feb 18, 2020
f034c92
Refactor wirings, paths, routes, etc. #331 (WIP) (#356)
epost Feb 18, 2020
297f866
Merge branch 'development' into 342/kdmoncat-errors
sjoerdvisscher Feb 24, 2020
1fb932c
KDMonCat: PR #349 Feedback (#342)
sjoerdvisscher Feb 25, 2020
8d0a855
Merge pull request #349 from statebox/342/kdmoncat-errors
sjoerdvisscher Feb 25, 2020
5e72206
[#328] [stbx-core] start defining `WiringTree` data structure
marcosh Jan 28, 2020
c0e8e21
[#328] [stbx-core] linearisation of wiring tree
marcosh Jan 31, 2020
db9bfa7
[#328] [stbx-core] Fix typos and standardise spelling and naming.
epost Jan 31, 2020
0796df8
[#328] [stbx-core] restructure imports for Statebox.Core.Lenses
marcosh Feb 3, 2020
75a83b5
[#328] [stbx-core] remove unused imports
marcosh Feb 4, 2020
77dc921
[#328] [stbx-core] split Transition module from WiringTree
marcosh Feb 4, 2020
0eb871f
[#328] [studio-common] empty marking
marcosh Feb 4, 2020
577bf0c
[#328] [stbx-protocol] implement transition firing
marcosh Feb 4, 2020
7b23c59
[#328] [studio-common] refactor to make explicit the subtraction in f…
marcosh Feb 4, 2020
801e86a
[#328] [stbx-core] Reduce intermediate data structures.
epost Feb 5, 2020
fdde102
[#328] [stbx-core, stbx-proto] Commit collaboration session changes.
epost Feb 5, 2020
1018e92
[#328] [stbx-core, stbx-proto] Replace emptyMarking by mempty.
epost Feb 5, 2020
f66e25b
[#328] [stbx-proto] Don't depend on halogen-petrinet-editor for type …
epost Feb 5, 2020
e63708b
[#328] [stbx-core] Use Tokens instead of Int and mark copied types.
epost Feb 6, 2020
3ea1248
[#328] [stbx-core] Rename buildTokens to buildTransitionMarking.
epost Feb 6, 2020
716da98
[#328] [stbx-core] Replace code by invocation of ArrayMultiset.countMap.
epost Feb 7, 2020
3f6ffd4
studio-common: Depend on stbx-core. #328
epost Feb 7, 2020
398fcb2
[#328] [stbx-core] Introduce modle Statebox.Core.Marking and simplify…
epost Feb 7, 2020
66e42fe
[#328] [studio-common, stbx-protocol] check if transition is enabled …
marcosh Feb 6, 2020
c242111
[#336] [stbx-core] test building of marking from array multiset
marcosh Feb 6, 2020
1208f15
[#336] [stbx-core] tests for wiring tree linerisation
marcosh Feb 6, 2020
330873b
[#336] [stbx-core] add new tests to suite
marcosh Feb 6, 2020
e3201b6
[#336] [stbx-core] fix imports after rebase
marcosh Feb 14, 2020
ae4efaf
[#336] [stbx-protocol] setup for tests in stbx-protocol
marcosh Feb 14, 2020
d673bbe
[#336] [stbx-protocol, studio-common] add necessary Eq and Show insta…
marcosh Feb 14, 2020
1eab4ee
[#336] [stbx-protocol] test that firing fails if wiring is not valid
marcosh Feb 14, 2020
3fc37c2
[#336] [stbx-protocol] test other fire failing cases
marcosh Feb 14, 2020
17ddf04
[#336] [studio-common] add Eq instance for Bags considering 0-valued …
marcosh Feb 14, 2020
52d55f6
[#336] [stbx-protocol] add first successful firing tests
marcosh Feb 14, 2020
cab844d
[#336] [stbx-protocol] add testwatch command
marcosh Feb 20, 2020
2e884ad
[#336] [stbx-protocol] add fireMultiple
marcosh Feb 20, 2020
2549576
[#336] [stbx-protocol] test fireMultiple
marcosh Feb 20, 2020
dc219ed
[#336] [stbx-core] fix imports after rebase
marcosh Feb 20, 2020
6de849d
[#336] [stbx-core] rename Transition test file to Marking
marcosh Feb 20, 2020
13d179b
[#336] [halogen-petrinet-editor, stbx-core, stbx-protocol] fixes afte…
marcosh Feb 20, 2020
807f74f
[#336] [stbx-core, stbx-protocol] Minor touch-ups
epost Feb 25, 2020
0ac43f7
studio: remove examples. #363
epost Feb 28, 2020
2248c12
KDMonCat: Port login changes from purescript-kdmoncat
sjoerdvisscher Feb 29, 2020
37e5e28
studio: Move main into its own namespace. #367
epost Mar 3, 2020
2213161
studio: Make studio component's render, eval, etc top-level for reusa…
epost Mar 3, 2020
7fc0604
studio: Fix a few type wildcard warnings. #367
epost Mar 3, 2020
df858d7
360/handle calls with stbx protocol (#362)
epost Mar 5, 2020
b760825
add start command to stbx-service-rest to be used by google cloud
marcosh Mar 5, 2020
90b7c3d
studio: Use @statebox/style. #368
epost Mar 5, 2020
3fbb57d
Segregate Paths and Routes to API objects. #358 (#372)
epost Mar 6, 2020
d3613c6
[stbx-rest-service] add build step for gcloud start
marcosh Mar 9, 2020
58c9705
[#374] [stbx-service-rest] rename /helthcheck to /ping
marcosh Mar 9, 2020
9c5c787
[#374] [stbx-service-rest] change service port to 8008
marcosh Mar 10, 2020
79e072c
[#374] [stbx-rest-integration] correct service port in tests
marcosh Mar 10, 2020
a0d07cb
[#374] [stbx-service-rest] use /tx as prefix for all service routes
marcosh Mar 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
.psc-ide-port
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js: stable
script:
- scripts/buildandtest.sh
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Statebox Studio
# Statebox PureScript monorepo

## Try online
studio demo: [![Netlify Status](https://api.netlify.com/api/v1/badges/8e848ea5-2d7f-4e74-98d7-330a13819bd0/deploy-status)](https://app.netlify.com/sites/statebox-studio-test/deploys).

https://statebox-studio-test.netlify.com/
source code docs: [![Netlify Status](https://api.netlify.com/api/v1/badges/40809c59-434f-4210-a088-903d2bea5fbf/deploy-status)](https://app.netlify.com/sites/zealous-swirles-adb9a4/deploys)

## Build and run
monorepo: [![Build Status](https://travis-ci.com/statebox/purescript-studio.svg?token=cVQf36PbhPuPrsV4Ks8k&branch=development)](https://travis-ci.com/statebox/purescript-studio)

Clone and `cd` into the repo, then do:
```
npm i
npm run bundle
```
Then open `dist/index.html` in your browser.
---

This contains Statebox Studio, Statebox REST API, Statebox REST client and associated projects.

See the docs in the [studio](studio/README.md) directory.
51 changes: 0 additions & 51 deletions dist/index.html

This file was deleted.

1 change: 0 additions & 1 deletion dist/vendor/tailwind.min.css

This file was deleted.

10 changes: 10 additions & 0 deletions halogen-diagram-editor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
18 changes: 18 additions & 0 deletions halogen-diagram-editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "purescript-halogen-diagram-editor",
"version": "1.0.0",
"description": "Halogen brick diagram editor component",
"author": "Erik Post <[email protected]>",
"main": "index.js",
"scripts": {
"postinstall": "spago install",
"build": "spago build --purs-args --censor-codes=ImplicitImport,ImplicitQualifiedImport,HidingImport",
"watch": "spago build --watch --purs-args --censor-codes=ImplicitImport,ImplicitQualifiedImport,HidingImport"
},
"devDependencies": {
"purescript": "^0.13.5",
"purescript-psa": "^0.7.3",
"spago": "^0.13"
},
"license": "ISC"
}
11 changes: 11 additions & 0 deletions halogen-diagram-editor/spago.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ name =
"halogen-diagram-editor"
, dependencies =
[ "vec"
, "halogen-svg"
]
, packages =
../packages.dhall
, sources =
[ "src/**/*.purs", "test/**/*.purs" ]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module View.Diagram.FromNLL (fromNLL, ErrDiagramEncoding(..)) where
module Data.Diagram.FromNLL (fromNLL, ErrDiagramEncoding(..)) where

import Data.Array hiding (head, tail, length)
import Data.Array.NonEmpty (toNonEmpty)
Expand Down Expand Up @@ -35,15 +35,15 @@ instance showErrDiagramEncoding :: Show ErrDiagramEncoding where

type DiagramM a = Either ErrDiagramEncoding a

-- | See https://adoring-curie-7b92fd.netlify.com/.
-- | See https://adoring-curie-7b92fd.netlify.com and https://docs.statebox.org/spec.
type BrickDiagram a =
{ width :: Int
, elements :: Array a
, pixels :: Array a
}

-- | Makes a brick diagram without checking bounds and sizes.
mkBrickDiagramUnsafe :: ∀ a. Int -> Array a -> BrickDiagram a
mkBrickDiagramUnsafe width ops = { width: width, elements: ops }
mkBrickDiagramUnsafe width ops = { width: width, pixels: ops }

-- | Safe constructor for brick diagrams, checks that the encoded array has the right size.
mkBrickDiagram :: ∀ a. Int -> Array a -> DiagramM (BrickDiagram a)
Expand All @@ -54,12 +54,12 @@ mkBrickDiagram w ops | length ops `mod` w == 0 = Right $ mkBrickDiagramUnsafe w

-- | Get the height of a brick diagram, assuming it's perfectly rectangular.
height :: ∀ a. BrickDiagram a -> Int
height b = (length b.elements) / b.width
height b = (length b.pixels) / b.width

-- | Return the element below the given coordinates, if any.
below :: ∀ a. BrickDiagram a -> Int -> Int -> Maybe a
below b x y = let l = min (height b) (y + 1) in
index b.elements (l * b.width + x)
index b.pixels (l * b.width + x)

-- Converting brick diagrams to directed graphs -----------------------------------------------------------------------

Expand Down Expand Up @@ -88,11 +88,11 @@ isSelfArrow {source, target} = source == target
brickToGraph :: ∀ a. Eq a => BrickDiagram a -> Array (GraphArrow a)
brickToGraph b = mapMaybe (edge b) indices
where
indices = range 0 (length b.elements - 1)
indices = range 0 (length b.pixels - 1)

-- | Given a brick diagram and an index, return one of the arrows leaving the node at this index.
edge :: ∀ a. Eq a => BrickDiagram a -> Int -> Maybe (GraphArrow a)
edge b i = { source: _, target: _ } <$> index b.elements i <*> below b xPos yPos
edge b i = { source: _, target: _ } <$> index b.pixels i <*> below b xPos yPos
where
yPos = i / b.width
xPos = i `rem` b.width
Expand Down Expand Up @@ -142,7 +142,7 @@ type ConsecutiveValues a = { value :: a, length :: Int }
-- | [--4--]
-- | ```
graphToOps :: ∀ a. Eq a => Show a => BrickDiagram a -> Array Operator
graphToOps { width: width, elements: brick } =
graphToOps { width: width, pixels: brick } =
let lines = splitLines width brick
l = mapWithIndex mapOperators $ map packConsecutive lines in
concat l
Expand Down Expand Up @@ -170,8 +170,8 @@ nllToBrickDiagram :: Array Int -> DiagramM (BrickDiagram Int)
nllToBrickDiagram nll = case uncons nll of
Just { head, tail } -> mkBrickDiagram head tail
Nothing -> Right $ mkBrickDiagramUnsafe 0 []
fromNLL :: Array Int -> String -> DiagramM DiagramInfo
fromNLL nll name = do bricks <- nllToBrickDiagram nll

fromNLL :: String -> Array Int -> DiagramM DiagramInfo
fromNLL name nll = do bricks <- nllToBrickDiagram nll
_ <- parseBrickToGraph 0 bricks
Right $ brickToDiagram bricks name
14 changes: 14 additions & 0 deletions halogen-diagram-editor/src/View/Diagram/Common.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module View.Diagram.Common where

import Prelude
import Data.Int (toNumber, round)
import Halogen.HTML.Properties as HP
import Halogen.HTML.Core as HC

-- TODO copied from halogen-petrinet-editor.View.Common
classesWithNames :: ∀ r i. Array String -> HP.IProp (class :: String | r) i
classesWithNames names = HP.classes (HC.ClassName <$> names)

-- snap s x = x - (x % s)
snap :: Int -> Int -> Int
snap s x = s * round (toNumber x / toNumber s) -- s * (x // s)
140 changes: 140 additions & 0 deletions halogen-diagram-editor/src/View/Diagram/DiagramEditor.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
module View.Diagram.DiagramEditor where

import Prelude hiding (div)

import Data.Array (snoc, length)
import Data.Maybe (Maybe(..), maybe)
import Data.Tuple.Nested ((/\))
import Data.Vec3 (Vec3, vec3, _x, _y, _z)
import Effect.Aff.Class (class MonadAff)
import GridKit.KeyHandler
import Halogen as H
import Halogen (ComponentHTML, HalogenM)
import Halogen.HTML (HTML, div, text, button)
import Halogen.HTML.Core (ClassName(..))
import Halogen.HTML.Events (onClick)
import Halogen.HTML.Properties (classes, tabIndex)
import Unsafe.Coerce (unsafeCoerce)
import Web.DOM (Element)
import Web.HTML.HTMLElement (HTMLElement)

import View.ReactiveInput as ReactiveInput
import View.Diagram.Common (classesWithNames)
import View.Diagram.Model (DragStart(..), Operators)
import View.Diagram.Update (Action(..), MouseMsg(..), Msg(..), State, evalModel)
import View.Diagram.View as View
import View.Diagram.Inspector as Inspector

initialState :: State
initialState =
{ model:
{ config: { scale: 24, width: 550, height: 450 }
, selectedOpId: Nothing
, mouseOver: Nothing
, mousePos: vec3 0 0 0
, cursorPos: vec3 0 0 0
, mousePressed: false
, dragStart: DragNotStarted
}
, msg: ""
, keyHelpVisible: false
, componentElemMaybe: Nothing
, inspectorVisible: false
}

ui :: ∀ m q. MonadAff m => H.Component HTML q Operators Msg m
ui = ReactiveInput.mkComponent { initialState, render, handleInput, handleAction }
where
keys :: KeysWithHelpPopup Action
keys = keysWithHelpPopup
{ keys: keyHandler [ Shortcut noMods "Space" ] (Just $ text "Insert a new operator") CreateOp <>
cursorKeyHandler noMods MoveCursor
, popupAction: ToggleKeyHelp
}

render :: Operators -> State -> ComponentHTML Action () m
render ops state =
div [ classes [ ClassName "css-diagram-editor" ]
, tabIndex 0
, keys.onKeyDown
]
[ div [ classes [] ]
[ View.diagramEditorSVG state.componentElemMaybe ops state.model <#> MouseAction
, div [ classes [ ClassName "css-diagram-editor-inspector-container" ] ]
[ div [ classes [ ClassName "css-diagram-editor-inspector-link-container" ] ]
[ button [ onClick \_ -> Just ToggleInspector ]
[ text $ (if state.inspectorVisible then "Hide" else "Show") <> " inspector" ]
]
, if state.inspectorVisible
then div [ classesWithNames [ "mt-4", "rb-2", "p-4", "bg-grey-lightest", "text-grey-dark", "rounded", "text-sm" ] ]
[ Inspector.view ops state ]
else div [] []
]
]
, keys.helpPopup state.keyHelpVisible
]

handleInput :: Operators -> HalogenM State Action () Msg m Unit
handleInput _ = do
componentElemMaybe <- getHTMLElementRef' View.componentRefLabel
H.modify_ \state -> state { componentElemMaybe = componentElemMaybe }

handleAction :: Operators -> Action -> HalogenM State Action () Msg m Unit
handleAction ops = case _ of

CreateOp -> do
m <- H.get <#> _.model
let id = length ops
let newOp = { identifier: "new" <> show id, pos: m.cursorPos + vec3 1 0 7, label: "new" <> show id }
H.modify_ \st -> st { model = m { cursorPos = m.cursorPos + vec3 0 1 0 } }
H.raise $ OperatorsChanged (ops `snoc` newOp)

MoveCursor delta -> do
m <- H.get <#> _.model
let { cursorPos, config: { scale, width, height } } = m
let cursorPos' = clamp2d (width/scale+1) (height/scale+1) (cursorPos + delta)
H.modify_ \st -> st { model = m { cursorPos = cursorPos' } }

MouseAction msg -> do
state <- H.get
let (opsChanged /\ model') = evalModel msg ops state.model
state' = state { model = model' }

case opsChanged of
Just ops' -> H.raise (OperatorsChanged ops')
Nothing -> pure unit

let isOperatorClicked = case msg of
MouseUp _ -> true
_ -> false

clickedOperatorId = case state'.model.mouseOver of
Just (op /\ oph) | isOperatorClicked -> Just op.identifier
_ -> Nothing

state'' = if isOperatorClicked then state' { model = state'.model { selectedOpId = clickedOperatorId } }
else state'

H.put state''

maybe (pure unit) (H.raise <<< OperatorClicked) clickedOperatorId

ToggleKeyHelp -> do
H.modify_ $ \state -> state { keyHelpVisible = not state.keyHelpVisible }

ToggleInspector -> do
H.modify_ \state -> state { inspectorVisible = not state.inspectorVisible }

--------------------------------------------------------------------------------

clamp2d :: Int -> Int -> Vec3 Int -> Vec3 Int
clamp2d width height xy = vec3 (clamp 0 (width - 1) (_x xy)) (clamp 0 (height - 1) (_y xy)) (_z xy)

-- TODO this is generally useful; move elsewhere
-- This was made because the original implementation from Halogen.Query doesn't seem to work, at least in this case:
-- getHTMLElementRef = map (HTMLElement.fromElement =<< _) <<< getRef
getHTMLElementRef' :: forall s a i o m. H.RefLabel -> HalogenM s a i o m (Maybe HTMLElement)
getHTMLElementRef' = map (map elementToHTMLElement) <<< H.getRef
where
elementToHTMLElement :: Element -> HTMLElement
elementToHTMLElement = unsafeCoerce
Loading