@arbidocs/blocks 0.4.74 → 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 (63) hide show
  1. package/README.md +2 -1
  2. package/dist/agents/index.cjs +208 -207
  3. package/dist/agents/index.js +3 -2
  4. package/dist/{chunk-5LP54CWR.cjs → chunk-F4LUD3YC.cjs} +19 -18
  5. package/dist/chunk-F4LUD3YC.cjs.map +1 -0
  6. package/dist/{chunk-IA7RTPT3.cjs → chunk-IXALYQT7.cjs} +2 -200
  7. package/dist/chunk-IXALYQT7.cjs.map +1 -0
  8. package/dist/{chunk-KOSGX3UK.js → chunk-LT2UORRG.js} +4 -3
  9. package/dist/chunk-LT2UORRG.js.map +1 -0
  10. package/dist/chunk-NUNKSZKU.js +203 -0
  11. package/dist/chunk-NUNKSZKU.js.map +1 -0
  12. package/dist/{chunk-6OL5S7MJ.cjs → chunk-NYBIKDWI.cjs} +5 -2
  13. package/dist/chunk-NYBIKDWI.cjs.map +1 -0
  14. package/dist/{chunk-D46ZAPEE.js → chunk-R3PDNQYT.js} +5 -2
  15. package/dist/chunk-R3PDNQYT.js.map +1 -0
  16. package/dist/chunk-V4ISCZJ7.cjs +207 -0
  17. package/dist/chunk-V4ISCZJ7.cjs.map +1 -0
  18. package/dist/{chunk-BUHKUKKB.js → chunk-ZPLG7QYF.js} +4 -199
  19. package/dist/chunk-ZPLG7QYF.js.map +1 -0
  20. package/dist/connect/index.cjs +2 -2
  21. package/dist/connect/index.js +2 -2
  22. package/dist/databases/DatabaseColumnDialog.d.ts +43 -0
  23. package/dist/databases/DatabaseList.d.ts +28 -0
  24. package/dist/databases/DatabaseTable.d.ts +38 -0
  25. package/dist/databases/DatabaseToolbar.d.ts +38 -0
  26. package/dist/databases/NewDatabaseDialog.d.ts +25 -0
  27. package/dist/databases/SelectCellEditor.d.ts +6 -0
  28. package/dist/databases/SelectChip.d.ts +4 -0
  29. package/dist/databases/column-types.d.ts +58 -0
  30. package/dist/databases/databaseColumns.d.ts +28 -0
  31. package/dist/databases/index.cjs +1081 -0
  32. package/dist/databases/index.cjs.map +1 -0
  33. package/dist/databases/index.d.ts +13 -0
  34. package/dist/databases/index.js +1055 -0
  35. package/dist/databases/index.js.map +1 -0
  36. package/dist/facts/index.cjs +7 -6
  37. package/dist/facts/index.cjs.map +1 -1
  38. package/dist/facts/index.js +3 -2
  39. package/dist/facts/index.js.map +1 -1
  40. package/dist/files/index.cjs +14 -13
  41. package/dist/files/index.cjs.map +1 -1
  42. package/dist/files/index.js +4 -2
  43. package/dist/files/index.js.map +1 -1
  44. package/dist/index.cjs +466 -465
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.js +8 -7
  47. package/dist/index.js.map +1 -1
  48. package/dist/settings/index.cjs +1 -1
  49. package/dist/settings/index.js +1 -1
  50. package/dist/shell/ActionCluster.d.ts +3 -1
  51. package/dist/shell/index.cjs +45 -45
  52. package/dist/shell/index.js +1 -1
  53. package/dist/workflow-canvas/index.cjs +10 -9
  54. package/dist/workflow-canvas/index.cjs.map +1 -1
  55. package/dist/workflow-canvas/index.js +3 -2
  56. package/dist/workflow-canvas/index.js.map +1 -1
  57. package/package.json +9 -4
  58. package/dist/chunk-5LP54CWR.cjs.map +0 -1
  59. package/dist/chunk-6OL5S7MJ.cjs.map +0 -1
  60. package/dist/chunk-BUHKUKKB.js.map +0 -1
  61. package/dist/chunk-D46ZAPEE.js.map +0 -1
  62. package/dist/chunk-IA7RTPT3.cjs.map +0 -1
  63. package/dist/chunk-KOSGX3UK.js.map +0 -1
@@ -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>[];