@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineSource.d.ts","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mineSource.d.ts","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE;IACpC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEvC;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,gBAAgB,CAM1E"}
|
package/dist/model/mineSource.js
CHANGED
|
@@ -1,45 +1,14 @@
|
|
|
1
|
+
import { MY_LISTINGS_TAB_STATUSES } from "./status.js";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
+
* The source the dashboard uses unless a host replaces it: the contract's own
|
|
4
|
+
* route, narrowed to the tab's statuses.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* (`views.ListingViewSet.get_queryset`): it returns the whole marketplace's
|
|
9
|
-
* shop window and can be narrowed to nobody. The only owner-scoped reads in
|
|
10
|
-
* the module are `my/counters` (three integers) and `my/favorites`. So a
|
|
11
|
-
* seller's own DRAFTS are unreachable by any call this contract offers — and
|
|
12
|
-
* drafts are not indexed either, so routing around it through
|
|
13
|
-
* `@stapel/search-react`'s `owner=` would return the published subset and
|
|
14
|
-
* quietly call it "everything".
|
|
15
|
-
*
|
|
16
|
-
* The storefront spec assumed `GET /listings/` was "for mine" (§4.1). It is
|
|
17
|
-
* not, and this pair records the gap rather than papering over it.
|
|
18
|
-
*
|
|
19
|
-
* Two upstream asks, in preference order:
|
|
20
|
-
* 1. an `?owner=me` filter (or a `my/listings` action) on the list endpoint,
|
|
21
|
-
* with the same `IDAnchorPagination` envelope the other two use;
|
|
22
|
-
* 2. failing that, a `status` filter on it, so at least the published subset
|
|
23
|
-
* can be narrowed without a search module.
|
|
24
|
-
*
|
|
25
|
-
* Until then a host injects a {@link MyListingsSource} and the dashboard
|
|
26
|
-
* works completely; without one it shows the real counters and NAMES the
|
|
27
|
-
* absence, because "we cannot ask" and "you have no listings" are different
|
|
28
|
-
* sentences.
|
|
29
|
-
*/
|
|
30
|
-
import { StapelApiError } from "@stapel/core";
|
|
31
|
-
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
32
|
-
/**
|
|
33
|
-
* The error a dashboard without a source reports.
|
|
34
|
-
*
|
|
35
|
-
* `status: 0` on purpose: this is a fact about the deployment's wiring, not
|
|
36
|
-
* something a server said, and a client-side refusal must never be
|
|
37
|
-
* indistinguishable from one that came over the wire.
|
|
6
|
+
* The tab → statuses table is `MY_LISTINGS_TAB_STATUSES`, which is a copy of
|
|
7
|
+
* the SERVER's grouping in `views.my_counters`. That is the whole point: the
|
|
8
|
+
* rows this fetches and the count on the tab beside them are the same set,
|
|
9
|
+
* asserted upstream (`tests/test_my_listings.py`) and here.
|
|
38
10
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"owner-scoped list endpoint to fall back on.",
|
|
43
|
-
status: 0,
|
|
44
|
-
});
|
|
11
|
+
export function defaultMyListingsSource(api) {
|
|
12
|
+
return ({ tab, page, signal }) => api.myListings({ ...page, status: MY_LISTINGS_TAB_STATUSES[tab] }, signal !== undefined ? { signal } : {});
|
|
13
|
+
}
|
|
45
14
|
//# sourceMappingURL=mineSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AASvD;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAgB;IACtD,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAC/B,GAAG,CAAC,UAAU,CACZ,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,wBAAwB,CAAC,GAAG,CAAC,EAAE,EAClD,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CACvC,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AA4CzB,mEAAmE;AACnE,wBAAgB,cAAc,IAAI,iBAAiB,CACjD,YAAY,EACZ,cAAc,EACd,iBAAiB,CAClB,CAeA;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,iBAAiB,CAC/C,YAAY,EACZ,cAAc,EACd,cAAc,CACf,CAUA;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,iBAAiB,CACpD,eAAe,EACf,cAAc,EACd,MAAM,CACP,CAUA;AAED;4EAC4E;AAC5E,wBAAgB,iBAAiB,IAAI,iBAAiB,CACpD,qBAAqB,EACrB,cAAc,EACd,MAAM,CACP,CAUA;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,qBAAqB,EACrB,cAAc,EACd,MAAM,CACP,CAUA;AAED;0CAC0C;AAC1C,wBAAgB,gBAAgB,IAAI,iBAAiB,CACnD,cAAc,EACd,cAAc,EACd,MAAM,CACP,CAWA;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,IAAI,iBAAiB,CACrD,sBAAsB,EACtB,cAAc,EACd,aAAa,CACd,CAmBA"}
|
package/dist/model/mutations.js
CHANGED
|
@@ -16,10 +16,13 @@ import { listingsQueryKeys } from "./queryKeys.js";
|
|
|
16
16
|
* ── The invalidation rule ──────────────────────────────────────────────────
|
|
17
17
|
*
|
|
18
18
|
* A write that can move `status` or `moderation_status` invalidates the
|
|
19
|
-
* DETAIL, the STATUS probe and the
|
|
20
|
-
* three tabs are defined by status sets (`views.my_counters`),
|
|
21
|
-
* silently moves a row from "drafts" to "active" and a dashboard
|
|
22
|
-
* refetch would show the old number beside the new row
|
|
19
|
+
* DETAIL, the STATUS probe, the COUNTERS and the owner's ROWS — the counters
|
|
20
|
+
* because their three tabs are defined by status sets (`views.my_counters`),
|
|
21
|
+
* so a publish silently moves a row from "drafts" to "active" and a dashboard
|
|
22
|
+
* that did not refetch would show the old number beside the new row; the rows
|
|
23
|
+
* for the same reason, since stapel-listings 0.7.0 gave them a route and they
|
|
24
|
+
* are narrowed by exactly those status sets. Invalidating one and not the
|
|
25
|
+
* other is the shape of the bug where the badge says 2 and the tab shows 3.
|
|
23
26
|
*
|
|
24
27
|
* Nothing here is optimistic except the favourite toggle, and that exception
|
|
25
28
|
* is argued at its own hook.
|
|
@@ -34,6 +37,7 @@ function invalidateListing(queryClient, id) {
|
|
|
34
37
|
void queryClient.invalidateQueries({
|
|
35
38
|
queryKey: listingsQueryKeys.validateDraft(id),
|
|
36
39
|
});
|
|
40
|
+
void queryClient.invalidateQueries({ queryKey: listingsQueryKeys.allMine() });
|
|
37
41
|
}
|
|
38
42
|
/** Start a draft. The server forces `owner` and `status=draft`. */
|
|
39
43
|
export function useCreateDraft() {
|
|
@@ -46,6 +50,9 @@ export function useCreateDraft() {
|
|
|
46
50
|
void queryClient.invalidateQueries({
|
|
47
51
|
queryKey: listingsQueryKeys.myCounters(),
|
|
48
52
|
});
|
|
53
|
+
void queryClient.invalidateQueries({
|
|
54
|
+
queryKey: listingsQueryKeys.allMine(),
|
|
55
|
+
});
|
|
49
56
|
},
|
|
50
57
|
});
|
|
51
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../src/model/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWpE,OAAO,E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C,CAAC;AACL,CAAC;AAQD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB;IAKhC,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,OAAO,WAAW,CAAC;QACjB,UAAU,EAAE,CAAC,KAAoB,EAAE,EAAE,CACnC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACrE,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;YAClC,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;aAC7C,CAAC,CAAC;YACH,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,YAAY,EAAE;aAC3C,CAAC,CAAC;YACH,KAAK,WAAW,CAAC,iBAAiB,CAAC;gBACjC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE;aACvC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -36,9 +36,14 @@ export declare const listingsQueryKeys: {
|
|
|
36
36
|
myCounters(): readonly ["listings", "my", "counters"];
|
|
37
37
|
/** The caller's favourites, one keyset page. */
|
|
38
38
|
myFavorites(page: ListingPageKey): readonly ["listings", "my", "favorites", ListingPageKey];
|
|
39
|
-
/** The owner's own rows, per tab
|
|
40
|
-
* this read goes through an injected source. */
|
|
39
|
+
/** The owner's own rows, per tab (`GET my/listings/?status=…`). */
|
|
41
40
|
mine(tab: string, page: ListingPageKey): readonly ["listings", "my", "listings", string, ListingPageKey];
|
|
41
|
+
/** The owner's rows no tab folds in — a takedown. A sibling of `mine` and
|
|
42
|
+
* not one of its tabs, because it answers a different question and must not
|
|
43
|
+
* be evicted when a tab pages. */
|
|
44
|
+
mineUntabbed(): readonly ["listings", "my", "listings", "untabbed"];
|
|
45
|
+
/** Every owner-row page, for an invalidation after a write. */
|
|
46
|
+
allMine(): readonly ["listings", "my", "listings"];
|
|
42
47
|
/** `GET /{pk}/validate-draft/` — the dry run of a publish. */
|
|
43
48
|
validateDraft(id: number): readonly ["listings", "validate-draft", number];
|
|
44
49
|
/** Every favourites PAGE, for an invalidation after a toggle — the cursor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryKeys.d.ts","sourceRoot":"","sources":["../../src/model/queryKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;wBAEwB;AACxB,wBAAgB,OAAO,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,cAAc,CAMlE;AAID,eAAO,MAAM,iBAAiB,EAAE;IAC9B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACpC,+BAA+B;IAC/B,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAC1E,2BAA2B;IAC3B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D;;0EAEsE;IACtE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,SAA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,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,gDAAgD;IAChD,WAAW,CACT,IAAI,EAAE,cAAc,GACnB,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAC5D,mEAAmE;IACnE,IAAI,CACF,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,cAAc,GACnB,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IACnE;;sCAEkC;IAClC,YAAY,IAAI,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,+DAA+D;IAC/D,OAAO,IAAI,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACnD,8DAA8D;IAC9D,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAC3E;8EAC0E;IAC1E,YAAY,IAAI,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IACzD,8CAA8C;IAC9C,QAAQ,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;CAc3C,CAAC"}
|
package/dist/model/queryKeys.js
CHANGED
|
@@ -17,6 +17,8 @@ export const listingsQueryKeys = {
|
|
|
17
17
|
myCounters: () => [ROOT, "my", "counters"],
|
|
18
18
|
myFavorites: (page) => [ROOT, "my", "favorites", page],
|
|
19
19
|
mine: (tab, page) => [ROOT, "my", "listings", tab, page],
|
|
20
|
+
mineUntabbed: () => [ROOT, "my", "listings", "untabbed"],
|
|
21
|
+
allMine: () => [ROOT, "my", "listings"],
|
|
20
22
|
validateDraft: (id) => [ROOT, "validate-draft", id],
|
|
21
23
|
allFavorites: () => [ROOT, "my", "favorites"],
|
|
22
24
|
allLists: () => [ROOT, "list"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryKeys.js","sourceRoot":"","sources":["../../src/model/queryKeys.ts"],"names":[],"mappings":"AAsBA;;wBAEwB;AACxB,MAAM,UAAU,OAAO,CAAC,MAA0B;IAChD,OAAO;QACL,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI;QAC9B,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI;QACpC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,UAAmB,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"queryKeys.js","sourceRoot":"","sources":["../../src/model/queryKeys.ts"],"names":[],"mappings":"AAsBA;;wBAEwB;AACxB,MAAM,UAAU,OAAO,CAAC,MAA0B;IAChD,OAAO;QACL,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI;QAC9B,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI;QACpC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,UAAmB,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAkC1B;IACF,GAAG,EAAE,CAAC,IAAI,CAAC;IACX,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC;IACpC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC;IACpC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC;IACpC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC;IAC1C,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC;IACtD,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,CAAC;IACxD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC;IACxD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC;IACvC,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,CAAC;IACnD,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC;IAC7C,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;CAC/B,CAAC"}
|
package/dist/model/status.d.ts
CHANGED
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TWO AXES, BOTH ON SCREEN, NEITHER STANDING IN FOR THE OTHER.
|
|
3
|
-
*
|
|
4
|
-
* `status` (nine states) is the lifecycle and the ONLY thing that decides
|
|
5
|
-
* whether a listing is public: `Listing.objects.published()` filters on it
|
|
6
|
-
* alone, `INDEXED_STATUSES` is `{published}`, and the model says so out loud
|
|
7
|
-
* ("no visibility-reads-moderation_status coupling", `models.py`).
|
|
8
|
-
* `moderation_status` (four states) is the content verdict and decides
|
|
9
|
-
* NOTHING about visibility.
|
|
10
|
-
*
|
|
11
|
-
* Since stapel-listings 0.5.0 the two genuinely diverge, and that divergence
|
|
12
|
-
* is the reason this file exists:
|
|
13
|
-
*
|
|
14
|
-
* first publication status draft → PENDING, moderation → pending
|
|
15
|
-
* (nothing public until a verdict arrives)
|
|
16
|
-
* editing a LIVE listing status published (UNCHANGED), moderation → pending
|
|
17
|
-
* (the edit is visible immediately; a rejecting
|
|
18
|
-
* verdict later lands as PUBLISHED → BLOCKED)
|
|
19
|
-
*
|
|
20
|
-
* A dashboard that computed "under re-review" from `status` would show
|
|
21
|
-
* nothing at all for the second row — the listing looks exactly as it did —
|
|
22
|
-
* and the owner would never learn their edit is being screened. A dashboard
|
|
23
|
-
* that computed "visible" from `moderation_status` would tell them their live
|
|
24
|
-
* listing is offline while strangers are reading it. Both mistakes are one
|
|
25
|
-
* `if` away, which is why the sentence a person reads is produced HERE, from
|
|
26
|
-
* BOTH fields, once.
|
|
27
|
-
*
|
|
28
|
-
* Everything below is pure: no React, no antd, no fetch. `test/status.test.ts`
|
|
29
|
-
* asserts the whole 9 × 4 table, so a state added upstream is a red test and
|
|
30
|
-
* not a bare enum value on a page.
|
|
31
|
-
*/
|
|
32
1
|
import type { ListingLifecycleStatus, ListingModerationStatus } from "../api/types.js";
|
|
33
2
|
/**
|
|
34
3
|
* How a status should READ, independent of the words: neutral (nothing is
|
|
@@ -114,4 +83,16 @@ export declare const MY_LISTINGS_TAB_STATUSES: Readonly<Record<MyListingsTab, re
|
|
|
114
83
|
* status `my/counters` counts in no tab at all. A dashboard that silently
|
|
115
84
|
* dropped it would hide exactly the listing whose owner most needs to know. */
|
|
116
85
|
export declare function tabOf(status: ListingLifecycleStatus): MyListingsTab | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The statuses no tab folds in — `blocked`, and nothing else today.
|
|
88
|
+
*
|
|
89
|
+
* DERIVED, not written down a second time: a status added upstream and left
|
|
90
|
+
* out of the counter groupings lands here automatically and gets shown, which
|
|
91
|
+
* is the opposite of what a hardcoded `["blocked"]` would do the day it goes
|
|
92
|
+
* stale. The dashboard renders these rows OUTSIDE the tabs (see
|
|
93
|
+
* `default/MyListingsPane.tsx`) rather than folding them into one, because a
|
|
94
|
+
* tab's rows and its `my/counters` badge have to describe the same set — and
|
|
95
|
+
* `my/counters` counts a takedown in no tab at all.
|
|
96
|
+
*/
|
|
97
|
+
export declare const MY_LISTINGS_UNTABBED_STATUSES: readonly ListingLifecycleStatus[];
|
|
117
98
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/model/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/model/status.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,CAAC;AAEd,mDAAmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC;8DAC0D;IAC1D,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AAoDD,4CAA4C;AAC5C,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,GAC7B,gBAAgB,CAElB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAEzE;AAED,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,uBAAuB,CAAC;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,EAC9B,gBAAgB,EAAE,uBAAuB,GACxC,gBAAgB,GAAG,SAAS,CA0D9B;AAED,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAClD;;;2BAGuB;IACvB,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC;sCACkC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAChE;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,sBAAsB,EAC9B,gBAAgB,EAAE,uBAAuB,GACxC,iBAAiB,CAQnB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,2CAA4C,CAAC;AAE1E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAC7C,MAAM,CAAC,aAAa,EAAE,SAAS,sBAAsB,EAAE,CAAC,CAKzD,CAAC;AAEF;;+EAE+E;AAC/E,wBAAgB,KAAK,CACnB,MAAM,EAAE,sBAAsB,GAC7B,aAAa,GAAG,SAAS,CAK3B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,sBAAsB,EACT,CAAC"}
|
package/dist/model/status.js
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TWO AXES, BOTH ON SCREEN, NEITHER STANDING IN FOR THE OTHER.
|
|
3
|
+
*
|
|
4
|
+
* `status` (nine states) is the lifecycle and the ONLY thing that decides
|
|
5
|
+
* whether a listing is public: `Listing.objects.published()` filters on it
|
|
6
|
+
* alone, `INDEXED_STATUSES` is `{published}`, and the model says so out loud
|
|
7
|
+
* ("no visibility-reads-moderation_status coupling", `models.py`).
|
|
8
|
+
* `moderation_status` (four states) is the content verdict and decides
|
|
9
|
+
* NOTHING about visibility.
|
|
10
|
+
*
|
|
11
|
+
* Since stapel-listings 0.5.0 the two genuinely diverge, and that divergence
|
|
12
|
+
* is the reason this file exists:
|
|
13
|
+
*
|
|
14
|
+
* first publication status draft → PENDING, moderation → pending
|
|
15
|
+
* (nothing public until a verdict arrives)
|
|
16
|
+
* editing a LIVE listing status published (UNCHANGED), moderation → pending
|
|
17
|
+
* (the edit is visible immediately; a rejecting
|
|
18
|
+
* verdict later lands as PUBLISHED → BLOCKED)
|
|
19
|
+
*
|
|
20
|
+
* A dashboard that computed "under re-review" from `status` would show
|
|
21
|
+
* nothing at all for the second row — the listing looks exactly as it did —
|
|
22
|
+
* and the owner would never learn their edit is being screened. A dashboard
|
|
23
|
+
* that computed "visible" from `moderation_status` would tell them their live
|
|
24
|
+
* listing is offline while strangers are reading it. Both mistakes are one
|
|
25
|
+
* `if` away, which is why the sentence a person reads is produced HERE, from
|
|
26
|
+
* BOTH fields, once.
|
|
27
|
+
*
|
|
28
|
+
* Everything below is pure: no React, no antd, no fetch. `test/status.test.ts`
|
|
29
|
+
* asserts the whole 9 × 4 table, so a state added upstream is a red test and
|
|
30
|
+
* not a bare enum value on a page.
|
|
31
|
+
*/
|
|
32
|
+
import { LISTING_STATUSES } from "../api/types.js";
|
|
1
33
|
import { LISTING_TRANSITIONS } from "./transitions.js";
|
|
2
34
|
import { LISTINGS_I18N_KEYS } from "../i18n/keys.js";
|
|
3
35
|
const LIFECYCLE = {
|
|
@@ -161,4 +193,16 @@ export function tabOf(status) {
|
|
|
161
193
|
}
|
|
162
194
|
return undefined;
|
|
163
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* The statuses no tab folds in — `blocked`, and nothing else today.
|
|
198
|
+
*
|
|
199
|
+
* DERIVED, not written down a second time: a status added upstream and left
|
|
200
|
+
* out of the counter groupings lands here automatically and gets shown, which
|
|
201
|
+
* is the opposite of what a hardcoded `["blocked"]` would do the day it goes
|
|
202
|
+
* stale. The dashboard renders these rows OUTSIDE the tabs (see
|
|
203
|
+
* `default/MyListingsPane.tsx`) rather than folding them into one, because a
|
|
204
|
+
* tab's rows and its `my/counters` badge have to describe the same set — and
|
|
205
|
+
* `my/counters` counts a takedown in no tab at all.
|
|
206
|
+
*/
|
|
207
|
+
export const MY_LISTINGS_UNTABBED_STATUSES = LISTING_STATUSES.filter((status) => tabOf(status) === undefined);
|
|
164
208
|
//# sourceMappingURL=status.js.map
|
package/dist/model/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/model/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/model/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAKnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA6BrD,MAAM,SAAS,GAEX;IACF,KAAK,EAAE;QACL,QAAQ,EAAE,kBAAkB,CAAC,WAAW;QACxC,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,kBAAkB,CAAC,aAAa;QAC1C,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,KAAK;KACvB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,kBAAkB,CAAC,eAAe;QAC5C,IAAI,EAAE,MAAM;QACZ,eAAe,EAAE,IAAI;KACtB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,kBAAkB,CAAC,YAAY;QACzC,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,KAAK;KACvB;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,kBAAkB,CAAC,aAAa;QAC1C,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,KAAK;KACvB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,kBAAkB,CAAC,UAAU;QACvC,IAAI,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C;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;CACpD,CAAC;AAEF;;+EAE+E;AAC/E,MAAM,UAAU,KAAK,CACnB,MAA8B;IAE9B,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACnC,IAAI,wBAAwB,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,GAAG,CAAC;IACjE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,gBAAgB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @stapel/listings-react 0.
|
|
1
|
+
# @stapel/listings-react 0.4.0
|
|
2
2
|
|
|
3
|
-
Headless React flow pair for stapel-listings (contract >=0.
|
|
3
|
+
Headless React flow pair for stapel-listings (contract >=0.7 <0.8) — business + state, zero visual opinion.
|
|
4
4
|
Built on @stapel/core: typed client + StapelApiError envelope, auth token refresh,
|
|
5
5
|
verification-403 interception, i18n engine, analytics facade, TanStack Query layer.
|
|
6
6
|
|
|
@@ -29,6 +29,7 @@ Paths are relative to `/listings/api/v1/`.
|
|
|
29
29
|
- listings_api_v1_listings_list: GET /listings/
|
|
30
30
|
- listings_api_v1_listings_my_counters_retrieve: GET /listings/my/counters/
|
|
31
31
|
- listings_api_v1_listings_my_favorites_list: GET /listings/my/favorites/
|
|
32
|
+
- listings_api_v1_listings_my_listings_list: GET /listings/my/listings/
|
|
32
33
|
- listings_api_v1_listings_partial_update: PATCH /listings/{id}/
|
|
33
34
|
- listings_api_v1_listings_publish_create: POST /listings/{id}/publish/
|
|
34
35
|
- listings_api_v1_listings_retrieve: GET /listings/{id}/
|
|
@@ -54,7 +55,7 @@ Paths are relative to `/listings/api/v1/`.
|
|
|
54
55
|
- useValidateDraft (query) → validateDraft
|
|
55
56
|
|
|
56
57
|
## Errors (render t(code, params); UX from remediation)
|
|
57
|
-
|
|
58
|
+
64 keys (full catalog: manifest.json §errors). By remediation: fix_input 36 · retry 15 · verify 5 · wait_and_retry 5 · contact_support 2 · reauthenticate 1.
|
|
58
59
|
Param-bearing keys (interpolation slots matter):
|
|
59
60
|
- error.400.description_too_long [400] → fix_input {max_length}
|
|
60
61
|
- error.400.description_too_short [400] → fix_input {min_length}
|
|
@@ -80,6 +81,7 @@ Param-bearing keys (interpolation slots matter):
|
|
|
80
81
|
- error.400.field.required [400] → fix_input {field}
|
|
81
82
|
- error.400.field.unique [400] → fix_input {field}
|
|
82
83
|
- error.400.listing_feature_not_allowed [400] → fix_input {feature}
|
|
84
|
+
- error.400.listing_invalid_status_filter [400] → fix_input {status}
|
|
83
85
|
- error.409.invalid_listing_transition [409] → fix_input {from_status}
|
|
84
86
|
- error.429.rate_limit [429] → wait_and_retry {retry_after_minutes}
|
|
85
87
|
|
|
@@ -107,7 +109,7 @@ const { tracked } = useTracked();
|
|
|
107
109
|
- listings.composer → <ListingComposerPage> [default|photos-in-flight|unsupported-type] demo/ListingComposer.demo.tsx
|
|
108
110
|
- listings.detail → <ListingDetailPane> [default|owner] demo/ListingDetail.demo.tsx
|
|
109
111
|
- listings.favorites → <FavoritesPane> [default|empty|failed|visitor] demo/Favorites.demo.tsx
|
|
110
|
-
- listings.mine → <MyListingsPane> [default|
|
|
112
|
+
- listings.mine → <MyListingsPane> [default|taken-down] demo/MyListings.demo.tsx
|
|
111
113
|
Each source file is the canonical usage snippet (open the default variant).
|
|
112
114
|
|
|
113
115
|
## Snippets
|
package/manifest.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"backend": {
|
|
6
6
|
"module": "stapel-listings",
|
|
7
|
-
"contract": ">=0.
|
|
7
|
+
"contract": ">=0.7 <0.8"
|
|
8
8
|
},
|
|
9
9
|
"layers": [
|
|
10
10
|
"api",
|
|
@@ -72,6 +72,13 @@
|
|
|
72
72
|
"request": null,
|
|
73
73
|
"response": "PaginatedListingCardList"
|
|
74
74
|
},
|
|
75
|
+
"listings_api_v1_listings_my_listings_list": {
|
|
76
|
+
"method": "GET",
|
|
77
|
+
"path": "/listings/api/v1/listings/my/listings/",
|
|
78
|
+
"tag": "Listings",
|
|
79
|
+
"request": null,
|
|
80
|
+
"response": "PaginatedMyListingCardList"
|
|
81
|
+
},
|
|
75
82
|
"listings_api_v1_listings_partial_update": {
|
|
76
83
|
"method": "PATCH",
|
|
77
84
|
"path": "/listings/api/v1/listings/{id}/",
|
|
@@ -142,6 +149,11 @@
|
|
|
142
149
|
"kind": "mutation",
|
|
143
150
|
"operation": "createDraft",
|
|
144
151
|
"invalidates": [
|
|
152
|
+
[
|
|
153
|
+
"listings",
|
|
154
|
+
"my",
|
|
155
|
+
"listings"
|
|
156
|
+
],
|
|
145
157
|
[
|
|
146
158
|
"listings",
|
|
147
159
|
"my",
|
|
@@ -453,6 +465,13 @@
|
|
|
453
465
|
],
|
|
454
466
|
"remediation": "fix_input"
|
|
455
467
|
},
|
|
468
|
+
"error.400.listing_invalid_status_filter": {
|
|
469
|
+
"status": 400,
|
|
470
|
+
"params": [
|
|
471
|
+
"status"
|
|
472
|
+
],
|
|
473
|
+
"remediation": "fix_input"
|
|
474
|
+
},
|
|
456
475
|
"error.400.publish_validation_failed": {
|
|
457
476
|
"status": 400,
|
|
458
477
|
"params": [],
|
|
@@ -697,7 +716,7 @@
|
|
|
697
716
|
{
|
|
698
717
|
"id": "listings.mine",
|
|
699
718
|
"title": "My listings",
|
|
700
|
-
"description": "stapel-listings 0.
|
|
719
|
+
"description": "stapel-listings 0.7.0 gave the owner's own listings a route (GET my/listings/, every status, ?status= for a tab's set), so the rows here are the contract's own. Three things the pane refuses to smooth over: both axes on every row (a LIVE listing whose edit is under review says so — status alone cannot); a row still in draft renders off title_draft, because the published title is empty until a publish, and is marked as such; and a moderation takedown, which my/counters counts in no tab at all, sits ABOVE the tabs where it cannot be missed.",
|
|
701
720
|
"component": "MyListingsPane",
|
|
702
721
|
"covers": [
|
|
703
722
|
"MyListings"
|
|
@@ -707,7 +726,7 @@
|
|
|
707
726
|
],
|
|
708
727
|
"variants": [
|
|
709
728
|
"default",
|
|
710
|
-
"
|
|
729
|
+
"taken-down"
|
|
711
730
|
],
|
|
712
731
|
"source": "demo/MyListings.demo.tsx"
|
|
713
732
|
}
|
|
@@ -744,6 +763,7 @@
|
|
|
744
763
|
"error.400.image_required",
|
|
745
764
|
"error.400.invalid_ad_id",
|
|
746
765
|
"error.400.listing_feature_not_allowed",
|
|
766
|
+
"error.400.listing_invalid_status_filter",
|
|
747
767
|
"error.400.publish_validation_failed",
|
|
748
768
|
"error.400.validation_error",
|
|
749
769
|
"error.400.verification_failed",
|
|
@@ -852,16 +872,20 @@
|
|
|
852
872
|
"listings.favorites.loading",
|
|
853
873
|
"listings.favorites.title",
|
|
854
874
|
"listings.mine.archive",
|
|
875
|
+
"listings.mine.blocked.load_failed",
|
|
876
|
+
"listings.mine.blocked.title",
|
|
855
877
|
"listings.mine.complete",
|
|
856
878
|
"listings.mine.counters_failed",
|
|
857
879
|
"listings.mine.delete",
|
|
858
880
|
"listings.mine.edit",
|
|
859
881
|
"listings.mine.empty",
|
|
882
|
+
"listings.mine.empty.active",
|
|
883
|
+
"listings.mine.empty.archived",
|
|
884
|
+
"listings.mine.empty.drafts",
|
|
860
885
|
"listings.mine.live_under_review",
|
|
861
886
|
"listings.mine.load_failed",
|
|
862
887
|
"listings.mine.loading",
|
|
863
888
|
"listings.mine.retry",
|
|
864
|
-
"listings.mine.source_missing",
|
|
865
889
|
"listings.mine.tab.active",
|
|
866
890
|
"listings.mine.tab.archived",
|
|
867
891
|
"listings.mine.tab.drafts",
|
|
@@ -914,9 +938,9 @@
|
|
|
914
938
|
"ListingsProvider",
|
|
915
939
|
"ListingsRuntimeContext",
|
|
916
940
|
"MODERATION_STATUSES",
|
|
917
|
-
"MY_LISTINGS_SOURCE_MISSING",
|
|
918
941
|
"MY_LISTINGS_TABS",
|
|
919
942
|
"MY_LISTINGS_TAB_STATUSES",
|
|
943
|
+
"MY_LISTINGS_UNTABBED_STATUSES",
|
|
920
944
|
"MyListings",
|
|
921
945
|
"PRICE_FIELD",
|
|
922
946
|
"TITLE_FIELD",
|
|
@@ -926,6 +950,7 @@
|
|
|
926
950
|
"createDraftBody",
|
|
927
951
|
"createListingsApi",
|
|
928
952
|
"createListingsRuntime",
|
|
953
|
+
"defaultMyListingsSource",
|
|
929
954
|
"draftPatchFromValues",
|
|
930
955
|
"draftValuesFromDetail",
|
|
931
956
|
"draftValuesFromWire",
|
|
@@ -948,11 +973,15 @@
|
|
|
948
973
|
"mirrorDraft",
|
|
949
974
|
"mirrorListingFields",
|
|
950
975
|
"moderationNotice",
|
|
976
|
+
"myListingImages",
|
|
977
|
+
"myListingPrice",
|
|
978
|
+
"myListingTitle",
|
|
951
979
|
"navEntries",
|
|
952
980
|
"pageKey",
|
|
953
981
|
"publishRefusal",
|
|
954
982
|
"registerListingsI18n",
|
|
955
983
|
"retainKnownFeatureValues",
|
|
984
|
+
"showsDraft",
|
|
956
985
|
"tabOf",
|
|
957
986
|
"unreadableFeatureCount",
|
|
958
987
|
"useArchiveListing",
|
|
@@ -1026,10 +1055,13 @@
|
|
|
1026
1055
|
"ListingsRuntime",
|
|
1027
1056
|
"ModerationNotice",
|
|
1028
1057
|
"MyCounters",
|
|
1058
|
+
"MyListingCard",
|
|
1029
1059
|
"MyListingsBag",
|
|
1060
|
+
"MyListingsParams",
|
|
1030
1061
|
"MyListingsSource",
|
|
1031
1062
|
"MyListingsTab",
|
|
1032
1063
|
"PaginatedListingCards",
|
|
1064
|
+
"PaginatedMyListingCards",
|
|
1033
1065
|
"PublishOutcome",
|
|
1034
1066
|
"PublishRefusal",
|
|
1035
1067
|
"PublishResponse",
|
package/nav-manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/listings-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
],
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@stapel/attributes-react": ">=0.1.0",
|
|
73
|
-
"@stapel/core": ">=0.
|
|
73
|
+
"@stapel/core": ">=0.16.0 <1.0.0",
|
|
74
74
|
"@stapel/image": ">=0.2.0",
|
|
75
75
|
"@stapel/tokens-antd": ">=0.5.0",
|
|
76
76
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"typescript": "^5.8.3",
|
|
100
100
|
"vitest": "^3.2.4",
|
|
101
101
|
"@stapel/attributes-react": "^0.2.0",
|
|
102
|
-
"@stapel/core": "^0.
|
|
103
|
-
"@stapel/image": "^0.
|
|
102
|
+
"@stapel/core": "^0.17.0",
|
|
103
|
+
"@stapel/image": "^0.3.0",
|
|
104
104
|
"@stapel/showcase": "^0.2.0",
|
|
105
105
|
"@stapel/tokens": "^0.5.0",
|
|
106
106
|
"@stapel/tokens-antd": "^0.5.0"
|