Commit graph

229 commits

Author SHA1 Message Date
Jonatan Kłosko 3ed5da0106
Implement menu with JS commands and extract into component (#698) 2021-11-10 19:28:09 +01:00
Jonatan Kłosko d8d52c9e89
Add runtime info panel (#692)
* Add runtime info panel

* Remove intro from the runtime modal

* Show default runtime in the panel if no runtime is set
2021-11-09 18:37:22 +01:00
Jonatan Kłosko c473a8c469
Add an option to amplify cell outputs (#689)
* Add an option to amplify cell outputs

* Reorder actions
2021-11-09 10:45:05 +01:00
Jonatan Kłosko 19f92c9e72
Don't sanitize KaTeX rendered SVGs (#684) 2021-11-06 21:25:07 +01:00
Jonatan Kłosko 8889f11244 Don't scroll when focusing cell output 2021-11-05 18:23:26 +01:00
Jonatan Kłosko 8c923f7bda
Show new directory section immediately on the client (#674) 2021-11-03 17:16:09 +01:00
Jonatan Kłosko e38d075fc2
Dynamically import Vega-Lite JS when needed (#673) 2021-11-03 15:58:46 +01:00
Jonatan Kłosko ad4867ddfb
Refactor modals with JS commands (#669)
* Use JS commands for closing the modal with animations

* Refactor modal to render content as slot

* Bump LV
2021-11-02 22:34:44 +01:00
Jonatan Kłosko 021d6ac42e
Improve icon buttons accessibility and navigation (#667)
* Rename tooltip source attribute

* Add aria-label to icon buttons/links

* Actually focus cell content when navigating around

* Add some descriptions

* Fix dynamically computed tooltips
2021-11-01 18:20:56 +01:00
Jakub Perżyło ace64eab37
Add show/hide button for password inputs #566 (#664)
* Added visibility toggle for password cell

* Formatted code

* Moved password toggle to separate component

* Adjusted to review

* Added password toggle for add filesystem component

* Update lib/livebook_web/helpers.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-11-01 16:04:11 +01:00
Jakub Perżyło fbef386aa8
Allow importing a livebook via file upload #645 (#665) 2021-11-01 13:59:39 +01:00
Jean Carlos 421b1c69a1
Show indicators of state on session sidebar (#657)
* Added range input (Slider)
* Added range input (Slider)
* Custom css to range input

* Formatting correction

* Defined min and max values of input range

* Revert "Defined min and max values of input range"

This reverts commit 815167ab0f.

* Added input select

* working with a options like list

* Formatting correction

* swapped li for inputs in input settings

* Removed unused attribute

* Final adjustments

* Improve users connected display

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Adjust elements

* Change favicon based on notebook status

* Format correction

* "operation" is unused

* Improvements for better functioning of icons

* Renamed icons files

* Update favicons

* Update changelog

* Show indicators of state on session sidebar

* Changes to status colors

* Improve spacing

* Scroll to cell on status click

* global_evaluation_status -> global_status

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-11-01 13:15:21 +01:00
Jonatan Kłosko 40158aa6cc
Improve scroll on cell focus/blur (#659)
* Stay in insert mode only if evaluate is clicked

* Never scroll when focusing cell with click
2021-10-29 15:05:59 +02:00
Owen Bickford b6793d6630
Type1fool-smooth-scrolling (#638)
* add scroll behavior to html, body, & notebook elems

* don't append base url or set target on intra-page links

* add back-to-top link, class autosorting/formatting

* add convert global style to `.scroll-smooth` util

* add `isPageAnchor` function

* remove `go-to-top` link

* use `isAbsoluteUrl` and add a semicolon ;)
2021-10-24 19:38:57 +02:00
Matheus Cumpian fe77823685
Removing "Evaluate All Below" shortcut functionality (#621) 2021-10-19 23:36:44 +02:00
Jonatan Kłosko c354c46d89
Update dependencies (#606)
* Update dependencies

* Update dependencies major

* Update mix deps
2021-10-19 00:37:48 +02:00
Jonatan Kłosko 866abe8dee
Update favicon when navigating across sessions (#603) 2021-10-18 22:36:00 +02:00
Jean Carlos 238635a6be
Changed favicon with base on notebook status (#594)
* Change favicon based on notebook status

* Format correction

* "operation" is unused

* Improvements for better functioning of icons

* Renamed icons files

* Update favicons

* Update changelog

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-16 12:24:19 +02:00
Jonatan Kłosko fedbf4f53b
Update matching brackets style (#595) 2021-10-13 14:56:33 +02:00
Jonatan Kłosko 2b1cb57a15
Start new notebooks with a focused code cell (#527)
* Start new notebooks with a focused code cell

* Update changelog
2021-08-30 16:33:40 +02:00
Jonatan Kłosko b1807b1192
Don't sanitize class on icon tags in markdown (#522) 2021-08-28 18:56:56 +02:00
Jonatan Kłosko acd100f3d3
Improve intellisense to handle structs and sigils (#513)
* Update Code.Fragment backport

* Support structs completion and show module subtype

* Support sigil completion

* Update changelog

* Don't show completion items for hidden modules

* Update Code.Fragment backport
2021-08-23 10:42:18 +02:00
Jonatan Kłosko f9e67d27c0
Add a keyboard shortcut for triggering on-hover docs (#508)
* Add a keyboard shortcut for triggering on-hover docs

* Update changelog
2021-08-20 23:25:18 +02:00
Jonatan Kłosko 9822735bcf Update GitHub org references from elixir-nx to livebook-dev 2021-08-18 15:55:07 +02:00
Jonatan Kłosko e0febac309
Switch client side markdown processing to remark (#495) 2021-08-14 10:44:46 +02:00
Jonatan Kłosko 3216727858
Keep original source when highlighting (#480) 2021-07-28 19:35:36 +02:00
Jonatan Kłosko ee51411299
Rewrite hover details using Code.Fragment.surround_context (#471) 2021-07-27 12:32:53 +02:00
Huynh Tan e7a8a0775f
Implement checkbox input (#461)
* Implement checkbox input

* Adjustments

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-07-26 19:59:52 +02:00
Jonatan Kłosko af50646a8e
Convert JavaScript string column to Elixir (#467)
* Fix column/index wording

* Convert JavaScript string column to Elixir
2021-07-26 11:57:51 +02:00
Jonatan Kłosko 7c89fecd8f Improve highlighting of code blocks in Markdown 2021-07-22 16:20:17 +02:00
Jonatan Kłosko ef06e49d18
Show full documentation when hovering over an identifier (#453)
* Show full documentation when hovering over an identifier

* Remove leftover function

* Improve determining subject boundaries
2021-07-20 21:30:53 +02:00
Jonatan Kłosko 28922b3deb
Update deps (#443)
* Update Elixir deps

* Update JS deps

* Increase assertion timeouts

* Run formatter
2021-07-09 14:13:44 +02:00
Jonatan Kłosko bd8e06b5ce
Implement relative navigation between notebooks (#441)
* Use live redirect for local links in rendered markdown

* Resolve relative notebook URLs

* Bump LV

* Adds tests

* Handle nested relative path

* Handle child nested paths
2021-07-08 19:35:11 +02:00
Jonatan Kłosko c1654345b7
Migrate to latest LV (#437)
* Update phoenix deps

* Update reference to LiveDashboard encode_pid

* Fix form input id references

* Move to HEEx

* Update back to filesystem LV npm package

* Further HEEx rewrites

* Refactor icons into function components

* .html.leex -> .html.heex

* Further refactoring

* Move render helpers into function components

* Add doctype back

* Further refactoring

* Refactor cell component

* Further refactoring

* Compose sidebar using function components

* Rewrite notebook card component as function component

* Fruther refactoring

* Fix race condition in runtime tests

* Rewrite tooltips into function component

* Update Tailwind purge rules

* Revert "Rewrite tooltips into function component"

This reverts commit bd6ca8f0b5.

* Refactor conditional tooltip
2021-07-07 14:32:49 +02:00
Jonatan Kłosko d0ec965fad Fix persistent insert mode in modals 2021-07-05 23:33:21 +02:00
Jonatan Kłosko 6d9fb90953
Merge undo stack for collaborative editing (#433) 2021-07-05 14:44:00 +02:00
Jonatan Kłosko 557df4a5bf
Add UI for file deletion and renaming (#426) 2021-07-02 23:06:05 +02:00
José Valim 2dbfb562ea Hardcode font size to 14 for consistency 2021-07-02 16:52:38 +02:00
Jonatan Kłosko 5637d09c09 Fix Enter behaviour on buttons 2021-07-01 17:06:06 +02:00
Jonatan Kłosko c0d9f8253a
Support Enter to enter insert mode (#422) 2021-07-01 16:38:08 +02:00
Jonatan Kłosko b92afcef8e
Highlight matching brackets only in insert mode (#421) 2021-07-01 15:58:18 +02:00
Jonatan Kłosko 2100451df7
Document editor shortcuts and add basic view (#419)
* Document more editor shortcuts

* Add basic shortcuts view

* Improve sizing

* More shortcuts

* Fix replace-all editor shortcut

* Show tab in basic view, hide find shortcut
2021-07-01 15:02:56 +02:00
Jonatan Kłosko 20ff5c95b8
Suggest restarting runtime on Mix.install error and add restart shortcut (#418)
* Suggest restarting runtime on Mix.install error and add restart shortcut

* Apply review comments
2021-07-01 13:23:07 +02:00
Jonatan Kłosko 86316e9460
Add code formatting integration to Elixir cells (#416) 2021-07-01 11:50:04 +02:00
Jonatan Kłosko 2ff327e742
Implement cells bin (#414)
* Implement cells bin

* Temporarily keep cells source

* Send complete bin entries from session to clients when a cell gets removed

* Polish styles

* Hydrate bin entries on section deletion as well
2021-06-30 17:48:27 +02:00
Jonatan Kłosko 44dc3d9041
Improve section management (#411)
* Allow inserting section anywhere in the notebook

* Improve section deletion

* Polishing

* Remove section insertion shortcuts
2021-06-28 23:46:50 +02:00
Jonatan Kłosko 8e5b387f04
Update VegaLite layout when the data changes (#405) 2021-06-26 18:05:52 +02:00
Jonatan Kłosko 73a79cbdae
Add support for markdown output (#404)
* Add support for markdown output

* Make cell indicator absolute

* Update output typespec

* Move rendering to the client

* Polishing
2021-06-26 16:47:52 +02:00
Jonatan Kłosko 6c53c09a61
Add copy to clipboard button to virtualized output (#393)
* Add copy to clipboard button to virtualized output

* Move text output into its own component

* Update button background
2021-06-24 12:15:12 +02:00
Jonatan Kłosko 8415ba311e
Show ticking timer while cell is evaluating (#374) 2021-06-20 17:06:30 +02:00
Jonatan Kłosko 56c087e79a
Improve section links behaviour (#367)
* Limit the impact of section html id changing

* Make sure section links scroll to section after loading finishes
2021-06-18 13:21:48 +02:00
Jonatan Kłosko 9d4139529e
Show clear error when rendering VegaLite plot fails (#362) 2021-06-17 18:24:03 +02:00
Jonatan Kłosko 3df6508b56
Disable autoscroll when focusing in insert mode (#355) 2021-06-16 16:16:26 +02:00
Jonatan Kłosko 4657ad17c3
Update Monaco and use the built-in Elixir definition (#345) 2021-06-14 15:57:13 +02:00
Jonatan Kłosko b0bd7540c0
Compute cell source digest on the client (#341) 2021-06-10 14:54:55 +02:00
Jonatan Kłosko 8dea99e600
Support inputs (#328)
* Render basic input

* Make each cell type a separate struct

* Add operation to set input value

* Prototype communication

* Make input name editable

* Refactoring

* Unify cell attribute setters

* IO tests

* Document input communication protocol in Runtime

* Add more tests

* Add persistence

* Fix status update on cell attributes change

* Rework persistence

* Integrate input cell with insert mode

* Add missing users keybinding

* Mimic autofocus for dynamically inserted elements

* Support input type selection

* Support URL input and set up validation

* Convert input error into a more meaningful io error

* Add missing client checks

* Consume every input only once per evaluation

* Fixes
2021-06-08 12:33:50 +02:00
Jonatan Kłosko a8073ceac1
Add attributions to Delta-related packages (#324) 2021-06-06 15:27:09 +02:00
Jonatan Kłosko 7b89e1ec83
Improve markdown links (#315)
* Make sure link/button clicks don't trigger cell focus

* Open external links in new browser tab
2021-06-03 16:31:41 +02:00
Jonatan Kłosko ce7adef7e4
Add VegaLite widget integration (#306)
* Add support for LiveWidget.VegaLite

* LiveWidget -> Kino

* Show an error when rendering unsupported Kino widget

* Match on Kino.Widget

* Add catch-all for unknown outputs
2021-05-31 22:48:05 +02:00
Jonatan Kłosko f4a479b14e
Improve output container behaviour with horizontal overflow (#295) 2021-05-25 18:55:57 +02:00
Jonatan Kłosko 2e0195f658
Make sure math equations are rendered sequentially (#294) 2021-05-25 14:36:55 +02:00
Jonatan Kłosko 7804ff1d82
Set up Vega-Lite plots rendering (#287)
* Set up Vega-Lite plots rendering

* Automatically recognise VegaLite specification

* Improve matching VegaLite result

* Update naming

* StringFormatter -> DefaultFormatter
2021-05-21 17:51:31 +02:00
Tomasz Tomczyk a750d528c4
Only focus when needed (#283) 2021-05-21 01:59:00 +02:00
Simon McConnell 056d01cee7
check contentElement exists - fixes #264 (#265) 2021-05-08 23:47:57 +02:00
Jonatan Kłosko cd80bd7804
Implement user cursor and selection tracking (#260)
* Implement user cursor and selection tracking

* Separate jump-to-user and follow
2021-05-07 16:41:37 +02:00
Jonatan Kłosko dc605aa209 Specify editor fallback font 2021-05-04 15:48:26 +02:00
Jonatan Kłosko 5c8e117800
Setup user profiles (#253)
* Add initial user config modal

* Assign user ids

* Update session data to hold user ids

* Get users list for specific ids

* Render user avatar

* User update

* Refactor user changes

* Subscribe to individual user updates

* Show users in side panel

* Add sidebar to homepage

* Don't generate the same color twice in a row

* Add documentation notes

* Fix tests

* Add tests

* Keep users in session data

* Rename color to hex_color
2021-05-03 20:03:19 +02:00
Jonatan Kłosko d3a2bfb60b
Ignore patches to content editable elements while focused (#247) 2021-04-28 19:11:19 +02:00
Javier Goday 790b9e764b
Feature cell link (#239)
* #99: Add anchor links to sections and cells

* Restores some css classes removed by error

* Focus cell based on anchor link

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-04-26 14:22:33 +02:00
Jonatan Kłosko e755ff8122
Restructure settings (#233)
* Force menu items into a single line

* Add shortcut for saving the notebook

* Make the disk icon always show file dialog

* Split runtime and file settings into separate modals

* Add ctrl+s to the shortcuts list

* Add togglable menu to the session page

* Make sure newly saved file appears in the file selector

* Fix path seletor force reloading

* Remove notebook generated in tests

* Add test for file list refresh after save
2021-04-21 23:02:09 +02:00
Jonatan Kłosko c498cfb211
Explicitly dispose Monaco editor instance when cell is deleted (#232) 2021-04-21 17:38:48 +02:00
Jonatan Kłosko 700987dc02
Add editor completion to Elixir cells (#208)
* Implement editor completion for Elixir cells

* Add completion tests

* Refactor completion

* Only extract Markdown docs for now

* Fix Elixir version-dependent test

* Fix docs matching

* Use upcoming Code.cursor_context/2

* Start temporary completion processes under a supervisor

* Show Erlang docs in completion items

* Update to latest Code.cursor_context

* Refactor completion

* Fix module completion when alias expands to Erlang module

* Remove tests-generated notebook

* Show variables and map fields differently

* Adjust signatures formatting
2021-04-20 19:34:17 +02:00
Jonatan Kłosko 04edc75181
Scroll to section when moved (#226) 2021-04-20 19:31:23 +02:00
Jonatan Kłosko 6b5de9eda5 Run formatter 2021-04-20 19:29:12 +02:00
José Valim 9a9ad14c8b Use a color from the theme on topbar 2021-04-20 19:06:06 +02:00
Michael Crumm a977957abc
Replace NProgress by topbar (#229) 2021-04-20 18:48:50 +02:00
Benjamin Philip 682ee396d0
Allow re-ordering of sections (#221)
* Allow server-side re-ordering of sections

* `Livebook.Notenook.move_section` definition
* Management and implementation of requests
* tests

This commit allows a person to send a request to the server to move a
section. However, the functionality in not yet available in the UI.

* Allow "Move up" and "Move down" functionality for sections

* Rendering of up and down "arrows" at Section's side
* Request from UI on click

This commit enables a user to move a section upwards or downwards, much
like a cell. However, after the section moves, the focus is not changed
to it.

* Apply formatting

* Define a function to update cell status

* Defines a common function for `move_cell` and `move_section` to use to
update cell status.
2021-04-20 12:12:29 +02:00
TED 623c5b3290
Add notbook runtime settings shortcut (#176) 2021-04-14 12:20:51 +02:00
José Valim e1bab06168
Fix issue with font-family detection (#157) 2021-04-12 18:31:10 +02:00
José Valim 6cbf4d1fb0 Set alwaysConsumeMouseWheel to false instead of disabling it 2021-04-12 13:04:54 +02:00
Jonatan Kłosko 90fb77b878 Disable do/end autocomplete in case it would move the cursor unexpectedly 2021-04-09 16:25:27 +02:00
Jonatan Kłosko d68c271aae
Add support for math formulas (#151)
* Add support for LaTeX equations

* Mention math support in the introductory notebook
2021-04-08 15:31:46 +02:00
Jonatan Kłosko 121eec784d Properly highlight piping into control flow structures 2021-04-08 12:11:03 +02:00
Jonatan Kłosko 70be004ee0
Make autoscroll behaviour more intuitive (#143)
* Fix editor shift

* Make autoscrolling more intuitive
2021-04-05 15:06:14 +02:00
Jonatan Kłosko d93b5d8450
Set up image uploads for Markdown content (#132)
* Add cell image upload modal

* Add controller for serving the images and handle this on markdown side

* Use per-session images dir

* Add etag header to session image responses

* Adjust markdown image styling

* Properly manage session images dir

* Add tests

* Set maximum file size for image uploads

* Move images dir specifics to the Session module

* Move images when nonpersistent session becomes persistent

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/cell_upload_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Test that close gets rid of session temporary dir

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-04 18:55:51 +02:00
Jonatan Kłosko 5efd8eb851
Notebook status indicators (#127)
* Add notebook indicators

* Make evaluation status button point to the corresponding cell

* Rename introductory notebook

* Update path highlight when chosen for saving

* Allow specifying nonexistent directories when saving and create those

* Update lib/livebook_web/live/session_live/indicators_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/indicators_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/indicators_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/indicators_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Update lib/livebook_web/live/session_live/indicators_component.ex

Co-authored-by: José Valim <jose.valim@dashbit.co>

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-01 12:56:19 +02:00
Jonatan Kłosko 4e90666350
Fix pressing insert button when in markdown insert mode (#126) 2021-03-30 22:16:42 +02:00
Jonatan Kłosko e335ecb791
Focus notebook name after creation (#122) 2021-03-29 19:50:46 +02:00
Jonatan Kłosko fdadefae32 Fix module attributes tokenization 2021-03-29 18:40:23 +02:00
Jonatan Kłosko 0983a9df77
Add confirmation for session deletion (#117)
* Update sections panel

* Add deletion confirm and unify buttons

* Align notebook title

* Fix whitespace shrinking in the editor

* Update session deletion route
2021-03-25 17:39:18 +01:00
Jonatan Kłosko fe5dfe3b86
Insert section (#114)
* Add section insertion button

* Add shortcut for inserting section

* Pass buttons to the component

* Add mix alias for running both formatter

* Adjustments

* Make the buttons group component stateless
2021-03-24 18:37:50 +01:00
Jonatan Kłosko 92c34b8718
Add shortcuts for toggling sections panel and showing settings (#110)
* Add shortcuts for toggling sections panel and showing settings

* List new shortcuts
2021-03-23 15:27:03 +01:00
Jonatan Kłosko af79a0fd2f
Improve tab navigation (#109)
* Ignore editor for tab movement

* Improve tab behaviour within notebook

* Highlight focused regular buttons

* Show tooltips on focused elements
2021-03-23 14:10:34 +01:00
Jonatan Kłosko 4061802220
Automatically scroll output (#106) 2021-03-22 16:23:42 +01:00
Jonatan Kłosko e2cd992b78 Add missing monaco import 2021-03-21 16:48:47 +01:00
Jonatan Kłosko 3155d682b8
Enter insert mode when markdown cell is double-clicked (#96) 2021-03-21 16:44:48 +01:00
Jonatan Kłosko 90e7941fe4
Redesign (#80)
* Update cell actions

* Add new focus indicator

* Update headings typography

* Update cell actions and insert buttons

* Add sidebar menu

* Add settings modal

* Update homepage

* Update settings dialog

* Rename classes

* Add floating menu

* Update icon colors on hover

* Fix homepage tests

* Format assets source

* Update monaco editor

* Fix editor width on resize

* Add more padding to the notebook content

* Update settings dialog title

* Show reevaluate button when the cell is in evaluated state

* Show section actions on focus or hover only

* Pre-fill runtime selector with the current configuration

* Ignore cmd + enter in Markdown cells
2021-03-20 14:10:15 +01:00
Jonatan Kłosko 7fa2b44666
Highlight viewed section within the list (#76)
* Add fallback primary fonts

* Highlight viewed section in the navbar

* Fix moving cells with empty sections

* Reword attribute
2021-03-12 16:40:37 +01:00
Jonatan Kłosko a2d1e2f934
Initial redesign (#75)
* Add Remix icons

* Replace existing icons with Remix icons

* Update fonts

* Redesign homepage

* Redesign shortcuts modal

* Fix tests
2021-03-12 11:57:01 +01:00
Jonatan Kłosko 266bf35bd0
Move focus navigation to the client (#74)
* Show all sections and enable cross-section focus navigation

* Move focus to the client

* Add shortcut for evaluating all cells

* Fix and expand tests

* Make section links scroll to the given section
2021-03-11 15:28:18 +01:00
Jonatan Kłosko e65a5f712c
Virtualize output lines (#70)
* Virtualize output lines

* Remove unused dependency

* Remove VirtualizedLinesComponent

* Pass lines as HTML nodes and use as template

* Validate hook children

* Refactor markup
2021-03-04 22:09:57 +01:00
Jonatan Kłosko dae6d5c9c3
Rename project (#68)
* Rename references

* Update file and directory names

* Fix homepage tests
2021-03-03 22:56:28 +01:00
Jonatan Kłosko 228c279cea
Keep editor focus when cell actions are executed (#65) 2021-03-01 18:48:19 +01:00
Jonatan Kłosko ca520cf481
Add buttons for moving cell (#64) 2021-03-01 18:17:24 +01:00
Jonatan Kłosko d93ab41e7a
Implement reordering cells using keyboard (#63)
* Implement moving cells with keyboard shortcuts

* Add tests for cell movement operation

* Refactor

* Does not mark cells as stale if Elixir cells did not change order
2021-03-01 13:29:46 +01:00
Jonatan Kłosko 663ec3283e
Support starting runtime in Mix context (#61)
* Prototype standalone mode with mix

* Move runtime initialization into separate LiveViews

* Make standalone node initialization async

* Refactor async node initialization

* Automatically scroll to the bottom of output

* Refactor streaming output

* Move MessageEmitter under Utils

* Add path selector to the mix runtime picker

* Update runtime descriptions

* Add successful or error message at the end of output

* Run formatter

* Rename Standalone to ElixirStandalone for consistency

* Show only directories when looking for a mix project

* Update docs

* Extract shared standalone logic

* Make the remote primary process monitor Manager instead of session

* Further refactoring and docs

* Add tests for collectable Callback

* Add missing macro doc

* Apply review suggestions

* Decouple sending asynchronous notifications from the runtime initialization

* Apply suggestions
2021-02-26 20:53:29 +01:00
Jonatan Kłosko d2cd541ce1
Fixes (#62)
* Ignore compilation warnings in the Evaluator tests

* Make Cmd + Enter evaluate cell even in navigation mode

* Fix homepage responsiveness

* Improve setting insert mode with mouse
2021-02-26 20:39:32 +01:00
Jonatan Kłosko 9fed524ed5
Markdown snippets (#56)
* Extend LiveMarkdown format to support Elixir snippets in Markdown cells

* Highlight Markdown code blocks using Monaco editor API

* Use livebook metadata for forcing markdown as well
2021-02-24 15:41:00 +01:00
Jonatan Kłosko efd58466f2
Purge old deltas (#57)
* Keep track of connected clients in session data

* Add API for confirming and purging deltas

* Send delta confirmation from clients once received

* Update naming

* Fix and extend Data tests

* Update naming
2021-02-23 21:20:46 +01:00
Jonatan Kłosko 48c7f9e707 Tiny tokenizer improvements 2021-02-22 16:33:46 +01:00
Jonatan Kłosko dc1930634f
Add UI for cancelling evaluation (#51)
* Add icon for cancelling cell evaluation

* Add shortcut for cancelling evaluation

* Test cancellation
2021-02-22 14:21:28 +01:00
Jonatan Kłosko 0925ec77cd
Implement notebook persistence and import (#44)
* Basic filesystem navigation

* Add file picker modal

* Implement autosave when dirty and show the status

* Add hompage link in the session view

* Improve file picker and use in both places

* Move session list to homepage

* Some refactoring

* Show import messages if any

* Fix and extend tests

* Show a message when there are no sessions running

* Rename import to fork and make that clear in notebook name

* Fix old route

* Show info when no file is connected to the given session

* Show runtime type next to filename

* Show button for joining session when a running path is selected

* Move modal components to SessionLive namespace

* Add FileGuard to lock files used for notebook persistence

* Use radio for specifying persistence type

* Don't lock nil path

* Simplify FileGuard implementation

* Test notebook persistence

* Fix typo

* Further simplify FileGuard

* Improve file listing

* Don't show parent dir when there's a basename being typed

* Add path component tests
2021-02-21 16:54:44 +01:00
Jonatan Kłosko 77675ad61e
UI polishing (#43)
* Tiny UI improvements

* Add icon for entering insert mode on a markdown cell

* Highlight selected section

* Improve contenteditable elements

* Highlight notebook/section name while editing
2021-02-18 15:11:24 +01:00
Jonatan Kłosko 0b77fd4279
Add keyboard shortcuts help modal (#41)
* Update keybindings and add help modal

* Add more evaluation shortcuts

* Add shortcut to the help modal

* Show appropriate shortcuts depending on the user system

* Handle missing user-agent header

* Conditionally render shortcut based on user agent

* Implement vim-style navigation

* Remove warning

* Determine platform based on socket on mount

* Improve shortcuts list UI
2021-02-18 13:14:09 +01:00
Jonatan Kłosko 13f9b2b509
Sanitize HTML rendered from Markdown (#39) 2021-02-17 17:16:16 +01:00
Jonatan Kłosko 9d3a2ae264
Some cleanups (#25)
* Remove old js files

* Cleanup styles

* Update page title

* Unify elements rounding

* Fix indentation

* Rename component modules

* Add actions to routes for better helpers
2021-02-11 16:35:32 +01:00
Jonatan Kłosko 79e5c432b3
Move evaluation to a separate Elixir runtime (#20)
* Isolate evaluation in separate node for each session

* Start new remote upon first evaluation and handle nodedown

* Add UI for managing evaluation node, improve naming and structure

* Show runtime initialization errors and some fixes

* Improve standalone node initialization

* Correctly handle multiple sessions connecting to the same node

* Fix session tests concerning evaluation

* Documentation and some refactoring

* Various improvements

* Configure schedulers to get to sleep immediately after evaluation

* Move EvaluatorSpervisor into the Remote namespace

* Fix evaluators cleanup

* Add tests

* Improve flash messages

* Introduce remote genserver taking care of cleanup

* Redefine the Runtime protocol to serve as an interface for evaluation

* Cleanup operations

* Use reference for communication with a standalone node

* Use shortnames for distribution by default

* Update node configuration and make sure epmd is running

* Rename Remote to ErlDist
2021-02-11 12:42:17 +01:00
Jonatan Kłosko 8acb483bcd
Improve keyboard navigation and focus (#19)
* Adjust result length

* Add more keyboard navigation actions

* Improve inserted/deleted cells focus and add some tests

* Some refactoring

* Run formatter
2021-02-04 16:01:59 +01:00
Jonatan Kłosko 77b60c8110
Integrate evaluation into UI (#17)
* Render evaluation outputs and result

* Fix auto-scrolling to not be interrupted by editor focus

* Add cell output tests

* Run formatter

* Show cell status

* Apply review suggestions

* Change EEx strings to Live EEx
2021-02-02 19:58:06 +01:00
Jonatan Kłosko 936d0af5fb
Set up markdown rendering (#16)
* Set up markdown rendering, update theme.

* Improve focus and handle expanding for markdown cells

* Add keybindings for expanding/navigating cells

* Improve editor autofocus when navigating with shortcuts

* Add tests

* Render markdown on the client

* Don't render cell initial data and make a request instead
2021-01-30 00:33:04 +01:00
Wojtek Mach ca36e22af0
Add defn to monarch_language.js (#15)
* Add defn

* Update monarch_language.js

* Update monarch_language.js
2021-01-26 13:52:28 +01:00
Jonatan Kłosko 479b0379d8
Implement Elixir lexer for the Monaco editor (#14)
* Implement Elixir lexer for the Monaco editor

* Tokenize function calls
2021-01-26 13:14:58 +01:00
Jonatan Kłosko 8e4b4af60c
Add Elixir language support to the editor (#13) 2021-01-22 23:27:25 +01:00
Jonatan Kłosko b8df31e1ae
Clear undo/redo stack upon receiving a concurrent delta (#12) 2021-01-22 20:43:56 +01:00
Jonatan Kłosko 3e6a4adce2
Implement collaborative text editing (#10)
* Set up editor and client side delta handling

* Synchronize deltas on the server

* Document the client code, add more tests

* Implement delta on the server, use compact representation when transmitting changes

* Simplify transformation implementation and add documentation

* Add session and data tests

* Add more delta tests

* Clean up evaluator tests wait timeout
2021-01-21 13:11:45 +01:00
Jonatan Kłosko 80cd651b0f
Setup initial session UI (#9)
* Sync session data within LV client

* Add basic session UI

* Add operations for setting notebook and section name

* Update notebook and section name from the UI

* Some cleanup

* Return current data upon client registartion to avoid race conditions

* Small fixes
2021-01-17 22:03:03 +01:00
Jonatan Kłosko 5877180934
Set up assets and layout (#2) 2021-01-07 22:13:17 +01:00
José Valim 2dd88ec017 Add LiveView 2021-01-07 21:16:54 +01:00
José Valim 79792777a7 Initial commit 2021-01-07 20:56:24 +01:00