@hanzo/ui 8.27.83 → 8.27.85
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/dist/backends/gui/code-editor.cjs +64 -72
- package/dist/backends/gui/code-editor.d.ts +3 -1
- package/dist/backends/gui/code-editor.d.ts.map +1 -1
- package/dist/backends/gui/code-editor.js +67 -75
- package/dist/backends/gui/code-editor.js.map +1 -1
- package/dist/backends/gui/grip.cjs +132 -0
- package/dist/backends/gui/grip.d.ts +28 -0
- package/dist/backends/gui/grip.d.ts.map +1 -0
- package/dist/backends/gui/grip.js +96 -0
- package/dist/backends/gui/grip.js.map +1 -0
- package/dist/backends/gui/json-tree.cjs +97 -10
- package/dist/backends/gui/json-tree.d.ts +40 -6
- package/dist/backends/gui/json-tree.d.ts.map +1 -1
- package/dist/backends/gui/json-tree.js +97 -11
- package/dist/backends/gui/json-tree.js.map +1 -1
- package/dist/backends/gui/resizable.cjs +16 -3
- package/dist/backends/gui/resizable.d.ts +4 -2
- package/dist/backends/gui/resizable.d.ts.map +1 -1
- package/dist/backends/gui/resizable.js +16 -3
- package/dist/backends/gui/resizable.js.map +1 -1
- package/dist/gallery.html +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.useGrip = useGrip;
|
|
38
|
+
exports.Grip = Grip;
|
|
39
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
40
|
+
/**
|
|
41
|
+
* The grip under a pane that resizes it, shared by CodeEditor and JsonTree.
|
|
42
|
+
*
|
|
43
|
+
* The footer is the drag target and the knob is the separator a keyboard and a
|
|
44
|
+
* screen reader find. A drag, or ArrowUp / ArrowDown on the knob, sets a height
|
|
45
|
+
* of the reader's own, as tall as they like; a double-click on the footer hands
|
|
46
|
+
* the height back to the content. `useGrip` owns that height; `Grip` draws the
|
|
47
|
+
* knob.
|
|
48
|
+
*/
|
|
49
|
+
const gui_1 = require("@hanzo/gui");
|
|
50
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
51
|
+
const React = __importStar(require("react"));
|
|
52
|
+
const slot_1 = require("./slot.cjs");
|
|
53
|
+
/** How far one ArrowUp / ArrowDown on the knob moves the height. */
|
|
54
|
+
const STEP = 24;
|
|
55
|
+
/** The separator's stated maximum, in px: the drag itself has none. */
|
|
56
|
+
const CEILING = 4096;
|
|
57
|
+
function useGrip({ enabled, min, measure, initial = null, onChange }) {
|
|
58
|
+
const grip = React.useRef(null);
|
|
59
|
+
const knob = React.useRef(null);
|
|
60
|
+
const [height, setHeight] = React.useState(initial);
|
|
61
|
+
const latest = React.useRef({ measure, onChange });
|
|
62
|
+
latest.current = { measure, onChange };
|
|
63
|
+
const set = React.useCallback((next) => {
|
|
64
|
+
setHeight(next);
|
|
65
|
+
latest.current.onChange?.(next);
|
|
66
|
+
}, []);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
const el = grip.current;
|
|
69
|
+
const handle = knob.current;
|
|
70
|
+
if (!el || !handle || !enabled)
|
|
71
|
+
return;
|
|
72
|
+
let pointer = -1;
|
|
73
|
+
let startY = 0;
|
|
74
|
+
let startH = 0;
|
|
75
|
+
const down = (e) => {
|
|
76
|
+
if (e.button !== 0)
|
|
77
|
+
return;
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
pointer = e.pointerId;
|
|
80
|
+
startY = e.clientY;
|
|
81
|
+
startH = latest.current.measure();
|
|
82
|
+
el.setPointerCapture?.(pointer);
|
|
83
|
+
};
|
|
84
|
+
const move = (e) => {
|
|
85
|
+
if (e.pointerId !== pointer)
|
|
86
|
+
return;
|
|
87
|
+
set(Math.max(min, Math.round(startH + e.clientY - startY)));
|
|
88
|
+
};
|
|
89
|
+
const up = (e) => {
|
|
90
|
+
if (e.pointerId !== pointer)
|
|
91
|
+
return;
|
|
92
|
+
el.releasePointerCapture?.(pointer);
|
|
93
|
+
pointer = -1;
|
|
94
|
+
};
|
|
95
|
+
const key = (e) => {
|
|
96
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')
|
|
97
|
+
return;
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
set(Math.max(min, Math.round(latest.current.measure() + (e.key === 'ArrowDown' ? STEP : -STEP))));
|
|
100
|
+
};
|
|
101
|
+
const reset = () => set(null);
|
|
102
|
+
el.addEventListener('pointerdown', down);
|
|
103
|
+
el.addEventListener('pointermove', move);
|
|
104
|
+
el.addEventListener('pointerup', up);
|
|
105
|
+
el.addEventListener('pointercancel', up);
|
|
106
|
+
el.addEventListener('dblclick', reset);
|
|
107
|
+
handle.addEventListener('keydown', key);
|
|
108
|
+
return () => {
|
|
109
|
+
el.removeEventListener('pointerdown', down);
|
|
110
|
+
el.removeEventListener('pointermove', move);
|
|
111
|
+
el.removeEventListener('pointerup', up);
|
|
112
|
+
el.removeEventListener('pointercancel', up);
|
|
113
|
+
el.removeEventListener('dblclick', reset);
|
|
114
|
+
handle.removeEventListener('keydown', key);
|
|
115
|
+
};
|
|
116
|
+
}, [enabled, min, set]);
|
|
117
|
+
return { grip, knob, height };
|
|
118
|
+
}
|
|
119
|
+
/** The knob: a separator that names what it resizes and says how tall it is. */
|
|
120
|
+
function Grip({ knob, name, label, min, height, }) {
|
|
121
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ref: knob, ...(0, slot_1.slot)(name), ...{
|
|
122
|
+
role: 'separator',
|
|
123
|
+
'aria-orientation': 'horizontal',
|
|
124
|
+
'aria-label': `Resize ${label}`,
|
|
125
|
+
'aria-valuemin': min,
|
|
126
|
+
// A drag has no ceiling; this stands in for "as tall as you like".
|
|
127
|
+
'aria-valuemax': CEILING,
|
|
128
|
+
'aria-valuenow': height ?? min,
|
|
129
|
+
'aria-valuetext': height === null ? 'Fits its content' : `${height} pixels`,
|
|
130
|
+
tabIndex: 0,
|
|
131
|
+
}, rounded: "$2", p: "$1", focusVisibleStyle: { bg: '$hover' }, children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.GripHorizontal, { size: 14, color: "$soft" }) }));
|
|
132
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GripOptions {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
/** The shortest a drag makes the pane, in px. */
|
|
5
|
+
min: number;
|
|
6
|
+
/** The pane's height now, read when a drag or a key starts. */
|
|
7
|
+
measure: () => number;
|
|
8
|
+
/** A height to start from, as `onChange` last reported it. */
|
|
9
|
+
initial?: number | null;
|
|
10
|
+
/** Every height the reader sets, and `null` when a double-click hands it back. */
|
|
11
|
+
onChange?: (height: number | null) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useGrip({ enabled, min, measure, initial, onChange }: GripOptions): {
|
|
14
|
+
grip: React.RefObject<HTMLElement | null>;
|
|
15
|
+
knob: React.RefObject<HTMLElement | null>;
|
|
16
|
+
height: number | null;
|
|
17
|
+
};
|
|
18
|
+
/** The knob: a separator that names what it resizes and says how tall it is. */
|
|
19
|
+
export declare function Grip({ knob, name, label, min, height, }: {
|
|
20
|
+
knob: React.RefObject<HTMLElement | null>;
|
|
21
|
+
/** Its `data-slot`. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** What it resizes, for "Resize <label>". */
|
|
24
|
+
label: string;
|
|
25
|
+
min: number;
|
|
26
|
+
height: number | null;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
//# sourceMappingURL=grip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grip.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,OAAO,EAAE,MAAM,MAAM,CAAA;IACrB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC3C;AAED,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,WAAW;;;;EA2DvF;AAED,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,GAAG,EACH,MAAM,GACP,EAAE;IACD,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACzC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB,qBAuBA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The grip under a pane that resizes it, shared by CodeEditor and JsonTree.
|
|
5
|
+
*
|
|
6
|
+
* The footer is the drag target and the knob is the separator a keyboard and a
|
|
7
|
+
* screen reader find. A drag, or ArrowUp / ArrowDown on the knob, sets a height
|
|
8
|
+
* of the reader's own, as tall as they like; a double-click on the footer hands
|
|
9
|
+
* the height back to the content. `useGrip` owns that height; `Grip` draws the
|
|
10
|
+
* knob.
|
|
11
|
+
*/
|
|
12
|
+
import { XStack } from '@hanzo/gui';
|
|
13
|
+
import { GripHorizontal } from '@hanzogui/lucide-icons-2';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { slot } from './slot.js';
|
|
16
|
+
/** How far one ArrowUp / ArrowDown on the knob moves the height. */
|
|
17
|
+
const STEP = 24;
|
|
18
|
+
/** The separator's stated maximum, in px: the drag itself has none. */
|
|
19
|
+
const CEILING = 4096;
|
|
20
|
+
export function useGrip({ enabled, min, measure, initial = null, onChange }) {
|
|
21
|
+
const grip = React.useRef(null);
|
|
22
|
+
const knob = React.useRef(null);
|
|
23
|
+
const [height, setHeight] = React.useState(initial);
|
|
24
|
+
const latest = React.useRef({ measure, onChange });
|
|
25
|
+
latest.current = { measure, onChange };
|
|
26
|
+
const set = React.useCallback((next) => {
|
|
27
|
+
setHeight(next);
|
|
28
|
+
latest.current.onChange?.(next);
|
|
29
|
+
}, []);
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
const el = grip.current;
|
|
32
|
+
const handle = knob.current;
|
|
33
|
+
if (!el || !handle || !enabled)
|
|
34
|
+
return;
|
|
35
|
+
let pointer = -1;
|
|
36
|
+
let startY = 0;
|
|
37
|
+
let startH = 0;
|
|
38
|
+
const down = (e) => {
|
|
39
|
+
if (e.button !== 0)
|
|
40
|
+
return;
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
pointer = e.pointerId;
|
|
43
|
+
startY = e.clientY;
|
|
44
|
+
startH = latest.current.measure();
|
|
45
|
+
el.setPointerCapture?.(pointer);
|
|
46
|
+
};
|
|
47
|
+
const move = (e) => {
|
|
48
|
+
if (e.pointerId !== pointer)
|
|
49
|
+
return;
|
|
50
|
+
set(Math.max(min, Math.round(startH + e.clientY - startY)));
|
|
51
|
+
};
|
|
52
|
+
const up = (e) => {
|
|
53
|
+
if (e.pointerId !== pointer)
|
|
54
|
+
return;
|
|
55
|
+
el.releasePointerCapture?.(pointer);
|
|
56
|
+
pointer = -1;
|
|
57
|
+
};
|
|
58
|
+
const key = (e) => {
|
|
59
|
+
if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown')
|
|
60
|
+
return;
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
set(Math.max(min, Math.round(latest.current.measure() + (e.key === 'ArrowDown' ? STEP : -STEP))));
|
|
63
|
+
};
|
|
64
|
+
const reset = () => set(null);
|
|
65
|
+
el.addEventListener('pointerdown', down);
|
|
66
|
+
el.addEventListener('pointermove', move);
|
|
67
|
+
el.addEventListener('pointerup', up);
|
|
68
|
+
el.addEventListener('pointercancel', up);
|
|
69
|
+
el.addEventListener('dblclick', reset);
|
|
70
|
+
handle.addEventListener('keydown', key);
|
|
71
|
+
return () => {
|
|
72
|
+
el.removeEventListener('pointerdown', down);
|
|
73
|
+
el.removeEventListener('pointermove', move);
|
|
74
|
+
el.removeEventListener('pointerup', up);
|
|
75
|
+
el.removeEventListener('pointercancel', up);
|
|
76
|
+
el.removeEventListener('dblclick', reset);
|
|
77
|
+
handle.removeEventListener('keydown', key);
|
|
78
|
+
};
|
|
79
|
+
}, [enabled, min, set]);
|
|
80
|
+
return { grip, knob, height };
|
|
81
|
+
}
|
|
82
|
+
/** The knob: a separator that names what it resizes and says how tall it is. */
|
|
83
|
+
export function Grip({ knob, name, label, min, height, }) {
|
|
84
|
+
return (_jsx(XStack, { ref: knob, ...slot(name), ...{
|
|
85
|
+
role: 'separator',
|
|
86
|
+
'aria-orientation': 'horizontal',
|
|
87
|
+
'aria-label': `Resize ${label}`,
|
|
88
|
+
'aria-valuemin': min,
|
|
89
|
+
// A drag has no ceiling; this stands in for "as tall as you like".
|
|
90
|
+
'aria-valuemax': CEILING,
|
|
91
|
+
'aria-valuenow': height ?? min,
|
|
92
|
+
'aria-valuetext': height === null ? 'Fits its content' : `${height} pixels`,
|
|
93
|
+
tabIndex: 0,
|
|
94
|
+
}, rounded: "$2", p: "$1", focusVisibleStyle: { bg: '$hover' }, children: _jsx(GripHorizontal, { size: 14, color: "$soft" }) }));
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=grip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grip.js","sourceRoot":"","sources":["../../../src/backends/gui/grip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,O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AAE,YAAY;YAChC,YAAY,EAAE,UAAU,KAAK,EAAE;YAC/B,eAAe,EAAE,GAAG;YACpB,mEAAmE;YACnE,eAAe,EAAE,OAAO;YACxB,eAAe,EAAE,MAAM,IAAI,GAAG;YAC9B,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS;YAC3E,QAAQ,EAAE,CAAC;SACD,EACZ,OAAO,EAAC,IAAI,EACZ,CAAC,EAAC,IAAI,EACN,iBAAiB,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,YAEnC,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,OAAO,GAAG,GACnC,CACV,CAAA;AACH,CAAC"}
|
|
@@ -34,25 +34,40 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.sift = sift;
|
|
37
38
|
exports.JsonTree = JsonTree;
|
|
38
39
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
40
|
/**
|
|
40
41
|
* JsonTree — a JSON value drawn as a tree a reader can open and close: one row
|
|
41
42
|
* per key or element, objects and arrays behind a disclosure that says how
|
|
42
|
-
* many children they hold, and a header with Expand all, Collapse all
|
|
43
|
+
* many children they hold, and a header with a filter, Expand all, Collapse all
|
|
44
|
+
* and Copy.
|
|
43
45
|
*
|
|
44
46
|
* The first `depth` levels open on first paint. A row is a button (Enter and
|
|
45
47
|
* Space toggle it, `aria-expanded` says which way), so the tree reads with a
|
|
46
48
|
* keyboard and a screen reader as well as a pointer. Keys and values take the
|
|
47
49
|
* code theme's colours (`code-theme.ts`), the same theme keys `CodeEditor`
|
|
48
50
|
* paints with, and a count reads as a comment. A long value wraps anywhere, so
|
|
49
|
-
* a hash never widens the page.
|
|
50
|
-
*
|
|
51
|
+
* a hash never widens the page.
|
|
52
|
+
*
|
|
53
|
+
* Filter. What is typed keeps every row whose key, dotted path
|
|
54
|
+
* (`answers.team.probabilities`) or value contains it, with the rows above it,
|
|
55
|
+
* and opens them; a branch that matches keeps everything under it. Clearing the
|
|
56
|
+
* filter hands back the tree as it was opened before.
|
|
57
|
+
*
|
|
58
|
+
* Height. The tree is as tall as its rows up to `maxHeight`, then scrolls.
|
|
59
|
+
* `resizable` adds CodeEditor's footer grip: a drag or ArrowUp / ArrowDown sets
|
|
60
|
+
* a height of the reader's own and a double-click hands it back; `onResize`
|
|
61
|
+
* hears each one and `defaultHeight` starts from it. Copy writes the whole
|
|
62
|
+
* value, whatever is open or filtered. Built from gui primitives only, so it
|
|
63
|
+
* renders wherever gui does.
|
|
51
64
|
*/
|
|
52
65
|
const gui_1 = require("@hanzo/gui");
|
|
53
66
|
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
54
67
|
const React = __importStar(require("react"));
|
|
55
68
|
const button_1 = require("./button.cjs");
|
|
69
|
+
const grip_1 = require("./grip.cjs");
|
|
70
|
+
const input_1 = require("./input.cjs");
|
|
56
71
|
const slot_1 = require("./slot.cjs");
|
|
57
72
|
const toaster_1 = require("./toaster.cjs");
|
|
58
73
|
/** Indent per level, in px. */
|
|
@@ -77,12 +92,70 @@ function paths(v, depth, at = '$', level = 0, out = new Set()) {
|
|
|
77
92
|
paths(x, depth, child(at, k), level + 1, out);
|
|
78
93
|
return out;
|
|
79
94
|
}
|
|
80
|
-
|
|
95
|
+
/** A leaf as it is drawn, and as the filter reads it. */
|
|
96
|
+
const text = (value) => typeof value === 'string' ? JSON.stringify(value) : value === undefined ? 'undefined' : String(value);
|
|
97
|
+
function sift(data, query) {
|
|
98
|
+
const q = query.trim().toLowerCase();
|
|
99
|
+
const rows = new Map();
|
|
100
|
+
const open = new Set();
|
|
101
|
+
const walk = (v, at, dotted, name) => {
|
|
102
|
+
const b = branch(v);
|
|
103
|
+
const hit = (name !== null && (name.toLowerCase().includes(q) || `.${dotted}`.toLowerCase().includes(`.${q}`))) ||
|
|
104
|
+
(!b && text(v).toLowerCase().includes(q));
|
|
105
|
+
if (hit) {
|
|
106
|
+
rows.set(at, true);
|
|
107
|
+
if (b)
|
|
108
|
+
open.add(at);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
let kept = false;
|
|
112
|
+
if (b)
|
|
113
|
+
for (const [k, x] of b.entries)
|
|
114
|
+
if (walk(x, child(at, k), dotted ? `${dotted}.${k}` : k, k))
|
|
115
|
+
kept = true;
|
|
116
|
+
if (kept) {
|
|
117
|
+
rows.set(at, false);
|
|
118
|
+
open.add(at);
|
|
119
|
+
}
|
|
120
|
+
return kept;
|
|
121
|
+
};
|
|
122
|
+
if (q)
|
|
123
|
+
walk(data, '$', '', null);
|
|
124
|
+
return { rows, open };
|
|
125
|
+
}
|
|
126
|
+
function JsonTree({ data, depth = 2, title, showCopyButton = true, search = true, maxHeight, minHeight = 96, resizable = false, defaultHeight = null, onResize, ...props }) {
|
|
81
127
|
const [open, setOpen] = React.useState(() => paths(data, depth));
|
|
128
|
+
const [query, setQuery] = React.useState('');
|
|
82
129
|
const [copied, setCopied] = React.useState(false);
|
|
83
130
|
const timer = React.useRef(undefined);
|
|
131
|
+
/** The open set from before a filter, handed back when it clears. */
|
|
132
|
+
const before = React.useRef(null);
|
|
133
|
+
const body = React.useRef(null);
|
|
134
|
+
const sized = (0, grip_1.useGrip)({
|
|
135
|
+
enabled: resizable,
|
|
136
|
+
min: minHeight,
|
|
137
|
+
measure: () => body.current?.getBoundingClientRect().height ?? minHeight,
|
|
138
|
+
initial: defaultHeight,
|
|
139
|
+
onChange: onResize,
|
|
140
|
+
});
|
|
141
|
+
const sifted = React.useMemo(() => (query.trim() ? sift(data, query) : null), [data, query]);
|
|
84
142
|
React.useEffect(() => () => clearTimeout(timer.current), []);
|
|
85
143
|
React.useEffect(() => setOpen(paths(data, depth)), [data, depth]);
|
|
144
|
+
// After the reset above, so a filter that is on keeps its matches open on new data.
|
|
145
|
+
React.useEffect(() => {
|
|
146
|
+
if (sifted)
|
|
147
|
+
setOpen(sifted.open);
|
|
148
|
+
}, [sifted]);
|
|
149
|
+
const type = (next) => {
|
|
150
|
+
const on = next.trim() !== '';
|
|
151
|
+
if (on && before.current === null)
|
|
152
|
+
before.current = open;
|
|
153
|
+
if (!on && before.current !== null) {
|
|
154
|
+
setOpen(before.current);
|
|
155
|
+
before.current = null;
|
|
156
|
+
}
|
|
157
|
+
setQuery(next);
|
|
158
|
+
};
|
|
86
159
|
const toggle = React.useCallback((path) => setOpen((prev) => {
|
|
87
160
|
const next = new Set(prev);
|
|
88
161
|
if (!next.delete(path))
|
|
@@ -101,9 +174,19 @@ function JsonTree({ data, depth = 2, title, showCopyButton = true, ...props }) {
|
|
|
101
174
|
toaster_1.toast.error('Failed to copy JSON');
|
|
102
175
|
}
|
|
103
176
|
};
|
|
104
|
-
const header = title !== undefined || showCopyButton;
|
|
105
177
|
const root = branch(data);
|
|
106
|
-
|
|
178
|
+
const searchable = search && root !== null;
|
|
179
|
+
const header = title !== undefined || showCopyButton || searchable;
|
|
180
|
+
// Everything is kept when the root itself matched; nothing is when no row did.
|
|
181
|
+
const kept = sifted && !sifted.rows.get('$') ? sifted.rows : null;
|
|
182
|
+
const none = sifted !== null && sifted.rows.size === 0;
|
|
183
|
+
const fixed = sized.height !== null;
|
|
184
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('json-tree'), borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", bg: "$background", ...props, children: [header && ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('json-tree-header'), items: "center", flexWrap: "wrap", gap: "$1", borderBottomWidth: 1, borderColor: "$borderColor", bg: "$panel", px: "$2", py: "$1", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", fontFamily: "$mono", color: "$soft", px: "$2", grow: 1, children: title ?? 'JSON' }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { grow: 1, shrink: 1, flexBasis: searchable ? 240 : 'auto', minW: 0, justify: "flex-end", items: "center", gap: "$1", children: [searchable && ((0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1, minW: 0, maxW: 260, children: (0, jsx_runtime_1.jsx)(input_1.Input, { ...(0, slot_1.slot)('json-tree-filter'), type: "search", value: query, onChangeText: type, placeholder: "Filter keys, paths, values", "aria-label": `Filter ${title ?? 'JSON'} by key, path or value`,
|
|
185
|
+
// No adornment: its wrapper holds the field at its intrinsic width, and
|
|
186
|
+
// on a narrow pane that pushed the actions out of the header.
|
|
187
|
+
height: 32, fontSize: "$2" }) })), root && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { ...(0, slot_1.slot)('json-tree-expand'), variant: "ghost", size: "icon-sm", "aria-label": "Expand all", title: "Expand all", onClick: () => setOpen(paths(data, Number.POSITIVE_INFINITY)), children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronsUpDown, { size: 14 }) }), (0, jsx_runtime_1.jsx)(button_1.Button, { ...(0, slot_1.slot)('json-tree-collapse'), variant: "ghost", size: "icon-sm", "aria-label": "Collapse all", title: "Collapse all", onClick: () => setOpen(new Set()), children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronsDownUp, { size: 14 }) })] })), showCopyButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { ...(0, slot_1.slot)('json-tree-copy'), variant: "ghost", size: "icon-sm", "aria-label": copied ? 'Copied' : `Copy ${title ?? 'JSON'}`, title: "Copy", onClick: copy, children: copied ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: 14 }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Copy, { size: 14 }) }))] })] })), (0, jsx_runtime_1.jsx)(gui_1.YStack, { ref: body, ...(0, slot_1.slot)('json-tree-body'), py: "$2", px: "$2", ...(fixed ? { height: sized.height } : maxHeight !== undefined ? { maxH: maxHeight } : null), overflowY: fixed || maxHeight !== undefined ? 'auto' : undefined, children: none ? ((0, jsx_runtime_1.jsxs)(gui_1.SizableText, { ...(0, slot_1.slot)('json-tree-empty'), size: "$2", color: "$soft", px: "$2", py: "$1", children: ["Nothing matches \u201C", query.trim(), "\u201D."] })) : ((0, jsx_runtime_1.jsx)(Node, { name: null, value: data, path: "$", level: 0, open: open, toggle: toggle, kept: kept })) }), resizable && ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ref: sized.grip, ...(0, slot_1.slot)('json-tree-footer'), cursor: "row-resize", items: "center", justify: "flex-end", minH: 24, px: "$3", borderTopWidth: 1, borderColor: "$borderColor", bg: "$panel", select: "none",
|
|
188
|
+
// A touch drag would otherwise scroll the page and cancel the pointer.
|
|
189
|
+
style: { touchAction: 'none' }, children: (0, jsx_runtime_1.jsx)(grip_1.Grip, { knob: sized.knob, name: "json-tree-resize", label: title ?? 'JSON', min: minHeight, height: sized.height }) }))] }));
|
|
107
190
|
}
|
|
108
191
|
/** A leaf's colour: the code theme's key for its JSON type. */
|
|
109
192
|
const INK = {
|
|
@@ -113,14 +196,13 @@ const INK = {
|
|
|
113
196
|
null: '$codeNull',
|
|
114
197
|
};
|
|
115
198
|
function Leaf({ value }) {
|
|
116
|
-
const text = typeof value === 'string' ? JSON.stringify(value) : value === undefined ? 'undefined' : String(value);
|
|
117
199
|
const type = value === null ? 'null' : typeof value;
|
|
118
200
|
return ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('json-tree-value'), "data-type": type, size: "$2", fontFamily: "$mono", color: INK[type] ?? '$codePunctuation', shrink: 1, minW: 0,
|
|
119
201
|
// A hash or a URL is one unbreakable word; without this it sets the tree's
|
|
120
202
|
// min-content width and pushes the page sideways on a phone.
|
|
121
|
-
style: { overflowWrap: 'anywhere' }, children: text }));
|
|
203
|
+
style: { overflowWrap: 'anywhere' }, children: text(value) }));
|
|
122
204
|
}
|
|
123
|
-
function Node({ name, value, path, level, open, toggle, }) {
|
|
205
|
+
function Node({ name, value, path, level, open, toggle, kept, }) {
|
|
124
206
|
const b = branch(value);
|
|
125
207
|
const expanded = b !== null && open.has(path);
|
|
126
208
|
const key = name === null ? null : ((0, jsx_runtime_1.jsxs)(gui_1.SizableText, { ...(0, slot_1.slot)('json-tree-key'), size: "$2", fontFamily: "$mono", color: "$codeKey", children: [name, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", fontFamily: "$mono", color: "$codePunctuation", children: ":" })] }));
|
|
@@ -141,5 +223,10 @@ function Node({ name, value, path, level, open, toggle, }) {
|
|
|
141
223
|
return;
|
|
142
224
|
e.preventDefault();
|
|
143
225
|
toggle(path);
|
|
144
|
-
}, children: [empty ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 14, shrink: 0 })) : expanded ? ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronDown, { size: 14, color: "$soft" })) : ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronRight, { size: 14, color: "$soft" })), key, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('json-tree-count'), size: "$2", fontFamily: "$mono", color: "$codeComment", children: empty ? (b.kind === 'array' ? '[]' : '{}') : count(b) })] }), expanded && ((0, jsx_runtime_1.jsx)(gui_1.YStack, { children: b.entries.map(([k, v]) =>
|
|
226
|
+
}, children: [empty ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 14, shrink: 0 })) : expanded ? ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronDown, { size: 14, color: "$soft" })) : ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronRight, { size: 14, color: "$soft" })), key, (0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('json-tree-count'), size: "$2", fontFamily: "$mono", color: "$codeComment", children: empty ? (b.kind === 'array' ? '[]' : '{}') : count(b) })] }), expanded && ((0, jsx_runtime_1.jsx)(gui_1.YStack, { children: b.entries.map(([k, v]) => {
|
|
227
|
+
const at = child(path, k);
|
|
228
|
+
if (kept && !kept.has(at))
|
|
229
|
+
return null;
|
|
230
|
+
return ((0, jsx_runtime_1.jsx)(Node, { name: k, value: v, path: at, level: level + 1, open: open, toggle: toggle, kept: kept && !kept.get(at) ? kept : null }, k));
|
|
231
|
+
}) }))] }));
|
|
145
232
|
}
|
|
@@ -1,26 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JsonTree — a JSON value drawn as a tree a reader can open and close: one row
|
|
3
3
|
* per key or element, objects and arrays behind a disclosure that says how
|
|
4
|
-
* many children they hold, and a header with Expand all, Collapse all
|
|
4
|
+
* many children they hold, and a header with a filter, Expand all, Collapse all
|
|
5
|
+
* and Copy.
|
|
5
6
|
*
|
|
6
7
|
* The first `depth` levels open on first paint. A row is a button (Enter and
|
|
7
8
|
* Space toggle it, `aria-expanded` says which way), so the tree reads with a
|
|
8
9
|
* keyboard and a screen reader as well as a pointer. Keys and values take the
|
|
9
10
|
* code theme's colours (`code-theme.ts`), the same theme keys `CodeEditor`
|
|
10
11
|
* paints with, and a count reads as a comment. A long value wraps anywhere, so
|
|
11
|
-
* a hash never widens the page.
|
|
12
|
-
*
|
|
12
|
+
* a hash never widens the page.
|
|
13
|
+
*
|
|
14
|
+
* Filter. What is typed keeps every row whose key, dotted path
|
|
15
|
+
* (`answers.team.probabilities`) or value contains it, with the rows above it,
|
|
16
|
+
* and opens them; a branch that matches keeps everything under it. Clearing the
|
|
17
|
+
* filter hands back the tree as it was opened before.
|
|
18
|
+
*
|
|
19
|
+
* Height. The tree is as tall as its rows up to `maxHeight`, then scrolls.
|
|
20
|
+
* `resizable` adds CodeEditor's footer grip: a drag or ArrowUp / ArrowDown sets
|
|
21
|
+
* a height of the reader's own and a double-click hands it back; `onResize`
|
|
22
|
+
* hears each one and `defaultHeight` starts from it. Copy writes the whole
|
|
23
|
+
* value, whatever is open or filtered. Built from gui primitives only, so it
|
|
24
|
+
* renders wherever gui does.
|
|
13
25
|
*/
|
|
14
26
|
import { type YStackProps } from '@hanzo/gui';
|
|
15
27
|
import * as React from 'react';
|
|
16
|
-
|
|
28
|
+
/**
|
|
29
|
+
* What a filter keeps. `rows` maps each kept path to `true` when everything
|
|
30
|
+
* under it is kept as well (it matched) and `false` when only the way down to a
|
|
31
|
+
* match is; `open` is every kept branch, so each match is in view.
|
|
32
|
+
*/
|
|
33
|
+
export type Sifted = {
|
|
34
|
+
rows: Map<string, boolean>;
|
|
35
|
+
open: Set<string>;
|
|
36
|
+
};
|
|
37
|
+
export declare function sift(data: unknown, query: string): Sifted;
|
|
38
|
+
export interface JsonTreeProps extends Omit<YStackProps, 'children' | 'minHeight' | 'maxHeight'> {
|
|
17
39
|
/** The value to draw — anything `JSON.stringify` accepts. */
|
|
18
40
|
data: unknown;
|
|
19
41
|
/** How many levels are open on first paint. */
|
|
20
42
|
depth?: number;
|
|
21
|
-
/** The header's title. Omit it and `
|
|
43
|
+
/** The header's title. Omit it, `showCopyButton={false}` and `search={false}` to drop the header. */
|
|
22
44
|
title?: string;
|
|
23
45
|
showCopyButton?: boolean;
|
|
46
|
+
/** Whether the header has a filter box. Defaults to true. */
|
|
47
|
+
search?: boolean;
|
|
48
|
+
/** The tallest the tree grows on its own, in px; past it the tree scrolls. */
|
|
49
|
+
maxHeight?: number;
|
|
50
|
+
/** The shortest a drag makes it, in px. */
|
|
51
|
+
minHeight?: number;
|
|
52
|
+
/** Whether a footer grip resizes the tree. */
|
|
53
|
+
resizable?: boolean;
|
|
54
|
+
/** A height to start from, as `onResize` last reported it. */
|
|
55
|
+
defaultHeight?: number | null;
|
|
56
|
+
/** Every height the reader drags to, and `null` when a double-click hands it back. */
|
|
57
|
+
onResize?: (height: number | null) => void;
|
|
24
58
|
}
|
|
25
|
-
export declare function JsonTree({ data, depth, title, showCopyButton, ...props }: JsonTreeProps): React.JSX.Element;
|
|
59
|
+
export declare function JsonTree({ data, depth, title, showCopyButton, search, maxHeight, minHeight, resizable, defaultHeight, onResize, ...props }: JsonTreeProps): React.JSX.Element;
|
|
26
60
|
//# sourceMappingURL=json-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-tree.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/json-tree.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"json-tree.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/json-tree.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAS1E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyC9B;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAA;AAEtE,wBAAgB,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAwBzD;AAED,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;IAC9F,6DAA6D;IAC7D,IAAI,EAAE,OAAO,CAAA;IACb,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qGAAqG;IACrG,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,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