lato 3.14.5 โ†’ 3.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e875480609c4aaa1b932e6f1deaee666a2a3df6e30c86dafcd487bf874c7807
4
- data.tar.gz: 2598d84609cc7be515b88e903e101dde2ef8fa8b95e2943b345818380c7354a2
3
+ metadata.gz: c5b3771be073f4d95535eecc8c2ea3b9804a008595a4a888e4a502d095fe97d7
4
+ data.tar.gz: bc9f33dbcec742df3302b2e400bcdd39e2a82abe8fa8255b8fef3fb9fa557135
5
5
  SHA512:
6
- metadata.gz: 5fd18d8715d6eda3955dcaad2781d6217becec2cc7aaf722aa52f55ad42a0d40f459322a825aa5b0836a81c004ac4f96119eaf08aa0ccaada0542e29c9f1ca14
7
- data.tar.gz: a1dba640c648db9b3a12b29211b8e25566c9a54366b274d528e181e8772146c56dffee945f05cede88298876948c5fa2fbda859d174ce228783261807186b43b
6
+ metadata.gz: 0ee934fed00dc3921730aa39ede9695afd4139d109dcd762ed769523eee375f179e68b364b69679419e26c435ca6ae16fb9a9d9cf89c00dec9f5bd0faa0d3c91
7
+ data.tar.gz: 1a5219655c1990e103fa2c5362d173b812d17fcd58cb0d031fc38ab0784e6bf1f199293d5edb20cbbab0558d4838236f9c923a2f7df1d9579cb4dfdb16f83cf9
data/README.md CHANGED
@@ -19,7 +19,9 @@ The gem is ready to be used with the **latest Rails 7+** features like **[ESM im
19
19
 
20
20
  ## Full documentation
21
21
 
22
- The full documentation is available at: ๐Ÿ‘‰ ๐Ÿ‘‰ [THIS LINK](https://lato-oss.gregoriogalante.com) ๐Ÿ‘ˆ ๐Ÿ‘ˆ
22
+ The full documentation is available here: ๐Ÿ‘‰ ๐Ÿ‘‰ [DOCUMENTATION](https://lato-oss.gregoriogalante.com) ๐Ÿ‘ˆ ๐Ÿ‘ˆ
23
+
24
+ The `llm.txt` file with all the context to use with LLMs is available here: ๐Ÿ‘‰ [LLM CONTEXT](https://github.com/Lato-org/lato/raw/refs/heads/main/docs/llm.txt) ๐Ÿ‘ˆ
23
25
 
24
26
  You can also use the [Lato AI Agent](https://lato-oss.gregoriogalante.com/AI.html) directly on your browser to generate code and get helps with the gem.
25
27
 
@@ -50,14 +52,23 @@ gem "sassc-rails"
50
52
  gem "lato"
51
53
  ```
52
54
 
55
+ If not already present, add `app/assets/config/manifest.js` file with the following content:
56
+
57
+ ```js
58
+ //= link_tree ../images
59
+ //= link_directory ../stylesheets .css
60
+ //= link_tree ../../javascript .js
61
+ //= link_tree ../../../vendor/javascript .js
62
+ ```
63
+
53
64
  Install gem and run required tasks:
54
65
 
55
66
  ```bash
56
- $ bundle
57
- $ rails active_storage:install
58
- $ rails lato:install:application
59
- $ rails lato:install:migrations
60
- $ rails db:migrate
67
+ bundle
68
+ rails active_storage:install
69
+ rails lato:install:application
70
+ rails lato:install:migrations
71
+ rails db:migrate
61
72
  ```
62
73
 
63
74
  Mount lato routes on the **config/routes.rb** file:
@@ -106,29 +117,29 @@ Lato integrates by default a basic PWAs manifest and service worker. To re-gener
106
117
  3. Run the following commands:
107
118
 
108
119
  ```bash
109
- $ rails lato:generate:favicon
110
- $ rails lato:generate:pwa
120
+ rails lato:generate:favicon
121
+ rails lato:generate:pwa
111
122
  ```
112
123
 
113
124
  ## Development
114
125
 
115
126
  Clone repository, install dependencies, run migrations and start:
116
127
 
117
- ```shell
118
- $ git clone https://github.com/lato-org/lato
119
- $ cd lato
120
- $ bundle
121
- $ rails db:migrate
122
- $ rails db:seed
123
- $ foreman start -f Procfile.dev
128
+ ```bash
129
+ git clone https://github.com/lato-org/lato
130
+ cd lato
131
+ bundle
132
+ rails db:migrate
133
+ rails db:seed
134
+ foreman start -f Procfile.dev
124
135
  ```
125
136
 
126
137
  ### Publish
127
138
 
128
139
  This script will publish the gem to rubygems.org. Make sure you have the correct permissions and that you are logged in to your rubygems account.
129
140
 
130
- ```shell
131
- $ ruby ./bin/publish.rb
141
+ ```bash
142
+ ruby ./bin/publish.rb
132
143
  ```
133
144
 
134
145
  ### Generate documentation
@@ -137,8 +148,8 @@ This script will generate the documentation for the gem by exporting the Rails r
137
148
 
138
149
  Make sure to have the server running on port 3000 before running the script.
139
150
 
140
- ```shell
141
- $ ruby ./bin/generate_docs.rb
151
+ ```bash
152
+ ruby ./bin/generate_docs.rb
142
153
  ```
143
154
 
144
155
  ## License
@@ -51,6 +51,12 @@ document.addEventListener('turbo:before-cache', (e) => {
51
51
  document.body.style.paddingRight = ''
52
52
  document.body.style.overflow = ''
53
53
 
54
+ // close sidebar submenus
55
+ document.querySelectorAll('aside .nav-item .collapse.show').forEach((el) => {
56
+ if (el.querySelector('.nav-link.active')) return // keep open if contains active link
57
+ el.classList.remove('show')
58
+ })
59
+
54
60
  // close nav menu (for mobile)
55
61
  document.querySelector('.navbar-toggler').classList.add('collapsed')
56
62
  document.querySelector('.navbar-collapse').classList.remove('show')
@@ -32,6 +32,9 @@ export default class extends Controller {
32
32
  await new Promise(resolve => setTimeout(resolve, 100))
33
33
  }
34
34
 
35
+ // add another await to ensure modal is fully hidden before returning
36
+ await new Promise(resolve => setTimeout(resolve, 500))
37
+
35
38
  return this._result
36
39
  }
37
40
 
@@ -61,6 +61,11 @@ aside {
61
61
  max-height: 100vh;
62
62
  position: sticky;
63
63
  top: 0;
64
+
65
+ .dropdown-toggle::after {
66
+ position: absolute;
67
+ right: 0.5rem;
68
+ }
64
69
  }
65
70
 
66
71
  main, aside {
@@ -21,11 +21,21 @@ module Lato
21
21
  # Sidebar
22
22
  ##
23
23
 
24
- def lato_sidebar_nav_item(key, path, external: false, &block)
24
+ def lato_sidebar_nav_item(key, path, external: false, children: nil, &block)
25
25
  active = request.path == path
26
26
  active = @sidebar_key == key if @sidebar_key
27
+
28
+ # se ci sono children, verifico se uno di questi รจ attivo e assegno a active la key del child attivo
29
+ if children && children.is_a?(Array)
30
+ children.each do |child|
31
+ if request.path == child[:path] || (@sidebar_key && @sidebar_key == (child[:key] || key))
32
+ active = child[:key] || key
33
+ break
34
+ end
35
+ end
36
+ end
27
37
 
28
- render 'lato/components/sidebar_nav_item', active: active, path: path, external: external do
38
+ render 'lato/components/sidebar_nav_item', key: key, active: active, path: path, external: external, children: children do
29
39
  yield if block
30
40
  end
31
41
  end
@@ -1,18 +1,51 @@
1
1
  <%
2
2
 
3
- link_to_options = {
4
- class: ['nav-link position-relative', (active ? 'active' : 'link-dark')].join(' '),
5
- }
6
- link_to_options[:target] = '_blank' if external
3
+ # Controlla se ci sono children da visualizzare
4
+ has_children = children&.any?
5
+
6
+ # Se non ci sono children, comportamento normale
7
+ unless has_children
8
+ link_to_options = {
9
+ class: ['nav-link position-relative', (active ? 'active' : 'link-dark')].join(' '),
10
+ }
11
+ link_to_options[:target] = '_blank' if external
12
+ end
7
13
 
8
14
  %>
9
15
 
10
- <li class="nav-item border-bottom py-2">
11
- <%= link_to path, link_to_options do %>
12
- <%= yield %>
16
+ <% if has_children %>
17
+ <!-- Menu con dropdown per children -->
18
+ <li class="nav-item border-bottom py-2">
19
+ <div class="nav-link position-relative dropdown">
20
+ <a href="#" class="link-dark text-decoration-none dropdown-toggle d-flex align-items-center"
21
+ data-bs-toggle="collapse"
22
+ data-bs-target="#sidebar-nav-item-dropdown-<%= key || 'item' %>"
23
+ aria-expanded="<%= active ? 'true' : 'false' %>">
24
+ <%= yield %>
25
+ </a>
26
+
27
+ <div class="collapse <%= 'show' if active %>" id="sidebar-nav-item-dropdown-<%= key || 'item' %>">
28
+ <ul class="list-unstyled mt-2 border-start border-1 ps-2">
29
+ <% children.each do |child| %>
30
+ <li class="py-1">
31
+ <%= link_to child[:path], class: ['nav-link py-1', (active == child[:key] ? 'active' : 'link-dark')].join(' ') do %>
32
+ <%= child[:label] %>
33
+ <% end %>
34
+ </li>
35
+ <% end %>
36
+ </ul>
37
+ </div>
38
+ </div>
39
+ </li>
40
+ <% else %>
41
+ <!-- Menu normale senza children -->
42
+ <li class="nav-item border-bottom py-2">
43
+ <%= link_to path, link_to_options do %>
44
+ <%= yield %>
13
45
 
14
- <% if external %>
15
- <i class="bi bi-arrow-up-right position-absolute end-0 top-50 translate-middle-y me-2" style="font-size: 0.75rem"></i>
46
+ <% if external %>
47
+ <i class="bi bi-arrow-up-right position-absolute end-0 top-50 translate-middle-y me-2" style="font-size: 0.75rem"></i>
48
+ <% end %>
16
49
  <% end %>
17
- <% end %>
18
- </li>
50
+ </li>
51
+ <% end %>
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "3.14.5"
2
+ VERSION = "3.14.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.5
4
+ version: 3.14.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-18 00:00:00.000000000 Z
11
+ date: 2025-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails