Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring the Plutus playground client. (#2629)
* Moving lots of stuff around. * Fixing an unused imports warning. * Setting the plutus logo as a global in entry.js (so webpack is happy with its path in both dev and prod). Co-authored-by: Kris Jenkins <kris.jenkins@tweag.io>
- Loading branch information
Showing
23 changed files
with
619 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Action.Lenses | ||
( _caller | ||
, _blocks | ||
, _InSlot | ||
, _slot | ||
) where | ||
|
||
import Data.BigInteger (BigInteger) | ||
import Data.Lens (Iso', Lens', iso) | ||
import Data.Lens.Record (prop) | ||
import Data.Newtype (unwrap, wrap) | ||
import Data.Symbol (SProxy(..)) | ||
import Plutus.V1.Ledger.Slot (Slot) | ||
import Prelude ((<<<)) | ||
|
||
_caller :: forall r a. Lens' { caller :: a | r } a | ||
_caller = prop (SProxy :: SProxy "caller") | ||
|
||
_blocks :: forall r a. Lens' { blocks :: a | r } a | ||
_blocks = prop (SProxy :: SProxy "blocks") | ||
|
||
_InSlot :: Iso' Slot BigInteger | ||
_InSlot = iso (_.getSlot <<< unwrap) (wrap <<< { getSlot: _ }) | ||
|
||
_slot :: forall r a. Lens' { slot :: a | r } a | ||
_slot = prop (SProxy :: SProxy "slot") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module Editor.Lenses | ||
( _warnings | ||
, _keyBindings | ||
, _feedbackPaneMinimised | ||
, _lastCompiledCode | ||
, _currentCodeIsCompiled | ||
, _feedbackPaneDragStart | ||
, _feedbackPaneExtend | ||
, _feedbackPanePreviousExtend | ||
) where | ||
|
||
import Data.Lens (Lens') | ||
import Data.Lens.Iso.Newtype (_Newtype) | ||
import Data.Lens.Record (prop) | ||
import Data.Maybe (Maybe) | ||
import Data.Symbol (SProxy(..)) | ||
import Editor.Types (State) | ||
import Halogen.Monaco (KeyBindings) | ||
import Language.Haskell.Interpreter (SourceCode) | ||
import Prelude ((<<<)) | ||
|
||
_warnings :: forall s a. Lens' { warnings :: a | s } a | ||
_warnings = prop (SProxy :: SProxy "warnings") | ||
|
||
_keyBindings :: Lens' State KeyBindings | ||
_keyBindings = _Newtype <<< prop (SProxy :: SProxy "keyBindings") | ||
|
||
_feedbackPaneMinimised :: Lens' State Boolean | ||
_feedbackPaneMinimised = _Newtype <<< prop (SProxy :: SProxy "feedbackPaneMinimised") | ||
|
||
_lastCompiledCode :: Lens' State (Maybe SourceCode) | ||
_lastCompiledCode = _Newtype <<< prop (SProxy :: SProxy "lastCompiledCode") | ||
|
||
_currentCodeIsCompiled :: Lens' State Boolean | ||
_currentCodeIsCompiled = _Newtype <<< prop (SProxy :: SProxy "currentCodeIsCompiled") | ||
|
||
_feedbackPaneDragStart :: Lens' State (Maybe Int) | ||
_feedbackPaneDragStart = _Newtype <<< prop (SProxy :: SProxy "feedbackPaneDragStart") | ||
|
||
_feedbackPaneExtend :: Lens' State Int | ||
_feedbackPaneExtend = _Newtype <<< prop (SProxy :: SProxy "feedbackPaneExtend") | ||
|
||
_feedbackPanePreviousExtend :: Lens' State Int | ||
_feedbackPanePreviousExtend = _Newtype <<< prop (SProxy :: SProxy "feedbackPanePreviousExtend") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.