activeadmin-command_palette 0.1.6 → 0.1.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: 509b73ad390b1fe9b43d2cb712f41afbccdd52af79a47ab7ab65121bd93d82ef
4
- data.tar.gz: d897245191a9056ff09d22cba322831a7ec2f8808ad2a44a2dea305dc205ba75
3
+ metadata.gz: 83f3175afa5b7ba41dc6c30e5135a98b3a9758fde370e3be75486c1047057b71
4
+ data.tar.gz: 516943cd830a801b1d17416d991534f9d6705d2616bc96ac47a82ead10702870
5
5
  SHA512:
6
- metadata.gz: a74e1279e40fe8a1030fb2473b0d0b9af28f868a36147c946c0fb116cd6599fdaddecd5f3db0e869ff1b167c251c909980ad5f15ddc70b0ea206c28bdbe4ba47
7
- data.tar.gz: 0d49f774e833e14eab01da3f44fae9cfc6644149a2179a1e45cbcfafa4e4b49051e5c32baf9c993a4e6d7985f2929a4444ae1b179f0a3b7f77ed25b2840b3406
6
+ metadata.gz: b5fa9c7c761c47f10709b593885178c96742f678450a7264b10c8c90009c21a9d48a6bf62d04efa8379f586938a63ff374f41bde80cd2bae0c5537867b2ff482
7
+ data.tar.gz: fca891d5bf231d999726e63e9eb432f0ecf7da3829dd6f87d68147668380dc57b3ce8687b596b4b966689268f5b2006fdf7c9091ed5eaddc482495ee18ddc702
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.7
6
+
7
+ - Keep the highlighted list row visible when moving with Arrow Up or Arrow Down.
8
+
5
9
  ## 0.1.6
6
10
 
7
11
  - Publish as `activeadmin-command_palette` so Bundler requires `activeadmin/command_palette` by default; yank mistaken `activeadmin-command-palette` 0.1.6.
@@ -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.queryTarget.setAttribute(
559
- "aria-activedescendant",
560
- `activeadmin-command-palette-option-${this.highlightedIndex}`
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");
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module CommandPalette
5
- VERSION = "0.1.6"
5
+ VERSION = "0.1.7"
6
6
  end
7
7
  end
@@ -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.6
4
+ version: 0.1.7
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