@stapel/listings-react 0.25.1 → 0.25.3
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 +68 -0
- package/dist/default/ListingDetailPane.d.ts +39 -4
- package/dist/default/ListingDetailPane.d.ts.map +1 -1
- package/dist/default/ListingDetailPane.js +9 -4
- package/dist/default/ListingDetailPane.js.map +1 -1
- package/dist/default/ListingSerpCard.d.ts +16 -75
- package/dist/default/ListingSerpCard.d.ts.map +1 -1
- package/dist/default/ListingSerpCard.js +80 -2
- package/dist/default/ListingSerpCard.js.map +1 -1
- package/dist/default/MyListingsPane.d.ts +13 -0
- package/dist/default/MyListingsPane.d.ts.map +1 -1
- package/dist/default/MyListingsPane.js +11 -3
- package/dist/default/MyListingsPane.js.map +1 -1
- package/dist/headless/MyListings.d.ts +35 -1
- package/dist/headless/MyListings.d.ts.map +1 -1
- package/dist/headless/MyListings.js +25 -1
- package/dist/headless/MyListings.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model/tabAddress.d.ts +42 -0
- package/dist/model/tabAddress.d.ts.map +1 -0
- package/dist/model/tabAddress.js +84 -0
- package/dist/model/tabAddress.js.map +1 -0
- package/llms.txt +1 -1
- package/manifest.json +7 -1
- package/nav-manifest.json +1 -1
- package/package.json +6 -6
- package/src/analytics/generated/events.json +1 -1
- package/src/default/ListingDetailPane.tsx +50 -8
- package/src/default/ListingSerpCard.tsx +38 -11
- package/src/default/MyListingsPane.tsx +24 -6
- package/src/headless/MyListings.tsx +64 -2
- package/src/index.ts +8 -0
- package/src/model/tabAddress.ts +103 -0
|
@@ -3,6 +3,7 @@ import type { ActionAvailability, LoadState } from "@stapel/core";
|
|
|
3
3
|
import type { MyListingCard, MyListingsParams, MyCounters } from "../api/types.js";
|
|
4
4
|
import type { MyListingsSource } from "../model/mineSource.js";
|
|
5
5
|
import type { MyListingsTab } from "../model/status.js";
|
|
6
|
+
import type { MyListingsAddress } from "../model/tabAddress.js";
|
|
6
7
|
/**
|
|
7
8
|
* The owner's dashboard.
|
|
8
9
|
*
|
|
@@ -24,8 +25,26 @@ export interface MyListingsBag {
|
|
|
24
25
|
readonly tab: MyListingsTab;
|
|
25
26
|
readonly tabs: readonly MyListingsTab[];
|
|
26
27
|
setTab(tab: MyListingsTab): void;
|
|
27
|
-
/** The three real counts. */
|
|
28
|
+
/** The three real counts, as the server reports them. */
|
|
28
29
|
readonly counters: LoadState<MyCounters>;
|
|
30
|
+
/**
|
|
31
|
+
* The number to DRAW on each tab — the server's counter, raised to what is
|
|
32
|
+
* actually on screen.
|
|
33
|
+
*
|
|
34
|
+
* D407: a moderator-rejected listing was on the Drafts tab under a badge
|
|
35
|
+
* reading `0`. The two sets are grouped in two places — `my/counters`
|
|
36
|
+
* aggregates server-side, `MY_LISTINGS_TAB_STATUSES` decides which statuses
|
|
37
|
+
* a tab ASKS for — and any disagreement between them (a deployment running
|
|
38
|
+
* an older counter, a status added upstream, a grouping changed on one side)
|
|
39
|
+
* lands as a badge contradicting the rows underneath it.
|
|
40
|
+
*
|
|
41
|
+
* A count smaller than what a person can see is not a count, so the loaded
|
|
42
|
+
* rows are treated as evidence: for the OPEN tab the number is never below
|
|
43
|
+
* `rows.length`. It is a floor and not a replacement — the rows are one
|
|
44
|
+
* keyset page and the counter is the whole set, so the counter still wins
|
|
45
|
+
* whenever it is the larger of the two.
|
|
46
|
+
*/
|
|
47
|
+
readonly tabCounts: LoadState<Readonly<Record<MyListingsTab, number>>>;
|
|
29
48
|
/** The rows for the current tab. */
|
|
30
49
|
readonly rows: LoadState<readonly MyListingCard[]>;
|
|
31
50
|
/**
|
|
@@ -48,8 +67,23 @@ export interface UseMyListingsOptions {
|
|
|
48
67
|
/** Replace the contract's own `my/listings` read — a deployment that keeps
|
|
49
68
|
* its sellers' rows somewhere else. Absent: {@link defaultMyListingsSource}. */
|
|
50
69
|
readonly source?: MyListingsSource;
|
|
70
|
+
/**
|
|
71
|
+
* Which tab to open when the ADDRESS names none. `?tab=drafts` wins over it
|
|
72
|
+
* — an address is a person's own statement about what they want to see, and
|
|
73
|
+
* a default cannot outrank one.
|
|
74
|
+
*/
|
|
51
75
|
readonly initialTab?: MyListingsTab;
|
|
52
76
|
readonly limit?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Where the open tab is kept. Default: the browser's own query string
|
|
79
|
+
* (`?tab=`), which is what makes `/account/listings?tab=drafts` open drafts
|
|
80
|
+
* and survive a reload — see `model/tabAddress.ts`.
|
|
81
|
+
*
|
|
82
|
+
* A host with a router passes its own binding. `NO_ADDRESS` opts out
|
|
83
|
+
* entirely, for a surface that mounts this hook somewhere the address is not
|
|
84
|
+
* about it (two dashboards on one page, a preview inside a modal).
|
|
85
|
+
*/
|
|
86
|
+
readonly address?: MyListingsAddress;
|
|
53
87
|
}
|
|
54
88
|
export declare function useMyListings(options?: UseMyListingsOptions): MyListingsBag;
|
|
55
89
|
/** Renderless: the bag, handed to a render prop. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyListings.d.ts","sourceRoot":"","sources":["../../src/headless/MyListings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"MyListings.d.ts","sourceRoot":"","sources":["../../src/headless/MyListings.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,E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IAAI,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC;oFACgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CACtC;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,aAAa,CA4Hf;AAED,oDAAoD;AACpD,wBAAgB,UAAU,CACxB,KAAK,EAAE,oBAAoB,GAAG;IAC5B,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,SAAS,CAAC;CAC7C,GACA,YAAY,CAGd"}
|
|
@@ -7,12 +7,18 @@ import { useListingsApi } from "../model/context.js";
|
|
|
7
7
|
import { useMyCounters } from "../model/queries.js";
|
|
8
8
|
import { listingsQueryKeys, pageKey } from "../model/queryKeys.js";
|
|
9
9
|
import { MY_LISTINGS_TABS, MY_LISTINGS_UNTABBED_STATUSES } from "../model/status.js";
|
|
10
|
+
import { browserAddress, tabFromSearch } from "../model/tabAddress.js";
|
|
10
11
|
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
11
12
|
import { useMandateGate } from "./useMandateGate.js";
|
|
12
13
|
export function useMyListings(options = {}) {
|
|
13
14
|
const gate = useMandateGate();
|
|
14
15
|
const sessionReady = useActiveSessionReady();
|
|
15
|
-
|
|
16
|
+
// The address is read ONCE, at mount, and written on every change: this is
|
|
17
|
+
// the initial value of a control the person then operates, not a controlled
|
|
18
|
+
// input fed by the URL. (A host that navigates its own router to a different
|
|
19
|
+
// `?tab=` remounts the pane, which is the same thing.)
|
|
20
|
+
const address = options.address ?? browserAddress();
|
|
21
|
+
const [tab, setTabState] = useState(() => tabFromSearch(address.search) ?? options.initialTab ?? "active");
|
|
16
22
|
const [page, setPage] = useState(options.limit !== undefined ? { limit: options.limit } : {});
|
|
17
23
|
const counters = useMyCounters();
|
|
18
24
|
const api = useListingsApi();
|
|
@@ -51,6 +57,20 @@ export function useMyListings(options = {}) {
|
|
|
51
57
|
return loadLoading();
|
|
52
58
|
}, [blockedQuery.status, blockedQuery.error, blockedQuery.data]);
|
|
53
59
|
const envelope = rowsQuery.data;
|
|
60
|
+
// D407, the floor: never a number smaller than the rows on screen. See
|
|
61
|
+
// `MyListingsBag.tabCounts`.
|
|
62
|
+
const tabCounts = useMemo(() => {
|
|
63
|
+
if (counters.status === "error")
|
|
64
|
+
return loadFailed(counters.error);
|
|
65
|
+
if (counters.data === undefined)
|
|
66
|
+
return loadLoading();
|
|
67
|
+
const server = counters.data;
|
|
68
|
+
const visible = rows.status === "ready" ? rows.data.length : 0;
|
|
69
|
+
return loadReady(Object.fromEntries(MY_LISTINGS_TABS.map((one) => [
|
|
70
|
+
one,
|
|
71
|
+
one === tab ? Math.max(server[one], visible) : server[one],
|
|
72
|
+
])));
|
|
73
|
+
}, [counters.status, counters.error, counters.data, rows, tab]);
|
|
54
74
|
return {
|
|
55
75
|
tab,
|
|
56
76
|
tabs: MY_LISTINGS_TABS,
|
|
@@ -61,12 +81,16 @@ export function useMyListings(options = {}) {
|
|
|
61
81
|
// down for its own keyset state.
|
|
62
82
|
setPage(options.limit !== undefined ? { limit: options.limit } : {});
|
|
63
83
|
setTabState(next);
|
|
84
|
+
// …and the address says which list is on screen, so a reload, a
|
|
85
|
+
// bookmark and a shared link all land on it.
|
|
86
|
+
(options.address ?? browserAddress()).setTab(next);
|
|
64
87
|
},
|
|
65
88
|
counters: counters.status === "error"
|
|
66
89
|
? loadFailed(counters.error)
|
|
67
90
|
: counters.data !== undefined
|
|
68
91
|
? loadReady(counters.data)
|
|
69
92
|
: loadLoading(),
|
|
93
|
+
tabCounts,
|
|
70
94
|
rows,
|
|
71
95
|
blockedRows,
|
|
72
96
|
page,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyListings.js","sourceRoot":"","sources":["../../src/headless/MyListings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,EACT,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"MyListings.js","sourceRoot":"","sources":["../../src/headless/MyListings.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,EACT,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,gB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CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,MAAM,GAAG,QAAQ,EAAE,WAAW,CAAC;YACrC,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO;YAC3B,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,IAAI;QACJ,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;YACzB,KAAK,YAAY,CAAC,OAAO,EAAE,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,UAAU,CACxB,KAEC;IAED,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC,OAAO,4BAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAI,CAAC;AACpC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,8 @@ export type { LifecycleCaption, ListingStatusTone, ListingStatusView, Moderation
|
|
|
69
69
|
export { LISTING_TRANSITIONS, OWNER_TRANSITIONS, canDelete, canTransition, ownerMoves, } from "./model/transitions.js";
|
|
70
70
|
export { defaultMyListingsSource } from "./model/mineSource.js";
|
|
71
71
|
export type { MyListingsSource } from "./model/mineSource.js";
|
|
72
|
+
export { MY_LISTINGS_TAB_PARAM, NO_ADDRESS, browserAddress, searchWithTab, tabFromSearch, } from "./model/tabAddress.js";
|
|
73
|
+
export type { MyListingsAddress } from "./model/tabAddress.js";
|
|
72
74
|
export { myListingImages, myListingPrice, myListingTitle, showsDraft, } from "./model/mine.js";
|
|
73
75
|
export { EMPTY_LOCATION, createDraftBody, draftPatchFromValues, draftValuesFromDetail, draftValuesFromWire, droppedFeatureSlugs, emptyDraftValues, retainKnownFeatureValues, } from "./model/draft.js";
|
|
74
76
|
export type { EmptyDraftOptions, ListingDraftValues, ListingLocation, } from "./model/draft.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,aAAa,IAAI,iBAAiB,EAClC,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,OAAO,GACR,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB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ANSITIONS, OWNER_TRANSITIONS, canDelete, canTransition, ownerMoves, } from "./model/transitions.js";
|
|
69
69
|
// ── model: the owner's own rows ──────────────────────────────────────────────
|
|
70
70
|
export { defaultMyListingsSource } from "./model/mineSource.js";
|
|
71
|
+
export { MY_LISTINGS_TAB_PARAM, NO_ADDRESS, browserAddress, searchWithTab, tabFromSearch, } from "./model/tabAddress.js";
|
|
71
72
|
export { myListingImages, myListingPrice, myListingTitle, showsDraft, } from "./model/mine.js";
|
|
72
73
|
// ── model: the draft twin ────────────────────────────────────────────────────
|
|
73
74
|
export { EMPTY_LOCATION, createDraftBody, draftPatchFromValues, draftValuesFromDetail, draftValuesFromWire, droppedFeatureSlugs, emptyDraftValues, retainKnownFeatureValues, } from "./model/draft.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,GACd,MAAM,gBAAgB,CAAC;AAiCxB,gFAAgF;AAChF,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,UAAU,GACX,MAAM,wBAAwB,CAAC;AAEhC,gFAAgF;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,U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A0B,CAAC;AAKrE,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAMrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAOjE,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,gFAAgF;AAChF,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,iCAAiC,EACjC,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MyListingsTab } from "./status.js";
|
|
2
|
+
/** The query parameter the tab lives in. */
|
|
3
|
+
export declare const MY_LISTINGS_TAB_PARAM = "tab";
|
|
4
|
+
/**
|
|
5
|
+
* The tab a query string names, or `undefined`.
|
|
6
|
+
*
|
|
7
|
+
* An unknown value is `undefined` and NOT an error: a link written by hand, a
|
|
8
|
+
* tab this build has dropped, or a `?tab=` some other component on the page
|
|
9
|
+
* owns must all fall back to the host's `initialTab` rather than throwing or
|
|
10
|
+
* opening an empty list.
|
|
11
|
+
*/
|
|
12
|
+
export declare function tabFromSearch(search: string): MyListingsTab | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The same query string with the tab written into it.
|
|
15
|
+
*
|
|
16
|
+
* Every other parameter is preserved verbatim and in place: the dashboard is
|
|
17
|
+
* one component on somebody's page, and rewriting an address it does not own
|
|
18
|
+
* would drop whatever else is in it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function searchWithTab(search: string, tab: MyListingsTab): string;
|
|
21
|
+
/**
|
|
22
|
+
* The address binding. A host with a router passes its own; absent, the
|
|
23
|
+
* browser's is used and a non-DOM environment gets one that does nothing.
|
|
24
|
+
*/
|
|
25
|
+
export interface MyListingsAddress {
|
|
26
|
+
/** The current query string, `?`-prefixed or not — both parse. */
|
|
27
|
+
readonly search: string;
|
|
28
|
+
/** Write the tab. See the module note for why this replaces. */
|
|
29
|
+
setTab(tab: MyListingsTab): void;
|
|
30
|
+
}
|
|
31
|
+
/** An address that carries nothing and remembers nothing — SSR, and a host
|
|
32
|
+
* that opts out. */
|
|
33
|
+
export declare const NO_ADDRESS: MyListingsAddress;
|
|
34
|
+
/**
|
|
35
|
+
* The browser's own address, or {@link NO_ADDRESS} where there is no document.
|
|
36
|
+
*
|
|
37
|
+
* Read fresh on every call rather than captured: the host's router may have
|
|
38
|
+
* navigated since this component mounted, and a stale copy would write back
|
|
39
|
+
* an address that is no longer on screen.
|
|
40
|
+
*/
|
|
41
|
+
export declare function browserAddress(): MyListingsAddress;
|
|
42
|
+
//# sourceMappingURL=tabAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabAddress.d.ts","sourceRoot":"","sources":["../../src/model/tabAddress.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,4CAA4C;AAC5C,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAIvE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM,CAKxE;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC;CAClC;AAED;oBACoB;AACpB,eAAO,MAAM,UAAU,EAAE,iBAGxB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,iBAAiB,CAelD"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard's open tab, IN THE ADDRESS.
|
|
3
|
+
*
|
|
4
|
+
* `<MyListingsPane>` kept its tab in component state, which is the same as
|
|
5
|
+
* keeping it nowhere: `/account/listings?tab=drafts` opened Active, a reload
|
|
6
|
+
* threw the tab away, and a seller who wanted to send somebody (or themselves,
|
|
7
|
+
* tomorrow) to their drafts had no address that meant "drafts". "Which of my
|
|
8
|
+
* three lists am I looking at" is exactly the kind of state a URL is for —
|
|
9
|
+
* `@stapel/search-react` says the same thing at length about its filters.
|
|
10
|
+
*
|
|
11
|
+
* ── Why this module and not a router ─────────────────────────────────────
|
|
12
|
+
*
|
|
13
|
+
* This pair carries no router and must not grow one: a package that reached
|
|
14
|
+
* for `react-router` would be unusable in a Next.js app and vice versa. So the
|
|
15
|
+
* address is read and written through the two DOM APIs every browser has, and
|
|
16
|
+
* the whole of that contact is here — three pure functions plus one guarded
|
|
17
|
+
* read/write pair, so a test can exercise the rules without a window and a
|
|
18
|
+
* host with its own router can pass {@link MyListingsAddress} instead.
|
|
19
|
+
*
|
|
20
|
+
* ── replace, not push ────────────────────────────────────────────────────
|
|
21
|
+
*
|
|
22
|
+
* Switching tab is a READ of your own dashboard, not a step in a flow. A
|
|
23
|
+
* `pushState` per tab would make Back walk Archive → Drafts → Active before it
|
|
24
|
+
* left the dashboard at all, which is the history churn `@stapel/search-react`
|
|
25
|
+
* documents for its own "a filter is a read" decision. `replaceState` keeps
|
|
26
|
+
* the address shareable and reloadable, which is the whole point, and leaves
|
|
27
|
+
* Back meaning "the page before this one".
|
|
28
|
+
*/
|
|
29
|
+
import { MY_LISTINGS_TABS } from "./status.js";
|
|
30
|
+
/** The query parameter the tab lives in. */
|
|
31
|
+
export const MY_LISTINGS_TAB_PARAM = "tab";
|
|
32
|
+
/**
|
|
33
|
+
* The tab a query string names, or `undefined`.
|
|
34
|
+
*
|
|
35
|
+
* An unknown value is `undefined` and NOT an error: a link written by hand, a
|
|
36
|
+
* tab this build has dropped, or a `?tab=` some other component on the page
|
|
37
|
+
* owns must all fall back to the host's `initialTab` rather than throwing or
|
|
38
|
+
* opening an empty list.
|
|
39
|
+
*/
|
|
40
|
+
export function tabFromSearch(search) {
|
|
41
|
+
const value = new URLSearchParams(search).get(MY_LISTINGS_TAB_PARAM);
|
|
42
|
+
if (value === null)
|
|
43
|
+
return undefined;
|
|
44
|
+
return MY_LISTINGS_TABS.find((tab) => tab === value);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The same query string with the tab written into it.
|
|
48
|
+
*
|
|
49
|
+
* Every other parameter is preserved verbatim and in place: the dashboard is
|
|
50
|
+
* one component on somebody's page, and rewriting an address it does not own
|
|
51
|
+
* would drop whatever else is in it.
|
|
52
|
+
*/
|
|
53
|
+
export function searchWithTab(search, tab) {
|
|
54
|
+
const params = new URLSearchParams(search);
|
|
55
|
+
params.set(MY_LISTINGS_TAB_PARAM, tab);
|
|
56
|
+
const next = params.toString();
|
|
57
|
+
return next.length > 0 ? `?${next}` : "";
|
|
58
|
+
}
|
|
59
|
+
/** An address that carries nothing and remembers nothing — SSR, and a host
|
|
60
|
+
* that opts out. */
|
|
61
|
+
export const NO_ADDRESS = {
|
|
62
|
+
search: "",
|
|
63
|
+
setTab: () => undefined,
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The browser's own address, or {@link NO_ADDRESS} where there is no document.
|
|
67
|
+
*
|
|
68
|
+
* Read fresh on every call rather than captured: the host's router may have
|
|
69
|
+
* navigated since this component mounted, and a stale copy would write back
|
|
70
|
+
* an address that is no longer on screen.
|
|
71
|
+
*/
|
|
72
|
+
export function browserAddress() {
|
|
73
|
+
if (typeof window === "undefined" || typeof window.history === "undefined") {
|
|
74
|
+
return NO_ADDRESS;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
search: window.location.search,
|
|
78
|
+
setTab: (tab) => {
|
|
79
|
+
const next = searchWithTab(window.location.search, tab);
|
|
80
|
+
window.history.replaceState(window.history.state, "", `${window.location.pathname}${next}${window.location.hash}`);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=tabAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabAddress.js","sourceRoot":"","sources":["../../src/model/tabAddress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACrE,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,GAAkB;IAC9D,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC/B,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAaD;oBACoB;AACpB,MAAM,CAAC,MAAM,UAAU,GAAsB;IAC3C,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;CACxB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QAC3E,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM;QAC9B,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;YACd,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACxD,MAAM,CAAC,OAAO,CAAC,YAAY,CACzB,MAAM,CAAC,OAAO,CAAC,KAAK,EACpB,EAAE,EACF,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAC5D,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/llms.txt
CHANGED
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$generated": "by scripts/gen-manifest.mjs — do not edit; drift-gated (pnpm gen:manifest:check)",
|
|
3
3
|
"package": "@stapel/listings-react",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.3",
|
|
5
5
|
"backend": {
|
|
6
6
|
"module": "stapel-listings",
|
|
7
7
|
"contract": ">=0.21 <0.22"
|
|
@@ -1182,15 +1182,18 @@
|
|
|
1182
1182
|
"ListingsRuntimeContext",
|
|
1183
1183
|
"MODERATION_STATUSES",
|
|
1184
1184
|
"MY_LISTINGS_TABS",
|
|
1185
|
+
"MY_LISTINGS_TAB_PARAM",
|
|
1185
1186
|
"MY_LISTINGS_TAB_STATUSES",
|
|
1186
1187
|
"MY_LISTINGS_UNTABBED_STATUSES",
|
|
1187
1188
|
"MyListings",
|
|
1189
|
+
"NO_ADDRESS",
|
|
1188
1190
|
"OWNER_TRANSITIONS",
|
|
1189
1191
|
"PRICE_FIELD",
|
|
1190
1192
|
"TITLE_FIELD",
|
|
1191
1193
|
"asFeatureDaoList",
|
|
1192
1194
|
"badgePresentation",
|
|
1193
1195
|
"badgeValueText",
|
|
1196
|
+
"browserAddress",
|
|
1194
1197
|
"canDelete",
|
|
1195
1198
|
"canTransition",
|
|
1196
1199
|
"cardBadgeText",
|
|
@@ -1239,7 +1242,9 @@
|
|
|
1239
1242
|
"publishRefusal",
|
|
1240
1243
|
"registerListingsI18n",
|
|
1241
1244
|
"retainKnownFeatureValues",
|
|
1245
|
+
"searchWithTab",
|
|
1242
1246
|
"showsDraft",
|
|
1247
|
+
"tabFromSearch",
|
|
1243
1248
|
"tabOf",
|
|
1244
1249
|
"unreadableFeatureCount",
|
|
1245
1250
|
"useArchiveListing",
|
|
@@ -1335,6 +1340,7 @@
|
|
|
1335
1340
|
"ModerationNotice",
|
|
1336
1341
|
"MyCounters",
|
|
1337
1342
|
"MyListingCard",
|
|
1343
|
+
"MyListingsAddress",
|
|
1338
1344
|
"MyListingsBag",
|
|
1339
1345
|
"MyListingsParams",
|
|
1340
1346
|
"MyListingsSource",
|
package/nav-manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/listings-react",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3",
|
|
4
4
|
"description": "Headless React pair for stapel-listings: a typed client over the draft twin, the composer that turns a category schema into a submittable listing, and the owner's dashboard. Two independent axes are rendered as two — lifecycle `status` decides visibility and `moderation_status` decides nothing about it, so an edit to a live listing stays live and says 'under review' instead of vanishing. Feature values are drawn and mirrored by @stapel/attributes-react; photos arrive as an injected upload bag whose `refs` ARE `images_draft` and whose `settled` gates the submit; a publish refusal is routed onto the control that caused it by slug. Zero visual opinion in the main entry; an opt-in /default subpath ships the antd skin.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
"size-limit": "^11.2.0",
|
|
103
103
|
"typescript": "^5.8.3",
|
|
104
104
|
"vitest": "^3.2.4",
|
|
105
|
-
"@stapel/attributes-react": "^0.16.
|
|
106
|
-
"@stapel/core": "^0.25.
|
|
105
|
+
"@stapel/attributes-react": "^0.16.1",
|
|
106
|
+
"@stapel/core": "^0.25.4",
|
|
107
107
|
"@stapel/currencies-react": "^0.4.0",
|
|
108
|
-
"@stapel/showcase": "^0.3.0",
|
|
109
108
|
"@stapel/image": "^0.4.2",
|
|
110
|
-
"@stapel/
|
|
111
|
-
"@stapel/tokens
|
|
109
|
+
"@stapel/showcase": "^0.3.0",
|
|
110
|
+
"@stapel/tokens": "^0.8.0",
|
|
111
|
+
"@stapel/tokens-antd": "^0.17.2"
|
|
112
112
|
},
|
|
113
113
|
"engines": {
|
|
114
114
|
"node": ">=22"
|
|
@@ -130,16 +130,51 @@ export interface ListingDetailPaneProps
|
|
|
130
130
|
* reads the viewport.
|
|
131
131
|
*/
|
|
132
132
|
readonly layout?: "column" | "split";
|
|
133
|
+
/**
|
|
134
|
+
* WHO OWNS THE PAGE EDGE.
|
|
135
|
+
*
|
|
136
|
+
* `"own"` (default, byte-compatible) keeps the pane's own `spacing[4]`
|
|
137
|
+
* gutter — right for a host that mounts the pane on a bare route with
|
|
138
|
+
* nothing padding it.
|
|
139
|
+
*
|
|
140
|
+
* `"shell"` says a page frame already placed that edge, so the pane adds
|
|
141
|
+
* none. `@stapel/shell-react` pads its content box with
|
|
142
|
+
* `--stapel-page-gutter` — a RESPONSIVE role, 4px on a phone and 24px on a
|
|
143
|
+
* desktop — and the pane then stacked a flat 16px inside it: a 40px left
|
|
144
|
+
* edge on a desktop, and on a 360px phone a 20px edge on each side eating
|
|
145
|
+
* a ninth of the screen the photos are read on. Two gutters is one gutter
|
|
146
|
+
* too many, and only the host knows whether it has a frame; measured on a
|
|
147
|
+
* live storefront, which worked around it by negatively margining the pane
|
|
148
|
+
* back out to the frame's edge.
|
|
149
|
+
*/
|
|
150
|
+
readonly gutter?: "own" | "shell";
|
|
133
151
|
/**
|
|
134
152
|
* The host's seller block (a profile card, ratings, "member since" — a
|
|
135
153
|
* different pair's data, so it arrives as a node). In `"split"` it renders
|
|
136
154
|
* inside the sticky buy column, under the actions, where the reference
|
|
137
|
-
* design keeps it. In `"column"`
|
|
138
|
-
*
|
|
139
|
-
* position the footer already holds, so a host passing both gets seller
|
|
140
|
-
* block then footer, in that order.
|
|
155
|
+
* design keeps it. In `"column"` it takes the position
|
|
156
|
+
* {@link asidePlacement} names.
|
|
141
157
|
*/
|
|
142
158
|
readonly aside?: ReactNode;
|
|
159
|
+
/**
|
|
160
|
+
* Where {@link aside} sits in the ONE-COLUMN arm (`layout="column"`);
|
|
161
|
+
* ignored in `"split"`, where the buy column already puts it under the
|
|
162
|
+
* actions.
|
|
163
|
+
*
|
|
164
|
+
* - `"end"` (default, byte-compatible) — the end of the reading flow,
|
|
165
|
+
* directly above `footer`.
|
|
166
|
+
* - `"after-actions"` — directly under the actions, before the description
|
|
167
|
+
* and the spec table.
|
|
168
|
+
*
|
|
169
|
+
* The phone is the whole argument. `"column"` IS the phone rendering of
|
|
170
|
+
* this page, and there the seller block sat below a description, a spec
|
|
171
|
+
* table and a meta table: measured on a live storefront, "who am I buying
|
|
172
|
+
* from" was two full screens of scrolling below "message the seller" — the
|
|
173
|
+
* two halves of one decision, separated by everything else on the page.
|
|
174
|
+
* The split layout already reads the other way round (price, actions,
|
|
175
|
+
* seller), and this is that reading order for the column.
|
|
176
|
+
*/
|
|
177
|
+
readonly asidePlacement?: "end" | "after-actions";
|
|
143
178
|
/**
|
|
144
179
|
* THE primary action for a buyer: "message the seller", filled by the
|
|
145
180
|
* container from `@stapel/chat-react`. Rendered first, before favouriting,
|
|
@@ -211,7 +246,9 @@ export function ListingDetailPane(props: ListingDetailPaneProps): ReactElement {
|
|
|
211
246
|
surface="base"
|
|
212
247
|
style={{
|
|
213
248
|
maxWidth: split ? DETAIL_SPLIT_MEASURE : DETAIL_MEASURE,
|
|
214
|
-
|
|
249
|
+
// See `gutter`: a frame that already placed the page edge does not get
|
|
250
|
+
// a second one stacked inside it.
|
|
251
|
+
padding: props.gutter === "shell" ? 0 : spacing[4],
|
|
215
252
|
}}
|
|
216
253
|
{...(props.mode !== undefined ? { mode: props.mode } : {})}
|
|
217
254
|
>
|
|
@@ -627,8 +664,12 @@ export function ListingDetailPane(props: ListingDetailPaneProps): ReactElement {
|
|
|
627
664
|
) : null;
|
|
628
665
|
|
|
629
666
|
if (!split) {
|
|
630
|
-
// The single column
|
|
631
|
-
// host's aside joins where the footer's flow already is
|
|
667
|
+
// The single column. `"end"` is the order it has always read —
|
|
668
|
+
// the host's aside joins where the footer's flow already is;
|
|
669
|
+
// `"after-actions"` puts the seller beside the decision to
|
|
670
|
+
// contact them, which is where the split layout already has it.
|
|
671
|
+
const asideAfterActions =
|
|
672
|
+
props.asidePlacement === "after-actions";
|
|
632
673
|
return (
|
|
633
674
|
<>
|
|
634
675
|
{statusBlocks}
|
|
@@ -637,11 +678,12 @@ export function ListingDetailPane(props: ListingDetailPaneProps): ReactElement {
|
|
|
637
678
|
{price}
|
|
638
679
|
{buyBox}
|
|
639
680
|
{actionError}
|
|
681
|
+
{asideAfterActions ? aside : null}
|
|
640
682
|
<Divider />
|
|
641
683
|
{description}
|
|
642
684
|
{specsSection}
|
|
643
685
|
{meta}
|
|
644
|
-
{aside}
|
|
686
|
+
{asideAfterActions ? null : aside}
|
|
645
687
|
{props.footer}
|
|
646
688
|
</>
|
|
647
689
|
);
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
* has to be re-laid-out the day the projection grows the field. The seam is
|
|
74
74
|
* the honest half; the missing data is written down rather than faked.
|
|
75
75
|
*/
|
|
76
|
+
import { Fragment } from "react";
|
|
76
77
|
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
77
78
|
import { Card, Flex, Typography, theme as antdTheme } from "antd";
|
|
78
79
|
import { SkinTheme } from "@stapel/tokens-antd/skin";
|
|
@@ -141,6 +142,22 @@ export interface ListingSerpCardBaseProps
|
|
|
141
142
|
/** The seller's name and rating. See the file header for the per-card fetch
|
|
142
143
|
* caveat a container has to avoid. */
|
|
143
144
|
readonly sellerSlot?: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* Where the seller line sits relative to the place: `"above"` (the default,
|
|
147
|
+
* and what this card has always drawn) or `"below"`.
|
|
148
|
+
*
|
|
149
|
+
* The reference classified — and the host measured against it — reads the
|
|
150
|
+
* bottom of a card as one descending line of PROVENANCE: what it is, then
|
|
151
|
+
* where it is, then who is selling it. This card put the seller between the
|
|
152
|
+
* specs and the place, which reads as part of the description rather than as
|
|
153
|
+
* the answer to "who am I buying from".
|
|
154
|
+
*
|
|
155
|
+
* A prop and not a change, because the order is a surface's decision and
|
|
156
|
+
* some surfaces genuinely want the seller first — a seller's own page, where
|
|
157
|
+
* every card has the same one, keeps it out of the way at the bottom, and a
|
|
158
|
+
* cross-seller feed leads with it. Both stay one line of composition.
|
|
159
|
+
*/
|
|
160
|
+
readonly sellerSlotPosition?: "above" | "below";
|
|
144
161
|
/** The vertical action column at the trailing edge — call, write. The
|
|
145
162
|
* favourite heart is added at its end by this component. */
|
|
146
163
|
readonly actionsRail?: ReactNode;
|
|
@@ -353,18 +370,28 @@ export function ListingSerpCard(props: ListingSerpCardProps): ReactElement {
|
|
|
353
370
|
|
|
354
371
|
{/* Outside the anchor, both of them: a seller line usually holds
|
|
355
372
|
a link to the seller, and the place is the last thing read
|
|
356
|
-
rather than part of what the card is called.
|
|
357
|
-
{props.sellerSlot ?? null}
|
|
373
|
+
rather than part of what the card is called.
|
|
358
374
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
375
|
+
Their ORDER is the surface's — see
|
|
376
|
+
`sellerSlotPosition`. Rendered from one array so the two
|
|
377
|
+
arms cannot drift into two different pairs of nodes. */}
|
|
378
|
+
{(props.sellerSlotPosition === "below"
|
|
379
|
+
? ["location", "seller"]
|
|
380
|
+
: ["seller", "location"]
|
|
381
|
+
).map((part) =>
|
|
382
|
+
part === "seller" ? (
|
|
383
|
+
<Fragment key="seller">{props.sellerSlot ?? null}</Fragment>
|
|
384
|
+
) : listing.location_label !== undefined &&
|
|
385
|
+
listing.location_label.length > 0 ? (
|
|
386
|
+
<Typography.Text
|
|
387
|
+
key="location"
|
|
388
|
+
type="secondary"
|
|
389
|
+
data-testid="listings-serp-location"
|
|
390
|
+
>
|
|
391
|
+
{listing.location_label}
|
|
392
|
+
</Typography.Text>
|
|
393
|
+
) : null
|
|
394
|
+
)}
|
|
368
395
|
</Flex>
|
|
369
396
|
|
|
370
397
|
{rail}
|