jamespot-react-components 1.0.193 → 1.0.195

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 (24) hide show
  1. package/build/jamespot-react-components.js +844 -852
  2. package/build/jamespot-react-components.js.map +1 -1
  3. package/build/src/components/Form/Input/Deprecated/JRCFormRichText/JRCFormRichTextField.d.ts +17 -18
  4. package/build/src/components/Form/Input/Deprecated/JRCFormRichText/JRCFormRichTextField.stories.d.ts +4 -1
  5. package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.d.ts +1 -0
  6. package/build/src/components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw.d.ts +6 -2
  7. package/build/src/components/JRCCommentsBloc/JRCComment.d.ts +2 -2
  8. package/build/src/components/JRCCommentsBloc/JRCCommentsBloc.d.ts +2 -2
  9. package/build/src/components/JRCFlex/JRCFlexBox.d.ts +1 -1
  10. package/build/src/components/Widgets/JRCWidgetArticleGallery/JRCWidgetArticleGallery.d.ts +17 -1
  11. package/build/src/components/Widgets/JRCWidgetArticleGallery/JRCWidgetArticleGallery.stories.d.ts +17 -2
  12. package/build/src/components/Widgets/JRCWidgetArticleText/JRCWidgetArticleText.stories.d.ts +2368 -2
  13. package/build/src/components/Widgets/JRCWidgetArticleTitle/JRCWidgetArticleTitle.d.ts +8 -2
  14. package/build/src/components/Widgets/JRCWidgetButton/JRCWidgetButtonEditor.d.ts +22 -2
  15. package/build/src/components/Widgets/JRCWidgetSlider/JRCWidgetArticleSliderEditor.d.ts +27 -1
  16. package/build/src/index.d.ts +1 -2
  17. package/build/src/types.d.ts +1 -1
  18. package/package.json +2 -14
  19. package/build/src/components/Form/Input/Deprecated/JRCFormRichText/extensions/mentions/MentionList.d.ts +0 -11
  20. package/build/src/components/Form/Input/Deprecated/JRCFormRichText/extensions/mentions/mention.css.d.ts +0 -4
  21. package/build/src/components/Form/Input/Deprecated/JRCFormRichText/utils/suggestion.d.ts +0 -14
  22. package/build/src/components/Form/Input/Deprecated/JRCFormSelect/utils/Extension.d.ts +0 -18
  23. package/build/src/components/Form/Input/JRCInputRichText/JRCInputRichText.d.ts +0 -26
  24. package/build/src/components/Form/Input/JRCInputRichText/JRCInputRichText.stories.d.ts +0 -7
@@ -1,18 +1,16 @@
1
1
  import * as React from 'react';
2
- import { Editor } from '@tiptap/react';
3
2
  import { JRCWritableFormInputProps } from '../JRCFormFieldRender';
4
- import { EventHandler, EventOrValueHandler } from 'redux-form';
5
- import { FormRichTextFieldOptionsProps, FormRichTextFieldToolbarProps } from '../../JRCInputRichText/JRCInputRichText';
6
3
  import { DataCy } from '../../../../../types/dataAttributes';
