@ynput/ayon-frontend-shared 0.6.9 → 0.7.1

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/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +767 -740
  3. package/dist/ListTable.es.js +430 -430
  4. package/dist/NewEntity.es.js +43 -42
  5. package/dist/ProjectTreeTable.es.js +3496 -3342
  6. package/dist/Slicer.es.js +301 -276
  7. package/dist/Views.es.js +537 -521
  8. package/dist/api.es.js +429 -412
  9. package/dist/chunks/Actions.es.js +19 -18
  10. package/dist/chunks/ColumnDropIndicator.es.js +19 -18
  11. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  12. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  14. package/dist/chunks/DetailsDialog.es.js +26 -24
  15. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  16. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  17. package/dist/chunks/EntityPath.es.js +72 -71
  18. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  19. package/dist/chunks/EntityTooltip.es.js +11 -10
  20. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  21. package/dist/chunks/Feed.es.js +864 -859
  22. package/dist/chunks/FilterErrorActions.es.js +4 -3
  23. package/dist/chunks/Menu.es.js +633 -289
  24. package/dist/chunks/MenuContext.es.js +1 -1
  25. package/dist/chunks/MetaWidget.es.js +2751 -2217
  26. package/dist/chunks/PlayableIcon.es.js +79 -78
  27. package/dist/chunks/ProjectContext.es.js +7 -7
  28. package/dist/chunks/RepresentationsList.es.js +1 -1
  29. package/dist/chunks/ReviewablesSelector.es.js +625 -609
  30. package/dist/chunks/SimpleForm.es.js +1 -1
  31. package/dist/chunks/SimpleTable.es.js +386 -363
  32. package/dist/chunks/Slicer.es.js +954 -821
  33. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  34. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  35. package/dist/chunks/ThumbnailSimple.es.js +96 -95
  36. package/dist/chunks/VideoPlayer.es.js +1 -1
  37. package/dist/chunks/Watchers.es.js +850 -797
  38. package/dist/chunks/getBundleMode.es.js +1 -1
  39. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  40. package/dist/chunks/getUris.es.js +3704 -3504
  41. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  42. package/dist/chunks/searchTerms.es.js +649 -563
  43. package/dist/chunks/sortLists.es.js +22 -0
  44. package/dist/chunks/useAttributeEnums.es.js +21 -21
  45. package/dist/chunks/useHierarchySelection.es.js +6 -5
  46. package/dist/chunks/useLoadModule.es.js +24 -23
  47. package/dist/chunks/viewUpdateHelper.es.js +19 -18
  48. package/dist/components.es.js +628 -593
  49. package/dist/context.es.js +525 -499
  50. package/dist/hooks.es.js +54 -53
  51. package/dist/index.es.js +4 -4
  52. package/dist/types/ContextMenu.d.ts +4 -1
  53. package/dist/types/Feed.d.ts +1 -1
  54. package/dist/types/ListTable.d.ts +1 -1
  55. package/dist/types/ProjectTreeTable.d.ts +144 -14
  56. package/dist/types/SimpleTable.d.ts +2 -1
  57. package/dist/types/Slicer.d.ts +32 -5
  58. package/dist/types/Views.d.ts +6 -0
  59. package/dist/types/api.d.ts +2252 -510
  60. package/dist/types/components.d.ts +52 -4
  61. package/dist/types/context.d.ts +96 -2
  62. package/dist/types/hooks.d.ts +36 -1
  63. package/dist/types/util.d.ts +54 -0
  64. package/dist/util.es.js +129 -119
  65. package/package.json +4 -4
  66. package/dist/chunks/MenuItem.es.js +0 -420
@@ -44,6 +44,7 @@ import { LabelHTMLAttributes } from 'react';
44
44
  import { LexicalCommand } from 'lexical';
45
45
  import { LexicalEditor } from 'lexical';
46
46
  import { LexicalNode } from 'lexical';
47
+ import { MixedChange } from '@ynput/ayon-react-components';
47
48
  import { MouseEvent as MouseEvent_2 } from 'react';
48
49
  import { MutationActionCreatorResult } from '@reduxjs/toolkit/query';
