jamespot-react-components 1.0.244 → 1.0.246

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,9 +1,9 @@
1
+ import React, { ReactElement } from 'react';
1
2
  import { jFileLittle } from 'jamespot-user-api';
2
- import React from 'react';
3
3
  type EditorImageUploadProps = {
4
4
  token: string;
5
5
  initialFile?: jFileLittle;
6
- children(open: () => void, openCrop: () => void): React.ReactElement<HTMLElement>;
6
+ children(open: () => void, openCrop: () => void): ReactElement<HTMLElement>;
7
7
  onUploadSuccess: (file: jFileLittle) => void;
8
8
  };
9
9
  export declare const EditorImageUpload: ({ token, children, initialFile, onUploadSuccess }: EditorImageUploadProps) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Editor } from '@tinymce/tinymce-react';
3
- import { LegacyRef } from 'react';
3
+ import { Ref } from 'react';
4
4
  import { TinyMCECommonOptions } from 'jamespot-user-api';
5
5
  import { DataCy } from '../../../../types/dataAttributes';
6
6
  import { TinyMCEExtension } from './extensions/JTinyMCEExtensions';
@@ -24,7 +24,7 @@ export type JRCInputTinyMCERawProps = DataCy & {
24
24
  };
25
25
  onBlur?: () => void;
26
26
  onChange: (html: string, text: string) => void;
27
- ref?: LegacyRef<Editor>;
27
+ ref?: Ref<Editor>;
28
28
  tinymceScriptSrc?: string;
29
29
  autoFocus?: boolean;
30
30
  inline?: boolean;
@@ -38,4 +38,27 @@ export type JRCInputTinyMCERawProps = DataCy & {
38
38
  autofocus?: boolean;
39
39
  readOnly?: boolean;
40
40
  };
41
- export declare const JRCInputTinyMCERaw: ({ dataCy, token, value, onBlur, onChange, mentionsQueries, tinymceScriptSrc, autoFocus, inline, placeholder, additionalExtensions, ref, height, autofocus, ...props }: JRCInputTinyMCERawProps) => React.JSX.Element;
41
+ export declare const JRCInputTinyMCERaw: React.ForwardRefExoticComponent<Omit<DataCy & {
42
+ token?: string | undefined;
43
+ commonOptions: TinyMCECommonOptions;
44
+ additionalExtensions?: TinyMCEExtension[] | undefined;
45
+ value: string | {
46
+ html: string;
47
+ text: string;
48
+ };
49
+ onBlur?: (() => void) | undefined;
50
+ onChange: (html: string, text: string) => void;
51
+ ref?: React.Ref<Editor> | undefined;
52
+ tinymceScriptSrc?: string | undefined;
53
+ autoFocus?: boolean | undefined;
54
+ inline?: boolean | undefined;
55
+ placeholder?: string | undefined;
56
+ mentionsQueries: {
57
+ users: MentionQuery;
58
+ tags: MentionQuery;
59
+ contents: MentionQuery;
60
+ };
61
+ height?: number | undefined;
62
+ autofocus?: boolean | undefined;
63
+ readOnly?: boolean | undefined;
64
+ }, "ref"> & React.RefAttributes<Editor>>;
@@ -1,6 +1,10 @@
1
- import * as React from 'react';
2
- import { JRCInputSelectProps, NativeSelectProps } from './JRCInputSelect.types';
1
+ import React from 'react';
2
+ import { JRCInputSelectProps } from './JRCInputSelect.types';
3
3
  import type { FieldValues } from 'react-hook-form';
