@stapel/search-react 0.16.0 → 0.18.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.
- package/CHANGELOG.md +122 -0
- package/dist/api/generated/schema.d.ts +18 -10
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/default/FacetGroupControl.d.ts +10 -0
- package/dist/default/FacetGroupControl.d.ts.map +1 -1
- package/dist/default/FacetGroupControl.js +122 -27
- package/dist/default/FacetGroupControl.js.map +1 -1
- package/dist/default/FacetPanelPane.d.ts +25 -38
- package/dist/default/FacetPanelPane.d.ts.map +1 -1
- package/dist/default/FacetPanelPane.js +157 -6
- package/dist/default/FacetPanelPane.js.map +1 -1
- package/dist/default/FilterChips.d.ts +25 -0
- package/dist/default/FilterChips.d.ts.map +1 -1
- package/dist/default/FilterChips.js +39 -3
- package/dist/default/FilterChips.js.map +1 -1
- package/dist/default/SearchPage.d.ts.map +1 -1
- package/dist/default/SearchPage.js +10 -1
- package/dist/default/SearchPage.js.map +1 -1
- package/dist/default/SearchResultsPane.d.ts +9 -1
- package/dist/default/SearchResultsPane.d.ts.map +1 -1
- package/dist/default/SearchResultsPane.js +20 -7
- package/dist/default/SearchResultsPane.js.map +1 -1
- package/dist/default/SortSelect.d.ts.map +1 -1
- package/dist/default/SortSelect.js +4 -1
- package/dist/default/SortSelect.js.map +1 -1
- package/dist/default/index.d.ts +1 -1
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +1 -1
- package/dist/default/index.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +5 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/keys.d.ts +19 -0
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +25 -0
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +7 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/state/facets.d.ts +14 -0
- package/dist/state/facets.d.ts.map +1 -1
- package/dist/state/facets.js +19 -0
- package/dist/state/facets.js.map +1 -1
- package/llms.txt +2 -2
- package/manifest.json +8 -2
- package/nav-manifest.json +1 -1
- package/package.json +7 -7
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +18 -10
- package/src/default/FacetGroupControl.tsx +217 -60
- package/src/default/FacetPanelPane.tsx +226 -25
- package/src/default/FilterChips.tsx +69 -2
- package/src/default/SearchPage.tsx +15 -1
- package/src/default/SearchResultsPane.tsx +20 -7
- package/src/default/SortSelect.tsx +3 -1
- package/src/default/index.ts +2 -0
- package/src/i18n/es.ts +5 -0
- package/src/i18n/keys.ts +25 -0
- package/src/i18n/ru.ts +7 -0
- package/src/state/facets.ts +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# @stapel/search-react
|
|
2
2
|
|
|
3
|
+
## 0.18.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f79bdc3: tokens-antd: a gated control is semantically off and interactively ALIVE — it can be tapped, focused, and can say why it will not do the thing
|
|
8
|
+
|
|
9
|
+
`GatedControl` handed callers `bind.disabled` and its own JSDoc told them to spread it straight onto the control. That produced an html-`disabled` element, which fires no events in any browser: it cannot be clicked, cannot take focus, cannot be described to a screen reader that never reaches it, and cannot carry the one gesture that mattered — the tap that should open the sign-in door standing behind the gate. Every gated control across the ~20 pairs using it was inert, and the wrong instruction was half the defect: the docs taught the shape that broke it.
|
|
10
|
+
|
|
11
|
+
Measured on a live deployment: an anonymous visitor taps the favourite heart and nothing happens at all — no sentence, no tooltip, no door (walker defects D45/D72).
|
|
12
|
+
|
|
13
|
+
**The corrected contract.** While the gate is shut a control is now `aria-disabled="true"` and NOT html-disabled, so it stays focusable and keeps receiving events. The ACTION is suppressed by `GatedControl` itself, in a capture-phase wrapper (`display: contents`, so no pair's layout moves by a pixel): the caller's `onClick`, keyboard activation, typing, IME input, paste and drop are swallowed before the control sees them. Callers write their handlers exactly as if the gate did not exist. The activation comes back as the new `onBlockedActivate`, which is where a pair opens its door. The reason stays where it was — visible text wired by `aria-describedby` — and where a `PaneGate` pools it into one footnote, the gesture now brings a `role="status"` copy of the sentence back to the control it belongs to. A blocked `GatedButton` keeps antd's exact disabled paint (its own `-disabled` class, which sets no `pointer-events`), so nothing about any screen looks different.
|
|
14
|
+
|
|
15
|
+
`GatedControlProps.whenBlocked` holds the two deliberate opt-outs, neither of them the default:
|
|
16
|
+
|
|
17
|
+
- `"inert"` — html `disabled`, for the rare control that must be switched off at the browser level. `attributes-react`'s catalogue lock is the one place in the fleet that asks for it, and now says so.
|
|
18
|
+
- `"annotate"` — the control stays fully usable and only gains the sentence, for a gate that judges the VALUE rather than refusing the person: `calendar-react`'s slot-length field must stay editable, because editing it is how the reason goes away, and `search-react`'s sort must still pick the options that are not the blocked one.
|
|
19
|
+
|
|
20
|
+
`useBlockedButtonClassName()` is exported for render-prop call sites that paint their own button and want the same unavailable look rather than a second grey.
|
|
21
|
+
|
|
22
|
+
**⚠️ The readiness-signal hazard, and its cure.** `element.disabled` is now permanently `false` on every gated control in the fleet. Any test using it as a readiness signal — `await waitFor(() => expect(save.disabled).toBe(false))`, meaning "wait until this is allowed" — returns instantly and mis-times SILENTLY: every assertion after it reads an unseeded component, and the failure looks like broken product logic rather than a gate that had not opened. One pair's suite went green → 21 failures across unrelated files on exactly this. Wait on the stamp instead, which is what such a wait was always asking:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
await waitFor(() =>
|
|
26
|
+
expect(
|
|
27
|
+
screen.getByTestId("save-gate").getAttribute("data-stapel-gated")
|
|
28
|
+
).toBe("available")
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`data-stapel-gated="available" | "blocked"` is on the wrapper of every gated control in all three modes (`GatedButton` names it `<testId>-gate`). For a point assertion on one element, read `aria-disabled`. Never `disabled`.
|
|
33
|
+
|
|
34
|
+
**ChoiceChips** carried the same defect on its own chips and is fixed the same way: a chip at the cap is `aria-disabled` and focusable, and the tap is refused in the handler, so the row's sentence reaches a keyboard.
|
|
35
|
+
|
|
36
|
+
**The consumers.** Every `GatedButton` call site (64 imports across 20 pairs) is fixed with no code change — the correction is in the substrate. The render-prop call sites that consumed the binding field-by-field now spread it whole: `billing-react`'s auto-recharge switch, `calendar-react`'s RSVP buttons, `moderation-react`'s sanction checkbox, `notifications-react`'s push switch, `attributes-react`'s at-max add button. `tasks-react`'s assignee picker is a host slot rendering its own control out of reach of the suppression, so it is handed a plain verdict on purpose. `workspaces-react` had two hand-rolled gates that never went through `GatedControl` at all — a row-action column and the create button on a failed roster read — and both now use the same anatomy.
|
|
37
|
+
|
|
38
|
+
## 0.18.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- 309890a: The desktop filter rail redesigned around what the walker measured on a live
|
|
43
|
+
classified deployment's cars leaf at 1440×900: the 280px rail carried 5717px
|
|
44
|
+
of content — 40 facet groups, 118 checkboxes, 66 fields — as one flat column
|
|
45
|
+
inside an invisible inner scroll whose tail was physically unreachable, with
|
|
46
|
+
the engineering phrase "not counted" printed 100+ times down the default view.
|
|
47
|
+
|
|
48
|
+
- **Facet groups are disclosures.** `<FacetGroupControl>` gains
|
|
49
|
+
`collapsible?: boolean` and `defaultOpen?: boolean` (both default to
|
|
50
|
+
today's always-open group, so no existing host changes): the label becomes
|
|
51
|
+
a real `<button aria-expanded>` with a chevron and the count of the
|
|
52
|
+
group's CHOSEN values; closed, the options are not in the DOM at all — a
|
|
53
|
+
hundred hidden checkboxes are still a hundred stops for a screen reader.
|
|
54
|
+
- **Which groups open is the answer's own evidence.** In `<FacetPanelPane>`
|
|
55
|
+
— rail AND sheet, a six-screen sheet being the same disease — a group with
|
|
56
|
+
any chosen value is always open; otherwise the top `FACET_OPEN_GROUPS`
|
|
57
|
+
(5) counted groups by coverage open, ranked by the new
|
|
58
|
+
`facetCoverage` (exported from the facet model; the chip row now sorts
|
|
59
|
+
its counted band by the same function instead of its own copy). Everything
|
|
60
|
+
else starts as a header, one click from whole. The three group shapes
|
|
61
|
+
(segmented / nested / checkbox) are untouched inside an open group.
|
|
62
|
+
- **Uncounted options are the fold's tail.** Options with `count: null` and
|
|
63
|
+
nothing chosen sort after every counted one and live behind the existing
|
|
64
|
+
"Show all (N)" fold — still reachable, still labelled honestly, no longer
|
|
65
|
+
the group's face. A schema-only group (ALL options uncounted) keeps its
|
|
66
|
+
options visible as before, and chosen options are always visible.
|
|
67
|
+
- **Search within the filters.** From `FACET_SEARCH_THRESHOLD` (6) groups
|
|
68
|
+
up, an `allowClear` input above the groups narrows them client-side by
|
|
69
|
+
group or option label, case-insensitively; matches render open, a miss
|
|
70
|
+
says so in the panel's empty-state idiom. Presentation only — the URL
|
|
71
|
+
never hears about the query. New keys `search.facets.search` /
|
|
72
|
+
`search.facets.search_empty` (en/ru/es).
|
|
73
|
+
- **The rail's scroll is visible and its floor answers back.** The RAIL
|
|
74
|
+
style gains `scrollbarWidth: "thin"` + `scrollbarGutter: "stable"` — on
|
|
75
|
+
overlay-scrollbar platforms an invisible inner scroll is indistinguishable
|
|
76
|
+
from a rail that ends at the fold. `<FacetPanelPane>` gains
|
|
77
|
+
`footerBar?: boolean` (default `false`; `<SearchPage>` turns it on for the
|
|
78
|
+
column layout only): a sticky bar on the theme's container ground with a
|
|
79
|
+
`colorSplit` hairline, stating the live result count as strong text (new
|
|
80
|
+
plural family `search.facets.match_count`, "N listings match", full
|
|
81
|
+
one/few/many/other forms in ru) with the clear-all control beside it when
|
|
82
|
+
filters are active. Desktop filters apply instantly — the bar is feedback
|
|
83
|
+
plus the way out, not an apply button, which is why the phone sheet (which
|
|
84
|
+
has its own apply footer) never draws it.
|
|
85
|
+
- **Denser results grid, and a measure that lets it breathe.**
|
|
86
|
+
`RESULTS_GRID`'s floor drops from `minmax(280px, 1fr)` to
|
|
87
|
+
`minmax(260px, 1fr)`, and `RESULTS_MAX_WIDTH` rises 1120 → 1400: the old
|
|
88
|
+
cap quietly overrode the floor (a 1440px desktop drew three 363px cards
|
|
89
|
+
inside a 1392px content column), and a card grid is not prose — its
|
|
90
|
+
measure is the fleet's widest content column. Five columns open, four
|
|
91
|
+
beside the rail; the 2560px pane the cap was written against is still
|
|
92
|
+
capped. A host that pinned `maxWidth` on the pane keeps its pin.
|
|
93
|
+
|
|
94
|
+
The `default` entry's size budget moves 21 → 22 KB (measured 21.6 KB): the
|
|
95
|
+
disclosure header, the panel search and the footer bar are shipped surface,
|
|
96
|
+
not drift.
|
|
97
|
+
|
|
98
|
+
## 0.17.0
|
|
99
|
+
|
|
100
|
+
### Minor Changes
|
|
101
|
+
|
|
102
|
+
- 6bf6f2d: The chip row is capped behind a "more" door, and the counted-facet band leads
|
|
103
|
+
with coverage.
|
|
104
|
+
|
|
105
|
+
Ordering alone did not survive a grown catalogue: an imported schema gave a
|
|
106
|
+
phones leaf option tables for its wholesale plumbing (so they came back as
|
|
107
|
+
facet groups) and a cars leaf declares enough axes for 44 chips in one row at
|
|
108
|
+
390px. Two mechanisms close it:
|
|
109
|
+
|
|
110
|
+
- Within the counted-facet band, groups rank by **coverage** — the sum of a
|
|
111
|
+
group's counts, the answer's own evidence of which axes this corpus fills.
|
|
112
|
+
A brand every document carries outranks a flaw eleven carry and an
|
|
113
|
+
uncounted schema guess with no evidence at all; ties keep the authored
|
|
114
|
+
order (the sort stays stable). Bands, applied-first, and the barren rule
|
|
115
|
+
are unchanged.
|
|
116
|
+
- The row draws at most `CHIP_ROW_CAP` (8) banded chips and stands a
|
|
117
|
+
"More · N" chip (`search-chips-overflow`) in for the tail, opening the same
|
|
118
|
+
full panel the leading circle does. Nothing is deleted, and an APPLIED
|
|
119
|
+
filter is never behind the door. `FilterChipsProps.maxRowChips` moves the
|
|
120
|
+
budget; `null` restores the uncapped row. `capChipRow` is exported beside
|
|
121
|
+
`orderChipFilters` because the cap, like the order, is the product.
|
|
122
|
+
|
|
123
|
+
New i18n key: `search.filters.chips_overflow` (en/ru/es shipped).
|
|
124
|
+
|
|
3
125
|
## 0.16.0
|
|
4
126
|
|
|
5
127
|
### Minor Changes
|
|
@@ -134,25 +134,29 @@ export interface components {
|
|
|
134
134
|
schemas: {
|
|
135
135
|
/** @description One destination in the dropdown, ready to render and ready to follow. */
|
|
136
136
|
CategorySuggestion: {
|
|
137
|
-
/** @description Category id. */
|
|
137
|
+
/** @description Category id. A `listings`-graded row derives it from the path's leaf segment. */
|
|
138
138
|
id: number;
|
|
139
|
-
/** @description Category slug. */
|
|
139
|
+
/** @description Category slug. Empty on a `listings`-graded row: no comm Function in the fleet resolves a path id to its slug or name yet. */
|
|
140
140
|
slug: string;
|
|
141
|
-
/** @description The category's own display name. */
|
|
141
|
+
/** @description The category's own display name. On a `listings`-graded row this is the leaf id as a truthful segment — render such rows by their `count` instead. */
|
|
142
142
|
name: string;
|
|
143
|
-
/** @description Display names root->leaf, e.g. ['Мужская одежда', 'Шорты']. This is what distinguishes three categories that share a name. */
|
|
143
|
+
/** @description Display names root->leaf, e.g. ['Мужская одежда', 'Шорты']. This is what distinguishes three categories that share a name. `listings`-graded rows carry the id segments here. */
|
|
144
144
|
path: string[];
|
|
145
145
|
/** @description The ancestry as ids joined with '/'. Pass it verbatim as the `category` parameter of /query — do not re-join path segments yourself. */
|
|
146
146
|
category: string;
|
|
147
|
-
/** @description Live listings a buyer would see under this category, descendants included — the same number the SERP reports for it. */
|
|
147
|
+
/** @description Live listings a buyer would see under this category, descendants included — the same number the SERP reports for it. On a `listings`-graded row: how many of them match the typed query, which is the count a `?q=…&category=…` tap will show. */
|
|
148
148
|
count: number;
|
|
149
149
|
/** @description Number of segments in `path`. */
|
|
150
150
|
depth: number;
|
|
151
151
|
/**
|
|
152
|
-
* @description How the name
|
|
152
|
+
* @description How the row earned its place: the four name grades from `categories.suggest`, or `listings` — a goods-driven row, offered because documents matching the query live there even though no category name says the word. Ranking: strong grades (exact/prefix/word) and `listings` sort as one class above `substring`; within a class, stocked before empty, then grade, then count desc, then depth, then name. `vector` rows — embedding-space neighbours offered when nothing first-class matched — always sit below every deterministic row, ordered by similarity.
|
|
153
153
|
*
|
|
154
|
+
* * `exact` - exact
|
|
154
155
|
* * `prefix` - prefix
|
|
156
|
+
* * `word` - word
|
|
155
157
|
* * `substring` - substring
|
|
158
|
+
* * `listings` - listings
|
|
159
|
+
* * `vector` - vector
|
|
156
160
|
*/
|
|
157
161
|
match: components["schemas"]["MatchEnum"];
|
|
158
162
|
};
|
|
@@ -190,11 +194,15 @@ export interface components {
|
|
|
190
194
|
stale_reason?: string;
|
|
191
195
|
};
|
|
192
196
|
/**
|
|
193
|
-
* @description * `
|
|
197
|
+
* @description * `exact` - exact
|
|
198
|
+
* * `prefix` - prefix
|
|
199
|
+
* * `word` - word
|
|
194
200
|
* * `substring` - substring
|
|
201
|
+
* * `listings` - listings
|
|
202
|
+
* * `vector` - vector
|
|
195
203
|
* @enum {string}
|
|
196
204
|
*/
|
|
197
|
-
MatchEnum: "prefix" | "substring";
|
|
205
|
+
MatchEnum: "exact" | "prefix" | "word" | "substring" | "listings" | "vector";
|
|
198
206
|
/** @description The P2B Art. 5 disclosure, generated from the scorer registry. */
|
|
199
207
|
RankingResponse: {
|
|
200
208
|
doc_type: string;
|
|
@@ -282,7 +290,7 @@ export interface components {
|
|
|
282
290
|
took_ms: number;
|
|
283
291
|
};
|
|
284
292
|
SuggestResponse: {
|
|
285
|
-
/** @description Destinations, ranked by live listing count desc, then depth, then name. */
|
|
293
|
+
/** @description Destinations, ranked by match class (strong name grades and goods-driven rows above substring), then stocked before empty, then grade, then live listing count desc, then depth, then name. */
|
|
286
294
|
categories: components["schemas"]["CategorySuggestion"][];
|
|
287
295
|
/** @description Title prefixes from the index. */
|
|
288
296
|
terms: string[];
|
|
@@ -290,7 +298,7 @@ export interface components {
|
|
|
290
298
|
items: string[];
|
|
291
299
|
/** @description Which dictionary answered — the same resolution /query reports. */
|
|
292
300
|
language: string;
|
|
293
|
-
/** @description What this answer could not do: `category_suggestions` (no provider for category names), `category_rollup` (no ancestry, so counts would read 0). */
|
|
301
|
+
/** @description What this answer could not do: `category_suggestions` (no provider for category names), `category_rollup` (no ancestry, so counts would read 0), `category_listing_suggestions` (no name matched and the configured engine does not implement the optional goods-driven verb, or it failed). */
|
|
294
302
|
degraded: string[];
|
|
295
303
|
backend: string;
|
|
296
304
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/api/generated/schema.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,KAAK;IAClB,uBAAuB,EAAE;QACrB,UAAU,EAAE;YACR,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,MAAM,CAAC,EAAE,KAAK,CAAC;YACf,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,MAAM,CAAC,EAAE,KAAK,CAAC;SAClB,CAAC;QACF;;;;;WAKG;QACH,GAAG,EAAE,UAAU,CAAC,+BAA+B,CAAC,CAAC;QACjD,GAAG,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,MAAM,CAAC,EAAE,KAAK,CAAC;QACf,OAAO,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;KACjB,CAAC;IACF,sBAAsB,EAAE;QACpB,UAAU,EAAE;YACR,KAAK,CAAC,EAAE,KAAK,CAAC;YACd,MAAM,CAAC,EAAE,KAAK,CAAC;YACf,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,MAAM,CAAC,EAAE,KAAK,CAAC;SAClB,CAAC;QACF;;;;;WAKG;QACH,GAAG,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAC;QAChD,GAAG,CAAC,EAAE,KAAK,CAAC;QACZ,IAAI,CAAC,EAAE,KAAK,CAAC;QACb,M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AC;QACpB,SAAS,EAAE;YACP,GAAG,EAAE;gBACD,OAAO,EAAE;oBACL,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;iBAC3B,CAAC;gBACF,OAAO,EAAE;oBACL,kBAAkB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;iBAChE,CAAC;aACL,CAAC;SACL,CAAC;KACL,CAAC;CACL"}
|
|
@@ -35,6 +35,16 @@ export interface FacetGroupControlProps {
|
|
|
35
35
|
/** How many options before "Show all". Default {@link FACET_VISIBLE_OPTIONS};
|
|
36
36
|
* `null` shows every option (a sheet devoted to one group has the room). */
|
|
37
37
|
readonly visibleOptions?: number | null;
|
|
38
|
+
/**
|
|
39
|
+
* Make the group a disclosure: the heading becomes a real button and the
|
|
40
|
+
* options can leave the DOM entirely. Default `false` — today's always-open
|
|
41
|
+
* group, so no existing host changes. Meaningless with `heading: false`:
|
|
42
|
+
* a disclosure with no header is a group nothing can reopen.
|
|
43
|
+
*/
|
|
44
|
+
readonly collapsible?: boolean;
|
|
45
|
+
/** Whether a `collapsible` group STARTS open. Default `true`. The initial
|
|
46
|
+
* value only — the person owns the state after the first click. */
|
|
47
|
+
readonly defaultOpen?: boolean;
|
|
38
48
|
}
|
|
39
49
|
export declare function FacetGroupControl(props: FacetGroupControlProps): ReactElement;
|
|
40
50
|
//# sourceMappingURL=FacetGroupControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetGroupControl.d.ts","sourceRoot":"","sources":["../../src/default/FacetGroupControl.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FacetGroupControl.d.ts","sourceRoot":"","sources":["../../src/default/FacetGroupControl.tsx"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAMzD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGlE;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,4CAA4C;AAC5C,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAElE,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAwCD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAMlE;AAWD,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,eAAe,EAAE,CAkC9E;AAgJD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD;2EACuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;gFAC4E;IAC5E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;uEACmE;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAsH7E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* `<FacetGroupControl>` — ONE facet group, drawn the way its own schema says
|
|
4
4
|
* it should be drawn.
|
|
@@ -32,6 +32,31 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
* A group with NO schema (the host passed no `categoryFeatures`, or the slug
|
|
33
33
|
* is not in it) is a flat checkbox list — the honest default, and the shape
|
|
34
34
|
* every group had before.
|
|
35
|
+
*
|
|
36
|
+
* ── The group can be a disclosure, and closed it is NOT in the DOM ─────────
|
|
37
|
+
*
|
|
38
|
+
* Measured on a live classified deployment's cars leaf at 1440×900: the 280px
|
|
39
|
+
* rail carried 5717px of content — 40 groups, 118 checkboxes, 66 fields — as
|
|
40
|
+
* one flat column. No amount of per-group folding fixes forty headings' worth
|
|
41
|
+
* of open controls, so the group itself can close: `collapsible` turns the
|
|
42
|
+
* label into a real `<button aria-expanded>` with a chevron and, when values
|
|
43
|
+
* are chosen inside, the count of them — the one fact a closed group owes its
|
|
44
|
+
* header. Closed means the options are not rendered at all: a hundred
|
|
45
|
+
* `display:none` checkboxes are still a hundred stops for a screen reader.
|
|
46
|
+
* Both props default to today's behaviour (always open, no disclosure), so no
|
|
47
|
+
* existing host changes; WHICH groups open is the panel's decision, not this
|
|
48
|
+
* component's — see `FacetPanelPane`.
|
|
49
|
+
*
|
|
50
|
+
* ── Uncounted options are the fold's tail, not the group's face ────────────
|
|
51
|
+
*
|
|
52
|
+
* The same walk found "not counted" printed 100+ times down the default view.
|
|
53
|
+
* The sentence is honest and it stays — but an option with no evidence behind
|
|
54
|
+
* it must not stand in front of one that has some, so options with
|
|
55
|
+
* `count: null` and nothing chosen sort AFTER every counted one and live
|
|
56
|
+
* behind the existing "Show all (N)" fold. A group whose options are ALL
|
|
57
|
+
* uncounted (a schema-only group — the server never counted the slug) keeps
|
|
58
|
+
* them visible as before: folding everything would leave a heading over
|
|
59
|
+
* nothing. Chosen options are always visible, wherever their count went.
|
|
35
60
|
*/
|
|
36
61
|
import { useState } from "react";
|
|
37
62
|
import { Button, Checkbox, Flex, Typography } from "antd";
|
|
@@ -95,30 +120,53 @@ export function facetGroupShape(group) {
|
|
|
95
120
|
}
|
|
96
121
|
return singleChoice(feature) ? "segmented" : "checkbox";
|
|
97
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Is this node in the group's uncounted tail — an option with no evidence
|
|
125
|
+
* behind it AND no choice on it? Only meaningful in a group that has counted
|
|
126
|
+
* evidence at all: see {@link facetOptionNodes}.
|
|
127
|
+
*/
|
|
128
|
+
function uncountedUnchosen(node) {
|
|
129
|
+
return node.option.count === null && !node.option.selected;
|
|
130
|
+
}
|
|
98
131
|
/** The group's options in render order, carrying the depth the schema gives. */
|
|
99
132
|
export function facetOptionNodes(group) {
|
|
133
|
+
let nodes;
|
|
100
134
|
if (facetGroupShape(group) !== "nested" || group.feature === undefined) {
|
|
101
|
-
|
|
135
|
+
nodes = group.options.map((option) => ({ option, depth: 0 }));
|
|
102
136
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
137
|
+
else {
|
|
138
|
+
const depths = optionDepths(featureConfig(group.feature)["options"]);
|
|
139
|
+
// Depth alone would leave children beside strangers: the options are
|
|
140
|
+
// re-ordered so each child follows its own parent, and a value the schema
|
|
141
|
+
// does not know keeps depth 0 rather than being hidden under someone.
|
|
142
|
+
const byValue = new Map(group.options.map((option) => [option.value, option]));
|
|
143
|
+
const out = [];
|
|
144
|
+
const emitted = new Set();
|
|
145
|
+
for (const [value, depth] of depths) {
|
|
146
|
+
const option = byValue.get(value);
|
|
147
|
+
if (option === undefined)
|
|
148
|
+
continue;
|
|
149
|
+
out.push({ option, depth });
|
|
150
|
+
emitted.add(value);
|
|
151
|
+
}
|
|
152
|
+
for (const option of group.options) {
|
|
153
|
+
if (!emitted.has(option.value))
|
|
154
|
+
out.push({ option, depth: 0 });
|
|
155
|
+
}
|
|
156
|
+
nodes = out;
|
|
120
157
|
}
|
|
121
|
-
|
|
158
|
+
// An option nobody counted must not stand in front of one with evidence:
|
|
159
|
+
// the uncounted, unchosen tail sorts after everything else (stable — both
|
|
160
|
+
// halves keep their own order) and folds behind "Show all" in the
|
|
161
|
+
// component below. Only in a group that HAS counted evidence: a schema-only
|
|
162
|
+
// group is all `null`, and demoting all of it would reorder nothing while
|
|
163
|
+
// telling the fold to hide the entire group behind its own heading.
|
|
164
|
+
if (!group.options.some((option) => option.count !== null))
|
|
165
|
+
return nodes;
|
|
166
|
+
const tail = nodes.filter(uncountedUnchosen);
|
|
167
|
+
if (tail.length === 0)
|
|
168
|
+
return nodes;
|
|
169
|
+
return [...nodes.filter((node) => !uncountedUnchosen(node)), ...tail];
|
|
122
170
|
}
|
|
123
171
|
/** A count, or the honest "we did not count this". Never a zero standing in
|
|
124
172
|
* for an absent answer. */
|
|
@@ -154,23 +202,70 @@ function OptionPill(props) {
|
|
|
154
202
|
props.onToggle(group.slug, option.value);
|
|
155
203
|
}, children: option.count === null ? option.label : `${option.label} ${option.count}` }));
|
|
156
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* The disclosure header, as a NATIVE button with the chrome stripped.
|
|
207
|
+
*
|
|
208
|
+
* Native rather than antd's `Button`, because this is a heading that happens
|
|
209
|
+
* to toggle, not an action: it must inherit the heading's type and colour and
|
|
210
|
+
* sit flush with the group's left edge, and undoing a themed button's
|
|
211
|
+
* padding, border, background and hover for every surface it lands on is more
|
|
212
|
+
* style than the button brings. `aria-expanded` on a real `<button>` is the
|
|
213
|
+
* whole disclosure pattern; the chevron only draws what it already says.
|
|
214
|
+
*/
|
|
215
|
+
const DISCLOSURE_HEADER = {
|
|
216
|
+
display: "flex",
|
|
217
|
+
alignItems: "center",
|
|
218
|
+
gap: spacing[1],
|
|
219
|
+
width: "100%",
|
|
220
|
+
padding: 0,
|
|
221
|
+
border: "none",
|
|
222
|
+
background: "none",
|
|
223
|
+
color: "inherit",
|
|
224
|
+
font: "inherit",
|
|
225
|
+
textAlign: "start",
|
|
226
|
+
cursor: "pointer",
|
|
227
|
+
};
|
|
228
|
+
/** The disclosure's state, drawn. Points down over a closed group ("there is
|
|
229
|
+
* more below") and flips once it is open. */
|
|
230
|
+
function ChevronGlyph(props) {
|
|
231
|
+
return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", role: "img", "aria-hidden": "true", focusable: "false", style: {
|
|
232
|
+
marginInlineStart: "auto",
|
|
233
|
+
flex: "0 0 auto",
|
|
234
|
+
...(props.open ? { transform: "rotate(180deg)" } : {}),
|
|
235
|
+
}, children: _jsx("path", { d: "m6 9 6 6 6-6" }) }));
|
|
236
|
+
}
|
|
157
237
|
export function FacetGroupControl(props) {
|
|
158
238
|
const t = useT();
|
|
159
239
|
const { group } = props;
|
|
160
240
|
const [expanded, setExpanded] = useState(false);
|
|
241
|
+
const [openState, setOpenState] = useState(props.defaultOpen !== false);
|
|
161
242
|
const shape = facetGroupShape(group);
|
|
162
243
|
const nodes = facetOptionNodes(group);
|
|
244
|
+
const disclosure = props.collapsible === true && props.heading !== false;
|
|
245
|
+
const open = !disclosure || openState;
|
|
163
246
|
const limit = props.visibleOptions === null
|
|
164
247
|
? null
|
|
165
248
|
: (props.visibleOptions ?? FACET_VISIBLE_OPTIONS);
|
|
249
|
+
// The demoted tail `facetOptionNodes` sorted to the end: uncounted,
|
|
250
|
+
// unchosen options in a group that has counted evidence. They are ALWAYS
|
|
251
|
+
// behind the fold — the "one row over the limit" exemption below is about
|
|
252
|
+
// not hiding one counted row, and these rows say "not counted".
|
|
253
|
+
const demoted = group.options.some((option) => option.count !== null)
|
|
254
|
+
? nodes.filter(uncountedUnchosen).length
|
|
255
|
+
: 0;
|
|
166
256
|
// A group one row over the limit is not truncated: hiding a single option
|
|
167
257
|
// behind "Show all (9)" costs a tap to reveal exactly one thing.
|
|
168
|
-
const
|
|
169
|
-
const shown =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
258
|
+
const folded = limit !== null && (nodes.length > limit + 1 || demoted > 0);
|
|
259
|
+
const shown = folded && !expanded
|
|
260
|
+
? nodes.slice(0, Math.min(limit ?? nodes.length, nodes.length - demoted))
|
|
261
|
+
: nodes;
|
|
262
|
+
return (_jsxs(Flex, { vertical: true, gap: shape === "segmented" ? spacing[2] : spacing[1], "data-testid": `facet-group-${group.slug}`, "data-counted": group.counted ? "true" : "false", "data-shape": shape, children: [props.heading !== false &&
|
|
263
|
+
(disclosure ? (_jsxs("button", { type: "button", style: DISCLOSURE_HEADER, "aria-expanded": open, "data-testid": `facet-toggle-${group.slug}`, "data-analytics": "none", "data-analytics-reason": "opening a filter group is a read, not a flow step", onClick: () => {
|
|
264
|
+
setOpenState((was) => !was);
|
|
265
|
+
}, children: [_jsx(Typography.Text, { strong: true, children: group.label }), group.selected.length > 0 && (_jsx(Typography.Text, { type: "secondary", "data-testid": `facet-toggle-count-${group.slug}`, children: group.selected.length })), _jsx(ChevronGlyph, { open: open })] })) : (_jsx(Typography.Text, { strong: true, children: group.label }))), open && (_jsxs(_Fragment, { children: [shape === "segmented" ? (_jsx(Flex, { wrap: true, gap: spacing[2], children: shown.map((node) => (_jsx(OptionPill, { group: group, option: node.option, onToggle: props.onToggle }, node.option.value))) })) : (shown.map((node) => (_jsx(CheckboxRow, { group: group, node: node, onToggle: props.onToggle }, node.option.value)))), folded && (_jsx(Button, { type: "link", size: "small", style: { alignSelf: "flex-start", paddingInline: 0 }, "data-testid": `facet-more-${group.slug}`, "data-analytics": "none", "data-analytics-reason": "expanding a filter group is a read, not a flow step", onClick: () => {
|
|
266
|
+
setExpanded((was) => !was);
|
|
267
|
+
}, children: expanded
|
|
268
|
+
? t(SEARCH_I18N_KEYS.facetsShowLess)
|
|
269
|
+
: t(SEARCH_I18N_KEYS.facetsShowAll, { count: nodes.length }) }))] }))] }));
|
|
175
270
|
}
|
|
176
271
|
//# sourceMappingURL=FacetGroupControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetGroupControl.js","sourceRoot":"","sources":["../../src/default/FacetGroupControl.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"FacetGroupControl.js","sourceRoot":"","sources":["../../src/default/FacetGroupControl.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAYvC,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,YAAY,CACnB,GAAY,EACZ,KAAK,GAAG,CAAC,EACT,OAA4B,IAAI,GAAG,EAAE;IAErC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,KAAK,MAAM,MAAM,IAAI,GAAG,EAAE,CAAC;QACzB,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,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AAI,EAAE,EAAE,CAAC,CACnB,KAAC,UAAU,IAET,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAHnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAItB,CACH,CAAC,GACG,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAClB,KAAC,WAAW,IAEV,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAHnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAItB,CACH,CAAC,CACH,EAEA,MAAM,IAAI,CACT,KAAC,MAAM,IACL,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,EAAE,iBACvC,cAAc,KAAK,CAAC,IAAI,EAAE,oBACxB,MAAM,2BACC,qDAAqD,EAC3E,OAAO,EAAE,GAAG,EAAE;4BACZ,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;wBAC7B,CAAC,YAEA,QAAQ;4BACP,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,cAAc,CAAC;4BACpC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,GACvD,CACV,IACA,CACJ,IACI,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,46 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<FacetPanelPane>` — the antd FILTER panel: everything that narrows a
|
|
3
|
-
* search, in the order a person narrows it.
|
|
4
|
-
*
|
|
5
|
-
* Category → language → location → numeric ranges → facet checkboxes. The last
|
|
6
|
-
* of those was, for three releases, the only one that existed: six of the nine
|
|
7
|
-
* state setters had no control at all, so a price range or a location could
|
|
8
|
-
* only be applied by editing the address bar (audit S-2, S-7).
|
|
9
|
-
*
|
|
10
|
-
* Three things it is obliged to render, all of which a naive panel drops:
|
|
11
|
-
*
|
|
12
|
-
* - the count NEXT TO EVERY OPTION, including the ones you have not chosen.
|
|
13
|
-
* Facets are counted with their own filter removed, so those numbers are
|
|
14
|
-
* "what you would get by switching to this instead" — a sibling that shows
|
|
15
|
-
* a stale or zeroed count has converted a drill-down facet into a naive one.
|
|
16
|
-
* - `approximate` — said in words, from the first day, because the counts
|
|
17
|
-
* genuinely are a sample above the backend's candidate cap.
|
|
18
|
-
* - `skipped` — the slugs the server did not count at all. Their options show
|
|
19
|
-
* "not counted", never `0`. A silent zero there is the same defect class as
|
|
20
|
-
* `data ?? []`: a number that looks like an answer and is not one. The
|
|
21
|
-
* facet itself is still DRAWN, from the category schema, because the server
|
|
22
|
-
* filters on a slug it never counted; the engine's own list of skipped
|
|
23
|
-
* slugs is a developer's note and lives behind `skippedNotice`.
|
|
24
|
-
*
|
|
25
|
-
* ── Two slots, and why they are slots ─────────────────────────────────────
|
|
26
|
-
*
|
|
27
|
-
* `renderCategoryFilter` and `renderGeoFilter` are filled by OTHER pairs:
|
|
28
|
-
* choosing a category means walking the catalogue tree (`categories-react`),
|
|
29
|
-
* and turning an address into a coordinate needs a geocoder and a map
|
|
30
|
-
* (`geo-react`). Neither belongs in a search package, and importing either
|
|
31
|
-
* would tie a storefront's search to a catalogue it might not have.
|
|
32
|
-
*
|
|
33
|
-
* What this panel does NOT do is pretend the slot is optional. An unfilled
|
|
34
|
-
* slot renders `SlotPlaceholder` in development — a named, visible hole rather
|
|
35
|
-
* than a silent absence — and, in every build, any constraint the URL already
|
|
36
|
-
* carries gets a control that REMOVES it. A shared link that narrows to a
|
|
37
|
-
* category or a point must never leave a person with no way to widen it again.
|
|
38
|
-
*/
|
|
39
1
|
import type { ReactElement, ReactNode } from "react";
|
|
40
2
|
import type { FeatureDef } from "@stapel/attributes-react";
|
|
41
3
|
import type { SearchGeo } from "../api/types.js";
|
|
42
4
|
import type { FacetLabelResolver } from "../headless/useFacetLabels.js";
|
|
43
5
|
import type { ThemeModeProp } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* How many counted groups open by default — beyond the ones with chosen
|
|
8
|
+
* values, which always do. Five open groups at the default type step fill
|
|
9
|
+
* roughly one 900px window of the rail: the panel's first screen is the five
|
|
10
|
+
* axes this corpus is most narrowed by, and everything after is a header.
|
|
11
|
+
*/
|
|
12
|
+
export declare const FACET_OPEN_GROUPS = 5;
|
|
13
|
+
/**
|
|
14
|
+
* From how many groups the panel offers a search of itself. Under six the
|
|
15
|
+
* headers fit a glance and a box would be chrome over nothing; the measured
|
|
16
|
+
* leaf had forty.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FACET_SEARCH_THRESHOLD = 6;
|
|
44
19
|
/** What a host's category control is handed. */
|
|
45
20
|
export interface CategoryFilterSlotProps {
|
|
46
21
|
/** The `root/leaf` path the search is narrowed to, if any. */
|
|
@@ -126,6 +101,18 @@ export interface FacetPanelPaneProps extends ThemeModeProp {
|
|
|
126
101
|
* on a staging surface. Nothing else changes with it.
|
|
127
102
|
*/
|
|
128
103
|
readonly skippedNotice?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Draw the sticky footer inside the panel: the live result count as the
|
|
106
|
+
* bar's strong text, and the clear-all control (which then moves out of the
|
|
107
|
+
* heading row — one control, not two) beside it. Default `false`.
|
|
108
|
+
*
|
|
109
|
+
* `<SearchPage>` turns it on for the desktop RAIL only. Desktop filters
|
|
110
|
+
* apply instantly, so the bar is FEEDBACK plus the way out, not an apply
|
|
111
|
+
* button — which is exactly why the phone sheet must not get it: the sheet
|
|
112
|
+
* already closes through its own "Show N results" footer, and a second
|
|
113
|
+
* count-bearing bar above that one would be the same sentence twice.
|
|
114
|
+
*/
|
|
115
|
+
readonly footerBar?: boolean;
|
|
129
116
|
}
|
|
130
117
|
/**
|
|
131
118
|
* What a location constraint is called when the host handed down no name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetPanelPane.d.ts","sourceRoot":"","sources":["../../src/default/FacetPanelPane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FacetPanelPane.d.ts","sourceRoot":"","sources":["../../src/default/FacetPanelPane.tsx"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAoBpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAUxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA2DhD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAClD;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD;;sEAEkE;IAClE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CA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