49
50
  import { MutationDefinition } from '@reduxjs/toolkit/query';
@@ -352,6 +353,8 @@ export declare type BuildFilterOptions = {
352
353
 
353
354
  export declare const buildScopes: (scopes: ScopeType_2[], exclude?: Partial<Record<ScopeType_2, FilterFieldType[]>>) => ScopeWithFilterTypes[];
354
355
 
356
+ export declare const buildSortMenuItem: <T extends string>({ options, sort, onChange, id, label, icon, }: SortMenuItemArgs<T>) => MenuItemType;
357
+
355
358
  declare type BundleMode = 'production' | 'staging' | 'developer';
356
359
 
357
360
  declare const Button: IStyledComponentBase<"web", FastOmit<Omit< ButtonProps & RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -367,6 +370,7 @@ export declare const Chips: FC<ChipsProps>;
367
370
  declare interface ChipsProps {
368
371
  values: ChipValue[];
369
372
  disabled?: boolean;
373
+ className?: string;
370
374
  pt?: {
371
375
  chip?: Partial<HTMLAttributes<HTMLDivElement>>;
372
376
  };
@@ -378,6 +382,7 @@ export declare type ChipValue = {
378
382
  icon?: string;
379
383
  prefix?: default_2.ReactNode;
380
384
  suffix?: default_2.ReactNode;
385
+ onClick?: default_2.MouseEventHandler<HTMLDivElement>;
381
386
  };
382
387
 
383
388
  declare type ColorInputPt = Partial<React.InputHTMLAttributes<HTMLInputElement>>;
@@ -750,7 +755,7 @@ declare interface DescriptionSectionProps {
750
755
  }, target: HTMLElement) => void;
751
756
  }
752
757
 
753
- export declare const DetailsDialog: ({ projectName, entityType, entityIds, visible, onHide, }: DetailsDialogProps) => JSX_2.Element | null;
758
+ export declare const DetailsDialog: ({ projectName, entityType, entityIds, visible, onHide, data: dataProp, header, }: DetailsDialogProps) => JSX_2.Element | null;
754
759
 
