@appquality/unguess-design-system 3.1.91-beta-attachments → 3.1.93-beta-attachments

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.
package/build/index.js CHANGED
@@ -2370,10 +2370,13 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2370
2370
  });
2371
2371
  }
2372
2372
  },
2373
- clearThumbnails: () => {
2374
- if (editor)
2373
+ clearInput: () => {
2374
+ if (editor && !editor.isEmpty) {
2375
+ editor.commands.clearContent();
2376
+ }
2377
+ if (thumbnails.length > 0)
2375
2378
  setThumbnails([]);
2376
- console.log("thumbnails cleared", thumbnails);
2379
+ console.log("thumbnails clear triggered", thumbnails);
2377
2380
  },
2378
2381
  removeThumbnail: (index) => setThumbnails(thumbnails.filter((_, i) => i !== index)),
2379
2382
  triggerSave: () => {
@@ -2381,7 +2384,7 @@ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, childr
2381
2384
  onSave(editor, getMentions(editor));
2382
2385
  editor.commands.clearContent();
2383
2386
  setThumbnails([]);
2384
- console.log("thumbnails cleared", thumbnails);
2387
+ console.log("save triggered", thumbnails);
2385
2388
  }
2386
2389
  },
2387
2390
  mentionableUsers: setMentionableUsers,
@@ -4687,12 +4690,12 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
4687
4690
  });
4688
4691
  return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => {
4689
4692
  // Check if item is an image or a video
4690
- if (file.type.includes('image'))
4691
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4693
+ if (file.type.includes("image"))
4694
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(ImageThumbnail, { src: file.url, index: index, showX: false, isLoadingMedia: false, clickThumbnail: () => {
4692
4695
  handleClickThumbnail(file, index);
4693
4696
  } }, index) })));
4694
- if (file.type.includes('video'))
4695
- return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: true, isLoadingMedia: false, clickThumbnail: () => {
4697
+ if (file.type.includes("video"))
4698
+ return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: false, isLoadingMedia: false, clickThumbnail: () => {
4696
4699
  handleClickThumbnail(file, index);
4697
4700
  } }, index) })));
4698
4701
  return null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ButtonArgs } from "./_types";
2
3
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
3
4
  export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
@@ -8,18 +8,18 @@ export declare const variants: readonly [{}, {
8
8
  readonly disabled: true;
9
9
  }];
