diff --git a/deployment/templates/test1.html b/deployment/templates/test1.html index 0376456..fa99ac2 100644 --- a/deployment/templates/test1.html +++ b/deployment/templates/test1.html @@ -1,22 +1,422 @@ -
+
-
Back To/History
+
Back To/History
Main Section
Settings
-
-
-
+
+ + + + + + + + + + +
+ +
+ +
+
+
+ + + +
+
+
diff --git a/lib/mishka_template_creator/components/blocks/config_selector.ex b/lib/mishka_template_creator/components/blocks/config_selector.ex index 7e3780d..1609807 100644 --- a/lib/mishka_template_creator/components/blocks/config_selector.ex +++ b/lib/mishka_template_creator/components/blocks/config_selector.ex @@ -32,7 +32,7 @@ defmodule MishkaTemplateCreator.Components.ConfigSelector do
<%= "#{item}" %> diff --git a/lib/mishka_template_creator/data/tailwind_setting.ex b/lib/mishka_template_creator/data/tailwind_setting.ex index 7ae7430..9a04fe0 100644 --- a/lib/mishka_template_creator/data/tailwind_setting.ex +++ b/lib/mishka_template_creator/data/tailwind_setting.ex @@ -74,6 +74,7 @@ defmodule MishkaTemplateCreator.Data.TailwindSetting do "open" ] + # TODO: we should cover these command in another version @pseudo_arbitrary_classes [ "supports-[x]", "aria-[x]", @@ -8778,7 +8779,7 @@ defmodule MishkaTemplateCreator.Data.TailwindSetting do end) |> Enum.concat() - [:none, :dark] ++ created_types + [:none, :dark] ++ created_types ++ [:hover] end def create_class("none", class), do: class @@ -8786,19 +8787,7 @@ defmodule MishkaTemplateCreator.Data.TailwindSetting do @spec is_class?(binary, list(String.t())) :: boolean def is_class?(class, configs) do - converted_class = - class - |> String.split(":") - |> case do - [h | [c | [sc | _t]]] when h in @pseudo_classes and c in @pseudo_classes -> - sc - - [h | [c | _t]] when h in @pseudo_classes -> - c - - [h | _t] -> - h - end + converted_class = class_spliter(class) [ Enum.member?(configs, converted_class), @@ -8807,6 +8796,22 @@ defmodule MishkaTemplateCreator.Data.TailwindSetting do |> Enum.member?(true) end + def is_class?(class, configs, :is_section) do + converted_class = class_spliter(class) + + case Enum.member?(configs, converted_class) do + true -> + true + + false -> + try_arbitrary_value = + String.replace(convert_arbitrary_value(converted_class) || "", "[x]", "") + + try_arbitrary_value != "" and + !is_nil(Enum.find(configs, &String.contains?(&1, try_arbitrary_value))) + end + end + @spec get_all_config :: list(String.t()) def get_all_config() do Enum.map(call(), fn {_, _, _, list} -> list end) @@ -8854,4 +8859,19 @@ defmodule MishkaTemplateCreator.Data.TailwindSetting do [h | t] = String.split(config, "-[") if t != [], do: "#{h}-[x]", else: nil end + + defp class_spliter(class) do + class + |> String.split(":") + |> case do + [h | [c | [sc | _t]]] when h in @pseudo_classes and c in @pseudo_classes -> + sc + + [h | [c | _t]] when h in @pseudo_classes -> + c + + [h | _t] -> + h + end + end end