@stapel/listings-react 0.21.0 → 0.22.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/api/generated/schema.d.ts +125 -2
  3. package/dist/api/generated/schema.d.ts.map +1 -1
  4. package/dist/api/listingsApi.d.ts +20 -1
  5. package/dist/api/listingsApi.d.ts.map +1 -1
  6. package/dist/api/listingsApi.js +1 -0
  7. package/dist/api/listingsApi.js.map +1 -1
  8. package/dist/api/types.d.ts +32 -2
  9. package/dist/api/types.d.ts.map +1 -1
  10. package/dist/api/types.js +7 -0
  11. package/dist/api/types.js.map +1 -1
  12. package/dist/default/ListingCard.d.ts.map +1 -1
  13. package/dist/default/ListingCard.js +54 -5
  14. package/dist/default/ListingCard.js.map +1 -1
  15. package/dist/default/ListingSerpCard.d.ts.map +1 -1
  16. package/dist/default/ListingSerpCard.js +14 -4
  17. package/dist/default/ListingSerpCard.js.map +1 -1
  18. package/dist/default/MyListingsPane.d.ts +19 -1
  19. package/dist/default/MyListingsPane.d.ts.map +1 -1
  20. package/dist/default/MyListingsPane.js +99 -12
  21. package/dist/default/MyListingsPane.js.map +1 -1
  22. package/dist/headless/ListingActions.d.ts +64 -13
  23. package/dist/headless/ListingActions.d.ts.map +1 -1
  24. package/dist/headless/ListingActions.js +60 -5
  25. package/dist/headless/ListingActions.js.map +1 -1
  26. package/dist/i18n/es.d.ts.map +1 -1
  27. package/dist/i18n/es.js +8 -2
  28. package/dist/i18n/es.js.map +1 -1
  29. package/dist/i18n/keys.d.ts +20 -0
  30. package/dist/i18n/keys.d.ts.map +1 -1
  31. package/dist/i18n/keys.js +52 -1
  32. package/dist/i18n/keys.js.map +1 -1
  33. package/dist/i18n/ru.d.ts.map +1 -1
  34. package/dist/i18n/ru.js +12 -2
  35. package/dist/i18n/ru.js.map +1 -1
  36. package/dist/index.d.ts +5 -5
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +2 -2
  39. package/dist/index.js.map +1 -1
  40. package/dist/model/mine.d.ts +20 -0
  41. package/dist/model/mine.d.ts.map +1 -1
  42. package/dist/model/mine.js +22 -0
  43. package/dist/model/mine.js.map +1 -1
  44. package/dist/model/mutations.d.ts +24 -1
  45. package/dist/model/mutations.d.ts.map +1 -1
  46. package/dist/model/mutations.js +28 -0
  47. package/dist/model/mutations.js.map +1 -1
  48. package/dist/model/status.d.ts.map +1 -1
  49. package/dist/model/status.js +50 -12
  50. package/dist/model/status.js.map +1 -1
  51. package/dist/model/transitions.d.ts +38 -1
  52. package/dist/model/transitions.d.ts.map +1 -1
  53. package/dist/model/transitions.js +73 -1
  54. package/dist/model/transitions.js.map +1 -1
  55. package/llms.txt +4 -2
  56. package/manifest.json +26 -2
  57. package/nav-manifest.json +1 -1
  58. package/package.json +6 -6
  59. package/src/analytics/generated/events.json +1 -1
  60. package/src/api/generated/schema.ts +125 -2
  61. package/src/api/listingsApi.ts +27 -0
  62. package/src/api/types.ts +47 -2
  63. package/src/default/ListingCard.tsx +73 -5
  64. package/src/default/ListingSerpCard.tsx +17 -4
  65. package/src/default/MyListingsPane.tsx +205 -39
  66. package/src/headless/ListingActions.tsx +137 -16
  67. package/src/i18n/es.ts +8 -2
  68. package/src/i18n/keys.ts +52 -1
  69. package/src/i18n/ru.ts +12 -2
  70. package/src/index.ts +19 -3
  71. package/src/model/mine.ts +23 -0
  72. package/src/model/mutations.ts +41 -0
  73. package/src/model/status.ts +51 -12
  74. package/src/model/transitions.ts +80 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mine.d.ts","sourceRoot":"","sources":["../../src/model/mine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAEtD"}