10
10
  export declare const Row: import("styled-components").IStyledComponent<"web", {
11
- alignItems?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
12
- alignItemsXs?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
13
- alignItemsSm?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
14
- alignItemsMd?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
15
- alignItemsLg?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
16
- alignItemsXl?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
17
- justifyContent?: "start" | "center" | "end" | "between" | "around" | undefined;
18
- justifyContentXs?: "start" | "center" | "end" | "between" | "around" | undefined;
19
- justifyContentSm?: "start" | "center" | "end" | "between" | "around" | undefined;
20
- justifyContentMd?: "start" | "center" | "end" | "between" | "around" | undefined;
21
- justifyContentLg?: "start" | "center" | "end" | "between" | "around" | undefined;
22
- justifyContentXl?: "start" | "center" | "end" | "between" | "around" | undefined;
11
+ alignItems?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "start" | "end" | "center" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "start" | "end" | "center" | "between" | "around" | undefined;
18
+ justifyContentXs?: "start" | "end" | "center" | "between" | "around" | undefined;
19
+ justifyContentSm?: "start" | "end" | "center" | "between" | "around" | undefined;
20
+ justifyContentMd?: "start" | "end" | "center" | "between" | "around" | undefined;
21
+ justifyContentLg?: "start" | "end" | "center" | "between" | "around" | undefined;
22
+ justifyContentXl?: "start" | "end" | "center" | "between" | "around" | undefined;
23
23
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
24
24
  wrapXs?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
25
25
  wrapSm?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
@@ -33,7 +33,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
33
33
  accessKey?: string | undefined;
34
34
  autoFocus?: boolean | undefined;
35
35
  className?: string | undefined;
36
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
36
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
37
37
  contextMenu?: string | undefined;
38
38
  dir?: string | undefined;
39
39
  draggable?: (boolean | "true" | "false") | undefined;
@@ -73,7 +73,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
73
73
  results?: number | undefined;
74
74
  security?: string | undefined;
75
75
  unselectable?: "on" | "off" | undefined;
76
- inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
76
+ inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -84,7 +84,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
84
84
  "aria-colindex"?: number | undefined;
85
85
  "aria-colspan"?: number | undefined;
86
86
  "aria-controls"?: string | undefined;
87
- "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
87
+ "aria-current"?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
88
88
  "aria-describedby"?: string | undefined;
89
89
  "aria-details"?: string | undefined;
90
90
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -93,7 +93,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
93
93
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
94
94
  "aria-flowto"?: string | undefined;
95
95
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
96
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
96
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
97
97
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
98
98
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
99
99
  "aria-keyshortcuts"?: string | undefined;
@@ -110,7 +110,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
110
110
  "aria-posinset"?: number | undefined;
111
111
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
112
112
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
113
- "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
113
+ "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
114
114
  "aria-required"?: (boolean | "true" | "false") | undefined;
115
115
  "aria-roledescription"?: string | undefined;
116
116
  "aria-rowcount"?: number | undefined;
@@ -299,18 +299,18 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
299
299
  md?: string | number | boolean | undefined;
300
300
  lg?: string | number | boolean | undefined;
301
301
  xl?: string | number | boolean | undefined;
302
- alignSelf?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
- alignSelfXs?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
- alignSelfSm?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
- alignSelfMd?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
- alignSelfLg?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
- alignSelfXl?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
- textAlign?: "start" | "center" | "end" | "justify" | undefined;
309
- textAlignXs?: "start" | "center" | "end" | "justify" | undefined;
310
- textAlignSm?: "start" | "center" | "end" | "justify" | undefined;
311
- textAlignMd?: "start" | "center" | "end" | "justify" | undefined;
312
- textAlignLg?: "start" | "center" | "end" | "justify" | undefined;
313
- textAlignXl?: "start" | "center" | "end" | "justify" | undefined;
302
+ alignSelf?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
303
+ alignSelfXs?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
304
+ alignSelfSm?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
305
+ alignSelfMd?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
306
+ alignSelfLg?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
307
+ alignSelfXl?: "start" | "end" | "center" | "baseline" | "stretch" | "auto" | undefined;
308
+ textAlign?: "start" | "end" | "center" | "justify" | undefined;
309
+ textAlignXs?: "start" | "end" | "center" | "justify" | undefined;
310
+ textAlignSm?: "start" | "end" | "center" | "justify" | undefined;
311
+ textAlignMd?: "start" | "end" | "center" | "justify" | undefined;
312
+ textAlignLg?: "start" | "end" | "center" | "justify" | undefined;
313
+ textAlignXl?: "start" | "end" | "center" | "justify" | undefined;
314
314
  offset?: string | number | undefined;
315
315
  offsetXs?: string | number | undefined;
316
316
  offsetSm?: string | number | undefined;
@@ -330,7 +330,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
330
330
  accessKey?: string | undefined;
331
331
  autoFocus?: boolean | undefined;
332
332
  className?: string | undefined;
333
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
333
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
334
334
  contextMenu?: string | undefined;
335
335
  dir?: string | undefined;
336
336
  draggable?: (boolean | "true" | "false") | undefined;
@@ -370,7 +370,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
370
370
  results?: number | undefined;
371
371
  security?: string | undefined;
372
372
  unselectable?: "on" | "off" | undefined;
373
- inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
373
+ inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
374
374
  is?: string | undefined;
375
375
  "aria-activedescendant"?: string | undefined;
376
376
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -381,7 +381,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
381
381
  "aria-colindex"?: number | undefined;
382
382
  "aria-colspan"?: number | undefined;
383
383
  "aria-controls"?: string | undefined;
384
- "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
384
+ "aria-current"?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
385
385
  "aria-describedby"?: string | undefined;
386
386
  "aria-details"?: string | undefined;
387
387
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -390,7 +390,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
390
390
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
391
391
  "aria-flowto"?: string | undefined;
392
392
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
393
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
393
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
394
394
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
395
395
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
396
396
  "aria-keyshortcuts"?: string | undefined;
@@ -407,7 +407,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
407
407
  "aria-posinset"?: number | undefined;
408
408
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
409
409
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
410
- "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
410
+ "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
411
411
  "aria-required"?: (boolean | "true" | "false") | undefined;
412
412
  "aria-roledescription"?: string | undefined;
413
413
  "aria-rowcount"?: number | undefined;
@@ -600,7 +600,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
600
600
  accessKey?: string | undefined;
601
601
  autoFocus?: boolean | undefined;
602
602
  className?: string | undefined;
603
- contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
603
+ contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
604
604
  contextMenu?: string | undefined;
605
605
  dir?: string | undefined;
606
606
  draggable?: (boolean | "true" | "false") | undefined;
@@ -640,7 +640,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
640
640
  results?: number | undefined;
641
641
  security?: string | undefined;
642
642
  unselectable?: "on" | "off" | undefined;
643
- inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
643
+ inputMode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
644
644
  is?: string | undefined;
645
645
  "aria-activedescendant"?: string | undefined;
646
646
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -651,7 +651,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
651
651
  "aria-colindex"?: number | undefined;
652
652
  "aria-colspan"?: number | undefined;
653
653
  "aria-controls"?: string | undefined;
654
- "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
654
+ "aria-current"?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
655
655
  "aria-describedby"?: string | undefined;
656
656
  "aria-details"?: string | undefined;
657
657
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -660,7 +660,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
660
660
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
661
661
  "aria-flowto"?: string | undefined;
662
662
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
663
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
663
+ "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
664
664
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
665
665
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
666
666
  "aria-keyshortcuts"?: string | undefined;
@@ -677,7 +677,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
677
677
  "aria-posinset"?: number | undefined;
678
678
  "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
679
679
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
680
- "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
680
+ "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
681
681
  "aria-required"?: (boolean | "true" | "false") | undefined;
682
682
  "aria-roledescription"?: string | undefined;
683
683
  "aria-rowcount"?: number | undefined;
@@ -41,6 +41,7 @@ export interface EditorHeaderArgs {
41
41
  export interface FileItem extends File {
42
42
  isLoadingMedia?: boolean;
43
43
  isError?: boolean;
44
+ id?: number;
44
45
  }
45
46
  export interface FloatingMenuArgs extends Partial<BubbleMenuProps> {
46
47
  }
@@ -14,7 +14,7 @@ export type ChatContextType = {
14
14
  query: string;
15
15
  }) => SuggestedUser[];
16
16
  afterUploadCallback: (failed: string[]) => void;
17
- clearThumbnails: () => void;
17
+ clearInput: () => void;
18
18
  };
