@pstdio/ui 0.8.0 → 0.9.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/dist/{MermaidComponent-D7Baqkwx.js → MermaidComponent-Cz_Iob5U.js} +56 -53
- package/dist/MermaidComponent-Cz_Iob5U.js.map +1 -0
- package/dist/chat-ui.js +117 -117
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/data-renderer/data-renderer-board.d.ts +1 -0
- package/dist/components/data-renderer/data-renderer-card.d.ts +5 -20
- package/dist/components/data-renderer/data-renderer-grouping.d.ts +11 -10
- package/dist/components/data-renderer/data-renderer-helpers.d.ts +63 -15
- package/dist/components/data-renderer/data-renderer-list.d.ts +5 -8
- package/dist/components/data-renderer/data-renderer-toolbar.d.ts +12 -0
- package/dist/components/data-renderer/data-renderer.d.ts +12 -23
- package/dist/components/data-renderer/display-menu.d.ts +9 -8
- package/dist/components/data-renderer/filter-menu.d.ts +5 -4
- package/dist/components/data-renderer/types.d.ts +83 -49
- package/dist/components/data-renderer/use-data-renderer-store.d.ts +15 -11
- package/dist/components/data-renderer/use-resolved-attributes.d.ts +14 -0
- package/dist/components/diff-viewer/diff-card-body.d.ts +10 -0
- package/dist/components/diff-viewer/diff-card-content.d.ts +1 -0
- package/dist/components/diff-viewer/diff-card.d.ts +1 -0
- package/dist/components/diff-viewer/diff-size.d.ts +2 -0
- package/dist/components/icon-color-picker.d.ts +13 -0
- package/dist/components/list-row/list-row-content.d.ts +9 -0
- package/dist/components/list-row/list-row.types.d.ts +1 -0
- package/dist/components/rich-text/shared/lexical-code.d.ts +2 -0
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.d.ts +1 -1
- package/dist/components/rich-text/shared/prism-global.d.ts +2 -0
- package/dist/components/status-option-editor/index.d.ts +2 -0
- package/dist/components/status-option-editor/status-option-editor.d.ts +2 -0
- package/dist/components/status-option-editor/status-option-editor.types.d.ts +39 -0
- package/dist/components/status-option-editor/status-option-row.d.ts +16 -0
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +19 -0
- package/dist/components/tab-strip/tab-visibility.store.d.ts +41 -0
- package/dist/components/tree-list/tree-list-model.d.ts +58 -0
- package/dist/components/tree-list/tree-list-node-row.d.ts +20 -0
- package/dist/components/tree-list/tree-list-order-filter.d.ts +3 -0
- package/dist/components/tree-list/tree-list-order.store.d.ts +42 -0
- package/dist/components/tree-list/tree-list-reorder.d.ts +13 -0
- package/dist/components/tree-list/tree-list-section-header.d.ts +14 -0
- package/dist/components/tree-list/tree-list-sortable.d.ts +22 -0
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +17 -0
- package/dist/components/tree-list/tree-list-visibility.store.d.ts +45 -0
- package/dist/components/tree-list/tree-list.d.ts +7 -27
- package/dist/components/tree-list/tree-list.types.d.ts +2 -0
- package/dist/components/tree-list/use-tree-list-keyboard-navigation.d.ts +15 -0
- package/dist/get-file-type-icon-ufFb0IkR.js +102 -0
- package/dist/get-file-type-icon-ufFb0IkR.js.map +1 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.js +5171 -3890
- package/dist/index.js.map +1 -1
- package/dist/{rich-message-33DPxuWJ.js → rich-message-CEOSsdR2.js} +428 -421
- package/dist/rich-message-CEOSsdR2.js.map +1 -0
- package/dist/rich-text.js +26 -26
- package/dist/rich-text.js.map +1 -1
- package/dist/theme/custom/index.d.ts +0 -3
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/recipes/tabs.d.ts +30 -0
- package/dist/theme/tokens/colors.d.ts +6 -0
- package/dist/{theme-D-aCJqTf.js → theme-qP4YOZ2R.js} +197 -148
- package/dist/theme-qP4YOZ2R.js.map +1 -0
- package/dist/theme.js +2 -4
- package/dist/utils/browser-storage.d.ts +7 -0
- package/dist/utils/prism.d.ts +1 -0
- package/package.json +8 -3
- package/dist/MermaidComponent-D7Baqkwx.js.map +0 -1
- package/dist/components/data-renderer/tag-badge.d.ts +0 -10
- package/dist/components/data-renderer/tag-option-icon.d.ts +0 -2
- package/dist/get-file-type-icon-Bwqf1WXA.js +0 -101
- package/dist/get-file-type-icon-Bwqf1WXA.js.map +0 -1
- package/dist/rich-message-33DPxuWJ.js.map +0 -1
- package/dist/theme/custom/monokai.json.d.ts +0 -80
- package/dist/theme-D-aCJqTf.js.map +0 -1
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
import { DragEventHandler } from 'react';
|
|
1
|
+
import { DragEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { WorkspaceBadgeProps } from '../workspace-badge';
|
|
3
|
-
import {
|
|
4
|
-
export interface
|
|
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?:
|
|
20
|
-
|
|
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 {};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { DataRendererFilterState, DataRendererOrdering, DataRendererRow
|
|
1
|
+
import { AttributeDescriptor, DataRendererFilterState, DataRendererOrdering, DataRendererRow } from './types';
|
|
2
2
|
interface GroupingOptions {
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
11
|
+
rows: DataRendererRow[];
|
|
11
12
|
}
|
|
12
13
|
interface DataRendererColumnGroup {
|
|
13
14
|
key: string;
|
|
14
15
|
label: string;
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
rows: DataRendererRow[];
|
|
17
|
+
subgroups: DataRendererRowGroup[];
|
|
17
18
|
}
|
|
18
|
-
export declare const orderRows: (
|
|
19
|
-
export declare const groupRows: (
|
|
20
|
-
export declare const filterRows: (
|
|
21
|
-
export declare const countFilterValues: (
|
|
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 {
|
|
2
|
-
import {
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
18
|
-
export declare const omitFilterCategory: (filters: 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,25 +1,22 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import { ResourceContextAction } from '../resource-context-menu';
|
|
3
|
-
import {
|
|
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?:
|
|
14
|
-
|
|
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
|
-
|
|
19
|
+
onDropRow?: (rowId: string) => void;
|
|
23
20
|
}
|
|
24
21
|
interface DataRendererListProps {
|
|
25
22
|
items: DataRendererListItem[];
|
|
@@ -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,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DataRendererBoardColumnAction } from './data-renderer-board';
|
|
3
|
-
import {
|
|
3
|
+
import { AttributeDescriptor, DataRendererFilterState, DataRendererRow, DataRendererSettings } from './types';
|
|
4
4
|
export interface BoardColumnConfig {
|
|
5
5
|
color?: string;
|
|
6
6
|
canDragIn?: boolean;
|
|
@@ -8,33 +8,22 @@ export interface BoardColumnConfig {
|
|
|
8
8
|
canCreate?: boolean;
|
|
9
9
|
actions?: DataRendererBoardColumnAction[];
|
|
10
10
|
}
|
|
11
|
-
interface DataRendererProps<
|
|
12
|
-
|
|
11
|
+
export interface DataRendererProps<TRow extends DataRendererRow = DataRendererRow> {
|
|
12
|
+
rows: TRow[];
|
|
13
13
|
storageKey: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
groupingOptions?: DataRendererOption<GroupingField>[];
|
|
17
|
-
orderingOptions?: DataRendererOption<OrderingField>[];
|
|
18
|
-
displayPropertyOptions?: DataRendererOption<DisplayProperty>[];
|
|
19
|
-
filterCategories?: DataRendererFilterCategory[];
|
|
20
|
-
knownColumnKeys?: string[];
|
|
14
|
+
attributes: AttributeDescriptor[];
|
|
15
|
+
selectedRowId?: string | null;
|
|
21
16
|
emptyTitle?: string;
|
|
22
17
|
emptyDescription?: string;
|
|
18
|
+
defaultSettings?: Partial<DataRendererSettings>;
|
|
19
|
+
defaultFilters?: DataRendererFilterState;
|
|
23
20
|
hideToolbar?: boolean;
|
|
24
21
|
toolbarLeading?: ReactNode;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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;
|
|
22
|
+
onRowClick?: (row: TRow) => void;
|
|
23
|
+
onAttributeChange?: (rowId: string, attributeId: string, value: unknown) => void;
|
|
24
|
+
onReorder?: (rowId: string, beforeRowId?: string) => void;
|
|
25
|
+
onCreateRow?: (columnId: string) => void;
|
|
36
26
|
onColumnAction?: (columnId: string, actionId: string) => Promise<void> | void;
|
|
37
27
|
getBoardColumnConfig?: (groupKey: string) => BoardColumnConfig;
|
|
38
28
|
}
|
|
39
|
-
export declare const DataRenderer: <
|
|
40
|
-
export type { DataRendererProps };
|
|
29
|
+
export declare const DataRenderer: <TRow extends DataRendererRow>(props: DataRendererProps<TRow>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MenuOption } from './data-renderer-helpers';
|
|
2
|
+
import { DataRendererSettings } from './types';
|
|
2
3
|
interface DisplayMenuProps {
|
|
3
4
|
settings: DataRendererSettings;
|
|
4
|
-
groupingOptions:
|
|
5
|
-
orderingOptions:
|
|
6
|
-
displayPropertyOptions:
|
|
5
|
+
groupingOptions: MenuOption[];
|
|
6
|
+
orderingOptions: MenuOption[];
|
|
7
|
+
displayPropertyOptions: MenuOption[];
|
|
7
8
|
onViewModeChange: (value: DataRendererSettings["viewMode"]) => void;
|
|
8
|
-
onColumnGroupingChange: (value:
|
|
9
|
-
onRowGroupingChange: (value:
|
|
10
|
-
|
|
9
|
+
onColumnGroupingChange: (value: string) => void;
|
|
10
|
+
onRowGroupingChange: (value: string) => void;
|
|
11
|
+
onOrderingAttributeIdChange: (value: string) => void;
|
|
11
12
|
onSortDirectionToggle: () => void;
|
|
12
|
-
onDisplayPropertyToggle: (property:
|
|
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 {
|
|
1
|
+
import { FilterCategoryView } from './data-renderer-helpers';
|
|
2
|
+
import { DataRendererFilterState } from './types';
|
|
2
3
|
interface FilterMenuProps {
|
|
3
|
-
categories:
|
|
4
|
+
categories: FilterCategoryView[];
|
|
4
5
|
filters: DataRendererFilterState;
|
|
5
6
|
countsByCategory: Record<string, Record<string, number>>;
|
|
6
|
-
onToggleFilterValue: (
|
|
7
|
-
onClearFilter: (
|
|
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
|
|
6
|
-
export
|
|
7
|
-
export interface
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
export declare const
|
|
64
|
-
|
|
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
|
|
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
|
-
|
|
12
|
-
setDisplayProperties: (displayProperties:
|
|
15
|
+
setOrderingAttributeId: (attributeId: DataRendererSettings["ordering"]["attributeId"]) => void;
|
|
16
|
+
setDisplayProperties: (displayProperties: string[]) => void;
|
|
13
17
|
toggleSortDirection: () => void;
|
|
14
|
-
toggleDisplayProperty: (property:
|
|
15
|
-
setFilter: (
|
|
16
|
-
toggleFilterValue: (
|
|
17
|
-
clearFilter: (
|
|
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?:
|
|
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
|
};
|
|
@@ -12,3 +12,5 @@ export declare const isLargeDiffContent: (input: {
|
|
|
12
12
|
newContent?: string;
|
|
13
13
|
}) => boolean;
|
|
14
14
|
export declare const isGeneratedDiffPath: (path: string) => boolean;
|
|
15
|
+
export declare const isBinaryDiffPath: (path: string) => boolean;
|
|
16
|
+
export declare const isImageDiffPath: (path: string) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export declare const optionColors: readonly ["gray", "red", "orange", "yellow", "green", "teal", "blue", "cyan", "purple", "pink"];
|
|
3
|
+
export declare const getIconComponent: (name: string | null | undefined) => ComponentType;
|
|
4
|
+
export interface IconColorPickerProps {
|
|
5
|
+
color: string;
|
|
6
|
+
icon?: string | null;
|
|
7
|
+
onColorChange: (color: string) => void;
|
|
8
|
+
onIconChange?: (icon: string | null) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
showIcons?: boolean;
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const IconColorPicker: (props: IconColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ListRowItem, ListRowProps } from './list-row.types';
|
|
2
|
+
export declare const ListRowContent: (props: {
|
|
3
|
+
item: ListRowItem;
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
showChevron: boolean;
|
|
6
|
+
isDisabled: boolean;
|
|
7
|
+
tone: ListRowProps["tone"];
|
|
8
|
+
variant: ListRowProps["variant"];
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,6 +16,7 @@ export interface ListRowActionMenuItem {
|
|
|
16
16
|
size?: number | string;
|
|
17
17
|
}>;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
+
readOnly?: boolean;
|
|
19
20
|
/** Trailing content rendered after the label. Use for Kbd shortcuts, counts, or badges. */
|
|
20
21
|
endContent?: ReactNode;
|
|
21
22
|
onAction?: () => void;
|