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