7
- /**
8
- * This component is used with redux-form (studio) and with react-hook-form!!
9
- * @deprecated Use JRCInputTinyMCE instead
10
- */
11
- export declare const MenuBar: ({ editor, toolbarOptions, isFixed, }: {
12
- editor: Editor | null;
13
- toolbarOptions: FormRichTextFieldToolbarProps[] | '*';
14
- isFixed: boolean;
15
- }) => React.JSX.Element | null;
4
+ import { MentionQuery } from '../../JRCInputTinyMCERaw/JRCInputTinyMCERaw';
5
+ import { TinyMCECommonOptions } from 'jamespot-user-api';
6
+ export type FormRichTextFieldOptionsProps = {
7
+ commonOptions: TinyMCECommonOptions;
8
+ mentionsQueries: {
9
+ users: MentionQuery;
10
+ tags: MentionQuery;
11
+ contents: MentionQuery;
12
+ };
13
+ };
16
14
  export type RichTextValue = {
17
15
  html: string;
18
16
  text: string;
@@ -21,24 +19,23 @@ export type FormRichTextFieldProps = {
21
19
  name: string;
22
20
  placeholder?: string;
23
21
  value: Partial<RichTextValue> | undefined;
24
- onFocus: EventHandler<React.FocusEvent>;
25
- onBlur: EventOrValueHandler<React.FocusEvent>;
26
22
  onChange: (value: RichTextValue) => void;
27
23
  readOnly?: boolean;
28
24
  } & DataCy;
25
+ /**
26
+ * This component is used with redux-form (studio) and with react-hook-form!!
27
+ */
29
28
  export declare const FormRichTextField: React.ForwardRefExoticComponent<{
30
29
  name: string;
31
30
  placeholder?: string | undefined;
32
31
  value: Partial<RichTextValue> | undefined;
33
- onFocus: EventHandler<React.FocusEvent>;
34
- onBlur: EventOrValueHandler<React.FocusEvent>;
35
32
  onChange: (value: RichTextValue) => void;
36
33
  readOnly?: boolean | undefined;
37
34
  } & DataCy & {
38
35
  inplace?: boolean | undefined;
39
36
  isComponentVisible?: boolean | undefined;
40
37
  } & {
41
- options?: FormRichTextFieldOptionsProps | undefined;
38
+ options: FormRichTextFieldOptionsProps;
42
39
  } & React.RefAttributes<unknown>>;
43
40
  /**
44
41
  * Component used as a <input type="text"/>
@@ -46,4 +43,6 @@ export declare const FormRichTextField: React.ForwardRefExoticComponent<{
46
43
  * validation props: required
47
44
  * @returns JSX.Element
48
45
  */
49
- export declare const JRCFormRichTextField: (props: JRCWritableFormInputProps) => React.JSX.Element;
46
+ export declare const JRCFormRichTextField: (props: JRCWritableFormInputProps & {
47
+ tinyMCE: FormRichTextFieldOptionsProps;
48
+ }) => React.JSX.Element;
@@ -1,5 +1,8 @@
1
+ import { FormRichTextFieldOptionsProps } from './JRCFormRichTextField';
1
2
  import { JRCWritableFormInputProps } from '../JRCFormFieldRender';
2
3
  import { Meta, Story } from '@storybook/react';
3
4
  declare const _default: Meta<import("@storybook/react").Args>;
4
5
  export default _default;
5
- export declare const RichText: Story<JRCWritableFormInputProps>;
6
+ export declare const RichText: Story<JRCWritableFormInputProps & {
7
+ tinyMCE: FormRichTextFieldOptionsProps;
8
+ }>;
@@ -4,6 +4,7 @@ import { DataCy } from '../../../../types/dataAttributes';
4
4
  import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
5
5
  import { FieldValues } from 'react-hook-form/dist/types';
6
6
  import { PartialBy } from '../../../../types/utils';
7
+ export declare const ReadOnlyBorder: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
8
  type CheckboxOption<TFieldValues> = {
8
9
  label: string | JSX.Element;
9
10
  value: string | number | TFieldValues;
@@ -18,9 +18,12 @@ export type JRCInputTinyMCERawProps = DataCy & {
18
18
  token?: string;
19
19
  commonOptions: TinyMCECommonOptions;
20
20
  additionalExtensions?: Array<TinyMCEExtension>;
21
- value: string;
21
+ value: string | {
22
+ html: string;
23
+ text: string;
24
+ };
22
25
  onBlur?: () => void;
23
- onChange: (v: string) => void;
26
+ onChange: (html: string, text: string) => void;
24
27
  ref?: LegacyRef<Editor>;
25
28
  tinymceScriptSrc?: string;
26
29
  autoFocus?: boolean;
@@ -33,5 +36,6 @@ export type JRCInputTinyMCERawProps = DataCy & {
33
36
  };
34
37
  height?: number;
35
38
  autofocus?: boolean;
39
+ readOnly?: boolean;
36
40
  };
37
41
  export declare const JRCInputTinyMCERaw: ({ dataCy, token, value, onBlur, onChange, mentionsQueries, tinymceScriptSrc, autoFocus, inline, placeholder, additionalExtensions, ref, height, autofocus, ...props }: JRCInputTinyMCERawProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import jamespot, { AddRemoveActionParams, CombinedWidgetType, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserView } from 'jamespot-user-api';
1
+ import jamespot, { AddRemoveActionParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserView } 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 'types';
@@ -23,7 +23,7 @@ export type JRCCommentProps = {
23
23
  getAccessHash?: (fileId: number) => Promise<string>;
24
24
  onGetHashError: (message?: string) => void;
25
25
  socialActionAdd: ({ targetId, targetType, type, }: AddRemoveActionParams) => ReturnType<typeof jamespot.socialAction.add>;
26
- existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps<CombinedWidgetType>[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
26
+ existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
27
27
  };
28
28
  export declare const DropdownButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
29
29
  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, }: JRCCommentProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import jamespot, { AddCommentParams, AddRemoveActionParams, CombinedWidgetType, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, jUserView } from 'jamespot-user-api';
1
+ import jamespot, { AddCommentParams, AddRemoveActionParams, Model, UpdateCommentParams, WidgetDisplayMode, WidgetWrapperProps, jUserList, jUserView } 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';
@@ -12,7 +12,7 @@ export type JRCCommentsBlocProps = {
12
12
  isWidgetActive?: boolean;
13
13
  widgetListComponent: React.ReactNode;
14
14
  newWidgetsWrapperComponent: React.ReactNode;
15
- existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps<CombinedWidgetType>[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
15
+ existingWidgetsWrapperComponent: (comment: Partial<jCommentList>, content: WidgetWrapperProps[], mode: WidgetDisplayMode, inplace: boolean, idComment: number, editRight?: boolean, deleteRight?: boolean) => React.ReactNode;
16
16
  loading?: boolean;
17
17
  token?: string;
18
18
  onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
@@ -9,7 +9,7 @@ type FlexBoxProps = Omit<FastCssProps, 'display'> & {
9
9
  childFull?: boolean;
10
10
  };
11
11
  export declare const JRCFlexBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Omit<FastCssProps, "display"> & {
12
- direction?: "row" | "column" | "column-reverse" | "row-reverse" | undefined;
12
+ direction?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
13
13
  inline?: boolean | undefined;
14
14
  flex?: string | boolean | undefined;
15
15
  gap?: number | undefined;
@@ -1,6 +1,22 @@
1
1
  import { WidgetArticleGalleryContent } from 'jamespot-user-api';
2
2
  import React from 'react';
3
- export declare const JRCWidgetArticleGallery: ({ files, size, gap, column, maxWidth, onClick, }: WidgetArticleGalleryContent & {
3
+ export declare const JRCWidgetArticleGallery: ({ files, size, gap, column, maxWidth, onClick, }: {
4
+ gap?: string | undefined;
5
+ column?: string | undefined;
6
+ files?: {
7
+ type: string;
8
+ id: number;
9
+ mainType: string;
10
+ uri: string;
11
+ dateCreation: string;
12
+ dateModified: string | null;
13
+ title: string;
14
+ _url: string;
15
+ mimetype: string;
16
+ size: number;
17
+ path?: string | undefined;
18
+ }[] | undefined;
19
+ } & {
4
20
  maxWidth: number;
5
21
  size?: string | undefined;
6
22
  onClick: (idFile: number) => void;
@@ -1,8 +1,23 @@
1
1
  import { Meta, Story } from '@storybook/react';
2
- import { WidgetArticleGalleryContent } from 'jamespot-user-api';
3
2
  declare const _default: Meta<import("@storybook/react").Args>;
4
3
  export default _default;
5
- export declare const Primary: Story<WidgetArticleGalleryContent & {
4
+ export declare const Primary: Story<{
5
+ gap?: string | undefined;
6
+ column?: string | undefined;
7
+ files?: {
8
+ type: string;
9
+ id: number;
10
+ mainType: string;
11
+ uri: string;
12
+ dateCreation: string;
13
+ dateModified: string | null;
14
+ title: string;
15
+ _url: string;
16
+ mimetype: string;
17
+ size: number;
18
+ path?: string | undefined;
19
+ }[] | undefined;
20
+ } & {
6
21
  maxWidth: number;
7
22
  onClick: (idFile: number) => void;
8
23
  }>;