@elice/material-pdf 1.240529.0 → 1.240614.0-cloudflare.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.
@@ -27,9 +27,14 @@ const MaterialPdfContent = ({
27
27
  signal
28
28
  }), [materialPdfId]), apiClient.config.init);
29
29
  const isPowerPointFile = React.useMemo(() => {
30
+ var _a, _b;
30
31
  if (!(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url)) return false;
31
- const file = new URL(materialPdf.attachment.url).pathname;
32
- return POWERPOINT_EXTENSIONS.some(extension => file.includes(extension));
32
+ const {
33
+ pathname
34
+ } = new URL(materialPdf.attachment.url);
35
+ const currentFileName = (_a = pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
36
+ const currentFileExtension = (_b = currentFileName.split('.').pop()) !== null && _b !== void 0 ? _b : '';
37
+ return POWERPOINT_EXTENSIONS.some(extension => currentFileExtension.toLowerCase().includes(extension));
33
38
  }, [materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url]);
34
39
  const componentProps = React.useMemo(() => {
35
40
  var _a;
@@ -23,9 +23,14 @@ const MaterialPdfContent = ({
23
23
  signal
24
24
  }), [materialPdfId]), config.init);
25
25
  const isPowerPointFile = useMemo(() => {
26
+ var _a, _b;
26
27
  if (!(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url)) return false;
27
- const file = new URL(materialPdf.attachment.url).pathname;
28
- return POWERPOINT_EXTENSIONS.some(extension => file.includes(extension));
28
+ const {
29
+ pathname
30
+ } = new URL(materialPdf.attachment.url);
31
+ const currentFileName = (_a = pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
32
+ const currentFileExtension = (_b = currentFileName.split('.').pop()) !== null && _b !== void 0 ? _b : '';
33
+ return POWERPOINT_EXTENSIONS.some(extension => currentFileExtension.toLowerCase().includes(extension));
29
34
  }, [materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url]);
30
35
  const componentProps = useMemo(() => {
31
36
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-pdf",
3
- "version": "1.240529.0",
3
+ "version": "1.240614.0-cloudflare.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",
@@ -50,8 +50,8 @@
50
50
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
51
51
  "@elice/intl": "0.240425.0-rc.2",
52
52
  "@elice/markdown": "^1.220815.0",
53
- "@elice/material-shared-types": "1.240529.0",
54
- "@elice/material-shared-utils": "1.240529.0",
53
+ "@elice/material-shared-types": "1.240614.0-cloudflare.0",
54
+ "@elice/material-shared-utils": "1.240614.0-cloudflare.0",
55
55
  "@elice/types": "^1.240208.0",
56
56
  "@types/classnames": "^2.3.1",
57
57
  "@types/react": "~17.0.9",
@@ -60,5 +60,5 @@
60
60
  "react-use": "^17.2.4",
61
61
  "styled-components": "^5.3.0"
62
62
  },
63
- "gitHead": "88d206c84227d8e370ee44df208395083833e3ec"
63
+ "gitHead": "5bbe89e1c936c1a1027482b3840f7fa9763ccdb9"
64
64
  }