jamespot-react-components 1.0.174 → 1.0.176
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 +103 -41
- package/build/jamespot-react-components.js.map +1 -1
- package/build/src/components/Form/Input/Common/JRCFormFieldRenderer.types.d.ts +1 -1
- package/build/src/components/Form/Input/JRCInputCheckbox/JRCInputCheckbox.stories.d.ts +1 -0
- package/build/src/components/Widgets/JRCWidgetApi/JRCWidgetApi.d.ts +27 -0
- package/build/src/components/Widgets/JRCWidgetApi/JRCWidgetApiEditor.d.ts +26 -0
- package/build/src/components/Widgets/JRCWidgetApi/JRCWidgetLabel.d.ts +6 -0
- package/build/src/components/Widgets/JRCWidgetApi/components/HeaderLabel.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetApi/mock.d.ts +1 -0
- package/build/src/components/Widgets/JRCWidgetApi/utils.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetApi/utils.test.d.ts +1 -0
- package/build/src/components/Widgets/JRCWidgetAttachment/JRCWidgetAttachment.d.ts +20 -0
- package/build/src/components/Widgets/{JRCWidgetArticleAttachment/JRCWidgetArticleAttachment.stories.d.ts → JRCWidgetAttachment/JRCWidgetAttachment.stories.d.ts} +2 -2
- package/build/src/components/Widgets/JRCWidgetButton/JRCWidgetButton.d.ts +3 -0
- package/build/src/components/Widgets/{JRCWidgetArticleImage/JRCWidgetArticleImage.stories.d.ts → JRCWidgetButton/JRCWidgetButton.stories.d.ts} +1 -4
- package/build/src/components/Widgets/JRCWidgetButton/JRCWidgetButtonEditor.d.ts +10 -0
- package/build/src/components/Widgets/{JRCWidgetArticleImage → JRCWidgetImage}/JRCWidgetArticleImageEditor.d.ts +3 -0
- package/build/src/components/Widgets/JRCWidgetImage/JRCWidgetImage.d.ts +9 -0
- package/build/src/components/Widgets/JRCWidgetImage/JRCWidgetImage.stories.d.ts +4 -0
- package/build/src/components/Widgets/JRCWidgetImage/JRCWidgetImageEditor.d.ts +8 -0
- package/build/src/hooks/UseImageLoader.d.ts +2 -1
- package/build/src/index.d.ts +9 -6
- package/package.json +2 -2
- package/build/src/components/Widgets/JRCWidgetArticleAttachment/JRCWidgetArticleAttachment.d.ts +0 -9
- package/build/src/components/Widgets/JRCWidgetArticleButton/JRCWidgetArticleButton.d.ts +0 -14
- package/build/src/components/Widgets/JRCWidgetArticleButton/JRCWidgetArticleButtonEditor.d.ts +0 -11
- package/build/src/components/Widgets/JRCWidgetArticleImage/JRCWidgetArticleImage.d.ts +0 -7
- /package/build/src/components/Widgets/{JRCWidgetArticleButton/JRCWidgetArticleButton.stories.d.ts → JRCWidgetApi/JRCWidgetApi.stories.d.ts} +0 -0
- /package/build/src/components/Widgets/{JRCWidgetArticleAttachment → JRCWidgetAttachment}/JRCWidgetArticleAttachmentEditor.d.ts +0 -0
- /package/build/src/components/Widgets/{JRCWidgetArticleImage → JRCWidgetImage}/styles.d.ts +0 -0
|
@@ -19,7 +19,7 @@ export interface FieldRenderProps extends DataCy {
|
|
|
19
19
|
htmlFor?: string;
|
|
20
20
|
placeholder?: string;
|
|
21
21
|
labelIsLegend?: boolean;
|
|
22
|
-
description?: string;
|
|
22
|
+
description?: string | React.ReactNode;
|
|
23
23
|
helper?: Omit<JRCTooltipProps, 'children'>;
|
|
24
24
|
className?: string;
|
|
25
25
|
}
|
|
@@ -3,4 +3,5 @@ import { Meta, Story } from '@storybook/react';
|
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const InputCheckbox: Story<JRCInputCheckboxProps<any>>;
|
|
6
|
+
export declare const InputCheckboxHelperWithComponent: Story<JRCInputCheckboxProps<any>>;
|
|
6
7
|
export declare const InputRadio: Story<JRCInputCheckboxProps<any>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CSSTable: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const CSSRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const CSSRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export type WidgetApiParam = {
|
|
6
|
+
label: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
9
|
+
export type WidgetApiParams = Record<string, WidgetApiParam>;
|
|
10
|
+
export type JRCWidgetApiProps = {};
|
|
11
|
+
export declare const extractAllKeys: (payload: Array<Record<string, unknown>>) => string[];
|
|
12
|
+
type BuildTableProps = {
|
|
13
|
+
data: ApiPayload;
|
|
14
|
+
model: string[];
|
|
15
|
+
order: string;
|
|
16
|
+
orderBy: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const BuildTable: ({ data, model, order, orderBy }: BuildTableProps) => React.JSX.Element;
|
|
19
|
+
export type ApiSortBy = 'asc' | 'desc';
|
|
20
|
+
export type ApiPayload = Array<Record<string, string>>;
|
|
21
|
+
export declare const JRCWidgetApi: ({ data, keys, order, orderBy, }: {
|
|
22
|
+
data: Array<Record<string, unknown>>;
|
|
23
|
+
keys: string[];
|
|
24
|
+
order: string;
|
|
25
|
+
orderBy: string;
|
|
26
|
+
}) => React.JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CSSTable: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const CSSRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const CSSRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export type WidgetApiParam = {
|
|
6
|
+
label: string;
|
|
7
|
+
url: string;
|
|
8
|
+
};
|
|
9
|
+
export type WidgetApiParams = Record<string, WidgetApiParam>;
|
|
10
|
+
export type JRCWidgetApiProps = {};
|
|
11
|
+
export declare const extractAllKeys: (payload: Array<Record<string, unknown>>) => string[];
|
|
12
|
+
export type ApiSortBy = 'asc' | 'desc';
|
|
13
|
+
export type ApiPayload = Array<Record<string, string>>;
|
|
14
|
+
export declare const CSSCheckboxWrapper: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
+
export declare const JRCWidgetApiEditor: ({ initialUrl, order, orderBy, provider, onChange, }: {
|
|
16
|
+
initialUrl: string;
|
|
17
|
+
order: string;
|
|
18
|
+
orderBy: string;
|
|
19
|
+
provider: (url: string) => Promise<Array<Record<string, string>>>;
|
|
20
|
+
onChange: (content: Partial<{
|
|
21
|
+
url: string;
|
|
22
|
+
keys: string[];
|
|
23
|
+
order: string;
|
|
24
|
+
orderBy: string;
|
|
25
|
+
}>, override?: boolean) => void;
|
|
26
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mockApi_1: any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const flattenObject: (obj: Record<string, unknown>, parentKey?: string) => Record<string, string>;
|
|
2
|
+
export declare const cleanPayload: (payload: Array<Record<string, unknown>>) => Record<string, string>[];
|
|
3
|
+
export declare const extractObjectKeys: (obj: Record<string, unknown>) => string[];
|
|
4
|
+
export declare const toggle: (arr: string[], el: string) => string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CSSWidgetAttachment: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
+
inline?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
export type JRCWidgetAttachmentProps = {
|
|
6
|
+
files: {
|
|
7
|
+
id: number;
|
|
8
|
+
uri: string | undefined;
|
|
9
|
+
mimetype: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}[];
|
|
12
|
+
fileDisplay?: 'list';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* TODO: resolveFileMimetype should be done before
|
|
16
|
+
*/
|
|
17
|
+
export declare const JRCWidgetAttachment: ({ files, inline, onClick, }: JRCWidgetAttachmentProps & {
|
|
18
|
+
onClick: (idFile: number) => void;
|
|
19
|
+
inline?: boolean | undefined;
|
|
20
|
+
}) => React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { JRCWidgetAttachmentProps } from './JRCWidgetAttachment';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const Primary: Story<
|
|
5
|
+
export declare const Primary: Story<JRCWidgetAttachmentProps & {
|
|
6
6
|
onClick: (idFile: number) => void;
|
|
7
7
|
}>;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
2
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
3
3
|
export default _default;
|
|
4
|
-
export declare const Primary: Story<
|
|
5
|
-
maxWidth: number;
|
|
6
|
-
uri: string;
|
|
7
|
-
}>;
|
|
4
|
+
export declare const Primary: Story<import("@storybook/react").Args>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetButtonProps } from 'jamespot-user-api';
|
|
3
|
+
/**
|
|
4
|
+
* Default widget button editor
|
|
5
|
+
*/
|
|
6
|
+
export declare const JRCWidgetButtonEditor: <T extends {}>({ text, color, backgroundColor, borderRadius, variant, buttonSize, url, target, onChange, onSave, extendProperties, }: WidgetButtonProps & T & {
|
|
7
|
+
onChange: (content: Partial<WidgetButtonProps>) => void;
|
|
8
|
+
onSave: (content?: Partial<WidgetButtonProps>) => void;
|
|
9
|
+
extendProperties?: ((onChange: (content: Partial<WidgetButtonProps & T>) => void) => React.ReactNode) | undefined;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WidgetArticleImageContent } from 'jamespot-user-api';
|
|
3
3
|
import { WidgetStateProps } from 'jamespot-user-api';
|
|
4
|
+
/**
|
|
5
|
+
* Custom widget image editor for article widget image
|
|
6
|
+
*/
|
|
4
7
|
export declare const JRCWidgetArticleImageEditor: ({ token, content, onSave, onStateChange, }: {
|
|
5
8
|
token: string | undefined;
|
|
6
9
|
content: WidgetArticleImageContent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type JRCWidgetImageProps = {
|
|
3
|
+
useFilter?: boolean;
|
|
4
|
+
maxWidth: number;
|
|
5
|
+
maxHeight?: number;
|
|
6
|
+
uri?: string;
|
|
7
|
+
loadWithDelay?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const JRCWidgetImage: ({ useFilter, maxWidth, maxHeight, uri, loadWithDelay, }: JRCWidgetImageProps) => React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { JRCWidgetImageProps } from './JRCWidgetImage';
|
|
3
|
+
/**
|
|
4
|
+
* This is the default image editor
|
|
5
|
+
*/
|
|
6
|
+
export declare const JRCWidgetImageEditor: ({ uri, maxWidth, onChange, }: JRCWidgetImageProps & {
|
|
7
|
+
onChange: (content: Partial<JRCWidgetImageProps>, override?: boolean) => void;
|
|
8
|
+
}) => React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare const useImageLoader: (url: string, maxWidth?: number) => {
|
|
1
|
+
export declare const useImageLoader: (url: string, maxWidth?: number, loadWithDelay?: number) => {
|
|
2
2
|
loading: boolean;
|
|
3
3
|
error: boolean;
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
|
6
|
+
load: () => void;
|
|
6
7
|
};
|
package/build/src/index.d.ts
CHANGED
|
@@ -149,18 +149,21 @@ export { JRCTypography } from './components/JRCTypography/JRCTypography';
|
|
|
149
149
|
export { JRCUserPopup } from './components/JRCUserPopup/JRCUserPopup';
|
|
150
150
|
export { JRCValidationButton } from './components/JRCButton/JRCValidationButton';
|
|
151
151
|
export { JRCInputDateTime } from './components/Form/Input/JRCInputDateTime/JRCInputDateTime';
|
|
152
|
-
export {
|
|
153
|
-
export { JRCWidgetArticleAttachmentEditor } from './components/Widgets/
|
|
154
|
-
export {
|
|
155
|
-
export {
|
|
152
|
+
export { JRCWidgetAttachment } from './components/Widgets/JRCWidgetAttachment/JRCWidgetAttachment';
|
|
153
|
+
export { JRCWidgetArticleAttachmentEditor } from './components/Widgets/JRCWidgetAttachment/JRCWidgetArticleAttachmentEditor';
|
|
154
|
+
export { JRCWidgetButton } from './components/Widgets/JRCWidgetButton/JRCWidgetButton';
|
|
155
|
+
export { JRCWidgetButtonEditor } from './components/Widgets/JRCWidgetButton/JRCWidgetButtonEditor';
|
|
156
156
|
export { JRCWidgetArticleGallery } from './components/Widgets/JRCWidgetArticleGallery/JRCWidgetArticleGallery';
|
|
157
157
|
export { JRCWidgetArticleGalleryEditor } from './components/Widgets/JRCWidgetArticleGallery/JRCWidgetArticleGalleryEditor';
|
|
158
|
-
export {
|
|
159
|
-
export {
|
|
158
|
+
export { JRCWidgetImage } from './components/Widgets/JRCWidgetImage/JRCWidgetImage';
|
|
159
|
+
export { JRCWidgetImageEditor } from './components/Widgets/JRCWidgetImage/JRCWidgetImageEditor';
|
|
160
|
+
export { JRCWidgetArticleImageEditor } from './components/Widgets/JRCWidgetImage/JRCWidgetArticleImageEditor';
|
|
160
161
|
export { JRCWidgetArticleText } from './components/Widgets/JRCWidgetArticleText/JRCWidgetArticleText';
|
|
161
162
|
export { JRCWidgetArticleTextEditor } from './components/Widgets/JRCWidgetArticleText/JRCWidgetArticleTextEditor';
|
|
162
163
|
export { JRCWidgetArticleTitle } from './components/Widgets/JRCWidgetArticleTitle/JRCWidgetArticleTitle';
|
|
163
164
|
export { JRCWidgetArticleTitleEditor } from './components/Widgets/JRCWidgetArticleTitle/JRCWidgetArticleTitleEditor';
|
|
165
|
+
export { JRCWidgetApi } from './components/Widgets/JRCWidgetApi/JRCWidgetApi';
|
|
166
|
+
export { JRCWidgetApiEditor } from './components/Widgets/JRCWidgetApi/JRCWidgetApiEditor';
|
|
164
167
|
export { JRCWidgetSlider } from './components/Widgets/JRCWidgetSlider/JRCWidgetSlider';
|
|
165
168
|
export { JRCWidgetArticleSliderEditor } from './components/Widgets/JRCWidgetSlider/JRCWidgetArticleSliderEditor';
|
|
166
169
|
export { JRCWidgetEmptyInplace } from './components/Widgets/JRCWidgetEmptyInplace';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-react-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.176",
|
|
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.147",
|
|
96
96
|
"moment": "2.29.4",
|
|
97
97
|
"react": "^17.x",
|
|
98
98
|
"react-beautiful-dnd": "^13.1.1",
|
package/build/src/components/Widgets/JRCWidgetArticleAttachment/JRCWidgetArticleAttachment.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WidgetArticleAttachmentContent } from 'jamespot-user-api';
|
|
3
|
-
export declare const CSSWidgetAttachment: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
4
|
-
inline?: boolean | undefined;
|
|
5
|
-
}, never>;
|
|
6
|
-
export declare const JRCWidgetArticleAttachment: ({ files, onClick, inline, }: WidgetArticleAttachmentContent & {
|
|
7
|
-
onClick: (idFile: number) => void;
|
|
8
|
-
inline?: boolean | undefined;
|
|
9
|
-
}) => React.JSX.Element;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { VariantSizeType, VariantType } from 'jamespot-user-api';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export type JRCWidgetArticleButtonProps = {
|
|
4
|
-
text?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
borderRadius?: string;
|
|
8
|
-
fontSize?: string;
|
|
9
|
-
buttonSize?: VariantSizeType;
|
|
10
|
-
variant?: VariantType;
|
|
11
|
-
url?: string;
|
|
12
|
-
target?: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const JRCWidgetArticleButton: ({ text, buttonSize, color, borderRadius, variant, backgroundColor, url, target, }: JRCWidgetArticleButtonProps) => React.JSX.Element;
|
package/build/src/components/Widgets/JRCWidgetArticleButton/JRCWidgetArticleButtonEditor.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { WidgetArticleButtonContent, WidgetStateProps } from 'jamespot-user-api';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type JRCWidgetArticleButtonEditorProps = {
|
|
4
|
-
content: WidgetArticleButtonContent;
|
|
5
|
-
onChange: (content: Partial<WidgetArticleButtonContent>, override?: boolean) => void;
|
|
6
|
-
onSave: (content: Partial<WidgetArticleButtonContent>) => void;
|
|
7
|
-
onStateChange?: (state: WidgetStateProps) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare function useFirstRender(): boolean;
|
|
10
|
-
export declare const JRCWidgetArticleButtonEditor: ({ content, onChange, onSave }: JRCWidgetArticleButtonEditorProps) => React.JSX.Element;
|
|
11
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|