diff --git a/deployment/templates/test1.html b/deployment/templates/test1.html index ae5b72f..3025842 100644 --- a/deployment/templates/test1.html +++ b/deployment/templates/test1.html @@ -1,7 +1,7 @@ -
+
-
Back To/History
+
Back To/History
Main Section
-
-
-
+
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + + +
+ This is a predefined text. Please click on the text to edit. +
+
+
+
@@ -42,7 +444,7 @@ List of Blocks
-
diff --git a/lib/mishka_template_creator/components/blocks/aside.ex b/lib/mishka_template_creator/components/blocks/aside.ex index bc966f4..ca10577 100644 --- a/lib/mishka_template_creator/components/blocks/aside.ex +++ b/lib/mishka_template_creator/components/blocks/aside.ex @@ -35,7 +35,7 @@ defmodule MishkaTemplateCreator.Components.Blocks.Aside do
JS.remove_class("text-gray-800", to: "#blocks_stack") @@ -106,4 +106,43 @@ defmodule MishkaTemplateCreator.Components.Blocks.Aside do
""" end + + attr(:id, :string, required: true) + attr(:title, :string, required: true) + slot(:inner_block, required: true) + + @spec aside_accordion(map) :: Phoenix.LiveView.Rendered.t() + def aside_accordion(%{title: title} = assigns) do + assigns = assign(assigns, title_alias: String.replace(title, " ", "-")) + + ~H""" +
+
+ <%= @title %>: + + JS.show(to: ".#{@title_alias}-down") + |> JS.hide(to: ".#{@id}-#{@title_alias}-content") + } + /> + JS.show(to: ".#{@title_alias}-up") + |> JS.show(to: ".#{@id}-#{@title_alias}-content") + } + /> + +
+ +
+ <%= render_slot(@inner_block) %> +
+
+ """ + end end diff --git a/lib/mishka_template_creator/components/elements/text.ex b/lib/mishka_template_creator/components/elements/text.ex index a9b0c92..ac0c6e7 100644 --- a/lib/mishka_template_creator/components/elements/text.ex +++ b/lib/mishka_template_creator/components/elements/text.ex @@ -1,6 +1,7 @@ defmodule MishkaTemplateCreator.Components.Elements.Text do use Phoenix.LiveComponent alias MishkaTemplateCreator.Components.Blocks.Aside + alias Phoenix.LiveView.JS @impl true def mount(socket) do @@ -14,8 +15,6 @@ defmodule MishkaTemplateCreator.Components.Elements.Text do @impl true def render(%{render_type: "call"} = assigns) do - IO.inspect(assigns.element) - ~H"""
-

test

-

test

+ + sss + + + + sss +
"""