755
760
  export declare interface DetailsDialogProps {
756
761
  projectName?: string;
@@ -758,6 +763,8 @@ export declare interface DetailsDialogProps {
758
763
  entityIds: string[];
759
764
  visible: boolean;
760
765
  onHide: () => void;
766
+ data?: unknown;
767
+ header?: string;
761
768
  }
762
769
 
763
770
  declare type DetailsField = Pick<AttributeField, 'name' | 'data' | 'hidden'>;
@@ -772,6 +779,7 @@ export declare interface DetailsPanelAttributesEditorProps {
772
779
  form: Record<string, string | number | boolean | Date | any[] | Record<string, any> | undefined | null>;
773
780
  mixedFields?: string[];
774
781
  onChange?: (key: string, value: any) => void;
782
+ onMixedChange?: (key: string, change: MixedChange) => void;
775
783
  entities?: any[];
776
784
  projectName?: string;
777
785
  entityType?: string;
@@ -1247,6 +1255,26 @@ declare const EnumItemBody: IStyledComponentBase<"web", FastOmit<DetailedHTMLPro
1247
1255
 
1248
1256
  declare const EnumItemBodyExpander: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
1249
1257
 
1258
+ export declare const EnumItemDialog: FC<EnumItemDialogProps>;
1259
+
1260
+ export declare interface EnumItemDialogProps {
1261
+ item?: EnumItemDraft;
1262
+ isNew?: boolean;
1263
+ fields: EnumItemField[];
1264
+ itemLabel?: string;
1265
+ onSave: (item: EnumItemDraft) => void;
1266
+ onCancel: () => void;
1267
+ }
1268
+
1269
+ export declare interface EnumItemDraft {
1270
+ value: string;
1271
+ label?: string;
1272
+ icon?: string;
1273
+ color?: string;
1274
+ }
1275
+
1276
+ export declare type EnumItemField = 'label' | 'icon' | 'color';
1277
+
1250
1278
  declare const EnumItemHeader: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
1251
1279
 
1252
1280
  declare const EnumItemWrapper: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -1397,7 +1425,7 @@ export declare interface FilterErrorActionsProps {
1397
1425
  errorMessage?: string;
1398
1426
  }
1399
1427
 
1400
- export declare type FilterFieldType = 'folderType' | 'taskType' | 'productType' | 'productBaseType' | ('users' | 'assignees' | 'author') | 'attributes' | 'status' | 'tags' | 'version' | 'hasReviewables' | 'productName' | 'name' | 'createdAt' | 'updatedAt';
1428
+ export declare type FilterFieldType = 'folderType' | 'taskType' | 'productType' | 'productBaseType' | ('users' | 'assignees' | 'author') | 'attributes' | 'status' | 'tags' | 'version' | 'hasReviewables' | 'productName' | 'name' | 'extension' | 'createdAt' | 'updatedAt';
1401
1429
 
1402
1430
  export declare const FLOATING_TOOLBAR: ToolbarLayout;
1403
1431
 
@@ -2441,7 +2469,7 @@ declare type PowerpackDialogType = {
2441
2469
  icon?: string;
2442
2470
  };
2443
2471
 
2444
- declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'entityLinks';
2472
+ declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'listValues' | 'entityLinks' | 'tableExport';
2445
2473
 
2446
2474
  declare interface Processing extends ReviewableProcessingStatus {
2447
2475
  progress?: number;
@@ -3015,7 +3043,7 @@ declare type Scalars = {
3015
3043
 
3016
3044
  declare type Scope = ScopeType | ScopeType[];
3017
3045
 
3018
- declare type ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version';
3046
+ declare type ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version' | 'representation';
3019
3047
 
3020
3048
  declare type ScopeType_2 = ScopeWithFilterTypes['scope'];
3021
3049
 
@@ -3215,6 +3243,26 @@ declare type SlideOut = {
3215
3243
  projectName: string;
3216
3244
  };
3217
3245
 
3246
+ declare interface SortMenuItemArgs<T extends string> {
3247
+ options: SortMenuOption<T>[];
3248
+ sort: SortMenuValue<T>;
3249
+ onChange: (sort: SortMenuValue<T>) => void;
3250
+ id?: string;
3251
+ label?: string;
3252
+ icon?: string;
3253
+ }
3254
+
3255
+ export declare interface SortMenuOption<T extends string = string> {
3256
+ id: T;
3257
+ label: string;
3258
+ desc: boolean;
3259
+ }
3260
+
3261
+ export declare interface SortMenuValue<T extends string = string> {
3262
+ by: T;
3263
+ desc: boolean;
3264
+ }
3265
+
3218
3266
  /**
3219
3267
  * Splits combined Filter objects by their scope and removes the scope prefix from filter IDs.
3220
3268
  * Used to separate multi-scope Filter arrays back into individual scope Filter arrays.
@@ -983,7 +983,7 @@ export declare type PowerpackDialogType = {
983
983
  icon?: string;
984
984
  };
985
985
 
986
- export declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'entityLinks';
986
+ export declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'listValues' | 'entityLinks' | 'tableExport';
987
987
 
988
988
  export declare const powerpackFeatureOrder: PowerpackFeature[];
989
989
 
@@ -1646,7 +1646,7 @@ declare interface SubtasksManagerProps extends Omit<React.HTMLAttributes<HTMLDiv
1646
1646
  export declare const SubtasksModulesContext: Context<SubtasksModulesContextType | undefined>;
1647
1647
 
1648
1648
  export declare interface SubtasksModulesContextType {
1649
- SubtasksManager: typeof SubtasksManagerFallback;
1649
+ SubtasksManager?: typeof SubtasksManagerFallback;
1650
1650
  requiredVersion: string | undefined;
1651
1651
  isLoading: boolean;
1652
1652
  }
@@ -1655,6 +1655,98 @@ export declare const SubtasksModulesProvider: FC<{
1655
1655
  children: ReactNode;
1656
1656
  }>;
1657
1657
 
1658
+ export declare const TABLE_EXPORT_SEARCH_PARAM = "tableExport";
1659
+
1660
+ export declare type TableExportContent = TableExportRows & {
1661
+ columns: string[];
1662
+ columnLabels: Record<string, string>;
1663
+ };
1664
+
1665
+ export declare const TableExportContext: Context<TableExportContextType | null>;
1666
+
1667
+ export declare type TableExportContextType = {
1668
+ source: TableExportSource | null;
1669
+ isAvailable: boolean;
1670
+ openExport: (scope: TableExportScope) => void;
1671
+ registerSource: (source: TableExportSource) => () => void;
1672
+ };
1673
+
1674
+ export declare type TableExportListQuery = {
1675
+ id: string;
1676
+ itemIds?: string[];
1677
+ filter?: string;
1678
+ search?: string;
1679
+ sortBy?: string[];
1680
+ };
1681
+
1682
+ export declare type TableExportOptions = {
1683
+ includeImportColumns: boolean;
1684
+ selectionColumns: 'selected' | 'visible';
1685
+ format?: 'xlsx' | 'csv';
1686
+ content?: 'readable' | 'raw';
1687
+ };
1688
+
1689
+ export declare type TableExportProductsQuery = {
1690
+ ids?: string[];
1691
+ folderIds?: string[];
1692
+ includeFolderChildren?: boolean;
1693
+ filter?: string;
1694
+ folderFilter?: string;
1695
+ versionFilter?: string;
1696
+ taskFilter?: string;
1697
+ representationFilter?: string;
1698
+ sortBy?: string[];
1699
+ featuredVersionOrder?: string[];
1700
+ };
1701
+
1702
+ export declare const TableExportProvider: ({ children }: {
1703
+ children: ReactNode;
1704
+ }) => JSX_2.Element;
1705
+
1706
+ export declare type TableExportRows = {
1707
+ folderIds?: string[];
1708
+ tasks?: TableExportTasksQuery;
1709
+ products?: TableExportProductsQuery;
1710
+ versions?: TableExportVersionsQuery;
1711
+ entityList?: TableExportListQuery;
1712
+ };
1713
+
1714
+ export declare type TableExportScope = 'table' | 'selection';
1715
+
1716
+ export declare type TableExportSource = {
1717
+ projectName: string;
1718
+ canImport: boolean;
1719
+ selectedRowsCount: number;
1720
+ getContent: (scope: TableExportScope, options: TableExportOptions) => TableExportContent;
1721
+ getSkippedColumns: (scope: TableExportScope, options: TableExportOptions) => string[];
1722
+ };
1723
+
1724
+ export declare type TableExportTasksQuery = {
1725
+ ids?: string[];
1726
+ folderIds?: string[];
1727
+ includeFolderChildren?: boolean;
1728
+ filter?: string;
1729
+ folderFilter?: string;
1730
+ search?: string;
1731
+ sortBy?: string[];
1732
+ };
1733
+
1734
+ export declare type TableExportVersionsQuery = {
1735
+ ids?: string[];
1736
+ productIds?: string[];
1737
+ folderIds?: string[];
1738
+ includeFolderChildren?: boolean;
1739
+ filter?: string;
1740
+ folderFilter?: string;
1741
+ productFilter?: string;
1742
+ taskFilter?: string;
1743
+ representationFilter?: string;
1744
+ featuredOnly?: string[];
1745
+ latestPerFolder?: boolean;
1746
+ hasReviewables?: boolean;
1747
+ sortBy?: string[];
1748
+ };
1749
+
1658
1750
  export declare const TABS_BY_SCOPE_KEY = "details/tabs-by-scope";
1659
1751
 
1660
1752
  export declare interface TabStateByScope {
@@ -1988,6 +2080,8 @@ declare type UseSyncUpdatesParams = {
1988
2080
  shouldSyncOnUpdate?: (update: RTEntityUpdate) => boolean;
1989
2081
  };
1990
2082
 
2083
+ export declare const useTableExportContext: () => TableExportContextType | null;
2084
+
1991
2085
  export declare const useThumbnailUploadContext: () => {
1992
2086
  resetFileUploadState?: Function;
1993
2087
  triggerThumbnailUpload?: () => void;
@@ -204,6 +204,24 @@ declare type EnumItem = {
204
204
  hidden?: boolean;
205
205
  };
206
206
 
207
+ declare interface EnumItemDialogProps {
208
+ item?: EnumItemDraft;
209
+ isNew?: boolean;
210
+ fields: EnumItemField[];
211
+ itemLabel?: string;
212
+ onSave: (item: EnumItemDraft) => void;
213
+ onCancel: () => void;
214
+ }
215
+
216
+ declare interface EnumItemDraft {
217
+ value: string;
218
+ label?: string;
219
+ icon?: string;
220
+ color?: string;
221
+ }
222
+
223
+ declare type EnumItemField = 'label' | 'icon' | 'color';
224
+
207
225
  export declare type FetchAttributeEnumOptions = (data: AttributeData, projectName?: string) => Promise<EnumItem[]>;
208
226
 
209
227
  declare type FilesystemSourceInfo = {
@@ -505,11 +523,28 @@ export declare interface UseAttributeEnumsParams {
505
523
  request?: AttributeEnumsRequest;
506
524
  }
507
525
 
526
+ /**
527
+ * Edits the project anatomy's tags from a tags dropdown: new tags saved on entities are added to
528
+ * it, and a dialog (render `dialog` with EnumItemDialog) creates a tag with a colour or changes a
529
+ * tag's colour. Undefined when the user can't change the project (managers and admins can), or
530
+ * without a project.
531
+ */
532
+ export declare const useEditProjectTags: (projectName: string | undefined, anatomyTags?: {
533
+ name: string;
534
+ }[]) => {
535
+ onEditOption: (tag: {
536
+ name?: string;
537
+ color?: string;
538
+ }, isNew: boolean) => Promise<string | undefined>;
539
+ dialog: EnumItemDialogProps;
540
+ addTags: (names: string[]) => void;
541
+ } | undefined;
542
+
508
543
  /**
509
544
  * Hook for updating entities with proper error handling and version-specific logic
510
545
  */
511
546
  export declare const useEntityUpdate: ({ entities, entityType }: UseEntityUpdateParams) => {
512
- updateEntity: (field: string, value: any) => Promise<void>;
547
+ updateEntity: (field: string, value: any | ((entityId: string) => any)) => Promise<void>;
513
548
  };
514
549
 
515
550
  export declare interface UseEntityUpdateParams {
@@ -352,6 +352,8 @@ declare type CustomTemplate = {
352
352
 
353
353
  declare type DataType = 'string' | 'list_of_strings' | string;
354
354
 
355
+ export declare const DEFAULT_LISTS_SORT: ListsSort;
356
+
355
357
  declare type DefaultProductBaseType = {
356
358
  color?: string;
357
359
  icon?: string;
@@ -431,10 +433,15 @@ declare type EnumItem_2 = {
431
433
  /** Icon name (material symbol) or IconModel object */
432
434
  icon?: string | IconModel_2;
433
435
  color?: string;
436
+ shortName?: string;
434
437
  /** Enum item is visible, but not selectable */
435
438
  disabled?: boolean;
436
439
  /** Message to show when the option is disabled */
437
440
  disabledMessage?: string;
441
+ /** Enum item is not visible in the dropdown */
442
+ hidden?: boolean;
443
+ /** Extra badge labels to display next to the item */
444
+ badges?: string[];
438
445
  };
439
446
 
440
447
  declare type EnumItem_3 = {
@@ -492,6 +499,8 @@ export declare const extractEntityHierarchyFromParents: (parents: string[], enti
492
499
  */
493
500
  export declare function extractVersionFromFilename(filename: string): number | null;
494
501
 
502
+ export declare const filterBySearchQuery: <T>(items: T[], query: string, toHaystack: (item: T) => string) => T[];
503
+
495
504
  /**
496
505
  * Result of building a folder hierarchy
497
506
  */
@@ -577,6 +586,12 @@ export declare const getEnumItemIcon: (icon: EnumItem_4["icon"]) => string | und
577
586
  */
578
587
  export declare const getErrorMessage: (error: unknown, prefix: string) => string;
579
588
 
589
+ /**
590
+ * The `sortBy` of `buildSortArgs` for a query read forwards (`first`/`after`), where every
591
+ * key carries its own direction.
592
+ */
593
+ export declare const getForwardSortBy: ({ sortBy, desc }: SortArgs) => string[] | undefined;
594
+
580
595
  /**
581
596
  * Determines the data type for a groupBy field.
582
597
  * Handles special cases for built-in group types (assignees, tags) and attribute-based grouping.
@@ -593,6 +608,11 @@ export declare const getErrorMessage: (error: unknown, prefix: string) => string
593
608
  */
594
609
  export declare const getGroupByDataType: (groupBy: TableGroupBy | undefined, attribFields: (ProjectTableAttribute | AttributeModel)[]) => DataType;
595
610
 
611
+ export declare const getListIcon: (list: {
612
+ entityListType: string;
613
+ entityType: string;
614
+ }) => string;
615
+
596
616
  export declare const getMixedState: (values: any[]) => {
597
617
  value: any;
598
618
  isMixed: boolean;
@@ -769,6 +789,8 @@ export declare enum KeyMode {
769
789
  Shift = "shift"
770
790
  }
771
791
 
792
+ export declare const labelCollator: Intl.Collator;
793
+
772
794
  declare type LinkType = {
773
795
  link_type: string;
774
796
  input_type: 'folder' | 'product' | 'version' | 'representation' | 'task' | 'workfile';
@@ -777,6 +799,19 @@ declare type LinkType = {
777
799
  style?: 'solid' | 'dashed';
778
800
  };
779
801
 
802
+ export declare const LISTS_SORT_OPTIONS: {
803
+ id: ListsSortBy;
804
+ label: string;
805
+ desc: boolean;
806
+ }[];
807
+
808
+ export declare interface ListsSort {
809
+ by: ListsSortBy;
810
+ desc: boolean;
811
+ }
812
+
813
+ export declare type ListsSortBy = 'createdAt' | 'updatedAt' | 'label';
814
+
780
815
  declare type MainCalc = 'count' | 'breakdown';
781
816
 
782
817
  export declare const matchSearchQuery: (haystack: string, groups: string[][]) => RankingInfo;
@@ -953,6 +988,8 @@ export declare type RealtimeBatchProcessor<T> = (items: T[], isActive: () => boo
953
988
 
954
989
  export declare const replaceRoot: (input?: string | null, roots?: Record<string, string | undefined>) => string | undefined;
955
990
 
991
+ export declare const resolveListsSort: (sort: unknown) => ListsSort;
992
+
956
993
  /**
957
994
  * Convert RGB components to hex color string
958
995
  */
@@ -982,6 +1019,14 @@ export declare const sanitizeProductName: (name: string) => string;
982
1019
 
983
1020
  declare type ScopeEntityType = 'folder' | 'product' | 'version' | 'representation' | 'task' | 'workfile' | 'project' | 'user';
984
1021
 
1022
+ export declare const searchQueryToFilter: <C>(query: string, toCondition: (term: string) => C) => {
1023
+ operator: "or";
1024
+ conditions: {
1025
+ operator: "and";
1026
+ conditions: C[];
1027
+ }[];
1028
+ } | null;
1029
+
985
1030
  /**
986
1031
  * Writes the sorting of a view, see `parseViewSorting` for the format.
987
1032
  * No sorting is `undefined` so the view falls back to its default order.
@@ -1026,6 +1071,13 @@ declare type SimpleTableRow = {
1026
1071
  badge?: string | React.ReactNode;
1027
1072
  };
1028
1073
 
1074
+ declare interface SortableList {
1075
+ label: string;
1076
+ active: boolean;
1077
+ createdAt?: unknown;
1078
+ updatedAt?: unknown;
1079
+ }
1080
+
1029
1081
  export declare type SortArgs = {
1030
1082
  sortBy: string | string[] | undefined;
1031
1083
  desc: boolean;
@@ -1038,6 +1090,8 @@ export declare type SortKey = {
1038
1090
 
1039
1091
  export declare const sortKeysDeep: (value: unknown) => unknown;
1040
1092
 
1093
+ export declare const sortLists: <T extends SortableList>(lists: T[], { by, desc }?: ListsSort) => T[];
1094
+
1041
1095
  declare type StagingDirectory = {
1042
1096
  name: string;
1043
1097
  directory?: string;