activeadmin-command_palette 0.1.6 → 0.1.8
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 +9 -0
- data/README.md +10 -0
- data/app/assets/controllers/activeadmin_command_palette/command_palette_controller.js +9 -4
- data/app/assets/stylesheets/activeadmin_command_palette.css +2 -0
- data/lib/activeadmin/command_palette/version.rb +1 -1
- data/lib/activeadmin/command_palette.rb +5 -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: 3801c8198b67b942accb14aa27744358b7991e66bf36de38de9fa94a796c89b4
|
|
4
|
+
data.tar.gz: 9e103a701673046e5203ef0878484c17047ebcf61fc83cc91e2cff94bef49723
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12c57eb1fa8b2682c53f4c2616806de2a8bc1449949d3850bff5deef2d10f687c5ebcb7fd861126ed0dafdc64a68b4c15b7186c09438bcb0eab4e5fb9cef670c
|
|
7
|
+
data.tar.gz: bd79f196c0e4a3330191b4bee534d2fce4010faa3199cbdcd46c19531b25a8dce41e7367476bbc691d6053f3264823df198c3f08c4a7e25cab7f80324d5ba96a
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.8
|
|
6
|
+
|
|
7
|
+
- Document `ActiveAdmin::CommandPalette.tailwind_entry_path` in the install README.
|
|
8
|
+
|
|
9
|
+
## 0.1.7
|
|
10
|
+
|
|
11
|
+
- Keep the highlighted list row visible when moving with Arrow Up or Arrow Down.
|
|
12
|
+
- Ship `ActiveAdmin::CommandPalette.tailwind_entry_path` so hosts can concatenate palette shell utilities into the ActiveAdmin Tailwind build.
|
|
13
|
+
|
|
5
14
|
## 0.1.6
|
|
6
15
|
|
|
7
16
|
- Publish as `activeadmin-command_palette` so Bundler requires `activeadmin/command_palette` by default; yank mistaken `activeadmin-command-palette` 0.1.6.
|
data/README.md
CHANGED
|
@@ -35,6 +35,16 @@ Register finders and actions in an initializer or with the resource DSL.
|
|
|
35
35
|
|
|
36
36
|
Built-in UI locales: English (`en`), Finnish (`fi`), Swedish (`sv`).
|
|
37
37
|
|
|
38
|
+
### Styles
|
|
39
|
+
|
|
40
|
+
Concatenate the gem Tailwind entry into the CSS file your ActiveAdmin Tailwind build compiles:
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
File.read(ActiveAdmin::CommandPalette.tailwind_entry_path)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
That entry keeps palette shell utilities available in the admin stylesheet.
|
|
47
|
+
|
|
38
48
|
## Configuration
|
|
39
49
|
|
|
40
50
|
Prefer resource-level registration in `ActiveAdmin.register`:
|
|
@@ -555,15 +555,20 @@ export default class extends Controller {
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
if (this.highlightedIndex >= 0 && this.visibleItems.length > 0) {
|
|
558
|
-
this.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
);
|
|
558
|
+
const optionId = `activeadmin-command-palette-option-${this.highlightedIndex}`;
|
|
559
|
+
this.queryTarget.setAttribute("aria-activedescendant", optionId);
|
|
560
|
+
this.scrollHighlightedIntoView(optionId);
|
|
562
561
|
} else {
|
|
563
562
|
this.queryTarget.removeAttribute("aria-activedescendant");
|
|
564
563
|
}
|
|
565
564
|
}
|
|
566
565
|
|
|
566
|
+
scrollHighlightedIntoView(optionId) {
|
|
567
|
+
if (!this.hasListTarget) return;
|
|
568
|
+
const option = this.listTarget.querySelector(`#${optionId}`);
|
|
569
|
+
option?.scrollIntoView({ block: "nearest" });
|
|
570
|
+
}
|
|
571
|
+
|
|
567
572
|
appendSectionHeader(kind) {
|
|
568
573
|
const header = document.createElement("li");
|
|
569
574
|
header.className =
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* Tailwind entry for ActiveAdmin hosts. Keep class tokens in sync with the palette shell. */
|
|
2
|
+
@source inline("absolute bg-black/40 bg-gray-100 bg-transparent bg-white border border-0 border-b border-gray-200 border-t cursor-pointer dark:bg-gray-800 dark:bg-gray-900 dark:border-gray-700 dark:hover:bg-gray-800 dark:text-gray-100 dark:text-gray-400 dark:text-gray-500 fixed flex flex-col focus:outline-none focus:ring-0 font-semibold hidden hover:bg-gray-100 inset-0 items-center items-start justify-center max-h-80 max-w-xl me-2 min-w-0 overflow-auto pb-1 pt-2 pt-[12vh] px-3 px-4 py-1 py-2 py-3 relative rounded-lg shadow-2xl shrink-0 sr-only text-[10px] text-base text-gray-400 text-gray-500 text-gray-900 text-gray-950 text-sm text-xs tracking-wide underline uppercase w-full z-50");
|
|
@@ -31,6 +31,11 @@ module ActiveAdmin
|
|
|
31
31
|
def reload!
|
|
32
32
|
configuration.reload!
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
# Path to the Tailwind CSS entry hosts concatenate into the ActiveAdmin stylesheet build.
|
|
36
|
+
def tailwind_entry_path
|
|
37
|
+
Engine.root.join("app/assets/stylesheets/activeadmin_command_palette.css")
|
|
38
|
+
end
|
|
34
39
|
end
|
|
35
40
|
end
|
|
36
41
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin-command_palette
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrei Makarov
|
|
@@ -340,6 +340,7 @@ files:
|
|
|
340
340
|
- SECURITY.md
|
|
341
341
|
- activeadmin-command_palette.gemspec
|
|
342
342
|
- app/assets/controllers/activeadmin_command_palette/command_palette_controller.js
|
|
343
|
+
- app/assets/stylesheets/activeadmin_command_palette.css
|
|
343
344
|
- app/controllers/active_admin/command_palette/options_controller.rb
|
|
344
345
|
- app/views/active_admin/command_palette/_palette.html.erb
|
|
345
346
|
- config/locales/activeadmin_command_palette.en.yml
|