jamespot-react-components 1.0.172 → 1.0.173
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.
- package/build/jamespot-react-components.js +259 -259
- package/build/jamespot-react-components.js.map +1 -1
- package/build/src/components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE.d.ts +7 -34
- package/build/src/components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE.stories.d.ts +3 -1
- package/build/src/components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw.d.ts +44 -0
- package/build/src/components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw.stories.d.ts +5 -0
- package/build/src/components/Form/Input/{JRCInputTinyMCE → JRCInputTinyMCERaw}/extensions/JIAExtension/JIATextGenerationExtension.d.ts +2 -1
- package/build/src/components/Form/Input/{JRCInputTinyMCE → JRCInputTinyMCERaw}/extensions/JTinyMCEExtensions.d.ts +1 -1
- package/build/src/components/JRCCommentsBloc/JRCComment.d.ts +2 -2
- package/build/src/components/JRCCommentsBloc/JRCCommentsBloc.d.ts +2 -2
- package/build/src/components/Widgets/JRCWidgetArticleText/JRCWidgetArticleText.d.ts +3 -1
- package/build/src/index.d.ts +5 -5
- package/build/src/types.d.ts +2 -1
- package/package.json +2 -2
- package/build/src/components/Form/Input/JRCFormTinyMCE/JRCFormTinyMCE.d.ts +0 -15
- package/build/src/components/Form/Input/JRCFormTinyMCE/JRCFormTinyMCE.stories.d.ts +0 -7
- /package/build/src/components/Form/Input/{JRCInputTinyMCE → JRCInputTinyMCERaw}/JRCTinyMCEFileUploadModal.d.ts +0 -0
- /package/build/src/components/Form/Input/{JRCInputTinyMCE → JRCInputTinyMCERaw}/JRCTinyMCEImageUploadModal.d.ts +0 -0
- /package/build/src/components/Form/Input/{JRCInputTinyMCE → JRCInputTinyMCERaw}/JRCTinyMCEVideoUploadModal.d.ts +0 -0
|
@@ -1,44 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { JRCInputFieldProps } from '../Common/JRCFormFieldRenderer.types';
|
|
3
|
+
import { FieldValues } from 'react-hook-form/dist/types';
|
|
4
4
|
import { TinyMCECommonOptions } from 'jamespot-user-api';
|
|
5
|
-
import {
|
|
6
|
-
import { TinyMCEExtension } from '
|
|
7
|
-
|
|
8
|
-
const tinymce: any;
|
|
9
|
-
}
|
|
10
|
-
export type TinyMention = {
|
|
11
|
-
type: 'autocompleteitem';
|
|
12
|
-
value: string;
|
|
13
|
-
text: string;
|
|
14
|
-
icon?: string;
|
|
15
|
-
};
|
|
16
|
-
export type MentionQuery = (query: string) => Promise<TinyMention[]>;
|
|
17
|
-
export type JRCInputTinyMCEStyleWrapperProps = {
|
|
18
|
-
linkColor?: string;
|
|
19
|
-
fontSize?: string;
|
|
20
|
-
lineHeight?: string;
|
|
21
|
-
minHeight?: number;
|
|
22
|
-
};
|
|
23
|
-
export type JRCInputTinyMCEProps = DataCy & {
|
|
5
|
+
import { MentionQuery } from '../JRCInputTinyMCERaw/JRCInputTinyMCERaw';
|
|
6
|
+
import { TinyMCEExtension } from '../JRCInputTinyMCERaw/extensions/JTinyMCEExtensions';
|
|
7
|
+
export type JRCInputTinyMCEProps<T extends FieldValues> = JRCInputFieldProps<T> & {
|
|
24
8
|
token?: string;
|
|
25
9
|
commonOptions: TinyMCECommonOptions;
|
|
26
|
-
additionalExtensions?: Array<TinyMCEExtension>;
|
|
27
|
-
value: string;
|
|
28
|
-
onBlur?: () => void;
|
|
29
|
-
onChange: (v: string) => void;
|
|
30
|
-
ref?: LegacyRef<Editor>;
|
|
31
|
-
tinymceScriptSrc?: string;
|
|
32
|
-
autoFocus?: boolean;
|
|
33
|
-
inline?: boolean;
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
styleWrapper?: JRCInputTinyMCEStyleWrapperProps;
|
|
36
10
|
mentionsQueries: {
|
|
37
11
|
users: MentionQuery;
|
|
38
12
|
tags: MentionQuery;
|
|
39
13
|
contents: MentionQuery;
|
|
40
14
|
};
|
|
41
|
-
|
|
42
|
-
autofocus?: boolean;
|
|
15
|
+
additionalExtensions?: Array<TinyMCEExtension>;
|
|
43
16
|
};
|
|
44
|
-
export declare const JRCInputTinyMCE: ({ dataCy, token,
|
|
17
|
+
export declare const JRCInputTinyMCE: <T extends FieldValues = FieldValues>({ dataCy, token, mentionsQueries, commonOptions, additionalExtensions, ...props }: JRCInputTinyMCEProps<T>) => React.JSX.Element;
|
|
@@ -2,4 +2,6 @@ import { Meta, Story } from '@storybook/react';
|
|
|
2
2
|
import { JRCInputTinyMCEProps } from './JRCInputTinyMCE';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const InputTinyMCEForm: Story<JRCInputTinyMCEProps<{
|
|
6
|
+
text: string;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
import { TinyMCEExtension } from './extensions/JTinyMCEExtensions';
|
|
7
|
+
declare global {
|
|
8
|
+
const tinymce: any;
|
|
9
|
+
}
|
|
10
|
+
export type TinyMention = {
|
|
11
|
+
type: 'autocompleteitem';
|
|
12
|
+
value: string;
|
|
13
|
+
text: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
};
|
|
16
|
+
export type MentionQuery = (query: string) => Promise<TinyMention[]>;
|
|
17
|
+
export type JRCInputTinyMCEStyleWrapperProps = {
|
|
18
|
+
linkColor?: string;
|
|
19
|
+
fontSize?: string;
|
|
20
|
+
lineHeight?: string;
|
|
21
|
+
minHeight?: number;
|
|
22
|
+
};
|
|
23
|
+
export type JRCInputTinyMCERawProps = DataCy & {
|
|
24
|
+
token?: string;
|
|
25
|
+
commonOptions: TinyMCECommonOptions;
|
|
26
|
+
additionalExtensions?: Array<TinyMCEExtension>;
|
|
27
|
+
value: string;
|
|
28
|
+
onBlur?: () => void;
|
|
29
|
+
onChange: (v: string) => void;
|
|
30
|
+
ref?: LegacyRef<Editor>;
|
|
31
|
+
tinymceScriptSrc?: string;
|
|
32
|
+
autoFocus?: boolean;
|
|
33
|
+
inline?: boolean;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
styleWrapper?: JRCInputTinyMCEStyleWrapperProps;
|
|
36
|
+
mentionsQueries: {
|
|
37
|
+
users: MentionQuery;
|
|
38
|
+
tags: MentionQuery;
|
|
39
|
+
contents: MentionQuery;
|
|
40
|
+
};
|
|
41
|
+
height?: number;
|
|
42
|
+
autofocus?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export declare const JRCInputTinyMCERaw: ({ dataCy, token, value, onBlur, onChange, mentionsQueries, tinymceScriptSrc, autoFocus, inline, placeholder, styleWrapper, additionalExtensions, ref, height, autofocus, ...props }: JRCInputTinyMCERawProps) => React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
|
2
|
+
import { JRCInputTinyMCERawProps } from './JRCInputTinyMCERaw';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const InputTinyMCE: Story<JRCInputTinyMCERawProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TinyMCEExtensionBuilder } from '../JTinyMCEExtensions';
|
|
2
|
+
import { IntlShape } from 'react-intl';
|
|
2
3
|
export type TextGenerationCapabilities = {
|
|
3
4
|
summarize: (text: string) => Promise<string>;
|
|
4
5
|
develop: (text: string) => Promise<string>;
|
|
5
6
|
tldr: (text: string) => Promise<string>;
|
|
6
7
|
};
|
|
7
|
-
export declare const JIATextGenerationExtension: TinyMCEExtensionBuilder<[TextGenerationCapabilities]>;
|
|
8
|
+
export declare const JIATextGenerationExtension: TinyMCEExtensionBuilder<[TextGenerationCapabilities, IntlShape]>;
|
|
@@ -6,5 +6,5 @@ export interface TinyMCEExtensionBuilder<T extends Array<any>> {
|
|
|
6
6
|
(...args: T): TinyMCEExtension;
|
|
7
7
|
}
|
|
8
8
|
export declare const JTinyMCEExtensionsBuilders: {
|
|
9
|
-
readonly jia: TinyMCEExtensionBuilder<[import("./JIAExtension/JIATextGenerationExtension").TextGenerationCapabilities]>;
|
|
9
|
+
readonly jia: TinyMCEExtensionBuilder<[import("./JIAExtension/JIATextGenerationExtension").TextGenerationCapabilities, import("react-intl").IntlShape]>;
|
|
10
10
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { jCommentList } from 'jamespot-user-api/lib/src/types/comment';
|
|
3
|
-
import { JRCInputTinyMCEProps } from '../Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
|
|
4
3
|
import { jUserList, jUserView, Model, UpdateCommentParams } from 'jamespot-user-api';
|
|
4
|
+
import { JRCInputTinyMCERawProps } from 'types';
|
|
5
5
|
export type JRCCommentProps = {
|
|
6
6
|
isFocused: boolean;
|
|
7
7
|
comment: jCommentList;
|
|
8
8
|
token?: string;
|
|
9
|
-
tinyMCEConfig: Pick<
|
|
9
|
+
tinyMCEConfig: Pick<JRCInputTinyMCERawProps, 'commonOptions' | 'mentionsQueries' | 'tinymceScriptSrc'>;
|
|
10
10
|
onCommentUpdate: (args: UpdateCommentParams) => Promise<void>;
|
|
11
11
|
onCommentDelete: (idComment: number) => Promise<void>;
|
|
12
12
|
fetchUser?: () => Promise<jUserView>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { jCommentList } from 'jamespot-user-api/lib/src/types/comment';
|
|
3
3
|
import { AddCommentParams, jUserList, jUserView, Model, UpdateCommentParams } from 'jamespot-user-api';
|
|
4
|
-
import {
|
|
4
|
+
import { JRCInputTinyMCERawProps } from '../Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
|
|
5
5
|
export type JRCCommentsBlocProps = {
|
|
6
6
|
comments?: jCommentList[];
|
|
7
7
|
initialCommentsNumber?: number;
|
|
8
8
|
currentUser: jUserList;
|
|
9
|
-
tinyMCEConfig: Pick<
|
|
9
|
+
tinyMCEConfig: Pick<JRCInputTinyMCERawProps, 'commonOptions' | 'mentionsQueries' | 'tinymceScriptSrc'>;
|
|
10
10
|
onComment: (params: Pick<AddCommentParams, 'content' | 'alertAuthor' | 'sendAlert'>) => Promise<void>;
|
|
11
11
|
loading?: boolean;
|
|
12
12
|
token?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TinyMCECommonOptions, WidgetDisplayMode } from 'jamespot-user-api';
|
|
3
|
+
import { TinyMCEExtension } from 'components/Form/Input/JRCInputTinyMCERaw/extensions/JTinyMCEExtensions';
|
|
3
4
|
export type JRCWidgetArticleTextProps = {
|
|
4
5
|
text: string;
|
|
5
6
|
color: string;
|
|
@@ -11,5 +12,6 @@ export type JRCWidgetArticleTextProps = {
|
|
|
11
12
|
tinyMCECommonOptions: TinyMCECommonOptions | undefined;
|
|
12
13
|
mode?: WidgetDisplayMode;
|
|
13
14
|
onChange: (text: string) => void;
|
|
15
|
+
additionalExtensions?: Array<TinyMCEExtension>;
|
|
14
16
|
};
|
|
15
|
-
export declare const JRCWidgetArticleText: ({ text, linkColor, fontSize, lineHeight, autoFocus, token, tinyMCECommonOptions, mode, onChange, }: JRCWidgetArticleTextProps) => React.JSX.Element;
|
|
17
|
+
export declare const JRCWidgetArticleText: ({ text, linkColor, fontSize, lineHeight, autoFocus, token, tinyMCECommonOptions, mode, onChange, additionalExtensions, }: JRCWidgetArticleTextProps) => React.JSX.Element;
|
package/build/src/index.d.ts
CHANGED
|
@@ -82,7 +82,6 @@ export { JRCFormSelectTagField } from './components/Form/Input/JRCFormSelect/JRC
|
|
|
82
82
|
export { JRCFormSendAlertField } from './components/Form/Input/JRCFormSendAlert/JRCFormSendAlert';
|
|
83
83
|
export { JRCFormTextarea, JRCFormTextareaField } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
|
|
84
84
|
export { JRCFormTextField } from './components/Form/Input/JRCFormText/JRCFormText';
|
|
85
|
-
export { JRCFormTinyMCE } from './components/Form/Input/JRCFormTinyMCE/JRCFormTinyMCE';
|
|
86
85
|
export { JRCFormUrlField } from './components/Form/Input/JRCFormURL/JRCFormUrl';
|
|
87
86
|
export { JRCGrid } from './components/JRCGrid/JRCGrid';
|
|
88
87
|
export { JRCH1, JRCH2, JRCH3, JRCH4, JRCH5, JRCText } from './components/JRCTypo/JRCTypo';
|
|
@@ -112,6 +111,7 @@ export { JRCInputTextarea } from './components/Form/Input/JRCInputTextarea/JRCIn
|
|
|
112
111
|
export { JRCInputTextIconButton } from './components/Form/Input/JRCInputText/JRCInputTextIconButton';
|
|
113
112
|
export { JRCInputTime } from './components/Form/Input/JRCInputTime/JRCInputTime';
|
|
114
113
|
export { JRCInputTinyMCE } from './components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
|
|
114
|
+
export { JRCInputTinyMCERaw } from './components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
|
|
115
115
|
export { JRCInputUrl } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
|
|
116
116
|
export { JRCList } from './components/JRCList/JRCList';
|
|
117
117
|
export { JRCLoader } from './components/JRCLoader/JRCLoader';
|
|
@@ -138,9 +138,9 @@ export { JRCTag } from './components/JRCTag/JRCTag';
|
|
|
138
138
|
export { JRCTemplateBase } from './components/Templates/JRCBase.template';
|
|
139
139
|
export { JRCTemplateTwoColumns } from './components/Templates/JRCTwoColumns.template';
|
|
140
140
|
export { JRCThemeProvider } from './components/JRCThemeProvider/JRCThemeProvider';
|
|
141
|
-
export { JRCTinyMCEFileUploadModal } from './components/Form/Input/
|
|
142
|
-
export { JRCTinyMCEImageUploadModal } from './components/Form/Input/
|
|
143
|
-
export { JRCTinyMCEVideoUploadModal } from './components/Form/Input/
|
|
141
|
+
export { JRCTinyMCEFileUploadModal } from './components/Form/Input/JRCInputTinyMCERaw/JRCTinyMCEFileUploadModal';
|
|
142
|
+
export { JRCTinyMCEImageUploadModal } from './components/Form/Input/JRCInputTinyMCERaw/JRCTinyMCEImageUploadModal';
|
|
143
|
+
export { JRCTinyMCEVideoUploadModal } from './components/Form/Input/JRCInputTinyMCERaw/JRCTinyMCEVideoUploadModal';
|
|
144
144
|
export { JRCTooltip } from './components/JRCTooltip/JRCTooltip';
|
|
145
145
|
export { JRCTypography } from './components/JRCTypography/JRCTypography';
|
|
146
146
|
export { JRCUserPopup } from './components/JRCUserPopup/JRCUserPopup';
|
|
@@ -171,7 +171,7 @@ export { useTimeout } from './hooks/UseTimeout';
|
|
|
171
171
|
export { useRefSize } from './hooks/useRefSize';
|
|
172
172
|
export { useWindowSize } from './hooks/useWindowSize';
|
|
173
173
|
export { useCancelOnUnmount } from './hooks/useCancelOnUnmount';
|
|
174
|
-
export { JTinyMCEExtensionsBuilders } from './components/Form/Input/
|
|
174
|
+
export { JTinyMCEExtensionsBuilders } from './components/Form/Input/JRCInputTinyMCERaw/extensions/JTinyMCEExtensions';
|
|
175
175
|
/****
|
|
176
176
|
*
|
|
177
177
|
* PLEASE RESPECT ALPHABETICAL ORDER
|
package/build/src/types.d.ts
CHANGED
|
@@ -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 { JRCInputTinyMCERawProps } from './components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
|
|
56
57
|
export type { JRCInputTinyMCEProps } from './components/Form/Input/JRCInputTinyMCE/JRCInputTinyMCE';
|
|
57
58
|
export type { JRCInputUrlProps } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
|
|
58
59
|
export type { JRCFileViewerOpenWithOptionsType } from './components/JRCFileViewer/types';
|
|
@@ -78,7 +79,7 @@ export type { JRCTypographyProps } from './components/JRCTypography/JRCTypograph
|
|
|
78
79
|
export type { JRCValidationButtonProps } from './components/JRCButton/JRCValidationButton';
|
|
79
80
|
export type { JRCValueLabelProps } from './components/Form/Common/types';
|
|
80
81
|
export type { JRCWritableFormInputProps } from './components/Form/Input/JRCFormFieldRender';
|
|
81
|
-
export type { MentionQuery, TinyMention } from './components/Form/Input/
|
|
82
|
+
export type { MentionQuery, TinyMention } from './components/Form/Input/JRCInputTinyMCERaw/JRCInputTinyMCERaw';
|
|
82
83
|
export type { MessageType } from './components/Common/util/getColor.util';
|
|
83
84
|
export type { TextareaFormInputProps } from './components/Form/Input/JRCFormTextarea/JRCFormTextarea';
|
|
84
85
|
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.
|
|
3
|
+
"version": "1.0.173",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/jamespot-react-components.js",
|
|
6
6
|
"types": "./build/src/index.d.ts",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"chroma-js": "^2.1.1",
|
|
93
93
|
"classnames": "^2.3.1",
|
|
94
94
|
"dompurify": "^3.0.5",
|
|
95
|
-
"jamespot-user-api": "^1.0.
|
|
95
|
+
"jamespot-user-api": "^1.0.144",
|
|
96
96
|
"moment": "2.29.4",
|
|
97
97
|
"react": "^17.x",
|
|
98
98
|
"react-beautiful-dnd": "^13.1.1",
|
|
@@ -1,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
}>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|