activeadmin_favorites 0.1.5 → 0.1.6
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +11 -3
- data/app/views/active_admin/_html_head.html.erb +14 -0
- data/lib/activeadmin/favorites/version.rb +1 -1
- data/lib/activeadmin/favorites.rb +9 -0
- data/sig/activeadmin/favorites.rbs +3 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d95f2a47f409353aaaa307098bf24dc0b94abc2bf116f47101259a81f8e481a
|
|
4
|
+
data.tar.gz: 9842f18c72d0e9fbe731b934a5d58c0eae9633eb0438849a57b8d09c10b87aaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52d6fd9962c311fcee1f14c98211478337761a916eb074e83ebb641063370eb16c8b81ad921f45d59af4c8ad0b4e328fa83c6b52e9ef6423fa823ce660d1c9a5
|
|
7
|
+
data.tar.gz: ba88cae3210e174538ec0dd397f7085f451093e9b86c364219d4ba2453302917fbb0c7d6918843a2d83abffb8a7ea11a1dc765811f2cd160ab70188dded4dbec
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.1.6 (2026-10-27)
|
|
4
|
+
|
|
5
|
+
- Link the personalization menu stylesheet from Active Admin's HTML head so hosts no longer need a Tailwind `@import` of the Propshaft path.
|
|
6
|
+
- Document `ActiveAdmin::Favorites.personalization_menu_stylesheet_path` for hosts that concatenate the plain CSS into a Tailwind CLI entry.
|
|
7
|
+
|
|
3
8
|
## 0.1.5 (2026-10-26)
|
|
4
9
|
|
|
5
10
|
- Keep personalization menu actions in view while a long catalog scrolls.
|
data/README.md
CHANGED
|
@@ -61,10 +61,18 @@ When using ActionPolicy, add `save_lens_favorite?` and `reset?` to `ActiveAdmin:
|
|
|
61
61
|
|
|
62
62
|
### Stylesheet
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
The engine links `activeadmin_favorites/personalization_menu` from Active Admin's HTML head so the cogwheel dropdown can scroll the catalog while keeping action buttons in view. The file is plain CSS served through Propshaft; it does not need Tailwind processing.
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
If the host overrides `active_admin/_html_head`, add the link there:
|
|
67
|
+
|
|
68
|
+
```erb
|
|
69
|
+
<%= stylesheet_link_tag "activeadmin_favorites/personalization_menu" %>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Do not bare-`@import` that Propshaft logical path into an Active Admin CSS entry that Tailwind CLI compiles from a generated `tmp` file. Tailwind resolves imports from the input file directory, not through Propshaft. Hosts that must fold the rules into one built stylesheet can concatenate the absolute file instead:
|
|
73
|
+
|
|
74
|
+
```ruby
|
|
75
|
+
File.read(ActiveAdmin::Favorites.personalization_menu_stylesheet_path)
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
### Locales
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%= stylesheet_link_tag "active_admin" %>
|
|
2
|
+
<%= stylesheet_link_tag ActiveAdmin::Favorites::PERSONALIZATION_MENU_STYLESHEET %>
|
|
3
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
4
|
+
<%= csrf_meta_tags %>
|
|
5
|
+
<%= csp_meta_tag %>
|
|
6
|
+
<% # On page load or when changing themes, best to add inline in `head` to avoid FOUC %>
|
|
7
|
+
<%= javascript_tag nonce: true do %>
|
|
8
|
+
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
9
|
+
document.documentElement.classList.add('dark')
|
|
10
|
+
} else {
|
|
11
|
+
document.documentElement.classList.remove('dark')
|
|
12
|
+
}
|
|
13
|
+
<% end %>
|
|
14
|
+
<%= javascript_importmap_tags "active_admin", importmap: ActiveAdmin.importmap %>
|
|
@@ -5,6 +5,8 @@ require "activeadmin/favorites/configuration"
|
|
|
5
5
|
|
|
6
6
|
module ActiveAdmin
|
|
7
7
|
module Favorites
|
|
8
|
+
PERSONALIZATION_MENU_STYLESHEET = "activeadmin_favorites/personalization_menu"
|
|
9
|
+
|
|
8
10
|
class << self
|
|
9
11
|
def config
|
|
10
12
|
@config ||= Configuration.new
|
|
@@ -14,6 +16,13 @@ module ActiveAdmin
|
|
|
14
16
|
yield config
|
|
15
17
|
end
|
|
16
18
|
|
|
19
|
+
# Absolute path to the plain CSS file Propshaft serves. Hosts that
|
|
20
|
+
# concatenate into a Tailwind CLI entry can File.read this path; do not
|
|
21
|
+
# bare-@import the Propshaft logical path from a tmp Tailwind input.
|
|
22
|
+
def personalization_menu_stylesheet_path
|
|
23
|
+
Engine.root.join("app/assets/stylesheets/#{PERSONALIZATION_MENU_STYLESHEET}.css")
|
|
24
|
+
end
|
|
25
|
+
|
|
17
26
|
def install!
|
|
18
27
|
require "activeadmin/favorites/install"
|
|
19
28
|
Install.call
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin_favorites
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrei Makarov
|
|
@@ -355,6 +355,7 @@ files:
|
|
|
355
355
|
- app/models/active_admin/favorites/lens_favorite.rb
|
|
356
356
|
- app/models/active_admin/favorites/view_lens/layout.rb
|
|
357
357
|
- app/models/active_admin/favorites/view_lens_default.rb
|
|
358
|
+
- app/views/active_admin/_html_head.html.erb
|
|
358
359
|
- app/views/active_admin/favorites/_lens_catalog_data.html.erb
|
|
359
360
|
- app/views/active_admin/favorites/_macro_fields.html.erb
|
|
360
361
|
- app/views/active_admin/favorites/_personalization_trigger.html.erb
|