Commit graph

399 commits

Author SHA1 Message Date
Jonatan Kłosko
9d7fe44253
Introduce smart cells (#1029)
* Introduce smart cells

* Apply review comments
2022-02-28 13:53:33 +01:00
Jonatan Kłosko
f699575b45
Cache mermaid graph rendering (#1023)
* Cache mermaid graph rendering

* Bump mermaid

* Update naming
2022-02-22 12:02:53 +01:00
Jonatan Kłosko
0386a032a1
Reinitialize hooks on reconnection (#1018)
* Reinitialize cells on reconnection

* Send initial session data without additional roundtrip
2022-02-21 20:39:29 +01:00
Cristine Guadelupe
72da7da3b5
Live region for home page (#1007)
* Live region on home

* Live region: bulk actions

* Live region: ordered by info

* Makes the live region helper global
2022-02-16 15:50:32 -03:00
Jonatan Kłosko
5cb0c68c41
Delay appearing input focus (#1001) 2022-02-14 21:22:58 +01:00
Jonatan Kłosko
53aea7af6e Leave JS output channel only if it exists 2022-02-10 11:25:37 +01:00
Jonatan Kłosko
565f65d0fc
JS output fixes (#991)
* Explicitly leave the JS channel before disconnecting the socket

* Reposition iframe when the sidebar is toggled and on window resize
2022-02-08 20:12:03 +01:00
Jonatan Kłosko
e5e13d86c2
Serve iframes from another local port when running on http (#989)
* Serve iframes from another local port when running on http

* Use relative hostname in local iframe URL

* Simplify server start check

* Use random iframe port when Livebook runs on a random port

* Rename space/ to iframe/

* LivebookWeb.IframePlug -> LivebookWeb.IframeEndpoint
2022-02-08 14:45:58 +01:00
Jonatan Kłosko
ccc64876a8
Add support for widget binary payloads (#982)
* Add support for widget binary payloads

* Migrate LV auth to a separate hook

* Properly set user buffer when encoding
2022-02-07 21:03:25 +01:00
Jonatan Kłosko
9fab78d2a6
Load iframe using the same protocol as the app (#985) 2022-02-05 22:41:58 +01:00
Jonatan Kłosko
2e17ad48d6 Correctly handle boolean attributes with data-keep-attribute 2022-02-04 00:37:46 +01:00
José Valim
995082b9ab
Add data-keep-attribute to reapply attribute on morphdom patch (#978) 2022-02-03 23:25:12 +01:00
Jonatan Kłosko
a42e11a2ad
Show an error message when loading the JS module fails (#975) 2022-02-03 18:51:33 +01:00
José Valim
aafa5cc642
Add delayed top bar (#973) 2022-02-03 15:05:16 +01:00
Milo Lee
6826939840
Controls how lines should wrap of the editor (#961)
* Configuring word wrapping temporarily on editor-level

* Split into enable and disable word wrapping actions

* Move toggle word wrapping code to __mountEditor
2022-02-02 13:58:46 +01:00
Jonatan Kłosko
178df3dac9
Load output iframe from a different origin (#968)
* Load output iframe from a different origin

* Update iframe source
2022-02-02 00:10:17 +01:00
Cristine Guadelupe
4dd28388a5
Bulk actions for sessions (#939)
* Initial implementation to close multiple sessions

* Sessions: bulk actions with components

* Rename Disconnect sessions to Disconnect runtime

* Select all and disabled when nothing is selected

* Styled checkbox

* Renames toggle events

* Warning about not persisted notebooks

* Adds disconnect runtime option for a single session

* Edit sessions on right

* Fix: typos and plural

* Minor adjustments

* Removes the loop for rendering the menu

* Menus with fixed width

* Minor adjustments

* Pluralize as global helper

* Bulk actions form on client side

* Track bulk actions buttons state

* Fix: home live tests

* Doctests for pluralize

* Fix: bulk actions buttons losing state on session update

* Fix: format

* Minor adjustment on toggle_edit

* Review-based adjustments

* Reset the Edit state after single-session actions

* Minor adjustments

* Fixes bulk action events

* Submit the bulk action form directly

* Tests for bulk actions

* Indentation

* Update lib/livebook_web/live/home_live/close_session_component.ex

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

Co-authored-by: José Valim <jose.valim@gmail.com>
2022-01-28 17:45:04 -03:00
Jonatan Kłosko
f8a216f8ee
Highlight code errors on formatting and evaluation (#948) 2022-01-28 21:00:31 +01:00
Jonatan Kłosko
2acefde9f7
Fix line break support in Mermaid graph definition (#932) 2022-01-25 16:19:33 +01:00
Jonatan Kłosko
2f55b87171
Allow downloads inside JS output iframe (#931) 2022-01-25 14:29:57 +01:00
Joe Martinez
961581bfc7
bump phoenix_live_view to 0.17.6 (#919)
* bump phoenix_live_view to 0.17.6

* revert change to static dir

* fix deprecation warning
2022-01-24 11:30:07 +01:00
Joe Martinez
cd958f1492
warn if clipboard support is missing (#922)
* warn if clipboard support is missing

* make the message a bit more helpful

* Update assets/js/app.js

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2022-01-24 11:21:13 +01:00
Roberto Estrada
cdb17e8573
Adds font-awesome when is required (mermaid). (#913)
* Adds font-awesome when is required (mermaid).

* applied suggestions

* format with prettier vscode plugin
2022-01-22 19:36:00 +01:00
Jonatan Kłosko
a9f9c68cfa
Compute iframe base URL based on page origin (#902)
* Compute iframe base URL based on page origin

* Format
2022-01-20 11:29:45 +01:00
Jonatan Kłosko
0b58ba9331
Adjust JS iframe default styles (#893) 2022-01-19 18:32:58 +01:00
Jonatan Kłosko
ae0f083c5c
Fixes (#889)
* Fix title test

* Fix editable element check

* Fix duplicate output ids
2022-01-19 14:43:35 +01:00
Jonatan Kłosko
3a0d77d879
Disable keyboard control when an editable element is focused (#885) 2022-01-19 13:05:21 +01:00
Jonatan Kłosko
0b1f308b13
Fix cell insertion while editing Markdown cell (#883) 2022-01-19 11:34:38 +01:00
Jonatan Kłosko
a1b8b54004
Update dependencies (#877)
* Update Elixir deps

* Update JS deps
2022-01-17 13:58:34 +01:00
Jonatan Kłosko
c57e5448b7
Remove old output formats (#876)
* Remove old outputs

* Remove other occurrences
2022-01-17 13:24:59 +01:00
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
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
Jonatan Kłosko
386fe5b531 Redesign flash message snackbars 2021-10-27 17:04:33 +02:00
Owen Bickford
46d49743b9
add --no-error-on-unmatched-pattern (#639) 2021-10-24 19:57:14 +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
Pete Jodo
08727bddac
Remove vertical margin from nested markdown lists (#631) 2021-10-22 12:01:19 +02:00
Matheus Cumpian
f6d31a7d86
adding a disabled delete button for sections that have branches (#624)
* adding a disabled delete button for sections that have branches

* Apply suggestions from code review

* Update assets/css/components.css

* Apply suggestions from code review

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-10-20 18:10:11 +02:00
Pete Jodo
5b96abea82
Hide list bullets in markdown checkboxes (#623)
* Hide list bullets in markdown checkboxes

* Align markdown checkboxes with list bullets
2021-10-20 14:09:50 +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
Jonatan Kłosko
a41dda9c7c
Keep static files outside priv (#602)
* Keep static files outside priv

* Override generated assets on the CI
2021-10-18 22:32:09 +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
bf05fb0a50
Add support for configuring file systems using env variables (#498)
* Add support for configuring file systems using env variables

* Add UI for copying file systems env configuration
2021-08-18 14:41:57 +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
8e6558a83a
Introduce file system abstraction and an S3 implementation (#492)
* Introduce file system abstraction and an S3 implementation

* Support arbitrary absolute paths and delegate resolution to file system

* Remove accidental notebook file

* Apply suggestions from code review

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

* Apply review comments

* Add missing path assertions

* Apply review comments

* Fix test saving notebook in project root

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-08-13 21:17:43 +02:00
Jonatan Kłosko
5ed6dd0807
Update deps (#489) 2021-08-11 00:56:52 +02:00
Jonatan Kłosko
3216727858
Keep original source when highlighting (#480) 2021-07-28 19:35:36 +02:00
Jonatan Kłosko
7578e81adb Depend on Phoenix 1.5.9 rather than master 2021-07-28 16:11:33 +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
Jean Carlos
ad999cf9c0
Added input select (#448)
* 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

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-07-18 19:01:44 +02:00
Jonatan Kłosko
d55c4a1ccc
Introduce branching sections (#449)
* Introduce branching sections

* parent_index -> branch_parent_index

* Flip the branch icon

* Don't mark branching sections as aborted if the main flow crashes

* Outline more details about branching sections in the Elixir and Livebook notebook

* Add branch indicator to the sections sidebar
2021-07-15 18:19:36 +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
b636f03172 Fix webpack warning showing up during build 2021-07-09 12:36:45 +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
7203813f8d
Add support for input properties (#440) 2021-07-08 11:35:09 +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
Jean Carlos
db22a7cccb
Added range input (Slider) (#435)
* Added range input (Slider)
* Added range input (Slider)
* Custom css to range input

* Formatting correction
2021-07-06 11:22:04 +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
mcintyre94
4241866b5d
Add support for a color input type (#410)
This renders as input type=color, and stores a 6 digit hex color with leading hash
2021-06-28 20:05:56 +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
69803806b5 Update default alignment in Markdown table header 2021-06-26 17:02:16 +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
Kevin
ea83e294c0
Update z-index of menu (#396) 2021-06-24 16:45:19 +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
e49aaa62d2 Bump Monaco editor version 2021-06-21 11:12:26 +02:00
Jonatan Kłosko
8415ba311e
Show ticking timer while cell is evaluating (#374) 2021-06-20 17:06:30 +02:00
Shavit
a104d9d73b
Show the evaluation time next to the cell indicator (#366)
* Display the time in seconds

Show the evaluation time next to the cell indicator

* Test session data

* Send evaluation time to session

Start the evaluation time inside the evaluator, display the time in seconds
or milliseconds.

The output is not a string but a map

* Add metadata to evaluation_response

* Wrap the evaluation indicator in a tooltip

  • Add metadata argument to the evaluation_response message
  • Use a tooltip to display the evaluation time

* Display the toolip below the indicator

* Remove the evaluation start time

* Make the tooltip optional

* Rename finish_cell_evaluation

* Evaluator tests

* Update test to accespt metadata

* Pass the evaluated time as a third argument

* Make status tooltip more generic

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-06-20 14:48:00 +02:00
Jonatan Kłosko
cbdc91d68d
Show insert actions when hovering over free space between cells (#369) 2021-06-18 16:14:20 +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
b18c1579bd
Add dynamic table output (#356)
* Add dynamic table output

* Support table name
2021-06-17 01:02:27 +02:00
Jonatan Kłosko
3df6508b56
Disable autoscroll when focusing in insert mode (#355) 2021-06-16 16:16:26 +02:00
Wojtek Mach
8cf8f2697c
Use <kbd> for keyboard keys (#351)
* Use <kbd> for keyboard keys

* Show keyboard icon

* Render each key explicitly

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

Co-authored-by: Wojtek Mach <wojtekmach@users.noreply.github.com>

* Add Livebook specific icons to the introductory notebooks

* More updates

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-06-16 13:31:53 +02:00
Jonatan Kłosko
4657ad17c3
Update Monaco and use the built-in Elixir definition (#345) 2021-06-14 15:57:13 +02:00
José Valim
e4cd38a1f1 Add portal images, closes #330 2021-06-14 11:37:57 +02:00
Jonatan Kłosko
b0bd7540c0
Compute cell source digest on the client (#341) 2021-06-10 14:54:55 +02:00
Edmundo Biglia
e16992dbc1
fix markdown codeblocks overflowing container (#333) 2021-06-09 11:02:47 +02:00
José Valim
9eaa98ce56
Portal guide (#318) 2021-06-08 14:53:41 +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
José Valim
2f38e3454e
Improvements to Markdown CSS (#326)
* Move ul/ol to list-outside so we can render paragraphs inside them
* Add left margin to ul/ol
* Add margin-top to headers
* Change the style of nested lists

Closes #317
2021-06-07 11:35:25 +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
Jonatan Kłosko
406c17dc43 Build assets to tmp/static_dev in development 2021-05-19 23:50:18 +02:00
Jonatan Kłosko
eea546d59c Add styles for kbd tag in rendered Markdown 2021-05-13 15:52:11 +02:00
Jonatan Kłosko
2c965b4bdf
Update webpack (#268) 2021-05-12 23:44:45 +02:00
Jonatan Kłosko
ea93edcc86
Add embedded runtime for evaluating code in the Livebook VM (#266)
* Add embedded runtime for evaluating code in the Livebook VM

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

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

* Use standard error proxy globally in the Livebook node

* Add configuration env variable for setting the default runtime

* Increase evaluation response assertion timeouts

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-05-10 14:37:38 +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
José Valim
02f46fd912 Improve responsive features 2021-04-21 13:50:55 +02:00
Jonatan Kłosko
4f80e5f601 Update tailwindcss 2021-04-21 12:19:16 +02:00
Jonatan Kłosko
d51e0ad2a9 Update package-lock.json 2021-04-20 19:38:08 +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
dependabot[bot]
1883fbc87e
Bump marked from 1.2.8 to 2.0.0 in /assets (#163)
Bumps [marked](https://github.com/markedjs/marked) from 1.2.8 to 2.0.0.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v1.2.8...v2.0.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-13 18:11:11 +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
535f7882b0 Improve inline code in rendered markdown 2021-04-09 14:31:34 +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
9ec80acc63
Design adjustments (#131)
* Add full logo to the homepage

* Update sidebar active icon style

* Update lib/livebook_web/live/home_live.ex

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

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-02 14:54:14 +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
5c5b4ece26
Add "Hello Livebook" notebook (#123)
* Limit module result to a single line

* Add introductory notebook to get started with

* Don't show tooltip on focused elements

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update lib/livebook/notebook/hello_livebook.ex

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

* Update notebook settings reference

* Add note on package authors

* Add tests

* Update Phoenix version to git master

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-03-30 21:42:02 +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