@mcpview/components 0.13.1 → 0.15.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/README.md +153 -1
- package/esm/preact-components.d.ts +1 -1
- package/esm/preact-components.d.ts.map +1 -1
- package/esm/preact-controls.d.ts +12 -0
- package/esm/preact-controls.d.ts.map +1 -0
- package/esm/preact-controls.js +8 -0
- package/esm/src/context-row-styles.d.ts +5 -0
- package/esm/src/context-row-styles.d.ts.map +1 -0
- package/esm/src/context-row-styles.js +101 -0
- package/esm/src/interaction-styles.d.ts +5 -0
- package/esm/src/interaction-styles.d.ts.map +1 -0
- package/esm/src/interaction-styles.js +55 -0
- package/esm/src/preact/components.d.ts +31 -1
- package/esm/src/preact/components.d.ts.map +1 -1
- package/esm/src/preact/components.js +88 -39
- package/esm/src/preact/interaction-controls.d.ts +22 -0
- package/esm/src/preact/interaction-controls.d.ts.map +1 -0
- package/esm/src/preact/interaction-controls.js +25 -0
- package/esm/src/preact/interactive-child.d.ts +2 -0
- package/esm/src/preact/interactive-child.d.ts.map +1 -0
- package/esm/src/preact/interactive-child.js +16 -0
- package/esm/src/preact/mod.d.ts +1 -1
- package/esm/src/preact/mod.d.ts.map +1 -1
- package/esm/src/preact/semantic-element.d.ts.map +1 -1
- package/esm/src/preact/semantic-element.js +3 -16
- package/esm/src/preact/structural.d.ts.map +1 -1
- package/esm/src/preact/structural.js +14 -7
- package/esm/src/preact/visual-item-gestures.d.ts +5 -0
- package/esm/src/preact/visual-item-gestures.d.ts.map +1 -0
- package/esm/src/preact/visual-item-gestures.js +37 -0
- package/esm/src/theme.d.ts.map +1 -1
- package/esm/src/theme.js +13 -0
- package/esm/src/visual-item-gestures.d.ts +40 -0
- package/esm/src/visual-item-gestures.d.ts.map +1 -0
- package/esm/src/visual-item-gestures.js +474 -0
- package/esm/src/visual-item-props.d.ts +45 -0
- package/esm/src/visual-item-props.d.ts.map +1 -0
- package/esm/src/visual-item-props.js +22 -0
- package/package.json +6 -1
- package/script/preact-components.d.ts +1 -1
- package/script/preact-components.d.ts.map +1 -1
- package/script/preact-controls.d.ts +12 -0
- package/script/preact-controls.d.ts.map +1 -0
- package/script/preact-controls.js +22 -0
- package/script/src/context-row-styles.d.ts +5 -0
- package/script/src/context-row-styles.d.ts.map +1 -0
- package/script/src/context-row-styles.js +104 -0
- package/script/src/interaction-styles.d.ts +5 -0
- package/script/src/interaction-styles.d.ts.map +1 -0
- package/script/src/interaction-styles.js +59 -0
- package/script/src/preact/components.d.ts +31 -1
- package/script/src/preact/components.d.ts.map +1 -1
- package/script/src/preact/components.js +87 -38
- package/script/src/preact/interaction-controls.d.ts +22 -0
- package/script/src/preact/interaction-controls.d.ts.map +1 -0
- package/script/src/preact/interaction-controls.js +29 -0
- package/script/src/preact/interactive-child.d.ts +2 -0
- package/script/src/preact/interactive-child.d.ts.map +1 -0
- package/script/src/preact/interactive-child.js +19 -0
- package/script/src/preact/mod.d.ts +1 -1
- package/script/src/preact/mod.d.ts.map +1 -1
- package/script/src/preact/semantic-element.d.ts.map +1 -1
- package/script/src/preact/semantic-element.js +4 -17
- package/script/src/preact/structural.d.ts.map +1 -1
- package/script/src/preact/structural.js +14 -7
- package/script/src/preact/visual-item-gestures.d.ts +5 -0
- package/script/src/preact/visual-item-gestures.d.ts.map +1 -0
- package/script/src/preact/visual-item-gestures.js +40 -0
- package/script/src/theme.d.ts.map +1 -1
- package/script/src/theme.js +13 -0
- package/script/src/visual-item-gestures.d.ts +40 -0
- package/script/src/visual-item-gestures.d.ts.map +1 -0
- package/script/src/visual-item-gestures.js +479 -0
- package/script/src/visual-item-props.d.ts +45 -0
- package/script/src/visual-item-props.d.ts.map +1 -0
- package/script/src/visual-item-props.js +25 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { createElement as _createElement } from "preact";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
3
3
|
/** @jsxImportSource preact */
|
|
4
4
|
/** Shared Preact presentation primitives for composable MCP Apps. */
|
|
5
|
+
import { eventStartedInInteractiveChild } from "./interactive-child.js";
|
|
5
6
|
import { createElement, render } from "preact";
|
|
7
|
+
import { useId } from "preact/hooks";
|
|
8
|
+
import { DisclosureChevron } from "./interaction-controls.js";
|
|
9
|
+
import { useVisualItemGestures } from "./visual-item-gestures.js";
|
|
6
10
|
/** Simple vertical composition primitive; it carries no domain semantics. */
|
|
7
11
|
export function Stack({ gap = "md", className, children }) {
|
|
8
12
|
return (_jsx("div", { class: classes("mcp-view-stack", className), "data-gap": gap, children: children }));
|
|
@@ -35,32 +39,93 @@ export function MetricGrid({ items, className }) {
|
|
|
35
39
|
export function KeyValueList({ items, layout = "inspector", className, }) {
|
|
36
40
|
return (_jsx("dl", { class: classes("mcp-view-key-values", className), "data-layout": layout === "inspector" ? undefined : layout, children: items.map((item) => (_jsxs("div", { class: "mcp-view-key-value", children: [_jsx("dt", { children: item.label }), _jsx("dd", { children: item.value })] }, item.id))) }));
|
|
37
41
|
}
|
|
42
|
+
function tableRowIntersects(item, rectangle) {
|
|
43
|
+
const header = item.parentElement?.previousElementSibling;
|
|
44
|
+
if (header?.localName !== "thead")
|
|
45
|
+
return true;
|
|
46
|
+
const style = header.ownerDocument.defaultView?.getComputedStyle?.(header);
|
|
47
|
+
if (style?.position !== "sticky" || style.top === "auto" ||
|
|
48
|
+
style.visibility === "hidden" || style.visibility === "collapse")
|
|
49
|
+
return true;
|
|
50
|
+
const head = header.getBoundingClientRect();
|
|
51
|
+
if (head.width <= 0 || head.height <= 0)
|
|
52
|
+
return true;
|
|
53
|
+
const row = item.getBoundingClientRect();
|
|
54
|
+
// Only reject an overlap completely covered by this table's sticky header.
|
|
55
|
+
return Math.max(rectangle.left, row.left) < head.left ||
|
|
56
|
+
Math.min(rectangle.right, row.right) > head.right ||
|
|
57
|
+
Math.max(rectangle.top, row.top) < head.top ||
|
|
58
|
+
Math.min(rectangle.bottom, row.bottom) > head.bottom;
|
|
59
|
+
}
|
|
38
60
|
/** Accessible compact table; selection behavior is opt-in and keyboard-safe. */
|
|
39
|
-
export function DataTable({ label, rows, columns, rowKey, selected, onSelect, emptyLabel = "No matching data", className, }) {
|
|
61
|
+
export function DataTable({ label, rows, columns, rowKey, selected, onSelect, contextSelection, getDisclosure, emptyLabel = "No matching data", className, }) {
|
|
62
|
+
const statusId = useId();
|
|
63
|
+
const describeSelection = contextSelection !== undefined && selected !== undefined;
|
|
64
|
+
const items = rows.map((row) => {
|
|
65
|
+
const key = rowKey(row);
|
|
66
|
+
return {
|
|
67
|
+
row,
|
|
68
|
+
key,
|
|
69
|
+
id: typeof key === "string" ? `s:${key}` : `n:${key}`,
|
|
70
|
+
disclosure: getDisclosure?.(row),
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
const byId = new Map(contextSelection ? items.map((item) => [item.id, item]) : []);
|
|
74
|
+
const gestureRoot = useVisualItemGestures({
|
|
75
|
+
onActivate: (id) => {
|
|
76
|
+
const item = byId.get(id);
|
|
77
|
+
if (!item)
|
|
78
|
+
return;
|
|
79
|
+
if (item.disclosure)
|
|
80
|
+
item.disclosure.onOpen();
|
|
81
|
+
else
|
|
82
|
+
onSelect?.(item.row);
|
|
83
|
+
},
|
|
84
|
+
onToggle: contextSelection && ((id) => {
|
|
85
|
+
const item = byId.get(id);
|
|
86
|
+
if (item)
|
|
87
|
+
contextSelection.onToggle(item.row);
|
|
88
|
+
}),
|
|
89
|
+
onAdd: contextSelection?.onAdd && ((ids) => {
|
|
90
|
+
const added = ids.flatMap((id) => {
|
|
91
|
+
const item = byId.get(id);
|
|
92
|
+
return item ? [item.row] : [];
|
|
93
|
+
});
|
|
94
|
+
contextSelection.onAdd?.(added);
|
|
95
|
+
}),
|
|
96
|
+
intersectsItem: tableRowIntersects,
|
|
97
|
+
doubleClickDelayMs: contextSelection?.doubleClickDelayMs,
|
|
98
|
+
holdDelayMs: contextSelection?.holdDelayMs,
|
|
99
|
+
});
|
|
40
100
|
if (rows.length === 0) {
|
|
41
101
|
return (_jsx("div", { "aria-label": label, class: classes("mcp-view-table-wrap", className), role: "status", children: _jsx(EmptyState, { children: emptyLabel }) }));
|
|
42
102
|
}
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
103
|
+
return (_jsxs("div", { class: classes("mcp-view-table-wrap", className), children: [_jsxs("table", { class: "mcp-view-table", "aria-label": label, children: [_jsx("thead", { children: _jsx("tr", { children: columns.map((column) => (_jsx("th", { scope: "col", "data-align": column.align ?? "left", children: column.label }, column.id))) }) }), _jsx("tbody", { ref: contextSelection ? gestureRoot : undefined, "data-visual-selection-surface": contextSelection?.onAdd ? "" : undefined, children: items.map(({ row, key, id, disclosure }) => {
|
|
104
|
+
const interactive = disclosure !== undefined || onSelect !== undefined;
|
|
105
|
+
const isSelected = selected?.(row);
|
|
106
|
+
const choose = disclosure ? disclosure.onOpen : () => onSelect?.(row);
|
|
107
|
+
return (_jsx("tr", { "aria-describedby": describeSelection
|
|
108
|
+
? `${statusId}-${isSelected ? "selected" : "unselected"}`
|
|
109
|
+
: undefined, "aria-selected": selected ? isSelected : undefined, "aria-keyshortcuts": contextSelection ? "Shift+Space" : undefined, class: isSelected && !contextSelection ? "mcp-view-selected" : undefined, "data-mcp-view-context-row": contextSelection && isSelected ? "selected" : undefined, "data-interactive": interactive || contextSelection ? "true" : undefined, "data-visual-item": contextSelection ? id : undefined, "data-visual-no-activate": contextSelection && !interactive ? "" : undefined, "data-visual-selection-start": contextSelection?.onAdd ? "" : undefined, tabIndex: contextSelection || (interactive && !disclosure) ? 0 : undefined, onClick: interactive && !contextSelection
|
|
110
|
+
? (event) => {
|
|
111
|
+
if (eventStartedInInteractiveChild(event.currentTarget, event.target))
|
|
112
|
+
return;
|
|
113
|
+
choose();
|
|
114
|
+
}
|
|
115
|
+
: undefined, onKeyDown: interactive && !contextSelection
|
|
116
|
+
? (event) => {
|
|
117
|
+
if (event.target !== event.currentTarget)
|
|
118
|
+
return;
|
|
119
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
120
|
+
return;
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
choose();
|
|
123
|
+
}
|
|
124
|
+
: undefined, children: columns.map((column, index) => (_jsxs("td", { "data-align": column.align ?? "left", children: [index === 0 && disclosure && (_jsx("button", { type: "button", class: "mcp-view-table-disclosure", "data-visual-immediate-activate": contextSelection ? "" : undefined, "aria-label": disclosure.label, "aria-expanded": disclosure.expanded, "aria-controls": disclosure.controls, onClick: (event) => {
|
|
125
|
+
event.stopPropagation();
|
|
126
|
+
disclosure.onOpen();
|
|
127
|
+
}, children: _jsx(DisclosureChevron, { expanded: disclosure.expanded === true }) })), column.render(row)] }, column.id))) }, key));
|
|
128
|
+
}) })] }), describeSelection && (_jsxs(_Fragment, { children: [_jsx("span", { hidden: true, id: `${statusId}-selected`, children: contextSelection.labels?.selected ?? "Selected for context" }), _jsx("span", { hidden: true, id: `${statusId}-unselected`, children: contextSelection.labels?.unselected ?? "Not selected for context" })] }))] }));
|
|
64
129
|
}
|
|
65
130
|
/** Small dashboard-safe action, never a product-wide navigation control. */
|
|
66
131
|
export function Button({ type = "button", pressed, disabled, title, className, onClick, children, }) {
|
|
@@ -155,22 +220,6 @@ export function CrossSelection({ label, value, status, className, }) {
|
|
|
155
220
|
export function StateMessage({ title, tone = "neutral", busy, children, className, }) {
|
|
156
221
|
return (_jsxs("div", { "aria-busy": busy, class: classes("mcp-view-state", className), "data-tone": tone, role: tone === "danger" ? "alert" : "status", children: [busy && _jsx("span", { "aria-hidden": "true", class: "mcp-view-state-busy" }), title && _jsx("strong", { children: title }), children && _jsx("div", { class: "mcp-view-state-detail", children: children })] }));
|
|
157
222
|
}
|
|
158
|
-
const INTERACTIVE_CHILD_SELECTOR = [
|
|
159
|
-
"a[href]",
|
|
160
|
-
"button",
|
|
161
|
-
"input",
|
|
162
|
-
"select",
|
|
163
|
-
"textarea",
|
|
164
|
-
"[role='button']",
|
|
165
|
-
"[role='link']",
|
|
166
|
-
].join(",");
|
|
167
|
-
function eventStartedInInteractiveChild(row, target) {
|
|
168
|
-
const candidate = target;
|
|
169
|
-
if (!candidate || typeof candidate.closest !== "function")
|
|
170
|
-
return false;
|
|
171
|
-
const interactive = candidate.closest(INTERACTIVE_CHILD_SELECTOR);
|
|
172
|
-
return interactive !== null && interactive !== row && row.contains(interactive);
|
|
173
|
-
}
|
|
174
223
|
function classes(...values) {
|
|
175
224
|
return values.filter(Boolean).join(" ");
|
|
176
225
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @jsxImportSource preact */
|
|
2
|
+
/** Controlled presentation for exploring a reading and pinning it to context. */
|
|
3
|
+
import type { JSX } from "preact";
|
|
4
|
+
export interface ContextPinButtonProps {
|
|
5
|
+
/** Localized accessible action, including its target. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly pressed: boolean | "mixed";
|
|
8
|
+
/** Draw two strokes for a collection, including when all or none are pinned. */
|
|
9
|
+
readonly group?: boolean;
|
|
10
|
+
readonly disabled?: boolean;
|
|
11
|
+
readonly className?: string;
|
|
12
|
+
readonly onToggle: (shiftKey: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Independent action beside a row, card, or active point. The viewer owns its selection. */
|
|
15
|
+
export declare function ContextPinButton({ label, pressed, group, disabled, className, onToggle, }: ContextPinButtonProps): JSX.Element;
|
|
16
|
+
export interface DisclosureChevronProps {
|
|
17
|
+
readonly expanded: boolean;
|
|
18
|
+
readonly className?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Decorative leading glyph. The containing button supplies its label, action and expanded state. */
|
|
21
|
+
export declare function DisclosureChevron({ expanded, className }: DisclosureChevronProps): JSX.Element;
|
|
22
|
+
//# sourceMappingURL=interaction-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-controls.d.ts","sourceRoot":"","sources":["../../../src/src/preact/interaction-controls.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,iFAAiF;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACpC,gFAAgF;IAChF,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,KAAa,EACb,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAmDrC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,qGAAqG;AACrG,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAmB9F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
/** Independent action beside a row, card, or active point. The viewer owns its selection. */
|
|
3
|
+
export function ContextPinButton({ label, pressed, group = false, disabled, className, onToggle, }) {
|
|
4
|
+
return (_jsx("button", { type: "button", "aria-label": label, "aria-pressed": pressed, title: label, class: className ? `mcp-view-context-pin ${className}` : "mcp-view-context-pin", "data-context-pin": "", disabled: disabled, draggable: false, onPointerDown: (event) => event.stopPropagation(), onPointerUp: (event) => event.stopPropagation(), onPointerCancel: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onMouseUp: (event) => event.stopPropagation(), onTouchStart: (event) => event.stopPropagation(), onTouchEnd: (event) => event.stopPropagation(), onDragStart: (event) => {
|
|
5
|
+
event.preventDefault();
|
|
6
|
+
event.stopPropagation();
|
|
7
|
+
}, onKeyDown: (event) => {
|
|
8
|
+
if (event.key !== "Enter" && event.key !== " ")
|
|
9
|
+
return;
|
|
10
|
+
event.stopPropagation();
|
|
11
|
+
if (event.repeat)
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
}, onKeyUp: (event) => {
|
|
14
|
+
if (event.key === "Enter" || event.key === " ")
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
}, onClick: (event) => {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
if (!disabled && (event.detail ?? 0) <= 1)
|
|
19
|
+
onToggle(Boolean(event.shiftKey));
|
|
20
|
+
}, onDblClick: (event) => event.stopPropagation(), children: _jsxs("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", width: "22", height: "22", fill: "none", stroke: "currentColor", "stroke-linecap": "round", children: [_jsx("path", { class: "mcp-view-context-pin-stroke", d: group ? "M9 5v14" : "M12 5v14" }), group && _jsx("path", { class: "mcp-view-context-pin-stroke", d: "M15 5v14" })] }) }));
|
|
21
|
+
}
|
|
22
|
+
/** Decorative leading glyph. The containing button supplies its label, action and expanded state. */
|
|
23
|
+
export function DisclosureChevron({ expanded, className }) {
|
|
24
|
+
return (_jsx("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 16 16", width: "16", height: "16", class: className ? `mcp-view-disclosure-chevron ${className}` : "mcp-view-disclosure-chevron", "data-expanded": expanded ? "true" : "false", fill: "none", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "1.5", children: _jsx("path", { d: "m6 4 4 4-4 4" }) }));
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive-child.d.ts","sourceRoot":"","sources":["../../../src/src/preact/interactive-child.ts"],"names":[],"mappings":"AAUA,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,WAAW,GAAG,IAAI,GACzB,OAAO,CAKT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const INTERACTIVE_CHILD_SELECTOR = [
|
|
2
|
+
"a[href]",
|
|
3
|
+
"button",
|
|
4
|
+
"input",
|
|
5
|
+
"select",
|
|
6
|
+
"textarea",
|
|
7
|
+
"[role='button']",
|
|
8
|
+
"[role='link']",
|
|
9
|
+
].join(",");
|
|
10
|
+
export function eventStartedInInteractiveChild(element, target) {
|
|
11
|
+
const candidate = target;
|
|
12
|
+
if (!candidate || typeof candidate.closest !== "function")
|
|
13
|
+
return false;
|
|
14
|
+
const interactive = candidate.closest(INTERACTIVE_CHILD_SELECTOR);
|
|
15
|
+
return interactive !== null && interactive !== element && element.contains(interactive);
|
|
16
|
+
}
|
package/esm/src/preact/mod.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
export { definePreactComponent, preactSurfaceRenderer, startPreactSurfaceApp, SurfaceAppError, } from "./surface.js";
|
|
3
3
|
export { ArtifactRow, Badge, BadgeGroup, Button, Card, CodeBlock, CollectionCard, CrossSelection, DataTable, Disclosure, DrillHint, ElementBody, ElementIdent, ElementLimit, ElementProvenance, ElementReading, ElementSection, ElementVerdict, EmptyState, FocusedView, InlineCode, IntervalPlot, KeyValueList, LimitGauge, Message, Metric, MetricGrid, NoticeGroup, PATH_BAR_DEFAULT_MAX_VISIBLE, PathBar, renderStatusMessage, Row, SemanticElement, SemanticList, SeriesChart, Skeleton, Slot3D, SnippetLibrary, Sparkline, Stack, StaleBanner, StateMessage, TextInput, Toolbar, TreeList, TypeBadge, } from "../../preact-components.js";
|
|
4
4
|
export type { PreactComponentRenderer, PreactSurfaceAppOptions, PreactSurfaceAppState, PreactSurfaceComponentProps, PreactSurfaceContext, SurfaceAppErrorCode, SurfaceAppHandle, SurfaceAppRuntime, SurfaceDisplayState, SurfaceHostAccess, SurfaceLabel, SurfaceMessageKind, SurfaceProjection, SurfaceStatus, SurfaceStatusTone, SurfaceToolResult, SurfaceViewerSession, } from "./surface.js";
|
|
5
|
-
export type { ArtifactFingerprint, ArtifactRowProps, ArtifactVerification, BadgeGroupProps, BadgeProps, ButtonProps, CardProps, CodeBlockProps, CollectionCardProps, CrossSelectionProps, DataTableColumn, DataTableProps, DisclosureProps, DrillHintDirection, DrillHintProps, ElementBodyProps, ElementIdentProps, ElementLimitProps, ElementProvenanceProps, ElementReadingProps, ElementSectionProps, ElementVerdictProps, EmptyStateProps, FocusedViewProps, InlineCodeProps, IntervalPlotInterval, IntervalPlotProps, KeyValueItem, KeyValueLayout, KeyValueListProps, LimitGaugeLimit, LimitGaugeProps, MessageProps, MetricGridProps, MetricItem, MetricProps, NoticeGroupProps, PathBarItem, PathBarProps, PresentationTone, RowProps, SemanticElementDensity, SemanticElementProps, SemanticListProps, SeriesChartCursor, SeriesChartProps, SeriesChartReadout, SeriesChartSeries, SeriesChartSummaryItem, SeriesChartTone, SeriesPoint, SkeletonProps, Slot3DProps, SnippetLibraryEntry, SnippetLibraryLabels, SnippetLibraryProps, SnippetLibrarySource, SparklineProps, StackProps, StaleBannerAction, StaleBannerProps, StateMessageProps, StatusMessageMount, TextInputProps, ToolbarProps, TreeListNode, TreeListProps, TypeBadgeProps, ViewKind, } from "../../preact-components.js";
|
|
5
|
+
export type { ArtifactFingerprint, ArtifactRowProps, ArtifactVerification, BadgeGroupProps, BadgeProps, ButtonProps, CardProps, CodeBlockProps, CollectionCardProps, CrossSelectionProps, DataTableColumn, DataTableDisclosure, DataTableProps, DisclosureProps, DrillHintDirection, DrillHintProps, ElementBodyProps, ElementIdentProps, ElementLimitProps, ElementProvenanceProps, ElementReadingProps, ElementSectionProps, ElementVerdictProps, EmptyStateProps, FocusedViewProps, InlineCodeProps, IntervalPlotInterval, IntervalPlotProps, KeyValueItem, KeyValueLayout, KeyValueListProps, LimitGaugeLimit, LimitGaugeProps, MessageProps, MetricGridProps, MetricItem, MetricProps, NoticeGroupProps, PathBarItem, PathBarProps, PresentationTone, RowProps, SemanticElementDensity, SemanticElementProps, SemanticListProps, SeriesChartCursor, SeriesChartProps, SeriesChartReadout, SeriesChartSeries, SeriesChartSummaryItem, SeriesChartTone, SeriesPoint, SkeletonProps, Slot3DProps, SnippetLibraryEntry, SnippetLibraryLabels, SnippetLibraryProps, SnippetLibrarySource, SparklineProps, StackProps, StaleBannerAction, StaleBannerProps, StateMessageProps, StatusMessageMount, TextInputProps, ToolbarProps, TreeListNode, TreeListProps, TypeBadgeProps, ViewKind, } from "../../preact-components.js";
|
|
6
6
|
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/preact/mod.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,SAAS,EACT,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,Y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AW,EACX,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/preact/mod.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,SAAS,EACT,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,OAAO,EACP,MAAM,EACN,UAAU,EACV,WAAW,EACX,4BAA4B,EAC5B,OAAO,EACP,mBAAmB,EACnB,GAAG,EACH,eAAe,EACf,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,MAAM,EACN,cAAc,EACd,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EACf,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-element.d.ts","sourceRoot":"","sources":["../../../src/src/preact/semantic-element.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,0EAA0E;
|
|
1
|
+
{"version":3,"file":"semantic-element.d.ts","sourceRoot":"","sources":["../../../src/src/preact/semantic-element.tsx"],"names":[],"mappings":"AAAA,8BAA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EAAE,gBAAgB,CAAC;IACjC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EACb,KAAK,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,GAC9C,SAAS,KAAK,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAS,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACpD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,SAAS,GACV,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CAoDpC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource preact */
|
|
3
|
+
/** Generic, domain-neutral presentation shell for one semantic object. */
|
|
4
|
+
import { eventStartedInInteractiveChild } from "./interactive-child.js";
|
|
2
5
|
import { Card } from "./components.js";
|
|
3
6
|
/** Bounded group for row-density semantic objects; it owns no domain ordering. */
|
|
4
7
|
export function SemanticList({ label, scrollable = false, className, children, }) {
|
|
@@ -67,22 +70,6 @@ export function SemanticElement({ reference, density, tone, selected, ident, rea
|
|
|
67
70
|
}
|
|
68
71
|
: undefined, children: [ident, isPresent(reading) && (_jsx("div", { class: "mcp-view-element-readings", "data-element-slot": "readings", children: reading })), body, verdict, provenance] }));
|
|
69
72
|
}
|
|
70
|
-
const INTERACTIVE_CHILD_SELECTOR = [
|
|
71
|
-
"a[href]",
|
|
72
|
-
"button",
|
|
73
|
-
"input",
|
|
74
|
-
"select",
|
|
75
|
-
"textarea",
|
|
76
|
-
"[role='button']",
|
|
77
|
-
"[role='link']",
|
|
78
|
-
].join(",");
|
|
79
|
-
function eventStartedInInteractiveChild(element, target) {
|
|
80
|
-
const candidate = target;
|
|
81
|
-
if (!candidate || typeof candidate.closest !== "function")
|
|
82
|
-
return false;
|
|
83
|
-
const interactive = candidate.closest(INTERACTIVE_CHILD_SELECTOR);
|
|
84
|
-
return interactive !== null && interactive !== element && element.contains(interactive);
|
|
85
|
-
}
|
|
86
73
|
function verdictBorder(tone) {
|
|
87
74
|
const color = {
|
|
88
75
|
neutral: "var(--mcp-view-muted, currentColor)",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structural.d.ts","sourceRoot":"","sources":["../../../src/src/preact/structural.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,kEAAkE;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"structural.d.ts","sourceRoot":"","sources":["../../../src/src/preact/structural.tsx"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,kEAAkE;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,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sx-runtime";
|
|
2
|
+
import { eventStartedInInteractiveChild } from "./interactive-child.js";
|
|
3
|
+
import { DisclosureChevron } from "./interaction-controls.js";
|
|
2
4
|
/** Trailing items kept inline before the leading ones collapse. */
|
|
3
5
|
export const PATH_BAR_DEFAULT_MAX_VISIBLE = 3;
|
|
4
6
|
/**
|
|
@@ -23,10 +25,6 @@ export function PathBar({ label, items, currentId, onSelect, maxVisible = PATH_B
|
|
|
23
25
|
: (_jsx("button", { class: "mcp-view-path-bar-button", onClick: () => onSelect(item.id), type: "button", children: item.label })) }, item.id));
|
|
24
26
|
}) })] }));
|
|
25
27
|
}
|
|
26
|
-
const DRILL_HINT_GLYPH = Object.freeze({
|
|
27
|
-
"in-view": "›",
|
|
28
|
-
"to-model": "~",
|
|
29
|
-
});
|
|
30
28
|
/**
|
|
31
29
|
* Affordance for one available drill-down.
|
|
32
30
|
*
|
|
@@ -38,7 +36,7 @@ export function DrillHint(props) {
|
|
|
38
36
|
if (props.onActivate === undefined) {
|
|
39
37
|
return (_jsx("span", { class: className, "data-degraded": "true", "data-direction": props.direction, children: props.label }));
|
|
40
38
|
}
|
|
41
|
-
return (_jsxs("button", { "aria-label": props.actionLabel, class: className, "data-direction": props.direction, onClick: props.onActivate, type: "button", children: [_jsx("span", { class: "mcp-view-drill-hint-label", children: props.label }), _jsx("span", { "aria-hidden": "true", class: "mcp-view-drill-hint-glyph", children:
|
|
39
|
+
return (_jsxs("button", { "aria-label": props.actionLabel, class: className, "data-direction": props.direction, onClick: props.onActivate, type: "button", children: [props.direction === "in-view" && _jsx(DisclosureChevron, { expanded: false }), _jsx("span", { class: "mcp-view-drill-hint-label", children: props.label }), props.direction === "to-model" && (_jsx("span", { "aria-hidden": "true", class: "mcp-view-drill-hint-glyph", children: "~" }))] }));
|
|
42
40
|
}
|
|
43
41
|
/** Names what one level is, next to the path that reached it. */
|
|
44
42
|
export function TypeBadge({ kind, label, className }) {
|
|
@@ -67,8 +65,17 @@ function TreeListItem({ node, level, expanded, onToggle, toggleLabel, selectedId
|
|
|
67
65
|
const children = node.children ?? [];
|
|
68
66
|
const open = children.length > 0 && expanded.has(node.id);
|
|
69
67
|
const selected = selectedId === node.id;
|
|
70
|
-
return (_jsxs("li", { "aria-expanded": children.length > 0 ? open : undefined, "aria-level": level, "aria-selected": onSelect === undefined ? undefined : selected, class: "mcp-view-tree-list-item", "data-tone": node.tone, role: "treeitem", children: [_jsxs("div", { class: "mcp-view-tree-list-row", style: { paddingInlineStart: `${(level - 1) * 0.9}rem` },
|
|
71
|
-
|
|
68
|
+
return (_jsxs("li", { "aria-expanded": children.length > 0 ? open : undefined, "aria-level": level, "aria-selected": onSelect === undefined ? undefined : selected, class: "mcp-view-tree-list-item", "data-tone": node.tone, role: "treeitem", children: [_jsxs("div", { class: "mcp-view-tree-list-row", style: { paddingInlineStart: `${(level - 1) * 0.9}rem` }, onClick: children.length > 0 && !onSelect
|
|
69
|
+
? (event) => {
|
|
70
|
+
if (eventStartedInInteractiveChild(event.currentTarget, event.target))
|
|
71
|
+
return;
|
|
72
|
+
onToggle(node.id);
|
|
73
|
+
}
|
|
74
|
+
: undefined, children: [children.length > 0
|
|
75
|
+
? (_jsx("button", { "aria-expanded": open, "aria-label": toggleLabel, class: "mcp-view-tree-list-twisty", onClick: (event) => {
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
onToggle(node.id);
|
|
78
|
+
}, type: "button", children: _jsx(DisclosureChevron, { expanded: open }) }))
|
|
72
79
|
: _jsx("span", { "aria-hidden": "true", class: "mcp-view-tree-list-twisty", "data-empty": "true" }), node.typeLabel !== undefined && (_jsx("span", { class: "mcp-view-tree-list-type", children: node.typeLabel })), onSelect === undefined
|
|
73
80
|
? _jsx("span", { class: "mcp-view-tree-list-label", children: node.label })
|
|
74
81
|
: (_jsx("button", { class: "mcp-view-tree-list-label", onClick: () => onSelect(node.id), type: "button", children: node.label })), node.detail !== undefined && _jsx("span", { class: "mcp-view-tree-list-detail", children: node.detail }), node.coverageLabel !== undefined && (_jsx("span", { class: "mcp-view-tree-list-coverage", "data-tone": node.tone, children: node.coverageLabel }))] }), open && (_jsx("ul", { class: "mcp-view-tree-list-group", role: "group", children: children.map((child) => (_jsx(TreeListItem, { expanded: expanded, level: level + 1, node: child, onSelect: onSelect, onToggle: onToggle, selectedId: selectedId, toggleLabel: toggleLabel }, child.id))) }))] }));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RefCallback } from "preact";
|
|
2
|
+
import { type VisualItemGestureOptions } from "../visual-item-gestures.js";
|
|
3
|
+
/** A stable callback ref that delegates to the latest gesture callbacks. */
|
|
4
|
+
export declare function useVisualItemGestures<T extends Element = HTMLElement>(options: VisualItemGestureOptions): RefCallback<T>;
|
|
5
|
+
//# sourceMappingURL=visual-item-gestures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-item-gestures.d.ts","sourceRoot":"","sources":["../../../src/src/preact/visual-item-gestures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AAEpC,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,GAAG,WAAW,EACnE,OAAO,EAAE,wBAAwB,GAChC,WAAW,CAAC,CAAC,CAAC,CAkChB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useCallback, useRef } from "preact/hooks";
|
|
2
|
+
import { bindVisualItemGestures, resolveVisualItemGestureDelays, } from "../visual-item-gestures.js";
|
|
3
|
+
/** A stable callback ref that delegates to the latest gesture callbacks. */
|
|
4
|
+
export function useVisualItemGestures(options) {
|
|
5
|
+
const current = useRef(options);
|
|
6
|
+
const detach = useRef();
|
|
7
|
+
resolveVisualItemGestureDelays(options);
|
|
8
|
+
current.current = options;
|
|
9
|
+
return useCallback((root) => {
|
|
10
|
+
detach.current?.();
|
|
11
|
+
detach.current = root
|
|
12
|
+
? bindVisualItemGestures(root, {
|
|
13
|
+
get onActivate() {
|
|
14
|
+
return current.current.onActivate;
|
|
15
|
+
},
|
|
16
|
+
get onToggle() {
|
|
17
|
+
return current.current.onToggle;
|
|
18
|
+
},
|
|
19
|
+
get onAdd() {
|
|
20
|
+
return current.current.onAdd;
|
|
21
|
+
},
|
|
22
|
+
get getItemBounds() {
|
|
23
|
+
return current.current.getItemBounds;
|
|
24
|
+
},
|
|
25
|
+
get intersectsItem() {
|
|
26
|
+
return current.current.intersectsItem;
|
|
27
|
+
},
|
|
28
|
+
get doubleClickDelayMs() {
|
|
29
|
+
return current.current.doubleClickDelayMs;
|
|
30
|
+
},
|
|
31
|
+
get holdDelayMs() {
|
|
32
|
+
return current.current.holdDelayMs;
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
: undefined;
|
|
36
|
+
}, []);
|
|
37
|
+
}
|
package/esm/src/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/src/theme.ts"],"names":[],"mappings":"AAAA,4EAA4E;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/src/theme.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAI5E,eAAO,MAAM,uBAAuB,mBAAmB,CAAC;AAExD,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,OAAO,EAAE,oB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iB,GAAG,kBAAkB,CAAC,MAAM,kBAAkB,CAAC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAu8DhC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAAC;CACnD;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CACjC,MAAM,GAAE,oBAA+B,GACtC,gBAAgB,CASlB"}
|
package/esm/src/theme.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Shared light-first visual language for composable MCP App components. */
|
|
2
|
+
import { MCP_VIEW_INTERACTION_CSS } from "./interaction-styles.js";
|
|
2
3
|
export const MCP_VIEW_THEME_STYLE_ID = "mcp-view-theme";
|
|
3
4
|
export const MCP_VIEW_THEME_TOKENS = Object.freeze({
|
|
4
5
|
text: "--mcp-view-text",
|
|
@@ -52,6 +53,7 @@ export const MCP_VIEW_THEME_TOKENS = Object.freeze({
|
|
|
52
53
|
* and explicit system states. Every token can be overridden by the host.
|
|
53
54
|
*/
|
|
54
55
|
export const MCP_VIEW_THEME_CSS = String.raw `
|
|
56
|
+
${MCP_VIEW_INTERACTION_CSS}
|
|
55
57
|
:root {
|
|
56
58
|
color-scheme: light dark;
|
|
57
59
|
--mcp-view-text: var(--color-text-primary, #101519);
|
|
@@ -1578,6 +1580,17 @@ button.mcp-view-drill-hint:focus-visible {
|
|
|
1578
1580
|
font-size: var(--mcp-view-size-note);
|
|
1579
1581
|
line-height: 1;
|
|
1580
1582
|
}
|
|
1583
|
+
.mcp-view-table-disclosure {
|
|
1584
|
+
display: inline-grid; place-items: center; min-width: 36px; min-height: 36px;
|
|
1585
|
+
margin-inline-end: .2rem; padding: 0; border: 0; border-radius: var(--mcp-view-radius-control);
|
|
1586
|
+
background: none; color: var(--mcp-view-muted); cursor: pointer; vertical-align: middle;
|
|
1587
|
+
}
|
|
1588
|
+
.mcp-view-table-disclosure:focus-visible {
|
|
1589
|
+
outline: 2px solid var(--mcp-view-accent); outline-offset: -2px;
|
|
1590
|
+
}
|
|
1591
|
+
@media (pointer: coarse) {
|
|
1592
|
+
.mcp-view-table-disclosure, button.mcp-view-tree-list-twisty { min-width: 44px; min-height: 44px; }
|
|
1593
|
+
}
|
|
1581
1594
|
.mcp-view-tree-list-twisty[data-empty="true"] { cursor: default; }
|
|
1582
1595
|
.mcp-view-tree-list-twisty:focus-visible {
|
|
1583
1596
|
outline: 2px solid var(--mcp-view-accent);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Default wait for a possible second click before a mouse click activates. */
|
|
2
|
+
export declare const VISUAL_ITEM_DOUBLE_CLICK_DELAY_MS = 500;
|
|
3
|
+
/** Default pointer hold duration that toggles an item. */
|
|
4
|
+
export declare const VISUAL_ITEM_HOLD_DELAY_MS = 550;
|
|
5
|
+
export interface VisualItemGestureOptions {
|
|
6
|
+
onActivate?: (id: string) => void;
|
|
7
|
+
onToggle?: (id: string) => void;
|
|
8
|
+
onAdd?: (ids: readonly string[]) => void;
|
|
9
|
+
getItemBounds?: (item: Element) => DOMRectReadOnly;
|
|
10
|
+
intersectsItem?: (item: Element, rect: DOMRectReadOnly) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Mouse and pen clicks on toggle-capable items wait this long for a second click before they
|
|
13
|
+
* activate. Default 500. `0` activates immediately and a double-click never toggles. Keep it
|
|
14
|
+
* equal to the `@mcpview/view` arbiter's `doubleClickDelayMs` when an App combines both.
|
|
15
|
+
* Keyboard, touch taps and items that cannot toggle always activate immediately.
|
|
16
|
+
* Must be finite, >= 0 and <= 2_147_483_647 (the longest delay `setTimeout` honours).
|
|
17
|
+
* Only `undefined` selects the default.
|
|
18
|
+
*/
|
|
19
|
+
doubleClickDelayMs?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Pointer hold duration that toggles a toggle-capable item. Default 550. Finite, > 0 and
|
|
22
|
+
* <= 2_147_483_647. Only `undefined` selects the default.
|
|
23
|
+
*/
|
|
24
|
+
holdDelayMs?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Throws a RangeError when a timing option is invalid. Returns the resolved delays. */
|
|
27
|
+
export declare function resolveVisualItemGestureDelays(options: Pick<VisualItemGestureOptions, "doubleClickDelayMs" | "holdDelayMs">): {
|
|
28
|
+
doubleClickDelayMs: number;
|
|
29
|
+
holdDelayMs: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Delegate drill and context gestures to descendants marked with `data-visual-item`.
|
|
33
|
+
* Mark rectangle surfaces with `data-visual-selection-surface` and use `touch-action: pan-y`
|
|
34
|
+
* there to allow horizontal touch selection alongside vertical scrolling.
|
|
35
|
+
* Mark items where a rectangle can start with `data-visual-selection-start`.
|
|
36
|
+
* Use native buttons or focusable equivalents and expose Shift+Space in their keyboard help.
|
|
37
|
+
* Returns the listener cleanup function.
|
|
38
|
+
*/
|
|
39
|
+
export declare function bindVisualItemGestures(root: Element, options: VisualItemGestureOptions): () => void;
|
|
40
|
+
//# sourceMappingURL=visual-item-gestures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-item-gestures.d.ts","sourceRoot":"","sources":["../../src/src/visual-item-gestures.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,0DAA0D;AAC1D,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,eAAe,CAAC;IACnD,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC;IACnE;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD,wFAAwF;AACxF,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,GAAG,aAAa,CAAC,GAC5E;IAAE,kBAAkB,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAqBrD;AAiID;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,wBAAwB,GAChC,MAAM,IAAI,CAyVZ"}
|