@elice/material-pdf 1.230222.0 → 1.230306.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.
|
@@ -4,6 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var apiClient = require('@elice/api-client');
|
|
5
5
|
var blocks = require('@elice/blocks');
|
|
6
6
|
var materialSharedUtils = require('@elice/material-shared-utils');
|
|
7
|
+
var types = require('@elice/types');
|
|
7
8
|
var classnames = require('classnames');
|
|
8
9
|
var MaterialPdf_styled = require('./MaterialPdf.styled.js');
|
|
9
10
|
|
|
@@ -20,11 +21,14 @@ const MaterialPdf = ({
|
|
|
20
21
|
var _a;
|
|
21
22
|
|
|
22
23
|
const prefixCls = 'em-material-pdf';
|
|
23
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
materialPdf,
|
|
26
|
+
status: materialPdfStatus
|
|
27
|
+
} = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.PDF, React__default["default"].useCallback(signal => apiClient.getOrgMaterialPdfGet({
|
|
24
28
|
materialPdfId
|
|
25
29
|
}, {
|
|
26
30
|
signal
|
|
27
|
-
}), [materialPdfId])); //
|
|
31
|
+
}), [materialPdfId]), apiClient.config.init); //
|
|
28
32
|
//
|
|
29
33
|
//
|
|
30
34
|
|
|
@@ -35,11 +39,11 @@ const MaterialPdf = ({
|
|
|
35
39
|
return React__default["default"].createElement(MaterialPdf_styled.StyledMaterialPdfWrapper, {
|
|
36
40
|
className: classnames__default["default"](prefixCls, className)
|
|
37
41
|
}, React__default["default"].createElement(blocks.PdfRenderer, {
|
|
38
|
-
key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
39
|
-
file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
40
|
-
title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
42
|
+
key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url,
|
|
43
|
+
file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) !== null && _a !== void 0 ? _a : '',
|
|
44
|
+
title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title,
|
|
41
45
|
cMapUrl: cMapUrl,
|
|
42
|
-
hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
46
|
+
hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected'
|
|
43
47
|
}));
|
|
44
48
|
};
|
|
45
49
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { getOrgMaterialPdfGet, config } from '@elice/api-client';
|
|
3
3
|
import { Spinner, PdfRenderer } from '@elice/blocks';
|
|
4
|
-
import {
|
|
4
|
+
import { useMaterialFetch } from '@elice/material-shared-utils';
|
|
5
|
+
import { enums } from '@elice/types';
|
|
5
6
|
import classnames from 'classnames';
|
|
6
7
|
import { StyledMaterialPdfWrapper } from './MaterialPdf.styled.js';
|
|
7
8
|
|
|
@@ -13,11 +14,14 @@ const MaterialPdf = ({
|
|
|
13
14
|
var _a;
|
|
14
15
|
|
|
15
16
|
const prefixCls = 'em-material-pdf';
|
|
16
|
-
const
|
|
17
|
+
const {
|
|
18
|
+
materialPdf,
|
|
19
|
+
status: materialPdfStatus
|
|
20
|
+
} = useMaterialFetch(enums.LectureMaterialType.PDF, React.useCallback(signal => getOrgMaterialPdfGet({
|
|
17
21
|
materialPdfId
|
|
18
22
|
}, {
|
|
19
23
|
signal
|
|
20
|
-
}), [materialPdfId])); //
|
|
24
|
+
}), [materialPdfId]), config.init); //
|
|
21
25
|
//
|
|
22
26
|
//
|
|
23
27
|
|
|
@@ -28,11 +32,11 @@ const MaterialPdf = ({
|
|
|
28
32
|
return React.createElement(StyledMaterialPdfWrapper, {
|
|
29
33
|
className: classnames(prefixCls, className)
|
|
30
34
|
}, React.createElement(PdfRenderer, {
|
|
31
|
-
key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
32
|
-
file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
33
|
-
title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
35
|
+
key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url,
|
|
36
|
+
file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) !== null && _a !== void 0 ? _a : '',
|
|
37
|
+
title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title,
|
|
34
38
|
cMapUrl: cMapUrl,
|
|
35
|
-
hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.
|
|
39
|
+
hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected'
|
|
36
40
|
}));
|
|
37
41
|
};
|
|
38
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-pdf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.230306.1",
|
|
4
4
|
"description": "User view and editing components of Elice material PDF",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@elice/api-client": "1.
|
|
32
|
+
"@elice/api-client": "^1.230306.0",
|
|
33
33
|
"@elice/blocks": "^1.220803.0",
|
|
34
34
|
"@elice/design-tokens": "^1.220803.0",
|
|
35
35
|
"@elice/icons": "^1.220803.0",
|
|
36
36
|
"@elice/markdown": "^1.220803.0",
|
|
37
37
|
"@elice/material-shared-types": "*",
|
|
38
38
|
"@elice/material-shared-utils": "*",
|
|
39
|
-
"@elice/types": "1.
|
|
39
|
+
"@elice/types": "^1.230306.0",
|
|
40
40
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
41
41
|
"react-intl": "^5.0.0",
|
|
42
42
|
"react-use": "^17.0.0",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"tslib": "^2.3.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@elice/api-client": "1.
|
|
50
|
+
"@elice/api-client": "^1.230306.0",
|
|
51
51
|
"@elice/blocks": "^1.220803.0",
|
|
52
52
|
"@elice/design-tokens": "^1.220803.0",
|
|
53
53
|
"@elice/icons": "^1.220803.0",
|
|
54
54
|
"@elice/icons-legacy": "npm:@elice/icons@0.220803.1",
|
|
55
55
|
"@elice/markdown": "^1.220803.0",
|
|
56
|
-
"@elice/material-shared-types": "1.
|
|
57
|
-
"@elice/material-shared-utils": "1.
|
|
58
|
-
"@elice/types": "1.
|
|
56
|
+
"@elice/material-shared-types": "1.230306.1",
|
|
57
|
+
"@elice/material-shared-utils": "1.230306.1",
|
|
58
|
+
"@elice/types": "^1.230306.0",
|
|
59
59
|
"@types/classnames": "^2.3.1",
|
|
60
60
|
"@types/react": "~17.0.9",
|
|
61
61
|
"@types/styled-components": "^5.1.21",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"react-use": "^17.2.4",
|
|
65
65
|
"styled-components": "^5.3.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "d834b422afcf3ed40499a3c169465a30aaa622e4"
|
|
68
68
|
}
|