@celestia-island/hikari 0.55.255 → 0.55.256
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,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Source contract for the bond CELLS of the horizontal stepper (2026-10-31
|
|
3
|
-
* user rule).
|
|
3
|
+
* user rule; 60 % share since the same evening's second look).
|
|
4
4
|
*
|
|
5
5
|
* The row is read as one cell per step plus one cell per bond: the steps
|
|
6
6
|
* keep their content width, the leftover splits into EQUAL bond cells, and
|
|
7
|
-
* each bond paints
|
|
7
|
+
* each bond paints 60 % of its own cell CENTERED, so both ends keep a 20 %
|
|
8
8
|
* air gap. Before that rule the bond filled whatever the step had left after
|
|
9
9
|
* its label, minus two fixed 4px margins — measured on a real engine at the
|
|
10
10
|
* provider wizard's 590px row that put the bond 12px off its own label but
|
|
@@ -95,7 +95,7 @@ describe("horizontal bond cell contract", () => {
|
|
|
95
95
|
// while the bond→node air is margin alone — the 12/4 asymmetry that
|
|
96
96
|
// made the bond look glued to the next circle.
|
|
97
97
|
expect(cell).toContain(`margin-inline: calc(-1 * ${GAP}) 0;`);
|
|
98
|
-
// The box must not paint itself: the visible
|
|
98
|
+
// The box must not paint itself: the visible 60 % is the ::before.
|
|
99
99
|
expect(cell).toContain("background: none;");
|
|
100
100
|
// The ::before resolves percentage insets against this box.
|
|
101
101
|
expect(cell).toContain("position: relative;");
|
|
@@ -106,7 +106,7 @@ describe("horizontal bond cell contract", () => {
|
|
|
106
106
|
expect(blockFor(".hk-timeline-step")).toContain(`gap: ${GAP};`);
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
it("paints
|
|
109
|
+
it("paints 60 % of the cell centred with a 20 % inset on each end", () => {
|
|
110
110
|
// The parser above only yields top-level rules; the paint lives in the
|
|
111
111
|
// nested block, so lift it out of the cell rule's body.
|
|
112
112
|
const paint = /&::before\s*\{([^}]*)\}/.exec(blockFor(BOND_CELL))?.[1] ?? "";
|
|
@@ -114,18 +114,31 @@ describe("horizontal bond cell contract", () => {
|
|
|
114
114
|
expect(paint).toContain('content: "";');
|
|
115
115
|
expect(paint).toContain("position: absolute;");
|
|
116
116
|
expect(paint).toContain("inset-block: 0;");
|
|
117
|
-
expect(paint).toContain("inset-inline:
|
|
117
|
+
expect(paint).toContain("inset-inline: 20%;");
|
|
118
118
|
expect(paint).toContain("background: var(--_bond-color);");
|
|
119
|
-
// Percentage PADDING would resolve against the step, not the bond
|
|
120
|
-
|
|
119
|
+
// Percentage PADDING would resolve against the step, not the bond —
|
|
120
|
+
// ban the MECHANISM on both boxes, not one pinned value (a stray
|
|
121
|
+
// `padding-inline: 10%` beside the correct inset would widen the paint
|
|
122
|
+
// through the padding box and slip past a value-pinned regex).
|
|
123
|
+
expect(blockFor(BOND_CELL)).not.toMatch(/padding-inline:/);
|
|
124
|
+
expect(paint).not.toMatch(/padding-inline:/);
|
|
121
125
|
});
|
|
122
126
|
|
|
123
|
-
it("
|
|
127
|
+
it("reserves the two-margin-era collapse threshold through its floor", () => {
|
|
124
128
|
const cell = blockFor(BOND_CELL);
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
|
|
129
|
+
// The floor (half a rem plus two gaps, minus the cancelled gap) reserves
|
|
130
|
+
// the same sixteen outer pixels per bond the old two 4px margins
|
|
131
|
+
// carried, so collapse="auto" measures the row's max-content width at
|
|
132
|
+
// the two-margin-era threshold — never earlier, never later.
|
|
133
|
+
expect(cell).toContain(`min-width: calc(0.5rem + 2 * ${GAP});`);
|
|
134
|
+
// A definite flex-basis reserves NOTHING: engines size a flex item's
|
|
135
|
+
// intrinsic contribution at max(min-width, content) and ignore the
|
|
136
|
+
// basis (measured: a 100px basis on an empty item contributed its 8px
|
|
137
|
+
// floor). The basis must not creep back in place of the floor — nor as
|
|
138
|
+
// the shorthand `flex:`, whose basis component would be equally silent
|
|
139
|
+
// while the literal reads like a reservation.
|
|
140
|
+
expect(cell).not.toContain("flex-basis");
|
|
141
|
+
expect(cell).not.toMatch(/\bflex\s*:/);
|
|
129
142
|
});
|
|
130
143
|
|
|
131
144
|
it("publishes one bond colour token for every status", () => {
|
|
@@ -312,11 +312,13 @@
|
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
/* ── Bond cells (2026-10-31 user rule)
|
|
315
|
+
/* ── Bond cells (2026-10-31 user rule; 60 % share the same evening) ────
|
|
316
316
|
The horizontal row reads as one cell per step plus one cell per bond: the
|
|
317
317
|
steps keep their content width, the leftover splits into EQUAL bond cells,
|
|
318
|
-
and each bond paints
|
|
319
|
-
air gap.
|
|
318
|
+
and each bond paints 60 % of its cell CENTERED, so both ends keep a 20 %
|
|
319
|
+
air gap. (The first cut painted 80 %/10 % — centred, but the completed
|
|
320
|
+
bond read as long as ever, so the share was trimmed the same evening.)
|
|
321
|
+
Three mechanics make that exact:
|
|
320
322
|
|
|
321
323
|
1. The bond's box must span the WHOLE cell. Its cell begins where its own
|
|
322
324
|
label ends, but the step's flex gap already sits in front of it (that
|
|
@@ -325,39 +327,48 @@
|
|
|
325
327
|
SAME `--hk-timeline-step-gap` token the step's `gap` uses. Before this
|
|
326
328
|
the gap counted twice and the bond ran 12px off its label but only 4px
|
|
327
329
|
off the next node: the completed bond read as glued to the next circle.
|
|
328
|
-
2. The painted
|
|
330
|
+
2. The painted share cannot be `padding-inline` — a percentage padding
|
|
329
331
|
resolves against the CONTAINING block (the step), not the bond's own
|
|
330
|
-
box, which would inset it by a slice of the step instead of
|
|
331
|
-
cell. So the colour
|
|
332
|
+
box, which would inset it by a slice of the step instead of 20 % of the
|
|
333
|
+
cell. So the colour lives on a ::before pinned `inset-inline: 20%`,
|
|
332
334
|
which does resolve against the bond. The status rules below therefore
|
|
333
335
|
publish `--_bond-color`; the vertical rail keeps painting its own box
|
|
334
336
|
(it is a rail hanging under the node, not a cell-wide bond).
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
337
|
+
3. The row-width RESERVATION is a min-width floor, sized to the two-margin
|
|
338
|
+
era at the stock 8px gap: half a rem plus two gaps, minus the cancelled
|
|
339
|
+
gap, reserves the same sixteen outer pixels per bond the old fixed
|
|
340
|
+
4px+4px margins carried, so `collapse="auto"` (HkTimeline.tsx measures
|
|
341
|
+
the row's max-content width) switches to the window at exactly the
|
|
342
|
+
threshold the two-margin era had — never earlier, never later. (A host
|
|
343
|
+
that retunes `--hk-timeline-step-gap` shifts the threshold by the
|
|
344
|
+
difference: the old margins were fixed 16px outer while this floor
|
|
345
|
+
reserves gap+8. And a definite `flex-basis` reserves NOTHING here:
|
|
346
|
+
engines size a flex item's intrinsic contribution at
|
|
347
|
+
max(min-width, content) and ignore the basis — measured, a 100px basis
|
|
348
|
+
on an empty item contributed only its 8px floor.) The floor only binds
|
|
349
|
+
when a row is squeezed below its natural width, which `collapse="auto"`
|
|
350
|
+
never lets happen for windowable rows (the window takes over; a ≤3-step
|
|
351
|
+
row stays full-mode at any width, but the floor then behaves exactly as
|
|
352
|
+
both prior eras' floors did); through `collapse="never"` — or the
|
|
353
|
+
full-mode frame a label change renders before re-measuring — the pinned
|
|
354
|
+
24px box paints 14.4px inset 4.8px, and that paint slides UNDER the
|
|
355
|
+
next step's 24px circle for as long as the overflow stays under 24px
|
|
356
|
+
(host ≳ 380px for the five-step wizard row). Below that a small stub
|
|
357
|
+
shows beside the circle (onset ~381px, ~5px by 360px) — marginally
|
|
358
|
+
tighter than the two-margin geometry's own stub in this manually-forced
|
|
359
|
+
mode (onset ~384px, ~6px by 360px), and bounded below by the width
|
|
360
|
+
where a label reaches the next circle (~400px for this row). */
|
|
350
361
|
.hk-timeline[data-mode="full"][data-orientation="horizontal"] .hk-timeline-step [data-el="connector"] {
|
|
351
362
|
position: relative;
|
|
352
363
|
margin-inline: calc(-1 * var(--hk-timeline-step-gap, var(--space-8, 8px))) 0;
|
|
353
|
-
min-width: calc(0.5rem + var(--hk-timeline-step-gap, var(--space-8, 8px)));
|
|
364
|
+
min-width: calc(0.5rem + 2 * var(--hk-timeline-step-gap, var(--space-8, 8px)));
|
|
354
365
|
background: none;
|
|
355
366
|
|
|
356
367
|
&::before {
|
|
357
368
|
content: "";
|
|
358
369
|
position: absolute;
|
|
359
370
|
inset-block: 0;
|
|
360
|
-
inset-inline:
|
|
371
|
+
inset-inline: 20%;
|
|
361
372
|
background: var(--_bond-color);
|
|
362
373
|
}
|
|
363
374
|
}
|
|
@@ -426,7 +437,7 @@
|
|
|
426
437
|
}
|
|
427
438
|
|
|
428
439
|
[data-el="connector"] {
|
|
429
|
-
// The bonds paint
|
|
440
|
+
// The bonds paint 60 % of their cell through a ::before (see the
|
|
430
441
|
// full-mode cell rule); the token is the single source for both that
|
|
431
442
|
// paint and the vertical rail's own box.
|
|
432
443
|
--_bond-color: var(--hi-color-primary);
|
|
@@ -516,7 +527,7 @@
|
|
|
516
527
|
|
|
517
528
|
// Status crossfade: the data-status driven colors (indicator fill/border,
|
|
518
529
|
// label color, connector fill) transition instead of flipping. The
|
|
519
|
-
// horizontal bond's paint lives on its ::before (the
|
|
530
|
+
// horizontal bond's paint lives on its ::before (the 60 % cell rule), so
|
|
520
531
|
// that box rides the crossfade too — without it a status flip snaps there
|
|
521
532
|
// while the vertical rail keeps easing.
|
|
522
533
|
.hk-timeline-step [data-el="indicator"],
|