19
19
  export declare const ChatContext: React.Context<ChatContextType | null>;
20
20
  export interface Data {
@@ -1,6 +1,6 @@
1
1
  import { PlaceholderOptions } from "@tiptap/extension-placeholder";
2
2
  import { Editor as TipTapEditor } from "@tiptap/react";
3
- import { ChatEditorArgs, SuggestedUser } from "./_types";
3
+ import { ChatEditorArgs, FileItem, SuggestedUser } from "./_types";
4
4
  import { MediaType } from "./parts/comment";
5
5
  import { Data } from "./context/chatContext";
6
6
  interface EditorStoryArgs extends ChatEditorArgs {
@@ -18,7 +18,7 @@ interface EditorStoryArgs extends ChatEditorArgs {
18
18
  editorText?: string;
19
19
  background?: string;
20
20
  onSave: (editor: TipTapEditor, mentions: SuggestedUser[]) => void;
21
- onFileUpload?: (files: File[]) => Promise<Data>;
21
+ onFileUpload?: (files: FileItem[]) => Promise<Data>;
22
22
  placeholderOptions?: Partial<PlaceholderOptions>;
23
23
  }
24
24
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, EditorStoryArgs>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DropdownArgs, SelectArgs } from "./_types";
2
3
  import { MenuArgs } from "../menu/_types";
3
4
  interface IItem {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditorArgs } from "./_types";
2
3
  interface EditorStoryArgs extends EditorArgs {
3
4
  children?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.91-beta-attachments",
3
+ "version": "3.1.93-beta-attachments",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",