zidane-ui 9.4.0 → 9.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/live.d.ts +7 -2
- package/dist/adapters/live.js +5 -2
- package/dist/adapters/server-approvals-host.js +3 -1
- package/dist/adapters/server-channels-host.d.ts +32 -0
- package/dist/adapters/server-channels-host.js +49 -0
- package/dist/adapters/server-composer-host.js +13 -0
- package/dist/adapters/server-files-host.js +12 -31
- package/dist/adapters/server-host.js +27 -3
- package/dist/adapters/server-machines-host.d.ts +5 -0
- package/dist/adapters/server-machines-host.js +13 -6
- package/dist/adapters/server-oauth-flow.d.ts +2 -1
- package/dist/adapters/server-projects.d.ts +15 -0
- package/dist/adapters/server-projects.js +225 -0
- package/dist/adapters/server-session-host.d.ts +2 -0
- package/dist/adapters/server-session-host.js +20 -1
- package/dist/app/AppHostProvider.d.ts +1 -1
- package/dist/app/AppHostProvider.js +7 -2
- package/dist/app/ModalProvider.d.ts +6 -2
- package/dist/app/ModalProvider.js +38 -10
- package/dist/app/headless/app-host.d.ts +3 -0
- package/dist/approvals/ApprovalsProvider.d.ts +2 -1
- package/dist/approvals/ApprovalsProvider.js +12 -4
- package/dist/approvals/headless/host.d.ts +13 -2
- package/dist/approvals/headless/index.d.ts +3 -3
- package/dist/approvals/headless/index.js +2 -2
- package/dist/approvals/headless/labels.d.ts +12 -2
- package/dist/approvals/headless/labels.js +19 -1
- package/dist/channels/BindingEditorDialog.d.ts +18 -0
- package/dist/channels/BindingEditorDialog.js +637 -0
- package/dist/channels/ChannelAlertsList.d.ts +25 -0
- package/dist/channels/ChannelAlertsList.js +107 -0
- package/dist/channels/ChannelDefaultsSection.d.ts +20 -0
- package/dist/channels/ChannelDefaultsSection.js +133 -0
- package/dist/channels/ChannelsProvider.d.ts +31 -0
- package/dist/channels/ChannelsProvider.js +29 -0
- package/dist/channels/ChannelsSettingsSection.d.ts +40 -0
- package/dist/channels/ChannelsSettingsSection.js +456 -0
- package/dist/channels/ConnectionSetupDialog.d.ts +16 -0
- package/dist/channels/ConnectionSetupDialog.js +470 -0
- package/dist/channels/HeldRepliesList.d.ts +27 -0
- package/dist/channels/HeldRepliesList.js +173 -0
- package/dist/channels/ProjectChannelsSection.d.ts +55 -0
- package/dist/channels/ProjectChannelsSection.js +433 -0
- package/dist/channels/ReadinessChecklist.d.ts +102 -0
- package/dist/channels/ReadinessChecklist.js +273 -0
- package/dist/channels/TestSessionBanner.d.ts +24 -0
- package/dist/channels/TestSessionBanner.js +44 -0
- package/dist/channels/channels-parts.d.ts +104 -0
- package/dist/channels/channels-parts.js +203 -0
- package/dist/channels/context.d.ts +9 -0
- package/dist/channels/context.js +14 -0
- package/dist/channels/headless/access.d.ts +127 -0
- package/dist/channels/headless/access.js +187 -0
- package/dist/channels/headless/fixture-host.d.ts +83 -0
- package/dist/channels/headless/fixture-host.js +557 -0
- package/dist/channels/headless/host.d.ts +245 -0
- package/dist/channels/headless/host.js +39 -0
- package/dist/channels/headless/index.d.ts +10 -0
- package/dist/channels/headless/index.js +5 -0
- package/dist/channels/headless/labels.d.ts +217 -0
- package/dist/channels/headless/labels.js +260 -0
- package/dist/channels/headless/state.d.ts +22 -0
- package/dist/channels/headless/state.js +303 -0
- package/dist/channels/index.d.ts +21 -0
- package/dist/channels/index.js +13 -0
- package/dist/channels/testing/contract.d.ts +31 -0
- package/dist/channels/testing/contract.js +378 -0
- package/dist/channels/testing/index.d.ts +7 -0
- package/dist/channels/testing/index.js +1 -0
- package/dist/chat/HostBadge.js +1 -0
- package/dist/chat/OrchestratorBadge.d.ts +23 -0
- package/dist/chat/OrchestratorBadge.js +22 -0
- package/dist/chat/SessionGroupHeader.d.ts +11 -1
- package/dist/chat/SessionGroupHeader.js +25 -14
- package/dist/chat/SessionList.d.ts +1 -1
- package/dist/chat/SessionList.js +1 -1
- package/dist/chat/SessionRow.d.ts +141 -0
- package/dist/chat/SessionRow.js +215 -0
- package/dist/chat/StatusDot.d.ts +7 -2
- package/dist/chat/StatusDot.js +3 -2
- package/dist/chat/Transcript.js +6 -2
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ContextBreakdown.d.ts +27 -2
- package/dist/chat/composer/ContextBreakdown.js +123 -2
- package/dist/chat/composer/DraftPickers.d.ts +8 -2
- package/dist/chat/composer/DraftPickers.js +7 -3
- package/dist/chat/composer/HostContextOrb.d.ts +2 -0
- package/dist/chat/composer/HostContextOrb.js +17 -2
- package/dist/chat/composer/ProjectMenu.d.ts +16 -3
- package/dist/chat/composer/ProjectMenu.js +102 -20
- package/dist/chat/composer/ScopeToggle.d.ts +7 -2
- package/dist/chat/composer/ScopeToggle.js +4 -2
- package/dist/chat/composer/ServerScopeToggle.d.ts +7 -2
- package/dist/chat/composer/ServerScopeToggle.js +3 -1
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/index.js +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +12 -1
- package/dist/chat/composer/use-draft-target.js +22 -10
- package/dist/chat/composer/use-send-prompt.d.ts +2 -0
- package/dist/chat/composer/use-send-prompt.js +4 -1
- package/dist/chat/headless/answered-first.d.ts +28 -0
- package/dist/chat/headless/answered-first.js +14 -0
- package/dist/chat/headless/chip-labels.d.ts +2 -0
- package/dist/chat/headless/chip-labels.js +2 -0
- package/dist/chat/headless/composer/composer-sources.d.ts +5 -2
- package/dist/chat/headless/composer/composer-sources.js +6 -0
- package/dist/chat/headless/composer/host.d.ts +13 -0
- package/dist/chat/headless/composer/index.d.ts +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -0
- package/dist/chat/headless/composer/labels-chrome.js +4 -1
- package/dist/chat/headless/composer/labels-editor.d.ts +2 -0
- package/dist/chat/headless/composer/labels-editor.js +2 -0
- package/dist/chat/headless/draft-target.d.ts +2 -0
- package/dist/chat/headless/fixtures/demo-transcript-all-kinds.d.ts +6 -0
- package/dist/chat/headless/fixtures/demo-transcript-all-kinds.js +90 -2
- package/dist/chat/headless/folder-groups.d.ts +41 -0
- package/dist/chat/headless/folder-groups.js +76 -0
- package/dist/chat/headless/host.d.ts +16 -1
- package/dist/chat/headless/hosts.d.ts +1 -1
- package/dist/chat/headless/index.d.ts +15 -10
- package/dist/chat/headless/index.js +35 -30
- package/dist/chat/headless/labels.d.ts +43 -4
- package/dist/chat/headless/labels.js +40 -9
- package/dist/chat/headless/prompt-origin.d.ts +2 -2
- package/dist/chat/headless/prompt-origin.js +3 -3
- package/dist/chat/headless/send-flow.d.ts +2 -0
- package/dist/chat/headless/session-list.d.ts +36 -2
- package/dist/chat/headless/session-list.js +7 -0
- package/dist/chat/headless/sidebar/directory.d.ts +5 -0
- package/dist/chat/headless/sidebar/directory.js +2 -0
- package/dist/chat/headless/sidebar/inbox.d.ts +33 -7
- package/dist/chat/headless/sidebar/inbox.js +65 -26
- package/dist/chat/headless/sidebar/index.d.ts +6 -4
- package/dist/chat/headless/sidebar/index.js +5 -3
- package/dist/chat/headless/sidebar/labels.d.ts +36 -7
- package/dist/chat/headless/sidebar/labels.js +1 -4
- package/dist/chat/headless/sidebar/project-main.d.ts +43 -0
- package/dist/chat/headless/sidebar/project-main.js +46 -0
- package/dist/chat/headless/sidebar/row-changes.d.ts +43 -0
- package/dist/chat/headless/sidebar/row-changes.js +43 -0
- package/dist/chat/headless/sidebar/rows.d.ts +64 -6
- package/dist/chat/headless/sidebar/rows.js +98 -18
- package/dist/chat/headless/sidebar/types.d.ts +12 -0
- package/dist/chat/headless/streams/live-events.d.ts +12 -0
- package/dist/chat/headless/streams/live-events.js +21 -2
- package/dist/chat/headless/streams/store.d.ts +17 -0
- package/dist/chat/headless/streams/store.js +38 -15
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/collapse.js +3 -1
- package/dist/chat/headless/transcript/derive.d.ts +1 -0
- package/dist/chat/headless/transcript/derive.js +3 -1
- package/dist/chat/headless/transcript/fold.js +1 -0
- package/dist/chat/headless/transcript/index.d.ts +3 -2
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +8 -1
- package/dist/chat/headless/transcript/rail.js +10 -2
- package/dist/chat/headless/transcript/rows.d.ts +31 -3
- package/dist/chat/headless/transcript/select-stops.js +1 -0
- package/dist/chat/headless/transcript/session-groups.d.ts +36 -0
- package/dist/chat/headless/transcript/session-groups.js +94 -0
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/index.d.ts +8 -5
- package/dist/chat/index.js +9 -6
- package/dist/chat/interactions/HostInteractions.js +4 -2
- package/dist/chat/interactions/InboxPanel.js +6 -4
- package/dist/chat/interactions/use-answer-interaction.d.ts +11 -0
- package/dist/chat/interactions/use-answer-interaction.js +19 -0
- package/dist/chat/rich-composer/artifact-mentions.d.ts +29 -0
- package/dist/chat/rich-composer/artifact-mentions.js +40 -0
- package/dist/chat/rich-composer/composer-extensions.d.ts +3 -2
- package/dist/chat/rich-composer/composer-extensions.js +12 -9
- package/dist/chat/rich-composer/use-composer-sources.js +1 -0
- package/dist/chat/sidebar/InboxList.d.ts +26 -2
- package/dist/chat/sidebar/InboxList.js +65 -49
- package/dist/chat/sidebar/MainSessionRow.d.ts +2 -1
- package/dist/chat/sidebar/MainSessionRow.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +8 -4
- package/dist/chat/sidebar/ProjectIcon.js +15 -3
- package/dist/chat/sidebar/SessionSidebar.d.ts +51 -2
- package/dist/chat/sidebar/SessionSidebar.js +87 -17
- package/dist/chat/sidebar/SidebarFooter.d.ts +2 -23
- package/dist/chat/sidebar/SidebarFooter.js +2 -43
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -3
- package/dist/chat/sidebar/SidebarGroupHeader.js +36 -15
- package/dist/chat/sidebar/SidebarLiveProvider.d.ts +22 -0
- package/dist/chat/sidebar/SidebarLiveProvider.js +20 -0
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +6 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +16 -7
- package/dist/chat/sidebar/inbox-triage.d.ts +18 -2
- package/dist/chat/sidebar/inbox-triage.js +39 -12
- package/dist/chat/sidebar/index.d.ts +5 -4
- package/dist/chat/sidebar/index.js +3 -2
- package/dist/chat/sidebar/sidebar-live.d.ts +29 -2
- package/dist/chat/sidebar/sidebar-live.js +36 -2
- package/dist/chat/sidebar/useInboxRows.d.ts +4 -1
- package/dist/chat/sidebar/useInboxRows.js +8 -6
- package/dist/chat/sidebar/useInboxTriage.d.ts +8 -2
- package/dist/chat/sidebar/useInboxTriage.js +29 -20
- package/dist/chat/testing/fixture-composer-host.d.ts +3 -1
- package/dist/chat/testing/fixture-composer-host.js +1 -0
- package/dist/chat/testing/index.d.ts +2 -2
- package/dist/chat/testing/index.js +2 -2
- package/dist/chat/transcript/BadgeMenu.d.ts +9 -2
- package/dist/chat/transcript/BadgeMenu.js +20 -2
- package/dist/chat/transcript/PromptEcho.js +15 -2
- package/dist/chat/transcript/PromptOriginLabel.d.ts +1 -1
- package/dist/chat/transcript/SubagentBlock.js +24 -7
- package/dist/chat/transcript/TranscriptRail.d.ts +3 -1
- package/dist/chat/transcript/TranscriptRail.js +15 -5
- package/dist/chat/transcript/TranscriptRow.js +9 -0
- package/dist/chat/transcript/badges.d.ts +1 -0
- package/dist/chat/transcript/badges.js +1 -0
- package/dist/chat/transcript/fold.js +2 -1
- package/dist/chat/transcript/frame.d.ts +7 -0
- package/dist/chat/transcript/frame.js +51 -5
- package/dist/chat/transcript/index.d.ts +5 -4
- package/dist/chat/transcript/index.js +4 -3
- package/dist/chat/transcript/inline-facts.d.ts +9 -0
- package/dist/chat/transcript/inline-facts.js +20 -0
- package/dist/chat/transcript/notices.d.ts +34 -12
- package/dist/chat/transcript/notices.js +213 -97
- package/dist/chat/transcript/prompt.js +8 -1
- package/dist/chat/transcript/receipt-parts.d.ts +29 -2
- package/dist/chat/transcript/receipt-parts.js +40 -7
- package/dist/chat/transcript/row-estimate.js +4 -1
- package/dist/chat/transcript/run-rows.js +2 -5
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/session-groups.d.ts +21 -0
- package/dist/chat/transcript/session-groups.js +154 -0
- package/dist/chat/transcript/session-line.d.ts +63 -0
- package/dist/chat/transcript/session-line.js +114 -0
- package/dist/chat/transcript/tasks.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +1 -1
- package/dist/chat/transcript/tool-row.js +3 -2
- package/dist/code/editor/FileView.js +1 -3
- package/dist/components/Form.d.ts +28 -1
- package/dist/components/Form.js +43 -7
- package/dist/components/HelpTip.d.ts +22 -0
- package/dist/components/HelpTip.js +26 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/Notice.d.ts +6 -4
- package/dist/components/Notice.js +73 -27
- package/dist/components/Progress.js +10 -4
- package/dist/components/SearchField.d.ts +46 -0
- package/dist/components/SearchField.js +50 -0
- package/dist/components/ShowMore.d.ts +48 -0
- package/dist/components/ShowMore.js +57 -0
- package/dist/components/Tooltip.js +8 -5
- package/dist/components/charts/ScatterChart.js +13 -6
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/useAnchoredPosition.d.ts +15 -1
- package/dist/components/floating/useAnchoredPosition.js +41 -7
- package/dist/components/palette/PaletteList.d.ts +5 -5
- package/dist/components/palette/PaletteList.js +2 -3
- package/dist/components/palette/PalettePanel.js +18 -12
- package/dist/components/palette/palette-layout.d.ts +5 -1
- package/dist/components/palette/palette-layout.js +13 -10
- package/dist/core.css +45 -20
- package/dist/dist/index-BmO8bRgK.d.ts +1 -0
- package/dist/dist/{index-BheVJOLc.d.ts → index-DPbpsCtl.d.ts} +248 -118
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-Bzg_jJK2.d.ts +2 -0
- package/dist/dist/{timeout-CmTx6V9y.d.ts → timeout-NoG7ppkm.d.ts} +1 -1
- package/dist/files/FilesProvider.d.ts +2 -0
- package/dist/files/FilesProvider.js +5 -1
- package/dist/files/headless/host.d.ts +6 -2
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.js +2 -2
- package/dist/git/GitBar.js +8 -2
- package/dist/git/MoveSessionDialog.js +8 -5
- package/dist/git/MoveToDialog.d.ts +3 -1
- package/dist/git/MoveToDialog.js +43 -16
- package/dist/git/TeleportSessionDialog.d.ts +11 -4
- package/dist/git/TeleportSessionDialog.js +263 -107
- package/dist/git/WherePicker.js +4 -1
- package/dist/git/headless/labels.d.ts +8 -0
- package/dist/git/headless/labels.js +24 -16
- package/dist/git/index.d.ts +2 -2
- package/dist/git/index.js +2 -2
- package/dist/git/useEnvironmentChoices.d.ts +19 -0
- package/dist/git/useEnvironmentChoices.js +34 -10
- package/dist/hooks/useLastCount.d.ts +9 -0
- package/dist/hooks/useLastCount.js +29 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +7 -3
- package/dist/keybindings/headless/overrides.d.ts +1 -1
- package/dist/keybindings/headless/overrides.js +14 -3
- package/dist/labels.d.ts +7 -0
- package/dist/labels.js +10 -3
- package/dist/machines/AddMachineDialog.js +1 -1
- package/dist/machines/AddServerForm.d.ts +14 -2
- package/dist/machines/AddServerForm.js +167 -51
- package/dist/machines/HostCapabilities.js +8 -4
- package/dist/machines/HostSignIn.d.ts +2 -1
- package/dist/machines/HostSignIn.js +1 -0
- package/dist/machines/HostSyncPanel.d.ts +4 -1
- package/dist/machines/HostSyncPanel.js +248 -132
- package/dist/machines/HostsSection.d.ts +2 -2
- package/dist/machines/HostsSection.js +91 -52
- package/dist/machines/LinkedAccountsPanel.d.ts +29 -0
- package/dist/machines/LinkedAccountsPanel.js +268 -0
- package/dist/machines/MachinesExplainer.d.ts +4 -4
- package/dist/machines/MachinesExplainer.js +27 -17
- package/dist/machines/OrganizationPanel.d.ts +12 -5
- package/dist/machines/OrganizationPanel.js +420 -133
- package/dist/machines/ProjectsSpendPanel.d.ts +22 -0
- package/dist/machines/ProjectsSpendPanel.js +160 -0
- package/dist/machines/ServerMachinesPanel.js +19 -4
- package/dist/machines/ServerUpdatePanel.js +3 -3
- package/dist/machines/SyncAccounts.d.ts +14 -7
- package/dist/machines/SyncAccounts.js +67 -81
- package/dist/machines/TokensPanel.js +54 -30
- package/dist/machines/headless/fixture-host.d.ts +15 -10
- package/dist/machines/headless/fixture-host.js +75 -44
- package/dist/machines/headless/fixtures.d.ts +12 -0
- package/dist/machines/headless/fixtures.js +71 -1
- package/dist/machines/headless/host.d.ts +13 -9
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +2 -2
- package/dist/machines/headless/labels.d.ts +81 -40
- package/dist/machines/headless/labels.js +103 -60
- package/dist/machines/headless/linked-accounts.d.ts +42 -0
- package/dist/machines/headless/linked-accounts.js +31 -0
- package/dist/machines/headless/organization.d.ts +9 -3
- package/dist/machines/headless/organization.js +12 -2
- package/dist/machines/headless/sync.d.ts +2 -0
- package/dist/machines/index.d.ts +3 -2
- package/dist/machines/index.js +3 -2
- package/dist/machines/sync-rows.d.ts +8 -0
- package/dist/machines/sync-rows.js +10 -0
- package/dist/machines/testing/contract.d.ts +1 -25
- package/dist/machines/testing/contract.js +1 -97
- package/dist/machines/testing/index.d.ts +3 -3
- package/dist/machines/testing/index.js +2 -2
- package/dist/onboarding/demos/extensions.d.ts +4 -0
- package/dist/onboarding/demos/extensions.js +27 -1
- package/dist/onboarding/demos/sidebar-layout.d.ts +4 -2
- package/dist/onboarding/demos/sidebar-layout.js +5 -2
- package/dist/onboarding/headless/labels.d.ts +9 -0
- package/dist/onboarding/headless/labels.js +2 -0
- package/dist/onboarding/steps/SidebarStep.js +4 -2
- package/dist/onboarding/steps/setting-cards.d.ts +4 -2
- package/dist/onboarding/steps/setting-cards.js +3 -2
- package/dist/palette/PaletteDialog.js +4 -4
- package/dist/palette/PaletteRows.js +34 -16
- package/dist/palette/headless/app-sources.js +3 -1
- package/dist/palette/headless/labels.js +2 -2
- package/dist/palette/usePaletteController.js +4 -8
- package/dist/session/ArtifactsPanel.js +11 -23
- package/dist/session/NewProjectDialog.d.ts +33 -0
- package/dist/session/NewProjectDialog.js +216 -0
- package/dist/session/OpenProjectsDialog.d.ts +56 -0
- package/dist/session/OpenProjectsDialog.js +324 -0
- package/dist/session/OpenSessionsDialog.js +186 -61
- package/dist/session/ProjectArtifactsHome.d.ts +42 -0
- package/dist/session/ProjectArtifactsHome.js +98 -0
- package/dist/session/ProjectArtifactsSection.d.ts +13 -0
- package/dist/session/ProjectArtifactsSection.js +367 -0
- package/dist/session/ProjectBudgetsSection.d.ts +7 -0
- package/dist/session/ProjectBudgetsSection.js +377 -0
- package/dist/session/ProjectContextSection.d.ts +20 -0
- package/dist/session/ProjectContextSection.js +139 -0
- package/dist/session/ProjectHome.d.ts +32 -5
- package/dist/session/ProjectHome.js +496 -249
- package/dist/session/ProjectInstructionsSection.d.ts +7 -0
- package/dist/session/ProjectInstructionsSection.js +179 -0
- package/dist/session/ProjectMainButton.d.ts +35 -0
- package/dist/session/ProjectMainButton.js +73 -0
- package/dist/session/ProjectName.d.ts +76 -0
- package/dist/session/ProjectName.js +140 -0
- package/dist/session/ProjectOrchestratorSection.d.ts +14 -0
- package/dist/session/ProjectOrchestratorSection.js +117 -0
- package/dist/session/ProjectPublishDialog.d.ts +30 -0
- package/dist/session/ProjectPublishDialog.js +420 -0
- package/dist/session/ProjectSessionAccessSection.d.ts +13 -0
- package/dist/session/ProjectSessionAccessSection.js +109 -0
- package/dist/session/ProjectSessionsList.d.ts +53 -0
- package/dist/session/ProjectSessionsList.js +316 -0
- package/dist/session/ProjectSettingsDialog.d.ts +30 -0
- package/dist/session/ProjectSettingsDialog.js +693 -0
- package/dist/session/ProjectShareDialog.d.ts +36 -0
- package/dist/session/ProjectShareDialog.js +190 -0
- package/dist/session/ProjectSkillsSection.d.ts +7 -0
- package/dist/session/ProjectSkillsSection.js +197 -0
- package/dist/session/ProjectToolsSection.d.ts +16 -0
- package/dist/session/ProjectToolsSection.js +347 -0
- package/dist/session/ProjectUsage.d.ts +61 -0
- package/dist/session/ProjectUsage.js +344 -0
- package/dist/session/ProviderUsageProvider.d.ts +2 -3
- package/dist/session/QueueTab.js +11 -1
- package/dist/session/SessionAccessNotice.d.ts +31 -0
- package/dist/session/SessionAccessNotice.js +69 -0
- package/dist/session/SessionDetailsDialog.d.ts +3 -1
- package/dist/session/SessionDetailsDialog.js +16 -1
- package/dist/session/SessionHeader.d.ts +10 -3
- package/dist/session/SessionHeader.js +20 -8
- package/dist/session/SessionPeopleStack.d.ts +3 -2
- package/dist/session/SessionPeopleStack.js +51 -17
- package/dist/session/SessionPlaceMenu.js +2 -2
- package/dist/session/SessionProvider.d.ts +13 -1
- package/dist/session/SessionProvider.js +21 -1
- package/dist/session/ShareSessionDialog.d.ts +4 -4
- package/dist/session/ShareSessionDialog.js +182 -283
- package/dist/session/TypingLine.d.ts +9 -4
- package/dist/session/TypingLine.js +16 -5
- package/dist/session/{UsagePanel.d.ts → UsageSection.d.ts} +9 -13
- package/dist/session/{UsagePanel.js → UsageSection.js} +40 -41
- package/dist/session/artifact-row-parts.d.ts +32 -0
- package/dist/session/artifact-row-parts.js +51 -0
- package/dist/session/headless/access.d.ts +33 -0
- package/dist/session/headless/access.js +48 -0
- package/dist/session/headless/fixture-host.d.ts +48 -9
- package/dist/session/headless/fixture-host.js +139 -1
- package/dist/session/headless/fixture-project-artifacts.d.ts +77 -0
- package/dist/session/headless/fixture-project-artifacts.js +168 -0
- package/dist/session/headless/fixture-project-content.d.ts +67 -0
- package/dist/session/headless/fixture-project-content.js +176 -0
- package/dist/session/headless/fixture-projects.d.ts +175 -0
- package/dist/session/headless/fixture-projects.js +498 -0
- package/dist/session/headless/home-layout.d.ts +18 -2
- package/dist/session/headless/home-layout.js +20 -7
- package/dist/session/headless/host.d.ts +263 -7
- package/dist/session/headless/index.d.ts +10 -5
- package/dist/session/headless/index.js +8 -3
- package/dist/session/headless/labels.d.ts +381 -6
- package/dist/session/headless/labels.js +72 -24
- package/dist/session/headless/orchestration-labels.d.ts +52 -0
- package/dist/session/headless/orchestration-labels.js +59 -0
- package/dist/session/headless/project-artifact-labels.d.ts +67 -0
- package/dist/session/headless/project-artifact-labels.js +96 -0
- package/dist/session/headless/project-artifacts.d.ts +124 -0
- package/dist/session/headless/project-artifacts.js +271 -0
- package/dist/session/headless/project-content-labels.d.ts +88 -0
- package/dist/session/headless/project-content-labels.js +152 -0
- package/dist/session/headless/project-labels.d.ts +123 -0
- package/dist/session/headless/project-labels.js +128 -0
- package/dist/session/headless/project-sessions.d.ts +37 -0
- package/dist/session/headless/project-sessions.js +57 -0
- package/dist/session/headless/project-usage-labels.d.ts +74 -0
- package/dist/session/headless/project-usage-labels.js +81 -0
- package/dist/session/headless/project-usage.d.ts +65 -0
- package/dist/session/headless/project-usage.js +92 -0
- package/dist/session/headless/projects.d.ts +158 -0
- package/dist/session/headless/projects.js +301 -0
- package/dist/session/headless/pushed-once.d.ts +22 -0
- package/dist/session/headless/pushed-once.js +28 -0
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/typing.d.ts +20 -1
- package/dist/session/headless/typing.js +58 -3
- package/dist/session/home-block-parts.d.ts +40 -0
- package/dist/session/home-block-parts.js +46 -0
- package/dist/session/index.d.ts +17 -4
- package/dist/session/index.js +16 -3
- package/dist/session/modal-shell.d.ts +1 -1
- package/dist/session/modal-shell.js +1 -1
- package/dist/session/project-artifact-parts.d.ts +59 -0
- package/dist/session/project-artifact-parts.js +222 -0
- package/dist/session/project-content-parts.d.ts +176 -0
- package/dist/session/project-content-parts.js +546 -0
- package/dist/session/project-files.d.ts +48 -0
- package/dist/session/project-files.js +54 -0
- package/dist/session/project-folder-actions.d.ts +11 -0
- package/dist/session/project-folder-actions.js +39 -0
- package/dist/session/project-mcp-add.d.ts +23 -0
- package/dist/session/project-mcp-add.js +107 -0
- package/dist/session/project-record-document.d.ts +48 -0
- package/dist/session/project-record-document.js +225 -0
- package/dist/session/project-settings-parts.d.ts +69 -0
- package/dist/session/project-settings-parts.js +90 -0
- package/dist/session/share-people.d.ts +222 -0
- package/dist/session/share-people.js +457 -0
- package/dist/session/testing/contract.d.ts +67 -8
- package/dist/session/testing/contract.js +343 -6
- package/dist/session/testing/index.d.ts +5 -2
- package/dist/session/testing/index.js +4 -1
- package/dist/session/testing/project-artifacts.contract.js +159 -0
- package/dist/session/testing/project-content.contract.d.ts +19 -0
- package/dist/session/testing/project-content.contract.js +221 -0
- package/dist/session/testing/project-sessions.contract.js +134 -0
- package/dist/session/use-folder-missing.d.ts +6 -0
- package/dist/session/use-folder-missing.js +31 -0
- package/dist/session/use-folder-project.d.ts +14 -0
- package/dist/session/use-folder-project.js +37 -0
- package/dist/session/use-home-projects.d.ts +55 -0
- package/dist/session/use-home-projects.js +154 -0
- package/dist/session/use-project-home-layout.d.ts +33 -0
- package/dist/session/use-project-home-layout.js +134 -0
- package/dist/session/use-project-home-on.d.ts +2 -0
- package/dist/session/use-project-home-on.js +14 -0
- package/dist/settings/SettingCard.d.ts +3 -1
- package/dist/settings/SettingCard.js +2 -1
- package/dist/settings/SettingDemo.d.ts +3 -1
- package/dist/settings/SettingDemo.js +4 -3
- package/dist/settings/SettingsShell.d.ts +2 -1
- package/dist/settings/SettingsShell.js +55 -43
- package/dist/settings/headless/index.d.ts +2 -1
- package/dist/settings/headless/index.js +2 -1
- package/dist/settings/headless/mcp-requirement.d.ts +93 -0
- package/dist/settings/headless/mcp-requirement.js +117 -0
- package/dist/settings/headless/mcp.d.ts +2 -0
- package/dist/settings/headless/mcp.js +3 -2
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +3 -2
- package/dist/settings/index.js +13 -12
- package/dist/settings/section.d.ts +9 -0
- package/dist/settings/section.js +12 -1
- package/dist/settings/sections/editor/labels.js +1 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +6 -2
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +10 -1
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +1 -0
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +6 -3
- package/dist/settings/sections/extensions/ExtensionsSection.js +24 -3
- package/dist/settings/sections/extensions/McpRequirementRow.d.ts +45 -0
- package/dist/settings/sections/extensions/McpRequirementRow.js +298 -0
- package/dist/settings/sections/extensions/labels.d.ts +4 -0
- package/dist/settings/sections/extensions/labels.js +4 -0
- package/dist/settings/sections/extensions/options-labels.d.ts +39 -0
- package/dist/settings/sections/extensions/options-labels.js +48 -1
- package/dist/settings/sections/extensions/use-mcp-setup.d.ts +6 -0
- package/dist/settings/sections/extensions/use-mcp-setup.js +41 -0
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +3 -0
- package/dist/settings/sections/index.d.ts +4 -3
- package/dist/settings/sections/index.js +4 -3
- package/dist/settings/sections/instructions/InstructionsSection.d.ts +69 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +181 -109
- package/dist/settings/sections/mcp/McpAddForm.d.ts +9 -2
- package/dist/settings/sections/mcp/McpAddForm.js +15 -7
- package/dist/settings/sections/mcp/McpSection.js +3 -5
- package/dist/settings/sections/mcp/McpServerRow.js +7 -47
- package/dist/settings/sections/mcp/McpSignIn.d.ts +38 -0
- package/dist/settings/sections/mcp/McpSignIn.js +72 -0
- package/dist/settings/sections/mcp/labels.js +1 -1
- package/dist/settings/sections/models/AgentDefaults.d.ts +12 -4
- package/dist/settings/sections/models/AgentDefaults.js +102 -70
- package/dist/settings/sections/models/ModelPickField.d.ts +10 -1
- package/dist/settings/sections/models/ModelPickField.js +87 -39
- package/dist/settings/sections/models/labels.d.ts +8 -0
- package/dist/settings/sections/models/labels.js +8 -0
- package/dist/settings/sections/performance/labels.js +2 -2
- package/dist/settings/sections/providers/ServerSignIn.d.ts +6 -1
- package/dist/settings/sections/providers/ServerSignIn.js +66 -61
- package/dist/settings/sections/skills/SkillList.d.ts +45 -0
- package/dist/settings/sections/skills/SkillList.js +58 -40
- package/dist/settings/server-app.d.ts +2 -0
- package/dist/settings/server-app.js +16 -4
- package/dist/styles.css +170 -34
- package/dist/theme/runtime-icons.js +7 -3
- package/dist/workspace/PanelContentView.js +1 -1
- package/package.json +26 -2
- package/src/styles/app.css +6 -3
- package/src/styles/palette.css +15 -19
- package/src/styles/primitives.css +3 -1
- package/src/styles/transcript.css +61 -0
- package/dist/dist/index-ttmMvjgM.d.ts +0 -1
- package/dist/dist/sandbox-CSUihARm.d.ts +0 -2
- package/dist/machines/PersonalLayerPanel.d.ts +0 -32
- package/dist/machines/PersonalLayerPanel.js +0 -360
- package/dist/machines/headless/layer.d.ts +0 -64
- package/dist/machines/headless/layer.js +0 -56
- /package/dist/dist/{execution-failure-SREfl-EZ.d.ts → execution-failure-_L2r_Qd-.d.ts} +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { constant, useReadable } from "../chat/headless/store.js";
|
|
2
|
+
import { buttonClass } from "../components/button.js";
|
|
3
|
+
import { CopyButton } from "../components/CopyButton.js";
|
|
4
|
+
import { FormSection } from "../components/Form.js";
|
|
5
|
+
import { Skeleton } from "../components/Skeleton.js";
|
|
6
|
+
import { useChannelsHost } from "./context.js";
|
|
7
|
+
import { useLinkRouter } from "../extensions/links.js";
|
|
8
|
+
import { ChannelsFailure, CheckRow, useChannelsAction } from "./channels-parts.js";
|
|
9
|
+
import { useChannelsLabels } from "./ChannelsProvider.js";
|
|
10
|
+
import { readinessCounts, sortReadiness } from "./headless/access.js";
|
|
11
|
+
import { useEffect, useId, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
// src/channels/ReadinessChecklist.tsx
|
|
14
|
+
/** The screens that are the project's own: its settings open them. */
|
|
15
|
+
const PROJECT_TARGETS = /* @__PURE__ */ new Set([
|
|
16
|
+
"projectSettings",
|
|
17
|
+
"channels",
|
|
18
|
+
"budgets",
|
|
19
|
+
"tools"
|
|
20
|
+
]);
|
|
21
|
+
const NO_ITEMS = constant(null);
|
|
22
|
+
const NO_ERROR = constant(null);
|
|
23
|
+
/** The severities, most serious first: the card's counts go in this order. */
|
|
24
|
+
const SEVERITIES = [
|
|
25
|
+
"blocker",
|
|
26
|
+
"warning",
|
|
27
|
+
"info"
|
|
28
|
+
];
|
|
29
|
+
const GLYPH = {
|
|
30
|
+
blocker: "i-ph-x-circle text-zg-danger",
|
|
31
|
+
warning: "i-ph-warning text-zg-warn",
|
|
32
|
+
info: "i-ph-info text-zg-info"
|
|
33
|
+
};
|
|
34
|
+
/** A project's items, read on first show. */
|
|
35
|
+
function useReadiness(projectId) {
|
|
36
|
+
const readiness = useChannelsHost().readiness;
|
|
37
|
+
useEffect(() => readiness?.ensure(projectId), [readiness, projectId]);
|
|
38
|
+
return {
|
|
39
|
+
readiness,
|
|
40
|
+
items: useReadable(readiness?.items(projectId) ?? NO_ITEMS),
|
|
41
|
+
error: useReadable(readiness?.error(projectId) ?? NO_ERROR)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A readiness fix as its button. Renders nothing when this app can't run it.
|
|
46
|
+
*
|
|
47
|
+
* @param props - The {@link ReadinessFixButtonProps}.
|
|
48
|
+
*/
|
|
49
|
+
function ReadinessFixButton({ projectId, fix, onOpenProject, runMethod }) {
|
|
50
|
+
const host = useChannelsHost();
|
|
51
|
+
const labels = useChannelsLabels();
|
|
52
|
+
const links = useLinkRouter();
|
|
53
|
+
const action = useChannelsAction();
|
|
54
|
+
const button = buttonClass({
|
|
55
|
+
variant: "secondary",
|
|
56
|
+
size: "sm"
|
|
57
|
+
});
|
|
58
|
+
if (fix.kind === "copy") return /* @__PURE__ */ jsxs("span", {
|
|
59
|
+
className: "inline-flex items-center gap-1 min-w-0",
|
|
60
|
+
children: [/* @__PURE__ */ jsx("code", {
|
|
61
|
+
className: "zg-meta break-all",
|
|
62
|
+
translate: "no",
|
|
63
|
+
children: fix.text
|
|
64
|
+
}), /* @__PURE__ */ jsx(CopyButton, {
|
|
65
|
+
text: fix.text,
|
|
66
|
+
label: fix.label
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
if (fix.kind === "link") return /* @__PURE__ */ jsx("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
className: button,
|
|
72
|
+
onClick: () => void links.open(fix.url, { source: "other" }),
|
|
73
|
+
children: fix.label
|
|
74
|
+
});
|
|
75
|
+
if (fix.kind === "open") {
|
|
76
|
+
const open = PROJECT_TARGETS.has(fix.target) ? onOpenProject : host.openTarget && (() => host.openTarget(fix.target, projectId));
|
|
77
|
+
return open ? /* @__PURE__ */ jsx("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
className: button,
|
|
80
|
+
onClick: open,
|
|
81
|
+
children: fix.label
|
|
82
|
+
}) : null;
|
|
83
|
+
}
|
|
84
|
+
const readinessFix = host.readiness?.runFix;
|
|
85
|
+
const runFix = runMethod ?? (readinessFix && projectId !== void 0 ? (method) => readinessFix(projectId, method) : void 0);
|
|
86
|
+
if (!runFix) return null;
|
|
87
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
88
|
+
className: "inline-flex flex-col items-start gap-1 min-w-0",
|
|
89
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
className: button,
|
|
92
|
+
disabled: action.busy,
|
|
93
|
+
onClick: () => void action.run(() => runFix(fix)),
|
|
94
|
+
children: fix.label
|
|
95
|
+
}), action.error && /* @__PURE__ */ jsx(ChannelsFailure, {
|
|
96
|
+
compact: true,
|
|
97
|
+
error: action.error,
|
|
98
|
+
message: labels.channelsFixFailed
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* One item: its glyph, title and detail, and its fix.
|
|
104
|
+
*
|
|
105
|
+
* @param props - The item, its project and how to open the project's settings.
|
|
106
|
+
* @param props.item - The item.
|
|
107
|
+
* @param props.projectId - Its project.
|
|
108
|
+
* @param props.onOpenProject - Opens the project's settings.
|
|
109
|
+
* @param props.trailing - What goes after the fix (an acknowledge box).
|
|
110
|
+
*/
|
|
111
|
+
function ReadinessRow({ item, projectId, onOpenProject, trailing }) {
|
|
112
|
+
const labels = useChannelsLabels();
|
|
113
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
114
|
+
className: "flex items-start gap-3 px-3 py-2",
|
|
115
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
116
|
+
role: "img",
|
|
117
|
+
"aria-label": labels.channelsSeverity(item.severity),
|
|
118
|
+
className: `${GLYPH[item.severity]} shrink-0 mt-0.5`
|
|
119
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
120
|
+
className: "min-w-0 flex-1",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx("div", {
|
|
123
|
+
className: "text-zg-ui text-[var(--zg-text)] break-words",
|
|
124
|
+
children: item.title
|
|
125
|
+
}),
|
|
126
|
+
item.detail && /* @__PURE__ */ jsx("div", {
|
|
127
|
+
className: "text-zg-label text-[var(--zg-text-muted)] break-words",
|
|
128
|
+
children: item.detail
|
|
129
|
+
}),
|
|
130
|
+
(item.fix || trailing) && /* @__PURE__ */ jsxs("div", {
|
|
131
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1 pt-1.5 empty:hidden",
|
|
132
|
+
children: [item.fix && /* @__PURE__ */ jsx(ReadinessFixButton, {
|
|
133
|
+
projectId,
|
|
134
|
+
fix: item.fix,
|
|
135
|
+
...onOpenProject ? { onOpenProject } : {}
|
|
136
|
+
}), trailing]
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
})]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A project's checklist, most serious first. Renders nothing without `ChannelsHost.readiness`.
|
|
144
|
+
*
|
|
145
|
+
* @param props - The {@link ReadinessListProps}.
|
|
146
|
+
*/
|
|
147
|
+
function ReadinessList({ projectId, onOpenProject, className = "", style }) {
|
|
148
|
+
const labels = useChannelsLabels();
|
|
149
|
+
const { readiness, items, error } = useReadiness(projectId);
|
|
150
|
+
if (!readiness) return null;
|
|
151
|
+
if (error && !items) return /* @__PURE__ */ jsx(ChannelsFailure, {
|
|
152
|
+
error,
|
|
153
|
+
message: labels.channelsReadinessLoadFailed,
|
|
154
|
+
onRetry: () => void readiness.refresh(projectId).catch(() => void 0),
|
|
155
|
+
className
|
|
156
|
+
});
|
|
157
|
+
if (!items) return /* @__PURE__ */ jsx("div", {
|
|
158
|
+
role: "status",
|
|
159
|
+
"aria-busy": "true",
|
|
160
|
+
"aria-label": labels.channelsReadiness,
|
|
161
|
+
className: `px-3 py-2 ${className}`,
|
|
162
|
+
style,
|
|
163
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
164
|
+
width: 180,
|
|
165
|
+
height: 12
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
if (items.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
169
|
+
className: `m-0 px-3 py-2 text-zg-ui text-[var(--zg-text-muted)] ${className}`,
|
|
170
|
+
style,
|
|
171
|
+
children: labels.channelsReadinessReady
|
|
172
|
+
});
|
|
173
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
174
|
+
"aria-label": labels.channelsReadiness,
|
|
175
|
+
className: `m-0 p-0 list-none flex flex-col ${className}`,
|
|
176
|
+
style,
|
|
177
|
+
children: sortReadiness(items).map((item) => /* @__PURE__ */ jsx(ReadinessRow, {
|
|
178
|
+
item,
|
|
179
|
+
projectId,
|
|
180
|
+
...onOpenProject ? { onOpenProject } : {}
|
|
181
|
+
}, item.id))
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The project home's readiness card: one line of counts that expands to the list. Renders nothing without
|
|
186
|
+
* `ChannelsHost.readiness`, before the first read, and while nothing is left to do.
|
|
187
|
+
*
|
|
188
|
+
* @param props - The {@link ProjectReadinessCardProps}.
|
|
189
|
+
*/
|
|
190
|
+
function ProjectReadinessCard({ projectId, onOpenProject, className = "", style }) {
|
|
191
|
+
const labels = useChannelsLabels();
|
|
192
|
+
const { readiness, items } = useReadiness(projectId);
|
|
193
|
+
const [open, setOpen] = useState(false);
|
|
194
|
+
const listId = useId();
|
|
195
|
+
if (!readiness || !items || items.length === 0) return null;
|
|
196
|
+
const counts = readinessCounts(items);
|
|
197
|
+
const worst = counts.blocker ? "blocker" : counts.warning ? "warning" : "info";
|
|
198
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
199
|
+
"aria-label": labels.channelsReadiness,
|
|
200
|
+
className: `zg-tray rounded-zg-lg p-1 ${className}`,
|
|
201
|
+
style,
|
|
202
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
203
|
+
type: "button",
|
|
204
|
+
"aria-expanded": open,
|
|
205
|
+
"aria-controls": listId,
|
|
206
|
+
onClick: () => setOpen((was) => !was),
|
|
207
|
+
className: "zg-press-subtle flex items-center gap-3 w-full px-3 py-2 rounded-zg-md bg-transparent border-0 cursor-pointer text-left text-[var(--zg-text)] hover:bg-[var(--zg-row-hover)] transition-colors",
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ jsx("span", {
|
|
210
|
+
"aria-hidden": true,
|
|
211
|
+
className: `${GLYPH[worst]} shrink-0`
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx("span", {
|
|
214
|
+
className: "font-medium text-zg-ui",
|
|
215
|
+
children: labels.channelsReadiness
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ jsx("span", {
|
|
218
|
+
className: "flex-1 min-w-0 flex flex-wrap gap-x-3 text-zg-label text-[var(--zg-text-muted)]",
|
|
219
|
+
children: SEVERITIES.filter((severity) => counts[severity] > 0).map((severity) => /* @__PURE__ */ jsx("span", {
|
|
220
|
+
className: "whitespace-nowrap",
|
|
221
|
+
children: labels.channelsReadinessCount(severity, counts[severity])
|
|
222
|
+
}, severity))
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx("span", {
|
|
225
|
+
"aria-hidden": true,
|
|
226
|
+
className: `i-ph-caret-down shrink-0 text-zg-label text-[var(--zg-text-muted)] transition-transform ${open ? "rotate-180" : ""}`
|
|
227
|
+
})
|
|
228
|
+
]
|
|
229
|
+
}), open && /* @__PURE__ */ jsx("div", {
|
|
230
|
+
id: listId,
|
|
231
|
+
children: /* @__PURE__ */ jsx(ReadinessList, {
|
|
232
|
+
projectId,
|
|
233
|
+
...onOpenProject ? { onOpenProject } : {}
|
|
234
|
+
})
|
|
235
|
+
})]
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The blockers before a binding turns on: each with its fix and a "go on without it" box.
|
|
240
|
+
*
|
|
241
|
+
* @param props - The {@link ReadinessGateProps}.
|
|
242
|
+
*/
|
|
243
|
+
function ReadinessGate({ projectId, blockers, acknowledged, onAcknowledge, onOpenProject, titled = false }) {
|
|
244
|
+
const labels = useChannelsLabels();
|
|
245
|
+
return /* @__PURE__ */ jsxs(FormSection, {
|
|
246
|
+
...titled ? { title: labels.channelsGateTitle } : {},
|
|
247
|
+
children: [
|
|
248
|
+
blockers.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
249
|
+
className: "m-0 px-3 py-2 text-zg-ui text-[var(--zg-text-muted)]",
|
|
250
|
+
children: labels.channelsReadinessReady
|
|
251
|
+
}),
|
|
252
|
+
blockers.length > 0 && /* @__PURE__ */ jsx("p", {
|
|
253
|
+
className: "m-0 px-3 pb-1 text-zg-label text-[var(--zg-text-muted)]",
|
|
254
|
+
children: labels.channelsGateHint
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ jsx("ul", {
|
|
257
|
+
"aria-label": labels.channelsGateTitle,
|
|
258
|
+
className: "m-0 p-0 list-none flex flex-col",
|
|
259
|
+
children: blockers.map((item) => /* @__PURE__ */ jsx(ReadinessRow, {
|
|
260
|
+
item,
|
|
261
|
+
projectId,
|
|
262
|
+
...onOpenProject ? { onOpenProject } : {},
|
|
263
|
+
trailing: /* @__PURE__ */ jsx(CheckRow, {
|
|
264
|
+
checked: acknowledged.has(item.id),
|
|
265
|
+
label: labels.channelsGateAcknowledge,
|
|
266
|
+
onChange: (on) => onAcknowledge(item.id, on)
|
|
267
|
+
})
|
|
268
|
+
}, item.id))
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
export { ProjectReadinessCard, ReadinessFixButton, ReadinessGate, ReadinessList, ReadinessRow };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The badge of a "Test as" session (docs/CHANNELS.md § Test as): a Test chip, who it runs as, and how its replies
|
|
3
|
+
* would post in Slack (the binding's name and icon, a Slack-look message in its own well, no title). Shown above a session's composer by the
|
|
4
|
+
* app; renders nothing for any other session. It knows the test sessions this window opened
|
|
5
|
+
* (`ChannelsHost.testSessions`).
|
|
6
|
+
*/
|
|
7
|
+
import { CSSProperties } from "react";
|
|
8
|
+
/** Props for {@link TestSessionBanner}. */
|
|
9
|
+
export interface TestSessionBannerProps {
|
|
10
|
+
/** The session shown. */
|
|
11
|
+
sessionId: string;
|
|
12
|
+
/** The session's latest reply, for the preview. Absent: a sample line. */
|
|
13
|
+
latestReply?: string;
|
|
14
|
+
/** Extra classes on the root. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Inline styles on the root. */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The Test badge and the Slack-look preview of a test session.
|
|
21
|
+
*
|
|
22
|
+
* @param props - The {@link TestSessionBannerProps}.
|
|
23
|
+
*/
|
|
24
|
+
export declare function TestSessionBanner({ sessionId, latestReply, className, style }: TestSessionBannerProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useReadable } from "../chat/headless/store.js";
|
|
2
|
+
import { MetaChip } from "../components/Form.js";
|
|
3
|
+
import { useChannelsHost } from "./context.js";
|
|
4
|
+
import { SlackMessagePreview } from "./channels-parts.js";
|
|
5
|
+
import { useChannelsLabels } from "./ChannelsProvider.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/channels/TestSessionBanner.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The Test badge and the Slack-look preview of a test session.
|
|
10
|
+
*
|
|
11
|
+
* @param props - The {@link TestSessionBannerProps}.
|
|
12
|
+
*/
|
|
13
|
+
function TestSessionBanner({ sessionId, latestReply, className = "", style }) {
|
|
14
|
+
const labels = useChannelsLabels();
|
|
15
|
+
const test = useReadable(useChannelsHost().testSessions)[sessionId];
|
|
16
|
+
if (!test) return null;
|
|
17
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
18
|
+
"aria-label": labels.channelsTestBadge,
|
|
19
|
+
className: `zg-tray rounded-zg-lg px-3 py-2.5 flex flex-col gap-2.5 ${className}`,
|
|
20
|
+
style,
|
|
21
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: "flex items-start gap-2",
|
|
23
|
+
children: [/* @__PURE__ */ jsx(MetaChip, {
|
|
24
|
+
tone: "warn",
|
|
25
|
+
className: "shrink-0",
|
|
26
|
+
children: labels.channelsTestBadge
|
|
27
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "min-w-0 flex-1",
|
|
29
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: "text-zg-ui text-[var(--zg-text)]",
|
|
31
|
+
children: labels.channelsTestAs(test.as)
|
|
32
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
33
|
+
className: "m-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
34
|
+
children: labels.channelsTestHint
|
|
35
|
+
})]
|
|
36
|
+
})]
|
|
37
|
+
}), /* @__PURE__ */ jsx(SlackMessagePreview, {
|
|
38
|
+
name: test.identity.name,
|
|
39
|
+
...test.identity.iconUrl ? { iconUrl: test.identity.iconUrl } : {},
|
|
40
|
+
text: latestReply ?? labels.channelsPreviewText
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { TestSessionBanner };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pieces the channels components share: one action at a time with its failure, a failure worded through labels, a
|
|
3
|
+
* connection's health dot, the provider's mark, a Slack-look message that shows how a project's posts look, the
|
|
4
|
+
* opener of their dialogs.
|
|
5
|
+
*/
|
|
6
|
+
import { ConnectionHealth } from "./headless/access.js";
|
|
7
|
+
import { ChannelConnectionProvider, ChannelsError } from "./headless/host.js";
|
|
8
|
+
import { CSSProperties, ReactNode } from "react";
|
|
9
|
+
/** A field's text, on the rows' edge. */
|
|
10
|
+
export declare const HINT = "m-0 px-3 pb-1 text-zg-label text-[var(--zg-text-muted)]";
|
|
11
|
+
/** A select, as the kit's pickers draw one. */
|
|
12
|
+
export declare const PICKER = "zg-well h-8 px-2.5 text-zg-ui cursor-pointer disabled:cursor-default disabled:opacity-zg-disabled";
|
|
13
|
+
/**
|
|
14
|
+
* Opens a channels dialog on the modal layer, above the surface it was asked from (Settings, Project settings), as
|
|
15
|
+
* Share does: closing it shows that surface again. `titleId` names the dialog (its `ModalShell` title takes it).
|
|
16
|
+
* Absent without a modal provider.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useChannelsDialog(): ((titleId: string, render: (close: () => void) => ReactNode) => void) | undefined;
|
|
19
|
+
/** What {@link useChannelsAction} returns. */
|
|
20
|
+
export interface ChannelsAction {
|
|
21
|
+
/** Runs one action; a second one waits for none (the button is off while one runs). */
|
|
22
|
+
run: (work: () => Promise<unknown>) => Promise<boolean>;
|
|
23
|
+
/** An action runs. */
|
|
24
|
+
busy: boolean;
|
|
25
|
+
/** The last failure, or `null`. */
|
|
26
|
+
error: ChannelsError | null;
|
|
27
|
+
/** Forgets the failure. */
|
|
28
|
+
clear: () => void;
|
|
29
|
+
}
|
|
30
|
+
/** One action at a time with its failure, safe after unmount. */
|
|
31
|
+
export declare function useChannelsAction(): ChannelsAction;
|
|
32
|
+
/** Props for {@link ChannelsFailure}. */
|
|
33
|
+
export interface ChannelsFailureProps {
|
|
34
|
+
/** What failed. */
|
|
35
|
+
error: ChannelsError;
|
|
36
|
+
/** The message; default: the failure's kind worded. */
|
|
37
|
+
message?: string;
|
|
38
|
+
/** Retry, when it can be tried again. */
|
|
39
|
+
onRetry?: () => void;
|
|
40
|
+
/** One tight line. */
|
|
41
|
+
compact?: boolean;
|
|
42
|
+
/** Extra classes on the root. */
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A failure as a notice: the message worded through labels, the host's words as its detail, and how to turn the
|
|
47
|
+
* channels on when they don't run here.
|
|
48
|
+
*
|
|
49
|
+
* @param props - The {@link ChannelsFailureProps}.
|
|
50
|
+
*/
|
|
51
|
+
export declare function ChannelsFailure({ error, message, onRetry, compact, className }: ChannelsFailureProps): import("react").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* A box with its words: a checkbox button.
|
|
54
|
+
*
|
|
55
|
+
* @param props - Whether it is ticked, its words and what a press does.
|
|
56
|
+
* @param props.checked - Ticked.
|
|
57
|
+
* @param props.label - Its words.
|
|
58
|
+
* @param props.onChange - Called with the new state.
|
|
59
|
+
* @param props.disabled - Grayed out.
|
|
60
|
+
*/
|
|
61
|
+
export declare function CheckRow({ checked, label, onChange, disabled }: {
|
|
62
|
+
checked: boolean;
|
|
63
|
+
label: ReactNode;
|
|
64
|
+
onChange: (on: boolean) => void;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* A connection's health: a dot in its tone and its word.
|
|
69
|
+
*
|
|
70
|
+
* @param props - The health.
|
|
71
|
+
* @param props.health - How the connection is doing.
|
|
72
|
+
*/
|
|
73
|
+
export declare function HealthBadge({ health }: {
|
|
74
|
+
health: ConnectionHealth;
|
|
75
|
+
}): import("react").JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* A provider's mark: GitHub's logo, Slack's glyph.
|
|
78
|
+
*
|
|
79
|
+
* @param props - The provider.
|
|
80
|
+
* @param props.provider - Slack or GitHub.
|
|
81
|
+
*/
|
|
82
|
+
export declare function ProviderMark({ provider }: {
|
|
83
|
+
provider: ChannelConnectionProvider;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
/** Props for {@link SlackMessagePreview}. */
|
|
86
|
+
export interface SlackMessagePreviewProps {
|
|
87
|
+
/** The name the post shows. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** An https picture; absent: the name's first letter. */
|
|
90
|
+
iconUrl?: string;
|
|
91
|
+
/** The message. */
|
|
92
|
+
text: ReactNode;
|
|
93
|
+
/** Extra classes on the root. */
|
|
94
|
+
className?: string;
|
|
95
|
+
/** Inline styles on the root. */
|
|
96
|
+
style?: CSSProperties;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A message as Slack draws a bot's post: the picture, the name in bold with the app tag, the time, the text. It sits
|
|
100
|
+
* in a well of its own, so it reads as a sample and needs no title.
|
|
101
|
+
*
|
|
102
|
+
* @param props - The {@link SlackMessagePreviewProps}.
|
|
103
|
+
*/
|
|
104
|
+
export declare function SlackMessagePreview({ name, iconUrl, text, className, style }: SlackMessagePreviewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { useOptionalModal } from "../app/ModalProvider.js";
|
|
2
|
+
import { BrandMark } from "../components/BrandMark.js";
|
|
3
|
+
import { buttonClass } from "../components/button.js";
|
|
4
|
+
import { Checkbox } from "../components/Form.js";
|
|
5
|
+
import { Notice } from "../components/Notice.js";
|
|
6
|
+
import { useChannelsLabels } from "./ChannelsProvider.js";
|
|
7
|
+
import { healthTone } from "./headless/access.js";
|
|
8
|
+
import { channelsFailure } from "./headless/state.js";
|
|
9
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
// src/channels/channels-parts.tsx
|
|
12
|
+
/** A field's text, on the rows' edge. */
|
|
13
|
+
const HINT = "m-0 px-3 pb-1 text-zg-label text-[var(--zg-text-muted)]";
|
|
14
|
+
/** A select, as the kit's pickers draw one. */
|
|
15
|
+
const PICKER = "zg-well h-8 px-2.5 text-zg-ui cursor-pointer disabled:cursor-default disabled:opacity-zg-disabled";
|
|
16
|
+
/**
|
|
17
|
+
* Opens a channels dialog on the modal layer, above the surface it was asked from (Settings, Project settings), as
|
|
18
|
+
* Share does: closing it shows that surface again. `titleId` names the dialog (its `ModalShell` title takes it).
|
|
19
|
+
* Absent without a modal provider.
|
|
20
|
+
*/
|
|
21
|
+
function useChannelsDialog() {
|
|
22
|
+
const modal = useOptionalModal();
|
|
23
|
+
const openLayer = modal?.openLayer;
|
|
24
|
+
const closeLayer = modal?.closeLayer;
|
|
25
|
+
const open = useCallback((titleId, render) => {
|
|
26
|
+
openLayer?.(render(() => closeLayer?.()), {
|
|
27
|
+
onDismiss: () => {},
|
|
28
|
+
labelledBy: titleId
|
|
29
|
+
});
|
|
30
|
+
}, [openLayer, closeLayer]);
|
|
31
|
+
return openLayer && closeLayer ? open : void 0;
|
|
32
|
+
}
|
|
33
|
+
/** One action at a time with its failure, safe after unmount. */
|
|
34
|
+
function useChannelsAction() {
|
|
35
|
+
const [busy, setBusy] = useState(false);
|
|
36
|
+
const [error, setError] = useState(null);
|
|
37
|
+
const mounted = useRef(true);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
mounted.current = true;
|
|
40
|
+
return () => {
|
|
41
|
+
mounted.current = false;
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return {
|
|
45
|
+
run: useCallback(async (work) => {
|
|
46
|
+
setBusy(true);
|
|
47
|
+
setError(null);
|
|
48
|
+
try {
|
|
49
|
+
await work();
|
|
50
|
+
return true;
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (mounted.current) setError(channelsFailure(err));
|
|
53
|
+
return false;
|
|
54
|
+
} finally {
|
|
55
|
+
if (mounted.current) setBusy(false);
|
|
56
|
+
}
|
|
57
|
+
}, []),
|
|
58
|
+
busy,
|
|
59
|
+
error,
|
|
60
|
+
clear: useCallback(() => setError(null), [])
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A failure as a notice: the message worded through labels, the host's words as its detail, and how to turn the
|
|
65
|
+
* channels on when they don't run here.
|
|
66
|
+
*
|
|
67
|
+
* @param props - The {@link ChannelsFailureProps}.
|
|
68
|
+
*/
|
|
69
|
+
function ChannelsFailure({ error, message, onRetry, compact, className }) {
|
|
70
|
+
const labels = useChannelsLabels();
|
|
71
|
+
const detail = error.kind === "unavailable" ? `${labels.channelsUnavailableHint}\n\n${error.detail}` : error.detail;
|
|
72
|
+
return /* @__PURE__ */ jsx(Notice, {
|
|
73
|
+
tone: error.kind === "refused" ? "warning" : "error",
|
|
74
|
+
detail,
|
|
75
|
+
...compact ? { compact } : {},
|
|
76
|
+
...className ? { className } : {},
|
|
77
|
+
...onRetry ? { action: /* @__PURE__ */ jsx("button", {
|
|
78
|
+
type: "button",
|
|
79
|
+
className: buttonClass({
|
|
80
|
+
variant: "secondary",
|
|
81
|
+
size: "sm"
|
|
82
|
+
}),
|
|
83
|
+
onClick: onRetry,
|
|
84
|
+
children: labels.channelsRetry
|
|
85
|
+
}) } : {},
|
|
86
|
+
children: message ?? labels.channelsFailed(error)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const CHECK_ROW = "flex items-center gap-2 min-h-7 min-w-0 bg-transparent border-0 p-0 text-left text-zg-label text-[var(--zg-text)] cursor-pointer rounded-zg-sm zg-focus-ring disabled:cursor-default disabled:opacity-zg-disabled";
|
|
90
|
+
/**
|
|
91
|
+
* A box with its words: a checkbox button.
|
|
92
|
+
*
|
|
93
|
+
* @param props - Whether it is ticked, its words and what a press does.
|
|
94
|
+
* @param props.checked - Ticked.
|
|
95
|
+
* @param props.label - Its words.
|
|
96
|
+
* @param props.onChange - Called with the new state.
|
|
97
|
+
* @param props.disabled - Grayed out.
|
|
98
|
+
*/
|
|
99
|
+
function CheckRow({ checked, label, onChange, disabled = false }) {
|
|
100
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
101
|
+
type: "button",
|
|
102
|
+
role: "checkbox",
|
|
103
|
+
"aria-checked": checked,
|
|
104
|
+
disabled,
|
|
105
|
+
onClick: () => onChange(!checked),
|
|
106
|
+
className: CHECK_ROW,
|
|
107
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
108
|
+
checked,
|
|
109
|
+
className: "!mt-0"
|
|
110
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: "min-w-0 truncate",
|
|
112
|
+
children: label
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const DOT = {
|
|
117
|
+
ok: "bg-zg-success",
|
|
118
|
+
busy: "bg-zg-info",
|
|
119
|
+
warn: "bg-zg-warn",
|
|
120
|
+
error: "bg-zg-danger",
|
|
121
|
+
off: "bg-[var(--zg-text-muted)] opacity-50"
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* A connection's health: a dot in its tone and its word.
|
|
125
|
+
*
|
|
126
|
+
* @param props - The health.
|
|
127
|
+
* @param props.health - How the connection is doing.
|
|
128
|
+
*/
|
|
129
|
+
function HealthBadge({ health }) {
|
|
130
|
+
const labels = useChannelsLabels();
|
|
131
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
132
|
+
className: "inline-flex items-center gap-1.5 shrink-0 text-zg-label text-[var(--zg-text-muted)]",
|
|
133
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
134
|
+
"aria-hidden": true,
|
|
135
|
+
className: `inline-block w-2 h-2 rounded-full ${DOT[healthTone(health)]}`
|
|
136
|
+
}), labels.channelsHealth(health)]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A provider's mark: GitHub's logo, Slack's glyph.
|
|
141
|
+
*
|
|
142
|
+
* @param props - The provider.
|
|
143
|
+
* @param props.provider - Slack or GitHub.
|
|
144
|
+
*/
|
|
145
|
+
function ProviderMark({ provider }) {
|
|
146
|
+
const labels = useChannelsLabels();
|
|
147
|
+
return provider === "github" ? /* @__PURE__ */ jsx(BrandMark, {
|
|
148
|
+
brand: "github",
|
|
149
|
+
label: labels.channelsProvider(provider),
|
|
150
|
+
size: "sm"
|
|
151
|
+
}) : /* @__PURE__ */ jsx(BrandMark, {
|
|
152
|
+
label: labels.channelsProvider(provider),
|
|
153
|
+
icon: "i-ph-slack-logo",
|
|
154
|
+
size: "sm"
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A message as Slack draws a bot's post: the picture, the name in bold with the app tag, the time, the text. It sits
|
|
159
|
+
* in a well of its own, so it reads as a sample and needs no title.
|
|
160
|
+
*
|
|
161
|
+
* @param props - The {@link SlackMessagePreviewProps}.
|
|
162
|
+
*/
|
|
163
|
+
function SlackMessagePreview({ name, iconUrl, text, className = "", style }) {
|
|
164
|
+
const labels = useChannelsLabels();
|
|
165
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
166
|
+
role: "group",
|
|
167
|
+
"aria-label": labels.channelsPreview,
|
|
168
|
+
className: `zg-well flex items-start gap-2.5 px-3 py-2.5 ${className}`,
|
|
169
|
+
style,
|
|
170
|
+
children: [iconUrl ? /* @__PURE__ */ jsx("img", {
|
|
171
|
+
src: iconUrl,
|
|
172
|
+
alt: "",
|
|
173
|
+
className: "w-9 h-9 shrink-0 rounded-zg-md object-cover"
|
|
174
|
+
}) : /* @__PURE__ */ jsx(BrandMark, {
|
|
175
|
+
label: name,
|
|
176
|
+
size: "md",
|
|
177
|
+
className: "shrink-0"
|
|
178
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
179
|
+
className: "min-w-0 flex-1",
|
|
180
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
181
|
+
className: "flex items-baseline gap-1.5 min-w-0",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ jsx("span", {
|
|
184
|
+
className: "font-semibold text-zg-ui truncate",
|
|
185
|
+
children: name
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ jsx("span", {
|
|
188
|
+
className: "shrink-0 px-1 rounded-zg-sm bg-[var(--zg-raised)] text-zg-badge leading-zg-badge text-[var(--zg-text-muted)]",
|
|
189
|
+
children: labels.channelsPreviewApp
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ jsx("span", {
|
|
192
|
+
className: "zg-meta shrink-0",
|
|
193
|
+
children: labels.channelsPreviewNow
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
197
|
+
className: "text-zg-ui text-[var(--zg-text)] break-words whitespace-pre-wrap",
|
|
198
|
+
children: text
|
|
199
|
+
})]
|
|
200
|
+
})]
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export { ChannelsFailure, CheckRow, HINT, HealthBadge, PICKER, ProviderMark, SlackMessagePreview, useChannelsAction, useChannelsDialog };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The channels host's context, on its own: a surface that only asks whether channels are on (Settings › Channels'
|
|
3
|
+
* page in `useServerAppSettingsSections`) does not carry the channels strings (`ChannelsProvider` does).
|
|
4
|
+
*/
|
|
5
|
+
import { ChannelsHost } from "./headless/host.js";
|
|
6
|
+
/** The nearest channels host. Internal to the kit: `ChannelsProvider` sets it. */
|
|
7
|
+
export declare const ChannelsContext: import("react").Context<ChannelsHost>;
|
|
8
|
+
/** The nearest {@link ChannelsHost}; an empty one outside a provider. */
|
|
9
|
+
export declare function useChannelsHost(): ChannelsHost;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { constant } from "../chat/headless/store.js";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
// src/channels/context.ts
|
|
4
|
+
const EMPTY_HOST = {
|
|
5
|
+
testSessions: constant({}),
|
|
6
|
+
defaultProjects: constant({})
|
|
7
|
+
};
|
|
8
|
+
/** The nearest channels host. Internal to the kit: `ChannelsProvider` sets it. */
|
|
9
|
+
const ChannelsContext = createContext(EMPTY_HOST);
|
|
10
|
+
/** The nearest {@link ChannelsHost}; an empty one outside a provider. */
|
|
11
|
+
function useChannelsHost() {
|
|
12
|
+
return useContext(ChannelsContext);
|
|
13
|
+
}
|
|
14
|
+
export { ChannelsContext, useChannelsHost };
|