@schlessera/brain-ui-react 0.35.0 → 0.37.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 +82 -4
- package/dist/components/activity/activity-page.d.ts +17 -5
- package/dist/components/activity/activity-page.d.ts.map +1 -1
- package/dist/components/activity/activity-page.js +148 -50
- package/dist/components/activity/activity-page.js.map +1 -1
- package/dist/components/activity/activity-run-detail.d.ts +16 -1
- package/dist/components/activity/activity-run-detail.d.ts.map +1 -1
- package/dist/components/activity/activity-run-detail.js +47 -4
- package/dist/components/activity/activity-run-detail.js.map +1 -1
- package/dist/components/activity/activity-run-list.d.ts +7 -1
- package/dist/components/activity/activity-run-list.d.ts.map +1 -1
- package/dist/components/activity/activity-run-list.js +16 -8
- package/dist/components/activity/activity-run-list.js.map +1 -1
- package/dist/components/activity/activity-views.d.ts +63 -0
- package/dist/components/activity/activity-views.d.ts.map +1 -0
- package/dist/components/activity/activity-views.js +52 -0
- package/dist/components/activity/activity-views.js.map +1 -0
- package/dist/components/activity/approval-card.d.ts +29 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +73 -0
- package/dist/components/activity/approval-card.js.map +1 -0
- package/dist/components/activity/digest-card.d.ts +3 -0
- package/dist/components/activity/digest-card.d.ts.map +1 -1
- package/dist/components/activity/digest-card.js +20 -16
- package/dist/components/activity/digest-card.js.map +1 -1
- package/dist/components/activity/digest-summary.d.ts +19 -0
- package/dist/components/activity/digest-summary.d.ts.map +1 -0
- package/dist/components/activity/digest-summary.js +20 -0
- package/dist/components/activity/digest-summary.js.map +1 -0
- package/dist/components/activity/push-switch.d.ts +25 -0
- package/dist/components/activity/push-switch.d.ts.map +1 -0
- package/dist/components/activity/push-switch.js +14 -0
- package/dist/components/activity/push-switch.js.map +1 -0
- package/dist/components/activity/push-toggle.d.ts +7 -0
- package/dist/components/activity/push-toggle.d.ts.map +1 -1
- package/dist/components/activity/push-toggle.js +72 -47
- package/dist/components/activity/push-toggle.js.map +1 -1
- package/dist/components/activity/span-bits.d.ts +11 -0
- package/dist/components/activity/span-bits.d.ts.map +1 -1
- package/dist/components/activity/span-bits.js +50 -7
- package/dist/components/activity/span-bits.js.map +1 -1
- package/dist/components/chat/ask-user-card.d.ts +76 -3
- package/dist/components/chat/ask-user-card.d.ts.map +1 -1
- package/dist/components/chat/ask-user-card.js +208 -149
- package/dist/components/chat/ask-user-card.js.map +1 -1
- package/dist/components/chat/ask-user-typed.d.ts +42 -0
- package/dist/components/chat/ask-user-typed.d.ts.map +1 -0
- package/dist/components/chat/ask-user-typed.js +60 -0
- package/dist/components/chat/ask-user-typed.js.map +1 -0
- package/dist/components/chat/brain-markdown-links.d.ts +2 -1
- package/dist/components/chat/brain-markdown-links.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown-links.js +3 -4
- package/dist/components/chat/brain-markdown-links.js.map +1 -1
- package/dist/components/chat/brain-markdown.d.ts.map +1 -1
- package/dist/components/chat/brain-markdown.js +4 -2
- package/dist/components/chat/brain-markdown.js.map +1 -1
- package/dist/components/chat/chat-page.d.ts.map +1 -1
- package/dist/components/chat/chat-page.js +27 -11
- package/dist/components/chat/chat-page.js.map +1 -1
- package/dist/components/chat/composer-view.d.ts +75 -0
- package/dist/components/chat/composer-view.d.ts.map +1 -0
- package/dist/components/chat/composer-view.js +31 -0
- package/dist/components/chat/composer-view.js.map +1 -0
- package/dist/components/chat/composer.d.ts +4 -0
- package/dist/components/chat/composer.d.ts.map +1 -1
- package/dist/components/chat/composer.js +76 -59
- package/dist/components/chat/composer.js.map +1 -1
- package/dist/components/chat/markdown-content.d.ts +16 -1
- package/dist/components/chat/markdown-content.d.ts.map +1 -1
- package/dist/components/chat/markdown-content.js +47 -3
- package/dist/components/chat/markdown-content.js.map +1 -1
- package/dist/components/chat/mermaid-block.d.ts +4 -0
- package/dist/components/chat/mermaid-block.d.ts.map +1 -1
- package/dist/components/chat/mermaid-block.js +13 -5
- package/dist/components/chat/mermaid-block.js.map +1 -1
- package/dist/components/chat/mermaid-share.d.ts +2 -1
- package/dist/components/chat/mermaid-share.d.ts.map +1 -1
- package/dist/components/chat/mermaid-share.js +7 -8
- package/dist/components/chat/mermaid-share.js.map +1 -1
- package/dist/components/chat/mermaid-viewer.d.ts.map +1 -1
- package/dist/components/chat/mermaid-viewer.js +3 -1
- package/dist/components/chat/mermaid-viewer.js.map +1 -1
- package/dist/components/chat/message-bubble.d.ts +8 -1
- package/dist/components/chat/message-bubble.d.ts.map +1 -1
- package/dist/components/chat/message-bubble.js +53 -24
- package/dist/components/chat/message-bubble.js.map +1 -1
- package/dist/components/chat/message-share.d.ts +2 -1
- package/dist/components/chat/message-share.d.ts.map +1 -1
- package/dist/components/chat/message-share.js +6 -7
- package/dist/components/chat/message-share.js.map +1 -1
- package/dist/components/chat/renderers/bind.d.ts +39 -0
- package/dist/components/chat/renderers/bind.d.ts.map +1 -0
- package/dist/components/chat/renderers/bind.js +43 -0
- package/dist/components/chat/renderers/bind.js.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts +3 -0
- package/dist/components/chat/renderers/brain-ui-tools.d.ts.map +1 -0
- package/dist/components/chat/renderers/brain-ui-tools.js +41 -0
- package/dist/components/chat/renderers/brain-ui-tools.js.map +1 -0
- package/dist/components/chat/renderers/claude-tools.d.ts.map +1 -1
- package/dist/components/chat/renderers/claude-tools.js +3 -2
- package/dist/components/chat/renderers/claude-tools.js.map +1 -1
- package/dist/components/chat/renderers/index.d.ts +10 -2
- package/dist/components/chat/renderers/index.d.ts.map +1 -1
- package/dist/components/chat/renderers/index.js +15 -10
- package/dist/components/chat/renderers/index.js.map +1 -1
- package/dist/components/chat/session-drawer.d.ts +4 -0
- package/dist/components/chat/session-drawer.d.ts.map +1 -1
- package/dist/components/chat/session-drawer.js +32 -32
- package/dist/components/chat/session-drawer.js.map +1 -1
- package/dist/components/chat/session-list.d.ts +41 -0
- package/dist/components/chat/session-list.d.ts.map +1 -0
- package/dist/components/chat/session-list.js +10 -0
- package/dist/components/chat/session-list.js.map +1 -0
- package/dist/components/chat/share-block.d.ts.map +1 -1
- package/dist/components/chat/share-block.js +12 -11
- package/dist/components/chat/share-block.js.map +1 -1
- package/dist/components/chat/share-card.js +2 -2
- package/dist/components/chat/share-card.js.map +1 -1
- package/dist/components/chat/subagent-view.js +1 -1
- package/dist/components/chat/subagent-view.js.map +1 -1
- package/dist/components/chat/tool-call-timeline.d.ts.map +1 -1
- package/dist/components/chat/tool-call-timeline.js +45 -14
- package/dist/components/chat/tool-call-timeline.js.map +1 -1
- package/dist/components/chat/tool-cards/block-card.d.ts +28 -0
- package/dist/components/chat/tool-cards/block-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/block-card.js +103 -0
- package/dist/components/chat/tool-cards/block-card.js.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts +70 -0
- package/dist/components/chat/tool-cards/image-mask-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/image-mask-card.js +142 -0
- package/dist/components/chat/tool-cards/image-mask-card.js.map +1 -0
- package/dist/components/chat/tool-cards/location-card.d.ts +45 -0
- package/dist/components/chat/tool-cards/location-card.d.ts.map +1 -0
- package/dist/components/chat/tool-cards/location-card.js +128 -0
- package/dist/components/chat/tool-cards/location-card.js.map +1 -0
- package/dist/components/chat/tool-views.d.ts +19 -2
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +28 -22
- package/dist/components/chat/tool-views.js.map +1 -1
- package/dist/components/chat/transcript-turn.d.ts +45 -0
- package/dist/components/chat/transcript-turn.d.ts.map +1 -0
- package/dist/components/chat/transcript-turn.js +25 -0
- package/dist/components/chat/transcript-turn.js.map +1 -0
- package/dist/components/chat/use-chat-commands.d.ts.map +1 -1
- package/dist/components/chat/use-chat-commands.js +13 -16
- package/dist/components/chat/use-chat-commands.js.map +1 -1
- package/dist/components/chat/welcome-state.d.ts +7 -0
- package/dist/components/chat/welcome-state.d.ts.map +1 -1
- package/dist/components/chat/welcome-state.js +13 -5
- package/dist/components/chat/welcome-state.js.map +1 -1
- package/dist/components/connectivity/connection-gate.d.ts.map +1 -1
- package/dist/components/connectivity/connection-gate.js +27 -21
- package/dist/components/connectivity/connection-gate.js.map +1 -1
- package/dist/components/connectivity/login-form.d.ts +31 -0
- package/dist/components/connectivity/login-form.d.ts.map +1 -0
- package/dist/components/connectivity/login-form.js +19 -0
- package/dist/components/connectivity/login-form.js.map +1 -0
- package/dist/components/connectivity/login-screen.d.ts +5 -2
- package/dist/components/connectivity/login-screen.d.ts.map +1 -1
- package/dist/components/connectivity/login-screen.js +41 -31
- package/dist/components/connectivity/login-screen.js.map +1 -1
- package/dist/components/dev/share-harness.js +1 -1
- package/dist/components/dev/share-harness.js.map +1 -1
- package/dist/components/files/file-panel.d.ts +1 -1
- package/dist/components/files/file-panel.d.ts.map +1 -1
- package/dist/components/files/file-panel.js +74 -0
- package/dist/components/files/file-panel.js.map +1 -1
- package/dist/components/files/file-tree-view.d.ts +45 -0
- package/dist/components/files/file-tree-view.d.ts.map +1 -0
- package/dist/components/files/file-tree-view.js +51 -0
- package/dist/components/files/file-tree-view.js.map +1 -0
- package/dist/components/files/file-tree.d.ts +6 -0
- package/dist/components/files/file-tree.d.ts.map +1 -1
- package/dist/components/files/file-tree.js +39 -43
- package/dist/components/files/file-tree.js.map +1 -1
- package/dist/components/files/file-viewer-binary.d.ts.map +1 -1
- package/dist/components/files/file-viewer-binary.js +3 -2
- package/dist/components/files/file-viewer-binary.js.map +1 -1
- package/dist/components/files/file-viewer-frame.d.ts +36 -0
- package/dist/components/files/file-viewer-frame.d.ts.map +1 -0
- package/dist/components/files/file-viewer-frame.js +26 -0
- package/dist/components/files/file-viewer-frame.js.map +1 -0
- package/dist/components/files/file-viewer.d.ts +5 -0
- package/dist/components/files/file-viewer.d.ts.map +1 -1
- package/dist/components/files/file-viewer.js +26 -32
- package/dist/components/files/file-viewer.js.map +1 -1
- package/dist/components/files/frontmatter-chips.d.ts +18 -0
- package/dist/components/files/frontmatter-chips.d.ts.map +1 -0
- package/dist/components/files/frontmatter-chips.js +11 -0
- package/dist/components/files/frontmatter-chips.js.map +1 -0
- package/dist/components/files/frontmatter-panel.d.ts +5 -1
- package/dist/components/files/frontmatter-panel.d.ts.map +1 -1
- package/dist/components/files/frontmatter-panel.js +7 -6
- package/dist/components/files/frontmatter-panel.js.map +1 -1
- package/dist/components/files/staleness.d.ts +18 -0
- package/dist/components/files/staleness.d.ts.map +1 -0
- package/dist/components/files/staleness.js +27 -0
- package/dist/components/files/staleness.js.map +1 -0
- package/dist/components/graph/graph-canvas.d.ts.map +1 -1
- package/dist/components/graph/graph-canvas.js +24 -1
- package/dist/components/graph/graph-canvas.js.map +1 -1
- package/dist/components/graph/graph-controls-column.d.ts +14 -0
- package/dist/components/graph/graph-controls-column.d.ts.map +1 -0
- package/dist/components/graph/graph-controls-column.js +44 -0
- package/dist/components/graph/graph-controls-column.js.map +1 -0
- package/dist/components/graph/graph-controls.d.ts +20 -5
- package/dist/components/graph/graph-controls.d.ts.map +1 -1
- package/dist/components/graph/graph-controls.js +58 -37
- package/dist/components/graph/graph-controls.js.map +1 -1
- package/dist/components/graph/graph-form.d.ts +82 -0
- package/dist/components/graph/graph-form.d.ts.map +1 -0
- package/dist/components/graph/graph-form.js +69 -0
- package/dist/components/graph/graph-form.js.map +1 -0
- package/dist/components/graph/graph-maintenance.d.ts.map +1 -1
- package/dist/components/graph/graph-maintenance.js +6 -10
- package/dist/components/graph/graph-maintenance.js.map +1 -1
- package/dist/components/graph/graph-node-rail.d.ts +13 -0
- package/dist/components/graph/graph-node-rail.d.ts.map +1 -0
- package/dist/components/graph/graph-node-rail.js +92 -0
- package/dist/components/graph/graph-node-rail.js.map +1 -0
- package/dist/components/graph/graph-page.d.ts +7 -0
- package/dist/components/graph/graph-page.d.ts.map +1 -1
- package/dist/components/graph/graph-page.js +102 -12
- package/dist/components/graph/graph-page.js.map +1 -1
- package/dist/components/graph/graph-scene.d.ts.map +1 -1
- package/dist/components/graph/graph-scene.js +100 -24
- package/dist/components/graph/graph-scene.js.map +1 -1
- package/dist/components/graph/lib/graph-helpers.d.ts +42 -12
- package/dist/components/graph/lib/graph-helpers.d.ts.map +1 -1
- package/dist/components/graph/lib/graph-helpers.js +33 -41
- package/dist/components/graph/lib/graph-helpers.js.map +1 -1
- package/dist/components/graph/node-card.d.ts +28 -0
- package/dist/components/graph/node-card.d.ts.map +1 -0
- package/dist/components/graph/node-card.js +7 -0
- package/dist/components/graph/node-card.js.map +1 -0
- package/dist/components/graph/node-popover.d.ts +6 -2
- package/dist/components/graph/node-popover.d.ts.map +1 -1
- package/dist/components/graph/node-popover.js +13 -31
- package/dist/components/graph/node-popover.js.map +1 -1
- package/dist/components/graph/use-graph-theme.d.ts +32 -4
- package/dist/components/graph/use-graph-theme.d.ts.map +1 -1
- package/dist/components/graph/use-graph-theme.js +44 -32
- package/dist/components/graph/use-graph-theme.js.map +1 -1
- package/dist/components/graph/use-node-actions.d.ts +26 -0
- package/dist/components/graph/use-node-actions.d.ts.map +1 -0
- package/dist/components/graph/use-node-actions.js +54 -0
- package/dist/components/graph/use-node-actions.js.map +1 -0
- package/dist/components/images/image-share.d.ts +2 -1
- package/dist/components/images/image-share.d.ts.map +1 -1
- package/dist/components/images/image-share.js +3 -3
- package/dist/components/images/image-share.js.map +1 -1
- package/dist/components/images/image-viewer.d.ts.map +1 -1
- package/dist/components/images/image-viewer.js +3 -1
- package/dist/components/images/image-viewer.js.map +1 -1
- package/dist/components/images/mask-editor.d.ts.map +1 -1
- package/dist/components/images/mask-editor.js +7 -5
- package/dist/components/images/mask-editor.js.map +1 -1
- package/dist/components/layout/app-shell.d.ts.map +1 -1
- package/dist/components/layout/app-shell.js +4 -1
- package/dist/components/layout/app-shell.js.map +1 -1
- package/dist/components/layout/desktop-palette.d.ts +23 -0
- package/dist/components/layout/desktop-palette.d.ts.map +1 -0
- package/dist/components/layout/desktop-palette.js +132 -0
- package/dist/components/layout/desktop-palette.js.map +1 -0
- package/dist/components/layout/key-cap.d.ts +9 -0
- package/dist/components/layout/key-cap.d.ts.map +1 -0
- package/dist/components/layout/key-cap.js +10 -0
- package/dist/components/layout/key-cap.js.map +1 -0
- package/dist/components/layout/mobile-tab-bar.d.ts +13 -0
- package/dist/components/layout/mobile-tab-bar.d.ts.map +1 -1
- package/dist/components/layout/mobile-tab-bar.js +58 -47
- package/dist/components/layout/mobile-tab-bar.js.map +1 -1
- package/dist/components/layout/shortcut-switch.d.ts +13 -0
- package/dist/components/layout/shortcut-switch.d.ts.map +1 -0
- package/dist/components/layout/shortcut-switch.js +22 -0
- package/dist/components/layout/shortcut-switch.js.map +1 -0
- package/dist/components/layout/side-rail.d.ts +28 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +72 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +25 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +13 -4
- package/dist/components/layout/slide-panel.js.map +1 -1
- package/dist/components/layout/theme.d.ts +22 -0
- package/dist/components/layout/theme.d.ts.map +1 -0
- package/dist/components/layout/theme.js +44 -0
- package/dist/components/layout/theme.js.map +1 -0
- package/dist/components/quick-actions/add-form.d.ts +44 -0
- package/dist/components/quick-actions/add-form.d.ts.map +1 -0
- package/dist/components/quick-actions/add-form.js +32 -0
- package/dist/components/quick-actions/add-form.js.map +1 -0
- package/dist/components/quick-actions/add-modal.d.ts +7 -0
- package/dist/components/quick-actions/add-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/add-modal.js +23 -20
- package/dist/components/quick-actions/add-modal.js.map +1 -1
- package/dist/components/quick-actions/search-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/search-modal.js +8 -5
- package/dist/components/quick-actions/search-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-modal.d.ts +6 -0
- package/dist/components/quick-actions/streaming-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/streaming-modal.js +53 -18
- package/dist/components/quick-actions/streaming-modal.js.map +1 -1
- package/dist/components/quick-actions/streaming-output.d.ts +38 -0
- package/dist/components/quick-actions/streaming-output.d.ts.map +1 -0
- package/dist/components/quick-actions/streaming-output.js +22 -0
- package/dist/components/quick-actions/streaming-output.js.map +1 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts +5 -0
- package/dist/components/quick-actions/whatsup-modal.d.ts.map +1 -1
- package/dist/components/quick-actions/whatsup-modal.js +51 -10
- package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
- package/dist/components/settings/devices-agents-tab.d.ts +6 -1
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -1
- package/dist/components/settings/devices-agents-tab.js +55 -20
- package/dist/components/settings/devices-agents-tab.js.map +1 -1
- package/dist/components/settings/models-list.d.ts +39 -0
- package/dist/components/settings/models-list.d.ts.map +1 -0
- package/dist/components/settings/models-list.js +72 -0
- package/dist/components/settings/models-list.js.map +1 -0
- package/dist/components/settings/models-tab.d.ts +4 -0
- package/dist/components/settings/models-tab.d.ts.map +1 -1
- package/dist/components/settings/models-tab.js +52 -102
- package/dist/components/settings/models-tab.js.map +1 -1
- package/dist/components/settings/one-time-agent-credential.js +1 -1
- package/dist/components/settings/one-time-agent-credential.js.map +1 -1
- package/dist/components/settings/passkey-list.d.ts +35 -0
- package/dist/components/settings/passkey-list.d.ts.map +1 -0
- package/dist/components/settings/passkey-list.js +34 -0
- package/dist/components/settings/passkey-list.js.map +1 -0
- package/dist/components/settings/passkey-tab.d.ts +3 -0
- package/dist/components/settings/passkey-tab.d.ts.map +1 -1
- package/dist/components/settings/passkey-tab.js +53 -45
- package/dist/components/settings/passkey-tab.js.map +1 -1
- package/dist/components/settings/pi-accounts-list.d.ts +27 -0
- package/dist/components/settings/pi-accounts-list.d.ts.map +1 -0
- package/dist/components/settings/pi-accounts-list.js +15 -0
- package/dist/components/settings/pi-accounts-list.js.map +1 -0
- package/dist/components/settings/pi-accounts.d.ts +3 -0
- package/dist/components/settings/pi-accounts.d.ts.map +1 -1
- package/dist/components/settings/pi-accounts.js +73 -55
- package/dist/components/settings/pi-accounts.js.map +1 -1
- package/dist/components/settings/principal-list.d.ts +37 -0
- package/dist/components/settings/principal-list.d.ts.map +1 -0
- package/dist/components/settings/principal-list.js +18 -0
- package/dist/components/settings/principal-list.js.map +1 -0
- package/dist/components/settings/settings-panel.d.ts +10 -3
- package/dist/components/settings/settings-panel.d.ts.map +1 -1
- package/dist/components/settings/settings-panel.js +71 -10
- package/dist/components/settings/settings-panel.js.map +1 -1
- package/dist/components/settings/skills-list.d.ts +53 -0
- package/dist/components/settings/skills-list.d.ts.map +1 -0
- package/dist/components/settings/skills-list.js +28 -0
- package/dist/components/settings/skills-list.js.map +1 -0
- package/dist/components/settings/skills-tab.d.ts.map +1 -1
- package/dist/components/settings/skills-tab.js +65 -38
- package/dist/components/settings/skills-tab.js.map +1 -1
- package/dist/components/settings/tool-permissions-list.d.ts +18 -0
- package/dist/components/settings/tool-permissions-list.d.ts.map +1 -0
- package/dist/components/settings/tool-permissions-list.js +6 -0
- package/dist/components/settings/tool-permissions-list.js.map +1 -0
- package/dist/components/settings/tool-permissions.d.ts +2 -1
- package/dist/components/settings/tool-permissions.d.ts.map +1 -1
- package/dist/components/settings/tool-permissions.js +33 -16
- package/dist/components/settings/tool-permissions.js.map +1 -1
- package/dist/components/settings/web-search-chain.d.ts +41 -0
- package/dist/components/settings/web-search-chain.d.ts.map +1 -0
- package/dist/components/settings/web-search-chain.js +47 -0
- package/dist/components/settings/web-search-chain.js.map +1 -0
- package/dist/components/settings/web-search-settings.d.ts +4 -7
- package/dist/components/settings/web-search-settings.d.ts.map +1 -1
- package/dist/components/settings/web-search-settings.js +54 -76
- package/dist/components/settings/web-search-settings.js.map +1 -1
- package/dist/components/share/share-menu.d.ts.map +1 -1
- package/dist/components/share/share-menu.js +24 -4
- package/dist/components/share/share-menu.js.map +1 -1
- package/dist/components/voice/dictation-sheet.js +3 -3
- package/dist/components/voice/dictation-sheet.js.map +1 -1
- package/dist/components/voice/mic-button.js +1 -1
- package/dist/components/voice/mic-button.js.map +1 -1
- package/dist/components/voice/review-card.js +1 -1
- package/dist/components/voice/review-card.js.map +1 -1
- package/dist/config.d.ts +5 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -5
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +12 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +421 -0
- package/dist/connection.js.map +1 -0
- package/dist/default-root.d.ts +3 -0
- package/dist/default-root.d.ts.map +1 -0
- package/dist/default-root.js +16 -0
- package/dist/default-root.js.map +1 -0
- package/dist/hooks/use-color-scheme.d.ts +14 -0
- package/dist/hooks/use-color-scheme.d.ts.map +1 -0
- package/dist/hooks/use-color-scheme.js +37 -0
- package/dist/hooks/use-color-scheme.js.map +1 -0
- package/dist/hooks/use-fine-pointer.d.ts +12 -0
- package/dist/hooks/use-fine-pointer.d.ts.map +1 -0
- package/dist/hooks/use-fine-pointer.js +15 -0
- package/dist/hooks/use-fine-pointer.js.map +1 -0
- package/dist/hooks/use-hash-routes.d.ts.map +1 -1
- package/dist/hooks/use-hash-routes.js +4 -2
- package/dist/hooks/use-hash-routes.js.map +1 -1
- package/dist/hooks/use-media-query.d.ts +9 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +38 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-share-intake.d.ts.map +1 -1
- package/dist/hooks/use-share-intake.js +37 -12
- package/dist/hooks/use-share-intake.js.map +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +17 -18
- package/dist/hooks/use-vpn-status.js.map +1 -1
- package/dist/hooks/use-websocket.d.ts +5 -24
- package/dist/hooks/use-websocket.d.ts.map +1 -1
- package/dist/hooks/use-websocket.js +11 -384
- package/dist/hooks/use-websocket.js.map +1 -1
- package/dist/hooks/websocket-handlers/activity.d.ts +2 -2
- package/dist/hooks/websocket-handlers/activity.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/activity.js +4 -5
- package/dist/hooks/websocket-handlers/activity.js.map +1 -1
- package/dist/hooks/websocket-handlers/chat.d.ts +1 -0
- package/dist/hooks/websocket-handlers/chat.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/chat.js +28 -6
- package/dist/hooks/websocket-handlers/chat.js.map +1 -1
- package/dist/hooks/websocket-handlers/connection.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/connection.js +4 -6
- package/dist/hooks/websocket-handlers/connection.js.map +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts +1 -1
- package/dist/hooks/websocket-handlers/mask.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/mask.js +2 -3
- package/dist/hooks/websocket-handlers/mask.js.map +1 -1
- package/dist/hooks/websocket-handlers/provider.d.ts.map +1 -1
- package/dist/hooks/websocket-handlers/provider.js +4 -6
- package/dist/hooks/websocket-handlers/provider.js.map +1 -1
- package/dist/hooks/websocket-handlers/types.d.ts +6 -2
- package/dist/hooks/websocket-handlers/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +289 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -224
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/backend.d.ts +19 -2
- package/dist/lib/backend.d.ts.map +1 -1
- package/dist/lib/backend.js +15 -9
- package/dist/lib/backend.js.map +1 -1
- package/dist/lib/diff.d.ts +8 -10
- package/dist/lib/diff.d.ts.map +1 -1
- package/dist/lib/diff.js +26 -53
- package/dist/lib/diff.js.map +1 -1
- package/dist/lib/light-dark.d.ts +37 -0
- package/dist/lib/light-dark.d.ts.map +1 -0
- package/dist/lib/light-dark.js +83 -0
- package/dist/lib/light-dark.js.map +1 -0
- package/dist/lib/mermaid-theme.d.ts +7 -2
- package/dist/lib/mermaid-theme.d.ts.map +1 -1
- package/dist/lib/mermaid-theme.js +125 -203
- package/dist/lib/mermaid-theme.js.map +1 -1
- package/dist/lib/passkeys.d.ts +6 -3
- package/dist/lib/passkeys.d.ts.map +1 -1
- package/dist/lib/passkeys.js +10 -4
- package/dist/lib/passkeys.js.map +1 -1
- package/dist/lib/push-registration.d.ts +4 -1
- package/dist/lib/push-registration.d.ts.map +1 -1
- package/dist/lib/push-registration.js +20 -2
- package/dist/lib/push-registration.js.map +1 -1
- package/dist/lib/share-intake.d.ts +2 -1
- package/dist/lib/share-intake.d.ts.map +1 -1
- package/dist/lib/share-intake.js +3 -3
- package/dist/lib/share-intake.js.map +1 -1
- package/dist/lib/share.d.ts +4 -3
- package/dist/lib/share.d.ts.map +1 -1
- package/dist/lib/share.js +6 -7
- package/dist/lib/share.js.map +1 -1
- package/dist/lib/single-key.d.ts +30 -0
- package/dist/lib/single-key.d.ts.map +1 -0
- package/dist/lib/single-key.js +45 -0
- package/dist/lib/single-key.js.map +1 -0
- package/dist/lib/tool-names.d.ts +8 -6
- package/dist/lib/tool-names.d.ts.map +1 -1
- package/dist/lib/tool-names.js +17 -7
- package/dist/lib/tool-names.js.map +1 -1
- package/dist/root-context.d.ts +229 -0
- package/dist/root-context.d.ts.map +1 -0
- package/dist/root-context.js +33 -0
- package/dist/root-context.js.map +1 -0
- package/dist/root.d.ts +38 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +47 -0
- package/dist/root.js.map +1 -0
- package/dist/stores/activity-state.d.ts +29 -0
- package/dist/stores/activity-state.d.ts.map +1 -0
- package/dist/stores/activity-state.js +282 -0
- package/dist/stores/activity-state.js.map +1 -0
- package/dist/stores/activity-store.d.ts +10 -41
- package/dist/stores/activity-store.d.ts.map +1 -1
- package/dist/stores/activity-store.js +9 -271
- package/dist/stores/activity-store.js.map +1 -1
- package/dist/stores/chat-state.d.ts +233 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +477 -0
- package/dist/stores/chat-state.js.map +1 -0
- package/dist/stores/chat-store.d.ts +4 -162
- package/dist/stores/chat-store.d.ts.map +1 -1
- package/dist/stores/chat-store.js +7 -418
- package/dist/stores/chat-store.js.map +1 -1
- package/dist/stores/connection-state.d.ts +40 -0
- package/dist/stores/connection-state.d.ts.map +1 -0
- package/dist/stores/connection-state.js +30 -0
- package/dist/stores/connection-state.js.map +1 -0
- package/dist/stores/connection-store.d.ts +4 -40
- package/dist/stores/connection-store.d.ts.map +1 -1
- package/dist/stores/connection-store.js +7 -27
- package/dist/stores/connection-store.js.map +1 -1
- package/dist/stores/create-stores.d.ts +23 -0
- package/dist/stores/create-stores.d.ts.map +1 -0
- package/dist/stores/create-stores.js +28 -0
- package/dist/stores/create-stores.js.map +1 -0
- package/dist/stores/file-state.d.ts +53 -0
- package/dist/stores/file-state.d.ts.map +1 -0
- package/dist/stores/file-state.js +341 -0
- package/dist/stores/file-state.js.map +1 -0
- package/dist/stores/file-store.d.ts +4 -52
- package/dist/stores/file-store.d.ts.map +1 -1
- package/dist/stores/file-store.js +7 -336
- package/dist/stores/file-store.js.map +1 -1
- package/dist/stores/graph-state.d.ts +95 -0
- package/dist/stores/graph-state.d.ts.map +1 -0
- package/dist/stores/graph-state.js +252 -0
- package/dist/stores/graph-state.js.map +1 -0
- package/dist/stores/graph-store.d.ts +7 -83
- package/dist/stores/graph-store.d.ts.map +1 -1
- package/dist/stores/graph-store.js +8 -249
- package/dist/stores/graph-store.js.map +1 -1
- package/dist/stores/mask-state.d.ts +21 -0
- package/dist/stores/mask-state.d.ts.map +1 -0
- package/dist/stores/mask-state.js +9 -0
- package/dist/stores/mask-state.js.map +1 -0
- package/dist/stores/mask-store.d.ts +4 -21
- package/dist/stores/mask-store.d.ts.map +1 -1
- package/dist/stores/mask-store.js +7 -6
- package/dist/stores/mask-store.js.map +1 -1
- package/dist/stores/principal-state.d.ts +16 -0
- package/dist/stores/principal-state.d.ts.map +1 -0
- package/dist/stores/principal-state.js +31 -0
- package/dist/stores/principal-state.js.map +1 -0
- package/dist/stores/principal-store.d.ts +4 -15
- package/dist/stores/principal-store.d.ts.map +1 -1
- package/dist/stores/principal-store.js +7 -28
- package/dist/stores/principal-store.js.map +1 -1
- package/dist/stores/provider-state.d.ts +24 -0
- package/dist/stores/provider-state.d.ts.map +1 -0
- package/dist/stores/provider-state.js +68 -0
- package/dist/stores/provider-state.js.map +1 -0
- package/dist/stores/provider-store.d.ts +4 -23
- package/dist/stores/provider-store.d.ts.map +1 -1
- package/dist/stores/provider-store.js +7 -64
- package/dist/stores/provider-store.js.map +1 -1
- package/dist/stores/share-state.d.ts +29 -0
- package/dist/stores/share-state.d.ts.map +1 -0
- package/dist/stores/share-state.js +21 -0
- package/dist/stores/share-state.js.map +1 -0
- package/dist/stores/share-store.d.ts +4 -28
- package/dist/stores/share-store.d.ts.map +1 -1
- package/dist/stores/share-store.js +7 -18
- package/dist/stores/share-store.js.map +1 -1
- package/dist/stores/store-environment.d.ts +10 -0
- package/dist/stores/store-environment.d.ts.map +1 -0
- package/dist/stores/store-environment.js +2 -0
- package/dist/stores/store-environment.js.map +1 -0
- package/dist/stores/ui-state.d.ts +71 -0
- package/dist/stores/ui-state.d.ts.map +1 -0
- package/dist/stores/ui-state.js +58 -0
- package/dist/stores/ui-state.js.map +1 -0
- package/dist/stores/ui-store.d.ts +4 -45
- package/dist/stores/ui-store.d.ts.map +1 -1
- package/dist/stores/ui-store.js +7 -36
- package/dist/stores/ui-store.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +150 -97
- package/dist/voice/asr-clients.d.ts +2 -1
- package/dist/voice/asr-clients.d.ts.map +1 -1
- package/dist/voice/asr-clients.js +16 -17
- package/dist/voice/asr-clients.js.map +1 -1
- package/dist/voice/use-dictation.d.ts.map +1 -1
- package/dist/voice/use-dictation.js +12 -8
- package/dist/voice/use-dictation.js.map +1 -1
- package/dist/voice/voice-state.d.ts +25 -0
- package/dist/voice/voice-state.d.ts.map +1 -0
- package/dist/voice/voice-state.js +29 -0
- package/dist/voice/voice-state.js.map +1 -0
- package/dist/voice/voice-store.d.ts +4 -25
- package/dist/voice/voice-store.d.ts.map +1 -1
- package/dist/voice/voice-store.js +7 -26
- package/dist/voice/voice-store.js.map +1 -1
- package/package.json +3 -2
- package/src/components/activity/activity-page.tsx +341 -160
- package/src/components/activity/activity-run-detail.tsx +81 -47
- package/src/components/activity/activity-run-list.tsx +27 -59
- package/src/components/activity/activity-views.tsx +155 -0
- package/src/components/activity/approval-card.tsx +117 -0
- package/src/components/activity/digest-card.tsx +25 -61
- package/src/components/activity/digest-summary.tsx +52 -0
- package/src/components/activity/push-switch.tsx +62 -0
- package/src/components/activity/push-toggle.tsx +51 -81
- package/src/components/activity/span-bits.tsx +60 -7
- package/src/components/chat/ask-user-card.tsx +292 -356
- package/src/components/chat/ask-user-typed.ts +77 -0
- package/src/components/chat/brain-markdown-links.tsx +4 -4
- package/src/components/chat/brain-markdown.tsx +4 -2
- package/src/components/chat/chat-page.tsx +41 -11
- package/src/components/chat/composer-view.tsx +194 -0
- package/src/components/chat/composer.tsx +117 -296
- package/src/components/chat/markdown-content.tsx +53 -2
- package/src/components/chat/mermaid-block.tsx +13 -5
- package/src/components/chat/mermaid-share.ts +8 -7
- package/src/components/chat/mermaid-viewer.tsx +3 -1
- package/src/components/chat/message-bubble.tsx +78 -94
- package/src/components/chat/message-share.ts +7 -7
- package/src/components/chat/renderers/bind.tsx +94 -0
- package/src/components/chat/renderers/brain-ui-tools.tsx +56 -0
- package/src/components/chat/renderers/claude-tools.tsx +3 -2
- package/src/components/chat/renderers/index.ts +15 -10
- package/src/components/chat/session-drawer.tsx +41 -138
- package/src/components/chat/session-list.tsx +113 -0
- package/src/components/chat/share-block.tsx +16 -12
- package/src/components/chat/share-card.tsx +2 -2
- package/src/components/chat/subagent-view.tsx +4 -4
- package/src/components/chat/tool-call-timeline.tsx +75 -26
- package/src/components/chat/tool-cards/block-card.tsx +145 -0
- package/src/components/chat/tool-cards/image-mask-card.tsx +214 -0
- package/src/components/chat/tool-cards/location-card.tsx +159 -0
- package/src/components/chat/tool-views.tsx +30 -60
- package/src/components/chat/transcript-turn.tsx +108 -0
- package/src/components/chat/use-chat-commands.ts +14 -16
- package/src/components/chat/welcome-state.tsx +36 -91
- package/src/components/connectivity/connection-gate.tsx +32 -24
- package/src/components/connectivity/login-form.tsx +122 -0
- package/src/components/connectivity/login-screen.tsx +45 -100
- package/src/components/dev/share-harness.tsx +2 -2
- package/src/components/files/file-panel.tsx +168 -0
- package/src/components/files/file-tree-view.tsx +127 -0
- package/src/components/files/file-tree.tsx +55 -109
- package/src/components/files/file-viewer-binary.tsx +3 -2
- package/src/components/files/file-viewer-frame.tsx +113 -0
- package/src/components/files/file-viewer.tsx +40 -95
- package/src/components/files/frontmatter-chips.tsx +42 -0
- package/src/components/files/frontmatter-panel.tsx +6 -71
- package/src/components/files/staleness.ts +29 -0
- package/src/components/graph/graph-canvas.tsx +24 -1
- package/src/components/graph/graph-controls-column.tsx +92 -0
- package/src/components/graph/graph-controls.tsx +83 -127
- package/src/components/graph/graph-form.tsx +183 -0
- package/src/components/graph/graph-maintenance.tsx +9 -14
- package/src/components/graph/graph-node-rail.tsx +147 -0
- package/src/components/graph/graph-page.tsx +189 -49
- package/src/components/graph/graph-scene.tsx +200 -30
- package/src/components/graph/lib/graph-helpers.ts +65 -43
- package/src/components/graph/node-card.tsx +64 -0
- package/src/components/graph/node-popover.tsx +28 -117
- package/src/components/graph/use-graph-theme.ts +69 -32
- package/src/components/graph/use-node-actions.ts +56 -0
- package/src/components/images/image-share.ts +4 -2
- package/src/components/images/image-viewer.tsx +3 -1
- package/src/components/images/mask-editor.tsx +7 -4
- package/src/components/layout/app-shell.tsx +5 -1
- package/src/components/layout/desktop-palette.tsx +151 -0
- package/src/components/layout/key-cap.tsx +15 -0
- package/src/components/layout/mobile-tab-bar.tsx +80 -157
- package/src/components/layout/shortcut-switch.tsx +32 -0
- package/src/components/layout/side-rail.tsx +77 -150
- package/src/components/layout/slide-panel.tsx +49 -6
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +196 -0
- package/src/components/quick-actions/add-modal.tsx +32 -153
- package/src/components/quick-actions/search-modal.tsx +15 -5
- package/src/components/quick-actions/streaming-modal.tsx +57 -72
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +53 -59
- package/src/components/settings/devices-agents-tab.tsx +60 -152
- package/src/components/settings/models-list.tsx +299 -0
- package/src/components/settings/models-tab.tsx +63 -337
- package/src/components/settings/one-time-agent-credential.tsx +1 -1
- package/src/components/settings/passkey-list.tsx +201 -0
- package/src/components/settings/passkey-tab.tsx +53 -197
- package/src/components/settings/pi-accounts-list.tsx +128 -0
- package/src/components/settings/pi-accounts.tsx +71 -170
- package/src/components/settings/principal-list.tsx +172 -0
- package/src/components/settings/settings-panel.tsx +239 -25
- package/src/components/settings/skills-list.tsx +276 -0
- package/src/components/settings/skills-tab.tsx +82 -269
- package/src/components/settings/tool-permissions-list.tsx +54 -0
- package/src/components/settings/tool-permissions.tsx +27 -46
- package/src/components/settings/web-search-chain.tsx +300 -0
- package/src/components/settings/web-search-settings.tsx +58 -328
- package/src/components/share/share-menu.tsx +19 -4
- package/src/components/voice/dictation-sheet.tsx +5 -5
- package/src/components/voice/mic-button.tsx +1 -1
- package/src/components/voice/review-card.tsx +1 -1
- package/src/config.ts +21 -7
- package/src/connection.ts +443 -0
- package/src/default-root.ts +16 -0
- package/src/hooks/use-color-scheme.ts +36 -0
- package/src/hooks/use-fine-pointer.ts +15 -0
- package/src/hooks/use-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +35 -0
- package/src/hooks/use-share-intake.ts +32 -12
- package/src/hooks/use-vpn-status.ts +18 -17
- package/src/hooks/use-websocket.ts +12 -428
- package/src/hooks/websocket-handlers/activity.ts +4 -5
- package/src/hooks/websocket-handlers/chat.ts +28 -6
- package/src/hooks/websocket-handlers/connection.ts +4 -6
- package/src/hooks/websocket-handlers/mask.ts +2 -3
- package/src/hooks/websocket-handlers/provider.ts +4 -6
- package/src/hooks/websocket-handlers/types.ts +6 -2
- package/src/index.ts +7 -3
- package/src/lib/api-client.ts +426 -384
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/light-dark.ts +83 -0
- package/src/lib/mermaid-theme.ts +183 -214
- package/src/lib/passkeys.ts +12 -4
- package/src/lib/push-registration.ts +19 -2
- package/src/lib/share-intake.ts +6 -3
- package/src/lib/share.ts +7 -4
- package/src/lib/single-key.ts +47 -0
- package/src/lib/tool-names.ts +31 -8
- package/src/root-context.tsx +40 -0
- package/src/root.ts +83 -0
- package/src/stores/activity-state.ts +295 -0
- package/src/stores/activity-store.ts +11 -285
- package/src/stores/chat-state.ts +822 -0
- package/src/stores/chat-store.ts +11 -705
- package/src/stores/connection-state.ts +78 -0
- package/src/stores/connection-store.ts +11 -76
- package/src/stores/create-stores.ts +31 -0
- package/src/stores/file-state.ts +399 -0
- package/src/stores/file-store.ts +9 -390
- package/src/stores/graph-state.ts +368 -0
- package/src/stores/graph-store.ts +10 -355
- package/src/stores/mask-state.ts +30 -0
- package/src/stores/mask-store.ts +10 -27
- package/src/stores/principal-state.ts +42 -0
- package/src/stores/principal-store.ts +10 -37
- package/src/stores/provider-state.ts +103 -0
- package/src/stores/provider-store.ts +10 -95
- package/src/stores/share-state.ts +56 -0
- package/src/stores/share-store.ts +11 -54
- package/src/stores/store-environment.ts +10 -0
- package/src/stores/ui-state.ts +143 -0
- package/src/stores/ui-store.ts +11 -93
- package/src/styles.css +4 -1
- package/src/theme.css +150 -97
- package/src/voice/asr-clients.ts +17 -17
- package/src/voice/use-dictation.ts +11 -8
- package/src/voice/voice-state.ts +57 -0
- package/src/voice/voice-store.ts +11 -55
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
2
3
|
import { Brain, WifiOff, ShieldAlert } from "lucide-react";
|
|
3
4
|
import { motion, AnimatePresence } from "framer-motion";
|
|
4
5
|
import { useConnectionStore } from "../../stores/connection-store.js";
|
|
5
6
|
import { useEffect, useRef, useState } from "react";
|
|
6
7
|
import { LoginScreen } from "./login-screen.js";
|
|
7
8
|
import { useVpnStatus } from "../../hooks/use-vpn-status.js";
|
|
8
|
-
import { reconnectWebSocketNow } from "../../hooks/use-websocket.js";
|
|
9
9
|
import { deriveConnectionIssue, } from "./connection-state.js";
|
|
10
10
|
import { rebindPushSubscriptionAfterLogin } from "../../lib/push-registration.js";
|
|
11
11
|
const INITIAL_PUSH_REBIND_BACKOFF_MS = 1_000;
|
|
12
12
|
const MAX_PUSH_REBIND_BACKOFF_MS = 60_000;
|
|
13
|
+
function newPushRebind() {
|
|
14
|
+
return {
|
|
15
|
+
pending: true,
|
|
16
|
+
inFlight: false,
|
|
17
|
+
retryReady: true,
|
|
18
|
+
backoffMs: INITIAL_PUSH_REBIND_BACKOFF_MS,
|
|
19
|
+
retryTimer: undefined,
|
|
20
|
+
controller: new AbortController(),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
13
23
|
export function ConnectionGate({ children }) {
|
|
24
|
+
const root = useBrainUiRoot();
|
|
14
25
|
// The gate owns its connectivity probe — composing <ConnectionGate> is all
|
|
15
26
|
// an embedder needs; the store would otherwise sit on "checking" forever.
|
|
16
27
|
const successfulProbeCount = useVpnStatus();
|
|
@@ -25,27 +36,21 @@ export function ConnectionGate({ children }) {
|
|
|
25
36
|
});
|
|
26
37
|
// Once the app has connected, never unmount the UI again — an intermittent
|
|
27
38
|
// drop must not destroy rendered chat state. Show a banner instead.
|
|
28
|
-
const [
|
|
39
|
+
const [connectedRoot, setConnectedRoot] = useState(null);
|
|
40
|
+
const everConnected = connectedRoot === root;
|
|
29
41
|
useEffect(() => {
|
|
30
42
|
if (vpnStatus === "connected")
|
|
31
|
-
|
|
32
|
-
}, [vpnStatus]);
|
|
33
|
-
const pushRebind = useRef(
|
|
34
|
-
pending: true,
|
|
35
|
-
inFlight: false,
|
|
36
|
-
retryReady: true,
|
|
37
|
-
backoffMs: INITIAL_PUSH_REBIND_BACKOFF_MS,
|
|
38
|
-
retryTimer: undefined,
|
|
39
|
-
disposed: false,
|
|
40
|
-
});
|
|
43
|
+
setConnectedRoot(root);
|
|
44
|
+
}, [vpnStatus, root]);
|
|
45
|
+
const pushRebind = useRef(newPushRebind());
|
|
41
46
|
useEffect(() => {
|
|
42
|
-
const state =
|
|
43
|
-
|
|
47
|
+
const state = newPushRebind();
|
|
48
|
+
pushRebind.current = state;
|
|
44
49
|
return () => {
|
|
45
|
-
state.
|
|
50
|
+
state.controller.abort();
|
|
46
51
|
clearTimeout(state.retryTimer);
|
|
47
52
|
};
|
|
48
|
-
}, []);
|
|
53
|
+
}, [root]);
|
|
49
54
|
// A successful authenticated probe follows a login reload (and is also the
|
|
50
55
|
// boot path for ambient auth modes). Re-assert any browser-held subscription
|
|
51
56
|
// so legacy/unbound rows acquire the current principal. A failed request
|
|
@@ -61,13 +66,13 @@ export function ConnectionGate({ children }) {
|
|
|
61
66
|
return;
|
|
62
67
|
}
|
|
63
68
|
state.inFlight = true;
|
|
64
|
-
void rebindPushSubscriptionAfterLogin().then(() => {
|
|
65
|
-
if (state.
|
|
69
|
+
void rebindPushSubscriptionAfterLogin(root.api, state.controller.signal).then(() => {
|
|
70
|
+
if (state.controller.signal.aborted)
|
|
66
71
|
return;
|
|
67
72
|
state.inFlight = false;
|
|
68
73
|
state.pending = false;
|
|
69
74
|
}, () => {
|
|
70
|
-
if (state.
|
|
75
|
+
if (state.controller.signal.aborted)
|
|
71
76
|
return;
|
|
72
77
|
state.inFlight = false;
|
|
73
78
|
state.retryReady = false;
|
|
@@ -78,7 +83,7 @@ export function ConnectionGate({ children }) {
|
|
|
78
83
|
state.retryTimer = undefined;
|
|
79
84
|
}, delay);
|
|
80
85
|
});
|
|
81
|
-
}, [successfulProbeCount, vpnStatus]);
|
|
86
|
+
}, [successfulProbeCount, vpnStatus, root]);
|
|
82
87
|
const refused = issue === "refused" || issue === "capacity";
|
|
83
88
|
const wasRefused = useRef(false);
|
|
84
89
|
useEffect(() => {
|
|
@@ -114,6 +119,7 @@ export function ConnectionGate({ children }) {
|
|
|
114
119
|
* backoff both tighten while offline).
|
|
115
120
|
*/
|
|
116
121
|
function OfflineBanner({ show, issue, }) {
|
|
122
|
+
const root = useBrainUiRoot();
|
|
117
123
|
const message = issue === "forbidden"
|
|
118
124
|
? "VPN required — reconnect Tailscale"
|
|
119
125
|
: issue === "unreachable"
|
|
@@ -123,6 +129,6 @@ function OfflineBanner({ show, issue, }) {
|
|
|
123
129
|
: issue === "refused"
|
|
124
130
|
? "Server refused the live connection"
|
|
125
131
|
: "Connection lost — reconnecting…";
|
|
126
|
-
return (_jsx(AnimatePresence, { children: show && (_jsx(motion.div, { initial: { opacity: 0, y: -24 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -24 }, transition: { duration: 0.2 }, className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex justify-center px-4 pt-3", children: _jsxs("div", { role: "status", className: "pointer-events-auto flex items-center gap-2 rounded-full border border-
|
|
132
|
+
return (_jsx(AnimatePresence, { children: show && (_jsx(motion.div, { initial: { opacity: 0, y: -24 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -24 }, transition: { duration: 0.2 }, className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex justify-center px-4 pt-3", children: _jsxs("div", { role: "status", className: "pointer-events-auto flex items-center gap-2 rounded-full border border-primary/30 bg-surface-raised/90 px-4 py-1.5 text-xs text-primary shadow-lg backdrop-blur", children: [issue === "forbidden" ? (_jsx(ShieldAlert, { className: "h-3.5 w-3.5" })) : (_jsx(WifiOff, { className: "h-3.5 w-3.5" })), _jsx("span", { children: message }), (issue === "refused" || issue === "capacity") && (_jsx("button", { type: "button", onClick: root.connection.reconnectNow, className: "font-medium underline underline-offset-2 hover:text-foreground", children: "Retry now" })), _jsx("span", { className: "inline-block h-1.5 w-1.5 rounded-full bg-primary-mark", style: { animation: "breathe 2s ease-in-out infinite" } })] }) })) }));
|
|
127
133
|
}
|
|
128
134
|
//# sourceMappingURL=connection-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-gate.js","sourceRoot":"","sources":["../../../src/components/connectivity/connection-gate.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"connection-gate.js","sourceRoot":"","sources":["../../../src/components/connectivity/connection-gate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACL,qBAAqB,GAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAElF,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAC7C,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAE1C,SAAS,aAAa;IACpB,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,8BAA8B;QACzC,UAAU,EAAE,SAAsD;QAClE,UAAU,EAAE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AAC,CAAC,iCAAiC;gBACnC,CAAC,CAAC,KAAK,KAAK,SAAS;oBACnB,CAAC,CAAC,oCAAoC;oBACtC,CAAC,CAAC,iCAAiC,CAAC;IAE9C,OAAO,CACL,KAAC,eAAe,cACb,IAAI,IAAI,CACP,KAAC,MAAM,CAAC,GAAG,IACT,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAC/B,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAC5B,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAC7B,SAAS,EAAC,gFAAgF,YAE1F,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iKAAiK,aAE1K,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CACvB,KAAC,WAAW,IAAC,SAAS,EAAC,aAAa,GAAG,CACxC,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,IAAC,SAAS,EAAC,aAAa,GAAG,CACpC,EACD,yBAAO,OAAO,GAAQ,EACrB,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU,CAAC,IAAI,CAChD,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,EACrC,SAAS,EAAC,gEAAgE,0BAGnE,CACV,EACD,eACE,SAAS,EAAC,uDAAuD,EACjE,KAAK,EAAE,EAAE,SAAS,EAAE,iCAAiC,EAAE,GACvD,IACE,GACK,CACd,GACe,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The login surface, rendered from props (S6). `LoginScreen` owns the methods
|
|
3
|
+
* probe, the conditional-autofill ceremony, the session cookie and the
|
|
4
|
+
* lifetime guards; this owns nothing but what is on screen.
|
|
5
|
+
*
|
|
6
|
+
* Buttons are the kit's: `primary` for the one that signs you in, and the
|
|
7
|
+
* passkey button is `ghost` beside a password field or `primary` when it is
|
|
8
|
+
* the only way in. The error is a red banner `Callout` inside a live region.
|
|
9
|
+
* The password field stays a native input — the kit has no text input, and
|
|
10
|
+
* `autoComplete="current-password webauthn"` is what lets the browser offer a
|
|
11
|
+
* passkey in the field's autofill.
|
|
12
|
+
*
|
|
13
|
+
* Fail-open by design: `methods.password` defaults to true in the container,
|
|
14
|
+
* so a failed probe still shows the one method that always works.
|
|
15
|
+
*/
|
|
16
|
+
export interface LoginMethods {
|
|
17
|
+
password: boolean;
|
|
18
|
+
passkey: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface LoginFormProps {
|
|
21
|
+
appName: string;
|
|
22
|
+
methods: LoginMethods;
|
|
23
|
+
password: string;
|
|
24
|
+
busy: boolean;
|
|
25
|
+
error: string | null;
|
|
26
|
+
onPasswordChange: (value: string) => void;
|
|
27
|
+
onPassword: () => void;
|
|
28
|
+
onPasskey: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function LoginForm(p: LoginFormProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=login-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../src/components/connectivity/login-form.tsx"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,cAAc,+BAqF1C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Callout, Icon } from "@schlessera/brain-ui-kit";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import { Lock } from "lucide-react";
|
|
5
|
+
export function LoginForm(p) {
|
|
6
|
+
const { password: passwordAvailable, passkey: passkeyAvailable } = p.methods;
|
|
7
|
+
const canSubmit = passwordAvailable && p.password.length > 0 && !p.busy;
|
|
8
|
+
function onSubmit(e) {
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
if (canSubmit)
|
|
11
|
+
p.onPassword();
|
|
12
|
+
}
|
|
13
|
+
return (_jsx("div", { className: "flex h-[100dvh] items-center justify-center bg-background", children: _jsxs(motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3 }, className: "flex w-full max-w-xs flex-col items-center gap-6 px-6 text-center", children: [_jsx("div", { className: "flex h-16 w-16 items-center justify-center rounded-2xl bg-surface", children: _jsx(Icon, { icon: "brain", size: 32, color: "var(--bk-amber-ink)" }) }), _jsxs("div", { children: [_jsx("h1", { className: "font-[family-name:var(--font-display)] text-2xl text-foreground", children: p.appName }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: !passwordAvailable
|
|
14
|
+
? "Sign in with your passkey."
|
|
15
|
+
: passkeyAvailable
|
|
16
|
+
? "Use your passkey or enter the password."
|
|
17
|
+
: "Enter the password to continue." })] }), _jsxs("form", { onSubmit: onSubmit, className: "flex w-full flex-col gap-3", children: [passwordAvailable && (_jsxs("div", { className: "relative", children: [_jsx(Lock, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/60" }), _jsx("input", { type: "password", autoFocus: true, autoComplete: "current-password webauthn", value: p.password, onChange: (e) => p.onPasswordChange(e.target.value), placeholder: "Password", "aria-label": "Password", className: "w-full rounded-lg border border-border-subtle bg-surface py-2 pl-9 pr-3 text-sm text-foreground outline-none transition-colors focus:border-primary" })] })), p.error && (_jsx("div", { role: "alert", children: _jsx(Callout, { tone: "red", variant: "banner", icon: "failed", mono: true, text: p.error }) })), passwordAvailable && (_jsx(Button, { label: p.busy ? "Signing in…" : "Sign in", tone: "primary", size: "md", center: true, disabled: !canSubmit, onClick: p.onPassword })), passkeyAvailable && (_jsx(Button, { label: "Sign in with a passkey", icon: "passkey", tone: passwordAvailable ? "ghost" : "primary", size: "md", center: true, disabled: p.busy, onClick: p.onPasskey })), !passwordAvailable && !passkeyAvailable && (_jsx("p", { className: "text-xs text-muted-foreground", children: "Password login is disabled. Use a device or browser that supports passkeys." }))] })] }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=login-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-form.js","sourceRoot":"","sources":["../../../src/components/connectivity/login-form.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAkCpC,MAAM,UAAU,SAAS,CAAC,CAAiB;IACzC,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC;IAC7E,MAAM,SAAS,GAAG,iBAAiB,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAExE,SAAS,QAAQ,CAAC,CAAY;QAC5B,CAAC,CAAC,cAAc,EAAE,CAAC;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CACV,cAAK,IAAI,EAAC,OAAO,YACf,KAAC,OAAO,IAAC,IAAI,EAAC,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,QAAC,IAAI,EAAE,CAAC,CAAC,KAAK,GAAI,GACrE,CACP,EACA,iBAAiB,IAAI,CACpB,KAAC,MAAM,IACL,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EACzC,IAAI,EAAC,SAAS,EACd,IAAI,EAAC,IAAI,EACT,MAAM,QACN,QAAQ,EAAE,CAAC,SAAS,EACpB,OAAO,EAAE,CAAC,CAAC,UAAU,GACrB,CACH,EACA,gBAAgB,IAAI,CACnB,KAAC,MAAM,IACL,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,SAAS,EACd,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC7C,IAAI,EAAC,IAAI,EACT,MAAM,QACN,QAAQ,EAAE,CAAC,CAAC,IAAI,EAChB,OAAO,EAAE,CAAC,CAAC,SAAS,GACpB,CACH,EACA,CAAC,iBAAiB,IAAI,CAAC,gBAAgB,IAAI,CAC1C,YAAG,SAAS,EAAC,+BAA+B,4FAExC,CACL,IACI,IACI,GACT,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Login, shown when the server is in `password` auth mode and no
|
|
3
|
-
* cookie is present (the /api/vpn-check probe returns 401).
|
|
2
|
+
* Login CONTAINER, shown when the server is in `password` auth mode and no
|
|
3
|
+
* valid session cookie is present (the /api/vpn-check probe returns 401). It
|
|
4
|
+
* owns the methods probe, the conditional-autofill passkey ceremony, the two
|
|
5
|
+
* sign-in requests and the lifetime guard that keeps any of them from acting
|
|
6
|
+
* on a superseded root; `LoginForm` owns the surface (S6). Password is always
|
|
4
7
|
* offered; a passkey button appears when the server reports registered
|
|
5
8
|
* passkeys and the browser supports WebAuthn. On success the browser has the
|
|
6
9
|
* HttpOnly session cookie; a reload boots the authenticated app.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../src/components/connectivity/login-screen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../src/components/connectivity/login-screen.tsx"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,gCA6F1B"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { motion } from "framer-motion";
|
|
6
|
-
import { api } from "../../lib/api-client.js";
|
|
4
|
+
import { LoginForm } from "./login-form.js";
|
|
7
5
|
import { isUserCancel, loginWithPasskey, supportsAutofill, supportsPasskeys, } from "../../lib/passkeys.js";
|
|
8
6
|
/**
|
|
9
|
-
* Login, shown when the server is in `password` auth mode and no
|
|
10
|
-
* cookie is present (the /api/vpn-check probe returns 401).
|
|
7
|
+
* Login CONTAINER, shown when the server is in `password` auth mode and no
|
|
8
|
+
* valid session cookie is present (the /api/vpn-check probe returns 401). It
|
|
9
|
+
* owns the methods probe, the conditional-autofill passkey ceremony, the two
|
|
10
|
+
* sign-in requests and the lifetime guard that keeps any of them from acting
|
|
11
|
+
* on a superseded root; `LoginForm` owns the surface (S6). Password is always
|
|
11
12
|
* offered; a passkey button appears when the server reports registered
|
|
12
13
|
* passkeys and the browser supports WebAuthn. On success the browser has the
|
|
13
14
|
* HttpOnly session cookie; a reload boots the authenticated app.
|
|
14
15
|
*/
|
|
15
16
|
export function LoginScreen() {
|
|
17
|
+
const root = useBrainUiRoot();
|
|
18
|
+
const api = root.api;
|
|
19
|
+
const uiConfig = root.config;
|
|
20
|
+
const lifetime = useRef(new AbortController());
|
|
16
21
|
const [password, setPassword] = useState("");
|
|
17
22
|
const [error, setError] = useState(null);
|
|
18
23
|
const [submitting, setSubmitting] = useState(false);
|
|
@@ -21,13 +26,19 @@ export function LoginScreen() {
|
|
|
21
26
|
// server enforces the real policy, and hiding the only working method on a
|
|
22
27
|
// transient error would be a self-inflicted lockout.
|
|
23
28
|
const [passwordAvailable, setPasswordAvailable] = useState(true);
|
|
24
|
-
const conditionalStarted = useRef(false);
|
|
25
29
|
useEffect(() => {
|
|
26
|
-
|
|
30
|
+
const controller = new AbortController();
|
|
31
|
+
const signal = controller.signal;
|
|
32
|
+
lifetime.current = controller;
|
|
33
|
+
setPassword("");
|
|
34
|
+
setError(null);
|
|
35
|
+
setSubmitting(false);
|
|
36
|
+
setPasskeyAvailable(false);
|
|
37
|
+
setPasswordAvailable(true);
|
|
27
38
|
api
|
|
28
39
|
.authMethods()
|
|
29
40
|
.then(async (methods) => {
|
|
30
|
-
if (
|
|
41
|
+
if (signal.aborted)
|
|
31
42
|
return;
|
|
32
43
|
if (methods.passkey && !methods.password)
|
|
33
44
|
setPasswordAvailable(false);
|
|
@@ -36,15 +47,15 @@ export function LoginScreen() {
|
|
|
36
47
|
setPasskeyAvailable(true);
|
|
37
48
|
// Conditional UI (progressive enhancement): surface passkeys in the
|
|
38
49
|
// password input's autofill. Runs once; a user cancel is not an error.
|
|
39
|
-
if (
|
|
50
|
+
if (!(await supportsAutofill()) || signal.aborted)
|
|
40
51
|
return;
|
|
41
|
-
conditionalStarted.current = true;
|
|
42
52
|
try {
|
|
43
|
-
await loginWithPasskey({ useBrowserAutofill: true });
|
|
44
|
-
|
|
53
|
+
await loginWithPasskey(api, { useBrowserAutofill: true, signal });
|
|
54
|
+
if (!signal.aborted)
|
|
55
|
+
window.location.reload();
|
|
45
56
|
}
|
|
46
57
|
catch (err) {
|
|
47
|
-
if (!isUserCancel(err)) {
|
|
58
|
+
if (!signal.aborted && !isUserCancel(err)) {
|
|
48
59
|
console.warn("[passkeys] conditional UI failed:", err);
|
|
49
60
|
}
|
|
50
61
|
}
|
|
@@ -52,22 +63,23 @@ export function LoginScreen() {
|
|
|
52
63
|
.catch(() => {
|
|
53
64
|
// Methods probe failing degrades to password-only — unchanged behavior.
|
|
54
65
|
});
|
|
55
|
-
return () =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, []);
|
|
59
|
-
async function onSubmit(e) {
|
|
60
|
-
e.preventDefault();
|
|
66
|
+
return () => controller.abort();
|
|
67
|
+
}, [root, api]);
|
|
68
|
+
async function onPasswordLogin() {
|
|
61
69
|
if (!password || submitting)
|
|
62
70
|
return;
|
|
71
|
+
const signal = lifetime.current.signal;
|
|
63
72
|
setSubmitting(true);
|
|
64
73
|
setError(null);
|
|
65
74
|
try {
|
|
66
75
|
await api.login(password);
|
|
67
76
|
// Cookie is set; reload so the app boots authenticated.
|
|
68
|
-
|
|
77
|
+
if (!signal.aborted)
|
|
78
|
+
window.location.reload();
|
|
69
79
|
}
|
|
70
80
|
catch (err) {
|
|
81
|
+
if (signal.aborted)
|
|
82
|
+
return;
|
|
71
83
|
setError(err instanceof Error ? err.message : "Login failed");
|
|
72
84
|
setSubmitting(false);
|
|
73
85
|
}
|
|
@@ -75,25 +87,23 @@ export function LoginScreen() {
|
|
|
75
87
|
async function onPasskeyClick() {
|
|
76
88
|
if (submitting)
|
|
77
89
|
return;
|
|
90
|
+
const signal = lifetime.current.signal;
|
|
78
91
|
setSubmitting(true);
|
|
79
92
|
setError(null);
|
|
80
93
|
try {
|
|
81
|
-
await loginWithPasskey();
|
|
82
|
-
|
|
94
|
+
await loginWithPasskey(api, { signal });
|
|
95
|
+
if (!signal.aborted)
|
|
96
|
+
window.location.reload();
|
|
83
97
|
}
|
|
84
98
|
catch (err) {
|
|
99
|
+
if (signal.aborted)
|
|
100
|
+
return;
|
|
85
101
|
if (!isUserCancel(err)) {
|
|
86
102
|
setError(err instanceof Error ? err.message : "Passkey login failed");
|
|
87
103
|
}
|
|
88
104
|
setSubmitting(false);
|
|
89
105
|
}
|
|
90
106
|
}
|
|
91
|
-
return (_jsx(
|
|
92
|
-
? "Sign in with your passkey."
|
|
93
|
-
: passkeyAvailable
|
|
94
|
-
? "Use your passkey or enter the password."
|
|
95
|
-
: "Enter the password to continue." })] }), _jsxs("form", { onSubmit: onSubmit, className: "flex w-full flex-col gap-3", children: [passwordAvailable && (_jsxs("div", { className: "relative", children: [_jsx(Lock, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/60" }), _jsx("input", { type: "password", autoFocus: true, autoComplete: "current-password webauthn", value: password, onChange: (e) => setPassword(e.target.value), placeholder: "Password", className: "w-full rounded-lg border border-border-subtle bg-surface py-2 pl-9 pr-3 text-sm text-foreground outline-none transition-colors focus:border-primary" })] })), error && (_jsx("p", { role: "alert", className: "text-xs text-destructive", children: error })), passwordAvailable && (_jsx("button", { type: "submit", disabled: submitting || !password, className: "rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:brightness-110 disabled:opacity-50", children: submitting ? "Signing in…" : "Sign in" })), passkeyAvailable && (_jsxs("button", { type: "button", onClick: onPasskeyClick, disabled: submitting, className: passwordAvailable
|
|
96
|
-
? "flex items-center justify-center gap-2 rounded-lg border border-border-subtle bg-surface px-4 py-2 text-sm font-medium text-foreground transition-colors hover:border-primary disabled:opacity-50"
|
|
97
|
-
: "flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:brightness-110 disabled:opacity-50", children: [_jsx(Fingerprint, { className: "h-4 w-4" }), "Sign in with a passkey"] })), !passwordAvailable && !passkeyAvailable && (_jsx("p", { className: "text-xs text-muted-foreground", children: "Password login is disabled. Use a device or browser that supports passkeys." }))] })] }) }));
|
|
107
|
+
return (_jsx(LoginForm, { appName: uiConfig.appName, methods: { password: passwordAvailable, passkey: passkeyAvailable }, password: password, busy: submitting, error: error, onPasswordChange: setPassword, onPassword: () => void onPasswordLogin(), onPasskey: () => void onPasskeyClick() }));
|
|
98
108
|
}
|
|
99
109
|
//# sourceMappingURL=login-screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-screen.js","sourceRoot":"","sources":["../../../src/components/connectivity/login-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"login-screen.js","sourceRoot":"","sources":["../../../src/components/connectivity/login-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;IAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,sEAAsE;IAC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AAI,CAAC,MAAM,CAAC,OAAO;gBAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,MAAM,CAAC,OAAO;gBAAE,OAAO;YAC3B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;YACxE,CAAC;YACD,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IACR,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,OAAO,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAAE,EACnE,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,WAAW,EAC7B,UAAU,EAAE,GAAG,EAAE,CAAC,KAAK,eAAe,EAAE,EACxC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,cAAc,EAAE,GACtC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -96,7 +96,7 @@ export function ShareHarness({ path = DEFAULT_SHARE_TARGET_PATH, }) {
|
|
|
96
96
|
await getShareStore().delete(id);
|
|
97
97
|
await refresh();
|
|
98
98
|
}
|
|
99
|
-
return (_jsxs("div", { className: "mx-auto flex max-w-2xl flex-col gap-6 p-6 text-foreground", children: [_jsxs("header", { className: "flex flex-col gap-1", children: [_jsx("h1", { className: "text-xl font-semibold", children: "Share target harness" }), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["Posts a multipart share to ", _jsx("code", { children: path }), " from inside the page. The service worker handles it exactly as it would a real share."] })] }), !controlled && (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-border bg-surface-raised p-3 text-sm", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsx("span", { children: "No service worker controls this page, so the POST goes to the network and the server answers with the no-worker fallback rather than stashing anything. Load a production build (the worker is disabled in dev) and reload once after it installs." })] })), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(Field, { label: "title", value: title, onChange: setTitle }), _jsx(Field, { label: "text", value: text, onChange: setText }), _jsx(Field, { label: "url", value: url, onChange: setUrl }), _jsxs("label", { className: "flex flex-col gap-1 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "files" }), _jsx("input", { type: "file", multiple: true, onChange: (e) => setFiles(Array.from(e.target.files ?? [])), className: "text-sm" })] }), _jsxs("button", { type: "button", onClick: () => void send(), className: "flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground", children: [_jsx(Send, { className: "h-4 w-4" }), "Share it"] })] }), error && (_jsx("p", { className: "rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm", children: error })), result && (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border border-border p-3 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Landed on" }), _jsx("code", { className: "break-all", children: result }), _jsx("button", { type: "button", onClick: () => window.location.assign(result), className: "self-start rounded-md border border-border px-3 py-1 text-sm", children: "Open it" })] })), _jsxs("section", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("h2", { className: "text-sm font-medium", children: ["Stashed shares (", pending.length, ")"] }), _jsxs("button", { type: "button", onClick: () => void refresh(), className: "flex items-center gap-1 text-sm text-muted-foreground", children: [_jsx(RefreshCw, { className: "h-3.5 w-3.5" }), "Refresh"] })] }), pending.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nothing stashed." })), pending.map((share) => (_jsxs("div", { className: "flex flex-col gap-1 rounded-lg border border-border p-3 text-sm", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("code", { className: "break-all text-xs text-muted-foreground", children: share.id }), _jsx("button", { type: "button", onClick: () => void drop(share.id), "aria-label": "Delete stashed share", className: "text-muted-foreground", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }), share.title && _jsxs("div", { children: ["title: ", share.title] }), share.text && _jsxs("div", { children: ["text: ", share.text] }), share.url && _jsxs("div", { children: ["url: ", share.url] }), share.files.map((file, i) => (_jsxs("div", { className: "text-muted-foreground", children: [file.name, " (", file.type || "unknown", ", ", formatBytes(file.size), ")"] }, `${file.name}-${i}`)))] }, share.id)))] })] }));
|
|
99
|
+
return (_jsxs("div", { className: "mx-auto flex max-w-2xl flex-col gap-6 p-6 text-foreground", children: [_jsxs("header", { className: "flex flex-col gap-1", children: [_jsx("h1", { className: "text-xl font-semibold", children: "Share target harness" }), _jsxs("p", { className: "text-sm text-muted-foreground", children: ["Posts a multipart share to ", _jsx("code", { children: path }), " from inside the page. The service worker handles it exactly as it would a real share."] })] }), !controlled && (_jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-border bg-surface-raised p-3 text-sm", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0" }), _jsx("span", { children: "No service worker controls this page, so the POST goes to the network and the server answers with the no-worker fallback rather than stashing anything. Load a production build (the worker is disabled in dev) and reload once after it installs." })] })), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(Field, { label: "title", value: title, onChange: setTitle }), _jsx(Field, { label: "text", value: text, onChange: setText }), _jsx(Field, { label: "url", value: url, onChange: setUrl }), _jsxs("label", { className: "flex flex-col gap-1 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "files" }), _jsx("input", { type: "file", multiple: true, onChange: (e) => setFiles(Array.from(e.target.files ?? [])), className: "text-sm" })] }), _jsxs("button", { type: "button", onClick: () => void send(), className: "flex items-center justify-center gap-2 rounded-lg bg-primary-fill px-4 py-2 text-sm font-medium text-primary-foreground", children: [_jsx(Send, { className: "h-4 w-4" }), "Share it"] })] }), error && (_jsx("p", { className: "rounded-lg border border-destructive/40 bg-destructive-fill/10 p-3 text-sm", children: error })), result && (_jsxs("div", { className: "flex flex-col gap-2 rounded-lg border border-border p-3 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: "Landed on" }), _jsx("code", { className: "break-all", children: result }), _jsx("button", { type: "button", onClick: () => window.location.assign(result), className: "self-start rounded-md border border-border px-3 py-1 text-sm", children: "Open it" })] })), _jsxs("section", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("h2", { className: "text-sm font-medium", children: ["Stashed shares (", pending.length, ")"] }), _jsxs("button", { type: "button", onClick: () => void refresh(), className: "flex items-center gap-1 text-sm text-muted-foreground", children: [_jsx(RefreshCw, { className: "h-3.5 w-3.5" }), "Refresh"] })] }), pending.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Nothing stashed." })), pending.map((share) => (_jsxs("div", { className: "flex flex-col gap-1 rounded-lg border border-border p-3 text-sm", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsx("code", { className: "break-all text-xs text-muted-foreground", children: share.id }), _jsx("button", { type: "button", onClick: () => void drop(share.id), "aria-label": "Delete stashed share", className: "text-muted-foreground", children: _jsx(Trash2, { className: "h-4 w-4" }) })] }), share.title && _jsxs("div", { children: ["title: ", share.title] }), share.text && _jsxs("div", { children: ["text: ", share.text] }), share.url && _jsxs("div", { children: ["url: ", share.url] }), share.files.map((file, i) => (_jsxs("div", { className: "text-muted-foreground", children: [file.name, " (", file.type || "unknown", ", ", formatBytes(file.size), ")"] }, `${file.name}-${i}`)))] }, share.id)))] })] }));
|
|
100
100
|
}
|
|
101
101
|
function Field({ label, value, onChange, }) {
|
|
102
102
|
return (_jsxs("label", { className: "flex flex-col gap-1 text-sm", children: [_jsx("span", { className: "text-muted-foreground", children: label }), _jsx("input", { type: "text", value: value, onChange: (e) => onChange(e.target.value), className: "rounded-lg border border-border bg-surface px-3 py-2 text-sm" })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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KAAK,CAAC,EAAE,CAwBT,CACP,CAAC,IACM,IACN,CACP,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,EACb,KAAK,EACL,KAAK,EACL,QAAQ,GAKT;IACC,OAAO,CACL,iBAAO,SAAS,EAAC,6BAA6B,aAC5C,eAAM,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAQ,EACtD,gBACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,SAAS,EAAC,8DAA8D,GACxE,IACI,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-panel.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-panel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-panel.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-panel.tsx"],"names":[],"mappings":"AAkCA,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,sCAwHlF"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense, lazy, useEffect } from "react";
|
|
3
|
+
import { Button, Label, Receipt, ScreenHeader } from "@schlessera/brain-ui-kit";
|
|
3
4
|
import { ChevronDown, ChevronRight, X } from "lucide-react";
|
|
4
5
|
import { useFileStore } from "../../stores/file-store.js";
|
|
6
|
+
import { singleKey } from "../../lib/single-key.js";
|
|
7
|
+
import { useUIStore } from "../../stores/ui-store.js";
|
|
5
8
|
import { useDeferredUnmount } from "../../hooks/use-deferred-unmount.js";
|
|
9
|
+
import { useMediaQuery } from "../../hooks/use-media-query.js";
|
|
10
|
+
import { splitFrontmatter } from "../../lib/frontmatter.js";
|
|
6
11
|
import { cn } from "../../lib/utils.js";
|
|
12
|
+
import { formatSize } from "./file-viewer-frame.js";
|
|
13
|
+
import { DisabledToggleRow } from "../graph/graph-form.js";
|
|
14
|
+
import { STALE_AFTER_DAYS, ageInDays, formatAge } from "./staleness.js";
|
|
7
15
|
/** Matches the `duration-300` slide-out below. */
|
|
8
16
|
const SLIDE_OUT_MS = 300;
|
|
17
|
+
/**
|
|
18
|
+
* The `laptop:` breakpoint from `theme.css`. From here up the rail is
|
|
19
|
+
* expanded and the design's D3 draws Files as panes beside it; below, the
|
|
20
|
+
* drawer. Read as a media query rather than a class pair so only one of the
|
|
21
|
+
* two shapes is mounted — two would mean two file trees on the store.
|
|
22
|
+
*/
|
|
23
|
+
const PANES_QUERY = "(min-width: 900px)";
|
|
9
24
|
/**
|
|
10
25
|
* The tree and the viewers load the first time the panel is opened. Together
|
|
11
26
|
* they carry the markdown, HTML, image and PDF viewers, none of which the chat
|
|
@@ -18,6 +33,7 @@ export function FilePanel({ open, onClose }) {
|
|
|
18
33
|
const treeExpanded = useFileStore((s) => s.treeExpanded);
|
|
19
34
|
const setTreeExpanded = useFileStore((s) => s.setTreeExpanded);
|
|
20
35
|
const closeFile = useFileStore((s) => s.closeFile);
|
|
36
|
+
const panes = useMediaQuery(PANES_QUERY);
|
|
21
37
|
useEffect(() => {
|
|
22
38
|
if (!open)
|
|
23
39
|
return;
|
|
@@ -52,6 +68,64 @@ export function FilePanel({ open, onClose }) {
|
|
|
52
68
|
// was otherwise keeping the whole file tree mounted behind the chat page.
|
|
53
69
|
const showContent = useDeferredUnmount(open, SLIDE_OUT_MS);
|
|
54
70
|
const showTree = showContent && (!currentPath || treeExpanded);
|
|
71
|
+
if (panes) {
|
|
72
|
+
return open ? _jsx(FilePanes, { onClose: onClose }) : null;
|
|
73
|
+
}
|
|
55
74
|
return (_jsxs(_Fragment, { children: [open && (_jsx("div", { className: "fixed inset-0 z-40 bg-black/40 transition-opacity md:bg-black/20", onClick: onClose })), _jsxs("div", { className: cn("fixed right-0 top-0 z-50 flex h-full w-full flex-col border-l border-border bg-surface shadow-[0_16px_48px_rgba(0,0,0,0.5)] md:w-[560px]", "transform transition-transform duration-300 ease-out", open ? "translate-x-0" : "translate-x-full"), children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-5 py-4", children: [_jsx("h2", { className: "font-[family-name:var(--font-display)] text-lg text-foreground", children: "Files" }), _jsx("button", { onClick: onClose, className: "rounded-lg p-2.5 md:p-1.5 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: _jsx(X, { className: "h-5 w-5 md:h-4 md:w-4" }) })] }), _jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [showContent && currentPath && (_jsxs("div", { className: "flex items-center gap-1 border-b border-border bg-surface-raised/40 px-3 py-1.5", children: [_jsxs("button", { onClick: () => setTreeExpanded(!treeExpanded), className: "flex items-center gap-1.5 rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: [treeExpanded ? _jsx(ChevronDown, { className: "h-3.5 w-3.5" }) : _jsx(ChevronRight, { className: "h-3.5 w-3.5" }), treeExpanded ? "Hide tree" : "Show tree"] }), _jsx("button", { onClick: closeFile, className: "ml-auto rounded px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: "Close file" })] })), showTree && (_jsx("div", { className: cn("overflow-y-auto", currentPath ? "max-h-[45vh] border-b border-border" : "flex-1"), children: _jsx(Suspense, { fallback: null, children: _jsx(FileTree, {}) }) })), showContent && currentPath && (_jsx("div", { className: "flex-1 overflow-hidden", children: _jsx(Suspense, { fallback: null, children: _jsx(FileViewer, {}) }) }))] })] })] }));
|
|
56
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* D3 (the fifth design drop): from `laptop:` up Files is
|
|
78
|
+
* not a drawer but a layer of panes over the content area, beside the rail —
|
|
79
|
+
* a 300px tree, the reading pane at a 720px measure, and from `wide:` a
|
|
80
|
+
* 320px evidence rail. No backdrop: the rail stays reachable, and the layer
|
|
81
|
+
* is the app's own surface, not a sheet over it. The host still composes
|
|
82
|
+
* views, so this remains the same `FilePanel` the drawer is; only the shape
|
|
83
|
+
* changes with the width.
|
|
84
|
+
*
|
|
85
|
+
* The tree's title carries no document count: the file store has no total,
|
|
86
|
+
* and the design's `4,812 docs` is not something to make up.
|
|
87
|
+
*
|
|
88
|
+
* The footer prints the keys that fire. `j` / `k` are single-key letters
|
|
89
|
+
* and go with the Settings off switch (D37 — a key that does not fire is
|
|
90
|
+
* not advertised); `← →` and `⏎` are not letters, the switch does not
|
|
91
|
+
* cover them, and the kit `FileRow` binds them regardless — so they print
|
|
92
|
+
* regardless. `FileRow` already moves focus with ↑↓ and Home/End on its
|
|
93
|
+
* own, so nothing here binds movement a second time.
|
|
94
|
+
*
|
|
95
|
+
* The evidence rail (sixth pass §3a): each block is independent and simply
|
|
96
|
+
* absent when its data does not exist, but the COLUMN stays — "a pane count
|
|
97
|
+
* that changes as you click through files is a worse defect than a sparse
|
|
98
|
+
* rail." So the rail mounts with the panes, empty until a file is open, and
|
|
99
|
+
* a file with no frontmatter shows only the blocks it has.
|
|
100
|
+
*/
|
|
101
|
+
function FilePanes({ onClose }) {
|
|
102
|
+
const currentPath = useFileStore((s) => s.currentPath);
|
|
103
|
+
const content = useFileStore((s) => s.currentContent);
|
|
104
|
+
const singleKeyShortcuts = useUIStore((s) => s.singleKeyShortcuts);
|
|
105
|
+
const loaded = content !== null && content.path === currentPath ? content : null;
|
|
106
|
+
const frontmatter = loaded?.kind === "markdown"
|
|
107
|
+
? splitFrontmatter(loaded.content ?? "").fields.map((f) => ({
|
|
108
|
+
k: f.key,
|
|
109
|
+
v: f.list ? f.list.join(", ") : f.value || "—",
|
|
110
|
+
}))
|
|
111
|
+
: [];
|
|
112
|
+
// Stale (sixth pass §3b): `mtime` is on every file the server serves, in
|
|
113
|
+
// milliseconds; the threshold is `STALE_AFTER_DAYS`. Past it the block
|
|
114
|
+
// turns gold — the same tone the tree's dot wears.
|
|
115
|
+
const modified = loaded ? ageInDays(loaded.mtime) : null;
|
|
116
|
+
const stale = modified !== null && modified >= STALE_AFTER_DAYS;
|
|
117
|
+
return (_jsxs("div", { role: "dialog", "aria-label": "Files", className: "fixed bottom-0 right-0 top-0 z-40 flex bg-surface tablet:left-[60px] laptop:left-[208px]", children: [_jsxs("aside", { className: "flex w-[300px] shrink-0 flex-col border-r border-border", children: [_jsx("div", { className: "shrink-0 px-4 pb-2 pt-4", children: _jsx("h2", { className: "font-[family-name:var(--font-display)] text-[22px] leading-tight text-foreground", children: "Files" }) }), _jsx("div", { className: "shrink-0 border-b border-border", children: _jsx(DisabledToggleRow, { label: "Untrusted only", reason: "needs provenance", tone: "purple", last: true }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", onKeyDown: (e) => {
|
|
118
|
+
if (!singleKeyShortcuts)
|
|
119
|
+
return;
|
|
120
|
+
const key = singleKey(e);
|
|
121
|
+
if (key !== "j" && key !== "k")
|
|
122
|
+
return;
|
|
123
|
+
const items = [...e.currentTarget.querySelectorAll('[role="treeitem"]')];
|
|
124
|
+
const here = items.indexOf(e.target);
|
|
125
|
+
if (here === -1)
|
|
126
|
+
return;
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
items[(here + (key === "j" ? 1 : -1) + items.length) % items.length]?.focus();
|
|
129
|
+
}, children: _jsx(Suspense, { fallback: null, children: _jsx(FileTree, {}) }) }), _jsxs("div", { className: "shrink-0 border-t border-border px-4 py-2 font-[family-name:var(--font-mono)] text-[10px] text-muted-foreground", children: [singleKeyShortcuts ? "j / k move · " : "", "\u2190 \u2192 fold \u00B7 \u23CE open"] })] }), _jsxs("section", { className: "flex min-w-0 flex-1 flex-col", "aria-label": currentPath ?? "No file open", children: [_jsxs("div", { className: "flex shrink-0 items-start border-b border-border pr-3", children: [_jsx("div", { className: "min-w-0 flex-1", children: _jsx(ScreenHeader, { variant: "nav", title: currentPath ?? "Files", subtitle: loaded ? formatSize(loaded.size) : undefined, back: false, divider: false }) }), _jsx("div", { className: "shrink-0 pt-2", children: _jsx(Button, { label: "Close", icon: "dismiss", tone: "ghost", size: "sm", block: false, onClick: onClose }) })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: _jsx("div", { className: "mx-auto h-full w-full max-w-[720px]", children: _jsx(Suspense, { fallback: null, children: _jsx(FileViewer, {}) }) }) })] }), _jsxs("aside", { "aria-label": "Evidence", className: "hidden w-[320px] shrink-0 flex-col gap-4 overflow-y-auto border-l border-border bg-background px-4 py-4 wide:flex", children: [frontmatter.length > 0 && (_jsxs("div", { className: "flex flex-col gap-2", "data-rail-block": "frontmatter", children: [_jsx(Label, { text: "Frontmatter", icon: "scope", meta: `${frontmatter.length} ${frontmatter.length === 1 ? "key" : "keys"}` }), _jsx(Receipt, { rows: frontmatter, keyWidth: 72 })] })), modified !== null && (_jsxs("div", { className: "flex flex-col gap-2", "data-rail-block": "modified", "data-stale": stale ? "" : undefined, children: [_jsx(Label, { text: "Modified", icon: "history", tone: stale ? "gold" : undefined, meta: stale ? "stale" : undefined }), _jsxs("div", { className: cn("font-[family-name:var(--font-mono)] text-[10px]", stale ? "text-[var(--bk-gold-ink)]" : "text-muted-foreground"), children: ["modified ", formatAge(modified), " \u00B7 ", stale ? "stale past" : "stale after", " ", STALE_AFTER_DAYS] })] }))] })] }));
|
|
130
|
+
}
|
|
57
131
|
//# sourceMappingURL=file-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-panel.js","sourceRoot":"","sources":["../../../src/components/files/file-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4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