zidane-ui 9.5.2 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/server-git-host.js +67 -0
- package/dist/adapters/server-host.js +9 -0
- package/dist/adapters/server-oauth-flow.d.ts +2 -2
- package/dist/adapters/server-oauth-flow.js +1 -1
- package/dist/adapters/server-projects.d.ts +53 -2
- package/dist/adapters/server-projects.js +4 -3
- package/dist/adapters/server-session-host.js +112 -4
- package/dist/channels/BindingEditorDialog.js +1 -1
- package/dist/channels/ChannelDefaultsSection.js +1 -1
- package/dist/channels/ChannelsSettingsSection.js +1 -1
- package/dist/channels/ConnectionSetupDialog.js +1 -1
- package/dist/channels/HeldRepliesList.js +1 -1
- package/dist/channels/ProjectChannelsSection.js +1 -1
- package/dist/chat/HostTranscript.js +1 -0
- package/dist/chat/SessionGroupHeader.js +2 -2
- package/dist/chat/composer/ComposerBadges.d.ts +27 -1
- package/dist/chat/composer/ComposerBadges.js +41 -5
- package/dist/chat/composer/ConversationBadges.d.ts +6 -0
- package/dist/chat/composer/ConversationBadges.js +70 -3
- package/dist/chat/composer/DraftPickers.js +4 -0
- package/dist/chat/composer/ServerScopeToggle.d.ts +16 -1
- package/dist/chat/composer/ServerScopeToggle.js +90 -47
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +18 -2
- package/dist/chat/composer/use-draft-target.js +74 -7
- package/dist/chat/composer/use-new-session-defaults.d.ts +3 -1
- package/dist/chat/composer/use-new-session-defaults.js +19 -14
- package/dist/chat/composer/use-send-prompt.js +2 -2
- package/dist/chat/headless/composer/index.d.ts +2 -2
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +7 -0
- package/dist/chat/headless/composer/labels-chrome.js +7 -0
- package/dist/chat/headless/composer/labels-editor.d.ts +4 -0
- package/dist/chat/headless/composer/labels-editor.js +4 -0
- package/dist/chat/headless/composer/models.d.ts +2 -0
- package/dist/chat/headless/composer/new-session-defaults.d.ts +12 -1
- package/dist/chat/headless/composer/new-session-defaults.js +30 -1
- package/dist/chat/headless/draft-target.d.ts +27 -6
- package/dist/chat/headless/draft-target.js +36 -3
- package/dist/chat/headless/host.d.ts +7 -0
- package/dist/chat/headless/index.d.ts +4 -4
- package/dist/chat/headless/index.js +29 -29
- package/dist/chat/headless/labels.d.ts +4 -0
- package/dist/chat/headless/send-flow.d.ts +2 -0
- package/dist/chat/headless/send-flow.js +2 -1
- package/dist/chat/headless/session-list.d.ts +4 -0
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +9 -1
- package/dist/chat/headless/sidebar/labels.js +4 -0
- package/dist/chat/headless/sidebar/rows.d.ts +48 -7
- package/dist/chat/headless/sidebar/rows.js +121 -22
- package/dist/chat/headless/sidebar/types.d.ts +5 -0
- package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
- package/dist/chat/headless/transcript/fold-actions.js +29 -1
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +2 -2
- package/dist/chat/rich-composer/RichComposer.js +58 -11
- package/dist/chat/rich-composer/composer-controls.d.ts +5 -1
- package/dist/chat/rich-composer/composer-controls.js +4 -4
- package/dist/chat/rich-composer/composer-keys.js +2 -2
- package/dist/chat/rich-composer/draft-collab.d.ts +91 -0
- package/dist/chat/rich-composer/draft-collab.js +310 -0
- package/dist/chat/rich-composer/use-composer-editor.d.ts +2 -0
- package/dist/chat/rich-composer/use-draft-collab.d.ts +53 -0
- package/dist/chat/rich-composer/use-draft-collab.js +92 -0
- package/dist/chat/rich-composer/use-draft-mirror.d.ts +11 -0
- package/dist/chat/rich-composer/use-draft-mirror.js +38 -9
- package/dist/chat/sidebar/InboxList.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +6 -2
- package/dist/chat/sidebar/ProjectIcon.js +7 -3
- package/dist/chat/sidebar/SessionSidebar.d.ts +30 -1
- package/dist/chat/sidebar/SessionSidebar.js +79 -7
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -4
- package/dist/chat/sidebar/SidebarGroupHeader.js +70 -28
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/transcript/actions.d.ts +6 -0
- package/dist/chat/transcript/fold.d.ts +2 -1
- package/dist/chat/transcript/fold.js +26 -1
- package/dist/chat/transcript/index.js +3 -3
- package/dist/chat/transcript/notices.d.ts +5 -2
- package/dist/chat/transcript/notices.js +23 -3
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/components/Avatar.d.ts +36 -0
- package/dist/components/Avatar.js +56 -0
- package/dist/components/AvatarStack.d.ts +58 -0
- package/dist/components/AvatarStack.js +187 -0
- package/dist/components/Tabs.d.ts +6 -1
- package/dist/components/Tabs.js +43 -39
- package/dist/core.css +19 -1
- package/dist/dist/{index-DPbpsCtl.d.ts → index-ChabiHpR.d.ts} +1 -1
- package/dist/dist/index.d.ts +1 -1
- package/dist/git/headless/environment.d.ts +15 -0
- package/dist/git/headless/environment.js +18 -1
- package/dist/git/headless/github.d.ts +11 -0
- package/dist/git/headless/github.js +15 -0
- package/dist/git/headless/host.d.ts +109 -0
- package/dist/git/headless/index.d.ts +5 -4
- package/dist/git/headless/index.js +4 -3
- package/dist/git/headless/labels.d.ts +16 -1
- package/dist/git/headless/labels.js +25 -1
- package/dist/git/testing/contract.d.ts +22 -4
- package/dist/git/testing/contract.js +173 -3
- package/dist/git/testing/index.d.ts +22 -1
- package/dist/git/testing/index.js +135 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/labels.d.ts +4 -0
- package/dist/labels.js +4 -0
- package/dist/onboarding/headless/labels.d.ts +4 -0
- package/dist/session/DraftPeopleStack.d.ts +24 -0
- package/dist/session/DraftPeopleStack.js +48 -0
- package/dist/session/NewProjectDialog.d.ts +28 -8
- package/dist/session/NewProjectDialog.js +225 -40
- package/dist/session/PersonCard.d.ts +29 -0
- package/dist/session/PersonCard.js +199 -0
- package/dist/session/ProjectArtifactsSection.d.ts +4 -1
- package/dist/session/ProjectArtifactsSection.js +149 -34
- package/dist/session/ProjectHome.d.ts +1 -1
- package/dist/session/ProjectHome.js +23 -4
- package/dist/session/ProjectName.d.ts +11 -6
- package/dist/session/ProjectName.js +27 -13
- package/dist/session/ProjectPeopleStack.d.ts +26 -0
- package/dist/session/ProjectPeopleStack.js +56 -0
- package/dist/session/ProjectPublishDialog.js +9 -3
- package/dist/session/ProjectSettingsDialog.d.ts +1 -1
- package/dist/session/ProjectSettingsDialog.js +171 -66
- package/dist/session/ProjectShareDialog.d.ts +1 -1
- package/dist/session/ProjectShareDialog.js +16 -6
- package/dist/session/ProjectToolsSection.js +88 -96
- package/dist/session/ProjectUsage.d.ts +4 -1
- package/dist/session/ProjectUsage.js +13 -4
- package/dist/session/SessionDetailsDialog.d.ts +5 -1
- package/dist/session/SessionDetailsDialog.js +67 -10
- package/dist/session/SessionPeopleStack.js +19 -37
- package/dist/session/SessionProjectPicker.d.ts +54 -0
- package/dist/session/SessionProjectPicker.js +175 -0
- package/dist/session/SessionProvider.d.ts +15 -1
- package/dist/session/SessionProvider.js +28 -6
- package/dist/session/UsageSection.d.ts +2 -4
- package/dist/session/UsageSection.js +57 -55
- package/dist/session/headless/draft-collab.d.ts +55 -0
- package/dist/session/headless/draft-collab.js +127 -0
- package/dist/session/headless/draft-room.d.ts +124 -0
- package/dist/session/headless/draft-room.js +340 -0
- package/dist/session/headless/drafts.d.ts +93 -0
- package/dist/session/headless/drafts.js +79 -0
- package/dist/session/headless/fixture-drafts.d.ts +54 -0
- package/dist/session/headless/fixture-drafts.js +286 -0
- package/dist/session/headless/fixture-host.d.ts +18 -2
- package/dist/session/headless/fixture-host.js +41 -7
- package/dist/session/headless/fixture-projects.d.ts +6 -4
- package/dist/session/headless/fixture-projects.js +25 -4
- package/dist/session/headless/host.d.ts +34 -6
- package/dist/session/headless/index.d.ts +6 -3
- package/dist/session/headless/index.js +6 -3
- package/dist/session/headless/labels.d.ts +47 -2
- package/dist/session/headless/labels.js +17 -1
- package/dist/session/headless/people.d.ts +27 -3
- package/dist/session/headless/people.js +38 -20
- package/dist/session/headless/project-artifact-labels.d.ts +7 -0
- package/dist/session/headless/project-artifact-labels.js +7 -0
- package/dist/session/headless/project-artifacts.d.ts +8 -0
- package/dist/session/headless/project-artifacts.js +15 -1
- package/dist/session/headless/project-labels.d.ts +25 -0
- package/dist/session/headless/project-labels.js +25 -0
- package/dist/session/headless/shared-with.d.ts +28 -0
- package/dist/session/headless/shared-with.js +51 -0
- package/dist/session/host-context.d.ts +11 -0
- package/dist/session/host-context.js +14 -0
- package/dist/session/index.d.ts +7 -3
- package/dist/session/index.js +6 -2
- package/dist/session/new-project-parts.d.ts +67 -0
- package/dist/session/new-project-parts.js +470 -0
- package/dist/session/project-artifact-parts.d.ts +2 -1
- package/dist/session/project-artifact-parts.js +5 -2
- package/dist/session/project-people.d.ts +14 -0
- package/dist/session/project-people.js +86 -0
- package/dist/session/share-people.d.ts +12 -0
- package/dist/session/share-people.js +1 -1
- package/dist/session/testing/contract.d.ts +6 -3
- package/dist/session/testing/contract.js +24 -3
- package/dist/session/testing/drafts.contract.d.ts +30 -0
- package/dist/session/testing/drafts.contract.js +126 -0
- package/dist/session/testing/index.d.ts +2 -1
- package/dist/session/testing/index.js +2 -1
- package/dist/session/use-home-projects.d.ts +11 -2
- package/dist/session/use-home-projects.js +142 -5
- package/dist/session/useDraftCollab.d.ts +24 -0
- package/dist/session/useDraftCollab.js +78 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.js +9 -9
- package/dist/settings/sections/index.js +1 -1
- package/dist/settings/sections/providers/CredentialSources.d.ts +5 -5
- package/dist/settings/sections/providers/CredentialSources.js +5 -22
- package/dist/settings/sections/providers/labels.d.ts +1 -9
- package/dist/settings/sections/providers/labels.js +1 -9
- package/dist/styles.css +20 -9
- package/package.json +4 -3
- package/src/styles/sidebar.css +2 -3
package/dist/session/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, BADGE_ICONS, DiffFacts, DiffFactsProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips } from "./ArtifactRowChips.js";
|
|
2
2
|
import { ArtifactOpenEvent, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews } from "./ArtifactsPanel.js";
|
|
3
3
|
import { DiffFileTree, DiffFileTreeProps, FindingCounts } from "./DiffFileTree.js";
|
|
4
|
+
import { DraftPeopleStack, DraftPeopleStackProps } from "./DraftPeopleStack.js";
|
|
4
5
|
import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
|
|
5
|
-
import { NewProjectDialog, NewProjectDialogProps, useNewProject } from "./NewProjectDialog.js";
|
|
6
|
+
import { NewProjectDialog, NewProjectDialogProps, NewProjectTarget, useNewProject } from "./NewProjectDialog.js";
|
|
6
7
|
import { OpenProjectsButton, OpenProjectsButtonProps, OpenProjectsDialog, OpenProjectsDialogProps, useOpenProjects } from "./OpenProjectsDialog.js";
|
|
7
8
|
import { OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, useOpenSessions } from "./OpenSessionsDialog.js";
|
|
8
9
|
import { AttentionActions, InboxAttention, InboxAttentionProps, PanelAttentionProps, QueueAttention, SecretsAttention, SecretsAttentionProps } from "./PanelAttention.js";
|
|
10
|
+
import { PersonCard, PersonCardProps } from "./PersonCard.js";
|
|
9
11
|
import { PlanTracker, PlanTrackerProps, RecentPlans, RecentPlansProps, planStateTone, useInboxPlans } from "./PlanTracker.js";
|
|
10
12
|
import { ProjectFileOpenEvent, ProjectFileOpener, ProjectFilesProvider, ProjectFilesProviderProps, useProjectFileOpener } from "./project-files.js";
|
|
11
13
|
import { ProjectHome, ProjectHomeFolderMissing, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher } from "./ProjectHome.js";
|
|
12
14
|
import { ProjectBadge, ProjectBadgeProps, ProjectLabel, ProjectName, ProjectNameProps, SessionProjectRef, projectIconOf, useFolderIcons, useSessionProject } from "./ProjectName.js";
|
|
15
|
+
import { ProjectPeopleStack, ProjectPeopleStackProps } from "./ProjectPeopleStack.js";
|
|
13
16
|
import { ProjectPublishDialog, ProjectPublishDialogProps, useProjectPublish } from "./ProjectPublishDialog.js";
|
|
14
17
|
import { ProjectSettingsActions, ProjectSettingsDialog, ProjectSettingsDialogProps, useProjectSettings } from "./ProjectSettingsDialog.js";
|
|
15
18
|
import { ProjectShareDialog, ProjectShareDialogProps, useProjectShare } from "./ProjectShareDialog.js";
|
|
@@ -25,7 +28,7 @@ import { SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, S
|
|
|
25
28
|
import { SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer } from "./SessionHeader.js";
|
|
26
29
|
import { SessionPeopleStack, SessionPeopleStackProps } from "./SessionPeopleStack.js";
|
|
27
30
|
import { SessionPlaceMenu, SessionPlaceMenuProps } from "./SessionPlaceMenu.js";
|
|
28
|
-
import { SessionProvider, SessionProviderProps, useAllSchedules, useProjectList, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionProjects, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
|
|
31
|
+
import { SessionProvider, SessionProviderProps, useAllSchedules, useHostProjects, useProjectList, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionProjects, useSessionProjectsOf, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useSessionSharing } from "./SessionProvider.js";
|
|
29
32
|
import { RenderSessionShell, SessionShell, SessionShellProps } from "./SessionShell.js";
|
|
30
33
|
import { ShareSessionDialog, ShareSessionDialogProps, useShareSession } from "./ShareSessionDialog.js";
|
|
31
34
|
import { SideChat, SideChatProps } from "./SideChat.js";
|
|
@@ -37,8 +40,9 @@ import { useFolderMissing } from "./use-folder-missing.js";
|
|
|
37
40
|
import { useFolderProject } from "./use-folder-project.js";
|
|
38
41
|
import { GroupedSession, HomeProjects, useHomeProjects } from "./use-home-projects.js";
|
|
39
42
|
import { useProjectHomeOn } from "./use-project-home-on.js";
|
|
43
|
+
import { useDraftCollab, useDraftComposer, useDraftRoomView, useDraftingHere } from "./useDraftCollab.js";
|
|
40
44
|
import { useSessionActionError } from "./useSessionActionError.js";
|
|
41
45
|
import { useSessionLabels } from "./useSessionLabels.js";
|
|
42
46
|
import { UsageSummaryView, useUsageSummary } from "./useUsageSummary.js";
|
|
43
47
|
import { WelcomeScreen, WelcomeScreenProps } from "./WelcomeScreen.js";
|
|
44
|
-
export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, BudgetBar, BudgetBarProps, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, GroupedSession, HomeProjects, InboxAttention, InboxAttentionProps, NewProjectDialog, NewProjectDialogProps, OpenProjectsButton, OpenProjectsButtonProps, OpenProjectsDialog, OpenProjectsDialogProps, OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectBadge, ProjectBadgeProps, type ProjectFileOpenEvent, type ProjectFileOpener, ProjectFilesProvider, type ProjectFilesProviderProps, ProjectHome, ProjectHomeFolderMissing, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProjectLabel, ProjectName, ProjectNameProps, ProjectPublishDialog, ProjectPublishDialogProps, ProjectSettingsActions, ProjectSettingsDialog, ProjectSettingsDialogProps, ProjectShareDialog, ProjectShareDialogProps, ProjectSpendChip, ProjectSpendChipProps, ProjectUsageDialog, ProjectUsageDialogProps, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionAccessNotice, SessionAccessNoticeProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPeopleStack, SessionPeopleStackProps, SessionPlaceMenu, SessionPlaceMenuProps, SessionProjectRef, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, ShareSessionDialog, ShareSessionDialogProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, TypingLine, TypingLineProps, UsageSection, UsageSectionProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, projectIconOf, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useFolderIcons, useFolderMissing, useFolderProject, useHomeProjects, useInboxPlans, useNewProject, useOpenProjects, useOpenSessions, useProjectFileOpener, useProjectHomeOn, useProjectList, useProjectPublish, useProjectSettings, useProjectShare, useProjectUsage, useProviderUsage, useSchedulesStatus, useSessionAccess, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionProject, useSessionProjects, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
|
|
48
|
+
export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, BudgetBar, BudgetBarProps, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, DraftPeopleStack, DraftPeopleStackProps, FindingCounts, GroupedSession, HomeProjects, InboxAttention, InboxAttentionProps, NewProjectDialog, NewProjectDialogProps, NewProjectTarget, OpenProjectsButton, OpenProjectsButtonProps, OpenProjectsDialog, OpenProjectsDialogProps, OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, PanelAttentionProps, PersonCard, PersonCardProps, PlanTracker, PlanTrackerProps, ProjectBadge, ProjectBadgeProps, type ProjectFileOpenEvent, type ProjectFileOpener, ProjectFilesProvider, type ProjectFilesProviderProps, ProjectHome, ProjectHomeFolderMissing, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProjectLabel, ProjectName, ProjectNameProps, ProjectPeopleStack, ProjectPeopleStackProps, ProjectPublishDialog, ProjectPublishDialogProps, ProjectSettingsActions, ProjectSettingsDialog, ProjectSettingsDialogProps, ProjectShareDialog, ProjectShareDialogProps, ProjectSpendChip, ProjectSpendChipProps, ProjectUsageDialog, ProjectUsageDialogProps, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionAccessNotice, SessionAccessNoticeProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPeopleStack, SessionPeopleStackProps, SessionPlaceMenu, SessionPlaceMenuProps, SessionProjectRef, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, ShareSessionDialog, ShareSessionDialogProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, TypingLine, TypingLineProps, UsageSection, UsageSectionProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, projectIconOf, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useDraftCollab, useDraftComposer, useDraftRoomView, useDraftingHere, useFolderIcons, useFolderMissing, useFolderProject, useHomeProjects, useHostProjects, useInboxPlans, useNewProject, useOpenProjects, useOpenSessions, useProjectFileOpener, useProjectHomeOn, useProjectList, useProjectPublish, useProjectSettings, useProjectShare, useProjectUsage, useProviderUsage, useSchedulesStatus, useSessionAccess, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionProject, useSessionProjects, useSessionProjectsOf, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useSessionSharing, useShareSession, useUsageSummary };
|
package/dist/session/index.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ArtifactRowChips, BADGE_ICONS, DiffFacts, badgeColorStyle, badgeToneClass, hasArtifactRowChips } from "./ArtifactRowChips.js";
|
|
2
2
|
import { ArtifactsPanel } from "./ArtifactsPanel.js";
|
|
3
3
|
import { DiffFileTree } from "./DiffFileTree.js";
|
|
4
|
+
import { DraftPeopleStack } from "./DraftPeopleStack.js";
|
|
4
5
|
import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
|
|
5
6
|
import { NewProjectDialog, useNewProject } from "./NewProjectDialog.js";
|
|
6
7
|
import { OpenProjectsButton, OpenProjectsDialog, useOpenProjects } from "./OpenProjectsDialog.js";
|
|
7
8
|
import { OpenSessionsButton, OpenSessionsDialog, useOpenSessions } from "./OpenSessionsDialog.js";
|
|
8
9
|
import { InboxAttention, QueueAttention, SecretsAttention } from "./PanelAttention.js";
|
|
10
|
+
import { PersonCard } from "./PersonCard.js";
|
|
9
11
|
import { PlanTracker, RecentPlans, planStateTone, useInboxPlans } from "./PlanTracker.js";
|
|
10
12
|
import { ProjectFilesProvider, useProjectFileOpener } from "./project-files.js";
|
|
11
13
|
import { ProjectHome } from "./ProjectHome.js";
|
|
12
14
|
import { ProjectBadge, ProjectName, projectIconOf, useFolderIcons, useSessionProject } from "./ProjectName.js";
|
|
15
|
+
import { ProjectPeopleStack } from "./ProjectPeopleStack.js";
|
|
13
16
|
import { ProjectPublishDialog, useProjectPublish } from "./ProjectPublishDialog.js";
|
|
14
17
|
import { ProjectSettingsDialog, useProjectSettings } from "./ProjectSettingsDialog.js";
|
|
15
18
|
import { ProjectShareDialog, useProjectShare } from "./ProjectShareDialog.js";
|
|
@@ -25,7 +28,7 @@ import { SessionDetailsDialog } from "./SessionDetailsDialog.js";
|
|
|
25
28
|
import { SessionHeader } from "./SessionHeader.js";
|
|
26
29
|
import { SessionPeopleStack } from "./SessionPeopleStack.js";
|
|
27
30
|
import { SessionPlaceMenu } from "./SessionPlaceMenu.js";
|
|
28
|
-
import { SessionProvider, useAllSchedules, useProjectList, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionProjects, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
|
|
31
|
+
import { SessionProvider, useAllSchedules, useHostProjects, useProjectList, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionProjects, useSessionProjectsOf, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useSessionSharing } from "./SessionProvider.js";
|
|
29
32
|
import { SessionShell } from "./SessionShell.js";
|
|
30
33
|
import { ShareSessionDialog, useShareSession } from "./ShareSessionDialog.js";
|
|
31
34
|
import { SideChat } from "./SideChat.js";
|
|
@@ -37,8 +40,9 @@ import { useFolderMissing } from "./use-folder-missing.js";
|
|
|
37
40
|
import { useFolderProject } from "./use-folder-project.js";
|
|
38
41
|
import { useHomeProjects } from "./use-home-projects.js";
|
|
39
42
|
import { useProjectHomeOn } from "./use-project-home-on.js";
|
|
43
|
+
import { useDraftCollab, useDraftComposer, useDraftRoomView, useDraftingHere } from "./useDraftCollab.js";
|
|
40
44
|
import { useSessionActionError } from "./useSessionActionError.js";
|
|
41
45
|
import { useSessionLabels } from "./useSessionLabels.js";
|
|
42
46
|
import { useUsageSummary } from "./useUsageSummary.js";
|
|
43
47
|
import { WelcomeScreen } from "./WelcomeScreen.js";
|
|
44
|
-
export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, BudgetBar, DiffFacts, DiffFileTree, InboxAttention, NewProjectDialog, OpenProjectsButton, OpenProjectsDialog, OpenSessionsButton, OpenSessionsDialog, PlanTracker, ProjectBadge, ProjectFilesProvider, ProjectHome, ProjectName, ProjectPublishDialog, ProjectSettingsDialog, ProjectShareDialog, ProjectSpendChip, ProjectUsageDialog, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionAccessNotice, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPeopleStack, SessionPlaceMenu, SessionProvider, SessionShell, ShareSessionDialog, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, TypingLine, UsageSection, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, projectIconOf, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useFolderIcons, useFolderMissing, useFolderProject, useHomeProjects, useInboxPlans, useNewProject, useOpenProjects, useOpenSessions, useProjectFileOpener, useProjectHomeOn, useProjectList, useProjectPublish, useProjectSettings, useProjectShare, useProjectUsage, useProviderUsage, useSchedulesStatus, useSessionAccess, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionProject, useSessionProjects, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
|
|
48
|
+
export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, BudgetBar, DiffFacts, DiffFileTree, DraftPeopleStack, InboxAttention, NewProjectDialog, OpenProjectsButton, OpenProjectsDialog, OpenSessionsButton, OpenSessionsDialog, PersonCard, PlanTracker, ProjectBadge, ProjectFilesProvider, ProjectHome, ProjectName, ProjectPeopleStack, ProjectPublishDialog, ProjectSettingsDialog, ProjectShareDialog, ProjectSpendChip, ProjectUsageDialog, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionAccessNotice, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPeopleStack, SessionPlaceMenu, SessionProvider, SessionShell, ShareSessionDialog, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, TypingLine, UsageSection, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, projectIconOf, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useDraftCollab, useDraftComposer, useDraftRoomView, useDraftingHere, useFolderIcons, useFolderMissing, useFolderProject, useHomeProjects, useHostProjects, useInboxPlans, useNewProject, useOpenProjects, useOpenSessions, useProjectFileOpener, useProjectHomeOn, useProjectList, useProjectPublish, useProjectSettings, useProjectShare, useProjectUsage, useProviderUsage, useSchedulesStatus, useSessionAccess, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionProject, useSessionProjects, useSessionProjectsOf, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useSessionSharing, useShareSession, useUsageSummary };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of New project on a host whose projects can have a repository as their home and be shared from the
|
|
3
|
+
* start (a zidane-server in organization mode): the repository home and the access.
|
|
4
|
+
*
|
|
5
|
+
* - The repository: one of the person's GitHub repositories (searched as they type), or a new one ("Create
|
|
6
|
+
* repository": the owner, the name from the project's, private or not, its availability checked as it is
|
|
7
|
+
* typed). Without the person's GitHub repositories (`GitHost.githubRepos` absent, or its `status` not
|
|
8
|
+
* available), a pasted git or GitHub URL, read as Import repository reads it.
|
|
9
|
+
* - The access: private, people invited with a grant each, or open to the organization.
|
|
10
|
+
*/
|
|
11
|
+
import { GithubRepos } from "../git/headless/host.js";
|
|
12
|
+
import { ParticipantView, ProjectGrant } from "zidane/ipc";
|
|
13
|
+
/** The repository home picked so far: an existing one (picked or pasted), or one to create. `null`: none yet. */
|
|
14
|
+
export type RepoHomePick = {
|
|
15
|
+
kind: 'url';
|
|
16
|
+
url: string;
|
|
17
|
+
name: string;
|
|
18
|
+
base?: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'create';
|
|
21
|
+
owner: string;
|
|
22
|
+
name: string;
|
|
23
|
+
private: boolean;
|
|
24
|
+
verdict: RepoNameVerdict;
|
|
25
|
+
};
|
|
26
|
+
/** What is known of a new repository's name: being checked, or GitHub's verdict, or why it could not say. */
|
|
27
|
+
export type RepoNameVerdict = 'checking' | 'available' | 'taken' | 'invalid' | 'forbidden' | 'failed';
|
|
28
|
+
/** The URL a project's repository home keeps for a repository's page or remote: its clone URL, as Import repository reads it. */
|
|
29
|
+
export declare function repoCloneUrl(url: string): string;
|
|
30
|
+
/** A repository name from a project's: spaces to dashes, only what GitHub takes. */
|
|
31
|
+
export declare function repoNameOf(projectName: string): string;
|
|
32
|
+
/** Props of {@link RepoHomeField}. */
|
|
33
|
+
export interface RepoHomeFieldProps {
|
|
34
|
+
/** The person's GitHub repositories (`GitHost.githubRepos`). Absent: a pasted URL only. */
|
|
35
|
+
github: GithubRepos | undefined;
|
|
36
|
+
/** The saved server the project is made on, which the GitHub calls go through. Absent: the window's own host. */
|
|
37
|
+
hostId?: string | undefined;
|
|
38
|
+
/** The project's name, which a new repository's name starts from. */
|
|
39
|
+
projectName: string;
|
|
40
|
+
/** A create is running: nothing changes. */
|
|
41
|
+
busy: boolean;
|
|
42
|
+
/** Hears the pick as it changes. */
|
|
43
|
+
onChange: (pick: RepoHomePick | null) => void;
|
|
44
|
+
}
|
|
45
|
+
/** The repository home (see the header). */
|
|
46
|
+
export declare function RepoHomeField({ github, hostId, projectName, busy, onChange }: RepoHomeFieldProps): import("react").JSX.Element;
|
|
47
|
+
/** Who has a new project from the start. */
|
|
48
|
+
export type ProjectAccess = 'private' | 'invite' | 'open';
|
|
49
|
+
/** A person invited to a new project, with what they may do there. */
|
|
50
|
+
export interface ProjectInvitee {
|
|
51
|
+
person: ParticipantView;
|
|
52
|
+
grant: ProjectGrant;
|
|
53
|
+
}
|
|
54
|
+
/** Props of {@link AccessField}. */
|
|
55
|
+
export interface AccessFieldProps {
|
|
56
|
+
/** The organization's people (`SessionProjectSharing.users`). */
|
|
57
|
+
users: () => Promise<readonly ParticipantView[]>;
|
|
58
|
+
/** The caller's user id (`SessionSharingHost.self`): left out of the people to invite. Absent: nobody is. */
|
|
59
|
+
self?: string;
|
|
60
|
+
access: ProjectAccess;
|
|
61
|
+
onAccess: (access: ProjectAccess) => void;
|
|
62
|
+
invited: readonly ProjectInvitee[];
|
|
63
|
+
onInvited: (invited: readonly ProjectInvitee[]) => void;
|
|
64
|
+
busy: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** The access (see the header): the people are read the first time Invite people is picked. */
|
|
67
|
+
export declare function AccessField({ users, self, access, onAccess, invited, onInvited, busy }: AccessFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { Checkbox, INPUT_CLASS } from "../components/Form.js";
|
|
2
|
+
import { MenuRow } from "../components/Menu.js";
|
|
3
|
+
import { Notice } from "../components/Notice.js";
|
|
4
|
+
import { errorMessage } from "../components/report-error.js";
|
|
5
|
+
import { Segmented } from "../components/Segmented.js";
|
|
6
|
+
import { useGitLabels } from "../git/GitProvider.js";
|
|
7
|
+
import { isGithubRepoName } from "../git/headless/github.js";
|
|
8
|
+
import { githubErrorText } from "../git/headless/labels.js";
|
|
9
|
+
import { ShareInviteRow, ShareMembers, ShareRetry } from "./share-people.js";
|
|
10
|
+
import { useSessionLabels } from "./useSessionLabels.js";
|
|
11
|
+
import { useEffect, useId, useLayoutEffect, useState } from "react";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { parseRepoInput } from "zidane/chat/pure";
|
|
14
|
+
// src/session/new-project-parts.tsx
|
|
15
|
+
/** How long typing holds still before GitHub is asked (a search, a name's availability). */
|
|
16
|
+
const TYPING_DELAY_MS = 250;
|
|
17
|
+
/** The URL a project's repository home keeps for a repository's page or remote: its clone URL, as Import repository reads it. */
|
|
18
|
+
function repoCloneUrl(url) {
|
|
19
|
+
return parseRepoInput(url)?.cloneUrl ?? url;
|
|
20
|
+
}
|
|
21
|
+
/** A repository name from a project's: spaces to dashes, only what GitHub takes. */
|
|
22
|
+
function repoNameOf(projectName) {
|
|
23
|
+
return projectName.trim().replace(/\s+/g, "-").replace(/[^\w.-]/g, "").replace(/-{2,}/g, "-").slice(0, 100);
|
|
24
|
+
}
|
|
25
|
+
/** A row that is a checkbox: the box, then its label. */
|
|
26
|
+
function CheckRow({ checked, label, disabled, onToggle, testId }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
role: "checkbox",
|
|
30
|
+
"aria-checked": checked,
|
|
31
|
+
disabled,
|
|
32
|
+
"data-testid": testId,
|
|
33
|
+
onClick: onToggle,
|
|
34
|
+
className: "zg-focus-ring flex items-center gap-2 bg-transparent border-0 p-0 rounded-zg-sm text-left text-zg-label text-[var(--zg-text)] cursor-pointer disabled:cursor-default min-h-7",
|
|
35
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
36
|
+
checked,
|
|
37
|
+
className: "!mt-0"
|
|
38
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "min-w-0 truncate",
|
|
40
|
+
children: label
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** The person's GitHub sign-in on the host: `null` while it is read. */
|
|
45
|
+
function useGithubStatus(github, hostId) {
|
|
46
|
+
const [status, setStatus] = useState(null);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!github) return void 0;
|
|
49
|
+
let live = true;
|
|
50
|
+
github.status(hostId).then((found) => live && setStatus({
|
|
51
|
+
github,
|
|
52
|
+
hostId,
|
|
53
|
+
status: found
|
|
54
|
+
}), (err) => live && setStatus({
|
|
55
|
+
github,
|
|
56
|
+
hostId,
|
|
57
|
+
status: {
|
|
58
|
+
available: false,
|
|
59
|
+
error: {
|
|
60
|
+
kind: "unavailable",
|
|
61
|
+
detail: errorMessage(err)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}));
|
|
65
|
+
return () => {
|
|
66
|
+
live = false;
|
|
67
|
+
};
|
|
68
|
+
}, [github, hostId]);
|
|
69
|
+
return github && status?.github === github && status.hostId === hostId ? status.status : null;
|
|
70
|
+
}
|
|
71
|
+
/** The repository home (see the header). */
|
|
72
|
+
function RepoHomeField({ github, hostId, projectName, busy, onChange }) {
|
|
73
|
+
const labels = useSessionLabels();
|
|
74
|
+
const git = useGitLabels();
|
|
75
|
+
const status = useGithubStatus(github, hostId);
|
|
76
|
+
if (github && status === null) return /* @__PURE__ */ jsx("input", {
|
|
77
|
+
"aria-label": labels.projectRepoSearch,
|
|
78
|
+
placeholder: labels.projectRepoSearch,
|
|
79
|
+
disabled: true,
|
|
80
|
+
className: INPUT_CLASS
|
|
81
|
+
});
|
|
82
|
+
if (!github || !status?.available) {
|
|
83
|
+
const why = status && !status.available ? status.error : null;
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
85
|
+
className: "flex flex-col gap-1.5",
|
|
86
|
+
children: [why && /* @__PURE__ */ jsx(Notice, {
|
|
87
|
+
tone: "info",
|
|
88
|
+
compact: true,
|
|
89
|
+
...why.detail ? { detail: why.detail } : {},
|
|
90
|
+
children: githubErrorText(why, git)
|
|
91
|
+
}), /* @__PURE__ */ jsx(RepoUrlField, {
|
|
92
|
+
busy,
|
|
93
|
+
onChange
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return /* @__PURE__ */ jsx(GithubRepoField, {
|
|
98
|
+
github,
|
|
99
|
+
hostId,
|
|
100
|
+
login: status.login,
|
|
101
|
+
orgs: status.orgs,
|
|
102
|
+
projectName,
|
|
103
|
+
busy,
|
|
104
|
+
onChange
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/** A pasted git or GitHub URL (or `owner/repo`). */
|
|
108
|
+
function RepoUrlField({ busy, onChange }) {
|
|
109
|
+
const labels = useSessionLabels();
|
|
110
|
+
const git = useGitLabels();
|
|
111
|
+
const [input, setInput] = useState("");
|
|
112
|
+
const spec = parseRepoInput(input);
|
|
113
|
+
const invalid = input.trim() !== "" && !spec;
|
|
114
|
+
const url = spec?.cloneUrl ?? null;
|
|
115
|
+
useLayoutEffect(() => {
|
|
116
|
+
onChange(spec ? {
|
|
117
|
+
kind: "url",
|
|
118
|
+
url: spec.cloneUrl,
|
|
119
|
+
name: spec.name,
|
|
120
|
+
...spec.branch ? { base: spec.branch } : {}
|
|
121
|
+
} : null);
|
|
122
|
+
}, [
|
|
123
|
+
url,
|
|
124
|
+
spec?.branch,
|
|
125
|
+
onChange
|
|
126
|
+
]);
|
|
127
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
128
|
+
className: "flex flex-col gap-1.5",
|
|
129
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
130
|
+
"aria-label": labels.projectRepoUrl,
|
|
131
|
+
value: input,
|
|
132
|
+
disabled: busy,
|
|
133
|
+
spellCheck: false,
|
|
134
|
+
autoComplete: "off",
|
|
135
|
+
"aria-invalid": invalid || void 0,
|
|
136
|
+
placeholder: git.gitImportPlaceholder,
|
|
137
|
+
onChange: (e) => setInput(e.target.value),
|
|
138
|
+
className: `${INPUT_CLASS} font-mono`
|
|
139
|
+
}), invalid && /* @__PURE__ */ jsx(Notice, {
|
|
140
|
+
tone: "error",
|
|
141
|
+
compact: true,
|
|
142
|
+
children: git.gitImportInvalid
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/** The person's repositories, searched as they type, and "Create repository". */
|
|
147
|
+
function GithubRepoField({ github, hostId, login, orgs, projectName, busy, onChange }) {
|
|
148
|
+
const labels = useSessionLabels();
|
|
149
|
+
const git = useGitLabels();
|
|
150
|
+
const [creating, setCreating] = useState(false);
|
|
151
|
+
const [query, setQuery] = useState("");
|
|
152
|
+
const [found, setFound] = useState(null);
|
|
153
|
+
const [picked, setPicked] = useState(null);
|
|
154
|
+
const [owner, setOwner] = useState(login);
|
|
155
|
+
const [typedName, setTypedName] = useState(null);
|
|
156
|
+
const [isPrivate, setIsPrivate] = useState(true);
|
|
157
|
+
const [checked, setChecked] = useState(null);
|
|
158
|
+
const listId = useId();
|
|
159
|
+
const trimmed = query.trim();
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (creating) return void 0;
|
|
162
|
+
let live = true;
|
|
163
|
+
const timer = setTimeout(() => {
|
|
164
|
+
github.search({
|
|
165
|
+
...hostId ? { hostId } : {},
|
|
166
|
+
...trimmed ? { query: trimmed } : {},
|
|
167
|
+
limit: 20
|
|
168
|
+
}).then((result) => live && setFound({
|
|
169
|
+
query: trimmed,
|
|
170
|
+
result
|
|
171
|
+
}), (err) => live && setFound({
|
|
172
|
+
query: trimmed,
|
|
173
|
+
result: {
|
|
174
|
+
ok: false,
|
|
175
|
+
error: {
|
|
176
|
+
kind: "unavailable",
|
|
177
|
+
detail: errorMessage(err)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}));
|
|
181
|
+
}, trimmed ? TYPING_DELAY_MS : 0);
|
|
182
|
+
return () => {
|
|
183
|
+
live = false;
|
|
184
|
+
clearTimeout(timer);
|
|
185
|
+
};
|
|
186
|
+
}, [
|
|
187
|
+
github,
|
|
188
|
+
hostId,
|
|
189
|
+
trimmed,
|
|
190
|
+
creating
|
|
191
|
+
]);
|
|
192
|
+
const name = typedName ?? repoNameOf(projectName);
|
|
193
|
+
const valid = isGithubRepoName(name);
|
|
194
|
+
const empty = name === "";
|
|
195
|
+
const key = `${owner}/${name}`;
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
if (!creating || !valid) return void 0;
|
|
198
|
+
let live = true;
|
|
199
|
+
const timer = setTimeout(() => {
|
|
200
|
+
github.check(owner, name, hostId).then((result) => live && setChecked({
|
|
201
|
+
key,
|
|
202
|
+
result
|
|
203
|
+
}), () => live && setChecked({
|
|
204
|
+
key,
|
|
205
|
+
result: null
|
|
206
|
+
}));
|
|
207
|
+
}, TYPING_DELAY_MS);
|
|
208
|
+
return () => {
|
|
209
|
+
live = false;
|
|
210
|
+
clearTimeout(timer);
|
|
211
|
+
};
|
|
212
|
+
}, [
|
|
213
|
+
github,
|
|
214
|
+
hostId,
|
|
215
|
+
creating,
|
|
216
|
+
valid,
|
|
217
|
+
owner,
|
|
218
|
+
name,
|
|
219
|
+
key
|
|
220
|
+
]);
|
|
221
|
+
const answer = checked?.key === key ? checked.result : void 0;
|
|
222
|
+
const verdict = !valid ? "invalid" : answer === void 0 ? "checking" : answer === null || !answer.ok ? "failed" : answer.verdict;
|
|
223
|
+
useLayoutEffect(() => {
|
|
224
|
+
onChange(creating ? {
|
|
225
|
+
kind: "create",
|
|
226
|
+
owner,
|
|
227
|
+
name,
|
|
228
|
+
private: isPrivate,
|
|
229
|
+
verdict
|
|
230
|
+
} : picked ? {
|
|
231
|
+
kind: "url",
|
|
232
|
+
...picked
|
|
233
|
+
} : null);
|
|
234
|
+
}, [
|
|
235
|
+
creating,
|
|
236
|
+
owner,
|
|
237
|
+
name,
|
|
238
|
+
isPrivate,
|
|
239
|
+
verdict,
|
|
240
|
+
picked,
|
|
241
|
+
onChange
|
|
242
|
+
]);
|
|
243
|
+
const result = found?.result;
|
|
244
|
+
const statusWord = empty ? "" : verdict === "checking" ? labels.projectRepoChecking : verdict === "available" ? labels.projectRepoAvailable : verdict === "taken" ? git.githubNameTaken : verdict === "invalid" ? git.githubInvalidName : verdict === "forbidden" ? git.githubForbidden : answer && !answer.ok ? githubErrorText(answer.error, git) : git.githubUnavailable;
|
|
245
|
+
const statusTone = verdict === "available" ? "text-[var(--zg-success)]" : verdict === "checking" ? "text-[var(--zg-text-muted)]" : "text-[var(--zg-danger)]";
|
|
246
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
247
|
+
className: "flex flex-col gap-1.5",
|
|
248
|
+
children: [
|
|
249
|
+
!creating && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("input", {
|
|
250
|
+
type: "search",
|
|
251
|
+
"aria-label": labels.projectRepoSearch,
|
|
252
|
+
"aria-controls": listId,
|
|
253
|
+
placeholder: labels.projectRepoSearch,
|
|
254
|
+
value: query,
|
|
255
|
+
disabled: busy,
|
|
256
|
+
spellCheck: false,
|
|
257
|
+
autoComplete: "off",
|
|
258
|
+
onChange: (e) => setQuery(e.target.value),
|
|
259
|
+
className: "zg-well w-full h-8 px-2.5 text-zg-ui placeholder:text-[var(--zg-text-subtle)] disabled:opacity-zg-disabled"
|
|
260
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
261
|
+
id: listId,
|
|
262
|
+
role: "group",
|
|
263
|
+
"aria-label": labels.projectRepoSearch,
|
|
264
|
+
"aria-busy": found?.query !== trimmed || void 0,
|
|
265
|
+
className: "flex flex-col -mx-1 px-1 max-h-[132px] overflow-y-auto",
|
|
266
|
+
"data-testid": "new-project-repos",
|
|
267
|
+
children: [
|
|
268
|
+
result && !result.ok && /* @__PURE__ */ jsx(Notice, {
|
|
269
|
+
tone: "error",
|
|
270
|
+
compact: true,
|
|
271
|
+
...result.error.detail ? { detail: result.error.detail } : {},
|
|
272
|
+
children: githubErrorText(result.error, git)
|
|
273
|
+
}),
|
|
274
|
+
result?.ok && result.repos.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
275
|
+
className: "m-0 px-3 py-2 text-zg-label text-[var(--zg-text-muted)]",
|
|
276
|
+
children: labels.projectRepoEmpty
|
|
277
|
+
}),
|
|
278
|
+
result?.ok && result.repos.map((repo) => /* @__PURE__ */ jsx(MenuRow, {
|
|
279
|
+
size: "sm",
|
|
280
|
+
"aria-pressed": picked?.url === repoCloneUrl(repo.url),
|
|
281
|
+
checked: picked?.url === repoCloneUrl(repo.url),
|
|
282
|
+
disabled: busy,
|
|
283
|
+
icon: /* @__PURE__ */ jsx("span", {
|
|
284
|
+
"aria-hidden": true,
|
|
285
|
+
className: repo.private ? "i-ph-lock-simple" : "i-ph-github-logo"
|
|
286
|
+
}),
|
|
287
|
+
title: repo.fullName,
|
|
288
|
+
onClick: () => setPicked({
|
|
289
|
+
url: repoCloneUrl(repo.url),
|
|
290
|
+
name: repo.name
|
|
291
|
+
})
|
|
292
|
+
}, repo.fullName))
|
|
293
|
+
]
|
|
294
|
+
})] }),
|
|
295
|
+
/* @__PURE__ */ jsx(CheckRow, {
|
|
296
|
+
checked: creating,
|
|
297
|
+
label: labels.projectRepoCreate,
|
|
298
|
+
disabled: busy,
|
|
299
|
+
testId: "new-project-create-repo",
|
|
300
|
+
onToggle: () => setCreating((on) => !on)
|
|
301
|
+
}),
|
|
302
|
+
creating && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
|
|
303
|
+
className: "flex items-center gap-1.5 min-w-0",
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsx("select", {
|
|
306
|
+
"aria-label": labels.projectRepoOwner,
|
|
307
|
+
value: owner,
|
|
308
|
+
disabled: busy,
|
|
309
|
+
onChange: (e) => setOwner(e.target.value),
|
|
310
|
+
className: `zg-well h-7 px-2 text-zg-label cursor-pointer disabled:cursor-default disabled:opacity-zg-disabled h-8 shrink-0 max-w-[40%] truncate`,
|
|
311
|
+
children: [login, ...orgs].map((o) => /* @__PURE__ */ jsx("option", {
|
|
312
|
+
value: o,
|
|
313
|
+
children: o
|
|
314
|
+
}, o))
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ jsx("span", {
|
|
317
|
+
"aria-hidden": true,
|
|
318
|
+
className: "text-zg-ui text-[var(--zg-text-muted)]",
|
|
319
|
+
children: "/"
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ jsx("input", {
|
|
322
|
+
"aria-label": labels.projectRepoName,
|
|
323
|
+
value: name,
|
|
324
|
+
disabled: busy,
|
|
325
|
+
spellCheck: false,
|
|
326
|
+
autoComplete: "off",
|
|
327
|
+
"aria-invalid": !empty && verdict !== "available" && verdict !== "checking" ? true : void 0,
|
|
328
|
+
onChange: (e) => setTypedName(e.target.value),
|
|
329
|
+
className: `zg-well w-full h-8 px-2.5 text-zg-ui placeholder:text-[var(--zg-text-subtle)] disabled:opacity-zg-disabled flex-1 min-w-0`
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
333
|
+
className: "flex items-center justify-between gap-2 min-w-0",
|
|
334
|
+
children: [/* @__PURE__ */ jsx(CheckRow, {
|
|
335
|
+
checked: isPrivate,
|
|
336
|
+
label: labels.projectRepoPrivate,
|
|
337
|
+
disabled: busy,
|
|
338
|
+
testId: "new-project-repo-private",
|
|
339
|
+
onToggle: () => setIsPrivate((on) => !on)
|
|
340
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
341
|
+
"aria-live": "polite",
|
|
342
|
+
"data-testid": "new-project-repo-status",
|
|
343
|
+
className: `min-w-0 truncate text-zg-label ${statusTone}`,
|
|
344
|
+
children: statusWord
|
|
345
|
+
})]
|
|
346
|
+
})] })
|
|
347
|
+
]
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
const GRANTS = ["member", "maintainer"];
|
|
351
|
+
const PREFIX = "new-project";
|
|
352
|
+
/** The access (see the header): the people are read the first time Invite people is picked. */
|
|
353
|
+
function AccessField({ users, self, access, onAccess, invited, onInvited, busy }) {
|
|
354
|
+
const labels = useSessionLabels();
|
|
355
|
+
const [people, setPeople] = useState(null);
|
|
356
|
+
const [failure, setFailure] = useState(null);
|
|
357
|
+
const [reads, setReads] = useState(0);
|
|
358
|
+
const [invitee, setInvitee] = useState("");
|
|
359
|
+
const [grant, setGrant] = useState("member");
|
|
360
|
+
const inviting = access === "invite";
|
|
361
|
+
useEffect(() => {
|
|
362
|
+
if (!inviting || people) return void 0;
|
|
363
|
+
let live = true;
|
|
364
|
+
users().then((found) => live && setPeople(found), (err) => live && setFailure({
|
|
365
|
+
message: labels.projectShareUsersFailed,
|
|
366
|
+
detail: errorMessage(err)
|
|
367
|
+
}));
|
|
368
|
+
return () => {
|
|
369
|
+
live = false;
|
|
370
|
+
};
|
|
371
|
+
}, [
|
|
372
|
+
inviting,
|
|
373
|
+
people,
|
|
374
|
+
users,
|
|
375
|
+
labels.projectShareUsersFailed,
|
|
376
|
+
reads
|
|
377
|
+
]);
|
|
378
|
+
const taken = new Set(invited.map((i) => i.person.userId));
|
|
379
|
+
if (self) taken.add(self);
|
|
380
|
+
const candidates = people && people.filter((p) => !taken.has(p.userId));
|
|
381
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
382
|
+
className: "flex flex-col gap-2",
|
|
383
|
+
children: [
|
|
384
|
+
/* @__PURE__ */ jsx(Segmented, {
|
|
385
|
+
size: "sm",
|
|
386
|
+
ariaLabel: labels.projectAccess,
|
|
387
|
+
value: access,
|
|
388
|
+
onChange: onAccess,
|
|
389
|
+
options: [
|
|
390
|
+
{
|
|
391
|
+
value: "private",
|
|
392
|
+
label: labels.projectAccessPrivate,
|
|
393
|
+
disabled: busy
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
value: "invite",
|
|
397
|
+
label: labels.projectAccessInvite,
|
|
398
|
+
disabled: busy
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
value: "open",
|
|
402
|
+
label: labels.projectShareOpen,
|
|
403
|
+
disabled: busy
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
className: "self-start"
|
|
407
|
+
}),
|
|
408
|
+
inviting && invited.length > 0 && /* @__PURE__ */ jsx(ShareMembers, {
|
|
409
|
+
prefix: PREFIX,
|
|
410
|
+
members: invited.map((i) => ({
|
|
411
|
+
...i.person,
|
|
412
|
+
grant: i.grant
|
|
413
|
+
})),
|
|
414
|
+
grants: GRANTS,
|
|
415
|
+
grantNames: labels.projectShareGrants,
|
|
416
|
+
manages: true,
|
|
417
|
+
busy,
|
|
418
|
+
words: {
|
|
419
|
+
owner: labels.projectShareOwner,
|
|
420
|
+
grantFor: labels.projectShareGrantFor,
|
|
421
|
+
removeFor: labels.projectShareRemoveFor,
|
|
422
|
+
remove: labels.projectShareRemove,
|
|
423
|
+
confirm: labels.projectShareConfirm
|
|
424
|
+
},
|
|
425
|
+
onGrant: (userId, next) => onInvited(invited.map((i) => i.person.userId === userId ? {
|
|
426
|
+
...i,
|
|
427
|
+
grant: next
|
|
428
|
+
} : i)),
|
|
429
|
+
onRemove: (m) => onInvited(invited.filter((i) => i.person.userId !== m.userId))
|
|
430
|
+
}),
|
|
431
|
+
inviting && (failure ? /* @__PURE__ */ jsx(ShareRetry, {
|
|
432
|
+
failure: {
|
|
433
|
+
...failure,
|
|
434
|
+
retry: () => {
|
|
435
|
+
setFailure(null);
|
|
436
|
+
setReads((n) => n + 1);
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
retryLabel: labels.projectRetry,
|
|
440
|
+
compact: true
|
|
441
|
+
}) : /* @__PURE__ */ jsx(ShareInviteRow, {
|
|
442
|
+
prefix: PREFIX,
|
|
443
|
+
candidates,
|
|
444
|
+
invitee,
|
|
445
|
+
onInvitee: setInvitee,
|
|
446
|
+
grants: GRANTS,
|
|
447
|
+
grantNames: labels.projectShareGrants,
|
|
448
|
+
grant,
|
|
449
|
+
onGrant: setGrant,
|
|
450
|
+
busy,
|
|
451
|
+
words: {
|
|
452
|
+
invitee: labels.projectShareAddPerson,
|
|
453
|
+
placeholder: labels.projectShareAddPlaceholder,
|
|
454
|
+
grant: labels.projectShareAddGrant,
|
|
455
|
+
submit: labels.projectShareAdd
|
|
456
|
+
},
|
|
457
|
+
onInvite: () => {
|
|
458
|
+
const person = people?.find((p) => p.userId === invitee);
|
|
459
|
+
if (!person) return;
|
|
460
|
+
onInvited([...invited, {
|
|
461
|
+
person,
|
|
462
|
+
grant
|
|
463
|
+
}]);
|
|
464
|
+
setInvitee("");
|
|
465
|
+
}
|
|
466
|
+
}))
|
|
467
|
+
]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
export { AccessField, RepoHomeField, repoCloneUrl, repoNameOf };
|
|
@@ -17,12 +17,13 @@ export interface ArtifactsRead {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Reads a project's artifacts: `fresh` reads them again on mount (a dialog that opens), else once if never read.
|
|
20
|
+
* Without `artifacts` (a host with none) it reads nothing and holds no rows.
|
|
20
21
|
*
|
|
21
22
|
* @param artifacts - The host's artifacts.
|
|
22
23
|
* @param projectId - The project.
|
|
23
24
|
* @param fresh - Read again on mount.
|
|
24
25
|
*/
|
|
25
|
-
export declare function useArtifactsRead(artifacts: SessionProjectArtifacts, projectId: string, fresh: boolean): ArtifactsRead;
|
|
26
|
+
export declare function useArtifactsRead(artifacts: SessionProjectArtifacts | undefined, projectId: string, fresh: boolean): ArtifactsRead;
|
|
26
27
|
/**
|
|
27
28
|
* A row's search text: its label, its drawn title (a pull request's own), its locator and its kind.
|
|
28
29
|
*
|