@stapel/listings-react 0.30.5 → 0.30.6

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @stapel/listings-react
2
2
 
3
+ ## 0.30.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 0fccad9: The title clamp outranks a host's own selector on the same element
8
+
9
+ `-webkit-line-clamp` does nothing without `display: -webkit-box`, and that one
10
+ declaration was the easiest in the rule for a container to overwrite by
11
+ accident. A single class selector scores (0,1,0) — exactly what
12
+ `[data-testid="listings-serp-title"]` scores — so whichever sheet loaded last
13
+ won.
14
+
15
+ Measured on a live storefront: the host set `display: block` on its title
16
+ testids to stop two inline spans running together, that rule came second, and
17
+ every clamp in the app went inert. The class was on the element, the sheet was
18
+ in the head, `-webkit-line-clamp: 2` was in the computed style, and a
19
+ 113-character title drew three lines — every check that could be made without
20
+ a browser passed.
21
+
22
+ The rule now repeats its own class, scoring (0,2,0). It cannot lose that tie,
23
+ and still loses to a host that really means it.
24
+
3
25
  ## 0.30.5
4
26
 
5
27
  ### Patch Changes
@@ -42,6 +42,27 @@ export declare const TITLE_CLAMP_LINES = 2;
42
42
  export declare const TITLE_CLAMP_CLASS = "stapel-listing-title-clamp";
43
43
  /** The `href` the hoisted stylesheet is deduplicated by. */
44
44
  export declare const TITLE_CLAMP_STYLE_HREF = "stapel-listings-title-clamp";
45
- /** The rule itself, as text, so a test can assert it. */
45
+ /**
46
+ * The rule itself, as text, so a test can assert it.
47
+ *
48
+ * ── Why the class is written TWICE ────────────────────────────────────────
49
+ *
50
+ * `-webkit-line-clamp` does nothing without `display: -webkit-box`, so that
51
+ * one declaration is the whole clamp — and it is the easiest declaration in
52
+ * the rule for a host to overwrite by accident. A single class selector scores
53
+ * (0,1,0), exactly the same as the `[data-testid="…-title"]` selector a
54
+ * container naturally reaches for, so whichever stylesheet loads LAST wins.
55
+ * Measured on a live storefront (2026-09-13): the host set `display: block` on
56
+ * its title testids to stop two inline spans running together, that rule
57
+ * happened to come second, and every clamp in the app went inert — the class
58
+ * was on the element, the sheet was in the head, `-webkit-line-clamp: 2` was
59
+ * in the computed style, and a 113-character title still drew three lines.
60
+ *
61
+ * Repeating the class scores (0,2,0), which outranks any single class or
62
+ * attribute selector whatever the load order, and still loses to a host that
63
+ * really means it (an id, a doubled selector of its own, `!important`). That
64
+ * is the right place on the ladder: a clamp that cannot be overridden at all
65
+ * is a different bug.
66
+ */
46
67
  export declare function titleClampCss(): string;
47
68
  //# sourceMappingURL=titleClamp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"titleClamp.d.ts","sourceRoot":"","sources":["../../src/default/titleClamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE,yDAAyD;AACzD,wBAAgB,aAAa,IAAI,MAAM,CAMtC"}
