@schlessera/brain-ui-react 0.34.1 → 0.36.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 +89 -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 +144 -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 +11 -0
- package/dist/components/activity/approval-card.d.ts.map +1 -0
- package/dist/components/activity/approval-card.js +46 -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.map +1 -1
- package/dist/components/activity/span-bits.js +9 -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 +24 -9
- 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 +55 -40
- 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 +37 -12
- 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 +15 -4
- package/dist/components/chat/tool-views.d.ts.map +1 -1
- package/dist/components/chat/tool-views.js +22 -38
- 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 +64 -6
- 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 +5 -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 +24 -0
- package/dist/components/layout/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail.js +65 -27
- package/dist/components/layout/side-rail.js.map +1 -1
- package/dist/components/layout/slide-panel.d.ts +12 -2
- package/dist/components/layout/slide-panel.d.ts.map +1 -1
- package/dist/components/layout/slide-panel.js +11 -2
- 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 +30 -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 +66 -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 +48 -19
- 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 +42 -17
- 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 +36 -10
- package/dist/components/quick-actions/whatsup-modal.js.map +1 -1
- package/dist/components/settings/devices-agents-tab.d.ts +10 -0
- package/dist/components/settings/devices-agents-tab.d.ts.map +1 -0
- package/dist/components/settings/devices-agents-tab.js +131 -0
- package/dist/components/settings/devices-agents-tab.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/components/settings/one-time-agent-credential.d.ts.map +1 -0
- package/dist/components/settings/one-time-agent-credential.js +55 -0
- package/dist/components/settings/one-time-agent-credential.js.map +1 -0
- 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 +80 -6
- 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-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 +7 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +34 -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 +1 -1
- package/dist/hooks/use-vpn-status.d.ts.map +1 -1
- package/dist/hooks/use-vpn-status.js +20 -16
- 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 -382
- 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 +27 -5
- 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 +321 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +243 -213
- 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/format-time.d.ts +3 -0
- package/dist/lib/format-time.d.ts.map +1 -0
- package/dist/lib/format-time.js +25 -0
- package/dist/lib/format-time.js.map +1 -0
- 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 +10 -0
- package/dist/lib/push-registration.d.ts.map +1 -0
- package/dist/lib/push-registration.js +44 -0
- package/dist/lib/push-registration.js.map +1 -0
- 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 +212 -0
- package/dist/stores/chat-state.d.ts.map +1 -0
- package/dist/stores/chat-state.js +466 -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 -300
- 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 +5 -0
- package/dist/stores/principal-store.d.ts.map +1 -0
- package/dist/stores/principal-store.js +8 -0
- package/dist/stores/principal-store.js.map +1 -0
- 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 +334 -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 +80 -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 +8 -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 +38 -9
- 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 +60 -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 +59 -22
- 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 +23 -73
- 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 +80 -9
- 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 +7 -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 +70 -150
- package/src/components/layout/slide-panel.tsx +29 -2
- package/src/components/layout/theme.tsx +67 -0
- package/src/components/quick-actions/add-form.tsx +188 -0
- package/src/components/quick-actions/add-modal.tsx +68 -144
- package/src/components/quick-actions/search-modal.tsx +49 -19
- package/src/components/quick-actions/streaming-modal.tsx +44 -71
- package/src/components/quick-actions/streaming-output.tsx +112 -0
- package/src/components/quick-actions/whatsup-modal.tsx +38 -60
- package/src/components/settings/devices-agents-tab.tsx +139 -0
- 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 +131 -0
- 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 +245 -19
- 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-hash-routes.ts +4 -2
- package/src/hooks/use-media-query.ts +32 -0
- package/src/hooks/use-share-intake.ts +32 -12
- package/src/hooks/use-vpn-status.ts +23 -15
- package/src/hooks/use-websocket.ts +12 -426
- package/src/hooks/websocket-handlers/activity.ts +4 -5
- package/src/hooks/websocket-handlers/chat.ts +26 -5
- 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 +446 -365
- package/src/lib/backend.ts +20 -10
- package/src/lib/diff.ts +28 -62
- package/src/lib/format-time.ts +20 -0
- 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 +46 -0
- 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 +795 -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 -360
- 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 +11 -0
- 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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FileKind } from "@schlessera/brain-ui-kit";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export declare function fileKind(name: string, isDir: boolean, expanded: boolean): FileKind;
|
|
4
|
+
export interface TreeRowProps {
|
|
5
|
+
name: string;
|
|
6
|
+
kind: FileKind;
|
|
7
|
+
depth: number;
|
|
8
|
+
/** The row the viewer is on. */
|
|
9
|
+
active: boolean;
|
|
10
|
+
/** A folder whose listing is in flight. */
|
|
11
|
+
loading: boolean;
|
|
12
|
+
/** The tree was asked to reveal this folder: flash it, scroll it into view. */
|
|
13
|
+
highlighted: boolean;
|
|
14
|
+
/** A folder's listing failed; shown under the row with a retry. */
|
|
15
|
+
error?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Days since the file was modified, given only when past the staleness
|
|
18
|
+
* threshold (`staleness.ts`). D3 draws it as the gold left-edge dot and
|
|
19
|
+
* the mono `stale 38d` meta, the same two marks the design's `1e` screen
|
|
20
|
+
* uses; the container decides from `mtime`, the row only prints.
|
|
21
|
+
*/
|
|
22
|
+
staleDays?: number;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
onClick: () => void;
|
|
25
|
+
onRetry?: () => void;
|
|
26
|
+
onHighlightShown?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* The kit `FileRow` binds → on a closed folder to `onFold(true)` and ← on
|
|
29
|
+
* an open one to `onFold(false)` (sixth pass §8: the ARIA tree pattern
|
|
30
|
+
* requires them, and the footer prints them). Folders only.
|
|
31
|
+
*/
|
|
32
|
+
onFold?: (open: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
/** How long the reveal flash runs before the request is cleared. */
|
|
35
|
+
export declare const HIGHLIGHT_MS = 1800;
|
|
36
|
+
export declare function TreeRow(p: TreeRowProps): import("react").JSX.Element;
|
|
37
|
+
export interface FileTreeViewProps {
|
|
38
|
+
/** The root listing: `loading` before it arrives, `error` when it failed, `ready` with rows. */
|
|
39
|
+
state: "loading" | "error" | "ready";
|
|
40
|
+
error?: string;
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
onRetry?: () => void;
|
|
43
|
+
}
|
|
44
|
+
export declare function FileTreeView(p: FileTreeViewProps): import("react").JSX.Element;
|
|
45
|
+
//# sourceMappingURL=file-tree-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-tree-view.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-tree-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAoB1D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAKlF;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,WAAW,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC;AAED,oEAAoE;AACpE,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,wBAAgB,OAAO,CAAC,CAAC,EAAE,YAAY,+BAiCtC;AAED,MAAM,WAAW,iBAAiB;IAChC,gGAAgG;IAChG,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,iBAAiB,+BAoBhD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileRow, Placeholder } from "@schlessera/brain-ui-kit";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
/**
|
|
6
|
+
* The file tree's rows, rendered from props (S7, the `files` directory). The
|
|
7
|
+
* design's `1e` screen draws the tree out of the kit's `FileRow` — folder,
|
|
8
|
+
* open folder, file, image — so that is what a row is here. `FileTree` is
|
|
9
|
+
* the container: it subscribes each node to the file store and decides
|
|
10
|
+
* expansion, loading, errors and the active path; these views decide how
|
|
11
|
+
* that looks.
|
|
12
|
+
*
|
|
13
|
+
* `TreeRow` is ONE row. The container renders it recursively so each node
|
|
14
|
+
* keeps its own store subscription (a change deep in one folder re-renders
|
|
15
|
+
* that row, not the tree); the children arrive as `children` already
|
|
16
|
+
* rendered. A highlighted row (the tree was asked to reveal this folder)
|
|
17
|
+
* scrolls itself into view and reports when the flash has run, so the
|
|
18
|
+
* container can clear the request.
|
|
19
|
+
*/
|
|
20
|
+
const IMAGE_EXT = new Set([".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg", ".avif", ".bmp", ".ico"]);
|
|
21
|
+
export function fileKind(name, isDir, expanded) {
|
|
22
|
+
if (isDir)
|
|
23
|
+
return expanded ? "open" : "folder";
|
|
24
|
+
const i = name.lastIndexOf(".");
|
|
25
|
+
const ext = i >= 0 ? name.slice(i).toLowerCase() : "";
|
|
26
|
+
return IMAGE_EXT.has(ext) ? "image" : "file";
|
|
27
|
+
}
|
|
28
|
+
/** How long the reveal flash runs before the request is cleared. */
|
|
29
|
+
export const HIGHLIGHT_MS = 1800;
|
|
30
|
+
export function TreeRow(p) {
|
|
31
|
+
const ref = useRef(null);
|
|
32
|
+
const { highlighted, onHighlightShown } = p;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!highlighted || !ref.current)
|
|
35
|
+
return;
|
|
36
|
+
ref.current.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
37
|
+
const t = setTimeout(() => onHighlightShown?.(), HIGHLIGHT_MS);
|
|
38
|
+
return () => clearTimeout(t);
|
|
39
|
+
}, [highlighted, onHighlightShown]);
|
|
40
|
+
return (_jsxs("li", { children: [_jsx("div", { ref: ref, className: cn(highlighted && "brain-tree-highlight"), children: _jsx(FileRow, { label: p.name, kind: p.kind, depth: p.depth, active: p.active, meta: p.loading ? "loading…" : p.staleDays !== undefined ? `stale ${p.staleDays}d` : undefined, metaTone: !p.loading && p.staleDays !== undefined ? "gold" : undefined, flag: p.staleDays !== undefined ? "gold" : undefined, onClick: p.onClick, onFold: p.onFold }) }), p.error ? (_jsx("div", { style: { paddingLeft: 8 + (p.depth + 1) * 22 }, className: "py-1 pr-2", children: _jsx(FileRow, { view: "error", stateMessage: "Folder unreadable", stateDetail: p.error, stateAction: "Retry", onStateAction: p.onRetry }) })) : null, p.children ? _jsx("ul", { children: p.children }) : null] }));
|
|
41
|
+
}
|
|
42
|
+
export function FileTreeView(p) {
|
|
43
|
+
if (p.state === "error") {
|
|
44
|
+
return (_jsx("div", { className: "px-3 py-2", children: _jsx(Placeholder, { variant: "error", message: "Files unreadable", detail: p.error, actionLabel: "Retry", onAction: p.onRetry }) }));
|
|
45
|
+
}
|
|
46
|
+
if (p.state === "loading") {
|
|
47
|
+
return (_jsx("div", { className: "px-3 py-2", "aria-label": "Loading files", children: _jsx(Placeholder, { variant: "loading", lines: 4, bordered: false, pad: 4 }) }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsx("ul", { className: "py-1 text-sm", role: "tree", children: p.children }));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=file-tree-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-tree-view.js","sourceRoot":"","sources":["../../../src/components/files/file-tree-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvG,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAc,EAAE,QAAiB;IACtE,IAAI,KAAK;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC/C,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtD,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC;AAiCD,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC,MAAM,UAAU,OAAO,CAAC,CAAe;IACrC,MAAM,GAA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C,CAAC,QAAQ,GACR,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The container (S7): every node subscribes to the file store for its own
|
|
3
|
+
* expansion, loading, error, active and highlight state, and renders a
|
|
4
|
+
* `TreeRow` with its children rendered the same way. The store owns the
|
|
5
|
+
* directory cache and the requests; the rows own nothing.
|
|
6
|
+
*/
|
|
1
7
|
export declare function FileTree(): import("react").JSX.Element;
|
|
2
8
|
//# sourceMappingURL=file-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-tree.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-tree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-tree.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-tree.tsx"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAgB,QAAQ,gCAsBvB"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
import { ChevronRight, Folder, FolderOpen, FileText, FileCode, FileImage, File as FileIcon, Loader2, AlertCircle } from "lucide-react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
4
3
|
import { useFileStore } from "../../stores/file-store.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (IMAGE_EXT.has(ext))
|
|
14
|
-
return FileImage;
|
|
15
|
-
if (CODE_EXT.has(ext))
|
|
16
|
-
return FileCode;
|
|
17
|
-
return FileIcon;
|
|
18
|
-
}
|
|
4
|
+
import { FileTreeView, TreeRow, fileKind } from "./file-tree-view.js";
|
|
5
|
+
import { ageInDays, isStale } from "./staleness.js";
|
|
6
|
+
/**
|
|
7
|
+
* The container (S7): every node subscribes to the file store for its own
|
|
8
|
+
* expansion, loading, error, active and highlight state, and renders a
|
|
9
|
+
* `TreeRow` with its children rendered the same way. The store owns the
|
|
10
|
+
* directory cache and the requests; the rows own nothing.
|
|
11
|
+
*/
|
|
19
12
|
export function FileTree() {
|
|
20
13
|
const loadDir = useFileStore((s) => s.loadDir);
|
|
21
14
|
const dirCache = useFileStore((s) => s.dirCache);
|
|
@@ -27,37 +20,40 @@ export function FileTree() {
|
|
|
27
20
|
}, [dirCache, loadDir]);
|
|
28
21
|
const rootEntries = dirCache[""];
|
|
29
22
|
const rootError = dirErrors[""];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
if (!rootEntries) {
|
|
34
|
-
return (_jsxs("div", { className: "flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), "Loading files..."] }));
|
|
35
|
-
}
|
|
36
|
-
return (_jsx("ul", { className: "py-1 text-sm", children: rootEntries.map((entry) => (_jsx(TreeNode, { entry: entry, depth: 0 }, entry.path))) }));
|
|
23
|
+
const retryRoot = useCallback(() => void loadDir(""), [loadDir]);
|
|
24
|
+
return (_jsx(FileTreeView, { state: rootError ? "error" : rootEntries ? "ready" : "loading", error: rootError, onRetry: retryRoot, children: rootEntries?.map((entry) => (_jsx(TreeNode, { entry: entry, depth: 0 }, entry.path))) }));
|
|
37
25
|
}
|
|
38
26
|
function TreeNode({ entry, depth }) {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
27
|
+
const isDir = entry.type === "dir";
|
|
28
|
+
const expanded = useFileStore((s) => isDir && s.expandedDirs.has(entry.path));
|
|
29
|
+
const loading = useFileStore((s) => isDir && s.loadingDirs.has(entry.path));
|
|
30
|
+
const childEntries = useFileStore((s) => (isDir ? s.dirCache[entry.path] : undefined));
|
|
31
|
+
const childError = useFileStore((s) => (isDir ? s.dirErrors[entry.path] : undefined));
|
|
43
32
|
const toggleDir = useFileStore((s) => s.toggleDir);
|
|
33
|
+
const loadDir = useFileStore((s) => s.loadDir);
|
|
44
34
|
const openFile = useFileStore((s) => s.openFile);
|
|
45
35
|
const isActive = useFileStore((s) => s.currentPath === entry.path);
|
|
46
|
-
const highlighted = useFileStore((s) =>
|
|
36
|
+
const highlighted = useFileStore((s) => isDir && s.highlightedDir === entry.path);
|
|
47
37
|
const setHighlightedDir = useFileStore((s) => s.setHighlightedDir);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
const clearHighlight = useCallback(() => setHighlightedDir(null), [setHighlightedDir]);
|
|
39
|
+
// Staleness is a fact about a FILE's content. A directory's mtime moves
|
|
40
|
+
// when an entry is added or removed, not when a note inside it changes,
|
|
41
|
+
// so a folder gets no dot: the design's gold folder (`context · stale
|
|
42
|
+
// 38d`) needs the newest child's mtime, which the tree only knows once
|
|
43
|
+
// that folder has been opened. The server sends `mtime` per entry; an
|
|
44
|
+
// older one without it draws nothing rather than guessing.
|
|
45
|
+
const staleDays = !isDir && entry.mtime !== undefined && isStale(entry.mtime) ? ageInDays(entry.mtime) : undefined;
|
|
46
|
+
// ← / → fold (sixth pass §8). The kit only calls `onFold(true)` on a closed
|
|
47
|
+
// folder and `onFold(false)` on an open one, but the guard keeps the store
|
|
48
|
+
// honest if a stale `kind` and the key disagree for a frame.
|
|
49
|
+
const fold = isDir
|
|
50
|
+
? (open) => {
|
|
51
|
+
if (open !== expanded)
|
|
52
|
+
void toggleDir(entry.path);
|
|
53
|
+
}
|
|
54
|
+
: undefined;
|
|
55
|
+
return (_jsx(TreeRow, { name: entry.name, kind: fileKind(entry.name, isDir, expanded), depth: depth, active: isActive, loading: loading, highlighted: highlighted, error: expanded ? childError : undefined, staleDays: staleDays, onClick: () => void (isDir ? toggleDir(entry.path) : openFile(entry.path)), onRetry: () => void loadDir(entry.path), onHighlightShown: clearHighlight, onFold: fold, children: expanded && childEntries?.length
|
|
56
|
+
? childEntries.map((child) => _jsx(TreeNode, { entry: child, depth: depth + 1 }, child.path))
|
|
57
|
+
: undefined }));
|
|
62
58
|
}
|
|
63
59
|
//# sourceMappingURL=file-tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-tree.js","sourceRoot":"","sources":["../../../src/components/files/file-tree.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"file-tree.js","sourceRoot":"","sources":["../../../src/components/files/file-tree.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;YAClB,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAExB,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.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-viewer-binary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAI7E,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"file-viewer-binary.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-viewer-binary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAI7E,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,mBAAmB,CAAA;CAAE,+BA6D7E"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { FileWarning, Download } from "lucide-react";
|
|
3
|
-
import {
|
|
3
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
4
4
|
import { ZoomableImage } from "../images/zoomable-image.js";
|
|
5
5
|
export function FileViewerBinary({ content }) {
|
|
6
|
+
const root = useBrainUiRoot();
|
|
6
7
|
const isImage = content.mime?.startsWith("image/");
|
|
7
|
-
const rawUrl = `${apiBase()}/files/content?path=${encodeURIComponent(content.path)}&raw=1`;
|
|
8
|
+
const rawUrl = `${root.apiBase()}/files/content?path=${encodeURIComponent(content.path)}&raw=1`;
|
|
8
9
|
if (isImage) {
|
|
9
10
|
const filename = content.path.split("/").pop() ?? content.path;
|
|
10
11
|
return (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-6", children: [_jsx("div", { className: "flex max-h-full max-w-full overflow-auto rounded-lg border border-border bg-surface p-2", children: _jsx(ZoomableImage, { src: rawUrl, alt: content.path, className: "max-h-[70vh] max-w-full cursor-zoom-in object-contain", mime: content.mime, bytes: content.size }) }), _jsxs("div", { className: "flex flex-wrap items-center justify-center gap-2 text-xs text-muted-foreground", children: [_jsxs("span", { children: [content.mime, " \u00B7 ", formatSize(content.size)] }), _jsx("span", { className: "text-muted-foreground/40", children: "\u00B7" }), _jsxs("a", { href: rawUrl, download: filename, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 rounded text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(Download, { className: "h-3 w-3" }), "Download"] })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-viewer-binary.js","sourceRoot":"","sources":["../../../src/components/files/file-viewer-binary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"file-viewer-binary.js","sourceRoot":"","sources":["../../../src/components/files/file-viewer-binary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAoC;IAC5E,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,uBAAuB,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IAEhG,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;QAC/D,OAAO,CACL,eAAK,SAAS,EAAC,4DAA4D,aACzE,cAAK,SAAS,EAAC,yFAAyF,Y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AI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The viewer's chrome, rendered from props (S7): the toolbar over the file,
|
|
4
|
+
* and the three states the body can be in before there is a file to draw.
|
|
5
|
+
* `FileViewer` is the container — it reads the store, builds the share
|
|
6
|
+
* options (which need the root) and chooses the body renderer; this owns
|
|
7
|
+
* how the frame looks.
|
|
8
|
+
*
|
|
9
|
+
* The Preview / Raw switch is the kit's `FilterRow`: two pills, one
|
|
10
|
+
* selected, activation following focus, which is what a mode switch is.
|
|
11
|
+
* The reveal and copy controls stay native icon buttons (titled; the kit
|
|
12
|
+
* has no icon-only button) and the share menu arrives rendered.
|
|
13
|
+
*/
|
|
14
|
+
export type ViewMode = "preview" | "raw";
|
|
15
|
+
export interface ViewerToolbarProps {
|
|
16
|
+
fileName: string;
|
|
17
|
+
fullPath: string;
|
|
18
|
+
size?: number;
|
|
19
|
+
mode: ViewMode;
|
|
20
|
+
/** Only markdown, HTML and standalone diagrams have a preview to switch to. */
|
|
21
|
+
previewAvailable: boolean;
|
|
22
|
+
copied: boolean;
|
|
23
|
+
/** The share menu, already built by the container; null when nothing shares. */
|
|
24
|
+
share: ReactNode;
|
|
25
|
+
onMode: (mode: ViewMode) => void;
|
|
26
|
+
onCopyPath: () => void;
|
|
27
|
+
onReveal: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function ViewerToolbar(p: ViewerToolbarProps): import("react").JSX.Element;
|
|
30
|
+
export declare function ViewerLoading(): import("react").JSX.Element;
|
|
31
|
+
export declare function ViewerError({ message }: {
|
|
32
|
+
message: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
export declare function ViewerEmpty(): import("react").JSX.Element;
|
|
35
|
+
export declare function formatSize(bytes: number): string;
|
|
36
|
+
//# sourceMappingURL=file-viewer-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-viewer-frame.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-viewer-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,+EAA+E;IAC/E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,kBAAkB,+BA2ClD;AAED,wBAAgB,aAAa,gCAM5B;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,+BAM3D;AAED,wBAAgB,WAAW,gCAY1B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Callout, EmptyState, FilterRow, Placeholder } from "@schlessera/brain-ui-kit";
|
|
3
|
+
import { Check, Copy, FolderOpen } from "lucide-react";
|
|
4
|
+
export function ViewerToolbar(p) {
|
|
5
|
+
return (_jsxs("div", { className: "flex items-center gap-2 border-b border-border bg-surface px-4 py-2", children: [_jsx("button", { type: "button", onClick: p.onReveal, title: "Reveal in tree", className: "rounded p-1 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: _jsx(FolderOpen, { className: "h-3.5 w-3.5" }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium text-foreground", title: p.fullPath, children: p.fileName }), _jsxs("div", { className: "truncate text-[10px] text-muted-foreground", title: p.fullPath, children: [p.fullPath, p.size !== undefined && _jsxs("span", { className: "ml-2", children: ["\u00B7 ", formatSize(p.size)] })] })] }), _jsx("button", { type: "button", onClick: p.onCopyPath, title: "Copy path", className: "rounded p-1.5 text-muted-foreground transition-colors hover:bg-surface-raised hover:text-foreground", children: p.copied ? _jsx(Check, { className: "h-3.5 w-3.5" }) : _jsx(Copy, { className: "h-3.5 w-3.5" }) }), p.share, p.previewAvailable && (_jsx("div", { className: "w-auto shrink-0", children: _jsx(FilterRow, { items: [
|
|
6
|
+
{ label: "Preview", onClick: () => p.onMode("preview") },
|
|
7
|
+
{ label: "Raw", onClick: () => p.onMode("raw") },
|
|
8
|
+
], active: p.mode === "preview" ? 0 : 1, mono: false }) }))] }));
|
|
9
|
+
}
|
|
10
|
+
export function ViewerLoading() {
|
|
11
|
+
return (_jsx("div", { className: "px-6 py-6", "aria-label": "Loading file", children: _jsx(Placeholder, { variant: "loading", lines: 5, bordered: false, pad: 0 }) }));
|
|
12
|
+
}
|
|
13
|
+
export function ViewerError({ message }) {
|
|
14
|
+
return (_jsx("div", { className: "m-4", role: "alert", children: _jsx(Callout, { tone: "red", variant: "banner", icon: "failed", mono: true, text: message }) }));
|
|
15
|
+
}
|
|
16
|
+
export function ViewerEmpty() {
|
|
17
|
+
return (_jsx(EmptyState, { variant: "no-results", icon: "folder", tone: "neutral", title: "No file open", body: "Select a file from the tree to view it.", meta: "", minHeight: 240 }));
|
|
18
|
+
}
|
|
19
|
+
export function formatSize(bytes) {
|
|
20
|
+
if (bytes < 1024)
|
|
21
|
+
return `${bytes} B`;
|
|
22
|
+
if (bytes < 1024 * 1024)
|
|
23
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
24
|
+
return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=file-viewer-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-viewer-frame.js","sourceRoot":"","sources":["../../../src/components/files/file-viewer-frame.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAgCvD,MAAM,UAAU,aAAa,CAAC,CAAqB;IACjD,OAAO,CACL,eAAK,SAAS,EAAC,qEAAqE,aAClF,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,KAAK,EAAC,gBAAgB,EACtB,SAAS,EAAC,mGAAmG,YAE7G,KAAC,UAAU,IAAC,SAAS,EAAC,aAAa,GAAG,GAC/B,EACT,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cAAK,SAAS,EAAC,8CAA8C,EAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,YAC5E,CAAC,CAAC,QAAQ,GACP,EACN,eAAK,SAAS,EAAC,4CAA4C,EAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,aAC1E,CAAC,CAAC,QAAQ,EACV,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,gBAAM,SAAS,EAAC,MAAM,wBAAI,UAAU,CAAC,CAAC,CAAC,IAA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QAAQ,EAAC,IAAI,QAAC,IAAI,EAAE,OAAO,GAAI,GACrE,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,KAAC,UAAU,IACT,OAAO,EAAC,YAAY,EACpB,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,SAAS,EACd,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,yCAAyC,EAC9C,IAAI,EAAC,EAAE,EACP,SAAS,EAAE,GAAG,GACd,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AAClD,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The container (S7): reads the file store, builds the share options (they
|
|
3
|
+
* need the root) and picks the body renderer; the frame around it is
|
|
4
|
+
* `file-viewer-frame.tsx`, rendered from props.
|
|
5
|
+
*/
|
|
1
6
|
export declare function FileViewer(): import("react").JSX.Element;
|
|
2
7
|
//# sourceMappingURL=file-viewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-viewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/files/file-viewer.tsx"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,wBAAgB,UAAU,gCAqCzB"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2, AlertCircle, Eye, Code, Copy, Check, FolderOpen } from "lucide-react";
|
|
3
2
|
import { useState } from "react";
|
|
4
3
|
import { useFileStore } from "../../stores/file-store.js";
|
|
5
|
-
import { cn } from "../../lib/utils.js";
|
|
6
4
|
import { FileViewerMarkdown } from "./file-viewer-markdown.js";
|
|
7
5
|
import { FileViewerHtml } from "./file-viewer-html.js";
|
|
8
6
|
import { FileViewerRaw } from "./file-viewer-raw.js";
|
|
9
7
|
import { FileViewerBinary } from "./file-viewer-binary.js";
|
|
10
8
|
import { ShareMenu } from "../share/share-menu.js";
|
|
11
|
-
import {
|
|
9
|
+
import { useBrainUiRoot } from "../../root-context.js";
|
|
12
10
|
import { fetchAsFile, shareFile, renderAndShare } from "../../lib/share.js";
|
|
13
11
|
import { splitFrontmatter } from "../../lib/frontmatter.js";
|
|
14
12
|
import { stripMarkdown } from "../../lib/strip-markdown.js";
|
|
@@ -16,6 +14,12 @@ import { inlineMermaidDiagrams, isMermaidPath } from "../../lib/mermaid.js";
|
|
|
16
14
|
import { MermaidBlock } from "../chat/mermaid-block.js";
|
|
17
15
|
import { buildDiagramShareOptions } from "../chat/mermaid-share.js";
|
|
18
16
|
import { buildImageShareOptions } from "../images/image-share.js";
|
|
17
|
+
import { ViewerEmpty, ViewerError, ViewerLoading, ViewerToolbar } from "./file-viewer-frame.js";
|
|
18
|
+
/**
|
|
19
|
+
* The container (S7): reads the file store, builds the share options (they
|
|
20
|
+
* need the root) and picks the body renderer; the frame around it is
|
|
21
|
+
* `file-viewer-frame.tsx`, rendered from props.
|
|
22
|
+
*/
|
|
19
23
|
export function FileViewer() {
|
|
20
24
|
const currentPath = useFileStore((s) => s.currentPath);
|
|
21
25
|
const content = useFileStore((s) => s.currentContent);
|
|
@@ -24,14 +28,13 @@ export function FileViewer() {
|
|
|
24
28
|
const viewMode = useFileStore((s) => s.viewMode);
|
|
25
29
|
const setViewMode = useFileStore((s) => s.setViewMode);
|
|
26
30
|
const setTreeExpanded = useFileStore((s) => s.setTreeExpanded);
|
|
27
|
-
if (!currentPath)
|
|
28
|
-
return
|
|
29
|
-
}
|
|
31
|
+
if (!currentPath)
|
|
32
|
+
return _jsx(ViewerEmpty, {});
|
|
30
33
|
const fileName = currentPath.split("/").pop() ?? currentPath;
|
|
31
34
|
const previewAvailable = content?.kind === "markdown" ||
|
|
32
35
|
content?.kind === "html" ||
|
|
33
36
|
(content?.kind === "text" && isMermaidPath(content.path));
|
|
34
|
-
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx(Toolbar, { fileName: fileName, fullPath: currentPath, size: content?.size, viewMode: viewMode, setViewMode: setViewMode, previewAvailable: previewAvailable, content: content ?? null, onRevealInTree: () => setTreeExpanded(true) }), _jsxs("div", { className: "flex-1 overflow-auto", children: [loading &&
|
|
37
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx(Toolbar, { fileName: fileName, fullPath: currentPath, size: content?.size, viewMode: viewMode, setViewMode: setViewMode, previewAvailable: previewAvailable, content: content ?? null, onRevealInTree: () => setTreeExpanded(true) }), _jsxs("div", { className: "flex-1 overflow-auto", children: [loading && _jsx(ViewerLoading, {}), error && _jsx(ViewerError, { message: error }), !loading && !error && content && _jsx(ViewerBody, { content: content, viewMode: viewMode })] })] }));
|
|
35
38
|
}
|
|
36
39
|
function ViewerBody({ content, viewMode }) {
|
|
37
40
|
if (content.kind === "binary") {
|
|
@@ -50,31 +53,22 @@ function ViewerBody({ content, viewMode }) {
|
|
|
50
53
|
return _jsx(FileViewerHtml, { content: content.content ?? "" });
|
|
51
54
|
}
|
|
52
55
|
function Toolbar({ fileName, fullPath, size, viewMode, setViewMode, previewAvailable, content, onRevealInTree, }) {
|
|
56
|
+
const root = useBrainUiRoot();
|
|
53
57
|
const [copied, setCopied] = useState(false);
|
|
54
|
-
const shareOptions = content ? buildFileShareOptions(content, fileName) : [];
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function ModeButton({ active, onClick, title, children }) {
|
|
62
|
-
return (_jsx("button", { onClick: onClick, title: title, className: cn("flex h-7 w-7 items-center justify-center transition-colors", active ? "bg-surface-raised text-primary" : "text-muted-foreground hover:text-foreground"), children: children }));
|
|
63
|
-
}
|
|
64
|
-
function formatSize(bytes) {
|
|
65
|
-
if (bytes < 1024)
|
|
66
|
-
return `${bytes} B`;
|
|
67
|
-
if (bytes < 1024 * 1024)
|
|
68
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
69
|
-
return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
58
|
+
const shareOptions = content ? buildFileShareOptions(root, content, fileName) : [];
|
|
59
|
+
return (_jsx(ViewerToolbar, { fileName: fileName, fullPath: fullPath, size: size, mode: viewMode, previewAvailable: previewAvailable, copied: copied, share: shareOptions.length > 0 ? _jsx(ShareMenu, { options: shareOptions, title: "Share" }) : null, onMode: setViewMode, onCopyPath: () => {
|
|
60
|
+
navigator.clipboard.writeText(fullPath);
|
|
61
|
+
setCopied(true);
|
|
62
|
+
setTimeout(() => setCopied(false), 1500);
|
|
63
|
+
}, onReveal: onRevealInTree }));
|
|
70
64
|
}
|
|
71
|
-
function buildFileShareOptions(content, fileName) {
|
|
72
|
-
const rawUrl = `${apiBase()}/files/content?path=${encodeURIComponent(content.path)}&raw=1`;
|
|
65
|
+
function buildFileShareOptions(root, content, fileName) {
|
|
66
|
+
const rawUrl = `${root.apiBase()}/files/content?path=${encodeURIComponent(content.path)}&raw=1`;
|
|
73
67
|
if (content.kind === "binary") {
|
|
74
68
|
// An image gets both: the original bytes, and a lighter re-encode for
|
|
75
69
|
// messaging. The original is first, and nothing is downgraded unasked.
|
|
76
70
|
if (content.mime?.startsWith("image/")) {
|
|
77
|
-
return buildImageShareOptions(rawUrl, fileName, {
|
|
71
|
+
return buildImageShareOptions(root, rawUrl, fileName, {
|
|
78
72
|
mime: content.mime,
|
|
79
73
|
bytes: content.size,
|
|
80
74
|
});
|
|
@@ -86,7 +80,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
86
80
|
id: "file",
|
|
87
81
|
label: "Share file",
|
|
88
82
|
run: async () => {
|
|
89
|
-
const file = await fetchAsFile(rawUrl, fileName, content.mime);
|
|
83
|
+
const file = await fetchAsFile(root, rawUrl, fileName, content.mime);
|
|
90
84
|
return shareFile(file, { title: fileName });
|
|
91
85
|
},
|
|
92
86
|
},
|
|
@@ -125,7 +119,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
125
119
|
id: "md-png",
|
|
126
120
|
label: "Share as image",
|
|
127
121
|
hint: "Rendered PNG snapshot",
|
|
128
|
-
run: async () => renderAndShare({
|
|
122
|
+
run: async () => renderAndShare(root, {
|
|
129
123
|
// The render page runs without JavaScript — mermaid fences are
|
|
130
124
|
// pre-rendered to inline SVG on the client.
|
|
131
125
|
content: await inlineMermaidDiagrams(body),
|
|
@@ -139,7 +133,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
139
133
|
id: "md-pdf",
|
|
140
134
|
label: "Share as PDF",
|
|
141
135
|
hint: "Vector PDF, A4",
|
|
142
|
-
run: async () => renderAndShare({
|
|
136
|
+
run: async () => renderAndShare(root, {
|
|
143
137
|
content: await inlineMermaidDiagrams(body),
|
|
144
138
|
contentType: "markdown",
|
|
145
139
|
format: "pdf",
|
|
@@ -165,7 +159,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
165
159
|
{
|
|
166
160
|
id: "html-png",
|
|
167
161
|
label: "Share as image",
|
|
168
|
-
run: () => renderAndShare({
|
|
162
|
+
run: () => renderAndShare(root, {
|
|
169
163
|
content: html,
|
|
170
164
|
contentType: "html",
|
|
171
165
|
format: "png",
|
|
@@ -176,7 +170,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
176
170
|
{
|
|
177
171
|
id: "html-pdf",
|
|
178
172
|
label: "Share as PDF",
|
|
179
|
-
run: () => renderAndShare({
|
|
173
|
+
run: () => renderAndShare(root, {
|
|
180
174
|
content: html,
|
|
181
175
|
contentType: "html",
|
|
182
176
|
format: "pdf",
|
|
@@ -191,7 +185,7 @@ function buildFileShareOptions(content, fileName) {
|
|
|
191
185
|
if (content.kind === "text" && isMermaidPath(content.path)) {
|
|
192
186
|
const source = content.content ?? "";
|
|
193
187
|
return [
|
|
194
|
-
...buildDiagramShareOptions(source, { filename: baseName(fileName) }),
|
|
188
|
+
...buildDiagramShareOptions(root, source, { filename: baseName(fileName) }),
|
|
195
189
|
{
|
|
196
190
|
id: "mmd-file",
|
|
197
191
|
label: "Share source file",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-viewer.js","sourceRoot":"","sources":["../../../src/components/files/file-viewer.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"file-viewer.js","sourceRoot":"","sources":["../../../src/components/files/file-viewer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,sBAAsB,C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