jamespot-react-components 1.0.212 → 1.0.214

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.
@@ -32,6 +32,7 @@ export type JRCButtonProps = React.ComponentPropsWithoutRef<'button'> & DataCy &
32
32
  label?: string;
33
33
  /** Disable margins **/
34
34
  noMargin?: boolean;
35
+ size?: 'm' | 's';
35
36
  };
36
37
  export declare const transformColor: (color?: string) => JRCIconProps['color'];
37
38
  /**
@@ -67,6 +68,7 @@ export declare const Button: import("styled-components").StyledComponent<"button
67
68
  label?: string | undefined;
68
69
  /** Disable margins **/
69
70
  noMargin?: boolean | undefined;
71
+ size?: "s" | "m" | undefined;
70
72
  } & DashedFocusBorderProps, never>;
71
73
  export declare const JRCButton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & DataCy & {
72
74
  /** Color of the background of the button */
@@ -95,4 +97,5 @@ export declare const JRCButton: React.ForwardRefExoticComponent<Omit<React.Detai
95
97
  label?: string | undefined;
96
98
  /** Disable margins **/
97
99
  noMargin?: boolean | undefined;
100
+ size?: "s" | "m" | undefined;
98
101
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -14,6 +14,7 @@ export declare const MarginLessJRCButton: import("styled-components").StyledComp
14
14
  tooltip?: Omit<import("../..").JRCTooltipProps, "children"> | undefined;
15
15
  label?: string | undefined;
16
16
  noMargin?: boolean | undefined;
17
+ size?: "s" | "m" | undefined;
17
18
  } & React.RefAttributes<HTMLButtonElement>>, import("styled-components").DefaultTheme, ButtonProps, never>;
18
19
  export declare const MenuWithoutTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
20
  export declare const MenuWithTitle: ({ direction, label, themeButton, children }: MenuWithTitleProps) => React.JSX.Element;
@@ -1,8 +1,9 @@
1
- import jamespot, { AddRemoveActionParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserView, JFilebankApi, JFileApi } from 'jamespot-user-api';
1
+ import { Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, JFilebankApi, JFileApi, JSocialActionApi, JUserApi } from 'jamespot-user-api';
2
2
  import { jCommentList } from 'jamespot-user-api/lib/src/types/comment';
3
3
  import React from 'react';
4
4
  import { DriveOrFilebank, JRCInputTinyMCERawProps } from 'types';
5
5
  import { JDriveApi } from 'jamespot-user-api/lib/src/apis/drive/drive';
