@elice/material-video-file 1.240401.0 → 1.240508.0-globalization.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.
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
+ import type { WithIntlComponentBuilderProps } from '@elice/intl';
2
3
  import type { MaterialVideoFilePlayerProps } from './MaterialVideoFilePlayer';
3
4
  import type { UseMaterialVideoFileApiProps } from './useMaterialVideoFileApi';
4
5
  type PickedVideoPlayerProps = Pick<MaterialVideoFilePlayerProps, 'materialVideoFileTrackerDisabled' | 'mainLecturePageId' | 'lms' | 'lmsOrganizationBusinessType' | 'emptyComponent' | 'autoPlay' | 'autoPlayNext' | 'endControl' | 'eliceVideoPlayerUrl' | 'onNavigatePreviousLecturePage' | 'onNavigateNextLecturePage'>;
5
6
  export interface MaterialVideoFileProps extends PickedVideoPlayerProps, UseMaterialVideoFileApiProps {
6
7
  materialVideoFileId: number;
7
8
  className?: string;
8
- locale?: string;
9
9
  }
10
- declare const MaterialVideoFile: React.FC<MaterialVideoFileProps>;
11
- export default MaterialVideoFile;
10
+ declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialVideoFileProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
11
+ export default _default;
@@ -4,12 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
6
  var React = require('react');
7
- var reactIntl = require('react-intl');
8
7
  var apiClient = require('@elice/api-client');
8
+ var intl = require('@elice/intl');
9
9
  var materialSharedUtils = require('@elice/material-shared-utils');
10
10
  var types = require('@elice/types');
11
11
  var classnames = require('classnames');
12
- var locales = require('./locales.js');
12
+ var en = require('./locales/en.json.js');
13
+ var ko = require('./locales/ko.json.js');
14
+ var th = require('./locales/th.json.js');
13
15
  var MaterialVideoFilePlayer = require('./MaterialVideoFilePlayer.js');
14
16
  var useMaterialVideoFileApi = require('./useMaterialVideoFileApi.js');
15
17
  var MaterialVideoFile_styled = require('./MaterialVideoFile.styled.js');
