simpler_navigation 0.2.0 → 0.3.0

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: 6ac165ac094cedb9dde1875566c903d0312a005525a33235899089038b723a75
4
- data.tar.gz: 5417062d855cef5368d129cf9f94615d13960a11c1e01fb066aae895849895db
3
+ metadata.gz: 31d56f3385357f7c2337b4c75f10376a560c9f06bae5a3bccba33979ee557b13
4
+ data.tar.gz: c9f12d5fcb6c3aa57d7e089757962cfec13861cf8d02400ab228706b7d68d1ae
5
5
  SHA512:
6
- metadata.gz: 4f885bb2d8c54952e32dd159061397f6f1769f83258e674fed867cef193c38d76d877176bee00945edee58f5ac8c89bb53d2c4f13bd282e9682d68cab4a6873d
7
- data.tar.gz: 97127515e3be1bed372ed7dc936a64922fd4ef2bac59b586d5367a6ccca19c27d8022b71745257eb36ed4a2c1f08346e720ea5bdec574a788beb5cc3bd3cc24e
6
+ metadata.gz: 543c251f069a62e4428a73c4a16813568f4e688f9e00d14bf951e25b2e38bf872d889194a49f181db1d84aa35a9f1604ad829c8a8af72be3dc25d31f31bdd4d5
7
+ data.tar.gz: be70a468eb9043da77d8f0ac2e2f8ab980d54cc6f5c33979605b003d78cf62bf609abda3fb230d5e8681061abd521fd6afa2188ddb6dd7a4f9f1f47a13eacae1
data/Gemfile.lock CHANGED
@@ -1,100 +1,162 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simpler_navigation (0.2.0)
4
+ simpler_navigation (0.3.0)
5
5
  actionview
6
6
  railties
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.4.2)
12
- actionview (= 7.0.4.2)
13
- activesupport (= 7.0.4.2)
14
- rack (~> 2.0, >= 2.2.0)
11
+ actionpack (8.0.2)
12
+ actionview (= 8.0.2)
13
+ activesupport (= 8.0.2)
14
+ nokogiri (>= 1.8.5)
15
+ rack (>= 2.2.4)
16
+ rack-session (>= 1.0.1)
15
17
  rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.4.2)
19
- activesupport (= 7.0.4.2)
18
+ rails-dom-testing (~> 2.2)
19
+ rails-html-sanitizer (~> 1.6)
20
+ useragent (~> 0.16)
21
+ actionview (8.0.2)
22
+ activesupport (= 8.0.2)
20
23
  builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (7.0.4.2)
25
- concurrent-ruby (~> 1.0, >= 1.0.2)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activesupport (8.0.2)
28
+ base64
29
+ benchmark (>= 0.3)
30
+ bigdecimal
31
+ concurrent-ruby (~> 1.0, >= 1.3.1)
32
+ connection_pool (>= 2.2.5)
33
+ drb
26
34
  i18n (>= 1.6, < 2)
35
+ logger (>= 1.4.2)
27
36
  minitest (>= 5.1)
28
- tzinfo (~> 2.0)
29
- ast (2.4.2)
30
- builder (3.2.4)
31
- concurrent-ruby (1.2.2)
37
+ securerandom (>= 0.3)
38
+ tzinfo (~> 2.0, >= 2.0.5)
39
+ uri (>= 0.13.1)
40
+ ast (2.4.3)
41
+ base64 (0.3.0)
42
+ benchmark (0.4.1)
43
+ bigdecimal (3.2.2)
44
+ builder (3.3.0)
45
+ concurrent-ruby (1.3.5)
46
+ connection_pool (2.5.3)
32
47
  crass (1.0.6)
33
- erubi (1.12.0)
34
- i18n (1.12.0)
48
+ date (3.4.1)
49
+ drb (2.2.3)
50
+ erb (5.0.1)
51
+ erubi (1.13.1)
52
+ i18n (1.14.7)
35
53
  concurrent-ruby (~> 1.0)
36
- json (2.6.3)
37
- language_server-protocol (3.17.0.3)
38
- loofah (2.19.1)
54
+ io-console (0.8.0)
55
+ irb (1.15.2)
56
+ pp (>= 0.6.0)
57
+ rdoc (>= 4.0.0)
58
+ reline (>= 0.4.2)
59
+ json (2.12.2)
60
+ language_server-protocol (3.17.0.5)
61
+ lint_roller (1.1.0)
62
+ logger (1.7.0)
63
+ loofah (2.24.1)
39
64
  crass (~> 1.0.2)
40
- nokogiri (>= 1.5.9)
41
- method_source (1.0.0)
42
- minitest (5.17.0)
43
- nokogiri (1.14.2-arm64-darwin)
65
+ nokogiri (>= 1.12.0)
66
+ minitest (5.25.5)
67
+ nokogiri (1.18.8-arm64-darwin)
44
68
  racc (~> 1.4)
