@imposium-hub/components 2.5.9 → 2.5.10-1
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/assets/AssetsTypeIcon.js +2 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/cjs/components/confirm-modal/ConfirmModal.d.ts +5 -3
- package/dist/cjs/components/confirm-modal/ConfirmModal.js +10 -9
- package/dist/cjs/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/cjs/components/header/Header.js +1 -1
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/constants/copy.d.ts +1 -0
- package/dist/cjs/constants/copy.js +6 -1
- package/dist/cjs/constants/copy.js.map +1 -1
- package/dist/cjs/constants/icons.d.ts +1 -0
- package/dist/cjs/constants/icons.js +2 -1
- package/dist/cjs/constants/icons.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/asset-uploads.d.ts +1 -1
- package/dist/cjs/redux/actions/asset-uploads.js +10 -3
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +3 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/esm/components/confirm-modal/ConfirmModal.d.ts +5 -3
- package/dist/esm/components/confirm-modal/ConfirmModal.js +10 -9
- package/dist/esm/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/esm/components/header/Header.js +1 -1
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/components/tabs/Tabs.d.ts +4 -1
- package/dist/esm/components/tabs/Tabs.stories.d.ts +3 -1
- package/dist/esm/constants/copy.d.ts +1 -0
- package/dist/esm/constants/copy.js +5 -0
- package/dist/esm/constants/copy.js.map +1 -1
- package/dist/esm/constants/icons.d.ts +1 -0
- package/dist/esm/constants/icons.js +2 -1
- package/dist/esm/constants/icons.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/asset-uploads.d.ts +1 -1
- package/dist/esm/redux/actions/asset-uploads.js +10 -3
- package/dist/esm/redux/actions/asset-uploads.js.map +1 -1
- package/dist/styles.css +21 -0
- package/dist/styles.less +26 -0
- package/less/components/button.less +21 -0
- package/less/components/header.less +5 -0
- package/package.json +4 -3
- package/src/components/assets/AssetsTypeIcon.tsx +4 -1
- package/src/components/confirm-modal/ConfirmModal.tsx +70 -0
- package/src/components/header/Header.tsx +1 -0
- package/src/constants/copy.ts +6 -0
- package/src/constants/icons.tsx +3 -1
- package/src/index.ts +3 -1
- package/src/redux/actions/asset-uploads.ts +11 -5
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import { useHotkeys } from 'react-hotkeys-hook';
|
|
4
|
+
import Modal from '../modal/Modal';
|
|
5
|
+
import Button from '../button/Button';
|
|
6
|
+
import { confirm as copy } from '../../constants/copy';
|
|
7
|
+
import Section from '../section/Section';
|
|
8
|
+
|
|
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;
|
|
20
|
+
|
|
21
|
+
const modal = (
|
|
22
|
+
<Modal
|
|
23
|
+
onRequestClose={onClose}
|
|
24
|
+
wrapperStyle={{
|
|
25
|
+
left: '0px',
|
|
26
|
+
width: '100%'
|
|
27
|
+
}}
|
|
28
|
+
style={{
|
|
29
|
+
width: '400px',
|
|
30
|
+
height: '12%',
|
|
31
|
+
top: 'calc(50% - 150px)',
|
|
32
|
+
left: 'calc((100% - 400px) / 2)'
|
|
33
|
+
}}
|
|
34
|
+
isOpen={true}>
|
|
35
|
+
<Section>
|
|
36
|
+
<div className='confirm-modal'>
|
|
37
|
+
<p>{title}</p>
|
|
38
|
+
<div className='confirm-buttons'>
|
|
39
|
+
{showCancel ? (
|
|
40
|
+
<Button
|
|
41
|
+
onClick={onClose}
|
|
42
|
+
size='large'
|
|
43
|
+
color='default'>
|
|
44
|
+
{cancel}
|
|
45
|
+
</Button>
|
|
46
|
+
) : null}
|
|
47
|
+
<Button
|
|
48
|
+
onClick={onNo}
|
|
49
|
+
size='large'
|
|
50
|
+
color='default'>
|
|
51
|
+
{onNoLabel}
|
|
52
|
+
</Button>
|
|
53
|
+
<Button
|
|
54
|
+
onClick={onYes}
|
|
55
|
+
size='large'
|
|
56
|
+
style='bold'
|
|
57
|
+
color='primary'>
|
|
58
|
+
{onYesLabel}
|
|
59
|
+
</Button>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</Section>
|
|
63
|
+
</Modal>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const PortalContextComponent = () =>
|
|
67
|
+
ReactDOM.createPortal(modal, document.querySelector('#react-root'));
|
|
68
|
+
|
|
69
|
+
return <PortalContextComponent />;
|
|
70
|
+
};
|
package/src/constants/copy.ts
CHANGED
package/src/constants/icons.tsx
CHANGED
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
} from '@fortawesome/pro-light-svg-icons';
|
|
74
74
|
import { faCircleSmall } from '@fortawesome/pro-solid-svg-icons/faCircleSmall';
|
|
75
75
|
import { faClapperboardPlay } from '@fortawesome/pro-solid-svg-icons/faClapperboardPlay';
|
|
76
|
-
import { faFilters } from '@fortawesome/pro-solid-svg-icons';
|
|
76
|
+
import { faCloudArrowUp, faFilters } from '@fortawesome/pro-solid-svg-icons';
|
|
77
77
|
|
|
78
78
|
export const ICON_VIDEO = <FontAwesomeIcon icon={faVideo} />;
|
|
79
79
|
|
|
@@ -218,3 +218,5 @@ export const ICON_CLAPPERBOARD_PLAY = <FontAwesomeIcon icon={faClapperboardPlay}
|
|
|
218
218
|
export const ICON_CODE = <FontAwesomeIcon icon={faCode} />;
|
|
219
219
|
|
|
220
220
|
export const ICON_UP_RIGHT_FROM_SQUARE = <FontAwesomeIcon icon={faUpRightFromSquare} />;
|
|
221
|
+
|
|
222
|
+
export const ICON_FILE_UPLOAD = <FontAwesomeIcon icon={faCloudArrowUp} />;
|
package/src/index.ts
CHANGED
|
@@ -158,6 +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 } from './components/confirm-modal/ConfirmModal';
|
|
161
162
|
|
|
162
163
|
export {
|
|
163
164
|
AppWrapper,
|
|
@@ -311,5 +312,6 @@ export {
|
|
|
311
312
|
ContextMenuItem,
|
|
312
313
|
ContextMenuTrigger,
|
|
313
314
|
Submenu,
|
|
314
|
-
CopyPropIdButton
|
|
315
|
+
CopyPropIdButton,
|
|
316
|
+
ConfirmModal
|
|
315
317
|
};
|
|
@@ -257,7 +257,8 @@ export const replaceAsset = (
|
|
|
257
257
|
api: IImposiumAPI,
|
|
258
258
|
assetId: any,
|
|
259
259
|
files: File[],
|
|
260
|
-
storyId: string
|
|
260
|
+
storyId: string,
|
|
261
|
+
bindToOverlay?: (f: any) => any
|
|
261
262
|
): any => {
|
|
262
263
|
return (dispatch, getStore) => {
|
|
263
264
|
return new Promise<void>((resolve) => {
|
|
@@ -303,17 +304,23 @@ export const replaceAsset = (
|
|
|
303
304
|
)
|
|
304
305
|
.then((result) => {
|
|
305
306
|
const currentOngoingJobs = () => {
|
|
307
|
+
if (bindToOverlay) {
|
|
308
|
+
bindToOverlay(result);
|
|
309
|
+
}
|
|
306
310
|
return {
|
|
311
|
+
footageId: result.id,
|
|
312
|
+
jobId: result.job_id,
|
|
307
313
|
filename: replacedFileBlobs[activeIndex].filename,
|
|
308
314
|
onProcessed: () => {
|
|
309
315
|
const fileName = ongoingJobs.filter(
|
|
310
|
-
(job: any) => job.jobId === result
|
|
316
|
+
(job: any) => job.jobId === result.job_id
|
|
311
317
|
)[0].filename;
|
|
312
318
|
dispatch({
|
|
313
319
|
type: assetUploadsActions.REMOVE_UPLOAD,
|
|
314
320
|
filename: fileName
|
|
315
321
|
});
|
|
316
322
|
doAssetTableHydration(api, storyId);
|
|
323
|
+
resolve(result);
|
|
317
324
|
}
|
|
318
325
|
};
|
|
319
326
|
};
|
|
@@ -326,23 +333,22 @@ export const replaceAsset = (
|
|
|
326
333
|
} else {
|
|
327
334
|
ongoingJobs = ongoingJobs.filter((j: any, i: number) => {
|
|
328
335
|
const jobIdExists: boolean = typeof j.jobId === 'string';
|
|
329
|
-
|
|
330
336
|
if (!jobIdExists) {
|
|
331
337
|
dispatch({
|
|
332
338
|
type: assetUploadsActions.REMOVE_UPLOAD,
|
|
333
339
|
filename: j.filename
|
|
334
340
|
});
|
|
335
341
|
doAssetTableHydration(api, storyId);
|
|
342
|
+
resolve(result);
|
|
336
343
|
}
|
|
337
344
|
return jobIdExists;
|
|
338
345
|
});
|
|
339
|
-
|
|
340
346
|
if (ongoingJobs.length > 0) {
|
|
341
347
|
pollAssetJobs(api, ongoingJobs, processingTimeout);
|
|
342
348
|
}
|
|
343
349
|
}
|
|
344
350
|
|
|
345
|
-
resolve(result);
|
|
351
|
+
// resolve(result);
|
|
346
352
|
})
|
|
347
353
|
.catch((e: Error[]) => {
|
|
348
354
|
if (axios.isCancel(e) && currentQueue !== queueLength - 1) {
|