@stapel/listings-react 0.3.0 → 0.4.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 +53 -0
- package/MODULE.md +26 -10
- package/README.md +33 -17
- package/dist/api/generated/schema.d.ts +127 -1
- package/dist/api/generated/schema.d.ts.map +1 -1
- package/dist/api/listingsApi.d.ts +35 -22
- package/dist/api/listingsApi.d.ts.map +1 -1
- package/dist/api/listingsApi.js +17 -0
- package/dist/api/listingsApi.js.map +1 -1
- package/dist/api/types.d.ts +43 -2
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/default/ListingDetailPane.d.ts.map +1 -1
- package/dist/default/ListingDetailPane.js +1 -1
- package/dist/default/ListingDetailPane.js.map +1 -1
- package/dist/default/MyListingsPane.d.ts +24 -11
- package/dist/default/MyListingsPane.d.ts.map +1 -1
- package/dist/default/MyListingsPane.js +26 -10
- package/dist/default/MyListingsPane.js.map +1 -1
- package/dist/headless/MyListings.d.ts +27 -12
- package/dist/headless/MyListings.d.ts.map +1 -1
- package/dist/headless/MyListings.js +29 -7
- package/dist/headless/MyListings.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +8 -3
- 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 +6 -0
- package/dist/i18n/generated/errors.gen.d.ts.map +1 -1
- package/dist/i18n/generated/errors.gen.js +3 -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 +12 -2
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +18 -4
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +8 -3
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/model/mine.d.ts +44 -0
- package/dist/model/mine.d.ts.map +1 -0
- package/dist/model/mine.js +52 -0
- package/dist/model/mine.js.map +1 -0
- package/dist/model/mineSource.d.ts +39 -34
- package/dist/model/mineSource.d.ts.map +1 -1
- package/dist/model/mineSource.js +10 -41
- package/dist/model/mineSource.js.map +1 -1
- package/dist/model/mutations.d.ts.map +1 -1
- package/dist/model/mutations.js +11 -4
- package/dist/model/mutations.js.map +1 -1
- package/dist/model/queryKeys.d.ts +7 -2
- package/dist/model/queryKeys.d.ts.map +1 -1
- package/dist/model/queryKeys.js +2 -0
- package/dist/model/queryKeys.js.map +1 -1
- package/dist/model/status.d.ts +12 -31
- package/dist/model/status.d.ts.map +1 -1
- package/dist/model/status.js +44 -0
- package/dist/model/status.js.map +1 -1
- package/llms.txt +6 -4
- package/manifest.json +38 -6
- package/nav-manifest.json +1 -1
- package/package.json +4 -4
- package/src/analytics/generated/events.json +1 -1
- package/src/api/generated/schema.ts +127 -1
- package/src/api/listingsApi.ts +60 -21
- package/src/api/types.ts +46 -2
- package/src/default/ListingDetailPane.tsx +6 -1
- package/src/default/MyListingsPane.tsx +98 -34
- package/src/headless/MyListings.tsx +62 -22
- package/src/i18n/es.ts +11 -4
- package/src/i18n/generated/errors.es.gen.ts +1 -1
- package/src/i18n/generated/errors.gen.ts +3 -0
- package/src/i18n/generated/errors.json +9 -0
- package/src/i18n/generated/errors.ru.gen.ts +1 -1
- package/src/i18n/keys.ts +20 -5
- package/src/i18n/ru.ts +11 -4
- package/src/index.ts +16 -5
- package/src/model/mine.ts +70 -0
- package/src/model/mineSource.ts +46 -41
- package/src/model/mutations.ts +11 -4
- package/src/model/queryKeys.ts +9 -2
- package/src/model/status.ts +15 -0
package/src/model/queryKeys.ts
CHANGED
|
@@ -49,12 +49,17 @@ export const listingsQueryKeys: {
|
|
|
49
49
|
myFavorites(
|
|
50
50
|
page: ListingPageKey
|
|
51
51
|
): readonly ["listings", "my", "favorites", ListingPageKey];
|
|
52
|
-
/** The owner's own rows, per tab
|
|
53
|
-
* this read goes through an injected source. */
|
|
52
|
+
/** The owner's own rows, per tab (`GET my/listings/?status=…`). */
|
|
54
53
|
mine(
|
|
55
54
|
tab: string,
|
|
56
55
|
page: ListingPageKey
|
|
57
56
|
): readonly ["listings", "my", "listings", string, ListingPageKey];
|
|
57
|
+
/** The owner's rows no tab folds in — a takedown. A sibling of `mine` and
|
|
58
|
+
* not one of its tabs, because it answers a different question and must not
|
|
59
|
+
* be evicted when a tab pages. */
|
|
60
|
+
mineUntabbed(): readonly ["listings", "my", "listings", "untabbed"];
|
|
61
|
+
/** Every owner-row page, for an invalidation after a write. */
|
|
62
|
+
allMine(): readonly ["listings", "my", "listings"];
|
|
58
63
|
/** `GET /{pk}/validate-draft/` — the dry run of a publish. */
|
|
59
64
|
validateDraft(id: number): readonly ["listings", "validate-draft", number];
|
|
60
65
|
/** Every favourites PAGE, for an invalidation after a toggle — the cursor
|
|
@@ -70,6 +75,8 @@ export const listingsQueryKeys: {
|
|
|
70
75
|
myCounters: () => [ROOT, "my", "counters"],
|
|
71
76
|
myFavorites: (page) => [ROOT, "my", "favorites", page],
|
|
72
77
|
mine: (tab, page) => [ROOT, "my", "listings", tab, page],
|
|
78
|
+
mineUntabbed: () => [ROOT, "my", "listings", "untabbed"],
|
|
79
|
+
allMine: () => [ROOT, "my", "listings"],
|
|
73
80
|
validateDraft: (id) => [ROOT, "validate-draft", id],
|
|
74
81
|
allFavorites: () => [ROOT, "my", "favorites"],
|
|
75
82
|
allLists: () => [ROOT, "list"],
|
package/src/model/status.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* asserts the whole 9 × 4 table, so a state added upstream is a red test and
|
|
30
30
|
* not a bare enum value on a page.
|
|
31
31
|
*/
|
|
32
|
+
import { LISTING_STATUSES } from "../api/types.js";
|
|
32
33
|
import type {
|
|
33
34
|
ListingLifecycleStatus,
|
|
34
35
|
ListingModerationStatus,
|
|
@@ -277,3 +278,17 @@ export function tabOf(
|
|
|
277
278
|
}
|
|
278
279
|
return undefined;
|
|
279
280
|
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The statuses no tab folds in — `blocked`, and nothing else today.
|
|
284
|
+
*
|
|
285
|
+
* DERIVED, not written down a second time: a status added upstream and left
|
|
286
|
+
* out of the counter groupings lands here automatically and gets shown, which
|
|
287
|
+
* is the opposite of what a hardcoded `["blocked"]` would do the day it goes
|
|
288
|
+
* stale. The dashboard renders these rows OUTSIDE the tabs (see
|
|
289
|
+
* `default/MyListingsPane.tsx`) rather than folding them into one, because a
|
|
290
|
+
* tab's rows and its `my/counters` badge have to describe the same set — and
|
|
291
|
+
* `my/counters` counts a takedown in no tab at all.
|
|
292
|
+
*/
|
|
293
|
+
export const MY_LISTINGS_UNTABBED_STATUSES: readonly ListingLifecycleStatus[] =
|
|
294
|
+
LISTING_STATUSES.filter((status) => tabOf(status) === undefined);
|