jamespot-react-components 1.0.158 → 1.0.159

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.
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
3
+ import { FieldValues } from 'react-hook-form/dist/types';
4
+ import { TinyMCECommonOptions } from 'jamespot-user-api';
5
+ import { MentionQuery } from '../JRCInputTinyMCE/JRCInputTinyMCE';
6
+ export type JRCFormTinyMCEProps<T extends FieldValues> = JRCInputFieldProps<T> & {
7
+ token?: string;
8
+ commonOptions: TinyMCECommonOptions;
9
+ mentionsQueries: {
10
+ users: MentionQuery;
11
+ tags: MentionQuery;
12
+ contents: MentionQuery;
13
+ };
14
+ };
15
+ export declare const JRCFormTinyMCE: <T extends FieldValues = FieldValues>({ dataCy, token, mentionsQueries, commonOptions, ...props }: JRCFormTinyMCEProps<T>) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { JRCFormTinyMCEProps } from './JRCFormTinyMCE';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const InputTinyMCEForm: Story<JRCFormTinyMCEProps<{
6
+ text: string;
7
+ }>>;
@@ -9,6 +9,7 @@ export type NativeInputFileProps = DataCy & Omit<React.ComponentPropsWithoutRef<
9
9
  onLoading?: (state: boolean) => void;
10
10
  value: ApiWrapper<jFileLittle>[];
11
11
  onChange: (files: ApiWrapper<jFileLittle>[]) => void;
12
+ showLoading?: boolean;
12
13
  };
13
14
  export type JRCInputFileProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & Omit<NativeInputFileProps, 'value' | 'onChange'>;
14
15
  export declare const InputFile: React.ForwardRefExoticComponent<DataCy & Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "value"> & {
@@ -17,6 +18,7 @@ export declare const InputFile: React.ForwardRefExoticComponent<DataCy & Omit<Om
17
18
  onLoading?: ((state: boolean) => void) | undefined;
18
19
  value: ApiWrapper<jFileLittle>[];
19
20
  onChange: (files: ApiWrapper<jFileLittle>[]) => void;
21
+ showLoading?: boolean | undefined;
20
22
  } & React.RefAttributes<HTMLInputElement>>;
