@stapel/search-react 0.11.0 → 0.13.0

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/MODULE.md +118 -3
  3. package/README.md +42 -0
  4. package/dist/api/generated/schema.d.ts +60 -6
  5. package/dist/api/generated/schema.d.ts.map +1 -1
  6. package/dist/api/searchApi.d.ts +13 -6
  7. package/dist/api/searchApi.d.ts.map +1 -1
  8. package/dist/api/searchApi.js.map +1 -1
  9. package/dist/api/types.d.ts +107 -1
  10. package/dist/api/types.d.ts.map +1 -1
  11. package/dist/api/types.js +29 -0
  12. package/dist/api/types.js.map +1 -1
  13. package/dist/default/FacetPanelPane.d.ts +13 -2
  14. package/dist/default/FacetPanelPane.d.ts.map +1 -1
  15. package/dist/default/FacetPanelPane.js +3 -1
  16. package/dist/default/FacetPanelPane.js.map +1 -1
  17. package/dist/default/FilterChips.d.ts +88 -3
  18. package/dist/default/FilterChips.d.ts.map +1 -1
  19. package/dist/default/FilterChips.js +161 -13
  20. package/dist/default/FilterChips.js.map +1 -1
  21. package/dist/default/LocationSummaryLine.d.ts.map +1 -1
  22. package/dist/default/LocationSummaryLine.js +1 -1
  23. package/dist/default/LocationSummaryLine.js.map +1 -1
  24. package/dist/default/SearchBox.d.ts.map +1 -1
  25. package/dist/default/SearchBox.js +74 -4
  26. package/dist/default/SearchBox.js.map +1 -1
  27. package/dist/default/SearchPage.d.ts +29 -1
  28. package/dist/default/SearchPage.d.ts.map +1 -1
  29. package/dist/default/SearchPage.js +25 -10
  30. package/dist/default/SearchPage.js.map +1 -1
  31. package/dist/default/SearchResultCard.d.ts.map +1 -1
  32. package/dist/default/SearchResultCard.js +83 -37
  33. package/dist/default/SearchResultCard.js.map +1 -1
  34. package/dist/default/SearchResultsPane.d.ts +22 -0
  35. package/dist/default/SearchResultsPane.d.ts.map +1 -1
  36. package/dist/default/SearchResultsPane.js +2 -2
  37. package/dist/default/SearchResultsPane.js.map +1 -1
  38. package/dist/default/SortSelect.d.ts +23 -0
  39. package/dist/default/SortSelect.d.ts.map +1 -1
  40. package/dist/default/SortSelect.js +29 -9
  41. package/dist/default/SortSelect.js.map +1 -1
  42. package/dist/default/cardPhotos.d.ts +65 -0
  43. package/dist/default/cardPhotos.d.ts.map +1 -0
  44. package/dist/default/cardPhotos.js +127 -0
  45. package/dist/default/cardPhotos.js.map +1 -0
  46. package/dist/default/index.d.ts +2 -2
  47. package/dist/default/index.d.ts.map +1 -1
  48. package/dist/default/index.js +1 -1
  49. package/dist/default/index.js.map +1 -1
  50. package/dist/headless/FacetPanel.d.ts +10 -0
  51. package/dist/headless/FacetPanel.d.ts.map +1 -1
  52. package/dist/headless/FacetPanel.js +9 -1
  53. package/dist/headless/FacetPanel.js.map +1 -1
  54. package/dist/headless/useFacetLabels.d.ts +39 -0
  55. package/dist/headless/useFacetLabels.d.ts.map +1 -0
  56. package/dist/headless/useFacetLabels.js +129 -0
  57. package/dist/headless/useFacetLabels.js.map +1 -0
  58. package/dist/headless/useSearchBox.d.ts +71 -0
  59. package/dist/headless/useSearchBox.d.ts.map +1 -1
  60. package/dist/headless/useSearchBox.js +67 -2
  61. package/dist/headless/useSearchBox.js.map +1 -1
  62. package/dist/i18n/es.d.ts.map +1 -1
  63. package/dist/i18n/es.js +10 -0
  64. package/dist/i18n/es.js.map +1 -1
  65. package/dist/i18n/keys.d.ts +55 -0
  66. package/dist/i18n/keys.d.ts.map +1 -1
  67. package/dist/i18n/keys.js +67 -0
  68. package/dist/i18n/keys.js.map +1 -1
  69. package/dist/i18n/ru.d.ts.map +1 -1
  70. package/dist/i18n/ru.js +12 -0
  71. package/dist/i18n/ru.js.map +1 -1
  72. package/dist/index.d.ts +7 -5
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +4 -3
  75. package/dist/index.js.map +1 -1
  76. package/dist/model/queries.d.ts +6 -5
  77. package/dist/model/queries.d.ts.map +1 -1
  78. package/dist/model/queries.js +4 -3
  79. package/dist/model/queries.js.map +1 -1
  80. package/dist/model/queryKeys.d.ts +12 -0
  81. package/dist/model/queryKeys.d.ts.map +1 -1
  82. package/dist/model/queryKeys.js +7 -0
  83. package/dist/model/queryKeys.js.map +1 -1
  84. package/dist/model/runtime.d.ts +40 -3
  85. package/dist/model/runtime.d.ts.map +1 -1
  86. package/dist/model/runtime.js +2 -1
  87. package/dist/model/runtime.js.map +1 -1
  88. package/dist/nav/manifest.d.ts +21 -0
  89. package/dist/nav/manifest.d.ts.map +1 -1
  90. package/dist/nav/manifest.js +3 -2
  91. package/dist/nav/manifest.js.map +1 -1
  92. package/dist/state/facets.d.ts +56 -15
  93. package/dist/state/facets.d.ts.map +1 -1
  94. package/dist/state/facets.js +101 -27
  95. package/dist/state/facets.js.map +1 -1
  96. package/llms.txt +3 -3
  97. package/manifest.json +33 -4
  98. package/nav-manifest.json +4 -3
  99. package/package.json +11 -11
  100. package/src/analytics/generated/events.json +1 -1
  101. package/src/api/generated/schema.ts +60 -6
  102. package/src/api/searchApi.ts +13 -6
  103. package/src/api/types.ts +115 -1
  104. package/src/default/FacetPanelPane.tsx +16 -2
  105. package/src/default/FilterChips.tsx +285 -38
  106. package/src/default/LocationSummaryLine.tsx +6 -1
  107. package/src/default/SearchBox.tsx +134 -6
  108. package/src/default/SearchPage.tsx +79 -5
  109. package/src/default/SearchResultCard.tsx +157 -71
  110. package/src/default/SearchResultsPane.tsx +48 -11
  111. package/src/default/SortSelect.tsx +70 -9
  112. package/src/default/cardPhotos.ts +195 -0
  113. package/src/default/index.ts +10 -2
  114. package/src/headless/FacetPanel.tsx +20 -1
  115. package/src/headless/useFacetLabels.ts +172 -0
  116. package/src/headless/useSearchBox.ts +132 -5
  117. package/src/i18n/es.ts +11 -0
  118. package/src/i18n/keys.ts +69 -0
  119. package/src/i18n/ru.ts +13 -0
  120. package/src/index.ts +22 -3
  121. package/src/model/queries.ts +6 -5
  122. package/src/model/queryKeys.ts +23 -0
  123. package/src/model/runtime.ts +43 -4
  124. package/src/nav/manifest.ts +24 -2
  125. package/src/state/facets.ts +123 -39
