@ynput/ayon-frontend-shared 0.6.8 → 0.7.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 (67) hide show
  1. package/dist/ContextMenu.es.js +44 -27
  2. package/dist/DetailsPanel.es.js +225 -224
  3. package/dist/Feed.es.js +64 -58
  4. package/dist/ListTable.es.js +423 -423
  5. package/dist/NewEntity.es.js +44 -43
  6. package/dist/ProjectTreeTable.es.js +3517 -3378
  7. package/dist/Slicer.es.js +301 -276
  8. package/dist/Views.es.js +366 -352
  9. package/dist/api.es.js +428 -413
  10. package/dist/chunks/Actions.es.js +18 -17
  11. package/dist/chunks/ColumnDropIndicator.es.js +21 -20
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
  13. package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
  14. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
  15. package/dist/chunks/DetailsDialog.es.js +26 -24
  16. package/dist/chunks/EmptyPlaceholder.es.js +3 -3
  17. package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
  18. package/dist/chunks/EntityPath.es.js +60 -59
  19. package/dist/chunks/EntityPickerDialog.es.js +88 -83
  20. package/dist/chunks/EntityTooltip.es.js +15 -14
  21. package/dist/chunks/EntityUpdatesContext.es.js +11 -11
  22. package/dist/chunks/Feed.es.js +1072 -1088
  23. package/dist/chunks/FilterErrorActions.es.js +4 -3
  24. package/dist/chunks/Menu.es.js +633 -289
  25. package/dist/chunks/MenuContext.es.js +1 -1
  26. package/dist/chunks/MetaWidget.es.js +2449 -2199
  27. package/dist/chunks/PlayableIcon.es.js +128 -88
  28. package/dist/chunks/ProjectContext.es.js +6 -6
  29. package/dist/chunks/RepresentationsList.es.js +1 -1
  30. package/dist/chunks/ReviewablesSelector.es.js +627 -611
  31. package/dist/chunks/SimpleForm.es.js +11 -10
  32. package/dist/chunks/SimpleTable.es.js +386 -363
  33. package/dist/chunks/Slicer.es.js +956 -823
  34. package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
  35. package/dist/chunks/TableSettingsFallback.es.js +4 -3
  36. package/dist/chunks/ThumbnailSimple.es.js +100 -99
  37. package/dist/chunks/VideoPlayer.es.js +1 -1
  38. package/dist/chunks/Watchers.es.js +224 -223
  39. package/dist/chunks/getBundleMode.es.js +33 -25
  40. package/dist/chunks/getEntityTypeIcon.es.js +5 -4
  41. package/dist/chunks/getUris.es.js +3873 -3736
  42. package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
  43. package/dist/chunks/searchTerms.es.js +621 -499
  44. package/dist/chunks/sortLists.es.js +22 -0
  45. package/dist/chunks/useAttributeEnums.es.js +43 -43
  46. package/dist/chunks/useDateRangeFilter.es.js +85 -59
  47. package/dist/chunks/useHierarchySelection.es.js +6 -5
  48. package/dist/chunks/useLoadModule.es.js +24 -23
  49. package/dist/chunks/viewUpdateHelper.es.js +41 -40
  50. package/dist/components.es.js +963 -891
  51. package/dist/context.es.js +528 -501
  52. package/dist/hooks.es.js +15 -15
  53. package/dist/index.es.js +6 -6
  54. package/dist/types/ContextMenu.d.ts +4 -1
  55. package/dist/types/Feed.d.ts +55 -1
  56. package/dist/types/ListTable.d.ts +1 -1
  57. package/dist/types/ProjectTreeTable.d.ts +128 -15
  58. package/dist/types/SimpleTable.d.ts +2 -1
  59. package/dist/types/Slicer.d.ts +26 -1
  60. package/dist/types/Views.d.ts +2 -0
  61. package/dist/types/api.d.ts +2359 -590
  62. package/dist/types/components.d.ts +542 -4
  63. package/dist/types/context.d.ts +94 -2
  64. package/dist/types/util.d.ts +58 -0
  65. package/dist/util.es.js +141 -129
  66. package/package.json +2 -2
  67. package/dist/chunks/MenuItem.es.js +0 -420
@@ -12,11 +12,17 @@ import { Component } from 'react';
12
12
  import { Context } from 'react';
13
13
  import { coreModuleName } from '@reduxjs/toolkit/query';
14
14
  import { CSSProperties } from 'react';
15
+ import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
15
16
  import { default as default_2 } from 'react';
16
17
  import { DetailedHTMLProps } from 'react';
17
18
  import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES } from 'react';
18
19
  import { DocumentNode } from 'graphql';
20
+ import { DOMConversionMap } from 'lexical';
21
+ import { DOMExportOutput } from 'lexical';
19
22
  import { DropdownRef } from '@ynput/ayon-react-components';
23
+ import { EditorConfig } from 'lexical';
24
+ import { ElementFormatType } from 'lexical';
25
+ import { ElementNode } from 'lexical';
20
26
  import { ExecutionProps } from 'styled-components';
21
27
  import { FastOmit } from 'styled-components';
22
28
  import { FC } from 'react';
@@ -33,11 +39,16 @@ import { ImgHTMLAttributes } from 'react';
33
39
  import { InputHTMLAttributes } from 'react';
34
40
  import { IStyledComponentBase } from 'styled-components/dist/types';
35
41
  import { JSX as JSX_2 } from 'react/jsx-runtime';
42
+ import { JSX as JSX_3 } from 'react';
36
43
  import { LabelHTMLAttributes } from 'react';