1
+ {"version":3,"file":"mine.d.ts","sourceRoot":"","sources":["../../src/model/mine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,MAAM,EAAE,CAMrE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAEtD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAE1D"}
@@ -49,4 +49,26 @@ export function myListingImages(row) {
49
49
  export function showsDraft(row) {
50
50
  return empty(row.title) && !empty(row.title_draft);
51
51
  }
52
+ /**
53
+ * Has this listing ever been in front of anybody?
54
+ *
55
+ * The server's own predicate, and it is the one that decides whether a row
56
+ * has a page to link to: `moderation_status` defaults to `NOT_SUBMITTED`
57
+ * (stapel-listings 0.20.0) and `publish_listing` sets `PENDING`
58
+ * unconditionally, so DRAFT + NOT_SUBMITTED means "nobody has ever pressed
59
+ * publish on this" and every other combination means somebody has.
60
+ *
61
+ * NOT {@link showsDraft}: that asks which HALF of the twin a row is showing,
62
+ * which is a different question and answers `false` for an empty draft that
63
+ * has no `title_draft` either — a row with no title at all would have been
64
+ * given a link to a page that does not exist.
65
+ *
66
+ * A row from a server older than 0.20.0 has no `moderation_status` of
67
+ * `not_submitted` to report, so it falls on the "has been submitted" side and
68
+ * keeps its link: an extra link to a draft its owner can read is a smaller
69
+ * harm than withholding one from a listing that is live.
70
+ */
71
+ export function neverSubmitted(row) {
72
+ return row.status === "draft" && row.moderation_status === "not_submitted";
73
+ }
52
74
  //# sourceMappingURL=mine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mine.js","sourceRoot":"","sources":["../../src/model/mine.ts"],"names":[],"mappings":"AAmBA;;mDAEmD;AACnD,SAAS,KAAK,CAAC,KAAgC;IAC7C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC;AAC/D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAe,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,GAAG,CAAC,WAAqB,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,KAAe,CAAC;IAClD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,GAAG,CAAC,WAAqB,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,eAAe,CAAC,GAAkB;IAChD,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;IAC7B,IAAI,SAAS,KAAK,I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I,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAkB;IAC3C,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkB;IAC/C,OAAO,GAAG,CAAC,MAAM,KAAK,OAAO,IAAI,GAAG,CAAC,iBAAiB,KAAK,eAAe,CAAC;AAC7E,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { UseMutationResult } from "@tanstack/react-query";
2
2
  import type { StapelApiError } from "@stapel/core";
3
- import type { DeleteResponse, FavoriteToggleResponse, ListingActionResponse, ListingDraft, ListingDraftPatch, PublishResponse } from "../api/types.js";
3
+ import type { DeleteResponse, FavoriteToggleResponse, ListingActionResponse, ListingDraft, ListingDraftPatch, ListingOwnerTransition, PublishResponse } from "../api/types.js";
4
4
  /** Start a draft. The server forces `owner` and `status=draft`. */
5
5
  export declare function useCreateDraft(): UseMutationResult<ListingDraft, StapelApiError, ListingDraftPatch>;
6
6
  /** What a `save-draft` write carries. */
@@ -30,6 +30,29 @@ export declare function usePublishListing(): UseMutationResult<PublishResponse,
30
30
  export declare function useArchiveListing(): UseMutationResult<ListingActionResponse, StapelApiError, number>;
31
31
  /** Mark SOLD. Same 409 contract as {@link useArchiveListing}. */
32
32
  export declare function useCompleteListing(): UseMutationResult<ListingActionResponse, StapelApiError, number>;
33
+ /** What a lifecycle move carries: the row, and where it is going. */
34
+ export interface ListingTransitionInput {
35
+ readonly id: number;
36
+ readonly to: ListingOwnerTransition;
37
+ }
38
+ /**
39
+ * Move a listing along ONE edge of the seller's half of the state machine
40
+ * (`POST listings/{id}/transition/`, stapel-listings 0.20.0).
41
+ *
42
+ * The generalisation of {@link useArchiveListing} and
43
+ * {@link useCompleteListing}, and the reason it exists is that those two were
44
+ * the whole owner API for two releases: both are EXITS, so a listing that
45
+ * reached SOLD, ARCHIVED, PAUSED or EXPIRED had no call that would move it
46
+ * again and a cabinet honestly had nothing to offer but Delete. The way back
47
+ * — SOLD or PAUSED to PUBLISHED, ARCHIVED to DRAFT, EXPIRED renewed — was in
48
+ * `LISTING_TRANSITIONS` the entire time and simply had no route.
49
+ *
50
+ * Same 409 as the two named exits (`error.409.invalid_listing_transition`
51
+ * with `params.from_status`), and the same invalidation: a move changes which
52
+ * tab the row belongs to, so the counters and every `my/listings` page go
53
+ * with it.
54
+ */
55
+ export declare function useTransitionListing(): UseMutationResult<ListingActionResponse, StapelApiError, ListingTransitionInput>;
33
56
  /** Soft-delete. Refused with `error.409.listing_cannot_delete_active` while
34
57
  * the listing is PUBLISHED or PENDING. */
35
58
  export declare function useDeleteListing(): UseMutationResult<DeleteResponse, StapelApiError, number>;
@@ -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;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"}
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,sBAAsB,EACtB,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,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CACvD,qBAAqB,EACrB,cAAc,EACd,sBAAsB,CACvB,CAWA;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"}
@@ -118,6 +118,34 @@ export function useCompleteListing() {
118
118
  },
119
119
  });
