formatic 0.9.0 → 0.9.1

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: 641a662c0dfbe70387798d793779dba1eb4dec7b66a9cb32d681a43ee3c5b491
4
- data.tar.gz: 00b57059e138f2f674c2ad282b077cf19fd5ef4f720259c97af66efad3d9c2dd
3
+ metadata.gz: dc6207b98bbdcf93dcae103ca03eebc2993c68503b4eca6911e93d57749e26e0
4
+ data.tar.gz: dbc8e45a7d99b106a56dd3f40a024da2baf3df46fdb11c9cffed0dd797a1efe5
5
5
  SHA512:
6
- metadata.gz: aed5fc7417a9093fc4a55b3ce43da0f7a97ec8935b9995e814bb297b94d37687f57b5d502d6a22dfe92931a0d452c02e9bf8977ea4c7f2e891ba635767ae622c
7
- data.tar.gz: 1c12aed7ea29933b5b4be058ba703cd2aa921a0436bda4db593701e663aeb3467020cf3eb2f04e6ca97e946f46a3651c553a9efcc277e6180ca73b2d4288e4be
6
+ metadata.gz: cc7e35488bd7a377d21b2482cb8460bcee495390ba89bd96c6b60d56a13f739c3a550263151d572b7c765bab5e9b980a399e17b479cdb3946d1ac6f638ad1976
7
+ data.tar.gz: 963a4fb447e3b5c1c3a7b7385f825de975ae5d8cb13f83c5cbf291609313bc6a2f9bc2076860897a617edb71b9304a08b52e8275b914e9e010e69b5213780dc0
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
+ ## [0.9.1] - 2026-11-11
2
+
3
+ - Search list hooks carry an automatic `--route_key` modifier per model
4
+
1
5
  ## [0.9.0] - 2026-11-11
2
6
 
3
- - `Formatic::Search` accepts `recommended:` alongside `favorites:` and `recents:`; quick-picks and async hits carry stable `formatic-search-hook__quickpicks` / `__results` styling hooks
7
+ - `Formatic::Search` accepts `recommended:` alongside `favorites:` and `recents:`
8
+ - Quick-picks and async hits carry stable `formatic-search-hook__quickpicks` / `__results` hooks, each with an automatic `--route_key` modifier per model
4
9
  - Rename `Formatic::Search` option `expand_favorites:` to `expand_quickpicks:`
5
10
 
6
11
  ## [0.8.1] - 2026-11-10
data/README.md CHANGED
@@ -46,10 +46,11 @@ the app supplies the rendered record fragments, and Formatic adds the search wra
46
46
 
47
47
  Styling hooks: the quick-pick lists carry `formatic-search-hook__quickpicks`,
48
48
  the async hits `formatic-search-hook__results`. Both are stable across
49
- refactors. Example: horizontal quick-picks with vertical results:
49
+ refactors. Each also carries a modifier with the records route key, so one
50
+ model can differ from the rest:
50
51
 
51
52
  ```css
52
- .formatic-search-hook__quickpicks {
53
+ .formatic-search-hook__quickpicks--animals {
53
54
  display: flex;
54
55
  flex-direction: row;
55
56
  flex-wrap: wrap;
@@ -81,6 +81,12 @@ module Formatic
81
81
  pick_list.checked_html
82
82
  end
83
83
 
84
+ def hook_modifier
85
+ record = Array(recents) + Array(favorites) + Array(recommended)
86
+ record = record.first
87
+ record.model_name.route_key if record.respond_to?(:model_name)
88
+ end
89
+
84
90
  private
85
91
 
86
92
  def pick_list
@@ -38,7 +38,7 @@ module Formatic
38
38
  class: 'js-formatic-search__query-input' %>
39
39
  </div>
40
40
 
41
- <div class="c-formatic-search__quickpicks js-formatic-search__quickpicks formatic-search-hook__quickpicks<%= ' is-hidden' if picks_initially_hidden? %>">
41
+ <div class="c-formatic-search__quickpicks js-formatic-search__quickpicks formatic-search-hook__quickpicks<%= ' formatic-search-hook__quickpicks--' + hook_modifier if hook_modifier %><%= ' is-hidden' if picks_initially_hidden? %>">
42
42
  <% if pick_groups.size > 1 %>
43
43
  <div class="c-formatic-search__quickpicks-tabs js-formatic-search__quickpicks-tablist" role="tablist">
44
44
  <% pick_groups.each_with_index do |group, group_index| %>
@@ -66,7 +66,7 @@ module Formatic
66
66
  <% end %>
67
67
  </div>
68
68
 
69
- <div class="c-formatic-search__results js-formatic-search__results formatic-search-hook__results"></div>
69
+ <div class="c-formatic-search__results js-formatic-search__results formatic-search-hook__results<%= ' formatic-search-hook__results--' + hook_modifier if hook_modifier %>"></div>
70
70
  <div class="c-formatic-search__add-record js-formatic-search__add-record" hidden><%= add_record %></div>
71
71
  </div>
72
72
  <% else %>
@@ -97,7 +97,7 @@ module Formatic
97
97
  class: 'js-formatic-search__query-input' %>
98
98
  </div>
99
99
 
100
- <div class="c-formatic-search__results js-formatic-search__results formatic-search-hook__results"></div>
100
+ <div class="c-formatic-search__results js-formatic-search__results formatic-search-hook__results<%= ' formatic-search-hook__results--' + hook_modifier if hook_modifier %>"></div>
101
101
  <div class="c-formatic-search__add-record js-formatic-search__add-record" hidden><%= add_record %></div>
102
102
  <% end %>
103
103
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Formatic
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo