@stapel/search-react 0.3.1 → 0.7.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.
- package/CHANGELOG.md +180 -0
- package/MODULE.md +43 -4
- package/README.md +1 -1
- package/dist/api/generated/schema.d.ts +5 -1
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/default/DegradationNotice.d.ts +34 -0
- package/dist/default/DegradationNotice.d.ts.map +1 -1
- package/dist/default/DegradationNotice.js +28 -6
- package/dist/default/DegradationNotice.js.map +1 -1
- package/dist/default/FacetPanelPane.d.ts +54 -3
- package/dist/default/FacetPanelPane.d.ts.map +1 -1
- package/dist/default/FacetPanelPane.js +119 -19
- package/dist/default/FacetPanelPane.js.map +1 -1
- package/dist/default/LanguageSelect.d.ts +9 -0
- package/dist/default/LanguageSelect.d.ts.map +1 -0
- package/dist/default/LanguageSelect.js +72 -0
- package/dist/default/LanguageSelect.js.map +1 -0
- package/dist/default/PageSizeSelect.d.ts +29 -0
- package/dist/default/PageSizeSelect.d.ts.map +1 -0
- package/dist/default/PageSizeSelect.js +25 -0
- package/dist/default/PageSizeSelect.js.map +1 -0
- package/dist/default/RangeFilterRow.d.ts +12 -0
- package/dist/default/RangeFilterRow.d.ts.map +1 -0
- package/dist/default/RangeFilterRow.js +75 -0
- package/dist/default/RangeFilterRow.js.map +1 -0
- package/dist/default/RankingDisclosurePane.d.ts +5 -0
- package/dist/default/RankingDisclosurePane.d.ts.map +1 -1
- package/dist/default/RankingDisclosurePane.js +15 -15
- package/dist/default/RankingDisclosurePane.js.map +1 -1
- package/dist/default/SearchBox.d.ts +13 -0
- package/dist/default/SearchBox.d.ts.map +1 -0
- package/dist/default/SearchBox.js +67 -0
- package/dist/default/SearchBox.js.map +1 -0
- package/dist/default/SearchPage.d.ts +58 -16
- package/dist/default/SearchPage.d.ts.map +1 -1
- package/dist/default/SearchPage.js +155 -6
- package/dist/default/SearchPage.js.map +1 -1
- package/dist/default/SearchResultCard.d.ts +19 -18
- package/dist/default/SearchResultCard.d.ts.map +1 -1
- package/dist/default/SearchResultCard.js +178 -5
- package/dist/default/SearchResultCard.js.map +1 -1
- package/dist/default/SearchResultsPane.d.ts +54 -3
- package/dist/default/SearchResultsPane.d.ts.map +1 -1
- package/dist/default/SearchResultsPane.js +45 -25
- package/dist/default/SearchResultsPane.js.map +1 -1
- package/dist/default/SortSelect.d.ts +10 -2
- package/dist/default/SortSelect.d.ts.map +1 -1
- package/dist/default/SortSelect.js +27 -24
- package/dist/default/SortSelect.js.map +1 -1
- package/dist/default/UrlIssueNotice.d.ts.map +1 -1
- package/dist/default/UrlIssueNotice.js +19 -1
- package/dist/default/UrlIssueNotice.js.map +1 -1
- package/dist/default/index.d.ts +33 -16
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +26 -12
- package/dist/default/index.js.map +1 -1
- package/dist/default/sortLabels.d.ts +5 -0
- package/dist/default/sortLabels.d.ts.map +1 -0
- package/dist/default/sortLabels.js +32 -0
- package/dist/default/sortLabels.js.map +1 -0
- package/dist/headless/FacetPanel.d.ts +17 -0
- package/dist/headless/FacetPanel.d.ts.map +1 -1
- package/dist/headless/FacetPanel.js +23 -2
- package/dist/headless/FacetPanel.js.map +1 -1
- package/dist/headless/SearchResults.d.ts +20 -3
- package/dist/headless/SearchResults.d.ts.map +1 -1
- package/dist/headless/SearchResults.js +3 -1
- package/dist/headless/SearchResults.js.map +1 -1
- package/dist/headless/useAppliedCount.d.ts +8 -0
- package/dist/headless/useAppliedCount.d.ts.map +1 -0
- package/dist/headless/useAppliedCount.js +30 -0
- package/dist/headless/useAppliedCount.js.map +1 -0
- package/dist/headless/useScorerNames.d.ts +4 -0
- package/dist/headless/useScorerNames.d.ts.map +1 -0
- package/dist/headless/useScorerNames.js +34 -0
- package/dist/headless/useScorerNames.js.map +1 -0
- package/dist/headless/useSearchBox.d.ts +44 -0
- package/dist/headless/useSearchBox.d.ts.map +1 -0
- package/dist/headless/useSearchBox.js +116 -0
- package/dist/headless/useSearchBox.js.map +1 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +32 -4
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/keys.d.ts +46 -2
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +86 -6
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +38 -4
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/model/queries.d.ts +26 -2
- package/dist/model/queries.d.ts.map +1 -1
- package/dist/model/queries.js +38 -1
- package/dist/model/queries.js.map +1 -1
- package/dist/state/degradations.d.ts +41 -0
- package/dist/state/degradations.d.ts.map +1 -1
- package/dist/state/degradations.js +41 -0
- package/dist/state/degradations.js.map +1 -1
- package/dist/state/limits.d.ts +44 -0
- package/dist/state/limits.d.ts.map +1 -0
- package/dist/state/limits.js +44 -0
- package/dist/state/limits.js.map +1 -0
- package/dist/state/ranges.d.ts +52 -0
- package/dist/state/ranges.d.ts.map +1 -0
- package/dist/state/ranges.js +108 -0
- package/dist/state/ranges.js.map +1 -0
- package/llms.txt +16 -5
- package/manifest.json +245 -22
- package/nav-manifest.json +1 -1
- package/package.json +15 -10
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +5 -1
- package/src/default/DegradationNotice.tsx +84 -14
- package/src/default/FacetPanelPane.tsx +343 -64
- package/src/default/LanguageSelect.tsx +93 -0
- package/src/default/PageSizeSelect.tsx +80 -0
- package/src/default/RangeFilterRow.tsx +148 -0
- package/src/default/RankingDisclosurePane.tsx +67 -35
- package/src/default/SearchBox.tsx +130 -0
- package/src/default/SearchPage.tsx +356 -41
- package/src/default/SearchResultCard.tsx +231 -24
- package/src/default/SearchResultsPane.tsx +147 -76
- package/src/default/SortSelect.tsx +50 -37
- package/src/default/UrlIssueNotice.tsx +21 -3
- package/src/default/index.ts +42 -16
- package/src/default/sortLabels.ts +34 -0
- package/src/headless/FacetPanel.tsx +30 -2
- package/src/headless/SearchResults.tsx +32 -4
- package/src/headless/useAppliedCount.ts +41 -0
- package/src/headless/useScorerNames.ts +36 -0
- package/src/headless/useSearchBox.ts +189 -0
- package/src/i18n/es.ts +39 -4
- package/src/i18n/keys.ts +97 -6
- package/src/i18n/ru.ts +45 -4
- package/src/index.ts +30 -3
- package/src/model/queries.ts +51 -1
- package/src/state/degradations.ts +60 -0
- package/src/state/limits.ts +50 -0
- package/src/state/ranges.ts +144 -0
- package/dist/default/ErrorAlert.d.ts +0 -9
- package/dist/default/ErrorAlert.d.ts.map +0 -1
- package/dist/default/ErrorAlert.js +0 -27
- package/dist/default/ErrorAlert.js.map +0 -1
- package/dist/default/theme.d.ts +0 -24
- package/dist/default/theme.d.ts.map +0 -1
- package/dist/default/theme.js +0 -39
- package/dist/default/theme.js.map +0 -1
- package/src/default/ErrorAlert.tsx +0 -46
- package/src/default/theme.tsx +0 -66
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultCard.js","sourceRoot":"","sources":["../../src/default/SearchResultCard.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SearchResultCard.js","sourceRoot":"","sources":["../../src/default/SearchResultCard.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,E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earchResultsPane>` — the antd result page: the count, the degradation
|
|
3
3
|
* banner, the cards, and the keyset controls.
|
|
4
4
|
*
|
|
5
|
-
* Rendered through
|
|
6
|
-
* "Nothing matches this search" is reachable only from a search that
|
|
7
|
-
* ran; a 5xx renders "we could not run this search" plus a retry. The
|
|
5
|
+
* Rendered through the shared substrate's `LoadList`, whose FOUR arms are the
|
|
6
|
+
* point. "Nothing matches this search" is reachable only from a search that
|
|
7
|
+
* actually ran; a 5xx renders "we could not run this search" plus a retry. The
|
|
8
8
|
* substitution of one for the other is what cost the 2026-08-09 incident, and
|
|
9
9
|
* the spec's §7.4 negative leg exercises this exact pane against a forced 5xx.
|
|
10
10
|
*
|
|
@@ -12,9 +12,21 @@
|
|
|
12
12
|
* is "narrow the search", not "there is nothing here" — it arrives as a 400
|
|
13
13
|
* with an empty body, which is precisely how it would otherwise render as an
|
|
14
14
|
* empty page.
|
|
15
|
+
*
|
|
16
|
+
* ── Two things the pager used to get wrong ────────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* 1. **Its reasons were in `title=`.** A disabled antd Button receives no
|
|
19
|
+
* pointer events, so the browser tooltip never fires — on any device — and
|
|
20
|
+
* a phone has no hover to begin with. Both buttons are `GatedButton` now:
|
|
21
|
+
* the block's reason is ordinary text beside the control and the button's
|
|
22
|
+
* `aria-describedby` points at it.
|
|
23
|
+
* 2. **It rendered when there was nothing to page.** Two dead buttons under an
|
|
24
|
+
* empty state is the fleet's C-DEADPAGER defect; the pager now appears only
|
|
25
|
+
* when the answer actually has another page in some direction.
|
|
15
26
|
*/
|
|
16
27
|
import type { ReactElement, ReactNode } from "react";
|
|
17
28
|
import type { SearchItem } from "../api/types.js";
|
|
29
|
+
import type { DegradationNoticeVariant } from "./DegradationNotice.js";
|
|
18
30
|
import type { SearchCardRenderer } from "./SearchResultCard.js";
|
|
19
31
|
import type { ThemeModeProp } from "./types.js";
|
|
20
32
|
/**
|
|
@@ -25,6 +37,16 @@ import type { ThemeModeProp } from "./types.js";
|
|
|
25
37
|
* problem.
|
|
26
38
|
*/
|
|
27
39
|
export type SearchResultsRenderer = (items: readonly SearchItem[]) => ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* The widest a column of results is allowed to get.
|
|
42
|
+
*
|
|
43
|
+
* Off the spacing scale and named for it: it is a MEASURE, the reading-width
|
|
44
|
+
* decision every long page has to take. Without it the pane spread the full
|
|
45
|
+
* width of whatever it was dropped into — the visual pass measured a 2560px
|
|
46
|
+
* pane with four cards floating at the top of it and a status row 1350px from
|
|
47
|
+
* the buttons that act on it (class C-NOMAXW).
|
|
48
|
+
*/
|
|
49
|
+
export declare const RESULTS_MAX_WIDTH = 1120;
|
|
28
50
|
export interface SearchResultsPaneProps extends ThemeModeProp {
|
|
29
51
|
/**
|
|
30
52
|
* The card slot (spec §6.2 item 1). A storefront passes
|
|
@@ -44,9 +66,38 @@ export interface SearchResultsPaneProps extends ThemeModeProp {
|
|
|
44
66
|
* toolbar in here instead of printing a second caption above the pane.
|
|
45
67
|
*/
|
|
46
68
|
readonly toolbar?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* What this list is CALLED on this surface. Default: "Results".
|
|
71
|
+
*
|
|
72
|
+
* The pane owning the heading row is what stops a screen printing two
|
|
73
|
+
* captions — but "Results" is only the right word when the person performed
|
|
74
|
+
* a search. A landing's newest-first strip is "Fresh listings"; a seller's
|
|
75
|
+
* page is "This seller's listings"; a category page's is the category. Every
|
|
76
|
+
* one of those surfaces had written its own `<Title>` above the pane and got
|
|
77
|
+
* the pane's "Results" underneath it a moment later — two headings, one
|
|
78
|
+
* list, on the three busiest screens of the storefront.
|
|
79
|
+
*
|
|
80
|
+
* So the name comes IN, to the row that already exists, instead of being
|
|
81
|
+
* printed a second time above it. Still exactly one heading either way.
|
|
82
|
+
*/
|
|
83
|
+
readonly heading?: ReactNode;
|
|
47
84
|
/** Rendered under the pager — where the container puts the ranking link. */
|
|
48
85
|
readonly footer?: ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* How this surface says what the engine could not do (default `"banner"`).
|
|
88
|
+
*
|
|
89
|
+
* A catalogue page wants the warning box. A landing page showing six cards
|
|
90
|
+
* under a hero has no room for one and passes `"inline"` or `"off"` — a
|
|
91
|
+
* decision about THIS surface, not about whether the degradation matters.
|
|
92
|
+
* Note that an `exact_total`-only degradation never raises a banner under
|
|
93
|
+
* any variant: it is a count nuance the count itself already speaks as
|
|
94
|
+
* "N+", not a failed search.
|
|
95
|
+
*/
|
|
96
|
+
readonly degradationNotice?: DegradationNoticeVariant;
|
|
49
97
|
readonly enabled?: boolean;
|
|
98
|
+
/** Widest the column of results may grow (default {@link RESULTS_MAX_WIDTH});
|
|
99
|
+
* `null` lets the container decide. */
|
|
100
|
+
readonly maxWidth?: number | null;
|
|
50
101
|
}
|
|
51
102
|
export declare function SearchResultsPane(props: SearchResultsPaneProps): ReactElement;
|
|
52
103
|
//# sourceMappingURL=SearchResultsPane.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultsPane.d.ts","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SearchResultsPane.d.ts","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOlD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,SAAS,UAAU,EAAE,KACzB,SAAS,CAAC;AAEf;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAiBtC,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;;;;;OASG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;2CACuC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AA8DD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAgG7E"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { errorCode,
|
|
2
|
+
import { Flex, Typography } from "antd";
|
|
3
|
+
import { errorCode, useT, useTPlural } from "@stapel/core";
|
|
4
|
+
import { EmptyState, ErrorAlert, GatedButton, LoadList, SkinTheme, } from "@stapel/tokens-antd/skin";
|
|
5
|
+
import { spacing } from "@stapel/tokens";
|
|
4
6
|
import { SearchResults } from "../headless/SearchResults.js";
|
|
7
|
+
import { useScorerNames } from "../headless/useScorerNames.js";
|
|
5
8
|
import { SEARCH_WINDOW_EXCEEDED } from "../i18n/errorsMap.js";
|
|
6
9
|
import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
|
|
7
10
|
import { DegradationNotice } from "./DegradationNotice.js";
|
|
8
|
-
import { ErrorAlert } from "./ErrorAlert.js";
|
|
9
11
|
import { SearchResultCard } from "./SearchResultCard.js";
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The widest a column of results is allowed to get.
|
|
14
|
+
*
|
|
15
|
+
* Off the spacing scale and named for it: it is a MEASURE, the reading-width
|
|
16
|
+
* decision every long page has to take. Without it the pane spread the full
|
|
17
|
+
* width of whatever it was dropped into — the visual pass measured a 2560px
|
|
18
|
+
* pane with four cards floating at the top of it and a status row 1350px from
|
|
19
|
+
* the buttons that act on it (class C-NOMAXW).
|
|
20
|
+
*/
|
|
21
|
+
export const RESULTS_MAX_WIDTH = 1120;
|
|
11
22
|
/**
|
|
12
23
|
* The results grid. `auto-fill` + `minmax(280px, 1fr)`: as many columns as fit,
|
|
13
24
|
* each at least a readable card and never wider than its share — a catalogue
|
|
@@ -19,7 +30,7 @@ import { SearchSkinTheme } from "./theme.js";
|
|
|
19
30
|
const RESULTS_GRID = {
|
|
20
31
|
display: "grid",
|
|
21
32
|
gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
|
|
22
|
-
gap:
|
|
33
|
+
gap: spacing[3],
|
|
23
34
|
alignItems: "stretch",
|
|
24
35
|
};
|
|
25
36
|
function Count(props) {
|
|
@@ -30,36 +41,45 @@ function Count(props) {
|
|
|
30
41
|
const page = props.bag.page;
|
|
31
42
|
if (page === null)
|
|
32
43
|
return null;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
// No count line at all when the server cannot say. The alternative — some
|
|
45
|
+
// number — is how "About 0 listings" ended up printed over four visible
|
|
46
|
+
// cards: an unknown total rendered as a claim about the catalogue.
|
|
47
|
+
if (page.countKind === "unknown" || page.count === null)
|
|
48
|
+
return null;
|
|
49
|
+
return (_jsx(Typography.Text, { type: "secondary", "data-testid": "search-count", "data-count-kind": page.countKind, children: page.countKind === "at_least"
|
|
50
|
+
? tPlural(SEARCH_I18N_KEYS.resultsCountAtLeast, { count: page.count })
|
|
37
51
|
: tPlural(SEARCH_I18N_KEYS.resultsCountExact, { count: page.count }) }));
|
|
38
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The keyset controls — rendered only when there IS another page.
|
|
55
|
+
*
|
|
56
|
+
* Keyset paging has no page numbers to jump to: there is a next, a previous,
|
|
57
|
+
* and a server-side depth cap. When neither direction exists the pager is not
|
|
58
|
+
* "disabled", it is absent — a control that can never do anything is not a
|
|
59
|
+
* control that needs explaining.
|
|
60
|
+
*/
|
|
39
61
|
function Pager(props) {
|
|
40
62
|
const t = useT();
|
|
41
|
-
const { prev, next, goPrev, goNext } = props.bag;
|
|
42
|
-
|
|
63
|
+
const { page, prev, next, goPrev, goNext } = props.bag;
|
|
64
|
+
if (page === null || (!page.hasNext && !page.hasPrev))
|
|
65
|
+
return null;
|
|
66
|
+
return (_jsxs(Flex, { gap: spacing[2], justify: "center", wrap: true, "data-testid": "search-pager", children: [_jsx(GatedButton, { gate: prev, onClick: goPrev, testId: "search-prev", "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", children: t(SEARCH_I18N_KEYS.resultsPrev) }), _jsx(GatedButton, { gate: next, onClick: goNext, testId: "search-next", "data-analytics": "none", "data-analytics-reason": "keyset paging is a read, not a flow step", children: t(SEARCH_I18N_KEYS.resultsNext) })] }));
|
|
43
67
|
}
|
|
44
68
|
export function SearchResultsPane(props) {
|
|
45
69
|
const t = useT();
|
|
46
|
-
const describe = useDescribeFlowError();
|
|
47
70
|
const { renderCard, renderResults } = props;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
71
|
+
const scorerName = useScorerNames();
|
|
72
|
+
const maxWidth = props.maxWidth === undefined ? RESULTS_MAX_WIDTH : props.maxWidth;
|
|
73
|
+
return (_jsx(SkinTheme, { surface: "base", ...(props.mode !== undefined ? { mode: props.mode } : {}), style: {
|
|
74
|
+
width: "100%",
|
|
75
|
+
...(maxWidth !== null ? { maxWidth } : {}),
|
|
76
|
+
}, children: _jsx(SearchResults, { ...(props.enabled !== undefined ? { enabled: props.enabled } : {}), children: (bag) => (_jsxs(Flex, { vertical: true, gap: spacing[4], children: [_jsxs(Flex, { justify: "space-between", align: "center", wrap: true, gap: spacing[2], children: [_jsx(Typography.Title, { level: 4, style: { margin: 0 }, "data-testid": "search-results-heading", children: props.heading ?? t(SEARCH_I18N_KEYS.resultsTitle) }), _jsxs(Flex, { align: "center", wrap: true, gap: spacing[3], children: [_jsx(Count, { bag: bag }), props.toolbar] })] }), _jsx(DegradationNotice, { degradations: bag.degradations, variant: props.degradationNotice ?? "banner", scorerName: scorerName }), _jsx(LoadList, { state: bag.state, testId: "search", skeletonRows: 6, onRetry: bag.refetch, empty: _jsx(EmptyState, { title: t(SEARCH_I18N_KEYS.resultsEmpty), testId: "search-empty" }), failed: (error) => {
|
|
51
77
|
// The window refusal is a DIFFERENT sentence from a failed
|
|
52
78
|
// search, and both are different from "nothing found".
|
|
53
79
|
const isWindow = errorCode(error) === SEARCH_WINDOW_EXCEEDED;
|
|
54
|
-
return (_jsx(ErrorAlert, { testId: isWindow ? "search-window-exceeded" : "search-failed", error:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
: SEARCH_I18N_KEYS.resultsLoadFailed),
|
|
59
|
-
}, action: _jsx(Button, { size: "small", onClick: bag.refetch, "data-analytics": "none", "data-analytics-reason": "retry of a failed read; no flow to step", children: t(SEARCH_I18N_KEYS.resultsRetry) }) }));
|
|
60
|
-
},
|
|
61
|
-
empty: () => (_jsx(Empty, { "data-testid": "search-empty", description: t(SEARCH_I18N_KEYS.resultsEmpty) })),
|
|
62
|
-
ready: (items) => (_jsx("div", { "data-testid": "search-results", children: renderResults !== undefined ? (renderResults(items)) : (_jsx("div", { style: RESULTS_GRID, "data-testid": "search-results-grid", children: items.map((item) => (_jsx("div", { children: renderCard !== undefined ? (renderCard(item)) : (_jsx(SearchResultCard, { item: item })) }, item.key))) })) })),
|
|
63
|
-
}), _jsx(Pager, { bag: bag }), props.footer] })) }) }));
|
|
80
|
+
return (_jsx(ErrorAlert, { testId: isWindow ? "search-window-exceeded" : "search-failed", thrown: error, message: t(isWindow
|
|
81
|
+
? SEARCH_I18N_KEYS.resultsWindowExceeded
|
|
82
|
+
: SEARCH_I18N_KEYS.resultsLoadFailed), retryLabel: t(SEARCH_I18N_KEYS.resultsRetry), onRetry: bag.refetch }));
|
|
83
|
+
}, children: (items) => (_jsx("div", { "data-testid": "search-results", children: renderResults !== undefined ? (renderResults(items)) : (_jsx("div", { style: RESULTS_GRID, "data-testid": "search-results-grid", children: items.map((item) => (_jsx("div", { children: renderCard !== undefined ? (renderCard(item)) : (_jsx(SearchResultCard, { item: item })) }, item.key))) })) })) }), _jsx(Pager, { bag: bag }), props.footer] })) }) }));
|
|
64
84
|
}
|
|
65
85
|
//# sourceMappingURL=SearchResultsPane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultsPane.js","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SearchResultsPane.js","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAA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
11
11
|
* `sort=distance` needs a centre — the server answers
|
|
12
12
|
* `error.400.search_sort_needs_center` without one. The option is therefore
|
|
13
|
-
* DISABLED
|
|
14
|
-
*
|
|
13
|
+
* DISABLED when no geo centre is set, and the REASON is rendered beside the
|
|
14
|
+
* control through `GatedControl`, not in a `title=` a phone can never surface.
|
|
15
|
+
* That is the whole defect this file used to carry: the one sort a person
|
|
16
|
+
* would most want on a phone was greyed out with its explanation in a hover.
|
|
15
17
|
*/
|
|
16
18
|
import type { ReactElement } from "react";
|
|
19
|
+
/**
|
|
20
|
+
* The select's floor width. Off the spacing scale on purpose and named for it:
|
|
21
|
+
* it is the width of the longest shipped sort label ("Price: low to high") at
|
|
22
|
+
* the default type step, so the control does not resize as the choice changes.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SORT_SELECT_MIN_WIDTH = 200;
|
|
17
25
|
export interface SortSelectProps {
|
|
18
26
|
/** The sort the SERVER applied, shown when the URL names none. Omitted, it
|
|
19
27
|
* is read from the page already in cache — see {@link useAppliedSort}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortSelect.d.ts","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SortSelect.d.ts","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAY1C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B;8EAC0E;IAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,CAwD/D"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex, Select, Typography } from "antd";
|
|
3
|
-
import { useT } from "@stapel/core";
|
|
3
|
+
import { actionAvailable, actionBlocked, useT } from "@stapel/core";
|
|
4
|
+
import { GatedControl } from "@stapel/tokens-antd/skin";
|
|
5
|
+
import { spacing } from "@stapel/tokens";
|
|
4
6
|
import { SEARCH_SORTS } from "../api/types.js";
|
|
5
7
|
import { useAppliedSort } from "../headless/useAppliedSort.js";
|
|
6
8
|
import { useSearchState } from "../headless/SearchStateProvider.js";
|
|
7
9
|
import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { sortLabelKey } from "./sortLabels.js";
|
|
11
|
+
/**
|
|
12
|
+
* The select's floor width. Off the spacing scale on purpose and named for it:
|
|
13
|
+
* it is the width of the longest shipped sort label ("Price: low to high") at
|
|
14
|
+
* the default type step, so the control does not resize as the choice changes.
|
|
15
|
+
*/
|
|
16
|
+
export const SORT_SELECT_MIN_WIDTH = 200;
|
|
15
17
|
export function SortSelect(props) {
|
|
16
18
|
const t = useT();
|
|
17
19
|
const { state, setSort } = useSearchState();
|
|
@@ -28,21 +30,22 @@ export function SortSelect(props) {
|
|
|
28
30
|
const values = active !== undefined && !known.has(active)
|
|
29
31
|
? [...SEARCH_SORTS, active]
|
|
30
32
|
: SEARCH_SORTS;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
// The gate is about ONE option, not the whole control — so the binding's
|
|
34
|
+
// `aria-describedby` is spread onto the select (a screen reader hears the
|
|
35
|
+
// reason with the control) and its `disabled` deliberately is not: the other
|
|
36
|
+
// four sorts work perfectly well without a location.
|
|
37
|
+
const distance = hasCentre
|
|
38
|
+
? actionAvailable()
|
|
39
|
+
: actionBlocked("error.400.search_sort_needs_center");
|
|
40
|
+
return (_jsx(GatedControl, { gate: distance, testId: "search-sort-gate", children: (bind) => (_jsxs(Flex, { gap: spacing[2], align: "center", children: [_jsx(Typography.Text, { type: "secondary", "aria-hidden": "true", children: t(SEARCH_I18N_KEYS.sortLabel) }), _jsx(Select, { "data-testid": "search-sort", "aria-label": t(SEARCH_I18N_KEYS.sortLabel), "aria-describedby": bind["aria-describedby"], style: { minWidth: SORT_SELECT_MIN_WIDTH }, value: active ?? null, onChange: (next) => {
|
|
41
|
+
setSort(next);
|
|
42
|
+
}, options: values.map((value) => {
|
|
43
|
+
const key = sortLabelKey(value);
|
|
44
|
+
return {
|
|
45
|
+
value,
|
|
46
|
+
label: key !== undefined ? t(key) : value,
|
|
47
|
+
disabled: value === "distance" && !hasCentre,
|
|
48
|
+
};
|
|
49
|
+
}) })] })) }));
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=SortSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortSelect.js","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"SortSelect.js","sourceRoot":"","sources":["../../src/default/SortSelect.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE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AAC,QAAQ,aACnC,KAAC,UAAU,CAAC,IAAI,IAAC,IAAI,EAAC,WAAW,iBAAa,MAAM,YACjD,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,GACd,EAClB,KAAC,MAAM,mBACO,aAAa,gBACb,CAAC,CAAC,gBAAgB,CAAC,SAAS,CAAC,sBACvB,IAAI,CAAC,kBAAkB,CAAC,EAC1C,KAAK,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,EAC1C,KAAK,EAAE,MAAM,IAAI,IAAI,EACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;wBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC,EACD,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;wBAC5B,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;wBAChC,OAAO;4BACL,KAAK;4BACL,KAAK,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;4BACzC,QAAQ,EAAE,KAAK,KAAK,UAAU,IAAI,CAAC,SAAS;yBAC7C,CAAC;oBACJ,CAAC,CAAC,GACF,IACG,CACR,GACY,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlIssueNotice.d.ts","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UrlIssueNotice.d.ts","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAwB1C,wBAAgB,cAAc,IAAI,YAAY,GAAG,IAAI,CAqBpD"}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Alert } from "antd";
|
|
3
|
+
import { spacing } from "@stapel/tokens";
|
|
3
4
|
import { useT } from "@stapel/core";
|
|
5
|
+
import { FILTER_PREFIX, RANGE_PREFIX } from "../state/urlState.js";
|
|
4
6
|
import { useSearchState } from "../headless/SearchStateProvider.js";
|
|
5
7
|
import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
|
|
8
|
+
/**
|
|
9
|
+
* The parameter as a person can recognise it.
|
|
10
|
+
*
|
|
11
|
+
* The codec reports the WIRE name, which for a facet or a range carries the
|
|
12
|
+
* prefix that tells the backend which family it belongs to (`r.price`,
|
|
13
|
+
* `f.brand`). That prefix is a protocol detail: the sentence is read by
|
|
14
|
+
* somebody who followed a link, and "price" is the part of `r.price` they
|
|
15
|
+
* have any chance of recognising.
|
|
16
|
+
*/
|
|
17
|
+
function readableParam(param) {
|
|
18
|
+
for (const prefix of [RANGE_PREFIX, FILTER_PREFIX]) {
|
|
19
|
+
if (param.startsWith(prefix))
|
|
20
|
+
return param.slice(prefix.length);
|
|
21
|
+
}
|
|
22
|
+
return param;
|
|
23
|
+
}
|
|
6
24
|
export function UrlIssueNotice() {
|
|
7
25
|
const t = useT();
|
|
8
26
|
const { issues } = useSearchState();
|
|
9
27
|
if (issues.length === 0)
|
|
10
28
|
return null;
|
|
11
|
-
return (_jsx(Alert, { type: "warning", showIcon: true, "data-testid": "search-url-issues",
|
|
29
|
+
return (_jsx(Alert, { type: "warning", showIcon: true, "data-testid": "search-url-issues", title: t(SEARCH_I18N_KEYS.urlIssuesTitle), description: _jsx("ul", { style: { margin: 0, paddingInlineStart: spacing[5] }, children: issues.map((issue) => (_jsx("li", { children: t(issue.messageKey, { param: readableParam(issue.param) }) }, `${issue.param}:${issue.code}`))) }) }));
|
|
12
30
|
}
|
|
13
31
|
//# sourceMappingURL=UrlIssueNotice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlIssueNotice.js","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAC,SAAS,EACd,QAAQ,uBACI,mBAAmB,EAC/B,
|
|
1
|
+
{"version":3,"file":"UrlIssueNotice.js","sourceRoot":"","sources":["../../src/default/UrlIssueNotice.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;GAQG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,KAAK,MAAM,MAAM,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAC,SAAS,EACd,QAAQ,uBACI,mBAAmB,EAC/B,KAAK,EAAE,CAAC,CAAC,gBAAgB,CAAC,cAAc,CAAC,EACzC,WAAW,EACT,aAAI,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,YACrD,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACrB,uBACG,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IADpD,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAElC,CACN,CAAC,GACC,GAEP,CACH,CAAC;AACJ,CAAC"}
|
package/dist/default/index.d.ts
CHANGED
|
@@ -6,37 +6,54 @@
|
|
|
6
6
|
* never pays for this bundle (enforced by size-limit and the bundle-purity
|
|
7
7
|
* test).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Five override levers, none of which requires forking anything:
|
|
10
10
|
*
|
|
11
11
|
* 1. **`renderCard`** — the card slot. A storefront passes
|
|
12
12
|
* `<ListingCard>` from `@stapel/listings-react/default`; the generic card
|
|
13
13
|
* here is the documented default, not the intended end state (spec §3.7).
|
|
14
14
|
* `renderResults` is the level above it: the whole layout, for a container
|
|
15
15
|
* whose arrangement is not "cards in a grid".
|
|
16
|
-
* 2. **`categoryFeatures`** — the facet-label slot
|
|
17
|
-
* `{value: count}` and no
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* 2. **`categoryFeatures`** — the facet-label slot, and the source of which
|
|
17
|
+
* slugs get a numeric range row. The server sends `{value: count}` and no
|
|
18
|
+
* labels; the schema that names them lives in categories, and the
|
|
19
|
+
* container hands it in (spec §6.2 item 2).
|
|
20
|
+
* 3. **`renderCategoryFilter`** — the catalogue picker. `categories-react`
|
|
21
|
+
* owns walking the tree; this pair owns the `category` parameter.
|
|
22
|
+
* 4. **`renderGeoFilter`** — the location control. `geo-react` owns the map
|
|
23
|
+
* and the geocoder; this pair owns `lat`/`lon`/`radius_km`/`bbox`, and
|
|
24
|
+
* keeps the controls that WIDEN a location a link already carries.
|
|
25
|
+
* 5. **retheming through the §68 token JSON** — every surface wraps itself
|
|
26
|
+
* in the shared `SkinTheme`, so a host's regenerated `--stapel-*` custom
|
|
21
27
|
* properties reach this skin with zero code.
|
|
28
|
+
*
|
|
29
|
+
* The pair's own `theme.tsx` and `ErrorAlert.tsx` are GONE as of 0.6.0: both
|
|
30
|
+
* were copies of a decision now stated once in `@stapel/tokens-antd/skin`
|
|
31
|
+
* (`SkinTheme`, `ErrorAlert`). A host that imported `SearchSkinTheme` imports
|
|
32
|
+
* `SkinTheme` from the substrate instead — same props, one implementation, and
|
|
33
|
+
* a runtime `data-theme` flip actually repaints it.
|
|
22
34
|
*/
|
|
23
35
|
export { SearchPage } from "./SearchPage.js";
|
|
24
|
-
export type { SearchPageProps } from "./SearchPage.js";
|
|
25
|
-
export { SearchResultsPane } from "./SearchResultsPane.js";
|
|
36
|
+
export type { SearchPageProps, SearchFiltersLayout } from "./SearchPage.js";
|
|
37
|
+
export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
|
|
26
38
|
export type { SearchResultsPaneProps, SearchResultsRenderer, } from "./SearchResultsPane.js";
|
|
27
39
|
export { FacetPanelPane } from "./FacetPanelPane.js";
|
|
28
|
-
export type { FacetPanelPaneProps } from "./FacetPanelPane.js";
|
|
29
|
-
export { RankingDisclosurePane } from "./RankingDisclosurePane.js";
|
|
40
|
+
export type { FacetPanelPaneProps, CategoryFilterSlotProps, GeoFilterSlotProps, } from "./FacetPanelPane.js";
|
|
41
|
+
export { RankingDisclosurePane, RANKING_MAX_WIDTH } from "./RankingDisclosurePane.js";
|
|
30
42
|
export type { RankingDisclosurePaneProps } from "./RankingDisclosurePane.js";
|
|
43
|
+
export { SearchBox } from "./SearchBox.js";
|
|
44
|
+
export type { SearchBoxProps } from "./SearchBox.js";
|
|
45
|
+
export { SortSelect, SORT_SELECT_MIN_WIDTH } from "./SortSelect.js";
|
|
46
|
+
export type { SortSelectProps } from "./SortSelect.js";
|
|
47
|
+
export { PageSizeSelect, SEARCH_PAGE_SIZES } from "./PageSizeSelect.js";
|
|
48
|
+
export type { PageSizeSelectProps } from "./PageSizeSelect.js";
|
|
49
|
+
export { LanguageSelect } from "./LanguageSelect.js";
|
|
50
|
+
export type { LanguageSelectProps } from "./LanguageSelect.js";
|
|
31
51
|
export { SearchResultCard, GENERIC_CARD_FIELDS } from "./SearchResultCard.js";
|
|
32
52
|
export type { SearchCardProps, SearchCardRenderer } from "./SearchResultCard.js";
|
|
33
53
|
export { DegradationNotice } from "./DegradationNotice.js";
|
|
34
|
-
export type { DegradationNoticeProps } from "./DegradationNotice.js";
|
|
54
|
+
export type { DegradationNoticeProps, DegradationNoticeVariant, } from "./DegradationNotice.js";
|
|
35
55
|
export { UrlIssueNotice } from "./UrlIssueNotice.js";
|
|
36
|
-
export {
|
|
37
|
-
export type {
|
|
38
|
-
export { ErrorAlert } from "./ErrorAlert.js";
|
|
39
|
-
export { SearchSkinTheme } from "./theme.js";
|
|
40
|
-
export type { SearchSkinThemeProps } from "./theme.js";
|
|
56
|
+
export { RangeFilterRow } from "./RangeFilterRow.js";
|
|
57
|
+
export type { RangeFilterRowProps } from "./RangeFilterRow.js";
|
|
41
58
|
export type { ThemeModeProp } from "./types.js";
|
|
42
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACtF,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAG7E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/default/index.js
CHANGED
|
@@ -6,31 +6,45 @@
|
|
|
6
6
|
* never pays for this bundle (enforced by size-limit and the bundle-purity
|
|
7
7
|
* test).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* Five override levers, none of which requires forking anything:
|
|
10
10
|
*
|
|
11
11
|
* 1. **`renderCard`** — the card slot. A storefront passes
|
|
12
12
|
* `<ListingCard>` from `@stapel/listings-react/default`; the generic card
|
|
13
13
|
* here is the documented default, not the intended end state (spec §3.7).
|
|
14
14
|
* `renderResults` is the level above it: the whole layout, for a container
|
|
15
15
|
* whose arrangement is not "cards in a grid".
|
|
16
|
-
* 2. **`categoryFeatures`** — the facet-label slot
|
|
17
|
-
* `{value: count}` and no
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* 2. **`categoryFeatures`** — the facet-label slot, and the source of which
|
|
17
|
+
* slugs get a numeric range row. The server sends `{value: count}` and no
|
|
18
|
+
* labels; the schema that names them lives in categories, and the
|
|
19
|
+
* container hands it in (spec §6.2 item 2).
|
|
20
|
+
* 3. **`renderCategoryFilter`** — the catalogue picker. `categories-react`
|
|
21
|
+
* owns walking the tree; this pair owns the `category` parameter.
|
|
22
|
+
* 4. **`renderGeoFilter`** — the location control. `geo-react` owns the map
|
|
23
|
+
* and the geocoder; this pair owns `lat`/`lon`/`radius_km`/`bbox`, and
|
|
24
|
+
* keeps the controls that WIDEN a location a link already carries.
|
|
25
|
+
* 5. **retheming through the §68 token JSON** — every surface wraps itself
|
|
26
|
+
* in the shared `SkinTheme`, so a host's regenerated `--stapel-*` custom
|
|
21
27
|
* properties reach this skin with zero code.
|
|
28
|
+
*
|
|
29
|
+
* The pair's own `theme.tsx` and `ErrorAlert.tsx` are GONE as of 0.6.0: both
|
|
30
|
+
* were copies of a decision now stated once in `@stapel/tokens-antd/skin`
|
|
31
|
+
* (`SkinTheme`, `ErrorAlert`). A host that imported `SearchSkinTheme` imports
|
|
32
|
+
* `SkinTheme` from the substrate instead — same props, one implementation, and
|
|
33
|
+
* a runtime `data-theme` flip actually repaints it.
|
|
22
34
|
*/
|
|
23
35
|
// ── surfaces ────────────────────────────────────────────────────────────────
|
|
24
36
|
export { SearchPage } from "./SearchPage.js";
|
|
25
|
-
export { SearchResultsPane } from "./SearchResultsPane.js";
|
|
37
|
+
export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
|
|
26
38
|
export { FacetPanelPane } from "./FacetPanelPane.js";
|
|
27
|
-
export { RankingDisclosurePane } from "./RankingDisclosurePane.js";
|
|
39
|
+
export { RankingDisclosurePane, RANKING_MAX_WIDTH } from "./RankingDisclosurePane.js";
|
|
40
|
+
// ── controls, exported so a host can compose its own layout ─────────────────
|
|
41
|
+
export { SearchBox } from "./SearchBox.js";
|
|
42
|
+
export { SortSelect, SORT_SELECT_MIN_WIDTH } from "./SortSelect.js";
|
|
43
|
+
export { PageSizeSelect, SEARCH_PAGE_SIZES } from "./PageSizeSelect.js";
|
|
44
|
+
export { LanguageSelect } from "./LanguageSelect.js";
|
|
28
45
|
// ── parts, exported so a host can compose or wrap one ───────────────────────
|
|
29
46
|
export { SearchResultCard, GENERIC_CARD_FIELDS } from "./SearchResultCard.js";
|
|
30
47
|
export { DegradationNotice } from "./DegradationNotice.js";
|
|
31
48
|
export { UrlIssueNotice } from "./UrlIssueNotice.js";
|
|
32
|
-
export {
|
|
33
|
-
export { ErrorAlert } from "./ErrorAlert.js";
|
|
34
|
-
// ── theming ─────────────────────────────────────────────────────────────────
|
|
35
|
-
export { SearchSkinTheme } from "./theme.js";
|
|
49
|
+
export { RangeFilterRow } from "./RangeFilterRow.js";
|
|
36
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,+EAA+E;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM9E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOrD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGtF,+EAA+E;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAK3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The i18n key for a shipped sort, or `undefined` for a deployment's own. */
|
|
2
|
+
export declare function sortLabelKey(sort: string): string | undefined;
|
|
3
|
+
/** The sort's name for a reader, falling back to the slug. */
|
|
4
|
+
export declare function sortLabel(t: (key: string) => string, sort: string): string;
|
|
5
|
+
//# sourceMappingURL=sortLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortLabels.d.ts","sourceRoot":"","sources":["../../src/default/sortLabels.ts"],"names":[],"mappings":"AAwBA,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG1E"}
|