@pstdio/ui 0.8.0 → 0.10.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.
Files changed (93) hide show
  1. package/dist/{MermaidComponent-D7Baqkwx.js → MermaidComponent-Cz_Iob5U.js} +56 -53
  2. package/dist/MermaidComponent-Cz_Iob5U.js.map +1 -0
  3. package/dist/chat-ui.js +117 -117
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/data-renderer/data-renderer-board.d.ts +1 -0
  6. package/dist/components/data-renderer/data-renderer-card.d.ts +5 -20
  7. package/dist/components/data-renderer/data-renderer-content.d.ts +20 -0
  8. package/dist/components/data-renderer/data-renderer-grouping.d.ts +11 -10
  9. package/dist/components/data-renderer/data-renderer-helpers.d.ts +63 -15
  10. package/dist/components/data-renderer/data-renderer-list.d.ts +13 -8
  11. package/dist/components/data-renderer/data-renderer-story-fixtures.d.ts +13 -0
  12. package/dist/components/data-renderer/data-renderer-toolbar.d.ts +12 -0
  13. package/dist/components/data-renderer/data-renderer.d.ts +15 -23
  14. package/dist/components/data-renderer/display-menu.d.ts +9 -8
  15. package/dist/components/data-renderer/filter-menu.d.ts +5 -4
  16. package/dist/components/data-renderer/types.d.ts +83 -49
  17. package/dist/components/data-renderer/use-data-renderer-store.d.ts +15 -11
  18. package/dist/components/data-renderer/use-resolved-attributes.d.ts +14 -0
  19. package/dist/components/diff-viewer/diff-card-body.d.ts +10 -0
  20. package/dist/components/diff-viewer/diff-card-content.d.ts +1 -0
  21. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  22. package/dist/components/diff-viewer/diff-drawer-empty-state.d.ts +1 -0
  23. package/dist/components/diff-viewer/diff-drawer-height.d.ts +10 -0
  24. package/dist/components/diff-viewer/diff-drawer-scroll.d.ts +47 -0
  25. package/dist/components/diff-viewer/diff-drawer.d.ts +2 -7
  26. package/dist/components/diff-viewer/diff-size.d.ts +2 -0
  27. package/dist/components/diff-viewer/use-selected-diff-scroll.d.ts +19 -0
  28. package/dist/components/icon-color-picker.d.ts +29 -0
  29. package/dist/components/list-row/list-row-content.d.ts +9 -0
  30. package/dist/components/list-row/list-row.types.d.ts +3 -0
  31. package/dist/components/palette.d.ts +1 -0
  32. package/dist/components/param-editor/index.d.ts +2 -0
  33. package/dist/components/rich-text/shared/lexical-code.d.ts +2 -0
  34. package/dist/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.d.ts +1 -1
  35. package/dist/components/rich-text/shared/prism-global.d.ts +2 -0
  36. package/dist/components/tab-strip/tab-visibility-filter.d.ts +19 -0
  37. package/dist/components/tab-strip/tab-visibility.store.d.ts +41 -0
  38. package/dist/components/tag-editor/index.d.ts +4 -0
  39. package/dist/components/tag-editor/tag-editor-row.d.ts +19 -0
  40. package/dist/components/tag-editor/tag-editor.d.ts +2 -0
  41. package/dist/components/tag-editor/tag-editor.types.d.ts +44 -0
  42. package/dist/components/tag-editor/tag-settings-panel.d.ts +24 -0
  43. package/dist/components/tree-list/tree-list-model.d.ts +58 -0
  44. package/dist/components/tree-list/tree-list-node-row.d.ts +20 -0
  45. package/dist/components/tree-list/tree-list-order-filter.d.ts +3 -0
  46. package/dist/components/tree-list/tree-list-order.store.d.ts +42 -0
  47. package/dist/components/tree-list/tree-list-reorder.d.ts +13 -0
  48. package/dist/components/tree-list/tree-list-section-header.d.ts +14 -0
  49. package/dist/components/tree-list/tree-list-sortable.d.ts +22 -0
  50. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +17 -0
  51. package/dist/components/tree-list/tree-list-visibility.store.d.ts +45 -0
  52. package/dist/components/tree-list/tree-list.d.ts +7 -27
  53. package/dist/components/tree-list/tree-list.types.d.ts +2 -0
  54. package/dist/components/tree-list/use-tree-list-keyboard-navigation.d.ts +15 -0
  55. package/dist/get-file-type-icon-ufFb0IkR.js +102 -0
  56. package/dist/get-file-type-icon-ufFb0IkR.js.map +1 -0
  57. package/dist/index.d.ts +22 -3
  58. package/dist/index.js +5840 -4141
  59. package/dist/index.js.map +1 -1
  60. package/dist/{rich-message-33DPxuWJ.js → rich-message-CEOSsdR2.js} +428 -421
  61. package/dist/rich-message-CEOSsdR2.js.map +1 -0
  62. package/dist/rich-text.js +26 -26
  63. package/dist/rich-text.js.map +1 -1
  64. package/dist/theme/custom/index.d.ts +0 -3
  65. package/dist/theme/index.d.ts +1 -1
  66. package/dist/theme/recipes/editable.d.ts +46 -1
  67. package/dist/theme/recipes/tabs.d.ts +30 -0
  68. package/dist/theme/tokens/colors.d.ts +6 -0
  69. package/dist/{theme-D-aCJqTf.js → theme-DOFdi_Ir.js} +244 -149
  70. package/dist/theme-DOFdi_Ir.js.map +1 -0
  71. package/dist/theme.js +2 -4
  72. package/dist/utils/browser-storage.d.ts +7 -0
  73. package/dist/utils/prism.d.ts +1 -0
  74. package/package.json +9 -4
  75. package/dist/MermaidComponent-D7Baqkwx.js.map +0 -1
  76. package/dist/components/data-renderer/tag-badge.d.ts +0 -10
  77. package/dist/components/data-renderer/tag-option-icon.d.ts +0 -2
  78. package/dist/get-file-type-icon-Bwqf1WXA.js +0 -101
  79. package/dist/get-file-type-icon-Bwqf1WXA.js.map +0 -1
  80. package/dist/rich-message-33DPxuWJ.js.map +0 -1
  81. package/dist/theme/custom/monokai.json.d.ts +0 -80
  82. package/dist/theme-D-aCJqTf.js.map +0 -1
  83. /package/dist/components/{param-editor-color-input.d.ts → param-editor/color-input.d.ts} +0 -0
  84. /package/dist/components/{param-editor-date-input.d.ts → param-editor/date-input.d.ts} +0 -0
  85. /package/dist/components/{param-editor-horizontal-text-input.d.ts → param-editor/horizontal-text-input.d.ts} +0 -0
  86. /package/dist/components/{param-editor-input-group.d.ts → param-editor/input-group.d.ts} +0 -0
  87. /package/dist/components/{param-editor-number-input.d.ts → param-editor/number-input.d.ts} +0 -0
  88. /package/dist/components/{param-editor-horizontal.d.ts → param-editor/param-editor-horizontal.d.ts} +0 -0
  89. /package/dist/components/{param-editor-label.d.ts → param-editor/param-editor-label.d.ts} +0 -0
  90. /package/dist/components/{param-editor.d.ts → param-editor/param-editor.d.ts} +0 -0
  91. /package/dist/components/{param-editor.types.d.ts → param-editor/param-editor.types.d.ts} +0 -0
  92. /package/dist/components/{param-editor-selection-input.d.ts → param-editor/selection-input.d.ts} +0 -0
  93. /package/dist/components/{param-editor-text-input.d.ts → param-editor/text-input.d.ts} +0 -0