21
23
  /**
22
24
  * Component used as a <input type="file"/>
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { Editor } from '@tinymce/tinymce-react';
3
+ import { LegacyRef } from 'react';
4
+ import { TinyMCECommonOptions } from 'jamespot-user-api';
5
+ import { DataCy } from '../../../../types/dataAttributes';
6
+ declare global {
7
+ const tinymce: any;
8
+ }
9
+ export type MentionQuery = (query: string) => Promise<{
10
+ type: 'autocompleteitem';
11
+ value: string;
12
+ text: string;
13
+ icon?: string;
14
+ }[]>;
15
+ export type JRCInputTinyMCEProps = DataCy & {
16
+ token?: string;
17
+ commonOptions: TinyMCECommonOptions;
18
+ value: string;
19
+ onBlur?: () => void;
20
+ onChange: (v: string) => void;
21
+ ref?: LegacyRef<Editor>;
22
+ mentionsQueries: {
23
+ users: MentionQuery;
24
+ tags: MentionQuery;
25
+ contents: MentionQuery;
26
+ };
27
+ };
28
+ export declare const JRCInputTinyMCE: ({ dataCy, token, value, onBlur, onChange, mentionsQueries, ref, ...props }: JRCInputTinyMCEProps) => React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import { JRCInputTinyMCEProps } from './JRCInputTinyMCE';
3
+ declare const _default: Meta<import("@storybook/react").Args>;
4
+ export default _default;
5
+ export declare const InputTinyMCE: Story<JRCInputTinyMCEProps>;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ type JRCTinyMCEImageUploadModalProps = {
3
+ closeHandler: () => void;
4
+ open: boolean;
5
+ token?: string;
6
+ };
7
+ export declare const JRCTinyMCEImageUploadModal: ({ open, closeHandler, token }: JRCTinyMCEImageUploadModalProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ type JRCTinyMCEVideoUploadModalProps = {
3
+ closeHandler: () => void;
4
+ open: boolean;
5
+ token?: string;
6
+ };
7
+ export declare const JRCTinyMCEVideoUploadModal: ({ open, closeHandler, token }: JRCTinyMCEVideoUploadModalProps) => React.JSX.Element;
8
+ export {};
@@ -3,6 +3,7 @@ export type ModalBorderRadius = 'medium' | 'small';
3
3
  export declare const JRCModalBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
4
  isFullHeight?: boolean | undefined;
5
5
  overflow?: "hidden" | "visible" | undefined;
6
+ zIndex?: number | undefined;
6
7
  }, never>;
7
8
  export declare const JRCModalContainerFull: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
9
  isFullScreen?: boolean | undefined;
@@ -17,6 +17,8 @@ export interface JRCModalButtonType {
17
17
  variant?: 'contained' | 'outlined';
18
18
  clickHandler?: () => void;
19
19
  dataCy?: string;
20
+ disabled?: boolean;
21
+ loading?: boolean;
20
22
  }
21
23
  export declare const ModalOptions: ({ children }: {
22
24
  children?: React.ReactNode;
@@ -6,8 +6,6 @@ export type JRCModalContentFormProps = JRCModalContentBase & {
6
6
  loading?: boolean;
7
7
  };
8
8
  export interface JRCModalFormButtonType extends JRCModalButtonType {
9
- loading?: boolean;
10
9
  isSubmit?: boolean;
11
- disabled?: boolean;
12
10
  }
13
11
  export declare const JRCModalContentForm: ({ onSubmit, children, loading, title, onClickIconClose, options, buttons, overflow, }: JRCModalContentFormProps) => React.JSX.Element;
@@ -13,5 +13,6 @@ export interface JRCModalLayoutProps {
13
13
  maxHeight?: string;
14
14
  variant?: ModalVariant;
15
15
  overflow?: 'visible' | 'hidden';
16
+ zIndex?: number;
16
17
  }
17
18
  export declare const JRCModalLayout: React.ForwardRefExoticComponent<JRCModalLayoutProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { JRCModalProps } from './JRCModal.types';
3
- export declare const JRCModal: ({ children, open, closeHandler, buttons, title, options, portalId, inPlace, ref, enableClickAwayCloseModal, }: JRCModalProps) => React.JSX.Element;
3
+ export declare const JRCModal: ({ children, open, closeHandler, buttons, title, options, portalId, inPlace, ref, zIndex, enableClickAwayCloseModal, }: JRCModalProps) => React.JSX.Element;
@@ -11,6 +11,7 @@ type JRCModalBaseProps = {
11
11
  inPlace?: boolean;
12
12
  ref?: ForwardedRef<HTMLDivElement>;
13
13
  enableClickAwayCloseModal?: boolean;
14
+ zIndex?: number;
14
15
  };
15
16
  export type JRCModalProps = JRCModalBaseProps & {
16
17
  buttons?: JRCModalButtonType[];
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { JRCModalFormProps } from './JRCModal.types';
3
- export declare const JRCModalForm: ({ title, children, options, open, closeHandler, buttons, onSubmit, loading, portalId, inPlace, ref, enableClickAwayCloseModal, maxHeight, }: JRCModalFormProps) => React.JSX.Element;
3
+ export declare const JRCModalForm: ({ title, children, options, open, closeHandler, buttons, onSubmit, loading, portalId, inPlace, ref, enableClickAwayCloseModal, maxHeight, zIndex, }: JRCModalFormProps) => React.JSX.Element;
@@ -80,6 +80,7 @@ export { JRCFormSelectTagField } from './components/Form/Input/JRCFormSelect/JRC
80
80
  export { JRCFormSendAlertField } from './components/Form/Input/JRCFormSendAlert/JRCFormSendAlert';
81
81
  export { JRCFormTextarea, JRCFormTextareaField } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
82
82
  export { JRCFormTextField } from './components/Form/Input/JRCFormText/JRCFormText';
83
+ export { JRCFormTinyMCE } from './components/Form/Input/JRCFormTinyMCE/JRCFormTinyMCE';
83
84
  export { JRCFormUrlField } from './components/Form/Input/JRCFormURL/JRCFormUrl';
84
85
  export { JRCGrid } from './components/JRCGrid/JRCGrid';
85
86
  export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText } from './components/JRCTypo/JRCTypo';
@@ -108,6 +109,7 @@ export { JRCInputText } from './components/Form/Input/JRCInputText/JRCInputText'
108
109
  export { JRCInputTextIconButton } from './components/Form/Input/JRCInputText/JRCInputTextIconButton';
109
110
  export { JRCInputTextarea } from './components/Form/Input/JRCInputTextarea/JRCInputTextarea';
110
111
  export { JRCInputTime } from './components/Form/Input/JRCInputTime/JRCInputTime';
112
+ export { JRCInputTinyMCE } from './components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
111
113
  export { JRCInputUrl } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
112
114
  export { JRCList } from './components/JRCList/JRCList';
113
115
  export { JRCLoader } from './components/JRCLoader/JRCLoader';
@@ -134,6 +136,8 @@ export { JRCTag } from './components/JRCTag/JRCTag';
134
136
  export { JRCTemplateBase } from './components/Templates/JRCBase.template';
135
137
  export { JRCTemplateTwoColumns } from './components/Templates/JRCTwoColumns.template';
136
138
  export { JRCThemeProvider } from './components/JRCThemeProvider/JRCThemeProvider';
139
+ export { JRCTinyMCEImageUploadModal } from './components/Form/Input/JRCInputTinyMCE/JRCTinyMCEImageUploadModal';
140
+ export { JRCTinyMCEVideoUploadModal } from './components/Form/Input/JRCInputTinyMCE/JRCTinyMCEVideoUploadModal';
137
141
  export { JRCTooltip } from './components/JRCTooltip/JRCTooltip';
138
142
  export { JRCTypography } from './components/JRCTypography/JRCTypography';
139
143
  export { JRCValidationButton } from './components/JRCButton/JRCValidationButton';
@@ -53,6 +53,7 @@ export type { JRCInputTextareaProps } from './components/Form/Input/JRCInputText
53
53
  export type { JRCInputTextProps } from './components/Form/Input/JRCInputText/JRCInputText';
54
54
  export type { JRCInputTextIconButtonProps } from './components/Form/Input/JRCInputText/JRCInputTextIconButton';
55
55
  export type { JRCInputTimeProps } from './components/Form/Input/JRCInputTime/JRCInputTime';
56
+ export type { JRCInputTinyMCEProps } from './components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
56
57
  export type { JRCInputUrlProps } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
57
58
  export type { JRCFileViewerOpenWithOptionsType } from './components/JRCFileViewer/types';
58
59
  export type { JRCLinkToProps, JRCStyledHrefProps } from './components/JRCHref/JRCHref';
@@ -77,6 +78,7 @@ export type { JRCTypographyProps } from './components/JRCTypography/JRCTypograph
77
78
  export type { JRCValidationButtonProps } from './components/JRCButton/JRCValidationButton';
78
79
  export type { JRCValueLabelProps } from './components/Form/Common/types';
79
80
  export type { JRCWritableFormInputProps } from './components/Form/Input/JRCFormFieldRender';
81
+ export type { MentionQuery } from './components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
80
82
  export type { MessageType } from './components/Common/util/getColor.util';
81
83
  export type { TextareaFormInputProps } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
82
84
  export type { ThemeConfigOptions, ThemeType } from './styles/theme';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.158",
3
+ "version": "1.0.159",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -41,6 +41,7 @@
41
41
  "@types/redux-form": "^8.3.5",
42
42
  "@types/styled-components": "^5.1.4",
43
43
  "@types/testing-library__jest-dom": "^5.12.0",
44
+ "@types/tinymce": "^4.6.7",
44
45
  "@types/uuid": "^8.3.1",
45
46
  "@typescript-eslint/eslint-plugin": "^5.4.0",
46
47
  "@typescript-eslint/parser": "^5.4.0",
@@ -75,6 +76,7 @@
75
76
  "webpack-dev-server": "^4.4.0"
76
77
  },
77
78
  "dependencies": {
79
+ "@tinymce/tinymce-react": "^4.3.0",
78
80
  "@tiptap/core": "^2.0.3",
79
81
  "@tiptap/extension-character-count": "^2.0.3",
80
82
  "@tiptap/extension-color": "^2.0.3",
@@ -90,7 +92,7 @@
90
92
  "chroma-js": "^2.1.1",
91
93
  "classnames": "^2.3.1",
92
94
  "dompurify": "^3.0.5",
93
- "jamespot-user-api": "^1.0.127",
95
+ "jamespot-user-api": "^1.0.128",
94
96
  "moment": "2.29.4",
95
97
  "react": "^17.x",
96
98
  "react-beautiful-dnd": "^13.1.1",