@@ -20,8 +20,114 @@ export type SearchItem = Schemas["SearchItem"];
20
20
  /** The honesty block beside the counts: `approximate`, `candidates`,
21
21
  * `counted`, `skipped`. Rendered, never swallowed (spec §4.2). */
22
22
  export type FacetMeta = Schemas["FacetMeta"];
23
- /** `GET /suggest` 200. */
23
+ /** `GET /suggest` 200, as the CURRENT generated schema describes it. */
24
24
  export type SuggestResponse = Schemas["SuggestResponse"];
25
+ /**
26
+ * How a category's name matched the typed prefix. Informational — the server
27
+ * ranks by `count`, never by this.
28
+ */
29
+ export type SuggestCategoryMatch = "prefix" | "substring";
30
+ /**
31
+ * One CATEGORY the type-ahead offers: a destination, not a search term.
32
+ *
33
+ * A classified's search box is a navigation control before it is a text
34
+ * filter. "Shorts" is not one destination but three — men's, women's,
35
+ * children's — and the only things that let a buyer pick between them are the
36
+ * ancestor path and how many live listings sit behind each. Both are here,
37
+ * and neither can be computed on the client: the count is one aggregate over
38
+ * the index, and a client-side matcher over a fetched tree would have the
39
+ * names and no numbers.
40
+ */
41
+ export interface SuggestCategory {
42
+ readonly id: number;
43
+ readonly slug: string;
44
+ /** The category's own display name. */
45
+ readonly name: string;
46
+ /**
47
+ * Display names root→leaf, e.g. `["Menswear", "Shorts"]` — this is what
48
+ * distinguishes three categories sharing a name, and it is what a row has
49
+ * to print.
50
+ */
51
+ readonly path: readonly string[];
52
+ /**
53
+ * The ancestry as ids joined with `/`, ready to pass VERBATIM as the
54
+ * `category` parameter of `/query`.
55
+ *
56
+ * The server serves the joined string rather than only the segments
57
+ * precisely so that a client cannot invent a different join and silently
58
+ * miss — so nothing in this pair rebuilds it from {@link path} or
59
+ * {@link slug}.
60
+ */
61
+ readonly category: string;
62
+ /**
63
+ * Live listings a buyer would see under this category, descendants
64
+ * included — the same number the SERP reports for it.
65
+ */
66
+ readonly count: number;
67
+ /** Number of segments in {@link path}. */
68
+ readonly depth: number;
69
+ readonly match: SuggestCategoryMatch;
70
+ }
71
+ /**
72
+ * The `/suggest` answer this pair actually reads.
73
+ *
74
+ * GENERATOR NOTE, and the reason this is not `Schemas["SuggestResponse"]`:
75
+ * the generated type describes ONE server. stapel-search 0.7.0 made the answer
76
+ * three-part — `categories`, `terms`, and `items` as a deprecated alias of
77
+ * `terms` — plus `language` and `degraded`, and declares all five REQUIRED,
78
+ * which is true of a 0.7.0 answer and false of every answer sent by the
79
+ * servers a storefront is also deployed against.
80
+ *
81
+ * Every member but `backend` is therefore OPTIONAL here, which is not
82
+ * sloppiness but the deployment story: a storefront ships against whichever
83
+ * server is actually running, an older one sends no `categories` key at all,
84
+ * and "the key is absent" has to read as "this server offers no destinations"
85
+ * rather than as a crash or as an empty group under a heading. A pair typed
86
+ * against the required-field version would compile while reading `undefined`
87
+ * from a field the compiler swore was there.
88
+ */
89
+ export interface SuggestAnswer {
90
+ readonly backend: string;
91
+ /** Destinations, ranked by live listing count desc, then depth, then name. */
92
+ readonly categories?: readonly SuggestCategory[];
93
+ /** Title prefixes from the index. */
94
+ readonly terms?: readonly string[];
95
+ /** Deprecated alias of {@link terms}, and the only half a pre-0.7.0 server
96
+ * sends. Read through {@link suggestTerms}, never directly. */
97
+ readonly items?: readonly string[];
98
+ /** Which dictionary answered — the same resolution `/query` reports. */
99
+ readonly language?: string;
100
+ /** What this answer could not do — see {@link SUGGEST_DEGRADED_CATEGORIES}
101
+ * and {@link SUGGEST_DEGRADED_ROLLUP}. */
102
+ readonly degraded?: readonly string[];
103
+ }
104
+ /**
105
+ * The suggest answer had NO category provider, so the categories half is
106
+ * empty for a reason that is not "nothing matched".
107
+ *
108
+ * A dropdown has no room for a sentence about a provider being down, and the
109
+ * person reading it is mid-word. So the group is ABSENT rather than empty —
110
+ * an empty group under a heading is the box claiming the catalogue has no
111
+ * section by that name, which is a different and untrue statement.
112
+ */
113
+ export declare const SUGGEST_DEGRADED_CATEGORIES = "category_suggestions";
114
+ /**
115
+ * Ancestry never arrived, so every stored path is one segment long and every
116
+ * count would read `0`.
117
+ *
118
+ * The rows are still destinations and still worth offering; their COUNTS are
119
+ * the part that is not an answer, so a surface drops the number rather than
120
+ * printing a catalogue of zeros.
121
+ */
122
+ export declare const SUGGEST_DEGRADED_ROLLUP = "category_rollup";
123
+ /**
124
+ * The term half of a suggest answer, from whichever key this server sends.
125
+ *
126
+ * `terms` is 0.7.0's name and `items` is the deprecated alias kept for one
127
+ * minor; a client that read only one of them would go blank against half the
128
+ * servers in the fleet.
129
+ */
130
+ export declare function suggestTerms(answer: SuggestAnswer | undefined): readonly string[];
25
131
  /** `GET /ranking` 200 — the P2B Art. 5 disclosure. */
