@calliopelabs/ui 0.16.0 → 0.18.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 +94 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/primitives/Menubar.d.ts +21 -0
- package/dist/primitives/Menubar.js +43 -0
- package/dist/provider/messages.d.ts +148 -0
- package/dist/provider/messages.js +178 -0
- package/dist/shell/RailPanel.js +1 -1
- package/dist/workbench/ActivityBar.d.ts +37 -0
- package/dist/workbench/ActivityBar.js +57 -0
- package/dist/workbench/BottomPanel.d.ts +30 -0
- package/dist/workbench/BottomPanel.js +20 -0
- package/dist/workbench/CodeEditor.d.ts +48 -0
- package/dist/workbench/CodeEditor.js +153 -0
- package/dist/workbench/CommandPalette.d.ts +49 -0
- package/dist/workbench/CommandPalette.js +114 -0
- package/dist/workbench/DataChart.d.ts +45 -0
- package/dist/workbench/DataChart.js +146 -0
- package/dist/workbench/DataGrid.d.ts +89 -0
- package/dist/workbench/DataGrid.js +590 -0
- package/dist/workbench/DataProfile.d.ts +17 -0
- package/dist/workbench/DataProfile.js +51 -0
- package/dist/workbench/EditorTabs.d.ts +62 -0
- package/dist/workbench/EditorTabs.js +115 -0
- package/dist/workbench/GridCell.d.ts +19 -0
- package/dist/workbench/GridCell.js +50 -0
- package/dist/workbench/GridDetails.d.ts +31 -0
- package/dist/workbench/GridDetails.js +78 -0
- package/dist/workbench/MenuBar.d.ts +49 -0
- package/dist/workbench/MenuBar.js +25 -0
- package/dist/workbench/PaneGroup.d.ts +50 -0
- package/dist/workbench/PaneGroup.js +146 -0
- package/dist/workbench/PendingChangesBar.d.ts +20 -0
- package/dist/workbench/PendingChangesBar.js +19 -0
- package/dist/workbench/Shortcuts.d.ts +50 -0
- package/dist/workbench/Shortcuts.js +109 -0
- package/dist/workbench/SqlEditor.d.ts +21 -0
- package/dist/workbench/SqlEditor.js +79 -0
- package/dist/workbench/StatusBar.d.ts +28 -0
- package/dist/workbench/StatusBar.js +26 -0
- package/dist/workbench/TruncationBanner.d.ts +11 -0
- package/dist/workbench/TruncationBanner.js +12 -0
- package/dist/workbench/WorkbenchShell.d.ts +36 -0
- package/dist/workbench/WorkbenchShell.js +20 -0
- package/dist/workbench/download.d.ts +11 -0
- package/dist/workbench/download.js +28 -0
- package/dist/workbench/editor-theme.d.ts +42 -0
- package/dist/workbench/editor-theme.js +113 -0
- package/dist/workbench/grid-format.d.ts +59 -0
- package/dist/workbench/grid-format.js +169 -0
- package/dist/workbench/grid-model.d.ts +75 -0
- package/dist/workbench/grid-model.js +259 -0
- package/dist/workbench/grid-selection.d.ts +69 -0
- package/dist/workbench/grid-selection.js +183 -0
- package/dist/workbench/grid-stats.d.ts +58 -0
- package/dist/workbench/grid-stats.js +185 -0
- package/dist/workbench/index.d.ts +28 -0
- package/dist/workbench/index.js +31 -0
- package/dist/workbench/keys.d.ts +23 -0
- package/dist/workbench/keys.js +105 -0
- package/dist/workbench/palette.d.ts +17 -0
- package/dist/workbench/palette.js +45 -0
- package/dist/workbench/pending.d.ts +92 -0
- package/dist/workbench/pending.js +207 -0
- package/dist/workbench/sql-completion.d.ts +107 -0
- package/dist/workbench/sql-completion.js +475 -0
- package/dist/workflow/WorkflowRuntimeControls.d.ts +21 -0
- package/dist/workflow/WorkflowRuntimeControls.js +54 -0
- package/dist/workflow/runtime-controls.d.ts +29 -0
- package/dist/workflow/runtime-controls.js +10 -0
- package/package.json +13 -2
package/README.md
CHANGED
|
@@ -534,7 +534,9 @@ Headers on the provider run in the browser: never put a secret there. Keys, the
|
|
|
534
534
|
|
|
535
535
|
## Workbench
|
|
536
536
|
|
|
537
|
-
`@calliopelabs/ui/workbench` is an opt-in entry for IDE-style tools (File Manager, Loadr, Chat Studio): an app without
|
|
537
|
+
`@calliopelabs/ui/workbench` is an opt-in entry for IDE-style tools (File Manager, Loadr, Chat Studio): an app without one never loads it. Its styles come from the preset. The code editors and the chart need optional peers the host installs and loads itself (`monaco-editor` through `configureMonaco`, `recharts` through `DataChart`'s `loadCharts`), so the entry builds without either. Like the rest, it is host-driven: data comes in as props, every change goes out through a callback, and nothing fetches.
|
|
538
|
+
|
|
539
|
+
**New in 0.17.0** (calliopeai/calliope-ux#12, extracted from Loadr and serving Chat Studio's fork too): the IDE shell (`WorkbenchShell`, `MenuBar`, `ActivityBar`, `EditorTabs` and `EditorGroup`, `PaneGroup`, `BottomPanel`, `StatusBar`, `CommandPalette`, `useShortcuts`; #79), the `Menubar` primitive in the main entry (#79), `DataGrid` with editing and pending changes, `DataProfile` and `DataChart` (#81), and `CodeEditor` and `SqlEditor` on Monaco (#80). New dependency: `@tanstack/react-virtual`. New optional peers: `monaco-editor`, `recharts`. Nothing existing changed. The file browser, upload dropzone and preview shipped in 0.16.0.
|
|
538
540
|
|
|
539
541
|
- **`FileBrowser`**: breadcrumb (its crumbs are drop targets), list and grid views, sorting (folders first, natural order), selection, a context menu, drag-and-drop moves (Alt copies) and an optional folder tree. View, sort and selection work uncontrolled or controlled. Copy for an empty folder, a toolbar slot, and thumbnails for grid tiles.
|
|
540
542
|
- **`FileTree`**: a lazy tree on the WAI-ARIA tree pattern (arrows open and move, Home, End, typeahead). The host answers `onLoad(path)` with a `FileBranch` (`loading`, `error`, `ready`) per directory in `branches`; a failed branch retries through `onRetry`.
|
|
@@ -569,6 +571,97 @@ import {
|
|
|
569
571
|
|
|
570
572
|
Their copy is in the `workbench` message group. The catalog's **Workbench** section shows every state, light and dark, narrow, and large trees.
|
|
571
573
|
|
|
574
|
+
### The IDE shell
|
|
575
|
+
|
|
576
|
+
Extracted from Loadr's layout (shared with Chat Studio). Every region is host content and every toggle a prop; the shell holds no state but the pane sizes.
|
|
577
|
+
|
|
578
|
+
- **`WorkbenchShell`**: menu bar, activity bar, a resizable side bar, the editors over a bottom panel, an optional right-hand panel, and the status bar. Hidden regions stay mounted, so an open page keeps its state; a maximized panel collapses the editors without unmounting them. `storageKey` remembers pane sizes per person.
|
|
579
|
+
- **`MenuBar`**: menus from data (`WorkbenchMenu`: items with shortcuts, checkbox items, labels, separators) on the `Menubar` primitive (WAI-ARIA menubar). `start` and `end` slots for the product mark and name.
|
|
580
|
+
- **`ActivityBar`**: the rail of views as a vertical toolbar of toggle buttons (one tab stop, arrows move), with labels, badges, footer items, and items that toggle a panel instead of choosing a view. Choosing the open view passes `null`, so the host closes the side bar.
|
|
581
|
+
- **`EditorTabs`** and **`EditorGroup`**: the WAI-ARIA tabs pattern with an unsaved marker (spoken), close by button, middle click or Delete, reorder by drag or Alt+Shift+Left/Right, a menu of every tab once the strip overflows, a per-tab context menu, trailing actions and a focused-group marker for split layouts. `EditorGroup` adds the labelled tab panel.
|
|
582
|
+
- **`PaneGroup`** and **`Pane`**: resizable panes on the WAI-ARIA window-splitter pattern (focusable `separator`s; arrows step, Home and End go to the bounds; pointer drag). Bounds in percent or pixels, collapsed panes stay mounted, sizes persist through `storageKey` (the library's local store).
|
|
583
|
+
- **`BottomPanel`**: views as tabs with counts, maximize, restore and close.
|
|
584
|
+
- **`StatusBar`** and **`StatusBarItem`**: a labelled region with start and end slots; `tone` paints it with a status colour (a production connection in `error`).
|
|
585
|
+
- **`CommandPalette`**: a modal WAI-ARIA combobox over a grouped listbox with fuzzy ranking (`fuzzyScore`, `rankItems`), recent entries, key caps, a loading state, controlled query for prefix modes ("@" for objects), and `onItemKeyDown` for host keys on the highlighted entry. Focus returns where it was.
|
|
586
|
+
- **`useShortcuts`**, **`KeyboardShortcutsDialog`**, **`ShortcutKeys`**: a page-wide registry with one listener; chords are strings (`"Mod+K"`: Command on a Mac, Control elsewhere); bare keys stay out of text fields; the last mounted binding wins; the dialog lists whatever is registered. `parseShortcut`, `matchesShortcut`, `formatShortcut` are pure.
|
|
587
|
+
|
|
588
|
+
```tsx
|
|
589
|
+
useShortcuts([
|
|
590
|
+
{ id: "palette", keys: "Mod+K", label: "Command palette", run: () => setPalette(true) },
|
|
591
|
+
{ id: "sidebar", keys: "Mod+B", label: "Toggle side bar", run: toggleSidebar },
|
|
592
|
+
]);
|
|
593
|
+
|
|
594
|
+
<WorkbenchShell
|
|
595
|
+
storageKey="loadr"
|
|
596
|
+
menuBar={<MenuBar menus={menus} end="Loadr" />}
|
|
597
|
+
activityBar={<ActivityBar items={views} active={view} onActiveChange={setView} />}
|
|
598
|
+
sidebar={<Explorer />}
|
|
599
|
+
sidebarOpen={view !== null}
|
|
600
|
+
bottomPanel={<BottomPanel views={panels} maximized={max} onMaximizedChange={setMax} />}
|
|
601
|
+
bottomPanelOpen={panelOpen}
|
|
602
|
+
bottomPanelMaximized={max}
|
|
603
|
+
statusBar={<StatusBar tone={envTone} start={connection} end={version} />}
|
|
604
|
+
overlays={
|
|
605
|
+
<CommandPalette open={palette} onOpenChange={setPalette} items={commands} onSelect={run} />
|
|
606
|
+
}
|
|
607
|
+
>
|
|
608
|
+
<EditorGroup tabs={tabs} activeId={active} onSelect={setActive} onClose={close} onReorder={move}>
|
|
609
|
+
<ActivePage />
|
|
610
|
+
</EditorGroup>
|
|
611
|
+
</WorkbenchShell>;
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### Code and SQL editors
|
|
615
|
+
|
|
616
|
+
`CodeEditor` wraps Monaco once; `SqlEditor` adds schema-aware completion. Monaco is an optional peer dependency (`monaco-editor` `>=0.52 <1`) that the package never imports: the host hands over its own import, so its bundler resolves Monaco, puts it in its own chunk and fetches it the first time an editor mounts. An app without an editor never loads it; without a loader (or if it fails) a plain text area stands in.
|
|
617
|
+
|
|
618
|
+
```ts
|
|
619
|
+
// Once, at startup (Vite shown; the worker setup is the bundler's part).
|
|
620
|
+
import { configureMonaco } from "@calliopelabs/ui/workbench";
|
|
621
|
+
|
|
622
|
+
configureMonaco({
|
|
623
|
+
load: async () => {
|
|
624
|
+
const [monaco, worker] = await Promise.all([
|
|
625
|
+
import("monaco-editor"),
|
|
626
|
+
import("monaco-editor/editor/editor.worker?worker"),
|
|
627
|
+
]);
|
|
628
|
+
self.MonacoEnvironment = { getWorker: () => new worker.default() };
|
|
629
|
+
return monaco;
|
|
630
|
+
},
|
|
631
|
+
});
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
- **`CodeEditor`**: `value`, `onChange`, `language`, `label` (its accessible name), `readOnly`, `onRun` (Ctrl or Command with Enter, the selection or the whole buffer), `options` (Monaco's own), `onMount(editor, monaco)` with an optional cleanup, and a per-editor `loader`. Host value changes are applied as edits, so undo still works. The theme comes from the library's tokens under the editor (ground, text, accent, border; syntax from the chart series) and follows a change of ground or mode; Monaco themes are page-wide.
|
|
635
|
+
- **`SqlEditor`**: a `schema` (`tables` with optional `columns`, `schemas`, `databases`, `otherDatabases`) drives completion: tables after FROM and JOIN, columns after SELECT and WHERE (qualified when two tables share a name), `alias.` resolved against the statement under the cursor, `schema.` and `db.` qualifiers, keywords, functions and window-function snippets. Completion never waits: what the schema lacks (a table's columns, another database's tables) comes out once through `onSchemaRequest`, and the host passes a new `schema`.
|
|
636
|
+
- Pure helpers for anything else: `sqlCompletions(text, offset, schema)`, `sqlCursorContext`, `statementAt`, `extractTableRefs`, `resolveSqlDot`, `isDdlStatement` (a host's cue to refresh its schema), `editorTheme`, `readEditorPalette`.
|
|
637
|
+
|
|
638
|
+
### Data grid, profile and chart
|
|
639
|
+
|
|
640
|
+
Extracted from Loadr's result grid and data editor (Chat Studio runs a fork of the same files). Host-driven: rows in, changes and copies out through callbacks, nothing fetches, no toasts.
|
|
641
|
+
|
|
642
|
+
- **`DataGrid`**: `columns` (names, or `GridColumn` with `type` in any driver spelling, `primaryKey`, `foreignKey`, `nullable`; undeclared types are sniffed) and `rows`. Rows and columns are virtualized (`@tanstack/react-virtual`), so 50,000 rows by 30 columns is a few hundred nodes. The WAI-ARIA grid pattern: arrows, Home and End, Ctrl+Home and Ctrl+End, Page Up and Down, Shift extends, Ctrl or Command with A selects all, with C copies TSV (Shift adds headers); Enter opens the cell, Shift+Enter the row. Cell, row and column selection (Shift and Ctrl or Command with the mouse), sort with NULLs last, a filter, hidden columns, resize by pointer or keyboard (a focusable `separator`; widths persist under `storageKey` in the library's local store), selection statistics, copy as TSV, CSV, JSON, INSERT or Markdown, and export as CSV, TSV, JSON, JSON Lines, SQL INSERT or Markdown. `totalRows` or `hasMore` shows the truncation banner; `loading`, `error` and `onRetry` the states. `onCopy` hears every copy; `onExport` takes over export (each request carries the library's `file` for its formats, `null` for the host's own `exportFormats`, such as a workbook), and `downloadExport(file)` saves one.
|
|
643
|
+
- **Editing**: `editable` turns on in-place editing (Enter, F2, double click or typing; Enter and Tab keep and move, Escape cancels), add, duplicate and delete rows, and a `PendingChangesBar` with Commit and Discard. Existing rows change only when a column is a `primaryKey`; without one, rows can be added. Commit calls `onCommit(changeSet)`: inserts with the filled cells, updates keyed on the primary key with the changed cells and their old values (for an optimistic-concurrency check), deletes by key. Resolve and the grid clears the changes; reject with `{ message, key }` and they stay, with the failed row marked. `pending` and `onPendingChange` control the changes from outside. The model is pure (`editCell`, `addRow`, `deleteRows`, `revertRow`, `pendingCounts`, `toChangeSet`), and `changeSetToSql(changeSet, { table })` writes the statements for a host that runs SQL.
|
|
644
|
+
- **`DataProfile`**: a card per column (completeness, distinct, range, mean and median, top values), sampling at most `rowCap` rows (10,000) and saying so.
|
|
645
|
+
- **`DataChart`**: bar, line, area, scatter or pie of an X column and Y columns, in the theme's chart series. Recharts is an optional peer (`recharts` `^3`) that the package never imports: the host passes `loadCharts={() => import("recharts")}`, so an app without charts builds without it and one with them loads it when a chart opens. Plots at most `rowCap` rows (500).
|
|
646
|
+
- Also exported: `CellDetailDialog`, `RowDetailDrawer`, `TruncationBanner`, `GridCellValue`, `ColumnTypeIcon`, and the pure helpers (`viewRowIndexes`, `compareCells`, `normalizeColumnType`, `buildColumnMeta`, the selection model, `formatMatrix`, `exportMatrix`, `toTSV`, `toCSV`, `toInsert`, `toMarkdown`, `computeStats`, `profileColumn`).
|
|
647
|
+
|
|
648
|
+
```tsx
|
|
649
|
+
<DataGrid
|
|
650
|
+
label="public.people"
|
|
651
|
+
columns={[{ name: "id", type: "int8", primaryKey: true }, "name", "email"]}
|
|
652
|
+
rows={result.rows}
|
|
653
|
+
totalRows={result.rowCount}
|
|
654
|
+
storageKey="table:public.people"
|
|
655
|
+
tableName="public.people"
|
|
656
|
+
editable={editMode}
|
|
657
|
+
onCommit={(changes) => api.apply({ table: "public.people", ...changes })}
|
|
658
|
+
onExport={(request) =>
|
|
659
|
+
request.file ? downloadExport(request.file) : writeWorkbook(request.matrix)
|
|
660
|
+
}
|
|
661
|
+
exportFormats={[{ id: "xlsx", label: "Excel workbook" }]}
|
|
662
|
+
/>
|
|
663
|
+
```
|
|
664
|
+
|
|
572
665
|
## Appearance
|
|
573
666
|
|
|
574
667
|
The person sets four axes, per product: the **ground** (black, charcoal, graphite, emerald, navy, paper, mist; it decides light or dark), the **accent** (the product's own, a family accent, or any colour that stands 3:1 off the ground), the **density** (`compact` hairline rows or boxed `cards`) and the **corners** (0, 2, 4 or 10 px). `AppearancePicker` is the settings UI for all four.
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export { Popover, PopoverAnchor, PopoverContent, PopoverHeader, PopoverTrigger,
|
|
|
63
63
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./primitives/Tabs.js";
|
|
64
64
|
export { Skeleton } from "./primitives/Skeleton.js";
|
|
65
65
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./primitives/Tooltip.js";
|
|
66
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarTrigger, } from "./primitives/Menubar.js";
|
|
66
67
|
export { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, } from "./primitives/ContextMenu.js";
|
|
67
68
|
export { ScrollArea, type ScrollAreaProps } from "./primitives/ScrollArea.js";
|
|
68
69
|
export { Badge, badgeVariants, type BadgeProps } from "./primitives/Badge.js";
|
|
@@ -70,6 +71,8 @@ export { ToastProvider, useToast, type ToastApi, type ToastOptions, type ToastPr
|
|
|
70
71
|
export type { WorkflowAction, WorkflowAvailability, WorkflowModule, WorkflowPermissions, WorkflowScope, WorkflowStatus, WorkflowSummary, } from "./workflow/model.js";
|
|
71
72
|
export { WorkflowCard, WorkflowCardSkeleton, type WorkflowCardActions, type WorkflowCardProps, } from "./workflow/WorkflowCard.js";
|
|
72
73
|
export { WorkflowQuestionCard, type WorkflowQuestionCardProps, } from "./workflow/WorkflowQuestionCard.js";
|
|
74
|
+
export { WorkflowRuntimeControls, type WorkflowRuntimeControlsProps, } from "./workflow/WorkflowRuntimeControls.js";
|
|
75
|
+
export type { WorkflowRuntimeState, WorkflowRuntimeBinding, WorkflowPauseReceipt, WorkflowRuntimeIntent, } from "./workflow/runtime-controls.js";
|
|
73
76
|
export type { WorkflowQuestion, WorkflowQuestionField, WorkflowQuestionState, WorkflowQuestionAnswers, WorkflowQuestionSubmission, } from "./workflow/question.js";
|
|
74
77
|
export { ANY_FILTER, DEFAULT_WORKFLOW_FILTERS, filterWorkflows, isFiltered, type WorkflowGalleryFilters, } from "./workflow/gallery.js";
|
|
75
78
|
export { WorkflowGallery, type WorkflowGalleryProps, type WorkflowGalleryView, } from "./workflow/WorkflowGallery.js";
|
package/dist/index.js
CHANGED
|
@@ -74,12 +74,14 @@ export { Popover, PopoverAnchor, PopoverContent, PopoverHeader, PopoverTrigger,
|
|
|
74
74
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./primitives/Tabs.js";
|
|
75
75
|
export { Skeleton } from "./primitives/Skeleton.js";
|
|
76
76
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./primitives/Tooltip.js";
|
|
77
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarTrigger, } from "./primitives/Menubar.js";
|
|
77
78
|
export { ContextMenu, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuTrigger, } from "./primitives/ContextMenu.js";
|
|
78
79
|
export { ScrollArea } from "./primitives/ScrollArea.js";
|
|
79
80
|
export { Badge, badgeVariants } from "./primitives/Badge.js";
|
|
80
81
|
export { ToastProvider, useToast, } from "./primitives/Toast.js";
|
|
81
82
|
export { WorkflowCard, WorkflowCardSkeleton, } from "./workflow/WorkflowCard.js";
|
|
82
83
|
export { WorkflowQuestionCard, } from "./workflow/WorkflowQuestionCard.js";
|
|
84
|
+
export { WorkflowRuntimeControls, } from "./workflow/WorkflowRuntimeControls.js";
|
|
83
85
|
export { ANY_FILTER, DEFAULT_WORKFLOW_FILTERS, filterWorkflows, isFiltered, } from "./workflow/gallery.js";
|
|
84
86
|
export { WorkflowGallery, } from "./workflow/WorkflowGallery.js";
|
|
85
87
|
export { ARTIFACT_TONE, GATE_TONE, RUN_STAGE_TONE, VERDICT_TONE, } from "./workflow/run.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* A desktop-style menu bar (File, Edit, View) with the ARIA menubar pattern:
|
|
5
|
+
* one tab stop, Left and Right move between menus, Down or Enter opens one,
|
|
6
|
+
* and an open menu follows the pointer and the arrows to its neighbours.
|
|
7
|
+
* Tools with an IDE layout use it through the workbench's `MenuBar`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): React.JSX.Element;
|
|
10
|
+
export declare function MenubarMenu(props: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
|
|
11
|
+
export declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Trigger>): React.JSX.Element;
|
|
12
|
+
export declare function MenubarContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>): React.JSX.Element;
|
|
13
|
+
export declare function MenubarGroup(props: React.ComponentProps<typeof MenubarPrimitive.Group>): React.JSX.Element;
|
|
14
|
+
export declare function MenubarItem({ className, variant, ...props }: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
15
|
+
variant?: "default" | "destructive";
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
export declare function MenubarCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>): React.JSX.Element;
|
|
18
|
+
export declare function MenubarLabel({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label>): React.JSX.Element;
|
|
19
|
+
export declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>): React.JSX.Element;
|
|
20
|
+
/** The item's keyboard shortcut, right-aligned. Decorative: the shortcut itself is the app's. */
|
|
21
|
+
export declare function MenubarShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon } from "lucide-react";
|
|
4
|
+
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
/**
|
|
7
|
+
* A desktop-style menu bar (File, Edit, View) with the ARIA menubar pattern:
|
|
8
|
+
* one tab stop, Left and Right move between menus, Down or Enter opens one,
|
|
9
|
+
* and an open menu follows the pointer and the arrows to its neighbours.
|
|
10
|
+
* Tools with an IDE layout use it through the workbench's `MenuBar`.
|
|
11
|
+
*/
|
|
12
|
+
export function Menubar({ className, ...props }) {
|
|
13
|
+
return (_jsx(MenubarPrimitive.Root, { "data-slot": "menubar", className: cn("flex items-center gap-0.5", className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
export function MenubarMenu(props) {
|
|
16
|
+
return _jsx(MenubarPrimitive.Menu, { "data-slot": "menubar-menu", ...props });
|
|
17
|
+
}
|
|
18
|
+
export function MenubarTrigger({ className, ...props }) {
|
|
19
|
+
return (_jsx(MenubarPrimitive.Trigger, { "data-slot": "menubar-trigger", className: cn("flex items-center rounded-lg px-2 py-0.5 text-xs text-muted-foreground outline-hidden select-none hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
export function MenubarContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
22
|
+
return (_jsx(MenubarPrimitive.Portal, { children: _jsx(MenubarPrimitive.Content, { "data-slot": "menubar-content", align: align, sideOffset: sideOffset, className: cn("z-50 max-h-(--radix-menubar-content-available-height) min-w-48 origin-(--radix-menubar-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=open]:animate-cui-fade-in", className), ...props }) }));
|
|
23
|
+
}
|
|
24
|
+
export function MenubarGroup(props) {
|
|
25
|
+
return _jsx(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
|
|
26
|
+
}
|
|
27
|
+
const itemClass = "relative flex cursor-default items-center gap-1.5 rounded-lg px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
28
|
+
export function MenubarItem({ className, variant = "default", ...props }) {
|
|
29
|
+
return (_jsx(MenubarPrimitive.Item, { "data-slot": "menubar-item", "data-variant": variant, className: cn(itemClass, "data-[variant=destructive]:text-danger-fg data-[variant=destructive]:focus:bg-danger/10", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
export function MenubarCheckboxItem({ className, children, ...props }) {
|
|
32
|
+
return (_jsxs(MenubarPrimitive.CheckboxItem, { "data-slot": "menubar-checkbox-item", className: cn(itemClass, "pr-8", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", children: _jsx(MenubarPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { "aria-hidden": true }) }) }), children] }));
|
|
33
|
+
}
|
|
34
|
+
export function MenubarLabel({ className, ...props }) {
|
|
35
|
+
return (_jsx(MenubarPrimitive.Label, { "data-slot": "menubar-label", className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground", className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
export function MenubarSeparator({ className, ...props }) {
|
|
38
|
+
return (_jsx(MenubarPrimitive.Separator, { "data-slot": "menubar-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
/** The item's keyboard shortcut, right-aligned. Decorative: the shortcut itself is the app's. */
|
|
41
|
+
export function MenubarShortcut({ className, ...props }) {
|
|
42
|
+
return (_jsx("span", { "data-slot": "menubar-shortcut", "aria-hidden": true, className: cn("ml-auto pl-4 font-mono text-xs text-muted-foreground", className), ...props }));
|
|
43
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ProductTheme } from "../appearance/product.js";
|
|
2
2
|
import type { ChatRole, ChatRunStatus, ChatToolCallStatus } from "../chat/model.js";
|
|
3
|
+
import type { CopyFormat as GridCopyFormat, ExportFormat as GridExportFormat } from "../workbench/grid-format.js";
|
|
4
|
+
import type { ColumnType as GridColumnType } from "../workbench/grid-model.js";
|
|
3
5
|
import type { UploadState } from "../workbench/model.js";
|
|
4
6
|
import type { WorkflowQuestionState } from "../workflow/question.js";
|
|
7
|
+
import type { WorkflowRuntimeState } from "../workflow/runtime-controls.js";
|
|
5
8
|
import type { WorkflowAction, WorkflowAvailability, WorkflowScope, WorkflowStatus } from "../workflow/model.js";
|
|
6
9
|
import type { ArtifactStatus, GateStatus, ReviewDecision, ReviewVerdict, RunStageStatus } from "../workflow/run.js";
|
|
7
10
|
import type { WorkflowConnectReason, WorkflowFlowNameProblem, WorkflowNode, WorkflowNodeKind, WorkflowSelector } from "../workflow/definition.js";
|
|
@@ -24,6 +27,21 @@ import type { WorkflowReadError } from "../workflow/portable.js";
|
|
|
24
27
|
* it (plurals, numbers, word order).
|
|
25
28
|
*/
|
|
26
29
|
export interface Messages {
|
|
30
|
+
workflowRuntime: {
|
|
31
|
+
title: string;
|
|
32
|
+
state: (state: WorkflowRuntimeState) => string;
|
|
33
|
+
description: (state: WorkflowRuntimeState) => string;
|
|
34
|
+
loading: string;
|
|
35
|
+
empty: string;
|
|
36
|
+
readOnly: string;
|
|
37
|
+
pause: string;
|
|
38
|
+
resume: string;
|
|
39
|
+
refresh: string;
|
|
40
|
+
steering: string;
|
|
41
|
+
steeringHint: string;
|
|
42
|
+
invalidSteering: string;
|
|
43
|
+
send: string;
|
|
44
|
+
};
|
|
27
45
|
workflowQuestion: {
|
|
28
46
|
title: string;
|
|
29
47
|
worker: (worker: string) => string;
|
|
@@ -158,6 +176,136 @@ export interface Messages {
|
|
|
158
176
|
/** A CSV column with no header. */
|
|
159
177
|
column: (index: number) => string;
|
|
160
178
|
noRows: string;
|
|
179
|
+
/** The menu bar's name. */
|
|
180
|
+
menuBar: string;
|
|
181
|
+
/** The activity bar's name. */
|
|
182
|
+
activityBar: string;
|
|
183
|
+
/** The editor tab strip's name. */
|
|
184
|
+
openEditors: string;
|
|
185
|
+
/** Spoken after a tab's title when it has unsaved changes. */
|
|
186
|
+
unsaved: string;
|
|
187
|
+
closeTab: (title: string) => string;
|
|
188
|
+
/** The overflow menu that lists every open tab. */
|
|
189
|
+
allTabs: (count: number) => string;
|
|
190
|
+
/** A resize handle's name: "Resize Explorer". */
|
|
191
|
+
resize: (pane: string) => string;
|
|
192
|
+
maximizePanel: string;
|
|
193
|
+
restorePanel: string;
|
|
194
|
+
closePanel: string;
|
|
195
|
+
/** The status bar's landmark name. */
|
|
196
|
+
statusBar: string;
|
|
197
|
+
commandPalette: string;
|
|
198
|
+
searchCommands: string;
|
|
199
|
+
noCommands: string;
|
|
200
|
+
commandsLoading: string;
|
|
201
|
+
/** The palette's group for entries the person ran lately. */
|
|
202
|
+
recent: string;
|
|
203
|
+
keyboardShortcuts: string;
|
|
204
|
+
keyboardShortcutsDescription: string;
|
|
205
|
+
/** Spoken between the keys of a chord: "Control plus K". */
|
|
206
|
+
keyJoin: string;
|
|
207
|
+
/** The shell's panes, for their resize handles. */
|
|
208
|
+
sideBar: string;
|
|
209
|
+
editor: string;
|
|
210
|
+
panel: string;
|
|
211
|
+
secondarySideBar: string;
|
|
212
|
+
/** The grid's name when the host gives none. */
|
|
213
|
+
gridLabel: string;
|
|
214
|
+
/** "1,204 rows", or "12 of 1,204 rows" while a filter is on. */
|
|
215
|
+
gridRows: (shown: number, total: number) => string;
|
|
216
|
+
gridColumns: (count: number) => string;
|
|
217
|
+
gridFilter: string;
|
|
218
|
+
gridClearFilter: string;
|
|
219
|
+
/** The button that shows hidden columns again. */
|
|
220
|
+
gridHidden: (count: number) => string;
|
|
221
|
+
gridSelected: (count: number) => string;
|
|
222
|
+
gridSelectAll: string;
|
|
223
|
+
gridExport: string;
|
|
224
|
+
gridExportScope: (rows: number, columns: number) => string;
|
|
225
|
+
gridExportFormat: (format: GridExportFormat) => string;
|
|
226
|
+
gridSortBy: (column: string) => string;
|
|
227
|
+
gridSortAscending: string;
|
|
228
|
+
gridSortDescending: string;
|
|
229
|
+
gridClearSort: string;
|
|
230
|
+
gridColumnMenu: (column: string) => string;
|
|
231
|
+
/** Null while no cell of the column is active. */
|
|
232
|
+
gridFilterByValue: (value: string | null) => string;
|
|
233
|
+
gridHideColumn: string;
|
|
234
|
+
gridShowAllColumns: (hidden: number) => string;
|
|
235
|
+
gridCopyColumnName: string;
|
|
236
|
+
gridResizeColumn: (column: string) => string;
|
|
237
|
+
gridType: (type: GridColumnType) => string;
|
|
238
|
+
gridPrimaryKey: string;
|
|
239
|
+
gridForeignKey: (references: string | null) => string;
|
|
240
|
+
gridNullable: string;
|
|
241
|
+
gridNotNull: string;
|
|
242
|
+
gridNull: string;
|
|
243
|
+
gridEmptyText: string;
|
|
244
|
+
gridBinary: (bytes: number) => string;
|
|
245
|
+
gridNoRows: string;
|
|
246
|
+
gridNoMatches: string;
|
|
247
|
+
gridLoading: string;
|
|
248
|
+
gridLoadFailed: string;
|
|
249
|
+
gridCopy: string;
|
|
250
|
+
gridCopyWithHeaders: string;
|
|
251
|
+
gridCopyAs: string;
|
|
252
|
+
gridCopyFormat: (format: GridCopyFormat) => string;
|
|
253
|
+
gridRowDetail: string;
|
|
254
|
+
gridCellDetail: string;
|
|
255
|
+
gridClearSelection: string;
|
|
256
|
+
/** The statistics bar's name. */
|
|
257
|
+
gridStatistics: string;
|
|
258
|
+
gridStat: (stat: "rows" | "nulls" | "distinct" | "min" | "max" | "avg" | "sum") => string;
|
|
259
|
+
gridNoNumeric: string;
|
|
260
|
+
/** A result the server capped: total known, or only that more exist. */
|
|
261
|
+
gridTruncated: (shown: number, total: number | null) => string;
|
|
262
|
+
gridCharacters: (count: number) => string;
|
|
263
|
+
gridBytes: (count: number, truncated: boolean) => string;
|
|
264
|
+
gridDownload: string;
|
|
265
|
+
gridCopied: string;
|
|
266
|
+
gridCopyValue: string;
|
|
267
|
+
gridRowOf: (row: number, total: number) => string;
|
|
268
|
+
gridPreviousRow: string;
|
|
269
|
+
gridNextRow: string;
|
|
270
|
+
gridCopyRow: string;
|
|
271
|
+
gridAddRow: string;
|
|
272
|
+
gridDeleteRows: (count: number) => string;
|
|
273
|
+
gridDuplicateRow: string;
|
|
274
|
+
gridRevertRow: string;
|
|
275
|
+
gridEditCell: (column: string) => string;
|
|
276
|
+
/** Spoken with a changed row's number. */
|
|
277
|
+
gridRowState: (state: "added" | "modified" | "deleted") => string;
|
|
278
|
+
/** The pending changes bar's name. */
|
|
279
|
+
gridPendingChanges: string;
|
|
280
|
+
gridPendingSummary: (inserts: number, updates: number, deletes: number) => string;
|
|
281
|
+
gridCommit: string;
|
|
282
|
+
gridCommitting: string;
|
|
283
|
+
gridDiscard: string;
|
|
284
|
+
/** Nothing was written; `row` is the 1-based row the host reported, when it did. */
|
|
285
|
+
gridCommitFailed: (message: string, row: number | null) => string;
|
|
286
|
+
gridNoPrimaryKey: string;
|
|
287
|
+
profileLabel: string;
|
|
288
|
+
profileSummary: (rows: number, columns: number, nulls: number) => string;
|
|
289
|
+
profileKind: (kind: "numeric" | "text" | "boolean" | "date" | "null") => string;
|
|
290
|
+
profileComplete: (share: number) => string;
|
|
291
|
+
profileMean: string;
|
|
292
|
+
profileMedian: string;
|
|
293
|
+
profileTopValues: string;
|
|
294
|
+
profileNoData: string;
|
|
295
|
+
/** The client capped what it profiled or charted: "Profiling the first 10,000 of 50,000 rows". */
|
|
296
|
+
profileCap: (cap: number, fetched: number) => string;
|
|
297
|
+
chartLabel: string;
|
|
298
|
+
chartType: string;
|
|
299
|
+
chartKind: (kind: "bar" | "line" | "area" | "scatter" | "pie") => string;
|
|
300
|
+
chartX: string;
|
|
301
|
+
chartY: string;
|
|
302
|
+
chartPickY: string;
|
|
303
|
+
chartNoData: string;
|
|
304
|
+
chartLoading: string;
|
|
305
|
+
chartLoadFailed: string;
|
|
306
|
+
chartCap: (cap: number, fetched: number) => string;
|
|
307
|
+
/** The code editor while Monaco loads. */
|
|
308
|
+
editorLoading: string;
|
|
161
309
|
};
|
|
162
310
|
toast: {
|
|
163
311
|
/** The notifications region; Radix fills `{hotkey}` with the shortcut that focuses it. */
|
|
@@ -144,6 +144,43 @@ function problemText({ code, values: v }) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
export const defaultMessages = {
|
|
147
|
+
workflowRuntime: {
|
|
148
|
+
title: "Agent controls",
|
|
149
|
+
state: (state) => ({
|
|
150
|
+
running: "Agent running",
|
|
151
|
+
paused: "Agent paused",
|
|
152
|
+
"pause-requested": "Pause requested",
|
|
153
|
+
"resume-requested": "Resume requested",
|
|
154
|
+
"steering-queued": "Steering queued",
|
|
155
|
+
"steering-applied": "Steering applied",
|
|
156
|
+
refused: "Control refused",
|
|
157
|
+
"delivery-unknown": "Delivery unconfirmed",
|
|
158
|
+
unavailable: "Controls unavailable",
|
|
159
|
+
finished: "Agent finished",
|
|
160
|
+
})[state],
|
|
161
|
+
description: (state) => ({
|
|
162
|
+
running: "Control this agent while it works on the original goal.",
|
|
163
|
+
paused: "The agent confirmed its pause. Resume continues the same goal.",
|
|
164
|
+
"pause-requested": "Waiting for the agent to confirm its pause.",
|
|
165
|
+
"resume-requested": "Waiting for the agent to confirm it resumed.",
|
|
166
|
+
"steering-queued": "The agent has not yet confirmed this steering message.",
|
|
167
|
+
"steering-applied": "The agent applied the steering message to this goal.",
|
|
168
|
+
refused: "The command was refused. Check the current agent state before continuing.",
|
|
169
|
+
"delivery-unknown": "Check the original command's status before sending another command.",
|
|
170
|
+
unavailable: "The current agent controls could not be read.",
|
|
171
|
+
finished: "This agent is no longer accepting commands.",
|
|
172
|
+
})[state],
|
|
173
|
+
loading: "Loading agent controls…",
|
|
174
|
+
empty: "The original agent is not available.",
|
|
175
|
+
readOnly: "An operator can control this agent.",
|
|
176
|
+
pause: "Pause agent",
|
|
177
|
+
resume: "Resume agent",
|
|
178
|
+
refresh: "Check agent status",
|
|
179
|
+
steering: "Steering message",
|
|
180
|
+
steeringHint: "Up to 4,000 characters. Steering preserves the original goal and limits.",
|
|
181
|
+
invalidSteering: "Enter a nonempty message of up to 4,000 valid characters.",
|
|
182
|
+
send: "Send steering",
|
|
183
|
+
},
|
|
147
184
|
workflowQuestion: {
|
|
148
185
|
title: "Question for this run",
|
|
149
186
|
worker: (worker) => `Worker: ${worker}`,
|
|
@@ -286,6 +323,147 @@ export const defaultMessages = {
|
|
|
286
323
|
partial: "Showing the start of the file",
|
|
287
324
|
column: (index) => `Column ${index}`,
|
|
288
325
|
noRows: "No rows",
|
|
326
|
+
menuBar: "Menu bar",
|
|
327
|
+
activityBar: "Activity bar",
|
|
328
|
+
openEditors: "Open editors",
|
|
329
|
+
unsaved: "unsaved",
|
|
330
|
+
closeTab: (title) => `Close ${title}`,
|
|
331
|
+
allTabs: (count) => `All open tabs (${count.toLocaleString()})`,
|
|
332
|
+
resize: (pane) => `Resize ${pane}`,
|
|
333
|
+
maximizePanel: "Maximize panel",
|
|
334
|
+
restorePanel: "Restore panel",
|
|
335
|
+
closePanel: "Close panel",
|
|
336
|
+
statusBar: "Status bar",
|
|
337
|
+
commandPalette: "Command palette",
|
|
338
|
+
searchCommands: "Type a command or search",
|
|
339
|
+
noCommands: "No matching commands",
|
|
340
|
+
commandsLoading: "Loading",
|
|
341
|
+
recent: "Recent",
|
|
342
|
+
keyboardShortcuts: "Keyboard shortcuts",
|
|
343
|
+
keyboardShortcutsDescription: "Every keyboard shortcut this app responds to",
|
|
344
|
+
keyJoin: "+",
|
|
345
|
+
sideBar: "Side bar",
|
|
346
|
+
editor: "Editor",
|
|
347
|
+
panel: "Panel",
|
|
348
|
+
secondarySideBar: "Secondary side bar",
|
|
349
|
+
gridLabel: "Results",
|
|
350
|
+
gridRows: (shown, total) => shown === total
|
|
351
|
+
? `${total.toLocaleString()} ${total === 1 ? "row" : "rows"}`
|
|
352
|
+
: `${shown.toLocaleString()} of ${total.toLocaleString()} rows`,
|
|
353
|
+
gridColumns: (count) => `${count.toLocaleString()} ${count === 1 ? "column" : "columns"}`,
|
|
354
|
+
gridFilter: "Filter rows",
|
|
355
|
+
gridClearFilter: "Clear filter",
|
|
356
|
+
gridHidden: (count) => `${count.toLocaleString()} hidden`,
|
|
357
|
+
gridSelected: (count) => `${count.toLocaleString()} selected`,
|
|
358
|
+
gridSelectAll: "Select all cells",
|
|
359
|
+
gridExport: "Export",
|
|
360
|
+
gridExportScope: (rows, columns) => `The current view: ${rows.toLocaleString()} ${rows === 1 ? "row" : "rows"}, ${columns.toLocaleString()} ${columns === 1 ? "column" : "columns"}`,
|
|
361
|
+
gridExportFormat: (format) => ({
|
|
362
|
+
csv: "CSV",
|
|
363
|
+
tsv: "TSV",
|
|
364
|
+
json: "JSON",
|
|
365
|
+
jsonl: "JSON Lines",
|
|
366
|
+
sql: "SQL INSERT",
|
|
367
|
+
markdown: "Markdown",
|
|
368
|
+
})[format],
|
|
369
|
+
gridSortBy: (column) => `Sort by ${column}`,
|
|
370
|
+
gridSortAscending: "Sort ascending",
|
|
371
|
+
gridSortDescending: "Sort descending",
|
|
372
|
+
gridClearSort: "Clear sort",
|
|
373
|
+
gridColumnMenu: (column) => `${column} column menu`,
|
|
374
|
+
gridFilterByValue: (value) => value === null
|
|
375
|
+
? "Filter by value"
|
|
376
|
+
: `Filter by \u201c${value.length > 20 ? `${value.slice(0, 20)}\u2026` : value}\u201d`,
|
|
377
|
+
gridHideColumn: "Hide column",
|
|
378
|
+
gridShowAllColumns: (hidden) => `Show all columns (${hidden.toLocaleString()} hidden)`,
|
|
379
|
+
gridCopyColumnName: "Copy column name",
|
|
380
|
+
gridResizeColumn: (column) => `Resize ${column}`,
|
|
381
|
+
gridType: (type) => type,
|
|
382
|
+
gridPrimaryKey: "Primary key",
|
|
383
|
+
gridForeignKey: (references) => (references ? `Foreign key to ${references}` : "Foreign key"),
|
|
384
|
+
gridNullable: "nullable",
|
|
385
|
+
gridNotNull: "not null",
|
|
386
|
+
gridNull: "NULL",
|
|
387
|
+
gridEmptyText: "empty",
|
|
388
|
+
gridBinary: (bytes) => `binary, ${bytes.toLocaleString()} bytes`,
|
|
389
|
+
gridNoRows: "No rows",
|
|
390
|
+
gridNoMatches: "No rows match the filter",
|
|
391
|
+
gridLoading: "Loading rows",
|
|
392
|
+
gridLoadFailed: "Could not load the rows",
|
|
393
|
+
gridCopy: "Copy",
|
|
394
|
+
gridCopyWithHeaders: "Copy with headers",
|
|
395
|
+
gridCopyAs: "Copy as",
|
|
396
|
+
gridCopyFormat: (format) => ({
|
|
397
|
+
tsv: "TSV",
|
|
398
|
+
"tsv-headers": "TSV with headers",
|
|
399
|
+
csv: "CSV",
|
|
400
|
+
json: "JSON",
|
|
401
|
+
insert: "INSERT statements",
|
|
402
|
+
markdown: "Markdown",
|
|
403
|
+
})[format],
|
|
404
|
+
gridRowDetail: "Row detail",
|
|
405
|
+
gridCellDetail: "Expand cell",
|
|
406
|
+
gridClearSelection: "Clear selection",
|
|
407
|
+
gridStatistics: "Selection statistics",
|
|
408
|
+
gridStat: (stat) => ({
|
|
409
|
+
rows: "Rows",
|
|
410
|
+
nulls: "Nulls",
|
|
411
|
+
distinct: "Distinct",
|
|
412
|
+
min: "Min",
|
|
413
|
+
max: "Max",
|
|
414
|
+
avg: "Avg",
|
|
415
|
+
sum: "Sum",
|
|
416
|
+
})[stat],
|
|
417
|
+
gridNoNumeric: "No numeric values selected",
|
|
418
|
+
gridTruncated: (shown, total) => total === null
|
|
419
|
+
? `Truncated at the ${shown.toLocaleString()}-row limit; more rows match.`
|
|
420
|
+
: `Showing ${shown.toLocaleString()} of ${total.toLocaleString()} rows, truncated at the ${shown.toLocaleString()}-row limit.`,
|
|
421
|
+
gridCharacters: (count) => `${count.toLocaleString()} ${count === 1 ? "character" : "characters"}`,
|
|
422
|
+
gridBytes: (count, truncated) => `${count.toLocaleString()} bytes${truncated ? ", preview truncated" : ""}`,
|
|
423
|
+
gridDownload: "Download",
|
|
424
|
+
gridCopied: "Copied",
|
|
425
|
+
gridCopyValue: "Copy",
|
|
426
|
+
gridRowOf: (row, total) => `Row ${row.toLocaleString()} of ${total.toLocaleString()}`,
|
|
427
|
+
gridPreviousRow: "Previous row",
|
|
428
|
+
gridNextRow: "Next row",
|
|
429
|
+
gridCopyRow: "Copy row",
|
|
430
|
+
gridAddRow: "Add row",
|
|
431
|
+
gridDeleteRows: (count) => count === 1 ? "Delete row" : `Delete ${count.toLocaleString()} rows`,
|
|
432
|
+
gridDuplicateRow: "Duplicate row",
|
|
433
|
+
gridRevertRow: "Revert row",
|
|
434
|
+
gridEditCell: (column) => `Edit ${column}`,
|
|
435
|
+
gridRowState: (state) => state,
|
|
436
|
+
gridPendingChanges: "Pending changes",
|
|
437
|
+
gridPendingSummary: (inserts, updates, deletes) => [
|
|
438
|
+
`${inserts.toLocaleString()} ${inserts === 1 ? "insert" : "inserts"}`,
|
|
439
|
+
`${updates.toLocaleString()} ${updates === 1 ? "update" : "updates"}`,
|
|
440
|
+
`${deletes.toLocaleString()} ${deletes === 1 ? "delete" : "deletes"}`,
|
|
441
|
+
].join(", "),
|
|
442
|
+
gridCommit: "Commit",
|
|
443
|
+
gridCommitting: "Committing",
|
|
444
|
+
gridDiscard: "Discard",
|
|
445
|
+
gridCommitFailed: (message, row) => `${row === null ? "" : `Row ${row.toLocaleString()}: `}${message} Nothing was written.`,
|
|
446
|
+
gridNoPrimaryKey: "No primary key: rows can be added, not changed or deleted.",
|
|
447
|
+
profileLabel: "Column profile",
|
|
448
|
+
profileSummary: (rows, columns, nulls) => `Profile of ${rows.toLocaleString()} ${rows === 1 ? "row" : "rows"}, ${columns.toLocaleString()} ${columns === 1 ? "column" : "columns"}, ${nulls.toLocaleString()} ${nulls === 1 ? "null" : "nulls"}`,
|
|
449
|
+
profileKind: (kind) => kind,
|
|
450
|
+
profileComplete: (share) => `${share.toLocaleString(undefined, { style: "percent", maximumFractionDigits: 1 })} complete`,
|
|
451
|
+
profileMean: "Mean",
|
|
452
|
+
profileMedian: "Median",
|
|
453
|
+
profileTopValues: "Top values",
|
|
454
|
+
profileNoData: "No data to profile",
|
|
455
|
+
profileCap: (cap, fetched) => `Profiling the first ${cap.toLocaleString()} of ${fetched.toLocaleString()} rows.`,
|
|
456
|
+
chartLabel: "Chart",
|
|
457
|
+
chartType: "Chart type",
|
|
458
|
+
chartKind: (kind) => ({ bar: "Bar", line: "Line", area: "Area", scatter: "Scatter", pie: "Pie" })[kind],
|
|
459
|
+
chartX: "X axis",
|
|
460
|
+
chartY: "Y axis",
|
|
461
|
+
chartPickY: "Choose at least one Y axis column",
|
|
462
|
+
chartNoData: "No data to chart",
|
|
463
|
+
chartLoading: "Loading the chart",
|
|
464
|
+
chartLoadFailed: "Could not load the chart library",
|
|
465
|
+
chartCap: (cap, fetched) => `Charting the first ${cap.toLocaleString()} of ${fetched.toLocaleString()} rows.`,
|
|
466
|
+
editorLoading: "Loading the editor",
|
|
289
467
|
},
|
|
290
468
|
toast: {
|
|
291
469
|
region: "Notifications ({hotkey})",
|
package/dist/shell/RailPanel.js
CHANGED
|
@@ -27,7 +27,7 @@ export function RailPanel({ label, title, actions, footer, children, collapsed,
|
|
|
27
27
|
}
|
|
28
28
|
/* A focusable separator is the WAI-ARIA window splitter, an interactive
|
|
29
29
|
widget; jsx-a11y counts every separator as static. */
|
|
30
|
-
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions
|
|
30
|
+
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
31
31
|
function ResizeHandle({ label, width, minWidth, maxWidth, onWidthChange, }) {
|
|
32
32
|
const drag = React.useRef(null);
|
|
33
33
|
return (_jsx("div", { role: "separator", "aria-orientation": "vertical", "aria-label": label, "aria-valuenow": width, "aria-valuemin": minWidth, "aria-valuemax": maxWidth, tabIndex: 0, onKeyDown: (event) => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ActivityItem {
|
|
3
|
+
id: string;
|
|
4
|
+
/** The word under the icon ("Explore"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The full name, spoken and shown on hover ("Database explorer"). Defaults to `label`. */
|
|
7
|
+
title?: string;
|
|
8
|
+
icon: React.ReactNode;
|
|
9
|
+
/** A count or marker on the icon (running tasks). */
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
/** Pressed state for an item that is a toggle (the AI panel) rather than a view. */
|
|
12
|
+
pressed?: boolean;
|
|
13
|
+
/** Run instead of selecting the item as the view. */
|
|
14
|
+
onSelect?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface ActivityBarProps {
|
|
17
|
+
/** The views, top down. */
|
|
18
|
+
items: readonly ActivityItem[];
|
|
19
|
+
/** Items pinned to the bottom (tasks, settings). */
|
|
20
|
+
footer?: readonly ActivityItem[];
|
|
21
|
+
/** The view on screen, or null when the side panel is closed. */
|
|
22
|
+
active: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* A view was chosen. Choosing the active one again passes null: the
|
|
25
|
+
* host closes the side panel, as an IDE does.
|
|
26
|
+
*/
|
|
27
|
+
onActiveChange: (id: string | null) => void;
|
|
28
|
+
/** Show the word under each icon. Defaults to true. */
|
|
29
|
+
showLabels?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The rail of views down the left of an IDE layout: a vertical toolbar with
|
|
34
|
+
* one tab stop (Up and Down move, Home and End jump), each item a toggle
|
|
35
|
+
* button that says whether its view is open.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ActivityBar({ items, footer, active, onActiveChange, showLabels, className, }: ActivityBarProps): React.JSX.Element;
|