@justai/core 0.25.0 → 0.27.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/core",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "The framework-free heart of the persona shell \u2014 the load-bearing behaviour (auth capture, reveal, ready) as plain strings, so Astro and Next inject the SAME logic instead of each re-writing it.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
package/src/index.d.ts CHANGED
@@ -136,5 +136,12 @@ export declare function toolbarMark(
136
136
  * redrawn.
137
137
  */
138
138
  fills?: number;
139
+ /**
140
+ * How many pixels of INK the surface wants, default 20 — the toolbar row's rule. The preroll
141
+ * asks for 300: the derivation is the same (take the tile's ground off, namespace the ids so two
142
+ * copies on one page do not fight over a gradient), only the measure differs, and a second copy
143
+ * of that logic under a second name is the O(N) debt this package exists to refuse.
144
+ */
145
+ ink?: number;
139
146
  },
140
147
  ): string;
package/src/index.js CHANGED
@@ -720,7 +720,13 @@ export function personaScroll(options) {
720
720
  if (!app) return;
721
721
  const strip = tbTitle ? tbTitle.getBoundingClientRect().height : 0;
722
722
  const open = parseFloat(getComputedStyle(toolbar).getPropertyValue("--tb-strip")) || 26;
723
- const h = Math.round(toolbar.getBoundingClientRect().height - strip + open);
723
+ // CEIL, NOT ROUND, AND IT IS LOAD-BEARING NOW: `--shell-top` is the slot's min-height as well as
724
+ // the subtrahend, so it must never be LESS than the bar's tallest state or the slot starts
725
+ // following the bar again and the 26px returns as a fraction. A bar under Dynamic Type is not an
726
+ // integer — this file has already recorded one at 82.3 — and rounding down is half a CSS pixel,
727
+ // one and a half device pixels at DPR 3, of permanent error in a law judged by eye against a
728
+ // drawn rectangle.
729
+ const h = Math.ceil(toolbar.getBoundingClientRect().height - strip + open);
724
730
  if (h > 0) app.style.setProperty("--shell-top", h + "px");
725
731
  };
726
732
  measureShell();
@@ -1362,8 +1368,20 @@ export function toolbarMark(iconSvg, options) {
1362
1368
  // Written as an inline style because the cut's `.tb-nav svg { width: 20px }` would beat a width
1363
1369
  // ATTRIBUTE. Left out, the mark takes the row's default and reads small — which is what shipped for
1364
1370
  // one deploy and is exactly how the fleet's ratios came to be measured.
1371
+ // queries: the mark in the preroll is tiny · ink option · use the derived mark somewhere else ·
1372
+ // toolbarMark size
1373
+ //
1374
+ // `ink` IS THE MEASURE, AND THE ROW IS ONLY ITS FIRST CUSTOMER. The derivation here — take the
1375
+ // ground off, namespace the ids so two copies on one page do not fight over a gradient — is what
1376
+ // ANY surface needs that wants the mark without its tile. The preroll wants exactly that at 300px
1377
+ // rather than 20, and the alternative was a second copy of the stripping logic under a second
1378
+ // name, which is the O(N) debt this package exists to refuse.
1379
+ //
1380
+ // So the number is a parameter and the default is the row's. The function keeps its name because
1381
+ // the row is still what it is for nine times in ten; that the name is now narrower than the job is
1382
+ // worth one line of honesty rather than a rename across sixteen repos.
1365
1383
  if (o.fills > 0) {
1366
- const px = (20 / o.fills).toFixed(2);
1384
+ const px = ((o.ink || 20) / o.fills).toFixed(2);
1367
1385
  s = s.replace(/<svg /, `<svg style="width:${px}px;height:${px}px" `);
1368
1386
  }
1369
1387
  return s.trim();