4
- export declare const Select: <T extends FieldValues = FieldValues>(props: Pick<Partial<NativeSelectProps<T>>, "ref"> & Omit<NativeSelectProps<T>, "ref">) => JSX.Element;
5
- export declare function JRCInputSelect<T extends FieldValues = FieldValues>(props: JRCInputSelectProps<T>): React.JSX.Element;
6
- export declare const JRCInputSelectRaw: <T extends FieldValues = FieldValues>(props: Pick<Partial<NativeSelectProps<T>>, "ref"> & Omit<NativeSelectProps<T>, "ref">) => JSX.Element;
4
+ type SelectOption = {
5
+ label: string;
6
+ value: any;
7
+ resetOptions?: boolean;
8
+ };
9
+ export declare function JRCInputSelect<T extends FieldValues = FieldValues>(props: Omit<JRCInputSelectProps<T, SelectOption>, 'getLabel' | 'getValue'>): React.JSX.Element;
10
+ export {};
@@ -9,4 +9,4 @@ type Data = {
9
9
  export declare const InputSelect: Story<JRCInputSelectProps<{
10
10
  select: Data;
11
11
  select2: Array<Data>;
12
- }>>;
12
+ }, any>>;
@@ -8,8 +8,8 @@ import { PartialBy } from '../../../../types/utils';
8
8
  /**
9
9
  * Select
10
10
  */
11
- export type NativeSelectProps<T extends FieldValues = FieldValues> = PartialBy<ControllerRenderProps<T>, 'onBlur'> & SelectProps & IconsProp;
12
- export type JRCInputSelectProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & SelectProps & IconsProp;
11
+ export type NativeSelectProps<T extends FieldValues = FieldValues, U = any> = PartialBy<ControllerRenderProps<T>, 'onBlur'> & SelectProps<U> & IconsProp;
12
+ export type JRCInputSelectProps<T extends FieldValues = FieldValues, U = any> = JRCInputFieldProps<T> & SelectProps<U> & IconsProp;
13
13
  export type Getter = ((option: any) => any) | string;
14
14
  export type IconsProp = {
15
15
  iconBefore?: {
@@ -18,34 +18,34 @@ export type IconsProp = {
18
18
  onClick?: () => void;
19
19
  };
20
20
  };
21
- export type SelectProps = DataCy & {
22
- options?: Array<any>;
21
+ export type SelectProps<T = any> = DataCy & {
22
+ options?: Array<T>;
23
23
  asyncPromise?: (inputValue: string, page?: number) => Promise<any[]>;
24
24
  multiple?: boolean;
25
- getLabel?: ((option: any) => any) | string;
26
- getValue?: ((option: any) => any) | string;
27
- getDescription?: (option: any) => any;
25
+ getLabel?: ((option: T) => string) | string;
26
+ getValue?: ((option: T) => string) | string;
27
+ getDescription?: (option: T) => T;
28
28
  disabled?: boolean;
29
29
  readOnly?: boolean;
30
30
  placeholder?: string;
31
31
  searchable?: boolean;
32
- getSearch?: ((option: any) => any) | string;
32
+ getSearch?: ((option: T) => string) | string;
33
33
  group?: boolean;
34
- getGroup?: ((option: any) => any) | string;
34
+ getGroup?: ((option: T) => string) | string;
35
35
  views?: Array<'folder' | 'user' | 'group' | 'community'>;
36
36
  onConfirm?: (values: any) => void;
37
37
  hideSelectedOption?: boolean;
38
38
  hideDeleteIcon?: boolean;
39
39
  displayOption?: boolean;
40
40
  displayIndicator?: boolean;
41
- getOptionsSelected?: (options: any) => void;
42
- setOptionsSelected?: any;
41
+ getOptionsSelected?: (options: T) => void;
42
+ setOptionsSelected?: T;
43
43
  components?: {
44
44
  Option?: React.ComponentType<{
45
- option: any;
45
+ option: T;
46
46
  }>;
47
47
  SelectedOption?: React.ComponentType<{
48
- option: any;
48
+ option: T;
49
49
  }>;
50
50
  };
51
51
  /**
@@ -8,4 +8,4 @@ type Data = {
8
8
  };
9
9
  export declare const AsyncSelect: Story<JRCInputSelectProps<{
10
10
  select: Array<Data>;
11
- }>>;
11
+ }, any>>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { JRCInputSelectProps } from './JRCInputSelect.types';
3
+ import type { FieldValues } from 'react-hook-form';
4
+ export declare function JRCInputSelectExtended<T extends FieldValues = FieldValues>(props: JRCInputSelectProps<T>): React.JSX.Element;
@@ -11,7 +11,7 @@ export type JRCInputSelectHierarchicalTreeProps = Omit<JRCInputSelectProps, 'asy
11
11
  value: any;
12
12
  }>;
13
13
  };
14
- export declare const JRCInputSelectHierarchicalTree: React.ForwardRefExoticComponent<Omit<JRCInputSelectProps<import("react-hook-form").FieldValues>, "asyncPromise"> & JRCModalLayoutProps & {
14
+ export declare const JRCInputSelectHierarchicalTree: React.ForwardRefExoticComponent<Omit<JRCInputSelectProps<import("react-hook-form").FieldValues, any>, "asyncPromise"> & JRCModalLayoutProps & {
15
15
  asyncPromise?: ((inputValue: string, page?: number) => Promise<PagingResults<any>>) | undefined;
16
16
  hierarchicalTaxonomyPromise: (uriConcept: string) => Promise<PagingResults<jObjectAutocomplete>>;
17
17
  displayModal?: boolean | undefined;
@@ -0,0 +1,3 @@
1
+ import { NativeSelectProps } from './JRCInputSelect.types';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ export declare const JRCInputSelectRaw: <T extends FieldValues = FieldValues, U = any>(props: Pick<Partial<NativeSelectProps<T, U>>, "ref"> & Omit<NativeSelectProps<T, U>, "ref">) => JSX.Element;
@@ -15,6 +15,7 @@ export type JRCCommentsBlocProps = {
15
15
  tinyMCEConfig: Pick<JRCInputTinyMCERawProps, 'commonOptions' | 'mentionsQueries' | 'tinymceScriptSrc'>;
16
16
  onComment: (params: Pick<AddCommentParams, 'content' | 'alertAuthor' | 'sendAlert'>) => Promise<void>;
17
17
  isWidgetActive?: boolean;
18
+ canCreateWidget?: boolean;
18
19
  widgetListComponent: React.ReactNode;
19
20
  newWidgetsWrapperComponent: React.ReactNode;
20
21
  existingWidgetsWrapperComponent: (comment: jCommentList, widgets: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean) => React.ReactNode;
@@ -52,4 +53,4 @@ export type JRCCommentsBlocProps = {
52
53
  onReport: (commentUri: string) => void;
53
54
  };
54
55
  export declare const AvatarWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
55
- export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, isWidgetActive, widgetListComponent, newWidgetsWrapperComponent, existingWidgetsWrapperComponent, loading, token, onCommentDelete, onCommentUpdate, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, activeDrives, variant, canComment, handlers, socialQuestion, articleId, additionalExtensions, onReport, }: JRCCommentsBlocProps) => React.JSX.Element;
56
+ export declare const JRCCommentsBloc: ({ comments, initialCommentsNumber, currentUser, tinyMCEConfig, onComment, canCreateWidget, isWidgetActive, widgetListComponent, newWidgetsWrapperComponent, existingWidgetsWrapperComponent, loading, token, onCommentDelete, onCommentUpdate, onError, highlightFields, userModel, userAccountStatus, isWedocActive, getAccessHash, onGetHashError, activeDrives, variant, canComment, handlers, socialQuestion, articleId, additionalExtensions, onReport, }: JRCCommentsBlocProps) => React.JSX.Element;
@@ -20,9 +20,9 @@ export type NewCommentProps = {
20
20
  };
21
21
  onError?: (message?: string) => void;
22
22
  activeDrives: DriveOrFilebank[];
23
- isWidgetActive?: boolean;
23
+ canCreateWidget?: boolean;
24
24
  socialQuestion?: boolean;
25
25
  deleteFile?: (id: number) => Promise<void>;
26
26
  additionalExtensions: Array<TinyMCEExtension>;
27
27
  };
28
- export declare const NewComment: ({ newWidgetsWrapperComponent, widgetListComponent, canComment, loading, currentUser, onComment, onError, tinyMCEConfig, token, handlers, activeDrives, isWidgetActive, socialQuestion, deleteFile, additionalExtensions, }: NewCommentProps) => React.JSX.Element;
28
+ export declare const NewComment: ({ newWidgetsWrapperComponent, widgetListComponent, canComment, loading, currentUser, onComment, onError, tinyMCEConfig, token, handlers, activeDrives, canCreateWidget, socialQuestion, deleteFile, additionalExtensions, }: NewCommentProps) => React.JSX.Element;
@@ -21,7 +21,6 @@ export declare const JRCModalBody: import("styled-components").StyledComponent<"
21
21
  modalOverflow?: "hidden" | "auto" | "scroll" | "visible" | undefined;
22
22
  }, never>;
23
23
  export declare const JRCModalContentFull: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
- export declare const JRCModalContentScrollbox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
25
24
  export declare const JRCModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
26
25
  modalOverflow?: "hidden" | "auto" | "scroll" | "visible" | undefined;
27
26
  }, never>;
@@ -1,5 +1,5 @@
1
- import { WidgetCheckListContent } from 'jamespot-user-api';
2
1
  import React from 'react';
2
+ import { WidgetCheckListContent } from 'jamespot-user-api';
3
3
  export declare const CSSRowLinkWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
4
  border?: boolean | undefined;
5
5
  }, never>;
@@ -82,7 +82,9 @@ export { JRCInputUrl } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
82
82
  export { JRCInputCommunity } from './components/Form/Input/JRCSelect/JRCAutocompleteCommunity';
83
83
  export { JRCInputAudience } from './components/Form/Input/JRCSelect/JRCInputAudience';
84
84
  export { JRCInputAutocomplete } from './components/Form/Input/JRCSelect/JRCInputAutocomplete';
85
- export { JRCInputSelect, JRCInputSelectRaw } from './components/Form/Input/JRCSelect/JRCInputSelect';
85
+ export { JRCInputSelect } from './components/Form/Input/JRCSelect/JRCInputSelect';
86
+ export { JRCInputSelectExtended } from './components/Form/Input/JRCSelect/JRCInputSelectExtended';
87
+ export { JRCInputSelectRaw } from './components/Form/Input/JRCSelect/JRCInputSelectRaw';
86
88
  export { JRCInputSelectHierarchicalTree } from './components/Form/Input/JRCSelect/JRCInputSelectHierarchicalTree';
87
89
  export { JRCInputSelectList } from './components/Form/Input/JRCSelect/JRCInputSelectList';
88
90
  export { JRCAlert } from './components/JRCAlert/JRCAlert';
@@ -213,4 +215,3 @@ export { JTinyMCEExtensionsBuilders } from './components/Form/Input/JRCInputTiny
213
215
  */
214
216
  export * from './types';
215
217
  export { Utils } from './utils';
216
- export { FormControls } from './components/Form/Input/Common/useFormControls';
@@ -4,6 +4,7 @@ export type { MessageType } from './components/Common/util/getColor.util';
4
4
  export * from './components/Form/Common/types';
5
5
  export type { JRCValueLabelProps } from './components/Form/Common/types';
6
6
  export type { JRCInputFieldProps, NameControl } from './components/Form/Input/Common/JRCFormFieldRenderer.types';
7
+ export type { FormControls } from './components/Form/Input/Common/useFormControls';
7
8
  export type { JRCAutocompleteAudienceProps } from './components/Form/Input/Deprecated/JRCFormAutocomplete/JRCFormAutocompleteAudience';
8
9
  export type { JRCAutocompleteTaxonomyProps } from './components/Form/Input/Deprecated/JRCFormAutocomplete/JRCFormAutocompleteTaxonomy';
9
10
  export type { JRCFormCheckboxProps } from './components/Form/Input/Deprecated/JRCFormCheckbox/JRCFormCheckbox.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.244",
3
+ "version": "1.0.246",
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.218",
83
+ "jamespot-user-api": "^1.0.219",
84
84
  "moment": "2.29.4",
85
85
  "react": "^17.x",
86
86
  "react-beautiful-dnd": "^13.1.1",