@elice/material-video 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.
@@ -6,7 +6,6 @@ var reactIntl = require('react-intl');
6
6
  var apiClient = require('@elice/api-client');
7
7
  var blocks = require('@elice/blocks');
8
8
  var materialSharedUtils = require('@elice/material-shared-utils');
9
- var types = require('@elice/types');
10
9
  var classnames = require('classnames');
11
10
  var locales = require('./locales.js');
12
11
  var MaterialVideoContent = require('./MaterialVideoContent.js');
@@ -17,6 +16,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
16
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
18
17
 
19
18
  const MaterialVideo = _a => {
19
+ var _b;
20
+
20
21
  var {
21
22
  className,
22
23
  materialVideoId,
@@ -25,14 +26,11 @@ const MaterialVideo = _a => {
25
26
  youtubeProps = tslib.__rest(_a, ["className", "materialVideoId", "locale"]);
26
27
 
27
28
  const prefixCls = 'em-material-video';
28
- const {
29
- materialVideo,
30
- status: materialVideoStatus
31
- } = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.Video, React__default["default"].useCallback(signal => apiClient.getOrgMaterialVideoGet({
29
+ const [materialVideo, materialVideoStatus] = materialSharedUtils.useMaterialInitFetch(apiClient.config.init, React__default["default"].useCallback(signal => apiClient.getOrgMaterialVideoGet({
32
30
  materialVideoId
33
31
  }, {
34
32
  signal
35
- }), [materialVideoId]), apiClient.config.init);
33
+ }), [materialVideoId]));
36
34
  return React__default["default"].createElement(blocks.Flex, {
37
35
  className: classnames__default["default"](prefixCls, className),
38
36
  align: "center",
@@ -44,7 +42,7 @@ const MaterialVideo = _a => {
44
42
  defaultLocale: "en",
45
43
  messages: locale in locales ? locales[locale] : locales.en
46
44
  }, React__default["default"].createElement(MaterialVideoContent, Object.assign({
47
- materialVideo: materialVideo !== null && materialVideo !== void 0 ? materialVideo : null,
45
+ materialVideo: (_b = materialVideo === null || materialVideo === void 0 ? void 0 : materialVideo.materialVideo) !== null && _b !== void 0 ? _b : null,
48
46
  videoGetStatus: materialVideoStatus
49
47
  }, youtubeProps))));
50
48
  };
@@ -1,16 +1,17 @@
1
1
  import { __rest } from 'tslib';
2
2
  import React from 'react';
3
3
  import { IntlProvider } from 'react-intl';
4
- import { getOrgMaterialVideoGet, config } from '@elice/api-client';
4
+ import { config, getOrgMaterialVideoGet } from '@elice/api-client';
5
5
  import { Flex } from '@elice/blocks';
6
- import { useMaterialFetch } from '@elice/material-shared-utils';
7
- import { enums } from '@elice/types';
6
+ import { useMaterialInitFetch } from '@elice/material-shared-utils';
8
7
  import classnames from 'classnames';
9
8
  import * as locales from './locales.js';
10
9
  import { en } from './locales.js';
11
10
  import MaterialVideoContent from './MaterialVideoContent.js';
12
11
 
13
12
  const MaterialVideo = _a => {
13
+ var _b;
14
+
14
15
  var {
15
16
  className,
16
17
  materialVideoId,
@@ -19,14 +20,11 @@ const MaterialVideo = _a => {
19
20
  youtubeProps = __rest(_a, ["className", "materialVideoId", "locale"]);
20
21
 
21
22
  const prefixCls = 'em-material-video';
22
- const {
23
- materialVideo,
24
- status: materialVideoStatus
25
- } = useMaterialFetch(enums.LectureMaterialType.Video, React.useCallback(signal => getOrgMaterialVideoGet({
23
+ const [materialVideo, materialVideoStatus] = useMaterialInitFetch(config.init, React.useCallback(signal => getOrgMaterialVideoGet({
26
24
  materialVideoId
27
25
  }, {
28
26
  signal
29
- }), [materialVideoId]), config.init);
27
+ }), [materialVideoId]));
30
28
  return React.createElement(Flex, {
31
29
  className: classnames(prefixCls, className),
32
30
  align: "center",
@@ -38,7 +36,7 @@ const MaterialVideo = _a => {
38
36
  defaultLocale: "en",
39
37
  messages: locale in locales ? locales[locale] : en
40
38
  }, React.createElement(MaterialVideoContent, Object.assign({
41
- materialVideo: materialVideo !== null && materialVideo !== void 0 ? materialVideo : null,
39
+ materialVideo: (_b = materialVideo === null || materialVideo === void 0 ? void 0 : materialVideo.materialVideo) !== null && _b !== void 0 ? _b : null,
42
40
  videoGetStatus: materialVideoStatus
43
41
  }, youtubeProps))));
44
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-video",
3
- "version": "1.230217.0-sepmatlec.2",
3
+ "version": "1.230220.0",
4
4
  "description": "User view and editing components of Elice material video",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -29,13 +29,13 @@
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/material-shared-types": "*",
37
37
  "@elice/material-shared-utils": "*",
38
- "@elice/types": "1.230126.0-sepmatlec.5",
38
+ "@elice/types": "1.230215.1",
39
39
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
40
40
  "react-intl": "^5.0.0",
41
41
  "react-use": "^17.0.0",
@@ -47,14 +47,14 @@
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
- "@elice/material-shared-types": "1.230217.0-sepmatlec.2",
56
- "@elice/material-shared-utils": "1.230217.0-sepmatlec.2",
57
- "@elice/types": "1.230126.0-sepmatlec.5",
55
+ "@elice/material-shared-types": "1.230220.0",
56
+ "@elice/material-shared-utils": "1.230220.0",
57
+ "@elice/types": "1.230215.1",
58
58
  "@types/classnames": "^2.3.1",
59
59
  "@types/react": "~17.0.9",
60
60
  "@types/styled-components": "^5.1.21",
@@ -63,5 +63,5 @@
63
63
  "react-use": "^17.2.4",
64
64
  "styled-components": "^5.3.0"
65
65
  },
66
- "gitHead": "ab40a7ea049f77f377503f94c1134fb9eb74a9a5"
66
+ "gitHead": "11ff1f7b809e77e19752569a5a7c852d180ee140"
67
67
  }