@@ -22,6 +22,7 @@ export interface DataRendererBoardGroup {
22
22
  export interface DataRendererBoardColumn {
23
23
  id: string;
24
24
  label: string;
25
+ createLabel?: string;
25
26
  color?: string;
26
27
  items: DataRendererBoardItem[];
27
28
  groups?: DataRendererBoardGroup[];
@@ -1,30 +1,15 @@
1
- import { DragEventHandler } from 'react';
1
+ import { DragEventHandler, ReactNode } from 'react';
2
2
  import { WorkspaceBadgeProps } from '../workspace-badge';
3
- import { DataRendererTagOption } from './types';
4
- export interface DataRendererCardBadge {
5
- label: string;
6
- color?: string;
7
- }
8
- export interface DataRendererCardTagBadge {
9
- tagName: string;
10
- label: string;
11
- value: string | null;
12
- color?: string;
13
- options: DataRendererTagOption[];
14
- }
15
- interface DataRendererCardProps {
16
- ticketId: string;
17
- parentPath?: string[];
3
+ import { AttributeBadge } from './data-renderer-helpers';
4
+ export interface DataRendererCardProps {
18
5
  title: string;
19
- badges?: DataRendererCardBadge[];
20
- tagBadges?: DataRendererCardTagBadge[];
6
+ badges?: AttributeBadge[];
7
+ customSlots?: ReactNode[];
21
8
  workspaceBadge?: WorkspaceBadgeProps;
22
9
  isSelected?: boolean;
23
10
  draggable?: boolean;
24
11
  onDragStart?: DragEventHandler<HTMLDivElement>;
25
12
  onDragEnd?: DragEventHandler<HTMLDivElement>;
26
13
  onClick?: () => void;
27
- onTagChange?: (tagName: string, newValue: string) => void;
28
14
  }
29
15
  export declare const DataRendererCard: (props: DataRendererCardProps) => import("react/jsx-runtime").JSX.Element;
30
- export {};
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ import { DataRendererBoardColumn } from './data-renderer-board';
3
+ import { DataRendererListItem } from './data-renderer-list';
4
+ import { DataRendererSettings } from './types';
5
+ interface DataRendererContentProps {
6
+ viewMode: DataRendererSettings["viewMode"];
7
+ boardColumns: DataRendererBoardColumn[];
8
+ listItems: DataRendererListItem[];
9
+ selectedRowId: string | null;
10
+ emptyState?: ReactNode;
11
+ emptyTitle: string;
12
+ emptyDescription?: string;
13
+ onBoardMoveItem: (rowId: string, targetColumnId: string) => void;
14
+ onBoardMoveToGroup: (rowId: string, targetGroupKey: string) => void;
15
+ onCreateRow?: (columnId: string) => void;
16
+ onColumnAction?: (columnId: string, actionId: string) => Promise<void> | void;
17
+ listKey: string;
18
+ }
19
+ export declare const DataRendererContent: (props: DataRendererContentProps) => import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -1,22 +1,23 @@
1
- import { DataRendererFilterState, DataRendererOrdering, DataRendererRow, DataRendererTagDefinition, FilterCategory, GroupingField } from './types';
1
+ import { AttributeDescriptor, DataRendererFilterState, DataRendererOrdering, DataRendererRow } from './types';
2
2
  interface GroupingOptions {
3
- columnGrouping: GroupingField;
4
- rowGrouping: GroupingField;
3
+ attributes: AttributeDescriptor[];
4
+ columnGrouping: string;
5
+ rowGrouping: string;
5
6
  knownColumnKeys?: string[];
6
7
  }
7
8
  interface DataRendererRowGroup {
8
9
  key: string;
9
10
  label: string;
10
- tickets: DataRendererRow[];
11
+ rows: DataRendererRow[];
11
12
  }
12
13
  interface DataRendererColumnGroup {
13
14
  key: string;
14
15
  label: string;
15
- tickets: DataRendererRow[];
16
- rows: DataRendererRowGroup[];
16
+ rows: DataRendererRow[];
17
+ subgroups: DataRendererRowGroup[];
17
18
  }
18
- export declare const orderRows: (tickets: DataRendererRow[], ordering: DataRendererOrdering, tagDefinitions?: DataRendererTagDefinition[]) => DataRendererRow[];
19
- export declare const groupRows: (tickets: DataRendererRow[], options: GroupingOptions) => DataRendererColumnGroup[];
20
- export declare const filterRows: (tickets: DataRendererRow[], filters: DataRendererFilterState) => DataRendererRow[];
21
- export declare const countFilterValues: (tickets: DataRendererRow[], category: FilterCategory) => Record<string, number>;
19
+ export declare const orderRows: (rows: DataRendererRow[], ordering: DataRendererOrdering, attributes: AttributeDescriptor[]) => DataRendererRow[];
20
+ export declare const groupRows: (rows: DataRendererRow[], options: GroupingOptions) => DataRendererColumnGroup[];
21
+ export declare const filterRows: (rows: DataRendererRow[], filters: DataRendererFilterState, attributes: AttributeDescriptor[]) => DataRendererRow[];
22
+ export declare const countFilterValues: (rows: DataRendererRow[], attributeId: string, attributes: AttributeDescriptor[]) => Record<string, number>;
22
23
  export type { DataRendererColumnGroup, DataRendererRowGroup };
@@ -1,18 +1,66 @@
1
- import { DataRendererCardBadge, DataRendererCardTagBadge } from './data-renderer-card';
2
- import { DataRendererFilterCategory, DataRendererFilterState, DataRendererOption, DataRendererRow, DataRendererTagDefinition, DisplayProperty, FilterCategory, GroupingField, OrderingField } from './types';
1
+ import { ReactNode } from 'react';
2
+ import { AttributeDescriptor, AttributeType, DataRendererFilterState, DataRendererRow, DataRendererSettings, EnumOption } from './types';
3
+ /**
4
+ * Normalize an enum / enum-multi attribute's `options` to a plain `EnumOption[]`.
5
+ * Sources resolve via `getSnapshot()` on every call, so callers naturally see
6
+ * the latest values — pair with `useResolvedAttributes` to also rerender on
7
+ * source change.
8
+ */
9
+ export declare const getEnumOptions: (type: AttributeType) => EnumOption[];
3
10
  export declare const toTitleCase: (value: string) => string;
4
- export declare const buildDefaultFilterCategories: (tickets: DataRendererRow[], tagDefinitions: DataRendererTagDefinition[]) => DataRendererFilterCategory[];
5
- export declare const toBadges: (ticket: DataRendererRow, displayProperties: DisplayProperty[]) => DataRendererCardBadge[];
6
- export declare const toTagBadges: (ticket: DataRendererRow, displayProperties: DisplayProperty[], tagDefinitions: DataRendererTagDefinition[]) => DataRendererCardTagBadge[];
7
- export declare const buildTagOptions: (tagDefinitions: DataRendererTagDefinition[]) => {
8
- grouping: DataRendererOption<GroupingField>[];
9
- ordering: DataRendererOption<OrderingField>[];
10
- display: DataRendererOption<DisplayProperty>[];
11
- };
12
- export declare const orderGroupingOptions: <TValue extends string>(options: DataRendererOption<TValue>[]) => DataRendererOption<TValue>[];
13
- export declare const resolveSubGroupingOptions: (options: DataRendererOption<GroupingField>[], columnGrouping: GroupingField) => DataRendererOption<GroupingField>[];
14
- export declare const resolveListDropTargetColumnKey: (columnGrouping: GroupingField, placement?: {
11
+ /**
12
+ * Read a typed attribute value out of a row. enum-multi normalizes to an array;
13
+ * single-valued kinds normalize to undefined when missing.
14
+ */
15
+ export declare const getAttributeValue: (row: DataRendererRow, descriptor: AttributeDescriptor) => unknown;
16
+ export declare const getAttributeStringValues: (row: DataRendererRow, descriptor: AttributeDescriptor) => string[];
17
+ export declare const findEnumOption: (type: AttributeType, value: string) => EnumOption | undefined;
18
+ export declare const enumOptionLabel: (type: AttributeType, value: string) => string;
19
+ export interface AttributeBadge {
20
+ attributeId: string;
21
+ label: string;
22
+ color?: string;
23
+ }
24
+ /**
25
+ * Per-type default cell summary used by the card / list end-content. Returns
26
+ * null when the attribute has no displayable value.
27
+ */
28
+ export declare const renderAttributeBadge: (descriptor: AttributeDescriptor, row: DataRendererRow) => AttributeBadge | null;
29
+ export declare const collectDisplayBadges: (row: DataRendererRow, attributes: AttributeDescriptor[], displayProperties: string[]) => AttributeBadge[];
30
+ export declare const collectDisplayCustomSlots: (row: DataRendererRow, attributes: AttributeDescriptor[], displayProperties: string[]) => ReactNode[];
31
+ export interface FilterCategoryView {
32
+ id: string;
33
+ label: string;
34
+ options: {
35
+ value: string;
36
+ label: string;
37
+ color?: string;
38
+ }[];
39
+ }
40
+ /**
41
+ * Build the filter menu's category list from the declared attributes. Enum
42
+ * descriptors expose their declared options first; auto-derived values from
43
+ * the data fill in the gaps for string / date / number / user attributes (so
44
+ * filter chips for free-form fields don't require declaring every option).
45
+ */
46
+ export declare const buildFilterCategories: (attributes: AttributeDescriptor[], rows: DataRendererRow[]) => FilterCategoryView[];
47
+ export interface MenuOption {
48
+ value: string;
49
+ label: string;
50
+ }
51
+ export declare const buildGroupingOptions: (attributes: AttributeDescriptor[]) => MenuOption[];
52
+ export declare const buildOrderingOptions: (attributes: AttributeDescriptor[]) => MenuOption[];
53
+ export declare const buildDisplayPropertyOptions: (attributes: AttributeDescriptor[]) => MenuOption[];
54
+ export declare const resolveSubGroupingOptions: (options: MenuOption[], columnGrouping: string) => MenuOption[];
55
+ export declare const resolveListDropTargetColumnKey: (columnGrouping: string, placement?: {
15
56
  columnKey?: string;
16
57
  }) => string | undefined;
17
- export declare const resolveKnownColumnKeys: (columnGrouping: GroupingField, knownColumnKeys: string[] | undefined, categories: DataRendererFilterCategory[], filters?: DataRendererFilterState) => string[] | undefined;
18
- export declare const omitFilterCategory: (filters: DataRendererFilterState, category: FilterCategory) => DataRendererFilterState;
58
+ export declare const resolveKnownColumnKeys: (columnGrouping: string, attributes: AttributeDescriptor[], filters?: DataRendererFilterState) => string[] | undefined;
59
+ export declare const omitFilterCategory: (filters: DataRendererFilterState, id: string) => DataRendererFilterState;
60
+ /**
61
+ * Drop persisted settings entries that reference attribute ids no longer
62
+ * declared by the contribution. Falls back to defaults for missing grouping
63
+ * and ordering attributes so a stale saved view still loads cleanly.
64
+ */
65
+ export declare const sanitizeSettings: (settings: DataRendererSettings, attributes: AttributeDescriptor[]) => DataRendererSettings;
66
+ export declare const sanitizeFilters: (filters: DataRendererFilterState, attributes: AttributeDescriptor[]) => DataRendererFilterState;
@@ -1,31 +1,36 @@
1
1
  import { ComponentType, ReactNode } from 'react';
2
2
  import { ResourceContextAction } from '../resource-context-menu';
3
- import { DataRendererCardBadge, DataRendererCardTagBadge } from './data-renderer-card';
3
+ import { AttributeBadge } from './data-renderer-helpers';
4
4
  export interface DataRendererListItem {
5
5
  id: string;
6
- ticketId: string;
7
6
  title: string;
8
7
  countBadge?: number;
8
+ countColorPalette?: string;
9
9
  statusIcon?: ComponentType<{
10
10
  size?: number | string;
11
11
  }>;
12
12
  statusColor?: string;
13
- badges?: DataRendererCardBadge[];
14
- tagBadges?: DataRendererCardTagBadge[];
15
- date?: string;
16
- assigneeIcon?: ReactNode;
13
+ badges?: AttributeBadge[];
14
+ customSlots?: ReactNode[];
17
15
  children?: DataRendererListItem[];
18
16
  onClick?: () => void;
19
- onTagChange?: (tagName: string, newValue: string) => void;
20
17
  contextMenuActions?: ResourceContextAction[];
21
18
  draggable?: boolean;
22
- onDropTicket?: (ticketId: string) => void;
19
+ onDropRow?: (rowId: string) => void;
23
20
  }
24
21
  interface DataRendererListProps {
25
22
  items: DataRendererListItem[];
26
23
  selectedItemId?: string | null;
27
24
  onItemClick?: (item: DataRendererListItem) => void;
28
25
  }
26
+ type DataRendererListExpandedState = true | Record<string, boolean>;
27
+ interface FlattenedDataRendererListItem {
28
+ id: string;
29
+ item: DataRendererListItem;
30
+ depth: number;
31
+ canExpand: boolean;
32
+ }
29
33
  export declare const getDataRendererListIndentation: (depth: number) => string | undefined;
34
+ export declare const flattenDataRendererListItems: (items: DataRendererListItem[], expanded: DataRendererListExpandedState, depth?: number) => FlattenedDataRendererListItem[];
30
35
  export declare const DataRendererList: (props: DataRendererListProps) => import("react/jsx-runtime").JSX.Element;
31
36
  export {};
@@ -0,0 +1,13 @@
1
+ import { AttributeDescriptor, DataRendererRow } from './types';
2
+ export declare const attributes: AttributeDescriptor[];
3
+ export interface StoryRow extends DataRendererRow {
4
+ attributes: {
5
+ status: string;
6
+ assignee: string;
7
+ component: string;
8
+ priority?: string;
9
+ updated: string;
10
+ labels?: string[];
11
+ };
12
+ }
13
+ export declare const initialRows: StoryRow[];
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { AttributeDescriptor, DataRendererFilterState, DataRendererRow, DataRendererSettings } from './types';
3
+ export interface DataRendererToolbarProps<TRow extends DataRendererRow = DataRendererRow> {
4
+ rows: TRow[];
5
+ storageKey: string;
6
+ attributes: AttributeDescriptor[];
7
+ defaultSettings?: Partial<DataRendererSettings>;
8
+ defaultFilters?: DataRendererFilterState;
9
+ leading?: ReactNode;
10
+ align?: "split" | "end";
11
+ }
12
+ export declare const DataRendererToolbar: <TRow extends DataRendererRow>(props: DataRendererToolbarProps<TRow>) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { ResourceContextAction } from '../resource-context-menu';
2
3
  import { DataRendererBoardColumnAction } from './data-renderer-board';
3
- import { DataRendererFilterCategory, DataRendererOption, DataRendererRow, DataRendererTagDefinition, DisplayProperty, GroupingField, OrderingField } from './types';
4
+ import { AttributeDescriptor, DataRendererFilterState, DataRendererRow, DataRendererSettings } from './types';
4
5
  export interface BoardColumnConfig {
5
6
  color?: string;
6
7
  canDragIn?: boolean;
@@ -8,33 +9,24 @@ export interface BoardColumnConfig {
8
9
  canCreate?: boolean;
9
10
  actions?: DataRendererBoardColumnAction[];
10
11
  }
11
- interface DataRendererProps<TTicket extends DataRendererRow = DataRendererRow> {
12
- tickets: TTicket[];
12
+ export interface DataRendererProps<TRow extends DataRendererRow = DataRendererRow> {
13
+ rows: TRow[];
13
14
  storageKey: string;
14
- tagDefinitions?: DataRendererTagDefinition[];
15
- selectedTicketId?: string | null;
16
- groupingOptions?: DataRendererOption<GroupingField>[];
17
- orderingOptions?: DataRendererOption<OrderingField>[];
18
- displayPropertyOptions?: DataRendererOption<DisplayProperty>[];
19
- filterCategories?: DataRendererFilterCategory[];
20
- knownColumnKeys?: string[];
15
+ attributes: AttributeDescriptor[];
16
+ selectedRowId?: string | null;
17
+ emptyState?: ReactNode;
21
18
  emptyTitle?: string;
22
19
  emptyDescription?: string;
20
+ defaultSettings?: Partial<DataRendererSettings>;
21
+ defaultFilters?: DataRendererFilterState;
23
22
  hideToolbar?: boolean;
24
23
  toolbarLeading?: ReactNode;
25
- onTicketClick?: (ticket: TTicket) => void;
26
- onTagChange?: (ticketId: string, tagName: string, newValue: string) => void;
27
- onMoveTicket?: (ticketId: string, targetColumnId: string, context?: {
28
- columnGrouping: GroupingField;
29
- beforeTicketId?: string;
30
- }) => void;
31
- onMoveToGroup?: (ticketId: string, targetGroupKey: string, context?: {
32
- rowGrouping: GroupingField;
33
- beforeTicketId?: string;
34
- }) => void;
35
- onCreateTicket?: (columnId: string) => void;
24
+ onRowClick?: (row: TRow) => void;
25
+ onAttributeChange?: (rowId: string, attributeId: string, value: unknown) => void;
26
+ onReorder?: (rowId: string, beforeRowId?: string) => void;
27
+ onCreateRow?: (columnId: string) => void;
36
28
  onColumnAction?: (columnId: string, actionId: string) => Promise<void> | void;
37
29
  getBoardColumnConfig?: (groupKey: string) => BoardColumnConfig;
30
+ getRowContextMenuActions?: (row: TRow) => ResourceContextAction[];
38
31
  }
39
- export declare const DataRenderer: <TTicket extends DataRendererRow>(props: DataRendererProps<TTicket>) => import("react/jsx-runtime").JSX.Element;
40
- export type { DataRendererProps };
32
+ export declare const DataRenderer: <TRow extends DataRendererRow>(props: DataRendererProps<TRow>) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,16 @@
1
- import { DataRendererOption, DataRendererSettings, DisplayProperty, GroupingField, OrderingField } from './types';
1
+ import { MenuOption } from './data-renderer-helpers';
2
+ import { DataRendererSettings } from './types';
2
3
  interface DisplayMenuProps {
3
4
  settings: DataRendererSettings;
4
- groupingOptions: DataRendererOption<GroupingField>[];
5
- orderingOptions: DataRendererOption<OrderingField>[];
6
- displayPropertyOptions: DataRendererOption<DisplayProperty>[];
5
+ groupingOptions: MenuOption[];
6
+ orderingOptions: MenuOption[];
7
+ displayPropertyOptions: MenuOption[];
7
8
  onViewModeChange: (value: DataRendererSettings["viewMode"]) => void;
8
- onColumnGroupingChange: (value: GroupingField) => void;
9
- onRowGroupingChange: (value: GroupingField) => void;
10
- onOrderingFieldChange: (value: OrderingField) => void;
9
+ onColumnGroupingChange: (value: string) => void;
10
+ onRowGroupingChange: (value: string) => void;
11
+ onOrderingAttributeIdChange: (value: string) => void;
11
12
  onSortDirectionToggle: () => void;
12
- onDisplayPropertyToggle: (property: DisplayProperty) => void;
13
+ onDisplayPropertyToggle: (property: string) => void;
13
14
  }
14
15
  export declare const DisplayMenu: (props: DisplayMenuProps) => import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -1,10 +1,11 @@
1
- import { DataRendererFilterCategory, DataRendererFilterState } from './types';
1
+ import { FilterCategoryView } from './data-renderer-helpers';
2
+ import { DataRendererFilterState } from './types';
2
3
  interface FilterMenuProps {
3
- categories: DataRendererFilterCategory[];
4
+ categories: FilterCategoryView[];
4
5
  filters: DataRendererFilterState;
5
6
  countsByCategory: Record<string, Record<string, number>>;
6
- onToggleFilterValue: (category: DataRendererFilterCategory["id"], value: string) => void;
7
- onClearFilter: (category: DataRendererFilterCategory["id"]) => void;
7
+ onToggleFilterValue: (attributeId: string, value: string) => void;
8
+ onClearFilter: (attributeId: string) => void;
8
9
  onClearAll: () => void;
9
10
  }
10
11
  export declare const FilterMenu: (props: FilterMenuProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,64 +1,98 @@
1
+ import { ReactNode } from 'react';
1
2
  export type ViewMode = "board" | "list";
2
- export type GroupingField = "status" | "assignee" | "none" | `tag:${string}`;
3
- export type OrderingField = "manual" | "updated" | "title" | "ticketId" | `tag:${string}`;
4
3
  export type SortDirection = "asc" | "desc";
5
- export type DisplayProperty = "id" | "status" | "assignee" | "updated" | `tag:${string}`;
6
- export type FilterCategory = "status" | "assignee" | `tag:${string}`;
7
- export interface DataRendererOrdering {
8
- field: OrderingField;
9
- direction: SortDirection;
10
- }
11
- export interface DataRendererSettings {
12
- viewMode: ViewMode;
13
- columnGrouping: GroupingField;
14
- rowGrouping: GroupingField;
15
- ordering: DataRendererOrdering;
16
- displayProperties: DisplayProperty[];
17
- }
18
- export type DataRendererFilterState = Partial<Record<FilterCategory, string[]>>;
19
- export interface DataRendererOption<TValue extends string> {
20
- value: TValue;
21
- label: string;
22
- }
23
- export interface DataRendererFilterOption {
24
- value: string;
25
- label: string;
26
- }
27
- export interface DataRendererFilterCategory {
28
- id: FilterCategory;
29
- label: string;
30
- options: DataRendererFilterOption[];
31
- }
32
- export interface DataRendererTagOption {
4
+ export declare const NO_GROUPING = "none";
5
+ export declare const MANUAL_ORDERING = "manual";
6
+ export interface EnumOption {
33
7
  value: string;
34
8
  label: string;
35
9
  color?: string;
36
10
  icon?: string | null;
37
11
  }
38
- export interface DataRendererTagDefinition {
39
- name: string;
12
+ /**
13
+ * Reactive options source for enum / enum-multi attributes. Mirrors React's
14
+ * useSyncExternalStore contract so a contribution can hand its options off as
15
+ * a live collection (e.g. a project-scoped resource) instead of a frozen
16
+ * array, and the renderer subscribes to it the same way it subscribes to rows.
17
+ */
18
+ export interface EnumOptionsSource {
19
+ subscribe: (listener: () => void) => () => void;
20
+ getSnapshot: () => EnumOption[];
21
+ }
22
+ export type EnumOptions = EnumOption[] | EnumOptionsSource;
23
+ export type AttributeType = {
24
+ kind: "enum";
25
+ options: EnumOptions;
26
+ } | {
27
+ kind: "enum-multi";
28
+ options: EnumOptions;
29
+ } | {
30
+ kind: "string";
31
+ } | {
32
+ kind: "date";
33
+ } | {
34
+ kind: "number";
35
+ } | {
36
+ kind: "user";
37
+ };
38
+ export declare const isEnumOptionsSource: (options: EnumOptions) => options is EnumOptionsSource;
39
+ export type AttributeKind = AttributeType["kind"];
40
+ export interface AttributeDescriptor {
41
+ id: string;
40
42
  label: string;
41
- options: DataRendererTagOption[];
43
+ type: AttributeType;
44
+ filterable?: boolean;
45
+ groupable?: boolean;
46
+ sortable?: boolean;
47
+ displayable?: boolean;
48
+ editable?: boolean;
49
+ render?: (value: unknown, row: DataRendererRow) => ReactNode;
50
+ compare?: (a: unknown, b: unknown) => number;
42
51
  }
43
- export interface DataRendererTag {
44
- name: string;
45
- value: string;
52
+ /**
53
+ * Reactive source for an entire attribute schema. Mirrors React's
54
+ * useSyncExternalStore contract so consumers (e.g. the workbench's
55
+ * data-renderer bridge) can subscribe and re-resolve when the schema changes
56
+ * — letting a contribution add/remove/edit attributes at runtime without
57
+ * re-registering.
58
+ */
59
+ export interface AttributesSource {
60
+ subscribe: (listener: () => void) => () => void;
61
+ getSnapshot: () => AttributeDescriptor[];
46
62
  }
63
+ export declare const isAttributesSource: (attributes: AttributeDescriptor[] | AttributesSource) => attributes is AttributesSource;
47
64
  export interface DataRendererRow {
48
65
  id: string;
49
- ticketId: string;
50
66
  title: string;
51
- status?: string | null;
52
- statusColor?: string;
53
- assignee?: string | null;
54
- tags?: DataRendererTag[];
55
- updatedAt?: string | null;
56
- parentPath?: string[];
57
- isSubIssue?: boolean;
67
+ /**
68
+ * Optional navigation handle. When set, the renderer's default click handler
69
+ * routes through the contribution's onRowClick (which typically opens the
70
+ * resource via the workbench).
71
+ */
72
+ resource?: unknown;
73
+ attributes: Record<string, unknown>;
74
+ }
75
+ export interface DataRendererOrdering {
76
+ attributeId: string | typeof MANUAL_ORDERING;
77
+ direction: SortDirection;
78
+ }
79
+ export interface DataRendererSettings {
80
+ viewMode: ViewMode;
81
+ columnGrouping: string | typeof NO_GROUPING;
82
+ rowGrouping: string | typeof NO_GROUPING;
83
+ ordering: DataRendererOrdering;
84
+ displayProperties: string[];
58
85
  }
86
+ export type DataRendererFilterState = Record<string, string[]>;
59
87
  export declare const DEFAULT_DATA_RENDERER_SETTINGS: DataRendererSettings;
60
- export declare const DEFAULT_GROUPING_OPTIONS: DataRendererOption<GroupingField>[];
61
- export declare const DEFAULT_ORDERING_OPTIONS: DataRendererOption<OrderingField>[];
62
- export declare const DEFAULT_DISPLAY_PROPERTY_OPTIONS: DataRendererOption<DisplayProperty>[];
63
- export declare const isTagKey: (key: string) => key is `tag:${string}`;
64
- export declare const toTagName: (key: `tag:${string}`) => string;
88
+ export declare const isEnumType: (type: AttributeType) => type is Extract<AttributeType, {
89
+ kind: "enum";
90
+ }>;
91
+ export declare const isMultiEnumType: (type: AttributeType) => type is Extract<AttributeType, {
92
+ kind: "enum-multi";
93
+ }>;
94
+ /**
95
+ * Look up an attribute by id from a contribution-provided descriptor list.
96
+ * Returns undefined for sentinels ("none", "manual") or unknown ids.
97
+ */
98
+ export declare const findAttribute: (attributes: AttributeDescriptor[], id: string | undefined) => AttributeDescriptor | undefined;
@@ -1,26 +1,30 @@
1
- import { DataRendererFilterState, DataRendererSettings, DisplayProperty, FilterCategory } from './types';
1
+ import { DataRendererFilterState, DataRendererSettings } from './types';
2
2
  interface DataRendererSnapshot {
3
3
  settings: DataRendererSettings;
4
4
  filters: DataRendererFilterState;
5
5
  }
6
+ interface DataRendererStoreInitialState {
7
+ settings?: Partial<DataRendererSettings>;
8
+ filters?: DataRendererFilterState;
9
+ }
6
10
  interface DataRendererState extends DataRendererSnapshot {
7
11
  setViewMode: (viewMode: DataRendererSettings["viewMode"]) => void;
8
12
  setColumnGrouping: (columnGrouping: DataRendererSettings["columnGrouping"]) => void;
9
13
  setRowGrouping: (rowGrouping: DataRendererSettings["rowGrouping"]) => void;
10
14
  setOrdering: (ordering: DataRendererSettings["ordering"]) => void;
11
- setOrderingField: (field: DataRendererSettings["ordering"]["field"]) => void;
12
- setDisplayProperties: (displayProperties: DisplayProperty[]) => void;
15
+ setOrderingAttributeId: (attributeId: DataRendererSettings["ordering"]["attributeId"]) => void;
16
+ setDisplayProperties: (displayProperties: string[]) => void;
13
17
  toggleSortDirection: () => void;
14
- toggleDisplayProperty: (property: DataRendererSettings["displayProperties"][number]) => void;
15
- setFilter: (category: FilterCategory, values: string[]) => void;
16
- toggleFilterValue: (category: FilterCategory, value: string) => void;
17
- clearFilter: (category: FilterCategory) => void;
18
+ toggleDisplayProperty: (property: string) => void;
19
+ setFilter: (attributeId: string, values: string[]) => void;
20
+ toggleFilterValue: (attributeId: string, value: string) => void;
21
+ clearFilter: (attributeId: string) => void;
18
22
  clearAllFilters: () => void;
19
23
  reset: () => void;
20
24
  }
21
25
  interface CreateDataRendererStoreOptions {
22
26
  storageKey: string;
23
- initialState?: Partial<DataRendererSnapshot>;
27
+ initialState?: DataRendererStoreInitialState;
24
28
  }
25
29
  export declare const createDataRendererStore: (options: CreateDataRendererStoreOptions) => Omit<import('zustand').StoreApi<DataRendererState>, "setState" | "persist"> & {
26
30
  setState(partial: DataRendererState | Partial<DataRendererState> | ((state: DataRendererState) => DataRendererState | Partial<DataRendererState>), replace?: false | undefined): unknown;
@@ -35,7 +39,7 @@ export declare const createDataRendererStore: (options: CreateDataRendererStoreO
35
39
  getOptions: () => Partial<import('zustand/middleware').PersistOptions<DataRendererState, unknown, unknown>>;
36
40
  };
37
41
  };
38
- export declare const getDataRendererStore: (storageKey: string) => Omit<import('zustand').StoreApi<DataRendererState>, "setState" | "persist"> & {
42
+ export declare const getDataRendererStore: (storageKey: string, initialState?: DataRendererStoreInitialState) => Omit<import('zustand').StoreApi<DataRendererState>, "setState" | "persist"> & {
39
43
  setState(partial: DataRendererState | Partial<DataRendererState> | ((state: DataRendererState) => DataRendererState | Partial<DataRendererState>), replace?: false | undefined): unknown;
40
44
  setState(state: DataRendererState | ((state: DataRendererState) => DataRendererState), replace: true): unknown;
41
45
  persist: {
@@ -48,5 +52,5 @@ export declare const getDataRendererStore: (storageKey: string) => Omit<import('
48
52
  getOptions: () => Partial<import('zustand/middleware').PersistOptions<DataRendererState, unknown, unknown>>;
49
53
  };
50
54
  };
51
- export declare const useDataRendererStore: <T>(storageKey: string, selector: (state: DataRendererState) => T) => T;
52
- export type { DataRendererState };
55
+ export declare const useDataRendererStore: <T>(storageKey: string, selector: (state: DataRendererState) => T, initialState?: DataRendererStoreInitialState) => T;
56
+ export type { DataRendererSnapshot, DataRendererState, DataRendererStoreInitialState };
@@ -0,0 +1,14 @@
1
+ import { AttributeDescriptor } from './types';
2
+ /**
3
+ * Returns the same descriptors with every source-backed enum's options
4
+ * replaced by a fresh `getSnapshot()` array. Pure — call from anywhere that
5
+ * needs a normalized view of the schema.
6
+ */
7
+ export declare const resolveAttributeOptions: (attributes: AttributeDescriptor[]) => AttributeDescriptor[];
8
+ /**
9
+ * Subscribes to every source-backed enum in `attributes` and returns the
10
+ * resolved descriptors (options materialized to plain arrays). When any
11
+ * source's listener fires the component rerenders, so downstream renders see
12
+ * the new snapshot automatically.
13
+ */
14
+ export declare const useResolvedAttributes: (attributes: AttributeDescriptor[]) => AttributeDescriptor[];
@@ -15,10 +15,19 @@ interface DiffCardBodyModelInput extends DiffCardBodyProps {
15
15
  buildViewData?: typeof buildDiffViewData;
16
16
  }
17
17
  export declare const createDiffCardBodyModel: (input: DiffCardBodyModelInput) => {
18
+ kind: "binary";
19
+ filePath: string;
20
+ isImage: boolean;
21
+ renderedLineCount?: undefined;
22
+ onShowFullDiff?: undefined;
23
+ diffViewData?: undefined;
24
+ sideBySide?: undefined;
25
+ } | {
18
26
  kind: "placeholder";
19
27
  filePath: string;
20
28
  renderedLineCount: number;
21
29
  onShowFullDiff: (() => void) | undefined;
30
+ isImage?: undefined;
22
31
  diffViewData?: undefined;
23
32
  sideBySide?: undefined;
24
33
  } | {
@@ -26,6 +35,7 @@ export declare const createDiffCardBodyModel: (input: DiffCardBodyModelInput) =>
26
35
  diffViewData: BuiltDiffViewData;
27
36
  sideBySide: boolean;
28
37
  filePath?: undefined;
38
+ isImage?: undefined;
29
39
  renderedLineCount?: undefined;
30
40
  onShowFullDiff?: undefined;
31
41
  };
@@ -8,6 +8,7 @@ interface DiffCardContentProps {
8
8
  isExpanded: boolean;
9
9
  isLargeDiff: boolean;
10
10
  isGeneratedDiff: boolean;
11
+ isBinaryDiff: boolean;
11
12
  hasDiffContent: boolean;
12
13
  canLoadDiff: boolean;
13
14
  shouldAutoLoadDiff: boolean;
@@ -30,6 +30,7 @@ export declare const shouldAutoLoadDiffContent: (input: {
30
30
  hasDiffContent: boolean;
31
31
  isLargeDiff: boolean;
32
32
  isGeneratedDiff: boolean;
33
+ isBinaryDiff: boolean;
33
34
  requestedPath: string | null;
34
35
  filePath: string;
35
36
  }) => boolean;
@@ -0,0 +1 @@
1
+ export declare const DiffDrawerEmptyState: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Diff } from './diff-card';
2
+ import { DiffViewMode } from './types';
3
+ interface EstimateDiffCardHeightInput {
4
+ diff: Diff;
5
+ isCollapsed: boolean;
6
+ hasOptedIntoLargeDiff?: boolean;
7
+ diffViewMode?: DiffViewMode;
8
+ }
9
+ export declare const estimateDiffCardHeight: (input: EstimateDiffCardHeightInput) => number;
10
+ export {};