zidane-ui/ views
import { … } from 'zidane-ui/views'ui/src/views/index.ts
Components#
ViewSessionNavProviderComponent#
Provides the app's way to open what a view's session actions start.
function ViewSessionNavProvider(props: ViewSessionNavProviderProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ViewSessionNavProviderProps |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The app. |
| value | ViewSessionNav | The app's way to open a session and a draft. Memoize it. |
ViewsProviderComponent#
Provides a ViewsHost to the components below it.
function ViewsProvider(props: ViewsProviderProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ViewsProviderProps | Provider props: the |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The app. |
| host | ViewsHost | Where the stored views come from. |
Functions#
useViewSessionNavFunction#
The app's ViewSessionNav, with the transcript's openSession when the app gives none.
function useViewSessionNav(): ViewSessionNavReturns
useViewsHostFunction#
zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider
that puts a ViewsHost in context and the hooks that read it. The
components that draw a view load in their own chunk, the first time the
transcript draws a ```view fence with its views option on, so this
entry stays small for apps that mount the provider with views off.
useViewsLabelsFunction#
zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider
that puts a ViewsHost in context and the hooks that read it. The
components that draw a view load in their own chunk, the first time the
transcript draws a ```view fence with its views option on, so this
entry stays small for apps that mount the provider with views off.
function useViewsLabels(): { cancel: string; copiedShort: string; retry: string; viewActionDenied: string; viewActionFailed: string; viewActionRuns: (tool: string) => string; viewActions: string; viewActionSends: (text: string) => string; viewActionWaiting: string; viewChoiceOptions: string; viewCloseTab: string; viewCopyFailed: string; viewCopyImage: string; viewCopyText: string; viewCustomConsoleError: string; viewCustomEmpty: string; viewCustomFailed: string; viewCustomFrame: (title: string) => string; viewCustomImage: (title: string) => string; viewCustomOff: string; viewCustomOverflow: string; viewCustomRun: string; viewCustomSnapshot: (title: string) => string; viewCustomUnsupported: string; viewCustomWaiting: string; viewDeleteFailed: string; viewDrawing: string; viewErrors: string; viewExpand: string; viewFormNo: string; viewFormYes: string; viewFrame: (title: string) => string; viewImageHidden: (alt: string) => string; viewInPanel: string; viewInputsFailed: string; viewInputsOff: string; viewInputsPending: string; viewInputsSend: string; viewInputsSending: string; viewInputsSent: string; viewInputsUnsupported: string; viewInvalid: (name: string) => string; viewLinkDomain: (domain: string) => string; viewLive: (seconds: number) => string; viewLoadFailed: string; viewLoading: string; viewMcpAppAllow: string; viewMcpAppAllowed: (names: string) => string; viewMcpAppAsks: (names: string) => string; viewMcpAppDownloadBody: (server: string, size: string) => string; viewMcpAppDownloadSave: string; viewMcpAppDownloadTitle: (name: string) => string; viewMcpAppFailed: string; viewMcpAppFrame: (server: string, title: string) => string; viewMcpAppFrom: (server: string) => string; viewMcpAppOff: string; viewMcpAppPermission: (name: 'camera' | 'microphone' | 'geolocation' | 'clipboardWrite') => string; viewMcpAppRefused: string; viewMcpAppRun: string; viewMcpAppUiOff: string; viewMcpAppUnsupported: string; viewMcpAppWaiting: string; viewMissingRef: (ref: string) => string; viewNewerVersion: string; viewNo: string; viewOpenChat: string; viewOpenInArtifacts: string; viewOpenInChat: string; viewOpenPanel: string; viewPending: string; viewPin: string; viewPinFailed: string; viewPinnedHomeOff: string; viewRefresh: string; viewRefreshedAgo: (age: string) => string; viewRefreshedAt: (when: string) => string; viewRefreshFailed: string; viewRefreshing: string; viewRefreshUnsupported: string; viewRename: string; viewRenameFailed: string; viewRenameTitle: (title: string) => string; viewSave: string; viewSaved: string; viewSavedDelete: string; viewSaveFailed: string; viewSessionAgent: string; viewSessionAgentDefault: string; viewSessionAlways: string; viewSessionAnother: string; viewSessionArtifacts: string; viewSessionAsk: (verb: 'start' | 'send' | 'schedule' | 'command') => string; viewSessionChip: (status: string, title: string) => string; viewSessionCommand: string; viewSessionDraft: string; viewSessionFailed: string; viewSessionMore: string; viewSessionOnce: (verb: 'start' | 'send' | 'schedule' | 'command') => 'Start once' | 'Run once'; viewSessionOpen: string; viewSessionOpenToast: string; viewSessionPrompt: string; viewSessionRan: string; viewSessionScheduled: string; viewSessionSent: string; viewSessionStarted: (title: string) => string; viewSessionStartedDefault: (title: string, agent: string) => string; viewSessionStatus: (status: 'done' | 'failed' | 'running' | 'blocked') => string; viewSessionWhen: string; viewSessionWhere: string; viewSessionWhereBranch: (branch: string) => string; viewSessionWhereProject: string; viewShowLatest: string; viewShowOriginal: string; viewSourceAgo: (age: string) => string; viewSourceAllow: string; viewSourceAllowMenu: string; viewSourceAllowOnce: string; viewSourceAllowTool: string; viewSourceAllowView: string; viewSourceAskBar: string; viewSourceAskTitle: string; viewSourceDetail: (target: string, state: string) => string; viewSourceDetails: string; viewSourceError: (reason: string, message: string) => string; viewSourceFailed: (name: string) => string; viewSourceFetched: (age: string) => string; viewSourceMore: (count: number) => string; viewSourceNeedsSignIn: (server: string) => string; viewSourceNoArgs: string; viewSourceNotNow: string; viewSourceOld: (age: string) => string; viewSourceReadOnly: string; viewSourceReason: (reason: ViewSourceFailure) => string; viewSourceSignIn: string; viewSourcesMenu: string; viewSourcesOff: string; viewSourceToolChanged: (server: string) => string; viewSourceToolNotAllowed: string; viewSourceWantMany: (count: number) => string; viewSourceWantsAccess: (server: string) => string; viewSourceWantsRun: string; viewSourceWantsSessions: string; viewStateControl: string; viewStateFailed: string; viewStateSearch: string; viewStateUnsupported: string; viewTitleField: string; viewTurnFailed: string; viewTurnIntoBlock: string; viewTurnIntoPanel: string; viewTurnOnHome: string; viewUnknown: (name: string) => string; viewUnpin: string; viewUnsave: string; viewUnsaveConfirm: string; viewUnsaveConfirmAction: string; viewUnsaveConfirmBody: string; viewUntitled: string; viewVersionOf: (version: number, latest: number) => string; viewVersionPick: string; viewYes: string }Returns
{ cancel: string; copiedShort: string; retry: string; viewActionDenied: string; viewActionFailed: string; viewActionRuns: (tool: string) => string; viewActions: string; viewActionSends: (text: string) => string; viewActionWaiting: string; viewChoiceOptions: string; viewCloseTab: string; viewCopyFailed: string; viewCopyImage: string; viewCopyText: string; viewCustomConsoleError: string; viewCustomEmpty: string; viewCustomFailed: string; viewCustomFrame: (title: string) => string; viewCustomImage: (title: string) => string; viewCustomOff: string; viewCustomOverflow: string; viewCustomRun: string; viewCustomSnapshot: (title: string) => string; viewCustomUnsupported: string; viewCustomWaiting: string; viewDeleteFailed: string; viewDrawing: string; viewErrors: string; viewExpand: string; viewFormNo: string; viewFormYes: string; viewFrame: (title: string) => string; viewImageHidden: (alt: string) => string; viewInPanel: string; viewInputsFailed: string; viewInputsOff: string; viewInputsPending: string; viewInputsSend: string; viewInputsSending: string; viewInputsSent: string; viewInputsUnsupported: string; viewInvalid: (name: string) => string; viewLinkDomain: (domain: string) => string; viewLive: (seconds: number) => string; viewLoadFailed: string; viewLoading: string; viewMcpAppAllow: string; viewMcpAppAllowed: (names: string) => string; viewMcpAppAsks: (names: string) => string; viewMcpAppDownloadBody: (server: string, size: string) => string; viewMcpAppDownloadSave: string; viewMcpAppDownloadTitle: (name: string) => string; viewMcpAppFailed: string; viewMcpAppFrame: (server: string, title: string) => string; viewMcpAppFrom: (server: string) => string; viewMcpAppOff: string; viewMcpAppPermission: (name: 'camera' | 'microphone' | 'geolocation' | 'clipboardWrite') => string; viewMcpAppRefused: string; viewMcpAppRun: string; viewMcpAppUiOff: string; viewMcpAppUnsupported: string; viewMcpAppWaiting: string; viewMissingRef: (ref: string) => string; viewNewerVersion: string; viewNo: string; viewOpenChat: string; viewOpenInArtifacts: string; viewOpenInChat: string; viewOpenPanel: string; viewPending: string; viewPin: string; viewPinFailed: string; viewPinnedHomeOff: string; viewRefresh: string; viewRefreshedAgo: (age: string) => string; viewRefreshedAt: (when: string) => string; viewRefreshFailed: string; viewRefreshing: string; viewRefreshUnsupported: string; viewRename: string; viewRenameFailed: string; viewRenameTitle: (title: string) => string; viewSave: string; viewSaved: string; viewSavedDelete: string; viewSaveFailed: string; viewSessionAgent: string; viewSessionAgentDefault: string; viewSessionAlways: string; viewSessionAnother: string; viewSessionArtifacts: string; viewSessionAsk: (verb: 'start' | 'send' | 'schedule' | 'command') => string; viewSessionChip: (status: string, title: string) => string; viewSessionCommand: string; viewSessionDraft: string; viewSessionFailed: string; viewSessionMore: string; viewSessionOnce: (verb: 'start' | 'send' | 'schedule' | 'command') => 'Start once' | 'Run once'; viewSessionOpen: string; viewSessionOpenToast: string; viewSessionPrompt: string; viewSessionRan: string; viewSessionScheduled: string; viewSessionSent: string; viewSessionStarted: (title: string) => string; viewSessionStartedDefault: (title: string, agent: string) => string; viewSessionStatus: (status: 'done' | 'failed' | 'running' | 'blocked') => string; viewSessionWhen: string; viewSessionWhere: string; viewSessionWhereBranch: (branch: string) => string; viewSessionWhereProject: string; viewShowLatest: string; viewShowOriginal: string; viewSourceAgo: (age: string) => string; viewSourceAllow: string; viewSourceAllowMenu: string; viewSourceAllowOnce: string; viewSourceAllowTool: string; viewSourceAllowView: string; viewSourceAskBar: string; viewSourceAskTitle: string; viewSourceDetail: (target: string, state: string) => string; viewSourceDetails: string; viewSourceError: (reason: string, message: string) => string; viewSourceFailed: (name: string) => string; viewSourceFetched: (age: string) => string; viewSourceMore: (count: number) => string; viewSourceNeedsSignIn: (server: string) => string; viewSourceNoArgs: string; viewSourceNotNow: string; viewSourceOld: (age: string) => string; viewSourceReadOnly: string; viewSourceReason: (reason: ViewSourceFailure) => string; viewSourceSignIn: string; viewSourcesMenu: string; viewSourcesOff: string; viewSourceToolChanged: (server: string) => string; viewSourceToolNotAllowed: string; viewSourceWantMany: (count: number) => string; viewSourceWantsAccess: (server: string) => string; viewSourceWantsRun: string; viewSourceWantsSessions: string; viewStateControl: string; viewStateFailed: string; viewStateSearch: string; viewStateUnsupported: string; viewTitleField: string; viewTurnFailed: string; viewTurnIntoBlock: string; viewTurnIntoPanel: string; viewTurnOnHome: string; viewUnknown: (name: string) => string; viewUnpin: string; viewUnsave: string; viewUnsaveConfirm: string; viewUnsaveConfirmAction: string; viewUnsaveConfirmBody: string; viewUntitled: string; viewVersionOf: (version: number, latest: number) => string; viewVersionPick: string; viewYes: string }useViewsMetaFunction#
zidane-ui/views: the views area (docs/VIEWS.md). It holds the provider
that puts a ViewsHost in context and the hooks that read it. The
components that draw a view load in their own chunk, the first time the
transcript draws a ```view fence with its views option on, so this
entry stays small for apps that mount the provider with views off.
function useViewsMeta(
host: ViewsHost | null,
sessionId: string | null,
): ViewsMetaState | nullParameters
| Name | Type | Description |
|---|---|---|
| host | ViewsHost | null | The views host, or |
| sessionId | string | null | The session, or |
Returns
ViewsMetaState | nullInterfaces#
ViewSessionDraftInterface#
A new chat a view's action fills, not sent.
interface ViewSessionDraftProperties
| Name | Type | Description |
|---|---|---|
| cwd | string | The project folder it runs in. |
| prompt | string | The filled prompt and its context block. |
| title? | string | The filled title, when the action has one. |
ViewSessionNavInterface#
What a view's session actions ask of the app. Each member is optional: its control hides without it.
interface ViewSessionNavProperties
| Name | Type | Description |
|---|---|---|
| openDraft? | (draft: ViewSessionDraft, from: ViewRef) => void | Opens the new-chat draft with this prompt in its composer, never sent. |
| openSession? | (sessionId: string, from: ViewRef) => void | Shows a session a view's action started or links to. |
ViewSessionNavProviderPropsInterface#
Props for ViewSessionNavProvider.
interface ViewSessionNavProviderPropsProperties
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The app. |
| value | ViewSessionNav | The app's way to open a session and a draft. Memoize it. |
ViewsProviderPropsInterface#
Props for ViewsProvider.
interface ViewsProviderPropsProperties
| Name | Type | Description |
|---|---|---|
| children | ReactNode | The app. |
| host | ViewsHost | Where the stored views come from. |