6
+ import { JQuestionAnswerApi } from 'jamespot-user-api/lib/src/apis/questionAnswer/questionAnswer';
6
7
  export type JRCCommentProps = {
7
8
  isFocused: boolean;
8
9
  comment: jCommentList;
@@ -10,11 +11,7 @@ export type JRCCommentProps = {
10
11
  tinyMCEConfig: Pick<JRCInputTinyMCERawProps, 'commonOptions' | 'mentionsQueries' | 'tinymceScriptSrc'>;
11
12
  onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
12
13
  onCommentDelete: (idComment: number) => Promise<void>;
13
- fetchUser: (id: string) => ReturnType<typeof jamespot.user.get<jUserView>>;
14
- fetchUserFields: (id: number, type: 'popover') => ReturnType<typeof jamespot.user.getFields>;
15
- fetchSocialActionUserList: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.getUsers<jUserView>>;
16
14
  deleteFile: (id: number) => Promise<void>;
17
- removeAction: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.remove>;
18
15
  onError?: (message?: string) => void;
19
16
  highlightFields?: string[];
20
17
  userAccountStatus?: 0 | 1;
@@ -23,14 +20,24 @@ export type JRCCommentProps = {
23
20
  isWidgetActive: boolean;
24
21
  getAccessHash?: (fileId: number) => Promise<string>;
25
22
  onGetHashError: (message?: string) => void;
26
- socialActionAdd: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.add>;
27
- existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
23
+ existingWidgetsWrapperComponent: (comment: jCommentList, widgets: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean) => React.ReactNode;
28
24
  activeDrives: DriveOrFilebank[];
29
25
  handlers: {
30
26
  filebank: Pick<JFilebankApi, 'getBanks' | 'getFolders' | 'getDocuments'>;
31
27
  file: Pick<JFileApi, 'copy'>;
32
28
  drive: Pick<JDriveApi, 'msDocuments' | 'dropboxDocuments' | 'groups' | 'tenants' | 'listAccount' | 'isAccountLogged' | 'checkAccountToken' | 'getAccount' | 'logout' | 'setDefaultAccount' | 'getDocument'>;
29
+ user: Pick<JUserApi, 'get' | 'getFields'>;
30
+ socialAction: Pick<JSocialActionApi, 'add' | 'remove' | 'getUsers'>;
31
+ questionAnswer: Pick<JQuestionAnswerApi, 'selectResponse' | 'unselectResponse'>;
33
32
  };
33
+ socialQuestion?: {
34
+ isResolved: boolean;
35
+ responseId?: number;
36
+ onSelectResponse: (responseId: number) => void;
37
+ onUnselectResponse: () => void;
38
+ canSelectResponse: boolean;
39
+ };
40
+ articleId: number;
34
41
  };
35
42
  export declare const DropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
36
- export declare const JRCComment: ({ isFocused, comment, token, tinyMCEConfig, onCommentUpdate, onCommentDelete, fetchUser, fetchUserFields, fetchSocialActionUserList, removeAction, onError, highlightFields, userModel, userAccountStatus, isWedocActive, isWidgetActive, getAccessHash, onGetHashError, socialActionAdd, deleteFile, existingWidgetsWrapperComponent, activeDrives, handlers, }: JRCCommentProps) => React.JSX.Element;
43
+ export declare const JRCComment: ({ isFocused, comment, token, tinyMCEConfig, onCommentUpdate, onCommentDelete, onError, highlightFields, userModel, userAccountStatus, isWedocActive, isWidgetActive, getAccessHash, onGetHashError, deleteFile, existingWidgetsWrapperComponent, activeDrives, handlers, socialQuestion, articleId, }: JRCCommentProps) => React.JSX.Element;
@@ -1,9 +1,10 @@
1
- import jamespot, { AddCommentParams, AddRemoveActionParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, jUserView, JFilebankApi, JFileApi } from 'jamespot-user-api';
1
+ import { AddCommentParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, JFilebankApi, JFileApi, JSocialActionApi, JUserApi } from 'jamespot-user-api';
2
2
  import { jCommentList } from 'jamespot-user-api/lib/src/types/comment';
3
3
  import React from 'react';
4
4
  import { JRCInputTinyMCERawProps } from '../Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
5
5
  import { DriveOrFilebank } from '../Form/Input/JRCInputFileAdvanced/JRCInputFileAdvancedRaw';
6
6
  import { JDriveApi } from 'jamespot-user-api/lib/src/apis/drive/drive';
7
+ import { JQuestionAnswerApi } from 'jamespot-user-api/lib/src/apis/questionAnswer/questionAnswer';
7
8
  export type JRCCommentsBlocProps = {
8
9
  comments?: jCommentList[];
9
10
  initialCommentsNumber?: number;
@@ -13,16 +14,12 @@ export type JRCCommentsBlocProps = {
13
14
  isWidgetActive?: boolean;
14
15
  widgetListComponent: React.ReactNode;
15
16
  newWidgetsWrapperComponent: React.ReactNode;
16
- existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
17
+ existingWidgetsWrapperComponent: (comment: jCommentList, widgets: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean) => React.ReactNode;
17
18
  loading?: boolean;
18
19
  token?: string;
19
20
  onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
20
21
  onCommentDelete: (idComment: number) => Promise<void>;
21
- fetchUser: (id: string) => ReturnType<typeof jamespot.user.get<jUserView>>;
22
- fetchUserFields: (id: number, type: 'popover') => ReturnType<typeof jamespot.user.getFields>;
23
22
  deleteFile: (id: number) => Promise<void>;
24
- fetchSocialActionUserList: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.getUsers<jUserView>>;
25
- removeLike: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.remove>;
26
23
  onError?: (message?: string) => void;
27
24
  highlightFields?: string[];
28
25
  userModel?: Model;
@@ -31,14 +28,24 @@ export type JRCCommentsBlocProps = {
31
28
  getAccessHash?: (fileId: number) => Promise<string>;
32
29
  onGetHashError: (message?: string) => void;
33
30
  activeDrives: DriveOrFilebank[];
34
- socialActionAdd: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.add>;
35
31
  variant?: 'modal' | 'inline';
36
32
  canComment: boolean;
37
33
  handlers: {
38
34
  filebank: Pick<JFilebankApi, 'getBanks' | 'getFolders' | 'getDocuments'>;
39
35
  file: Pick<JFileApi, 'copy'>;
40
36
  drive: Pick<JDriveApi, 'msDocuments' | 'dropboxDocuments' | 'groups' | 'tenants' | 'listAccount' | 'isAccountLogged' | 'checkAccountToken' | 'getAccount' | 'logout' | 'setDefaultAccount' | 'getDocument'>;
37
+ user: Pick<JUserApi, 'get' | 'getFields'>;
38
+ socialAction: Pick<JSocialActionApi, 'add' | 'remove' | 'getUsers'>;
39
+ questionAnswer: Pick<JQuestionAnswerApi, 'selectResponse' | 'unselectResponse'>;
41
40
  };
41
+ socialQuestion?: {
42
+ isResolved: boolean;
43
+ responseId?: number;
44
+ onSelectResponse: (responseId: number) => void;
45
+ onUnselectResponse: () => void;
46
+ canSelectResponse: boolean;
47
+ };
48
+ articleId: number;
42
49
  };
43
50
  export declare const AvatarWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
44
- export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, isWidgetActive, widgetListComponent, newWidgetsWrapperComponent, existingWidgetsWrapperComponent, loading, token, onCommentDelete, onCommentUpdate, fetchUser, fetchUserFields, deleteFile, fetchSocialActionUserList, removeLike, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, activeDrives, socialActionAdd, variant, canComment, handlers, }: JRCCommentsBlocProps) => React.JSX.Element;
51
+ export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, isWidgetActive, widgetListComponent, newWidgetsWrapperComponent, existingWidgetsWrapperComponent, loading, token, onCommentDelete, onCommentUpdate, deleteFile, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, activeDrives, variant, canComment, handlers, socialQuestion, articleId, }: JRCCommentsBlocProps) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface JRCDropDownProps {
3
3
  trigger: React.ReactNode;
4
- dropdown: React.ReactNode;
4
+ dropdown: (collapseDropdown: () => void) => React.ReactNode;
5
5
  align?: 'left' | 'right';
6
6
  onToggle?: (isOpen: boolean) => void;
7
7
  withBorder?: boolean;
@@ -1,12 +1,12 @@
1
- import { jObjectLittle, jUserView } from 'jamespot-user-api';
1
+ import { jObjectLittle, JUserApi } from 'jamespot-user-api';
2
2
  import React, { ReactNode } from 'react';
3
- import jamespot from 'jamespot-user-api';
4
3
  export type JRCUserPopupProps = {
5
- idUser: number;
6
- fetchUser: (id: string) => ReturnType<typeof jamespot.user.get<jUserView>>;
7
- fetchFields: (id: number, type: 'popover') => ReturnType<typeof jamespot.user.getFields>;
4
+ uri: string;
8
5
  fetchBusinessNetworking?: () => Promise<jObjectLittle>;
9
6
  onError?: (message?: string) => void;
7
+ handlers: {
8
+ user: Pick<JUserApi, 'get' | 'getFields'>;
9
+ };
10
10
  children: ReactNode;
11
11
  };
12
- export declare const JRCUserPopup: ({ children, idUser, fetchUser, fetchFields, fetchBusinessNetworking, onError, }: JRCUserPopupProps) => React.JSX.Element;
12
+ export declare const JRCUserPopup: ({ children, uri, fetchBusinessNetworking, handlers, onError }: JRCUserPopupProps) => React.JSX.Element;
@@ -9,7 +9,6 @@ export declare const CSSRowBox: import("styled-components").StyledComponent<"div
9
9
  export declare const CSSRowContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
10
  export declare const CSSCheckboxWrapper: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
11
11
  export declare const CSSRowLinksWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
12
- export declare const CSSRowLinkWrapper: import("styled-components").StyledComponent<({ dataCy, hasLicense, href, useLink, ...props }: import("components/JRCHref/JRCHref").JRCStyledHrefProps) => React.JSX.Element, import("styled-components").DefaultTheme, {}, never>;
13
12
  export type JRCWidgetCheckListEntry = {
14
13
  text: string;
15
14
  checked: boolean;
@@ -20,7 +19,6 @@ export type JRCWidgetCheckListEntry = {
20
19
  };
21
20
  export type JRCWidgetCheckListEntries = JRCWidgetCheckListEntry[];
22
21
  export type JRCWidgetCheckListProps = {
23
- title?: string;
24
22
  initialEntries: JRCWidgetCheckListEntries;
25
23
  limit: number;
26
24
  inplace?: boolean;
@@ -29,4 +27,4 @@ export type JRCWidgetCheckListProps = {
29
27
  onNewItem?: () => void;
30
28
  onItemCheckListChange?: (index: number, items: JRCWidgetCheckListEntries) => void;
31
29
  };
32
- export declare const JRCWidgetCheckList: ({ title, initialEntries, inplace, inplaceButtonLabel, limit, onFileClick, onNewItem, onItemCheckListChange, }: JRCWidgetCheckListProps) => React.JSX.Element;
30
+ export declare const JRCWidgetCheckList: ({ initialEntries, inplace, inplaceButtonLabel, limit, onFileClick, onNewItem, onItemCheckListChange, }: JRCWidgetCheckListProps) => React.JSX.Element;
@@ -19,9 +19,7 @@ type JRCWidgetCheckListEditorProps = {
19
19
  uniqid: string;
20
20
  title: string;
21
21
  }) => void;
22
- onRemoveWidget?: (uniqid: string) => void;
23
22
  onSave?: (uniqid: string, content: Partial<CombinedWidgetContent>) => void;
24
- openEditorPanel?: (token: string, newComment?: boolean) => void;
25
23
  };
26
- export declare const JRCWidgetCheckListEditor: ({ token, uniqid, content, canEditCollaboration, onChangeContent, onChangeWrapper, onRemoveWidget, onSave, openEditorPanel, }: JRCWidgetCheckListEditorProps) => React.JSX.Element;
24
+ export declare const JRCWidgetCheckListEditor: ({ token, uniqid, content, canEditCollaboration, onChangeContent, onChangeWrapper, onSave, }: JRCWidgetCheckListEditorProps) => React.JSX.Element;
27
25
  export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export declare const CSSRowImageWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const JRCWidgetCheckListImage: ({ uri, mimetype, onClick, }: {
4
+ uri: string;
5
+ mimetype: string;
6
+ onClick: () => void;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const CSSRowLinkWrapper: import("styled-components").StyledComponent<({ dataCy, hasLicense, href, useLink, ...props }: import("components/JRCHref/JRCHref").JRCStyledHrefProps) => React.JSX.Element, import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const JRCWidgetCheckListLink: ({ link }: {
4
+ link: {
5
+ href: string;
6
+ target: string;
7
+ };
8
+ }) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.212",
3
+ "version": "1.0.214",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -80,7 +80,7 @@
80
80
  "chroma-js": "^2.1.1",
81
81
  "classnames": "^2.3.1",
82
82
  "dompurify": "^3.0.5",
83
- "jamespot-user-api": "^1.0.189",
83
+ "jamespot-user-api": "^1.0.193",
84
84
  "moment": "2.29.4",
85
85
  "react": "^17.x",
86
86
  "react-beautiful-dnd": "^13.1.1",
@@ -132,7 +132,7 @@
132
132
  "lint": "npx eslint ./src/ . --ext .ts,.tsx,.js",
133
133
  "lint:fix": "npx eslint ./src/ . --ext .ts,.tsx,.js --fix ",
134
134
  "lint:ci": "npx eslint --output-file eslint_report.json --format json . --ext .ts,.tsx,.js",
135
- "test": "jest --updateSnapshot",
135
+ "test": "jest --updateSnapshot --runInBand",
136
136
  "test:watch": "npm run test -- --watch --verbose",
137
137
  "storybook": "start-storybook -p 6006",
138
138
  "storybook-no-cache": "cross-env NODE_ENV=development STORYBOOK_MODE=true PUBLIC_PATH='' start-storybook -s ./.storybook/assets/ -c .storybook -p 3022 --no-manager-cache",