26
132
  export type RankingResponse = Schemas["RankingResponse"];
27
133
  /** One ranking parameter of the disclosure. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,4EAA4E;AAC5E,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAE5C,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEvD;;0EAE0E;AAC1E,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE/C;kEACkE;AAClE,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7C,0BAA0B;AAC1B,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEzD,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEzD,+CAA+C;AAC/C,MAAM,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE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I,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,GACb,oBAAoB,GACpB,iBAAiB,GACjB,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC;4EACwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
package/dist/api/types.js CHANGED
@@ -1,3 +1,32 @@
1
+ /**
2
+ * The suggest answer had NO category provider, so the categories half is
3
+ * empty for a reason that is not "nothing matched".
4
+ *
5
+ * A dropdown has no room for a sentence about a provider being down, and the
6
+ * person reading it is mid-word. So the group is ABSENT rather than empty —
7
+ * an empty group under a heading is the box claiming the catalogue has no
8
+ * section by that name, which is a different and untrue statement.
9
+ */
10
+ export const SUGGEST_DEGRADED_CATEGORIES = "category_suggestions";
11
+ /**
12
+ * Ancestry never arrived, so every stored path is one segment long and every
13
+ * count would read `0`.
14
+ *
15
+ * The rows are still destinations and still worth offering; their COUNTS are
16
+ * the part that is not an answer, so a surface drops the number rather than
17
+ * printing a catalogue of zeros.
18
+ */
19
+ export const SUGGEST_DEGRADED_ROLLUP = "category_rollup";
20
+ /**
21
+ * The term half of a suggest answer, from whichever key this server sends.
22
+ *
23
+ * `terms` is 0.7.0's name and `items` is the deprecated alias kept for one
24
+ * minor; a client that read only one of them would go blank against half the
25
+ * servers in the fleet.
26
+ */
27
+ export function suggestTerms(answer) {
28
+ return answer?.terms ?? answer?.items ?? [];
29
+ }
1
30
  /**
2
31
  * The sorts stapel-search ships (`conf.py::DEFAULT_SORTS`).
3
32
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAoCA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,UAAU;CACX,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAgHA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAiC;IAC5D,OAAO,MAAM,EAAE,KAAK,IAAI,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAC9C,CAAC;AAQD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,WAAW;IACX,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,UAAU;CACX,CAAC"}
@@ -36,6 +36,7 @@
36
36
  import type { ReactElement, ReactNode } from "react";
37
37
  import type { FeatureDef } from "@stapel/attributes-react";
38
38
  import type { SearchGeo } from "../api/types.js";
39
+ import type { FacetLabelResolver } from "../headless/useFacetLabels.js";
39
40
  import type { ThemeModeProp } from "./types.js";
40
41
  /** What a host's category control is handed. */
