@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.
Files changed (66) hide show
  1. package/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +3 -0
  46. package/dist/types/ContextMenu.d.ts +3 -0
  47. package/dist/types/DetailsPanel.d.ts +3 -0
  48. package/dist/types/EntityPickerDialog.d.ts +3 -0
  49. package/dist/types/Feed.d.ts +3 -0
  50. package/dist/types/ListTable.d.ts +3 -0
  51. package/dist/types/NewEntity.d.ts +3 -0
  52. package/dist/types/ProjectTreeTable.d.ts +735 -1
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +3 -0
  55. package/dist/types/SimpleTable.d.ts +17 -0
  56. package/dist/types/Slicer.d.ts +4 -0
  57. package/dist/types/Views.d.ts +3 -0
  58. package/dist/types/api.d.ts +3 -0
  59. package/dist/types/components.d.ts +808 -11
  60. package/dist/types/context.d.ts +39 -1
  61. package/dist/types/hooks.d.ts +3 -0
  62. package/dist/types/index.d.ts +3 -0
  63. package/dist/types/util.d.ts +7 -0
  64. package/dist/util.es.js +152 -144
  65. package/package.json +16 -8
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
@@ -9,6 +9,7 @@ import { ColumnOrderState } from '@tanstack/react-table';
9
9
  import { ColumnPinningState } from '@tanstack/react-table';
10
10
  import { ColumnSizingState } from '@tanstack/react-table';
11
11
  import { Component } from 'react';
12
+ import type { ComponentType } from 'react';
12
13
  import { Context } from 'react';
13
14
  import { coreModuleName } from '@reduxjs/toolkit/query';
14
15
  import { CSSProperties } from 'react';
@@ -96,6 +97,9 @@ export declare const $isYouTubeNode: (node: LexicalNode | null | undefined) => n
96
97
 
97
98
  export declare const $setMarkdown: (markdown: string) => void;
98
99
 
