@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardGallery.js","sourceRoot":"","sources":["../../src/default/cardGallery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"cardGallery.js","sourceRoot":"","sources":["../../src/default/cardGallery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE1D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAC3D,yEAAyE;AACzE,MAAM,CAAC,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AACzE,oEAAoE;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AAEtE,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,KAAa,EAAE,KAAa;IACxE,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CA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 export interface FavoriteHeartProps {
|
|
|
74
74
|
* its reason, which is all a surface with no sign-in route can offer.
|
|
75
75
|
*/
|
|
76
76
|
readonly signIn?: SignInCta;
|
|
77
|
+
/**
|
|
78
|
+
* The hit-target class this surface wants — `LISTING_CARD_ACTION_CLASS` on
|
|
79
|
+
* a card (36px with a cursor, 44px with a thumb),
|
|
80
|
+
* `LISTING_ACTION_CLASS` on the listing page (44px everywhere).
|
|
81
|
+
*
|
|
82
|
+
* A CLASS rather than a size prop: the tiers are a media query, and a
|
|
83
|
+
* component that took a number would have to be told the viewport — which
|
|
84
|
+
* is the thing a leaf must never ask. See `actionRow.ts`.
|
|
85
|
+
*/
|
|
86
|
+
readonly className?: string;
|
|
87
|
+
/**
|
|
88
|
+
* SAY THE OUTCOME OUT LOUD — a short toast on each successful press.
|
|
89
|
+
*
|
|
90
|
+
* Off by default and ON for the listing page: one heart on a screen the
|
|
91
|
+
* person came to act on earns a sentence, forty hearts on a grid do not.
|
|
92
|
+
* The icon fill remains the state in both cases; this is the acknowledgement
|
|
93
|
+
* that the press was received, which is the half a small glyph pinned to
|
|
94
|
+
* the corner of a photograph cannot carry on its own.
|
|
95
|
+
*
|
|
96
|
+
* It is raised on the GESTURE, from the predicted next state, for the same
|
|
97
|
+
* reason `useFavoriteToggle` draws that state optimistically: the toast has
|
|
98
|
+
* to arrive with the press. A write that then fails rolls the icon back and
|
|
99
|
+
* states the failure through the heart's own `ErrorAlert`.
|
|
100
|
+
*/
|
|
101
|
+
readonly announce?: boolean;
|
|
77
102
|
readonly style?: CSSProperties;
|
|
78
103
|
}
|
|
79
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../src/default/favorite.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAA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{ useFavoriteToggle } from "../headless/Favorites.js";
|
|
|
7
7
|
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
8
8
|
import { GateReasonPopover } from "./GateReasonPopover.js";
|
|
9
9
|
import { HeartIcon } from "./icons.js";
|
|
10
|
+
import { useNotice } from "./notice.js";
|
|
11
|
+
import { LISTING_ACTIONS_STYLE_HREF, actionRowCss } from "./actionRow.js";
|
|
10
12
|
/**
|
|
11
13
|
* The heart and its refusal. It is NEVER hidden from a visitor: it is blocked,
|
|
12
14
|
* the reason is on the page as ordinary text, and the container's sign-in door
|
|
@@ -55,6 +57,7 @@ import { HeartIcon } from "./icons.js";
|
|
|
55
57
|
*/
|
|
56
58
|
export function FavoriteHeart(props) {
|
|
57
59
|
const t = useT();
|
|
60
|
+
const notice = useNotice();
|
|
58
61
|
const { token } = antdTheme.useToken();
|
|
59
62
|
const favorite = useFavoriteToggle(props.listingId, props.favorited);
|
|
60
63
|
const label = t(favorite.favorited
|
|
@@ -68,6 +71,19 @@ export function FavoriteHeart(props) {
|
|
|
68
71
|
// place a blocked reason becomes words in this fleet.
|
|
69
72
|
const gate = useActionGate(favorite.gate);
|
|
70
73
|
const reason = gate.reason;
|
|
74
|
+
// The press, plus the sentence the surface asked for. The next state is the
|
|
75
|
+
// one the icon is about to draw, so the toast and the fill say the same
|
|
76
|
+
// thing at the same moment — see `announce`.
|
|
77
|
+
const announce = props.announce === true;
|
|
78
|
+
const press = () => {
|
|
79
|
+
const next = !favorite.favorited;
|
|
80
|
+
favorite.toggle();
|
|
81
|
+
if (!announce || !favorite.gate.available)
|
|
82
|
+
return;
|
|
83
|
+
notice(t(next
|
|
84
|
+
? LISTINGS_I18N_KEYS.favoriteAdded
|
|
85
|
+
: LISTINGS_I18N_KEYS.favoriteRemoved));
|
|
86
|
+
};
|
|
71
87
|
// D431. A blocked gate plus a door the surface handed in: the press is not
|
|
72
88
|
// refused, it is ROUTED — through the door, keeping whatever `?next=` the
|
|
73
89
|
// container put in the href. With no door there is nothing better for the
|
|
@@ -88,13 +104,23 @@ export function FavoriteHeart(props) {
|
|
|
88
104
|
...doorPress,
|
|
89
105
|
...(door?.href !== undefined ? {} : { "aria-pressed": favorite.favorited }),
|
|
90
106
|
}
|
|
91
|
-
: { "aria-pressed": favorite.favorited, onClick:
|
|
107
|
+
: { "aria-pressed": favorite.favorited, onClick: press };
|
|
92
108
|
// A failed save, stated where the heart is. The rollback already put the
|
|
93
109
|
// icon back; this says why it went back.
|
|
110
|
+
// (see `press` above for the toast that rides the successful half)
|
|
94
111
|
const failure = (_jsx(ErrorAlert, { testId: `${props.testId}-error`, thrown: favorite.error, variant: "inline" }));
|
|
112
|
+
// The hit-target rules the surfaces address by class. Hoisted here rather
|
|
113
|
+
// than by each card, because the heart is what carries the class and a
|
|
114
|
+
// stylesheet that arrived only on the surfaces that remembered it is a
|
|
115
|
+
// 32px target on the one that forgot.
|
|
116
|
+
const sheet = (_jsx("style", { href: LISTING_ACTIONS_STYLE_HREF, precedence: "default", children: actionRowCss() }));
|
|
95
117
|
if (props.blockedReason === "popover" && reason !== undefined) {
|
|
96
|
-
return (_jsx(GateReasonPopover, { reason: reason, cta: props.signIn, testId: `${props.testId}-reason`, signInTestId: props.signInTestId ?? `${props.testId}-sign-in`, children: (bind) => (_jsx(Button, { shape: "circle", ...(opensDoor ? {} : { "aria-disabled": true }), ...bind,
|
|
118
|
+
return (_jsxs(_Fragment, { children: [sheet, _jsx(GateReasonPopover, { reason: reason, cta: props.signIn, testId: `${props.testId}-reason`, signInTestId: props.signInTestId ?? `${props.testId}-sign-in`, children: (bind) => (_jsx(Button, { shape: "circle", ...(opensDoor ? {} : { "aria-disabled": true }), ...bind, ...(props.className !== undefined
|
|
119
|
+
? { className: props.className }
|
|
120
|
+
: {}), "aria-label": label, "data-testid": props.testId, "data-favorited": String(favorite.favorited), "data-analytics": "none", "data-analytics-reason": "business action \u2014 host app wraps with its own tracked()", ...asDoor, icon: icon, ...(props.style !== undefined ? { style: props.style } : {}) })) })] }));
|
|
97
121
|
}
|
|
98
|
-
return (_jsx(GatedControl, { gate: favorite.gate, testId: props.gateTestId ?? `${props.testId}-gate`, ...(opensDoor ? { whenBlocked: "annotate" } : {}), ...(props.layout !== undefined ? { layout: props.layout } : {}), ...(props.style !== undefined ? { style: props.style } : {}), children: (bind) => (_jsxs(_Fragment, { children: [_jsx(Button, { shape: "circle", ...bind,
|
|
122
|
+
return (_jsxs(_Fragment, { children: [sheet, _jsx(GatedControl, { gate: favorite.gate, testId: props.gateTestId ?? `${props.testId}-gate`, ...(opensDoor ? { whenBlocked: "annotate" } : {}), ...(props.layout !== undefined ? { layout: props.layout } : {}), ...(props.style !== undefined ? { style: props.style } : {}), children: (bind) => (_jsxs(_Fragment, { children: [_jsx(Button, { shape: "circle", ...bind, ...(props.className !== undefined
|
|
123
|
+
? { className: props.className }
|
|
124
|
+
: {}), "aria-label": label, "data-testid": props.testId, "data-favorited": String(favorite.favorited), "data-analytics": "none", "data-analytics-reason": "business action \u2014 host app wraps with its own tracked()", ...asDoor, icon: icon }), failure] })) })] }));
|
|
99
125
|
}
|
|
100
126
|
//# sourceMappingURL=favorite.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite.js","sourceRoot":"","sources":["../../src/default/favorite.tsx"],"names":[],"mappings":";AA4BA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OA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CAAC,CAAC,EAAE,CAAC,gBACK,KAAK,iBACJ,KAAK,CAAC,MAAM,oBACT,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,oBAC3B,MAAM,2BACC,8DAAyD,KAC3E,MAAM,EACV,IAAI,EAAE,IAAI,GACV,EACD,OAAO,IACP,CACJ,GACY,IACZ,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/default/icons.d.ts
CHANGED
|
@@ -29,6 +29,25 @@ export interface HeartIconProps {
|
|
|
29
29
|
readonly color?: string;
|
|
30
30
|
}
|
|
31
31
|
export declare function HeartIcon(props: HeartIconProps): ReactElement;
|
|
32
|
+
/**
|
|
33
|
+
* The share glyph — three nodes and two edges, the platform-neutral shape
|
|
34
|
+
* both Android and the web draw for "send this somewhere else".
|
|
35
|
+
*
|
|
36
|
+
* `aria-hidden`, like the heart: the control it sits in carries the verb as
|
|
37
|
+
* its accessible name in every arm, including the phone arm where the word
|
|
38
|
+
* itself is not painted, and a glyph announced beside its own label reads the
|
|
39
|
+
* action twice.
|
|
40
|
+
*
|
|
41
|
+
* Deliberately not the iOS "box with an arrow": that shape means "share" to
|
|
42
|
+
* an iPhone user and "upload" or "export" to everybody else, and this control
|
|
43
|
+
* is drawn on a browser, not inside an app the platform styled.
|
|
44
|
+
*/
|
|
45
|
+
export declare function ShareIcon(): ReactElement;
|
|
46
|
+
/**
|
|
47
|
+
* A chain link — the copy row's glyph, and the one thing on the menu that is
|
|
48
|
+
* not a network's own brand.
|
|
49
|
+
*/
|
|
50
|
+
export declare function LinkIcon(): ReactElement;
|
|
32
51
|
/**
|
|
33
52
|
* Which way the asking price moved — an arrow, and a NAME for it.
|
|
34
53
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/default/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B;uEACmE;IACnE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAkB7D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,YAAY,CAmBf"}
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/default/icons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,cAAc;IAC7B;uEACmE;IACnE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAkB7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,IAAI,YAAY,CAqBxC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,YAAY,CAkBvC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,YAAY,CAmBf"}
|
package/dist/default/icons.js
CHANGED
|
@@ -3,6 +3,29 @@ export function HeartIcon(props) {
|
|
|
3
3
|
const paint = props.color ?? "currentColor";
|
|
4
4
|
return (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: props.filled ? paint : "none", stroke: paint, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", role: "img", "aria-hidden": "true", children: _jsx("path", { d: "M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1L12 21l7.7-7.6 1.1-1a5.5 5.5 0 0 0 0-7.8z" }) }));
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* The share glyph — three nodes and two edges, the platform-neutral shape
|
|
8
|
+
* both Android and the web draw for "send this somewhere else".
|
|
9
|
+
*
|
|
10
|
+
* `aria-hidden`, like the heart: the control it sits in carries the verb as
|
|
11
|
+
* its accessible name in every arm, including the phone arm where the word
|
|
12
|
+
* itself is not painted, and a glyph announced beside its own label reads the
|
|
13
|
+
* action twice.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately not the iOS "box with an arrow": that shape means "share" to
|
|
16
|
+
* an iPhone user and "upload" or "export" to everybody else, and this control
|
|
17
|
+
* is drawn on a browser, not inside an app the platform styled.
|
|
18
|
+
*/
|
|
19
|
+
export function ShareIcon() {
|
|
20
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", role: "img", "aria-hidden": "true", children: [_jsx("circle", { cx: "18", cy: "5", r: "3" }), _jsx("circle", { cx: "6", cy: "12", r: "3" }), _jsx("circle", { cx: "18", cy: "19", r: "3" }), _jsx("path", { d: "M8.6 10.5 15.4 6.6" }), _jsx("path", { d: "M8.6 13.5 15.4 17.4" })] }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A chain link — the copy row's glyph, and the one thing on the menu that is
|
|
24
|
+
* not a network's own brand.
|
|
25
|
+
*/
|
|
26
|
+
export function LinkIcon() {
|
|
27
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", role: "img", "aria-hidden": "true", children: [_jsx("path", { d: "M10 13a5 5 0 0 0 7.5.6l3-3a5 5 0 0 0-7-7l-1.7 1.7" }), _jsx("path", { d: "M14 11a5 5 0 0 0-7.5-.6l-3 3a5 5 0 0 0 7 7l1.7-1.7" })] }));
|
|
28
|
+
}
|
|
6
29
|
/**
|
|
7
30
|
* Which way the asking price moved — an arrow, and a NAME for it.
|
|
8
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/default/icons.tsx"],"names":[],"mappings":";AAgCA,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,cAAc,CAAC;IAC5C,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EACnC,MAAM,EAAE,KAAK,EACb,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,IAAI,EAAC,KAAK,iBACE,MAAM,YAElB,eAAM,CAAC,EAAC,kHAAkH,GAAG,GACzH,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,KAG9B;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IACxC,OAAO,CACL,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,IAAI,EAAC,KAAK,gBACE,KAAK,CAAC,KAAK,aAEvB,eAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,GAAI,EAC3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AoB,GAAG,EAC/B,eAAM,CAAC,EAAC,qBAAqB,GAAG,IAC5B,CACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,CACL,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,IAAI,EAAC,KAAK,iBACE,MAAM,aAElB,eAAM,CAAC,EAAC,mDAAmD,GAAG,EAC9D,eAAM,CAAC,EAAC,oDAAoD,GAAG,IAC3D,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,KAG9B;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IACxC,OAAO,CACL,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,IAAI,EAAC,KAAK,gBACE,KAAK,CAAC,KAAK,aAEvB,eAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,GAAI,EAC3C,eAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,GAAI,IACjD,CACP,CAAC;AACJ,CAAC"}
|
package/dist/default/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export { ListingFeedCard } from "./ListingFeedCard.js";
|
|
|
41
41
|
export type { ListingFeedCardProps, ListingFeedCardBaseProps, } from "./ListingFeedCard.js";
|
|
42
42
|
export { FeedGrid, FEED_GRID_COLUMNS } from "./FeedGrid.js";
|
|
43
43
|
export type { FeedGridProps } from "./FeedGrid.js";
|
|
44
|
-
export { ListingDetailPane, DETAIL_MEASURE, DETAIL_SPLIT_MEASURE, DETAIL_SPLIT_ASIDE, DETAIL_PHOTO_MIN, } from "./ListingDetailPane.js";
|
|
44
|
+
export { ListingDetailPane, DETAIL_MEASURE, DETAIL_SPLIT_MEASURE, DETAIL_SPLIT_ASIDE, DETAIL_PHOTO_MIN, DETAIL_GALLERY_GUTTER, } from "./ListingDetailPane.js";
|
|
45
45
|
export type { ListingDetailPaneProps } from "./ListingDetailPane.js";
|
|
46
46
|
export { ListingComposerPage, COMPOSER_DETAILS_PLACEMENT, COMPOSER_MEASURE, composerFieldId, } from "./ListingComposerPage.js";
|
|
47
47
|
export type { ListingComposerPageProps, ComposerCategorySlot, ComposerCurrencySlot, ComposerLocationSlot, ComposerLocationValue, ComposerLocationPickerProps, } from "./ListingComposerPage.js";
|
|
@@ -59,6 +59,13 @@ export { CardBadges, CardSpecLine } from "./CardBadges.js";
|
|
|
59
59
|
export type { CardBadgesProps } from "./CardBadges.js";
|
|
60
60
|
export { SWIPE_AXIS_RATIO, SWIPE_MIN_PX, cardGalleryCss, hasFinePointer, segmentIndex, swipeStep, useCardGallery, } from "./cardGallery.js";
|
|
61
61
|
export type { CardGallery } from "./cardGallery.js";
|
|
62
|
+
export { ListingActions } from "./ListingActions.js";
|
|
63
|
+
export type { ListingActionsConfig, ListingActionsProps, } from "./ListingActions.js";
|
|
64
|
+
export { ShareAction } from "./ShareAction.js";
|
|
65
|
+
export type { ShareActionProps } from "./ShareAction.js";
|
|
66
|
+
export { LISTING_ACTIONS_CLASS, LISTING_ACTIONS_OVERLAY_CLASS, LISTING_ACTIONS_STYLE_HREF, LISTING_ACTION_CLASS, LISTING_ACTION_HIT, LISTING_ACTION_LABEL_CLASS, LISTING_CARD_ACTION_CLASS, LISTING_CARD_ACTION_HIT, actionRowCss, } from "./actionRow.js";
|
|
67
|
+
export { NOTICE_SECONDS, useNotice } from "./notice.js";
|
|
68
|
+
export type { Notice } from "./notice.js";
|
|
62
69
|
export { SignInLink } from "./SignInLink.js";
|
|
63
70
|
export type { SignInLinkProps } from "./SignInLink.js";
|
|
64
71
|
export type { CategoryFeaturesProp, ThemeModeProp } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,WAAW,EAGX,oBAAoB,EACpB,sBAAsB,EAGtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,cAAc,EAGd,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,WAAW,EAGX,oBAAoB,EACpB,sBAAsB,EAGtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,gBAAgB,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
@@ -46,7 +46,7 @@ export { FeedGrid, FEED_GRID_COLUMNS } from "./FeedGrid.js";
|
|
|
46
46
|
export { ListingDetailPane, DETAIL_MEASURE,
|
|
47
47
|
// The split layout's two geometry constants, for a container laying out
|
|
48
48
|
// against the same tracks (and for a test that measures them).
|
|
49
|
-
DETAIL_SPLIT_MEASURE, DETAIL_SPLIT_ASIDE, DETAIL_PHOTO_MIN, } from "./ListingDetailPane.js";
|
|
49
|
+
DETAIL_SPLIT_MEASURE, DETAIL_SPLIT_ASIDE, DETAIL_PHOTO_MIN, DETAIL_GALLERY_GUTTER, } from "./ListingDetailPane.js";
|
|
50
50
|
export { ListingComposerPage, COMPOSER_DETAILS_PLACEMENT, COMPOSER_MEASURE, composerFieldId, } from "./ListingComposerPage.js";
|
|
51
51
|
export { MyListingsPane } from "./MyListingsPane.js";
|
|
52
52
|
export { FavoritesPane, FAVORITES_CARD_MIN } from "./FavoritesPane.js";
|
|
@@ -57,5 +57,10 @@ export { ListingSpecColumns, ListingSpecList, specListCss, } from "./ListingSpec
|
|
|
57
57
|
export { CardBadges, CardSpecLine } from "./CardBadges.js";
|
|
58
58
|
// ── the card gallery's two gestures ─────────────────────────────────────────
|
|
59
59
|
export { SWIPE_AXIS_RATIO, SWIPE_MIN_PX, cardGalleryCss, hasFinePointer, segmentIndex, swipeStep, useCardGallery, } from "./cardGallery.js";
|
|
60
|
+
// ── the reader's two actions: save it, or send it to somebody ───────────────
|
|
61
|
+
export { ListingActions } from "./ListingActions.js";
|
|
62
|
+
export { ShareAction } from "./ShareAction.js";
|
|
63
|
+
export { LISTING_ACTIONS_CLASS, LISTING_ACTIONS_OVERLAY_CLASS, LISTING_ACTIONS_STYLE_HREF, LISTING_ACTION_CLASS, LISTING_ACTION_HIT, LISTING_ACTION_LABEL_CLASS, LISTING_CARD_ACTION_CLASS, LISTING_CARD_ACTION_HIT, actionRowCss, } from "./actionRow.js";
|
|
64
|
+
export { NOTICE_SECONDS, useNotice } from "./notice.js";
|
|
60
65
|
export { SignInLink } from "./SignInLink.js";
|
|
61
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,WAAW;AACX,6EAA6E;AAC7E,6EAA6E;AAC7E,oBAAoB,EACpB,sBAAsB;AACtB,0EAA0E;AAC1E,4EAA4E;AAC5E,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,cAAc;AACd,wEAAwE;AACxE,+DAA+D;AAC/D,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,WAAW;AACX,6EAA6E;AAC7E,6EAA6E;AAC7E,oBAAoB,EACpB,sBAAsB;AACtB,0EAA0E;AAC1E,4EAA4E;AAC5E,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,cAAc;AACd,wEAAwE;AACxE,+DAA+D;AAC/D,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAOvE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG3D,+EAA+E;AAC/E,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,SAAS,EACT,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,+EAA+E;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Say one short sentence. Resolved copy — this is the skin, not a bag. */
|
|
2
|
+
export type Notice = (text: string) => void;
|
|
3
|
+
/**
|
|
4
|
+
* How long a confirmation stands, in seconds.
|
|
5
|
+
*
|
|
6
|
+
* Two, not antd's default three. Every notice this package raises confirms
|
|
7
|
+
* something the person can already SEE — a filled heart, a sentence standing
|
|
8
|
+
* in the open share menu — so it is an acknowledgement, not information, and
|
|
9
|
+
* an acknowledgement that outstays the gesture is a strip of chrome sitting
|
|
10
|
+
* over the page a thumb was about to press next.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NOTICE_SECONDS = 2;
|
|
13
|
+
export declare function useNotice(): Notice;
|
|
14
|
+
//# sourceMappingURL=notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/default/notice.ts"],"names":[],"mappings":"AAoCA,2EAA2E;AAC3E,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,wBAAgB,SAAS,IAAI,MAAM,CAiBlC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A one-line confirmation, spoken once — the message seam this skin uses and
|
|
3
|
+
* the reason it is not a new dependency.
|
|
4
|
+
*
|
|
5
|
+
* ── There is no fleet-wide toast primitive, and this does not invent one ──
|
|
6
|
+
*
|
|
7
|
+
* `@stapel/tokens-antd/skin` carries `ErrorAlert`, `EmptyState`,
|
|
8
|
+
* `GatedControl`, `SkinDialog` and `SkinConfirm` — every way a pair states a
|
|
9
|
+
* REFUSAL or asks a question — and nothing at all for "that worked". So the
|
|
10
|
+
* seam here is antd's own, which this package already renders through:
|
|
11
|
+
*
|
|
12
|
+
* 1. `App.useApp().message` when the host mounts antd's `<App>`, which is
|
|
13
|
+
* the arrangement antd itself asks for — the notice then inherits the
|
|
14
|
+
* host's `ConfigProvider` theme, its locale and its container;
|
|
15
|
+
* 2. antd's STATIC `message` otherwise, so a host that never mounted `<App>`
|
|
16
|
+
* still gets the confirmation instead of silence.
|
|
17
|
+
*
|
|
18
|
+
* Outside an `<App>`, `App.useApp()` returns `{message: {}, …}` — antd's own
|
|
19
|
+
* default context — which is why the arm is chosen by asking whether the
|
|
20
|
+
* function is there rather than by asking whether a provider is. A version
|
|
21
|
+
* that assumed the context would have been a confirmation that worked in
|
|
22
|
+
* every test and on no deployment.
|
|
23
|
+
*
|
|
24
|
+
* ── And a toast is never the ONLY copy of a confirmation ──────────────────
|
|
25
|
+
*
|
|
26
|
+
* A toast is transient by construction: it appears for three seconds
|
|
27
|
+
* somewhere the person may not be looking, and on a phone it can land under a
|
|
28
|
+
* thumb. So every caller here also paints the same sentence where the gesture
|
|
29
|
+
* happened — `<ShareAction>` states "Link copied" inside the open menu, and
|
|
30
|
+
* the heart's state is on the heart. This is the AMPLIFIER, never the record.
|
|
31
|
+
* A future `SkinNotice` in the substrate replaces the body of this function
|
|
32
|
+
* and nothing else; the callers already speak in resolved sentences.
|
|
33
|
+
*/
|
|
34
|
+
import { useCallback } from "react";
|
|
35
|
+
import { App, message as staticMessage } from "antd";
|
|
36
|
+
/**
|
|
37
|
+
* How long a confirmation stands, in seconds.
|
|
38
|
+
*
|
|
39
|
+
* Two, not antd's default three. Every notice this package raises confirms
|
|
40
|
+
* something the person can already SEE — a filled heart, a sentence standing
|
|
41
|
+
* in the open share menu — so it is an acknowledgement, not information, and
|
|
42
|
+
* an acknowledgement that outstays the gesture is a strip of chrome sitting
|
|
43
|
+
* over the page a thumb was about to press next.
|
|
44
|
+
*/
|
|
45
|
+
export const NOTICE_SECONDS = 2;
|
|
46
|
+
export function useNotice() {
|
|
47
|
+
const app = App.useApp();
|
|
48
|
+
const contextual = app.message.success;
|
|
49
|
+
return useCallback((text) => {
|
|
50
|
+
if (typeof contextual === "function") {
|
|
51
|
+
contextual(text, NOTICE_SECONDS);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// No `<App>` above us. antd's static entry renders its own holder into
|
|
55
|
+
// the document, which is exactly right for a host that never opted in,
|
|
56
|
+
// and is a no-op on a server where there is no document to render into.
|
|
57
|
+
if (typeof document === "undefined")
|
|
58
|
+
return;
|
|
59
|
+
staticMessage.success(text, NOTICE_SECONDS);
|
|
60
|
+
}, [contextual]);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=notice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../src/default/notice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAKrD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;IACvC,OAAO,WAAW,CAChB,CAAC,IAAY,EAAQ,EAAE;QACrB,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE,CAAC;YACrC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACjC,OAAO;QACT,CAAC;QACD,uEAAuE;QACvE,uEAAuE;QACvE,wEAAwE;QACxE,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE,OAAO;QAC5C,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC9C,CAAC,EACD,CAAC,UAAU,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -14,44 +14,65 @@ import type { MyListingsAddress } from "../model/tabAddress.js";
|
|
|
14
14
|
* keeps the argument and the seam that came out of it.
|
|
15
15
|
*
|
|
16
16
|
* TWO reads, not one, and the second one is the point of this file's shape:
|
|
17
|
-
* the three tabs are the SERVER's status groupings, and `blocked` — a
|
|
17
|
+
* the three counted tabs are the SERVER's status groupings, and `blocked` — a
|
|
18
18
|
* moderation takedown — is in none of them, because `my/counters` counts it
|
|
19
19
|
* in none of them. A dashboard that only ever asked for a tab's statuses
|
|
20
20
|
* would hide exactly the listing whose owner most needs to know. So
|
|
21
21
|
* `blockedRows` is fetched beside them, off the same route, narrowed to
|
|
22
22
|
* whatever `MY_LISTINGS_UNTABBED_STATUSES` derives.
|
|
23
|
+
*
|
|
24
|
+
* That second read is also the fourth tab's COUNT (D407). `my/counters` has
|
|
25
|
+
* three integers and no fourth, so the removed tab is counted from the rows it
|
|
26
|
+
* holds — which is honest exactly because that read is unpaged and runs
|
|
27
|
+
* whichever tab is open. The one thing it cannot describe is a page cap: a
|
|
28
|
+
* seller with more takedowns than one page of `my/listings` would see the page
|
|
29
|
+
* count and not the total, and there is no counter on the wire to check it
|
|
30
|
+
* against (see `MyListingsBag.tabCounts`).
|
|
23
31
|
*/
|
|
24
32
|
export interface MyListingsBag {
|
|
25
33
|
readonly tab: MyListingsTab;
|
|
34
|
+
/**
|
|
35
|
+
* The tabs to DRAW, in order.
|
|
36
|
+
*
|
|
37
|
+
* The server's three always; the removed one only where there is something
|
|
38
|
+
* in it or the person asked for it by address. An empty "Taken down" tab is
|
|
39
|
+
* a scare, and the seller it would scare is the one it has nothing to tell.
|
|
40
|
+
*/
|
|
26
41
|
readonly tabs: readonly MyListingsTab[];
|
|
27
42
|
setTab(tab: MyListingsTab): void;
|
|
28
43
|
/** The three real counts, as the server reports them. */
|
|
29
44
|
readonly counters: LoadState<MyCounters>;
|
|
30
45
|
/**
|
|
31
46
|
* The number to DRAW on each tab — the server's counter, raised to what is
|
|
32
|
-
* actually on screen.
|
|
47
|
+
* actually on screen, plus the fourth tab's own.
|
|
33
48
|
*
|
|
34
|
-
* D407: a moderator-rejected listing was on the
|
|
35
|
-
* reading `0`. The two sets are grouped in two
|
|
36
|
-
* aggregates server-side, `MY_LISTINGS_TAB_STATUSES`
|
|
37
|
-
* a tab ASKS for — and any disagreement between them
|
|
38
|
-
* an older counter, a status added upstream, a
|
|
39
|
-
* lands as a badge contradicting the rows
|
|
49
|
+
* D407, twice over. The first half: a moderator-rejected listing was on the
|
|
50
|
+
* Drafts tab under a badge reading `0`. The two sets are grouped in two
|
|
51
|
+
* places — `my/counters` aggregates server-side, `MY_LISTINGS_TAB_STATUSES`
|
|
52
|
+
* decides which statuses a tab ASKS for — and any disagreement between them
|
|
53
|
+
* (a deployment running an older counter, a status added upstream, a
|
|
54
|
+
* grouping changed on one side) lands as a badge contradicting the rows
|
|
55
|
+
* underneath it. A count smaller than what a person can see is not a count,
|
|
56
|
+
* so the loaded rows are treated as evidence: for the OPEN tab the number is
|
|
57
|
+
* never below `rows.length`. It is a floor and not a replacement — the rows
|
|
58
|
+
* are one keyset page and the counter is the whole set, so the counter still
|
|
59
|
+
* wins whenever it is the larger of the two.
|
|
40
60
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* `
|
|
44
|
-
*
|
|
45
|
-
* whenever it is the larger of the two.
|
|
61
|
+
* The second half: a takedown was in no tab and therefore in no number, so
|
|
62
|
+
* a cabinet holding one read "Active 0 · Drafts 0 · Archived 0" over it.
|
|
63
|
+
* `removed` is counted from `blockedRows` — there is no server counter to
|
|
64
|
+
* read, and the rows are the only evidence on the wire.
|
|
46
65
|
*/
|
|
47
66
|
readonly tabCounts: LoadState<Readonly<Record<MyListingsTab, number>>>;
|
|
48
|
-
/** The rows for the current tab.
|
|
67
|
+
/** The rows for the current tab — {@link MyListingsBag.blockedRows} while
|
|
68
|
+
* the removed tab is open, and the tab's own keyset page otherwise. */
|
|
49
69
|
readonly rows: LoadState<readonly MyListingCard[]>;
|
|
50
70
|
/**
|
|
51
|
-
* The rows
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
71
|
+
* The rows the server's own counter folds into no tab — a moderation
|
|
72
|
+
* takedown, today; the removed tab's whole contents and its count. Empty
|
|
73
|
+
* for almost every seller; when it is not, it is the most important thing
|
|
74
|
+
* on the screen. Never `failed` in a way that hides the tabs: this read is
|
|
75
|
+
* independent of the tab's own and a skin renders it beside them.
|
|
55
76
|
*/
|
|
56
77
|
readonly blockedRows: LoadState<readonly MyListingCard[]>;
|
|
57
78
|
readonly page: MyListingsParams;
|
|
@@ -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;
|
|
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;AAU/D,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAA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KAAK,SAAS,CAAC;CAC7C,GACA,YAAY,CAGd"}
|
|
@@ -6,7 +6,7 @@ import { defaultMyListingsSource } from "../model/mineSource.js";
|
|
|
6
6
|
import { useListingsApi } from "../model/context.js";
|
|
7
7
|
import { useMyCounters } from "../model/queries.js";
|
|
8
8
|
import { listingsQueryKeys, pageKey } from "../model/queryKeys.js";
|
|
9
|
-
import { MY_LISTINGS_TABS, MY_LISTINGS_UNTABBED_STATUSES } from "../model/status.js";
|
|
9
|
+
import { MY_LISTINGS_COUNTED_TABS, MY_LISTINGS_REMOVED_TAB, MY_LISTINGS_TABS, MY_LISTINGS_UNTABBED_STATUSES, } from "../model/status.js";
|
|
10
10
|
import { browserAddress, tabFromSearch } from "../model/tabAddress.js";
|
|
11
11
|
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
12
12
|
import { useMandateGate } from "./useMandateGate.js";
|
|
@@ -25,10 +25,17 @@ export function useMyListings(options = {}) {
|
|
|
25
25
|
const injected = options.source;
|
|
26
26
|
const source = useMemo(() => injected ?? defaultMyListingsSource(api), [injected, api]);
|
|
27
27
|
const ready = sessionReady && gate.available;
|
|
28
|
+
// The fourth tab is served by `blockedQuery` below, not by the host's
|
|
29
|
+
// source: `MyListingsSource` is typed for the three counted tabs and a host
|
|
30
|
+
// that implemented it before D407 has no answer for a fourth.
|
|
31
|
+
const removed = tab === MY_LISTINGS_REMOVED_TAB;
|
|
32
|
+
const countedTab = removed
|
|
33
|
+
? MY_LISTINGS_COUNTED_TABS[0]
|
|
34
|
+
: tab;
|
|
28
35
|
const rowsQuery = useQuery({
|
|
29
|
-
queryKey: listingsQueryKeys.mine(
|
|
30
|
-
queryFn: ({ signal }) => source({ tab, page, signal }),
|
|
31
|
-
enabled: ready,
|
|
36
|
+
queryKey: listingsQueryKeys.mine(countedTab, pageKey(page)),
|
|
37
|
+
queryFn: ({ signal }) => source({ tab: countedTab, page, signal }),
|
|
38
|
+
enabled: ready && !removed,
|
|
32
39
|
retry: false,
|
|
33
40
|
});
|
|
34
41
|
// The takedowns, off the same route and deliberately NOT paged: a seller
|
|
@@ -40,13 +47,6 @@ export function useMyListings(options = {}) {
|
|
|
40
47
|
enabled: ready && MY_LISTINGS_UNTABBED_STATUSES.length > 0,
|
|
41
48
|
retry: false,
|
|
42
49
|
});
|
|
43
|
-
const rows = useMemo(() => {
|
|
44
|
-
if (rowsQuery.status === "error")
|
|
45
|
-
return loadFailed(rowsQuery.error);
|
|
46
|
-
if (rowsQuery.data !== undefined)
|
|
47
|
-
return loadReady(rowsQuery.data.items);
|
|
48
|
-
return loadLoading();
|
|
49
|
-
}, [rowsQuery.status, rowsQuery.error, rowsQuery.data]);
|
|
50
50
|
const blockedRows = useMemo(() => {
|
|
51
51
|
if (MY_LISTINGS_UNTABBED_STATUSES.length === 0)
|
|
52
52
|
return loadReady([]);
|
|
@@ -56,8 +56,23 @@ export function useMyListings(options = {}) {
|
|
|
56
56
|
return loadReady(blockedQuery.data.items);
|
|
57
57
|
return loadLoading();
|
|
58
58
|
}, [blockedQuery.status, blockedQuery.error, blockedQuery.data]);
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const tabRows = useMemo(() => {
|
|
60
|
+
if (rowsQuery.status === "error")
|
|
61
|
+
return loadFailed(rowsQuery.error);
|
|
62
|
+
if (rowsQuery.data !== undefined)
|
|
63
|
+
return loadReady(rowsQuery.data.items);
|
|
64
|
+
return loadLoading();
|
|
65
|
+
}, [rowsQuery.status, rowsQuery.error, rowsQuery.data]);
|
|
66
|
+
const rows = removed ? blockedRows : tabRows;
|
|
67
|
+
// The takedown count, when it is known. Not a `0` while the read is in
|
|
68
|
+
// flight: the tab strip is drawn off this number and a tab that appeared a
|
|
69
|
+
// beat after the page settled would move the three beside it.
|
|
70
|
+
const blockedCount = blockedRows.status === "ready" ? blockedRows.data.length : undefined;
|
|
71
|
+
// Paging belongs to the tab's own keyset read. The takedowns are fetched
|
|
72
|
+
// unpaged on purpose, so the removed tab has nowhere to go and says so.
|
|
73
|
+
const envelope = removed ? undefined : rowsQuery.data;
|
|
74
|
+
// D407, the floor: never a number smaller than the rows on screen — and a
|
|
75
|
+
// number for the fourth tab, which the server counts nowhere. See
|
|
61
76
|
// `MyListingsBag.tabCounts`.
|
|
62
77
|
const tabCounts = useMemo(() => {
|
|
63
78
|
if (counters.status === "error")
|
|
@@ -66,14 +81,21 @@ export function useMyListings(options = {}) {
|
|
|
66
81
|
return loadLoading();
|
|
67
82
|
const server = counters.data;
|
|
68
83
|
const visible = rows.status === "ready" ? rows.data.length : 0;
|
|
69
|
-
return loadReady(
|
|
70
|
-
one
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
return loadReady({
|
|
85
|
+
...Object.fromEntries(MY_LISTINGS_COUNTED_TABS.map((one) => [
|
|
86
|
+
one,
|
|
87
|
+
one === tab ? Math.max(server[one], visible) : server[one],
|
|
88
|
+
])),
|
|
89
|
+
[MY_LISTINGS_REMOVED_TAB]: blockedCount ?? 0,
|
|
90
|
+
});
|
|
91
|
+
}, [counters.status, counters.error, counters.data, rows, tab, blockedCount]);
|
|
92
|
+
// The removed tab is drawn where it has something to say — or where the
|
|
93
|
+
// address named it, so `?tab=removed` opens a real (if empty) tab rather
|
|
94
|
+
// than an activeKey pointing at nothing.
|
|
95
|
+
const tabs = removed || (blockedCount ?? 0) > 0 ? MY_LISTINGS_TABS : MY_LISTINGS_COUNTED_TABS;
|
|
74
96
|
return {
|
|
75
97
|
tab,
|
|
76
|
-
tabs
|
|
98
|
+
tabs,
|
|
77
99
|
setTab: (next) => {
|
|
78
100
|
// A cursor belongs to ONE ordered candidate set. Carried across a tab
|
|
79
101
|
// change it either bounces or honestly returns page four of a
|