@appquality/unguess-design-system 3.1.94-beta-attachments → 3.1.95-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
@@ -2332,9 +2332,6 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
2332
2332
  });
2333
2333
  return result;
2334
2334
  };
2335
- React.useMemo(() => {
2336
- console.log("thumbnails", thumbnails);
2337
- }, [thumbnails]);
2338
2335
  const chatContextValue = React.useMemo(() => ({
2339
2336
  editor,
2340
2337
  setEditor,
@@ -2381,7 +2378,6 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
2381
2378
  }
2382
2379
  if (thumbnails.length > 0)
2383
2380
  setThumbnails([]);
2384
- console.log("thumbnails clear triggered", thumbnails);
2385
2381
  },
2386
2382
  onDeleteThumbnail: (id) => {
2387
2383
  onDeleteThumbnail(id);
@@ -2394,7 +2390,6 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
2394
2390
  onSave(editor, getMentions(editor));
2395
2391
  editor.commands.clearContent();
2396
2392
  setThumbnails([]);
2397
- console.log("save triggered", thumbnails);
2398
2393
  }
2399
2394
  },
2400
2395
  mentionableUsers: setMentionableUsers,
@@ -3537,8 +3532,7 @@ const StyledCol$1 = styled__default["default"](reactGrid.Col) `
3537
3532
  `;
3538
3533
  const Col = (props) => jsxRuntime.jsx(StyledCol$1, Object.assign({}, props));
3539
3534
 
3540
- const ThumbnailContainer = ({
3541
- /*removeMediaToUpload,*/ openLightbox, }) => {
3535
+ const ThumbnailContainer = ({ openLightbox, }) => {
3542
3536
  const { thumbnails, removeThumbnail, onDeleteThumbnail } = useChatContext();
3543
3537
  if (!thumbnails || thumbnails.length === 0) {
3544
3538
  return null;
@@ -3553,7 +3547,6 @@ const ThumbnailContainer = ({
3553
3547
  internal_id: file.internal_id,
3554
3548
  });
3555
3549
  });
3556
- console.log("mediafiles", mediaFiles);
3557
3550
  if (!mediaFiles || mediaFiles.length === 0) {
3558
3551
  return null;
3559
3552
  }
@@ -3569,7 +3562,7 @@ const ThumbnailContainer = ({
3569
3562
  if (file.fileType.includes("video"))
3570
3563
  return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.status === "uploading", removeThumbnail: () => {
3571
3564
  removeThumbnail(index);
3572
- //removeMediaToUpload(thumbnails[index]);
3565
+ onDeleteThumbnail(file.internal_id);
3573
3566
  }, clickThumbnail: () => {
3574
3567
  openLightbox(thumbnails[index], index);
3575
3568
  } }, index) })));
@@ -4562,7 +4555,7 @@ const CommentBox = (_a) => {
4562
4555
  }
4563
4556
  return false;
4564
4557
  },