44
+ import { LexicalCommand } from 'lexical';
45
+ import { LexicalEditor } from 'lexical';
46
+ import { LexicalNode } from 'lexical';
37
47
  import { MouseEvent as MouseEvent_2 } from 'react';
38
48
  import { MutationActionCreatorResult } from '@reduxjs/toolkit/query';
39
49
  import { MutationDefinition } from '@reduxjs/toolkit/query';
40
50
  import { NamedExoticComponent } from 'react';
51
+ import { NodeKey } from 'lexical';
41
52
  import { Option as Option_2 } from '@ynput/ayon-react-components';
42
53
  import { OverrideResultType } from '@reduxjs/toolkit/query';
43
54
  import { QueryDefinition } from '@reduxjs/toolkit/query';
@@ -48,9 +59,15 @@ import { RefAttributes } from 'react';
48
59
  import { RefObject } from 'react';
49
60
  import { SearchFilterGroupOption } from '@ynput/ayon-react-components';
50
61
  import { SearchFilterRef } from '@ynput/ayon-react-components';
62
+ import { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
51
63
  import { SerializedError } from '@reduxjs/toolkit';
64
+ import { SerializedTextNode } from 'lexical';
52
65
  import { SortingState } from '@tanstack/react-table';
66
+ import { Spread } from 'lexical';
67
+ import { TextMatchTransformer } from '@lexical/markdown';
68
+ import { TextNode } from 'lexical';
53
69
  import { ThunkDispatch } from '@reduxjs/toolkit';
70
+ import { Transformer as Transformer_2 } from '@lexical/markdown';
54
71
  import { TSHelpersNoInfer } from '@reduxjs/toolkit/query';
55
72
  import { UnknownAction } from '@reduxjs/toolkit';
56
73
  import { UpdateDefinitions } from '@reduxjs/toolkit/query';
@@ -62,6 +79,22 @@ import { VisibilityState } from '@tanstack/react-table';
62
79
  import { WatcherSelectProps } from '@ynput/ayon-react-components';
63
80
  import { WebTarget } from 'styled-components';
64
81
 
82
+ export declare const $createMediaNode: (payload: MediaPayload) => MediaNode;
83
+
84
+ export declare const $createMentionNode: (type: string, id: string, label: string) => MentionNode;
85
+
86
+ export declare const $createYouTubeNode: (url: string) => YouTubeNode;
87
+
88
+ export declare const $getMarkdown: (node?: ElementNode) => string;
89
+
90
+ export declare const $isMediaNode: (node: LexicalNode | null | undefined) => node is MediaNode;
91
+
92
+ export declare const $isMentionNode: (node: LexicalNode | null | undefined) => node is MentionNode;
93
+
94
+ export declare const $isYouTubeNode: (node: LexicalNode | null | undefined) => node is YouTubeNode;
95
+
96
+ export declare const $setMarkdown: (markdown: string) => void;
97
+
65
98
  export declare const ACCESS_LEVEL_LABELS: {
66
99
  0: string;
67
100
  10: string;
@@ -114,6 +147,8 @@ declare interface Action extends ButtonProps {
114
147
 
115
148
  declare const ActionWrapper: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
116
149
 
150
+ export declare const ACTIVITY_LINK_LABEL = "Comment";
151
+
117
152
  export declare const AddColumnButton: FC<AddColumnButtonProps>;
118
153
 
119
154
  declare interface AddColumnButtonProps {
@@ -285,6 +320,10 @@ declare type BaseProps = React.HTMLAttributes<HTMLDivElement> & {
285
320
 
286
321
  export declare const BLOCK_DIALOG_CLOSE_CLASS = "block-dialog-close";
287
322
 
323
+ export declare type BlockFormat = Exclude<BlockType, 'paragraph' | 'heading'>;
324
+
325
+ declare type BlockType = 'paragraph' | 'h1' | 'h2' | 'h3' | 'heading' | 'quote' | 'code' | 'bullet' | 'number' | 'check';
326
+
288
327
  declare type BooleanCalc = 'checked' | 'notChecked';
289
328
 
290
329
  export declare const buildChildrenDetails: (topLevelFolders: DeletableEntity[], folderInfo: FolderDeleteInfo[]) => string[];
@@ -313,6 +352,8 @@ export declare type BuildFilterOptions = {
313
352
 
314
353
  export declare const buildScopes: (scopes: ScopeType_2[], exclude?: Partial<Record<ScopeType_2, FilterFieldType[]>>) => ScopeWithFilterTypes[];
315
354
 
355
+ export declare const buildSortMenuItem: <T extends string>({ options, sort, onChange, id, label, icon, }: SortMenuItemArgs<T>) => MenuItemType;
356
+
316
357
  declare type BundleMode = 'production' | 'staging' | 'developer';
317
358
 
318
359
  declare const Button: IStyledComponentBase<"web", FastOmit<Omit< ButtonProps & RefAttributes<HTMLButtonElement>, "ref"> & {
@@ -328,6 +369,7 @@ export declare const Chips: FC<ChipsProps>;
328
369
  declare interface ChipsProps {
329
370
  values: ChipValue[];
330
371
  disabled?: boolean;
372
+ className?: string;
331
373
  pt?: {
332
374
  chip?: Partial<HTMLAttributes<HTMLDivElement>>;
333
375
  };
@@ -339,6 +381,7 @@ export declare type ChipValue = {
339
381
  icon?: string;
340
382
  prefix?: default_2.ReactNode;
341
383
  suffix?: default_2.ReactNode;
384
+ onClick?: default_2.MouseEventHandler<HTMLDivElement>;
342
385
  };
343
386
 
344
387
  declare type ColorInputPt = Partial<React.InputHTMLAttributes<HTMLInputElement>>;
@@ -503,6 +546,12 @@ declare interface ContextMenuItemType extends Omit<ContextMenuItemProps, 'contex
503
546
  [key: string]: any;
504
547
  }
505
548
 
549
+ /**
550
+ * Mention source backed by the activity feed's mention suggestions (`useGetEntityMentionsQuery`),
551
+ * using the same option builders and sorting as the legacy comment input.
552
+ */
553
+ export declare const createFeedMentionSource: ({ suggestions, project, taskTypes, entityType, }: FeedMentionSourceOptions) => MentionSource;
554
+
506
555
  declare type CreateViewApiArg = {
507
556
  viewType: string;
508
557
  projectName?: string;
@@ -608,6 +657,8 @@ export declare interface DateRangePickerProps {
608
657
 
609
658
  export declare const DEFAULT_FEATURED_ORDER: string[];
610
659
 
660
+ export declare const DEFAULT_TOOLBAR: ToolbarLayout;
661
+
611
662
  declare type DefaultProductBaseType_2 = {
612
663
  color?: string;
613
664
  icon?: string;
@@ -669,6 +720,8 @@ declare type DeliveryTemplate = {
669
720
  file: string;
670
721
  };
671
722
 
723
+ export declare const DESCRIPTION_TOOLBAR: ToolbarLayout;
724
+
672
725
  declare interface DescriptionMentionsContext {
673
726
  projectName: string;
674
727
  entityType: string;
@@ -701,7 +754,7 @@ declare interface DescriptionSectionProps {
701
754
  }, target: HTMLElement) => void;
702
755
  }
703
756
 
704
- export declare const DetailsDialog: ({ projectName, entityType, entityIds, visible, onHide, }: DetailsDialogProps) => JSX_2.Element | null;
757
+ export declare const DetailsDialog: ({ projectName, entityType, entityIds, visible, onHide, data: dataProp, header, }: DetailsDialogProps) => JSX_2.Element | null;
705
758
 
706
759
  export declare interface DetailsDialogProps {
707
760
  projectName?: string;
@@ -709,6 +762,8 @@ export declare interface DetailsDialogProps {
709
762
  entityIds: string[];
710
763
  visible: boolean;
711
764
  onHide: () => void;
765
+ data?: unknown;
766
+ header?: string;
712
767
  }
713
768
 
714
769
  declare type DetailsField = Pick<AttributeField, 'name' | 'data' | 'hidden'>;
@@ -947,6 +1002,15 @@ declare interface EarlyPreviewProps extends React.HTMLAttributes<HTMLDivElement>
947
1002
 
948
1003
  declare type EditingViewState = string | true | null;
949
1004
 
1005
+ export declare interface EditorCommand {
1006
+ id: string;
1007
+ label: string;
1008
+ icon: string;
1009
+ keywords?: string[];
1010
+ hint?: string;
1011
+ run: () => void;
1012
+ }
1013
+
950
1014
  export declare const EmptyPlaceholder: FC<EmptyPlaceholderProps>;
951
1015
 
952
1016
  export declare const EmptyPlaceholderFlex: IStyledComponentBase<"web", FastOmit<EmptyPlaceholderProps, never> & Partial<Pick< EmptyPlaceholderProps, never>>> & string & Omit< FC<EmptyPlaceholderProps>, keyof Component<any, {}, any>>;
@@ -1245,6 +1309,13 @@ declare type FeedFrameLinkPreview = {
1245
1309
  link: CommentFrameLink | null;
1246
1310
  };
1247
1311
 
1312
+ declare interface FeedMentionSourceOptions {
1313
+ suggestions?: SuggestResponse;
1314
+ project?: Pick<ProjectContextValue, 'productTypes'>;
1315
+ taskTypes?: TaskType_3[];
1316
+ entityType?: string;
1317
+ }
1318
+
1248
1319
  export declare const FieldLabel: default_2.FC<FieldLabelProps>;
1249
1320
 
1250
1321
  declare interface FieldLabelProps extends default_2.HTMLAttributes<HTMLDivElement> {
@@ -1332,7 +1403,9 @@ export declare interface FilterErrorActionsProps {
1332
1403
  errorMessage?: string;
1333
1404
  }
1334
1405
 
1335
- export declare type FilterFieldType = 'folderType' | 'taskType' | 'productType' | 'productBaseType' | ('users' | 'assignees' | 'author') | 'attributes' | 'status' | 'tags' | 'version' | 'hasReviewables' | 'productName' | 'name' | 'createdAt' | 'updatedAt';
1406
+ export declare type FilterFieldType = 'folderType' | 'taskType' | 'productType' | 'productBaseType' | ('users' | 'assignees' | 'author') | 'attributes' | 'status' | 'tags' | 'version' | 'hasReviewables' | 'productName' | 'name' | 'extension' | 'createdAt' | 'updatedAt';
1407
+
1408
+ export declare const FLOATING_TOOLBAR: ToolbarLayout;
1336
1409
 
1337
1410
  declare type FolderDeleteInfo = {
1338
1411
  id: string;
@@ -1360,6 +1433,18 @@ declare interface FolderProduct {
1360
1433
  } | null;
1361
1434
  }
1362
1435
 
1436
+ declare type FolderSuggestionItem = {
1437
+ /** The date and time when the suggested entity was created */
1438
+ createdAt?: string;
1439
+ /** The relevance score of the suggestion */
1440
+ relevance?: number;
1441
+ id: string;
1442
+ folderType: string;
1443
+ name: string;
1444
+ label?: string;
1445
+ thumbnailId?: string;
1446
+ };
1447
+
1363
1448
  declare type FolderType = {
1364
1449
  name: string;
1365
1450
  original_name?: string;
@@ -1552,6 +1637,39 @@ export declare const getGroupedReviewables: (reviewables: ReviewableResponse[],
1552
1637
  queued: ReviewableResponse[];
1553
1638
  };
1554
1639
 
1640
+ /**
1641
+ * Ids of the project files shown as image / video blocks in the markdown. Only standalone media
1642
+ * images count, not file urls in prose, links or code blocks.
1643
+ */
1644
+ export declare const getInlineMediaFileIds: (markdown?: string | null) => Set<string>;
1645
+
1646
+ /**
1647
+ * A short label for a link to a well known site, made only from the url (nothing is fetched),
1648
+ * e.g. `https://github.com/ynput/ayon-frontend/issues/2342` → `ayon-frontend #2342`.
1649
+ * Returns null for urls without a known structure, which keep the url as their text.
1650
+ */
1651
+ export declare const getLinkLabel: (href: string) => string | null;
1652
+
1653
+ /**
1654
+ * Image or video, from the mime type (written as the markdown image title by the editor) or else
1655
+ * the file extension of the url / name. Defaults to image, markdown images are images.
1656
+ */
1657
+ export declare const getMediaKind: (mime?: string | null, ...names: (string | null | undefined)[]) => "video" | "image";
1658
+
1659
+ export declare const getMentionTrigger: (type: string) => MentionTrigger;
1660
+
1661
+ export declare const getProjectFileId: (src?: string | null) => string | null;
1662
+
1663
+ /**
1664
+ * The link a duplicated comment keeps to the comment it was copied from:
1665
+ * `source:{activityId}?type={entityType}&id={entityId}`. The entity is the one the source comment
1666
+ * belongs to, which can differ from the entity the copy is posted on.
1667
+ */
1668
+ export declare const getSourceLink: (activityId: string, entity?: {
1669
+ id: string;
1670
+ type: string;
1671
+ }) => string;
1672
+
1555
1673
  export declare const getUiTypeLabel: (type: AttributeData_2["type"] | undefined, enumValues?: AttributeData_2["enum"], enumResolver?: AttributeData_2["enumResolver"]) => string;
1556
1674
 
1557
1675
  declare type GetViewApiArg = {
@@ -1599,6 +1717,28 @@ export declare const groupLinksByEntity: (links: LinkEntity[]) => GroupedLink[];
1599
1717
 
1600
1718
  export declare const GUEST_KEY_PREFIX = "guest:";
1601
1719
 
1720
+ declare interface HastNode {
1721
+ type: string;
1722
+ tagName?: string;
1723
+ value?: string;
1724
+ properties?: {
1725
+ href?: string;
1726
+ };
1727
+ children?: HastNode[];
1728
+ }
1729
+
1730
+ declare interface HastNode_2 {
1731
+ type: string;
1732
+ tagName?: string;
1733
+ value?: string;
1734
+ properties?: {
1735
+ src?: string;
1736
+ alt?: string;
1737
+ title?: string;
1738
+ };
1739
+ children?: HastNode_2[];
1740
+ }
1741
+
1602
1742
  export declare interface HeightSliderProps {
1603
1743
  value: number;
1604
1744
  onChange: (value: number) => void;
@@ -1668,6 +1808,10 @@ declare const InputText: IStyledComponentBase<"web", FastOmit<Omit< InputHTMLAtt
1668
1808
  ref?: ((instance: HTMLInputElement | 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<HTMLInputElement> | null | undefined;
1669
1809
  }, never>>> & string & Omit< ForwardRefExoticComponent< InputHTMLAttributes<HTMLInputElement> & RefAttributes<HTMLInputElement>>, keyof Component<any, {}, any>>;
1670
1810
 
1811
+ export declare const INSERT_MENTION_TRIGGER_COMMAND: LexicalCommand<MentionTrigger>;
1812
+
1813
+ export declare const isMediaFile: (file: File) => boolean;
1814
+
1671
1815
  export declare const JsonViewer: FC<JsonViewerProps>;
1672
1816
 
1673
1817
  export declare interface JsonViewerProps {
@@ -1838,8 +1982,204 @@ declare type ListViewsApiArg = {
1838
1982
 
1839
1983
  declare type MainCalc = 'count' | 'breakdown';
1840
1984
 
1985
+ export declare const MARKDOWN_TRANSFORMERS: Transformer_2[];
1986
+
1987
+ /**
1988
+ * Rich text editor that reads and writes markdown.
1989
+ * Supports text formats, links, lists, check lists, quotes, inline code and code blocks and
1990
+ * mentions (`@user`, `@@version`, `@@@task`) stored as `[label](type:id)`.
1991
+ */
1992
+ export declare const MarkdownEditor: ForwardRefExoticComponent<MarkdownEditorProps & RefAttributes<MarkdownEditorHandle>>;
1993
+
1994
+ export declare interface MarkdownEditorHandle {
1995
+ getEditor: () => LexicalEditor;
1996
+ focus: () => void;
1997
+ blur: () => void;
1998
+ getMarkdown: () => string;
1999
+ setMarkdown: (markdown: string) => void;
2000
+ clear: () => void;
2001
+ isEmpty: () => boolean;
2002
+ insertMentionTrigger: (trigger: MentionTrigger) => void;
2003
+ }
2004
+
2005
+ export declare interface MarkdownEditorProps extends MentionEventHandlers {
2006
+ variant?: MarkdownEditorVariant;
2007
+ value?: string;
2008
+ onChange?: (markdown: string) => void;
2009
+ placeholder?: string;
2010
+ onSubmit?: () => void;
2011
+ submitOnEnter?: boolean;
2012
+ onEscape?: () => void;
2013
+ onFiles?: (files: File[]) => void;
2014
+ onUploadMedia?: UploadMedia;
2015
+ mentions?: MentionSource;
2016
+ mentionMenuParent?: HTMLElement;
2017
+ mentionPlacement?: MentionPlacement;
2018
+ emoji?: boolean;
2019
+ slashCommands?: boolean;
2020
+ commands?: EditorCommand[];
2021
+ toolbar?: boolean | ToolbarLayout;
2022
+ floatingToolbar?: boolean | ToolbarLayout;
2023
+ toolbarStart?: ReactNode;
2024
+ toolbarEnd?: ReactNode;
2025
+ footer?: ReactNode;
2026
+ actions?: ReactNode;
2027
+ autoFocus?: boolean;
2028
+ readOnly?: boolean;
2029
+ bordered?: boolean;
2030
+ minHeight?: number;
2031
+ maxHeight?: number;
2032
+ namespace?: string;
2033
+ className?: string;
2034
+ style?: CSSProperties;
2035
+ contentClassName?: string;
2036
+ children?: ReactNode;
2037
+ }
2038
+
2039
+ export declare type MarkdownEditorVariant = 'document' | 'message';
2040
+
2041
+ /**
2042
+ * Markdown as one line of plain text, e.g. for a summary of a description change. Mentions and
2043
+ * links become their label, images their name, and formatting, block markers and line breaks go.
2044
+ */
2045
+ export declare const markdownToPlainText: (markdown: string) => string;
2046
+
1841
2047
  declare type Maybe<T> = T | null;
1842
2048
 
2049
+ export declare const MediaBlock: ({ src, alt, mime, uploading, onOpen, className }: MediaBlockProps) => JSX_2.Element;
2050
+
2051
+ declare interface MediaBlockProps {
2052
+ src: string;
2053
+ alt?: string;
2054
+ mime?: string | null;
2055
+ uploading?: boolean;
2056
+ onOpen?: () => void;
2057
+ className?: string;
2058
+ }
2059
+
2060
+ /**
2061
+ * An image or video block. Stored in markdown as an image on its own line with the mime type as
2062
+ * its title: `![clip.mp4](/api/projects/p/files/id "video/mp4")`.
2063
+ */
2064
+ export declare class MediaNode extends DecoratorBlockNode {
2065
+ __src: string;
2066
+ __alt: string;
2067
+ __mime: string | null;
2068
+ __uploading: boolean;
2069
+ static getType(): string;
2070
+ static clone(node: MediaNode): MediaNode;
2071
+ static importJSON(serializedNode: SerializedMediaNode): MediaNode;
2072
+ constructor(payload: MediaPayload, format?: ElementFormatType, key?: NodeKey);
2073
+ exportJSON(): SerializedMediaNode;
2074
+ exportDOM(): DOMExportOutput;
2075
+ static importDOM(): DOMConversionMap | null;
2076
+ updateDOM(): false;
2077
+ getSrc(): string;
2078
+ getAlt(): string;
2079
+ getMime(): string | null;
2080
+ isUploading(): boolean;
2081
+ setUploaded(src: string, { alt, mime }?: {
2082
+ alt?: string;
2083
+ mime?: string | null;
2084
+ }): this;
2085
+ getTextContent(): string;
2086
+ decorate(_editor: LexicalEditor, config: EditorConfig): JSX_3.Element;
2087
+ }
2088
+
2089
+ declare interface MediaPayload {
2090
+ src: string;
2091
+ alt?: string;
2092
+ mime?: string | null;
2093
+ uploading?: boolean;
2094
+ }
2095
+
2096
+ export declare const MENTION: TextMatchTransformer;
2097
+
2098
+ export declare const MENTION_REF_TYPES: readonly ["user", "team", "task", "version", "folder", "representation", "workfile", "product"];
2099
+
2100
+ export declare const MENTION_TRIGGER_BY_TYPE: Record<string, MentionTrigger>;
2101
+
2102
+ export declare interface MentionEventHandlers {
2103
+ onMentionClick?: (mention: {
2104
+ type: string;
2105
+ id: string;
2106
+ label: string;
2107
+ }, e: MouseEvent) => void;
2108
+ onMentionHover?: (mention: {
2109
+ type: string;
2110
+ id: string;
2111
+ label: string;
2112
+ }, target: HTMLElement) => void;
2113
+ }
2114
+
2115
+ export declare interface MentionFilter {
2116
+ id: string;
2117
+ icon: string;
2118
+ tooltip: string;
2119
+ }
2120
+
2121
+ export declare interface MentionItem {
2122
+ type: string;
2123
+ id: string;
2124
+ label: string;
2125
+ icon?: string;
2126
+ color?: string;
2127
+ context?: string;
2128
+ suffix?: string;
2129
+ }
2130
+
2131
+ /**
2132
+ * An inline reference to a user, team, task, version... rendered as `@label` and stored in
2133
+ * markdown as `[label](type:id)`. It is a token so it can only be selected and deleted as a whole.
2134
+ */
2135
+ export declare class MentionNode extends TextNode {
2136
+ __mentionType: string;
2137
+ __mentionId: string;
2138
+ static getType(): string;
2139
+ static clone(node: MentionNode): MentionNode;
2140
+ static importJSON(serializedNode: SerializedMentionNode): MentionNode;
2141
+ constructor(mentionType: string, mentionId: string, text: string, key?: NodeKey);
2142
+ exportJSON(): SerializedMentionNode;
2143
+ getMentionType(): string;
2144
+ getMentionId(): string;
2145
+ getLabel(): string;
2146
+ getMentionValue(): string;
2147
+ createDOM(config: EditorConfig): HTMLElement;
2148
+ exportDOM(): DOMExportOutput;
2149
+ static importDOM(): DOMConversionMap | null;
2150
+ isTextEntity(): true;
2151
+ canInsertTextBefore(): boolean;
2152
+ canInsertTextAfter(): boolean;
2153
+ }
2154
+
2155
+ export declare type MentionPlacement = 'inline' | 'top';
2156
+
2157
+ export declare interface MentionQuery {
2158
+ trigger: MentionTrigger;
2159
+ search: string;
2160
+ filter: string | null;
2161
+ }
2162
+
2163
+ export declare type MentionRefType = (typeof MENTION_REF_TYPES)[number];
2164
+
2165
+ export declare interface MentionSource {
2166
+ triggers?: MentionTrigger[];
2167
+ config?: Partial<Record<MentionTrigger, Partial<MentionTriggerConfig>>>;
2168
+ getOptions: (query: MentionQuery) => MentionItem[];
2169
+ getError?: (trigger: MentionTrigger) => string | null | undefined;
2170
+ limit?: number;
2171
+ renderOptionImage?: (option: MentionItem) => ReactNode;
2172
+ }
2173
+
2174
+ export declare type MentionTrigger = '@' | '@@' | '@@@';
2175
+
2176
+ export declare interface MentionTriggerConfig {
2177
+ title: string;
2178
+ noun: string;
2179
+ isCircle?: boolean;
2180
+ filters?: MentionFilter[];
2181
+ }
2182
+
1843
2183
  export declare const Menu: default_2.FC<MenuProps>;
1844
2184
 
1845
2185
  export declare const MENU_PORTAL_CONTENT_ID = "ayon-menu-content";
@@ -1931,6 +2271,15 @@ export declare type NormalizedData = {
1931
2271
  icon?: string;
1932
2272
  };
1933
2273
 
2274
+ /**
2275
+ * Clean up markdown written by the legacy quill editor:
2276
+ * - quill wrote every line as its own paragraph and blank lines as `&nbsp;` spacer paragraphs.
2277
+ * When spacers are found, paragraphs next to each other become lines of one paragraph and the
2278
+ * spacers become paragraph breaks.
2279
+ * - `<u>` tags are dropped (markdown has no underline)
2280
+ */
2281
+ export declare const normalizeLegacyMarkdown: (markdown: string) => string;
2282
+
1934
2283
  declare type NullableString = string | null | undefined;
1935
2284
 
1936
2285
  declare type NumberCalc = 'sum' | 'avg' | 'min' | 'max' | 'none';
@@ -2025,8 +2374,36 @@ declare type ParentColumnDefinition = {
2025
2374
 
2026
2375
  declare type ParentColumnOptionKey = 'status' | 'folderStatus' | 'folderType' | 'taskType' | 'taskStatus' | 'productType' | 'assignee' | 'tag';
2027
2376
 
2377
+ export declare const parseActivityLink: (href?: string | null) => ParsedActivityLink | null;
2378
+
2379
+ /**
2380
+ * A link to a comment (any activity) on this server: `/projects/{project}/...?activity={id}`, as
2381
+ * made by a comment's "Copy link", or a source link (`getSourceLink`).
2382
+ * Links to other servers stay links.
2383
+ */
2384
+ declare type ParsedActivityLink = {
2385
+ activityId: string;
2386
+ entity: {
2387
+ id: string;
2388
+ type: string;
2389
+ } | null;
2390
+ isSource: true;
2391
+ } | {
2392
+ projectName: string;
2393
+ activityId: string;
2394
+ entityId: string | null;
2395
+ isSource: false;
2396
+ url: string;
2397
+ };
2398
+
2028
2399
  export declare const parseFilename: (filename: string) => string;
2029
2400
 
2401
+ /**
2402
+ * The video of a YouTube url, e.g. youtube.com/watch?v=ID, youtu.be/ID, youtube.com/shorts/ID,
2403
+ * youtube.com/embed/ID or youtube.com/live/ID. Null for anything else.
2404
+ */
2405
+ export declare const parseYouTubeUrl: (value: string) => YouTubeVideo | null;
2406
+
2030
2407
  declare type PartialBy<T, K extends keyof T> = Omit_2<T, K> & Partial<Pick<T, K>>;
2031
2408
 
2032
2409
  export declare type PathSegment = {
@@ -2070,7 +2447,7 @@ declare type PowerpackDialogType = {
2070
2447
  icon?: string;
2071
2448
  };
2072
2449
 
2073
- declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'entityLinks';
2450
+ declare type PowerpackFeature = 'slicer' | 'annotations' | 'releases' | 'advancedFilters' | 'listAttributes' | 'listFolders' | 'listAccess' | 'groupAttributes' | 'sharedViews' | 'commentCategories' | 'projectFolders' | 'columnSummaries' | 'listValues' | 'entityLinks' | 'tableExport';
2074
2451
 
2075
2452
  declare interface Processing extends ReviewableProcessingStatus {
2076
2453
  progress?: number;
@@ -2088,6 +2465,17 @@ declare type ProductBaseTypes = {
2088
2465
  definitions?: ProductBaseType[];
2089
2466
  };
2090
2467
 
2468
+ declare type ProductSuggestionItem = {
2469
+ /** The date and time when the suggested entity was created */
2470
+ createdAt?: string;
2471
+ /** The relevance score of the suggestion */
2472
+ relevance?: number;
2473
+ id: string;
2474
+ name: string;
2475
+ productType: string;
2476
+ parent?: FolderSuggestionItem;
2477
+ };
2478
+
2091
2479
  declare type ProductType = {
2092
2480
  __typename?: 'ProductType';
2093
2481
  color?: Maybe<Scalars['String']['output']>;
@@ -2342,6 +2730,24 @@ declare type RemoveLinks = (links: {
2342
2730
  };
2343
2731
  }[], addToHistory?: boolean) => Promise<void>;
2344
2732
 
2733
+ /**
2734
+ * For react-markdown `p` components: a paragraph that is only an image (how the editor stores
2735
+ * image and video blocks) renders as the block. Returns null for any other paragraph.
2736
+ */
2737
+ export declare const renderMediaParagraph: (props: {
2738
+ node?: HastNode_2;
2739
+ }, { onOpen }?: {
2740
+ onOpen?: (src: string) => void;
2741
+ }) => ReactNode | null;
2742
+
2743
+ /**
2744
+ * For react-markdown `p` components: a paragraph that is only a YouTube link (how the editor
2745
+ * stores videos) renders as the player. Returns null for any other paragraph.
2746
+ */
2747
+ export declare const renderYouTubeParagraph: (props: {
2748
+ node?: HastNode;
2749
+ }) => ReactNode | null;
2750
+
2345
2751
  export declare interface ReportsLoadingScreenProps extends HTMLAttributes<HTMLDivElement> {
2346
2752
  showSidebar?: boolean;
2347
2753
  sidebarConfig?: SidebarConfig;
@@ -2615,7 +3021,7 @@ declare type Scalars = {
2615
3021
 
2616
3022
  declare type Scope = ScopeType | ScopeType[];
2617
3023
 
2618
- declare type ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version';
3024
+ declare type ScopeType = 'folder' | 'product' | 'task' | 'user' | 'version' | 'representation';
2619
3025
 
2620
3026
  declare type ScopeType_2 = ScopeWithFilterTypes['scope'];
2621
3027
 
@@ -2626,6 +3032,21 @@ export declare type ScopeWithFilterTypes = {
2626
3032
 
2627
3033
  declare type SelectedViewState = ViewData | undefined;
2628
3034
 
3035
+ declare type SerializedMediaNode = Spread<{
3036
+ src: string;
3037
+ alt: string;
3038
+ mime: string | null;
3039
+ }, SerializedDecoratorBlockNode>;
3040
+
3041
+ declare type SerializedMentionNode = Spread<{
3042
+ mentionType: string;
3043
+ mentionId: string;
3044
+ }, SerializedTextNode>;
3045
+
3046
+ declare type SerializedYouTubeNode = Spread<{
3047
+ url: string;
3048
+ }, SerializedDecoratorBlockNode>;
3049
+
2629
3050
  declare type SetDefaultViewApiArg = {
2630
3051
  viewType: string;
2631
3052
  projectName?: string;
@@ -2800,6 +3221,26 @@ declare type SlideOut = {
2800
3221
  projectName: string;
2801
3222
  };
2802
3223
 
3224
+ declare interface SortMenuItemArgs<T extends string> {
3225
+ options: SortMenuOption<T>[];
3226
+ sort: SortMenuValue<T>;
3227
+ onChange: (sort: SortMenuValue<T>) => void;
3228
+ id?: string;
3229
+ label?: string;
3230
+ icon?: string;
3231
+ }
3232
+
3233
+ export declare interface SortMenuOption<T extends string = string> {
3234
+ id: T;
3235
+ label: string;
3236
+ desc: boolean;
3237
+ }
3238
+
3239
+ export declare interface SortMenuValue<T extends string = string> {
3240
+ by: T;
3241
+ desc: boolean;
3242
+ }
3243
+
2803
3244
  /**
2804
3245
  * Splits combined Filter objects by their scope and removes the scope prefix from filter IDs.
2805
3246
  * Used to separate multi-scope Filter arrays back into individual scope Filter arrays.
@@ -2945,6 +3386,13 @@ export declare type SubtasksManagerWrapperProps = Omit<SubtasksManagerProps, 'up
2945
3386
  SubtasksManager: React.ComponentType<SubtasksManagerProps>;
2946
3387
  };
2947
3388
 
3389
+ declare type SuggestResponse = {
3390
+ users?: UserSuggestionItem[];
3391
+ teams?: TeamSuggestionItem[];
3392
+ tasks?: TaskSuggestionItem[];
3393
+ versions?: VersionSuggestionItem[];
3394
+ };
3395
+
2948
3396
  export declare const sumExpectedCounts: (counts: ExpectedDeleteCounts) => number;
2949
3397
 
2950
3398
  declare type SummaryCalc = NumberCalc | BooleanCalc | TextCalc | EnumCalc | MainCalc;
@@ -3056,6 +3504,19 @@ declare type TaskProgressViewPostModel = {
3056
3504
  viewType?: 'taskProgress';
3057
3505
  };
3058
3506
 
3507
+ declare type TaskSuggestionItem = {
3508
+ /** The date and time when the suggested entity was created */
3509
+ createdAt?: string;
3510
+ /** The relevance score of the suggestion */
3511
+ relevance?: number;
3512
+ id: string;
3513
+ taskType: string;
3514
+ name: string;
3515
+ label?: string;
3516
+ thumbnailId?: string;
3517
+ parent?: FolderSuggestionItem;
3518
+ };
3519
+
3059
3520
  declare type TaskType = {
3060
3521
  name: string;
3061
3522
  original_name?: string;
@@ -3082,6 +3543,14 @@ declare type TaskType_3 = {
3082
3543
 
3083
3544
  export declare const TEAM_KEY_PREFIX = "team:";
3084
3545
 
3546
+ declare type TeamSuggestionItem = {
3547
+ /** The date and time when the suggested entity was created */
3548
+ createdAt?: string;
3549
+ /** The relevance score of the suggestion */
3550
+ relevance?: number;
3551
+ name: string;
3552
+ };
3553
+
3085
3554
  declare type Templates = {
3086
3555
  version_padding?: number;
3087
3556
  version?: string;
@@ -3135,6 +3604,16 @@ export declare interface ThumbnailSimpleProps extends default_2.HTMLAttributes<H
3135
3604
  iconOnly?: boolean;
3136
3605
  }
3137
3606
 
3607
+ /**
3608
+ * Turn the selected blocks into `format`, or back into paragraphs when they already are.
3609
+ * Used by the toolbar and keyboard shortcuts. `set` only turns them into `format` (slash menu).
3610
+ */
3611
+ export declare const toggleBlockFormat: (editor: LexicalEditor, format: BlockFormat, mode?: "toggle" | "set") => void;
3612
+
3613
+ export declare type ToolbarItem = 'h1' | 'h2' | 'h3' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'link' | 'codeBlock' | 'quote' | 'numberList' | 'bulletList' | 'checkList';
3614
+
3615
+ export declare type ToolbarLayout = (ToolbarItem | '|')[];
3616
+
3138
3617
  declare type TopicUpdateType = 'created' | 'label_changed' | 'renamed' | 'type_changed' | 'status_changed' | 'tags_changed' | 'attrib_changed' | 'deleted';
3139
3618
 
3140
3619
  declare type UpdateEntitiesArgs = {
@@ -3173,6 +3652,12 @@ declare type UpdateViewApiArg = {
3173
3652
 
3174
3653
  declare type UpdateViewSettingsFn = (updatedSettings: any, localStateSetter: (value: any) => void, newLocalValue: any, options: UpdateOptions) => Promise<void>;
3175
3654
 
3655
+ export declare interface UploadedMedia {
3656
+ src: string;
3657
+ name?: string;
3658
+ mime?: string;
3659
+ }
3660
+
3176
3661
  export declare interface UploadHandlers {
3177
3662
  handleFileUpload: (files: FileList | File[], versionId?: string) => Promise<void>;
3178
3663
  handleRemoveUpload: (name: string) => void;
@@ -3181,6 +3666,8 @@ export declare interface UploadHandlers {
3181
3666
  };
3182
3667
  }
3183
3668
 
3669
+ export declare type UploadMedia = (file: File) => Promise<UploadedMedia>;
3670
+
3184
3671
  export declare const UploadVersionDialog: FC<UploadVersionDialogProps>;
3185
3672
 
3186
3673
  declare interface UploadVersionDialogProps {
@@ -3276,6 +3763,15 @@ declare type UserModel = {
3276
3763
  updatedAt?: string;
3277
3764
  };
3278
3765
 
3766
+ declare type UserSuggestionItem = {
3767
+ /** The date and time when the suggested entity was created */
3768
+ createdAt?: string;
3769
+ /** The relevance score of the suggestion */
3770
+ relevance?: number;
3771
+ name: string;
3772
+ fullName?: string;
3773
+ };
3774
+
3279
3775
  export declare const useUpdateLinks: ({ projectName, direction, entityId, entityType, targetEntityType, linkType, }: Props) => {
3280
3776
  remove: RemoveLinks;
3281
3777
  add: AddLinks;
@@ -3490,6 +3986,17 @@ declare type VersionsSettings = {
3490
3986
  columns?: ColumnItemModel[];
3491
3987
  };
3492
3988
 
3989
+ declare type VersionSuggestionItem = {
3990
+ /** The date and time when the suggested entity was created */
3991
+ createdAt?: string;
3992
+ /** The relevance score of the suggestion */
3993
+ relevance?: number;
3994
+ id: string;
3995
+ version: number;
3996
+ parent?: ProductSuggestionItem;
3997
+ name?: string;
3998
+ };
3999
+
3493
4000
  declare type VersionsViewModel = {
3494
4001
  /** Unique identifier for the view within the given scope. */
3495
4002
  id?: string;
@@ -3798,6 +4305,37 @@ declare type WorkTemplate = {
3798
4305
  file: string;
3799
4306
  };
3800
4307
 
4308
+ export declare const YouTubeEmbed: ({ video, className }: YouTubeEmbedProps) => JSX_2.Element;
4309
+
4310
+ declare interface YouTubeEmbedProps {
4311
+ video: YouTubeVideo;
4312
+ className?: string;
4313
+ }
4314
+
4315
+ /**
4316
+ * An embedded YouTube video. Stored in markdown as the video url on its own line, which the
4317
+ * comment renderer shows as the player (and anything else as a link).
4318
+ */
4319
+ export declare class YouTubeNode extends DecoratorBlockNode {
4320
+ __url: string;
4321
+ static getType(): string;
4322
+ static clone(node: YouTubeNode): YouTubeNode;
4323
+ static importJSON(serializedNode: SerializedYouTubeNode): YouTubeNode;
4324
+ constructor(url: string, format?: ElementFormatType, key?: NodeKey);
4325
+ exportJSON(): SerializedYouTubeNode;
4326
+ exportDOM(): DOMExportOutput;
4327
+ static importDOM(): DOMConversionMap | null;
4328
+ updateDOM(): false;
4329
+ getUrl(): string;
4330
+ getTextContent(): string;
4331
+ decorate(_editor: LexicalEditor, config: EditorConfig): JSX_3.Element;
4332
+ }
4333
+
4334
+ declare interface YouTubeVideo {
4335
+ id: string;
4336
+ start?: number;
4337
+ }
4338
+
3801
4339
 
3802
4340
  export * from "primereact/confirmdialog";
3803
4341