45
- nokogiri (1.14.2-x86_64-linux)
69
+ nokogiri (1.18.8-x86_64-linux-gnu)
46
70
  racc (~> 1.4)
47
- parallel (1.22.1)
48
- parser (3.2.1.0)
71
+ parallel (1.27.0)
72
+ parser (3.3.8.0)
49
73
  ast (~> 2.4.1)
50
- racc (1.6.2)
51
- rack (2.2.6.2)
52
- rack-test (2.0.2)
74
+ racc
75
+ pp (0.6.2)
76
+ prettyprint
77
+ prettyprint (0.2.0)
78
+ prism (1.4.0)
79
+ psych (5.2.6)
80
+ date
81
+ stringio
82
+ racc (1.8.1)
83
+ rack (3.1.16)
84
+ rack-session (2.1.1)
85
+ base64 (>= 0.1.0)
86
+ rack (>= 3.0.0)
87
+ rack-test (2.2.0)
53
88
  rack (>= 1.3)
54
- rails-dom-testing (2.0.3)
55
- activesupport (>= 4.2.0)
89
+ rackup (2.2.1)
90
+ rack (>= 3)
91
+ rails-dom-testing (2.3.0)
92
+ activesupport (>= 5.0.0)
93
+ minitest
56
94
  nokogiri (>= 1.6)
57
- rails-html-sanitizer (1.5.0)
58
- loofah (~> 2.19, >= 2.19.1)
59
- railties (7.0.4.2)
60
- actionpack (= 7.0.4.2)
61
- activesupport (= 7.0.4.2)
62
- method_source
95
+ rails-html-sanitizer (1.6.2)
96
+ loofah (~> 2.21)
97
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
98
+ railties (8.0.2)
99
+ actionpack (= 8.0.2)
100
+ activesupport (= 8.0.2)
101
+ irb (~> 1.13)
102
+ rackup (>= 1.0.0)
63
103
  rake (>= 12.2)
64
- thor (~> 1.0)
65
- zeitwerk (~> 2.5)
104
+ thor (~> 1.0, >= 1.2.2)
105
+ zeitwerk (~> 2.6)
66
106
  rainbow (3.1.1)
67
- rake (13.0.6)
68
- regexp_parser (2.7.0)
69
- rexml (3.2.5)
70
- rubocop (1.44.1)
107
+ rake (13.3.0)
108
+ rdoc (6.14.1)
109
+ erb
110
+ psych (>= 4.0.0)
111
+ regexp_parser (2.10.0)
112
+ reline (0.6.1)
113
+ io-console (~> 0.5)
114
+ rubocop (1.75.8)
71
115
  json (~> 2.3)
116
+ language_server-protocol (~> 3.17.0.2)
117
+ lint_roller (~> 1.1.0)
72
118
  parallel (~> 1.10)
73
- parser (>= 3.2.0.0)
119
+ parser (>= 3.3.0.2)
74
120
  rainbow (>= 2.2.2, < 4.0)
75
- regexp_parser (>= 1.8, < 3.0)
76
- rexml (>= 3.2.5, < 4.0)
77
- rubocop-ast (>= 1.24.1, < 2.0)
121
+ regexp_parser (>= 2.9.3, < 3.0)
122
+ rubocop-ast (>= 1.44.0, < 2.0)
78
123
  ruby-progressbar (~> 1.7)
79
- unicode-display_width (>= 2.4.0, < 3.0)
80
- rubocop-ast (1.27.0)
81
- parser (>= 3.2.1.0)
82
- rubocop-performance (1.15.2)
83
- rubocop (>= 1.7.0, < 2.0)
84
- rubocop-ast (>= 0.4.0)
85
- ruby-progressbar (1.11.0)
86
- standard (1.24.3)
124
+ unicode-display_width (>= 2.4.0, < 4.0)
125
+ rubocop-ast (1.45.1)
126
+ parser (>= 3.3.7.2)
127
+ prism (~> 1.4)
128
+ rubocop-performance (1.25.0)
129
+ lint_roller (~> 1.1)
130
+ rubocop (>= 1.75.0, < 2.0)
131
+ rubocop-ast (>= 1.38.0, < 2.0)
132
+ ruby-progressbar (1.13.0)
133
+ securerandom (0.4.1)
134
+ standard (1.50.0)
87
135
  language_server-protocol (~> 3.17.0.2)
88
- rubocop (= 1.44.1)
89
- rubocop-performance (= 1.15.2)
90
- thor (1.2.1)
136
+ lint_roller (~> 1.0)
137
+ rubocop (~> 1.75.5)
138
+ standard-custom (~> 1.0.0)
139
+ standard-performance (~> 1.8)
140
+ standard-custom (1.0.2)
141
+ lint_roller (~> 1.0)
142
+ rubocop (~> 1.50)
143
+ standard-performance (1.8.0)
144
+ lint_roller (~> 1.1)
145
+ rubocop-performance (~> 1.25.0)
146
+ stringio (3.1.7)
147
+ thor (1.3.2)
91
148
  tzinfo (2.0.6)
