Current section
7 Versions
Jump to
Current section
7 Versions
Compare versions
23
files changed
+315
additions
-201
deletions
| @@ -17,7 +17,7 @@ Open your Phoenix project and add `live_view_ui` to your list of dependencies in | |
| 17 17 | ```elixir |
| 18 18 | def deps do |
| 19 19 | [ |
| 20 | - {:live_view_ui, "~> 0.0.6"}, # <-- Add this line |
| 20 | + {:live_view_ui, "~> 0.0.7"}, # <-- Add this line |
| 21 21 | ] |
| 22 22 | end |
| 23 23 | ``` |
| @@ -1,6 +1,6 @@ | |
| 1 1 | {<<"links">>,[{<<"GitHub">>,<<"https://github.com/rosaan/live_view_ui">>}]}. |
| 2 2 | {<<"name">>,<<"live_view_ui">>}. |
| 3 | - {<<"version">>,<<"0.0.6">>}. |
| 3 | + {<<"version">>,<<"0.0.7">>}. |
| 4 4 | {<<"description">>,<<"A collection of UI components for Phoenix LiveView.">>}. |
| 5 5 | {<<"elixir">>,<<"~> 1.16">>}. |
| 6 6 | {<<"app">>,<<"live_view_ui">>}. |
| @@ -26,11 +26,9 @@ defmodule Mix.Tasks.LiveViewUi.Prerelease do | |
| 26 26 | content = File.read!(source_path) |
| 27 27 | |
| 28 28 | updated_content = |
| 29 | - if Regex.scan(~r/LiveViewUI\.UI/, content) != [] do |
| 30 | - Regex.replace(~r/LiveViewUI\.UI/, content, "<%= @module_name %>.UI") |
| 31 | - else |
| 32 | - Regex.replace(~r/LiveViewUI/, content, "<%= @module_name %>.UI") |
| 33 | - end |
| 29 | + content |
| 30 | + |> String.replace("LiveViewUI", "<%= @module_name %>") |
| 31 | + |> String.replace("UI.Gettext", "<%= @gettext %>") |
| 34 32 | |
| 35 33 | File.write!(destination_path, updated_content) |
| 36 34 | Mix.shell().info("Processed #{file}") |
| @@ -88,9 +88,12 @@ defmodule Mix.Tasks.LiveViewUi.Setup do | |
| 88 88 | else |
| 89 89 | file_path = Path.join([ui_dir, file]) |
| 90 90 | file_content = File.read!(file_path) |
| 91 | + gettext_module = "#{module_name}Web.Gettext" |
| 91 92 | |
| 92 93 | new_content = |
| 93 | - String.replace(file_content, "<%= @module_name %>", module_name) |
| 94 | + file_content |
| 95 | + |> String.replace("<%= @module_name %>", module_name) |
| 96 | + |> String.replace("<%= @gettext %>", gettext_module) |
| 94 97 | |
| 95 98 | new_file_path = Path.join([current_ui_dir, file]) |
| 96 99 | File.write!(new_file_path, new_content) |
| @@ -179,7 +182,7 @@ defmodule Mix.Tasks.LiveViewUi.Setup do | |
| 179 182 | pattern = ~r/import Config/ |
| 180 183 | |
| 181 184 | line = """ |
| 182 | - config :tails, colors_file: Path.join(File.cwd!(), "assets/tailwind.colors.json") |
| 185 | + \nconfig :tails, colors_file: Path.join(File.cwd!(), "assets/tailwind.colors.json") |
| 183 186 | """ |
| 184 187 | |
| 185 188 | inject_line(file, pattern, line, :after) |
| @@ -1,4 +1,4 @@ | |
| 1 | - defmodule LiveViewUI.Accordion do |
| 1 | + defmodule LiveViewUI.UI.Accordion do |
| 2 2 | @moduledoc """ |
| 3 3 | A simple accordion component for dynamically displaying collapsible content panels. |
| 4 4 | |
| @@ -35,7 +35,7 @@ defmodule LiveViewUI.Accordion do | |
| 35 35 | """ |
| 36 36 | use Phoenix.Component |
| 37 37 | |
| 38 | - import LiveViewUI.Helper |
| 38 | + import LiveViewUI.UI.Helper |
| 39 39 | |
| 40 40 | attr :multiple, :boolean, default: false |
| 41 41 | attr :class, :any, default: nil |
Loading more files…