@stapel/listings-react 0.25.10 → 0.26.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 +208 -0
- package/README.md +77 -9
- package/dist/api/generated/schema.d.ts +2 -2
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/default/CardBadges.d.ts.map +1 -1
- package/dist/default/CardBadges.js +3 -1
- package/dist/default/CardBadges.js.map +1 -1
- package/dist/default/ListingActions.d.ts +108 -0
- package/dist/default/ListingActions.d.ts.map +1 -0
- package/dist/default/ListingActions.js +29 -0
- package/dist/default/ListingActions.js.map +1 -0
- package/dist/default/ListingCard.d.ts.map +1 -1
- package/dist/default/ListingCard.js +15 -8
- package/dist/default/ListingCard.js.map +1 -1
- package/dist/default/ListingDetailPane.d.ts +76 -56
- package/dist/default/ListingDetailPane.d.ts.map +1 -1
- package/dist/default/ListingDetailPane.js +164 -18
- package/dist/default/ListingDetailPane.js.map +1 -1
- package/dist/default/ListingFeedCard.d.ts.map +1 -1
- package/dist/default/ListingFeedCard.js +2 -1
- package/dist/default/ListingFeedCard.js.map +1 -1
- package/dist/default/ListingPhoto.d.ts.map +1 -1
- package/dist/default/ListingPhoto.js +5 -2
- package/dist/default/ListingPhoto.js.map +1 -1
- package/dist/default/ListingSerpCard.d.ts.map +1 -1
- package/dist/default/ListingSerpCard.js +18 -4
- package/dist/default/ListingSerpCard.js.map +1 -1
- package/dist/default/MyListingsPane.d.ts.map +1 -1
- package/dist/default/MyListingsPane.js +45 -21
- package/dist/default/MyListingsPane.js.map +1 -1
- package/dist/default/ShareAction.d.ts +32 -0
- package/dist/default/ShareAction.d.ts.map +1 -0
- package/dist/default/ShareAction.js +116 -0
- package/dist/default/ShareAction.js.map +1 -0
- package/dist/default/actionRow.d.ts +58 -0
- package/dist/default/actionRow.d.ts.map +1 -0
- package/dist/default/actionRow.js +128 -0
- package/dist/default/actionRow.js.map +1 -0
- package/dist/default/cardGallery.d.ts +2 -0
- package/dist/default/cardGallery.d.ts.map +1 -1
- package/dist/default/cardGallery.js +31 -0
- package/dist/default/cardGallery.js.map +1 -1
- package/dist/default/favorite.d.ts +25 -0
- package/dist/default/favorite.d.ts.map +1 -1
- package/dist/default/favorite.js +29 -3
- package/dist/default/favorite.js.map +1 -1
- package/dist/default/icons.d.ts +19 -0
- package/dist/default/icons.d.ts.map +1 -1
- package/dist/default/icons.js +23 -0
- package/dist/default/icons.js.map +1 -1
- package/dist/default/index.d.ts +8 -1
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +6 -1
- package/dist/default/index.js.map +1 -1
- package/dist/default/notice.d.ts +14 -0
- package/dist/default/notice.d.ts.map +1 -0
- package/dist/default/notice.js +62 -0
- package/dist/default/notice.js.map +1 -0
- package/dist/headless/MyListings.d.ts +39 -18
- package/dist/headless/MyListings.d.ts.map +1 -1
- package/dist/headless/MyListings.js +41 -19
- package/dist/headless/MyListings.js.map +1 -1
- package/dist/headless/Share.d.ts +103 -0
- package/dist/headless/Share.d.ts.map +1 -0
- package/dist/headless/Share.js +190 -0
- package/dist/headless/Share.js.map +1 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +21 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/generated/errors.es.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.es.gen.js +1 -1
- package/dist/i18n/generated/errors.gen.d.ts +18 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +9 -0
- package/dist/i18n/generated/errors.gen.js.map +1 -1
- package/dist/i18n/generated/errors.ru.gen.d.ts +1 -1
- package/dist/i18n/generated/errors.ru.gen.js +1 -1
- package/dist/i18n/keys.d.ts +45 -0
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +60 -0
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +21 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model/cardBadges.d.ts +52 -3
- package/dist/model/cardBadges.d.ts.map +1 -1
- package/dist/model/cardBadges.js +74 -12
- package/dist/model/cardBadges.js.map +1 -1
- package/dist/model/mineSource.d.ts +9 -3
- package/dist/model/mineSource.d.ts.map +1 -1
- package/dist/model/mineSource.js.map +1 -1
- package/dist/model/status.d.ts +62 -13
- package/dist/model/status.d.ts.map +1 -1
- package/dist/model/status.js +69 -15
- package/dist/model/status.js.map +1 -1
- package/llms.txt +8 -3
- package/manifest.json +96 -4
- package/nav-manifest.json +1 -1
- package/package.json +10 -10
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +2 -2
- package/src/default/CardBadges.tsx +3 -1
- package/src/default/ListingActions.tsx +196 -0
- package/src/default/ListingCard.tsx +79 -43
- package/src/default/ListingDetailPane.tsx +268 -81
- package/src/default/ListingFeedCard.tsx +2 -0
- package/src/default/ListingPhoto.tsx +28 -0
- package/src/default/ListingSerpCard.tsx +39 -12
- package/src/default/MyListingsPane.tsx +77 -44
- package/src/default/ShareAction.tsx +260 -0
- package/src/default/actionRow.ts +131 -0
- package/src/default/cardGallery.ts +31 -0
- package/src/default/favorite.tsx +68 -1
- package/src/default/icons.tsx +60 -0
- package/src/default/index.ts +23 -0
- package/src/default/notice.ts +68 -0
- package/src/headless/MyListings.tsx +89 -38
- package/src/headless/Share.tsx +278 -0
- package/src/i18n/es.ts +28 -0
- package/src/i18n/generated/errors.es.gen.ts +1 -1
- package/src/i18n/generated/errors.gen.ts +9 -0
- package/src/i18n/generated/errors.json +31 -0
- package/src/i18n/generated/errors.ru.gen.ts +1 -1
- package/src/i18n/keys.ts +63 -0
- package/src/i18n/ru.ts +28 -0
- package/src/index.ts +22 -0
- package/src/model/cardBadges.ts +124 -12
- package/src/model/mineSource.ts +9 -3
- package/src/model/status.ts +85 -18
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<ListingActions>` — save it, or send it to somebody. The two verbs a
|
|
3
|
+
* classified puts beside a listing's title, in one cluster.
|
|
4
|
+
*
|
|
5
|
+
* ── Why they are one component and not two buttons in a row ───────────────
|
|
6
|
+
*
|
|
7
|
+
* Because everything that makes them usable is a property of the PAIR, not of
|
|
8
|
+
* either control: they share a hit-target tier, they share the corner of the
|
|
9
|
+
* photograph they are pinned to on a phone, and the reason they are icon-only
|
|
10
|
+
* on the listing page is that there are two of them and a price on one line.
|
|
11
|
+
* Measured against the reference (§23): our listing page drew a 152px
|
|
12
|
+
* "Save to favourites" button with a word in it at every width, where the
|
|
13
|
+
* reference draws a 44×44 glyph on a desktop and 36×36 on a phone and puts
|
|
14
|
+
* the share glyph beside it. Two components could not have been given that
|
|
15
|
+
* ruling once.
|
|
16
|
+
*
|
|
17
|
+
* ── The NAME of `<ListingActions>` and of `useListingActions` ─────────────
|
|
18
|
+
*
|
|
19
|
+
* They are different things and the collision is worth stating rather than
|
|
20
|
+
* renaming around. `useListingActions` (the headless entry) is the SELLER's
|
|
21
|
+
* lifecycle moves — archive, mark sold, delete — the owner's half of the
|
|
22
|
+
* state machine. This is the READER's two actions, and it lives in
|
|
23
|
+
* `/default` because it is a layout. Neither is exported from the other's
|
|
24
|
+
* barrel.
|
|
25
|
+
*
|
|
26
|
+
* ── The heart arrives as a node when the surface already has one ──────────
|
|
27
|
+
*
|
|
28
|
+
* The listing page's heart is driven by `useListingDetail`'s own optimistic
|
|
29
|
+
* bag (it holds the whole listing, so it flips the row it already has),
|
|
30
|
+
* while a card's is driven by `useFavoriteToggle` against a card row. Two
|
|
31
|
+
* hooks, one control — so the cluster takes {@link ListingActionsProps.favorite}
|
|
32
|
+
* as a node for a surface that already built one, and mounts the shared
|
|
33
|
+
* `<FavoriteHeart>` for everyone else. What it never does is let the two
|
|
34
|
+
* surfaces disagree about SIZE, PLACEMENT or ORDER, which is the whole job.
|
|
35
|
+
*
|
|
36
|
+
* ── There is no favourite count on the wire, and this does not invent one ─
|
|
37
|
+
*
|
|
38
|
+
* `ListingCard`/`ListingDetail` carry `is_favorited` — a per-reader boolean —
|
|
39
|
+
* and no aggregate anywhere (asserted in `test/engagementState`). So
|
|
40
|
+
* {@link ListingActionsProps.favoriteCount} is a number the HOST was given by
|
|
41
|
+
* something else, rendered when it is there and absent when it is not. Never
|
|
42
|
+
* a zero standing in for "nobody counted".
|
|
43
|
+
*/
|
|
44
|
+
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
45
|
+
import type { SignInCta } from "@stapel/core";
|
|
46
|
+
import type { ShareChannel } from "../headless/Share.js";
|
|
47
|
+
/**
|
|
48
|
+
* Which of the two the host wants drawn.
|
|
49
|
+
*
|
|
50
|
+
* Both default to `true`: a pair whose share button had to be switched ON
|
|
51
|
+
* would have shipped a storefront with no share button, which is the exact
|
|
52
|
+
* defect this wave answers. `{ share: false }` is for a deployment that has
|
|
53
|
+
* decided against it — a private marketplace, an internal catalogue — and
|
|
54
|
+
* `{ favorite: false }` for a surface where saving makes no sense (the
|
|
55
|
+
* owner's own listing).
|
|
56
|
+
*/
|
|
57
|
+
export interface ListingActionsConfig {
|
|
58
|
+
readonly favorite?: boolean;
|
|
59
|
+
readonly share?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface ListingActionsProps {
|
|
62
|
+
readonly listingId: number;
|
|
63
|
+
/** `is_favorited` off the row — ignored when {@link favorite} is given. */
|
|
64
|
+
readonly favorited?: boolean | null | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The surface's own heart, when it has one. See the file header: the
|
|
67
|
+
* listing page's heart is driven by a different hook from a card's, and
|
|
68
|
+
* this cluster's job is the geometry, not the hook.
|
|
69
|
+
*/
|
|
70
|
+
readonly favorite?: ReactNode;
|
|
71
|
+
/** How many people saved it, when the host knows. Absent draws nothing —
|
|
72
|
+
* the wire carries no such aggregate. */
|
|
73
|
+
readonly favoriteCount?: number;
|
|
74
|
+
/** The listing's canonical address — a path or an absolute URL. Given, it
|
|
75
|
+
* is what is shared and `window.location` is never read. */
|
|
76
|
+
readonly shareUrl?: string;
|
|
77
|
+
/** The listing's title: the share sheet's heading. */
|
|
78
|
+
readonly shareTitle?: string;
|
|
79
|
+
/** A line under it in the sheet — the price, typically. */
|
|
80
|
+
readonly shareText?: string;
|
|
81
|
+
readonly onShared?: (channel: ShareChannel) => void;
|
|
82
|
+
/** The container's sign-in door for the heart. */
|
|
83
|
+
readonly signIn?: SignInCta;
|
|
84
|
+
/** How loudly a blocked heart speaks — only consulted when this cluster
|
|
85
|
+
* mounts the heart itself. */
|
|
86
|
+
readonly blockedReason?: "text" | "popover";
|
|
87
|
+
/** A short toast on each successful favourite press. */
|
|
88
|
+
readonly announce?: boolean;
|
|
89
|
+
/** See {@link ListingActionsConfig}. */
|
|
90
|
+
readonly actions?: ListingActionsConfig;
|
|
91
|
+
/**
|
|
92
|
+
* `"inline"` (default) is a row wherever the surface put it.
|
|
93
|
+
*
|
|
94
|
+
* `"overlay"` pins the cluster to the TRAILING TOP corner of the media it
|
|
95
|
+
* is drawn over — the one corner of a card gallery that is free, because
|
|
96
|
+
* the dots own the bottom centre and the "3 of 16" counter owns the bottom
|
|
97
|
+
* trailing corner. The element it is pinned inside must be a containing
|
|
98
|
+
* block; every media well in this package already is.
|
|
99
|
+
*/
|
|
100
|
+
readonly placement?: "inline" | "overlay";
|
|
101
|
+
/** This cluster's test id. Default `listings-actions`. */
|
|
102
|
+
readonly testId?: string;
|
|
103
|
+
/** The heart's test id, when this cluster mounts it. */
|
|
104
|
+
readonly favoriteTestId?: string;
|
|
105
|
+
readonly style?: CSSProperties;
|
|
106
|
+
}
|
|
107
|
+
export declare function ListingActions(props: ListingActionsProps): ReactElement | null;
|
|
108
|
+
//# sourceMappingURL=ListingActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListingActions.d.ts","sourceRoot":"","sources":["../../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xC,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC1C,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CA0E9E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Typography } from "antd";
|
|
3
|
+
import { useT } from "@stapel/core";
|
|
4
|
+
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
5
|
+
import { FavoriteHeart } from "./favorite.js";
|
|
6
|
+
import { ShareAction } from "./ShareAction.js";
|
|
7
|
+
import { LISTING_ACTIONS_CLASS, LISTING_ACTIONS_OVERLAY_CLASS, LISTING_ACTIONS_STYLE_HREF, LISTING_ACTION_CLASS, actionRowCss, } from "./actionRow.js";
|
|
8
|
+
export function ListingActions(props) {
|
|
9
|
+
const t = useT();
|
|
10
|
+
const testId = props.testId ?? "listings-actions";
|
|
11
|
+
const showFavorite = props.actions?.favorite !== false;
|
|
12
|
+
const showShare = props.actions?.share !== false;
|
|
13
|
+
const overlay = props.placement === "overlay";
|
|
14
|
+
// Nothing asked for is nothing drawn — not an empty box with a gap in it.
|
|
15
|
+
if (!showFavorite && !showShare)
|
|
16
|
+
return null;
|
|
17
|
+
const heart = !showFavorite ? null : (props.favorite ?? (_jsx(FavoriteHeart, { listingId: props.listingId, favorited: props.favorited, testId: props.favoriteTestId ?? `${testId}-favorite`, className: LISTING_ACTION_CLASS, ...(props.announce === true ? { announce: true } : {}), ...(props.blockedReason !== undefined
|
|
18
|
+
? { blockedReason: props.blockedReason }
|
|
19
|
+
: {}), ...(props.signIn !== undefined ? { signIn: props.signIn } : {}) })));
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { href: LISTING_ACTIONS_STYLE_HREF, precedence: "default", children: actionRowCss() }), _jsxs(Flex, { align: "flex-end", className: overlay
|
|
21
|
+
? `${LISTING_ACTIONS_CLASS} ${LISTING_ACTIONS_OVERLAY_CLASS}`
|
|
22
|
+
: LISTING_ACTIONS_CLASS, "data-testid": testId, "data-placement": overlay ? "overlay" : "inline", ...(props.style !== undefined ? { style: props.style } : {}), children: [heart, showFavorite && props.favoriteCount !== undefined ? (_jsx(Typography.Text, { type: "secondary", "data-testid": `${testId}-favorite-count`, children: t(LISTINGS_I18N_KEYS.favoriteCount, { count: props.favoriteCount }) })) : null, showShare ? (_jsx(ShareAction, { testId: `${testId}-share`,
|
|
23
|
+
// Icon-only in the cluster, at both placements: two glyphs and a
|
|
24
|
+
// price share one line on a phone, and the reference draws the
|
|
25
|
+
// page's actions as glyphs on a desktop too (§23). The verb is
|
|
26
|
+
// still the control's accessible name in every arm.
|
|
27
|
+
shape: "circle", ...(props.shareUrl !== undefined ? { url: props.shareUrl } : {}), ...(props.shareTitle !== undefined ? { title: props.shareTitle } : {}), ...(props.shareText !== undefined ? { text: props.shareText } : {}), ...(props.onShared !== undefined ? { onShared: props.onShared } : {}) })) : null] })] }));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ListingActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListingActions.js","sourceRoot":"","sources":["../../src/default/ListingActions.tsx"],"names":[],"mappings":";AA4CA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA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KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACnE,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAChE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GACtE,CACH,CAAC,CAAC,CAAC,IAAI,IACH,IACN,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCard.d.ts","sourceRoot":"","sources":["../../src/default/ListingCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ListingCard.d.ts","sourceRoot":"","sources":["../../src/default/ListingCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,EAAE,WAA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from "../model/engagement.js";
|
|
|
9
9
|
import { useEngagedListing } from "../headless/Engagement.js";
|
|
10
10
|
import { useFavoriteToggle } from "../headless/Favorites.js";
|
|
11
11
|
import { FavoriteHeart } from "./favorite.js";
|
|
12
|
+
import { LISTING_ACTIONS_CLASS, LISTING_ACTIONS_OVERLAY_CLASS, LISTING_CARD_ACTION_CLASS, } from "./actionRow.js";
|
|
12
13
|
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
13
14
|
import { CardBadges, CardSpecLine } from "./CardBadges.js";
|
|
14
15
|
import { SignInLink } from "./SignInLink.js";
|
|
@@ -138,7 +139,10 @@ export function cardTargetCss() {
|
|
|
138
139
|
// of pictures with a torn right edge. One radius, stated by the card,
|
|
139
140
|
// applied to the box that holds the pictures; the slides inside it are
|
|
140
141
|
// square because the well is what has the shape.
|
|
141
|
-
|
|
142
|
+
// `position:relative` is the containing block the favourite overlay is
|
|
143
|
+
// pinned inside (see `LISTING_ACTIONS_OVERLAY_CLASS`). A `relative` with
|
|
144
|
+
// no offsets moves no pixel of what is already in the well.
|
|
145
|
+
`${media}{position:relative;min-inline-size:0;overflow:hidden;` +
|
|
142
146
|
`border-start-start-radius:var(--listing-card-radius);` +
|
|
143
147
|
`border-start-end-radius:var(--listing-card-radius)}`,
|
|
144
148
|
`${media} .${SKIN_CAROUSEL_SLIDE_CLASS}{border-radius:0}`,
|
|
@@ -317,14 +321,17 @@ export function ListingCard(props) {
|
|
|
317
321
|
// The theme's own elevation, so the lift is the same one every
|
|
318
322
|
// raised surface in the skin uses and it is right in both modes.
|
|
319
323
|
["--listing-card-hover-shadow"]: token.boxShadowSecondary,
|
|
320
|
-
}, children: _jsx("div", { className: CARD_QUERY_CLASS, children: _jsxs("div", { className: `${CARD_FRAME_CLASS} ${CARD_BLEED_CLASS}`, children: [
|
|
321
|
-
|
|
322
|
-
|
|
324
|
+
}, children: _jsx("div", { className: CARD_QUERY_CLASS, children: _jsxs("div", { className: `${CARD_FRAME_CLASS} ${CARD_BLEED_CLASS}`, children: [_jsxs("div", { className: CARD_MEDIA_CLASS, children: [_jsx(ListingPhotoStrip, { images: listing.images ?? [], title: title.length > 0 ? title : String(listing.id), testId: "listings-card-photos", ...(props.href !== undefined ? { href: props.href } : {}), ...(props.href !== undefined && props.linkComponent !== undefined
|
|
325
|
+
? { linkComponent: props.linkComponent }
|
|
326
|
+
: {}) }), props.showFavorite === false ? null : (_jsx("div", { className: `${LISTING_ACTIONS_CLASS} ${LISTING_ACTIONS_OVERLAY_CLASS}`, "data-testid": "listings-card-favorite-overlay", onClick: (event) => {
|
|
327
|
+
event.stopPropagation();
|
|
328
|
+
}, children: _jsx(FavoriteHeart, { listingId: listing.id, favorited: listing.is_favorited, testId: "listings-card-favorite", gateTestId: "listings-card-actions", signInTestId: "listings-card-sign-in", className: LISTING_CARD_ACTION_CLASS, ...(blockedReason === "popover"
|
|
329
|
+
? { blockedReason: "popover" }
|
|
330
|
+
: {}), ...(props.signIn !== undefined ? { signIn: props.signIn } : {}) }) }))] }), _jsxs("div", { className: CARD_MAIN_CLASS, children: [_jsx(CardTarget, { ...props, listingId: listing.id, label: targetLabel, children: content }), props.showFavorite === false ||
|
|
331
|
+
favoriteGate.reason === undefined ||
|
|
332
|
+
blockedReason !== "text" ? null : (_jsx("div", { style: {
|
|
323
333
|
paddingInline: token.paddingSM,
|
|
324
334
|
paddingBlockEnd: token.paddingSM,
|
|
325
|
-
}, children:
|
|
326
|
-
? { blockedReason: "popover" }
|
|
327
|
-
: {}), ...(props.signIn !== undefined ? { signIn: props.signIn } : {}) }) }), favoriteGate.reason === undefined ||
|
|
328
|
-
blockedReason !== "text" ? null : (_jsx(Typography.Text, { type: "secondary", "data-testid": "listings-card-favorite-blocked", children: _jsx(SignInLink, { cta: props.signIn, testId: "listings-card-sign-in" }) }))] }))] })] }) }) })] }));
|
|
335
|
+
}, children: _jsx(Typography.Text, { type: "secondary", "data-testid": "listings-card-favorite-blocked", children: _jsx(SignInLink, { cta: props.signIn, testId: "listings-card-sign-in" }) }) }))] })] }) }) })] }));
|
|
329
336
|
}
|
|
330
337
|
//# sourceMappingURL=ListingCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingCard.js","sourceRoot":"","sources":["../../src/default/ListingCard.tsx"],"names":[],"mappings":";AA2GA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA6EjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAC9D;;0CAE0C;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACxD,iDAAiD;AACjD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K,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,YAC7D,OAAO,GACG,EAQZ,KAAK,CAAC,YAAY,KAAK,KAAK;wCAC7B,YAAY,CAAC,MAAM,KAAK,SAAS;wCACjC,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAChC,cACE,KAAK,EAAE;4CACL,aAAa,EAAE,KAAK,CAAC,SAAS;4CAC9B,eAAe,EAAE,KAAK,CAAC,SAAS;yCACjC,YASD,KAAC,UAAU,CAAC,IAAI,IACd,IAAI,EAAC,WAAW,iBACJ,gCAAgC,YAE5C,KAAC,UAAU,IAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAC,uBAAuB,GAAG,GAChD,GACd,CACP,IACG,IACF,GACF,GACD,IACG,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<ListingDetailPane>` — the listing page, and the page a marketplace makes
|
|
3
|
-
* its money on.
|
|
4
|
-
*
|
|
5
|
-
* Five distinct absences, five distinct sentences, and the whole point of the
|
|
6
|
-
* component is that none of them collapses into another:
|
|
7
|
-
*
|
|
8
|
-
* loading — we are asking
|
|
9
|
-
* failed — we could not ask (retry, never "nothing here")
|
|
10
|
-
* not found — no listing ever had this id
|
|
11
|
-
* removed — one did, and it is gone (the AllowAny status probe
|
|
12
|
-
* is the only read that can still say so)
|
|
13
|
-
* withdrawn — one did, and its owner took it off the shelf: the
|
|
14
|
-
* detail 404s while the probe still answers "not
|
|
15
|
-
* deleted". NO retry — nothing a retry could change.
|
|
16
|
-
*
|
|
17
|
-
* On top of that, a listing that IS returned may still not be on sale: the
|
|
18
|
-
* detail endpoint has no `published()` filter, so a draft answers 200 to
|
|
19
|
-
* anyone holding the id. The pane says which side of that it is on rather
|
|
20
|
-
* than dressing a draft up as a shop page.
|
|
21
|
-
*
|
|
22
|
-
* ── The page has ONE primary action, and it depends on who is reading ──────
|
|
23
|
-
*
|
|
24
|
-
* For two releases the only control here was "Save to favourites" — the money
|
|
25
|
-
* screen of a marketplace with no way to reach the seller, and the owner's own
|
|
26
|
-
* copy of the page offering to favourite their own listing. So:
|
|
27
|
-
*
|
|
28
|
-
* a buyer → `contactSlot` (the container's `@stapel/chat-react`
|
|
29
|
-
* "message the seller" button), with favouriting beside it as
|
|
30
|
-
* the secondary it always was;
|
|
31
|
-
* the owner → Edit and Take down, and no contact button at all — you do not
|
|
32
|
-
* message yourself.
|
|
33
|
-
*
|
|
34
|
-
* `contactSlot` is a SLOT because conversations belong to another L2 pair and
|
|
35
|
-
* L2 pairs do not import each other. Unfilled it renders `<SlotPlaceholder>`,
|
|
36
|
-
* so an app wired without a chat is a named gap in a dev build rather than a
|
|
37
|
-
* page whose only verb is "save".
|
|
38
|
-
*
|
|
39
|
-
* ── The page has a DESKTOP, when the host says so ──────────────────────────
|
|
40
|
-
*
|
|
41
|
-
* Measured on a live classified deployment at 1440×900: the whole listing
|
|
42
|
-
* page was a ~930px single column hugging the start edge, the price a 22px
|
|
43
|
-
* line UNDER the title and smaller than it, and the right half of the screen
|
|
44
|
-
* empty — while the reference design for this page is two columns: gallery +
|
|
45
|
-
* description + specs on the left, a sticky buy column on the right with the
|
|
46
|
-
* price LARGE at its top, then the actions, then the seller block.
|
|
47
|
-
*
|
|
48
|
-
* `layout="split"` is that design. The HOST states the axis — the same rule
|
|
49
|
-
* as CategoryPage's `subcategories`: a decision taken once by the component
|
|
50
|
-
* that knows the viewport it granted, never a media query guessed in a leaf —
|
|
51
|
-
* and the default `"column"` renders exactly what existing hosts already get.
|
|
52
|
-
*/
|
|
53
1
|
import type { ReactElement, ReactNode } from "react";
|
|
54
2
|
import type { SignInCta } from "@stapel/core";
|
|
3
|
+
import type { ShareChannel } from "../headless/Share.js";
|
|
4
|
+
import type { ListingActionsConfig } from "./ListingActions.js";
|
|
55
5
|
import type { CategoryFeaturesProp, ThemeModeProp } from "./types.js";
|
|
56
6
|
/** The reading measure of the page body. A detail page is prose plus a spec
|
|
57
7
|
* table; past this it stops being one column and starts being a stripe across
|
|
@@ -79,6 +29,27 @@ export declare const DETAIL_SPLIT_ASIDE = "380px";
|
|
|
79
29
|
* desktop pane, and no `width: 320` that is near-full-bleed on one and a
|
|
80
30
|
* postage stamp on the other. */
|
|
81
31
|
export declare const DETAIL_PHOTO_MIN = "14rem";
|
|
32
|
+
/**
|
|
33
|
+
* THE GUTTER BETWEEN TWO PHOTOGRAPHS, and it is the page's own (D418).
|
|
34
|
+
*
|
|
35
|
+
* The gallery painted a flat `spacing[3]` — 12px on a 390px phone and 12px on
|
|
36
|
+
* a 1280px desktop — while the page around it had already decided that its
|
|
37
|
+
* edge is 4px on a phone and 24px on a desktop. Measured on the live listing:
|
|
38
|
+
* `getComputedStyle(gallery).gap` answered `12px` at both widths, so neither
|
|
39
|
+
* of the two declared numbers was ever on screen and the tiles sat closer
|
|
40
|
+
* together than the page edge on a desktop and three times further apart than
|
|
41
|
+
* it on a phone.
|
|
42
|
+
*
|
|
43
|
+
* `--stapel-page-gutter` is a RESPONSIVE token role (`@stapel/tokens`: 4px
|
|
44
|
+
* phone, 8px tablet, 24px desktop, declared once with its own media arms), and
|
|
45
|
+
* reading it as a VAR rather than computing a number is the load-bearing half:
|
|
46
|
+
* a value picked in JS is applied at render, so a window resized between
|
|
47
|
+
* renders keeps the gutter it was drawn with, where a var reflows. Written
|
|
48
|
+
* through `cssVar` so a renamed role fails to compile instead of silently
|
|
49
|
+
* resolving to nothing, with the flat value this grid used before as the
|
|
50
|
+
* fallback for a host that loads no token stylesheet.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DETAIL_GALLERY_GUTTER: string;
|
|
82
53
|
export interface ListingDetailPaneProps extends ThemeModeProp, CategoryFeaturesProp {
|
|
83
54
|
readonly id: number;
|
|
84
55
|
/** The reader's own uuid, when the host knows it. Enables the owner view —
|
|
@@ -147,10 +118,59 @@ export interface ListingDetailPaneProps extends ThemeModeProp, CategoryFeaturesP
|
|
|
147
118
|
/** Open the composer on this listing — the owner's primary. Absent is a real
|
|
148
119
|
* answer: the button then states that this app has no editing screen. */
|
|
149
120
|
readonly onEdit?: (id: number) => void;
|
|
150
|
-
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
|
|
121
|
+
/**
|
|
122
|
+
* TWO THINGS UNDER ONE NAME, and the type tells them apart.
|
|
123
|
+
*
|
|
124
|
+
* - a NODE — extra chrome beside the primary (the seller's profile link, a
|
|
125
|
+
* control from another pair). What this prop has always been, unchanged,
|
|
126
|
+
* and still rendered at the end of the buy box. Cross-pair navigation is
|
|
127
|
+
* the container's job (spec §6.2 item 5), so this pair takes nodes
|
|
128
|
+
* rather than routes.
|
|
129
|
+
* - a CONFIG — `{ share: false }` / `{ favorite: false }`, switching off
|
|
130
|
+
* one of the page's own two reader actions.
|
|
131
|
+
*
|
|
132
|
+
* A union rather than a second prop, because they are the same question
|
|
133
|
+
* ("what is in the action row") asked from two sides, and it is
|
|
134
|
+
* unambiguous at runtime: a plain object that is not a React element was
|
|
135
|
+
* never a legal `ReactNode` in the first place — React refuses to render
|
|
136
|
+
* one — so `{ share: false }` cannot be a node that somebody meant.
|
|
137
|
+
*/
|
|
138
|
+
readonly actions?: ReactNode | ListingActionsConfig;
|
|
139
|
+
/**
|
|
140
|
+
* The listing's CANONICAL address, for the share sheet — the route the
|
|
141
|
+
* container built (`/l/7`, or an absolute URL), not the address bar.
|
|
142
|
+
*
|
|
143
|
+
* Absent, sharing falls back to `window.location.href`, which is honest for
|
|
144
|
+
* a bare mount and wrong for a real app: the address a visitor is standing
|
|
145
|
+
* on carries the SERP query they arrived from, the page anchor and whatever
|
|
146
|
+
* tracking parameters came with them, and none of that belongs in a link
|
|
147
|
+
* somebody sends to a friend. See `useShare`.
|
|
148
|
+
*/
|
|
149
|
+
readonly shareUrl?: string;
|
|
150
|
+
/** Analytics: which channel a completed share went through. */
|
|
151
|
+
readonly onShared?: (channel: ShareChannel) => void;
|
|
152
|
+
/**
|
|
153
|
+
* How many people saved this listing, when the host was told by something
|
|
154
|
+
* else. The listings wire carries `is_favorited` — a per-reader boolean —
|
|
155
|
+
* and no aggregate at all, so this pair never invents the number and never
|
|
156
|
+
* draws a zero in place of "nobody counted".
|
|
157
|
+
*/
|
|
158
|
+
readonly favoriteCount?: number;
|
|
159
|
+
/**
|
|
160
|
+
* WHERE THE READER'S TWO ACTIONS SIT.
|
|
161
|
+
*
|
|
162
|
+
* - `"header"` (default) — beside the title, at the trailing edge of the
|
|
163
|
+
* heading row, which is where the reference classified puts them and
|
|
164
|
+
* where a person looks for them on both a phone and a desktop;
|
|
165
|
+
* - `"gallery"` — pinned over the photographs' trailing top corner, for a
|
|
166
|
+
* phone-first host that wants them on the picture. The corner is chosen
|
|
167
|
+
* rather than free: the dots own the bottom centre of the strip and the
|
|
168
|
+
* photo counter owns the bottom trailing corner;
|
|
169
|
+
* - `"buy-box"` — inside `listings-detail-actions`, beside "message the
|
|
170
|
+
* seller", which is where the favourite alone used to live. The escape
|
|
171
|
+
* hatch for a host whose page was laid out around it.
|
|
172
|
+
*/
|
|
173
|
+
readonly actionsPlacement?: "header" | "gallery" | "buy-box";
|
|
154
174
|
/**
|
|
155
175
|
* The container's sign-in door, rendered beside the favourite's refusal —
|
|
156
176
|
* the same `SignInCta` seam the three card skins already take. The pane was
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListingDetailPane.d.ts","sourceRoot":"","sources":["../../src/default/ListingDetailPane.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListingDetailPane.d.ts","sourceRoot":"","sources":["../../src/default/ListingDetailPane.tsx"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sB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