Commit Graph

12 Commits

Author SHA1 Message Date
Beka Westberg db09cbf6e4 feat: add serialization and deserialization of comments (#5216)
* Add tests for (de)seralizing icons

* Add logic for (de)serializing icons

* fix: add docs for saveIcons

* fix: add timeout for setting comment visible
2021-08-18 06:51:34 -07:00
Beka Westberg acbfb5af57 Add throwing exceptions during deserialization (#5200)
* Add exception definitions

* Add tests for throwing errors during deserialization

* Add actually throwing exceptions

* Cleanup

* Cleanup

* Fix tests

* fix: PR Comments
2021-08-17 06:55:25 -07:00
Beka Westberg 39826e4b33 feat: upgrade block defs to have JSO serialization hooks (#5329)
* Respect nulls from blocks.save

* Upgrade list blocks to use JSO serialization

* Upgrade logic blocks to use JSO serialization

* Upgrade math blocks to use JSO serialization

* Upgrade text blocks to use JSO serialization

* Upgrade procedure blocks to use JSO serialization

* Add more mutator tests

* Fix firing enabled events

* PR Comments
2021-08-12 08:53:28 -07:00
Beka Westberg 5631d4a490 fix: touch up some deserialization behavior (#5181)
* Add parameter for recording undo.

This sets up the most common default behavior, but also makes it clear
to people that it is happening, because it might not be expected.

* Add grouping of events

* Add text width caching

* Add disabling workspace resizing

* Add performance optimizations

* Respect nulls from blocks.save

* Cleanup from rebase

* PR Comments

* Cleanup from rebase
2021-08-11 08:01:24 -07:00
Beka Westberg cc26417e7e feat: add initialization of blocks and event firing (#5166)
* Change playground to use JSO system

* Add tests for initialization and events

* Add initialization of blocks

* PR Comments
2021-08-10 13:14:37 -07:00
Beka Westberg ea8eb52c00 feat: add deserialization of JSO block state (#5137)
* Fixup tests

* Add deserialization of blocks

* Cleanup

* PR commnts
2021-08-06 11:39:39 -07:00
Beka Westberg c59d0616c6 feat: add top level save and load functions for JSO serialization (#5132)
* Add top-level serialization API

* Add using JSO system in serializer tests

* Make compiler happy
2021-08-06 09:19:23 -07:00
Beka Westberg f9285e269a feat: add JSO serialization and deserialization of variables (#5131)
* Add variable serialization tests

* Fix requires for new file

* Add serialization and deserialization of variables

* Remove only in tests

* Cleanup
2021-08-06 08:45:47 -07:00
Beka Westberg 3fb09af387 feat: add serialization of child blocks (#5120)
* Add tests for serializing connected blocks

* Add serialization of child blocks

* Add tests for not serializing children

* Add options for not serializing children

* Fix types

* Change addNextBlocks to default to true

* Cleanup

* Fix types
2021-08-06 07:55:04 -07:00
Beka Westberg 95c88094d6 Add serialization of field values (#5072)
* Add tests for field serialization

* Add field serialization

* Fixup types and tests
2021-07-30 08:38:00 -07:00
Beka Westberg 8f1f67062d Add serialization of mutators (#5054)
* Add tests for saving extra state

* Add serializing extra state

* Fix backwards compatibility

* Switch to other function declarations

* Handle null returns from hooks

* Remove backwards compatibility

* Remove XML require, and fix type

* Fix JSDoc formatting
2021-07-30 08:06:38 -07:00
Beka Westberg d03f5254ab Add serialization of basic block attributes to JSOs (#5053)
* Add basic attribute tests

* Add basic block serialization

* Add more attribute tests

* Change save to use options dictionary

* Add obeying save options

* Add test for data attribute

* Add saving data tag

* Move to ES6 syntax

* Fixup move to es6 syntax

* Declare module

* Format and lint

* Add docs

* Add returning null on insertion markers

* Fixup for move to module

* Switch to other function declarations

* Cleanup for finalized style

* Fix lint and types

* Export State def

* Switch disabled=true to enabled=false
2021-07-23 15:03:11 -07:00