mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
44611e5300
Parity seams for hosts of @plannotator/ui, requested by Workspaces after the HTML annotation handoff: projectHostThreads and buildPersistedHtmlAnchor in @plannotator/core; HtmlViewer onUnanchoredChange completed over the annotations prop with a restore-keyed report so hosts can drop their mark-applied listeners; published useHtmlRefresh with a fetchSnapshot adapter; published HtmlSurfaceControls (eye, refresh, pen) with label overrides; AnnotationPanel unanchoredIds chip (wired for Plannotator too); HtmlViewer maxAdditionalTargets and scrollBehavior carried on the bridge; shortcuts and utils/inputMethod blessed as consumer exports. Plannotator's behavior is unchanged apart from the new Unanchored chip, verified by a real-browser A/B including the orphan and re-anchor cycle and by a combined cross-surface verification with #1394. AI-assisted (Claude) under maintainer direction.
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { HtmlSurfaceControls } from '@plannotator/ui/components/HtmlSurfaceControls';
|
|
|
|
interface HtmlSurfaceActionsProps {
|
|
canRefresh: boolean;
|
|
isRefreshing: boolean;
|
|
toolsHidden: boolean;
|
|
onRefresh: () => void;
|
|
onToggleTools: () => void;
|
|
}
|
|
|
|
/** Plannotator's refresh strings for the published control: the document
|
|
* is a file on disk, so the refresh says so. Shared with AppHeader. */
|
|
export const PLANNOTATOR_HTML_REFRESH_LABELS = {
|
|
refreshTitle: 'Refresh HTML from disk',
|
|
refreshingTitle: 'Refreshing HTML from disk',
|
|
} as const;
|
|
|
|
/** Eye + refresh, without the pen: the published HtmlSurfaceControls with
|
|
* Plannotator's refresh strings. Kept as the local name the header used. */
|
|
export function HtmlSurfaceActions({
|
|
canRefresh,
|
|
isRefreshing,
|
|
toolsHidden,
|
|
onRefresh,
|
|
onToggleTools,
|
|
}: HtmlSurfaceActionsProps) {
|
|
return (
|
|
<HtmlSurfaceControls
|
|
armed={false}
|
|
toolsHidden={toolsHidden}
|
|
onToggleTools={onToggleTools}
|
|
canRefresh={canRefresh}
|
|
onRefresh={onRefresh}
|
|
isRefreshing={isRefreshing}
|
|
labels={PLANNOTATOR_HTML_REFRESH_LABELS}
|
|
/>
|
|
);
|
|
}
|