@elice/material-survey 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.
Files changed (49) hide show
  1. package/cjs/components/material-survey/MaterialSurvey.d.ts +3 -2
  2. package/cjs/components/material-survey/MaterialSurvey.js +12 -9
  3. package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +6 -4
  4. package/cjs/components/material-survey/MaterialSurveySelectOne.js +6 -4
  5. package/cjs/components/material-survey/MaterialSurveyText.js +7 -5
  6. package/cjs/components/material-survey/SurveyResultBadge.js +5 -3
  7. package/cjs/components/material-survey/SurveySubmitStatusText.js +6 -4
  8. package/cjs/components/material-survey/locales/en.json.js +7 -0
  9. package/cjs/components/material-survey/locales/index.d.ts +3 -0
  10. package/cjs/components/material-survey/locales/ko.json.js +7 -0
  11. package/cjs/components/material-survey/locales/th.json.js +7 -0
  12. package/cjs/components/material-survey-edit/MaterialSurveyEdit.d.ts +4 -4
  13. package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +16 -10
  14. package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +22 -20
  15. package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +10 -8
  16. package/cjs/components/material-survey-edit/locales/en.json.js +7 -0
  17. package/cjs/components/material-survey-edit/locales/index.d.ts +3 -0
  18. package/cjs/components/material-survey-edit/locales/ko.json.js +7 -0
  19. package/cjs/components/material-survey-edit/locales/th.json.js +7 -0
  20. package/cjs/components/shared/SurveyContentBox.js +5 -3
  21. package/es/components/material-survey/MaterialSurvey.d.ts +3 -2
  22. package/es/components/material-survey/MaterialSurvey.js +12 -10
  23. package/es/components/material-survey/MaterialSurveySelectMultiple.js +4 -2
  24. package/es/components/material-survey/MaterialSurveySelectOne.js +4 -2
  25. package/es/components/material-survey/MaterialSurveyText.js +4 -2
  26. package/es/components/material-survey/SurveyResultBadge.js +4 -2
  27. package/es/components/material-survey/SurveySubmitStatusText.js +4 -2
  28. package/es/components/material-survey/locales/en.json.js +3 -0
  29. package/es/components/material-survey/locales/index.d.ts +3 -0
  30. package/es/components/material-survey/locales/ko.json.js +3 -0
  31. package/es/components/material-survey/locales/th.json.js +3 -0
  32. package/es/components/material-survey-edit/MaterialSurveyEdit.d.ts +4 -4
  33. package/es/components/material-survey-edit/MaterialSurveyEdit.js +16 -11
  34. package/es/components/material-survey-edit/MaterialSurveyEditContent.js +10 -8
  35. package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +6 -4
  36. package/es/components/material-survey-edit/locales/en.json.js +3 -0
  37. package/es/components/material-survey-edit/locales/index.d.ts +3 -0
  38. package/es/components/material-survey-edit/locales/ko.json.js +3 -0
  39. package/es/components/material-survey-edit/locales/th.json.js +3 -0
  40. package/es/components/shared/SurveyContentBox.js +4 -2
  41. package/package.json +6 -6
  42. package/cjs/components/material-survey/MaterialSurvey.i18n.d.ts +0 -16
  43. package/cjs/components/material-survey/MaterialSurvey.i18n.js +0 -35
  44. package/cjs/components/material-survey-edit/locales.d.ts +0 -20
  45. package/cjs/components/material-survey-edit/locales.js +0 -43
  46. package/es/components/material-survey/MaterialSurvey.i18n.d.ts +0 -16
  47. package/es/components/material-survey/MaterialSurvey.i18n.js +0 -32
  48. package/es/components/material-survey-edit/locales.d.ts +0 -20
  49. package/es/components/material-survey-edit/locales.js +0 -40
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
- import { IntlProvider } from 'react-intl';
3
2
  import { useMeasure } from 'react-use';
4
3
  import { base } from '@elice/design-tokens';
4
+ import { IntlComponentBuilder, RawEliceIntlProvider } from '@elice/intl';
5
5
  import { enums } from '@elice/types';
6
6
  import styled from 'styled-components';
7
7
  import { MaterialSurveyProvider, useMaterialSurveyState, useMaterialSurveyDispatch } from './context/MaterialSurveyContext.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';
8
11
  import MaterialSurveyShimmer from './MaterialSurveyShimmer.js';
9
12
  import MaterialSurveyInfo from './MaterialSurveyInfo.js';
10
- import * as MaterialSurvey_i18n from './MaterialSurvey.i18n.js';
11
- import { en } from './MaterialSurvey.i18n.js';
12
13
 
13
14
  const AsyncMaterialSurveySelectMultiple = React.lazy(() => import('./MaterialSurveySelectMultiple.js'));
