@uipath/apollo-vertex 0.1.0 → 0.4.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 +15 -21
- package/dist/entries/index.d.ts +102 -1
- package/dist/entries/index.js +77 -2
- 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/card/card.d.ts +3 -1
- package/dist/registry/card/card.js +4 -5
- package/dist/registry/carousel/carousel.js +3 -3
- package/dist/registry/charts-core/charts-core.d.ts +2 -2
- 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.d.ts +1 -0
- 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/hooks.d.ts +0 -1
- 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/stepper/index.d.ts +1 -7
- package/dist/registry/stepper/index.js +1 -6
- 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 +27 -88
- 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)
|
|
@@ -67,6 +60,7 @@ pnpm build # Generate theme.css, build dist/ with rslib, check every exp
|
|
|
67
60
|
pnpm build:check # List the external packages each public entry reaches
|
|
68
61
|
pnpm lint # oxlint (type-aware)
|
|
69
62
|
pnpm lint:deps # Check that registry files only import from registry/ and lib/
|
|
63
|
+
pnpm -w knip # Find unused files, exports and dependencies (both workspaces)
|
|
70
64
|
pnpm typecheck # tsc --noEmit
|
|
71
65
|
pnpm format # Biome
|
|
72
66
|
```
|
|
@@ -76,6 +70,6 @@ pnpm format # Biome
|
|
|
76
70
|
1. Create the component in `registry/<component>/<component>.tsx`.
|
|
77
71
|
2. Add a `@/components/ui/<component>` alias to `tsconfig.json` if other components import it.
|
|
78
72
|
3. Add the item to `registry.json`.
|
|
79
|
-
4. Export it from
|
|
73
|
+
4. Export it from `entries/index.ts`.
|
|
80
74
|
5. Document it in `apps/apollo-vertex/content/docs/components/<component>.mdx`.
|
|
81
75
|
6. Run `pnpm build` and `pnpm --filter apollo-vertex registry:build` to check both outputs.
|
package/dist/entries/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export * from "../registry/toggle-group/toggle-group";
|
|
|
58
58
|
export * from "../registry/tooltip/tooltip";
|
|
59
59
|
export * from "../registry/confidence-signal/confidence-signal";
|
|
60
60
|
export * from "../registry/data-table";
|
|
61
|
-
export { CheckboxField, type CheckboxFieldProps, type FieldOption, RadioGroupField, type RadioGroupFieldProps, SelectField, type SelectFieldProps, SubmitButton, type SubmitButtonProps, SwitchField, type SwitchFieldProps, TextareaField, type TextareaFieldProps, TextField, type TextFieldProps, useAppForm, useFieldContext, useFormContext, useTranslatedErrors, withForm, } from "../registry/form";
|
|
61
|
+
export { CheckboxField, type CheckboxFieldProps, FieldError as FormFieldError, type FieldErrorProps as FormFieldErrorProps, type FieldOption, RadioGroupField, type RadioGroupFieldProps, SelectField, type SelectFieldProps, SubmitButton, type SubmitButtonProps, SwitchField, type SwitchFieldProps, TextareaField, type TextareaFieldProps, TextField, type TextFieldProps, useAppForm, useFieldContext, useFormContext, useTranslatedErrors, withForm, } from "../registry/form";
|
|
62
62
|
export * from "../registry/form-wizard";
|
|
63
63
|
export * from "../registry/onboarding-tour-joyride";
|
|
64
64
|
export * from "../registry/sidebar/sidebar";
|
|
@@ -67,3 +67,104 @@ 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 { assertDateOrString } from "../lib/asserts/assert-date-or-string";
|
|
71
|
+
export { assertString } from "../lib/asserts/assert-string";
|
|
72
|
+
export { addVertexTranslations } from "../lib/i18n";
|
|
73
|
+
export * from "../registry/chart/chart";
|
|
74
|
+
export * from "../registry/bar-chart/bar-chart";
|
|
75
|
+
export * from "../registry/distribution-chart/distribution-chart";
|
|
76
|
+
export * from "../registry/kpi-chart/kpi-chart";
|
|
77
|
+
export * from "../registry/line-chart/line-chart";
|
|
78
|
+
export * from "../registry/multi-line-chart/multi-line-chart";
|
|
79
|
+
export * from "../registry/table-chart/table-chart";
|
|
80
|
+
export * from "../registry/charts-core/charts-core";
|
|
81
|
+
export * from "../registry/data-fabric-adapter/data-fabric-adapter";
|
|
82
|
+
export * from "../registry/insights-adapter/insights-adapter";
|
|
83
|
+
export { ApolloShell, type ApolloShellProps, type CompanyLogo, type ShellNavItem, type ShellSubNavItem, } from "../registry/shell/shell";
|
|
84
|
+
export { AuthContext, ShellAuthProvider, useAuth, type AuthContextValue, type UserInfo, } from "../registry/shell/shell-auth-provider";
|
|
85
|
+
export { LocaleProvider } from "../registry/shell/shell-locale-provider";
|
|
86
|
+
export { ThemeProvider } from "../registry/shell/shell-theme-provider";
|
|
87
|
+
export { MembershipDenied, VerifyingMembership, type MembershipDeniedProps, } from "../registry/shell/group-membership-screens";
|
|
88
|
+
export { Role } from "../registry/shell/shell-roles";
|
|
89
|
+
export { STALE_TIME_MS } from "../registry/shell/shell-constants";
|
|
90
|
+
export { useAccessToken } from "../registry/shell/shell-auth-provider";
|
|
91
|
+
export { useTheme } from "../registry/shell/shell-theme-provider";
|
|
92
|
+
export { ShellLogin } from "../registry/shell/shell-login";
|
|
93
|
+
export { ShellLayout } from "../registry/shell/shell-layout";
|
|
94
|
+
export { ShellSidebar } from "../registry/shell/shell-sidebar";
|
|
95
|
+
export { ShellUserProvider, useUser, type User, } from "../registry/shell/shell-user-provider";
|
|
96
|
+
export { SUPPORTED_LOCALES, configurei18n, type SupportedLocale, } from "../lib/i18n";
|
|
97
|
+
export { STORAGE_KEYS, TOKEN_QUERY_KEY, type TokenData, ensureValidToken, login, logout, resolveReturnPath, toCodedAppFilePath, } from "../lib/auth";
|
|
98
|
+
export { GroupMembershipGuard, type GroupMembershipGuardProps, } from "../registry/shell/group-membership-guard";
|
|
99
|
+
export { useGroupId, type UseGroupIdOptions, type UseGroupIdResult, } from "../registry/shell/use-group-id";
|
|
100
|
+
export { useGroupMembers, type UseGroupMembersOptions, type UseGroupMembersResult, } from "../registry/shell/use-group-members";
|
|
101
|
+
export { useIsGroupMember } from "../registry/shell/use-is-group-member";
|
|
102
|
+
export { useEntityDataTable, type UseEntityDataTableOptions, } from "../registry/use-data-table/useEntityDataTable";
|
|
103
|
+
export { useEntityColumns } from "../registry/use-data-table/useEntityColumns";
|
|
104
|
+
export { FeatureFlagContext, FeatureFlagProvider, useFeatureFlagProvider, } from "../registry/feature-flag-provider/feature-flag-provider";
|
|
105
|
+
export { FeatureFlagGuard } from "../registry/feature-flag-guard/feature-flag-guard";
|
|
106
|
+
export { ProtectedFeatureRoute } from "../registry/protected-feature-route/protected-feature-route";
|
|
107
|
+
export { useFeatureFlag } from "../registry/use-feature-flag/use-feature-flag";
|
|
108
|
+
export type { FeatureFlagProviderConfig, FeatureFlagUserContext, } from "../registry/feature-flag-provider/types";
|
|
109
|
+
export { createProteusProvider, type FlagMapping, type ProteusFeatureFlagValues, } from "../registry/feature-flag-provider/proteus-adapter";
|
|
110
|
+
export { SolutionTestsView } from "../registry/solution-tests/solution-tests-view";
|
|
111
|
+
export type { SolutionTestsViewProps } from "../registry/solution-tests/solution-tests-view";
|
|
112
|
+
export { SaveAsTestButton } from "../registry/solution-tests/save-as-test-button";
|
|
113
|
+
export { SolutionTestActionError } from "../registry/solution-tests/errors";
|
|
114
|
+
export type { ActionFailure } from "../registry/solution-tests/errors";
|
|
115
|
+
export { SolutionTestsProvider, useSolutionTestsContext, useSolutionTestsConfig, } from "../registry/solution-tests/context";
|
|
116
|
+
export type { SolutionTestsConfig, ResolvedSolutionTestsConfig, SolutionTestEventMap, SolutionTestEventName, TrackSolutionTestEvent, } from "../registry/solution-tests/config";
|
|
117
|
+
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";
|
|
118
|
+
export type { EvaluatorRenderer, EvaluatorRenderers, EvaluatorRenderArgs, EvaluatorResultProps, } from "../registry/solution-tests/evaluators/registry";
|
|
119
|
+
export { makeProcessOutputRenderer, resolveProcessOutputRenderer, } from "../registry/solution-tests/outputs/registry";
|
|
120
|
+
export type { ProcessOutputRenderer, ProcessOutputRenderers, ProcessOutputRenderArgs, ProcessOutputProps, } from "../registry/solution-tests/outputs/registry";
|
|
121
|
+
export { ProcessOutputView } from "../registry/solution-tests/outputs/process-output-view";
|
|
122
|
+
export { BaselineCompare } from "../registry/solution-tests/baseline-compare";
|
|
123
|
+
export type { BaselineCompareRow } from "../registry/solution-tests/baseline-compare";
|
|
124
|
+
export { VersionDeltaGlyph } from "../registry/solution-tests/version-delta-glyph";
|
|
125
|
+
export { versionDelta } from "../registry/solution-tests/utils";
|
|
126
|
+
export type { VersionDelta } from "../registry/solution-tests/utils";
|
|
127
|
+
export { IxpOutputResult, IXP_OUTPUT_RENDERER, } from "../registry/solution-tests/outputs/ixp-extraction/ixp-output-result";
|
|
128
|
+
export { IxpOutputSchema } from "../registry/solution-tests/outputs/ixp-extraction/schema";
|
|
129
|
+
export { CaseEvaluationOutputResult, CASE_EVALUATION_OUTPUT_RENDERER, } from "../registry/solution-tests/outputs/case-evaluation/case-evaluation-output";
|
|
130
|
+
export { CaseEvaluationOutputSchema } from "../registry/solution-tests/outputs/case-evaluation/schema";
|
|
131
|
+
export type { CaseEvaluationOutput, EvaluationRecord, } from "../registry/solution-tests/outputs/case-evaluation/schema";
|
|
132
|
+
export type { IxpOutput, IxpDocumentExtraction, IxpExtractionGroup, IxpFieldValue, } from "../registry/solution-tests/outputs/ixp-extraction/schema";
|
|
133
|
+
export { SolutionTestStatus, RunStatus, RunResultStatus, JobRole, } from "../registry/solution-tests/types";
|
|
134
|
+
export type { SolutionTest, SolutionTestJob, SolutionTestRun, SolutionTestBatchRun, SolutionTestRunResult, UserMessageItem, ResultAttachmentField, SolutionTestStatusValue, RunStatusValue, RunResultStatusValue, JobRoleValue, } from "../registry/solution-tests/types";
|
|
135
|
+
export type { RunConfirmTarget } from "../registry/solution-tests/solution-tests-view";
|
|
136
|
+
export { RunDetailsView } from "../registry/solution-tests/run-details-view";
|
|
137
|
+
export type { BaselineJobMap, RunDetailsViewProps, } from "../registry/solution-tests/run-details-view";
|
|
138
|
+
export { ExpandedAgentsView } from "../registry/solution-tests/expanded-agents-view";
|
|
139
|
+
export type { ExpandedAgentsViewProps } from "../registry/solution-tests/expanded-agents-view";
|
|
140
|
+
export { ExpandedRunTestsView } from "../registry/solution-tests/expanded-run-tests-view";
|
|
141
|
+
export type { ExpandedRunTestsViewProps } from "../registry/solution-tests/expanded-run-tests-view";
|
|
142
|
+
export { CaseEvaluationDetailsSchema, EvaluationPairStatus, SummaryVerdict, } from "../registry/solution-tests/evaluators/case-evaluation/schema";
|
|
143
|
+
export type { CaseEvaluationDetails, EvaluationPair, EvaluationView, } from "../registry/solution-tests/evaluators/case-evaluation/schema";
|
|
144
|
+
export { IxpDetailsSchema, IxpDocStatus, IxpVerdict, } from "../registry/solution-tests/evaluators/ixp-extraction/schema";
|
|
145
|
+
export type { IxpDetails, IxpDocument, IxpField, IxpProvenance, IxpVerdictValue, } from "../registry/solution-tests/evaluators/ixp-extraction/schema";
|
|
146
|
+
export { SolutionTests } from "../registry/solution-tests/solution-tests";
|
|
147
|
+
export { RunDetails } from "../registry/solution-tests/run-details";
|
|
148
|
+
export { useSolutionTests, useSolutionTestBatchRuns, useSolutionTestRuns, useBaselineJobs, useRunResults, useRunTests, useCreateTest, useToggleTestActive, useDeleteTest, useForceStopBatch, useForceStopRun, useAdoptJob, useUpdateBaseline, useRemoveJobBaseline, useJobExpectedOutput, useResultAttachment, } from "../registry/solution-tests/hooks";
|
|
149
|
+
export type { UseSolutionTestsResult, UseSolutionTestBatchRunsResult, UseSolutionTestRunsResult, UseBaselineJobsResult, UseRunResultsResult, MutationHook, AttachmentFetcher, } from "../registry/solution-tests/hooks";
|
|
150
|
+
export { ExpandedAgents } from "../registry/solution-tests/expanded-agents";
|
|
151
|
+
export { ExpandedRunTests } from "../registry/solution-tests/expanded-run-tests";
|
|
152
|
+
export { createAgentHubConnection } from "../registry/ai-chat/adapters/agenthub/adapter";
|
|
153
|
+
export type { AgentHubAdapterConfig, AgentHubVendor, } from "../registry/ai-chat/adapters/agenthub/adapter";
|
|
154
|
+
export { createConversationalAgentConnection } from "../registry/ai-chat/adapters/conversational-agent/adapter";
|
|
155
|
+
export type { ConversationalAgentAdapterConfig } from "../registry/ai-chat/adapters/conversational-agent/adapter";
|
|
156
|
+
export { AiChat } from "../registry/ai-chat/components/ai-chat";
|
|
157
|
+
export { AiChatEmptyState } from "../registry/ai-chat/components/ai-chat-empty-state";
|
|
158
|
+
export { NoDataMessage } from "../registry/ai-chat/charts/no-data-message";
|
|
159
|
+
export { AutopilotGradientIcon } from "../registry/ai-chat/components/icons/autopilot-gradient";
|
|
160
|
+
export * from "../registry/ai-chat/tools/choices";
|
|
161
|
+
export type { Entity } from "../registry/ai-chat/tools/data-fabric/util/entities";
|
|
162
|
+
export type { JoinInput } from "../registry/ai-chat/tools/data-fabric/util/joins";
|
|
163
|
+
export * from "../registry/ai-chat/tools/data-fabric-bar";
|
|
164
|
+
export * from "../registry/ai-chat/tools/data-fabric-distribution";
|
|
165
|
+
export * from "../registry/ai-chat/tools/data-fabric-kpi";
|
|
166
|
+
export * from "../registry/ai-chat/tools/data-fabric-line";
|
|
167
|
+
export * from "../registry/ai-chat/tools/data-fabric-multi-line";
|
|
168
|
+
export * from "../registry/ai-chat/tools/data-fabric-table";
|
|
169
|
+
export * from "../registry/ai-chat/tools/data-fabric";
|
|
170
|
+
export type { MessageFeedbackType } from "../registry/ai-chat/types";
|
package/dist/entries/index.js
CHANGED
|
@@ -1,7 +1,64 @@
|
|
|
1
|
-
import { CheckboxField, RadioGroupField, SelectField, SubmitButton, SwitchField, TextField, TextareaField, useAppForm, useFieldContext, useFormContext, useTranslatedErrors, withForm } from "../registry/form/index.js";
|
|
1
|
+
import { CheckboxField, FieldError, RadioGroupField, SelectField, SubmitButton, SwitchField, TextField, TextareaField, useAppForm, useFieldContext, useFormContext, useTranslatedErrors, withForm } from "../registry/form/index.js";
|
|
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 { assertDateOrString } from "../lib/asserts/assert-date-or-string.js";
|
|
6
|
+
import { assertString } from "../lib/asserts/assert-string.js";
|
|
7
|
+
import { SUPPORTED_LOCALES, addVertexTranslations, configurei18n } from "../lib/i18n.js";
|
|
8
|
+
import { ApolloShell } from "../registry/shell/shell.js";
|
|
9
|
+
import { AuthContext, ShellAuthProvider, useAccessToken, useAuth } from "../registry/shell/shell-auth-provider.js";
|
|
10
|
+
import { LocaleProvider } from "../registry/shell/shell-locale-provider.js";
|
|
11
|
+
import { ThemeProvider, useTheme } from "../registry/shell/shell-theme-provider.js";
|
|
12
|
+
import { MembershipDenied, VerifyingMembership } from "../registry/shell/group-membership-screens.js";
|
|
13
|
+
import { Role } from "../registry/shell/shell-roles.js";
|
|
14
|
+
import { STALE_TIME_MS } from "../registry/shell/shell-constants.js";
|
|
15
|
+
import { ShellLogin } from "../registry/shell/shell-login.js";
|
|
16
|
+
import { ShellLayout } from "../registry/shell/shell-layout.js";
|
|
17
|
+
import { ShellSidebar } from "../registry/shell/shell-sidebar.js";
|
|
18
|
+
import { ShellUserProvider, useUser } from "../registry/shell/shell-user-provider.js";
|
|
19
|
+
import { STORAGE_KEYS, TOKEN_QUERY_KEY, ensureValidToken, login, logout, resolveReturnPath, toCodedAppFilePath } from "../lib/auth.js";
|
|
20
|
+
import { GroupMembershipGuard } from "../registry/shell/group-membership-guard.js";
|
|
21
|
+
import { useGroupId } from "../registry/shell/use-group-id.js";
|
|
22
|
+
import { useGroupMembers } from "../registry/shell/use-group-members.js";
|
|
23
|
+
import { useIsGroupMember } from "../registry/shell/use-is-group-member.js";
|
|
24
|
+
import { useEntityDataTable } from "../registry/use-data-table/useEntityDataTable.js";
|
|
25
|
+
import { useEntityColumns } from "../registry/use-data-table/useEntityColumns.js";
|
|
26
|
+
import { FeatureFlagContext, FeatureFlagProvider, useFeatureFlagProvider } from "../registry/feature-flag-provider/feature-flag-provider.js";
|
|
27
|
+
import { FeatureFlagGuard } from "../registry/feature-flag-guard/feature-flag-guard.js";
|
|
28
|
+
import { ProtectedFeatureRoute } from "../registry/protected-feature-route/protected-feature-route.js";
|
|
29
|
+
import { useFeatureFlag } from "../registry/use-feature-flag/use-feature-flag.js";
|
|
30
|
+
import { createProteusProvider } from "../registry/feature-flag-provider/proteus-adapter.js";
|
|
31
|
+
import { SolutionTestsView } from "../registry/solution-tests/solution-tests-view.js";
|
|
32
|
+
import { SaveAsTestButton } from "../registry/solution-tests/save-as-test-button.js";
|
|
33
|
+
import { SolutionTestActionError } from "../registry/solution-tests/errors.js";
|
|
34
|
+
import { SolutionTestsProvider, useSolutionTestsConfig, useSolutionTestsContext } from "../registry/solution-tests/context.js";
|
|
35
|
+
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";
|
|
36
|
+
import { makeProcessOutputRenderer, resolveProcessOutputRenderer } from "../registry/solution-tests/outputs/registry.js";
|
|
37
|
+
import { ProcessOutputView } from "../registry/solution-tests/outputs/process-output-view.js";
|
|
38
|
+
import { BaselineCompare } from "../registry/solution-tests/baseline-compare.js";
|
|
39
|
+
import { VersionDeltaGlyph } from "../registry/solution-tests/version-delta-glyph.js";
|
|
40
|
+
import { versionDelta } from "../registry/solution-tests/utils.js";
|
|
41
|
+
import { IXP_OUTPUT_RENDERER, IxpOutputResult } from "../registry/solution-tests/outputs/ixp-extraction/ixp-output-result.js";
|
|
42
|
+
import { IxpOutputSchema } from "../registry/solution-tests/outputs/ixp-extraction/schema.js";
|
|
43
|
+
import { CASE_EVALUATION_OUTPUT_RENDERER, CaseEvaluationOutputResult } from "../registry/solution-tests/outputs/case-evaluation/case-evaluation-output.js";
|
|
44
|
+
import { CaseEvaluationOutputSchema } from "../registry/solution-tests/outputs/case-evaluation/schema.js";
|
|
45
|
+
import { JobRole, RunResultStatus, RunStatus, SolutionTestStatus } from "../registry/solution-tests/types.js";
|
|
46
|
+
import { RunDetailsView } from "../registry/solution-tests/run-details-view.js";
|
|
47
|
+
import { ExpandedAgentsView } from "../registry/solution-tests/expanded-agents-view.js";
|
|
48
|
+
import { ExpandedRunTestsView } from "../registry/solution-tests/expanded-run-tests-view.js";
|
|
49
|
+
import { CaseEvaluationDetailsSchema, EvaluationPairStatus, SummaryVerdict } from "../registry/solution-tests/evaluators/case-evaluation/schema.js";
|
|
50
|
+
import { IxpDetailsSchema, IxpDocStatus, IxpVerdict } from "../registry/solution-tests/evaluators/ixp-extraction/schema.js";
|
|
51
|
+
import { SolutionTests } from "../registry/solution-tests/solution-tests.js";
|
|
52
|
+
import { RunDetails } from "../registry/solution-tests/run-details.js";
|
|
53
|
+
import { useAdoptJob, useBaselineJobs, useCreateTest, useDeleteTest, useForceStopBatch, useForceStopRun, useJobExpectedOutput, useRemoveJobBaseline, useResultAttachment, useRunResults, useRunTests, useSolutionTestBatchRuns, useSolutionTestRuns, useSolutionTests, useToggleTestActive, useUpdateBaseline } from "../registry/solution-tests/hooks.js";
|
|
54
|
+
import { ExpandedAgents } from "../registry/solution-tests/expanded-agents.js";
|
|
55
|
+
import { ExpandedRunTests } from "../registry/solution-tests/expanded-run-tests.js";
|
|
56
|
+
import { createAgentHubConnection } from "../registry/ai-chat/adapters/agenthub/adapter.js";
|
|
57
|
+
import { createConversationalAgentConnection } from "../registry/ai-chat/adapters/conversational-agent/adapter.js";
|
|
58
|
+
import { AiChat } from "../registry/ai-chat/components/ai-chat.js";
|
|
59
|
+
import { AiChatEmptyState } from "../registry/ai-chat/components/ai-chat-empty-state.js";
|
|
60
|
+
import { NoDataMessage } from "../registry/ai-chat/charts/no-data-message.js";
|
|
61
|
+
import { AutopilotGradientIcon } from "../registry/ai-chat/components/icons/autopilot-gradient.js";
|
|
5
62
|
export * from "../registry/accordion/accordion.js";
|
|
6
63
|
export * from "../registry/ai-caveat/ai-caveat.js";
|
|
7
64
|
export * from "../registry/ai-glow/ai-glow.js";
|
|
@@ -67,4 +124,22 @@ export * from "../registry/onboarding-tour-joyride/index.js";
|
|
|
67
124
|
export * from "../registry/sidebar/sidebar.js";
|
|
68
125
|
export * from "../registry/stepper/index.js";
|
|
69
126
|
export * from "../registry/timeline/index.js";
|
|
70
|
-
export
|
|
127
|
+
export * from "../registry/chart/chart.js";
|
|
128
|
+
export * from "../registry/bar-chart/bar-chart.js";
|
|
129
|
+
export * from "../registry/distribution-chart/distribution-chart.js";
|
|
130
|
+
export * from "../registry/kpi-chart/kpi-chart.js";
|
|
131
|
+
export * from "../registry/line-chart/line-chart.js";
|
|
132
|
+
export * from "../registry/multi-line-chart/multi-line-chart.js";
|
|
133
|
+
export * from "../registry/table-chart/table-chart.js";
|
|
134
|
+
export * from "../registry/charts-core/charts-core.js";
|
|
135
|
+
export * from "../registry/data-fabric-adapter/data-fabric-adapter.js";
|
|
136
|
+
export * from "../registry/insights-adapter/insights-adapter.js";
|
|
137
|
+
export * from "../registry/ai-chat/tools/choices/index.js";
|
|
138
|
+
export * from "../registry/ai-chat/tools/data-fabric-bar/index.js";
|
|
139
|
+
export * from "../registry/ai-chat/tools/data-fabric-distribution/index.js";
|
|
140
|
+
export * from "../registry/ai-chat/tools/data-fabric-kpi/index.js";
|
|
141
|
+
export * from "../registry/ai-chat/tools/data-fabric-line/index.js";
|
|
142
|
+
export * from "../registry/ai-chat/tools/data-fabric-multi-line/index.js";
|
|
143
|
+
export * from "../registry/ai-chat/tools/data-fabric-table/index.js";
|
|
144
|
+
export * from "../registry/ai-chat/tools/data-fabric/index.js";
|
|
145
|
+
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, FieldError as FormFieldError, 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, NoDataMessage, ProcessOutputView, ProtectedFeatureRoute, RadioGroupField, Role, RunDetails, RunDetailsView, RunResultStatus, RunStatus, STALE_TIME_MS, 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, assertDateOrString, assertString, 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, useUser, 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",
|