@uipath/apollo-vertex 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -21
- package/dist/entries/index.d.ts +96 -0
- package/dist/entries/index.js +72 -1
- package/dist/lib/i18n.d.ts +11 -0
- package/dist/lib/i18n.js +32 -2
- package/dist/lib/vertex-translation.d.ts +14 -0
- package/dist/lib/vertex-translation.js +4 -0
- package/dist/registry/ai-caveat/ai-caveat.js +2 -2
- package/dist/registry/ai-chat/charts/no-data-message.js +2 -2
- package/dist/registry/ai-chat/charts/tool-resolution-error.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-code-block.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-empty-state.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-error-banner.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-header.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-image-preview.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-input.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-loading.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-message-actions.js +3 -3
- package/dist/registry/ai-chat/components/ai-chat-message.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-pending-files.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-scroll-to-bottom-button.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat-selection-menu.js +2 -2
- package/dist/registry/ai-chat/components/ai-chat.js +2 -2
- package/dist/registry/bar-chart/bar-chart-with-adapter.js +2 -2
- package/dist/registry/breadcrumb/breadcrumb.js +2 -2
- package/dist/registry/carousel/carousel.js +3 -3
- package/dist/registry/charts-core/error-boundary.js +2 -2
- package/dist/registry/combobox/combobox.js +2 -2
- package/dist/registry/confidence-signal/confidence-signal.js +2 -2
- package/dist/registry/data-fabric-adapter/contract.d.ts +1 -1
- package/dist/registry/data-fabric-adapter/schemas/query-schema.d.ts +2 -2
- package/dist/registry/data-table/data-table-expand-toggle.js +2 -2
- package/dist/registry/data-table/data-table-pagination.js +2 -2
- package/dist/registry/data-table/data-table-search.js +2 -2
- package/dist/registry/data-table/data-table-view-options.js +2 -2
- package/dist/registry/data-table/data-table.js +2 -2
- package/dist/registry/date-picker/date-picker.js +2 -2
- package/dist/registry/dialog/dialog.js +2 -2
- package/dist/registry/distribution-chart/distribution-chart-with-adapter.js +2 -2
- package/dist/registry/filter-dropdown/filter-dropdown.js +2 -2
- package/dist/registry/form/use-translated-errors.js +2 -2
- package/dist/registry/form-wizard/form-wizard-nav.js +2 -2
- package/dist/registry/kpi-chart/kpi-chart-with-adapter.js +2 -2
- package/dist/registry/line-chart/line-chart-with-adapter.js +2 -2
- package/dist/registry/multi-line-chart/multi-line-chart-with-adapter.js +2 -2
- package/dist/registry/pagination/pagination.js +4 -4
- package/dist/registry/sheet/sheet.js +2 -2
- package/dist/registry/shell/group-membership-guard.js +1 -0
- package/dist/registry/shell/group-membership-screens.js +4 -3
- package/dist/registry/shell/shell-auth-provider.js +1 -0
- package/dist/registry/shell/shell-company.js +3 -3
- package/dist/registry/shell/shell-layout.js +1 -0
- package/dist/registry/shell/shell-locale-provider.js +3 -2
- package/dist/registry/shell/shell-login.js +3 -2
- package/dist/registry/shell/shell-sidebar.js +3 -2
- package/dist/registry/shell/shell-text.js +4 -2
- package/dist/registry/shell/shell-theme-provider.js +1 -0
- package/dist/registry/shell/shell-user-profile-menu-items.js +2 -2
- package/dist/registry/shell/shell-user-profile.js +2 -2
- package/dist/registry/shell/shell-user-provider.js +1 -0
- package/dist/registry/shell/shell.js +1 -0
- package/dist/registry/shell/use-group-id.js +1 -0
- package/dist/registry/shell/use-group-members.js +1 -0
- package/dist/registry/shell/use-is-group-member.js +1 -0
- package/dist/registry/sidebar/sidebar-trigger.js +2 -2
- package/dist/registry/sidebar/sidebar.js +2 -2
- package/dist/registry/solution-tests/baseline-compare.js +2 -2
- package/dist/registry/solution-tests/delete-confirm-dialog.js +2 -2
- package/dist/registry/solution-tests/evaluators/case-evaluation/case-evaluation-result.js +7 -7
- package/dist/registry/solution-tests/evaluators/generic-evaluator-result.js +2 -2
- package/dist/registry/solution-tests/evaluators/ixp-extraction/internal/document-row.js +3 -3
- package/dist/registry/solution-tests/evaluators/ixp-extraction/internal/field-group.js +2 -2
- package/dist/registry/solution-tests/evaluators/ixp-extraction/internal/provenance-bar.js +2 -2
- package/dist/registry/solution-tests/evaluators/ixp-extraction/internal/summary-bar.js +2 -2
- package/dist/registry/solution-tests/evaluators/ixp-extraction/internal/verdict-badge.js +2 -2
- package/dist/registry/solution-tests/evaluators/ixp-extraction/ixp-extraction-result.js +2 -2
- package/dist/registry/solution-tests/expanded-agents-view.js +2 -2
- package/dist/registry/solution-tests/expanded-run-tests-view.js +2 -2
- package/dist/registry/solution-tests/expanded-run-tests.js +2 -2
- package/dist/registry/solution-tests/kpi-bar.js +2 -2
- package/dist/registry/solution-tests/outputs/case-evaluation/case-evaluation-output.js +3 -3
- package/dist/registry/solution-tests/outputs/ixp-extraction/ixp-output-result.js +5 -5
- package/dist/registry/solution-tests/process-results-viewer-dialog.js +2 -2
- package/dist/registry/solution-tests/result-expanded-content.js +2 -2
- package/dist/registry/solution-tests/run-confirm-dialog.js +2 -2
- package/dist/registry/solution-tests/run-details-agent-list.js +2 -2
- package/dist/registry/solution-tests/run-details-view.js +4 -4
- package/dist/registry/solution-tests/run-details.js +2 -2
- package/dist/registry/solution-tests/save-as-test-button.js +2 -2
- package/dist/registry/solution-tests/solution-tests-view.js +2 -2
- package/dist/registry/solution-tests/solution-tests.js +2 -2
- package/dist/registry/solution-tests/user-messages-view.js +3 -3
- package/dist/registry/solution-tests/version-delta-glyph.js +2 -2
- package/dist/registry/table-chart/table-chart-view.js +2 -2
- package/dist/registry/table-chart/table-chart-with-adapter.js +2 -2
- package/package.json +18 -87
- package/skills/use-vertex-components/SKILL.md +168 -0
- package/dist/entries/ai-chat/index.d.ts +0 -17
- package/dist/entries/ai-chat/index.js +0 -14
- package/dist/entries/charts/index.d.ts +0 -10
- package/dist/entries/charts/index.js +0 -10
- package/dist/entries/feature-flags/index.d.ts +0 -5
- package/dist/entries/feature-flags/index.js +0 -5
- package/dist/entries/feature-flags/proteus.d.ts +0 -1
- package/dist/entries/feature-flags/proteus.js +0 -2
- package/dist/entries/shell/entities.d.ts +0 -6
- package/dist/entries/shell/entities.js +0 -8
- package/dist/entries/shell/index.d.ts +0 -14
- package/dist/entries/shell/index.js +0 -14
- package/dist/entries/solution-tests/data.d.ts +0 -6
- package/dist/entries/solution-tests/data.js +0 -6
- package/dist/entries/solution-tests/index.d.ts +0 -36
- package/dist/entries/solution-tests/index.js +0 -21
package/README.md
CHANGED
|
@@ -23,31 +23,24 @@ import { Button, DataTable } from "@uipath/apollo-vertex";
|
|
|
23
23
|
`tailwind.css` includes Tailwind, the Vertex theme and a `@source` for the package's built files. Use
|
|
24
24
|
`@uipath/apollo-vertex/theme.css` instead if you only want the theme variables.
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| `./solution-tests/data` | Solution Tests containers and hooks | `./solution-tests` packages, `@uipath/vs-core`, `@tanstack/react-db`, `@tanstack/react-query`, `@uipath/uipath-typescript` |
|
|
39
|
-
| `./ai-chat` | AI chat and data fabric chat tools | `@tanstack/ai`, `@tanstack/ai-client`, `@tanstack/react-query`, `@uipath/uipath-typescript`, `eventsource-parser`, `highlight.js`, `react-markdown`, `remark-breaks`, `remark-gfm`, `recharts`, `react-error-boundary`, `@ts-rest/core` |
|
|
40
|
-
| `./locales/*` | Translation JSON files | None |
|
|
41
|
-
|
|
42
|
-
`@uipath/vs-core`, `@uipath/proteus-client` and `@tanstack/react-db` are declared only in
|
|
43
|
-
`peerDependenciesMeta` (as optional) and not in `peerDependencies`, because they are not on the public
|
|
44
|
-
npm registry and pnpm would try to install them in this workspace. The host app provides them.
|
|
26
|
+
Everything, including the app shell, charts, feature flags, Solution Tests and AI chat, is exported
|
|
27
|
+
from the package root. Translation JSON files are available at `@uipath/apollo-vertex/locales/*`.
|
|
28
|
+
|
|
29
|
+
npm 7+ and pnpm install the packages in `peerDependencies` automatically. Install these three
|
|
30
|
+
yourself, because they are not on the public npm registry:
|
|
31
|
+
|
|
32
|
+
- `@uipath/vs-core`
|
|
33
|
+
- `@tanstack/react-db`
|
|
34
|
+
- `@uipath/proteus-client`
|
|
35
|
+
|
|
36
|
+
They are declared only in `peerDependenciesMeta` (as optional) so that pnpm does not try to install them
|
|
37
|
+
in this workspace.
|
|
45
38
|
|
|
46
39
|
## Layout
|
|
47
40
|
|
|
48
41
|
```text
|
|
49
42
|
packages/apollo-vertex/
|
|
50
|
-
├── entries/ # Public API
|
|
43
|
+
├── entries/ # Public API barrel (index.ts)
|
|
51
44
|
├── registry/ # Component sources, one directory per registry item
|
|
52
45
|
├── registry.json # shadcn registry manifest (items, files, theme tokens)
|
|
53
46
|
├── lib/ # Helpers shipped with registry items (cn, asserts, i18n, auth)
|
|
@@ -76,6 +69,6 @@ pnpm format # Biome
|
|
|
76
69
|
1. Create the component in `registry/<component>/<component>.tsx`.
|
|
77
70
|
2. Add a `@/components/ui/<component>` alias to `tsconfig.json` if other components import it.
|
|
78
71
|
3. Add the item to `registry.json`.
|
|
79
|
-
4. Export it from
|
|
72
|
+
4. Export it from `entries/index.ts`.
|
|
80
73
|
5. Document it in `apps/apollo-vertex/content/docs/components/<component>.mdx`.
|
|
81
74
|
6. Run `pnpm build` and `pnpm --filter apollo-vertex registry:build` to check both outputs.
|
package/dist/entries/index.d.ts
CHANGED
|
@@ -67,3 +67,99 @@ export * from "../registry/timeline";
|
|
|
67
67
|
export { useIsMobile } from "../registry/use-mobile/use-mobile";
|
|
68
68
|
export { type UseDataTableOptions, useDataTable, } from "../registry/use-data-table/useDataTable";
|
|
69
69
|
export { cn } from "../lib/utils";
|
|
70
|
+
export { addVertexTranslations } from "../lib/i18n";
|
|
71
|
+
export * from "../registry/chart/chart";
|
|
72
|
+
export * from "../registry/bar-chart/bar-chart";
|
|
73
|
+
export * from "../registry/distribution-chart/distribution-chart";
|
|
74
|
+
export * from "../registry/kpi-chart/kpi-chart";
|
|
75
|
+
export * from "../registry/line-chart/line-chart";
|
|
76
|
+
export * from "../registry/multi-line-chart/multi-line-chart";
|
|
77
|
+
export * from "../registry/table-chart/table-chart";
|
|
78
|
+
export * from "../registry/charts-core/charts-core";
|
|
79
|
+
export * from "../registry/data-fabric-adapter/data-fabric-adapter";
|
|
80
|
+
export * from "../registry/insights-adapter/insights-adapter";
|
|
81
|
+
export { ApolloShell, type ApolloShellProps, type CompanyLogo, type ShellNavItem, type ShellSubNavItem, } from "../registry/shell/shell";
|
|
82
|
+
export { AuthContext, ShellAuthProvider, useAuth, type AuthContextValue, type UserInfo, } from "../registry/shell/shell-auth-provider";
|
|
83
|
+
export { LocaleProvider } from "../registry/shell/shell-locale-provider";
|
|
84
|
+
export { ThemeProvider } from "../registry/shell/shell-theme-provider";
|
|
85
|
+
export { MembershipDenied, VerifyingMembership, type MembershipDeniedProps, } from "../registry/shell/group-membership-screens";
|
|
86
|
+
export { Role } from "../registry/shell/shell-roles";
|
|
87
|
+
export { useAccessToken } from "../registry/shell/shell-auth-provider";
|
|
88
|
+
export { useTheme } from "../registry/shell/shell-theme-provider";
|
|
89
|
+
export { ShellLogin } from "../registry/shell/shell-login";
|
|
90
|
+
export { ShellLayout } from "../registry/shell/shell-layout";
|
|
91
|
+
export { ShellSidebar } from "../registry/shell/shell-sidebar";
|
|
92
|
+
export { ShellUserProvider } from "../registry/shell/shell-user-provider";
|
|
93
|
+
export { SUPPORTED_LOCALES, configurei18n, type SupportedLocale, } from "../lib/i18n";
|
|
94
|
+
export { STORAGE_KEYS, TOKEN_QUERY_KEY, ensureValidToken, login, logout, resolveReturnPath, toCodedAppFilePath, } from "../lib/auth";
|
|
95
|
+
export { GroupMembershipGuard } from "../registry/shell/group-membership-guard";
|
|
96
|
+
export { useGroupId } from "../registry/shell/use-group-id";
|
|
97
|
+
export { useGroupMembers } from "../registry/shell/use-group-members";
|
|
98
|
+
export { useIsGroupMember } from "../registry/shell/use-is-group-member";
|
|
99
|
+
export { useEntityDataTable } from "../registry/use-data-table/useEntityDataTable";
|
|
100
|
+
export { useEntityColumns } from "../registry/use-data-table/useEntityColumns";
|
|
101
|
+
export { FeatureFlagContext, FeatureFlagProvider, useFeatureFlagProvider, } from "../registry/feature-flag-provider/feature-flag-provider";
|
|
102
|
+
export { FeatureFlagGuard } from "../registry/feature-flag-guard/feature-flag-guard";
|
|
103
|
+
export { ProtectedFeatureRoute } from "../registry/protected-feature-route/protected-feature-route";
|
|
104
|
+
export { useFeatureFlag } from "../registry/use-feature-flag/use-feature-flag";
|
|
105
|
+
export type { FeatureFlagProviderConfig, FeatureFlagUserContext, } from "../registry/feature-flag-provider/types";
|
|
106
|
+
export { createProteusProvider, type FlagMapping, type ProteusFeatureFlagValues, } from "../registry/feature-flag-provider/proteus-adapter";
|
|
107
|
+
export { SolutionTestsView } from "../registry/solution-tests/solution-tests-view";
|
|
108
|
+
export type { SolutionTestsViewProps } from "../registry/solution-tests/solution-tests-view";
|
|
109
|
+
export { SaveAsTestButton } from "../registry/solution-tests/save-as-test-button";
|
|
110
|
+
export { SolutionTestActionError } from "../registry/solution-tests/errors";
|
|
111
|
+
export type { ActionFailure } from "../registry/solution-tests/errors";
|
|
112
|
+
export { SolutionTestsProvider, useSolutionTestsContext, useSolutionTestsConfig, } from "../registry/solution-tests/context";
|
|
113
|
+
export type { SolutionTestsConfig, ResolvedSolutionTestsConfig, SolutionTestEventMap, SolutionTestEventName, TrackSolutionTestEvent, } from "../registry/solution-tests/config";
|
|
114
|
+
export { makeRenderer, genericRenderer, resolveEvaluatorRenderer, GENERIC_RENDERER, JSON_SIMILARITY_EVALUATOR_ID, LLM_JUDGE_EVALUATOR_ID, IXP_EXTRACTION_EVALUATOR_ID, CASE_EVALUATION_EVALUATOR_ID, } from "../registry/solution-tests/evaluators/registry";
|
|
115
|
+
export type { EvaluatorRenderer, EvaluatorRenderers, EvaluatorRenderArgs, EvaluatorResultProps, } from "../registry/solution-tests/evaluators/registry";
|
|
116
|
+
export { makeProcessOutputRenderer, resolveProcessOutputRenderer, } from "../registry/solution-tests/outputs/registry";
|
|
117
|
+
export type { ProcessOutputRenderer, ProcessOutputRenderers, ProcessOutputRenderArgs, ProcessOutputProps, } from "../registry/solution-tests/outputs/registry";
|
|
118
|
+
export { ProcessOutputView } from "../registry/solution-tests/outputs/process-output-view";
|
|
119
|
+
export { BaselineCompare } from "../registry/solution-tests/baseline-compare";
|
|
120
|
+
export type { BaselineCompareRow } from "../registry/solution-tests/baseline-compare";
|
|
121
|
+
export { VersionDeltaGlyph } from "../registry/solution-tests/version-delta-glyph";
|
|
122
|
+
export { versionDelta } from "../registry/solution-tests/utils";
|
|
123
|
+
export type { VersionDelta } from "../registry/solution-tests/utils";
|
|
124
|
+
export { IxpOutputResult, IXP_OUTPUT_RENDERER, } from "../registry/solution-tests/outputs/ixp-extraction/ixp-output-result";
|
|
125
|
+
export { IxpOutputSchema } from "../registry/solution-tests/outputs/ixp-extraction/schema";
|
|
126
|
+
export { CaseEvaluationOutputResult, CASE_EVALUATION_OUTPUT_RENDERER, } from "../registry/solution-tests/outputs/case-evaluation/case-evaluation-output";
|
|
127
|
+
export { CaseEvaluationOutputSchema } from "../registry/solution-tests/outputs/case-evaluation/schema";
|
|
128
|
+
export type { CaseEvaluationOutput, EvaluationRecord, } from "../registry/solution-tests/outputs/case-evaluation/schema";
|
|
129
|
+
export type { IxpOutput, IxpDocumentExtraction, IxpExtractionGroup, IxpFieldValue, } from "../registry/solution-tests/outputs/ixp-extraction/schema";
|
|
130
|
+
export { SolutionTestStatus, RunStatus, RunResultStatus, JobRole, } from "../registry/solution-tests/types";
|
|
131
|
+
export type { SolutionTest, SolutionTestJob, SolutionTestRun, SolutionTestBatchRun, SolutionTestRunResult, UserMessageItem, ResultAttachmentField, } from "../registry/solution-tests/types";
|
|
132
|
+
export type { RunConfirmTarget } from "../registry/solution-tests/solution-tests-view";
|
|
133
|
+
export { RunDetailsView } from "../registry/solution-tests/run-details-view";
|
|
134
|
+
export type { BaselineJobMap, RunDetailsViewProps, } from "../registry/solution-tests/run-details-view";
|
|
135
|
+
export { ExpandedAgentsView } from "../registry/solution-tests/expanded-agents-view";
|
|
136
|
+
export type { ExpandedAgentsViewProps } from "../registry/solution-tests/expanded-agents-view";
|
|
137
|
+
export { ExpandedRunTestsView } from "../registry/solution-tests/expanded-run-tests-view";
|
|
138
|
+
export type { ExpandedRunTestsViewProps } from "../registry/solution-tests/expanded-run-tests-view";
|
|
139
|
+
export { CaseEvaluationDetailsSchema, EvaluationPairStatus, SummaryVerdict, } from "../registry/solution-tests/evaluators/case-evaluation/schema";
|
|
140
|
+
export type { CaseEvaluationDetails, EvaluationPair, EvaluationView, } from "../registry/solution-tests/evaluators/case-evaluation/schema";
|
|
141
|
+
export { IxpDetailsSchema, IxpDocStatus, IxpVerdict, } from "../registry/solution-tests/evaluators/ixp-extraction/schema";
|
|
142
|
+
export type { IxpDetails, IxpDocument, IxpField, IxpProvenance, IxpVerdictValue, } from "../registry/solution-tests/evaluators/ixp-extraction/schema";
|
|
143
|
+
export { SolutionTests } from "../registry/solution-tests/solution-tests";
|
|
144
|
+
export { RunDetails } from "../registry/solution-tests/run-details";
|
|
145
|
+
export { useSolutionTests, useSolutionTestBatchRuns, useSolutionTestRuns, useBaselineJobs, useRunResults, useRunTests, useCreateTest, useToggleTestActive, useDeleteTest, useForceStopBatch, useForceStopRun, useAdoptJob, useUpdateBaseline, useRemoveJobBaseline, useJobExpectedOutput, useResultAttachment, } from "../registry/solution-tests/hooks";
|
|
146
|
+
export type { UseSolutionTestsResult, UseSolutionTestBatchRunsResult, UseSolutionTestRunsResult, UseBaselineJobsResult, UseRunResultsResult, MutationHook, AttachmentFetcher, } from "../registry/solution-tests/hooks";
|
|
147
|
+
export { ExpandedAgents } from "../registry/solution-tests/expanded-agents";
|
|
148
|
+
export { ExpandedRunTests } from "../registry/solution-tests/expanded-run-tests";
|
|
149
|
+
export { createAgentHubConnection } from "../registry/ai-chat/adapters/agenthub/adapter";
|
|
150
|
+
export type { AgentHubAdapterConfig, AgentHubVendor, } from "../registry/ai-chat/adapters/agenthub/adapter";
|
|
151
|
+
export { createConversationalAgentConnection } from "../registry/ai-chat/adapters/conversational-agent/adapter";
|
|
152
|
+
export type { ConversationalAgentAdapterConfig } from "../registry/ai-chat/adapters/conversational-agent/adapter";
|
|
153
|
+
export { AiChat } from "../registry/ai-chat/components/ai-chat";
|
|
154
|
+
export { AiChatEmptyState } from "../registry/ai-chat/components/ai-chat-empty-state";
|
|
155
|
+
export { AutopilotGradientIcon } from "../registry/ai-chat/components/icons/autopilot-gradient";
|
|
156
|
+
export * from "../registry/ai-chat/tools/choices";
|
|
157
|
+
export type { Entity } from "../registry/ai-chat/tools/data-fabric/util/entities";
|
|
158
|
+
export * from "../registry/ai-chat/tools/data-fabric-bar";
|
|
159
|
+
export * from "../registry/ai-chat/tools/data-fabric-distribution";
|
|
160
|
+
export * from "../registry/ai-chat/tools/data-fabric-kpi";
|
|
161
|
+
export * from "../registry/ai-chat/tools/data-fabric-line";
|
|
162
|
+
export * from "../registry/ai-chat/tools/data-fabric-multi-line";
|
|
163
|
+
export * from "../registry/ai-chat/tools/data-fabric-table";
|
|
164
|
+
export * from "../registry/ai-chat/tools/data-fabric";
|
|
165
|
+
export type { MessageFeedbackType } from "../registry/ai-chat/types";
|
package/dist/entries/index.js
CHANGED
|
@@ -2,6 +2,59 @@ import { CheckboxField, RadioGroupField, SelectField, SubmitButton, SwitchField,
|
|
|
2
2
|
import { useIsMobile } from "../registry/use-mobile/use-mobile.js";
|
|
3
3
|
import { useDataTable } from "../registry/use-data-table/useDataTable.js";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { SUPPORTED_LOCALES, addVertexTranslations, configurei18n } from "../lib/i18n.js";
|
|
6
|
+
import { ApolloShell } from "../registry/shell/shell.js";
|
|
7
|
+
import { AuthContext, ShellAuthProvider, useAccessToken, useAuth } from "../registry/shell/shell-auth-provider.js";
|
|
8
|
+
import { LocaleProvider } from "../registry/shell/shell-locale-provider.js";
|
|
9
|
+
import { ThemeProvider, useTheme } from "../registry/shell/shell-theme-provider.js";
|
|
10
|
+
import { MembershipDenied, VerifyingMembership } from "../registry/shell/group-membership-screens.js";
|
|
11
|
+
import { Role } from "../registry/shell/shell-roles.js";
|
|
12
|
+
import { ShellLogin } from "../registry/shell/shell-login.js";
|
|
13
|
+
import { ShellLayout } from "../registry/shell/shell-layout.js";
|
|
14
|
+
import { ShellSidebar } from "../registry/shell/shell-sidebar.js";
|
|
15
|
+
import { ShellUserProvider } from "../registry/shell/shell-user-provider.js";
|
|
16
|
+
import { STORAGE_KEYS, TOKEN_QUERY_KEY, ensureValidToken, login, logout, resolveReturnPath, toCodedAppFilePath } from "../lib/auth.js";
|
|
17
|
+
import { GroupMembershipGuard } from "../registry/shell/group-membership-guard.js";
|
|
18
|
+
import { useGroupId } from "../registry/shell/use-group-id.js";
|
|
19
|
+
import { useGroupMembers } from "../registry/shell/use-group-members.js";
|
|
20
|
+
import { useIsGroupMember } from "../registry/shell/use-is-group-member.js";
|
|
21
|
+
import { useEntityDataTable } from "../registry/use-data-table/useEntityDataTable.js";
|
|
22
|
+
import { useEntityColumns } from "../registry/use-data-table/useEntityColumns.js";
|
|
23
|
+
import { FeatureFlagContext, FeatureFlagProvider, useFeatureFlagProvider } from "../registry/feature-flag-provider/feature-flag-provider.js";
|
|
24
|
+
import { FeatureFlagGuard } from "../registry/feature-flag-guard/feature-flag-guard.js";
|
|
25
|
+
import { ProtectedFeatureRoute } from "../registry/protected-feature-route/protected-feature-route.js";
|
|
26
|
+
import { useFeatureFlag } from "../registry/use-feature-flag/use-feature-flag.js";
|
|
27
|
+
import { createProteusProvider } from "../registry/feature-flag-provider/proteus-adapter.js";
|
|
28
|
+
import { SolutionTestsView } from "../registry/solution-tests/solution-tests-view.js";
|
|
29
|
+
import { SaveAsTestButton } from "../registry/solution-tests/save-as-test-button.js";
|
|
30
|
+
import { SolutionTestActionError } from "../registry/solution-tests/errors.js";
|
|
31
|
+
import { SolutionTestsProvider, useSolutionTestsConfig, useSolutionTestsContext } from "../registry/solution-tests/context.js";
|
|
32
|
+
import { CASE_EVALUATION_EVALUATOR_ID, GENERIC_RENDERER, IXP_EXTRACTION_EVALUATOR_ID, JSON_SIMILARITY_EVALUATOR_ID, LLM_JUDGE_EVALUATOR_ID, genericRenderer, makeRenderer, resolveEvaluatorRenderer } from "../registry/solution-tests/evaluators/registry.js";
|
|
33
|
+
import { makeProcessOutputRenderer, resolveProcessOutputRenderer } from "../registry/solution-tests/outputs/registry.js";
|
|
34
|
+
import { ProcessOutputView } from "../registry/solution-tests/outputs/process-output-view.js";
|
|
35
|
+
import { BaselineCompare } from "../registry/solution-tests/baseline-compare.js";
|
|
36
|
+
import { VersionDeltaGlyph } from "../registry/solution-tests/version-delta-glyph.js";
|
|
37
|
+
import { versionDelta } from "../registry/solution-tests/utils.js";
|
|
38
|
+
import { IXP_OUTPUT_RENDERER, IxpOutputResult } from "../registry/solution-tests/outputs/ixp-extraction/ixp-output-result.js";
|
|
39
|
+
import { IxpOutputSchema } from "../registry/solution-tests/outputs/ixp-extraction/schema.js";
|
|
40
|
+
import { CASE_EVALUATION_OUTPUT_RENDERER, CaseEvaluationOutputResult } from "../registry/solution-tests/outputs/case-evaluation/case-evaluation-output.js";
|
|
41
|
+
import { CaseEvaluationOutputSchema } from "../registry/solution-tests/outputs/case-evaluation/schema.js";
|
|
42
|
+
import { JobRole, RunResultStatus, RunStatus, SolutionTestStatus } from "../registry/solution-tests/types.js";
|
|
43
|
+
import { RunDetailsView } from "../registry/solution-tests/run-details-view.js";
|
|
44
|
+
import { ExpandedAgentsView } from "../registry/solution-tests/expanded-agents-view.js";
|
|
45
|
+
import { ExpandedRunTestsView } from "../registry/solution-tests/expanded-run-tests-view.js";
|
|
46
|
+
import { CaseEvaluationDetailsSchema, EvaluationPairStatus, SummaryVerdict } from "../registry/solution-tests/evaluators/case-evaluation/schema.js";
|
|
47
|
+
import { IxpDetailsSchema, IxpDocStatus, IxpVerdict } from "../registry/solution-tests/evaluators/ixp-extraction/schema.js";
|
|
48
|
+
import { SolutionTests } from "../registry/solution-tests/solution-tests.js";
|
|
49
|
+
import { RunDetails } from "../registry/solution-tests/run-details.js";
|
|
50
|
+
import { useAdoptJob, useBaselineJobs, useCreateTest, useDeleteTest, useForceStopBatch, useForceStopRun, useJobExpectedOutput, useRemoveJobBaseline, useResultAttachment, useRunResults, useRunTests, useSolutionTestBatchRuns, useSolutionTestRuns, useSolutionTests, useToggleTestActive, useUpdateBaseline } from "../registry/solution-tests/hooks.js";
|
|
51
|
+
import { ExpandedAgents } from "../registry/solution-tests/expanded-agents.js";
|
|
52
|
+
import { ExpandedRunTests } from "../registry/solution-tests/expanded-run-tests.js";
|
|
53
|
+
import { createAgentHubConnection } from "../registry/ai-chat/adapters/agenthub/adapter.js";
|
|
54
|
+
import { createConversationalAgentConnection } from "../registry/ai-chat/adapters/conversational-agent/adapter.js";
|
|
55
|
+
import { AiChat } from "../registry/ai-chat/components/ai-chat.js";
|
|
56
|
+
import { AiChatEmptyState } from "../registry/ai-chat/components/ai-chat-empty-state.js";
|
|
57
|
+
import { AutopilotGradientIcon } from "../registry/ai-chat/components/icons/autopilot-gradient.js";
|
|
5
58
|
export * from "../registry/accordion/accordion.js";
|
|
6
59
|
export * from "../registry/ai-caveat/ai-caveat.js";
|
|
7
60
|
export * from "../registry/ai-glow/ai-glow.js";
|
|
@@ -67,4 +120,22 @@ export * from "../registry/onboarding-tour-joyride/index.js";
|
|
|
67
120
|
export * from "../registry/sidebar/sidebar.js";
|
|
68
121
|
export * from "../registry/stepper/index.js";
|
|
69
122
|
export * from "../registry/timeline/index.js";
|
|
70
|
-
export
|
|
123
|
+
export * from "../registry/chart/chart.js";
|
|
124
|
+
export * from "../registry/bar-chart/bar-chart.js";
|
|
125
|
+
export * from "../registry/distribution-chart/distribution-chart.js";
|
|
126
|
+
export * from "../registry/kpi-chart/kpi-chart.js";
|
|
127
|
+
export * from "../registry/line-chart/line-chart.js";
|
|
128
|
+
export * from "../registry/multi-line-chart/multi-line-chart.js";
|
|
129
|
+
export * from "../registry/table-chart/table-chart.js";
|
|
130
|
+
export * from "../registry/charts-core/charts-core.js";
|
|
131
|
+
export * from "../registry/data-fabric-adapter/data-fabric-adapter.js";
|
|
132
|
+
export * from "../registry/insights-adapter/insights-adapter.js";
|
|
133
|
+
export * from "../registry/ai-chat/tools/choices/index.js";
|
|
134
|
+
export * from "../registry/ai-chat/tools/data-fabric-bar/index.js";
|
|
135
|
+
export * from "../registry/ai-chat/tools/data-fabric-distribution/index.js";
|
|
136
|
+
export * from "../registry/ai-chat/tools/data-fabric-kpi/index.js";
|
|
137
|
+
export * from "../registry/ai-chat/tools/data-fabric-line/index.js";
|
|
138
|
+
export * from "../registry/ai-chat/tools/data-fabric-multi-line/index.js";
|
|
139
|
+
export * from "../registry/ai-chat/tools/data-fabric-table/index.js";
|
|
140
|
+
export * from "../registry/ai-chat/tools/data-fabric/index.js";
|
|
141
|
+
export { AiChat, AiChatEmptyState, ApolloShell, AuthContext, AutopilotGradientIcon, BaselineCompare, CASE_EVALUATION_EVALUATOR_ID, CASE_EVALUATION_OUTPUT_RENDERER, CaseEvaluationDetailsSchema, CaseEvaluationOutputResult, CaseEvaluationOutputSchema, CheckboxField, EvaluationPairStatus, ExpandedAgents, ExpandedAgentsView, ExpandedRunTests, ExpandedRunTestsView, FeatureFlagContext, FeatureFlagGuard, FeatureFlagProvider, GENERIC_RENDERER, GroupMembershipGuard, IXP_EXTRACTION_EVALUATOR_ID, IXP_OUTPUT_RENDERER, IxpDetailsSchema, IxpDocStatus, IxpOutputResult, IxpOutputSchema, IxpVerdict, JSON_SIMILARITY_EVALUATOR_ID, JobRole, LLM_JUDGE_EVALUATOR_ID, LocaleProvider, MembershipDenied, ProcessOutputView, ProtectedFeatureRoute, RadioGroupField, Role, RunDetails, RunDetailsView, RunResultStatus, RunStatus, STORAGE_KEYS, SUPPORTED_LOCALES, SaveAsTestButton, SelectField, ShellAuthProvider, ShellLayout, ShellLogin, ShellSidebar, ShellUserProvider, SolutionTestActionError, SolutionTestStatus, SolutionTests, SolutionTestsProvider, SolutionTestsView, SubmitButton, SummaryVerdict, SwitchField, TOKEN_QUERY_KEY, TextField, TextareaField, ThemeProvider, VerifyingMembership, VersionDeltaGlyph, addVertexTranslations, cn, configurei18n, createAgentHubConnection, createConversationalAgentConnection, createProteusProvider, ensureValidToken, genericRenderer, login, logout, makeProcessOutputRenderer, makeRenderer, resolveEvaluatorRenderer, resolveProcessOutputRenderer, resolveReturnPath, toCodedAppFilePath, useAccessToken, useAdoptJob, useAppForm, useAuth, useBaselineJobs, useCreateTest, useDataTable, useDeleteTest, useEntityColumns, useEntityDataTable, useFeatureFlag, useFeatureFlagProvider, useFieldContext, useForceStopBatch, useForceStopRun, useFormContext, useGroupId, useGroupMembers, useIsGroupMember, useIsMobile, useJobExpectedOutput, useRemoveJobBaseline, useResultAttachment, useRunResults, useRunTests, useSolutionTestBatchRuns, useSolutionTestRuns, useSolutionTests, useSolutionTestsConfig, useSolutionTestsContext, useTheme, useToggleTestActive, useTranslatedErrors, useUpdateBaseline, versionDelta, withForm };
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { i18n as I18n } from "i18next";
|
|
1
2
|
declare const localeLoaders: {
|
|
2
3
|
readonly en: () => Promise<{
|
|
3
4
|
default: {
|
|
@@ -8812,5 +8813,15 @@ declare const localeLoaders: {
|
|
|
8812
8813
|
};
|
|
8813
8814
|
export type SupportedLocale = keyof typeof localeLoaders;
|
|
8814
8815
|
export declare const SUPPORTED_LOCALES: SupportedLocale[];
|
|
8816
|
+
/**
|
|
8817
|
+
* Adds the translations bundled with Apollo Vertex to an existing i18next
|
|
8818
|
+
* instance, under the `apollo-vertex` namespace. Use this when the app sets up
|
|
8819
|
+
* i18next itself instead of using `LocaleProvider`.
|
|
8820
|
+
*
|
|
8821
|
+
* Loads the current language and its fallbacks up front, and loads other
|
|
8822
|
+
* languages when the app switches to them. Returns a function that stops
|
|
8823
|
+
* listening.
|
|
8824
|
+
*/
|
|
8825
|
+
export declare const addVertexTranslations: (instance: I18n) => Promise<() => void>;
|
|
8815
8826
|
export declare const configurei18n: () => Promise<void>;
|
|
8816
8827
|
export {};
|
package/dist/lib/i18n.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import i18next from "i18next";
|
|
2
2
|
import { initReactI18next } from "react-i18next";
|
|
3
|
+
import { VERTEX_NAMESPACE } from "./vertex-translation.js";
|
|
3
4
|
const localeLoaders = {
|
|
4
5
|
en: ()=>import("../locales/en.json"),
|
|
5
6
|
de: ()=>import("../locales/de.json"),
|
|
@@ -18,11 +19,35 @@ const localeLoaders = {
|
|
|
18
19
|
};
|
|
19
20
|
const SUPPORTED_LOCALES = Object.keys(localeLoaders);
|
|
20
21
|
const DEFAULT_LOCALE = "en";
|
|
22
|
+
const isSupportedLocale = (language)=>language in localeLoaders;
|
|
23
|
+
const loadVertexLocale = async (instance, language)=>{
|
|
24
|
+
if (!isSupportedLocale(language) || instance.hasResourceBundle(language, VERTEX_NAMESPACE)) return false;
|
|
25
|
+
const { default: translations } = await localeLoaders[language]();
|
|
26
|
+
instance.addResourceBundle(language, VERTEX_NAMESPACE, translations);
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
const addVertexTranslations = async (instance)=>{
|
|
30
|
+
const loadCurrentLanguages = async ()=>{
|
|
31
|
+
const added = await Promise.all([
|
|
32
|
+
...instance.languages,
|
|
33
|
+
DEFAULT_LOCALE
|
|
34
|
+
].map((language)=>loadVertexLocale(instance, language)));
|
|
35
|
+
return added.includes(true);
|
|
36
|
+
};
|
|
37
|
+
const handleLanguageChanged = (language)=>{
|
|
38
|
+
loadCurrentLanguages().then((added)=>{
|
|
39
|
+
if (added && instance.language === language) return instance.changeLanguage(language);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
instance.on("languageChanged", handleLanguageChanged);
|
|
43
|
+
await loadCurrentLanguages();
|
|
44
|
+
return ()=>instance.off("languageChanged", handleLanguageChanged);
|
|
45
|
+
};
|
|
21
46
|
const configurei18n = async ()=>{
|
|
22
47
|
await i18next.use({
|
|
23
48
|
type: "backend",
|
|
24
49
|
async read (language, _namespace, callback) {
|
|
25
|
-
if (!(language
|
|
50
|
+
if (!isSupportedLocale(language)) return void callback(new Error(`Locale not found: ${language}`), null);
|
|
26
51
|
const loadLocale = localeLoaders[language];
|
|
27
52
|
try {
|
|
28
53
|
const module = await loadLocale();
|
|
@@ -35,8 +60,13 @@ const configurei18n = async ()=>{
|
|
|
35
60
|
fallbackLng: DEFAULT_LOCALE,
|
|
36
61
|
lng: DEFAULT_LOCALE,
|
|
37
62
|
supportedLngs: SUPPORTED_LOCALES,
|
|
63
|
+
ns: [
|
|
64
|
+
"translation",
|
|
65
|
+
VERTEX_NAMESPACE
|
|
66
|
+
],
|
|
67
|
+
defaultNS: "translation",
|
|
38
68
|
returnNull: false
|
|
39
69
|
});
|
|
40
70
|
document.documentElement.lang = i18next.language;
|
|
41
71
|
};
|
|
42
|
-
export { SUPPORTED_LOCALES, configurei18n };
|
|
72
|
+
export { SUPPORTED_LOCALES, addVertexTranslations, configurei18n };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** i18next namespace that Apollo Vertex components read their strings from. */
|
|
2
|
+
export declare const VERTEX_NAMESPACE = "apollo-vertex";
|
|
3
|
+
/**
|
|
4
|
+
* `useTranslation` bound to the vertex namespace. Internal to vertex
|
|
5
|
+
* components: apps never read vertex strings themselves.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useVertexTranslation: () => {
|
|
8
|
+
t: import("./react-i18next").TranslationFn;
|
|
9
|
+
i18n: {
|
|
10
|
+
exists: (key: string) => key is import("react-i18next").ParseKeys;
|
|
11
|
+
changeLanguage: (locale: string) => void;
|
|
12
|
+
language: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Info } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
function AiCaveat({ variant = "standalone", children, className }) {
|
|
7
|
-
const { t } =
|
|
7
|
+
const { t } = useVertexTranslation();
|
|
8
8
|
const defaultCopy = t("ai_caveat_default", {
|
|
9
9
|
defaultValue: "The output is AI generated. Please review."
|
|
10
10
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
4
4
|
function NoDataMessage() {
|
|
5
|
-
const { t } =
|
|
5
|
+
const { t } = useVertexTranslation();
|
|
6
6
|
return /*#__PURE__*/ jsx("p", {
|
|
7
7
|
className: "text-sm text-muted-foreground",
|
|
8
8
|
children: t("no_results")
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AlertTriangle } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
5
5
|
function ToolResolutionError({ failure }) {
|
|
6
|
-
const { t } =
|
|
6
|
+
const { t } = useVertexTranslation();
|
|
7
7
|
const { reason, ...params } = failure;
|
|
8
8
|
return /*#__PURE__*/ jsx("div", {
|
|
9
9
|
role: "alert",
|
|
@@ -13,7 +13,7 @@ import typescript from "highlight.js/lib/languages/typescript";
|
|
|
13
13
|
import xml from "highlight.js/lib/languages/xml";
|
|
14
14
|
import { Check, Copy } from "lucide-react";
|
|
15
15
|
import { useEffect, useRef } from "react";
|
|
16
|
-
import {
|
|
16
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
17
17
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../tooltip/tooltip.js";
|
|
18
18
|
import { cn } from "../../../lib/utils.js";
|
|
19
19
|
const DARK_HLJS_STYLE = `
|
|
@@ -86,7 +86,7 @@ core.registerLanguage("html", xml);
|
|
|
86
86
|
core.registerLanguage("xml", xml);
|
|
87
87
|
core.registerLanguage("sql", sql);
|
|
88
88
|
function AiChatCodeBlock({ children, language }) {
|
|
89
|
-
const { t } =
|
|
89
|
+
const { t } = useVertexTranslation();
|
|
90
90
|
const { copied, error, copy } = useClipboard({
|
|
91
91
|
timeout: 2000
|
|
92
92
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
4
4
|
function AiChatEmptyState({ title, description, icon }) {
|
|
5
|
-
const { t } =
|
|
5
|
+
const { t } = useVertexTranslation();
|
|
6
6
|
const displayTitle = title ?? t("how_can_i_help_you");
|
|
7
7
|
return /*#__PURE__*/ jsxs("div", {
|
|
8
8
|
className: "flex flex-col items-center justify-center h-full text-center text-ai-chat-muted-foreground gap-4",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AlertCircle, RefreshCw } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
5
5
|
import { Button } from "../../button/button.js";
|
|
6
6
|
function AiChatErrorBanner({ message, onRetry }) {
|
|
7
|
-
const { t } =
|
|
7
|
+
const { t } = useVertexTranslation();
|
|
8
8
|
return /*#__PURE__*/ jsxs("div", {
|
|
9
9
|
role: "alert",
|
|
10
10
|
"aria-live": "assertive",
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useClipboard } from "@mantine/hooks";
|
|
4
4
|
import { MoreHorizontal } from "lucide-react";
|
|
5
|
-
import {
|
|
5
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
6
6
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../alert-dialog/alert-dialog.js";
|
|
7
7
|
import { Button } from "../../button/button.js";
|
|
8
8
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../dropdown-menu/dropdown-menu.js";
|
|
9
9
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../tooltip/tooltip.js";
|
|
10
10
|
import { AutopilotGradientIcon } from "./icons/autopilot-gradient.js";
|
|
11
11
|
function AiChatHeader({ title, hasMessages, conversationText, onClearChat }) {
|
|
12
|
-
const { t } =
|
|
12
|
+
const { t } = useVertexTranslation();
|
|
13
13
|
const { copied, error, copy } = useClipboard({
|
|
14
14
|
timeout: 2000
|
|
15
15
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
4
4
|
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "../../dialog/dialog.js";
|
|
5
5
|
function AiChatImagePreview({ url, onClose }) {
|
|
6
|
-
const { t } =
|
|
6
|
+
const { t } = useVertexTranslation();
|
|
7
7
|
return /*#__PURE__*/ jsx(Dialog, {
|
|
8
8
|
open: !!url,
|
|
9
9
|
onOpenChange: (open)=>!open && onClose(),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowUp, CircleStop, Paperclip, X } from "lucide-react";
|
|
4
4
|
import { useImperativeHandle, useRef, useState } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
6
6
|
import { Button } from "../../button/button.js";
|
|
7
7
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../dropdown-menu/dropdown-menu.js";
|
|
8
8
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../tooltip/tooltip.js";
|
|
@@ -12,7 +12,7 @@ import { AiChatImagePreview } from "./ai-chat-image-preview.js";
|
|
|
12
12
|
import { AiChatInputGlow } from "./ai-chat-input-glow.js";
|
|
13
13
|
import { AiChatPendingFiles } from "./ai-chat-pending-files.js";
|
|
14
14
|
function AiChatInput({ value, onChange, onSubmit, onStop, isLoading, disabled = false, placeholder, hasMessages = false, acceptedFileTypes, quotedText, onClearQuote, ref }) {
|
|
15
|
-
const { t } =
|
|
15
|
+
const { t } = useVertexTranslation();
|
|
16
16
|
const textareaRef = useRef(null);
|
|
17
17
|
const fileInputRef = useRef(null);
|
|
18
18
|
const [focused, setFocused] = useState(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { motion, useReducedMotion } from "framer-motion";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
5
5
|
import { ENTRANCE_ANIMATE, ENTRANCE_EASE, ENTRANCE_INITIAL } from "../animations.js";
|
|
6
6
|
import { AiChatThinking } from "./ai-chat-thinking.js";
|
|
7
7
|
const ENTRANCE_DURATION = 0.5;
|
|
@@ -9,7 +9,7 @@ const TEXT_DELAY = 0.9;
|
|
|
9
9
|
const TEXT_DURATION = 0.3;
|
|
10
10
|
const TEXT_OVERLAP_PX = -7;
|
|
11
11
|
function AiChatLoading() {
|
|
12
|
-
const { t } =
|
|
12
|
+
const { t } = useVertexTranslation();
|
|
13
13
|
const prefersReducedMotion = useReducedMotion();
|
|
14
14
|
const thinkingLabel = t("thinking");
|
|
15
15
|
const shimmerStyle = prefersReducedMotion ? {} : {
|
|
@@ -3,7 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useClipboard } from "@mantine/hooks";
|
|
4
4
|
import { Root } from "@radix-ui/react-tooltip";
|
|
5
5
|
import { Check, Copy, Pencil, RefreshCw, ThumbsDown, ThumbsUp } from "lucide-react";
|
|
6
|
-
import {
|
|
6
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
7
7
|
import { Button } from "../../button/button.js";
|
|
8
8
|
import { TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip/tooltip.js";
|
|
9
9
|
import { cn } from "../../../lib/utils.js";
|
|
@@ -32,7 +32,7 @@ function IconActionButton({ icon, label, onClick, pressed }) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function CopyToClipboardButton({ value }) {
|
|
35
|
-
const { t } =
|
|
35
|
+
const { t } = useVertexTranslation();
|
|
36
36
|
const { copied, error, copy } = useClipboard({
|
|
37
37
|
timeout: 2000
|
|
38
38
|
});
|
|
@@ -51,7 +51,7 @@ function CopyToClipboardButton({ value }) {
|
|
|
51
51
|
}
|
|
52
52
|
const ICON_CLASSES = "size-3.5 text-ai-chat-muted-foreground";
|
|
53
53
|
function AiChatMessageActions({ content, messageRole, isLatest = false, feedback, onFeedback, onRegenerate, onEdit }) {
|
|
54
|
-
const { t } =
|
|
54
|
+
const { t } = useVertexTranslation();
|
|
55
55
|
return /*#__PURE__*/ jsx(TooltipProvider, {
|
|
56
56
|
delayDuration: 0,
|
|
57
57
|
skipDelayDuration: 150,
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { imagePartToUrl } from "../content-parts.js";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import { useState } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
7
7
|
import { Button } from "../../button/button.js";
|
|
8
8
|
import { Textarea } from "../../textarea/textarea.js";
|
|
9
9
|
import { ENTRANCE_ANIMATE, ENTRANCE_EASE, ENTRANCE_INITIAL } from "../animations.js";
|
|
@@ -31,7 +31,7 @@ function getImageParts(message) {
|
|
|
31
31
|
return message.parts.filter((p)=>"image" === p.type);
|
|
32
32
|
}
|
|
33
33
|
function AiChatMessage({ message, children, hideActions = false, showActionsAlwaysVisible = false, feedback, onFeedback, onRegenerate, onEditMessage }) {
|
|
34
|
-
const { t } =
|
|
34
|
+
const { t } = useVertexTranslation();
|
|
35
35
|
const isUser = "user" === message.role;
|
|
36
36
|
const displayContent = getDisplayText(message);
|
|
37
37
|
const imageParts = getImageParts(message);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { FileText, X } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
5
5
|
import { Button } from "../../button/button.js";
|
|
6
6
|
function formatFileSize(bytes) {
|
|
7
7
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -9,7 +9,7 @@ function formatFileSize(bytes) {
|
|
|
9
9
|
return `${(bytes / 1048576).toFixed(1)} MB`;
|
|
10
10
|
}
|
|
11
11
|
function AiChatPendingFiles({ files, onRemove, onPreview }) {
|
|
12
|
-
const { t } =
|
|
12
|
+
const { t } = useVertexTranslation();
|
|
13
13
|
if (0 === files.length) return null;
|
|
14
14
|
return /*#__PURE__*/ jsx("div", {
|
|
15
15
|
className: "flex flex-wrap gap-1.5 px-3 pt-2",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowDown } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
5
5
|
import { Button } from "../../button/button.js";
|
|
6
6
|
function AiChatScrollToBottomButton({ onClick }) {
|
|
7
|
-
const { t } =
|
|
7
|
+
const { t } = useVertexTranslation();
|
|
8
8
|
return /*#__PURE__*/ jsx(Button, {
|
|
9
9
|
type: "button",
|
|
10
10
|
variant: "outline",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTextSelection } from "@mantine/hooks";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
|
-
import {
|
|
5
|
+
import { useVertexTranslation } from "../../../lib/vertex-translation.js";
|
|
6
6
|
import { Button } from "../../button/button.js";
|
|
7
7
|
import { POP_ANIMATE, POP_EXIT, POP_INITIAL, POP_TRANSITION } from "../animations.js";
|
|
8
8
|
import { AutopilotIcon } from "./icons/autopilot.js";
|
|
@@ -25,7 +25,7 @@ function deriveMenuState(selection, container) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function AiChatSelectionMenu({ onAskAi, containerRef }) {
|
|
28
|
-
const { t } =
|
|
28
|
+
const { t } = useVertexTranslation();
|
|
29
29
|
const selection = useTextSelection();
|
|
30
30
|
const menu = deriveMenuState(selection, containerRef?.current ?? null);
|
|
31
31
|
return /*#__PURE__*/ jsx(AnimatePresence, {
|