mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-09 00:17:59 +08:00
77b60c8110
* 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
36 lines
1,004 B
Elixir
36 lines
1,004 B
Elixir
defmodule LiveBookWeb.InsertCellActions do
|
|
use LiveBookWeb, :live_component
|
|
|
|
def render(assigns) do
|
|
~L"""
|
|
<div class="opacity-0 hover:opacity-100 flex space-x-2 justify-center items-center">
|
|
<%= line() %>
|
|
<button
|
|
phx-click="insert_cell"
|
|
phx-value-type="markdown"
|
|
phx-value-section_id="<%= @section_id %>"
|
|
phx-value-index="<%= @index %>"
|
|
class="py-1 px-2 rounded text-sm hover:bg-gray-100 border border-gray-200 bg-gray-50">
|
|
+ Markdown
|
|
</button>
|
|
<button
|
|
phx-click="insert_cell"
|
|
phx-value-type="elixir"
|
|
phx-value-section_id="<%= @section_id %>"
|
|
phx-value-index="<%= @index %>"
|
|
class="py-1 px-2 rounded text-sm hover:bg-gray-100 border border-gray-200 bg-gray-50">
|
|
+ Elixir
|
|
</button>
|
|
<%= line() %>
|
|
</div>
|
|
"""
|
|
end
|
|
|
|
defp line() do
|
|
assigns = %{}
|
|
|
|
~L"""
|
|
<div class="border-t-2 border-dashed border-gray-200 flex-grow"></div>
|
|
"""
|
|
end
|
|
end
|