14
15
  const AsyncMaterialSurveyText = React.lazy(() => import('./MaterialSurveyText.js'));
@@ -75,14 +76,14 @@ const MaterialSurvey = () => {
75
76
  const MaterialSurveyContainer = ({
76
77
  materialSurveyId,
77
78
  userId,
78
- locale = 'en',
79
79
  onSubmit,
80
- onNext
80
+ onNext,
81
+ __intl
81
82
  }) => {
82
- return React.createElement(IntlProvider, {
83
- locale: locale,
84
- defaultLocale: "en",
85
- messages: locale in MaterialSurvey_i18n ? MaterialSurvey_i18n[locale] : en
83
+ return React.createElement(RawEliceIntlProvider, {
84
+ value: {
85
+ intl: __intl
86
+ }
86
87
  }, React.createElement(MaterialSurveyProvider, {
87
88
  materialSurveyId: materialSurveyId,
88
89
  userId: userId,
@@ -90,5 +91,6 @@ const MaterialSurveyContainer = ({
90
91
  onNext: onNext
91
92
  }, React.createElement(MaterialSurvey, null)));
92
93
  };
94
+ var MaterialSurvey$1 = new IntlComponentBuilder(MaterialSurveyContainer).add('en', messageEn).add('ko', messageKo).add('th', messageTh).build();
93
95
 
94
- export { MaterialSurveyContainer as default };
96
+ export { MaterialSurvey$1 as default };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl';
3
2
  import { getOrgMaterialSurveyResponseGet, getOrgMaterialSurveyResponseList, postOrgMaterialSurveyResponseAdd } from '@elice/api-client';
3
+ import { useRawEliceIntl } from '@elice/intl';
4
4
  import { checkUserLectureTestEnded } from '../../helpers/index.js';
5
5
  import '../shared/question-radio/QuestionRadio.js';
6
6
  import '../shared/question-radio/QuestionRadioOption.js';
@@ -27,7 +27,9 @@ const MaterialSurveySelectMultiple = () => {
27
27
  refreshOrgMaterialSurvey
28
28
  } = useMaterialSurveyDispatch();
29
29
  // state
30
- const intl = useIntl();
30
+ const {
31
+ intl
32
+ } = useRawEliceIntl();
31
33
  const [selectedAnswer, setSelectedAnswer] = React.useState([]);
32
34
  const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
33
35
  const [submitStatus, setSubmitStatus] = React.useState('idle');
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl';
3
2
  import { getOrgMaterialSurveyResponseGet, getOrgMaterialSurveyResponseList, postOrgMaterialSurveyResponseAdd } from '@elice/api-client';
3
+ import { useRawEliceIntl } from '@elice/intl';
4
4
  import { checkUserLectureTestEnded } from '../../helpers/index.js';
5
5
  import QuestionRadio from '../shared/question-radio/QuestionRadio.js';
6
6
  import QuestionRadioOption from '../shared/question-radio/QuestionRadioOption.js';
@@ -26,7 +26,9 @@ const MaterialSurveySelectOne = () => {
26
26
  refreshOrgMaterialSurvey
27
27
  } = useMaterialSurveyDispatch();
28
28
  // state
29
- const intl = useIntl();
29
+ const {
30
+ intl
31
+ } = useRawEliceIntl();
30
32
  const [selectedAnswer, setSelectedAnswer] = React.useState();
31
33
  const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
32
34
  const [submitStatus, setSubmitStatus] = React.useState('idle');
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl';
3
2
  import { getOrgMaterialSurveyResponseGet, getOrgMaterialSurveyResponseList, postOrgMaterialSurveyResponseAdd } from '@elice/api-client';
4
3
  import { base } from '@elice/design-tokens';
4
+ import { useRawEliceIntl } from '@elice/intl';
5
5
  import styled from 'styled-components';
6
6
  import { checkUserLectureTestEnded } from '../../helpers/index.js';
7
7
  import SurveyContentBox from '../shared/SurveyContentBox.js';
@@ -27,7 +27,9 @@ const MaterialSurveyText = () => {
27
27
  refreshOrgMaterialSurvey
28
28
  } = useMaterialSurveyDispatch();
29
29
  // state
30
- const intl = useIntl();
30
+ const {
31
+ intl
32
+ } = useRawEliceIntl();
31
33
  const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
32
34
  const [submitStatus, setSubmitStatus] = React.useState('idle');
33
35
  const [answer, setAnswer] = React.useState('');
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl';
3
2
  import { BadgeNext } from '@elice/blocks';
3
+ import { useRawEliceIntl } from '@elice/intl';
4
4
  import { getSurveyResultStatus, SurveyResultStatus } from '../../helpers/index.js';
5
5
 
6
6
  const SurveyResultBadge = ({
7
7
  materialSurveyResponse
8
8
  }) => {
9
- const intl = useIntl();
9
+ const {
10
+ intl
11
+ } = useRawEliceIntl();
10
12
  const status = React.useMemo(() => getSurveyResultStatus(materialSurveyResponse), [materialSurveyResponse]);
11
13
  switch (status) {
12
14
  case SurveyResultStatus.Submitted:
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
- import { useIntl } from 'react-intl';
3
2
  import { StatusText } from '@elice/blocks';
3
+ import { useRawEliceIntl } from '@elice/intl';
4
4
 
5
5
  const SurveySubmitStatusText = ({
6
6
  status
7
7
  }) => {
8
- const intl = useIntl();
8
+ const {
9
+ intl
10
+ } = useRawEliceIntl();
9
11
  switch (status) {
10
12
  case 'resolved':
11
13
  return React.createElement(StatusText, {
@@ -0,0 +1,3 @@
1
+ var messageEn = {"materialSurvey.error":"Failed to fetch survey","materialSurvey.submit":"Submit","materialSurvey.submittedAnswer":"Submitted Answer","materialSurvey.next":"Next question >","materialSurvey.myAnswer":"My answer","materialSurvey.empty.title":"Survey is now preparing.","materialSurvey.empty.description":"Please check again after survey posting!","materialSurvey.survey.empty.title":"Survey is now preparing.","materialSurvey.survey.empty.description":"Please check again after survey posting!","materialSurvey.submitStatus.success":"Submitted","materialSurvey.submitStatus.failure":"Failed to submit","materialSurvey.resultStatus.submitted":"Submitted","materialSurvey.text.placeholder":"please fill the answer"};
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 = {"materialSurvey.error":"설문조사를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialSurvey.submit":"제출","materialSurvey.submittedAnswer":"제출한 답","materialSurvey.next":"다음으로 이동 >","materialSurvey.myAnswer":"내 답변","materialSurvey.empty.title":"설문조사가 준비 중 입니다.","materialSurvey.empty.description":"설문조사 게시 후 다시 확인해주세요!","materialSurvey.survey.empty.title":"설문조사가 준비 중 입니다.","materialSurvey.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialSurvey.submitStatus.success":"제출되었습니다.","materialSurvey.submitStatus.failure":"제출에 실패하였습니다.","materialSurvey.resultStatus.submitted":"제출완료","materialSurvey.text.placeholder":"답변을 입력하세요."};
2
+
3
+ export { messageKo as default };
@@ -0,0 +1,3 @@
1
+ var messageTh = {"materialSurvey.error":"การโหลดแบบสำรวจล้มเหลว\nโปรดลองอีกครั้งในภายหลัง","materialSurvey.submit":"ส่ง","materialSurvey.submittedAnswer":"ส่งคำตอบ","materialSurvey.next":"ย้ายไปที่ต่อไป >","materialSurvey.myAnswer":"การตอบของฉัน","materialSurvey.empty.title":"การสำรวจกำลังจะเริ่มขึ้นค่ะ.","materialSurvey.empty.description":"โปสต์แบบสำรวจแล้ว กรุณาตรวจสอบอีกครั้งค่ะ!","materialSurvey.survey.empty.title":"การสำรวจกำลังจะเริ่มต้น โปรดรอสัก{_termCourseRoleEducator}่.","materialSurvey.survey.empty.description":"กรุณาตรวจสอบแบบสำรวจอีกครั้งหลังจากที่โพสต์แล้วค่ะ!","materialSurvey.submitStatus.success":"ส่งแล้วครับ.","materialSurvey.submitStatus.failure":"การส่งล้มเหลวแล้วค่ะ.","materialSurvey.resultStatus.submitted":"การส่งแบบทำเสร็จแล้ว","materialSurvey.text.placeholder":"โปรดใส่คำตอบของคุณ."};
2
+
3
+ export { messageTh as default };
@@ -12,8 +12,6 @@ export interface MaterialSurveyEditProps {
12
12
  * When true, cannot change `optionType`, `optionInfo` and `answerInfo`.
13
13
  */
14
14
  disabled?: boolean;
15
- /** Locale of edit form. */
16
- locale: string;
17
15
  /** Handle form change event. */
18
16
  onChange: (value: MaterialSurveyEditValue) => void;
19
17
  /** Handle form state changes. (`FormState` from react-hook-form) */
@@ -21,5 +19,7 @@ export interface MaterialSurveyEditProps {
21
19
  /** Handle file upload. */
22
20
  onFileUploadRequest: MarkdownEditorFileUploadReqFn;
23
21
  }
24
- declare const MaterialSurveyEdit: React.ForwardRefExoticComponent<MaterialSurveyEditProps & React.RefAttributes<HTMLFormElement>>;
25
- export default MaterialSurveyEdit;
22
+ declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialSurveyEditProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
23
+ __intl: import("@elice/intl").EliceIntlShape;
24
+ } & React.RefAttributes<HTMLFormElement>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<HTMLFormElement>>;
25
+ export default _default;
@@ -1,20 +1,24 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { useForm, FormProvider } from 'react-hook-form';
3
- import { IntlProvider } from 'react-intl';
3
+ import { RawEliceIntlProvider, IntlComponentBuilder } from '@elice/intl';
4
4
  import { useDeepClonedCompareEffect } from '@elice/material-shared-utils';
5
5
  import { manipulateValue, restoreValue } from './utils/editValue.js';
6
6
  import MaterialSurveyEditContext from './context.js';
7
- import * as locales from './locales.js';
8
- import { en } from './locales.js';
7
+ import messageEn from './locales/en.json.js';
8
+ import messageKo from './locales/ko.json.js';
9
+ import messageTh from './locales/th.json.js';
9
10
  import MaterialSurveyEditContent from './MaterialSurveyEditContent.js';
10
11
 
12
+ //
13
+ //
14
+ //
11
15
  const MaterialSurveyEdit = forwardRef(({
12
16
  value,
13
17
  disabled = false,
14
- locale = 'en',
15
18
  onChange,
16
19
  onFormStateChange,
17
- onFileUploadRequest
20
+ onFileUploadRequest,
21
+ __intl
18
22
  }, ref) => {
19
23
  const formElRef = React.useRef(null);
20
24
  const useFormMethods = useForm({
@@ -70,18 +74,19 @@ const MaterialSurveyEdit = forwardRef(({
70
74
  //
71
75
  //
72
76
  //
73
- return React.createElement("form", {
77
+ return React.createElement(RawEliceIntlProvider, {
78
+ value: {
79
+ intl: __intl
80
+ }
81
+ }, React.createElement("form", {
74
82
  ref: formElRef
75
83
  }, React.createElement(MaterialSurveyEditContext.Provider, {
76
84
  value: {
77
85
  disabled,
78
86
  onFileUploadRequest
79
87
  }
80
- }, React.createElement(IntlProvider, {
81
- locale: locale,
82
- defaultLocale: "en",
83
- messages: locale in locales ? locales[locale] : en
84
88
  }, React.createElement(FormProvider, Object.assign({}, useFormMethods), React.createElement(MaterialSurveyEditContent, null)))));
85
89
  });
90
+ var MaterialSurveyEdit$1 = new IntlComponentBuilder(MaterialSurveyEdit).add('en', messageEn).add('ko', messageKo).add('th', messageTh).build();
86
91
 
87
- export { MaterialSurveyEdit as default };
92
+ export { MaterialSurveyEdit$1 as default };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
- import { useIntl, FormattedMessage } from 'react-intl';
4
3
  import { FormInputVerticalLayout, Label, Input, Tooltip, Select, Vspace } from '@elice/blocks';
4
+ import { useRawEliceIntl } from '@elice/intl';
5
5
  import { MarkdownEditor } from '@elice/markdown';
6
6
  import { enums } from '@elice/types';
7
7
  import styled from 'styled-components';
@@ -15,7 +15,9 @@ const StyledSurveyOptionTypeSelectWrap = styled.div.withConfig({
15
15
  componentId: "sc-r4ms68-0"
16
16
  })(["display:flex;max-width:12rem;"]);
17
17
  const MaterialSurveyEditContent = () => {
18
- const intl = useIntl();
18
+ const {
19
+ intl
20
+ } = useRawEliceIntl();
19
21
  const {
20
22
  disabled,
21
23
  onFileUploadRequest
@@ -83,8 +85,8 @@ const MaterialSurveyEditContent = () => {
83
85
  label: React.createElement(Label, {
84
86
  size: "small",
85
87
  required: true
86
- }, React.createElement(FormattedMessage, {
87
- id: "content.title"
88
+ }, intl.formatMessage({
89
+ id: 'content.title'
88
90
  })),
89
91
  input: React.createElement(Controller, {
90
92
  control: control,
@@ -142,8 +144,8 @@ const MaterialSurveyEditContent = () => {
142
144
  return React.createElement(FormInputVerticalLayout, {
143
145
  label: React.createElement(Label, {
144
146
  size: "small"
145
- }, React.createElement(FormattedMessage, {
146
- id: "content.description.title"
147
+ }, intl.formatMessage({
148
+ id: 'content.description.title'
147
149
  })),
148
150
  input: React.createElement(Controller, {
149
151
  control: control,
@@ -168,8 +170,8 @@ const MaterialSurveyEditContent = () => {
168
170
  label: React.createElement(Label, {
169
171
  size: "small",
170
172
  required: true
171
- }, React.createElement(FormattedMessage, {
172
- id: "content.option.title"
173
+ }, intl.formatMessage({
174
+ id: 'content.option.title'
173
175
  })),
174
176
  input: React.createElement(React.Fragment, null, React.createElement(Controller, {
175
177
  control: control,
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
3
- import { useIntl, FormattedMessage } from 'react-intl';
4
3
  import { Input, Tooltip, IconButton, Vspace, Button, Icon } from '@elice/blocks';
5
4
  import { eilMathsignMultiplyBasic, eilMathsignAddCircle } from '@elice/icons';
5
+ import { useRawEliceIntl } from '@elice/intl';
6
6
  import styled from 'styled-components';
7
7
  import { createRandomId } from './utils/randomId.js';
8
8
  import { useMaterialSurveyEditContext } from './context.js';
@@ -16,7 +16,9 @@ const StyledInputGroup = styled.div.withConfig({
16
16
  componentId: "sc-1eiyk6z-1"
17
17
  })(["width:100%;.eb-input{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
18
18
  const OptionSelectOne = () => {
19
- const intl = useIntl();
19
+ const {
20
+ intl
21
+ } = useRawEliceIntl();
20
22
  const {
21
23
  disabled
22
24
  } = useMaterialSurveyEditContext();
@@ -111,8 +113,8 @@ const OptionSelectOne = () => {
111
113
  }),
112
114
  disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
113
115
  onClick: appendOptionInfo
114
- }, React.createElement(FormattedMessage, {
115
- id: "option.common.select.addButton"
116
+ }, intl.formatMessage({
117
+ id: 'option.common.select.addButton'
116
118
  })))));
117
119
  };
118
120
 
@@ -0,0 +1,3 @@
1
+ var messageEn = {"common.option":"Option {number}","common.errorMessage.range":"Please enter within {min} ~ {max} characters.","content.title":"Question","content.title.errorMessage.required":"Please fill the question.","content.title.placeholder":"Please enter question.","content.description.title":"Detailed Contents","content.description.placeholder":"Please enter a detailed question description or image, etc.","content.option.title":"Answer","content.option.tooltip.disabled":"Editing is not possible if the question is public or if there are {_termPathRoleStudent} who have submitted the question.\nYou can check the configured question in the Learner's {_termLibraryLecturePage} tab on the left.","content.option.select.items.selectOne":"Single Choice","content.option.select.items.selectMultiple":"Multiple Choice","content.option.select.items.text":"Short Answer","option.common.select.errorMessage.required":"Please enter options.","option.common.select.placeholder":"Enter options","option.common.select.tooltip.minOptionInfoItem":"You must enter at least 2 options.","option.common.select.tooltip.maxOptionInfoItem":"You cannot enter more than 20 options.","option.common.select.addButton":"Add Option"};
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 = {"common.option":"옵션 {number}","common.errorMessage.range":"{min} ~ {max}자 이내로 입력해주세요.","content.title":"질문","content.title.errorMessage.required":"질문을 입력해주세요.","content.title.placeholder":"질문을 입력해주세요.","content.description.title":"세부 내용","content.description.placeholder":"자세한 질문 설명이나 이미지 등을 입력해주세요.","content.option.title":"답변","content.option.tooltip.disabled":"설문 조사가 공개된 상태이거나 제출한 {_termPathRoleStudent}이 존재하면\n수정이 불가능합니다.","content.option.select.items.selectOne":"객관식 (단일 답변)","content.option.select.items.selectMultiple":"객관식 (복수 답변)","content.option.select.items.text":"주관식 답변","option.common.select.errorMessage.required":"선택지를 입력해주세요.","option.common.select.placeholder":"선택지 입력","option.common.select.tooltip.minOptionInfoItem":"선택지는 2개 이상 입력해야 합니다.","option.common.select.tooltip.maxOptionInfoItem":"선택지는 20개 초과하여 입력할 수 없습니다.","option.common.select.addButton":"보기 추가"};
2
+
3
+ export { messageKo as default };
@@ -0,0 +1,3 @@
1
+ var messageTh = {"common.option":"ตัวเลือก {number}","common.errorMessage.range":"โปรดป้อนข้อความระหว่าง {min} ถึง {max} ตัวอักษร","content.title":"คำถาม","content.title.errorMessage.required":"กรุณาใส่คำถาม","content.title.placeholder":"กรุณาใส่คำถาม","content.description.title":"รายละเอียด","content.description.placeholder":"โปรดใส่คำอธิบายหรือรูปภาพสำหรับคำถามของคุณ","content.option.title":"คำตอบ","content.option.tooltip.disabled":"หากการสำรวจถูกเปิดเผยแล้วหรือมี{_termCourseRoleStudent}ที่ส่งแล้ว\nจะไม่สามารถแก้ไขได้","content.option.select.items.selectOne":"ปรนัย (เลือกหนึ่ง)","content.option.select.items.selectMultiple":"ปรนัย (เลือกหลายอย่าง)","content.option.select.items.text":"คำตอบอัตนัย","option.common.select.errorMessage.required":"กรุณาใส่ตัวเลือก","option.common.select.placeholder":"ใส่ตัวเลือก","option.common.select.tooltip.minOptionInfoItem":"ต้องใส่ตัวเลือกอย่างน้อย 2 ตัว","option.common.select.tooltip.maxOptionInfoItem":"ไม่สามารถใส่ตัวเลือกได้เกิน 20 ตัว","option.common.select.addButton":"เพิ่มตัวเลือก"};
2
+
3
+ export { messageTh as default };
@@ -1,8 +1,8 @@
1
1
  import { __rest } from 'tslib';
2
2
  import React from 'react';
3
- import { useIntl } from 'react-intl';
4
3
  import { Text, Button } from '@elice/blocks';
5
4
  import { base } from '@elice/design-tokens';
5
+ import { useRawEliceIntl } from '@elice/intl';
6
6
  import styled from 'styled-components';
7
7
  import { useMaterialSurveyState } from '../material-survey/context/MaterialSurveyContext.js';
8
8
 
@@ -56,7 +56,9 @@ const SurveyContentBox = _a => {
56
56
  onNext
57
57
  } = _a,
58
58
  props = __rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext"]);
59
- const intl = useIntl();
59
+ const {
60
+ intl
61
+ } = useRawEliceIntl();
60
62
  const {
61
63
  vertical
62
64
  } = useMaterialSurveyState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-survey",
3
- "version": "1.240401.0",
3
+ "version": "1.240508.0-globalization.0",
4
4
  "description": "User view and editing components of Elice material survey",
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
  },
@@ -50,18 +50,18 @@
50
50
  "@elice/design-tokens": "^1.220803.0",
51
51
  "@elice/icons": "^1.230814.0",
52
52
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
53
+ "@elice/intl": "0.240425.0-alpha.7",
53
54
  "@elice/markdown": "^1.220815.0",
54
- "@elice/material-shared-types": "1.240401.0",
55
- "@elice/material-shared-utils": "1.240401.0",
55
+ "@elice/material-shared-types": "1.240508.0-globalization.0",
56
+ "@elice/material-shared-utils": "1.240508.0-globalization.0",
56
57
  "@elice/types": "^1.240208.0",
57
58
  "@types/classnames": "^2.3.1",
58
59
  "@types/react": "~17.0.9",
59
60
  "@types/react-transition-group": "^4.4.4",
60
61
  "@types/styled-components": "^5.1.21",
61
62
  "react": "^17.0.2",
62
- "react-intl": "^5.20.10",
63
63
  "react-use": "^17.2.4",
64
64
  "styled-components": "^5.3.0"
65
65
  },
66
- "gitHead": "c3c7c033d7524e3d16328399010562ca6c2c3286"
66
+ "gitHead": "e64474c7cab0b6cb852ba08a2076c88e732eec03"
67
67
  }
@@ -1,16 +0,0 @@
1
- export declare const en: {
2
- 'materialSurvey.error': string;
3
- 'materialSurvey.submit': string;
4
- 'materialSurvey.submittedAnswer': string;
5
- 'materialSurvey.next': string;
6
- 'materialSurvey.myAnswer': string;
7
- 'materialSurvey.empty.title': string;
8
- 'materialSurvey.empty.description': string;
9
- 'materialSurvey.survey.empty.title': string;
10
- 'materialSurvey.survey.empty.description': string;
11
- 'materialSurvey.submitStatus.success': string;
12
- 'materialSurvey.submitStatus.failure': string;
13
- 'materialSurvey.resultStatus.submitted': string;
14
- 'materialSurvey.text.placeholder': string;
15
- };
16
- export declare const ko: typeof en;
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- const en = {
4
- 'materialSurvey.error': 'Failed to fetch survey',
5
- 'materialSurvey.submit': 'Submit',
6
- 'materialSurvey.submittedAnswer': 'Submitted Answer',
7
- 'materialSurvey.next': 'Next question >',
8
- 'materialSurvey.myAnswer': 'My answer',
9
- 'materialSurvey.empty.title': 'Survey is now preparing.',
10
- 'materialSurvey.empty.description': 'Please check again after survey posting!',
11
- 'materialSurvey.survey.empty.title': 'Survey is now preparing.',
12
- 'materialSurvey.survey.empty.description': 'Please check again after survey posting!',
13
- 'materialSurvey.submitStatus.success': 'Submitted',
14
- 'materialSurvey.submitStatus.failure': 'Failed to submit',
15
- 'materialSurvey.resultStatus.submitted': 'Submitted',
16
- 'materialSurvey.text.placeholder': 'please fill the answer'
17
- };
18
- const ko = {
19
- 'materialSurvey.error': '설문조사를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.',
20
- 'materialSurvey.submit': '제출',
21
- 'materialSurvey.submittedAnswer': '제출한 답',
22
- 'materialSurvey.next': '다음으로 이동 >',
23
- 'materialSurvey.myAnswer': '내 답변',
24
- 'materialSurvey.empty.title': '설문조사가 준비 중 입니다.',
25
- 'materialSurvey.empty.description': '설문조사 게시 후 다시 확인해주세요!',
26
- 'materialSurvey.survey.empty.title': '설문조사가 준비 중 입니다.',
27
- 'materialSurvey.survey.empty.description': '설문지 게시 후 다시 확인해주세요!',
28
- 'materialSurvey.submitStatus.success': '제출되었습니다.',
29
- 'materialSurvey.submitStatus.failure': '제출에 실패하였습니다.',
30
- 'materialSurvey.resultStatus.submitted': '제출완료',
31
- 'materialSurvey.text.placeholder': '답변을 입력하세요.'
32
- };
33
-
34
- exports.en = en;
35
- exports.ko = ko;
@@ -1,20 +0,0 @@
1
- export declare const en: {
2
- 'common.option': string;
3
- 'common.errorMessage.range': string;
4
- 'content.title': string;
5
- 'content.title.errorMessage.required': string;
6
- 'content.title.placeholder': string;
7
- 'content.description.title': string;
8
- 'content.description.placeholder': string;
9
- 'content.option.title': string;
10
- 'content.option.tooltip.disabled': string;
11
- 'content.option.select.items.selectOne': string;
12
- 'content.option.select.items.selectMultiple': string;
13
- 'content.option.select.items.text': string;
14
- 'option.common.select.errorMessage.required': string;
15
- 'option.common.select.placeholder': string;
16
- 'option.common.select.tooltip.minOptionInfoItem': string;
17
- 'option.common.select.tooltip.maxOptionInfoItem': string;
18
- 'option.common.select.addButton': string;
19
- };
20
- export declare const ko: typeof en;
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- const en = {
4
- 'common.option': 'Option {number}',
5
- 'common.errorMessage.range': 'Please enter within {min} ~ {max} characters.',
6
- 'content.title': 'Question',
7
- 'content.title.errorMessage.required': 'Please fill the question.',
8
- 'content.title.placeholder': 'Please enter question.',
9
- 'content.description.title': 'Detailed Contents',
10
- 'content.description.placeholder': 'Please enter a detailed question description or image, etc.',
11
- 'content.option.title': 'Answer',
12
- 'content.option.tooltip.disabled': "Editing is not possible if the question is public or if there are students who have submitted the question.\nYou can check the configured question in the Learner's Materials tab on the left.",
13
- 'content.option.select.items.selectOne': 'Single Choice',
14
- 'content.option.select.items.selectMultiple': 'Multiple Choice',
15
- 'content.option.select.items.text': 'Short Answer',
16
- 'option.common.select.errorMessage.required': 'Please enter options.',
17
- 'option.common.select.placeholder': 'Enter options',
18
- 'option.common.select.tooltip.minOptionInfoItem': 'You must enter at least 2 options.',
19
- 'option.common.select.tooltip.maxOptionInfoItem': 'You cannot enter more than 20 options.',
20
- 'option.common.select.addButton': 'Add Option'
21
- };
22
- const ko = {
23
- 'common.option': '옵션 {number}',
24
- 'common.errorMessage.range': '{min} ~ {max}자 이내로 입력해주세요.',
25
- 'content.title': '질문',
26
- 'content.title.errorMessage.required': '질문을 입력해주세요.',
27
- 'content.title.placeholder': '질문을 입력해주세요.',
28
- 'content.description.title': '세부 내용',
29
- 'content.description.placeholder': '자세한 질문 설명이나 이미지 등을 입력해주세요.',
30
- 'content.option.title': '답변',
31
- 'content.option.tooltip.disabled': '설문 조사가 공개된 상태이거나 제출한 학생이 존재하면\n수정이 불가능합니다.',
32
- 'content.option.select.items.selectOne': '객관식 (단일 답변)',
33
- 'content.option.select.items.selectMultiple': '객관식 (복수 답변)',
34
- 'content.option.select.items.text': '주관식 답변',
35
- 'option.common.select.errorMessage.required': '선택지를 입력해주세요.',
36
- 'option.common.select.placeholder': '선택지 입력',
37
- 'option.common.select.tooltip.minOptionInfoItem': '선택지는 2개 이상 입력해야 합니다.',
38
- 'option.common.select.tooltip.maxOptionInfoItem': '선택지는 20개 초과하여 입력할 수 없습니다.',
39
- 'option.common.select.addButton': '보기 추가'
40
- };
41
-
42
- exports.en = en;
43
- exports.ko = ko;
@@ -1,16 +0,0 @@
1
- export declare const en: {
2
- 'materialSurvey.error': string;
3
- 'materialSurvey.submit': string;
4
- 'materialSurvey.submittedAnswer': string;
5
- 'materialSurvey.next': string;
6
- 'materialSurvey.myAnswer': string;
7
- 'materialSurvey.empty.title': string;
8
- 'materialSurvey.empty.description': string;
9
- 'materialSurvey.survey.empty.title': string;
10
- 'materialSurvey.survey.empty.description': string;
11
- 'materialSurvey.submitStatus.success': string;
12
- 'materialSurvey.submitStatus.failure': string;
13
- 'materialSurvey.resultStatus.submitted': string;
14
- 'materialSurvey.text.placeholder': string;
15
- };
16
- export declare const ko: typeof en;
@@ -1,32 +0,0 @@
1
- const en = {
2
- 'materialSurvey.error': 'Failed to fetch survey',
3
- 'materialSurvey.submit': 'Submit',
4
- 'materialSurvey.submittedAnswer': 'Submitted Answer',
5
- 'materialSurvey.next': 'Next question >',
6
- 'materialSurvey.myAnswer': 'My answer',
7
- 'materialSurvey.empty.title': 'Survey is now preparing.',
8
- 'materialSurvey.empty.description': 'Please check again after survey posting!',
9
- 'materialSurvey.survey.empty.title': 'Survey is now preparing.',
10
- 'materialSurvey.survey.empty.description': 'Please check again after survey posting!',
11
- 'materialSurvey.submitStatus.success': 'Submitted',
12
- 'materialSurvey.submitStatus.failure': 'Failed to submit',
13
- 'materialSurvey.resultStatus.submitted': 'Submitted',
14
- 'materialSurvey.text.placeholder': 'please fill the answer'
15
- };
16
- const ko = {
17
- 'materialSurvey.error': '설문조사를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.',
18
- 'materialSurvey.submit': '제출',
19
- 'materialSurvey.submittedAnswer': '제출한 답',
20
- 'materialSurvey.next': '다음으로 이동 >',
21
- 'materialSurvey.myAnswer': '내 답변',
22
- 'materialSurvey.empty.title': '설문조사가 준비 중 입니다.',
23
- 'materialSurvey.empty.description': '설문조사 게시 후 다시 확인해주세요!',
24
- 'materialSurvey.survey.empty.title': '설문조사가 준비 중 입니다.',
25
- 'materialSurvey.survey.empty.description': '설문지 게시 후 다시 확인해주세요!',
26
- 'materialSurvey.submitStatus.success': '제출되었습니다.',
27
- 'materialSurvey.submitStatus.failure': '제출에 실패하였습니다.',
28
- 'materialSurvey.resultStatus.submitted': '제출완료',
29
- 'materialSurvey.text.placeholder': '답변을 입력하세요.'
30
- };
31
-
32
- export { en, ko };
@@ -1,20 +0,0 @@
1
- export declare const en: {
2
- 'common.option': string;
3
- 'common.errorMessage.range': string;
4
- 'content.title': string;
5
- 'content.title.errorMessage.required': string;
6
- 'content.title.placeholder': string;
7
- 'content.description.title': string;
8
- 'content.description.placeholder': string;
9
- 'content.option.title': string;
10
- 'content.option.tooltip.disabled': string;
11
- 'content.option.select.items.selectOne': string;
12
- 'content.option.select.items.selectMultiple': string;
13
- 'content.option.select.items.text': string;
14
- 'option.common.select.errorMessage.required': string;
15
- 'option.common.select.placeholder': string;
16
- 'option.common.select.tooltip.minOptionInfoItem': string;
17
- 'option.common.select.tooltip.maxOptionInfoItem': string;
18
- 'option.common.select.addButton': string;
19
- };
20
- export declare const ko: typeof en;