@celestia-island/hikari 0.55.95 → 0.55.96
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
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
gap: 0.3rem;
|
|
14
14
|
max-width: 11rem;
|
|
15
15
|
/* Logical axes: the wide side reserves caret room at inline-end and
|
|
16
|
-
* flips together with the host input's RTL suffix/prefix side.
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* flips together with the host input's RTL suffix/prefix side.
|
|
17
|
+
* Roomy padding: the pill's fill must not hug the label — the text
|
|
18
|
+
* keeps clear air on both sides (user direction, round N). */
|
|
19
|
+
padding-block: 4px;
|
|
20
|
+
padding-inline: 9px 11px;
|
|
19
21
|
border: none;
|
|
20
22
|
border-radius: var(--radius-sm, 6px);
|
|
21
23
|
background: transparent;
|
|
@@ -33,6 +33,10 @@ describe("HkJsonTree spacing contract", () => {
|
|
|
33
33
|
const fallbacks = [...scss.matchAll(/var\(--jt-toggle,\s*([^)]+)\)/g)].map((m) => m[1].trim());
|
|
34
34
|
expect(fallbacks.length, "fallback sites were scanned").toBeGreaterThan(2);
|
|
35
35
|
expect(fallbacks.every((f) => f === "14px"), `fallbacks = ${fallbacks}`).toBe(true);
|
|
36
|
+
// The canonical definition itself: the TSX drives depth steps and
|
|
37
|
+
// guide lines from JT_TOGGLE = 14 — a different definition desyncs
|
|
38
|
+
// CSS geometry from the TS geometry with zero other red.
|
|
39
|
+
expect(scss).toContain("--jt-toggle: 14px;");
|
|
36
40
|
});
|
|
37
41
|
|
|
38
42
|
it("pins the depth step to exactly one toggle width", () => {
|
|
@@ -40,6 +44,28 @@ describe("HkJsonTree spacing contract", () => {
|
|
|
40
44
|
expect(tsx).toContain("const JT_INDENT = JT_TOGGLE;");
|
|
41
45
|
});
|
|
42
46
|
|
|
47
|
+
it("reads collapsed summaries one tab in, at full row size", () => {
|
|
48
|
+
const tsx = readFileSync(join(here, "HkJsonTree.tsx"), "utf-8");
|
|
49
|
+
// Both collapsed shapes (object preview and long string) carry the
|
|
50
|
+
// one-tab slot before the summary — the collapsed text sits in the
|
|
51
|
+
// child column instead of hugging the chevron.
|
|
52
|
+
expect(tsx.match(/<span class="s-jt-indent" \/>/g)?.length).toBe(2);
|
|
53
|
+
const preview = scss.slice(scss.indexOf(".s-jt-preview {"));
|
|
54
|
+
// A smaller preview font would shrink a keyless row's line box below
|
|
55
|
+
// the toggle centering assumption and float the row high.
|
|
56
|
+
expect(preview).toContain("font-size: inherit");
|
|
57
|
+
expect(preview).not.toContain("0.5rem");
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("keeps the collapsed summary indent slot exactly one tab wide", () => {
|
|
61
|
+
const indent = scss.slice(scss.indexOf(".s-jt-indent {"), scss.indexOf(".s-jt-preview {"));
|
|
62
|
+
// Deleting the whole rule (not just tweaking it) must also go red —
|
|
63
|
+
// this slot IS the second-round "collapsed text hugs the chevron" fix.
|
|
64
|
+
expect(indent, ".s-jt-indent rule present").not.toBe("");
|
|
65
|
+
expect(indent).toContain("width: var(--jt-toggle, 14px)");
|
|
66
|
+
expect(indent).toContain("flex-shrink: 0");
|
|
67
|
+
});
|
|
68
|
+
|
|
43
69
|
it("keeps the key colon gap on one spacing unit", () => {
|
|
44
70
|
const block = scss.slice(scss.indexOf(".s-jt-colon {"), scss.indexOf(".s-jv-null"));
|
|
45
71
|
expect(block).toContain("margin-inline-end: var(--space-4");
|
|
@@ -178,9 +178,22 @@
|
|
|
178
178
|
font-weight: 400;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
.s-jt-indent {
|
|
182
|
+
/* The collapsed summary reads one tab in — the same column the
|
|
183
|
+
children occupy when the node is expanded — instead of hugging the
|
|
184
|
+
chevron. Kept as a flex slot (not padding) so it can never shrink. */
|
|
185
|
+
flex-shrink: 0;
|
|
186
|
+
width: var(--jt-toggle, 14px);
|
|
187
|
+
}
|
|
188
|
+
|
|
181
189
|
.s-jt-preview {
|
|
182
190
|
color: rgb(var(--color-muted));
|
|
183
|
-
|
|
191
|
+
/* Full row size: a keyless collapsed root's ONLY text is the preview,
|
|
192
|
+
and a smaller font here would shrink the line box below the toggle's
|
|
193
|
+
centering assumption and float the whole row high (the 2026-09-30
|
|
194
|
+
second-round screenshot report). Quietness comes from the muted
|
|
195
|
+
color, not a smaller size. */
|
|
196
|
+
font-size: inherit;
|
|
184
197
|
font-weight: 400;
|
|
185
198
|
opacity: 0.7;
|
|
186
199
|
}
|
|
@@ -234,6 +234,7 @@ export const HkJsonTree = defineComponent({
|
|
|
234
234
|
</span>
|
|
235
235
|
{node.key !== null && <span class="s-jt-key">{node.key}</span>}
|
|
236
236
|
{node.key !== null && <span class="s-jt-colon">: </span>}
|
|
237
|
+
<span class="s-jt-indent" />
|
|
237
238
|
<span class="s-jt-preview">{node.preview}</span>
|
|
238
239
|
</div>
|
|
239
240
|
);
|
|
@@ -267,6 +268,7 @@ export const HkJsonTree = defineComponent({
|
|
|
267
268
|
</span>
|
|
268
269
|
{node.key !== null && <span class="s-jt-key">{node.key}</span>}
|
|
269
270
|
{node.key !== null && <span class="s-jt-colon">: </span>}
|
|
271
|
+
<span class="s-jt-indent" />
|
|
270
272
|
<span class="s-jv-str">"{truncateStr(node.stringValue, STR_PREVIEW_LEN)}"</span>
|
|
271
273
|
<span class="s-jt-type">string ({node.stringValue.length})</span>
|
|
272
274
|
</div>
|