jamespot-react-components 1.0.213 → 1.0.215

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.
@@ -1,4 +1,4 @@
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';
@@ -11,11 +11,7 @@ export type JRCCommentProps = {
11
11
  tinyMCEConfig: Pick<JRCInputTinyMCERawProps, 'commonOptions' | 'mentionsQueries' | 'tinymceScriptSrc'>;
12
12
  onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
13
13
  onCommentDelete: (idComment: number) => Promise<void>;
14
- fetchUser: (id: string) => ReturnType<typeof jamespot.user.get<jUserView>>;
15
- fetchUserFields: (id: number, type: 'popover') => ReturnType<typeof jamespot.user.getFields>;
16
- fetchSocialActionUserList: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.getUsers<jUserView>>;
17
14
  deleteFile: (id: number) => Promise<void>;
18
- removeAction: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.remove>;
19
15
  onError?: (message?: string) => void;
20
16
  highlightFields?: string[];
21
17
  userAccountStatus?: 0 | 1;
@@ -24,13 +20,14 @@ export type JRCCommentProps = {
24
20
  isWidgetActive: boolean;
25
21
  getAccessHash?: (fileId: number) => Promise<string>;
26
22
  onGetHashError: (message?: string) => void;
27
- socialActionAdd: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.add>;
28
- 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;
29
24
  activeDrives: DriveOrFilebank[];
30
25
  handlers: {
31
26
  filebank: Pick<JFilebankApi, 'getBanks' | 'getFolders' | 'getDocuments'>;
32
27
  file: Pick<JFileApi, 'copy'>;
33
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'>;
34
31
  questionAnswer: Pick<JQuestionAnswerApi, 'selectResponse' | 'unselectResponse'>;
35
32
  };
36
33
  socialQuestion?: {
@@ -43,4 +40,4 @@ export type JRCCommentProps = {
43
40
  articleId: number;
44
41
  };
45
42
  export declare const DropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
46
- 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, socialQuestion, articleId, }: 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,4 +1,4 @@
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';
@@ -14,16 +14,12 @@ export type JRCCommentsBlocProps = {
14
14
  isWidgetActive?: boolean;
15
15
  widgetListComponent: React.ReactNode;
16
16
  newWidgetsWrapperComponent: React.ReactNode;
17
- 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;
18
18
  loading?: boolean;
19
19
  token?: string;
20
20
  onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
21
21
  onCommentDelete: (idComment: number) => Promise<void>;
22
- fetchUser: (id: string) => ReturnType<typeof jamespot.user.get<jUserView>>;
23
- fetchUserFields: (id: number, type: 'popover') => ReturnType<typeof jamespot.user.getFields>;
24
22
  deleteFile: (id: number) => Promise<void>;
25
- fetchSocialActionUserList: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.getUsers<jUserView>>;
26
- removeLike: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.remove>;
27
23
  onError?: (message?: string) => void;
28
24
  highlightFields?: string[];
29
25
  userModel?: Model;
@@ -32,13 +28,14 @@ export type JRCCommentsBlocProps = {
32
28
  getAccessHash?: (fileId: number) => Promise<string>;
33
29
  onGetHashError: (message?: string) => void;
34
30
  activeDrives: DriveOrFilebank[];
35
- socialActionAdd: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.add>;
36
31
  variant?: 'modal' | 'inline';
37
32
  canComment: boolean;
38
33
  handlers: {
39
34
  filebank: Pick<JFilebankApi, 'getBanks' | 'getFolders' | 'getDocuments'>;
40
35
  file: Pick<JFileApi, 'copy'>;
41
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'>;
42
39
  questionAnswer: Pick<JQuestionAnswerApi, 'selectResponse' | 'unselectResponse'>;
43
40
  };
44
41
  socialQuestion?: {
@@ -51,4 +48,4 @@ export type JRCCommentsBlocProps = {
51
48
  articleId: number;
52
49
  };
53
50
  export declare const AvatarWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
54
- 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, socialQuestion, articleId, }: 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,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;
@@ -12,4 +12,4 @@ export declare const mock_api_network_default: Pick<import("jamespot-user-api").
12
12
  export declare const mock_api_network_excel: Pick<import("jamespot-user-api").Network, "token" | "postFile" | "getUrl">;
13
13
  export declare const mock_api_datasource_excel: Omit<import("jamespot-user-api").JDatasourceApi, "jApi" | "network">;
14
14
  export declare const mock_api_datasource_studio: Omit<import("jamespot-user-api").JDatasourceApi, "jApi" | "network">;
15
- export declare const mock_api_application: Pick<import("jamespot-user-api").JApplicationApi, "get" | "list">;
15
+ export declare const mock_api_application: Pick<import("jamespot-user-api").JApplicationApi, "list" | "get">;
@@ -1,8 +1,8 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
2
  export interface ITheme {
3
- config: DefaultTheme;
3
+ config: DefaultTheme | undefined;
4
4
  get: () => DefaultTheme;
5
- initTheme: (options?: ThemeConfigOptions) => void;
5
+ initTheme: (options?: ThemeConfigOptions) => DefaultTheme;
6
6
  }
7
7
  export type ThemeConfigOptions = {
8
8
  fontFamily?: string;
@@ -18,7 +18,7 @@ export type ThemeConfigOptions = {
18
18
  navTextColor: string;
19
19
  bgColorNotLogged: string;
20
20
  };
21
- export type Colors = 'primary' | 'secondary' | 'headerColor' | 'headerTextColor' | 'headerUserBackground' | 'headerUserTextColor' | 'headerSearchBarTextColor' | 'headerSearchBarBackgroundColor' | 'lavender' | 'orange' | 'yellow' | 'green' | 'navy' | 'overseas' | 'night1' | 'night2' | 'sandLight' | 'sky' | 'sky15' | 'sand' | 'grey0' | 'grey1' | 'grey2' | 'grey3' | 'grey4' | 'grey5' | 'grey6' | 'black' | 'black10' | 'black15' | 'black20' | 'white';
21
+ export type Colors = 'primary' | 'secondary' | 'headerColor' | 'headerTextColor' | 'headerUserBackground' | 'headerUserTextColor' | 'headerSearchBarTextColor' | 'headerSearchBarBackgroundColor' | 'navBackground' | 'navTextColor' | 'lavender' | 'orange' | 'yellow' | 'green' | 'navy' | 'overseas' | 'night1' | 'night2' | 'sandLight' | 'sky' | 'sky15' | 'sand' | 'grey0' | 'grey1' | 'grey2' | 'grey3' | 'grey4' | 'grey5' | 'grey6' | 'black' | 'black10' | 'black15' | 'black20' | 'white';
22
22
  type ThemeConfigColorType = {
23
23
  [color in Colors]: string;
24
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.213",
3
+ "version": "1.0.215",
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.191",
83
+ "jamespot-user-api": "^1.0.194",
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",