@elice/material-pdf 1.240401.0 → 1.240508.0-globalization.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.
- package/cjs/components/material-pdf/MaterialPdf.d.ts +3 -2
- package/cjs/components/material-pdf/MaterialPdf.js +8 -9
- package/cjs/components/material-pdf/MaterialPdfContent.js +6 -6
- package/cjs/components/material-pdf/locales/en.json.js +7 -0
- package/cjs/components/material-pdf/locales/index.d.ts +3 -0
- package/cjs/components/material-pdf/locales/ko.json.js +7 -0
- package/cjs/components/material-pdf/locales/th.json.js +7 -0
- package/es/components/material-pdf/MaterialPdf.d.ts +3 -2
- package/es/components/material-pdf/MaterialPdf.js +8 -10
- package/es/components/material-pdf/MaterialPdfContent.js +2 -2
- package/es/components/material-pdf/locales/en.json.js +3 -0
- package/es/components/material-pdf/locales/index.d.ts +3 -0
- package/es/components/material-pdf/locales/ko.json.js +3 -0
- package/es/components/material-pdf/locales/th.json.js +3 -0
- package/package.json +6 -6
- package/cjs/components/material-pdf/locales.d.ts +0 -7
- package/cjs/components/material-pdf/locales.js +0 -17
- package/es/components/material-pdf/locales.d.ts +0 -7
- package/es/components/material-pdf/locales.js +0 -14
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { WithIntlComponentBuilderProps } from '@elice/intl';
|
|
2
3
|
export interface MaterialPdfProps {
|
|
3
4
|
className?: string;
|
|
4
5
|
materialPdfId: number;
|
|
5
6
|
cMapUrl?: string;
|
|
6
7
|
locale?: string;
|
|
7
8
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialPdfProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
|
|
10
|
+
export default _default;
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var
|
|
6
|
+
var intl = require('@elice/intl');
|
|
7
7
|
var classnames = require('classnames');
|
|
8
|
-
var
|
|
8
|
+
var en = require('./locales/en.json.js');
|
|
9
|
+
var ko = require('./locales/ko.json.js');
|
|
10
|
+
var th = require('./locales/th.json.js');
|
|
9
11
|
var MaterialPdfContent = require('./MaterialPdfContent.js');
|
|
10
12
|
var MaterialPdf_styled = require('./MaterialPdf.styled.js');
|
|
11
13
|
|
|
@@ -13,22 +15,19 @@ const MaterialPdf = ({
|
|
|
13
15
|
className,
|
|
14
16
|
materialPdfId,
|
|
15
17
|
cMapUrl,
|
|
16
|
-
|
|
18
|
+
__intl
|
|
17
19
|
}) => {
|
|
18
20
|
const prefixCls = 'em-material-pdf';
|
|
19
21
|
//
|
|
20
22
|
//
|
|
21
23
|
//
|
|
22
|
-
return React.createElement(MaterialPdf_styled.StyledMaterialPdfWrapper, {
|
|
24
|
+
return React.createElement(intl.RawEliceIntlProvider, Object.assign({}, __intl), React.createElement(MaterialPdf_styled.StyledMaterialPdfWrapper, {
|
|
23
25
|
className: classnames(prefixCls, className)
|
|
24
|
-
}, React.createElement(reactIntl.IntlProvider, {
|
|
25
|
-
locale: locale,
|
|
26
|
-
defaultLocale: "en",
|
|
27
|
-
messages: locale in locales ? locales[locale] : locales.en
|
|
28
26
|
}, React.createElement(MaterialPdfContent.default, {
|
|
29
27
|
materialPdfId: materialPdfId,
|
|
30
28
|
cMapUrl: cMapUrl
|
|
31
29
|
})));
|
|
32
30
|
};
|
|
31
|
+
var MaterialPdf$1 = new intl.IntlComponentBuilder(MaterialPdf).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
|
|
33
32
|
|
|
34
|
-
exports.default = MaterialPdf;
|
|
33
|
+
exports.default = MaterialPdf$1;
|
|
@@ -3,9 +3,9 @@
|
|
|
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 apiClient = require('@elice/api-client');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
9
|
var materialSharedUtils = require('@elice/material-shared-utils');
|
|
10
10
|
var types = require('@elice/types');
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ const MaterialPdfContent = ({
|
|
|
17
17
|
cMapUrl
|
|
18
18
|
}) => {
|
|
19
19
|
var _a;
|
|
20
|
-
const intl =
|
|
20
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
21
21
|
const {
|
|
22
22
|
materialPdf,
|
|
23
23
|
status: materialPdfStatus
|
|
@@ -36,16 +36,16 @@ const MaterialPdfContent = ({
|
|
|
36
36
|
cMapUrl: cMapUrl,
|
|
37
37
|
hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected',
|
|
38
38
|
i18n: {
|
|
39
|
-
fullscreen: intl.formatMessage({
|
|
39
|
+
fullscreen: intl$1.formatMessage({
|
|
40
40
|
id: 'pdf.fullScreen'
|
|
41
41
|
}),
|
|
42
|
-
download: intl.formatMessage({
|
|
42
|
+
download: intl$1.formatMessage({
|
|
43
43
|
id: 'pdf.download'
|
|
44
44
|
}),
|
|
45
|
-
loading: intl.formatMessage({
|
|
45
|
+
loading: intl$1.formatMessage({
|
|
46
46
|
id: 'pdf.status.loading'
|
|
47
47
|
}),
|
|
48
|
-
error: intl.formatMessage({
|
|
48
|
+
error: intl$1.formatMessage({
|
|
49
49
|
id: 'pdf.status.error'
|
|
50
50
|
})
|
|
51
51
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageEn = {"pdf.status.loading":"Loading File...","pdf.status.error":"Error occurred while loading file.","pdf.fullScreen":"Full Screen","pdf.download":"File download"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageEn;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageKo = {"pdf.status.loading":"{_termLibraryLecture} {_termLibraryLecturePage} 로딩 중...","pdf.status.error":"{_termLibraryLecture} {_termLibraryLecturePage}를 가져오는 중 문제가 발생하였습니다.","pdf.fullScreen":"화면 맞춤","pdf.download":"{_termLibraryLecture} {_termLibraryLecturePage} 다운로드"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageKo;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageTh = {"pdf.status.loading":"การโหลดข้อมูลการเรียนการสอน...","pdf.status.error":"มีปัญหาขณะดึงข้อมูลการเรียนการสอนค่ะ.","pdf.fullScreen":"หน้าจอที่ปรับให้เข้ากับแบบชุด","pdf.download":"ดาวน์โหลด{_termLibraryLecturePage}"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageTh;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { WithIntlComponentBuilderProps } from '@elice/intl';
|
|
2
3
|
export interface MaterialPdfProps {
|
|
3
4
|
className?: string;
|
|
4
5
|
materialPdfId: number;
|
|
5
6
|
cMapUrl?: string;
|
|
6
7
|
locale?: string;
|
|
7
8
|
}
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialPdfProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
|
|
10
|
+
export default _default;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IntlComponentBuilder, RawEliceIntlProvider } from '@elice/intl';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import messageEn from './locales/en.json.js';
|
|
5
|
+
import messageKo from './locales/ko.json.js';
|
|
6
|
+
import messageTh from './locales/th.json.js';
|
|
6
7
|
import MaterialPdfContent from './MaterialPdfContent.js';
|
|
7
8
|
import { StyledMaterialPdfWrapper } from './MaterialPdf.styled.js';
|
|
8
9
|
|
|
@@ -10,22 +11,19 @@ const MaterialPdf = ({
|
|
|
10
11
|
className,
|
|
11
12
|
materialPdfId,
|
|
12
13
|
cMapUrl,
|
|
13
|
-
|
|
14
|
+
__intl
|
|
14
15
|
}) => {
|
|
15
16
|
const prefixCls = 'em-material-pdf';
|
|
16
17
|
//
|
|
17
18
|
//
|
|
18
19
|
//
|
|
19
|
-
return React.createElement(StyledMaterialPdfWrapper, {
|
|
20
|
+
return React.createElement(RawEliceIntlProvider, Object.assign({}, __intl), React.createElement(StyledMaterialPdfWrapper, {
|
|
20
21
|
className: classnames(prefixCls, className)
|
|
21
|
-
}, React.createElement(IntlProvider, {
|
|
22
|
-
locale: locale,
|
|
23
|
-
defaultLocale: "en",
|
|
24
|
-
messages: locale in locales ? locales[locale] : en
|
|
25
22
|
}, React.createElement(MaterialPdfContent, {
|
|
26
23
|
materialPdfId: materialPdfId,
|
|
27
24
|
cMapUrl: cMapUrl
|
|
28
25
|
})));
|
|
29
26
|
};
|
|
27
|
+
var MaterialPdf$1 = new IntlComponentBuilder(MaterialPdf).add('en', messageEn).add('ko', messageKo).add('th', messageTh).build();
|
|
30
28
|
|
|
31
|
-
export { MaterialPdf as default };
|
|
29
|
+
export { MaterialPdf$1 as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useIntl } from 'react-intl';
|
|
3
2
|
import { getOrgMaterialPdfGet, config } from '@elice/api-client';
|
|
4
3
|
import { Spinner, PdfRenderer } from '@elice/blocks';
|
|
4
|
+
import { useRawEliceIntl } from '@elice/intl';
|
|
5
5
|
import { useMaterialFetch } from '@elice/material-shared-utils';
|
|
6
6
|
import { enums } from '@elice/types';
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ const MaterialPdfContent = ({
|
|
|
13
13
|
cMapUrl
|
|
14
14
|
}) => {
|
|
15
15
|
var _a;
|
|
16
|
-
const intl =
|
|
16
|
+
const intl = useRawEliceIntl();
|
|
17
17
|
const {
|
|
18
18
|
materialPdf,
|
|
19
19
|
status: materialPdfStatus
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var messageKo = {"pdf.status.loading":"{_termLibraryLecture} {_termLibraryLecturePage} 로딩 중...","pdf.status.error":"{_termLibraryLecture} {_termLibraryLecturePage}를 가져오는 중 문제가 발생하였습니다.","pdf.fullScreen":"화면 맞춤","pdf.download":"{_termLibraryLecture} {_termLibraryLecturePage} 다운로드"};
|
|
2
|
+
|
|
3
|
+
export { messageKo as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-pdf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.240508.0-globalization.1",
|
|
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",
|
|
@@ -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/markdown": "^1",
|
|
33
34
|
"@elice/material-shared-types": "*",
|
|
34
35
|
"@elice/material-shared-utils": "*",
|
|
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
|
},
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
"@elice/design-tokens": "^1.220803.0",
|
|
49
49
|
"@elice/icons": "^1.230814.0",
|
|
50
50
|
"@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
|
|
51
|
+
"@elice/intl": "0.240425.0-alpha.9",
|
|
51
52
|
"@elice/markdown": "^1.220815.0",
|
|
52
|
-
"@elice/material-shared-types": "1.
|
|
53
|
-
"@elice/material-shared-utils": "1.
|
|
53
|
+
"@elice/material-shared-types": "1.240508.0-globalization.1",
|
|
54
|
+
"@elice/material-shared-utils": "1.240508.0-globalization.1",
|
|
54
55
|
"@elice/types": "^1.240208.0",
|
|
55
56
|
"@types/classnames": "^2.3.1",
|
|
56
57
|
"@types/react": "~17.0.9",
|
|
57
58
|
"@types/styled-components": "^5.1.21",
|
|
58
59
|
"react": "^17.0.2",
|
|
59
|
-
"react-intl": "^5.20.10",
|
|
60
60
|
"react-use": "^17.2.4",
|
|
61
61
|
"styled-components": "^5.3.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "359abc2f14610a96b1c4514aedb4a7d0ad02aed3"
|
|
64
64
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const en = {
|
|
4
|
-
'pdf.status.loading': 'Loading File...',
|
|
5
|
-
'pdf.status.error': 'Error occurred while loading file.',
|
|
6
|
-
'pdf.fullScreen': 'Full Screen',
|
|
7
|
-
'pdf.download': 'File download'
|
|
8
|
-
};
|
|
9
|
-
const ko = {
|
|
10
|
-
'pdf.status.loading': '수업 자료 로딩 중...',
|
|
11
|
-
'pdf.status.error': '수업 자료를 가져오는 중 문제가 발생하였습니다.',
|
|
12
|
-
'pdf.fullScreen': '화면 맞춤',
|
|
13
|
-
'pdf.download': '수업 자료 다운로드'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.en = en;
|
|
17
|
-
exports.ko = ko;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const en = {
|
|
2
|
-
'pdf.status.loading': 'Loading File...',
|
|
3
|
-
'pdf.status.error': 'Error occurred while loading file.',
|
|
4
|
-
'pdf.fullScreen': 'Full Screen',
|
|
5
|
-
'pdf.download': 'File download'
|
|
6
|
-
};
|
|
7
|
-
const ko = {
|
|
8
|
-
'pdf.status.loading': '수업 자료 로딩 중...',
|
|
9
|
-
'pdf.status.error': '수업 자료를 가져오는 중 문제가 발생하였습니다.',
|
|
10
|
-
'pdf.fullScreen': '화면 맞춤',
|
|
11
|
-
'pdf.download': '수업 자료 다운로드'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { en, ko };
|