@elice/material-pdf 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,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 MaterialPdf: React.FC<MaterialPdfProps>;
9
- export default MaterialPdf;
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 reactIntl = require('react-intl');
6
+ var intl = require('@elice/intl');
7
7
  var classnames = require('classnames');
8
- var locales = require('./locales.js');
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,23 @@ const MaterialPdf = ({
13
15
  className,
14
16
  materialPdfId,
15
17
  cMapUrl,
16
- locale = 'en'
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, {
25
+ value: {
26
+ intl: __intl
27
+ }
28
+ }, React.createElement(MaterialPdf_styled.StyledMaterialPdfWrapper, {
23
29
  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
30
  }, React.createElement(MaterialPdfContent.default, {
29
31
  materialPdfId: materialPdfId,
30
32
  cMapUrl: cMapUrl
31
33
  })));
32
34
  };
35
+ var MaterialPdf$1 = new intl.IntlComponentBuilder(MaterialPdf).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
33
36
 
34
- exports.default = MaterialPdf;
37
+ 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,9 @@ const MaterialPdfContent = ({
17
17
  cMapUrl
18
18
  }) => {
19
19
  var _a;
20
- const intl = reactIntl.useIntl();
20
+ const {
21
+ intl: intl$1
22
+ } = intl.useRawEliceIntl();
21
23
  const {
22
24
  materialPdf,
23
25
  status: materialPdfStatus
@@ -36,16 +38,16 @@ const MaterialPdfContent = ({
36
38
  cMapUrl: cMapUrl,
37
39
  hasError: !(materialPdf === null || materialPdf === void 0 ? void 0 : materialPdf.attachment.url) || materialPdfStatus === 'rejected',
38
40
  i18n: {
39
- fullscreen: intl.formatMessage({
41
+ fullscreen: intl$1.formatMessage({
40
42
  id: 'pdf.fullScreen'
41
43
  }),
42
- download: intl.formatMessage({
44
+ download: intl$1.formatMessage({
43
45
  id: 'pdf.download'
44
46
  }),
45
- loading: intl.formatMessage({
47
+ loading: intl$1.formatMessage({
46
48
  id: 'pdf.status.loading'
47
49
  }),
48
- error: intl.formatMessage({
50
+ error: intl$1.formatMessage({
49
51
  id: 'pdf.status.error'
50
52
  })
51
53
  }
@@ -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,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 = {"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 MaterialPdf: React.FC<MaterialPdfProps>;
9
- export default MaterialPdf;
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 { IntlProvider } from 'react-intl';
2
+ import { IntlComponentBuilder, RawEliceIntlProvider } from '@elice/intl';
3
3
  import classnames from 'classnames';
4
- import * as locales from './locales.js';
5
- import { en } from './locales.js';
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,23 @@ const MaterialPdf = ({
10
11
  className,
11
12
  materialPdfId,
12
13
  cMapUrl,
13
- locale = 'en'
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, {
21
+ value: {
22
+ intl: __intl
23
+ }
24
+ }, React.createElement(StyledMaterialPdfWrapper, {
20
25
  className: classnames(prefixCls, className)
21
- }, React.createElement(IntlProvider, {
22
- locale: locale,
23
- defaultLocale: "en",
24
- messages: locale in locales ? locales[locale] : en
25
26
  }, React.createElement(MaterialPdfContent, {
26
27
  materialPdfId: materialPdfId,
27
28
  cMapUrl: cMapUrl
28
29
  })));
29
30
  };
31
+ var MaterialPdf$1 = new IntlComponentBuilder(MaterialPdf).add('en', messageEn).add('ko', messageKo).add('th', messageTh).build();
30
32
 
31
- export { MaterialPdf as default };
33
+ 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,9 @@ const MaterialPdfContent = ({
13
13
  cMapUrl
14
14
  }) => {
15
15
  var _a;
16
- const intl = useIntl();
16
+ const {
17
+ intl
18
+ } = useRawEliceIntl();
17
19
  const {
18
20
  materialPdf,
19
21
  status: materialPdfStatus
@@ -0,0 +1,3 @@
1
+ var messageEn = {"pdf.status.loading":"Loading File...","pdf.status.error":"Error occurred while loading file.","pdf.fullScreen":"Full Screen","pdf.download":"File download"};
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 = {"pdf.status.loading":"{_termLibraryLecture} {_termLibraryLecturePage} 로딩 중...","pdf.status.error":"{_termLibraryLecture} {_termLibraryLecturePage}를 가져오는 중 문제가 발생하였습니다.","pdf.fullScreen":"화면 맞춤","pdf.download":"{_termLibraryLecture} {_termLibraryLecturePage} 다운로드"};
2
+
3
+ export { messageKo as default };
@@ -0,0 +1,3 @@
1
+ var messageTh = {"pdf.status.loading":"การโหลดข้อมูลการเรียนการสอน...","pdf.status.error":"มีปัญหาขณะดึงข้อมูลการเรียนการสอนค่ะ.","pdf.fullScreen":"หน้าจอที่ปรับให้เข้ากับแบบชุด","pdf.download":"ดาวน์โหลด{_termLibraryLecturePage}"};
2
+
3
+ export { messageTh as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-pdf",
3
- "version": "1.240401.0",
3
+ "version": "1.240508.0-globalization.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",
@@ -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.7",
51
52
  "@elice/markdown": "^1.220815.0",
52
- "@elice/material-shared-types": "1.240401.0",
53
- "@elice/material-shared-utils": "1.240401.0",
53
+ "@elice/material-shared-types": "1.240508.0-globalization.0",
54
+ "@elice/material-shared-utils": "1.240508.0-globalization.0",
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": "c3c7c033d7524e3d16328399010562ca6c2c3286"
63
+ "gitHead": "e64474c7cab0b6cb852ba08a2076c88e732eec03"
64
64
  }
@@ -1,7 +0,0 @@
1
- export declare const en: {
2
- 'pdf.status.loading': string;
3
- 'pdf.status.error': string;
4
- 'pdf.fullScreen': string;
5
- 'pdf.download': string;
6
- };
7
- export declare const ko: typeof en;
@@ -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,7 +0,0 @@
1
- export declare const en: {
2
- 'pdf.status.loading': string;
3
- 'pdf.status.error': string;
4
- 'pdf.fullScreen': string;
5
- 'pdf.download': string;
6
- };
7
- export declare const ko: typeof en;
@@ -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 };