@plannotator/ui 0.29.1 → 0.31.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 +1 -0
- package/components/ActionMenu.tsx +6 -1
- package/components/AgentsTab.tsx +8 -9
- package/components/AnalysisLayerToggle.tsx +48 -0
- package/components/AnnotationPanel.tsx +68 -35
- package/components/AnnotationToolbar.tsx +28 -8
- package/components/AnnotationToolstrip.tsx +9 -0
- package/components/CommentPopover.tsx +212 -46
- package/components/ConfirmDialog.tsx +42 -28
- package/components/InlineMarkdown.tsx +3 -2
- package/components/KeyboardShortcuts.tsx +9 -0
- package/components/Landing.tsx +1 -1
- package/components/LookAndFeelAnnouncementDialog.tsx +147 -178
- package/components/MarkdownEditor/embedPicker.ts +349 -0
- package/components/MarkdownEditor.tsx +12 -0
- package/components/ModeToggle.tsx +2 -1
- package/components/PermissionModeSetup.tsx +24 -5
- package/components/PinpointOverlay.tsx +11 -6
- package/components/PlanHeaderMenu.tsx +140 -1
- package/components/SearchableSelect.tsx +2 -0
- package/components/Settings.tsx +136 -10
- package/components/SkillReferenceMenu.tsx +9 -0
- package/components/StickyHeaderLane.tsx +9 -2
- package/components/TableOfContents.tsx +9 -4
- package/components/TextShimmer.tsx +8 -5
- package/components/ThemeProvider.tsx +43 -1
- package/components/ThemeTab.tsx +52 -1
- package/components/Tooltip.tsx +3 -1
- package/components/Viewer.tsx +19 -5
- package/components/VimTargetReticle.tsx +12 -4
- package/components/ai/DocumentAIChatPanel.tsx +1 -0
- package/components/core/button.tsx +14 -6
- package/components/html-viewer/HtmlViewer.tsx +215 -39
- package/components/html-viewer/bridge-script.ts +384 -66
- package/components/html-viewer/composerYield.ts +1 -51
- package/components/html-viewer/useHtmlAnnotation.ts +179 -58
- package/components/plan-diff/PlanCleanDiffView.tsx +1 -0
- package/components/sidebar/FileBrowser.tsx +17 -5
- package/components/sidebar/SidebarContainer.tsx +124 -28
- package/components/ui/button.tsx +10 -8
- package/components/ui/dialog.tsx +35 -25
- package/config/index.ts +6 -1
- package/config/reviewView.ts +42 -9
- package/config/settings.ts +141 -0
- package/hooks/useAIProviderConfig.ts +8 -7
- package/hooks/useActiveSection.ts +6 -4
- package/hooks/useAgentJobs.ts +3 -0
- package/hooks/useAnnotationHighlighter.ts +20 -0
- package/hooks/useIsMobile.ts +37 -0
- package/hooks/useLinkedDoc.ts +7 -0
- package/hooks/useScrollViewport.ts +74 -0
- package/hooks/useViewportEnvironment.ts +350 -0
- package/package.json +3 -2
- package/shortcuts/index.ts +3 -0
- package/shortcuts/plan-review/annotationMode.shortcuts.ts +91 -0
- package/shortcuts/plan-review/documentView.shortcuts.ts +26 -0
- package/shortcuts/plan-review/htmlAnnotate.shortcuts.ts +24 -0
- package/styles.css +1 -1
- package/theme.css +229 -0
- package/types.ts +34 -0
- package/utils/annotateAgentTerminal.ts +36 -5
- package/utils/blockTargeting.ts +6 -3
- package/utils/composerYield.ts +45 -0
- package/utils/htmlChrome.ts +20 -16
- package/utils/lookAndFeelAnnouncement.ts +12 -8
- package/utils/markdownExtensions.ts +57 -0
- package/utils/parser.ts +37 -2
- package/utils/vimNavigation.ts +4 -1
- package/utils/vimScroll.ts +9 -4
- package/utils/wideMode.ts +20 -0
- package/components/PlanAIAnnouncementDialog.tsx +0 -187
- package/components/VimModeAnnouncementDialog.tsx +0 -557
- package/utils/planAIAnnouncement.ts +0 -17
- package/utils/vimModeAnnouncement.ts +0 -23
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineShortcutScope } from '../core';
|
|
2
|
+
import {
|
|
3
|
+
useShortcutScope,
|
|
4
|
+
type ShortcutHandlers,
|
|
5
|
+
type UseShortcutScopeOptions,
|
|
6
|
+
} from '../runtime';
|
|
7
|
+
|
|
8
|
+
// Shift+digit rather than mnemonic letters: bare letters are swallowed by
|
|
9
|
+
// type-to-comment, bare digits by the label picker, Mod+digit by the browser's
|
|
10
|
+
// tab switching, and Mod+Shift+3/4 by macOS screenshots. Follows the toolstrip
|
|
11
|
+
// left to right.
|
|
12
|
+
export const annotationModeShortcuts = defineShortcutScope({
|
|
13
|
+
id: 'annotation-mode',
|
|
14
|
+
title: 'Annotation Mode',
|
|
15
|
+
shortcuts: {
|
|
16
|
+
selectMarkupMode: {
|
|
17
|
+
description: 'Markup mode',
|
|
18
|
+
bindings: ['Shift+1'],
|
|
19
|
+
section: 'Annotations',
|
|
20
|
+
hint: 'Selecting text opens the annotation toolbar.',
|
|
21
|
+
preventDefault: true,
|
|
22
|
+
displayOrder: 1,
|
|
23
|
+
},
|
|
24
|
+
selectCommentMode: {
|
|
25
|
+
description: 'Comment mode',
|
|
26
|
+
bindings: ['Shift+2'],
|
|
27
|
+
section: 'Annotations',
|
|
28
|
+
hint: 'Selecting text opens the comment editor.',
|
|
29
|
+
preventDefault: true,
|
|
30
|
+
displayOrder: 2,
|
|
31
|
+
},
|
|
32
|
+
selectRedlineMode: {
|
|
33
|
+
description: 'Redline mode',
|
|
34
|
+
bindings: ['Shift+3'],
|
|
35
|
+
section: 'Annotations',
|
|
36
|
+
hint: 'Selecting text marks it for deletion.',
|
|
37
|
+
preventDefault: true,
|
|
38
|
+
displayOrder: 3,
|
|
39
|
+
},
|
|
40
|
+
selectQuickLabelMode: {
|
|
41
|
+
description: 'Label mode',
|
|
42
|
+
bindings: ['Shift+4'],
|
|
43
|
+
section: 'Annotations',
|
|
44
|
+
hint: 'Selecting text opens the quick label picker.',
|
|
45
|
+
preventDefault: true,
|
|
46
|
+
displayOrder: 4,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// --- Type-to-comment capture guard (#1244 follow-up) ---
|
|
52
|
+
// Shift+1..4 produce printable characters (! @ # $). While a surface's
|
|
53
|
+
// type-to-comment listener owns printable keys (a selection exists and the
|
|
54
|
+
// annotation toolbar is open), those characters belong to the comment being
|
|
55
|
+
// started: a mode shortcut firing there both eats the character and silently
|
|
56
|
+
// re-arms the mode (Shift+3 arming Redline mid-thought). The toolbar
|
|
57
|
+
// registers its capture here; the scope hook refuses to dispatch while any
|
|
58
|
+
// capture is held.
|
|
59
|
+
let typeToCommentCaptures = 0;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Held by AnnotationToolbar for the lifetime of its type-to-comment keydown
|
|
63
|
+
* listener. Returns a release function; releasing more than once is safe.
|
|
64
|
+
*/
|
|
65
|
+
export function acquireTypeToCommentCapture(): () => void {
|
|
66
|
+
typeToCommentCaptures += 1;
|
|
67
|
+
let released = false;
|
|
68
|
+
return () => {
|
|
69
|
+
if (released) return;
|
|
70
|
+
released = true;
|
|
71
|
+
typeToCommentCaptures -= 1;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type AnnotationModeScope = typeof annotationModeShortcuts;
|
|
76
|
+
type AnnotationModeOptions = Omit<UseShortcutScopeOptions<AnnotationModeScope>, 'scope'>;
|
|
77
|
+
|
|
78
|
+
export function useAnnotationModeShortcuts(options: AnnotationModeOptions): void {
|
|
79
|
+
const guarded: ShortcutHandlers<AnnotationModeScope> = {};
|
|
80
|
+
for (const actionId of Object.keys(options.handlers) as Array<keyof typeof options.handlers>) {
|
|
81
|
+
const handler = options.handlers[actionId];
|
|
82
|
+
if (!handler) continue;
|
|
83
|
+
const config = typeof handler === 'function' ? { handle: handler } : handler;
|
|
84
|
+
guarded[actionId] = {
|
|
85
|
+
...config,
|
|
86
|
+
when: (event: KeyboardEvent) =>
|
|
87
|
+
typeToCommentCaptures === 0 && (config.when ? config.when(event) : true),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
useShortcutScope({ scope: annotationModeShortcuts, ...options, handlers: guarded });
|
|
91
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineShortcutScope } from '../core';
|
|
2
|
+
import { createShortcutScopeHook } from '../runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Document-chrome view commands shared by plan review and annotate mode.
|
|
6
|
+
*
|
|
7
|
+
* Focus mode is the keyboard entry point to the same view state the document
|
|
8
|
+
* card's `Focus` control drives: both side panels collapse in one press and the
|
|
9
|
+
* previous arrangement comes back on the next one.
|
|
10
|
+
*/
|
|
11
|
+
export const documentViewShortcuts = defineShortcutScope({
|
|
12
|
+
id: 'document-view',
|
|
13
|
+
title: 'Document View',
|
|
14
|
+
shortcuts: {
|
|
15
|
+
toggleFocusMode: {
|
|
16
|
+
description: 'Toggle focus mode',
|
|
17
|
+
bindings: ['Mod+.'],
|
|
18
|
+
section: 'View',
|
|
19
|
+
hint: 'Collapses the Contents sidebar and the right-hand panel together; press again to restore whatever was open before.',
|
|
20
|
+
displayOrder: 10,
|
|
21
|
+
preventDefault: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const useDocumentViewShortcuts = createShortcutScopeHook(documentViewShortcuts);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineShortcutScope } from '../core';
|
|
2
|
+
import { createShortcutScopeHook } from '../runtime';
|
|
3
|
+
|
|
4
|
+
// Interact/Annotate toggle for HTML and live-app annotate surfaces. The same
|
|
5
|
+
// chord is mirrored inside the sandboxed iframe by the bridge (focus usually
|
|
6
|
+
// lives in there on live apps) and forwarded to the parent, so it works
|
|
7
|
+
// regardless of which document owns the keyboard. No bare-letter binding:
|
|
8
|
+
// bare letters belong to type-to-comment and the page itself.
|
|
9
|
+
export const htmlAnnotateShortcuts = defineShortcutScope({
|
|
10
|
+
id: 'html-annotate',
|
|
11
|
+
title: 'HTML Annotate',
|
|
12
|
+
shortcuts: {
|
|
13
|
+
toggleAnnotateMode: {
|
|
14
|
+
description: 'Toggle Interact / Annotate',
|
|
15
|
+
bindings: ['Mod+Shift+A'],
|
|
16
|
+
section: 'Annotations',
|
|
17
|
+
hint: 'On HTML and live app surfaces: arm annotation capture, or hand clicks back to the page. Esc also exits Annotate.',
|
|
18
|
+
preventDefault: true,
|
|
19
|
+
displayOrder: 0,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const useHtmlAnnotateShortcuts = createShortcutScopeHook(htmlAnnotateShortcuts);
|