@ynput/ayon-frontend-shared 0.4.7 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/DetailsPanel.es.js +684 -649
  2. package/dist/Feed.es.js +22 -22
  3. package/dist/ListTable.es.js +78 -67
  4. package/dist/ProjectTreeTable.es.js +2185 -2132
  5. package/dist/Slicer.es.js +152 -120
  6. package/dist/Views.es.js +1 -1
  7. package/dist/api.es.js +332 -329
  8. package/dist/chunks/Actions.es.js +7 -7
  9. package/dist/chunks/ColumnDropIndicator.es.js +127 -241
  10. package/dist/chunks/DeleteEntitiesContext.es.js +109 -109
  11. package/dist/chunks/DetailsDialog.es.js +3 -3
  12. package/dist/chunks/DetailsPanelContext.es.js +155 -0
  13. package/dist/chunks/EntityPath.es.js +40 -40
  14. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  15. package/dist/chunks/EntityTooltip.es.js +3 -3
  16. package/dist/chunks/EntityUpdatesContext.es.js +1 -1
  17. package/dist/chunks/Feed.es.js +2208 -2611
  18. package/dist/chunks/FilterErrorActions.es.js +5 -5
  19. package/dist/chunks/GlobalContext.es.js +21 -21
  20. package/dist/chunks/InfoMessage.es.js +146 -0
  21. package/dist/chunks/Menu.es.js +6 -6
  22. package/dist/chunks/MenuContext.es.js +51 -240
  23. package/dist/chunks/MenuItem.es.js +1 -1
  24. package/dist/chunks/MetaWidget.es.js +3211 -3761
  25. package/dist/chunks/NewEntityContext.es.js +539 -544
  26. package/dist/chunks/PlayableIcon.es.js +4261 -1163
  27. package/dist/chunks/ProjectContext.es.js +2 -2
  28. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  29. package/dist/chunks/RepresentationsList.es.js +3 -3
  30. package/dist/chunks/ReviewablesSelector.es.js +396 -384
  31. package/dist/chunks/SimpleForm.es.js +9 -9
  32. package/dist/chunks/SimpleTable.es.js +286 -283
  33. package/dist/chunks/Slicer.es.js +1129 -689
  34. package/dist/chunks/TableSettingsFallback.es.js +6 -6
  35. package/dist/chunks/ThumbnailSimple.es.js +410 -61
  36. package/dist/chunks/VersionUploadContext.es.js +30 -30
  37. package/dist/chunks/ViewsContext.es.js +97 -97
  38. package/dist/chunks/Watchers.es.js +628 -598
  39. package/dist/chunks/entityDefinitions.es.js +276 -134
  40. package/dist/chunks/expandRelativeDates.es.js +27 -0
  41. package/dist/chunks/getBundleMode.es.js +16 -61
  42. package/dist/chunks/getUris.es.js +329 -322
  43. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  44. package/dist/chunks/searchTerms.es.js +186 -173
  45. package/dist/chunks/uriUtils.es.js +48 -0
  46. package/dist/chunks/useAttributeEnums.es.js +69 -61
  47. package/dist/chunks/useColumnDragRestriction.es.js +37 -27
  48. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  49. package/dist/chunks/useLocalStorage.es.js +8 -8
  50. package/dist/chunks/useSessionStorage.es.js +61 -0
  51. package/dist/chunks/viewUpdateHelper.es.js +8 -8
  52. package/dist/components.es.js +199 -194
  53. package/dist/context.es.js +60 -58
  54. package/dist/hooks.es.js +108 -101
  55. package/dist/index.es.js +20 -14
  56. package/dist/types/Actions.d.ts +16 -16
  57. package/dist/types/ContextMenu.d.ts +16 -16
  58. package/dist/types/DetailsPanel.d.ts +22 -16
  59. package/dist/types/EntityPickerDialog.d.ts +16 -16
  60. package/dist/types/Feed.d.ts +16 -16
  61. package/dist/types/ListTable.d.ts +16 -16
  62. package/dist/types/NewEntity.d.ts +16 -16
  63. package/dist/types/ProjectTreeTable.d.ts +48 -22
  64. package/dist/types/RepresentationsList.d.ts +19 -16
  65. package/dist/types/SimpleTable.d.ts +17 -16
  66. package/dist/types/Slicer.d.ts +119 -34
  67. package/dist/types/Views.d.ts +17 -17
  68. package/dist/types/api.d.ts +404 -95
  69. package/dist/types/components.d.ts +86 -25
  70. package/dist/types/context.d.ts +60 -17
  71. package/dist/types/hooks.d.ts +16 -16
  72. package/dist/types/index.d.ts +16 -16
  73. package/dist/types/util.d.ts +16 -16
  74. package/dist/util.es.js +108 -97
  75. package/package.json +26 -13
  76. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  77. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -72,6 +72,8 @@ declare type AttributeModel = {
72
72
 
73
73
  export declare const buildListFolderRowId: (folderId: string) => string;
74
74
 
75
+ export declare const clampDraggedHeights: (sizes: number[], totalHeight: number, mins: number[]) => number[];
76
+
75
77
  declare type ColumnItemModel = {
76
78
  name: string;
77
79
  visible?: boolean;
@@ -118,15 +120,17 @@ declare interface ContextMenuItemType extends Omit<ContextMenuItemProps, 'contex
118
120
  }
119
121
 
120
122
  export declare type CreateFilterFromSlicer = ({ slice, attribFields, }: {
121
- slice: {
122
- sliceType: SliceType;
123
- rowSelection: RowSelectionState;
124
- } | null;
123
+ slice: SliceSelection | null;
125
124
  attribFields: ProjectTableAttribute[];
126
125
  }) => SliceFilter | null;
127
126
 
128
127
  export declare const createFilterFromSlicer: CreateFilterFromSlicer;
129
128
 
129
+ export declare const createFiltersFromSlicer: ({ slices, attribFields, }: {
130
+ slices: SliceSelection[];
131
+ attribFields: ProjectTableAttribute[];
132
+ }) => SliceFilter[];
133
+
130
134
  export declare const defaultSliceOptions: SliceTypeField[];
131
135
 
132
136
  declare interface EntityMoveData {
@@ -138,6 +142,12 @@ declare interface EntityMoveData {
138
142
 
139
143
  declare type EntityMoveType = 'folder' | 'task';
140
144
 
145
+ export declare interface EntityParentMaps {
146
+ taskFolderIds: Record<string, string>;
147
+ versionFolderIds: Record<string, string>;
148
+ productFolderIds: Record<string, string>;
149
+ }
150
+
141
151
  declare type EnumItem = {
142
152
  value: string | number | number | boolean;
143
153
  label: string;
@@ -216,6 +226,8 @@ declare type GetDefaultViewApiResponse =
216
226
  /** status 200 Successful Response */
217
227
  OverviewViewModel | TaskProgressViewModel | ListsViewModel | ReviewsViewModel | VersionsViewModel | GenericViewModel;
218
228
 
229
+ export declare type GetSlicerCountsSource = (sliceType: string) => SlicerCountsSource | undefined;
230
+
219
231
  declare type GroupCount = {
220
232
  count: number;
221
233
  percentage?: number;
@@ -408,6 +420,8 @@ declare type QueryFilter_5 = {
408
420
  operator?: 'and' | 'or';
409
421
  };
410
422
 
423
+ export declare const resolvePanelLayout: (stored: SlicerPanelHeights, panelIds: string[], collapsed?: string[], containerHeight?: number, defaultHeight?: number) => SlicerPanelLayout;
424
+
411
425
  declare type ReviewsSettings = {
412
426
  rowHeight?: number;
413
427
  sortBy?: string;
@@ -531,17 +545,23 @@ export declare interface SliceData {
531
545
  isAttribute?: boolean;
532
546
  }
533
547
 
534
- export declare interface SliceFilter extends FilterValue {
535
- values: {
536
- id: string;
537
- label: string;
538
- }[];
548
+ export declare interface SliceFilter extends Filter {
549
+ values: FilterValue[];
539
550
  }
540
551
 
541
552
  export declare type SliceMap = Map<string, SimpleTableRow>;
542
553
 
554
+ export declare interface SlicePanel {
555
+ id: string;
556
+ sliceType: SliceType;
557
+ }
558
+
543
559
  export declare const Slicer: FC<SlicerProps>;
544
560
 
561
+ export declare const SLICER_DEFAULT_PANEL_HEIGHT = 180;
562
+
563
+ export declare const SLICER_MIN_PANEL_HEIGHT = 100;
564
+
545
565
  export declare const SLICER_PAGES_CONFIG: SlicerConfig;
546
566
 
547
567
  export declare const SLICER_SPLITTER_PANEL_CONFIG: {
@@ -559,12 +579,23 @@ export declare type SlicerConfig = {
559
579
 
560
580
  export declare interface SlicerContextValue {
561
581
  projectName: string;
582
+ page: string;
562
583
  rowSelection: RowSelectionState;
563
584
  onRowSelectionChange: OnRowSelectionChange;
564
585
  expanded: ExpandedState;
565
586
  onExpandedChange: (expanded: ExpandedState) => void;
566
587
  sliceType: SliceType;
567
588
  onSliceTypeChange: OnSliceTypeChange;
589
+ slices: SlicePanel[];
590
+ addSlicePanel: (sliceType?: SliceType) => void;
591
+ removeSlicePanel: (panelId: string) => void;
592
+ setPanelSliceType: (panelId: string, sliceType: SliceType) => void;
593
+ getPanelSelection: (panelId: string) => RowSelectionState;
594
+ setPanelSelection: (panelId: string, selection: React.SetStateAction<RowSelectionState>) => void;
595
+ getPanelExpanded: (panelId: string) => ExpandedState;
596
+ setPanelExpanded: (panelId: string, expanded: React.SetStateAction<ExpandedState>) => void;
597
+ collapsedPanels: string[];
598
+ togglePanelCollapsed: (panelId: string) => void;
568
599
  isViewSyncPending: boolean;
569
600
  pinnedSlice: PinnedSlice | null;
570
601
  setPinnedSlice: React.Dispatch<React.SetStateAction<PinnedSlice | null>>;
@@ -594,12 +625,34 @@ declare interface SlicerDropdownFallbackProps extends DropdownProps {
594
625
  sliceTypes: SliceType[];
595
626
  }
596
627
 
628
+ declare interface SliceRowSelection {
629
+ sliceType: string;
630
+ rowSelection: RowSelectionState;
631
+ }
632
+
633
+ declare type SlicerPanelHeights = Record<string, number>;
634
+
635
+ declare type SlicerPanelLayout = {
636
+ heights: number[];
637
+ mins: number[];
638
+ sizes: number[];
639
+ minSize: number;
640
+ height: number;
641
+ };
642
+
643
+ export declare interface SlicerPanelSelections {
644
+ sliceSelections: SliceRowSelection[];
645
+ sliceFilters: SliceFilter[];
646
+ isLicensePending: boolean;
647
+ }
648
+
597
649
  export declare interface SlicerProps {
598
650
  sliceFields: SliceTypeField[];
599
651
  entityTypes?: string[];
600
652
  pinnedSliceType?: SliceType;
601
- countsSource?: SlicerCountsSource;
653
+ countsSource?: SlicerCountsSource | GetSlicerCountsSource;
602
654
  onAddToList?: OnAddToList;
655
+ enableSplit?: boolean;
603
656
  }
604
657
 
605
658
  export declare const SlicerProvider: ({ children, page, projectName, viewSettings, isLoadingViews, updateViewSettings, onOpenViewer, onAddToList, ...props }: SlicerProviderProps) => JSX_2.Element;
@@ -629,6 +682,17 @@ export declare interface SlicerTableProps {
629
682
  globalFilter: string;
630
683
  }
631
684
 
685
+ export declare interface SlicerViewSettings {
686
+ sliceType?: SliceType;
687
+ sliceTypes?: SliceType[];
688
+ collapsedSliceTypes?: SliceType[];
689
+ }
690
+
691
+ export declare type SliceSelection = {
692
+ sliceType: SliceType;
693
+ rowSelection: RowSelectionState;
694
+ };
695
+
632
696
  export declare type SliceType = 'hierarchy' | 'assignees' | 'status' | 'type' | 'taskType' | 'entityList' | string;
633
697
 
634
698
  export declare interface SliceTypeField {
@@ -740,26 +804,42 @@ export declare const useHierarchyContextMenuItems: (onAddToList?: OnAddToList, e
740
804
  onCancelRename: () => void;
741
805
  };
742
806
 
807
+ export declare const useHierarchySelection: () => RowSelectionState | null;
808
+
743
809
  export declare const useOptionalSlicerContext: () => SlicerContextValue | undefined;
744
810
 
745
811
  /**
746
812
  * Resolves entity list slicer selections to actual entity IDs.
747
- * When sliceType is 'entityList', fetches entity IDs from each selected list,
748
- * then resolves cross-entity parent references (e.g. task → folder, version → folder/task).
813
+ * When a panel with sliceType 'entityList' exists, fetches entity IDs from each
814
+ * selected list, then resolves cross-entity parent references
815
+ * (e.g. task → folder, version → folder/task).
749
816
  */
750
- export declare const useSelectedEntityIds: ({ rowSelection, sliceType, projectName, }: {
751
- rowSelection: RowSelectionState;
752
- sliceType: SliceType;
817
+ export declare const useSelectedEntityIds: ({ slices, projectName, }: {
818
+ slices: SliceSelection[];
753
819
  projectName: string;
754
820
  }) => {
755
821
  entityIds: SelectedEntityIds;
756
822
  rawEntityIds: SelectedEntityIds;
823
+ parentMaps: EntityParentMaps;
757
824
  isLoading: boolean;
758
825
  };
759
826
 
760
827
  export declare const useSlicerContext: () => SlicerContextValue;
761
828
 
762
- export declare const useSlicerCounts: (source: SlicerCountsSource | undefined, skip?: boolean) => SlicerCounts;
829
+ export declare const useSlicerCounts: (source: SlicerCountsSource | undefined, sliceType: string, allSliceTypes?: string[], skip?: boolean) => SlicerCounts;
830
+
831
+ export declare const useSlicerPanelHeights: (page: string, panelIds: string[], collapsed?: string[], containerHeight?: number) => {
832
+ sizes: number[];
833
+ minSize: number;
834
+ height: number;
835
+ panelHeights: number[];
836
+ layoutKey: string;
837
+ handleResizeEnd: (props: {
838
+ sizes: number[];
839
+ }) => void;
840
+ };
841
+
842
+ export declare const useSlicerPanelSelections: (attribFields: AttributeModel[]) => SlicerPanelSelections;
763
843
 
764
844
  export declare const useSlicerRemotes: () => {
765
845
  useExtraSlices: UseExtraSlices;
@@ -767,15 +847,19 @@ export declare const useSlicerRemotes: () => {
767
847
  SlicerDropdown: ForwardRefExoticComponent< SlicerDropdownFallbackProps & RefAttributes<DropdownRef>>;
768
848
  };
769
849
 
770
- export declare const useSlicerRowSelection: ({ sliceType, page, projectName, ...props }: UseSlicerRowSelectionProps) => {
850
+ export declare const useSlicerRowSelection: ({ sliceTypes, page, projectName, ...props }: UseSlicerRowSelectionProps) => {
771
851
  rowSelection: RowSelectionState;
772
852
  setRowSelection: (value: React.SetStateAction<RowSelectionState>, targetSliceType?: SliceType) => void;
773
853
  expanded: ExpandedState;
774
854
  setExpanded: (value: React.SetStateAction<ExpandedState>, targetSliceType?: SliceType) => void;
855
+ getPanelSelection: (sliceType: SliceType) => RowSelectionState;
856
+ setPanelSelection: (sliceType: SliceType, value: React.SetStateAction<RowSelectionState>) => void;
857
+ getPanelExpanded: (sliceType: SliceType) => ExpandedState;
858
+ setPanelExpanded: (sliceType: SliceType, value: React.SetStateAction<ExpandedState>) => void;
775
859
  };
776
860
 
777
861
  declare type UseSlicerRowSelectionProps = {
778
- sliceType: SliceType;
862
+ sliceTypes: SliceType[];
779
863
  page: string;
780
864
  projectName: string;
781
865
  rowSelection?: RowSelectionState;
@@ -810,6 +894,7 @@ declare type VersionStatsArgs = {
810
894
  versionFilter?: string;
811
895
  productFilter?: string;
812
896
  taskFilter?: string;
897
+ folderFilter?: string;
813
898
  folderIds?: string[];
814
899
  versionIds?: string[];
815
900
  productIds?: string[];
@@ -841,6 +926,22 @@ declare type ViewSettings = GetDefaultViewApiResponse['settings'];
841
926
  export { }
842
927
 
843
928
 
929
+ declare module '@tanstack/react-table' {
930
+ interface FilterFns {
931
+ fuzzy: (row: Row<any>, columnId: string, searchValue: string[][], addMeta: (meta: any) => void) => boolean;
932
+ }
933
+ interface FilterMeta {
934
+ itemRank: RankingInfo;
935
+ }
936
+ interface TableMeta<TData extends RowData> {
937
+ isExpandable?: boolean;
938
+ isLoading?: boolean;
939
+ children?: (props: SimpleTableCellTemplateProps, row: Row<TData>, table: Table<SimpleTableRow>) => JSX.Element;
940
+ [key: string]: any;
941
+ }
942
+ }
943
+
944
+
844
945
  declare global {
845
946
  interface Window {
846
947
  senderId: string;
@@ -862,22 +963,6 @@ declare module '@tanstack/react-table' {
862
963
  }
863
964
 
864
965
 
865
- declare module '@tanstack/react-table' {
866
- interface FilterFns {
867
- fuzzy: (row: Row<any>, columnId: string, searchValue: string[][], addMeta: (meta: any) => void) => boolean;
868
- }
869
- interface FilterMeta {
870
- itemRank: RankingInfo;
871
- }
872
- interface TableMeta<TData extends RowData> {
873
- isExpandable?: boolean;
874
- isLoading?: boolean;
875
- children?: (props: SimpleTableCellTemplateProps, row: Row<TData>, table: Table<SimpleTableRow>) => JSX.Element;
876
- [key: string]: any;
877
- }
878
- }
879
-
880
-
881
966
  declare module '@tanstack/react-table' {
882
967
  interface ColumnMeta<TData extends RowData, TValue> {
883
968
  listTableCustomCell?: boolean;
@@ -14,7 +14,7 @@ import { ForwardRefExoticComponent } from 'react';
14
14
  import { MutationDefinition } from '@reduxjs/toolkit/query';
15
15
  import { OverrideResultType } from '@reduxjs/toolkit/query';
16
16
  import { QueryDefinition } from '@reduxjs/toolkit/query';
17
- import { reactHooksModuleName } from '@reduxjs/toolkit/dist/query/react';
17
+ import { reactHooksModuleName } from '@reduxjs/toolkit/query/react';
18
18
  import { ReactNode } from 'react';
19
19
  import { RefAttributes } from 'react';
20
20
  import { SetStateAction } from 'react';
@@ -963,6 +963,22 @@ export declare const WORKING_VIEW_ID: "_working_";
963
963
  export { }
964
964
 
965
965
 
966
+ declare module '@tanstack/react-table' {
967
+ interface FilterFns {
968
+ fuzzy: (row: Row<any>, columnId: string, searchValue: string[][], addMeta: (meta: any) => void) => boolean;
969
+ }
970
+ interface FilterMeta {
971
+ itemRank: RankingInfo;
972
+ }
973
+ interface TableMeta<TData extends RowData> {
974
+ isExpandable?: boolean;
975
+ isLoading?: boolean;
976
+ children?: (props: SimpleTableCellTemplateProps, row: Row<TData>, table: Table<SimpleTableRow>) => JSX.Element;
977
+ [key: string]: any;
978
+ }
979
+ }
980
+
981
+
966
982
  declare global {
967
983
  interface Window {
968
984
  senderId: string;
@@ -984,22 +1000,6 @@ declare module '@tanstack/react-table' {
984
1000
  }
985
1001
 
986
1002
 
987
- declare module '@tanstack/react-table' {
988
- interface FilterFns {
989
- fuzzy: (row: Row<any>, columnId: string, searchValue: string[][], addMeta: (meta: any) => void) => boolean;
990
- }
991
- interface FilterMeta {
992
- itemRank: RankingInfo;
993
- }
994
- interface TableMeta<TData extends RowData> {
995
- isExpandable?: boolean;
996
- isLoading?: boolean;
997
- children?: (props: SimpleTableCellTemplateProps, row: Row<TData>, table: Table<SimpleTableRow>) => JSX.Element;
998
- [key: string]: any;
999
- }
1000
- }
1001
-
1002
-
1003
1003
  declare module '@tanstack/react-table' {
1004
1004
  interface ColumnMeta<TData extends RowData, TValue> {
1005
1005
  listTableCustomCell?: boolean;