@arbidocs/blocks 0.4.73 → 0.4.75

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.
Files changed (104) hide show
  1. package/README.md +2 -1
  2. package/dist/agents/index.cjs +255 -254
  3. package/dist/agents/index.js +5 -4
  4. package/dist/agents/workflows/WorkflowRunner.d.ts +20 -4
  5. package/dist/agents/workflows/WorkflowStepBar.d.ts +23 -0
  6. package/dist/agents/workflows/run.d.ts +1 -0
  7. package/dist/agents/workflows/types.d.ts +2 -0
  8. package/dist/chat/index.cjs +124 -124
  9. package/dist/chat/index.js +3 -3
  10. package/dist/{chunk-3SFFTSOI.cjs → chunk-7CVF3DK2.cjs} +5 -5
  11. package/dist/{chunk-3SFFTSOI.cjs.map → chunk-7CVF3DK2.cjs.map} +1 -1
  12. package/dist/{chunk-V3L5DONY.cjs → chunk-B4SRYJLM.cjs} +31 -2
  13. package/dist/chunk-B4SRYJLM.cjs.map +1 -0
  14. package/dist/{chunk-IUR565UW.cjs → chunk-F4LUD3YC.cjs} +49 -48
  15. package/dist/chunk-F4LUD3YC.cjs.map +1 -0
  16. package/dist/{chunk-WOYUXVVQ.cjs → chunk-HITAN7JF.cjs} +4 -4
  17. package/dist/{chunk-WOYUXVVQ.cjs.map → chunk-HITAN7JF.cjs.map} +1 -1
  18. package/dist/{chunk-3VQYJBOI.js → chunk-HOXKR26S.js} +31 -4
  19. package/dist/chunk-HOXKR26S.js.map +1 -0
  20. package/dist/{chunk-KJ3QEKOJ.cjs → chunk-IPGKTUF7.cjs} +7 -33
  21. package/dist/chunk-IPGKTUF7.cjs.map +1 -0
  22. package/dist/{chunk-IA7RTPT3.cjs → chunk-IXALYQT7.cjs} +2 -200
  23. package/dist/chunk-IXALYQT7.cjs.map +1 -0
  24. package/dist/{chunk-QDNXEB3T.js → chunk-LT2UORRG.js} +7 -6
  25. package/dist/chunk-LT2UORRG.js.map +1 -0
  26. package/dist/{chunk-ORA2XE7U.js → chunk-MK6NJQGF.js} +3 -3
  27. package/dist/{chunk-ORA2XE7U.js.map → chunk-MK6NJQGF.js.map} +1 -1
  28. package/dist/chunk-NUNKSZKU.js +203 -0
  29. package/dist/chunk-NUNKSZKU.js.map +1 -0
  30. package/dist/{chunk-6OL5S7MJ.cjs → chunk-NYBIKDWI.cjs} +5 -2
  31. package/dist/chunk-NYBIKDWI.cjs.map +1 -0
  32. package/dist/{chunk-GTNUQBXI.cjs → chunk-P2RBE3FD.cjs} +254 -102
  33. package/dist/chunk-P2RBE3FD.cjs.map +1 -0
  34. package/dist/{chunk-D46ZAPEE.js → chunk-R3PDNQYT.js} +5 -2
  35. package/dist/chunk-R3PDNQYT.js.map +1 -0
  36. package/dist/{chunk-G5DP27DU.js → chunk-UIWLDSTF.js} +3 -29
  37. package/dist/chunk-UIWLDSTF.js.map +1 -0
  38. package/dist/chunk-V4ISCZJ7.cjs +207 -0
  39. package/dist/chunk-V4ISCZJ7.cjs.map +1 -0
  40. package/dist/{chunk-VRPRAU3J.js → chunk-WJEKRSPH.js} +3 -3
  41. package/dist/{chunk-VRPRAU3J.js.map → chunk-WJEKRSPH.js.map} +1 -1
  42. package/dist/{chunk-2P3T23C7.js → chunk-YWYVIQ7T.js} +256 -104
  43. package/dist/chunk-YWYVIQ7T.js.map +1 -0
  44. package/dist/{chunk-BUHKUKKB.js → chunk-ZPLG7QYF.js} +4 -199
  45. package/dist/chunk-ZPLG7QYF.js.map +1 -0
  46. package/dist/connect/index.cjs +96 -37
  47. package/dist/connect/index.cjs.map +1 -1
  48. package/dist/connect/index.js +81 -22
  49. package/dist/connect/index.js.map +1 -1
  50. package/dist/connection/ConnectedWorkflowRunner.d.ts +5 -1
  51. package/dist/connection/useWorkflowThread.d.ts +4 -0
  52. package/dist/databases/DatabaseColumnDialog.d.ts +43 -0
  53. package/dist/databases/DatabaseList.d.ts +28 -0
  54. package/dist/databases/DatabaseTable.d.ts +38 -0
  55. package/dist/databases/DatabaseToolbar.d.ts +38 -0
  56. package/dist/databases/NewDatabaseDialog.d.ts +25 -0
  57. package/dist/databases/SelectCellEditor.d.ts +6 -0
  58. package/dist/databases/SelectChip.d.ts +4 -0
  59. package/dist/databases/column-types.d.ts +58 -0
  60. package/dist/databases/databaseColumns.d.ts +28 -0
  61. package/dist/databases/index.cjs +1081 -0
  62. package/dist/databases/index.cjs.map +1 -0
  63. package/dist/databases/index.d.ts +13 -0
  64. package/dist/databases/index.js +1055 -0
  65. package/dist/databases/index.js.map +1 -0
  66. package/dist/facts/index.cjs +7 -6
  67. package/dist/facts/index.cjs.map +1 -1
  68. package/dist/facts/index.js +3 -2
  69. package/dist/facts/index.js.map +1 -1
  70. package/dist/files/index.cjs +14 -13
  71. package/dist/files/index.cjs.map +1 -1
  72. package/dist/files/index.js +4 -2
  73. package/dist/files/index.js.map +1 -1
  74. package/dist/index.cjs +632 -631
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.js +12 -11
  77. package/dist/index.js.map +1 -1
  78. package/dist/settings/index.cjs +1 -1
  79. package/dist/settings/index.js +1 -1
  80. package/dist/shell/ActionCluster.d.ts +3 -1
  81. package/dist/shell/index.cjs +45 -45
  82. package/dist/shell/index.js +1 -1
  83. package/dist/studio/index.cjs +4 -4
  84. package/dist/studio/index.js +3 -3
  85. package/dist/workflow-canvas/StepInspector.d.ts +11 -0
  86. package/dist/workflow-canvas/WorkflowCanvas.d.ts +6 -2
  87. package/dist/workflow-canvas/index.cjs +202 -91
  88. package/dist/workflow-canvas/index.cjs.map +1 -1
  89. package/dist/workflow-canvas/index.js +170 -59
  90. package/dist/workflow-canvas/index.js.map +1 -1
  91. package/dist/workflow-canvas/viewport.d.ts +47 -0
  92. package/package.json +9 -4
  93. package/dist/chunk-2P3T23C7.js.map +0 -1
  94. package/dist/chunk-3VQYJBOI.js.map +0 -1
  95. package/dist/chunk-6OL5S7MJ.cjs.map +0 -1
  96. package/dist/chunk-BUHKUKKB.js.map +0 -1
  97. package/dist/chunk-D46ZAPEE.js.map +0 -1
  98. package/dist/chunk-G5DP27DU.js.map +0 -1
  99. package/dist/chunk-GTNUQBXI.cjs.map +0 -1
  100. package/dist/chunk-IA7RTPT3.cjs.map +0 -1
  101. package/dist/chunk-IUR565UW.cjs.map +0 -1
  102. package/dist/chunk-KJ3QEKOJ.cjs.map +0 -1
  103. package/dist/chunk-QDNXEB3T.js.map +0 -1
  104. package/dist/chunk-V3L5DONY.cjs.map +0 -1
