@elice/material-lms-public-content 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
 
9
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -16,30 +17,31 @@ const MaterialLmsPublicContent = ({
16
17
  materialLmsPublicContentId
17
18
  }) => {
18
19
  const prefixCls = 'em-material-lms-public-content';
19
- const [materialLmsPublicContent, materialLmsPublicContentStatus] = materialSharedUtils.useMaterialInitFetch(apiClient.config.init, React__default["default"].useCallback(signal => apiClient.getOrgMaterialLmsPublicContentGet({
20
+ const {
21
+ materialLmsPublicContent,
22
+ status: materialLmsPublicContentStatus
23
+ } = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.LMSPublicContent, React__default["default"].useCallback(signal => apiClient.getOrgMaterialLmsPublicContentGet({
20
24
  materialLmsPublicContentId
21
25
  }, {
22
26
  signal
23
- }), [materialLmsPublicContentId]));
27
+ }), [materialLmsPublicContentId]), apiClient.config.init);
24
28
  /**
25
29
  *
26
30
  */
27
31
 
28
32
  const renderContent = () => {
29
- var _a, _b;
30
-
31
33
  if (materialLmsPublicContentStatus === 'pending') {
32
34
  return React__default["default"].createElement(blocks.Spinner, null);
33
35
  }
34
36
 
35
37
  return React__default["default"].createElement("iframe", {
36
- title: (_a = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _a === void 0 ? void 0 : _a.title,
38
+ title: materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.title,
37
39
  width: "100%",
38
40
  height: "100%",
39
41
  style: {
40
42
  border: 0
41
43
  },
42
- src: (_b = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _b === void 0 ? void 0 : _b.url
44
+ src: materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.url
43
45
  });
44
46
  }; //
45
47
  //
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- import { config, getOrgMaterialLmsPublicContentGet } from '@elice/api-client';
2
+ import { getOrgMaterialLmsPublicContentGet, config } from '@elice/api-client';
3
3
  import { Flex, Spinner } from '@elice/blocks';
4
- import { useMaterialInitFetch } from '@elice/material-shared-utils';
4
+ import { useMaterialFetch } from '@elice/material-shared-utils';
5
+ import { enums } from '@elice/types';
5
6
  import classnames from 'classnames';
6
7
 
7
8
  const MaterialLmsPublicContent = ({
@@ -9,30 +10,31 @@ const MaterialLmsPublicContent = ({
9
10
  materialLmsPublicContentId
10
11
  }) => {
11
12
  const prefixCls = 'em-material-lms-public-content';
12
- const [materialLmsPublicContent, materialLmsPublicContentStatus] = useMaterialInitFetch(config.init, React.useCallback(signal => getOrgMaterialLmsPublicContentGet({
13
+ const {
14
+ materialLmsPublicContent,
15
+ status: materialLmsPublicContentStatus
16
+ } = useMaterialFetch(enums.LectureMaterialType.LMSPublicContent, React.useCallback(signal => getOrgMaterialLmsPublicContentGet({
13
17
  materialLmsPublicContentId
14
18
  }, {
15
19
  signal
16
- }), [materialLmsPublicContentId]));
20
+ }), [materialLmsPublicContentId]), config.init);
17
21
  /**
18
22
  *
19
23
  */
20
24
 
21
25
  const renderContent = () => {
22
- var _a, _b;
23
-
24
26
  if (materialLmsPublicContentStatus === 'pending') {
25
27
  return React.createElement(Spinner, null);
26
28
  }
27
29
 
28
30
  return React.createElement("iframe", {
29
- title: (_a = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _a === void 0 ? void 0 : _a.title,
31
+ title: materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.title,
30
32
  width: "100%",
31
33
  height: "100%",
32
34
  style: {
33
35
  border: 0
34
36
  },
35
- src: (_b = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _b === void 0 ? void 0 : _b.url
37
+ src: materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.url
36
38
  });
37
39
  }; //
38
40
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-lms-public-content",
3
- "version": "1.230222.0",
3
+ "version": "1.230306.1",
4
4
  "description": "User view and editing components of Elice material LMS public content",
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.230215.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.230215.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.230215.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.230222.0",
57
- "@elice/material-shared-utils": "1.230222.0",
58
- "@elice/types": "1.230215.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": "31176c73215066ca4d6760b8c8fde4e49fcba2ec"
67
+ "gitHead": "d834b422afcf3ed40499a3c169465a30aaa622e4"
68
68
  }