@appquality/unguess-design-system 3.1.78-alpha-attachment → 3.1.79-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
@@ -2313,8 +2313,9 @@ const ChatFooter = ({ saveText, children, showShortcut, }) => {
2313
2313
  };
2314
2314
 
2315
2315
  const ChatContext = React.createContext(null);
2316
- const ChatContextProvider = ({ onSave, setMentionableUsers, children, }) => {
2316
+ const ChatContextProvider = ({ onSave, onFileUpload, setMentionableUsers, children, }) => {
2317
2317
  const [editor, setEditor] = React.useState();
2318
+ const [thumbnails, setThumbnails] = React.useState([]);
2318
2319
  const getMentions = (editor) => {
2319
2320
  const result = [];
2320
2321
  editor.state.doc.descendants((node) => {
@@ -2324,7 +2325,7 @@ const ChatContextProvider = ({ onSave, setMentionableUsers, children, }) => {
2324
2325
  result.push({
2325
2326
  id: node.attrs.id,
2326
2327
  name: node.attrs.name,
2327
- email: node.attrs.email
2328
+ email: node.attrs.email,
2328
2329
  });
2329
2330
  }
2330
2331
  });
@@ -2333,6 +2334,12 @@ const ChatContextProvider = ({ onSave, setMentionableUsers, children, }) => {
2333
2334
  const chatContextValue = React.useMemo(() => ({
2334
2335
  editor,
2335
2336
  setEditor,
2337
+ thumbnails,
2338
+ addThumbnails: ({ files, }) => {
2339
+ onFileUpload && onFileUpload(files);
2340
+ setThumbnails((prev) => [...prev, ...files]);
2341
+ },
2342
+ removeThumbnail: (index) => setThumbnails(thumbnails.filter((_, i) => i !== index)),
2336
2343
  triggerSave: () => {
2337
2344
  if (editor && onSave && !editor.isEmpty) {
2338
2345
  onSave(editor, getMentions(editor));
@@ -2340,7 +2347,7 @@ const ChatContextProvider = ({ onSave, setMentionableUsers, children, }) => {
2340
2347
  }
2341
2348
  },
2342
2349
  mentionableUsers: setMentionableUsers,
2343
- }), [editor, setEditor, onSave, setMentionableUsers]);
2350
+ }), [editor, setEditor, onSave, setMentionableUsers, thumbnails, setThumbnails, onFileUpload]);
2344
2351
  return (jsxRuntime.jsx(ChatContext.Provider, Object.assign({ value: chatContextValue }, { children: children })));
2345
2352
  };
2346
2353
  const useChatContext = () => {
@@ -2899,11 +2906,9 @@ const VerticalDivider = styled__default["default"].div `
2899
2906
  background-color: ${({ theme }) => theme.palette.grey[300]};
2900
2907
  margin: 0 ${({ theme }) => theme.space.xs};
2901
2908
  `;
2902
- const CommentBar = ({ editor, i18n, addFilesToThumbnail, }) => {
2909
+ const CommentBar = ({ editor, i18n, }) => {
2903
2910
  var _a, _b, _c, _d, _e, _f, _g, _h;
2904
- React.useState(false);
2905
- React.useState({});
2906
- React.useState(0);
2911
+ const { addThumbnails } = useChatContext();
2907
2912
  if (!editor)
2908
2913
  return null;
2909
2914
  const getIcon = (type) => {
@@ -2943,7 +2948,7 @@ const CommentBar = ({ editor, i18n, addFilesToThumbnail, }) => {
2943
2948
  const mediaFiles = Array.from(files);
2944
2949
  if (mediaFiles.length === 0)
2945
2950
  return;
2946
- addFilesToThumbnail({ type: "add", payload: { file: mediaFiles } });
2951
+ addThumbnails({ files: mediaFiles });
2947
2952
  }
2948
2953
  };
2949
2954
  return;
@@ -3268,21 +3273,12 @@ const StyledThumbnailContainer = styled.styled.div `
3268
3273
  z-index: 9999;
3269
3274
  }
3270
3275
  `;
3271
- const ThumbnailContainer = ({ mediaFiles, openLightbox, updateThumbnails, }) => {
3272
- const [thumbnails, setThumbnails] = React.useState(mediaFiles);
3273
- React.useEffect(() => {
3274
- // todo: upload to s3
3275
- console.log("started uploading to s3", mediaFiles);
3276
- setThumbnails(mediaFiles);
3277
- console.log("useEffect mediaFiles", mediaFiles);
3278
- }, [mediaFiles, openLightbox]);
3276
+ const ThumbnailContainer = ({ openLightbox, }) => {
3277
+ const { thumbnails, removeThumbnail } = useChatContext();
3279
3278
  if (!thumbnails || thumbnails.length === 0) {
3280
3279
  return null;
3281
3280
  }
3282
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(StyledThumbnailContainer, Object.assign({ className: "thumbnailContainer" }, { children: thumbnails.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: URL.createObjectURL(file), label: file.name, index: index, showX: true, showLabel: true, mediaType: file.type, removeThumbnail: () => updateThumbnails({
3283
- type: "remove",
3284
- payload: { file: thumbnails, index: index },
3285
- }), clickThumbnail: () => {
3281
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(StyledThumbnailContainer, Object.assign({ className: "thumbnailContainer" }, { children: thumbnails.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: URL.createObjectURL(file), label: file.name, index: index, showX: true, showLabel: true, mediaType: file.type, removeThumbnail: () => removeThumbnail(index), clickThumbnail: () => {
3286
3282
  openLightbox(file, index);
3287
3283
  } }, index))) })) }));
3288
3284
  };
@@ -4225,22 +4221,6 @@ const ChatBoxContainer = styled__default["default"].div `
4225
4221
  margin: ${({ theme }) => `0 -${theme.space.base * 4}px`};
4226
4222
  padding: ${({ theme }) => `${theme.space.base * 4}px ${theme.space.sm} 0`};
4227
4223
  `;
4228
- function thumbnailReducer(state, action) {
4229
- switch (action.type) {
4230
- case "add": {
4231
- if (!action.payload)
4232
- return state;
4233
- console.log("chiuamato", action.payload.file);
4234
- return [...state, ...action.payload.file];
4235
- }
4236
- case "remove":
4237
- return state.filter((item, index) => { var _a; return index !== ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.index); });
4238
- case "reset":
4239
- return [];
4240
- default:
4241
- return state;
4242
- }
4243
- }
4244
4224
  /**
4245
4225
  * CommentBox is a wrapper around Editor component
4246
4226
  * <br>
@@ -4256,11 +4236,10 @@ function thumbnailReducer(state, action) {
4256
4236
  const CommentBox = (_a) => {
4257
4237
  var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
4258
4238
  const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
4259
- const { editor, setEditor, mentionableUsers, triggerSave } = useChatContext();
4239
+ const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, removeThumbnail } = useChatContext();
4260
4240
  const [isOpen, setIsOpen] = React.useState(false);
4261
4241
  const [selectedImage, setSelectedImage] = React.useState({});
4262
4242
  const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
4263
- const [thumbnails, updateThumbnails] = React.useReducer(thumbnailReducer, []);
4264
4243
  const ext = editorExtensions({ placeholderOptions, mentionableUsers });
4265
4244
  const closeLightbox = () => {
4266
4245
  setIsOpen(false);
@@ -4296,7 +4275,7 @@ const CommentBox = (_a) => {
4296
4275
  const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
4297
4276
  if (mediaFiles.length === 0)
4298
4277
  return false;
4299
- updateThumbnails({ type: "add", payload: { file: mediaFiles } });
4278
+ addThumbnails({ files: mediaFiles });
4300
4279
  return false;
4301
4280
  },
4302
4281
  /*handlePaste: (view, event, slice) => {
@@ -4348,7 +4327,7 @@ const CommentBox = (_a) => {
4348
4327
  ed.on("update", ({ editor }) => setEditor(editor));
4349
4328
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: selectedImage.name }), jsxRuntime.jsx(Lightbox.Body, { children: jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: thumbnails.map((item) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type === "image" && (jsxRuntime.jsx("img", { src: URL.createObjectURL(item), alt: `media ${item.name}` })), item.type === "video" && (jsxRuntime.jsx(Player, { ref: (ref) => {
4350
4329
  videoRefs.current.push(ref);
4351
- }, url: URL.createObjectURL(item) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { mediaFiles: thumbnails, openLightbox: handleOpenLightbox, updateThumbnails: updateThumbnails })] })) }), hasButtonsMenu && (jsxRuntime.jsx(CommentBar, { addFilesToThumbnail: updateThumbnails, editor: ed, i18n: i18n }))] }));
4330
+ }, url: URL.createObjectURL(item) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && (jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n }))] }));
4352
4331
  };
4353
4332
 
4354
4333
  var _path$c;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -5,13 +5,19 @@ export type ChatContextType = {
5
5
  triggerSave: () => void;
6
6
  editor?: Editor;
7
7
  setEditor: React.Dispatch<React.SetStateAction<Editor | undefined>>;
8
+ addThumbnails: (props: {
9
+ files: File[];
10
+ }) => void;
11
+ removeThumbnail: (index: number) => void;
12
+ thumbnails: File[];
8
13
  mentionableUsers: (props: {
9
14
  query: string;
10
15
  }) => SuggestedUser[];
11
16
  };
12
17
  export declare const ChatContext: React.Context<ChatContextType | null>;
13
- export declare const ChatContextProvider: ({ onSave, setMentionableUsers, children, }: {
18
+ export declare const ChatContextProvider: ({ onSave, onFileUpload, setMentionableUsers, children, }: {
14
19
  onSave?: ((editor: Editor, mentions: SuggestedUser[]) => void) | undefined;
20
+ onFileUpload?: ((files: File[]) => Promise<void>) | undefined;
15
21
  children: React.ReactNode;
16
22
  setMentionableUsers: (props: {
17
23
  query: string;
@@ -16,6 +16,7 @@ interface EditorStoryArgs extends ChatEditorArgs {
16
16
  editorText?: string;
17
17
  background?: string;
18
18
  onSave: (editor: TipTapEditor, mentions: SuggestedUser[]) => void;
19
+ onFileUpload?: (files: File[]) => Promise<void>;
19
20
  placeholderOptions?: Partial<PlaceholderOptions>;
20
21
  }
21
22
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, EditorStoryArgs>;
@@ -1,13 +1,5 @@
1
1
  interface Props {
2
- mediaFiles: File[];
3
2
  openLightbox: (file: File, index: number) => void;
4
- updateThumbnails: (payload: {
5
- type: string;
6
- payload: {
7
- file: File[];
8
- index?: number;
9
- };
10
- }) => void;
11
3
  }
12
- declare const ThumbnailContainer: ({ mediaFiles, openLightbox, updateThumbnails, }: Props) => import("react/jsx-runtime").JSX.Element | null;
4
+ declare const ThumbnailContainer: ({ openLightbox, }: Props) => import("react/jsx-runtime").JSX.Element | null;
13
5
  export default ThumbnailContainer;
@@ -1,13 +1,6 @@
1
1
  import { ChatEditorArgs } from "../_types";
2
2
  import { Editor } from "@tiptap/react";
3
- declare const CommentBar: ({ editor, i18n, addFilesToThumbnail, }: Partial<ChatEditorArgs> & {
4
- addFilesToThumbnail: (payload: {
5
- type: string;
6
- payload: {
7
- file: File[];
8
- index?: number;
9
- };
10
- }) => void;
3
+ declare const CommentBar: ({ editor, i18n, }: Partial<ChatEditorArgs> & {
11
4
  editor?: Editor | undefined;
12
5
  }) => import("react/jsx-runtime").JSX.Element | null;
13
6
  export { CommentBar };
@@ -1,12 +1,5 @@
1
1
  import { ChatEditorArgs } from "../_types";
2
2
  import { PropsWithChildren } from "react";
3
- export declare function thumbnailReducer(state: File[], action: {
4
- type: string;
5
- payload?: {
6
- file: File[];
7
- index?: number;
8
- };
9
- }): File[];
10
3
  /**
11
4
  * CommentBox is a wrapper around Editor component
12
5
  * <br>
@@ -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.78-alpha-attachment",
3
+ "version": "3.1.79-beta-attachments",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",