Commit graph

219 commits

Author SHA1 Message Date
Jonatan Kłosko 6d1d4de767
Push cells source to the client on initial render (#875) 2022-01-17 13:20:59 +01:00
Pete Jodo 384a59e5f0
fix bad import for mermaidjs (#874) 2022-01-16 22:16:08 +01:00
Jonatan Kłosko a4a61ae9b7 Bump Mermaid version 2022-01-16 22:07:48 +01:00
Pete Jodo 45175b2a6f
add mermaidjs support (#816) 2022-01-16 22:04:24 +01:00
Jonatan Kłosko 6615422613
Restructure frame output (#857)
* Restructure frame output

* Reboot JSComponent when ref changes

* Prune outputs from LV, handle frame and stdout updates via component messaging

* Keep ANSI modifiers as keyword list

* Don't re-render pruned outputs

* Improve empty frame styling

* Use more specific id

* Add clarification on trailing CR

* Handle output group borders with CSS

* Keep only relevant outputs in memory

* Adjust borders

* Update lib/livebook/live_markdown/import.ex

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

* Apply review comments

Co-authored-by: José Valim <jose.valim@dashbit.co>
2022-01-16 20:37:00 +01:00
Jonatan Kłosko 357985eef4
Apply editor theme to markdown snippets (#873)
* Apply editor theme to markdown snippets

* More tailwind
2022-01-16 13:50:44 +01:00
José Valim 68e81356f6
Improvements to theme (#871) 2022-01-16 12:40:14 +01:00
Jonatan Kłosko 35e42d1bad
Keep editor background on rerender (#869) 2022-01-15 23:08:45 +01:00
Cristine Guadelupe 67fa155f3d
High-contrast option for the code editor (#868)
* High-contrast option for the code editor

* Small refactor

* Creates a high-contrast theme from the custom theme

* Refactor to store the theme as a string

* Fix prettier
2022-01-15 18:46:25 -03:00
Cristine Guadelupe 6b63ed9c33
Changes the color scheme of the outputs from One Dark to One Light (#864) 2022-01-13 17:10:51 -03:00
Cristine Guadelupe 36aab4357c
Adds an option to increase the font size of the editor (#860)
* Adds an option to increase the font size of the editor

* Update lib/livebook_web/live/settings_live.ex

Co-authored-by: José Valim <jose.valim@gmail.com>

* Editor font size options as constants

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-01-13 15:06:50 -03:00
Cristine Guadelupe 89835f5e60
Adds a bit of contrast to the comments in the code editor (#859)
* Adds a bit of contrast to the comments in the code editor

* Changes the ansi-color-light-black to the new color of the comments

* Color hex in lowercase

* Reverts to the old light-black
2022-01-13 15:06:30 -03:00
Cristine Guadelupe 9690e2ac51
Minor design improvements (#858)
* Adds the greens and yellows from the custom color palette

* Keeps the cell status indicators with the original bright colors

* Increases icon-button contrast

* Increases labeled_text font-size

* Removes type: button to fix the runtime sidebar buttons style on Safari

* Increases the toggleable menu contrast on hover

* Use the same color for the stale state in the sections sidebar
2022-01-13 15:06:11 -03:00
Jonatan Kłosko 2f9197c4ed
Use monspaced font for all characters in Markdown code blocks (#855) 2022-01-12 13:40:35 +01:00
Jonatan Kłosko 118cf05d0a
Introduce broadcast communication from runtime (#845)
* Introduce broadcast communication from runtime

* Return broadcast target from group leader

* Increase timeout

* Make the channel test async

* Decouple base topic and ref
2022-01-10 18:38:08 +01:00
Jonatan Kłosko 19baf013d5
Introduce a dedicated channel for JS widget communication (#843)
* Introduce a dedicated channel for JS widget communication

* Handle payload serialization errors

* Tie channel lifetime to the session

* Catch serialization errors instead of encoding twice

* Merge JS static and dynamic outputs

* Authenticate socket connection from session

* Update JS output format

* Remove unused helper

* Apply review comments
2022-01-06 16:31:26 +01:00
Jonatan Kłosko 53869371c2
Update dependencies (#838)
* Update Elixir deps

* Update JS dependencies

* Bump Tailwind to v3

* Update Hex badge color

* Set SameSite for the session cookie
2021-12-29 22:06:19 +01:00
Jonatan Kłosko 742e3ad70e Update Tailwind palette 2021-12-29 15:14:37 +01:00
Jonatan Kłosko 66390dc677
Support Escape out of multi-cursor mode (#833) 2021-12-28 22:40:24 +01:00
Jonatan Kłosko 145f8a6992
Focus fixes (#831) 2021-12-28 19:42:04 +01:00
Jonatan Kłosko 23330786fa
Bump Monaco editor (#828) 2021-12-27 16:17:05 +01:00
Jonatan Kłosko 844242ba80
Add support for JS output widgets (#818)
* Add support for JS output widgets

* Don't block session when fetching assets and batch calls

* Improve path component sanitisation

* Move fetching check to session caller

* Attach origin to connect and event messages
2021-12-24 14:18:34 +01:00
Jonatan Kłosko b0563d14a6
Fix completion shortcuts (#792)
* Fix completion shortcuts

* Remove shortcut override
2021-12-12 00:10:15 +01:00
Jean Carlos b92bf3ae7c
fix handleDocumentFocus error (#778)
* fix handleDocumentFocus error

* format correction

* Update assets/js/session/index.js

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

* format correction

* Update assets/js/session/index.js

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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-12-09 12:51:32 +01:00
Jonatan Kłosko ee2602c932
Keep indentation when pasting code into the editor (#779) 2021-12-09 12:18:41 +01:00
Jonatan Kłosko a133a7070d
Use different icon when output is amplified (#775) 2021-12-08 16:30:52 +01:00
Jonatan Kłosko 89ea67861f
Improve "changed" indicator and batch evaluation shortcuts (#766)
* Make cell status italic when content changed

* Add Ctrl+Shift+Enter for evaluating all cells

* Improve the behaviour of evaluating all cells

* Fix typo
2021-12-07 19:14:32 +01:00
Jonatan Kłosko 84222d0a0c
Allow editor command palette to overflow (#764) 2021-12-06 14:15:44 +01:00
Jonatan Kłosko 859dfd9eb2
Disable word suggestions on Elixir cells (#763) 2021-12-06 13:10:16 +01:00
Jonatan Kłosko d909272746
Improve completion (#747)
* Add keywords to completion

* Fix signature request caching for call without parentheses

* Don't insert parentheses for def* macros

* Don't trigger missing runtime message when auto completion is enabled

* Don't insert parentheses for keyword macros

* Improve completion of env macros

* Apply review comments

* Update locals without parentheses

* Apply suggestions from code review

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

* Format

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-12-05 14:58:30 +01:00
Jonatan Kłosko f0606b109d
Automatically back up notebooks without a file (#736)
* Improve file select layout on long paths

* Automatically back up notebooks without a file

* Run formatter

* Add margin when there are no sections

* Add an informative note about autosave directory

* Store autosave path instead of file in the config

* Rename autosave dir to autosave path

* Fix insert mode escape on section headlines

* Show ellipsis on selected file too

* Always create the default directory

* Apply review comments
2021-12-04 16:29:14 +01:00
Adam Lancaster a764073848
Allow for XML syntax highlighting in markdown cells (#743)
* Update webpack.config.js

Allows for xml syntax highlighting in markdown cells

* Extend theme to cover XML and JSON specific tokens

* Refactor theme colors into a single palette

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-12-04 15:02:53 +01:00
Jonatan Kłosko cc772f4ffe
Never show automatic completion popup in Markdown cells (#742) 2021-12-04 13:44:07 +01:00
Jonatan Kłosko e2490c0f7f
Implement signature intellisense (#640)
* Remove Code.Fragment backport

* Fix tests compatibility with Elixir 1.13

* Implement signature intellisense

* Don't show signatures on module attributes

* Add tests for calls with do-end block

* Unify spec formatting

* Insert parentheses when completing a function call

* Send all text until cursor in signature request

* Add configuration for completion/signature popups (#693)

* Add editor settings form

* Add configuration for intellisense defaults

* Read fresh settings when editor mounts

* Scope attribute names

* Fix disabled button styling

* Simplify signature box and enable by default

* Split settings into system and user sections

* Update lib/livebook_web/live/settings_live.ex

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

* Update lib/livebook_web/live/settings_live.ex

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

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

* Fix spacing in documentation tests

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-12-03 21:57:21 +01:00
Jonatan Kłosko 4debf2c1fb
Fix evaluation timer on page refresh (#732) 2021-12-03 14:23:50 +01:00
Jonatan Kłosko 264d6c3ff2
Add support for controls output type (#710)
* Add support for controls output type

* Split controls into individual widgets

* Adjust ids

* Improve widget and controls garbage collection

* Allow arbitrary functions as object release hook

* Add type to button and input events

* Add keyboard status event

* Change release hooks into monitor messages

* Rename pointer to reference and return an error on bad monitor
2021-12-02 16:45:00 +01:00
Alex Reichert 236ea4dd96
Fix typo in drag_and_drop directory name (#723)
* Fix typo in drag_and_drop directory name

* Fix import
2021-12-01 19:44:42 +01:00
Jonatan Kłosko c2636b8220
Migrate inputs to Kino (#714)
* Migrate inputs to Kino

* Update lib/livebook/session/data.ex

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

* Try parsing numbers as integers

* Garbage collect input values

* Adjust tests

* Remove unused variable

* Fix frame rendering

* Wrap inputs in border depending on its type

* Add textarea

* Reorder

* Update tests

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-11-25 18:43:42 +01:00
Jonatan Kłosko bfe2036d34 Fix headline blur on click and improve editor focus 2021-11-18 17:34:04 +01:00
Jonatan Kłosko f64dd0ea90
Restructure j/k navigation to support headlines (#707)
* Accessibility fixes

* Restructure j/k navigation to support headlines

* Focus modal content when open

* Further focus adjustments

* Fix tests

* Remove unused functions
2021-11-16 21:57:10 +01:00
Jonatan Kłosko 7eac7a83ac
Implement clipboard copy with JS commands (#699) 2021-11-10 20:17:32 +01:00
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 fbd03d6725
Update Phoenix LV (#656)
* Wrap live routes in live_session

* Update Phoenix LV

* Migrate to live_component component call

* render_block -> render_slot

* phx-disconnected -> phx-loading

* phx-capture-click -> phx-click-away

* Add hook dealing with current user

* Bump LV

* Bump LV
2021-11-01 19:33:43 +01:00