120
120
  }
121
+ /**
122
+ * Move a listing along ONE edge of the seller's half of the state machine
123
+ * (`POST listings/{id}/transition/`, stapel-listings 0.20.0).
124
+ *
125
+ * The generalisation of {@link useArchiveListing} and
126
+ * {@link useCompleteListing}, and the reason it exists is that those two were
127
+ * the whole owner API for two releases: both are EXITS, so a listing that
128
+ * reached SOLD, ARCHIVED, PAUSED or EXPIRED had no call that would move it
129
+ * again and a cabinet honestly had nothing to offer but Delete. The way back
130
+ * — SOLD or PAUSED to PUBLISHED, ARCHIVED to DRAFT, EXPIRED renewed — was in
131
+ * `LISTING_TRANSITIONS` the entire time and simply had no route.
132
+ *
133
+ * Same 409 as the two named exits (`error.409.invalid_listing_transition`
134
+ * with `params.from_status`), and the same invalidation: a move changes which
135
+ * tab the row belongs to, so the counters and every `my/listings` page go
136
+ * with it.
137
+ */
138
+ export function useTransitionListing() {
139
+ const api = useListingsApi();
140
+ const queryClient = useQueryClient();
141
+ return useMutation({
142
+ mutationFn: (input) => api.transition(input.id, input.to),
143
+ retry: false,
144
+ onSuccess: (_data, input) => {
145
+ invalidateListing(queryClient, input.id);
146
+ },
147
+ });
148
+ }
121
149
  /** Soft-delete. Refused with `error.409.listing_cannot_delete_active` while
122
150
  * the listing is PUBLISHED or PENDING. */
