@elice/material-pdf 1.230217.0-sepmatlec.2 → 1.230220.0

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,7 +4,6 @@ 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');
8
7
  var classnames = require('classnames');
9
8
  var MaterialPdf_styled = require('./MaterialPdf.styled.js');
10
9
 
@@ -21,14 +20,11 @@ const MaterialPdf = ({
21
20
  var _a;
22
21
 
23
22
  const prefixCls = 'em-material-pdf';
24
- const {
25
- materialPdf,
26
- status: materialPdfStatus
27
- } = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.PDF, React__default["default"].useCallback(signal => apiClient.getOrgMaterialPdfGet({
23
+ const [materialPdf, materialPdfStatus] = materialSharedUtils.useMaterialInitFetch(apiClient.config.init, React__default["default"].useCallback(signal => apiClient.getOrgMaterialPdfGet({
28
24
  materialPdfId
29
25
  }, {
30
26
  signal
31
- }), [materialPdfId]), apiClient.config.init); //
27
+ }), [materialPdfId])); //
32
28
  //
33
29
  //
34
30
 
@@ -39,11 +35,11 @@ const MaterialPdf = ({
39
35
  return React__default["default"].createElement(MaterialPdf_styled.StyledMaterialPdfWrapper, {
40
36
  className: classnames__default["default"](prefixCls, className)
41
37
  }, React__default["default"].createElement(blocks.PdfRenderer, {
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,
38
+ key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url,
39
+ file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url) !== null && _a !== void 0 ? _a : '',
40
+ title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.title,
45
41
  cMapUrl: cMapUrl,
46
- hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected'
42
+ hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url) || materialPdfStatus === 'rejected'
47
43
  }));
48
44
  };
49
45
 
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { getOrgMaterialPdfGet, config } from '@elice/api-client';
2
+ import { config, getOrgMaterialPdfGet } from '@elice/api-client';
3
3
  import { Spinner, PdfRenderer } from '@elice/blocks';
4
- import { useMaterialFetch } from '@elice/material-shared-utils';
5
- import { enums } from '@elice/types';
4
+ import { useMaterialInitFetch } from '@elice/material-shared-utils';
6
5
  import classnames from 'classnames';
7
6
  import { StyledMaterialPdfWrapper } from './MaterialPdf.styled.js';
8
7
 
@@ -14,14 +13,11 @@ const MaterialPdf = ({
14
13
  var _a;
15
14
 
16
15
  const prefixCls = 'em-material-pdf';
17
- const {
18
- materialPdf,
19
- status: materialPdfStatus
20
- } = useMaterialFetch(enums.LectureMaterialType.PDF, React.useCallback(signal => getOrgMaterialPdfGet({
16
+ const [materialPdf, materialPdfStatus] = useMaterialInitFetch(config.init, React.useCallback(signal => getOrgMaterialPdfGet({
21
17
  materialPdfId
22
18
  }, {
23
19
  signal
24
- }), [materialPdfId]), config.init); //
20
+ }), [materialPdfId])); //
25
21
  //
26
22
  //
27
23
 
@@ -32,11 +28,11 @@ const MaterialPdf = ({
32
28
  return React.createElement(StyledMaterialPdfWrapper, {
33
29
  className: classnames(prefixCls, className)
34
30
  }, React.createElement(PdfRenderer, {
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,
31
+ key: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url,
32
+ file: (_a = materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url) !== null && _a !== void 0 ? _a : '',
33
+ title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.title,
38
34
  cMapUrl: cMapUrl,
39
- hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected'
35
+ hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.materialPdf.attachment.url) || materialPdfStatus === 'rejected'
40
36
  }));
41
37
  };
42
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-pdf",
3
- "version": "1.230217.0-sepmatlec.2",
3
+ "version": "1.230220.0",
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.230126.0-sepmatlec.4",
32
+ "@elice/api-client": "1.230215.1",
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.230126.0-sepmatlec.5",
39
+ "@elice/types": "1.230215.1",
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.230126.0-sepmatlec.4",
50
+ "@elice/api-client": "1.230215.1",
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.230217.0-sepmatlec.2",
57
- "@elice/material-shared-utils": "1.230217.0-sepmatlec.2",
58
- "@elice/types": "1.230126.0-sepmatlec.5",
56
+ "@elice/material-shared-types": "1.230220.0",
57
+ "@elice/material-shared-utils": "1.230220.0",
58
+ "@elice/types": "1.230215.1",
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": "ab40a7ea049f77f377503f94c1134fb9eb74a9a5"
67
+ "gitHead": "11ff1f7b809e77e19752569a5a7c852d180ee140"
68
68
  }