cursedbelt 5.40.0 → 5.45.1
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/dist/react/Toast.d.ts +12 -2
- package/dist/react/Toast.d.ts.map +1 -1
- package/dist/react/Toast.js +32 -3
- package/dist/react/Toast.js.map +1 -1
- package/dist/react/analytics/MetricDrilldown.js +1 -1
- package/dist/react/canvas-hud/CanvasMinimap.d.ts +32 -0
- package/dist/react/canvas-hud/CanvasMinimap.d.ts.map +1 -0
- package/dist/react/canvas-hud/CanvasMinimap.js +32 -0
- package/dist/react/canvas-hud/CanvasMinimap.js.map +1 -0
- package/dist/react/canvas-hud/CanvasNodeMenu.d.ts +34 -0
- package/dist/react/canvas-hud/CanvasNodeMenu.d.ts.map +1 -0
- package/dist/react/canvas-hud/CanvasNodeMenu.js +21 -0
- package/dist/react/canvas-hud/CanvasNodeMenu.js.map +1 -0
- package/dist/react/canvas-hud/CanvasSearchField.d.ts +27 -0
- package/dist/react/canvas-hud/CanvasSearchField.d.ts.map +1 -0
- package/dist/react/canvas-hud/CanvasSearchField.js +35 -0
- package/dist/react/canvas-hud/CanvasSearchField.js.map +1 -0
- package/dist/react/canvas-hud/HudControls.d.ts +43 -0
- package/dist/react/canvas-hud/HudControls.d.ts.map +1 -0
- package/dist/react/canvas-hud/HudControls.js +22 -0
- package/dist/react/canvas-hud/HudControls.js.map +1 -0
- package/dist/react/canvas-hud/index.d.ts +13 -0
- package/dist/react/canvas-hud/index.d.ts.map +1 -0
- package/dist/react/canvas-hud/index.js +7 -0
- package/dist/react/canvas-hud/index.js.map +1 -0
- package/dist/react/canvas-hud/useCanvasWheel.d.ts +41 -0
- package/dist/react/canvas-hud/useCanvasWheel.d.ts.map +1 -0
- package/dist/react/canvas-hud/useCanvasWheel.js +65 -0
- package/dist/react/canvas-hud/useCanvasWheel.js.map +1 -0
- package/dist/react/canvas-hud/viewport.d.ts +68 -0
- package/dist/react/canvas-hud/viewport.d.ts.map +1 -0
- package/dist/react/canvas-hud/viewport.js +77 -0
- package/dist/react/canvas-hud/viewport.js.map +1 -0
- package/dist/react/charts/AreaChart.d.ts.map +1 -1
- package/dist/react/charts/AreaChart.js +5 -5
- package/dist/react/charts/AreaChart.js.map +1 -1
- package/dist/react/charts/BarChart.d.ts.map +1 -1
- package/dist/react/charts/BarChart.js +3 -3
- package/dist/react/charts/BarChart.js.map +1 -1
- package/dist/react/charts/ChartCard.d.ts +53 -0
- package/dist/react/charts/ChartCard.d.ts.map +1 -0
- package/dist/react/charts/ChartCard.js +46 -0
- package/dist/react/charts/ChartCard.js.map +1 -0
- package/dist/react/charts/ChartFrame.d.ts +12 -5
- package/dist/react/charts/ChartFrame.d.ts.map +1 -1
- package/dist/react/charts/ChartFrame.js +12 -5
- package/dist/react/charts/ChartFrame.js.map +1 -1
- package/dist/react/charts/ChartLegend.js +1 -1
- package/dist/react/charts/ChartLegend.js.map +1 -1
- package/dist/react/charts/HeatmapChart.js +3 -3
- package/dist/react/charts/HeatmapChart.js.map +1 -1
- package/dist/react/charts/IntervalTimeline.js +1 -1
- package/dist/react/charts/IntervalTimeline.js.map +1 -1
- package/dist/react/charts/LineChart.d.ts.map +1 -1
- package/dist/react/charts/LineChart.js +3 -3
- package/dist/react/charts/LineChart.js.map +1 -1
- package/dist/react/charts/TimeSeriesChart.d.ts.map +1 -1
- package/dist/react/charts/TimeSeriesChart.js +6 -6
- package/dist/react/charts/TimeSeriesChart.js.map +1 -1
- package/dist/react/charts/chartBox.d.ts +46 -0
- package/dist/react/charts/chartBox.d.ts.map +1 -0
- package/dist/react/charts/chartBox.js +45 -0
- package/dist/react/charts/chartBox.js.map +1 -0
- package/dist/react/charts/index.d.ts +2 -0
- package/dist/react/charts/index.d.ts.map +1 -1
- package/dist/react/charts/index.js +2 -0
- package/dist/react/charts/index.js.map +1 -1
- package/dist/react/charts/shared.d.ts +13 -2
- package/dist/react/charts/shared.d.ts.map +1 -1
- package/dist/react/charts/shared.js +14 -3
- package/dist/react/charts/shared.js.map +1 -1
- package/dist/react/chat/Bubble.js +4 -4
- package/dist/react/chat/Bubble.js.map +1 -1
- package/dist/react/chat/MessageScroller.js +1 -1
- package/dist/react/chat/MessageScroller.js.map +1 -1
- package/dist/react/components/ActionBar.d.ts.map +1 -1
- package/dist/react/components/ActionBar.js +63 -1
- package/dist/react/components/ActionBar.js.map +1 -1
- package/dist/react/components/AddItemsMenu.js +1 -1
- package/dist/react/components/AddItemsMenu.js.map +1 -1
- package/dist/react/components/Alert.d.ts +16 -2
- package/dist/react/components/Alert.d.ts.map +1 -1
- package/dist/react/components/Alert.js +35 -2
- package/dist/react/components/Alert.js.map +1 -1
- package/dist/react/components/AppShell.d.ts +55 -33
- package/dist/react/components/AppShell.d.ts.map +1 -1
- package/dist/react/components/AppShell.js +141 -31
- package/dist/react/components/AppShell.js.map +1 -1
- package/dist/react/components/AsyncPanel.d.ts +21 -3
- package/dist/react/components/AsyncPanel.d.ts.map +1 -1
- package/dist/react/components/AsyncPanel.js +50 -6
- package/dist/react/components/AsyncPanel.js.map +1 -1
- package/dist/react/components/BannerLane.d.ts +32 -0
- package/dist/react/components/BannerLane.d.ts.map +1 -0
- package/dist/react/components/BannerLane.js +41 -0
- package/dist/react/components/BannerLane.js.map +1 -0
- package/dist/react/components/Button.d.ts.map +1 -1
- package/dist/react/components/Button.js +2 -1
- package/dist/react/components/Button.js.map +1 -1
- package/dist/react/components/Checkbox.d.ts.map +1 -1
- package/dist/react/components/Checkbox.js +7 -2
- package/dist/react/components/Checkbox.js.map +1 -1
- package/dist/react/components/ChipFilterStrip.js +1 -1
- package/dist/react/components/ChipFilterStrip.js.map +1 -1
- package/dist/react/components/ComboboxField.d.ts.map +1 -1
- package/dist/react/components/ComboboxField.js +14 -4
- package/dist/react/components/ComboboxField.js.map +1 -1
- package/dist/react/components/CommentThread.js +2 -2
- package/dist/react/components/CommentThread.js.map +1 -1
- package/dist/react/components/ConfirmDialog.js +1 -1
- package/dist/react/components/ConfirmDialog.js.map +1 -1
- package/dist/react/components/DataTable/DataTable.d.ts +18 -2
- package/dist/react/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/react/components/DataTable/DataTable.js +51 -12
- package/dist/react/components/DataTable/DataTable.js.map +1 -1
- package/dist/react/components/DataTable/Pagination.js +1 -1
- package/dist/react/components/DataTable/Pagination.js.map +1 -1
- package/dist/react/components/DataTable/RowActions.d.ts +7 -1
- package/dist/react/components/DataTable/RowActions.d.ts.map +1 -1
- package/dist/react/components/DataTable/RowActions.js +10 -3
- package/dist/react/components/DataTable/RowActions.js.map +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.js +1 -1
- package/dist/react/components/DataTable/TableFilterBuilder.js.map +1 -1
- package/dist/react/components/DataTable/cells/CodeCell.js +1 -1
- package/dist/react/components/DataTable/cells/CodeCell.js.map +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.js +1 -1
- package/dist/react/components/DataTable/cells/LinkCell.js.map +1 -1
- package/dist/react/components/DataTable/index.d.ts +1 -1
- package/dist/react/components/DataTable/index.d.ts.map +1 -1
- package/dist/react/components/DataTable/index.js.map +1 -1
- package/dist/react/components/DataTable/types.d.ts +20 -0
- package/dist/react/components/DataTable/types.d.ts.map +1 -1
- package/dist/react/components/DataTable/types.js +22 -0
- package/dist/react/components/DataTable/types.js.map +1 -1
- package/dist/react/components/DateTimeField.d.ts.map +1 -1
- package/dist/react/components/DateTimeField.js +4 -1
- package/dist/react/components/DateTimeField.js.map +1 -1
- package/dist/react/components/DeleteButton.js +2 -0
- package/dist/react/components/DeleteButton.js.map +1 -1
- package/dist/react/components/Drawer.js +3 -3
- package/dist/react/components/Drawer.js.map +1 -1
- package/dist/react/components/DropdownMenu.d.ts +16 -0
- package/dist/react/components/DropdownMenu.d.ts.map +1 -1
- package/dist/react/components/DropdownMenu.js +22 -6
- package/dist/react/components/DropdownMenu.js.map +1 -1
- package/dist/react/components/EmptyState.d.ts +10 -2
- package/dist/react/components/EmptyState.d.ts.map +1 -1
- package/dist/react/components/EmptyState.js +10 -5
- package/dist/react/components/EmptyState.js.map +1 -1
- package/dist/react/components/EventTimeline.js +1 -1
- package/dist/react/components/EventTimeline.js.map +1 -1
- package/dist/react/components/Field.d.ts.map +1 -1
- package/dist/react/components/Field.js +4 -1
- package/dist/react/components/Field.js.map +1 -1
- package/dist/react/components/FileDropZone.js +1 -1
- package/dist/react/components/FileDropZone.js.map +1 -1
- package/dist/react/components/Grid.d.ts +9 -1
- package/dist/react/components/Grid.d.ts.map +1 -1
- package/dist/react/components/Grid.js +20 -2
- package/dist/react/components/Grid.js.map +1 -1
- package/dist/react/components/Guide.d.ts +31 -0
- package/dist/react/components/Guide.d.ts.map +1 -0
- package/dist/react/components/Guide.js +18 -0
- package/dist/react/components/Guide.js.map +1 -0
- package/dist/react/components/InfoHintImpl.d.ts +0 -13
- package/dist/react/components/InfoHintImpl.d.ts.map +1 -1
- package/dist/react/components/InfoHintImpl.js +17 -1
- package/dist/react/components/InfoHintImpl.js.map +1 -1
- package/dist/react/components/InlineEditableText.js +1 -1
- package/dist/react/components/InlineEditableText.js.map +1 -1
- package/dist/react/components/IsolatedFrame.js +1 -1
- package/dist/react/components/IsolatedFrame.js.map +1 -1
- package/dist/react/components/ListToolbar.d.ts.map +1 -1
- package/dist/react/components/ListToolbar.js +2 -2
- package/dist/react/components/ListToolbar.js.map +1 -1
- package/dist/react/components/LogViewer.d.ts +26 -2
- package/dist/react/components/LogViewer.d.ts.map +1 -1
- package/dist/react/components/LogViewer.js +41 -26
- package/dist/react/components/LogViewer.js.map +1 -1
- package/dist/react/components/Modal.d.ts +5 -1
- package/dist/react/components/Modal.d.ts.map +1 -1
- package/dist/react/components/Modal.js +18 -8
- package/dist/react/components/Modal.js.map +1 -1
- package/dist/react/components/Page.d.ts +51 -7
- package/dist/react/components/Page.d.ts.map +1 -1
- package/dist/react/components/Page.js +53 -8
- package/dist/react/components/Page.js.map +1 -1
- package/dist/react/components/PageGuideButton.d.ts +11 -0
- package/dist/react/components/PageGuideButton.d.ts.map +1 -0
- package/dist/react/components/PageGuideButton.js +52 -0
- package/dist/react/components/PageGuideButton.js.map +1 -0
- package/dist/react/components/PageGuidePopover.d.ts +14 -0
- package/dist/react/components/PageGuidePopover.d.ts.map +1 -0
- package/dist/react/components/PageGuidePopover.js +25 -0
- package/dist/react/components/PageGuidePopover.js.map +1 -0
- package/dist/react/components/PanelSeparator.js +1 -1
- package/dist/react/components/PanelSeparator.js.map +1 -1
- package/dist/react/components/Popover.d.ts.map +1 -1
- package/dist/react/components/Popover.js +2 -1
- package/dist/react/components/Popover.js.map +1 -1
- package/dist/react/components/PromptDialog.js +1 -1
- package/dist/react/components/PromptDialog.js.map +1 -1
- package/dist/react/components/ScrollArea.d.ts +9 -1
- package/dist/react/components/ScrollArea.d.ts.map +1 -1
- package/dist/react/components/ScrollArea.js +9 -3
- package/dist/react/components/ScrollArea.js.map +1 -1
- package/dist/react/components/Section.d.ts +5 -2
- package/dist/react/components/Section.d.ts.map +1 -1
- package/dist/react/components/Section.js +5 -2
- package/dist/react/components/Section.js.map +1 -1
- package/dist/react/components/Skeleton.d.ts +19 -1
- package/dist/react/components/Skeleton.d.ts.map +1 -1
- package/dist/react/components/Skeleton.js +24 -2
- package/dist/react/components/Skeleton.js.map +1 -1
- package/dist/react/components/StatStrip.js +1 -1
- package/dist/react/components/StatStrip.js.map +1 -1
- package/dist/react/components/StatTile.d.ts +30 -3
- package/dist/react/components/StatTile.d.ts.map +1 -1
- package/dist/react/components/StatTile.js +35 -9
- package/dist/react/components/StatTile.js.map +1 -1
- package/dist/react/components/StatTileGrid.d.ts +10 -1
- package/dist/react/components/StatTileGrid.d.ts.map +1 -1
- package/dist/react/components/StatTileGrid.js +50 -33
- package/dist/react/components/StatTileGrid.js.map +1 -1
- package/dist/react/components/StatusPill.d.ts.map +1 -1
- package/dist/react/components/StatusPill.js +26 -1
- package/dist/react/components/StatusPill.js.map +1 -1
- package/dist/react/components/Surface.d.ts +1 -1
- package/dist/react/components/Surface.d.ts.map +1 -1
- package/dist/react/components/Surface.js +20 -11
- package/dist/react/components/Surface.js.map +1 -1
- package/dist/react/components/SwatchPicker.d.ts.map +1 -1
- package/dist/react/components/SwatchPicker.js +5 -1
- package/dist/react/components/SwatchPicker.js.map +1 -1
- package/dist/react/components/Switch.js +1 -1
- package/dist/react/components/Switch.js.map +1 -1
- package/dist/react/components/TagsInput.d.ts.map +1 -1
- package/dist/react/components/TagsInput.js +3 -1
- package/dist/react/components/TagsInput.js.map +1 -1
- package/dist/react/components/WidgetHeader.js +1 -1
- package/dist/react/components/WidgetHeader.js.map +1 -1
- package/dist/react/components/calendar/CalendarLegend.js +1 -1
- package/dist/react/components/calendar/CalendarLegend.js.map +1 -1
- package/dist/react/components/calendar/DayAgenda.js +1 -1
- package/dist/react/components/calendar/DayAgenda.js.map +1 -1
- package/dist/react/components/calendar/EventChip.js +1 -1
- package/dist/react/components/calendar/EventChip.js.map +1 -1
- package/dist/react/components/calendar/MonthGrid.js +1 -1
- package/dist/react/components/calendar/MonthGrid.js.map +1 -1
- package/dist/react/components/calendar/WeekView.js +2 -2
- package/dist/react/components/calendar/WeekView.js.map +1 -1
- package/dist/react/components/cardFrame.d.ts +16 -0
- package/dist/react/components/cardFrame.d.ts.map +1 -0
- package/dist/react/components/cardFrame.js +24 -0
- package/dist/react/components/cardFrame.js.map +1 -0
- package/dist/react/components/dialog.d.ts.map +1 -1
- package/dist/react/components/dialog.js +2 -1
- package/dist/react/components/dialog.js.map +1 -1
- package/dist/react/dashboard-grid/WidgetFrame.js +2 -2
- package/dist/react/dashboard-grid/WidgetFrame.js.map +1 -1
- package/dist/react/emoji/EmojiPicker.js +1 -1
- package/dist/react/emoji/EmojiPicker.js.map +1 -1
- package/dist/react/file-tree/FileTree.d.ts +8 -1
- package/dist/react/file-tree/FileTree.d.ts.map +1 -1
- package/dist/react/file-tree/FileTree.js +29 -4
- package/dist/react/file-tree/FileTree.js.map +1 -1
- package/dist/react/filter-rail/FilterRail.js +1 -1
- package/dist/react/filter-rail/FilterRail.js.map +1 -1
- package/dist/react/folder-tree/FolderPicker.d.ts.map +1 -1
- package/dist/react/folder-tree/FolderPicker.js +5 -1
- package/dist/react/folder-tree/FolderPicker.js.map +1 -1
- package/dist/react/icons.d.ts +28 -0
- package/dist/react/icons.d.ts.map +1 -1
- package/dist/react/icons.js +29 -1
- package/dist/react/icons.js.map +1 -1
- package/dist/react/index.d.ts +9 -6
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +6 -3
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/menuSections.d.ts +8 -0
- package/dist/react/lib/menuSections.d.ts.map +1 -0
- package/dist/react/lib/menuSections.js +37 -0
- package/dist/react/lib/menuSections.js.map +1 -0
- package/dist/react/lib/whenIdle.d.ts +7 -0
- package/dist/react/lib/whenIdle.d.ts.map +1 -0
- package/dist/react/lib/whenIdle.js +14 -0
- package/dist/react/lib/whenIdle.js.map +1 -0
- package/dist/react/markdown/Markdown.js +2 -2
- package/dist/react/markdown/Markdown.js.map +1 -1
- package/dist/react/media/DenseGalleryShell.d.ts +7 -1
- package/dist/react/media/DenseGalleryShell.d.ts.map +1 -1
- package/dist/react/media/DenseGalleryShell.js +3 -3
- package/dist/react/media/DenseGalleryShell.js.map +1 -1
- package/dist/react/media/HoverScrubVideoThumb.js +1 -1
- package/dist/react/media/HoverScrubVideoThumb.js.map +1 -1
- package/dist/react/media/MaskPainter.js +1 -1
- package/dist/react/media/MediaUploadControl.js +1 -1
- package/dist/react/media/MediaUploadControl.js.map +1 -1
- package/dist/react/media/VideoTrimmer.js +1 -1
- package/dist/react/media/VideoTrimmer.js.map +1 -1
- package/dist/react/media/denseGallery.css +96 -1
- package/dist/react/media-gallery/MediaGallery.d.ts +5 -2
- package/dist/react/media-gallery/MediaGallery.d.ts.map +1 -1
- package/dist/react/media-gallery/MediaGallery.js +1 -1
- package/dist/react/media-gallery/MediaGallery.js.map +1 -1
- package/dist/react/namespace/NamespaceTargetCapsule.js +1 -1
- package/dist/react/namespace/NamespaceTargetCapsule.js.map +1 -1
- package/dist/react/nav/BreadcrumbTrail.js +1 -1
- package/dist/react/nav/BreadcrumbTrail.js.map +1 -1
- package/dist/react/nav/CommandBar.d.ts +7 -1
- package/dist/react/nav/CommandBar.d.ts.map +1 -1
- package/dist/react/nav/CommandBar.js +5 -3
- package/dist/react/nav/CommandBar.js.map +1 -1
- package/dist/react/nav/PlaceBar.d.ts.map +1 -1
- package/dist/react/nav/PlaceBar.js +7 -9
- package/dist/react/nav/PlaceBar.js.map +1 -1
- package/dist/react/nav/SideNav.d.ts +12 -2
- package/dist/react/nav/SideNav.d.ts.map +1 -1
- package/dist/react/nav/SideNav.js +42 -22
- package/dist/react/nav/SideNav.js.map +1 -1
- package/dist/react/nav/TopBar.d.ts +65 -31
- package/dist/react/nav/TopBar.d.ts.map +1 -1
- package/dist/react/nav/TopBar.js +59 -24
- package/dist/react/nav/TopBar.js.map +1 -1
- package/dist/react/nav/index.d.ts +1 -1
- package/dist/react/nav/index.d.ts.map +1 -1
- package/dist/react/nav/index.js +1 -1
- package/dist/react/nav/index.js.map +1 -1
- package/dist/react/nav/navShared.d.ts +10 -1
- package/dist/react/nav/navShared.d.ts.map +1 -1
- package/dist/react/nav/navShared.js +23 -0
- package/dist/react/nav/navShared.js.map +1 -1
- package/dist/react/notifications/NotificationFeed.js +2 -2
- package/dist/react/notifications/NotificationFeed.js.map +1 -1
- package/dist/react/palette/Command.d.ts.map +1 -1
- package/dist/react/palette/Command.js +1 -1
- package/dist/react/palette/Command.js.map +1 -1
- package/dist/react/palette/CommandPalette.d.ts +13 -1
- package/dist/react/palette/CommandPalette.d.ts.map +1 -1
- package/dist/react/palette/CommandPalette.js +44 -8
- package/dist/react/palette/CommandPalette.js.map +1 -1
- package/dist/react/palette/commandSources.d.ts +57 -0
- package/dist/react/palette/commandSources.d.ts.map +1 -0
- package/dist/react/palette/commandSources.js +129 -0
- package/dist/react/palette/commandSources.js.map +1 -0
- package/dist/react/palette/index.d.ts +1 -0
- package/dist/react/palette/index.d.ts.map +1 -1
- package/dist/react/palette/index.js +1 -0
- package/dist/react/palette/index.js.map +1 -1
- package/dist/react/rich-text/RichTextEditor.js +1 -1
- package/dist/react/rich-text/RichTextEditor.js.map +1 -1
- package/dist/react/rich-text/RichTextToolbar.js +1 -1
- package/dist/react/rich-text/RichTextToolbar.js.map +1 -1
- package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
- package/dist/styles-areas/analytics.css +16 -16
- package/dist/styles-areas/auth.css +2 -2
- package/dist/styles-areas/calendar.css +5 -6
- package/dist/styles-areas/canvas-hud.css +30 -0
- package/dist/styles-areas/chart-table.css +1 -1
- package/dist/styles-areas/charts.css +3 -3
- package/dist/styles-areas/chat.css +7 -6
- package/dist/styles-areas/companion-link.css +2 -2
- package/dist/styles-areas/core.css +99 -90
- package/dist/styles-areas/dashboard-grid.css +4 -4
- package/dist/styles-areas/data-table.css +16 -16
- package/dist/styles-areas/disk-usage.css +5 -5
- package/dist/styles-areas/emoji.css +2 -2
- package/dist/styles-areas/fields.css +13 -14
- package/dist/styles-areas/filter-rail.css +4 -4
- package/dist/styles-areas/folder-tree.css +6 -6
- package/dist/styles-areas/layout-engine.css +4 -4
- package/dist/styles-areas/markdown.css +2 -1
- package/dist/styles-areas/master-detail.css +3 -3
- package/dist/styles-areas/media-gallery.css +7 -6
- package/dist/styles-areas/media.css +12 -13
- package/dist/styles-areas/nav.css +28 -14
- package/dist/styles-areas/notifications.css +4 -4
- package/dist/styles-areas/overlays.css +4 -4
- package/dist/styles-areas/palette.css +5 -4
- package/dist/styles-areas/rich-text.css +3 -3
- package/dist/styles-areas/sharing.css +4 -3
- package/dist/styles-areas/stats.css +9 -8
- package/dist/styles-areas/test-report.css +4 -4
- package/dist/styles-areas/wizard.css +6 -5
- package/dist/styles-areas/workbench.css +10 -9
- package/dist/styles-areas/workbook-viewer.css +2 -2
- package/dist/styles-utilities.css +296 -190
- package/dist/testing/designAudit.d.ts.map +1 -1
- package/dist/testing/designAudit.js +4 -0
- package/dist/testing/designAudit.js.map +1 -1
- package/dist/testing/designBaseline.d.ts.map +1 -1
- package/dist/testing/designBaseline.js +4 -0
- package/dist/testing/designBaseline.js.map +1 -1
- package/dist/theme.css +103 -2
- package/package.json +10 -2
- package/scripts/generateAreaStyles.ts +3 -1
- package/scripts/guardrails-baseline.json +2 -1
- package/scripts/guardrailsEnforce.spec.ts +64 -0
- package/scripts/guardrailsEnforce.ts +65 -8
- package/scripts/styleAreas.ts +89 -6
- package/src/bundlerOnlyEntries.spec.ts +25 -8
- package/src/nodeTypesDeclared.spec.ts +47 -0
- package/src/react/Toast.spec.tsx +43 -0
- package/src/react/Toast.tsx +45 -2
- package/src/react/analytics/MetricDrilldown.tsx +1 -1
- package/src/react/canvas-hud/CanvasMinimap.tsx +88 -0
- package/src/react/canvas-hud/CanvasNodeMenu.tsx +91 -0
- package/src/react/canvas-hud/CanvasSearchField.tsx +91 -0
- package/src/react/canvas-hud/HudControls.spec.tsx +160 -0
- package/src/react/canvas-hud/HudControls.tsx +128 -0
- package/src/react/canvas-hud/index.ts +33 -0
- package/src/react/canvas-hud/useCanvasWheel.ts +99 -0
- package/src/react/canvas-hud/viewport.spec.ts +105 -0
- package/src/react/canvas-hud/viewport.ts +124 -0
- package/src/react/charts/AreaChart.tsx +9 -8
- package/src/react/charts/BarChart.tsx +11 -10
- package/src/react/charts/ChartCard.tsx +146 -0
- package/src/react/charts/ChartFrame.tsx +28 -10
- package/src/react/charts/ChartLegend.tsx +1 -1
- package/src/react/charts/HeatmapChart.tsx +5 -5
- package/src/react/charts/IntervalTimeline.tsx +2 -2
- package/src/react/charts/LineChart.tsx +9 -8
- package/src/react/charts/TimeSeriesChart.tsx +11 -10
- package/src/react/charts/chartBox.spec.ts +40 -0
- package/src/react/charts/chartBox.ts +75 -0
- package/src/react/charts/index.ts +2 -0
- package/src/react/charts/shared.ts +16 -3
- package/src/react/chat/Bubble.tsx +5 -5
- package/src/react/chat/MessageScroller.tsx +1 -1
- package/src/react/components/ActionBar.spec.tsx +90 -0
- package/src/react/components/ActionBar.tsx +82 -2
- package/src/react/components/AddItemsMenu.tsx +1 -1
- package/src/react/components/Alert.spec.tsx +32 -2
- package/src/react/components/Alert.tsx +47 -3
- package/src/react/components/AppShell.spec.tsx +199 -13
- package/src/react/components/AppShell.tsx +254 -92
- package/src/react/components/AsyncPanel.spec.tsx +17 -1
- package/src/react/components/AsyncPanel.tsx +88 -6
- package/src/react/components/BannerLane.tsx +128 -0
- package/src/react/components/Button.tsx +2 -0
- package/src/react/components/Checkbox.spec.tsx +18 -0
- package/src/react/components/Checkbox.tsx +8 -5
- package/src/react/components/ChipFilterStrip.tsx +1 -1
- package/src/react/components/ComboboxField.tsx +20 -3
- package/src/react/components/CommentThread.tsx +2 -2
- package/src/react/components/ConfirmDialog.tsx +1 -1
- package/src/react/components/DataTable/DataTable.tsx +80 -8
- package/src/react/components/DataTable/Pagination.tsx +1 -1
- package/src/react/components/DataTable/RowActions.tsx +55 -2
- package/src/react/components/DataTable/TableFilterBuilder.tsx +1 -1
- package/src/react/components/DataTable/cells/CodeCell.tsx +1 -1
- package/src/react/components/DataTable/cells/LinkCell.tsx +1 -1
- package/src/react/components/DataTable/index.ts +1 -0
- package/src/react/components/DataTable/numericColumn.spec.ts +19 -0
- package/src/react/components/DataTable/types.ts +36 -0
- package/src/react/components/DateTimeField.tsx +3 -1
- package/src/react/components/DeleteButton.tsx +3 -0
- package/src/react/components/Drawer.tsx +3 -3
- package/src/react/components/DropdownMenu.spec.tsx +55 -0
- package/src/react/components/DropdownMenu.tsx +73 -20
- package/src/react/components/EmptyState.tsx +26 -7
- package/src/react/components/EventTimeline.tsx +1 -1
- package/src/react/components/Field.spec.tsx +3 -2
- package/src/react/components/Field.tsx +7 -4
- package/src/react/components/Field.width.spec.tsx +14 -3
- package/src/react/components/FileDropZone.tsx +1 -1
- package/src/react/components/Grid.spec.tsx +44 -0
- package/src/react/components/Grid.tsx +41 -11
- package/src/react/components/Guide.tsx +77 -0
- package/src/react/components/InfoHint.spec.tsx +21 -0
- package/src/react/components/InfoHintImpl.tsx +22 -1
- package/src/react/components/InlineEditableText.tsx +1 -1
- package/src/react/components/IsolatedFrame.tsx +1 -1
- package/src/react/components/ListToolbar.spec.tsx +12 -0
- package/src/react/components/ListToolbar.tsx +8 -5
- package/src/react/components/LogViewer.tsx +118 -18
- package/src/react/components/Modal.spec.tsx +17 -2
- package/src/react/components/Modal.tsx +25 -10
- package/src/react/components/MultiSelectField.spec.tsx +6 -0
- package/src/react/components/Page.spec.tsx +89 -5
- package/src/react/components/Page.tsx +100 -16
- package/src/react/components/PageGuideButton.spec.tsx +39 -0
- package/src/react/components/PageGuideButton.tsx +110 -0
- package/src/react/components/PageGuidePopover.tsx +52 -0
- package/src/react/components/PanelSeparator.tsx +1 -1
- package/src/react/components/Popover.tsx +3 -1
- package/src/react/components/PromptDialog.tsx +1 -1
- package/src/react/components/ScrollArea.spec.tsx +20 -0
- package/src/react/components/ScrollArea.tsx +19 -0
- package/src/react/components/Section.spec.tsx +82 -1
- package/src/react/components/Section.tsx +10 -4
- package/src/react/components/Skeleton.tsx +50 -2
- package/src/react/components/StatStrip.tsx +1 -1
- package/src/react/components/StatTile.tsx +84 -11
- package/src/react/components/StatTileGrid.spec.tsx +6 -1
- package/src/react/components/StatTileGrid.tsx +25 -0
- package/src/react/components/StatusPill.tsx +26 -1
- package/src/react/components/Surface.tsx +22 -14
- package/src/react/components/SwatchPicker.tsx +4 -0
- package/src/react/components/Switch.tsx +1 -1
- package/src/react/components/TagsInput.spec.tsx +8 -0
- package/src/react/components/TagsInput.tsx +3 -1
- package/src/react/components/WidgetHeader.tsx +1 -1
- package/src/react/components/calendar/CalendarLegend.tsx +1 -1
- package/src/react/components/calendar/DayAgenda.tsx +1 -1
- package/src/react/components/calendar/EventChip.tsx +1 -1
- package/src/react/components/calendar/MonthGrid.tsx +1 -1
- package/src/react/components/calendar/WeekView.tsx +2 -2
- package/src/react/components/cardFrame.ts +28 -0
- package/src/react/components/dataDisplay.spec.tsx +176 -0
- package/src/react/components/dialog.tsx +4 -1
- package/src/react/components/entryChunks.graph.spec.ts +89 -0
- package/src/react/dashboard-grid/WidgetFrame.tsx +2 -2
- package/src/react/emoji/EmojiPicker.tsx +1 -1
- package/src/react/file-tree/FileTree.spec.tsx +49 -0
- package/src/react/file-tree/FileTree.tsx +37 -4
- package/src/react/filter-rail/FilterRail.tsx +1 -1
- package/src/react/folder-tree/FolderPicker.spec.tsx +8 -0
- package/src/react/folder-tree/FolderPicker.tsx +4 -1
- package/src/react/icons.spec.ts +21 -1
- package/src/react/icons.tsx +136 -2
- package/src/react/index.ts +38 -3
- package/src/react/lib/menuSections.ts +33 -0
- package/src/react/lib/whenIdle.ts +13 -0
- package/src/react/markdown/Markdown.tsx +2 -2
- package/src/react/media/DenseGalleryShell.tsx +20 -4
- package/src/react/media/HoverScrubVideoThumb.tsx +2 -2
- package/src/react/media/MaskPainter.tsx +1 -1
- package/src/react/media/MediaUploadControl.tsx +1 -1
- package/src/react/media/VideoTrimmer.tsx +1 -1
- package/src/react/media/denseGallery.css +96 -1
- package/src/react/media-gallery/MediaGallery.spec.tsx +26 -0
- package/src/react/media-gallery/MediaGallery.tsx +10 -3
- package/src/react/namespace/NamespaceTargetCapsule.tsx +1 -1
- package/src/react/nav/BreadcrumbTrail.tsx +2 -2
- package/src/react/nav/CommandBar.tsx +14 -3
- package/src/react/nav/PlaceBar.tsx +18 -8
- package/src/react/nav/SideNav.tsx +99 -17
- package/src/react/nav/TopBar.spec.tsx +78 -21
- package/src/react/nav/TopBar.tsx +270 -98
- package/src/react/nav/index.ts +8 -1
- package/src/react/nav/nav.spec.tsx +46 -2
- package/src/react/nav/navShared.tsx +23 -2
- package/src/react/notifications/NotificationFeed.tsx +2 -2
- package/src/react/palette/Command.tsx +1 -1
- package/src/react/palette/CommandPalette.spec.tsx +31 -0
- package/src/react/palette/CommandPalette.tsx +108 -11
- package/src/react/palette/commandSources.tsx +186 -0
- package/src/react/palette/index.ts +7 -0
- package/src/react/rich-text/RichTextEditor.tsx +1 -1
- package/src/react/rich-text/RichTextToolbar.tsx +1 -1
- package/src/styles-areas/analytics.css +16 -16
- package/src/styles-areas/auth.css +2 -2
- package/src/styles-areas/calendar.css +5 -6
- package/src/styles-areas/canvas-hud.css +30 -0
- package/src/styles-areas/chart-table.css +1 -1
- package/src/styles-areas/charts.css +3 -3
- package/src/styles-areas/chat.css +7 -6
- package/src/styles-areas/companion-link.css +2 -2
- package/src/styles-areas/core.css +99 -90
- package/src/styles-areas/dashboard-grid.css +4 -4
- package/src/styles-areas/data-table.css +16 -16
- package/src/styles-areas/disk-usage.css +5 -5
- package/src/styles-areas/emoji.css +2 -2
- package/src/styles-areas/fields.css +13 -14
- package/src/styles-areas/filter-rail.css +4 -4
- package/src/styles-areas/folder-tree.css +6 -6
- package/src/styles-areas/layout-engine.css +4 -4
- package/src/styles-areas/markdown.css +2 -1
- package/src/styles-areas/master-detail.css +3 -3
- package/src/styles-areas/media-gallery.css +7 -6
- package/src/styles-areas/media.css +12 -13
- package/src/styles-areas/nav.css +28 -14
- package/src/styles-areas/notifications.css +4 -4
- package/src/styles-areas/overlays.css +4 -4
- package/src/styles-areas/palette.css +5 -4
- package/src/styles-areas/rich-text.css +3 -3
- package/src/styles-areas/sharing.css +4 -3
- package/src/styles-areas/stats.css +9 -8
- package/src/styles-areas/test-report.css +4 -4
- package/src/styles-areas/wizard.css +6 -5
- package/src/styles-areas/workbench.css +10 -9
- package/src/styles-areas/workbook-viewer.css +2 -2
- package/src/styles-utilities.css +296 -190
- package/src/stylesAreas.spec.ts +17 -0
- package/src/testing/designAudit.ts +3 -0
- package/src/testing/designBaseline.ts +4 -0
- package/src/theme.css +103 -2
- package/src/themeDarkScopeAliases.spec.ts +65 -0
package/dist/react/Toast.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { Toaster as SonnerToaster, toast } from 'sonner';
|
|
2
|
-
|
|
1
|
+
import { type ExternalToast, Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
|
|
2
|
+
type ToastMessage = Parameters<typeof sonnerToast.error>[0];
|
|
3
|
+
/**
|
|
4
|
+
* "Moved 3 files to trash" with an Undo — the shape OVL-9 asks every reversible action to take.
|
|
5
|
+
* `onUndo` runs when Undo is pressed; the toast stays for 6s, long enough to reach the button.
|
|
6
|
+
*/
|
|
7
|
+
declare function undoToast(message: ToastMessage, onUndo: () => void, data?: ExternalToast): string | number;
|
|
8
|
+
/** sonner's `toast`, with OVL-9's rules on `error` and an `undo` helper. */
|
|
9
|
+
export declare const toast: typeof sonnerToast & {
|
|
10
|
+
undo: typeof undoToast;
|
|
11
|
+
};
|
|
3
12
|
export type ToasterProps = React.ComponentProps<typeof SonnerToaster>;
|
|
4
13
|
export declare function Toaster({ style, ...props }: ToasterProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
5
15
|
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/react/Toast.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/react/Toast.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAE,OAAO,IAAI,aAAa,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAG5F,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAmB5D;;;GAGG;AACH,iBAAS,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,IAAI,CAAC,EAAE,aAAa,mBAEjF;AAED,4EAA4E;AAC5E,eAAO,MAAM,KAAK,EAAE,OAAO,WAAW,GAAG;IAAE,IAAI,EAAE,OAAO,SAAS,CAAA;CAIhE,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAwBtE,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BA2BxD"}
|
package/dist/react/Toast.js
CHANGED
|
@@ -12,8 +12,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
12
12
|
* light/dark exactly like every other primitive (no sonner `richColors` — that
|
|
13
13
|
* would inject sonner's own hardcoded palette instead of our tokens).
|
|
14
14
|
*/
|
|
15
|
-
import { Toaster as SonnerToaster, toast } from 'sonner';
|
|
16
|
-
|
|
15
|
+
import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
|
|
16
|
+
import { devWarnOnce } from './lib/devWarn.js';
|
|
17
|
+
/**
|
|
18
|
+
* OVL-9: a toast confirms what happened ("Moved to trash") and offers Undo; it never carries an
|
|
19
|
+
* error the reader must act on — that is an inline `Alert` where the problem is, because a toast
|
|
20
|
+
* leaves in four seconds and takes the problem with it. An error toast is allowed only with an
|
|
21
|
+
* `action` (Retry, Undo), so the error is something the toast itself lets you resolve.
|
|
22
|
+
*/
|
|
23
|
+
function errorToast(message, data) {
|
|
24
|
+
if (!data?.action) {
|
|
25
|
+
devWarnOnce('toast:error-without-action', 'cursedbelt: toast.error() with no `action` — an error the reader must act on belongs in an inline <Alert tone="error"> ' +
|
|
26
|
+
"where the problem is (OVL-9). Give the toast an action (Retry) if it can resolve it itself.");
|
|
27
|
+
}
|
|
28
|
+
return sonnerToast.error(message, data);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* "Moved 3 files to trash" with an Undo — the shape OVL-9 asks every reversible action to take.
|
|
32
|
+
* `onUndo` runs when Undo is pressed; the toast stays for 6s, long enough to reach the button.
|
|
33
|
+
*/
|
|
34
|
+
function undoToast(message, onUndo, data) {
|
|
35
|
+
return sonnerToast(message, { duration: 6000, ...data, action: { label: 'Undo', onClick: onUndo } });
|
|
36
|
+
}
|
|
37
|
+
/** sonner's `toast`, with OVL-9's rules on `error` and an `undo` helper. */
|
|
38
|
+
export const toast = Object.assign((...args) => sonnerToast(...args), sonnerToast, { error: errorToast, undo: undoToast });
|
|
17
39
|
/**
|
|
18
40
|
* 🔴 sonner paints a toast from its OWN variables (`--normal-bg`, `--normal-border`,
|
|
19
41
|
* `--normal-text`), set per `data-sonner-theme` on the toaster — and its rule outranks the
|
|
@@ -27,8 +49,15 @@ const TOKEN_VARS = {
|
|
|
27
49
|
'--normal-border': 'var(--border)',
|
|
28
50
|
'--normal-text': 'var(--popover-foreground)',
|
|
29
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* OVL-9: on a phone the stack sits ABOVE the `PlaceBar` (and any bottom dock), not on top of
|
|
54
|
+
* the navigation. `AppShell` publishes its bottom chrome's height as `--cb-bottom-chrome-h`;
|
|
55
|
+
* outside a shell it is 0 and this is sonner's own gap.
|
|
56
|
+
*/
|
|
57
|
+
const BOTTOM_OFFSET = { bottom: 'calc(var(--cb-bottom-chrome-h, 0px) + 16px)', right: '16px' };
|
|
58
|
+
const DESKTOP_OFFSET = { bottom: 'calc(var(--cb-bottom-chrome-h, 0px) + 24px)', right: '24px' };
|
|
30
59
|
export function Toaster({ style, ...props }) {
|
|
31
|
-
return (_jsx(SonnerToaster, { style: { ...TOKEN_VARS, ...style }, position: 'bottom-right', closeButton: true, toastOptions: {
|
|
60
|
+
return (_jsx(SonnerToaster, { style: { ...TOKEN_VARS, ...style }, position: 'bottom-right', offset: DESKTOP_OFFSET, mobileOffset: BOTTOM_OFFSET, closeButton: true, toastOptions: {
|
|
32
61
|
classNames: {
|
|
33
62
|
toast: 'rounded-lg border border-border bg-popover text-foreground shadow-overlay',
|
|
34
63
|
title: 'text-sm font-medium',
|
package/dist/react/Toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/react/Toast.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../src/react/Toast.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAsB,OAAO,IAAI,aAAa,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI/C;;;;;GAKG;AACH,SAAS,UAAU,CAAC,OAAqB,EAAE,IAAoB;IAC7D,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAClB,WAAW,CACT,4BAA4B,EAC5B,yHAAyH;YACvH,6FAA6F,CAChG,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,SAAS,SAAS,CAAC,OAAqB,EAAE,MAAkB,EAAE,IAAoB;IAChF,OAAO,WAAW,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AACvG,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,KAAK,GAAoD,MAAM,CAAC,MAAM,CACjF,CAAC,GAAG,IAAoC,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,EACjE,WAAW,EACX,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CACvC,CAAC;AAIF;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE,gBAAgB;IAC/B,iBAAiB,EAAE,eAAe;IAClC,eAAe,EAAE,2BAA2B;CACtB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,aAAa,GAAG,EAAE,MAAM,EAAE,6CAA6C,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC/F,MAAM,cAAc,GAAG,EAAE,MAAM,EAAE,6CAA6C,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAEhG,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB;IACvD,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,EAAE,EAClC,QAAQ,EAAC,cAAc,EACvB,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,aAAa,EAC3B,WAAW,QACX,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,KAAK,EAAE,2EAA2E;gBAClF,KAAK,EAAE,qBAAqB;gBAC5B,sFAAsF;gBACtF,8EAA8E;gBAC9E,WAAW,EAAE,gCAAgC;gBAC7C,YAAY,EAAE,yDAAyD;gBACvE,YAAY,EAAE,uDAAuD;gBACrE,WAAW,EAAE,0EAA0E;gBACvF,KAAK,EAAE,wDAAwD;gBAC/D,OAAO,EAAE,gDAAgD;gBACzD,OAAO,EAAE,gDAAgD;gBACzD,IAAI,EAAE,8CAA8C;aACrD;SACF,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -29,7 +29,7 @@ import { AnalyticsPanel } from './AnalyticsPanel.js';
|
|
|
29
29
|
* (retention, a pruned event log, nothing broke) rather than a blank table.
|
|
30
30
|
*/
|
|
31
31
|
export function MetricDrilldown({ open, onClose, title, value, question, caveat, range, chart, data, columns, getRowId, onRowClick, downloadName, emptyState, children, }) {
|
|
32
|
-
return (_jsx(Modal, { open: open, onClose: onClose, size: '
|
|
32
|
+
return (_jsx(Modal, { open: open, onClose: onClose, size: 'lg', title: value === undefined ? (title) : (_jsxs("span", { className: 'flex items-baseline gap-2', children: [_jsx("span", { children: title }), _jsx("span", { className: 'font-semibold text-muted-foreground tabular-nums', children: value })] })), subtitle: question, children: _jsxs("div", { className: 'flex min-w-0 flex-col gap-3', children: [children, _jsx(AnalyticsPanel, { title: `${data.length} ${data.length === 1 ? 'row' : 'rows'}`, question: question, ...(caveat === undefined ? {} : { caveat }), ...(range === undefined ? {} : { range }),
|
|
33
33
|
// No chart means the reader came for the list: open on the table. The
|
|
34
34
|
// Chart tab still exists (the toggle is the panel's, not ours) so it
|
|
35
35
|
// must SAY there is nothing to draw — an empty pane reads as a broken
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type CanvasBounds, type CanvasSize, type CanvasView } from './viewport.js';
|
|
3
|
+
export interface CanvasMinimapProps {
|
|
4
|
+
/** The content's extent in WORLD units — what the thumbnail shows. */
|
|
5
|
+
bounds: CanvasBounds;
|
|
6
|
+
view: CanvasView;
|
|
7
|
+
/** The canvas viewport in screen pixels, for the visible window. */
|
|
8
|
+
viewport: CanvasSize;
|
|
9
|
+
/** A click on the thumbnail, in WORLD units — the canvas centres there. */
|
|
10
|
+
onJump?: (point: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}) => void;
|
|
14
|
+
/** The thumbnail's longest side in pixels. Default 168. */
|
|
15
|
+
size?: number;
|
|
16
|
+
/** Drawn inside the SVG in WORLD units, under the window: dots, zones, edges. */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
/** A one-line caption under the map. Default "Tap to jump" when `onJump` is set. */
|
|
19
|
+
hint?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* CNV-3's minimap — the whole content as a low-opacity thumbnail with the visible window drawn
|
|
24
|
+
* on it. What a canvas draws on it (a dot per node, a heat zone per cluster) is `children` in its
|
|
25
|
+
* own world coordinates; the frame, the scaling and the window are this component's.
|
|
26
|
+
*
|
|
27
|
+
* The SVG is `aria-hidden`: the jump is a pointer shortcut over content that is already
|
|
28
|
+
* reachable by keyboard on the canvas itself, and a parallel interface over unlabeled dots would
|
|
29
|
+
* be a second, worse way to do what Tab already does (family's reasoning, kept).
|
|
30
|
+
*/
|
|
31
|
+
export declare function CanvasMinimap({ bounds, view, viewport, onJump, size, children, hint, className, }: CanvasMinimapProps): import("react").JSX.Element | null;
|
|
32
|
+
//# sourceMappingURL=CanvasMinimap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasMinimap.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/CanvasMinimap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAiB,MAAM,eAAe,CAAC;AAEnG,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,oEAAoE;IACpE,QAAQ,EAAE,UAAU,CAAC;IACrB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnD,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oFAAoF;IACpF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAU,EACV,QAAQ,EACR,IAAI,EACJ,SAAS,GACV,EAAE,kBAAkB,sCAgDpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../lib/cn.js';
|
|
3
|
+
import { visibleBounds } from './viewport.js';
|
|
4
|
+
/**
|
|
5
|
+
* CNV-3's minimap — the whole content as a low-opacity thumbnail with the visible window drawn
|
|
6
|
+
* on it. What a canvas draws on it (a dot per node, a heat zone per cluster) is `children` in its
|
|
7
|
+
* own world coordinates; the frame, the scaling and the window are this component's.
|
|
8
|
+
*
|
|
9
|
+
* The SVG is `aria-hidden`: the jump is a pointer shortcut over content that is already
|
|
10
|
+
* reachable by keyboard on the canvas itself, and a parallel interface over unlabeled dots would
|
|
11
|
+
* be a second, worse way to do what Tab already does (family's reasoning, kept).
|
|
12
|
+
*/
|
|
13
|
+
export function CanvasMinimap({ bounds, view, viewport, onJump, size = 168, children, hint, className, }) {
|
|
14
|
+
if (bounds.width <= 0 || bounds.height <= 0 || viewport.width <= 0 || view.scale <= 0)
|
|
15
|
+
return null;
|
|
16
|
+
const ratio = Math.min(size / bounds.width, (size * 0.62) / bounds.height);
|
|
17
|
+
const width = Math.max(1, bounds.width * ratio);
|
|
18
|
+
const height = Math.max(1, bounds.height * ratio);
|
|
19
|
+
const seen = visibleBounds(view, viewport);
|
|
20
|
+
const jump = (event) => {
|
|
21
|
+
if (!onJump)
|
|
22
|
+
return;
|
|
23
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
24
|
+
onJump({
|
|
25
|
+
x: bounds.x + (event.clientX - rect.left) / ratio,
|
|
26
|
+
y: bounds.y + (event.clientY - rect.top) / ratio,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const caption = hint === undefined ? (onJump ? 'Tap to jump' : null) : hint;
|
|
30
|
+
return (_jsxs("div", { "data-testid": 'canvas-minimap', className: cn('pointer-events-auto flex flex-col items-center gap-1 rounded-lg border border-border/60 bg-background/70 p-2 shadow-raised backdrop-blur-md', className), children: [_jsxs("svg", { width: width, height: height, viewBox: `${bounds.x} ${bounds.y} ${bounds.width} ${bounds.height}`, onClick: jump, "aria-hidden": 'true', className: cn('overflow-hidden', onJump && 'cursor-pointer'), children: [children, _jsx("rect", { "data-testid": 'canvas-minimap-window', x: seen.x, y: seen.y, width: seen.width, height: seen.height, fill: 'var(--accent)', fillOpacity: 0.12, stroke: 'var(--accent)', strokeWidth: 1.5 / ratio, rx: 3 / ratio })] }), caption ? _jsx("span", { className: 'text-caption text-muted-foreground', children: caption }) : null] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=CanvasMinimap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasMinimap.js","sourceRoot":"","sources":["../../../src/react/canvas-hud/CanvasMinimap.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAuD,aAAa,EAAE,MAAM,eAAe,CAAC;AAmBnG;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,IAAI,GAAG,GAAG,EACV,QAAQ,EACR,IAAI,EACJ,SAAS,GACU;IACnB,IAAI,MAAM,CAAC,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnG,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAClD,MAAM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MAAM,EAAC,eAAe,EACtB,WAAW,EAAE,GAAG,GAAG,KAAK,EACxB,EAAE,EAAE,CAAC,GAAG,KAAK,GACb,IACE,EACL,OAAO,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,oCAAoC,YAAE,OAAO,GAAQ,CAAC,CAAC,CAAC,IAAI,IACnF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CanvasNodeMenuItem {
|
|
3
|
+
label: string;
|
|
4
|
+
onSelect: () => void;
|
|
5
|
+
/** Drawn disabled. The section's `note` is where the reason goes. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
destructive?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface CanvasNodeMenuSection {
|
|
10
|
+
heading?: string;
|
|
11
|
+
items: CanvasNodeMenuItem[];
|
|
12
|
+
/** One quiet line under the rows: what they change, or why they cannot. */
|
|
13
|
+
note?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface CanvasNodeMenuProps {
|
|
16
|
+
trigger: ReactNode;
|
|
17
|
+
open: boolean;
|
|
18
|
+
onOpenChange: (open: boolean) => void;
|
|
19
|
+
sections: CanvasNodeMenuSection[];
|
|
20
|
+
align?: 'start' | 'center' | 'end';
|
|
21
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A node's menu on a canvas — a `Popover`, deliberately not a `DropdownMenu`.
|
|
26
|
+
*
|
|
27
|
+
* A menu takes the arrow keys for its own rows; on a canvas they belong to the CANVAS, which
|
|
28
|
+
* moves its cursor to the next node and closes this (family's branch menu, the owner's ask of
|
|
29
|
+
* 2026-09-24: *"I want it to disappear if I click off of it or use arrows to move to another
|
|
30
|
+
* person"*). So the rows are Tab-reachable buttons, the keys bubble, and an outside press or
|
|
31
|
+
* Escape closes it. Pointer-downs stop here so pressing a row never starts a pan.
|
|
32
|
+
*/
|
|
33
|
+
export declare function CanvasNodeMenu({ trigger, open, onOpenChange, sections, align, side, className, }: CanvasNodeMenuProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=CanvasNodeMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasNodeMenu.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/CanvasNodeMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,KAAe,EACf,IAAe,EACf,SAAS,GACV,EAAE,mBAAmB,+BA2CrB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../components/Button.js';
|
|
3
|
+
import { Popover } from '../components/Popover.js';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
/**
|
|
6
|
+
* A node's menu on a canvas — a `Popover`, deliberately not a `DropdownMenu`.
|
|
7
|
+
*
|
|
8
|
+
* A menu takes the arrow keys for its own rows; on a canvas they belong to the CANVAS, which
|
|
9
|
+
* moves its cursor to the next node and closes this (family's branch menu, the owner's ask of
|
|
10
|
+
* 2026-09-24: *"I want it to disappear if I click off of it or use arrows to move to another
|
|
11
|
+
* person"*). So the rows are Tab-reachable buttons, the keys bubble, and an outside press or
|
|
12
|
+
* Escape closes it. Pointer-downs stop here so pressing a row never starts a pan.
|
|
13
|
+
*/
|
|
14
|
+
export function CanvasNodeMenu({ trigger, open, onOpenChange, sections, align = 'start', side = 'bottom', className, }) {
|
|
15
|
+
const stop = (event) => event.stopPropagation();
|
|
16
|
+
return (_jsx(Popover, { open: open, onOpenChange: onOpenChange, align: align, side: side, className: cn('w-64 p-1', className), trigger: trigger, children: _jsx("div", { role: 'menu', onPointerDown: stop, className: 'flex flex-col', children: sections.map((section, sectionIndex) => (_jsxs("div", { className: cn('flex flex-col py-1', sectionIndex > 0 && 'border-t border-border'), children: [section.heading ? _jsx("p", { className: 'cb-meta-label px-2 pt-1 pb-1.5', children: section.heading }) : null, section.items.map((item) => (_jsx(Button, { role: 'menuitem', variant: item.destructive ? 'destructive' : 'ghost', size: 'sm', tooltip: item.label, tooltipMobile: 'off', disabled: item.disabled, className: 'w-full justify-start', onClick: (event) => {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
item.onSelect();
|
|
19
|
+
}, children: item.label }, item.label))), section.note ? _jsx("p", { className: 'px-2 pt-1 text-caption text-muted-foreground', children: section.note }) : null] }, sectionIndex))) }) }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=CanvasNode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EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EACnD,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,aAAa,EAAC,KAAK,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,sBAAsB,EAChC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;4BACjB,KAAK,CAAC,eAAe,EAAE,CAAC;4BACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAClB,CAAC,YAEA,IAAI,CAAC,KAAK,IAbN,IAAI,CAAC,KAAK,CAcR,CACV,CAAC,EACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,8CAA8C,YAAE,OAAO,CAAC,IAAI,GAAK,CAAC,CAAC,CAAC,IAAI,KAtBhG,YAAY,CAuBb,CACP,CAAC,GACE,GACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface CanvasSearchFieldProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
/** Step to the next (1) or previous (-1) match — Enter and Shift+Enter, and the ‹ › keys. */
|
|
5
|
+
onStep?: (delta: 1 | -1) => void;
|
|
6
|
+
/** How many matches the query has, and which one is current (0-based). */
|
|
7
|
+
matches?: number;
|
|
8
|
+
index?: number;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The find box that floats over a canvas, and the one that does not steal the canvas's keys.
|
|
15
|
+
*
|
|
16
|
+
* 🔴 A canvas binds the arrow keys on an ancestor of this field. Without stopping them here,
|
|
17
|
+
* typing a name and pressing ← to fix a typo walked the reader to a cousin instead of moving
|
|
18
|
+
* the caret (family, 2026-09). Every key stops at the field; Enter and Shift+Enter step through
|
|
19
|
+
* the matches, the convention of every find-in-page; Escape empties the box rather than blurring.
|
|
20
|
+
*
|
|
21
|
+
* It is the belt's `Input` drawn borderless, so the pill around it is the field — and NOT
|
|
22
|
+
* `SearchInput`: a find box over a canvas matches names, never wildcards or regexes, and the
|
|
23
|
+
* syntax parser and its badge were 5.6 kB gzip on family's first paint for nothing (task 2401).
|
|
24
|
+
* A ✕ empties it too, because a phone has no Escape key.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CanvasSearchField({ value, onChange, onStep, matches, index, placeholder, 'aria-label': ariaLabel, className, }: CanvasSearchFieldProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=CanvasSearchField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasSearchField.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/CanvasSearchField.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC;IACjC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAW,EACX,KAAS,EACT,WAAqB,EACrB,YAAY,EAAE,SAAS,EACvB,SAAS,GACV,EAAE,sBAAsB,+BAgDxB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HudPill } from '../components/HudPill.js';
|
|
3
|
+
import { Input } from '../components/Input.js';
|
|
4
|
+
import { IconSearch } from '../icons.js';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { HudButton } from './HudControls.js';
|
|
7
|
+
/**
|
|
8
|
+
* The find box that floats over a canvas, and the one that does not steal the canvas's keys.
|
|
9
|
+
*
|
|
10
|
+
* 🔴 A canvas binds the arrow keys on an ancestor of this field. Without stopping them here,
|
|
11
|
+
* typing a name and pressing ← to fix a typo walked the reader to a cousin instead of moving
|
|
12
|
+
* the caret (family, 2026-09). Every key stops at the field; Enter and Shift+Enter step through
|
|
13
|
+
* the matches, the convention of every find-in-page; Escape empties the box rather than blurring.
|
|
14
|
+
*
|
|
15
|
+
* It is the belt's `Input` drawn borderless, so the pill around it is the field — and NOT
|
|
16
|
+
* `SearchInput`: a find box over a canvas matches names, never wildcards or regexes, and the
|
|
17
|
+
* syntax parser and its badge were 5.6 kB gzip on family's first paint for nothing (task 2401).
|
|
18
|
+
* A ✕ empties it too, because a phone has no Escape key.
|
|
19
|
+
*/
|
|
20
|
+
export function CanvasSearchField({ value, onChange, onStep, matches = 0, index = 0, placeholder = 'Find…', 'aria-label': ariaLabel, className, }) {
|
|
21
|
+
const searching = value.trim().length > 0;
|
|
22
|
+
const onKeyDown = (event) => {
|
|
23
|
+
if (event.key === 'Enter' && onStep) {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
onStep(event.shiftKey ? -1 : 1);
|
|
26
|
+
}
|
|
27
|
+
if (event.key === 'Escape' && value !== '') {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
onChange('');
|
|
30
|
+
}
|
|
31
|
+
event.stopPropagation();
|
|
32
|
+
};
|
|
33
|
+
return (_jsxs(HudPill, { className: cn('gap-0.5 rounded-lg py-0.5 pr-1 pl-0', className), children: [_jsx(IconSearch, { size: 16, className: 'ml-2 shrink-0 text-muted-foreground' }), _jsx(Input, { type: 'search', size: 'sm', value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder, "aria-label": ariaLabel ?? placeholder, onKeyDown: onKeyDown, className: 'w-40 border-transparent bg-transparent pl-1 shadow-none focus-visible:border-transparent focus-visible:ring-0 [&::-webkit-search-cancel-button]:hidden' }), searching ? (_jsx("span", { className: 'min-w-10 text-center text-xs text-muted-foreground tabular-nums', "aria-live": 'polite', children: matches === 0 ? 'none' : `${index + 1}/${matches}` })) : null, onStep && matches > 1 ? (_jsxs(_Fragment, { children: [_jsx(HudButton, { label: 'Previous match \u2014 Shift+Enter', onClick: () => onStep(-1), children: _jsx("span", { "aria-hidden": true, children: "\u2039" }) }), _jsx(HudButton, { label: 'Next match \u2014 Enter', onClick: () => onStep(1), children: _jsx("span", { "aria-hidden": true, children: "\u203A" }) })] })) : null, searching ? (_jsx(HudButton, { label: 'Clear the search \u2014 Escape', onClick: () => onChange(''), children: _jsx("span", { "aria-hidden": true, children: "\u00D7" }) })) : null] }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=CanvasSearchField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CanvasSearchField.js","sourceRoot":"","sources":["../../../src/react/canvas-hud/CanvasSearchField.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAe7C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,GAAG,CAAC,EACX,KAAK,GAAG,CAAC,EACT,WAAW,GAAG,OAAO,EACrB,YAAY,EAAE,SAAS,EACvB,SAAS,GACc;IAC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I,EACP,MAAM,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CACvB,8BACE,KAAC,SAAS,IAAC,KAAK,EAAC,mCAA8B,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YACvE,yDAA0B,GAChB,EACZ,KAAC,SAAS,IAAC,KAAK,EAAC,yBAAoB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,YAC5D,yDAA0B,GAChB,IACX,CACJ,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,SAAS,IAAC,KAAK,EAAC,gCAA2B,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,YACtE,yDAA0B,GAChB,CACb,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface HudButtonProps {
|
|
3
|
+
/** What it does — the accessible name and the hover hint. */
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Present only on a control that TOGGLES, so the others announce no pressed state. */
|
|
8
|
+
pressed?: boolean;
|
|
9
|
+
/** Why it cannot act right now: drawn disabled, still focusable, the reason on hover. */
|
|
10
|
+
unavailableReason?: string | null;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/** One HUD control — an icon-sized belt `IconButton`, with a pressed state for a toggle. */
|
|
14
|
+
export declare function HudButton({ label, onClick, children, pressed, unavailableReason, className }: HudButtonProps): import("react").JSX.Element;
|
|
15
|
+
export interface HudZoomControlsProps {
|
|
16
|
+
/** The live scale; drawn as a percentage. */
|
|
17
|
+
scale: number;
|
|
18
|
+
onZoomIn: () => void;
|
|
19
|
+
onZoomOut: () => void;
|
|
20
|
+
/** Fit the content to the screen. */
|
|
21
|
+
onFit: () => void;
|
|
22
|
+
/** Center on the focused node. Omit it when the canvas has no focus to centre on. */
|
|
23
|
+
onCenter?: () => void;
|
|
24
|
+
fitLabel?: string;
|
|
25
|
+
centerLabel?: string;
|
|
26
|
+
/** The canvas's own utilities, drawn before the zoom keys in the same pill (CNV-4 — utilities
|
|
27
|
+
* only; preferences and primary actions belong in the page's panel). */
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/** CNV-3's essentials as one pill: −, the zoom %, +, Fit and Center. */
|
|
32
|
+
export declare function HudZoomControls({ scale, onZoomIn, onZoomOut, onFit, onCenter, fitLabel, centerLabel, children, className, }: HudZoomControlsProps): import("react").JSX.Element;
|
|
33
|
+
export interface CanvasZoomHintProps {
|
|
34
|
+
/** `useCanvasWheel(…).hint` — up while the reader wheels over an embedded canvas. */
|
|
35
|
+
show: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* CNV-1's "Hold ⌘ to zoom" — what an embedded canvas says when a plain wheel scrolled the page
|
|
40
|
+
* instead of zooming it, the way an embedded Google Map does. Says Ctrl off a Mac.
|
|
41
|
+
*/
|
|
42
|
+
export declare function CanvasZoomHint({ show, className }: CanvasZoomHintProps): import("react").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=HudControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HudControls.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/HudControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAoBvC,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4FAA4F;AAC5F,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,cAAc,+BAc5G;AAED,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,qCAAqC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;6EACyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAA0B,EAC1B,WAAuC,EACvC,QAAQ,EACR,SAAS,GACV,EAAE,oBAAoB,+BAuBtB;AAED,MAAM,WAAW,mBAAmB;IAClC,qFAAqF;IACrF,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,mBAAmB,+BAetE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HudPill } from '../components/HudPill.js';
|
|
3
|
+
import { IconButton } from '../components/IconButton.js';
|
|
4
|
+
import { IconCenter, IconFit, IconZoomIn, IconZoomOut } from '../icons.js';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
/** One HUD control — an icon-sized belt `IconButton`, with a pressed state for a toggle. */
|
|
7
|
+
export function HudButton({ label, onClick, children, pressed, unavailableReason, className }) {
|
|
8
|
+
return (_jsx(IconButton, { label: label, size: 'sm', "aria-pressed": pressed, unavailableReason: unavailableReason ?? undefined, tooltipMobile: 'off', onClick: onClick, className: cn('text-muted-foreground aria-pressed:bg-muted aria-pressed:text-foreground', className), children: children }));
|
|
9
|
+
}
|
|
10
|
+
/** CNV-3's essentials as one pill: −, the zoom %, +, Fit and Center. */
|
|
11
|
+
export function HudZoomControls({ scale, onZoomIn, onZoomOut, onFit, onCenter, fitLabel = 'Fit to screen', centerLabel = 'Center on the selection', children, className, }) {
|
|
12
|
+
return (_jsxs(HudPill, { role: 'group', "aria-label": 'View', className: cn('gap-0.5 rounded-lg px-1 py-1', className), children: [children, _jsx(HudButton, { label: 'Zoom out', onClick: onZoomOut, children: _jsx(IconZoomOut, {}) }), _jsxs("span", { className: 'min-w-11 text-center text-xs text-muted-foreground tabular-nums', "data-testid": 'hud-zoom', children: [Math.round(scale * 100), "%"] }), _jsx(HudButton, { label: 'Zoom in', onClick: onZoomIn, children: _jsx(IconZoomIn, {}) }), _jsx(HudButton, { label: fitLabel, onClick: onFit, children: _jsx(IconFit, {}) }), onCenter ? (_jsx(HudButton, { label: centerLabel, onClick: onCenter, children: _jsx(IconCenter, {}) })) : null] }));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* CNV-1's "Hold ⌘ to zoom" — what an embedded canvas says when a plain wheel scrolled the page
|
|
16
|
+
* instead of zooming it, the way an embedded Google Map does. Says Ctrl off a Mac.
|
|
17
|
+
*/
|
|
18
|
+
export function CanvasZoomHint({ show, className }) {
|
|
19
|
+
const mac = typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
20
|
+
return (_jsx("div", { "aria-hidden": !show, "data-testid": 'canvas-zoom-hint', className: cn('pointer-events-none absolute inset-0 grid place-items-center bg-background/40 transition-opacity duration-200', show ? 'opacity-100' : 'opacity-0', className), children: _jsxs(HudPill, { className: 'px-3 py-1.5 text-sm', children: ["Hold ", mac ? '⌘' : 'Ctrl', " to zoom"] }) }));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=HudControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HudControls.js","sourceRoot":"","sources":["../../../src/react/canvas-hud/HudControls.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AA4BlC,4FAA4F;AAC5F,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAkB;IAC3G,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,IAAI,kBACK,OAAO,EACrB,iBAAiB,EAAE,iBAAiB,IAAI,SAAS,EACjD,aAAa,EAAC,KAAK,EACnB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CAAC,0EAA0E,EAAE,SAAS,CAAC,YAEnG,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAmBD,wEAAwE;AACxE,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,eAAe,EAC1B,WAAW,GAAG,yBAAyB,EACvC,QAAQ,EACR,SAAS,GACY;IACrB,OAAO,CACL,MAAC,OAAO,IAAC,IAAI,EAAC,OAAO,g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inimapProps } from './CanvasMinimap.js';
|
|
2
|
+
export { CanvasMinimap } from './CanvasMinimap.js';
|
|
3
|
+
export type { CanvasNodeMenuItem, CanvasNodeMenuProps, CanvasNodeMenuSection } from './CanvasNodeMenu.js';
|
|
4
|
+
export { CanvasNodeMenu } from './CanvasNodeMenu.js';
|
|
5
|
+
export type { CanvasSearchFieldProps } from './CanvasSearchField.js';
|
|
6
|
+
export { CanvasSearchField } from './CanvasSearchField.js';
|
|
7
|
+
export type { CanvasZoomHintProps, HudButtonProps, HudZoomControlsProps } from './HudControls.js';
|
|
8
|
+
export { CanvasZoomHint, HudButton, HudZoomControls } from './HudControls.js';
|
|
9
|
+
export type { CanvasWheelMode, CanvasWheelOptions } from './useCanvasWheel.js';
|
|
10
|
+
export { readWheel, useCanvasWheel, useLevelOfDetail } from './useCanvasWheel.js';
|
|
11
|
+
export type { CanvasBounds, CanvasPoint, CanvasSize, CanvasView, FitOptions, LevelOfDetail, LevelOfDetailThresholds, } from './viewport.js';
|
|
12
|
+
export { centerView, clampScale, fitScale, fitView, LEVEL_OF_DETAIL, levelOfDetail, visibleBounds, wheelZoomFactor, zoomAt, } from './viewport.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClF,YAAY,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,MAAM,GACP,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CanvasMinimap } from './CanvasMinimap.js';
|
|
2
|
+
export { CanvasNodeMenu } from './CanvasNodeMenu.js';
|
|
3
|
+
export { CanvasSearchField } from './CanvasSearchField.js';
|
|
4
|
+
export { CanvasZoomHint, HudButton, HudZoomControls } from './HudControls.js';
|
|
5
|
+
export { readWheel, useCanvasWheel, useLevelOfDetail } from './useCanvasWheel.js';
|
|
6
|
+
export { centerView, clampScale, fitScale, fitView, LEVEL_OF_DETAIL, levelOfDetail, visibleBounds, wheelZoomFactor, zoomAt, } from './viewport.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/canvas-hud/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAUlF,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,aAAa,EACb,eAAe,EACf,MAAM,GACP,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type CanvasPoint, type LevelOfDetail, type LevelOfDetailThresholds } from './viewport.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a canvas reads the wheel (CNV-1 — one gesture, one meaning, on every surface):
|
|
5
|
+
*
|
|
6
|
+
* - `'full'` — the canvas owns the viewport and the page does not scroll. Pinch and ⌘/Ctrl+wheel
|
|
7
|
+
* zoom; a plain wheel or a two-finger swipe PANS (Figma, Miro).
|
|
8
|
+
* - `'full-zoom'` — the same, except a plain wheel ZOOMS, the way a full-page map does. For a
|
|
9
|
+
* canvas whose readers already zoom with a mouse wheel (family's tree): a shift+wheel pans.
|
|
10
|
+
* - `'embedded'` — the page scrolls past the canvas. A plain wheel is the PAGE's and is left
|
|
11
|
+
* alone; pinch and ⌘/Ctrl+wheel zoom; the hook raises `hint` so the canvas can say
|
|
12
|
+
* "Hold ⌘ to zoom", the way an embedded Google Map does.
|
|
13
|
+
*/
|
|
14
|
+
export type CanvasWheelMode = 'full' | 'full-zoom' | 'embedded';
|
|
15
|
+
export interface CanvasWheelOptions {
|
|
16
|
+
mode: CanvasWheelMode;
|
|
17
|
+
/** Zoom by `factor` about `anchor` (viewport pixels). The canvas clamps. */
|
|
18
|
+
onZoom: (factor: number, anchor: CanvasPoint) => void;
|
|
19
|
+
/** Pan by screen pixels. Unused in `'embedded'` mode. */
|
|
20
|
+
onPan?: (dx: number, dy: number) => void;
|
|
21
|
+
/** How long the embedded hint stays up after the last plain wheel. Default 1200 ms. */
|
|
22
|
+
hintMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/** The decision, separated from the DOM so it is testable: what one wheel event means. */
|
|
25
|
+
export declare function readWheel(mode: CanvasWheelMode, event: Pick<WheelEvent, 'ctrlKey' | 'metaKey' | 'shiftKey' | 'deltaX' | 'deltaY'>): 'zoom' | 'pan' | 'page';
|
|
26
|
+
/**
|
|
27
|
+
* Binds the wheel on `ref` per {@link CanvasWheelMode}.
|
|
28
|
+
*
|
|
29
|
+
* 🔴 A NON-passive native listener, never a JSX `onWheel`: React registers `wheel` at the root as
|
|
30
|
+
* passive, so `preventDefault()` there is ignored and the page scrolls (or zooms the whole
|
|
31
|
+
* browser on a pinch) under the canvas.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useCanvasWheel(ref: RefObject<HTMLElement | null>, options: CanvasWheelOptions): {
|
|
34
|
+
hint: boolean;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* CNV-5 — the density to draw at this scale. A string that changes only at a threshold, so an
|
|
38
|
+
* effect or memo keyed on it re-runs three times across the whole zoom range, not every frame.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useLevelOfDetail(scale: number, thresholds?: LevelOfDetailThresholds): LevelOfDetail;
|
|
41
|
+
//# sourceMappingURL=useCanvasWheel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasWheel.d.ts","sourceRoot":"","sources":["../../../src/react/canvas-hud/useCanvasWheel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAG7B,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,4EAA4E;IAC5E,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACtD,yDAAyD;IACzD,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0FAA0F;AAC1F,wBAAgB,SAAS,CACvB,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAChF,MAAM,GAAG,KAAK,GAAG,MAAM,CAMzB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,kBAAkB,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAmCjH;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,uBAAyC,GACpD,aAAa,CAEf"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { LEVEL_OF_DETAIL, levelOfDetail, wheelZoomFactor, } from './viewport.js';
|
|
3
|
+
/** The decision, separated from the DOM so it is testable: what one wheel event means. */
|
|
4
|
+
export function readWheel(mode, event) {
|
|
5
|
+
// A trackpad pinch arrives as a wheel event with ctrlKey set, on every browser.
|
|
6
|
+
if (event.ctrlKey || event.metaKey)
|
|
7
|
+
return 'zoom';
|
|
8
|
+
if (mode === 'embedded')
|
|
9
|
+
return 'page';
|
|
10
|
+
if (mode === 'full-zoom')
|
|
11
|
+
return event.shiftKey ? 'pan' : 'zoom';
|
|
12
|
+
return 'pan';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Binds the wheel on `ref` per {@link CanvasWheelMode}.
|
|
16
|
+
*
|
|
17
|
+
* 🔴 A NON-passive native listener, never a JSX `onWheel`: React registers `wheel` at the root as
|
|
18
|
+
* passive, so `preventDefault()` there is ignored and the page scrolls (or zooms the whole
|
|
19
|
+
* browser on a pinch) under the canvas.
|
|
20
|
+
*/
|
|
21
|
+
export function useCanvasWheel(ref, options) {
|
|
22
|
+
const latest = useRef(options);
|
|
23
|
+
latest.current = options;
|
|
24
|
+
const [hint, setHint] = useState(false);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const element = ref.current;
|
|
27
|
+
if (!element)
|
|
28
|
+
return;
|
|
29
|
+
let timer;
|
|
30
|
+
const onWheel = (event) => {
|
|
31
|
+
const { mode, onZoom, onPan, hintMs = 1200 } = latest.current;
|
|
32
|
+
const meaning = readWheel(mode, event);
|
|
33
|
+
if (meaning === 'page') {
|
|
34
|
+
setHint(true);
|
|
35
|
+
clearTimeout(timer);
|
|
36
|
+
timer = setTimeout(() => setHint(false), hintMs);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
if (meaning === 'zoom') {
|
|
41
|
+
const rect = element.getBoundingClientRect();
|
|
42
|
+
onZoom(wheelZoomFactor(event.deltaY), { x: event.clientX - rect.left, y: event.clientY - rect.top });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// A shift+wheel from a mouse reports its motion on Y; a sideways trackpad swipe on X.
|
|
46
|
+
const dx = event.shiftKey && event.deltaX === 0 ? event.deltaY : event.deltaX;
|
|
47
|
+
const dy = event.shiftKey && event.deltaX === 0 ? 0 : event.deltaY;
|
|
48
|
+
onPan?.(-dx, -dy);
|
|
49
|
+
};
|
|
50
|
+
element.addEventListener('wheel', onWheel, { passive: false });
|
|
51
|
+
return () => {
|
|
52
|
+
clearTimeout(timer);
|
|
53
|
+
element.removeEventListener('wheel', onWheel);
|
|
54
|
+
};
|
|
55
|
+
}, [ref]);
|
|
56
|
+
return { hint };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* CNV-5 — the density to draw at this scale. A string that changes only at a threshold, so an
|
|
60
|
+
* effect or memo keyed on it re-runs three times across the whole zoom range, not every frame.
|
|
61
|
+
*/
|
|
62
|
+
export function useLevelOfDetail(scale, thresholds = LEVEL_OF_DETAIL) {
|
|
63
|
+
return levelOfDetail(scale, thresholds);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=useCanvasWheel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCanvasWheel.js","sourceRoot":"","sources":["../../../src/react/canvas-hud/useCanvasWheel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAEL,eAAe,EAGf,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AAyBvB,0FAA0F;AAC1F,MAAM,UAAU,SAAS,CACvB,IAAqB,EACrB,KAAiF;IAEjF,gFAAgF;IAChF,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAClD,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC;IACvC,IAAI,IAAI,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACjE,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,GAAkC,EAAE,OAA2B;IAC5F,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,GA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