jamespot-react-components 1.0.182 → 1.0.183

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.
@@ -5,5 +5,7 @@ export type JRCAttachmentsProps = {
5
5
  isWedocActive: boolean;
6
6
  getAccessHash?: (fileId: number) => Promise<string>;
7
7
  onError: (message?: string) => void;
8
+ onDelete?: (id: number) => void;
9
+ onRecomputePreview: () => void;
8
10
  };
9
- export declare const JRCAttachments: ({ files, isWedocActive, getAccessHash, onError }: JRCAttachmentsProps) => React.JSX.Element;
11
+ export declare const JRCAttachments: ({ files, isWedocActive, getAccessHash, onError, onDelete, onRecomputePreview, }: JRCAttachmentsProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { jCommentList } from 'jamespot-user-api/lib/src/types/comment';
3
- import { jUserList, jUserView, Model, UpdateCommentParams } from 'jamespot-user-api';
3
+ import jamespot, { jUserList, jUserView, Model, UpdateCommentParams } from 'jamespot-user-api';
4
4
  import { JRCInputTinyMCERawProps } from 'types';
5
5
  export type JRCCommentProps = {
6
6
  isFocused: boolean;
@@ -25,6 +25,13 @@ export type JRCCommentProps = {
25
25
  isWedocActive: boolean;
26
26
  getAccessHash?: (fileId: number) => Promise<string>;
27
27
  onGetHashError: (message?: string) => void;
28
+ onRecomputePreview: () => void;
29
+ mocks?: {
30
+ socialActionGetUsers: typeof jamespot.socialAction.getUsers<jUserList>;
31
+ socialActionAdd: typeof jamespot.socialAction.add;
32
+ socialActionRemove: typeof jamespot.socialAction.remove;
33
+ fileDeleteFile: typeof jamespot.file.deleteFile;
34
+ };
28
35
  };
29
36
  export declare const DropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
30
- export declare const JRCComment: ({ isFocused, comment, token, tinyMCEConfig, onCommentUpdate, onCommentDelete, fetchUser, fetchUserFields, deleteFile, fetchSocialActionUserList, addAction, removeAction, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, }: JRCCommentProps) => React.JSX.Element;
37
+ export declare const JRCComment: ({ isFocused, comment, token, tinyMCEConfig, onCommentUpdate, onCommentDelete, fetchUser, fetchUserFields, fetchSocialActionUserList, addAction, removeAction, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, onRecomputePreview, mocks, }: JRCCommentProps) => React.JSX.Element;
@@ -28,6 +28,7 @@ export type JRCCommentsBlocProps = {
28
28
  isWedocActive: boolean;
29
29
  getAccessHash?: (fileId: number) => Promise<string>;
30
30
  onGetHashError: (message?: string) => void;
31
+ onRecomputePreview: () => void;
31
32
  };
32
33
  export declare const AvatarWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
33
- export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, loading, token, onCommentDelete, onCommentUpdate, fetchUser, fetchUserFields, deleteFile, fetchSocialActionUserList, addLike, removeLike, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, }: JRCCommentsBlocProps) => React.JSX.Element;
34
+ export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, loading, token, onCommentDelete, onCommentUpdate, fetchUser, fetchUserFields, deleteFile, fetchSocialActionUserList, addLike, removeLike, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, onRecomputePreview, }: JRCCommentsBlocProps) => React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import jamespot from 'jamespot-user-api';
2
3
  export declare const CSSWidgetAttachment: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
4
  inline?: boolean | undefined;
4
5
  }, never>;
@@ -11,11 +12,18 @@ export type JRCWidgetAttachmentProps = {
11
12
  size: number;
12
13
  }[];
13
14
  fileDisplay?: 'list';
15
+ onDelete?: (idFile: number) => void;
16
+ onRecomputePreview: () => void;
17
+ onError: (message?: string) => void;
18
+ mocks?: {
19
+ fileGetDownloads: typeof jamespot.file.getDownload;
20
+ fileGeneratePreview: typeof jamespot.file.generatePreview;
21
+ };
14
22
  };
15
23
  /**
16
24
  * TODO: resolveFileMimetype should be done before
17
25
  */
18
- export declare const JRCWidgetAttachment: ({ files, inline, onClick, }: JRCWidgetAttachmentProps & {
26
+ export declare const JRCWidgetAttachment: ({ files, inline, onClick, onDelete, onRecomputePreview, onError, mocks, }: JRCWidgetAttachmentProps & {
19
27
  onClick: (idFile: number) => void;
20
28
  inline?: boolean | undefined;
21
29
  }) => React.JSX.Element;
@@ -1,3 +1,4 @@
1
1
  export declare function suffixIfDoesNotExist(str: string | undefined, suffix: string): string | undefined;
2
2
  export declare function removeIfStartsWith(str: string | undefined, prefix: string): string | undefined;
3
3
  export declare function padStartTwoDigits(val: string | number): string;
4
+ export declare function limitSize(str: string, length: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.182",
3
+ "version": "1.0.183",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -92,7 +92,7 @@
92
92
  "chroma-js": "^2.1.1",
93
93
  "classnames": "^2.3.1",
94
94
  "dompurify": "^3.0.5",
95
- "jamespot-user-api": "^1.0.151",
95
+ "jamespot-user-api": "^1.0.152",
96
96
  "moment": "2.29.4",
97
97
  "react": "^17.x",
98
98
  "react-beautiful-dnd": "^13.1.1",