@@ -22,10 +24,10 @@ const MaterialVideoFile = _a => {
22
24
  var {
23
25
  materialVideoFileId,
24
26
  className,
25
- locale = 'en',
26
- eliceAccountApiConfiguration
27
+ eliceAccountApiConfiguration,
28
+ __intl
27
29
  } = _a,
28
- playerProps = tslib.__rest(_a, ["materialVideoFileId", "className", "locale", "eliceAccountApiConfiguration"]);
30
+ playerProps = tslib.__rest(_a, ["materialVideoFileId", "className", "eliceAccountApiConfiguration", "__intl"]);
29
31
  const prefixCls = 'em-material-video-file';
30
32
  const {
31
33
  orgNameShort
@@ -46,12 +48,12 @@ const MaterialVideoFile = _a => {
46
48
  //
47
49
  //
48
50
  //
49
- return React.createElement(MaterialVideoFile_styled.StyledMaterialVideoFileWrap, {
51
+ return React.createElement(intl.RawEliceIntlProvider, {
52
+ value: {
53
+ intl: __intl
54
+ }
55
+ }, React.createElement(MaterialVideoFile_styled.StyledMaterialVideoFileWrap, {
50
56
  className: classnames(prefixCls, className)
51
- }, React.createElement(reactIntl.IntlProvider, {
52
- locale: locale,
53
- defaultLocale: "en",
54
- messages: locale in locales ? locales[locale] : locales.en
55
57
  }, React.createElement(MaterialVideoFilePlayer.default, Object.assign({}, playerProps, {
56
58
  orgNameShort: orgNameShort,
57
59
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
@@ -60,5 +62,6 @@ const MaterialVideoFile = _a => {
60
62
  title: (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.videoAssetName) !== null && _c !== void 0 ? _c : undefined
61
63
  }))));
62
64
  };
65
+ var MaterialVideoFile$1 = new intl.IntlComponentBuilder(MaterialVideoFile).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
63
66
 
64
- exports.default = MaterialVideoFile;
67
+ exports.default = MaterialVideoFile$1;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var reactIntl = require('react-intl');
7
6
  var blocks = require('@elice/blocks');
7
+ var intl = require('@elice/intl');
8
8
  var types = require('@elice/types');
9
9
  var classnames = require('classnames');
10
10
  var MaterialVideoFilePlayer_styled = require('./MaterialVideoFilePlayer.styled.js');
@@ -57,6 +57,9 @@ const MaterialVideoFilePlayer = ({
57
57
  accountApi
58
58
  }) => {
59
59
  const prefixCls = 'em-video-player';
60
+ const {
61
+ intl: intl$1
62
+ } = intl.useRawEliceIntl();
60
63
  const [playerFrameSrc, setPlayerFrameSrc] = React.useState(null);
61
64
  /**
62
65
  * Current video status.
@@ -177,8 +180,8 @@ const MaterialVideoFilePlayer = ({
177
180
  lineHeight: 1.5,
178
181
  textAlign: "center",
179
182
  preWrap: true
180
- }, React.createElement(reactIntl.FormattedMessage, {
181
- id: "videoFile.player.encoding"
183
+ }, intl$1.formatMessage({
184
+ id: 'videoFile.player.encoding'
182
185
  })));
183
186
  }
184
187
  // encoding failed
@@ -188,8 +191,8 @@ const MaterialVideoFilePlayer = ({
188
191
  lineHeight: 1.5,
189
192
  textAlign: "center",
190
193
  preWrap: true
191
- }, React.createElement(reactIntl.FormattedMessage, {
192
- id: "videoFile.player.encodingFailed"
194
+ }, intl$1.formatMessage({
195
+ id: 'videoFile.player.encodingFailed'
193
196
  })));
194
197
  }
195
198
  // resolved
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var messageEn = {"videoFile.player.preparing":"{_termLibraryLecturePage} on preparing.","videoFile.player.uploadVideoBtn":"Upload File","videoFile.player.encoding":"A video is being prepared.\nPlease check back later.","videoFile.player.encodingFailed":"There was a problem processing the video.\nIf the problem persists, please contact customer service.","videoFile.player.noVideo":"This file does not exist."};
6
+
7
+ exports.default = messageEn;
@@ -0,0 +1,3 @@
1
+ export { default as messageEn } from './en.json';
2
+ export { default as messageKo } from './ko.json';
3
+ export { default as messageTh } from './th.json';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var messageKo = {"videoFile.player.preparing":"{_termLibraryLecturePage}를 준비 중입니다.","videoFile.player.uploadVideoBtn":"파일 업로드","videoFile.player.encoding":"동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.","videoFile.player.encodingFailed":"동영상 준비 중 문제가 발생하였습니다.\n문제가 지속될 경우 고객센터에 문의해주세요.","videoFile.player.noVideo":"존재하지 않는 파일입니다."};
6
+
7
+ exports.default = messageKo;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var messageTh = {"videoFile.player.preparing":"กำลังเตรียมข้อมูลค่ะ.","videoFile.player.uploadVideoBtn":"อัปโหลดไฟล์","videoFile.player.encoding":"วิดีโอกำลังเตรียมการ\nโปรดตรวจสอบอีกครั้งในภายหลัง","videoFile.player.encodingFailed":"วิดีโอกำลังเตรียมการมีปัญหาเกิดขึ้น\nหากปัญหายังคงอยู่โปรดติดต่อศูนย์บริการลูกค้า","videoFile.player.noVideo":"ไม่มีไฟล์ที่มีอยู่"};
6
+
7
+ exports.default = messageTh;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
+ import type { WithIntlComponentBuilderProps } from '@elice/intl';
2
3
  import type { MaterialVideoFilePlayerProps } from './MaterialVideoFilePlayer';
3
4
  import type { UseMaterialVideoFileApiProps } from './useMaterialVideoFileApi';
4
5
  type PickedVideoPlayerProps = Pick<MaterialVideoFilePlayerProps, 'materialVideoFileTrackerDisabled' | 'mainLecturePageId' | 'lms' | 'lmsOrganizationBusinessType' | 'emptyComponent' | 'autoPlay' | 'autoPlayNext' | 'endControl' | 'eliceVideoPlayerUrl' | 'onNavigatePreviousLecturePage' | 'onNavigateNextLecturePage'>;
5
6
  export interface MaterialVideoFileProps extends PickedVideoPlayerProps, UseMaterialVideoFileApiProps {
6
7
  materialVideoFileId: number;
7
8
  className?: string;
8
- locale?: string;
9
9
  }
10
- declare const MaterialVideoFile: React.FC<MaterialVideoFileProps>;
11
- export default MaterialVideoFile;
10
+ declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialVideoFileProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
11
+ export default _default;
@@ -1,12 +1,13 @@
1
1
  import { __rest } from 'tslib';
2
2
  import React from 'react';
3
- import { IntlProvider } from 'react-intl';
4
3
  import { getOrgMaterialVideoFileGet, config } from '@elice/api-client';
4
+ import { IntlComponentBuilder, RawEliceIntlProvider } from '@elice/intl';
5
5
  import { useMaterialConfig, useMaterialFetch } from '@elice/material-shared-utils';
6
6
  import { enums } from '@elice/types';
7
7
  import classnames from 'classnames';
8
- import * as locales from './locales.js';
9
- import { en } from './locales.js';
8
+ import messageEn from './locales/en.json.js';
9
+ import messageKo from './locales/ko.json.js';
10
+ import messageTh from './locales/th.json.js';
10
11
  import MaterialVideoFilePlayer from './MaterialVideoFilePlayer.js';
11
12
  import { useMaterialVideoFileApi } from './useMaterialVideoFileApi.js';
12
13
  import { StyledMaterialVideoFileWrap } from './MaterialVideoFile.styled.js';
@@ -19,10 +20,10 @@ const MaterialVideoFile = _a => {
19
20
  var {
20
21
  materialVideoFileId,
21
22
  className,
22
- locale = 'en',
23
- eliceAccountApiConfiguration
23
+ eliceAccountApiConfiguration,
24
+ __intl
24
25
  } = _a,
25
- playerProps = __rest(_a, ["materialVideoFileId", "className", "locale", "eliceAccountApiConfiguration"]);
26
+ playerProps = __rest(_a, ["materialVideoFileId", "className", "eliceAccountApiConfiguration", "__intl"]);
26
27
  const prefixCls = 'em-material-video-file';
27
28
  const {
28
29
  orgNameShort
@@ -43,12 +44,12 @@ const MaterialVideoFile = _a => {
43
44
  //
44
45
  //
45
46
  //
46
- return React.createElement(StyledMaterialVideoFileWrap, {
47
+ return React.createElement(RawEliceIntlProvider, {
48
+ value: {
49
+ intl: __intl
50
+ }
51
+ }, React.createElement(StyledMaterialVideoFileWrap, {
47
52
  className: classnames(prefixCls, className)
48
- }, React.createElement(IntlProvider, {
49
- locale: locale,
50
- defaultLocale: "en",
51
- messages: locale in locales ? locales[locale] : en
52
53
  }, React.createElement(MaterialVideoFilePlayer, Object.assign({}, playerProps, {
53
54
  orgNameShort: orgNameShort,
54
55
  materialVideoFile: materialVideoFile !== null && materialVideoFile !== void 0 ? materialVideoFile : null,
@@ -57,5 +58,6 @@ const MaterialVideoFile = _a => {
57
58
  title: (_c = (_b = materialVideoFile === null || materialVideoFile === void 0 ? void 0 : materialVideoFile.azureMediaVideo) === null || _b === void 0 ? void 0 : _b.videoAssetName) !== null && _c !== void 0 ? _c : undefined
58
59
  }))));
59
60
  };
61
+ var MaterialVideoFile$1 = new IntlComponentBuilder(MaterialVideoFile).add('en', messageEn).add('ko', messageKo).add('th', messageTh).build();
60
62
 
61
- export { MaterialVideoFile as default };
63
+ export { MaterialVideoFile$1 as default };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { FormattedMessage } from 'react-intl';
3
2
  import { Spinner, Text } from '@elice/blocks';
3
+ import { useRawEliceIntl } from '@elice/intl';
4
4
  import { enums } from '@elice/types';
5
5
  import classnames from 'classnames';
6
6
  import { StyledVideoPlayerLoading, StyledVideoPlayerWrap } from './MaterialVideoFilePlayer.styled.js';
@@ -53,6 +53,9 @@ const MaterialVideoFilePlayer = ({
53
53
  accountApi
54
54
  }) => {
55
55
  const prefixCls = 'em-video-player';
56
+ const {
57
+ intl
58
+ } = useRawEliceIntl();
56
59
  const [playerFrameSrc, setPlayerFrameSrc] = React.useState(null);
57
60
  /**
58
61
  * Current video status.
@@ -173,8 +176,8 @@ const MaterialVideoFilePlayer = ({
173
176
  lineHeight: 1.5,
174
177
  textAlign: "center",
175
178
  preWrap: true
176
- }, React.createElement(FormattedMessage, {
177
- id: "videoFile.player.encoding"
179
+ }, intl.formatMessage({
180
+ id: 'videoFile.player.encoding'
178
181
  })));
179
182
  }
180
183
  // encoding failed
@@ -184,8 +187,8 @@ const MaterialVideoFilePlayer = ({
184
187
  lineHeight: 1.5,
185
188
  textAlign: "center",
186
189
  preWrap: true
187
- }, React.createElement(FormattedMessage, {
188
- id: "videoFile.player.encodingFailed"
190
+ }, intl.formatMessage({
191
+ id: 'videoFile.player.encodingFailed'
189
192
  })));
190
193
  }
191
194
  // resolved
@@ -0,0 +1,3 @@
1
+ var messageEn = {"videoFile.player.preparing":"{_termLibraryLecturePage} on preparing.","videoFile.player.uploadVideoBtn":"Upload File","videoFile.player.encoding":"A video is being prepared.\nPlease check back later.","videoFile.player.encodingFailed":"There was a problem processing the video.\nIf the problem persists, please contact customer service.","videoFile.player.noVideo":"This file does not exist."};
2
+
3
+ export { messageEn as default };
@@ -0,0 +1,3 @@
1
+ export { default as messageEn } from './en.json';
2
+ export { default as messageKo } from './ko.json';
3
+ export { default as messageTh } from './th.json';
@@ -0,0 +1,3 @@
1
+ var messageKo = {"videoFile.player.preparing":"{_termLibraryLecturePage}를 준비 중입니다.","videoFile.player.uploadVideoBtn":"파일 업로드","videoFile.player.encoding":"동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.","videoFile.player.encodingFailed":"동영상 준비 중 문제가 발생하였습니다.\n문제가 지속될 경우 고객센터에 문의해주세요.","videoFile.player.noVideo":"존재하지 않는 파일입니다."};
2
+
3
+ export { messageKo as default };
@@ -0,0 +1,3 @@
1
+ var messageTh = {"videoFile.player.preparing":"กำลังเตรียมข้อมูลค่ะ.","videoFile.player.uploadVideoBtn":"อัปโหลดไฟล์","videoFile.player.encoding":"วิดีโอกำลังเตรียมการ\nโปรดตรวจสอบอีกครั้งในภายหลัง","videoFile.player.encodingFailed":"วิดีโอกำลังเตรียมการมีปัญหาเกิดขึ้น\nหากปัญหายังคงอยู่โปรดติดต่อศูนย์บริการลูกค้า","videoFile.player.noVideo":"ไม่มีไฟล์ที่มีอยู่"};
2
+
3
+ export { messageTh as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-video-file",
3
- "version": "1.240401.0",
3
+ "version": "1.240508.0-globalization.0",
4
4
  "description": "User view and editing components of Elice material video file",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -29,12 +29,12 @@
29
29
  "@elice/blocks": "^1",
30
30
  "@elice/design-tokens": "^1",
31
31
  "@elice/icons": "^1",
32
+ "@elice/intl": "*",
32
33
  "@elice/material-shared-types": "*",
33
34
  "@elice/material-shared-utils": "*",
34
35
  "@elice/openapi-client-account": "^1",
35
36
  "@elice/types": "^1",
36
37
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
37
- "react-intl": "^5.0.0",
38
38
  "react-use": "^17.0.0",
39
39
  "styled-components": "^5.2.0"
40
40
  },
@@ -49,8 +49,9 @@
49
49
  "@elice/design-tokens": "^1.220803.0",
50
50
  "@elice/icons": "^1.230814.0",
51
51
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
52
- "@elice/material-shared-types": "1.240401.0",
53
- "@elice/material-shared-utils": "1.240401.0",
52
+ "@elice/intl": "0.240425.0-alpha.7",
53
+ "@elice/material-shared-types": "1.240508.0-globalization.0",
54
+ "@elice/material-shared-utils": "1.240508.0-globalization.0",
54
55
  "@elice/openapi-client-account": "^1.230814.0",
55
56
  "@elice/types": "^1.240208.0",
56
57
  "@types/classnames": "^2.3.1",
@@ -58,9 +59,8 @@
58
59
  "@types/react": "~17.0.9",
59
60
  "@types/styled-components": "^5.1.21",
60
61
  "react": "^17.0.2",
61
- "react-intl": "^5.20.10",
62
62
  "react-use": "^17.2.4",
63
63
  "styled-components": "^5.3.0"
64
64
  },
65
- "gitHead": "c3c7c033d7524e3d16328399010562ca6c2c3286"
65
+ "gitHead": "e64474c7cab0b6cb852ba08a2076c88e732eec03"
66
66
  }
@@ -1,8 +0,0 @@
1
- export declare const en: {
2
- 'videoFile.player.preparing': string;
3
- 'videoFile.player.uploadVideoBtn': string;
4
- 'videoFile.player.encoding': string;
5
- 'videoFile.player.encodingFailed': string;
6
- 'videoFile.player.noVideo': string;
7
- };
8
- export declare const ko: typeof en;
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const en = {
4
- 'videoFile.player.preparing': 'Material on preparing.',
5
- 'videoFile.player.uploadVideoBtn': 'Upload File',
6
- 'videoFile.player.encoding': 'A video is being prepared.\nPlease check back later.',
7
- 'videoFile.player.encodingFailed': 'There was a problem processing the video.\nIf the problem persists, please contact customer service.',
8
- 'videoFile.player.noVideo': 'This file does not exist.'
9
- };
10
- const ko = {
11
- 'videoFile.player.preparing': '자료를 준비 중입니다.',
12
- 'videoFile.player.uploadVideoBtn': '파일 업로드',
13
- 'videoFile.player.encoding': '동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.',
14
- 'videoFile.player.encodingFailed': '동영상 준비 중 문제가 발생하였습니다.\n문제가 지속될 경우 고객센터에 문의해주세요.',
15
- 'videoFile.player.noVideo': '존재하지 않는 파일입니다.'
16
- };
17
-
18
- exports.en = en;
19
- exports.ko = ko;
@@ -1,8 +0,0 @@
1
- export declare const en: {
2
- 'videoFile.player.preparing': string;
3
- 'videoFile.player.uploadVideoBtn': string;
4
- 'videoFile.player.encoding': string;
5
- 'videoFile.player.encodingFailed': string;
6
- 'videoFile.player.noVideo': string;
7
- };
8
- export declare const ko: typeof en;
@@ -1,16 +0,0 @@
1
- const en = {
2
- 'videoFile.player.preparing': 'Material on preparing.',
3
- 'videoFile.player.uploadVideoBtn': 'Upload File',
4
- 'videoFile.player.encoding': 'A video is being prepared.\nPlease check back later.',
5
- 'videoFile.player.encodingFailed': 'There was a problem processing the video.\nIf the problem persists, please contact customer service.',
6
- 'videoFile.player.noVideo': 'This file does not exist.'
7
- };
8
- const ko = {
9
- 'videoFile.player.preparing': '자료를 준비 중입니다.',
10
- 'videoFile.player.uploadVideoBtn': '파일 업로드',
11
- 'videoFile.player.encoding': '동영상을 준비 중 입니다.\n잠시 후 다시 확인해주세요.',
12
- 'videoFile.player.encodingFailed': '동영상 준비 중 문제가 발생하였습니다.\n문제가 지속될 경우 고객센터에 문의해주세요.',
13
- 'videoFile.player.noVideo': '존재하지 않는 파일입니다.'
14
- };
15
-
16
- export { en, ko };