jamespot-react-components 1.2.17 → 1.2.19

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.
@@ -6,7 +6,7 @@ export declare const EditorUploader: ({ token, uniqid, label, accept, multiple,
6
6
  label: string;
7
7
  accept: string;
8
8
  multiple: boolean;
9
- name?: "editorFiles" | "attachment" | undefined;
9
+ name?: "attachment" | "editorFiles" | undefined;
10
10
  network?: Pick<Network, "token" | "postFile" | "getUrl"> | undefined;
11
11
  onUploadStart: (count?: number) => void;
12
12
  onUploadSuccess: (response: jFileLittle) => void;
@@ -23,6 +23,8 @@ export type JRCButtonDropdownProps = {
23
23
  options: Array<JRCButtonDropdownOptionProps>;
24
24
  semiTransparentClosed?: boolean;
25
25
  disabled?: boolean;
26
+ defaultOpen?: boolean;
27
+ onClose?: () => void;
26
28
  };
27
29
  export type ButtonProps = {
28
30
  borderLeft?: boolean;
@@ -1,16 +1,19 @@
1
- import React from 'react';
2
- import { CalendarEventListAbstractType, CalendarEventWithExtensions, JGlobalApi } from 'jamespot-user-api';
1
+ import React, { ReactNode } from 'react';
2
+ import { CalendarEventViewAbstractType, CalendarEventWithExtensions, JArticleApi, JCalendarApi, JGlobalApi } from 'jamespot-user-api';
3
3
  export type JRCCalendarProps = {
4
- events?: CalendarEventWithExtensions<CalendarEventListAbstractType, ['socialEventRecord']>[];
5
- onClickEvent?: (id: number) => void;
4
+ events?: CalendarEventWithExtensions<CalendarEventViewAbstractType, ['socialEventRecord']>[];
6
5
  loading?: boolean;
7
6
  onChangeDates?: (start: Date, end: Date) => void;
8
7
  onError: (errorMsg?: string) => void;
9
- onUpdateActionSuccess: () => void;
8
+ onSuccess: (message: string) => void;
10
9
  handler: {
11
10
  global: Pick<JGlobalApi, 'updateAction'>;
11
+ calendar: Pick<JCalendarApi, 'reviveSubmit'>;
12
+ article: Pick<JArticleApi, 'delete'>;
12
13
  };
13
- defaultView: 'calendar' | 'list';
14
+ defaultView: CalendarView;
15
+ eventModalExtraComponent?: (event: CalendarEventWithExtensions<CalendarEventViewAbstractType, ['socialEventRecord']>) => ReactNode;
16
+ onChangeView?: (view: CalendarView) => void;
14
17
  };
15
18
  export type CalendarView = 'dayGridMonth' | 'timeGridWeek' | 'timeGridDay' | 'list';
16
- export declare const JRCCalendar: ({ events, onClickEvent, loading, onChangeDates, onError, handler, onUpdateActionSuccess, defaultView, }: JRCCalendarProps) => React.JSX.Element;
19
+ export declare const JRCCalendar: ({ events, loading, onChangeDates, onError, handler, onSuccess, defaultView, eventModalExtraComponent, onChangeView, }: JRCCalendarProps) => React.JSX.Element;
@@ -1,14 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { CalendarView } from './JRCCalendar';
3
- import { Audience, JGlobalApi, UserResponseStatus } from 'jamespot-user-api';
4
- export type JRCCalendarMonthEventProps = {
3
+ import { Audience, JCalendarApi, JGlobalApi, UserResponseStatus } from 'jamespot-user-api';
4
+ import { SubscriptionModifiers } from './JRCEventStatusButton';
5
+ export type JRCCalendarEventProps = {
5
6
  id: string;
6
7
  title: string;
7
8
  start: Date | null;
8
9
  end: Date | null;
9
10
  status: UserResponseStatus | null;
10
11
  display: CalendarView;
11
- onClick?: (id: number) => void;
12
+ onClick: (id: number) => void;
12
13
  audience: Pick<Audience, '_url' | 'title' | 'uri'>[];
13
14
  allDay?: boolean;
14
15
  textColor?: string;
@@ -19,8 +20,14 @@ export type JRCCalendarMonthEventProps = {
19
20
  isVisio?: boolean;
20
21
  handler: {
21
22
  global: Pick<JGlobalApi, 'updateAction'>;
23
+ calendar: Pick<JCalendarApi, 'reviveSubmit'>;
22
24
  };
23
25
  onError: (errMsg?: string) => void;
24
- onUpdateSuccess: () => void;
26
+ onSuccess: (message: string) => void;
27
+ noGestion: boolean;
28
+ setSubscriptionModifiers: (fn: (prev: SubscriptionModifiers) => SubscriptionModifiers) => void;
29
+ uri: string;
30
+ canSubscribe: boolean;
31
+ subscriptionModifiers: SubscriptionModifiers;
25
32
  };
26
- export declare const JRCCalendarEvent: ({ status, title, start, end, display, id: stringId, onClick, audience, allDay, textColor, backgroundColor, address, image, type, isVisio, handler, onError, onUpdateSuccess, }: JRCCalendarMonthEventProps) => React.JSX.Element | null;
33
+ export declare const JRCCalendarEvent: ({ status, title, start, end, display, id: stringId, onClick, audience, allDay, textColor, backgroundColor, address, image, type, isVisio, handler, onError, onSuccess, noGestion, setSubscriptionModifiers, uri, canSubscribe, subscriptionModifiers, }: JRCCalendarEventProps) => React.JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { CalendarEventViewAbstractType, CalendarEventWithExtensions, JArticleApi, JCalendarApi, JGlobalApi } from 'jamespot-user-api';
3
+ import { SubscriptionModifiers } from './JRCEventStatusButton';
4
+ export type JRCCalendarModalProps = {
5
+ event?: CalendarEventWithExtensions<CalendarEventViewAbstractType, ['socialEventRecord']>;
6
+ open: boolean;
7
+ closeHandler: () => void;
8
+ handler: {
9
+ article: Pick<JArticleApi, 'delete'>;
10
+ calendar: Pick<JCalendarApi, 'reviveSubmit'>;
11
+ global: Pick<JGlobalApi, 'updateAction'>;
12
+ };
13
+ onError: (errorMsg?: string) => void;
14
+ onSuccess: (message: string) => void;
15
+ extraComponent?: (event: CalendarEventWithExtensions<CalendarEventViewAbstractType, ['socialEventRecord']>) => ReactNode;
16
+ setSubscriptionModifiers: (fn: (prev: SubscriptionModifiers) => SubscriptionModifiers) => void;
17
+ subscriptionModifiers: SubscriptionModifiers;
18
+ };
19
+ export declare const JRCCalendarModal: ({ open, closeHandler, event, handler, onError, onSuccess, extraComponent, setSubscriptionModifiers, subscriptionModifiers, }: JRCCalendarModalProps) => React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { JGlobalApi, UserResponseStatus } from 'jamespot-user-api';
3
+ export type SubscriptionModifiers = {
4
+ uri: string;
5
+ modifier: number;
6
+ status: UserResponseStatus;
7
+ }[];
8
+ export type JRCEventStatusButtonProps = {
9
+ eventId: number;
10
+ eventType: string;
11
+ initialStatus?: UserResponseStatus | null;
12
+ eventIsVisio?: boolean;
13
+ onUpdateStatus?: (status: UserResponseStatus) => void;
14
+ onError: (errorMessage: string) => void;
15
+ onSuccess: (message: string) => void;
16
+ handler: {
17
+ global: Pick<JGlobalApi, 'updateAction'>;
18
+ };
19
+ canSubscribe?: boolean;
20
+ setSubscriptionModifiers: (fn: (prev: SubscriptionModifiers) => SubscriptionModifiers) => void;
21
+ eventUri: string;
22
+ status: UserResponseStatus | null;
23
+ };
24
+ export declare const JRCEventStatusButton: ({ onError, handler, onSuccess, eventId, eventUri, eventType, eventIsVisio, initialStatus, canSubscribe, setSubscriptionModifiers, status, }: JRCEventStatusButtonProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { UserResponseStatus } from 'jamespot-user-api';
2
+ import { Colors } from '../../styles/theme';
3
+ export declare const useResponseStatus: () => {
4
+ getStatusColor: (status: UserResponseStatus | null) => Colors;
5
+ getStatusLabel: (status: UserResponseStatus | null) => string;
6
+ };
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { JRCButtonDropdownOptionProps } from '../JRCButtonDropdown/JRCButtonDropdown.types';
2
3
  /**
3
4
  * Type for JRCSidePanelModal props
4
5
  */
@@ -14,6 +15,7 @@ export type JRCSidePanelModalProps = {
14
15
  removePadding?: boolean;
15
16
  inplace?: boolean;
16
17
  offsetTop?: number;
18
+ optionsButton?: JRCButtonDropdownOptionProps[];
17
19
  };
18
20
  /**
19
21
  * ℹ️⚠️
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -100,7 +100,7 @@
100
100
  "chroma-js": "^2.1.1",
101
101
  "classnames": "^2.3.1",
102
102
  "dompurify": "^3.0.5",
103
- "jamespot-user-api": "^1.2.17",
103
+ "jamespot-user-api": "^1.2.19",
104
104
  "react": "^17.x",
105
105
  "react-beautiful-dnd": "^13.1.1",
106
106
  "react-dnd": "^14.0.4",