1
+ {"version":3,"file":"titleClamp.d.ts","sourceRoot":"","sources":["../../src/default/titleClamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAOtC"}
@@ -42,9 +42,31 @@ export const TITLE_CLAMP_LINES = 2;
42
42
  export const TITLE_CLAMP_CLASS = "stapel-listing-title-clamp";
43
43
  /** The `href` the hoisted stylesheet is deduplicated by. */
44
44
  export const TITLE_CLAMP_STYLE_HREF = "stapel-listings-title-clamp";
45
- /** The rule itself, as text, so a test can assert it. */
45
+ /**
46
+ * The rule itself, as text, so a test can assert it.
47
+ *
48
+ * ── Why the class is written TWICE ────────────────────────────────────────
49
+ *
50
+ * `-webkit-line-clamp` does nothing without `display: -webkit-box`, so that
51
+ * one declaration is the whole clamp — and it is the easiest declaration in
52
+ * the rule for a host to overwrite by accident. A single class selector scores
53
+ * (0,1,0), exactly the same as the `[data-testid="…-title"]` selector a
54
+ * container naturally reaches for, so whichever stylesheet loads LAST wins.
55
+ * Measured on a live storefront (2026-09-13): the host set `display: block` on
56
+ * its title testids to stop two inline spans running together, that rule
57
+ * happened to come second, and every clamp in the app went inert — the class
58
+ * was on the element, the sheet was in the head, `-webkit-line-clamp: 2` was
59
+ * in the computed style, and a 113-character title still drew three lines.
60
+ *
61
+ * Repeating the class scores (0,2,0), which outranks any single class or
62
+ * attribute selector whatever the load order, and still loses to a host that
63
+ * really means it (an id, a doubled selector of its own, `!important`). That
64
+ * is the right place on the ladder: a clamp that cannot be overridden at all
65
+ * is a different bug.
66
+ */
46
67
  export function titleClampCss() {
47
- return (`.${TITLE_CLAMP_CLASS}{display:-webkit-box;-webkit-box-orient:vertical;` +
68
+ const self = `.${TITLE_CLAMP_CLASS}.${TITLE_CLAMP_CLASS}`;
69
+ return (`${self}{display:-webkit-box;-webkit-box-orient:vertical;` +
48
70
  `-webkit-line-clamp:${String(TITLE_CLAMP_LINES)};overflow:hidden;` +
49
71
  `overflow-wrap:normal}`);
50
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"titleClamp.js","sourceRoot":"","sources":["../../src/default/titleClamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,yCAAyC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAE9D,4DAA4D;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEpE,yDAAyD;AACzD,MAAM,UAAU,aAAa;IAC3B,OAAO,CACL,IAAI,iBAAiB,mDAAmD;QACxE,sBAAsB,MAAM,CAAC,iBAAiB,CAAC,mBAAmB;QAClE,uBAAuB,CACxB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"titleClamp.js","sourceRoot":"","sources":["../../src/default/titleClamp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,yCAAyC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAE9D,4DAA4D;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,6BAA6B,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,IAAI,GAAG,IAAI,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;IAC1D,OAAO,CACL,GAAG,IAAI,mDAAmD;QAC1D,sBAAsB,MAAM,CAAC,iBAAiB,CAAC,mBAAmB;QAClE,uBAAuB,CACxB,CAAC;AACJ,CAAC"}
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @stapel/listings-react 0.30.5
1
+ # @stapel/listings-react 0.30.6
2
2
 
3
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,
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
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.30.5",
4
+ "version": "0.30.6",
5
5
  "backend": {
6
6
  "module": "stapel-listings",
7
7
  "contract": ">=0.22 <0.23"
package/nav-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@stapel/listings-react",
3
- "version": "0.30.5",
3
+ "version": "0.30.6",
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.30.5",
3
+ "version": "0.30.6",
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": {
@@ -106,9 +106,9 @@
106
106
  "@stapel/core": "^0.26.1",
107
107
  "@stapel/currencies-react": "^0.4.0",
108
108
  "@stapel/image": "^0.4.2",
109
+ "@stapel/showcase": "^0.3.0",
109
110
  "@stapel/tokens": "^0.8.0",
110
- "@stapel/tokens-antd": "^0.18.1",
111
- "@stapel/showcase": "^0.3.0"
111
+ "@stapel/tokens-antd": "^0.18.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.30.5",
4
+ "version": "0.30.6",
5
5
  "defined": [],
6
6
  "flows": []
7
7
  }
@@ -46,10 +46,32 @@ export const TITLE_CLAMP_CLASS = "stapel-listing-title-clamp";
46
46
  /** The `href` the hoisted stylesheet is deduplicated by. */
47
47
  export const TITLE_CLAMP_STYLE_HREF = "stapel-listings-title-clamp";
48
48
 
49
- /** The rule itself, as text, so a test can assert it. */
49
+ /**
50
+ * The rule itself, as text, so a test can assert it.
51
+ *
52
+ * ── Why the class is written TWICE ────────────────────────────────────────
53
+ *
54
+ * `-webkit-line-clamp` does nothing without `display: -webkit-box`, so that
55
+ * one declaration is the whole clamp — and it is the easiest declaration in
56
+ * the rule for a host to overwrite by accident. A single class selector scores
57
+ * (0,1,0), exactly the same as the `[data-testid="…-title"]` selector a
58
+ * container naturally reaches for, so whichever stylesheet loads LAST wins.
59
+ * Measured on a live storefront (2026-09-13): the host set `display: block` on
60
+ * its title testids to stop two inline spans running together, that rule
61
+ * happened to come second, and every clamp in the app went inert — the class
62
+ * was on the element, the sheet was in the head, `-webkit-line-clamp: 2` was
63
+ * in the computed style, and a 113-character title still drew three lines.
64
+ *
65
+ * Repeating the class scores (0,2,0), which outranks any single class or
66
+ * attribute selector whatever the load order, and still loses to a host that
67
+ * really means it (an id, a doubled selector of its own, `!important`). That
68
+ * is the right place on the ladder: a clamp that cannot be overridden at all
69
+ * is a different bug.
70
+ */
50
71
  export function titleClampCss(): string {
72
+ const self = `.${TITLE_CLAMP_CLASS}.${TITLE_CLAMP_CLASS}`;
51
73
  return (
52
- `.${TITLE_CLAMP_CLASS}{display:-webkit-box;-webkit-box-orient:vertical;` +
74
+ `${self}{display:-webkit-box;-webkit-box-orient:vertical;` +
53
75
  `-webkit-line-clamp:${String(TITLE_CLAMP_LINES)};overflow:hidden;` +
54
76
  `overflow-wrap:normal}`
55
77
  );