formatic 0.9.0 → 0.9.2

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: c931ff6cca39b6a9700a6e5cdb156c5c1c5db3275bf418d60edef92bb332ad38
4
+ data.tar.gz: 17fa8c729f43d79b261cb1b65a80c89c08d36885a138e45e2dbbadcb5581e02a
5
5
  SHA512:
6
- metadata.gz: aed5fc7417a9093fc4a55b3ce43da0f7a97ec8935b9995e814bb297b94d37687f57b5d502d6a22dfe92931a0d452c02e9bf8977ea4c7f2e891ba635767ae622c
7
- data.tar.gz: 1c12aed7ea29933b5b4be058ba703cd2aa921a0436bda4db593701e663aeb3467020cf3eb2f04e6ca97e946f46a3651c553a9efcc277e6180ca73b2d4288e4be
6
+ metadata.gz: 87b166208544a11ecac31459ea34db003bc83f49668abb720fb98f365b7ef78b52e23f4f093353063962fddb93eecd233764412df61f81885a05c2b579bf5a48
7
+ data.tar.gz: 4bb2ef735910006e78166d8c65c61ef721b253cd55b94379c084dc8ad3adbd1b4b2a381d4c6f197f03d6848313d5431420e1fc20834ed4fbd687eb137e5a9146
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
+ ## [0.9.2] - 2026-11-11
2
+
3
+ - Move the `formatic-search-hook__quickpicks` hook onto the list grid element, so layout overrides take effect
4
+
5
+ ## [0.9.1] - 2026-11-11
6
+
7
+ - Search list hooks carry an automatic `--route_key` modifier per model
8
+
1
9
  ## [0.9.0] - 2026-11-11
2
10
 
3
- - `Formatic::Search` accepts `recommended:` alongside `favorites:` and `recents:`; quick-picks and async hits carry stable `formatic-search-hook__quickpicks` / `__results` styling hooks
11
+ - `Formatic::Search` accepts `recommended:` alongside `favorites:` and `recents:`
12
+ - Quick-picks and async hits carry stable `formatic-search-hook__quickpicks` / `__results` hooks, each with an automatic `--route_key` modifier per model
4
13
  - Rename `Formatic::Search` option `expand_favorites:` to `expand_quickpicks:`
5
14
 
6
15
  ## [0.8.1] - 2026-11-10
data/README.md CHANGED
@@ -44,12 +44,14 @@ and a selected search field. Its `as_json` and `to_json` methods return the wrap
44
44
  `Formatic::Search` to render its selected markup, including the usual clear control:
45
45
  the app supplies the rendered record fragments, and Formatic adds the search wrappers.
46
46
 
47
- Styling hooks: the quick-pick lists carry `formatic-search-hook__quickpicks`,
48
- the async hits `formatic-search-hook__results`. Both are stable across
49
- refactors. Example: horizontal quick-picks with vertical results:
47
+ Styling hooks: the quick-pick list carries `formatic-search-hook__quickpicks`,
48
+ the async hits `formatic-search-hook__results`. Both sit on the grid element
49
+ itself, so layout overrides like `display` land where they take effect.
50
+ Both are stable across refactors. Each also carries a modifier with the
51
+ records route key, so one model can differ from the rest:
50
52
 
51
53
  ```css
52
- .formatic-search-hook__quickpicks {
54
+ .formatic-search-hook__quickpicks--animals {
53
55
  display: flex;
54
56
  flex-direction: row;
55
57
  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<%= ' 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| %>
@@ -51,7 +51,7 @@ module Formatic
51
51
  </div>
52
52
  <% end %>
53
53
  <% pick_groups.each_with_index do |group, group_index| %>
54
- <fieldset class="c-formatic-search__quickpicks-group js-formatic-search__quickpicks-panel<%= ' is-hidden' if pick_groups.size > 1 && group_index != active_group_index %>"
54
+ <fieldset class="c-formatic-search__quickpicks-group js-formatic-search__quickpicks-panel formatic-search-hook__quickpicks<%= ' formatic-search-hook__quickpicks--' + hook_modifier if hook_modifier %><%= ' is-hidden' if pick_groups.size > 1 && group_index != active_group_index %>"
55
55
  <% if pick_groups.size > 1 %>role="tabpanel" aria-labelledby="<%= query_input_id %>_tab_<%= group_index %>"<% else %>aria-label="<%= group[:legend] %>"<% end %>>
56
56
  <% group[:picks].each do |pick| %>
57
57
  <label class="c-formatic-search__pick js-formatic-search__pick-label" for="<%= pick[:dom_id] %>">
@@ -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.2'
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo