jamespot-react-components 1.0.242 → 1.0.243

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.
Files changed (32) hide show
  1. package/build/jamespot-react-components.js +775 -775
  2. package/build/jamespot-react-components.js.map +1 -1
  3. package/build/src/components/Form/Input/Common/JRCFormErrors.d.ts +1 -1
  4. package/build/src/components/Form/Input/Common/JRCFormFieldRenderer.types.d.ts +2 -2
  5. package/build/src/components/Form/Input/Common/useFormControls.d.ts +1 -1
  6. package/build/src/components/Form/Input/Deprecated/JRCFormSelect/JRCFormSelect.d.ts +1 -1
  7. package/build/src/components/Form/Input/Deprecated/JRCFormSelect/JRCFormSelectTag.d.ts +1 -1
  8. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.d.ts +2 -2
  9. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.types.d.ts +2 -2
  10. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputReorderCheckbox.d.ts +2 -2
  11. package/build/src/components/Form/Input/JRCInputColor/JRCInputColor.d.ts +1 -1
  12. package/build/src/components/Form/Input/JRCInputDate/JRCInputDate.d.ts +1 -1
  13. package/build/src/components/Form/Input/JRCInputDateTime/JRCInputDateTime.d.ts +1 -1
  14. package/build/src/components/Form/Input/JRCInputEmail/JRCInputEmail.d.ts +1 -1
  15. package/build/src/components/Form/Input/JRCInputFile/JRCInputFile.d.ts +1 -1
  16. package/build/src/components/Form/Input/JRCInputImage/JRCInputImage.d.ts +1 -1
  17. package/build/src/components/Form/Input/JRCInputRange/JRCInputRange.d.ts +1 -1
  18. package/build/src/components/Form/Input/JRCInputText/JRCInputPassword.d.ts +1 -1
  19. package/build/src/components/Form/Input/JRCInputText/JRCInputText.d.ts +1 -1
  20. package/build/src/components/Form/Input/JRCInputTextarea/JRCInputTextarea.d.ts +1 -1
  21. package/build/src/components/Form/Input/JRCInputTime/JRCInputTime.d.ts +1 -1
  22. package/build/src/components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE.d.ts +1 -1
  23. package/build/src/components/Form/Input/JRCInputUrl/JRCInputUrl.d.ts +1 -1
  24. package/build/src/components/Form/Input/JRCSelect/JRCAutocompleteCommunity.d.ts +1 -1
  25. package/build/src/components/Form/Input/JRCSelect/JRCInputAudience.d.ts +1 -1
  26. package/build/src/components/Form/Input/JRCSelect/JRCInputAutocomplete.d.ts +1 -1
  27. package/build/src/components/Form/Input/JRCSelect/JRCInputSelect.types.d.ts +2 -2
  28. package/build/src/components/JRCCommentsBloc/JRCComment.d.ts +2 -2
  29. package/build/src/components/JRCCommentsBloc/JRCCommentsBloc.d.ts +2 -2
  30. package/build/src/components/JRCModal/JRCModalContent.d.ts +2 -1
  31. package/build/src/index.d.ts +1 -0
  32. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FieldError } from 'react-hook-form/dist/types/errors';
2
+ import { FieldError } from 'react-hook-form';
3
3
  /**
4
4
  * Component that displays a list of input error if any.
5
5
  * The required message is not displayed within this component.
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { JRCTooltipProps } from '../../../JRCTooltip/JRCTooltip';
3
- import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
3
+ import { ControllerRenderProps } from 'react-hook-form';
4
4
  import { FormControls, JRCFormControls } from './useFormControls';
5
5
  import { UseControllerProps, FieldValues } from 'react-hook-form';
6
6
  import { DataCy } from '../../../../types/dataAttributes';
7
- import { RegisterOptions } from 'react-hook-form/dist/types/validator';
7
+ import { RegisterOptions } from 'react-hook-form';
8
8
  /**
9
9
  * Form field render props that might be provided outside of this library
10
10
  * @member label, label
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { RegisterOptions, ValidationRule, ValidationValue } from 'react-hook-form/dist/types/validator';
2
+ import { RegisterOptions, ValidationRule, ValidationValue } from 'react-hook-form';
3
3
  import { IntlShape } from 'react-intl/src/types';
4
4
  export type AllowedDefaultTypes = 'required' | 'min' | 'max' | 'maxLength' | 'minLength' | 'pattern';
5
5
  export type FormControls = Pick<RegisterOptions, AllowedDefaultTypes>;
@@ -3,7 +3,7 @@ import { WrappedFieldInputProps } from 'redux-form';
3
3
  import { ExternalFormFieldRenderProps, InputState } from '../JRCFormFieldRender';
4
4
  import { JRCValueLabelProps } from 'components/Form/Common/types';
5
5
  import { SelectComponentsConfig } from 'react-select/src/components';
6
- import { FieldValues } from 'react-hook-form/dist/types';
6
+ import { FieldValues } from 'react-hook-form';
7
7
  /**
8
8
  * @deprecated Use JRCInputSelect alternatives instead
9
9
  */
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { JRCFormSelectProps } from './JRCFormSelect';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  /**
5
5
  * Component used as a select sync or async with custom display: options are JRCTags
6
6
  * options (or asyncPromise) elements should have a uri and a name attributes
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
2
+ import { ControllerRenderProps } from 'react-hook-form';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
5
- import { FieldValues } from 'react-hook-form/dist/types';
5
+ import { FieldValues } from 'react-hook-form';
6
6
  import { PartialBy } from '../../../../types/utils';
7
7
  export declare const ReadOnlyBorder: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
8
  type CheckboxOption<TFieldValues> = {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
- import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
4
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { ControllerRenderProps } from 'react-hook-form';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type CheckboxValue<T extends FieldValues = FieldValues> = string | number | T;
6
6
  export type CheckboxOption<TFieldValues extends FieldValues = FieldValues> = {
7
7
  label: string | JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
2
+ import { ControllerRenderProps } from 'react-hook-form';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
5
- import { FieldValues } from 'react-hook-form/dist/types';
5
+ import { FieldValues } from 'react-hook-form';
6
6
  type CheckboxOption<TFieldValues> = {
7
7
  label: string | JSX.Element;
8
8
  value: string | number | TFieldValues;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { JRCInputColorRawProps } from './JRCInputColorRawProps';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
5
5
  export type JRCColorPickerProps<T extends FieldValues> = Omit<JRCInputFieldProps<T>, 'placeholder' | 'labelIsLegend'> & Omit<JRCInputColorRawProps, 'onChange' | 'name' | 'description' | 'label'>;
6
6
  export declare const JRCInputColor: <T extends FieldValues = FieldValues>({ initialValue, palettes, disabled, ...props }: JRCColorPickerProps<T>) => React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type NativeInputProps = DataCy & React.ComponentPropsWithoutRef<'input'> & {
6
6
  type?: 'date' | 'time' | 'datetime-local';
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type NativeInputProps = DataCy & React.ComponentPropsWithoutRef<'input'> & {
6
6
  type?: 'date' | 'time' | 'datetime-local';
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  /**
5
5
  * Component used as a <input type="text"/>
6
6
  * @param rules validation rules applied to the field
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  import { ApiWrapper, jFileLittle } from 'jamespot-user-api';
6
6
  export type NativeInputFileProps = DataCy & Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'onChange'> & {
7
7
  token?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  import { jFileLittle } from 'jamespot-user-api';
6
6
  export type NativeInputImageProps = DataCy & Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'onChange'> & {
7
7
  token?: string | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type JRCInputRangeProps = DataCy & React.ComponentPropsWithoutRef<'input'>;
6
6
  export declare const InputRange: React.ForwardRefExoticComponent<DataCy & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type JRCInputTextProps = DataCy & Omit<React.ComponentPropsWithoutRef<'input'>, 'type'> & {
6
6
  width?: string;
7
7
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FieldValues } from 'react-hook-form/dist/types';
2
+ import { FieldValues } from 'react-hook-form';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
5
5
  export type JRCInputTextProps = DataCy & React.ComponentPropsWithoutRef<'input'> & {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type JRCInputTextareaProps = DataCy & React.ComponentPropsWithoutRef<'textarea'>;
6
6
  /**
7
7
  * Component used as a <input type="text"/>
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type JRCInputTimeProps = DataCy & React.ComponentPropsWithoutRef<'input'>;
6
6
  /**
7
7
  * Component used as a <input type="hour"/>
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  import { TinyMCECommonOptions } from 'jamespot-user-api';
5
5
  import { MentionQuery } from '../JRCInputTinyMCERaw/JRCInputTinyMCERaw';
6
6
  import { TinyMCEExtension } from '../JRCInputTinyMCERaw/extensions/JTinyMCEExtensions';
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  export type JRCInputUrlProps = DataCy & React.ComponentPropsWithoutRef<'input'> & {
6
6
  width?: string;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  export type JRCAutocompleteCommunityProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & {
5
5
  multiple?: boolean;
6
6
  searchable?: boolean;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FieldValues } from 'react-hook-form/dist/types';
2
+ import { FieldValues } from 'react-hook-form';
3
3
  import { JRCAutocompleteProps } from './JRCInputSelect.types';
4
4
  export type JRCInputAudienceProps<T extends FieldValues = FieldValues> = JRCAutocompleteProps<T> & {
5
5
  multiple?: boolean;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AutocompleteLittle, JRCAutocompleteProps, NativeAutocompleteProps } from './JRCInputSelect.types';
3
- import { FieldValues } from 'react-hook-form/dist/types';
3
+ import { FieldValues } from 'react-hook-form';
4
4
  export declare function CustomOption({ option, }: {
5
5
  option: AutocompleteLittle & {
6
6
  newOption?: boolean;
@@ -1,7 +1,7 @@
1
1
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
2
- import { ControllerRenderProps } from 'react-hook-form/dist/types/controller';
2
+ import { ControllerRenderProps } from 'react-hook-form';
3
3
  import { DataCy } from '../../../../types/dataAttributes';
4
- import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { FieldValues } from 'react-hook-form';
5
5
  import { Colors, Shades } from 'styles/theme';
6
6
  import React from 'react';
7
7
  import { PartialBy } from '../../../../types/utils';
@@ -1,4 +1,4 @@
1
- import { Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, JFilebankApi, JFileApi, JSocialActionApi, JUserApi, WithExtension } from 'jamespot-user-api';
1
+ import { Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, JFilebankApi, JFileApi, JSocialActionApi, JUserApi, CommentWithExtensions } 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';
@@ -6,7 +6,7 @@ import { JDriveApi } from 'jamespot-user-api/lib/src/apis/drive/drive';
6
6
  import { JQuestionAnswerApi } from 'jamespot-user-api/lib/src/apis/questionAnswer/questionAnswer';
7
7
  export type JRCCommentProps = {
8
8
  isFocused: boolean;
9
- comment: WithExtension<jCommentList> & {
9
+ comment: CommentWithExtensions<jCommentList, ['actions']> & {
10
10
  pending?: boolean;
11
11
  };
12
12
  token?: string;
@@ -1,4 +1,4 @@
1
- import { AddCommentParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, JFilebankApi, JFileApi, JSocialActionApi, JUserApi, WithExtension } from 'jamespot-user-api';
1
+ import { AddCommentParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, JFilebankApi, JFileApi, JSocialActionApi, JUserApi, CommentWithExtensions } 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';
@@ -7,7 +7,7 @@ import { JDriveApi } from 'jamespot-user-api/lib/src/apis/drive/drive';
7
7
  import { JQuestionAnswerApi } from 'jamespot-user-api/lib/src/apis/questionAnswer/questionAnswer';
8
8
  import { TinyMCEExtension } from '../Form/Input/JRCInputTinyMCERaw/extensions/JTinyMCEExtensions';
9
9
  export type JRCCommentsBlocProps = {
10
- comments?: Array<WithExtension<jCommentList> & {
10
+ comments?: Array<CommentWithExtensions<jCommentList, ['actions']> & {
11
11
  pending?: boolean;
12
12
  }>;
13
13
  initialCommentsNumber?: number;
@@ -6,6 +6,7 @@ export type JRCModalContentBase = {
6
6
  options?: ReactNode;
7
7
  overflow?: 'visible' | 'hidden' | 'scroll';
8
8
  onClickIconClose?: () => void;
9
+ dataCy?: string;
9
10
  };
10
11
  export type JRCModalContentProps = JRCModalContentBase & {
11
12
  isFull?: boolean;
@@ -26,4 +27,4 @@ export declare const ModalOptions: ({ children }: {
26
27
  export declare const ModalTitle: ({ children }: {
27
28
  children?: React.ReactNode;
28
29
  }) => React.JSX.Element;
29
- export declare const JRCModalContent: ({ title, onClickIconClose, overflow, options, children, buttons, isFull, }: JRCModalContentProps) => React.JSX.Element;
30
+ export declare const JRCModalContent: ({ title, onClickIconClose, overflow, options, children, buttons, isFull, dataCy, }: JRCModalContentProps) => React.JSX.Element;
@@ -213,3 +213,4 @@ export { JTinyMCEExtensionsBuilders } from './components/Form/Input/JRCInputTiny
213
213
  */
214
214
  export * from './types';
215
215
  export { Utils } from './utils';
216
+ export { FormControls } from './components/Form/Input/Common/useFormControls';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.242",
3
+ "version": "1.0.243",
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.216",
83
+ "jamespot-user-api": "^1.0.217",
84
84
  "moment": "2.29.4",
85
85
  "react": "^17.x",
86
86
  "react-beautiful-dnd": "^13.1.1",