@@ -0,0 +1,38 @@
1
+ import { type GridViewProps } from '../files/GridView';
2
+ import { type DatabaseColumnLabels } from './databaseColumns';
3
+ import type { DatabaseColumnView, DatabaseRowView } from './column-types';
4
+ export interface DatabaseTableLabels {
5
+ newRow: string;
6
+ emptyTitle: string;
7
+ emptyMessage: string;
8
+ noColumnsTitle: string;
9
+ noColumnsMessage: string;
10
+ noMatches: string;
11
+ }
12
+ export declare const DEFAULT_DATABASE_TABLE_LABELS: DatabaseTableLabels;
13
+ export interface DatabaseTableProps {
14
+ columns: DatabaseColumnView[];
15
+ rows: DatabaseRowView[];
16
+ /** An edited cell: the value is already in the API's form (`null` empties the cell). */
17
+ onCellChange?: (row: DatabaseRowView, columnId: string, value: unknown) => void;
18
+ onAddRow?: () => void;
19
+ onAddColumn?: () => void;
20
+ onEditColumn?: (column: DatabaseColumnView) => void;
21
+ /** Ticked rows (for a bulk delete). With it, rows show a checkbox. */
22
+ onSelectionChange?: (rows: DatabaseRowView[]) => void;
23
+ selected?: DatabaseRowView[];
24
+ /** Read-only: a database of another (public) workspace. */
25
+ readOnly?: boolean;
26
+ /** Rows are filtered by a search: an empty result says so instead of "no rows yet". */
27
+ isFiltered?: boolean;
28
+ isLoading?: boolean;
29
+ locale?: string;
30
+ /** Saved column state key (AG Grid persists by it): one per database. */
31
+ gridId?: string;
32
+ height?: GridViewProps<DatabaseRowView>['height'];
33
+ labels?: Partial<DatabaseTableLabels>;
34
+ columnLabels?: Partial<DatabaseColumnLabels>;
35
+ gridProps?: Partial<Omit<GridViewProps<DatabaseRowView>, 'items' | 'columnDefs' | 'getItemId'>>;
36
+ testId?: string;
37
+ }
38
+ export declare function DatabaseTable({ columns, rows, onCellChange, onAddRow, onAddColumn, onEditColumn, onSelectionChange, selected, readOnly, isFiltered, isLoading, locale, gridId, height, labels, columnLabels, gridProps, testId, }: DatabaseTableProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ export type DatabaseExportFormat = 'csv' | 'xlsx';
2
+ export interface DatabaseToolbarLabels {
3
+ back: string;
4
+ rename: string;
5
+ rows: (count: number) => string;
6
+ showing: (shown: number, total: number) => string;
7
+ search: string;
8
+ deleteSelected: (count: number) => string;
9
+ more: string;
10
+ importRows: string;
11
+ exportXlsx: string;
12
+ exportCsv: string;
13
+ deleteDatabase: string;
14
+ readOnly: string;
15
+ }
16
+ export declare const DEFAULT_DATABASE_TOOLBAR_LABELS: DatabaseToolbarLabels;
17
+ export interface DatabaseToolbarProps {
18
+ name: string;
19
+ description?: string | null;
20
+ /** Rows matching the search (all rows without one). */
21
+ total: number;
22
+ /** Rows loaded into the grid, when fewer than `total`. */
23
+ shown?: number;
24
+ search: string;
25
+ onSearchChange: (text: string) => void;
26
+ onBack?: () => void;
27
+ onRename?: (name: string) => void;
28
+ selectedCount?: number;
29
+ onDeleteSelected?: () => void;
30
+ /** Append rows from a .csv / .xlsx file. */
31
+ onImportRows?: (file: File) => void;
32
+ onExport?: (format: DatabaseExportFormat) => void;
33
+ /** Delete the whole database (the host confirms first). */
34
+ onDeleteDatabase?: () => void;
35
+ readOnly?: boolean;
36
+ labels?: Partial<DatabaseToolbarLabels>;
37
+ }
38
+ export declare function DatabaseToolbar({ name, description, total, shown, search, onSearchChange, onBack, onRename, selectedCount, onDeleteSelected, onImportRows, onExport, onDeleteDatabase, readOnly, labels, }: DatabaseToolbarProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ export interface NewDatabaseDialogLabels {
2
+ title: string;
3
+ description: string;
4
+ name: string;
5
+ namePlaceholder: string;
6
+ about: string;
7
+ aboutPlaceholder: string;
8
+ cancel: string;
9
+ create: string;
10
+ creating: string;
11
+ }
12
+ export declare const DEFAULT_NEW_DATABASE_DIALOG_LABELS: NewDatabaseDialogLabels;
13
+ export interface NewDatabaseDraft {
14
+ name: string;
15
+ description: string | null;
16
+ }
17
+ export interface NewDatabaseDialogProps {
18
+ open: boolean;
19
+ onOpenChange: (open: boolean) => void;
20
+ onCreate: (draft: NewDatabaseDraft) => void;
21
+ isCreating?: boolean;
22
+ error?: string | null;
23
+ labels?: Partial<NewDatabaseDialogLabels>;
24
+ }
25
+ export declare function NewDatabaseDialog({ open, onOpenChange, onCreate, isCreating, error, labels, }: NewDatabaseDialogProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { CustomCellEditorProps } from 'ag-grid-react';
2
+ export interface SelectCellEditorParams {
3
+ options: string[];
4
+ clearLabel?: string;
5
+ }
6
+ export declare function SelectCellEditor(props: CustomCellEditorProps & SelectCellEditorParams): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** A select option as a coloured chip (the same colour wherever the option appears). */
2
+ export declare function SelectChip({ value }: {
3
+ value: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Databases: the shapes the blocks read, and the per-type rules for showing and editing a cell.
3
+ *
4
+ * A database is a user-defined table (a client database, billing records). Its columns are typed:
5
+ * `text`, `number`, `date`, `checkbox` or `select`. The server checks and normalises every cell
6
+ * (dates arrive as ISO `YYYY-MM-DD` or a full timestamp, numbers as numbers, a select as one of its
7
+ * options), so the blocks only format for display and turn an editor's value into what the API takes.
8
+ */
9
+ export type DatabaseColumnType = 'text' | 'number' | 'date' | 'checkbox' | 'select';
10
+ /** Every type, in the order a type picker lists them. */
11
+ export declare const DATABASE_COLUMN_TYPES: DatabaseColumnType[];
12
+ /** A column as the blocks read it (the API's `DatabaseColumn`). */
13
+ export interface DatabaseColumnView {
14
+ id: string;
15
+ name: string;
16
+ type: DatabaseColumnType;
17
+ options?: string[] | null;
18
+ }
19
+ /** A row as the blocks read it: cell values keyed by column id; an empty cell is absent. */
20
+ export interface DatabaseRowView {
21
+ id: string;
22
+ values: Record<string, unknown>;
23
+ }
24
+ /** A database as a list shows it (the API's `DatabaseRead`). */
25
+ export interface DatabaseSummaryView {
26
+ id: string;
27
+ name: string;
28
+ description?: string | null;
29
+ columns: DatabaseColumnView[];
30
+ row_count: number;
31
+ /** False for a database of another (public) workspace: read here, edited in its own workspace. */
32
+ editable: boolean;
33
+ updated_at?: string | null;
34
+ }
35
+ export interface DatabaseColumnTypeLabels {
36
+ text: string;
37
+ number: string;
38
+ date: string;
39
+ checkbox: string;
40
+ select: string;
41
+ }
42
+ export declare const DEFAULT_DATABASE_COLUMN_TYPE_LABELS: DatabaseColumnTypeLabels;
43
+ export declare function optionTone(option: string): string;
44
+ /**
45
+ * A stored date for display. A bare `YYYY-MM-DD` is a calendar day: it is shown from its own
46
+ * components, never through a time zone (which would move it a day for viewers west of UTC).
47
+ */
48
+ export declare function formatDateValue(value: string, locale?: string): string;
49
+ export declare function formatNumberValue(value: number, locale?: string): string;
50
+ /** A cell as text: what a cell shows, what search and copy see. Checkboxes read as Yes/No. */
51
+ export declare function formatCell(value: unknown, type: DatabaseColumnType, locale?: string): string;
52
+ /**
53
+ * An editor's value as the API takes it. Empty becomes `null` (which empties the cell); everything
54
+ * else goes as typed and the server checks it, so a bad value comes back as a 422 naming the column.
55
+ */
56
+ export declare function toApiValue(value: unknown, type: DatabaseColumnType): unknown;
57
+ /** Sort comparator for a column's stored values: empty cells last, then by type. */
58
+ export declare function compareCells(a: unknown, b: unknown, type: DatabaseColumnType): number;
@@ -0,0 +1,28 @@
1
+ import type { ColDef } from 'ag-grid-community';
2
+ import { Type } from 'lucide-react';
3
+ import { type DatabaseColumnType, type DatabaseColumnView, type DatabaseRowView } from './column-types';
4
+ import { SelectChip } from './SelectChip';
5
+ export { SelectChip };
6
+ export interface DatabaseColumnLabels {
7
+ addColumn: string;
8
+ columnSettings: (name: string) => string;
9
+ }
10
+ export declare const DEFAULT_DATABASE_COLUMN_LABELS: DatabaseColumnLabels;
11
+ /** colId of the trailing "add a column" column (never a database column id). */
12
+ export declare const ADD_COLUMN_COL_ID = "__add_column";
13
+ export declare const COLUMN_TYPE_ICONS: Record<DatabaseColumnType, typeof Type>;
14
+ export interface DatabaseColumnOptions {
15
+ /** No editing, no column settings, no add-column button (a database of another workspace). */
16
+ readOnly?: boolean;
17
+ /** Open a column's settings (rename, options, delete). */
18
+ onEditColumn?: (column: DatabaseColumnView) => void;
19
+ /** Add a column (the trailing "+" header). */
20
+ onAddColumn?: () => void;
21
+ /** Locale for numbers and dates. */
22
+ locale?: string;
23
+ labels?: Partial<DatabaseColumnLabels>;
24
+ }
25
+ /** Wide enough for the type's values and for the header (icon, name, settings button). */
26
+ export declare function columnWidth(column: DatabaseColumnView): number;
27
+ /** One grid column per database column, then the "add a column" column (unless read-only). */
28
+ export declare function createDatabaseColumns(columns: DatabaseColumnView[], options?: DatabaseColumnOptions): ColDef<DatabaseRowView>[];