jamespot-react-components 1.2.16 → 1.2.18

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;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumProps } from './types';
3
+ export declare const JRCAlbum: ({ files, maxWidth, withAttachments, urlResolve, }: JRCAlbumProps) => React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { JRCAlbum } from './JRCAlbum';
2
+ import { Meta, StoryObj } from '@storybook/react/*';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ type Story = StoryObj<typeof JRCAlbum>;
6
+ export declare const AlbumX1: Story;
7
+ export declare const AlbumX1OpenFileViewer: Story;
8
+ export declare const AlbumX2: Story;
9
+ export declare const AlbumX3WithVideo: Story;
10
+ export declare const AlbumX4: Story;
11
+ export declare const AlbumX5: Story;
12
+ export declare const AlbumX5WithAttachments: Story;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemFile } from '../types';
3
+ export declare const AlbumItem: ({ file, width, height }: {
4
+ file: JRCAlbumItemFile;
5
+ width: number;
6
+ height: number;
7
+ }) => React.JSX.Element;
8
+ export declare const AlbumItemImage: ({ uri }: {
9
+ uri: string;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemProps } from '../types';
3
+ export declare const AlbumX1: ({ files, maxWidth, maxHeight, onClick }: JRCAlbumItemProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemProps } from '../types';
3
+ export declare const AlbumX2: ({ files, maxWidth, onClick }: JRCAlbumItemProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemProps } from '../types';
3
+ export declare const AlbumX3: ({ files, maxWidth, onClick }: JRCAlbumItemProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemProps } from '../types';
3
+ export declare const AlbumX4: ({ files, maxWidth, onClick }: JRCAlbumItemProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { JRCAlbumItemProps } from '../types';
3
+ export declare const AlbumX5: ({ files, maxWidth, onClick }: JRCAlbumItemProps) => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ export declare const ALBUM_GAP = 10;
2
+ export declare const ALBUM_DEFAULT_MAX_WIDTH = 800;
3
+ export declare const ALBUM_SUPPORTED_FILE_FAMILY: string[];
4
+ export declare enum AlbumFamilyType {
5
+ IMAGE = "image",
6
+ VIDEO = "video",
7
+ GIF = "gif"
8
+ }
@@ -0,0 +1,20 @@
1
+ export declare const AlbumWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
+ maxWidth?: string | undefined;
3
+ }, never>;
4
+ export declare const AlbumBackgroundVideoWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
5
+ width: number;
6
+ height: number;
7
+ }, never>;
8
+ export declare const AlbumBackgroundImage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
9
+ uri: string;
10
+ }, never>;
11
+ export declare const AlbumImageWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
12
+ width: number;
13
+ height: number;
14
+ }, never>;
15
+ export declare const AlbumImage: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {}, never>;
16
+ export declare const AlbumOverlay: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
17
+ export declare const AlbumAttachments: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
+ export declare const AlbumRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
+ export declare const AlbumX1Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
+ export declare const AlbumButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,22 @@
1
+ import { jFileLittle } from 'jamespot-user-api';
2
+ export type JRCAlbumProps = {
3
+ files: jFileLittle[];
4
+ maxWidth?: number;
5
+ maxHeight?: number;
6
+ withAttachments?: boolean;
7
+ urlResolve: (file: jFileLittle) => string;
8
+ };
9
+ export type JRCAlbumItemFile = {
10
+ uri: string;
11
+ id: number;
12
+ title: string;
13
+ mimetype: string;
14
+ size: string;
15
+ };
16
+ export type JRCAlbumItemProps = {
17
+ files: JRCAlbumItemFile[];
18
+ maxWidth?: number;
19
+ maxHeight?: number;
20
+ withAttachments?: boolean;
21
+ onClick: (index: number) => void;
22
+ };
@@ -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
  * ℹ️⚠️
@@ -160,6 +160,7 @@ export { JRCMainColumn } from './components/Templates/JRCMainColumn';
160
160
  export { JRCPanel } from './components/Templates/JRCPanel';
161
161
  export { JRCStepperPage } from './components/Templates/JRCStepperPage';
162
162
  export { JRCTemplateTwoColumns } from './components/Templates/JRCTwoColumns.template';
163
+ export { JRCAlbum } from './components/JRCAlbum/JRCAlbum';
163
164
  export { JRCProgressBar } from './components/JRCProgressBar/JRCProgressBar';
164
165
  export { JRCWidgetArticleAttachmentEditor } from './components/Widgets/JRCWidgetAttachment/JRCWidgetArticleAttachmentEditor';
165
166
  export { JRCWidgetAttachment } from './components/Widgets/JRCWidgetAttachment/JRCWidgetAttachment';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
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.16",
103
+ "jamespot-user-api": "^1.2.18",
104
104
  "react": "^17.x",
105
105
  "react-beautiful-dnd": "^13.1.1",
106
106
  "react-dnd": "^14.0.4",