123
151
  export function useDeleteListing() {
@@ -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,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,WAAwB,EAAE,EAAU;IAC7D,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/E,KAAK,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAA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B,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"}
@@ -111,6 +111,11 @@ export function moderationNotice(status, moderationStatus) {
111
111
  // still owes its owner an explanation — and it is the lifecycle's.
112
112
  return undefined;
113
113
  }
114
+ // NOTHING HAS BEEN SUBMITTED, so there is nothing for moderation to say.
115
+ // The lifecycle already calls this row a draft, and a second line beside
116
+ // that word can only add a claim the data does not support.
117
+ if (moderationStatus === "not_submitted")
118
+ return undefined;
114
119
  if (moderationStatus === "pending") {
115
120
  if (live) {
116
121
  return {
@@ -139,24 +144,57 @@ export function moderationNotice(status, moderationStatus) {
139
144
  };
140
145
  }
141
146
  if (moderationStatus === "needs_review") {
147
+ // Same three-way split as `pending`, and for the same reason (D225): a
148
+ // manual-review verdict is exactly as capable of being OVERTAKEN by a
149
+ // lifecycle move as an automated one is, and this branch used to ignore
150
+ // that — a sold/paused/archived/draft row carrying a stale
151
+ // `needs_review` printed "a moderator is looking at this by hand" to an
152
+ // owner whose listing had not been on offer for however long the review
153
+ // has been sitting open.
154
+ if (live) {
155
+ return {
156
+ moderationStatus,
157
+ messageKey: LISTINGS_I18N_KEYS.moderationLiveNeedsReview,
158
+ tone: "waiting",
159
+ liveDuringReview: true,
160
+ };
161
+ }
162
+ if (status === "pending") {
163
+ return {
164
+ moderationStatus,
165
+ messageKey: LISTINGS_I18N_KEYS.moderationNeedsReview,
166
+ tone: "waiting",
167
+ liveDuringReview: false,
168
+ };
169
+ }
170
+ return {
171
+ moderationStatus,
172
+ messageKey: LISTINGS_I18N_KEYS.moderationPendingOffline,
173
+ tone: "neutral",
174
+ liveDuringReview: false,
175
+ };
176
+ }
177
+ if (moderationStatus === "rejected") {
178
+ // …and it matters whether the lifecycle followed the verdict.
142
179
  return {
143
180
  moderationStatus,
144
181
  messageKey: live
145
- ? LISTINGS_I18N_KEYS.moderationLiveNeedsReview
146
- : LISTINGS_I18N_KEYS.moderationNeedsReview,
147
- tone: "waiting",
182
+ ? LISTINGS_I18N_KEYS.moderationRejectedStillLive
183
+ : LISTINGS_I18N_KEYS.moderationRejected,
184
+ tone: "warning",
148
185
  liveDuringReview: live,
149
186
  };
150
187
  }
151
- // rejected and it matters whether the lifecycle followed the verdict.
152
- return {
153
- moderationStatus,
154
- messageKey: live
155
- ? LISTINGS_I18N_KEYS.moderationRejectedStillLive
156
- : LISTINGS_I18N_KEYS.moderationRejected,
157
- tone: "warning",
158
- liveDuringReview: live,
159
- };
188
+ // AN UNKNOWN VALUE SAYS NOTHING. This used to be the `rejected` branch's
189
+ // fallthrough, which made "not one of the three I know" mean "a moderator
190
+ // turned this down" — and then stapel-listings 0.20.0 added a fourth value
191
+ // and made it the DEFAULT, so every freshly created draft in the cabinet
192
+ // was announced as "A moderator turned this listing down. Fix it and send
193
+ // it again." to a person who had submitted nothing (D166). A row read from a
194
+ // server newer than this pair must degrade to silence, never to a verdict:
195
+ // the lifecycle caption beside it is still true, and an accusation is the
196
+ // one thing a client must not invent.
197
+ return undefined;
160
198
  }
161
199
  export function listingStatusView(status, moderationStatus) {
162
200
  const moderation = moderationNotice(status, moderationStatus);
@@ -1 +1 @@
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,E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E,UAAU,EAAE,gBAAgB,KAAK,IAAI;QACtD,kBAAkB,EAAE,mBAAmB,CAAC,MAAM,CAAC;KAChD,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAI1E,MAAM,CAAC,MAAM,wBAAwB,GAEjC;IACF,MAAM,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;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"}
@@ -30,8 +30,45 @@
30
30
  import type { ListingLifecycleStatus } from "../api/types.js";
31
31
  export declare const LISTING_TRANSITIONS: Readonly<Record<ListingLifecycleStatus, readonly ListingLifecycleStatus[]>>;
32
32
  /** Would the server accept this move? A same-status move is a no-op the
33
- * server returns early on, so it counts as allowed. */
33
+ * server returns early on, so it counts as allowed.
34
+ *
35
+ * "Accept" and "offer" are NOT the same question, and conflating them is the
36
+ * whole of defect D182: `canTransition("sold", "sold")` is true, so a SOLD
37
+ * row's "Mark sold" button was enabled, clickable, and did nothing — and so
38
+ * was an ARCHIVED row's "Archive". Ask {@link ownerMoves} what to OFFER.
39
+ */
34
40
  export declare function canTransition(from: ListingLifecycleStatus, to: ListingLifecycleStatus): boolean;
41
+ /**
42
+ * The SELLER's half of the machine above, mirrored from
43
+ * `stapel_listings.models.OWNER_TRANSITIONS` (0.20.0).
44
+ *
45
+ * A subset of {@link LISTING_TRANSITIONS}, and what it leaves out is as
46
+ * load-bearing as what it keeps: `pending → published` and
47
+ * `blocked → published` are moderation's decisions, `published → blocked` is
48
+ * a takedown, and none of the three is a thing one does to oneself. Putting
49
+ * them here would make the cabinet a self-service publish gate.
50
+ *
51
+ * ── This is a FALLBACK, and the card's own field is the answer ─────────────
52
+ *
53
+ * `MyListingCard.available_transitions` is the server reporting this table
54
+ * for one row, and where it is present nothing here is consulted: the set a
55
+ * client offers and the set the route accepts are then one object rather than
56
+ * two that agree today. This copy is for a surface that holds only a `status`
57
+ * — a detail pane, a listing loaded before 0.20.0 — where the alternative is
58
+ * offering nothing at all.
59
+ */
60
+ export declare const OWNER_TRANSITIONS: Readonly<Record<ListingLifecycleStatus, readonly ListingLifecycleStatus[]>>;
61
+ /**
62
+ * What to OFFER a seller looking at a row in *status*, in drawing order.
63
+ *
64
+ * Never the status the row is already in: a control that would leave the
65
+ * world exactly as it found it is not an action, and four of them down a
66
+ * dashboard taught a seller that half the buttons on this screen do nothing.
67
+ *
68
+ * Pass the card's own `available_transitions` when it has one — see
69
+ * {@link OWNER_TRANSITIONS} for why the mirror is the second-best answer.
70
+ */
71
+ export declare function ownerMoves(status: ListingLifecycleStatus | undefined, available?: readonly ListingLifecycleStatus[] | undefined): readonly ListingLifecycleStatus[];
35
72
  /**
36
73
  * Deleting is not a transition and has its own rule
37
74
  * (`views.destroy`): a PUBLISHED or PENDING listing is refused with
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../src/model/transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CACxC,MAAM,CAAC,sBAAsB,EAAE,SAAS,sBAAsB,EAAE,CAAC,CAWlE,CAAC;AAEF;uDACuD;AACvD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,sBAAsB,EAC5B,EAAE,EAAE,sBAAsB,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAEjE"}
1
+ {"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../src/model/transitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CACxC,MAAM,CAAC,sBAAsB,EAAE,SAAS,sBAAsB,EAAE,CAAC,CAWlE,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,sBAAsB,EAC5B,EAAE,EAAE,sBAAsB,GACzB,OAAO,CAET;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CACtC,MAAM,CAAC,sBAAsB,EAAE,SAAS,sBAAsB,EAAE,CAAC,CAWlE,CAAC;AAsBF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,sBAAsB,GAAG,SAAS,EAC1C,SAAS,CAAC,EAAE,SAAS,sBAAsB,EAAE,GAAG,SAAS,GACxD,SAAS,sBAAsB,EAAE,CAKnC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAEjE"}
@@ -10,10 +10,82 @@ export const LISTING_TRANSITIONS = {
10
10
  archived: ["draft"],
11
11
  };
12
12
  /** Would the server accept this move? A same-status move is a no-op the
13
- * server returns early on, so it counts as allowed. */
13
+ * server returns early on, so it counts as allowed.
14
+ *
15
+ * "Accept" and "offer" are NOT the same question, and conflating them is the
16
+ * whole of defect D182: `canTransition("sold", "sold")` is true, so a SOLD
17
+ * row's "Mark sold" button was enabled, clickable, and did nothing — and so
18
+ * was an ARCHIVED row's "Archive". Ask {@link ownerMoves} what to OFFER.
19
+ */
14
20
  export function canTransition(from, to) {
15
21
  return from === to || LISTING_TRANSITIONS[from].includes(to);
16
22
  }
23
+ /**
24
+ * The SELLER's half of the machine above, mirrored from
25
+ * `stapel_listings.models.OWNER_TRANSITIONS` (0.20.0).
26
+ *
27
+ * A subset of {@link LISTING_TRANSITIONS}, and what it leaves out is as
28
+ * load-bearing as what it keeps: `pending → published` and
29
+ * `blocked → published` are moderation's decisions, `published → blocked` is
30
+ * a takedown, and none of the three is a thing one does to oneself. Putting
31
+ * them here would make the cabinet a self-service publish gate.
32
+ *
33
+ * ── This is a FALLBACK, and the card's own field is the answer ─────────────
34
+ *
35
+ * `MyListingCard.available_transitions` is the server reporting this table
36
+ * for one row, and where it is present nothing here is consulted: the set a
37
+ * client offers and the set the route accepts are then one object rather than
38
+ * two that agree today. This copy is for a surface that holds only a `status`
39
+ * — a detail pane, a listing loaded before 0.20.0 — where the alternative is
40
+ * offering nothing at all.
41
+ */
42
+ export const OWNER_TRANSITIONS = {
43
+ draft: ["pending", "archived"],
44
+ pending: ["draft", "archived"],
45
+ published: ["paused", "sold", "archived"],
46
+ paused: ["published", "archived"],
47
+ expired: ["pending", "archived"],
48
+ sold: ["published", "archived"],
49
+ rejected: ["draft", "archived"],
50
+ blocked: ["draft", "archived"],
51
+ archived: ["draft"],
52
+ };
53
+ /**
54
+ * The order the moves are DRAWN in, wherever they came from.
55
+ *
56
+ * A row's action set changes as the listing moves through its life, and a set
57
+ * that also reorders itself makes a person hunt for the button they used
58
+ * yesterday. Forward first (back on sale, then submitted, then paused), exits
59
+ * last — so "Archive" is never where "Publish again" was a moment ago.
60
+ */
61
+ const MOVE_ORDER = [
62
+ "published",
63
+ "pending",
64
+ "paused",
65
+ "sold",
66
+ "draft",
67
+ "rejected",
68
+ "blocked",
69
+ "expired",
70
+ "archived",
71
+ ];
72
+ /**
73
+ * What to OFFER a seller looking at a row in *status*, in drawing order.
74
+ *
75
+ * Never the status the row is already in: a control that would leave the
76
+ * world exactly as it found it is not an action, and four of them down a
77
+ * dashboard taught a seller that half the buttons on this screen do nothing.
78
+ *
79
+ * Pass the card's own `available_transitions` when it has one — see
80
+ * {@link OWNER_TRANSITIONS} for why the mirror is the second-best answer.
81
+ */
82
+ export function ownerMoves(status, available) {
83
+ if (status === undefined)
84
+ return [];
85
+ const offered = available ?? OWNER_TRANSITIONS[status];
86
+ const set = new Set(offered.filter((to) => to !== status));
87
+ return MOVE_ORDER.filter((to) => set.has(to));
88
+ }
17
89
  /**
18
90
  * Deleting is not a transition and has its own rule
19
91
  * (`views.destroy`): a PUBLISHED or PENDING listing is refused with
@@ -1 +1 @@
1
- {"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/model/transitions.ts"],"names":[],"mappings":"AA+BA,MAAM,CAAC,MAAM,mBAAmB,GAE5B;IACF,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9B,OAAO,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC;IACvD,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;IAC/D,OAAO,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC;IAC3C,MAAM,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,SAAS,CAAC;IAC5C,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC;IAC7C,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAC/B,QAAQ,EAAE,CAAC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# @stapel/listings-react 0.21.0
1
+ # @stapel/listings-react 0.22.1
2
2
 
3
- Headless React flow pair for stapel-listings (contract >=0.19 <0.20) — business + state, zero visual opinion.
3
+ Headless React flow pair for stapel-listings (contract >=0.21 <0.22) — 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
 
@@ -36,6 +36,7 @@ Paths are relative to `/listings/api/v1/`.
36
36
  - listings_api_v1_listings_retrieve: GET /listings/{id}/
37
37
  - listings_api_v1_listings_save_draft_create: POST /listings/{id}/save-draft/
38
38
  - listings_api_v1_listings_status_retrieve: GET /listings/{id}/status/
39
+ - listings_api_v1_listings_transition_create: POST /listings/{id}/transition/
39
40
  - listings_api_v1_listings_unfavorite_create: POST /listings/{id}/unfavorite/
40
41
  - listings_api_v1_listings_update: PUT /listings/{id}/
41
42
  - listings_api_v1_listings_validate_draft_retrieve: GET /listings/{id}/validate-draft/
@@ -54,6 +55,7 @@ Paths are relative to `/listings/api/v1/`.
54
55
  - useMyFavorites (query) → myFavorites
55
56
  - usePublishListing (mutation) → publish
56
57
  - useSaveDraft (mutation) → saveDraft
58
+ - useTransitionListing (mutation) → transition
57
59
  - useValidateDraft (query) → validateDraft
58
60
 
59
61
  ## Errors (render t(code, params); UX from remediation)
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.21.0",
4
+ "version": "0.22.1",
5
5
  "backend": {
6
6
  "module": "stapel-listings",
7
- "contract": ">=0.19 <0.20"
7
+ "contract": ">=0.21 <0.22"
8
8
  },
9
9
  "layers": [
10
10
  "api",
@@ -121,6 +121,13 @@
121
121
  "request": null,
122
122
  "response": "ListingStatus"
123
123
  },
124
+ "listings_api_v1_listings_transition_create": {
125
+ "method": "POST",
126
+ "path": "/listings/api/v1/listings/{id}/transition/",
127
+ "tag": "listings",
128
+ "request": "ListingTransitionRequest",
129
+ "response": "ListingActionResponse"
130
+ },
124
131
  "listings_api_v1_listings_unfavorite_create": {
125
132
  "method": "POST",
126
133
  "path": "/listings/api/v1/listings/{id}/unfavorite/",
@@ -263,6 +270,10 @@
263
270
  "kind": "mutation",
264
271
  "operation": "saveDraft"
265
272
  },
273
+ "useTransitionListing": {
274
+ "kind": "mutation",
275
+ "operation": "transition"
276
+ },
266
277
  "useValidateDraft": {
267
278
  "kind": "query",
268
279
  "operation": "validateDraft",
@@ -1058,11 +1069,17 @@
1058
1069
  "listings.mine.live_under_review",
1059
1070
  "listings.mine.load_failed",
1060
1071
  "listings.mine.loading",
1072
+ "listings.mine.move.draft",
1073
+ "listings.mine.move.paused",
1074
+ "listings.mine.move.pending",
1075
+ "listings.mine.move.published",
1076
+ "listings.mine.move.renew",
1061
1077
  "listings.mine.retry",
1062
1078
  "listings.mine.tab.active",
1063
1079
  "listings.mine.tab.archived",
1064
1080
  "listings.mine.tab.drafts",
1065
1081
  "listings.mine.title",
1082
+ "listings.mine.view",
1066
1083
  "listings.moderation.first_review",
1067
1084
  "listings.moderation.live_edit_pending",
1068
1085
  "listings.moderation.live_needs_review",
@@ -1123,6 +1140,7 @@
1123
1140
  "MY_LISTINGS_TAB_STATUSES",
1124
1141
  "MY_LISTINGS_UNTABBED_STATUSES",
1125
1142
  "MyListings",
1143
+ "OWNER_TRANSITIONS",
1126
1144
  "PRICE_FIELD",
1127
1145
  "TITLE_FIELD",
1128
1146
  "asFeatureDaoList",
@@ -1164,6 +1182,7 @@
1164
1182
  "myListingPrice",
1165
1183
  "myListingTitle",
1166
1184
  "navEntries",
1185
+ "ownerMoves",
1167
1186
  "pageKey",
1168
1187
  "publishRefusal",
1169
1188
  "registerListingsI18n",
@@ -1199,6 +1218,7 @@
1199
1218
  "useMyListings",
1200
1219
  "usePublishListing",
1201
1220
  "useSaveDraft",
1221
+ "useTransitionListing",
1202
1222
  "useValidateDraft",
1203
1223
  "withEngagement"
1204
1224
  ],
@@ -1241,11 +1261,14 @@
1241
1261
  "ListingLifecycleStatus",
1242
1262
  "ListingLocation",
1243
1263
  "ListingModerationStatus",
1264
+ "ListingMove",
1265
+ "ListingOwnerTransition",
1244
1266
  "ListingPageKey",
1245
1267
  "ListingPageParams",
1246
1268
  "ListingStatusInfo",
1247
1269
  "ListingStatusTone",
1248
1270
  "ListingStatusView",
1271
+ "ListingTransitionInput",
1249
1272
  "ListingsApi",
1250
1273
  "ListingsErrorCode",
1251
1274
  "ListingsErrorSpec",
@@ -1269,6 +1292,7 @@
1269
1292
  "SaveDraftInput",
1270
1293
  "Schemas",
1271
1294
  "UseFavoritesOptions",
1295
+ "UseListingActionsOptions",
1272
1296
  "UseListingComposerOptions",
1273
1297
  "UseListingDetailOptions",
1274
1298
  "UseListingEngagementOverlayOptions",
package/nav-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@stapel/listings-react",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "entries": [
5
5
  {
6
6
  "id": "listings.detail",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stapel/listings-react",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
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": {
@@ -53,9 +53,9 @@
53
53
  "limit": "14 KB"
54
54
  },
55
55
  {
56
- "name": "default — the antd skin (three cards, detail, composer, dashboard, the named slots and the delete confirmation) must stay out of the main bundle. Raised 17 -> 19 KB for the mobile wave: <ListingSerpCard> (photo strip + price-first block + action rail), <ListingFeedCard> and <FeedGrid> are two more card surfaces on the same shared target/favourite/photo parts, not three copies of one Raised 19 -> 20 KB for the desktop wave of the detail page: layout=\"split\" is a second ASSEMBLY of the money page (the sticky buy column, the two-column spec table, the widened measure) over the same parts, and GateReasonPopover is the blocked heart's third volume — the reason and the door disclosed on interaction, with the visually-hidden copy that keeps the refusal in the accessibility tree. Both are geometry and wiring, not new widgets. Raised 20 -> 21 KB (measured 20.22) for the engagement wave, which is four small things and no new component: the disclosure became a controlled open/close so a pointer that hovers and then clicks does not shut the only explanation the control has; the heart draws a filled accent when saved and states a failed save through the shared ErrorAlert; an already-seen card dims through one rule in the sheet all three cards already hoist; and the listing page gained a view-count row. 216 bytes is what a control that reports its own outcome costs",
56
+ "name": "default — the antd skin (three cards, detail, composer, dashboard, the named slots and the delete confirmation) must stay out of the main bundle. Raised 17 -> 19 KB for the mobile wave: <ListingSerpCard> (photo strip + price-first block + action rail), <ListingFeedCard> and <FeedGrid> are two more card surfaces on the same shared target/favourite/photo parts, not three copies of one Raised 19 -> 20 KB for the desktop wave of the detail page: layout=\"split\" is a second ASSEMBLY of the money page (the sticky buy column, the two-column spec table, the widened measure) over the same parts, and GateReasonPopover is the blocked heart's third volume — the reason and the door disclosed on interaction, with the visually-hidden copy that keeps the refusal in the accessibility tree. Both are geometry and wiring, not new widgets. Raised 20 -> 21 KB (measured 20.22) for the engagement wave, which is four small things and no new component: the disclosure became a controlled open/close so a pointer that hovers and then clicks does not shut the only explanation the control has; the heart draws a filled accent when saved and states a failed save through the shared ErrorAlert; an already-seen card dims through one rule in the sheet all three cards already hoist; and the listing page gained a view-count row. 216 bytes is what a control that reports its own outcome costs. Raised 21 -> 22 KB for the seller's board becoming a door in both directions: the transition route and useTransitionListing, OWNER_TRANSITIONS/ownerMoves as the fallback mirror, ListingActionsBag.moves drawn in a stable order, listingHref/linkComponent on the cabinet pane, the refusal that stops quoting the wire, and the row that fits a phone. Measured on a clean tree, this package's src reverted to the previous commit with dependencies held constant: 20.82 -> 21.60 KB. The old ceiling had 180 B of room and the work needs 780; none of it is copy, and a fourth axis of owner state is not a rounding error",
57
57
  "path": "dist/default/index.js",
58
- "limit": "21 KB"
58
+ "limit": "22 KB"
59
59
  },
60
60
  {
61
61
  "name": "i18n/ru — the Russian bundle is opt-in, not carried by the main entry",
@@ -102,13 +102,13 @@
102
102
  "size-limit": "^11.2.0",
103
103
  "typescript": "^5.8.3",
104
104
  "vitest": "^3.2.4",
105
- "@stapel/attributes-react": "^0.14.1",
106
- "@stapel/core": "^0.24.0",
105
+ "@stapel/attributes-react": "^0.15.0",
106
+ "@stapel/core": "^0.25.0",
107
107
  "@stapel/currencies-react": "^0.3.0",
108
108
  "@stapel/image": "^0.4.2",
109
109
  "@stapel/showcase": "^0.3.0",
110
110
  "@stapel/tokens": "^0.7.0",
111
- "@stapel/tokens-antd": "^0.16.0"
111
+ "@stapel/tokens-antd": "^0.16.1"
112
112
  },
113
113
  "engines": {
114
114
  "node": ">=22"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$generated": "by scripts/gen-events.mjs — do not edit; drift-gated (pnpm gen:events:check)",
3
3
  "package": "@stapel/listings-react",
4
- "version": "0.21.0",
4
+ "version": "0.22.1",
5
5
  "defined": [],
6
6
  "flows": []
7
7
  }