mirror of
https://github.com/hanzo-apps/tabs.git
synced 2026-09-15 19:32:29 +00:00
Type the two handlers a consumer cannot type for us
This package ships its sources — `types` is `./index.ts` — so every consumer typechecks `components/workspace.tsx` in its own module graph. Two handlers took their parameter types from `YStack`'s props by inference, which resolves here and does not resolve there: one implicit `any` under a consumer's `noImplicitAny`, and its build fails on a file it does not own. Both are annotated now, from named imports rather than the global React namespace, for the same reason: a shipped source cannot assume what the consumer has in scope. 0.1.6. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -42,7 +42,16 @@
|
||||
* rather than merely redundant.
|
||||
*/
|
||||
|
||||
import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
type PointerEvent as ReactPointerEvent,
|
||||
type ReactNode,
|
||||
type SyntheticEvent,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import {
|
||||
ArrowLeft,
|
||||
ArrowRight,
|
||||
@@ -1034,7 +1043,9 @@ export function Workspace({
|
||||
// — never ours. What is withheld is top-navigation and popups.
|
||||
sandbox="allow-scripts allow-same-origin allow-forms"
|
||||
ref={(el) => probe(id, el)}
|
||||
onLoad={(e) => probe(id, e.currentTarget)}
|
||||
onLoad={(e: SyntheticEvent<HTMLIFrameElement>) =>
|
||||
probe(id, e.currentTarget)
|
||||
}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
@@ -1165,7 +1176,7 @@ export function Workspace({
|
||||
return (
|
||||
<YStack
|
||||
key={d.path.join('') || 'root'}
|
||||
onPointerDown={(e) => {
|
||||
onPointerDown={(e: ReactPointerEvent<HTMLElement>) => {
|
||||
e.preventDefault();
|
||||
e.currentTarget.setPointerCapture?.(e.pointerId);
|
||||
setDrag({ path: d.path, dir: d.dir });
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hanzo/tabs",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"license": "MIT",
|
||||
"description": "Keep tabs on your agents. A browser terminal workspace for machines you have linked \u2014 the app at tabs.hanzo.ai, and the component its other hosts mount.",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user