@elice/material-pdf 1.260612.0 → 1.260716.0-pdfdownload.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.
@@ -5,6 +5,7 @@ export interface MaterialPdfProps {
5
5
  materialPdfId: number;
6
6
  cMapUrl?: string;
7
7
  locale?: string;
8
+ onDownloadError?: (err?: Error) => void;
8
9
  }
9
10
  declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialPdfProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
10
11
  export default _default;
@@ -30,6 +30,7 @@ var MaterialPdf = function MaterialPdf(_ref) {
30
30
  var className = _ref.className,
31
31
  materialPdfId = _ref.materialPdfId,
32
32
  cMapUrl = _ref.cMapUrl,
33
+ onDownloadError = _ref.onDownloadError,
33
34
  __intl = _ref.__intl;
34
35
  var prefixCls = 'em-material-pdf';
35
36
  //
@@ -41,7 +42,8 @@ var MaterialPdf = function MaterialPdf(_ref) {
41
42
  className: classnames__default.default(prefixCls, className),
42
43
  children: jsxRuntime.jsx(MaterialPdfContent.default, {
43
44
  materialPdfId: materialPdfId,
44
- cMapUrl: cMapUrl
45
+ cMapUrl: cMapUrl,
46
+ onDownloadError: onDownloadError
45
47
  })
46
48
  })
47
49
  });
@@ -20,7 +20,8 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
20
20
  var POWERPOINT_EXTENSIONS = ['ppt', 'pptx', 'pps', 'ppsx'];
21
21
  var MaterialPdfContent = function MaterialPdfContent(_ref) {
22
22
  var materialPdfId = _ref.materialPdfId,
23
- cMapUrl = _ref.cMapUrl;
23
+ cMapUrl = _ref.cMapUrl,
24
+ onDownloadError = _ref.onDownloadError;
24
25
  var intl$1 = intl.useRawEliceIntl();
25
26
  var _useMaterialFetch = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.PDF, React__default.default.useCallback(function (signal) {
26
27
  return apiClient.getOrgMaterialPdfGet({
@@ -61,6 +62,7 @@ var MaterialPdfContent = function MaterialPdfContent(_ref) {
61
62
  title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title,
62
63
  cMapUrl: cMapUrl,
63
64
  hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected',
65
+ onDownloadError: onDownloadError,
64
66
  i18n: {
65
67
  fullscreen: intl$1.formatMessage({
66
68
  id: 'pdf.fullScreen'
@@ -76,7 +78,7 @@ var MaterialPdfContent = function MaterialPdfContent(_ref) {
76
78
  })
77
79
  }
78
80
  };
79
- }, [cMapUrl, intl$1, isPowerPointFile, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title, materialPdfStatus]);
81
+ }, [cMapUrl, intl$1, isPowerPointFile, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title, materialPdfStatus, onDownloadError]);
80
82
  if (materialPdfStatus === 'pending') {
81
83
  return jsxRuntime.jsx(blocks.Spinner, {});
82
84
  }
@@ -5,6 +5,7 @@ export interface MaterialPdfProps {
5
5
  materialPdfId: number;
6
6
  cMapUrl?: string;
7
7
  locale?: string;
8
+ onDownloadError?: (err?: Error) => void;
8
9
  }
9
10
  declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialPdfProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
10
11
  export default _default;
@@ -21,6 +21,7 @@ var MaterialPdf = function MaterialPdf(_ref) {
21
21
  var className = _ref.className,
22
22
  materialPdfId = _ref.materialPdfId,
23
23
  cMapUrl = _ref.cMapUrl,
24
+ onDownloadError = _ref.onDownloadError,
24
25
  __intl = _ref.__intl;
25
26
  var prefixCls = 'em-material-pdf';
26
27
  //
@@ -32,7 +33,8 @@ var MaterialPdf = function MaterialPdf(_ref) {
32
33
  className: classnames(prefixCls, className),
33
34
  children: jsx(MaterialPdfContent, {
34
35
  materialPdfId: materialPdfId,
35
- cMapUrl: cMapUrl
36
+ cMapUrl: cMapUrl,
37
+ onDownloadError: onDownloadError
36
38
  })
37
39
  })
38
40
  });
@@ -12,7 +12,8 @@ import { enums } from '@elice/types';
12
12
  var POWERPOINT_EXTENSIONS = ['ppt', 'pptx', 'pps', 'ppsx'];
13
13
  var MaterialPdfContent = function MaterialPdfContent(_ref) {
14
14
  var materialPdfId = _ref.materialPdfId,
15
- cMapUrl = _ref.cMapUrl;
15
+ cMapUrl = _ref.cMapUrl,
16
+ onDownloadError = _ref.onDownloadError;
16
17
  var intl = useRawEliceIntl();
17
18
  var _useMaterialFetch = useMaterialFetch(enums.LectureMaterialType.PDF, React.useCallback(function (signal) {
18
19
  return getOrgMaterialPdfGet({
@@ -53,6 +54,7 @@ var MaterialPdfContent = function MaterialPdfContent(_ref) {
53
54
  title: materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title,
54
55
  cMapUrl: cMapUrl,
55
56
  hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected',
57
+ onDownloadError: onDownloadError,
56
58
  i18n: {
57
59
  fullscreen: intl.formatMessage({
58
60
  id: 'pdf.fullScreen'
@@ -68,7 +70,7 @@ var MaterialPdfContent = function MaterialPdfContent(_ref) {
68
70
  })
69
71
  }
70
72
  };
71
- }, [cMapUrl, intl, isPowerPointFile, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title, materialPdfStatus]);
73
+ }, [cMapUrl, intl, isPowerPointFile, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url, materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.title, materialPdfStatus, onDownloadError]);
72
74
  if (materialPdfStatus === 'pending') {
73
75
  return jsx(Spinner, {});
74
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-pdf",
3
- "version": "1.260612.0",
3
+ "version": "1.260716.0-pdfdownload.0",
4
4
  "description": "User view and editing components of Elice material PDF",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,8 +29,8 @@
29
29
  "@emotion/styled": "^11.10.0",
30
30
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
31
31
  "react-use": "^17.0.0",
32
- "@elice/material-shared-types": "1.260612.0",
33
- "@elice/material-shared-utils": "1.260612.0"
32
+ "@elice/material-shared-types": "1.260716.0-pdfdownload.0",
33
+ "@elice/material-shared-utils": "1.260716.0-pdfdownload.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "classnames": "^2.2.0",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@elice/api-client": "1.260529.0",
41
- "@elice/blocks": "1.260404.0",
41
+ "@elice/blocks": "1.260716.0-pdfdownload.0",
42
42
  "@elice/design-tokens": "^1.220803.0",
43
43
  "@elice/icons": "^1.230814.0",
44
44
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
@@ -58,8 +58,8 @@
58
58
  "react-use": "^17.2.4",
59
59
  "rollup": "^4.0.0",
60
60
  "typescript": "~5.9.3",
61
- "@elice/material-shared-types": "1.260612.0",
62
- "@elice/material-shared-utils": "1.260612.0"
61
+ "@elice/material-shared-types": "1.260716.0-pdfdownload.0",
62
+ "@elice/material-shared-utils": "1.260716.0-pdfdownload.0"
63
63
  },
64
64
  "scripts": {
65
65
  "start": "run-s watch",