@ynput/ayon-frontend-shared 0.6.8 → 0.6.9

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.
@@ -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[];
@@ -503,6 +542,12 @@ declare interface ContextMenuItemType extends Omit<ContextMenuItemProps, 'contex
503
542
  [key: string]: any;
504
543
  }
505
544
 
545
+ /**
546
+ * Mention source backed by the activity feed's mention suggestions (`useGetEntityMentionsQuery`),
547
+ * using the same option builders and sorting as the legacy comment input.
548
+ */
549
+ export declare const createFeedMentionSource: ({ suggestions, project, taskTypes, entityType, }: FeedMentionSourceOptions) => MentionSource;
550
+
506
551
  declare type CreateViewApiArg = {
507
552
  viewType: string;
508
553
  projectName?: string;
@@ -608,6 +653,8 @@ export declare interface DateRangePickerProps {
608
653
 
609
654
  export declare const DEFAULT_FEATURED_ORDER: string[];
610
655
 
656
+ export declare const DEFAULT_TOOLBAR: ToolbarLayout;
657
+
611
658
  declare type DefaultProductBaseType_2 = {
612
659
  color?: string;
613
660
  icon?: string;
@@ -669,6 +716,8 @@ declare type DeliveryTemplate = {
669
716
  file: string;
670
717
  };
671
718
 
719
+ export declare const DESCRIPTION_TOOLBAR: ToolbarLayout;
720
+
672
721
  declare interface DescriptionMentionsContext {
673
722
  projectName: string;
674
723
  entityType: string;
@@ -947,6 +996,15 @@ declare interface EarlyPreviewProps extends React.HTMLAttributes<HTMLDivElement>
947
996
 
948
997
  declare type EditingViewState = string | true | null;
949
998
 
999
+ export declare interface EditorCommand {
1000
+ id: string;
1001
+ label: string;
1002
+ icon: string;
1003
+ keywords?: string[];
1004
+ hint?: string;
1005
+ run: () => void;
1006
+ }
1007
+
950
1008
  export declare const EmptyPlaceholder: FC<EmptyPlaceholderProps>;
951
1009
 
952
1010
  export declare const EmptyPlaceholderFlex: IStyledComponentBase<"web", FastOmit<EmptyPlaceholderProps, never> & Partial<Pick< EmptyPlaceholderProps, never>>> & string & Omit< FC<EmptyPlaceholderProps>, keyof Component<any, {}, any>>;
@@ -1245,6 +1303,13 @@ declare type FeedFrameLinkPreview = {
1245
1303
  link: CommentFrameLink | null;
1246
1304
  };
1247
1305
 
1306
+ declare interface FeedMentionSourceOptions {
1307
+ suggestions?: SuggestResponse;
1308
+ project?: Pick<ProjectContextValue, 'productTypes'>;
1309
+ taskTypes?: TaskType_3[];
1310
+ entityType?: string;
1311
+ }
1312
+
1248
1313
  export declare const FieldLabel: default_2.FC<FieldLabelProps>;
1249
1314
 
1250
1315
  declare interface FieldLabelProps extends default_2.HTMLAttributes<HTMLDivElement> {
@@ -1334,6 +1399,8 @@ export declare interface FilterErrorActionsProps {
1334
1399
 
1335
1400
  export declare type FilterFieldType = 'folderType' | 'taskType' | 'productType' | 'productBaseType' | ('users' | 'assignees' | 'author') | 'attributes' | 'status' | 'tags' | 'version' | 'hasReviewables' | 'productName' | 'name' | 'createdAt' | 'updatedAt';
1336
1401
 
1402
+ export declare const FLOATING_TOOLBAR: ToolbarLayout;
1403
+
1337
1404
  declare type FolderDeleteInfo = {
1338
1405
  id: string;
1339
1406
  name: string;
@@ -1360,6 +1427,18 @@ declare interface FolderProduct {
1360
1427
  } | null;
1361
1428
  }
1362
1429
 
1430
+ declare type FolderSuggestionItem = {
1431
+ /** The date and time when the suggested entity was created */
1432
+ createdAt?: string;
1433
+ /** The relevance score of the suggestion */
1434
+ relevance?: number;
1435
+ id: string;
1436
+ folderType: string;
1437
+ name: string;
1438
+ label?: string;
1439
+ thumbnailId?: string;
1440
+ };
1441
+
1363
1442
  declare type FolderType = {
1364
1443
  name: string;
1365
1444
  original_name?: string;
@@ -1552,6 +1631,39 @@ export declare const getGroupedReviewables: (reviewables: ReviewableResponse[],
1552
1631
  queued: ReviewableResponse[];
1553
1632
  };
1554
1633
 
1634
+ /**
1635
+ * Ids of the project files shown as image / video blocks in the markdown. Only standalone media
1636
+ * images count, not file urls in prose, links or code blocks.
1637
+ */
1638
+ export declare const getInlineMediaFileIds: (markdown?: string | null) => Set<string>;
1639
+
1640
+ /**
1641
+ * A short label for a link to a well known site, made only from the url (nothing is fetched),
1642
+ * e.g. `https://github.com/ynput/ayon-frontend/issues/2342` → `ayon-frontend #2342`.
1643
+ * Returns null for urls without a known structure, which keep the url as their text.
1644
+ */
1645
+ export declare const getLinkLabel: (href: string) => string | null;
1646
+
1647
+ /**
1648
+ * Image or video, from the mime type (written as the markdown image title by the editor) or else
1649
+ * the file extension of the url / name. Defaults to image, markdown images are images.
1650
+ */
1651
+ export declare const getMediaKind: (mime?: string | null, ...names: (string | null | undefined)[]) => "video" | "image";
1652
+
1653
+ export declare const getMentionTrigger: (type: string) => MentionTrigger;
1654
+
1655
+ export declare const getProjectFileId: (src?: string | null) => string | null;
1656
+
1657
+ /**
1658
+ * The link a duplicated comment keeps to the comment it was copied from:
1659
+ * `source:{activityId}?type={entityType}&id={entityId}`. The entity is the one the source comment
1660
+ * belongs to, which can differ from the entity the copy is posted on.
1661
+ */
1662
+ export declare const getSourceLink: (activityId: string, entity?: {
1663
+ id: string;
1664
+ type: string;
1665
+ }) => string;
1666
+
1555
1667
  export declare const getUiTypeLabel: (type: AttributeData_2["type"] | undefined, enumValues?: AttributeData_2["enum"], enumResolver?: AttributeData_2["enumResolver"]) => string;
1556
1668
 
1557
1669
  declare type GetViewApiArg = {
@@ -1599,6 +1711,28 @@ export declare const groupLinksByEntity: (links: LinkEntity[]) => GroupedLink[];
1599
1711
 
1600
1712
  export declare const GUEST_KEY_PREFIX = "guest:";
1601
1713
 
1714
+ declare interface HastNode {
1715
+ type: string;
1716
+ tagName?: string;
1717
+ value?: string;
1718
+ properties?: {
1719
+ href?: string;
1720
+ };
1721
+ children?: HastNode[];
1722
+ }
1723
+
1724
+ declare interface HastNode_2 {
1725
+ type: string;
1726
+ tagName?: string;
1727
+ value?: string;
1728
+ properties?: {
1729
+ src?: string;
1730
+ alt?: string;
1731
+ title?: string;
1732
+ };
1733
+ children?: HastNode_2[];
1734
+ }
1735
+
1602
1736
  export declare interface HeightSliderProps {
1603
1737
  value: number;
1604
1738
  onChange: (value: number) => void;
@@ -1668,6 +1802,10 @@ declare const InputText: IStyledComponentBase<"web", FastOmit<Omit< InputHTMLAtt
1668
1802
  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
1803
  }, never>>> & string & Omit< ForwardRefExoticComponent< InputHTMLAttributes<HTMLInputElement> & RefAttributes<HTMLInputElement>>, keyof Component<any, {}, any>>;
1670
1804
 
1805
+ export declare const INSERT_MENTION_TRIGGER_COMMAND: LexicalCommand<MentionTrigger>;
1806
+
1807
+ export declare const isMediaFile: (file: File) => boolean;
1808
+
1671
1809
  export declare const JsonViewer: FC<JsonViewerProps>;
1672
1810
 
1673
1811
  export declare interface JsonViewerProps {
@@ -1838,8 +1976,204 @@ declare type ListViewsApiArg = {
1838
1976
 
1839
1977
  declare type MainCalc = 'count' | 'breakdown';
1840
1978
 
1979
+ export declare const MARKDOWN_TRANSFORMERS: Transformer_2[];
1980
+
1981
+ /**
1982
+ * Rich text editor that reads and writes markdown.
1983
+ * Supports text formats, links, lists, check lists, quotes, inline code and code blocks and
1984
+ * mentions (`@user`, `@@version`, `@@@task`) stored as `[label](type:id)`.
1985
+ */
1986
+ export declare const MarkdownEditor: ForwardRefExoticComponent<MarkdownEditorProps & RefAttributes<MarkdownEditorHandle>>;
1987
+
1988
+ export declare interface MarkdownEditorHandle {
1989
+ getEditor: () => LexicalEditor;
1990
+ focus: () => void;
1991
+ blur: () => void;
1992
+ getMarkdown: () => string;
1993
+ setMarkdown: (markdown: string) => void;
1994
+ clear: () => void;
1995
+ isEmpty: () => boolean;
1996
+ insertMentionTrigger: (trigger: MentionTrigger) => void;
1997
+ }
1998
+
1999
+ export declare interface MarkdownEditorProps extends MentionEventHandlers {
2000
+ variant?: MarkdownEditorVariant;
2001
+ value?: string;
2002
+ onChange?: (markdown: string) => void;
2003
+ placeholder?: string;
2004
+ onSubmit?: () => void;
2005
+ submitOnEnter?: boolean;
2006
+ onEscape?: () => void;
2007
+ onFiles?: (files: File[]) => void;
2008
+ onUploadMedia?: UploadMedia;
2009
+ mentions?: MentionSource;
2010
+ mentionMenuParent?: HTMLElement;
2011
+ mentionPlacement?: MentionPlacement;
2012
+ emoji?: boolean;
2013
+ slashCommands?: boolean;
2014
+ commands?: EditorCommand[];
2015
+ toolbar?: boolean | ToolbarLayout;
2016
+ floatingToolbar?: boolean | ToolbarLayout;
2017
+ toolbarStart?: ReactNode;
2018
+ toolbarEnd?: ReactNode;
2019
+ footer?: ReactNode;
2020
+ actions?: ReactNode;
2021
+ autoFocus?: boolean;
2022
+ readOnly?: boolean;
2023
+ bordered?: boolean;
2024
+ minHeight?: number;
2025
+ maxHeight?: number;
2026
+ namespace?: string;
2027
+ className?: string;
2028
+ style?: CSSProperties;
2029
+ contentClassName?: string;
2030
+ children?: ReactNode;
2031
+ }
2032
+
2033
+ export declare type MarkdownEditorVariant = 'document' | 'message';
2034
+
2035
+ /**
2036
+ * Markdown as one line of plain text, e.g. for a summary of a description change. Mentions and
2037
+ * links become their label, images their name, and formatting, block markers and line breaks go.
2038
+ */
2039
+ export declare const markdownToPlainText: (markdown: string) => string;
2040
+
1841
2041
  declare type Maybe<T> = T | null;
1842
2042
 
2043
+ export declare const MediaBlock: ({ src, alt, mime, uploading, onOpen, className }: MediaBlockProps) => JSX_2.Element;
2044
+
2045
+ declare interface MediaBlockProps {
2046
+ src: string;
2047
+ alt?: string;
2048
+ mime?: string | null;
2049
+ uploading?: boolean;
2050
+ onOpen?: () => void;
2051
+ className?: string;
2052
+ }
2053
+
2054
+ /**
2055
+ * An image or video block. Stored in markdown as an image on its own line with the mime type as
2056
+ * its title: `![clip.mp4](/api/projects/p/files/id "video/mp4")`.
2057
+ */
2058
+ export declare class MediaNode extends DecoratorBlockNode {
2059
+ __src: string;
2060
+ __alt: string;
2061
+ __mime: string | null;
2062
+ __uploading: boolean;
2063
+ static getType(): string;
2064
+ static clone(node: MediaNode): MediaNode;
2065
+ static importJSON(serializedNode: SerializedMediaNode): MediaNode;
2066
+ constructor(payload: MediaPayload, format?: ElementFormatType, key?: NodeKey);
2067
+ exportJSON(): SerializedMediaNode;
2068
+ exportDOM(): DOMExportOutput;
2069
+ static importDOM(): DOMConversionMap | null;
2070
+ updateDOM(): false;
2071
+ getSrc(): string;
2072
+ getAlt(): string;
2073
+ getMime(): string | null;
2074
+ isUploading(): boolean;
2075
+ setUploaded(src: string, { alt, mime }?: {
2076
+ alt?: string;
2077
+ mime?: string | null;
2078
+ }): this;
2079
+ getTextContent(): string;
2080
+ decorate(_editor: LexicalEditor, config: EditorConfig): JSX_3.Element;
2081
+ }
2082
+
2083
+ declare interface MediaPayload {
2084
+ src: string;
2085
+ alt?: string;
2086
+ mime?: string | null;
2087
+ uploading?: boolean;
2088
+ }
2089
+
2090
+ export declare const MENTION: TextMatchTransformer;
2091
+
2092
+ export declare const MENTION_REF_TYPES: readonly ["user", "team", "task", "version", "folder", "representation", "workfile", "product"];
2093
+
2094
+ export declare const MENTION_TRIGGER_BY_TYPE: Record<string, MentionTrigger>;
2095
+
2096
+ export declare interface MentionEventHandlers {
2097
+ onMentionClick?: (mention: {
2098
+ type: string;
2099
+ id: string;
2100
+ label: string;
2101
+ }, e: MouseEvent) => void;
2102
+ onMentionHover?: (mention: {
2103
+ type: string;
2104
+ id: string;
2105
+ label: string;
2106
+ }, target: HTMLElement) => void;
2107
+ }
2108
+
2109
+ export declare interface MentionFilter {
2110
+ id: string;
2111
+ icon: string;
2112
+ tooltip: string;
2113
+ }
2114
+
2115
+ export declare interface MentionItem {
2116
+ type: string;
2117
+ id: string;
2118
+ label: string;
2119
+ icon?: string;
2120
+ color?: string;
2121
+ context?: string;
2122
+ suffix?: string;
2123
+ }
2124
+
2125
+ /**
2126
+ * An inline reference to a user, team, task, version... rendered as `@label` and stored in
2127
+ * markdown as `[label](type:id)`. It is a token so it can only be selected and deleted as a whole.
2128
+ */
2129
+ export declare class MentionNode extends TextNode {
2130
+ __mentionType: string;
2131
+ __mentionId: string;
2132
+ static getType(): string;
2133
+ static clone(node: MentionNode): MentionNode;
2134
+ static importJSON(serializedNode: SerializedMentionNode): MentionNode;
2135
+ constructor(mentionType: string, mentionId: string, text: string, key?: NodeKey);
2136
+ exportJSON(): SerializedMentionNode;
2137
+ getMentionType(): string;
2138
+ getMentionId(): string;
2139
+ getLabel(): string;
2140
+ getMentionValue(): string;
2141
+ createDOM(config: EditorConfig): HTMLElement;
2142
+ exportDOM(): DOMExportOutput;
2143
+ static importDOM(): DOMConversionMap | null;
2144
+ isTextEntity(): true;
2145
+ canInsertTextBefore(): boolean;
2146
+ canInsertTextAfter(): boolean;
2147
+ }
2148
+
2149
+ export declare type MentionPlacement = 'inline' | 'top';
2150
+
2151
+ export declare interface MentionQuery {
2152
+ trigger: MentionTrigger;
2153
+ search: string;
2154
+ filter: string | null;
2155
+ }
2156
+
2157
+ export declare type MentionRefType = (typeof MENTION_REF_TYPES)[number];
2158
+
2159
+ export declare interface MentionSource {
2160
+ triggers?: MentionTrigger[];
2161
+ config?: Partial<Record<MentionTrigger, Partial<MentionTriggerConfig>>>;
2162
+ getOptions: (query: MentionQuery) => MentionItem[];
2163
+ getError?: (trigger: MentionTrigger) => string | null | undefined;
2164
+ limit?: number;
2165
+ renderOptionImage?: (option: MentionItem) => ReactNode;
2166
+ }
2167
+
2168
+ export declare type MentionTrigger = '@' | '@@' | '@@@';
2169
+
2170
+ export declare interface MentionTriggerConfig {
2171
+ title: string;
2172
+ noun: string;
2173
+ isCircle?: boolean;
2174
+ filters?: MentionFilter[];
2175
+ }
2176
+
1843
2177
  export declare const Menu: default_2.FC<MenuProps>;
1844
2178
 
1845
2179
  export declare const MENU_PORTAL_CONTENT_ID = "ayon-menu-content";
@@ -1931,6 +2265,15 @@ export declare type NormalizedData = {
1931
2265
  icon?: string;
1932
2266
  };
1933
2267
 
2268
+ /**
2269
+ * Clean up markdown written by the legacy quill editor:
2270
+ * - quill wrote every line as its own paragraph and blank lines as `&nbsp;` spacer paragraphs.
2271
+ * When spacers are found, paragraphs next to each other become lines of one paragraph and the
2272
+ * spacers become paragraph breaks.
2273
+ * - `<u>` tags are dropped (markdown has no underline)
2274
+ */
2275
+ export declare const normalizeLegacyMarkdown: (markdown: string) => string;
2276
+
1934
2277
  declare type NullableString = string | null | undefined;
1935
2278
 
1936
2279
  declare type NumberCalc = 'sum' | 'avg' | 'min' | 'max' | 'none';
@@ -2025,8 +2368,36 @@ declare type ParentColumnDefinition = {
2025
2368
 
2026
2369
  declare type ParentColumnOptionKey = 'status' | 'folderStatus' | 'folderType' | 'taskType' | 'taskStatus' | 'productType' | 'assignee' | 'tag';
2027
2370
 
2371
+ export declare const parseActivityLink: (href?: string | null) => ParsedActivityLink | null;
2372
+
2373
+ /**
2374
+ * A link to a comment (any activity) on this server: `/projects/{project}/...?activity={id}`, as
2375
+ * made by a comment's "Copy link", or a source link (`getSourceLink`).
2376
+ * Links to other servers stay links.
2377
+ */
2378
+ declare type ParsedActivityLink = {
2379
+ activityId: string;
2380
+ entity: {
2381
+ id: string;
2382
+ type: string;
2383
+ } | null;
2384
+ isSource: true;
2385
+ } | {
2386
+ projectName: string;
2387
+ activityId: string;
2388
+ entityId: string | null;
2389
+ isSource: false;
2390
+ url: string;
2391
+ };
2392
+
2028
2393
  export declare const parseFilename: (filename: string) => string;
2029
2394
 
2395
+ /**
2396
+ * The video of a YouTube url, e.g. youtube.com/watch?v=ID, youtu.be/ID, youtube.com/shorts/ID,
2397
+ * youtube.com/embed/ID or youtube.com/live/ID. Null for anything else.
2398
+ */
2399
+ export declare const parseYouTubeUrl: (value: string) => YouTubeVideo | null;
2400
+
2030
2401
  declare type PartialBy<T, K extends keyof T> = Omit_2<T, K> & Partial<Pick<T, K>>;
2031
2402
 
2032
2403
  export declare type PathSegment = {
@@ -2088,6 +2459,17 @@ declare type ProductBaseTypes = {
2088
2459
  definitions?: ProductBaseType[];
2089
2460
  };
2090
2461
 
2462
+ declare type ProductSuggestionItem = {
2463
+ /** The date and time when the suggested entity was created */
2464
+ createdAt?: string;
2465
+ /** The relevance score of the suggestion */
2466
+ relevance?: number;
2467
+ id: string;
2468
+ name: string;
2469
+ productType: string;
2470
+ parent?: FolderSuggestionItem;
2471
+ };
2472
+
2091
2473
  declare type ProductType = {
2092
2474
  __typename?: 'ProductType';
2093
2475
  color?: Maybe<Scalars['String']['output']>;
@@ -2342,6 +2724,24 @@ declare type RemoveLinks = (links: {
2342
2724
  };
2343
2725
  }[], addToHistory?: boolean) => Promise<void>;
2344
2726
 
2727
+ /**
2728
+ * For react-markdown `p` components: a paragraph that is only an image (how the editor stores
2729
+ * image and video blocks) renders as the block. Returns null for any other paragraph.
2730
+ */
2731
+ export declare const renderMediaParagraph: (props: {
2732
+ node?: HastNode_2;
2733
+ }, { onOpen }?: {
2734
+ onOpen?: (src: string) => void;
2735
+ }) => ReactNode | null;
2736
+
2737
+ /**
2738
+ * For react-markdown `p` components: a paragraph that is only a YouTube link (how the editor
2739
+ * stores videos) renders as the player. Returns null for any other paragraph.
2740
+ */
2741
+ export declare const renderYouTubeParagraph: (props: {
2742
+ node?: HastNode;
2743
+ }) => ReactNode | null;
2744
+
2345
2745
  export declare interface ReportsLoadingScreenProps extends HTMLAttributes<HTMLDivElement> {
2346
2746
  showSidebar?: boolean;
2347
2747
  sidebarConfig?: SidebarConfig;
@@ -2626,6 +3026,21 @@ export declare type ScopeWithFilterTypes = {
2626
3026
 
2627
3027
  declare type SelectedViewState = ViewData | undefined;
2628
3028
 
3029
+ declare type SerializedMediaNode = Spread<{
3030
+ src: string;
3031
+ alt: string;
3032
+ mime: string | null;
3033
+ }, SerializedDecoratorBlockNode>;
3034
+
3035
+ declare type SerializedMentionNode = Spread<{
3036
+ mentionType: string;
3037
+ mentionId: string;
3038
+ }, SerializedTextNode>;
3039
+
3040
+ declare type SerializedYouTubeNode = Spread<{
3041
+ url: string;
3042
+ }, SerializedDecoratorBlockNode>;
3043
+
2629
3044
  declare type SetDefaultViewApiArg = {
2630
3045
  viewType: string;
2631
3046
  projectName?: string;
@@ -2945,6 +3360,13 @@ export declare type SubtasksManagerWrapperProps = Omit<SubtasksManagerProps, 'up
2945
3360
  SubtasksManager: React.ComponentType<SubtasksManagerProps>;
2946
3361
  };
2947
3362
 
3363
+ declare type SuggestResponse = {
3364
+ users?: UserSuggestionItem[];
3365
+ teams?: TeamSuggestionItem[];
3366
+ tasks?: TaskSuggestionItem[];
3367
+ versions?: VersionSuggestionItem[];
3368
+ };
3369
+
2948
3370
  export declare const sumExpectedCounts: (counts: ExpectedDeleteCounts) => number;
2949
3371
 
2950
3372
  declare type SummaryCalc = NumberCalc | BooleanCalc | TextCalc | EnumCalc | MainCalc;
@@ -3056,6 +3478,19 @@ declare type TaskProgressViewPostModel = {
3056
3478
  viewType?: 'taskProgress';
3057
3479
  };
3058
3480
 
3481
+ declare type TaskSuggestionItem = {
3482
+ /** The date and time when the suggested entity was created */
3483
+ createdAt?: string;
3484
+ /** The relevance score of the suggestion */
3485
+ relevance?: number;
3486
+ id: string;
3487
+ taskType: string;
3488
+ name: string;
3489
+ label?: string;
3490
+ thumbnailId?: string;
3491
+ parent?: FolderSuggestionItem;
3492
+ };
3493
+
3059
3494
  declare type TaskType = {
3060
3495
  name: string;
3061
3496
  original_name?: string;
@@ -3082,6 +3517,14 @@ declare type TaskType_3 = {
3082
3517
 
3083
3518
  export declare const TEAM_KEY_PREFIX = "team:";
3084
3519
 
3520
+ declare type TeamSuggestionItem = {
3521
+ /** The date and time when the suggested entity was created */
3522
+ createdAt?: string;
3523
+ /** The relevance score of the suggestion */
3524
+ relevance?: number;
3525
+ name: string;
3526
+ };
3527
+
3085
3528
  declare type Templates = {
3086
3529
  version_padding?: number;
3087
3530
  version?: string;
@@ -3135,6 +3578,16 @@ export declare interface ThumbnailSimpleProps extends default_2.HTMLAttributes<H
3135
3578
  iconOnly?: boolean;
3136
3579
  }
3137
3580
 
3581
+ /**
3582
+ * Turn the selected blocks into `format`, or back into paragraphs when they already are.
3583
+ * Used by the toolbar and keyboard shortcuts. `set` only turns them into `format` (slash menu).
3584
+ */
3585
+ export declare const toggleBlockFormat: (editor: LexicalEditor, format: BlockFormat, mode?: "toggle" | "set") => void;
3586
+
3587
+ export declare type ToolbarItem = 'h1' | 'h2' | 'h3' | 'bold' | 'italic' | 'strikethrough' | 'code' | 'link' | 'codeBlock' | 'quote' | 'numberList' | 'bulletList' | 'checkList';
3588
+
3589
+ export declare type ToolbarLayout = (ToolbarItem | '|')[];
3590
+
3138
3591
  declare type TopicUpdateType = 'created' | 'label_changed' | 'renamed' | 'type_changed' | 'status_changed' | 'tags_changed' | 'attrib_changed' | 'deleted';
3139
3592
 
3140
3593
  declare type UpdateEntitiesArgs = {
@@ -3173,6 +3626,12 @@ declare type UpdateViewApiArg = {
3173
3626
 
3174
3627
  declare type UpdateViewSettingsFn = (updatedSettings: any, localStateSetter: (value: any) => void, newLocalValue: any, options: UpdateOptions) => Promise<void>;
3175
3628
 
3629
+ export declare interface UploadedMedia {
3630
+ src: string;
3631
+ name?: string;
3632
+ mime?: string;
3633
+ }
3634
+
3176
3635
  export declare interface UploadHandlers {
3177
3636
  handleFileUpload: (files: FileList | File[], versionId?: string) => Promise<void>;
3178
3637
  handleRemoveUpload: (name: string) => void;
@@ -3181,6 +3640,8 @@ export declare interface UploadHandlers {
3181
3640
  };
3182
3641
  }
3183
3642
 
3643
+ export declare type UploadMedia = (file: File) => Promise<UploadedMedia>;
3644
+
3184
3645
  export declare const UploadVersionDialog: FC<UploadVersionDialogProps>;
3185
3646
 
3186
3647
  declare interface UploadVersionDialogProps {
@@ -3276,6 +3737,15 @@ declare type UserModel = {
3276
3737
  updatedAt?: string;
3277
3738
  };
3278
3739
 
3740
+ declare type UserSuggestionItem = {
3741
+ /** The date and time when the suggested entity was created */
3742
+ createdAt?: string;
3743
+ /** The relevance score of the suggestion */
3744
+ relevance?: number;
3745
+ name: string;
3746
+ fullName?: string;
3747
+ };
3748
+
3279
3749
  export declare const useUpdateLinks: ({ projectName, direction, entityId, entityType, targetEntityType, linkType, }: Props) => {
3280
3750
  remove: RemoveLinks;
3281
3751
  add: AddLinks;
@@ -3490,6 +3960,17 @@ declare type VersionsSettings = {
3490
3960
  columns?: ColumnItemModel[];
3491
3961
  };
3492
3962
 
3963
+ declare type VersionSuggestionItem = {
3964
+ /** The date and time when the suggested entity was created */
3965
+ createdAt?: string;
3966
+ /** The relevance score of the suggestion */
3967
+ relevance?: number;
3968
+ id: string;
3969
+ version: number;
3970
+ parent?: ProductSuggestionItem;
3971
+ name?: string;
3972
+ };
3973
+
3493
3974
  declare type VersionsViewModel = {
3494
3975
  /** Unique identifier for the view within the given scope. */
3495
3976
  id?: string;
@@ -3798,6 +4279,37 @@ declare type WorkTemplate = {
3798
4279
  file: string;
3799
4280
  };
3800
4281
 
4282
+ export declare const YouTubeEmbed: ({ video, className }: YouTubeEmbedProps) => JSX_2.Element;
4283
+
4284
+ declare interface YouTubeEmbedProps {
4285
+ video: YouTubeVideo;
4286
+ className?: string;
4287
+ }
4288
+
4289
+ /**
4290
+ * An embedded YouTube video. Stored in markdown as the video url on its own line, which the
4291
+ * comment renderer shows as the player (and anything else as a link).
4292
+ */
4293
+ export declare class YouTubeNode extends DecoratorBlockNode {
4294
+ __url: string;
4295
+ static getType(): string;
4296
+ static clone(node: YouTubeNode): YouTubeNode;
4297
+ static importJSON(serializedNode: SerializedYouTubeNode): YouTubeNode;
4298
+ constructor(url: string, format?: ElementFormatType, key?: NodeKey);
4299
+ exportJSON(): SerializedYouTubeNode;
4300
+ exportDOM(): DOMExportOutput;
4301
+ static importDOM(): DOMConversionMap | null;
4302
+ updateDOM(): false;
4303
+ getUrl(): string;
4304
+ getTextContent(): string;
4305
+ decorate(_editor: LexicalEditor, config: EditorConfig): JSX_3.Element;
4306
+ }
4307
+
4308
+ declare interface YouTubeVideo {
4309
+ id: string;
4310
+ start?: number;
4311
+ }
4312
+
3801
4313
 
3802
4314
  export * from "primereact/confirmdialog";
3803
4315