@imposium-hub/components 2.5.10-23 → 2.5.10-3
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/dist/cjs/components/app-wrapper/AppWrapper.js +2 -5
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableAssetIdCell.js +2 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter copy.d.ts +2 -0
- package/dist/cjs/components/assets/{StoryTableNameFilter.js → AssetsTableAssetIdFilter copy.js } +12 -12
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter copy.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableNameCell.js +2 -2
- package/dist/cjs/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTypeIcon.js +0 -2
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/cjs/components/confirm-modal/ConfirmModal.d.ts +9 -9
- package/dist/cjs/components/confirm-modal/ConfirmModal.js +12 -108
- package/dist/cjs/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/cjs/components/data-table/Paginator.js +46 -7
- package/dist/cjs/components/data-table/Paginator.js.map +1 -1
- package/dist/cjs/components/story-previewer/StoryPreviewer.js +1 -11
- package/dist/cjs/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/cjs/constants/copy.js +2 -2
- package/dist/cjs/constants/copy.js.map +1 -1
- package/dist/cjs/constants/icons.d.ts +0 -1
- package/dist/cjs/constants/icons.js +1 -3
- package/dist/cjs/constants/icons.js.map +1 -1
- package/dist/cjs/constants/variables.d.ts +0 -3
- package/dist/cjs/constants/variables.js +2 -27
- package/dist/cjs/constants/variables.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/asset-list.js +42 -33
- package/dist/cjs/redux/actions/asset-list.js.map +1 -1
- package/dist/cjs/redux/actions/asset-uploads.js +1 -33
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -1
- package/dist/cjs/redux/actions/notifications.d.ts +8 -0
- package/dist/cjs/redux/actions/notifications.js +56 -0
- package/dist/cjs/redux/actions/notifications.js.map +1 -0
- package/dist/cjs/redux/reducers/asset-uploads.js +0 -8
- package/dist/cjs/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/cjs/redux/reducers/notifications.d.ts +8 -0
- package/dist/cjs/redux/reducers/notifications.js +45 -0
- package/dist/cjs/redux/reducers/notifications.js.map +1 -0
- package/dist/cjs/services/API.d.ts +0 -3
- package/dist/cjs/services/API.js +0 -9
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +2 -5
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableAssetIdCell.js +2 -0
- package/dist/esm/components/assets/AssetsTableAssetIdCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableAssetIdFilter copy.d.ts +2 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter copy.js +20 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter copy.js.map +1 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableNameCell.js +2 -2
- package/dist/esm/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +1 -3
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/esm/components/confirm-modal/ConfirmModal.d.ts +9 -9
- package/dist/esm/components/confirm-modal/ConfirmModal.js +11 -60
- package/dist/esm/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/esm/components/data-table/Paginator.js +69 -44
- package/dist/esm/components/data-table/Paginator.js.map +1 -1
- package/dist/esm/components/story-previewer/StoryPreviewer.js +2 -12
- package/dist/esm/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/esm/constants/copy.js +2 -2
- package/dist/esm/constants/copy.js.map +1 -1
- package/dist/esm/constants/icons.d.ts +0 -1
- package/dist/esm/constants/icons.js +0 -2
- package/dist/esm/constants/icons.js.map +1 -1
- package/dist/esm/constants/variables.d.ts +0 -3
- package/dist/esm/constants/variables.js +1 -25
- package/dist/esm/constants/variables.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/asset-list.js +42 -33
- package/dist/esm/redux/actions/asset-list.js.map +1 -1
- package/dist/esm/redux/actions/asset-uploads.js +1 -22
- package/dist/esm/redux/actions/asset-uploads.js.map +1 -1
- package/dist/esm/redux/actions/notifications.d.ts +8 -0
- package/dist/esm/redux/actions/notifications.js +47 -0
- package/dist/esm/redux/actions/notifications.js.map +1 -0
- package/dist/esm/redux/reducers/asset-uploads.js +0 -11
- package/dist/esm/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/esm/redux/reducers/notifications.d.ts +8 -0
- package/dist/esm/redux/reducers/notifications.js +14 -0
- package/dist/esm/redux/reducers/notifications.js.map +1 -0
- package/dist/esm/services/API.d.ts +0 -3
- package/dist/esm/services/API.js +0 -9
- package/dist/esm/services/API.js.map +1 -1
- package/package.json +1 -1
- package/src/components/app-wrapper/AppWrapper.tsx +4 -3
- package/src/components/assets/AssetsTableNameCell.tsx +2 -2
- package/src/components/assets/AssetsTypeIcon.tsx +1 -4
- package/src/components/confirm-modal/ConfirmModal.tsx +19 -80
- package/src/components/data-table/Paginator.tsx +131 -93
- package/src/components/story-previewer/StoryPreviewer.tsx +4 -28
- package/src/constants/copy.ts +2 -2
- package/src/constants/icons.tsx +0 -3
- package/src/constants/variables.ts +1 -27
- package/src/index.ts +2 -3
- package/src/redux/actions/asset-list.ts +44 -36
- package/src/redux/actions/asset-uploads.ts +1 -20
- package/src/redux/reducers/asset-uploads.ts +0 -11
- package/src/services/API.ts +0 -15
- package/dist/cjs/components/assets/StoryTableNameFilter.d.ts +0 -2
- package/dist/cjs/components/assets/StoryTableNameFilter.js.map +0 -1
- package/dist/cjs/redux/actions/asset-filters copy.d.ts +0 -4
- package/dist/cjs/redux/actions/asset-filters copy.js +0 -18
- package/dist/cjs/redux/actions/asset-filters copy.js.map +0 -1
- package/dist/cjs/redux/actions/story-filter.d.ts +0 -4
- package/dist/cjs/redux/actions/story-filter.js +0 -18
- package/dist/cjs/redux/actions/story-filter.js.map +0 -1
- package/dist/cjs/redux/actions/story-filters.d.ts +0 -4
- package/dist/cjs/redux/actions/story-filters.js +0 -18
- package/dist/cjs/redux/actions/story-filters.js.map +0 -1
- package/dist/cjs/redux/reducers/asset-filters copy.d.ts +0 -2
- package/dist/cjs/redux/reducers/asset-filters copy.js +0 -39
- package/dist/cjs/redux/reducers/asset-filters copy.js.map +0 -1
- package/dist/cjs/redux/reducers/story-filter.d.ts +0 -2
- package/dist/cjs/redux/reducers/story-filter.js +0 -33
- package/dist/cjs/redux/reducers/story-filter.js.map +0 -1
- package/dist/cjs/redux/reducers/story-filters.d.ts +0 -2
- package/dist/cjs/redux/reducers/story-filters.js +0 -33
- package/dist/cjs/redux/reducers/story-filters.js.map +0 -1
- package/dist/esm/components/assets/StoryTableNameFilter.d.ts +0 -2
- package/dist/esm/components/assets/StoryTableNameFilter.js +0 -20
- package/dist/esm/components/assets/StoryTableNameFilter.js.map +0 -1
- package/dist/esm/redux/actions/asset-filters copy.d.ts +0 -4
- package/dist/esm/redux/actions/asset-filters copy.js +0 -13
- package/dist/esm/redux/actions/asset-filters copy.js.map +0 -1
- package/dist/esm/redux/actions/story-filter.d.ts +0 -4
- package/dist/esm/redux/actions/story-filter.js +0 -13
- package/dist/esm/redux/actions/story-filter.js.map +0 -1
- package/dist/esm/redux/actions/story-filters.d.ts +0 -4
- package/dist/esm/redux/actions/story-filters.js +0 -13
- package/dist/esm/redux/actions/story-filters.js.map +0 -1
- package/dist/esm/redux/reducers/asset-filters copy.d.ts +0 -2
- package/dist/esm/redux/reducers/asset-filters copy.js +0 -22
- package/dist/esm/redux/reducers/asset-filters copy.js.map +0 -1
- package/dist/esm/redux/reducers/story-filter.d.ts +0 -2
- package/dist/esm/redux/reducers/story-filter.js +0 -16
- package/dist/esm/redux/reducers/story-filter.js.map +0 -1
- package/dist/esm/redux/reducers/story-filters.d.ts +0 -2
- package/dist/esm/redux/reducers/story-filters.js +0 -16
- package/dist/esm/redux/reducers/story-filters.js.map +0 -1
|
@@ -8,7 +8,6 @@ import { bindActionCreators } from 'redux';
|
|
|
8
8
|
import { login, clearCachedAuth } from '../../redux/actions/auth';
|
|
9
9
|
import { validateAccessLevel } from '../../Util';
|
|
10
10
|
import { setAccessData } from '../../redux/actions/access';
|
|
11
|
-
import { ConfirmModal } from '../confirm-modal/ConfirmModal';
|
|
12
11
|
|
|
13
12
|
export interface IAppWrapperProps {
|
|
14
13
|
children: React.ReactChildren;
|
|
@@ -85,7 +84,10 @@ class AppWrapper extends React.Component<IAppWrapperProps, IAppWrapperState> {
|
|
|
85
84
|
/*
|
|
86
85
|
Check the auth0 session expiry
|
|
87
86
|
*/
|
|
88
|
-
public componentDidUpdate = (
|
|
87
|
+
public componentDidUpdate = (
|
|
88
|
+
prevProps: Readonly<IAppWrapperProps>,
|
|
89
|
+
prevState: Readonly<IAppWrapperState>
|
|
90
|
+
): void => {
|
|
89
91
|
const { auth } = this.props;
|
|
90
92
|
let validAccessLevel: boolean;
|
|
91
93
|
|
|
@@ -284,7 +286,6 @@ class AppWrapper extends React.Component<IAppWrapperProps, IAppWrapperState> {
|
|
|
284
286
|
id='app'
|
|
285
287
|
className='app'>
|
|
286
288
|
{innerContent}
|
|
287
|
-
<ConfirmModal />
|
|
288
289
|
</div>
|
|
289
290
|
);
|
|
290
291
|
};
|
|
@@ -20,7 +20,7 @@ const AssetsTableNameCell: React.FC<IAssetsTableNameCell> = (props: IAssetsTable
|
|
|
20
20
|
const {
|
|
21
21
|
cell: {
|
|
22
22
|
row: {
|
|
23
|
-
original: { name, id, percent: uploadProgress
|
|
23
|
+
original: { name, id, percent: uploadProgress }
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
disabled
|
|
@@ -53,7 +53,7 @@ const AssetsTableNameCell: React.FC<IAssetsTableNameCell> = (props: IAssetsTable
|
|
|
53
53
|
text={name}
|
|
54
54
|
/>
|
|
55
55
|
) : (
|
|
56
|
-
<span>{
|
|
56
|
+
<span>{copy.uploads.preparePhase}</span>
|
|
57
57
|
);
|
|
58
58
|
return loader;
|
|
59
59
|
} else {
|
|
@@ -15,8 +15,7 @@ import {
|
|
|
15
15
|
ICON_FILE_CODE,
|
|
16
16
|
ICON_CLAPPERBOARD_PLAY,
|
|
17
17
|
ICON_FILTERS,
|
|
18
|
-
ICON_FILE_UPLOAD
|
|
19
|
-
ICON_FILE_ERROR
|
|
18
|
+
ICON_FILE_UPLOAD
|
|
20
19
|
} from '../../constants/icons';
|
|
21
20
|
|
|
22
21
|
interface IAssetsTypeIconProps {
|
|
@@ -113,8 +112,6 @@ const AssetsTypeIcon: React.FC<IAssetsTypeIconProps> = (p: IAssetsTypeIconProps)
|
|
|
113
112
|
);
|
|
114
113
|
case 'upload':
|
|
115
114
|
return <span>{ICON_FILE_UPLOAD}</span>;
|
|
116
|
-
case 'error':
|
|
117
|
-
return <span>{ICON_FILE_ERROR}</span>;
|
|
118
115
|
default:
|
|
119
116
|
if (filter === 'multi') {
|
|
120
117
|
return <span>{ICON_FILTERS}</span>;
|
|
@@ -1,85 +1,24 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
+
import { useHotkeys } from 'react-hotkeys-hook';
|
|
3
4
|
import Modal from '../modal/Modal';
|
|
4
5
|
import Button from '../button/Button';
|
|
5
6
|
import { confirm as copy } from '../../constants/copy';
|
|
6
7
|
import Section from '../section/Section';
|
|
7
8
|
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export const ConfirmModal = ({
|
|
10
|
+
onClose,
|
|
11
|
+
onYes,
|
|
12
|
+
onNo,
|
|
13
|
+
title,
|
|
14
|
+
onYesLabel,
|
|
15
|
+
onNoLabel,
|
|
16
|
+
showCancel
|
|
17
|
+
}) => {
|
|
18
|
+
useHotkeys('enter', onYes, { enableOnFormTags: true });
|
|
19
|
+
const { cancel } = copy;
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
const [props, setProps] = useState<IConfirmModalProps>(null);
|
|
19
|
-
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
20
|
-
|
|
21
|
-
const onOpen = (event) => {
|
|
22
|
-
setProps({
|
|
23
|
-
...event.detail
|
|
24
|
-
});
|
|
25
|
-
setIsOpen(true);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const onClose = () => setIsOpen(false);
|
|
29
|
-
|
|
30
|
-
const onYesHandler = () => {
|
|
31
|
-
props.onYes();
|
|
32
|
-
setIsOpen(false);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const onNoHandler = () => {
|
|
36
|
-
props.onNo();
|
|
37
|
-
setIsOpen(false);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const onYes = useCallback(() => onYesHandler(), [isOpen]);
|
|
41
|
-
|
|
42
|
-
const onNo = useCallback(() => {
|
|
43
|
-
if (props.onNo) {
|
|
44
|
-
onNoHandler();
|
|
45
|
-
} else {
|
|
46
|
-
onClose();
|
|
47
|
-
}
|
|
48
|
-
}, [isOpen]);
|
|
49
|
-
|
|
50
|
-
const onKeyDown = useCallback(
|
|
51
|
-
(e) => {
|
|
52
|
-
if (e.key === 'Enter') {
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
onYesHandler();
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[isOpen]
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
window.addEventListener('openconfirmmodal', onOpen);
|
|
62
|
-
return () => {
|
|
63
|
-
window.removeEventListener('openconfirmmodal', onOpen);
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (isOpen) {
|
|
69
|
-
document.addEventListener('keypress', onKeyDown);
|
|
70
|
-
} else {
|
|
71
|
-
document.removeEventListener('keypress', onKeyDown);
|
|
72
|
-
}
|
|
73
|
-
return () => {
|
|
74
|
-
document.removeEventListener('keypress', onKeyDown);
|
|
75
|
-
};
|
|
76
|
-
}, [isOpen, onKeyDown]);
|
|
77
|
-
|
|
78
|
-
const { cancel, yes, no } = copy;
|
|
79
|
-
const noLabel = props?.noLabel ? props.noLabel : no;
|
|
80
|
-
const yesLabel = props?.yesLabel ? props.yesLabel : yes;
|
|
81
|
-
|
|
82
|
-
const modal = isOpen && (
|
|
21
|
+
const modal = (
|
|
83
22
|
<Modal
|
|
84
23
|
onRequestClose={onClose}
|
|
85
24
|
wrapperStyle={{
|
|
@@ -88,16 +27,16 @@ export const ConfirmModal = () => {
|
|
|
88
27
|
}}
|
|
89
28
|
style={{
|
|
90
29
|
width: '400px',
|
|
91
|
-
height: '
|
|
30
|
+
height: '12%',
|
|
92
31
|
top: 'calc(50% - 150px)',
|
|
93
32
|
left: 'calc((100% - 400px) / 2)'
|
|
94
33
|
}}
|
|
95
34
|
isOpen={true}>
|
|
96
35
|
<Section>
|
|
97
36
|
<div className='confirm-modal'>
|
|
98
|
-
<p>{
|
|
37
|
+
<p>{title}</p>
|
|
99
38
|
<div className='confirm-buttons'>
|
|
100
|
-
{
|
|
39
|
+
{showCancel ? (
|
|
101
40
|
<Button
|
|
102
41
|
onClick={onClose}
|
|
103
42
|
size='large'
|
|
@@ -109,14 +48,14 @@ export const ConfirmModal = () => {
|
|
|
109
48
|
onClick={onNo}
|
|
110
49
|
size='large'
|
|
111
50
|
color='default'>
|
|
112
|
-
{
|
|
51
|
+
{onNoLabel}
|
|
113
52
|
</Button>
|
|
114
53
|
<Button
|
|
115
54
|
onClick={onYes}
|
|
116
55
|
size='large'
|
|
117
56
|
style='bold'
|
|
118
57
|
color='primary'>
|
|
119
|
-
{
|
|
58
|
+
{onYesLabel}
|
|
120
59
|
</Button>
|
|
121
60
|
</div>
|
|
122
61
|
</div>
|
|
@@ -26,102 +26,140 @@ const Paginator: React.FC<any> = ({
|
|
|
26
26
|
setPageSize,
|
|
27
27
|
itemsPerPage,
|
|
28
28
|
onItemsPerPage
|
|
29
|
-
}) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
onClick={() => gotoPage(pageCount, pageSize)}>
|
|
62
|
-
{ICON_ANGLE_DOUBLE_RIGHT}
|
|
63
|
-
</Button>
|
|
64
|
-
|
|
29
|
+
}) => {
|
|
30
|
+
const [getPageIndex, setPageIndex] = React.useState<number>(pageIndex);
|
|
31
|
+
const [getItemsPerPage, setItemsPerPage] = React.useState<number>(itemsPerPage);
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (pageIndex !== getPageIndex) {
|
|
35
|
+
setPageIndex(pageIndex);
|
|
36
|
+
}
|
|
37
|
+
}, [pageIndex]);
|
|
38
|
+
|
|
39
|
+
const onItemsPerPageBlur = () => {
|
|
40
|
+
onItemsPerPage(getItemsPerPage);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const onGoToPageBlur = () => {
|
|
44
|
+
gotoPage(getPageIndex, pageSize);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const onItemsPerPageKeyDown = (e) => {
|
|
48
|
+
if (e.key === 'Enter') {
|
|
49
|
+
onItemsPerPage(getItemsPerPage);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const onGoToPageKeyDown = (e) => {
|
|
54
|
+
if (e.key === 'Enter') {
|
|
55
|
+
gotoPage(getPageIndex, pageSize);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<section className='ip-table-pagination'>
|
|
65
61
|
<span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
<Button
|
|
63
|
+
style='subtle'
|
|
64
|
+
size='small'
|
|
65
|
+
tooltip='Go to first page'
|
|
66
|
+
disabled={!canPreviousPage}
|
|
67
|
+
onClick={() => gotoPage(1, pageSize)}>
|
|
68
|
+
{ICON_ANGLE_DOUBLE_LEFT}
|
|
69
|
+
</Button>
|
|
70
|
+
<Button
|
|
71
|
+
style='subtle'
|
|
72
|
+
size='small'
|
|
73
|
+
tooltip='Go to previous page'
|
|
74
|
+
disabled={!canPreviousPage}
|
|
75
|
+
onClick={() => previousPage()}>
|
|
76
|
+
{ICON_ANGLE_LEFT}
|
|
77
|
+
</Button>
|
|
78
|
+
<Button
|
|
79
|
+
style='subtle'
|
|
80
|
+
size='small'
|
|
81
|
+
tooltip='Go to next page'
|
|
82
|
+
disabled={!canNextPage}
|
|
83
|
+
onClick={() => nextPage()}>
|
|
84
|
+
{ICON_ANGLE_RIGHT}
|
|
85
|
+
</Button>
|
|
86
|
+
<Button
|
|
87
|
+
style='subtle'
|
|
88
|
+
size='small'
|
|
89
|
+
tooltip='Go to last page'
|
|
90
|
+
disabled={!canNextPage}
|
|
91
|
+
onClick={() => gotoPage(pageCount, pageSize)}>
|
|
92
|
+
{ICON_ANGLE_DOUBLE_RIGHT}
|
|
93
|
+
</Button>
|
|
70
94
|
|
|
95
|
+
<span>
|
|
96
|
+
{copy.table.page}
|
|
97
|
+
<strong>
|
|
98
|
+
{getPageIndex} of {pageCount}
|
|
99
|
+
</strong>
|
|
100
|
+
|
|
101
|
+
</span>
|
|
102
|
+
<span>
|
|
103
|
+
{copy.table.goToPage}
|
|
104
|
+
<input
|
|
105
|
+
className='paginator-input'
|
|
106
|
+
type='number'
|
|
107
|
+
placeholder={getPageIndex.toString()}
|
|
108
|
+
onChange={(e) => {
|
|
109
|
+
const input = e.target.value;
|
|
110
|
+
const inputNum = Number(input);
|
|
111
|
+
let next: number;
|
|
112
|
+
|
|
113
|
+
clearTimeout(textInputTimeout);
|
|
114
|
+
|
|
115
|
+
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
120
|
+
next = inputNum;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
textInputTimeout = window.setTimeout(() => setPageIndex(next), 300);
|
|
124
|
+
}}
|
|
125
|
+
onBlur={() => onGoToPageBlur()}
|
|
126
|
+
onKeyDown={(e) => onGoToPageKeyDown(e)}
|
|
127
|
+
/>
|
|
128
|
+
</span>
|
|
129
|
+
|
|
130
|
+
<span>
|
|
131
|
+
{copy.table.itemsPerPage}
|
|
132
|
+
<input
|
|
133
|
+
className='paginator-input'
|
|
134
|
+
type='number'
|
|
135
|
+
placeholder={getItemsPerPage.toString()}
|
|
136
|
+
min={1}
|
|
137
|
+
onChange={(e) => {
|
|
138
|
+
const input = e.target.value;
|
|
139
|
+
const inputNum = Number(input);
|
|
140
|
+
|
|
141
|
+
clearTimeout(textInputTimeout);
|
|
142
|
+
|
|
143
|
+
if (!input || inputNum < 1) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
textInputTimeout = window.setTimeout(
|
|
148
|
+
() => setItemsPerPage(inputNum),
|
|
149
|
+
300
|
|
150
|
+
);
|
|
151
|
+
}}
|
|
152
|
+
onBlur={() => onItemsPerPageBlur()}
|
|
153
|
+
onKeyDown={(e) => onItemsPerPageKeyDown(e)}
|
|
154
|
+
/>
|
|
155
|
+
</span>
|
|
71
156
|
</span>
|
|
72
|
-
<span>
|
|
73
|
-
{copy.table.goToPage}
|
|
74
|
-
<input
|
|
75
|
-
className='paginator-input'
|
|
76
|
-
type='number'
|
|
77
|
-
placeholder={pageIndex}
|
|
78
|
-
onChange={(e) => {
|
|
79
|
-
const input = e.target.value;
|
|
80
|
-
const inputNum = Number(input);
|
|
81
|
-
let next: number;
|
|
82
|
-
|
|
83
|
-
clearTimeout(textInputTimeout);
|
|
84
|
-
|
|
85
|
-
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
90
|
-
next = inputNum;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
textInputTimeout = window.setTimeout(() => gotoPage(next, pageSize), 300);
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</span>
|
|
97
|
-
|
|
98
|
-
<span>
|
|
99
|
-
{copy.table.itemsPerPage}
|
|
100
|
-
<input
|
|
101
|
-
className='paginator-input'
|
|
102
|
-
type='number'
|
|
103
|
-
placeholder={itemsPerPage}
|
|
104
|
-
min={1}
|
|
105
|
-
onChange={(e) => {
|
|
106
|
-
const input = e.target.value;
|
|
107
|
-
const inputNum = Number(input);
|
|
108
|
-
|
|
109
|
-
clearTimeout(textInputTimeout);
|
|
110
|
-
|
|
111
|
-
if (!input || inputNum < 1) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
textInputTimeout = window.setTimeout(() => onItemsPerPage(inputNum), 300);
|
|
116
|
-
}}
|
|
117
|
-
/>
|
|
118
|
-
</span>
|
|
119
|
-
</span>
|
|
120
157
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
158
|
+
<span className='total-assets'>
|
|
159
|
+
{copy.table.total} <strong>{totalItems || 0}</strong>
|
|
160
|
+
</span>
|
|
161
|
+
</section>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
126
164
|
|
|
127
165
|
export default Paginator;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IImposiumAPI } from '../../services/API';
|
|
3
|
-
import {
|
|
4
|
-
VARIABLE_TYPES,
|
|
5
|
-
BOOLEAN_DEFAULT_OPTIONS,
|
|
6
|
-
colorPresets,
|
|
7
|
-
formatColor
|
|
8
|
-
} from '../../constants/variables';
|
|
3
|
+
import { VARIABLE_TYPES, BOOLEAN_DEFAULT_OPTIONS } from '../../constants/variables';
|
|
9
4
|
import { OUTPUT_TYPES } from '../../constants/previewer';
|
|
10
5
|
import TextField from '../text-field/TextField';
|
|
11
6
|
import Button from '../button/Button';
|
|
@@ -28,7 +23,6 @@ import LogViewer from '../log-viewer/LogViewer';
|
|
|
28
23
|
import { connect } from 'react-redux';
|
|
29
24
|
import { ICON_DOWNLOAD, ICON_CLIPBOARD } from '../../constants/icons';
|
|
30
25
|
import AudioPlayer from '../players/AudioPlayer';
|
|
31
|
-
import ColorField from '../color-field/ColorField';
|
|
32
26
|
|
|
33
27
|
interface IStoryPreviewerProps {
|
|
34
28
|
api: IImposiumAPI;
|
|
@@ -143,14 +137,15 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
143
137
|
const { variables } = this.props;
|
|
144
138
|
const inventoryOverrides = this.props.editor?.inventoryOverrides;
|
|
145
139
|
const newInv = {};
|
|
140
|
+
|
|
146
141
|
for (const i in variables) {
|
|
147
142
|
if (variables.hasOwnProperty(i)) {
|
|
148
143
|
const override = inventoryOverrides ? inventoryOverrides[i] : null;
|
|
149
144
|
const inv = variables[i];
|
|
150
|
-
newInv[inv.id] =
|
|
151
|
-
override !== null ? override : this.getVariableValue(inv.previewItem);
|
|
145
|
+
newInv[inv.id] = override ? override : this.getVariableValue(inv.previewItem);
|
|
152
146
|
}
|
|
153
147
|
}
|
|
148
|
+
|
|
154
149
|
return newInv;
|
|
155
150
|
}
|
|
156
151
|
|
|
@@ -235,14 +230,8 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
235
230
|
}
|
|
236
231
|
}
|
|
237
232
|
|
|
238
|
-
private colorInputChanged(key, value) {
|
|
239
|
-
const color = formatColor(value);
|
|
240
|
-
this.variableInputChanged(key, color);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
233
|
private variableInputChanged(key, value) {
|
|
244
234
|
const inventory = { ...this.state.inventory };
|
|
245
|
-
console.log('inventory', inventory);
|
|
246
235
|
inventory[key] = value;
|
|
247
236
|
|
|
248
237
|
this.setState({
|
|
@@ -408,19 +397,6 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
408
397
|
</FieldWrapper>
|
|
409
398
|
);
|
|
410
399
|
break;
|
|
411
|
-
case VARIABLE_TYPES.COLOR:
|
|
412
|
-
fields.push(
|
|
413
|
-
<ColorField
|
|
414
|
-
label={inv.name}
|
|
415
|
-
labelPosition='top'
|
|
416
|
-
enableAlpha={true}
|
|
417
|
-
presetColors={colorPresets}
|
|
418
|
-
value={inventory[inv.id]}
|
|
419
|
-
pickerPosition='bottom'
|
|
420
|
-
onChange={(v) => this.colorInputChanged(inv.id, v)}
|
|
421
|
-
/>
|
|
422
|
-
);
|
|
423
|
-
break;
|
|
424
400
|
}
|
|
425
401
|
}
|
|
426
402
|
}
|
package/src/constants/copy.ts
CHANGED
package/src/constants/icons.tsx
CHANGED
|
@@ -74,7 +74,6 @@ import {
|
|
|
74
74
|
import { faCircleSmall } from '@fortawesome/pro-solid-svg-icons/faCircleSmall';
|
|
75
75
|
import { faClapperboardPlay } from '@fortawesome/pro-solid-svg-icons/faClapperboardPlay';
|
|
76
76
|
import { faCloudArrowUp, faFilters } from '@fortawesome/pro-solid-svg-icons';
|
|
77
|
-
import { faCircleExclamation } from '@fortawesome/free-solid-svg-icons';
|
|
78
77
|
|
|
79
78
|
export const ICON_VIDEO = <FontAwesomeIcon icon={faVideo} />;
|
|
80
79
|
|
|
@@ -221,5 +220,3 @@ export const ICON_CODE = <FontAwesomeIcon icon={faCode} />;
|
|
|
221
220
|
export const ICON_UP_RIGHT_FROM_SQUARE = <FontAwesomeIcon icon={faUpRightFromSquare} />;
|
|
222
221
|
|
|
223
222
|
export const ICON_FILE_UPLOAD = <FontAwesomeIcon icon={faCloudArrowUp} />;
|
|
224
|
-
|
|
225
|
-
export const ICON_FILE_ERROR = <FontAwesomeIcon icon={faCircleExclamation} />;
|
|
@@ -5,8 +5,7 @@ export const VARIABLE_TYPES = {
|
|
|
5
5
|
ENUM: 'enum',
|
|
6
6
|
IMAGE: 'image',
|
|
7
7
|
VIDEO: 'video',
|
|
8
|
-
AUDIO: 'audio'
|
|
9
|
-
COLOR: 'color'
|
|
8
|
+
AUDIO: 'audio'
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
export const BOOLEAN_DEFAULT_OPTIONS = [
|
|
@@ -19,28 +18,3 @@ export const BOOLEAN_DEFAULT_OPTIONS = [
|
|
|
19
18
|
label: 'False'
|
|
20
19
|
}
|
|
21
20
|
];
|
|
22
|
-
|
|
23
|
-
export const colorPresets = [
|
|
24
|
-
'#D0021B',
|
|
25
|
-
'#F5A623',
|
|
26
|
-
'#F8E71C',
|
|
27
|
-
'#8B572A',
|
|
28
|
-
'#7ED321',
|
|
29
|
-
'#417505',
|
|
30
|
-
'#BD10E0',
|
|
31
|
-
'#9013FE',
|
|
32
|
-
'#4A90E2',
|
|
33
|
-
'#50E3C2',
|
|
34
|
-
'#B8E986',
|
|
35
|
-
'#000000',
|
|
36
|
-
'#4A4A4A',
|
|
37
|
-
'#9B9B9B',
|
|
38
|
-
'#FFFFFF',
|
|
39
|
-
'transparent'
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
export const formatColor = (color) => {
|
|
43
|
-
const { r, g, b, a } = color.rgb;
|
|
44
|
-
const alpha = color.source === 'hsv' ? 1 : a;
|
|
45
|
-
return `rgba(${r},${g},${b},${alpha})`;
|
|
46
|
-
};
|
package/src/index.ts
CHANGED
|
@@ -158,7 +158,7 @@ import ContextMenuItem from './components/context-menu/ContextMenuItem';
|
|
|
158
158
|
import ContextMenuTrigger from './components/context-menu/ContextMenuTrigger';
|
|
159
159
|
import CopyPropIdButton from './components/copy-prop-id-button/CopyPropIdButton';
|
|
160
160
|
import Submenu from './components/context-menu/SubMenu';
|
|
161
|
-
import { ConfirmModal
|
|
161
|
+
import { ConfirmModal } from './components/confirm-modal/ConfirmModal';
|
|
162
162
|
|
|
163
163
|
export {
|
|
164
164
|
AppWrapper,
|
|
@@ -313,6 +313,5 @@ export {
|
|
|
313
313
|
ContextMenuTrigger,
|
|
314
314
|
Submenu,
|
|
315
315
|
CopyPropIdButton,
|
|
316
|
-
ConfirmModal
|
|
317
|
-
IConfirmModalProps
|
|
316
|
+
ConfirmModal
|
|
318
317
|
};
|