41
42
  export interface CategoryFilterSlotProps {
@@ -51,11 +52,21 @@ export interface GeoFilterSlotProps {
51
52
  readonly onChange: (geo: SearchGeo | null) => void;
52
53
  }
53
54
  export interface FacetPanelPaneProps extends ThemeModeProp {
54
- /** The category's feature schema — the source of option LABELS and of which
55
- * slugs get a numeric range row. */
55
+ /** The category's feature schema — the source of option LABELS, of which
56
+ * slugs get a numeric range row, and of which slugs are a filter at all
57
+ * (`isFacetableFeature`: an `imei` is counted and is not one). */
56
58
  readonly categoryFeatures?: readonly FeatureDef[];
57
59
  readonly locale?: string;
58
60
  readonly enabled?: boolean;
61
+ /**
62
+ * Name the values neither the answer nor the schema names — see
63
+ * {@link FacetLabelResolver}. A `ref_select` facet carries only a pointer to
64
+ * a vocabulary in its config, and the vocabulary is the host's to read.
65
+ *
66
+ * The same prop reaches `<FilterChips>` from `<SearchPage>`, so the panel
67
+ * and the chip row cannot print two different words for one value.
68
+ */
69
+ readonly resolveFacetLabels?: FacetLabelResolver;
59
70
  /** The catalogue picker (`categories-react`'s `CategoryPickerField`, bound
60
71
  * to a path). Unfilled, an active category still gets a "clear" control. */
61
72
  readonly renderCategoryFilter?: (slot: CategoryFilterSlotProps) => ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"FacetPanelPane.d.ts","sourceRoot":"","sources":["../../src/default/FacetPanelPane.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,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,CA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,EAAE,SAAS,CAAC;CAC9B;AAiDD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GACzB,MAAM,CAIR;AAuHD,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,CAgKvE"}
@@ -124,7 +124,9 @@ export function FacetPanelPane(props) {
124
124
  const { state } = useSearchState();
125
125
  return (_jsx(SkinTheme, { ...(props.mode !== undefined ? { mode: props.mode } : {}), children: _jsx(FacetPanel, { ...(props.categoryFeatures !== undefined
126
126
  ? { categoryFeatures: props.categoryFeatures }
127
- : {}), ...(props.locale !== undefined ? { locale: props.locale } : {}), ...(props.enabled !== undefined ? { enabled: props.enabled } : {}), children: (bag) => {
127
+ : {}), ...(props.locale !== undefined ? { locale: props.locale } : {}), ...(props.enabled !== undefined ? { enabled: props.enabled } : {}), ...(props.resolveFacetLabels !== undefined
128
+ ? { resolveFacetLabels: props.resolveFacetLabels }
129
+ : {}), children: (bag) => {
128
130
  // Built INSIDE the bag, because which axes exist is a property of
129
131
  // the ANSWER now: `facet_meta.core_ranges` names the core columns
130
132
  // this server can actually filter on (`r.price`), and the corpus
@@ -1 +1 @@
1
- {"version":3,"file":"FacetPanelPane.js","sourceRoot":"","sources":["../../src/default/FacetPanelPane.tsx"],"names":[],"mappings":";AAoCA,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,WAAW,EACX,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;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AAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;6BAC5D,CAAC,GACF,CACH,EAED,KAAC,QAAQ,IACP,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,MAAM,EAAC,QAAQ,EACf,YAAY,EAAE,CAAC,EACf,KAAK,EAAE,KAAC,UAAU,IAAC,OAAO,QAAC,KAAK,EAAE,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,EAAC,cAAc,GAAG,EAC3F,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CACjB,KAAC,UAAU,IACT,MAAM,EAAC,eAAe,EACtB,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,GAC7C,CACH,YAEA,CAAC,MAAM,EAAE,EAAE,CAAC,CACX,MAAC,IAAI,IAAC,QAAQ,QAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,aAa3B,MAAM;yCACJ,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;yCAC3C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACd,KAAC,iBAAiB,IAEhB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,GAAG,CAAC,MAAM,IAFf,KAAK,CAAC,IAAI,CAGf,CACH,CAAC,EACJ,KAAC,UAAU,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,YAC9B,CAAC,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,GACxB,IACb,CACR,GACQ,IACN,CACN,CAAC;YACJ,CAAC,GACU,GACH,CACb,CAAC;AACJ,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import type { FeatureDef } from "@stapel/attributes-react";
3
- import type { GeoFilterSlotProps } from "./FacetPanelPane.js";
3
+ import type { FacetLabelResolver } from "../headless/useFacetLabels.js";
4
+ import type { RangeGroup } from "../state/ranges.js";
5
+ import type { FacetGroup } from "../state/facets.js";
6
+ import type { CategoryFilterSlotProps, GeoFilterSlotProps } from "./FacetPanelPane.js";
4
7
  /** The class the scroller carries, for {@link chipRowCss}. */
5
8
  export declare const CHIP_ROW_CLASS = "stapel-filter-chips";
6
9
  /** The `href` the hoisted chip-row stylesheet is deduplicated by. */
@@ -11,11 +14,72 @@ export declare const CHIP_ROW_STYLE_HREF = "stapel-search-filter-chips";
11
14
  * copy serves the document.
12
15
  */
13
16
  export declare function chipRowCss(): string;
17
+ /**
18
+ * The three bands the row's non-slot chips fall into, most-evidenced first.
19
+ *
20
+ * `core_range` is the SERVER's own declaration (`facet_meta.core_ranges`) that
21
+ * an axis exists for every document in every category. `facet` is a group the
22
+ * server COUNTED for this search, which arrives with the remaining counts that
23
+ * make it a drill-down. `attribute_range` is a numeric field the category
24
+ * declares and nothing ranks — see this module's ordering note.
25
+ */
26
+ export type ChipBand = "core_range" | "facet" | "attribute_range";
27
+ /** Band order, stated once. */
28
+ export declare const CHIP_BAND_ORDER: readonly ChipBand[];
29
+ /** One non-slot chip, resolved to the band and the applied state it sorts by. */
30
+ export type ChipSpec = {
31
+ readonly band: "core_range" | "attribute_range";
32
+ readonly range: RangeGroup;
33
+ } | {
34
+ readonly band: "facet";
35
+ readonly facet: FacetGroup;
36
+ };
37
+ /**
38
+ * The row's order: applied first, then band, then the order each source
39
+ * already came in.
40
+ *
41
+ * Exported because the order IS the fix — the defect it closes is invisible to
42
+ * a test that only asks whether a chip exists, and a rule stated in prose next
43
+ * to an unexercised implementation is a rule that drifts.
44
+ *
45
+ * `Array.prototype.sort` is stable in every runtime this pair supports, so
46
+ * equal-ranked chips keep the order `buildRangeGroups` and `buildFacetGroups`
47
+ * gave them — a closed set's authored order survives all the way to the row.
48
+ */
49
+ export declare function orderChipFilters(ranges: readonly RangeGroup[], facets: readonly FacetGroup[]): readonly ChipSpec[];
14
50
  export interface FilterChipsProps {
15
51
  /** The category's feature schema — the source of option labels, of which
16
- * slugs get a range chip, and of how each group is drawn. */
52
+ * slugs get a range chip, of which slugs are choosable at all, and of how
53
+ * each group is drawn. */
17
54
  readonly categoryFeatures?: readonly FeatureDef[];
18
55
  readonly locale?: string;
56
+ /**
57
+ * Name the values neither the answer nor the schema names — see
58
+ * {@link FacetLabelResolver}. The same prop reaches the filter panel, so a
59
+ * value cannot read one way on a chip and another way inside the sheet.
60
+ */
61
+ readonly resolveFacetLabels?: FacetLabelResolver;
62
+ /**
63
+ * The catalogue picker (`categories-react`), same slot the panel takes.
64
+ *
65
+ * Filled, it becomes the row's LEADING chip and opens in the same sheet as
66
+ * every other chip. Unfilled, the row draws no category chip at all — and
67
+ * that is not a constraint left without a control: the whole panel is one
68
+ * tap away behind the leading circle, and it carries the "search the whole
69
+ * catalogue" button for a link that arrived narrowed.
70
+ */
71
+ readonly renderCategoryFilter?: (slot: CategoryFilterSlotProps) => ReactNode;
72
+ /**
73
+ * What the current category is CALLED, in words.
74
+ *
75
+ * The pair holds a `root/leaf` PATH of slugs and nothing that turns one into
76
+ * a catalogue name — the tree belongs to `categories-react`, and whoever
77
+ * rendered the picker has the name already. Absent, the chip falls back to
78
+ * the path's last segment, which is the honest half-answer: it is what the
79
+ * search is actually narrowed to, it fits a 390px row where the whole path
80
+ * does not, and it is never invented.
81
+ */
82
+ readonly categoryLabel?: ReactNode;
19
83
  /** The location control (`geo-react`), same slot the panel takes. Without
20
84
  * it the location chip appears only when the URL already carries a point,
21
85
  * so a shared link can still be widened. */
@@ -32,6 +96,27 @@ export interface FilterChipsProps {
32
96
  /** Open the whole panel — the leading chip's action. The page owns that
33
97
  * sheet, because the page is the surface it covers. */
34
98
  readonly onOpenAll: () => void;
99
+ /**
100
+ * Draw the location chip. Default `true`.
101
+ *
102
+ * `false` for a surface that already states the location ABOVE this row —
103
+ * `<LocationSummaryLine>` is that surface, and the phone SERP mounts both.
104
+ * Together they printed two location controls one line apart — the summary
105
+ * sentence over the chip's own prompt — opening two different sheets over
106
+ * one filter, which is the same constraint asked about twice.
107
+ */
108
+ readonly geoChip?: boolean;
35
109
  }
36
- export declare function FilterChips(props: FilterChipsProps): ReactElement;
110
+ /**
111
+ * The last segment of a `root/leaf` category path.
112
+ *
113
+ * A chip has room for one word, and the whole path is what the panel prints on
114
+ * a surface with a column to spend. This is the pair's LAST resort — a host
115
+ * that renders the picker knows the catalogue's own name for the node and
116
+ * passes `categoryLabel` — but it is a real narrowing stated with a value the
117
+ * URL genuinely carries, which is the line the geo chip draws too: never print
118
+ * a coordinate, always print the name you actually have.
119
+ */
120
+ export declare function categoryLeaf(path: string): string;
121
+ export declare function FilterChips(props: FilterChipsProps): ReactElement | null;
37
122
  //# sourceMappingURL=FilterChips.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterChips.d.ts","sourceRoot":"","sources":["../../src/default/FilterChips.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAS3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,8DAA8D;AAC9D,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAKnC;AAqBD,MAAM,WAAW,gBAAgB;IAC/B;iEAC6D;IAC7D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;gDAE4C;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IA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B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,MAAM,EAAE,SAAS,UAAU,EAAE,GAC5B,SAAS,QAAQ,EAAE,CAerB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;8BAE0B;IAC1B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACjD;;;;;;;;OAQG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,SAAS,CAAC;IAC7E;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC;IACnC;;gDAE4C;IAC5C,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B;2DACuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAiBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAkRxE"}
@@ -42,11 +42,69 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
42
42
  *
43
43
  * ## The library is not inventing a classified's filters
44
44
  *
45
- * A chip exists for each facet group the SERVER returned, each numeric range
46
- * the CATEGORY SCHEMA declares, and the location plus the leading
47
- * "all filters" chip. Nothing here knows what a "brand" or a "mileage" is;
48
- * a deployment with three facets gets three chips and a deployment with none
49
- * gets the leading chip alone.
45
+ * A chip exists for each facet group the SERVER returned AND the category
46
+ * schema types as choosable (`isFacetableFeature` an `imei` is counted and
47
+ * is not a filter), each numeric range the CATEGORY SCHEMA declares, the
48
+ * location, and the host's category control plus the leading "all filters"
49
+ * chip. Nothing here knows what a "brand" or a "mileage" is; a deployment with
50
+ * three facets gets three chips and a deployment with none gets the leading
51
+ * chip alone.
52
+ *
53
+ * ## The ORDER of the row is the whole product
54
+ *
55
+ * At 390px a person sees roughly four chips before the fold, and everything
56
+ * past them costs a horizontal flick most people never make. On a live phone
57
+ * category the first seven were battery health, four parcel dimensions and two
58
+ * wholesale counts — every one of them a numeric ATTRIBUTE the category
59
+ * happens to declare, drawn before the condition, the vendor and the model
60
+ * anybody actually narrows by, and before the price.
61
+ *
62
+ * That is an ORDERING defect, not a facetability one, and it is fixed as one:
63
+ * nothing is deleted, because this package cannot tell a battery-health axis
64
+ * from a parcel-width axis and must not pretend to. Two categories declare
65
+ * `int` attributes and one of them is `mileage`. So the row states its order
66
+ * instead, out of evidence it actually has:
67
+ *
68
+ * 1. **the category chip** — narrowing the category decides which chips
69
+ * exist at all, the facet plan being derived from the leaf;
70
+ * 2. **the location chip** — the other host-slot filter;
71
+ * 3. **everything APPLIED**, in band order below. A constraint a person has
72
+ * set has to be reachable without a flick, or the row states filters that
73
+ * are on screen only if you go looking;
74
+ * 4. then everything unapplied, in band order:
75
+ * **core range axes** (`facet_meta.core_ranges` — the SERVER declaring an
76
+ * axis that exists for every document in every category: `price`), then
77
+ * **counted facet groups** (the server counted them for this search and
78
+ * each carries its remaining counts — the strongest evidence the row has
79
+ * that these are the axes this corpus is narrowed by), then
80
+ * **the category's numeric attributes**, which are form fields the
81
+ * composer collects and which no flag in the schema distinguishes from an
82
+ * axis a buyer uses.
83
+ *
84
+ * Band 3's attributes keep their controls, whole, in the panel behind the
85
+ * leading circle and at the tail of this row. `buildRangeGroups` is untouched:
86
+ * a rule that DELETED them would have to answer "on what evidence", and
87
+ * `facet_meta.skipped` — the one server signal that names a slug — means the
88
+ * counter ran out of plan slots at `MAX_FACET_FIELDS`, not that a person
89
+ * cannot filter by it. `r.<slug>` still answers for a skipped slug.
90
+ *
91
+ * ## Why the CATEGORY leads the row
92
+ *
93
+ * The owner's navigation model puts levels 1-2 of the catalogue on tiles and
94
+ * every level below them behind a cascading child selector, chosen "as a
95
+ * characteristic" — on the result list and in the composer alike. On the SERP
96
+ * that selector is a chip like any other, and it is the FIRST one, because
97
+ * narrowing the category is what changes which other chips exist at all: the
98
+ * facet plan is derived from the leaf category, so every chip to its right is
99
+ * downstream of it.
100
+ *
101
+ * The pair does not draw that selector. Walking the tree belongs to
102
+ * `categories-react`, so the chip is the host's `renderCategoryFilter` in the
103
+ * same sheet the other chips open, and a row whose host filled no such slot
104
+ * renders exactly as it did before. There is no synthesized category FACET
105
+ * anywhere here and there must not be one: the server counts no category
106
+ * buckets and the index has no read path for them, so any count this row drew
107
+ * beside a child category would be a number nobody could check.
50
108
  */
51
109
  import { useState } from "react";
52
110
  import { Button } from "antd";
@@ -90,6 +148,42 @@ const ROW = {
90
148
  paddingBlock: spacing[1],
91
149
  };
92
150
  const CHIP = { flex: "0 0 auto", borderRadius: radii.full };
151
+ /** Band order, stated once. */
152
+ export const CHIP_BAND_ORDER = [
153
+ "core_range",
154
+ "facet",
155
+ "attribute_range",
156
+ ];
157
+ /** Has the person set this filter? */
158
+ function specApplied(spec) {
159
+ return spec.band === "facet" ? spec.facet.selected.length > 0 : spec.range.active;
160
+ }
161
+ /**
162
+ * The row's order: applied first, then band, then the order each source
163
+ * already came in.
164
+ *
165
+ * Exported because the order IS the fix — the defect it closes is invisible to
166
+ * a test that only asks whether a chip exists, and a rule stated in prose next
167
+ * to an unexercised implementation is a rule that drifts.
168
+ *
169
+ * `Array.prototype.sort` is stable in every runtime this pair supports, so
170
+ * equal-ranked chips keep the order `buildRangeGroups` and `buildFacetGroups`
171
+ * gave them — a closed set's authored order survives all the way to the row.
172
+ */
173
+ export function orderChipFilters(ranges, facets) {
174
+ const specs = [
175
+ ...ranges.map((range) => range.core
176
+ ? { band: "core_range", range }
177
+ : { band: "attribute_range", range }),
178
+ ...facets.map((facet) => ({ band: "facet", facet })),
179
+ ];
180
+ return [...specs].sort((a, b) => {
181
+ const applied = Number(specApplied(b)) - Number(specApplied(a));
182
+ if (applied !== 0)
183
+ return applied;
184
+ return CHIP_BAND_ORDER.indexOf(a.band) - CHIP_BAND_ORDER.indexOf(b.band);
185
+ });
186
+ }
93
187
  /**
94
188
  * The label a chip carries: the group's name alone when nothing is chosen,
95
189
  * and the CHOICE when something is — "Brand" becomes "Bosch", "Brand, +2".
@@ -105,14 +199,31 @@ function chipLabel(group, t) {
105
199
  ? first.label
106
200
  : `${first.label}${t(SEARCH_I18N_KEYS.filtersChipMore, { count: chosen.length - 1 })}`;
107
201
  }
202
+ /**
203
+ * The last segment of a `root/leaf` category path.
204
+ *
205
+ * A chip has room for one word, and the whole path is what the panel prints on
206
+ * a surface with a column to spend. This is the pair's LAST resort — a host
207
+ * that renders the picker knows the catalogue's own name for the node and
208
+ * passes `categoryLabel` — but it is a real narrowing stated with a value the
209
+ * URL genuinely carries, which is the line the geo chip draws too: never print
210
+ * a coordinate, always print the name you actually have.
211
+ */
212
+ export function categoryLeaf(path) {
213
+ const parts = path.split("/").filter((part) => part.length > 0);
214
+ return parts[parts.length - 1] ?? path;
215
+ }
108
216
  export function FilterChips(props) {
109
217
  const t = useT();
110
- const { state } = useSearchState();
218
+ const { state, setCategory } = useSearchState();
111
219
  const bag = useFacetPanel({
112
220
  ...(props.categoryFeatures !== undefined
113
221
  ? { categoryFeatures: props.categoryFeatures }
114
222
  : {}),
115
223
  ...(props.locale !== undefined ? { locale: props.locale } : {}),
224
+ ...(props.resolveFacetLabels !== undefined
225
+ ? { resolveFacetLabels: props.resolveFacetLabels }
226
+ : {}),
116
227
  });
117
228
  const applyLabel = useApplyLabel();
118
229
  const surface = useDialogSurface();
@@ -136,21 +247,58 @@ export function FilterChips(props) {
136
247
  setOpen(null);
137
248
  };
138
249
  const sheetFor = (id, title, body) => (_jsx(SkinDialog, { open: open === id, onClose: close, title: title, dismissLabel: t(SEARCH_I18N_KEYS.filtersDismiss), "data-testid": `filter-chip-sheet-${id}`, footer: _jsx(Button, { block: true, type: "primary", "data-testid": `filter-chip-apply-${id}`, "data-analytics": "none", "data-analytics-reason": "the filter is already applied; this closes the sheet", onClick: close, children: applyLabel }), children: body }));
250
+ // The category chip exists only where a host can actually draw the picker:
251
+ // a chip that opened an empty sheet would be a filter affordance leading
252
+ // nowhere, and the whole panel behind the leading circle already carries the
253
+ // control that widens a narrowed link.
254
+ const showCategoryChip = props.renderCategoryFilter !== undefined;
255
+ const category = state.category;
256
+ // Same rule as every other chip: the CHOICE when there is one, the filter's
257
+ // own name when there is not.
258
+ const categoryChipLabel = category === undefined
259
+ ? t(SEARCH_I18N_KEYS.categoryTitle)
260
+ : (props.categoryLabel ?? categoryLeaf(category));
261
+ const ordered = orderChipFilters(ranges, groups);
139
262
  const geo = state.geo;
140
- const showGeoChip = props.renderGeoFilter !== undefined || geo !== undefined;
263
+ const showGeoChip = props.geoChip !== false &&
264
+ (props.renderGeoFilter !== undefined || geo !== undefined);
141
265
  // Nothing applied: the chip is the FILTER's name ("Location"), because there
142
266
  // is no constraint to describe yet. Applied: the host's name for the place,
143
267
  // and failing that the sentence that admits the pair does not know it.
144
268
  const geoChipLabel = geo === undefined
145
269
  ? t(SEARCH_I18N_KEYS.geoTitle)
146
270
  : (props.geoLabel ?? geoSummaryFallback(geo, t));
147
- return (_jsxs(_Fragment, { children: [_jsx("style", { href: CHIP_ROW_STYLE_HREF, precedence: "default", children: chipRowCss() }), _jsxs("div", { className: CHIP_ROW_CLASS, style: ROW, role: "group", "aria-label": t(SEARCH_I18N_KEYS.filtersChipsLabel), "data-testid": "search-filter-chips", "data-surface": surface, children: [_jsx(Button, { shape: "circle", "aria-label": t(SEARCH_I18N_KEYS.filtersAll), icon: _jsx(SlidersGlyph, {}), style: CHIP, "data-testid": "search-filters-open", "data-active": bag.activeFilters > 0 ? "true" : "false", "data-analytics": "none", "data-analytics-reason": "opening the filter sheet is a read, not a flow step", onClick: props.onOpenAll, children: bag.activeFilters > 0 && _jsx(ActiveDot, {}) }), showGeoChip && (_jsx(Button, { style: CHIP, shape: "round", type: geo !== undefined ? "primary" : "default", "data-testid": "search-chip-geo", "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
271
+ /*
272
+ * A row of one button is not a chip row.
273
+ *
274
+ * The leading circle is the whole-panel door, and it is the only child this
275
+ * row is guaranteed. On a deployment whose plan has no facets for the
276
+ * current query — a free-text search with no category is exactly that: the
277
+ * plan comes from the CATEGORY's feature defs, so `facets` comes back `{}` —
278
+ * the row rendered as a lone circle floating between the location line and
279
+ * the results, a third filter affordance next to two working ones. When
280
+ * there is nothing to state, the row states nothing and the surface above
281
+ * keeps its own door.
282
+ */
283
+ const hasChips = showCategoryChip || showGeoChip || ordered.length > 0;
284
+ if (!hasChips)
285
+ return null;
286
+ return (_jsxs(_Fragment, { children: [_jsx("style", { href: CHIP_ROW_STYLE_HREF, precedence: "default", children: chipRowCss() }), _jsxs("div", { className: CHIP_ROW_CLASS, style: ROW, role: "group", "aria-label": t(SEARCH_I18N_KEYS.filtersChipsLabel), "data-testid": "search-filter-chips", "data-surface": surface, children: [_jsx(Button, { shape: "circle", "aria-label": t(SEARCH_I18N_KEYS.filtersAll), icon: _jsx(SlidersGlyph, {}), style: CHIP, "data-testid": "search-filters-open", "data-active": bag.activeFilters > 0 ? "true" : "false", "data-analytics": "none", "data-analytics-reason": "opening the filter sheet is a read, not a flow step", onClick: props.onOpenAll, children: bag.activeFilters > 0 && _jsx(ActiveDot, {}) }), showCategoryChip && (_jsx(Button, { style: CHIP, shape: "round", type: category !== undefined ? "primary" : "default", "data-testid": "search-chip-category", "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
287
+ setOpen("category");
288
+ }, children: categoryChipLabel })), showGeoChip && (_jsx(Button, { style: CHIP, shape: "round", type: geo !== undefined ? "primary" : "default", "data-testid": "search-chip-geo", "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
148
289
  setOpen("geo");
149
- }, children: geoChipLabel })), ranges.map((group) => (_jsx(Button, { style: CHIP, shape: "round", type: group.active ? "primary" : "default", "data-testid": `search-chip-range-${group.slug}`, "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
150
- setOpen(`range:${group.slug}`);
151
- }, children: group.label }, group.slug))), groups.map((group) => (_jsx(Button, { style: CHIP, shape: "round", type: group.selected.length > 0 ? "primary" : "default", "data-testid": `search-chip-${group.slug}`, "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
152
- setOpen(`facet:${group.slug}`);
153
- }, children: chipLabel(group, t) }, group.slug)))] }), open?.startsWith("facet:") === true &&
290
+ }, children: geoChipLabel })), ordered.map((spec) => spec.band === "facet" ? (_jsx(Button, { style: CHIP, shape: "round", type: spec.facet.selected.length > 0 ? "primary" : "default", "data-testid": `search-chip-${spec.facet.slug}`, "data-band": spec.band, "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
291
+ setOpen(`facet:${spec.facet.slug}`);
292
+ }, children: chipLabel(spec.facet, t) }, `facet:${spec.facet.slug}`)) : (_jsx(Button, { style: CHIP, shape: "round", type: spec.range.active ? "primary" : "default", "data-testid": `search-chip-range-${spec.range.slug}`, "data-band": spec.band, "data-analytics": "none", "data-analytics-reason": "a filter is a read, not a flow step", onClick: () => {
293
+ setOpen(`range:${spec.range.slug}`);
294
+ }, children: spec.range.label }, `range:${spec.range.slug}`)))] }), open === "category" &&
295
+ props.renderCategoryFilter !== undefined &&
296
+ sheetFor("category", t(SEARCH_I18N_KEYS.categoryTitle), props.renderCategoryFilter({
297
+ value: category,
298
+ onChange: (path) => {
299
+ setCategory(path);
300
+ },
301
+ })), open?.startsWith("facet:") === true &&
154
302
  (() => {
155
303
  const slug = open.slice("facet:".length);
156
304
  const group = groups.find((candidate) => candidate.slug === slug);