4565
- handleDrop: function (view, event, slice, moved) {
4558
+ handleDrop: function (view, event) {
4566
4559
  if (!event.dataTransfer || !event.dataTransfer.files)
4567
4560
  return false;
4568
4561
  event.preventDefault();
@@ -4584,41 +4577,28 @@ const CommentBox = (_a) => {
4584
4577
  addThumbnails({ files: mediaFiles });
4585
4578
  return false;
4586
4579
  },
4587
- /*handlePaste: (view, event, slice) => {
4588
- if (!event.clipboardData || !event.clipboardData.items) return false;
4589
-
4590
- event.preventDefault();
4591
-
4592
- const items = Array.from(event.clipboardData.items);
4593
-
4594
- const imageItems = items.filter(
4595
- (item) => item.type && item.type.startsWith("image/")
4596
- );
4597
- const textItem = items.find((item) => item.type === "text/plain");
4598
-
4599
- if (imageItems.length > 0) {
4600
- imageItems.forEach((imageItem) => {
4601
- const file = imageItem.getAsFile();
4602
- if (file) {
4603
- const imageUrl = URL.createObjectURL(file);
4604
- const node = view.state.schema.nodes.image.create({
4605
- src: imageUrl,
4580
+ handlePaste: (view, event) => {
4581
+ if (!event.clipboardData || !event.clipboardData.items)
4582
+ return false;
4583
+ event.preventDefault();
4584
+ const files = Array.from(event.clipboardData.files).map((file) => {
4585
+ return Object.assign(file, {
4586
+ isLoadingMedia: false,
4587
+ internal_id: uuid.v4(),
4606
4588
  });
4607
- const transaction = view.state.tr.replaceSelectionWith(node);
4608
- view.dispatch(transaction);
4609
- }
4610
- });
4611
- } else if (textItem) {
4612
- textItem.getAsString(async (text) => {
4613
- const node = view.state.schema.text(text);
4614
- const tr = view.state.tr;
4615
- tr.replaceSelectionWith(node);
4616
- view.dispatch(tr);
4617
4589
  });
4618
- }
4619
-
4620
- return true;
4621
- },*/
4590
+ const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
4591
+ if (wrongFiles.length > 0) {
4592
+ for (const file of wrongFiles) {
4593
+ addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
4594
+ }
4595
+ }
4596
+ const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
4597
+ if (mediaFiles.length === 0)
4598
+ return false;
4599
+ addThumbnails({ files: mediaFiles });
4600
+ return false;
4601
+ },
4622
4602
  } }, props));
4623
4603
  const onKeyDown = (event) => {
4624
4604
  if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
@@ -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" | "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;
11
+ alignItems?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "center" | "start" | "end" | "between" | "around" | undefined;
18
+ justifyContentXs?: "center" | "start" | "end" | "between" | "around" | undefined;
19
+ justifyContentSm?: "center" | "start" | "end" | "between" | "around" | undefined;
20
+ justifyContentMd?: "center" | "start" | "end" | "between" | "around" | undefined;
21
+ justifyContentLg?: "center" | "start" | "end" | "between" | "around" | undefined;
22
+ justifyContentXl?: "center" | "start" | "end" | "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?: "inherit" | (boolean | "true" | "false") | undefined;
36
+ contentEditable?: (boolean | "true" | "false") | "inherit" | 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?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
76
+ inputMode?: "none" | "search" | "text" | "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 | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
87
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | 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 | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
96
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "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" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
113
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "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" | "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;
302
+ alignSelf?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
+ alignSelfXs?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
+ alignSelfSm?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
+ alignSelfMd?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
+ alignSelfLg?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
+ alignSelfXl?: "center" | "start" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
+ textAlign?: "center" | "start" | "end" | "justify" | undefined;
309
+ textAlignXs?: "center" | "start" | "end" | "justify" | undefined;
310
+ textAlignSm?: "center" | "start" | "end" | "justify" | undefined;
311
+ textAlignMd?: "center" | "start" | "end" | "justify" | undefined;
312
+ textAlignLg?: "center" | "start" | "end" | "justify" | undefined;
313
+ textAlignXl?: "center" | "start" | "end" | "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?: "inherit" | (boolean | "true" | "false") | undefined;
333
+ contentEditable?: (boolean | "true" | "false") | "inherit" | 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?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
373
+ inputMode?: "none" | "search" | "text" | "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 | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
384
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | 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 | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
393
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "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" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
410
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "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?: "inherit" | (boolean | "true" | "false") | undefined;
603
+ contentEditable?: (boolean | "true" | "false") | "inherit" | 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?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
643
+ inputMode?: "none" | "search" | "text" | "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 | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
654
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | 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 | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
663
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "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" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
680
+ "aria-relevant"?: "text" | "additions" | "additions removals" | "additions text" | "all" | "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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PlaceholderOptions } from "@tiptap/extension-placeholder";
2
3
  import { Editor as TipTapEditor } from "@tiptap/react";
3
4
  import { ChatEditorArgs, FileItem, SuggestedUser } from "./_types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.94-beta-attachments",
3
+ "version": "3.1.95-beta-attachments",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,3 +0,0 @@
1
- {
2
- "svg.preview.background": "editor"
3
- }