@stapel/listings-react 0.25.9 → 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 +216 -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/ListingComposer.d.ts +36 -2
- package/dist/headless/ListingComposer.d.ts.map +1 -1
- package/dist/headless/ListingComposer.js +15 -2
- package/dist/headless/ListingComposer.js.map +1 -1
- 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 +11 -11
- 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/ListingComposer.tsx +68 -4
- 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
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,GACd,MAAM,gBAAgB,CAAC;AAiCxB,gFAAgF;AAChF,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,GACd,MAAM,gBAAgB,CAAC;AAiCxB,gFAAgF;AAChF,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,mBAAmB,C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,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEhE,gFAAgF;AAChF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,gFAAgF;AAChF,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,iBAAiB,EACjB,iCAAiC,EACjC,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
|
@@ -56,6 +56,44 @@
|
|
|
56
56
|
* contract, and it is rendered exactly as it is rendered today — through
|
|
57
57
|
* `@stapel/attributes-react`'s `<FeatureBadges>`, off the stored DAO's own
|
|
58
58
|
* config. Nothing about this module is required for a card to draw.
|
|
59
|
+
*
|
|
60
|
+
* ── A CHIP IS NOT A LINE (D421) ───────────────────────────────────────────
|
|
61
|
+
*
|
|
62
|
+
* The four presentations produce a piece of text; where that text is PUT
|
|
63
|
+
* decides how it is read, and the two places this pair puts it are not the
|
|
64
|
+
* same place:
|
|
65
|
+
*
|
|
66
|
+
* a badge strip each element is a `<Tag>`, and the chip's own border says
|
|
67
|
+
* where one fact ends and the next begins;
|
|
68
|
+
* a spec line the elements are joined with " · ", so the only thing
|
|
69
|
+
* separating two facts is punctuation, and a SPACE inside
|
|
70
|
+
* one of them is not punctuation.
|
|
71
|
+
*
|
|
72
|
+
* Measured on a live feed, translated: "HONOR · Model 90 · 256 GB" — three
|
|
73
|
+
* facts, and the middle one reads as a value that begins with the word
|
|
74
|
+
* "Model", because in a run of values a caption joined by a space is
|
|
75
|
+
* indistinguishable from a two-word answer. So {@link CardBadgeStyle}
|
|
76
|
+
* `"line"` writes the same pair with a COLON, which is the punctuation that
|
|
77
|
+
* says "what follows is the answer to this". The chip keeps its space: "Floor 3" inside a border needs
|
|
78
|
+
* no help, and a colon there is the form-field look the 0.22 contract
|
|
79
|
+
* deliberately refused.
|
|
80
|
+
*
|
|
81
|
+
* ── …AND TWO AXES MUST NOT WEAR ONE CAPTION ───────────────────────────────
|
|
82
|
+
*
|
|
83
|
+
* The same feed: "5 fl. · 9 fl. · 54 m²" — the floor a flat is on and the
|
|
84
|
+
* number of floors in the building, printed as one number and its unit each,
|
|
85
|
+
* twice, with nothing saying which is which. The server presented both as
|
|
86
|
+
* `value_unit` and it was right about each of them ALONE; what it cannot see
|
|
87
|
+
* is that they are on one line together.
|
|
88
|
+
*
|
|
89
|
+
* That collision is a property of the SET, so it is resolved once, here, in
|
|
90
|
+
* {@link cardBadgeTexts}: elements printed without a caption that share a unit
|
|
91
|
+
* (or that print identical text) get their catalogue names back — the
|
|
92
|
+
* `name_value` shape the contract already defines, so a disambiguated element
|
|
93
|
+
* is spelled exactly as a server-captioned one. The rule refuses to act where
|
|
94
|
+
* it would not help: a group whose names are missing or not distinct is left
|
|
95
|
+
* alone rather than captioned with the same word twice, because a caption
|
|
96
|
+
* that does not tell two things apart is noise the reader still has to read.
|
|
59
97
|
*/
|
|
60
98
|
import type { ListingCardBadgeElement, ListingFeatureDao } from "../api/types.js";
|
|
61
99
|
/**
|
|
@@ -116,6 +154,14 @@ export declare function hasCardBadgeContract(rows: readonly CardBadgeRow[]): boo
|
|
|
116
154
|
* verbatim otherwise.
|
|
117
155
|
*/
|
|
118
156
|
export declare function badgeValueText(row: CardBadgeRow, locale?: string): string;
|
|
157
|
+
/**
|
|
158
|
+
* WHERE the text is going to be put — see the module header.
|
|
159
|
+
*
|
|
160
|
+
* `"badge"` is a chip in a strip and is the default, so every existing call
|
|
161
|
+
* site keeps the bytes it had. `"line"` is one item in a " · "-separated run,
|
|
162
|
+
* where a caption needs punctuation to be read as one.
|
|
163
|
+
*/
|
|
164
|
+
export type CardBadgeStyle = "badge" | "line";
|
|
119
165
|
/**
|
|
120
166
|
* One badge element → the text a card prints, or `undefined` for an element
|
|
121
167
|
* that has nothing to say (a false boolean, a blank value).
|
|
@@ -125,9 +171,12 @@ export declare function badgeValueText(row: CardBadgeRow, locale?: string): stri
|
|
|
125
171
|
* exists: three cards each re-deciding what a badge says is three places for
|
|
126
172
|
* "Brick · 3 · 9" to come back.
|
|
127
173
|
*/
|
|
128
|
-
export declare function cardBadgeText(row: CardBadgeRow, locale?: string): string | undefined;
|
|
129
|
-
/**
|
|
130
|
-
|
|
174
|
+
export declare function cardBadgeText(row: CardBadgeRow, locale?: string, style?: CardBadgeStyle): string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Every element that has something to say, in the server's order, with two
|
|
177
|
+
* axes that would read alike told apart — see the module header (D421).
|
|
178
|
+
*/
|
|
179
|
+
export declare function cardBadgeTexts(rows: readonly CardBadgeRow[], locale?: string, style?: CardBadgeStyle): readonly {
|
|
131
180
|
readonly slug: string;
|
|
132
181
|
readonly text: string;
|
|
133
182
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardBadges.d.ts","sourceRoot":"","sources":["../../src/model/cardBadges.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cardBadges.d.ts","sourceRoot":"","sources":["../../src/model/cardBadges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,cAAc,CAAC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;gEAE4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG;IACF,QAAQ,EAAE,CAAC,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI;CAC9E,GAAG;IACF;;;+BAG2B;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,qBAAqB,GAAG,SAAS,CAYtF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAE3E;AAqBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBzE;AAOD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAU9C;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,GAAE,cAAwB,GAC9B,MAAM,GAAG,SAAS,CA6BpB;AAuBD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,YAAY,EAAE,EAC7B,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,GAAE,cAAwB,GAC9B,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAsC7D"}
|
package/dist/model/cardBadges.js
CHANGED
|
@@ -80,6 +80,13 @@ export function badgeValueText(row, locale) {
|
|
|
80
80
|
function isTrue(raw) {
|
|
81
81
|
return raw === true || raw === 1 || raw === "true";
|
|
82
82
|
}
|
|
83
|
+
/** A caption and its answer, joined the way this surface separates them. */
|
|
84
|
+
function caption(name, body, style) {
|
|
85
|
+
// A SPACE in a chip and a COLON in a line. "Floor 3" is a caption inside a
|
|
86
|
+
// border; "Floor: 3" is what the same pair has to become when the border is
|
|
87
|
+
// gone and the neighbours are a dot away.
|
|
88
|
+
return style === "line" ? `${name}: ${body}` : `${name} ${body}`;
|
|
89
|
+
}
|
|
83
90
|
/**
|
|
84
91
|
* One badge element → the text a card prints, or `undefined` for an element
|
|
85
92
|
* that has nothing to say (a false boolean, a blank value).
|
|
@@ -89,7 +96,7 @@ function isTrue(raw) {
|
|
|
89
96
|
* exists: three cards each re-deciding what a badge says is three places for
|
|
90
97
|
* "Brick · 3 · 9" to come back.
|
|
91
98
|
*/
|
|
92
|
-
export function cardBadgeText(row, locale) {
|
|
99
|
+
export function cardBadgeText(row, locale, style = "badge") {
|
|
93
100
|
const presentation = badgePresentation(row);
|
|
94
101
|
const name = text(row.name);
|
|
95
102
|
const unit = text(row.unit);
|
|
@@ -105,26 +112,81 @@ export function cardBadgeText(row, locale) {
|
|
|
105
112
|
case "value_unit":
|
|
106
113
|
return withUnit;
|
|
107
114
|
case "name_value":
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
return name.length > 0 ? `${name} ${withUnit}` : withUnit;
|
|
115
|
+
// Joined by the SURFACE's own punctuation (D421): a space inside a
|
|
116
|
+
// chip, a colon inside a line. The unit rides along either way — a
|
|
117
|
+
// named row that dropped it reads "Mileage 20 000", which is the defect
|
|
118
|
+
// this contract exists to close.
|
|
119
|
+
return name.length > 0 ? caption(name, withUnit, style) : withUnit;
|
|
114
120
|
default:
|
|
115
121
|
// `value`, and an element the server left plain in a list that speaks
|
|
116
122
|
// the contract. The value alone, never the unit — the server said so.
|
|
117
123
|
return value;
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
|
-
/**
|
|
121
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Does this element already print its own caption?
|
|
128
|
+
*
|
|
129
|
+
* `name` IS the caption, and a `name_value` with a name to print carries one.
|
|
130
|
+
* Everything else is a bare answer, and two bare answers are what can collide.
|
|
131
|
+
*/
|
|
132
|
+
function alreadyCaptioned(row) {
|
|
133
|
+
const presentation = badgePresentation(row);
|
|
134
|
+
if (presentation === "name")
|
|
135
|
+
return true;
|
|
136
|
+
return presentation === "name_value" && text(row.name).length > 0;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* How a bare answer could be MISTAKEN for its neighbour: by measuring the
|
|
140
|
+
* same thing (one unit, two axes) or by reading identically.
|
|
141
|
+
*/
|
|
142
|
+
function ambiguityKey(row, printed) {
|
|
143
|
+
const unit = text(row.unit);
|
|
144
|
+
return unit.length > 0 ? `unit:${unit}` : `text:${printed}`;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Every element that has something to say, in the server's order, with two
|
|
148
|
+
* axes that would read alike told apart — see the module header (D421).
|
|
149
|
+
*/
|
|
150
|
+
export function cardBadgeTexts(rows, locale, style = "badge") {
|
|
122
151
|
const out = [];
|
|
152
|
+
const printedRows = [];
|
|
153
|
+
/** Ambiguity key → the positions in `out` that could be confused. */
|
|
154
|
+
const groups = new Map();
|
|
123
155
|
for (const row of rows) {
|
|
124
|
-
const printed = cardBadgeText(row, locale);
|
|
125
|
-
if (printed
|
|
126
|
-
|
|
156
|
+
const printed = cardBadgeText(row, locale, style);
|
|
157
|
+
if (printed === undefined || typeof row.slug !== "string" || row.slug.length === 0) {
|
|
158
|
+
continue;
|
|
127
159
|
}
|
|
160
|
+
const at = out.length;
|
|
161
|
+
out.push({ slug: row.slug, text: printed });
|
|
162
|
+
printedRows.push(row);
|
|
163
|
+
if (alreadyCaptioned(row))
|
|
164
|
+
continue;
|
|
165
|
+
const key = ambiguityKey(row, printed);
|
|
166
|
+
const seen = groups.get(key);
|
|
167
|
+
if (seen === undefined)
|
|
168
|
+
groups.set(key, [at]);
|
|
169
|
+
else
|
|
170
|
+
seen.push(at);
|
|
171
|
+
}
|
|
172
|
+
for (const positions of groups.values()) {
|
|
173
|
+
if (positions.length < 2)
|
|
174
|
+
continue;
|
|
175
|
+
const names = positions.map((at) => text(printedRows[at]?.name));
|
|
176
|
+
// Nothing to caption with, or one word for both axes: leave the line as
|
|
177
|
+
// the server wrote it rather than adding a caption that tells a reader
|
|
178
|
+
// nothing they did not already have.
|
|
179
|
+
if (names.some((name) => name.length === 0))
|
|
180
|
+
continue;
|
|
181
|
+
if (new Set(names).size !== names.length)
|
|
182
|
+
continue;
|
|
183
|
+
positions.forEach((at, index) => {
|
|
184
|
+
const entry = out[at];
|
|
185
|
+
const name = names[index];
|
|
186
|
+
if (entry === undefined || name === undefined)
|
|
187
|
+
return;
|
|
188
|
+
out[at] = { slug: entry.slug, text: caption(name, entry.text, style) };
|
|
189
|
+
});
|
|
128
190
|
}
|
|
129
191
|
return out;
|
|
130
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardBadges.js","sourceRoot":"","sources":["../../src/model/cardBadges.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cardBadges.js","sourceRoot":"","sources":["../../src/model/cardBadges.ts"],"names":[],"mappings":"AAyIA;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAiB;IACjD,MAAM,GAAG,GAAG,GAAG,CAAC,YAAY,CAAC;IAC7B,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9C,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,YAAY,CAAC;QAClB,KAAK,YAAY,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA6B;IAChE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAClE,CAAC;AAED,4EAA4E;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C,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACjE,wEAAwE;QACxE,uEAAuE;QACvE,qCAAqC;QACrC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;YAAE,SAAS;QACtD,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM;YAAE,SAAS;QACnD,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;YAC9B,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;YACtB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO;YACtD,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -32,10 +32,16 @@
|
|
|
32
32
|
*/
|
|
33
33
|
import type { ListingsApi } from "../api/listingsApi.js";
|
|
34
34
|
import type { MyListingsParams, PaginatedMyListingCards } from "../api/types.js";
|
|
35
|
-
import type {
|
|
36
|
-
/**
|
|
35
|
+
import type { MyListingsCountedTab } from "./status.js";
|
|
36
|
+
/**
|
|
37
|
+
* One page of the caller's own listings, however the host gets them.
|
|
38
|
+
*
|
|
39
|
+
* `tab` is one of the three COUNTED tabs and not the fourth: the removed tab
|
|
40
|
+
* (D407) reads takedowns off `?status=blocked` directly and unpaged, so a host
|
|
41
|
+
* source is never handed a tab it was not written for.
|
|
42
|
+
*/
|
|
37
43
|
export type MyListingsSource = (args: {
|
|
38
|
-
readonly tab:
|
|
44
|
+
readonly tab: MyListingsCountedTab;
|
|
39
45
|
readonly page: MyListingsParams;
|
|
40
46
|
readonly signal?: AbortSignal;
|
|
41
47
|
}) => Promise<PaginatedMyListingCards>;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE;IACpC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IACnC,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"mineSource.js","sourceRoot":"","sources":["../../src/model/mineSource.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAevD;;;;;;;;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"}
|
package/dist/model/status.d.ts
CHANGED
|
@@ -67,7 +67,8 @@ export interface ListingStatusView {
|
|
|
67
67
|
}
|
|
68
68
|
export declare function listingStatusView(status: ListingLifecycleStatus, moderationStatus: ListingModerationStatus): ListingStatusView;
|
|
69
69
|
/**
|
|
70
|
-
* The
|
|
70
|
+
* The three tabs `my/counters` COUNTS, and the statuses each one folds
|
|
71
|
+
* together.
|
|
71
72
|
*
|
|
72
73
|
* The grouping is the SERVER's (`views.my_counters`), copied here so a tab's
|
|
73
74
|
* caption and its count cannot describe different sets: `active` includes
|
|
@@ -76,23 +77,71 @@ export declare function listingStatusView(status: ListingLifecycleStatus, modera
|
|
|
76
77
|
* working on. A client that grouped them its own way would show "3 active"
|
|
77
78
|
* over two rows.
|
|
78
79
|
*/
|
|
79
|
-
export declare const
|
|
80
|
-
|
|
81
|
-
export
|
|
82
|
-
/** Which
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
export declare function tabOf(status: ListingLifecycleStatus): MyListingsTab | undefined;
|
|
80
|
+
export declare const MY_LISTINGS_COUNTED_TABS: readonly ["active", "drafts", "archived"];
|
|
81
|
+
/** One of the three tabs `MyCountersResponse` carries a number for. */
|
|
82
|
+
export type MyListingsCountedTab = (typeof MY_LISTINGS_COUNTED_TABS)[number];
|
|
83
|
+
/** Which of the three COUNTED tabs a status belongs to, or `undefined` for
|
|
84
|
+
* one the server's own counter groups nowhere — `blocked`, today. */
|
|
85
|
+
export declare function countedTabOf(status: ListingLifecycleStatus): MyListingsCountedTab | undefined;
|
|
86
86
|
/**
|
|
87
|
-
* The statuses
|
|
87
|
+
* The statuses the server's own counter groups nowhere — `blocked`, and
|
|
88
|
+
* nothing else today.
|
|
88
89
|
*
|
|
89
90
|
* DERIVED, not written down a second time: a status added upstream and left
|
|
90
91
|
* out of the counter groupings lands here automatically and gets shown, which
|
|
91
92
|
* is the opposite of what a hardcoded `["blocked"]` would do the day it goes
|
|
92
|
-
* stale.
|
|
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.
|
|
93
|
+
* stale.
|
|
96
94
|
*/
|
|
97
95
|
export declare const MY_LISTINGS_UNTABBED_STATUSES: readonly ListingLifecycleStatus[];
|
|
96
|
+
/**
|
|
97
|
+
* The fourth tab: the rows `my/counters` counts in NO tab at all.
|
|
98
|
+
*
|
|
99
|
+
* ── What was on screen (D407) ────────────────────────────────────────────
|
|
100
|
+
*
|
|
101
|
+
* A listing pulled by moderation showed "Taken down by a moderator" over a
|
|
102
|
+
* counter row reading "Active 0 · Drafts 0 · Archived 0", beside the active
|
|
103
|
+
* tab's own "nothing of yours is live". The object was on the page and in no
|
|
104
|
+
* tab and in no number — three statements, and the two loudest of them said
|
|
105
|
+
* the seller had nothing.
|
|
106
|
+
*
|
|
107
|
+
* The takedowns had a home before this (a block above the tabs) and that was
|
|
108
|
+
* the half that was wrong: a row outside the tab strip is a row the counters
|
|
109
|
+
* do not describe, and a person reads the counters. So they get a TAB, with a
|
|
110
|
+
* count, like every other state a listing can be in.
|
|
111
|
+
*
|
|
112
|
+
* ── Why a fourth tab and not the archive ─────────────────────────────────
|
|
113
|
+
*
|
|
114
|
+
* Folding `blocked` into `archived` is the other shape this could take, and
|
|
115
|
+
* it costs the count: `my/counters` has three integers and no fourth, so an
|
|
116
|
+
* archive tab holding takedowns would read the server's `archived` number —
|
|
117
|
+
* `0` — until the tab was opened and its rows could raise it. The fourth tab
|
|
118
|
+
* is counted from its OWN read (`?status=blocked`, unpaged), so the number is
|
|
119
|
+
* right while the seller is looking at a different tab, which is exactly the
|
|
120
|
+
* moment D407 was measured at.
|
|
121
|
+
*
|
|
122
|
+
* The archive keeps its meaning too, which is not nothing: "I put this away"
|
|
123
|
+
* and "a moderator took this down" are not the same sentence and a tab that
|
|
124
|
+
* said one over rows that meant the other would be the D407 defect wearing a
|
|
125
|
+
* label.
|
|
126
|
+
*/
|
|
127
|
+
export declare const MY_LISTINGS_REMOVED_TAB = "removed";
|
|
128
|
+
/**
|
|
129
|
+
* Every tab the dashboard can show: the server's three, then the removed one.
|
|
130
|
+
*
|
|
131
|
+
* The removed tab is DRAWN only where there is something in it (see
|
|
132
|
+
* `headless/MyListings.tsx`) — an empty "Taken down" tab is a scare — but it
|
|
133
|
+
* is in this list unconditionally, because `?tab=removed` must parse and a
|
|
134
|
+
* host must be able to name it.
|
|
135
|
+
*/
|
|
136
|
+
export declare const MY_LISTINGS_TABS: readonly [
|
|
137
|
+
...typeof MY_LISTINGS_COUNTED_TABS,
|
|
138
|
+
typeof MY_LISTINGS_REMOVED_TAB
|
|
139
|
+
];
|
|
140
|
+
export type MyListingsTab = (typeof MY_LISTINGS_TABS)[number];
|
|
141
|
+
export declare const MY_LISTINGS_TAB_STATUSES: Readonly<Record<MyListingsTab, readonly ListingLifecycleStatus[]>>;
|
|
142
|
+
/** Which tab a listing belongs to. Every status has one: the three counted
|
|
143
|
+
* groupings, and the removed tab for whatever they leave out. `undefined` is
|
|
144
|
+
* unreachable today and stays in the signature so a status this build has
|
|
145
|
+
* never heard of cannot be filed under a tab by accident. */
|
|
146
|
+
export declare function tabOf(status: ListingLifecycleStatus): MyListingsTab | undefined;
|
|
98
147
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,CAiG9B;AAED,6EAA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wB,EAAE,QAAQ,CAC7C,MAAM,CAAC,aAAa,EAAE,SAAS,sBAAsB,EAAE,CAAC,CAIzD,CAAC;AAEF;;;6DAG6D;AAC7D,wBAAgB,KAAK,CACnB,MAAM,EAAE,sBAAsB,GAC7B,aAAa,GAAG,SAAS,CAK3B"}
|
package/dist/model/status.js
CHANGED
|
@@ -206,7 +206,8 @@ export function listingStatusView(status, moderationStatus) {
|
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
|
-
* The
|
|
209
|
+
* The three tabs `my/counters` COUNTS, and the statuses each one folds
|
|
210
|
+
* together.
|
|
210
211
|
*
|
|
211
212
|
* The grouping is the SERVER's (`views.my_counters`), copied here so a tab's
|
|
212
213
|
* caption and its count cannot describe different sets: `active` includes
|
|
@@ -215,32 +216,85 @@ export function listingStatusView(status, moderationStatus) {
|
|
|
215
216
|
* working on. A client that grouped them its own way would show "3 active"
|
|
216
217
|
* over two rows.
|
|
217
218
|
*/
|
|
218
|
-
export const
|
|
219
|
-
|
|
219
|
+
export const MY_LISTINGS_COUNTED_TABS = ["active", "drafts", "archived"];
|
|
220
|
+
const COUNTED_TAB_STATUSES = {
|
|
220
221
|
active: ["published", "pending"],
|
|
221
222
|
drafts: ["draft", "rejected"],
|
|
222
223
|
archived: ["archived", "paused", "expired", "sold"],
|
|
223
224
|
};
|
|
224
|
-
/** Which
|
|
225
|
-
*
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
if (MY_LISTINGS_TAB_STATUSES[tab].includes(status))
|
|
225
|
+
/** Which of the three COUNTED tabs a status belongs to, or `undefined` for
|
|
226
|
+
* one the server's own counter groups nowhere — `blocked`, today. */
|
|
227
|
+
export function countedTabOf(status) {
|
|
228
|
+
for (const tab of MY_LISTINGS_COUNTED_TABS) {
|
|
229
|
+
if (COUNTED_TAB_STATUSES[tab].includes(status))
|
|
230
230
|
return tab;
|
|
231
231
|
}
|
|
232
232
|
return undefined;
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
|
-
* The statuses
|
|
235
|
+
* The statuses the server's own counter groups nowhere — `blocked`, and
|
|
236
|
+
* nothing else today.
|
|
236
237
|
*
|
|
237
238
|
* DERIVED, not written down a second time: a status added upstream and left
|
|
238
239
|
* out of the counter groupings lands here automatically and gets shown, which
|
|
239
240
|
* is the opposite of what a hardcoded `["blocked"]` would do the day it goes
|
|
240
|
-
* stale.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
* stale.
|
|
242
|
+
*/
|
|
243
|
+
export const MY_LISTINGS_UNTABBED_STATUSES = LISTING_STATUSES.filter((status) => countedTabOf(status) === undefined);
|
|
244
|
+
/**
|
|
245
|
+
* The fourth tab: the rows `my/counters` counts in NO tab at all.
|
|
246
|
+
*
|
|
247
|
+
* ── What was on screen (D407) ────────────────────────────────────────────
|
|
248
|
+
*
|
|
249
|
+
* A listing pulled by moderation showed "Taken down by a moderator" over a
|
|
250
|
+
* counter row reading "Active 0 · Drafts 0 · Archived 0", beside the active
|
|
251
|
+
* tab's own "nothing of yours is live". The object was on the page and in no
|
|
252
|
+
* tab and in no number — three statements, and the two loudest of them said
|
|
253
|
+
* the seller had nothing.
|
|
254
|
+
*
|
|
255
|
+
* The takedowns had a home before this (a block above the tabs) and that was
|
|
256
|
+
* the half that was wrong: a row outside the tab strip is a row the counters
|
|
257
|
+
* do not describe, and a person reads the counters. So they get a TAB, with a
|
|
258
|
+
* count, like every other state a listing can be in.
|
|
259
|
+
*
|
|
260
|
+
* ── Why a fourth tab and not the archive ─────────────────────────────────
|
|
261
|
+
*
|
|
262
|
+
* Folding `blocked` into `archived` is the other shape this could take, and
|
|
263
|
+
* it costs the count: `my/counters` has three integers and no fourth, so an
|
|
264
|
+
* archive tab holding takedowns would read the server's `archived` number —
|
|
265
|
+
* `0` — until the tab was opened and its rows could raise it. The fourth tab
|
|
266
|
+
* is counted from its OWN read (`?status=blocked`, unpaged), so the number is
|
|
267
|
+
* right while the seller is looking at a different tab, which is exactly the
|
|
268
|
+
* moment D407 was measured at.
|
|
269
|
+
*
|
|
270
|
+
* The archive keeps its meaning too, which is not nothing: "I put this away"
|
|
271
|
+
* and "a moderator took this down" are not the same sentence and a tab that
|
|
272
|
+
* said one over rows that meant the other would be the D407 defect wearing a
|
|
273
|
+
* label.
|
|
244
274
|
*/
|
|
245
|
-
export const
|
|
275
|
+
export const MY_LISTINGS_REMOVED_TAB = "removed";
|
|
276
|
+
/**
|
|
277
|
+
* Every tab the dashboard can show: the server's three, then the removed one.
|
|
278
|
+
*
|
|
279
|
+
* The removed tab is DRAWN only where there is something in it (see
|
|
280
|
+
* `headless/MyListings.tsx`) — an empty "Taken down" tab is a scare — but it
|
|
281
|
+
* is in this list unconditionally, because `?tab=removed` must parse and a
|
|
282
|
+
* host must be able to name it.
|
|
283
|
+
*/
|
|
284
|
+
export const MY_LISTINGS_TABS = [...MY_LISTINGS_COUNTED_TABS, MY_LISTINGS_REMOVED_TAB];
|
|
285
|
+
export const MY_LISTINGS_TAB_STATUSES = {
|
|
286
|
+
...COUNTED_TAB_STATUSES,
|
|
287
|
+
[MY_LISTINGS_REMOVED_TAB]: MY_LISTINGS_UNTABBED_STATUSES,
|
|
288
|
+
};
|
|
289
|
+
/** Which tab a listing belongs to. Every status has one: the three counted
|
|
290
|
+
* groupings, and the removed tab for whatever they leave out. `undefined` is
|
|
291
|
+
* unreachable today and stays in the signature so a status this build has
|
|
292
|
+
* never heard of cannot be filed under a tab by accident. */
|
|
293
|
+
export function tabOf(status) {
|
|
294
|
+
for (const tab of MY_LISTINGS_TABS) {
|
|
295
|
+
if (MY_LISTINGS_TAB_STATUSES[tab].includes(status))
|
|
296
|
+
return tab;
|
|
297
|
+
}
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
246
300
|
//# 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"],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AM,gBAAgB,GAGzB,CAAC,GAAG,wBAAwB,EAAE,uBAAuB,CAAC,CAAC;AAI3D,MAAM,CAAC,MAAM,wBAAwB,GAEjC;IACF,GAAG,oBAAoB;IACvB,CAAC,uBAAuB,CAAC,EAAE,6BAA6B;CACzD,CAAC;AAEF;;;6DAG6D;AAC7D,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"}
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @stapel/listings-react 0.
|
|
1
|
+
# @stapel/listings-react 0.26.0
|
|
2
2
|
|
|
3
|
-
Headless React flow pair for stapel-listings (contract >=0.
|
|
3
|
+
Headless React flow pair for stapel-listings (contract >=0.22 <0.23) — 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
|
|
|
@@ -61,7 +61,7 @@ Paths are relative to `/listings/api/v1/`.
|
|
|
61
61
|
- useValidateDraft (query) → validateDraft
|
|
62
62
|
|
|
63
63
|
## Errors (render t(code, params); UX from remediation)
|
|
64
|
-
|
|
64
|
+
72 keys (full catalog: manifest.json §errors). By remediation: fix_input 43 · retry 16 · verify 5 · wait_and_retry 5 · contact_support 2 · reauthenticate 1.
|
|
65
65
|
Param-bearing keys (interpolation slots matter):
|
|
66
66
|
- error.400.description_too_long [400] → fix_input {max_length}
|
|
67
67
|
- error.400.description_too_short [400] → fix_input {min_length}
|
|
@@ -89,6 +89,9 @@ Param-bearing keys (interpolation slots matter):
|
|
|
89
89
|
- error.400.field.unique [400] → fix_input {field}
|
|
90
90
|
- error.400.listing_draft_meta_too_large [400] → fix_input {max_bytes}
|
|
91
91
|
- error.400.listing_feature_not_allowed [400] → fix_input {feature}
|
|
92
|
+
- error.400.listing_features_draft_shape [400] → fix_input {got_type,example}
|
|
93
|
+
- error.400.listing_features_draft_unknown_slug [400] → fix_input {index,example}
|
|
94
|
+
- error.400.listing_features_draft_value_shape [400] → fix_input {slug,got_type,example}
|
|
92
95
|
- error.400.listing_invalid_status_filter [400] → fix_input {status}
|
|
93
96
|
- error.409.invalid_listing_transition [409] → fix_input {from_status}
|
|
94
97
|
- error.429.rate_limit [429] → wait_and_retry {retry_after_minutes}
|
|
@@ -113,6 +116,7 @@ const { tracked } = useTracked();
|
|
|
113
116
|
```
|
|
114
117
|
|
|
115
118
|
## Demos (defineDemo → manifest.demos; compiled, linted, rendered examples)
|
|
119
|
+
- listings.actions → <ListingActions> [default|blocked] demo/ListingActions.demo.tsx
|
|
116
120
|
- listings.card → <ListingCard> [default|saved|visitor|grid cell|list row|no-photo] demo/ListingCard.demo.tsx
|
|
117
121
|
- listings.composer → <ListingComposerPage> [default|unwired|photos-in-flight|unsupported-type] demo/ListingComposer.demo.tsx
|
|
118
122
|
- listings.detail → <ListingDetailPane> [default|contact-unwired|owner|not-found] demo/ListingDetail.demo.tsx
|
|
@@ -123,6 +127,7 @@ const { tracked } = useTracked();
|
|
|
123
127
|
- listings.parts → <ListingStatusBlock> [default|tags|notes|media|door] demo/ListingParts.demo.tsx
|
|
124
128
|
- listings.photo-strip → <ListingPhotoStrip> [default|single|no photos] demo/ListingPhotoStrip.demo.tsx
|
|
125
129
|
- listings.serp-card → <ListingSerpCard> [default|trend|visitor|desktop row|bare] demo/ListingSerpCard.demo.tsx
|
|
130
|
+
- listings.share → <ShareAction> [default|menu] demo/Share.demo.tsx
|
|
126
131
|
- listings.spec-parts → <CardBadges> [contract|legacy|specs|specs-split] demo/ListingSpecParts.demo.tsx
|
|
127
132
|
Each source file is the canonical usage snippet (open the default variant).
|
|
128
133
|
|