@ynput/ayon-frontend-shared 0.7.3 → 0.7.5
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/LICENSE +105 -0
- package/dist/DetailsPanel.es.js +1088 -969
- package/dist/ListTable.es.js +70 -67
- package/dist/NewEntity.es.js +8 -5
- package/dist/ProjectTreeTable.es.js +4134 -3825
- package/dist/ProjectsTable.es.js +526 -0
- package/dist/Slicer.es.js +75 -73
- package/dist/Views.es.js +86 -84
- package/dist/chunks/Actions.es.js +4 -2
- package/dist/chunks/ColumnDropIndicator.es.js +21 -18
- package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
- package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
- package/dist/chunks/EmptyPlaceholder.es.js +9 -8
- package/dist/chunks/EntityPath.es.js +15 -14
- package/dist/chunks/EntityPickerDialog.es.js +5 -3
- package/dist/chunks/EntityTooltip.es.js +10 -8
- package/dist/chunks/EntityUpdatesContext.es.js +13 -12
- package/dist/chunks/Feed.es.js +12 -11
- package/dist/chunks/FilterErrorActions.es.js +6 -4
- package/dist/chunks/GroupSettingsFallback.es.js +75 -0
- package/dist/chunks/JsonViewer.es.js +3 -2
- package/dist/chunks/Menu.es.js +105 -103
- package/dist/chunks/MetaWidget.es.js +278 -275
- package/dist/chunks/PlayableIcon.es.js +868 -862
- package/dist/chunks/ProjectContext.es.js +5 -4
- package/dist/chunks/RepresentationsList.es.js +3 -2
- package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
- package/dist/chunks/SimpleTable.es.js +492 -402
- package/dist/chunks/Slicer.es.js +936 -896
- package/dist/chunks/TableExportContextInstance.es.js +437 -339
- package/dist/chunks/TableSettingsFallback.es.js +5 -3
- package/dist/chunks/ThumbnailSimple.es.js +15 -13
- package/dist/chunks/VideoPlayer.es.js +14 -12
- package/dist/chunks/Watchers.es.js +97 -95
- package/dist/chunks/getProjectDisplayName.es.js +4 -0
- package/dist/chunks/getUris.es.js +375 -374
- package/dist/chunks/useHierarchySelection.es.js +5 -3
- package/dist/chunks/useLoadModule.es.js +10 -8
- package/dist/chunks/viewUpdateHelper.es.js +12 -10
- package/dist/components.es.js +1488 -1186
- package/dist/context.es.js +589 -539
- package/dist/hooks.es.js +169 -212
- package/dist/index.es.js +17 -12
- package/dist/types/Actions.d.ts +3 -0
- package/dist/types/ContextMenu.d.ts +3 -0
- package/dist/types/DetailsPanel.d.ts +3 -0
- package/dist/types/EntityPickerDialog.d.ts +3 -0
- package/dist/types/Feed.d.ts +3 -0
- package/dist/types/ListTable.d.ts +3 -0
- package/dist/types/NewEntity.d.ts +3 -0
- package/dist/types/ProjectTreeTable.d.ts +735 -1
- package/dist/types/ProjectsTable.d.ts +228 -0
- package/dist/types/RepresentationsList.d.ts +3 -0
- package/dist/types/SimpleTable.d.ts +17 -0
- package/dist/types/Slicer.d.ts +4 -0
- package/dist/types/Views.d.ts +3 -0
- package/dist/types/api.d.ts +3 -0
- package/dist/types/components.d.ts +808 -11
- package/dist/types/context.d.ts +39 -1
- package/dist/types/hooks.d.ts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/util.d.ts +7 -0
- package/dist/util.es.js +152 -144
- package/package.json +16 -8
- /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
|
@@ -6,6 +6,7 @@ import { ColumnDef } from '@tanstack/react-table';
|
|
|
6
6
|
import { ColumnOrderState } from '@tanstack/react-table';
|
|
7
7
|
import { ColumnPinningState } from '@tanstack/react-table';
|
|
8
8
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
9
|
+
import type { ComponentType } from 'react';
|
|
9
10
|
import { Context } from 'react';
|
|
10
11
|
import { CSSProperties } from 'react';
|
|
11
12
|
import { default as default_2 } from 'react';
|
|
@@ -54,6 +55,9 @@ import { useSearchParams } from 'react-router-dom';
|
|
|
54
55
|
import { Virtualizer } from '@tanstack/react-virtual';
|
|
55
56
|
import { VisibilityState } from '@tanstack/react-table';
|
|
56
57
|
|
|
58
|
+
/** Who sees a page: everyone when not set. Admins see manager pages too. */
|
|
59
|
+
declare type Access = 'manager' | 'admin'
|
|
60
|
+
|
|
57
61
|
export declare type ActiveFilters = {
|
|
58
62
|
filter?: {
|
|
59
63
|
conditions?: unknown[];
|
|
@@ -101,6 +105,24 @@ export declare type ActivityOperationsResponseModel = {
|
|
|
101
105
|
success: boolean;
|
|
102
106
|
};
|
|
103
107
|
|
|
108
|
+
export declare const ADDON_COLUMN_PREFIX = "addon__";
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Gets the values of every shown addon column for the rows on screen (fetchValues), into the
|
|
112
|
+
* store the cells read. Wraps the table body.
|
|
113
|
+
*/
|
|
114
|
+
export declare const AddonColumnDataScope: ({ columns, entities, children, }: {
|
|
115
|
+
columns: Column<TableRow>[];
|
|
116
|
+
entities: TableRow["primary"][];
|
|
117
|
+
children: ReactNode;
|
|
118
|
+
}) => JSX_2.Element;
|
|
119
|
+
|
|
120
|
+
/** What the table needs to know about an addon column (ColumnDef meta). */
|
|
121
|
+
export declare interface AddonColumnMeta {
|
|
122
|
+
contribution: Contribution<'tableColumn'>;
|
|
123
|
+
page: ProjectTablePage;
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
declare interface AddonConfig {
|
|
105
127
|
/** Display name of the addon */
|
|
106
128
|
label: string;
|
|
@@ -120,6 +142,35 @@ declare type AddonDialogSelection = {
|
|
|
120
142
|
|
|
121
143
|
declare type AddonFeatureKey = string;
|
|
122
144
|
|
|
145
|
+
/** The addon a contribution came from. */
|
|
146
|
+
declare interface AddonInfo {
|
|
147
|
+
/** addon name, as on the server */
|
|
148
|
+
name: string
|
|
149
|
+
version: string
|
|
150
|
+
/** federation remote the manifest was loaded from */
|
|
151
|
+
remote: string
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** An entry of a button's `menu`. */
|
|
155
|
+
declare type AddonMenuItem =
|
|
156
|
+
| { divider: true }
|
|
157
|
+
| {
|
|
158
|
+
id: string
|
|
159
|
+
label: string
|
|
160
|
+
icon?: string
|
|
161
|
+
/** goes to an AYON URL when clicked */
|
|
162
|
+
to?: string
|
|
163
|
+
/** opens an external URL in a new tab when clicked */
|
|
164
|
+
href?: string
|
|
165
|
+
/** called when clicked; an error is shown as a toast */
|
|
166
|
+
onClick?: () => void | Promise<void>
|
|
167
|
+
/** a submenu */
|
|
168
|
+
items?: AddonMenuItem[]
|
|
169
|
+
disabled?: boolean
|
|
170
|
+
selected?: boolean
|
|
171
|
+
danger?: boolean
|
|
172
|
+
}
|
|
173
|
+
|
|
123
174
|
export declare const allowedGroupByFields: string[];
|
|
124
175
|
|
|
125
176
|
export declare const ALWAYS_VISIBLE_COLUMNS: string[];
|
|
@@ -168,6 +219,10 @@ declare type Anatomy_2 = {
|
|
|
168
219
|
product_base_types?: ProductBaseTypes_2;
|
|
169
220
|
};
|
|
170
221
|
|
|
222
|
+
export declare const appliesToPage: (contribution: {
|
|
223
|
+
pages?: ProjectTablePage[];
|
|
224
|
+
}, page: ProjectTablePage) => boolean;
|
|
225
|
+
|
|
171
226
|
declare type AttributeData = {
|
|
172
227
|
/** Type of attribute value */
|
|
173
228
|
type?: 'string' | 'integer' | 'float' | 'boolean' | 'datetime' | 'list_of_strings' | 'list_of_integers' | 'list_of_any' | 'list_of_submodels' | 'dict';
|
|
@@ -346,6 +401,40 @@ export declare type BuiltInFieldOptions = {
|
|
|
346
401
|
[key in BuiltInFieldOptionKey]: EnumOption[];
|
|
347
402
|
};
|
|
348
403
|
|
|
404
|
+
/** Description fields of a button the host draws (header and toolbar items). */
|
|
405
|
+
declare interface ButtonMeta {
|
|
406
|
+
/** a Material Symbols icon name; required unless the item is a `component` */
|
|
407
|
+
icon?: string
|
|
408
|
+
/** shown on hover; the label when not set */
|
|
409
|
+
tooltip?: string
|
|
410
|
+
/** navigates there on click, e.g. `/dashboard/comments` (exactly one action: see the slot) */
|
|
411
|
+
to?: string
|
|
412
|
+
/** the `dialog`'s title; the label when not set */
|
|
413
|
+
dialogTitle?: string
|
|
414
|
+
/** the `dialog`'s size, `md` by default */
|
|
415
|
+
dialogSize?: 'sm' | 'md' | 'lg' | 'full'
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* The pieces of a button: what a click does. Set exactly one of them, or `to` in the description.
|
|
420
|
+
*/
|
|
421
|
+
declare interface ButtonPieces<S extends SlotName> {
|
|
422
|
+
/** called on click with the context (it has `navigate`) */
|
|
423
|
+
run?: Loader<RunPiece<S>>
|
|
424
|
+
/** the content of a dialog the host opens and closes: AYON's dialog with title and close button */
|
|
425
|
+
dialog?: Loader<ComponentType<SlotProps<S> & DialogScope>>
|
|
426
|
+
/** the items of a menu the host opens under the button, like the header's help menu */
|
|
427
|
+
menu?: Loader<MenuPiece<S>>
|
|
428
|
+
/** the addon's own component instead of the host's button: a dropdown, a toggle, anything */
|
|
429
|
+
component?: Loader<ComponentType<SlotProps<S>>>
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Context of a button's code (`run`, `dialog`, `menu`, `component`) besides the slot's own. */
|
|
433
|
+
declare interface ButtonScope {
|
|
434
|
+
/** goes to an AYON URL, e.g. `navigate('/dashboard/comments')` */
|
|
435
|
+
navigate: (to: string) => void
|
|
436
|
+
}
|
|
437
|
+
|
|
349
438
|
export declare const CELL_PADDING_Y = 4;
|
|
350
439
|
|
|
351
440
|
export declare const CellEditingContext: Context<CellEditingContextType | undefined>;
|
|
@@ -636,6 +725,18 @@ declare interface ContextMenuItemType extends Omit<ContextMenuItemProps, 'contex
|
|
|
636
725
|
[key: string]: any;
|
|
637
726
|
}
|
|
638
727
|
|
|
728
|
+
/** A contribution as the host keeps it: what the addon wrote, plus where it came from. */
|
|
729
|
+
declare type Contribution<S extends SlotName = SlotName> = ContributionInput<S> & {
|
|
730
|
+
/** `<addonName>.<id>`, unique across addons */
|
|
731
|
+
key: string
|
|
732
|
+
addon: AddonInfo
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/** What an addon writes for a contribution to slot `S`: the slot, its description and pieces. */
|
|
736
|
+
declare type ContributionInput<S extends SlotName = SlotName> = S extends SlotName
|
|
737
|
+
? { slot: S } & SlotMap[S]['meta'] & SlotMap[S]['pieces']
|
|
738
|
+
: never
|
|
739
|
+
|
|
639
740
|
/**
|
|
640
741
|
* Converts a datetime Filter to a nested QueryFilter with gte/lte conditions.
|
|
641
742
|
* Returns null if no date conditions could be created.
|
|
@@ -740,6 +841,42 @@ export declare interface DetailsPanelEntityProviderProps {
|
|
|
740
841
|
children: ReactNode;
|
|
741
842
|
}
|
|
742
843
|
|
|
844
|
+
/** Context of a details panel menu item. */
|
|
845
|
+
declare interface DetailsPanelMenuItemContext extends ProjectNameScope {
|
|
846
|
+
entityType: string
|
|
847
|
+
/** the entities the panel shows */
|
|
848
|
+
selectedEntities: EntityRef[]
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/** Description of a `detailsPanel.menuItem` contribution. */
|
|
852
|
+
declare interface DetailsPanelMenuItemMeta extends MenuItemMeta {
|
|
853
|
+
/** entity types the item shows for; all when not set */
|
|
854
|
+
entityTypes?: string[]
|
|
855
|
+
/**
|
|
856
|
+
* shown as an icon button in the panel's header, next to the "more" button, instead of in its
|
|
857
|
+
* menu (the label is the tooltip); `position` and `order` then order the header buttons
|
|
858
|
+
*/
|
|
859
|
+
pinned?: boolean
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/** Context of a details panel tab. */
|
|
863
|
+
declare interface DetailsPanelTabContext extends ProjectNameScope, EntityScope_2 {
|
|
864
|
+
/** where the panel is open (`overview`, `dashboard`, `inbox`, ...); the panel opens in many places */
|
|
865
|
+
scope: string
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/** Description of a `detailsPanel.tab` contribution. */
|
|
869
|
+
declare interface DetailsPanelTabMeta {
|
|
870
|
+
/** the tab id is `<addon>.<id>` */
|
|
871
|
+
id: string
|
|
872
|
+
/** the tab button's tooltip */
|
|
873
|
+
label: string
|
|
874
|
+
/** a Material Symbols icon name, the tab button */
|
|
875
|
+
icon: string
|
|
876
|
+
/** entity types the tab shows for; all when not set */
|
|
877
|
+
entityTypes?: string[]
|
|
878
|
+
}
|
|
879
|
+
|
|
743
880
|
/**
|
|
744
881
|
* Determines which folders are currently loading tasks
|
|
745
882
|
* @param params - Object containing parameters for determining loading folders
|
|
@@ -758,6 +895,12 @@ export declare type DetermineLoadingTaskFoldersParams = {
|
|
|
758
895
|
foldersMap: FolderNodeMap;
|
|
759
896
|
};
|
|
760
897
|
|
|
898
|
+
/** What a `dialog` piece gets besides the slot context. */
|
|
899
|
+
declare interface DialogScope {
|
|
900
|
+
/** closes the dialog */
|
|
901
|
+
close: () => void
|
|
902
|
+
}
|
|
903
|
+
|
|
761
904
|
declare type DisplayConfig = Record<string, boolean>;
|
|
762
905
|
|
|
763
906
|
export declare const DRAG_HANDLE_COLUMN_ID = "drag-handle";
|
|
@@ -939,6 +1082,23 @@ declare type EntityLinkQuery = FolderLink | TaskLink | ProductLink | VersionLink
|
|
|
939
1082
|
|
|
940
1083
|
export declare type EntityMap = EditorTaskNode | MatchingFolder | EditorVersionNode | EditorProductNode;
|
|
941
1084
|
|
|
1085
|
+
/** Context of an entity menu item. */
|
|
1086
|
+
declare interface EntityMenuItemContext extends ProjectNameScope {
|
|
1087
|
+
page: ProjectTablePage
|
|
1088
|
+
/** the selected entities (not table rows: list items resolve to their entity) */
|
|
1089
|
+
entities: EntityRef[]
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/** Description of an `entityMenuItem` contribution. */
|
|
1093
|
+
declare interface EntityMenuItemMeta extends MenuItemMeta {
|
|
1094
|
+
/** entity types it acts on: shown only when every selected entity is one of them. All when not set */
|
|
1095
|
+
entityTypes?: string[]
|
|
1096
|
+
/** which tables offer it; all (Overview, Products, Lists) when not set */
|
|
1097
|
+
pages?: ProjectTablePage[]
|
|
1098
|
+
/** `single`: only for one selected entity; `multi` (default): for one or more */
|
|
1099
|
+
selection?: 'single' | 'multi'
|
|
1100
|
+
}
|
|
1101
|
+
|
|
942
1102
|
declare interface EntityMoveData {
|
|
943
1103
|
entityId: string;
|
|
944
1104
|
entityType: EntityMoveType;
|
|
@@ -976,8 +1136,24 @@ declare type EntityNaming_2 = {
|
|
|
976
1136
|
separator?: '' | '_' | '-' | '.';
|
|
977
1137
|
};
|
|
978
1138
|
|
|
1139
|
+
/** An entity a slot is about: its id and type, and its name when the host has it. */
|
|
1140
|
+
declare interface EntityRef {
|
|
1141
|
+
id: string
|
|
1142
|
+
/** `folder`, `task`, `product`, `version`, `representation` */
|
|
1143
|
+
entityType: string
|
|
1144
|
+
projectName: string
|
|
1145
|
+
name?: string
|
|
1146
|
+
label?: string
|
|
1147
|
+
}
|
|
1148
|
+
|
|
979
1149
|
export declare type EntityScope = 'primary' | EntityType;
|
|
980
1150
|
|
|
1151
|
+
/** Slots about one or more entities of one type. */
|
|
1152
|
+
declare interface EntityScope_2 {
|
|
1153
|
+
entityType: string
|
|
1154
|
+
entities: EntityRef[]
|
|
1155
|
+
}
|
|
1156
|
+
|
|
981
1157
|
export declare type EntityType = 'folder' | 'task' | 'product' | 'version';
|
|
982
1158
|
|
|
983
1159
|
declare type EntityType_2 = OperationModel_2['entityType'];
|
|
@@ -1207,6 +1383,25 @@ export declare interface FolderEntityData extends BaseEntityData {
|
|
|
1207
1383
|
hasVersions?: boolean;
|
|
1208
1384
|
}
|
|
1209
1385
|
|
|
1386
|
+
/** A folder of the project, as slots pass it. AYON passes its folder list item, so more may be there. */
|
|
1387
|
+
declare interface FolderInfo {
|
|
1388
|
+
id: string
|
|
1389
|
+
name: string
|
|
1390
|
+
label?: string
|
|
1391
|
+
folderType: string
|
|
1392
|
+
/** `/` separated names from the project root, e.g. `assets/characters/hero` */
|
|
1393
|
+
path: string
|
|
1394
|
+
/** unset for folders at the project root */
|
|
1395
|
+
parentId?: string
|
|
1396
|
+
/** names of the parents, from the project root */
|
|
1397
|
+
parents: string[]
|
|
1398
|
+
status: string
|
|
1399
|
+
tags?: string[]
|
|
1400
|
+
hasTasks?: boolean
|
|
1401
|
+
hasChildren?: boolean
|
|
1402
|
+
attrib?: Record<string, unknown>
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1210
1405
|
declare type FolderLink = GetFoldersLinksQuery['project']['folders']['edges'][0]['node']['links']['edges'][0];
|
|
1211
1406
|
|
|
1212
1407
|
export declare type FolderListItem = {
|
|
@@ -1322,6 +1517,8 @@ export declare const generateDummyAttributes: (count?: number) => AttributeModel
|
|
|
1322
1517
|
*/
|
|
1323
1518
|
export declare const generateLoadingRows: (count?: number, attrib?: {}, key?: string) => TableRow[];
|
|
1324
1519
|
|
|
1520
|
+
export declare const getAddonColumnId: (column: Contribution<"tableColumn">) => string;
|
|
1521
|
+
|
|
1325
1522
|
declare type GetAncestorsOf = (id: string) => string[];
|
|
1326
1523
|
|
|
1327
1524
|
/**
|
|
@@ -1885,6 +2082,24 @@ export declare const HeaderActionButton: FC<HeaderActionButtonProps>;
|
|
|
1885
2082
|
declare interface HeaderActionButtonProps extends ButtonProps {
|
|
1886
2083
|
}
|
|
1887
2084
|
|
|
2085
|
+
/** Context of a header item. */
|
|
2086
|
+
declare interface HeaderItemContext extends ButtonScope {
|
|
2087
|
+
/** the project whose page is open, else `null` */
|
|
2088
|
+
projectName: string | null
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/** Description of a `header.item` contribution. */
|
|
2092
|
+
declare interface HeaderItemMeta extends ButtonMeta {
|
|
2093
|
+
/** unique among the addon's header items */
|
|
2094
|
+
id: string
|
|
2095
|
+
/** shown next to the icon on the left, as the tooltip on the right */
|
|
2096
|
+
label: string
|
|
2097
|
+
/** `left`: after the Home button; `right`: before chat and the inbox */
|
|
2098
|
+
placement: 'left' | 'right'
|
|
2099
|
+
/** order among addon items on the same side, lowest first */
|
|
2100
|
+
order?: number
|
|
2101
|
+
}
|
|
2102
|
+
|
|
1888
2103
|
export declare type HeaderLabel = {
|
|
1889
2104
|
id: string;
|
|
1890
2105
|
label: string;
|
|
@@ -1964,6 +2179,8 @@ export declare type InheritFromParentEntity = {
|
|
|
1964
2179
|
meta?: Record<string, any>;
|
|
1965
2180
|
};
|
|
1966
2181
|
|
|
2182
|
+
export declare const isAddonColumnId: (columnId: string) => boolean;
|
|
2183
|
+
|
|
1967
2184
|
export declare const isAttribGroupable: (attrib: ProjectTableAttribute, entityType?: string, allowedTypes?: ("string" | "integer" | "float")[], enumOnly?: boolean) => boolean;
|
|
1968
2185
|
|
|
1969
2186
|
export declare const isColumnSortable: (columnId: string) => boolean;
|
|
@@ -2128,6 +2345,12 @@ declare type ListMembershipFragmentFragment = {
|
|
|
2128
2345
|
itemIds: Array<string>;
|
|
2129
2346
|
};
|
|
2130
2347
|
|
|
2348
|
+
/** Description of a `projectList.menuItem` or `slicer.menuItem` contribution. */
|
|
2349
|
+
declare interface ListMenuItemMeta extends MenuItemMeta {
|
|
2350
|
+
/** which menus show it: both when not set */
|
|
2351
|
+
in?: MenuKind[]
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2131
2354
|
export declare const LISTS_COLUMN_ID = "lists";
|
|
2132
2355
|
|
|
2133
2356
|
declare type ListsMembershipEntityType = 'folder' | 'task' | 'version';
|
|
@@ -2146,6 +2369,12 @@ declare interface ListsWidgetProps extends WidgetBaseProps {
|
|
|
2146
2369
|
cellId: string;
|
|
2147
2370
|
}
|
|
2148
2371
|
|
|
2372
|
+
/**
|
|
2373
|
+
* A piece of a contribution: a dynamic import of a file in the addon, `() => import('./NotesTab')`.
|
|
2374
|
+
* The build puts each piece in its own chunk, and the slot decides when it loads.
|
|
2375
|
+
*/
|
|
2376
|
+
declare type Loader<T> = () => Promise<{ default: T }>
|
|
2377
|
+
|
|
2149
2378
|
export declare type LoadingTasks = Record<string, number>;
|
|
2150
2379
|
|
|
2151
2380
|
export declare type MainBreakdownFields = {
|
|
@@ -2179,6 +2408,34 @@ declare type Maybe<T> = T | null;
|
|
|
2179
2408
|
|
|
2180
2409
|
declare type Maybe_2<T> = T | null;
|
|
2181
2410
|
|
|
2411
|
+
/** Description of a menu item contribution. */
|
|
2412
|
+
declare interface MenuItemMeta {
|
|
2413
|
+
/** unique among the addon's items of the slot */
|
|
2414
|
+
id: string
|
|
2415
|
+
/** the menu entry */
|
|
2416
|
+
label: string
|
|
2417
|
+
/** a Material Symbols icon name */
|
|
2418
|
+
icon: string
|
|
2419
|
+
/**
|
|
2420
|
+
* `top`: first in the menu; `bottom` (default): after the menu's own items, above the
|
|
2421
|
+
* destructive ones (Delete, Archive)
|
|
2422
|
+
*/
|
|
2423
|
+
position?: MenuItemPosition
|
|
2424
|
+
/** order among addon items with the same position, lowest first */
|
|
2425
|
+
order?: number
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
/** Where an addon's item goes in a menu. */
|
|
2429
|
+
declare type MenuItemPosition = 'top' | 'bottom'
|
|
2430
|
+
|
|
2431
|
+
/** Which menu a list's menu item is in: the right-click menu or the "more" dropdown. */
|
|
2432
|
+
declare type MenuKind = 'context' | 'dropdown'
|
|
2433
|
+
|
|
2434
|
+
/** What a `menu` piece exports as default: the menu's items, built each time the menu opens. */
|
|
2435
|
+
declare type MenuPiece<S extends SlotName> = (
|
|
2436
|
+
context: SlotContext<S>,
|
|
2437
|
+
) => AddonMenuItem[] | Promise<AddonMenuItem[]>
|
|
2438
|
+
|
|
2182
2439
|
/**
|
|
2183
2440
|
* Utility functions for managing meta rows in tables (empty, loading, error, etc.)
|
|
2184
2441
|
*/
|
|
@@ -2290,6 +2547,43 @@ declare interface Option_2 {
|
|
|
2290
2547
|
singleSelect?: boolean;
|
|
2291
2548
|
}
|
|
2292
2549
|
|
|
2550
|
+
/** Description of a page contribution (`project.page`, `studio.page`). */
|
|
2551
|
+
declare interface PageMeta {
|
|
2552
|
+
/**
|
|
2553
|
+
* The page's URL segment and tab id: `/projects/<project>/<id>`, `/dashboard/<id>`.
|
|
2554
|
+
* A built-in page with the same id wins.
|
|
2555
|
+
*/
|
|
2556
|
+
id: string
|
|
2557
|
+
/** the tab label */
|
|
2558
|
+
title: string
|
|
2559
|
+
/** `manager` or `admin`: the tab is hidden from everyone else, and its URL redirects them */
|
|
2560
|
+
access?: Access
|
|
2561
|
+
/**
|
|
2562
|
+
* Gives the page views: the host shows the views menu and the page gets `views` in its context.
|
|
2563
|
+
* The type its views are saved under, e.g. `budget`: letters, digits, `_`, `-` and `.`. It must
|
|
2564
|
+
* be the page's own: one AYON or another page already uses is not shown.
|
|
2565
|
+
*/
|
|
2566
|
+
viewType?: string
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/**
|
|
2570
|
+
* The views of a page with a `viewType`. The host shows the views menu (saved views, the user's
|
|
2571
|
+
* working view, sharing); the page reads the selected view's settings and saves changes here.
|
|
2572
|
+
*/
|
|
2573
|
+
declare interface PageViews {
|
|
2574
|
+
/** the page's `viewType` */
|
|
2575
|
+
viewType: string
|
|
2576
|
+
/** settings of the selected view: the page decides their shape. `undefined` while loading */
|
|
2577
|
+
settings: Record<string, unknown> | undefined
|
|
2578
|
+
/** true until the selected view's settings have loaded: don't save before that */
|
|
2579
|
+
isLoading: boolean
|
|
2580
|
+
/**
|
|
2581
|
+
* Saves settings the user changed: they are merged into the selected view's settings and stored
|
|
2582
|
+
* in the user's working view, which becomes the selected view (as on the built-in pages).
|
|
2583
|
+
*/
|
|
2584
|
+
updateSettings: (settings: Record<string, unknown>) => Promise<void>
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2293
2587
|
declare type Params = {
|
|
2294
2588
|
users: {
|
|
2295
2589
|
name: string;
|
|
@@ -2579,6 +2873,21 @@ declare interface ProjectDataProviderProps {
|
|
|
2579
2873
|
projectName: string;
|
|
2580
2874
|
}
|
|
2581
2875
|
|
|
2876
|
+
/** The project's folders. The host loads them once per project, for every page of it. */
|
|
2877
|
+
declare interface ProjectFolders {
|
|
2878
|
+
/** every folder of the project; empty while they load */
|
|
2879
|
+
folders: FolderInfo[]
|
|
2880
|
+
/** true on the first load and when the project changes */
|
|
2881
|
+
isLoading: boolean
|
|
2882
|
+
getFolderById: (id: string) => FolderInfo | undefined
|
|
2883
|
+
/** ids of the folder's parents, nearest first */
|
|
2884
|
+
getParentFolderIds: (folderId: string) => string[]
|
|
2885
|
+
/** ids of every folder inside the given ones, and the given ones too with `includeSelf` */
|
|
2886
|
+
getChildFolderIds: (folderIds: string[], includeSelf?: boolean) => string[]
|
|
2887
|
+
/** the given folders, without those inside another one of them */
|
|
2888
|
+
getFolderIdsWithoutChildren: (folderIds: string[]) => string[]
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2582
2891
|
declare interface ProjectFoldersContextValue {
|
|
2583
2892
|
folders: FolderListItem_2[];
|
|
2584
2893
|
getFolderById: (id: string) => FolderListItem_2 | undefined;
|
|
@@ -2594,6 +2903,12 @@ declare interface ProjectFoldersContextValue {
|
|
|
2594
2903
|
refetch: () => Promise<FolderListModel>;
|
|
2595
2904
|
}
|
|
2596
2905
|
|
|
2906
|
+
/** Slots on a project page, which always has the project's folders. */
|
|
2907
|
+
declare interface ProjectFoldersScope {
|
|
2908
|
+
/** every folder of the project, with lookups for parents and children */
|
|
2909
|
+
projectFolders: ProjectFolders
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2597
2912
|
declare type ProjectInfo = {
|
|
2598
2913
|
folderTypes: FolderType_5[];
|
|
2599
2914
|
taskTypes: TaskType_5[];
|
|
@@ -2603,6 +2918,30 @@ declare type ProjectInfo = {
|
|
|
2603
2918
|
productTypes: ProductType_2[];
|
|
2604
2919
|
};
|
|
2605
2920
|
|
|
2921
|
+
/**
|
|
2922
|
+
* A project, as slots pass it. The fields addons can rely on; AYON passes the full project
|
|
2923
|
+
* model, so more may be there.
|
|
2924
|
+
*/
|
|
2925
|
+
declare interface ProjectInfo_2 {
|
|
2926
|
+
name: string
|
|
2927
|
+
code: string
|
|
2928
|
+
label?: string
|
|
2929
|
+
active?: boolean
|
|
2930
|
+
library?: boolean
|
|
2931
|
+
attrib?: Record<string, unknown>
|
|
2932
|
+
statuses?: { name: string; color?: string; icon?: string; state?: string; scope?: string[] }[]
|
|
2933
|
+
folderTypes?: { name: string; icon?: string; color?: string }[]
|
|
2934
|
+
taskTypes?: { name: string; icon?: string; color?: string; shortName?: string }[]
|
|
2935
|
+
tags?: { name: string; color?: string }[]
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
/** Context of a project list menu item. */
|
|
2939
|
+
declare interface ProjectListMenuItemContext {
|
|
2940
|
+
/** the selected projects (project folders left out) */
|
|
2941
|
+
projectNames: string[]
|
|
2942
|
+
menu: MenuKind
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2606
2945
|
declare type ProjectModel = {
|
|
2607
2946
|
/** Name is an unique id of the {entity_name} */
|
|
2608
2947
|
name: string;
|
|
@@ -2631,6 +2970,11 @@ declare type ProjectModelWithProducts = ProjectModel & {
|
|
|
2631
2970
|
productTypes: ProductTypeListItem[];
|
|
2632
2971
|
};
|
|
2633
2972
|
|
|
2973
|
+
/** Slots that are about one project. */
|
|
2974
|
+
declare interface ProjectNameScope {
|
|
2975
|
+
projectName: string
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2634
2978
|
export declare interface ProjectOverviewContextType {
|
|
2635
2979
|
isInitialized: boolean;
|
|
2636
2980
|
projectInfo?: ProjectInfo;
|
|
@@ -2697,6 +3041,12 @@ export declare interface ProjectOverviewProviderProps {
|
|
|
2697
3041
|
modules: ProjectTableModulesType;
|
|
2698
3042
|
}
|
|
2699
3043
|
|
|
3044
|
+
/** Slots that are about one project, with the project itself. */
|
|
3045
|
+
declare interface ProjectScope extends ProjectNameScope {
|
|
3046
|
+
/** the project; `undefined` while it loads */
|
|
3047
|
+
project: ProjectInfo_2 | undefined
|
|
3048
|
+
}
|
|
3049
|
+
|
|
2700
3050
|
export declare interface ProjectTableAttribute extends Omit<AttributeModel, 'position'> {
|
|
2701
3051
|
readOnly?: boolean;
|
|
2702
3052
|
enumIsLoading?: boolean;
|
|
@@ -2763,12 +3113,32 @@ export declare interface ProjectTableContextType {
|
|
|
2763
3113
|
dispatch?: ThunkDispatch<any, any, UnknownAction>;
|
|
2764
3114
|
}
|
|
2765
3115
|
|
|
3116
|
+
/** Context of a Customize section. */
|
|
3117
|
+
declare interface ProjectTableCustomizeSectionContext extends ProjectNameScope {
|
|
3118
|
+
page: ProjectTablePage
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
/** Description of a `projectTable.customizeSection` contribution. */
|
|
3122
|
+
declare interface ProjectTableCustomizeSectionMeta {
|
|
3123
|
+
/** unique among the addon's sections */
|
|
3124
|
+
id: string
|
|
3125
|
+
/** the section's entry in Customize and its title when open */
|
|
3126
|
+
title: string
|
|
3127
|
+
/** a Material Symbols icon name */
|
|
3128
|
+
icon: string
|
|
3129
|
+
/** which tables' Customize panels show it; all (Overview, Products, Lists) when not set */
|
|
3130
|
+
pages?: ProjectTablePage[]
|
|
3131
|
+
}
|
|
3132
|
+
|
|
2766
3133
|
declare type ProjectTableModulesType = {
|
|
2767
3134
|
GroupSettings: typeof GroupSettingsFallback;
|
|
2768
3135
|
requiredVersion?: string;
|
|
2769
3136
|
isLoading: boolean;
|
|
2770
3137
|
};
|
|
2771
3138
|
|
|
3139
|
+
/** The project pages with a project table (ProjectTreeTable). */
|
|
3140
|
+
declare type ProjectTablePage = 'overview' | 'products' | 'lists'
|
|
3141
|
+
|
|
2772
3142
|
export declare const ProjectTableProvider: ({ children, foldersMap, tableRows, tasksMap, entitiesMap, tasksByFolderMap, selectedFolders, expanded, showHierarchy, loadingTasks, isLoadingMore, isLoading, error, softError, softErrorAction, isInitialized, users, attribFields, scopes, groups, groupRowFunc, overrideGroupBy, groupCounts, groupCountsComplete, queryFilters, updateShowHierarchy, toggleExpanded, updateExpanded, fetchNextPage, onSyncData, setExpanded, contextMenuItems, powerpack, modules, loadingLinksEntityIds, groupByConfig, hierarchyOptions, hierarchyActive, isFlatFolderView, SubtasksManager, playerOpen, onOpenPlayer, onResetView, hiddenListIds, useParams, useNavigate, useLocation, useSearchParams, dispatch, }: ProjectTableProviderProps) => JSX_2.Element;
|
|
2773
3143
|
|
|
2774
3144
|
export declare interface ProjectTableProviderProps {
|
|
@@ -2862,7 +3232,24 @@ export declare interface ProjectTableQueriesProviderProps {
|
|
|
2862
3232
|
}, force?: boolean) => Promise<any>;
|
|
2863
3233
|
}
|
|
2864
3234
|
|
|
2865
|
-
|
|
3235
|
+
/** Context of a project table toolbar item. */
|
|
3236
|
+
declare interface ProjectTableToolbarItemContext extends ProjectNameScope, ButtonScope {
|
|
3237
|
+
page: ProjectTablePage
|
|
3238
|
+
/** on Lists: the open list */
|
|
3239
|
+
list?: { id: string; label: string; entityType: string }
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3242
|
+
/** Description of a `projectTable.toolbarItem` contribution. */
|
|
3243
|
+
declare interface ProjectTableToolbarItemMeta extends ButtonMeta {
|
|
3244
|
+
/** unique among the addon's toolbar items */
|
|
3245
|
+
id: string
|
|
3246
|
+
/** shown next to the icon; an icon-only button when not set */
|
|
3247
|
+
label?: string
|
|
3248
|
+
/** which tables' toolbars show it; all (Overview, Products, Lists) when not set */
|
|
3249
|
+
pages?: ProjectTablePage[]
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
export declare const ProjectTreeTable: ({ scope, sliceId, onScroll, onScrollBottom, onOpenNew, readOnly, excludedColumns, excludedSorting, extraColumns, includeLinks, includeParents, parentColumns, isLoading: isLoadingProp, isExpandable, enableSorting, clientSorting, sortableRows, onRowReorder, dndActiveId, columnsConfig, showColumnSummaries, fieldStats, groupFieldStats, fieldStatsLoading, fieldStatsError, mainCountLabels, mainBreakdownFields, onScrollBottomGroupBy, contextMenuItems: propsContextMenuItems, onColumnVisibleChange, onColumnVisibleChangeSubscribed, onVisibleRowsChange, scrollToRowId, onScrolledToRow, addonPage, pt, ...props }: ProjectTreeTableProps) => JSX_2.Element;
|
|
2866
3253
|
|
|
2867
3254
|
export declare interface ProjectTreeTableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2868
3255
|
scope: string;
|
|
@@ -2898,6 +3285,7 @@ export declare interface ProjectTreeTableProps extends React.HTMLAttributes<HTML
|
|
|
2898
3285
|
onVisibleRowsChange?: (entityIds: string[]) => void;
|
|
2899
3286
|
scrollToRowId?: string | null;
|
|
2900
3287
|
onScrolledToRow?: (rowId: string) => void;
|
|
3288
|
+
addonPage?: ProjectTablePage;
|
|
2901
3289
|
pt?: {
|
|
2902
3290
|
container?: React.HTMLAttributes<HTMLDivElement>;
|
|
2903
3291
|
head?: Partial<TableHeadProps>;
|
|
@@ -3063,6 +3451,9 @@ declare type RTEntityUpdate = {
|
|
|
3063
3451
|
message?: any;
|
|
3064
3452
|
};
|
|
3065
3453
|
|
|
3454
|
+
/** What a menu item's `run` piece exports as default: called on click with the slot context. */
|
|
3455
|
+
declare type RunPiece<S extends SlotName> = (context: SlotContext<S>) => void | Promise<void>
|
|
3456
|
+
|
|
3066
3457
|
export declare const sanitizeQueryFilter: (filter: QueryFilter) => QueryFilter;
|
|
3067
3458
|
|
|
3068
3459
|
export declare const sanitizeSubtaskName: (name: string) => string;
|
|
@@ -3208,11 +3599,205 @@ declare type SettingsPanelItem = {
|
|
|
3208
3599
|
path?: string;
|
|
3209
3600
|
};
|
|
3210
3601
|
|
|
3602
|
+
/**
|
|
3603
|
+
* A table with addon shortcuts: the project tables (`overview`, `products`, `lists`) and the
|
|
3604
|
+
* panels' tables: the slicer, the project list, the Lists page's lists and the Products page's
|
|
3605
|
+
* versions.
|
|
3606
|
+
*/
|
|
3607
|
+
declare type ShortcutTable = ProjectTablePage | 'slicer' | 'projects' | 'listsPanel' | 'versionsPanel'
|
|
3608
|
+
|
|
3609
|
+
/** Context of a slicer menu item. */
|
|
3610
|
+
declare interface SlicerMenuItemContext extends ProjectNameScope {
|
|
3611
|
+
sliceType: string
|
|
3612
|
+
/** the rows it acts on: the selected ones, or the right-clicked one */
|
|
3613
|
+
selected: SlicerRowRef[]
|
|
3614
|
+
menu: MenuKind
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
/** Description of a `slicer.menuItem` contribution. */
|
|
3618
|
+
declare interface SlicerMenuItemMeta extends ListMenuItemMeta {
|
|
3619
|
+
/** slice types it shows for (`hierarchy`, `assignees`, `status`, ...); all when not set */
|
|
3620
|
+
sliceTypes?: string[]
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3211
3623
|
export declare interface SliceRowSelection {
|
|
3212
3624
|
sliceType: string;
|
|
3213
3625
|
rowSelection: RowSelectionState;
|
|
3214
3626
|
}
|
|
3215
3627
|
|
|
3628
|
+
/** A row of the slicer: a folder in `hierarchy`, a value (user, status, type) in the others. */
|
|
3629
|
+
declare interface SlicerRowRef {
|
|
3630
|
+
id: string
|
|
3631
|
+
label?: string
|
|
3632
|
+
/** for `hierarchy` rows: `folder` (or `task`) */
|
|
3633
|
+
entityType?: string
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
/** Slots on a project page, which always has the host's slicer state (selection, per page). */
|
|
3637
|
+
declare interface SlicerScope {
|
|
3638
|
+
/** empty until the user selects something in a `<Slicer>` the page places */
|
|
3639
|
+
slicer: SlicerSelection
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
/** What is selected in the project page's slicer. */
|
|
3643
|
+
declare interface SlicerSelection {
|
|
3644
|
+
/** `hierarchy`, `assignees`, `status`, `taskType`, ... */
|
|
3645
|
+
sliceType: string
|
|
3646
|
+
/** ids of the selected rows: folder ids for `hierarchy`, the values for the others */
|
|
3647
|
+
selection: string[]
|
|
3648
|
+
}
|
|
3649
|
+
|
|
3650
|
+
/** What the code of a contribution to slot `S` gets: `{ slot: S, ...context }`. */
|
|
3651
|
+
declare type SlotContext<S extends SlotName> = S extends SlotName
|
|
3652
|
+
? { slot: S } & SlotMap[S]['context']
|
|
3653
|
+
: never
|
|
3654
|
+
|
|
3655
|
+
/**
|
|
3656
|
+
* Every slot this version of AYON has. Keys are slot names (`'project.page'`); each value has
|
|
3657
|
+
* the slot's `version`, its description fields (`meta`), the context its code gets (`context`)
|
|
3658
|
+
* and its pieces (`pieces`).
|
|
3659
|
+
*/
|
|
3660
|
+
declare interface SlotMap {
|
|
3661
|
+
/**
|
|
3662
|
+
* A tab on the project page, at `/projects/<project>/<id>`. The tab shows from the
|
|
3663
|
+
* description; `component` loads when the page is first opened.
|
|
3664
|
+
*/
|
|
3665
|
+
'project.page': {
|
|
3666
|
+
version: 1
|
|
3667
|
+
meta: PageMeta
|
|
3668
|
+
context: ProjectScope & SlicerScope & ProjectFoldersScope & ViewsScope
|
|
3669
|
+
pieces: { component: Loader<ComponentType<SlotProps<'project.page'>>> }
|
|
3670
|
+
}
|
|
3671
|
+
/**
|
|
3672
|
+
* A tab on the dashboard (studio level), at `/dashboard/<id>`. The tab shows from the
|
|
3673
|
+
* description; `component` loads when the page is first opened.
|
|
3674
|
+
*/
|
|
3675
|
+
'studio.page': {
|
|
3676
|
+
version: 1
|
|
3677
|
+
meta: PageMeta
|
|
3678
|
+
context: StudioPageContext
|
|
3679
|
+
pieces: { component: Loader<ComponentType<SlotProps<'studio.page'>>> }
|
|
3680
|
+
}
|
|
3681
|
+
/**
|
|
3682
|
+
* A button in the main header, drawn by the host like its own buttons. What a click does is the
|
|
3683
|
+
* addon's: navigate (`to`), run code (`run`), open a dialog (`dialog`) or a menu (`menu`); or the
|
|
3684
|
+
* addon draws the item itself (`component`, loaded with the header). Set exactly one.
|
|
3685
|
+
*/
|
|
3686
|
+
'header.item': {
|
|
3687
|
+
version: 1
|
|
3688
|
+
meta: HeaderItemMeta
|
|
3689
|
+
context: HeaderItemContext
|
|
3690
|
+
pieces: ButtonPieces<'header.item'>
|
|
3691
|
+
}
|
|
3692
|
+
/**
|
|
3693
|
+
* A tab in the details panel. The tab button shows from the description, for `entityTypes`;
|
|
3694
|
+
* `component` loads when the tab is first opened.
|
|
3695
|
+
*/
|
|
3696
|
+
'detailsPanel.tab': {
|
|
3697
|
+
version: 1
|
|
3698
|
+
meta: DetailsPanelTabMeta
|
|
3699
|
+
context: DetailsPanelTabContext
|
|
3700
|
+
pieces: { component: Loader<ComponentType<SlotProps<'detailsPanel.tab'>>> }
|
|
3701
|
+
}
|
|
3702
|
+
/**
|
|
3703
|
+
* An item in the details panel's "more" menu. It shows from the description; `run` loads when
|
|
3704
|
+
* the menu opens and is called on click.
|
|
3705
|
+
*/
|
|
3706
|
+
'detailsPanel.menuItem': {
|
|
3707
|
+
version: 1
|
|
3708
|
+
meta: DetailsPanelMenuItemMeta
|
|
3709
|
+
context: DetailsPanelMenuItemContext
|
|
3710
|
+
pieces: { run: Loader<RunPiece<'detailsPanel.menuItem'>> }
|
|
3711
|
+
}
|
|
3712
|
+
/**
|
|
3713
|
+
* An item in the project list's menus (dashboard, project menu, studio pages' ProjectList): the
|
|
3714
|
+
* right-click menu, the "more" dropdown, or both (`in`). It acts on the selected projects.
|
|
3715
|
+
*/
|
|
3716
|
+
'projectList.menuItem': {
|
|
3717
|
+
version: 1
|
|
3718
|
+
meta: ListMenuItemMeta
|
|
3719
|
+
context: ProjectListMenuItemContext
|
|
3720
|
+
pieces: { run: Loader<RunPiece<'projectList.menuItem'>> }
|
|
3721
|
+
}
|
|
3722
|
+
/**
|
|
3723
|
+
* An item in the project page slicer's menus: the right-click menu, the panel's dropdown, or both
|
|
3724
|
+
* (`in`), for the slice types it lists.
|
|
3725
|
+
*/
|
|
3726
|
+
'slicer.menuItem': {
|
|
3727
|
+
version: 1
|
|
3728
|
+
meta: SlicerMenuItemMeta
|
|
3729
|
+
context: SlicerMenuItemContext
|
|
3730
|
+
pieces: { run: Loader<RunPiece<'slicer.menuItem'>> }
|
|
3731
|
+
}
|
|
3732
|
+
/**
|
|
3733
|
+
* An item in the right-click menu of the project tables' cells, for the selected entities. It
|
|
3734
|
+
* shows from the description; `run` loads when the menu opens and is called on click.
|
|
3735
|
+
*/
|
|
3736
|
+
entityMenuItem: {
|
|
3737
|
+
version: 1
|
|
3738
|
+
meta: EntityMenuItemMeta
|
|
3739
|
+
context: EntityMenuItemContext
|
|
3740
|
+
pieces: { run: Loader<RunPiece<'entityMenuItem'>> }
|
|
3741
|
+
}
|
|
3742
|
+
/**
|
|
3743
|
+
* A button in the project tables' toolbar, before Customize (Overview, Products, Lists), drawn
|
|
3744
|
+
* by the host like the toolbar's own. What a click does is the addon's: navigate (`to`), run code
|
|
3745
|
+
* (`run`), open a dialog (`dialog`) or a menu (`menu`); or the addon draws the item itself
|
|
3746
|
+
* (`component`, loaded with the toolbar). Set exactly one.
|
|
3747
|
+
*/
|
|
3748
|
+
'projectTable.toolbarItem': {
|
|
3749
|
+
version: 1
|
|
3750
|
+
meta: ProjectTableToolbarItemMeta
|
|
3751
|
+
context: ProjectTableToolbarItemContext
|
|
3752
|
+
pieces: ButtonPieces<'projectTable.toolbarItem'>
|
|
3753
|
+
}
|
|
3754
|
+
/**
|
|
3755
|
+
* A section in the project tables' Customize panel (Overview, Products, Lists). The entry shows
|
|
3756
|
+
* from the description; `component` loads when the section is opened.
|
|
3757
|
+
*/
|
|
3758
|
+
'projectTable.customizeSection': {
|
|
3759
|
+
version: 1
|
|
3760
|
+
meta: ProjectTableCustomizeSectionMeta
|
|
3761
|
+
context: ProjectTableCustomizeSectionContext
|
|
3762
|
+
pieces: { component: Loader<ComponentType<SlotProps<'projectTable.customizeSection'>>> }
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* A read-only column in the project tables (Overview, Products, Lists). It is in the column
|
|
3766
|
+
* settings from the description; `cell` and `fetchValues` load with the table. The host draws
|
|
3767
|
+
* the cell box (padding, selection, focus), so `cell` renders only its content; selecting, the
|
|
3768
|
+
* right-click menu and Copy (the cell's `value` as text) work as in other columns. Not sortable,
|
|
3769
|
+
* and pasting into it changes nothing.
|
|
3770
|
+
*/
|
|
3771
|
+
tableColumn: {
|
|
3772
|
+
version: 1
|
|
3773
|
+
meta: TableColumnMeta
|
|
3774
|
+
context: TableCellContext_2
|
|
3775
|
+
pieces: {
|
|
3776
|
+
cell: Loader<ComponentType<SlotProps<'tableColumn'>>>
|
|
3777
|
+
fetchValues?: Loader<TableColumnFetch>
|
|
3778
|
+
}
|
|
3779
|
+
}
|
|
3780
|
+
/**
|
|
3781
|
+
* A keyboard shortcut on the cells of AYON's tables: the project tables (Overview, Products,
|
|
3782
|
+
* Lists) and the panels' tables (slicer, project list, lists, versions). Pressed in a cell, it
|
|
3783
|
+
* runs code (`run`) or opens a dialog (`dialog`) with the selected rows; set exactly one. AYON's
|
|
3784
|
+
* own keys (arrows, Enter, Escape, Tab, Space, `r`, Delete, copy, paste, undo) can't be taken,
|
|
3785
|
+
* and the key does nothing while a cell is being edited.
|
|
3786
|
+
*/
|
|
3787
|
+
'table.shortcut': {
|
|
3788
|
+
version: 1
|
|
3789
|
+
meta: TableShortcutMeta
|
|
3790
|
+
context: TableShortcutContext
|
|
3791
|
+
pieces: TableShortcutPieces
|
|
3792
|
+
}
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
/** The name of a slot, e.g. `'project.page'`. */
|
|
3796
|
+
declare type SlotName = keyof SlotMap & string
|
|
3797
|
+
|
|
3798
|
+
/** Props of the component a contribution to slot `S` renders. Same as `SlotContext<S>`. */
|
|
3799
|
+
declare type SlotProps<S extends SlotName> = SlotContext<S>
|
|
3800
|
+
|
|
3216
3801
|
export declare type SoftErrorAction = {
|
|
3217
3802
|
label: string;
|
|
3218
3803
|
icon: string;
|
|
@@ -3298,6 +3883,12 @@ declare type Status_5 = {
|
|
|
3298
3883
|
scope?: string[];
|
|
3299
3884
|
};
|
|
3300
3885
|
|
|
3886
|
+
/** Context of a studio page. */
|
|
3887
|
+
declare interface StudioPageContext extends ViewsScope {
|
|
3888
|
+
/** projects selected in the page's `<ProjectList>`; saved per page */
|
|
3889
|
+
selectedProjects: string[]
|
|
3890
|
+
}
|
|
3891
|
+
|
|
3301
3892
|
export declare const StyledBaseTextWidget: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
3302
3893
|
|
|
3303
3894
|
declare type SubTaskNode = {
|
|
@@ -3390,6 +3981,14 @@ export declare const TABLE_CONTAINER_ATTR = "data-column-dnd-container";
|
|
|
3390
3981
|
|
|
3391
3982
|
export declare const TableCellContext: Context<TableCellContextValue>;
|
|
3392
3983
|
|
|
3984
|
+
/** Context of one cell of a `tableColumn`. */
|
|
3985
|
+
declare interface TableCellContext_2 extends ProjectNameScope {
|
|
3986
|
+
page: ProjectTablePage
|
|
3987
|
+
entity: EntityRef
|
|
3988
|
+
/** what the column's `fetchValues` returned for this entity; `undefined` without `fetchValues` */
|
|
3989
|
+
value: unknown
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3393
3992
|
export declare type TableCellContextData = {
|
|
3394
3993
|
cellId: string;
|
|
3395
3994
|
columnId: string;
|
|
@@ -3410,6 +4009,47 @@ export declare type TableCellContextValue = {
|
|
|
3410
4009
|
isRowReadOnly?: boolean;
|
|
3411
4010
|
};
|
|
3412
4011
|
|
|
4012
|
+
/**
|
|
4013
|
+
* Gets a column's values, by entity id; each cell gets its own as `value`. AYON calls it with
|
|
4014
|
+
* the rows that come on screen and that it has no value for yet, in batches once scrolling
|
|
4015
|
+
* pauses, and keeps what it returns: scrolling back costs nothing. A row whose entity changes
|
|
4016
|
+
* (here or by someone else) is asked for again; `refreshTableColumn(id)` asks again for all.
|
|
4017
|
+
* When it throws, those cells show the error and are tried again when they next come on
|
|
4018
|
+
* screen. Fetch through AYON's store (`dispatch(api.endpoints.x.initiate(...))`) to share its
|
|
4019
|
+
* cache.
|
|
4020
|
+
*/
|
|
4021
|
+
declare type TableColumnFetch = (args: TableColumnFetchArgs) => Promise<Record<string, unknown>>
|
|
4022
|
+
|
|
4023
|
+
/** What a column's `fetchValues` gets. */
|
|
4024
|
+
declare interface TableColumnFetchArgs extends ProjectNameScope {
|
|
4025
|
+
page: ProjectTablePage
|
|
4026
|
+
/** the rows to get values for (entities, not list items): at most 100 */
|
|
4027
|
+
entities: EntityRef[]
|
|
4028
|
+
/** aborted when the table no longer needs them (another project or table) */
|
|
4029
|
+
signal: AbortSignal
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
/** Description of a `tableColumn` contribution. */
|
|
4033
|
+
declare interface TableColumnMeta {
|
|
4034
|
+
/** part of the column id, so only letters, digits and `_` */
|
|
4035
|
+
id: string
|
|
4036
|
+
/** the column header and its name in the column settings */
|
|
4037
|
+
label: string
|
|
4038
|
+
icon?: string
|
|
4039
|
+
/** entity types with a cell; other rows show an empty read-only cell. All when not set */
|
|
4040
|
+
entityTypes?: string[]
|
|
4041
|
+
/** which tables offer it; all (Overview, Products, Lists) when not set */
|
|
4042
|
+
pages?: ProjectTablePage[]
|
|
4043
|
+
/** width in pixels. Addon columns start hidden: users show them in Customize */
|
|
4044
|
+
width?: number
|
|
4045
|
+
/**
|
|
4046
|
+
* where the column sits in the "Add column" menu: a submenu named after the addon when not
|
|
4047
|
+
* set, a submenu with this name (columns giving the same name share it, across addons too), or
|
|
4048
|
+
* `false` for the menu's top level
|
|
4049
|
+
*/
|
|
4050
|
+
menu?: string | false
|
|
4051
|
+
}
|
|
4052
|
+
|
|
3413
4053
|
export declare interface TableGroupBy {
|
|
3414
4054
|
desc: boolean;
|
|
3415
4055
|
id: string;
|
|
@@ -3440,6 +4080,66 @@ export declare interface TableRow {
|
|
|
3440
4080
|
cellMarks?: Record<string, CellMark>;
|
|
3441
4081
|
}
|
|
3442
4082
|
|
|
4083
|
+
/** A table row a shortcut acts on. */
|
|
4084
|
+
declare interface TableRowRef {
|
|
4085
|
+
/** project tables: the entity's id (list items resolve to their entity); else the row's id */
|
|
4086
|
+
id: string
|
|
4087
|
+
/** project tables: `folder`, `task`, `product`, `version`, ... */
|
|
4088
|
+
entityType?: string
|
|
4089
|
+
name?: string
|
|
4090
|
+
label?: string
|
|
4091
|
+
/**
|
|
4092
|
+
* the row as the table has it: an entity's fields and `attrib` in the project tables, the
|
|
4093
|
+
* project, list, version or slicer value in the panels
|
|
4094
|
+
*/
|
|
4095
|
+
data: Record<string, unknown>
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
/** Context of a table shortcut. */
|
|
4099
|
+
declare interface TableShortcutContext {
|
|
4100
|
+
/** the table the key was pressed in */
|
|
4101
|
+
table: ShortcutTable
|
|
4102
|
+
/** the open project; `null` in the project list */
|
|
4103
|
+
projectName: string | null
|
|
4104
|
+
/** the rows it acts on: the selected ones when the key was pressed in one of them, else its row */
|
|
4105
|
+
rows: TableRowRef[]
|
|
4106
|
+
/** where the key was pressed: the row's id, and the column's in the project tables */
|
|
4107
|
+
focused: { rowId: string; columnId?: string }
|
|
4108
|
+
/** project tables: the selected cells, by row (entity) and column id; empty elsewhere */
|
|
4109
|
+
cells: { rowId: string; columnId: string }[]
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4112
|
+
/** Description of a `table.shortcut` contribution. */
|
|
4113
|
+
declare interface TableShortcutMeta {
|
|
4114
|
+
/** unique among the addon's shortcuts */
|
|
4115
|
+
id: string
|
|
4116
|
+
/** what it does, e.g. `Copy row as JSON`; the dialog's title when `dialogTitle` is not set */
|
|
4117
|
+
label: string
|
|
4118
|
+
/**
|
|
4119
|
+
* the key and its modifiers joined by `+`, lower case: `g`, `shift+mod+c`, `alt+1`, `f2`. `mod` is
|
|
4120
|
+
* ⌘ on macOS and Ctrl elsewhere; `ctrl`, `meta`, `alt` and `shift` are the keys themselves.
|
|
4121
|
+
* Letters and digits match the key's place on the keyboard, so `alt+g` works on macOS too
|
|
4122
|
+
*/
|
|
4123
|
+
keys: string
|
|
4124
|
+
/**
|
|
4125
|
+
* which tables it works in; all when not set. `overview`, `products`, `lists` (the project
|
|
4126
|
+
* tables), `slicer`, `projects`, `listsPanel`, `versionsPanel`
|
|
4127
|
+
*/
|
|
4128
|
+
tables?: ShortcutTable[]
|
|
4129
|
+
/** the `dialog`'s title; the label when not set */
|
|
4130
|
+
dialogTitle?: string
|
|
4131
|
+
/** the `dialog`'s size, `md` by default */
|
|
4132
|
+
dialogSize?: 'sm' | 'md' | 'lg' | 'full'
|
|
4133
|
+
}
|
|
4134
|
+
|
|
4135
|
+
/** The pieces of a table shortcut: what the key does. Set exactly one. */
|
|
4136
|
+
declare interface TableShortcutPieces {
|
|
4137
|
+
/** called with the context when the key is pressed */
|
|
4138
|
+
run?: Loader<RunPiece<'table.shortcut'>>
|
|
4139
|
+
/** the content of a dialog the host opens: AYON's dialog with title and close button */
|
|
4140
|
+
dialog?: Loader<ComponentType<SlotProps<'table.shortcut'> & DialogScope>>
|
|
4141
|
+
}
|
|
4142
|
+
|
|
3443
4143
|
export declare type TableUser = {
|
|
3444
4144
|
name: string;
|
|
3445
4145
|
fullName?: string | null;
|
|
@@ -3691,6 +4391,31 @@ export declare type UpdateTableEntity = (cellId: CellId, value: string, { includ
|
|
|
3691
4391
|
includeSelection: boolean;
|
|
3692
4392
|
}) => Promise<void>;
|
|
3693
4393
|
|
|
4394
|
+
/**
|
|
4395
|
+
* Items addons contribute to the cells' right-click menu (entityMenuItem slot, @ynput/ayon-addon),
|
|
4396
|
+
* as one constructor a page adds to its contextMenuItems: the `top` ones first in the list, the
|
|
4397
|
+
* `bottom` ones (default) right before 'delete'. The items draw from their descriptions; `run`
|
|
4398
|
+
* starts loading when the menu opens.
|
|
4399
|
+
*/
|
|
4400
|
+
export declare const useAddonEntityMenuItems: (page: ProjectTablePage, position?: MenuItemPosition) => ContextMenuItemConstructor;
|
|
4401
|
+
|
|
4402
|
+
/**
|
|
4403
|
+
* The columns addons contribute to this page's table (tableColumn slot): `columns` for the
|
|
4404
|
+
* table's `extraColumns`, `settingsColumns` for the column settings and the add-column menu.
|
|
4405
|
+
* Both come from the descriptions; the cells' code starts loading with the table. In the
|
|
4406
|
+
* add-column menu each addon's columns get a submenu titled after it unless they name one
|
|
4407
|
+
* (`menu`) or ask for the top level (`menu: false`).
|
|
4408
|
+
*/
|
|
4409
|
+
export declare const useAddonTableColumns: (page: ProjectTablePage) => {
|
|
4410
|
+
columns: TreeTableExtraColumn[];
|
|
4411
|
+
settingsColumns: {
|
|
4412
|
+
value: string;
|
|
4413
|
+
label: string;
|
|
4414
|
+
icon: string | undefined;
|
|
4415
|
+
menu: string | undefined;
|
|
4416
|
+
}[];
|
|
4417
|
+
};
|
|
4418
|
+
|
|
3694
4419
|
export declare const useCellEditing: () => CellEditingContextType;
|
|
3695
4420
|
|
|
3696
4421
|
export declare const useCheckSelectedCellsVisible: ({ selectedCells, setSelectedCells, focusedCellId, setFocusedCellId, }: CheckSelectedCellsVisibleProps) => void;
|
|
@@ -4111,6 +4836,12 @@ export declare type VersionStatsArgs = {
|
|
|
4111
4836
|
latestPerFolder?: boolean;
|
|
4112
4837
|
};
|
|
4113
4838
|
|
|
4839
|
+
/** Pages, which have views when their description sets `viewType`. */
|
|
4840
|
+
declare interface ViewsScope {
|
|
4841
|
+
/** `undefined` when the page's description has no `viewType` */
|
|
4842
|
+
views: PageViews | undefined
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4114
4845
|
declare type VisibleEntity = {
|
|
4115
4846
|
id: string;
|
|
4116
4847
|
entityType: string;
|
|
@@ -4151,6 +4882,9 @@ export { }
|
|
|
4151
4882
|
|
|
4152
4883
|
|
|
4153
4884
|
declare module '@tanstack/react-table' {
|
|
4885
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
4886
|
+
addonColumn?: AddonColumnMeta;
|
|
4887
|
+
}
|
|
4154
4888
|
interface TableMeta<TData extends RowData> {
|
|
4155
4889
|
options?: BuiltInFieldOptions;
|
|
4156
4890
|
readOnly?: ProjectTreeTableProps['readOnly'];
|