100
+ /** Who sees a page: everyone when not set. Admins see manager pages too. */
101
+ declare type Access = 'manager' | 'admin'
102
+
99
103
  export declare const ACCESS_LEVEL_LABELS: {
100
104
  0: string;
101
105
  10: string;
@@ -153,11 +157,7 @@ export declare const ACTIVITY_LINK_LABEL = "Comment";
153
157
  export declare const AddColumnButton: FC<AddColumnButtonProps>;
154
158
 
155
159
  declare interface AddColumnButtonProps {
156
- extraColumns?: {
157
- value: string;
158
- label: string;
159
- icon?: string;
160
- }[];
160
+ extraColumns?: Pick<AddColumnItem, 'value' | 'label' | 'icon' | 'menu'>[];
161
161
  hiddenColumns?: string[];
162
162
  includeLinks?: boolean;
163
163
  extraMenuItems?: MenuItemType[];
@@ -172,6 +172,7 @@ declare type AddColumnItem = SettingsPanelItem & {
172
172
  field?: string;
173
173
  isLink?: boolean;
174
174
  parentScope?: EntityType;
175
+ menu?: string;
175
176
  };
176
177
 
177
178
  declare type AddLinks = (links: {
@@ -189,8 +190,71 @@ declare interface AddNewLinksProps {
189
190
  onAdd?: (targetEntityId: string, linkType?: string) => void;
190
191
  }
191
192
 
193
+ export declare const AddonButton: <S extends ButtonSlot>({ contribution, context, renderButton, autoOpen, onContext, }: AddonButtonProps<S>) => JSX_2.Element;
194
+
195
+ export declare interface AddonButtonProps<S extends ButtonSlot> {
196
+ contribution: Contribution<S>;
197
+ /** the slot's context, without `navigate` (the button adds it) */
198
+ context: Omit<SlotMap[S]['context'], 'navigate'>;
199
+ /** the host's button; not called for a `component` item, which draws itself */
200
+ renderButton: (props: AddonButtonRenderProps) => ReactNode;
201
+ /** dev shell: open the dialog right away */
202
+ autoOpen?: boolean;
203
+ /** dev shell: the context the item's code gets */
204
+ onContext?: (context: object) => void;
205
+ }
206
+
207
+ export declare interface AddonButtonRenderProps {
208
+ ref: (element: HTMLElement | null) => void;
209
+ /** its dialog or menu is open */
210
+ active: boolean;
211
+ onClick: () => void;
212
+ onMouseEnter: () => void;
213
+ }
214
+
215
+ declare type AddonDetailsPanelTab = `${string}.${string}`;
216
+
217
+ export declare const AddonDialog: <S extends SlotName>({ contribution, context }: AddonDialogProps<S>) => JSX_2.Element;
218
+
219
+ export declare interface AddonDialogProps<S extends SlotName> {
220
+ contribution: Contribution<S>;
221
+ /** the slot's context with `close`; memoize it */
222
+ context: SlotMap[S]['context'] & {
223
+ close: () => void;
224
+ };
225
+ }
226
+
227
+ /** The addon a contribution came from. */
228
+ declare interface AddonInfo {
229
+ /** addon name, as on the server */
230
+ name: string
231
+ version: string
232
+ /** federation remote the manifest was loaded from */
233
+ remote: string
234
+ }
235
+
192
236
  export declare const AddonLoadingScreen: FC<ReportsLoadingScreenProps>;
193
237
 
238
+ /** An entry of a button's `menu`. */
239
+ declare type AddonMenuItem =
240
+ | { divider: true }
241
+ | {
242
+ id: string
243
+ label: string
244
+ icon?: string
245
+ /** goes to an AYON URL when clicked */
246
+ to?: string
247
+ /** opens an external URL in a new tab when clicked */
248
+ href?: string
249
+ /** called when clicked; an error is shown as a toast */
250
+ onClick?: () => void | Promise<void>
251
+ /** a submenu */
252
+ items?: AddonMenuItem[]
253
+ disabled?: boolean
254
+ selected?: boolean
255
+ danger?: boolean
256
+ }
257
+
194
258
  declare type AlignType = 'left' | 'right';
195
259
 
196
260
  declare type Anatomy = {
@@ -215,6 +279,15 @@ declare type Anatomy = {
215
279
  product_base_types?: ProductBaseTypes;
216
280
  };
217
281
 
282
+ /** Any contribution, whatever its slot: what the host's generic code (loading, errors) uses. */
283
+ declare interface AnyContribution {
284
+ slot: string
285
+ id: string
286
+ key: string
287
+ addon: AddonInfo
288
+ [field: string]: unknown
289
+ }
290
+
218
291
  export declare type AttributeData = {
219
292
  id: string;
220
293
  isExpanded: boolean;
@@ -363,6 +436,46 @@ declare const Button: IStyledComponentBase<"web", FastOmit<Omit< ButtonProps & R
363
436
  ref?: ((instance: HTMLButtonElement | null) => void | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLButtonElement> | null | undefined;
364
437
  }, never>>> & string & Omit< ForwardRefExoticComponent< ButtonProps & RefAttributes<HTMLButtonElement>>, keyof Component<any, {}, any>>;
365
438
 
439
+ /** What a button contribution does on click: exactly one is set (checked when the manifest loads). */
440
+ export declare type ButtonAction = 'to' | 'run' | 'dialog' | 'menu' | 'component';
441
+
442
+ /** Description fields of a button the host draws (header and toolbar items). */
443
+ declare interface ButtonMeta {
444
+ /** a Material Symbols icon name; required unless the item is a `component` */
445
+ icon?: string
446
+ /** shown on hover; the label when not set */
447
+ tooltip?: string
448
+ /** navigates there on click, e.g. `/dashboard/comments` (exactly one action: see the slot) */
449
+ to?: string
450
+ /** the `dialog`'s title; the label when not set */
451
+ dialogTitle?: string
452
+ /** the `dialog`'s size, `md` by default */
453
+ dialogSize?: 'sm' | 'md' | 'lg' | 'full'
454
+ }
455
+
456
+ /**
457
+ * The pieces of a button: what a click does. Set exactly one of them, or `to` in the description.
458
+ */
459
+ declare interface ButtonPieces<S extends SlotName> {
460
+ /** called on click with the context (it has `navigate`) */
461
+ run?: Loader<RunPiece<S>>
462
+ /** the content of a dialog the host opens and closes: AYON's dialog with title and close button */
463
+ dialog?: Loader<ComponentType<SlotProps<S> & DialogScope>>
464
+ /** the items of a menu the host opens under the button, like the header's help menu */
465
+ menu?: Loader<MenuPiece<S>>
466
+ /** the addon's own component instead of the host's button: a dropdown, a toggle, anything */
467
+ component?: Loader<ComponentType<SlotProps<S>>>
468
+ }
469
+
470
+ /** Context of a button's code (`run`, `dialog`, `menu`, `component`) besides the slot's own. */
471
+ declare interface ButtonScope {
472
+ /** goes to an AYON URL, e.g. `navigate('/dashboard/comments')` */
473
+ navigate: (to: string) => void
474
+ }
475
+
476
+ /** The slots whose contributions are buttons: header.item, projectTable.toolbarItem. */
477
+ export declare type ButtonSlot = 'header.item' | 'projectTable.toolbarItem';
478
+
366
479
  export declare const CellEditingDialog: FC<LinksManagerDialogProps>;
367
480
 
368
481
  export declare const Chips: FC<ChipsProps>;
@@ -547,6 +660,18 @@ declare interface ContextMenuItemType extends Omit<ContextMenuItemProps, 'contex
547
660
  [key: string]: any;
548
661
  }
549
662
 
663
+ /** A contribution as the host keeps it: what the addon wrote, plus where it came from. */
664
+ declare type Contribution<S extends SlotName = SlotName> = ContributionInput<S> & {
665
+ /** `<addonName>.<id>`, unique across addons */
666
+ key: string
667
+ addon: AddonInfo
668
+ }
669
+
670
+ /** What an addon writes for a contribution to slot `S`: the slot, its description and pieces. */
671
+ declare type ContributionInput<S extends SlotName = SlotName> = S extends SlotName
672
+ ? { slot: S } & SlotMap[S]['meta'] & SlotMap[S]['pieces']
673
+ : never
674
+
550
675
  /**
551
676
  * Mention source backed by the activity feed's mention suggestions (`useGetEntityMentionsQuery`),
552
677
  * using the same option builders and sorting as the legacy comment input.
@@ -898,6 +1023,24 @@ declare type DetailsPanelFolderFragmentFragment = {
898
1023
  folderType: string;
899
1024
  };
900
1025
 
1026
+ /** Context of a details panel menu item. */
1027
+ declare interface DetailsPanelMenuItemContext extends ProjectNameScope {
1028
+ entityType: string
1029
+ /** the entities the panel shows */
1030
+ selectedEntities: EntityRef[]
1031
+ }
1032
+
1033
+ /** Description of a `detailsPanel.menuItem` contribution. */
1034
+ declare interface DetailsPanelMenuItemMeta extends MenuItemMeta {
1035
+ /** entity types the item shows for; all when not set */
1036
+ entityTypes?: string[]
1037
+ /**
1038
+ * shown as an icon button in the panel's header, next to the "more" button, instead of in its
1039
+ * menu (the label is the tooltip); `position` and `order` then order the header buttons
1040
+ */
1041
+ pinned?: boolean
1042
+ }
1043
+
901
1044
  declare type DetailsPanelPip = {
902
1045
  entityType: DetailsPanelEntityType;
903
1046
  entities: {
@@ -928,7 +1071,25 @@ declare type DetailsPanelRepresentationFragmentFragment = {
928
1071
  }>;
929
1072
  };
930
1073
 
931
- declare type DetailsPanelTab = 'feed' | 'subtasks' | 'details' | 'files';
1074
+ declare type DetailsPanelTab = 'feed' | 'subtasks' | 'details' | 'files' | AddonDetailsPanelTab;
1075
+
1076
+ /** Context of a details panel tab. */
1077
+ declare interface DetailsPanelTabContext extends ProjectNameScope, EntityScope {
1078
+ /** where the panel is open (`overview`, `dashboard`, `inbox`, ...); the panel opens in many places */
1079
+ scope: string
1080
+ }
1081
+
1082
+ /** Description of a `detailsPanel.tab` contribution. */
1083
+ declare interface DetailsPanelTabMeta {
1084
+ /** the tab id is `<addon>.<id>` */
1085
+ id: string
1086
+ /** the tab button's tooltip */
1087
+ label: string
1088
+ /** a Material Symbols icon name, the tab button */
1089
+ icon: string
1090
+ /** entity types the tab shows for; all when not set */
1091
+ entityTypes?: string[]
1092
+ }
932
1093
 
933
1094
  declare type DetailsPanelTask = NonNullable<GetDetailsPanelTaskQuery['project']['task']>;
934
1095
 
@@ -969,6 +1130,12 @@ export declare const detectRelativeDatePattern: (startISO: string | undefined, e
969
1130
  id: DateOptionType;
970
1131
  } | null;
971
1132
 
1133
+ /** What a `dialog` piece gets besides the slot context. */
1134
+ declare interface DialogScope {
1135
+ /** closes the dialog */
1136
+ close: () => void
1137
+ }
1138
+
972
1139
  declare type DivPt = Partial<React.HTMLAttributes<HTMLDivElement>>;
973
1140
 
974
1141
  declare type DivPt_2 = Partial<default_2.HTMLAttributes<HTMLDivElement>>;
@@ -1122,6 +1289,23 @@ declare type EntityListModel = {
1122
1289
  accessLevel?: ListAccessLevel;
1123
1290
  };
1124
1291
 
1292
+ /** Context of an entity menu item. */
1293
+ declare interface EntityMenuItemContext extends ProjectNameScope {
1294
+ page: ProjectTablePage
1295
+ /** the selected entities (not table rows: list items resolve to their entity) */
1296
+ entities: EntityRef[]
1297
+ }
1298
+
1299
+ /** Description of an `entityMenuItem` contribution. */
1300
+ declare interface EntityMenuItemMeta extends MenuItemMeta {
1301
+ /** entity types it acts on: shown only when every selected entity is one of them. All when not set */
1302
+ entityTypes?: string[]
1303
+ /** which tables offer it; all (Overview, Products, Lists) when not set */
1304
+ pages?: ProjectTablePage[]
1305
+ /** `single`: only for one selected entity; `multi` (default): for one or more */
1306
+ selection?: 'single' | 'multi'
1307
+ }
1308
+
1125
1309
  declare type EntityNaming_2 = {
1126
1310
  /** How to capitalize the entity names */
1127
1311
  capitalization?: 'lower' | 'upper' | 'keep' | 'pascal' | 'camel';
@@ -1156,6 +1340,22 @@ export declare interface EntityPathProps {
1156
1340
  scope: string;
1157
1341
  }
1158
1342
 
1343
+ /** An entity a slot is about: its id and type, and its name when the host has it. */
1344
+ declare interface EntityRef {
1345
+ id: string
1346
+ /** `folder`, `task`, `product`, `version`, `representation` */
1347
+ entityType: string
1348
+ projectName: string
1349
+ name?: string
1350
+ label?: string
1351
+ }
1352
+
1353
+ /** Slots about one or more entities of one type. */
1354
+ declare interface EntityScope {
1355
+ entityType: string
1356
+ entities: EntityRef[]
1357
+ }
1358
+
1159
1359
  export declare const EntityTooltip: React.FC<EntityTooltipProps>;
1160
1360
 
1161
1361
  export declare interface EntityTooltipProjectInfo {
@@ -1439,6 +1639,25 @@ declare type FolderDeleteInfo = {
1439
1639
  totalVersionCount: number;
1440
1640
  };
1441
1641
 
1642
+ /** A folder of the project, as slots pass it. AYON passes its folder list item, so more may be there. */
1643
+ declare interface FolderInfo {
1644
+ id: string
1645
+ name: string
1646
+ label?: string
1647
+ folderType: string
1648
+ /** `/` separated names from the project root, e.g. `assets/characters/hero` */
1649
+ path: string
1650
+ /** unset for folders at the project root */
1651
+ parentId?: string
1652
+ /** names of the parents, from the project root */
1653
+ parents: string[]
1654
+ status: string
1655
+ tags?: string[]
1656
+ hasTasks?: boolean
1657
+ hasChildren?: boolean
1658
+ attrib?: Record<string, unknown>
1659
+ }
1660
+
1442
1661
  declare interface FolderProduct {
1443
1662
  id: string;
1444
1663
  name: string;
@@ -1587,6 +1806,8 @@ declare type GetBaseViewApiResponse =
1587
1806
  /** status 200 Successful Response */
1588
1807
  OverviewViewModel | TaskProgressViewModel | ListsViewModel | ReviewsViewModel | VersionsViewModel | GenericViewModel;
1589
1808
 
1809
+ export declare const getButtonAction: (contribution: AnyContribution) => ButtonAction | undefined;
1810
+
1590
1811
  declare type GetDefaultViewApiArg = {
1591
1812
  viewType: string;
1592
1813
  projectName?: string;
@@ -1761,6 +1982,24 @@ declare interface HastNode_2 {
1761
1982
  children?: HastNode_2[];
1762
1983
  }
1763
1984
 
1985
+ /** Context of a header item. */
1986
+ declare interface HeaderItemContext extends ButtonScope {
1987
+ /** the project whose page is open, else `null` */
1988
+ projectName: string | null
1989
+ }
1990
+
1991
+ /** Description of a `header.item` contribution. */
1992
+ declare interface HeaderItemMeta extends ButtonMeta {
1993
+ /** unique among the addon's header items */
1994
+ id: string
1995
+ /** shown next to the icon on the left, as the tooltip on the right */
1996
+ label: string
1997
+ /** `left`: after the Home button; `right`: before chat and the inbox */
1998
+ placement: 'left' | 'right'
1999
+ /** order among addon items on the same side, lowest first */
2000
+ order?: number
2001
+ }
2002
+
1764
2003
  export declare interface HeightSliderProps {
1765
2004
  value: number;
1766
2005
  onChange: (value: number) => void;
@@ -1944,6 +2183,12 @@ declare interface ListAttributeFormProps {
1944
2183
  attributes?: AttributeField[];
1945
2184
  }
1946
2185
 
2186
+ /** Description of a `projectList.menuItem` or `slicer.menuItem` contribution. */
2187
+ declare interface ListMenuItemMeta extends MenuItemMeta {
2188
+ /** which menus show it: both when not set */
2189
+ in?: MenuKind[]
2190
+ }
2191
+
1947
2192
  export declare const ListMetaData: FC<ListMetaDataProps>;
1948
2193
 
1949
2194
  declare interface ListMetaDataProps {
@@ -2002,6 +2247,29 @@ declare type ListViewsApiArg = {
2002
2247
  projectName?: string;
2003
2248
  };
2004
2249
 
2250
+ /**
2251
+ * A piece of a contribution: a dynamic import of a file in the addon, `() => import('./NotesTab')`.
2252
+ * The build puts each piece in its own chunk, and the slot decides when it loads.
2253
+ */
2254
+ declare type Loader<T> = () => Promise<{ default: T }>
2255
+
2256
+ export declare const LoginPage: ({ onLogin, loading, isFirstTime }: LoginPageProps) => JSX_2.Element | null;
2257
+
2258
+ export declare interface LoginPageProps {
2259
+ /** stores the session: ayon-frontend dispatches its `login`, the addon dev shell stores the token */
2260
+ onLogin: (result: LoginResult) => void;
2261
+ /** shown while the site info or an SSO callback loads */
2262
+ loading?: ReactNode;
2263
+ isFirstTime?: boolean;
2264
+ }
2265
+
2266
+ /** What a successful login gives the host, which stores the session (see storeAccessToken). */
2267
+ export declare interface LoginResult {
2268
+ user: any;
2269
+ accessToken?: string;
2270
+ redirectUrl?: string | null;
2271
+ }
2272
+
2005
2273
  declare type MainCalc = 'count' | 'breakdown';
2006
2274
 
2007
2275
  export declare const MARKDOWN_TRANSFORMERS: Transformer_2[];
@@ -2226,6 +2494,26 @@ declare interface MenuItemEndAction {
2226
2494
  onClick: (e: default_2.MouseEvent) => void;
2227
2495
  }
2228
2496
 
2497
+ /** Description of a menu item contribution. */
2498
+ declare interface MenuItemMeta {
2499
+ /** unique among the addon's items of the slot */
2500
+ id: string
2501
+ /** the menu entry */
2502
+ label: string
2503
+ /** a Material Symbols icon name */
2504
+ icon: string
2505
+ /**
2506
+ * `top`: first in the menu; `bottom` (default): after the menu's own items, above the
2507
+ * destructive ones (Delete, Archive)
2508
+ */
2509
+ position?: MenuItemPosition
2510
+ /** order among addon items with the same position, lowest first */
2511
+ order?: number
2512
+ }
2513
+
2514
+ /** Where an addon's item goes in a menu. */
2515
+ declare type MenuItemPosition = 'top' | 'bottom'
2516
+
2229
2517
  export declare interface MenuItemType {
2230
2518
  id: string;
2231
2519
  label?: string | string[];
@@ -2250,6 +2538,9 @@ export declare interface MenuItemType {
2250
2538
  [key: string]: any;
2251
2539
  }
2252
2540
 
2541
+ /** Which menu a list's menu item is in: the right-click menu or the "more" dropdown. */
2542
+ declare type MenuKind = 'context' | 'dropdown'
2543
+
2253
2544
  export declare const MenuList: default_2.FC<MenuListProps>;
2254
2545
 
2255
2546
  declare interface MenuListProps {
@@ -2277,6 +2568,11 @@ declare interface MenuListProps {
2277
2568
  [key: string]: any;
2278
2569
  }
2279
2570
 
2571
+ /** What a `menu` piece exports as default: the menu's items, built each time the menu opens. */
2572
+ declare type MenuPiece<S extends SlotName> = (
2573
+ context: SlotContext<S>,
2574
+ ) => AddonMenuItem[] | Promise<AddonMenuItem[]>
2575
+
2280
2576
  declare interface MenuProps {
2281
2577
  menu?: MenuItemType[];
2282
2578
  onClose?: () => void;
@@ -2310,6 +2606,13 @@ declare type Omit_2<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
2310
2606
 
2311
2607
  declare type OnSyncDataCallback = (updates: RTEntityUpdate[] | undefined) => void | Promise<void>;
2312
2608
 
2609
+ export declare interface OpenAddonShortcutDialog {
2610
+ contribution: Contribution<'table.shortcut'>;
2611
+ context: TableShortcutContext & {
2612
+ close: () => void;
2613
+ };
2614
+ }
2615
+
2313
2616
  declare interface OpenStateByScope {
2314
2617
  [scope: string]: boolean;
2315
2618
  }
@@ -2378,6 +2681,43 @@ declare type OverviewViewPostModel = {
2378
2681
  viewType?: 'overview';
2379
2682
  };
2380
2683
 
2684
+ /** Description of a page contribution (`project.page`, `studio.page`). */
2685
+ declare interface PageMeta {
2686
+ /**
2687
+ * The page's URL segment and tab id: `/projects/<project>/<id>`, `/dashboard/<id>`.
2688
+ * A built-in page with the same id wins.
2689
+ */
2690
+ id: string
2691
+ /** the tab label */
2692
+ title: string
2693
+ /** `manager` or `admin`: the tab is hidden from everyone else, and its URL redirects them */
2694
+ access?: Access
2695
+ /**
2696
+ * Gives the page views: the host shows the views menu and the page gets `views` in its context.
2697
+ * The type its views are saved under, e.g. `budget`: letters, digits, `_`, `-` and `.`. It must
2698
+ * be the page's own: one AYON or another page already uses is not shown.
2699
+ */
2700
+ viewType?: string
2701
+ }
2702
+
2703
+ /**
2704
+ * The views of a page with a `viewType`. The host shows the views menu (saved views, the user's
2705
+ * working view, sharing); the page reads the selected view's settings and saves changes here.
2706
+ */
2707
+ declare interface PageViews {
2708
+ /** the page's `viewType` */
2709
+ viewType: string
2710
+ /** settings of the selected view: the page decides their shape. `undefined` while loading */
2711
+ settings: Record<string, unknown> | undefined
2712
+ /** true until the selected view's settings have loaded: don't save before that */
2713
+ isLoading: boolean
2714
+ /**
2715
+ * Saves settings the user changed: they are merged into the selected view's settings and stored
2716
+ * in the user's working view, which becomes the selected view (as on the built-in pages).
2717
+ */
2718
+ updateSettings: (settings: Record<string, unknown>) => Promise<void>
2719
+ }
2720
+
2381
2721
  declare type ParentColumnDataType = 'string' | 'datetime' | 'list_of_strings';
2382
2722
 
2383
2723
  declare type ParentColumnDefinition = {
@@ -2581,6 +2921,51 @@ declare interface ProjectContextValue extends ProjectModelWithProducts {
2581
2921
  }[];
2582
2922
  }
2583
2923
 
2924
+ /** The project's folders. The host loads them once per project, for every page of it. */
2925
+ declare interface ProjectFolders {
2926
+ /** every folder of the project; empty while they load */
2927
+ folders: FolderInfo[]
2928
+ /** true on the first load and when the project changes */
2929
+ isLoading: boolean
2930
+ getFolderById: (id: string) => FolderInfo | undefined
2931
+ /** ids of the folder's parents, nearest first */
2932
+ getParentFolderIds: (folderId: string) => string[]
2933
+ /** ids of every folder inside the given ones, and the given ones too with `includeSelf` */
2934
+ getChildFolderIds: (folderIds: string[], includeSelf?: boolean) => string[]
2935
+ /** the given folders, without those inside another one of them */
2936
+ getFolderIdsWithoutChildren: (folderIds: string[]) => string[]
2937
+ }
2938
+
2939
+ /** Slots on a project page, which always has the project's folders. */
2940
+ declare interface ProjectFoldersScope {
2941
+ /** every folder of the project, with lookups for parents and children */
2942
+ projectFolders: ProjectFolders
2943
+ }
2944
+
2945
+ /**
2946
+ * A project, as slots pass it. The fields addons can rely on; AYON passes the full project
2947
+ * model, so more may be there.
2948
+ */
2949
+ declare interface ProjectInfo {
2950
+ name: string
2951
+ code: string
2952
+ label?: string
2953
+ active?: boolean
2954
+ library?: boolean
2955
+ attrib?: Record<string, unknown>
2956
+ statuses?: { name: string; color?: string; icon?: string; state?: string; scope?: string[] }[]
2957
+ folderTypes?: { name: string; icon?: string; color?: string }[]
2958
+ taskTypes?: { name: string; icon?: string; color?: string; shortName?: string }[]
2959
+ tags?: { name: string; color?: string }[]
2960
+ }
2961
+
2962
+ /** Context of a project list menu item. */
2963
+ declare interface ProjectListMenuItemContext {
2964
+ /** the selected projects (project folders left out) */
2965
+ projectNames: string[]
2966
+ menu: MenuKind
2967
+ }
2968
+
2584
2969
  declare type ProjectModel = {
2585
2970
  /** Name is an unique id of the {entity_name} */
2586
2971
  name: string;
@@ -2609,6 +2994,19 @@ declare type ProjectModelWithProducts = ProjectModel & {
2609
2994
  productTypes: ProductTypeListItem[];
2610
2995
  };
2611
2996
 
2997
+ /** Slots that are about one project. */
2998
+ declare interface ProjectNameScope {
2999
+ projectName: string
3000
+ }
3001
+
3002
+ export declare const ProjectPageLayoutHost: ({ sidebar, children }: ProjectPageLayoutProps) => JSX_2.Element;
3003
+
3004
+ declare interface ProjectPageLayoutProps {
3005
+ /** the left panel, usually `<Slicer fields={[...]} />` */
3006
+ sidebar?: ReactNode
3007
+ children: ReactNode
3008
+ }
3009
+
2612
3010
  export declare const ProjectPageRemote: FC<ProjectPageRemoteProps>;
2613
3011
 
2614
3012
  export declare interface ProjectPageRemoteProps extends RemotePageWrapperProps {
@@ -2618,15 +3016,37 @@ export declare interface ProjectPageRemoteProps extends RemotePageWrapperProps {
2618
3016
  addonProps?: any;
2619
3017
  }
2620
3018
 
3019
+ /** Slots that are about one project, with the project itself. */
3020
+ declare interface ProjectScope extends ProjectNameScope {
3021
+ /** the project; `undefined` while it loads */
3022
+ project: ProjectInfo | undefined
3023
+ }
3024
+
3025
+ /** Context of a Customize section. */
3026
+ declare interface ProjectTableCustomizeSectionContext extends ProjectNameScope {
3027
+ page: ProjectTablePage
3028
+ }
3029
+
3030
+ /** Description of a `projectTable.customizeSection` contribution. */
3031
+ declare interface ProjectTableCustomizeSectionMeta {
3032
+ /** unique among the addon's sections */
3033
+ id: string
3034
+ /** the section's entry in Customize and its title when open */
3035
+ title: string
3036
+ /** a Material Symbols icon name */
3037
+ icon: string
3038
+ /** which tables' Customize panels show it; all (Overview, Products, Lists) when not set */
3039
+ pages?: ProjectTablePage[]
3040
+ }
3041
+
3042
+ /** The project pages with a project table (ProjectTreeTable). */
3043
+ declare type ProjectTablePage = 'overview' | 'products' | 'lists'
3044
+
2621
3045
  export declare const ProjectTableSettings: FC<ProjectTableSettingsProps>;
2622
3046
 
2623
3047
  export declare type ProjectTableSettingsProps = {
2624
3048
  settings?: SettingConfig[];
2625
- extraColumns?: {
2626
- value: string;
2627
- label: string;
2628
- icon?: string;
2629
- }[];
3049
+ extraColumns?: Pick<AddColumnItem, 'value' | 'label' | 'icon' | 'menu'>[];
2630
3050
  hiddenColumns?: string[];
2631
3051
  hiddenSettings?: ('columns' | 'row-height' | 'group-by' | 'sort-by')[];
2632
3052
  highlighted?: SettingHighlightedId;
@@ -2639,6 +3059,23 @@ export declare type ProjectTableSettingsProps = {
2639
3059
  columnIdAliases?: ColumnIdAliases;
2640
3060
  };
2641
3061
 
3062
+ /** Context of a project table toolbar item. */
3063
+ declare interface ProjectTableToolbarItemContext extends ProjectNameScope, ButtonScope {
3064
+ page: ProjectTablePage
3065
+ /** on Lists: the open list */
3066
+ list?: { id: string; label: string; entityType: string }
3067
+ }
3068
+
3069
+ /** Description of a `projectTable.toolbarItem` contribution. */
3070
+ declare interface ProjectTableToolbarItemMeta extends ButtonMeta {
3071
+ /** unique among the addon's toolbar items */
3072
+ id: string
3073
+ /** shown next to the icon; an icon-only button when not set */
3074
+ label?: string
3075
+ /** which tables' toolbars show it; all (Overview, Products, Lists) when not set */
3076
+ pages?: ProjectTablePage[]
3077
+ }
3078
+
2642
3079
  declare type Props = {
2643
3080
  projectName: string;
2644
3081
  entityId: string;
@@ -3001,6 +3438,9 @@ declare type RTEntityUpdate = {
3001
3438
  message?: any;
3002
3439
  };
3003
3440
 
3441
+ /** What a menu item's `run` piece exports as default: called on click with the slot context. */
3442
+ declare type RunPiece<S extends SlotName> = (context: SlotContext<S>) => void | Promise<void>
3443
+
3004
3444
  declare type SavedAnnotationMetadata = {
3005
3445
  id: string;
3006
3446
  composite: string;
@@ -3154,6 +3594,18 @@ export declare interface ShareOptionIconProps {
3154
3594
  withTooltip?: boolean;
3155
3595
  }
3156
3596
 
3597
+ declare type ShortcutKeyEvent = Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'repeat'> & {
3598
+ preventDefault: () => void;
3599
+ stopPropagation: () => void;
3600
+ };
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
+
3157
3609
  declare interface SidebarConfig {
3158
3610
  width?: string;
3159
3611
  minWidth?: string;
@@ -3237,12 +3689,206 @@ declare interface SliceFilter extends Filter {
3237
3689
  values: FilterValue[];
3238
3690
  }
3239
3691
 
3692
+ export declare const SlicerHost: ({ fields }: SlicerProps) => JSX_2.Element;
3693
+
3694
+ /** Context of a slicer menu item. */
3695
+ declare interface SlicerMenuItemContext extends ProjectNameScope {
3696
+ sliceType: string
3697
+ /** the rows it acts on: the selected ones, or the right-clicked one */
3698
+ selected: SlicerRowRef[]
3699
+ menu: MenuKind
3700
+ }
3701
+
3702
+ /** Description of a `slicer.menuItem` contribution. */
3703
+ declare interface SlicerMenuItemMeta extends ListMenuItemMeta {
3704
+ /** slice types it shows for (`hierarchy`, `assignees`, `status`, ...); all when not set */
3705
+ sliceTypes?: string[]
3706
+ }
3707
+
3708
+ declare interface SlicerProps {
3709
+ /** which slice types the slicer offers: `hierarchy`, `assignees`, `status`, `taskType`, ... */
3710
+ fields: string[]
3711
+ }
3712
+
3713
+ /** A row of the slicer: a folder in `hierarchy`, a value (user, status, type) in the others. */
3714
+ declare interface SlicerRowRef {
3715
+ id: string
3716
+ label?: string
3717
+ /** for `hierarchy` rows: `folder` (or `task`) */
3718
+ entityType?: string
3719
+ }
3720
+
3721
+ /** Slots on a project page, which always has the host's slicer state (selection, per page). */
3722
+ declare interface SlicerScope {
3723
+ /** empty until the user selects something in a `<Slicer>` the page places */
3724
+ slicer: SlicerSelection
3725
+ }
3726
+
3727
+ /** What is selected in the project page's slicer. */
3728
+ declare interface SlicerSelection {
3729
+ /** `hierarchy`, `assignees`, `status`, `taskType`, ... */
3730
+ sliceType: string
3731
+ /** ids of the selected rows: folder ids for `hierarchy`, the values for the others */
3732
+ selection: string[]
3733
+ }
3734
+
3240
3735
  declare type SlideOut = {
3241
3736
  entityId: string;
3242
3737
  entityType: DetailsPanelEntityType;
3243
3738
  projectName: string;
3244
3739
  };
3245
3740
 
3741
+ /** What the code of a contribution to slot `S` gets: `{ slot: S, ...context }`. */
3742
+ declare type SlotContext<S extends SlotName> = S extends SlotName
3743
+ ? { slot: S } & SlotMap[S]['context']
3744
+ : never
3745
+
3746
+ /**
3747
+ * Every slot this version of AYON has. Keys are slot names (`'project.page'`); each value has
3748
+ * the slot's `version`, its description fields (`meta`), the context its code gets (`context`)
3749
+ * and its pieces (`pieces`).
3750
+ */
3751
+ declare interface SlotMap {
3752
+ /**
3753
+ * A tab on the project page, at `/projects/<project>/<id>`. The tab shows from the
3754
+ * description; `component` loads when the page is first opened.
3755
+ */
3756
+ 'project.page': {
3757
+ version: 1
3758
+ meta: PageMeta
3759
+ context: ProjectScope & SlicerScope & ProjectFoldersScope & ViewsScope
3760
+ pieces: { component: Loader<ComponentType<SlotProps<'project.page'>>> }
3761
+ }
3762
+ /**
3763
+ * A tab on the dashboard (studio level), at `/dashboard/<id>`. The tab shows from the
3764
+ * description; `component` loads when the page is first opened.
3765
+ */
3766
+ 'studio.page': {
3767
+ version: 1
3768
+ meta: PageMeta
3769
+ context: StudioPageContext
3770
+ pieces: { component: Loader<ComponentType<SlotProps<'studio.page'>>> }
3771
+ }
3772
+ /**
3773
+ * A button in the main header, drawn by the host like its own buttons. What a click does is the
3774
+ * addon's: navigate (`to`), run code (`run`), open a dialog (`dialog`) or a menu (`menu`); or the
3775
+ * addon draws the item itself (`component`, loaded with the header). Set exactly one.
3776
+ */
3777
+ 'header.item': {
3778
+ version: 1
3779
+ meta: HeaderItemMeta
3780
+ context: HeaderItemContext
3781
+ pieces: ButtonPieces<'header.item'>
3782
+ }
3783
+ /**
3784
+ * A tab in the details panel. The tab button shows from the description, for `entityTypes`;
3785
+ * `component` loads when the tab is first opened.
3786
+ */
3787
+ 'detailsPanel.tab': {
3788
+ version: 1
3789
+ meta: DetailsPanelTabMeta
3790
+ context: DetailsPanelTabContext
3791
+ pieces: { component: Loader<ComponentType<SlotProps<'detailsPanel.tab'>>> }
3792
+ }
3793
+ /**
3794
+ * An item in the details panel's "more" menu. It shows from the description; `run` loads when
3795
+ * the menu opens and is called on click.
3796
+ */
3797
+ 'detailsPanel.menuItem': {
3798
+ version: 1
3799
+ meta: DetailsPanelMenuItemMeta
3800
+ context: DetailsPanelMenuItemContext
3801
+ pieces: { run: Loader<RunPiece<'detailsPanel.menuItem'>> }
3802
+ }
3803
+ /**
3804
+ * An item in the project list's menus (dashboard, project menu, studio pages' ProjectList): the
3805
+ * right-click menu, the "more" dropdown, or both (`in`). It acts on the selected projects.
3806
+ */
3807
+ 'projectList.menuItem': {
3808
+ version: 1
3809
+ meta: ListMenuItemMeta
3810
+ context: ProjectListMenuItemContext
3811
+ pieces: { run: Loader<RunPiece<'projectList.menuItem'>> }
3812
+ }
3813
+ /**
3814
+ * An item in the project page slicer's menus: the right-click menu, the panel's dropdown, or both
3815
+ * (`in`), for the slice types it lists.
3816
+ */
3817
+ 'slicer.menuItem': {
3818
+ version: 1
3819
+ meta: SlicerMenuItemMeta
3820
+ context: SlicerMenuItemContext
3821
+ pieces: { run: Loader<RunPiece<'slicer.menuItem'>> }
3822
+ }
3823
+ /**
3824
+ * An item in the right-click menu of the project tables' cells, for the selected entities. It
3825
+ * shows from the description; `run` loads when the menu opens and is called on click.
3826
+ */
3827
+ entityMenuItem: {
3828
+ version: 1
3829
+ meta: EntityMenuItemMeta
3830
+ context: EntityMenuItemContext
3831
+ pieces: { run: Loader<RunPiece<'entityMenuItem'>> }
3832
+ }
3833
+ /**
3834
+ * A button in the project tables' toolbar, before Customize (Overview, Products, Lists), drawn
3835
+ * by the host like the toolbar's own. What a click does is the addon's: navigate (`to`), run code
3836
+ * (`run`), open a dialog (`dialog`) or a menu (`menu`); or the addon draws the item itself
3837
+ * (`component`, loaded with the toolbar). Set exactly one.
3838
+ */
3839
+ 'projectTable.toolbarItem': {
3840
+ version: 1
3841
+ meta: ProjectTableToolbarItemMeta
3842
+ context: ProjectTableToolbarItemContext
3843
+ pieces: ButtonPieces<'projectTable.toolbarItem'>
3844
+ }
3845
+ /**
3846
+ * A section in the project tables' Customize panel (Overview, Products, Lists). The entry shows
3847
+ * from the description; `component` loads when the section is opened.
3848
+ */
3849
+ 'projectTable.customizeSection': {
3850
+ version: 1
3851
+ meta: ProjectTableCustomizeSectionMeta
3852
+ context: ProjectTableCustomizeSectionContext
3853
+ pieces: { component: Loader<ComponentType<SlotProps<'projectTable.customizeSection'>>> }
3854
+ }
3855
+ /**
3856
+ * A read-only column in the project tables (Overview, Products, Lists). It is in the column
3857
+ * settings from the description; `cell` and `fetchValues` load with the table. The host draws
3858
+ * the cell box (padding, selection, focus), so `cell` renders only its content; selecting, the
3859
+ * right-click menu and Copy (the cell's `value` as text) work as in other columns. Not sortable,
3860
+ * and pasting into it changes nothing.
3861
+ */
3862
+ tableColumn: {
3863
+ version: 1
3864
+ meta: TableColumnMeta
3865
+ context: TableCellContext
3866
+ pieces: {
3867
+ cell: Loader<ComponentType<SlotProps<'tableColumn'>>>
3868
+ fetchValues?: Loader<TableColumnFetch>
3869
+ }
3870
+ }
3871
+ /**
3872
+ * A keyboard shortcut on the cells of AYON's tables: the project tables (Overview, Products,
3873
+ * Lists) and the panels' tables (slicer, project list, lists, versions). Pressed in a cell, it
3874
+ * runs code (`run`) or opens a dialog (`dialog`) with the selected rows; set exactly one. AYON's
3875
+ * own keys (arrows, Enter, Escape, Tab, Space, `r`, Delete, copy, paste, undo) can't be taken,
3876
+ * and the key does nothing while a cell is being edited.
3877
+ */
3878
+ 'table.shortcut': {
3879
+ version: 1
3880
+ meta: TableShortcutMeta
3881
+ context: TableShortcutContext
3882
+ pieces: TableShortcutPieces
3883
+ }
3884
+ }
3885
+
3886
+ /** The name of a slot, e.g. `'project.page'`. */
3887
+ declare type SlotName = keyof SlotMap & string
3888
+
3889
+ /** Props of the component a contribution to slot `S` renders. Same as `SlotContext<S>`. */
3890
+ declare type SlotProps<S extends SlotName> = SlotContext<S>
3891
+
3246
3892
  declare interface SortMenuItemArgs<T extends string> {
3247
3893
  options: SortMenuOption<T>[];
3248
3894
  sort: SortMenuValue<T>;
@@ -3346,6 +3992,12 @@ declare type Status_3 = {
3346
3992
  scope?: string[];
3347
3993
  };
3348
3994
 
3995
+ /** Context of a studio page. */
3996
+ declare interface StudioPageContext extends ViewsScope {
3997
+ /** projects selected in the page's `<ProjectList>`; saved per page */
3998
+ selectedProjects: string[]
3999
+ }
4000
+
3349
4001
  declare namespace Styled {
3350
4002
  export {
3351
4003
  EnumListWrapper,
@@ -3436,6 +4088,55 @@ declare interface SyncButtonProps extends Omit<ButtonProps, 'onClick'> {
3436
4088
  hideWhenNoUpdates?: boolean;
3437
4089
  }
3438
4090
 
4091
+ /** Context of one cell of a `tableColumn`. */
4092
+ declare interface TableCellContext extends ProjectNameScope {
4093
+ page: ProjectTablePage
4094
+ entity: EntityRef
4095
+ /** what the column's `fetchValues` returned for this entity; `undefined` without `fetchValues` */
4096
+ value: unknown
4097
+ }
4098
+
4099
+ /**
4100
+ * Gets a column's values, by entity id; each cell gets its own as `value`. AYON calls it with
4101
+ * the rows that come on screen and that it has no value for yet, in batches once scrolling
4102
+ * pauses, and keeps what it returns: scrolling back costs nothing. A row whose entity changes
4103
+ * (here or by someone else) is asked for again; `refreshTableColumn(id)` asks again for all.
4104
+ * When it throws, those cells show the error and are tried again when they next come on
4105
+ * screen. Fetch through AYON's store (`dispatch(api.endpoints.x.initiate(...))`) to share its
4106
+ * cache.
4107
+ */
4108
+ declare type TableColumnFetch = (args: TableColumnFetchArgs) => Promise<Record<string, unknown>>
4109
+
4110
+ /** What a column's `fetchValues` gets. */
4111
+ declare interface TableColumnFetchArgs extends ProjectNameScope {
4112
+ page: ProjectTablePage
4113
+ /** the rows to get values for (entities, not list items): at most 100 */
4114
+ entities: EntityRef[]
4115
+ /** aborted when the table no longer needs them (another project or table) */
4116
+ signal: AbortSignal
4117
+ }
4118
+
4119
+ /** Description of a `tableColumn` contribution. */
4120
+ declare interface TableColumnMeta {
4121
+ /** part of the column id, so only letters, digits and `_` */
4122
+ id: string
4123
+ /** the column header and its name in the column settings */
4124
+ label: string
4125
+ icon?: string
4126
+ /** entity types with a cell; other rows show an empty read-only cell. All when not set */
4127
+ entityTypes?: string[]
4128
+ /** which tables offer it; all (Overview, Products, Lists) when not set */
4129
+ pages?: ProjectTablePage[]
4130
+ /** width in pixels. Addon columns start hidden: users show them in Customize */
4131
+ width?: number
4132
+ /**
4133
+ * where the column sits in the "Add column" menu: a submenu named after the addon when not
4134
+ * set, a submenu with this name (columns giving the same name share it, across addons too), or
4135
+ * `false` for the menu's top level
4136
+ */
4137
+ menu?: string | false
4138
+ }
4139
+
3439
4140
  export declare const TableGridSwitch: ForwardRefExoticComponent<TableGridSwitchProps & RefAttributes<HTMLDivElement>>;
3440
4141
 
3441
4142
  declare interface TableGridSwitchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
@@ -3448,6 +4149,21 @@ declare interface TableGroupBy {
3448
4149
  id: string;
3449
4150
  }
3450
4151
 
4152
+ /** A table row a shortcut acts on. */
4153
+ declare interface TableRowRef {
4154
+ /** project tables: the entity's id (list items resolve to their entity); else the row's id */
4155
+ id: string
4156
+ /** project tables: `folder`, `task`, `product`, `version`, ... */
4157
+ entityType?: string
4158
+ name?: string
4159
+ label?: string
4160
+ /**
4161
+ * the row as the table has it: an entity's fields and `attrib` in the project tables, the
4162
+ * project, list, version or slicer value in the panels
4163
+ */
4164
+ data: Record<string, unknown>
4165
+ }
4166
+
3451
4167
  export declare const TableSearch: FC<TableSearchProps>;
3452
4168
 
3453
4169
  export declare interface TableSearchProps {
@@ -3466,6 +4182,51 @@ export declare interface TableSettingsFallbackProps {
3466
4182
  children?: React.ReactNode;
3467
4183
  }
3468
4184
 
4185
+ /** Context of a table shortcut. */
4186
+ declare interface TableShortcutContext {
4187
+ /** the table the key was pressed in */
4188
+ table: ShortcutTable
4189
+ /** the open project; `null` in the project list */
4190
+ projectName: string | null
4191
+ /** the rows it acts on: the selected ones when the key was pressed in one of them, else its row */
4192
+ rows: TableRowRef[]
4193
+ /** where the key was pressed: the row's id, and the column's in the project tables */
4194
+ focused: { rowId: string; columnId?: string }
4195
+ /** project tables: the selected cells, by row (entity) and column id; empty elsewhere */
4196
+ cells: { rowId: string; columnId: string }[]
4197
+ }
4198
+
4199
+ /** Description of a `table.shortcut` contribution. */
4200
+ declare interface TableShortcutMeta {
4201
+ /** unique among the addon's shortcuts */
4202
+ id: string
4203
+ /** what it does, e.g. `Copy row as JSON`; the dialog's title when `dialogTitle` is not set */
4204
+ label: string
4205
+ /**
4206
+ * the key and its modifiers joined by `+`, lower case: `g`, `shift+mod+c`, `alt+1`, `f2`. `mod` is
4207
+ * ⌘ on macOS and Ctrl elsewhere; `ctrl`, `meta`, `alt` and `shift` are the keys themselves.
4208
+ * Letters and digits match the key's place on the keyboard, so `alt+g` works on macOS too
4209
+ */
4210
+ keys: string
4211
+ /**
4212
+ * which tables it works in; all when not set. `overview`, `products`, `lists` (the project
4213
+ * tables), `slicer`, `projects`, `listsPanel`, `versionsPanel`
4214
+ */
4215
+ tables?: ShortcutTable[]
4216
+ /** the `dialog`'s title; the label when not set */
4217
+ dialogTitle?: string
4218
+ /** the `dialog`'s size, `md` by default */
4219
+ dialogSize?: 'sm' | 'md' | 'lg' | 'full'
4220
+ }
4221
+
4222
+ /** The pieces of a table shortcut: what the key does. Set exactly one. */
4223
+ declare interface TableShortcutPieces {
4224
+ /** called with the context when the key is pressed */
4225
+ run?: Loader<RunPiece<'table.shortcut'>>
4226
+ /** the content of a dialog the host opens: AYON's dialog with title and close button */
4227
+ dialog?: Loader<ComponentType<SlotProps<'table.shortcut'> & DialogScope>>
4228
+ }
4229
+
3469
4230
  declare interface TabStateByScope {
3470
4231
  [scope: string]: DetailsPanelTab;
3471
4232
  }
@@ -3632,6 +4393,12 @@ export declare interface ThumbnailSimpleProps extends default_2.HTMLAttributes<H
3632
4393
  */
3633
4394
  export declare const toggleBlockFormat: (editor: LexicalEditor, format: BlockFormat, mode?: "toggle" | "set") => void;
3634
4395
 
4396
+ /**
4397
+ * An addon's menu entries as the shared Menu's items: `to` and `href` become links (the Menu
4398
+ * follows them), and a failing `onClick` is reported as a toast naming the addon.
4399
+ */
4400
+ export declare const toMenuItems: (items: AddonMenuItem[], contribution: AnyContribution) => MenuItemType[];
4401
+
3635
4402
  export declare type ToolbarItem = 'h1' | 'h2' | 'h3' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'link' | 'codeBlock' | 'quote' | 'numberList' | 'bulletList' | 'checkList';
3636
4403
 
3637
4404
  export declare type ToolbarLayout = (ToolbarItem | '|')[];
@@ -3695,6 +4462,21 @@ export declare const UploadVersionDialog: FC<UploadVersionDialogProps>;
3695
4462
  declare interface UploadVersionDialogProps {
3696
4463
  }
3697
4464
 
4465
+ /**
4466
+ * The sections addons contribute to this page's Customize panel (projectTable.customizeSection
4467
+ * slot, @ynput/ayon-addon), for ProjectTableSettings' `settings`. The entries show from the
4468
+ * descriptions; a section's code loads when it is opened (the panel only renders the open one).
4469
+ */
4470
+ export declare const useAddonCustomizeSections: (page: ProjectTablePage) => SettingConfig[];
4471
+
4472
+ /** `table`: which table this is; no shortcuts when not set. */
4473
+ export declare const useAddonTableShortcuts: (table: ShortcutTable | undefined) => {
4474
+ hasShortcuts: boolean;
4475
+ handleShortcut: (event: ShortcutKeyEvent, getContext: () => Omit<TableShortcutContext, "table"> | undefined) => boolean;
4476
+ runShortcut: (contribution: Contribution<"table.shortcut">, context: TableShortcutContext) => void;
4477
+ dialog: OpenAddonShortcutDialog | null;
4478
+ };
4479
+
3698
4480
  export declare const useBuildFilterOptions: ({ filterTypes: globalFilterTypes, projectNames, scope, scopes: customScopes, data, config, power, }: BuildFilterOptions) => {
3699
4481
  options: Option_2[];
3700
4482
  groupOptions: SearchFilterGroupOption[];
@@ -3737,6 +4519,9 @@ export declare const useFeedbackSafe: () => FeedbackContextType | undefined;
3737
4519
 
3738
4520
  export declare const useOptionalVersionUploadContext: () => VersionUploadContextType | null;
3739
4521
 
4522
+ /** The context of a project.page contribution. */
4523
+ export declare const useProjectPageSlotContext: (projectName: string) => SlotMap["project.page"]["context"];
4524
+
3740
4525
  export declare const USER_KEY_PREFIX = "user:";
3741
4526
 
3742
4527
  declare type UserAttribModel = {
@@ -3794,6 +4579,9 @@ declare type UserSuggestionItem = {
3794
4579
  fullName?: string;
3795
4580
  };
3796
4581
 
4582
+ /** The context of a studio.page contribution. */
4583
+ export declare const useStudioPageSlotContext: (selectedProjects: string[]) => SlotMap["studio.page"]["context"];
4584
+
3797
4585
  export declare const useUpdateLinks: ({ projectName, direction, entityId, entityType, targetEntityType, linkType, }: Props) => {
3798
4586
  remove: RemoveLinks;
3799
4587
  add: AddLinks;
@@ -4299,6 +5087,12 @@ declare const viewsQueries: Api<BaseQueryFn<string | {
4299
5087
  } | FetchArgs, unknown, FetchBaseQueryError, {} | Partial<Pick< ClientError, "response" | "request">>>, string, ViewListModel, "restApi", unknown>, ViewListItemModel[]>;
4300
5088
  }>, string, never>, "restApi", string, typeof coreModuleName | typeof reactHooksModuleName>;
4301
5089
 
5090
+ /** Pages, which have views when their description sets `viewType`. */
5091
+ declare interface ViewsScope {
5092
+ /** `undefined` when the page's description has no `viewType` */
5093
+ views: PageViews | undefined
5094
+ }
5095
+
4302
5096
  declare interface ViewsWithReportsSettings extends ViewsContextValue {
4303
5097
  viewSettings: GenericViewModel['settings'] | undefined;
4304
5098
  settings: GenericViewModel['settings'] | undefined;
@@ -4365,6 +5159,9 @@ export { }
4365
5159
 
4366
5160
 
4367
5161
  declare module '@tanstack/react-table' {
5162
+ interface ColumnMeta<TData extends RowData, TValue> {
5163
+ addonColumn?: AddonColumnMeta;
5164
+ }
4368
5165
  interface TableMeta<TData extends RowData> {
4369
5166
  options?: BuiltInFieldOptions;
4370
5167
  readOnly?: ProjectTreeTableProps['readOnly'];