@plannotator/ui 0.28.0 → 0.29.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 +6 -0
- package/components/AISettingsTab.tsx +5 -4
- package/components/ActionMenu.tsx +5 -1
- package/components/AgentsTab.tsx +10 -23
- package/components/AnnotationPanel.tsx +9 -5
- package/components/AnnotationToolbar.tsx +5 -13
- package/components/AnnotationToolstrip.tsx +2 -2
- package/components/ApproveDropdown.tsx +1 -1
- package/components/BlockRenderer.tsx +1 -1
- package/components/CodeFilePopout.tsx +5 -4
- package/components/CommentPopover.tsx +391 -65
- package/components/DocBadges.tsx +29 -11
- package/components/ExportModal.tsx +16 -8
- package/components/GraphvizBlock.tsx +1 -1
- package/components/InlineMarkdown.tsx +30 -13
- package/components/KeyboardShortcuts.tsx +37 -2
- package/components/Landing.tsx +7 -7
- package/components/MenuVersionSection.tsx +4 -4
- package/components/MermaidBlock.tsx +1 -1
- package/components/ModeToggle.tsx +7 -6
- package/components/OpenInAppButton.tsx +2 -5
- package/components/PinpointOverlay.tsx +9 -7
- package/components/PlanHeaderMenu.tsx +8 -8
- package/components/PopoutDialog.tsx +6 -1
- package/components/ResizeHandle.tsx +1 -0
- package/components/Settings.tsx +172 -12
- package/components/SkillReferenceMenu.tsx +260 -0
- package/components/StickyHeaderLane.tsx +7 -0
- package/components/ThemeProvider.tsx +131 -32
- package/components/ThemeTab.tsx +123 -77
- package/components/ToolbarButtons.tsx +29 -8
- package/components/Viewer.tsx +396 -130
- package/components/VimKeyHud.tsx +695 -0
- package/components/VimModeAnnouncementDialog.tsx +557 -0
- package/components/VimModeOverlay.tsx +235 -0
- package/components/VimTargetReticle.tsx +284 -0
- package/components/ai/DocumentAIChatPanel.tsx +1 -1
- package/components/blocks/CodeBlock.tsx +18 -18
- package/components/blocks/TablePopout.tsx +7 -8
- package/components/blocks/TableToolbar.tsx +7 -8
- package/components/goal-setup/GoalSetupSurface.tsx +16 -3
- package/components/html-viewer/HtmlViewer.tsx +450 -47
- package/components/html-viewer/annotationNumbering.ts +37 -0
- package/components/html-viewer/bridge-script.ts +4051 -298
- package/components/html-viewer/composerYield.ts +51 -0
- package/components/html-viewer/srcdoc.ts +18 -3
- package/components/html-viewer/useHtmlAnnotation.ts +457 -32
- package/components/icons/themeIcons.tsx +1 -1
- package/components/plan-diff/PlanCleanDiffView.tsx +9 -9
- package/components/plan-diff/PlanDiffBadge.tsx +22 -1
- package/components/settings/HooksTab.tsx +12 -8
- package/components/sidebar/FileBrowser.tsx +4 -1
- package/components/themeModes.tsx +28 -0
- package/config/configStore.ts +76 -1
- package/config/settings.ts +152 -0
- package/configure.ts +9 -0
- package/globals.d.ts +7 -1
- package/hooks/useAIChat.ts +5 -2
- package/hooks/useAIProviderActivation.ts +47 -0
- package/hooks/useAIProviderConfig.ts +5 -1
- package/hooks/useAgentSettings.ts +64 -23
- package/hooks/useAgents.ts +4 -4
- package/hooks/useAnnotationHighlighter.ts +100 -3
- package/hooks/useArchive.ts +2 -1
- package/hooks/useFenceTheme.ts +17 -0
- package/hooks/useLinkedDoc.ts +68 -1
- package/hooks/usePinpoint.ts +76 -75
- package/hooks/usePlanDiff.ts +73 -2
- package/hooks/useSkillReferenceAutocomplete.ts +239 -0
- package/hooks/useUpdateCheck.ts +1 -2
- package/hooks/useVimDocumentFocus.ts +116 -0
- package/hooks/useVimSelection.ts +1063 -0
- package/package.json +4 -4
- package/print.css +14 -13
- package/shortcuts/core.ts +38 -13
- package/shortcuts/index.ts +10 -0
- package/shortcuts/plan-review/commentPopover.shortcuts.ts +7 -0
- package/shortcuts/plan-review/vimSelection.shortcuts.ts +251 -0
- package/shortcuts/runtime.ts +111 -12
- package/styles.css +1 -1
- package/theme.css +504 -0
- package/themes/colorblind.css +89 -0
- package/themes/plannotator.css +2 -2
- package/types.ts +93 -10
- package/utils/agentSwitch.ts +33 -7
- package/utils/blockTargeting.ts +462 -178
- package/utils/clipboard.ts +110 -0
- package/utils/codeBlockMark.ts +50 -0
- package/utils/codeHighlight.ts +293 -0
- package/utils/codexModels.ts +79 -0
- package/utils/domSelection.ts +84 -0
- package/utils/htmlChrome.ts +73 -0
- package/utils/inputMethod.ts +79 -6
- package/utils/parser.ts +517 -21
- package/utils/preferenceTtl.ts +15 -0
- package/utils/sharing.ts +0 -1
- package/utils/skillCatalog.ts +269 -0
- package/utils/skillReferences.ts +475 -0
- package/utils/syntaxTheme.ts +83 -0
- package/utils/themeRegistry.ts +154 -0
- package/utils/vimHud.ts +263 -0
- package/utils/vimModeAnnouncement.ts +23 -0
- package/utils/vimNavigation.ts +417 -0
- package/utils/vimReticle.ts +88 -0
- package/utils/vimScroll.ts +162 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Annotation } from "../../types";
|
|
2
|
+
import { AnnotationType } from "../../types";
|
|
3
|
+
|
|
4
|
+
/** Mirror of the bridge's MAX_SYNC_ANNOTATIONS: the bridge truncates the
|
|
5
|
+
* synced numbering list at this many ENTRIES, so the sender ships at most
|
|
6
|
+
* this many (after globals are dropped) and both sides keep the same set.
|
|
7
|
+
* Numbers themselves are array positions and may exceed this value; the
|
|
8
|
+
* bridge's own number bound (100000) accepts them. */
|
|
9
|
+
export const MAX_SYNC_ANNOTATIONS = 512;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Placed-marker numbers for the bridge sync, derived from the SAME effective
|
|
13
|
+
* ordering `exportAnnotations` (packages/ui/utils/parser.ts) numbers the
|
|
14
|
+
* submitted feedback with. exportAnnotations sorts by (block index, start
|
|
15
|
+
* offset) and every raw-HTML annotation ties on both keys (blockId "",
|
|
16
|
+
* startOffset 0) — including externally submitted ones, whose server-stamped
|
|
17
|
+
* createdA can interleave arbitrarily with local timestamps — so its stable
|
|
18
|
+
* sort numbers the list in ARRAY order. Numbering here is therefore by array
|
|
19
|
+
* position of the input (the combined [...local, ...external] list the App
|
|
20
|
+
* feeds both consumers), never by createdA: an on-page "Comment 3" must read
|
|
21
|
+
* `## 3.` in the feedback the agent receives.
|
|
22
|
+
*
|
|
23
|
+
* Global comments occupy a number (they get their own `## N.` section in the
|
|
24
|
+
* feedback) but ship no sync entry — they have no page location — so the
|
|
25
|
+
* on-page numbers show gaps where globals sit. The entry cap applies AFTER
|
|
26
|
+
* globals are dropped, so globals never waste sync capacity and a non-global
|
|
27
|
+
* the export numbers past position 512 still syncs while slots remain.
|
|
28
|
+
*/
|
|
29
|
+
export function buildSyncNumbering(
|
|
30
|
+
annotations: readonly Annotation[],
|
|
31
|
+
): Array<{ id: string; number: number }> {
|
|
32
|
+
return annotations
|
|
33
|
+
.map((ann, index) => ({ ann, number: index + 1 }))
|
|
34
|
+
.filter(({ ann }) => ann.type !== AnnotationType.GLOBAL_COMMENT)
|
|
35
|
+
.slice(0, MAX_SYNC_ANNOTATIONS)
|
|
36
|
+
.map(({ ann, number }) => ({ id: ann.id, number }));
|
|
37
|
+
}
|