mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-16 12:57:32 +08:00
c2636b8220
* 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>
32 lines
1.1 KiB
Elixir
32 lines
1.1 KiB
Elixir
defmodule LivebookWeb.SessionLive.InsertButtonsComponent do
|
|
use LivebookWeb, :live_component
|
|
|
|
def render(assigns) do
|
|
~H"""
|
|
<div class="relative top-0.5 m-0 flex justify-center"
|
|
role="toolbar"
|
|
aria-label="insert new"
|
|
data-element="insert-buttons">
|
|
<div class={"w-full absolute z-10 #{if(@persistent, do: "opacity-100", else: "opacity-0")} hover:opacity-100 focus-within:opacity-100 flex space-x-2 justify-center items-center"}>
|
|
<button class="button button-small"
|
|
phx-click="insert_cell_below"
|
|
phx-value-type="markdown"
|
|
phx-value-section_id={@section_id}
|
|
phx-value-cell_id={@cell_id}
|
|
>+ Markdown</button>
|
|
<button class="button button-small"
|
|
phx-click="insert_cell_below"
|
|
phx-value-type="elixir"
|
|
phx-value-section_id={@section_id}
|
|
phx-value-cell_id={@cell_id}
|
|
>+ Elixir</button>
|
|
<button class="button button-small"
|
|
phx-click="insert_section_below"
|
|
phx-value-section_id={@section_id}
|
|
phx-value-cell_id={@cell_id}
|
|
>+ Section</button>
|
|
</div>
|
|
</div>
|
|
"""
|
|
end
|
|
end
|