92
149
  concurrent-ruby (~> 1.0)
93
- unicode-display_width (2.4.2)
94
- zeitwerk (2.6.7)
150
+ unicode-display_width (3.1.4)
151
+ unicode-emoji (~> 4.0, >= 4.0.4)
152
+ unicode-emoji (4.0.4)
153
+ uri (1.0.3)
154
+ useragent (0.16.11)
155
+ zeitwerk (2.7.3)
95
156
 
96
157
  PLATFORMS
97
158
  arm64-darwin-21
159
+ arm64-darwin-24
98
160
  x86_64-linux
99
161
 
100
162
  DEPENDENCIES
@@ -63,18 +63,19 @@ module SimplerNavigation
63
63
  end
64
64
 
65
65
  def link_tag_options(item)
66
- options = if item.options[:link_html]
67
- item.options[:link_html].dup
68
- else
69
- {}
70
- end
66
+ render_options = @options[:link_html] || {}
67
+ item_options = item.options[:link_html] || {}
68
+ options = render_options.merge(item_options)
71
69
 
72
70
  classes = []
73
- if options[:class]
74
- classes << options[:class]
71
+ if render_options[:class]
72
+ classes << render_options[:class]
73
+ end
74
+ if item_options[:class]
75
+ classes << item_options[:class]
75
76
  end
76
77
  if selected?(item)
77
- classes << SimplerNavigation.config.selected_class
78
+ classes << (@options[:selected_class] || SimplerNavigation.config.selected_class)
78
79
  end
79
80
  options[:class] = classes.compact.join(" ")
80
81
  if options[:class].empty?
@@ -85,21 +86,22 @@ module SimplerNavigation
85
86
  end
86
87
 
87
88
  def wrapper_tag_options(item)
88
- options = if item.options[:html]
89
- item.options[:html].dup
90
- else
91
- {}
92
- end
89
+ render_options = @options[:html] || {}
90
+ item_options = item.options[:html] || {}
91
+ options = render_options.merge(item_options)
93
92
 
94
93
  classes = []
95
- if options[:class]
96
- classes << options[:class]
94
+ if render_options[:class]
95
+ classes << render_options[:class]
96
+ end
97
+ if item_options[:class]
98
+ classes << item_options[:class]
97
99
  end
98
100
  if selected?(item)
99
- classes << SimplerNavigation.config.selected_class
101
+ classes << (@options[:selected_class] || SimplerNavigation.config.selected_class)
100
102
  end
101
103
  if active_leaf?(item)
102
- classes << SimplerNavigation.config.active_leaf_class
104
+ classes << (@options[:active_leaf_class] || SimplerNavigation.config.active_leaf_class)
103
105
  end
104
106
  options[:class] = classes.compact.join(" ")
105
107
  if options[:class].empty?
@@ -8,8 +8,7 @@ module SimplerNavigation
8
8
 
9
9
  tags = crumb_tags(@item)
10
10
 
11
- join_with = @options[:join_with] || " "
12
- content_tag(:div, safe_join(tags, join_with), @options[:attributes])
11
+ content_tag(:ol, safe_join(tags), @options[:attributes])
13
12
  end
14
13
 
15
14
  private
@@ -20,12 +19,20 @@ module SimplerNavigation
20
19
  parent_item.children.each_value do |item|
21
20
  next unless show?(item) && selected?(item)
22
21
 
23
- tags << if @options[:static_leaf] && active_leaf?(item)
22
+ active = active_leaf?(item)
23
+ li_content = if @options[:static_leaf] && active
24
24
  content_tag("span", item.name, link_tag_options(item))
25
25
  else
26
26
  link_tag(item)
27
27
  end
28
28
 
29
+ li_options = wrapper_tag_options(item)
30
+ if active
31
+ li_options[:"aria-current"] = "page"
32
+ end
33
+
34
+ tags << content_tag(:li, li_content, li_options)
35
+
29
36
  if include_sub_navigation?(item)
30
37
  tags += crumb_tags(item)
31
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimplerNavigation
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpler_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Muerdter
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-01-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionview
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
- description:
42
40
  email:
43
41
  - 12112+GUI@users.noreply.github.com
44
42
  executables: []
@@ -70,7 +68,6 @@ metadata:
70
68
  homepage_uri: https://github.com/GUI/simpler_navigation
71
69
  source_code_uri: https://github.com/GUI/simpler_navigation
72
70
  changelog_uri: https://github.com/GUI/simpler_navigation/blob/main/CHANGELOG.md
73
- post_install_message:
74
71
  rdoc_options: []
75
72
  require_paths:
76
73
  - lib
@@ -85,8 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
82
  - !ruby/object:Gem::Version
86
83
  version: '0'
87
84
  requirements: []
88
- rubygems_version: 3.4.10
89
- signing_key:
85
+ rubygems_version: 3.6.9
90
86
  specification_version: 4
91
87
  summary: A Rails gem to handle navigation menus and breadcrumbs.
92
88
  test_files: []