@team-monolith/cds 1.119.2 → 1.119.4

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 (221) hide show
  1. package/dist/CdsProvider.d.ts +2 -2
  2. package/dist/CdsProvider.js +1 -11
  3. package/dist/i18n/i18n.d.ts +14 -3
  4. package/dist/i18n/i18n.js +32 -34
  5. package/dist/icons/custom/colored/AiHelper.d.ts +1 -1
  6. package/dist/icons/custom/colored/AiHelper.js +1 -1
  7. package/dist/icons/custom/colored/AiQuizColor.d.ts +1 -1
  8. package/dist/icons/custom/colored/AiQuizColor.js +1 -1
  9. package/dist/icons/custom/colored/BadgeColor.d.ts +1 -1
  10. package/dist/icons/custom/colored/BadgeColor.js +1 -1
  11. package/dist/icons/custom/colored/BadgeGold.d.ts +1 -1
  12. package/dist/icons/custom/colored/BadgeGold.js +1 -1
  13. package/dist/icons/custom/colored/BadgeGreen.d.ts +1 -1
  14. package/dist/icons/custom/colored/BadgeGreen.js +1 -1
  15. package/dist/icons/custom/colored/BadgeSilver.d.ts +1 -1
  16. package/dist/icons/custom/colored/BadgeSilver.js +1 -1
  17. package/dist/icons/custom/colored/Basic.d.ts +1 -1
  18. package/dist/icons/custom/colored/Basic.js +1 -1
  19. package/dist/icons/custom/colored/BasicPlus.d.ts +1 -1
  20. package/dist/icons/custom/colored/BasicPlus.js +1 -1
  21. package/dist/icons/custom/colored/BoardColor.d.ts +1 -1
  22. package/dist/icons/custom/colored/BoardColor.js +1 -1
  23. package/dist/icons/custom/colored/CastCloudyColor.d.ts +1 -1
  24. package/dist/icons/custom/colored/CastCloudyColor.js +1 -1
  25. package/dist/icons/custom/colored/CastPartlyColor.d.ts +1 -1
  26. package/dist/icons/custom/colored/CastPartlyColor.js +1 -1
  27. package/dist/icons/custom/colored/CastRainbowColor.d.ts +1 -1
  28. package/dist/icons/custom/colored/CastRainbowColor.js +1 -1
  29. package/dist/icons/custom/colored/CastSunnyColor.d.ts +1 -1
  30. package/dist/icons/custom/colored/CastSunnyColor.js +1 -1
  31. package/dist/icons/custom/colored/ClapBronze.d.ts +1 -1
  32. package/dist/icons/custom/colored/ClapBronze.js +1 -1
  33. package/dist/icons/custom/colored/ClapGold.d.ts +1 -1
  34. package/dist/icons/custom/colored/ClapGold.js +1 -1
  35. package/dist/icons/custom/colored/ClapSilver.d.ts +1 -1
  36. package/dist/icons/custom/colored/ClapSilver.js +1 -1
  37. package/dist/icons/custom/colored/Class.d.ts +1 -1
  38. package/dist/icons/custom/colored/Class.js +1 -1
  39. package/dist/icons/custom/colored/CodapColor.d.ts +1 -1
  40. package/dist/icons/custom/colored/CodapColor.js +1 -1
  41. package/dist/icons/custom/colored/EbookColor.d.ts +1 -1
  42. package/dist/icons/custom/colored/EbookColor.js +1 -1
  43. package/dist/icons/custom/colored/EmbeddedColor.d.ts +1 -1
  44. package/dist/icons/custom/colored/EmbeddedColor.js +1 -1
  45. package/dist/icons/custom/colored/EmoClapColor.d.ts +1 -1
  46. package/dist/icons/custom/colored/EmoClapColor.js +1 -1
  47. package/dist/icons/custom/colored/EmoGoodColor.d.ts +1 -1
  48. package/dist/icons/custom/colored/EmoGoodColor.js +1 -1
  49. package/dist/icons/custom/colored/EmoGreatColor.d.ts +1 -1
  50. package/dist/icons/custom/colored/EmoGreatColor.js +1 -1
  51. package/dist/icons/custom/colored/EmoHeartColor.d.ts +1 -1
  52. package/dist/icons/custom/colored/EmoHeartColor.js +1 -1
  53. package/dist/icons/custom/colored/EmoHundredColor.d.ts +1 -1
  54. package/dist/icons/custom/colored/EmoHundredColor.js +1 -1
  55. package/dist/icons/custom/colored/EmoNeutralColor.d.ts +1 -1
  56. package/dist/icons/custom/colored/EmoNeutralColor.js +1 -1
  57. package/dist/icons/custom/colored/EmoStarsColor.d.ts +1 -1
  58. package/dist/icons/custom/colored/EmoStarsColor.js +1 -1
  59. package/dist/icons/custom/colored/EmoThumbupColor.d.ts +1 -1
  60. package/dist/icons/custom/colored/EmoThumbupColor.js +1 -1
  61. package/dist/icons/custom/colored/Empty.d.ts +1 -1
  62. package/dist/icons/custom/colored/Empty.js +1 -1
  63. package/dist/icons/custom/colored/EntryColor.d.ts +1 -1
  64. package/dist/icons/custom/colored/EntryColor.js +1 -1
  65. package/dist/icons/custom/colored/FilenameAllColor.d.ts +1 -1
  66. package/dist/icons/custom/colored/FilenameAllColor.js +1 -1
  67. package/dist/icons/custom/colored/FilenameDocColor.d.ts +1 -1
  68. package/dist/icons/custom/colored/FilenameDocColor.js +1 -1
  69. package/dist/icons/custom/colored/FilenameHwpColor.d.ts +1 -1
  70. package/dist/icons/custom/colored/FilenameHwpColor.js +1 -1
  71. package/dist/icons/custom/colored/FilenameImgColor.d.ts +1 -1
  72. package/dist/icons/custom/colored/FilenameImgColor.js +1 -1
  73. package/dist/icons/custom/colored/FilenameMp4Color.d.ts +1 -1
  74. package/dist/icons/custom/colored/FilenameMp4Color.js +1 -1
  75. package/dist/icons/custom/colored/FilenamePdfColor.d.ts +1 -1
  76. package/dist/icons/custom/colored/FilenamePdfColor.js +1 -1
  77. package/dist/icons/custom/colored/FilenamePptColor.d.ts +1 -1
  78. package/dist/icons/custom/colored/FilenamePptColor.js +1 -1
  79. package/dist/icons/custom/colored/FilenameXlsColor.d.ts +1 -1
  80. package/dist/icons/custom/colored/FilenameXlsColor.js +1 -1
  81. package/dist/icons/custom/colored/FilenameZipColor.d.ts +1 -1
  82. package/dist/icons/custom/colored/FilenameZipColor.js +1 -1
  83. package/dist/icons/custom/colored/Google.d.ts +1 -1
  84. package/dist/icons/custom/colored/Google.js +1 -1
  85. package/dist/icons/custom/colored/HandFill.d.ts +1 -1
  86. package/dist/icons/custom/colored/HandFill.js +1 -1
  87. package/dist/icons/custom/colored/JudgeColor.d.ts +1 -1
  88. package/dist/icons/custom/colored/JudgeColor.js +1 -1
  89. package/dist/icons/custom/colored/MakecodeColor.d.ts +1 -1
  90. package/dist/icons/custom/colored/MakecodeColor.js +1 -1
  91. package/dist/icons/custom/colored/Master.d.ts +1 -1
  92. package/dist/icons/custom/colored/Master.js +1 -1
  93. package/dist/icons/custom/colored/Material.d.ts +1 -1
  94. package/dist/icons/custom/colored/Material.js +1 -1
  95. package/dist/icons/custom/colored/MedalBronze.d.ts +1 -1
  96. package/dist/icons/custom/colored/MedalBronze.js +1 -1
  97. package/dist/icons/custom/colored/MedalGold.d.ts +1 -1
  98. package/dist/icons/custom/colored/MedalGold.js +1 -1
  99. package/dist/icons/custom/colored/MedalSilver.d.ts +1 -1
  100. package/dist/icons/custom/colored/MedalSilver.js +1 -1
  101. package/dist/icons/custom/colored/Pro.d.ts +1 -1
  102. package/dist/icons/custom/colored/Pro.js +1 -1
  103. package/dist/icons/custom/colored/Problem.d.ts +1 -1
  104. package/dist/icons/custom/colored/Problem.js +1 -1
  105. package/dist/icons/custom/colored/PythonColor.d.ts +1 -1
  106. package/dist/icons/custom/colored/PythonColor.js +1 -1
  107. package/dist/icons/custom/colored/QuizColor.d.ts +1 -1
  108. package/dist/icons/custom/colored/QuizColor.js +1 -1
  109. package/dist/icons/custom/colored/ResourceColor.d.ts +1 -1
  110. package/dist/icons/custom/colored/ResourceColor.js +1 -1
  111. package/dist/icons/custom/colored/ScratchColor.d.ts +1 -1
  112. package/dist/icons/custom/colored/ScratchColor.js +1 -1
  113. package/dist/icons/custom/colored/TypeHelper.d.ts +1 -1
  114. package/dist/icons/custom/colored/TypeHelper.js +1 -1
  115. package/dist/icons/custom/colored/Whale.d.ts +1 -1
  116. package/dist/icons/custom/colored/Whale.js +1 -1
  117. package/dist/icons/custom/colored/WorksheetColor.d.ts +1 -1
  118. package/dist/icons/custom/colored/WorksheetColor.js +1 -1
  119. package/dist/icons/custom/default/AiQuiz.d.ts +1 -1
  120. package/dist/icons/custom/default/AiQuiz.js +1 -1
  121. package/dist/icons/custom/default/Badge.d.ts +1 -1
  122. package/dist/icons/custom/default/Badge.js +1 -1
  123. package/dist/icons/custom/default/Board.d.ts +1 -1
  124. package/dist/icons/custom/default/Board.js +1 -1
  125. package/dist/icons/custom/default/CastCloudy.d.ts +1 -1
  126. package/dist/icons/custom/default/CastCloudy.js +1 -1
  127. package/dist/icons/custom/default/CastPartly.d.ts +1 -1
  128. package/dist/icons/custom/default/CastPartly.js +1 -1
  129. package/dist/icons/custom/default/CastRainbow.d.ts +1 -1
  130. package/dist/icons/custom/default/CastRainbow.js +1 -1
  131. package/dist/icons/custom/default/CastSunny.d.ts +1 -1
  132. package/dist/icons/custom/default/CastSunny.js +1 -1
  133. package/dist/icons/custom/default/Codap.d.ts +1 -1
  134. package/dist/icons/custom/default/Codap.js +1 -1
  135. package/dist/icons/custom/default/Ebook.d.ts +1 -1
  136. package/dist/icons/custom/default/Ebook.js +1 -1
  137. package/dist/icons/custom/default/Embedded.d.ts +1 -1
  138. package/dist/icons/custom/default/Embedded.js +1 -1
  139. package/dist/icons/custom/default/EmoClap.d.ts +1 -1
  140. package/dist/icons/custom/default/EmoClap.js +1 -1
  141. package/dist/icons/custom/default/EmoGood.d.ts +1 -1
  142. package/dist/icons/custom/default/EmoGood.js +1 -1
  143. package/dist/icons/custom/default/EmoGreat.d.ts +1 -1
  144. package/dist/icons/custom/default/EmoGreat.js +1 -1
  145. package/dist/icons/custom/default/EmoHeart.d.ts +1 -1
  146. package/dist/icons/custom/default/EmoHeart.js +1 -1
  147. package/dist/icons/custom/default/EmoHundred.d.ts +1 -1
  148. package/dist/icons/custom/default/EmoHundred.js +1 -1
  149. package/dist/icons/custom/default/EmoNeutral.d.ts +1 -1
  150. package/dist/icons/custom/default/EmoNeutral.js +1 -1
  151. package/dist/icons/custom/default/EmoStars.d.ts +1 -1
  152. package/dist/icons/custom/default/EmoStars.js +1 -1
  153. package/dist/icons/custom/default/EmoThumbup.d.ts +1 -1
  154. package/dist/icons/custom/default/EmoThumbup.js +1 -1
  155. package/dist/icons/custom/default/Entry.d.ts +1 -1
  156. package/dist/icons/custom/default/Entry.js +1 -1
  157. package/dist/icons/custom/default/Fab.d.ts +1 -1
  158. package/dist/icons/custom/default/Fab.js +1 -1
  159. package/dist/icons/custom/default/Grant.d.ts +1 -1
  160. package/dist/icons/custom/default/Grant.js +1 -1
  161. package/dist/icons/custom/default/GrantAlt.d.ts +1 -1
  162. package/dist/icons/custom/default/GrantAlt.js +1 -1
  163. package/dist/icons/custom/default/HandLine.d.ts +1 -1
  164. package/dist/icons/custom/default/HandLine.js +1 -1
  165. package/dist/icons/custom/default/Judge.d.ts +1 -1
  166. package/dist/icons/custom/default/Judge.js +1 -1
  167. package/dist/icons/custom/default/Makecode.d.ts +1 -1
  168. package/dist/icons/custom/default/Makecode.js +1 -1
  169. package/dist/icons/custom/default/Pdf.d.ts +1 -1
  170. package/dist/icons/custom/default/Pdf.js +1 -1
  171. package/dist/icons/custom/default/Python.d.ts +1 -1
  172. package/dist/icons/custom/default/Python.js +1 -1
  173. package/dist/icons/custom/default/Quiz.d.ts +1 -1
  174. package/dist/icons/custom/default/Quiz.js +1 -1
  175. package/dist/icons/custom/default/Resource.d.ts +1 -1
  176. package/dist/icons/custom/default/Resource.js +1 -1
  177. package/dist/icons/custom/default/Scratch.d.ts +1 -1
  178. package/dist/icons/custom/default/Scratch.js +1 -1
  179. package/dist/icons/custom/default/ScrollAlt.d.ts +1 -1
  180. package/dist/icons/custom/default/ScrollAlt.js +1 -1
  181. package/dist/icons/custom/default/ScrollFill.d.ts +1 -1
  182. package/dist/icons/custom/default/ScrollFill.js +1 -1
  183. package/dist/icons/custom/default/ScrollLine.d.ts +1 -1
  184. package/dist/icons/custom/default/ScrollLine.js +1 -1
  185. package/dist/icons/custom/default/Symbol.d.ts +1 -1
  186. package/dist/icons/custom/default/Symbol.js +1 -1
  187. package/dist/icons/custom/default/Worksheet.d.ts +1 -1
  188. package/dist/icons/custom/default/Worksheet.js +1 -1
  189. package/dist/icons/custom/svgrColoredTemplate.js +1 -1
  190. package/dist/icons/custom/svgrDefaultTemplate.js +1 -1
  191. package/dist/index.d.ts +1 -0
  192. package/dist/index.js +1 -0
  193. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +7 -8
  194. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +3 -1
  195. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +2 -2
  196. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormPlaceholder.js +3 -1
  197. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +1 -1
  198. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -14
  199. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +1 -1
  200. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +3 -3
  201. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +2 -2
  202. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +5 -3
  203. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +1 -1
  204. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +1 -1
  205. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +1 -1
  206. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.d.ts +2 -1
  207. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.js +4 -5
  208. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +1 -1
  209. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +2 -2
  210. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +1 -1
  211. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +3 -3
  212. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +1 -0
  213. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +84 -83
  214. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.d.ts +2 -0
  215. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +49 -94
  216. package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +4 -2
  217. package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +17 -8
  218. package/dist/patterns/LexicalEditor/plugins/TogglePlugin/index.js +54 -2
  219. package/dist/texts.d.ts +2 -1
  220. package/dist/texts.js +11 -12
  221. package/package.json +1 -2
@@ -14,12 +14,14 @@ import moment from "moment";
14
14
  import { CdsContext } from "../../../../CdsProvider";
15
15
  import styled from "@emotion/styled";
16
16
  import { getTexts } from "../../../../texts";
17
+ import { useTranslation } from "react-i18next";
17
18
  /**
18
19
  * OS 파일 다이얼로그를 열어 파일을 선택하고 업로드하는 컴포넌트입니다.
19
20
  */
20
21
  export function UploadFileDialog({ open, onClose, onChange, }) {
21
22
  const inputRef = useRef(null);
22
23
  const cdsContext = useContext(CdsContext);
24
+ const { t } = useTranslation();
23
25
  const handleFileChange = (event) => __awaiter(this, void 0, void 0, function* () {
24
26
  var _a, _b, _c;
25
27
  const showFileError = (_a = cdsContext.lexical) === null || _a === void 0 ? void 0 : _a.showFileError;
@@ -30,7 +32,7 @@ export function UploadFileDialog({ open, onClose, onChange, }) {
30
32
  }
31
33
  const MAX_FILE_SIZE = 1 * 1024 * 1024 * 1024; // 1GB
32
34
  if (file.size >= MAX_FILE_SIZE) {
33
- showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", getTexts("errorFileTooLarge"));
35
+ showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", getTexts(t, "errorFileTooLarge"));
34
36
  event.target.value = "";
35
37
  onClose();
36
38
  return;
@@ -54,9 +54,9 @@ export function InputComponent(props) {
54
54
  // 학생 view
55
55
  if (!isEditable) {
56
56
  if (showCharacterNumber) {
57
- return (_jsx(SegmentedInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, answerFormat: answerFormat, placeholder: placeholder || getTexts("placeholderEnterHere"), value: answerInput, onChange: handleChange }));
57
+ return (_jsx(SegmentedInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, answerFormat: answerFormat, placeholder: placeholder || getTexts(t, "placeholderEnterHere"), value: answerInput, onChange: handleChange }));
58
58
  }
59
- return (_jsx(TextInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, size: "small", color: "default", placeholder: placeholder || getTexts("placeholderEnterHere"), value: answerInput, onChange: (e) => {
59
+ return (_jsx(TextInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, size: "small", color: "default", placeholder: placeholder || getTexts(t, "placeholderEnterHere"), value: answerInput, onChange: (e) => {
60
60
  handleChange(e.target.value);
61
61
  }, fullWidth: true }));
62
62
  }
@@ -2,7 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Controller } from "react-hook-form";
3
3
  import { Input } from "../../../../../components/Input";
4
4
  import { getTexts } from "../../../../../texts";
5
+ import { useTranslation } from "react-i18next";
5
6
  export function FormPlaceholder(props) {
6
7
  const { control } = props;
7
- return (_jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: getTexts("exampleEnterHere") })) }));
8
+ const { t } = useTranslation();
9
+ return (_jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: getTexts(t, "exampleEnterHere") })) }));
8
10
  }
@@ -83,7 +83,7 @@ export function SettingForm(props) {
83
83
  ` }) })] }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "showCharacterNumber", items: [
84
84
  { value: false, label: t("한 칸으로") },
85
85
  { value: true, label: numCharOptionStr },
86
- ] })] }), _jsxs(FormArea, { children: [_jsxs(Label, { children: [t("자리 표시자", { context: "렉시컬 주관식 설정창" }), _jsx(Tooltip, { text: getTexts("descriptionDefaultInputText"), placement: "top", children: _jsx(QuestionFillIcon, { css: css `
86
+ ] })] }), _jsxs(FormArea, { children: [_jsxs(Label, { children: [t("자리 표시자", { context: "렉시컬 주관식 설정창" }), _jsx(Tooltip, { text: getTexts(t, "descriptionDefaultInputText"), placement: "top", children: _jsx(QuestionFillIcon, { css: css `
87
87
  width: 12px;
88
88
  height: 12px;
89
89
  ` }) })] }), _jsx(FormPlaceholder, { control: control })] }), _jsxs(FormArea, { children: [_jsx(Label, { children: t("띄어쓰기") }), _jsx(FormSegmentedControl, { control: control, trigger: trigger, name: "ignoreWhitespace", items: [
@@ -6,7 +6,6 @@ import { SelectBoxComponent } from "./SelectBoxComponent";
6
6
  import { Tag } from "../../../../../components/Tag";
7
7
  import { useRef } from "react";
8
8
  import { useEventListener } from "usehooks-ts";
9
- import { i18n } from "../../../../../i18n/i18n";
10
9
  import { useTranslation } from "react-i18next";
11
10
  const TYPE_TO_INDEX_ICON = (type) => ({
12
11
  primary: (_jsx(CheckFillIcon, { css: css `
@@ -26,40 +25,42 @@ const TYPE_TO_INDEX_ICON = (type) => ({
26
25
  * isSelected, isAnswer, onClick에 따른 type, description 내용
27
26
  * /images/2025-05-05-01-25-06.png
28
27
  */
29
- function getTypeAndDescription(isSelected, isAnswer, onClick) {
28
+ function getTypeAndDescription(isSelected, isAnswer, onClick, t) {
30
29
  if (isAnswer === undefined) {
31
30
  return {
32
31
  type: isSelected ? "primary" : undefined,
33
- description: isSelected
34
- ? i18n.t("선택됨")
35
- : onClick
36
- ? i18n.t("선택하기")
37
- : "",
32
+ description: isSelected ? t("선택됨") : onClick ? t("선택하기") : "",
38
33
  };
39
34
  }
40
35
  if (isAnswer) {
41
36
  return {
42
37
  type: isSelected ? "success" : undefined,
43
38
  description: isSelected
44
- ? i18n.t("선택됨, 정답", { context: "렉시컬 선택지 하나의 상태" })
39
+ ? t("선택됨, 정답", {
40
+ context: "렉시컬 선택지 하나의 상태",
41
+ })
45
42
  : onClick
46
- ? i18n.t("선택하기, 정답", { context: "렉시컬 선택지 하나의 상태" })
47
- : i18n.t("정답", { context: "렉시컬 선택지 하나의 상태" }),
43
+ ? t("선택하기, 정답", {
44
+ context: "렉시컬 선택지 하나의 상태",
45
+ })
46
+ : t("정답", { context: "렉시컬 선택지 하나의 상태" }),
48
47
  };
49
48
  }
50
49
  return {
51
50
  type: isSelected ? "danger" : undefined,
52
51
  description: isSelected
53
- ? i18n.t("선택됨, 오답", { context: "렉시컬 선택지 하나의 상태" })
52
+ ? t("선택됨, 오답", { context: "렉시컬 선택지 하나의 상태" })
54
53
  : onClick
55
- ? i18n.t("선택하기, 오답", { context: "렉시컬 선택지 하나의 상태" })
56
- : i18n.t("오답", { context: "렉시컬 선택지 하나의 상태" }),
54
+ ? t("선택하기, 오답", {
55
+ context: "렉시컬 선택지 하나의 상태",
56
+ })
57
+ : t("오답", { context: "렉시컬 선택지 하나의 상태" }),
57
58
  };
58
59
  }
59
60
  export function SelectBoxView(props) {
60
61
  const { multipleSelectionsEnabled, index, isSelected, isAnswer, image, text, onClick, } = props;
61
62
  const { t } = useTranslation();
62
- const { type, description } = getTypeAndDescription(isSelected, isAnswer, onClick);
63
+ const { type, description } = getTypeAndDescription(isSelected, isAnswer, onClick, t);
63
64
  const boxRef = useRef(null);
64
65
  const handleKeyDown = (e) => {
65
66
  // onClick이 없으면 아무것도 하지 않음.
@@ -36,7 +36,7 @@ export function SelectComponent(props) {
36
36
  `, children: [multipleSelectionsEnabled && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
37
37
  width: 14px;
38
38
  height: 14px;
39
- ` }), getTexts("multipleChoicesProblem")] })), selections.map((selection, index) => (_jsx(SelectBoxView, { multipleSelectionsEnabled: multipleSelectionsEnabled, index: index + 1, isAnswer: showQuizSolution && "isAnswer" in selection
39
+ ` }), getTexts(t, "multipleChoicesProblem")] })), selections.map((selection, index) => (_jsx(SelectBoxView, { multipleSelectionsEnabled: multipleSelectionsEnabled, index: index + 1, isAnswer: showQuizSolution && "isAnswer" in selection
40
40
  ? selection.isAnswer
41
41
  : undefined, isSelected: selected.includes(selection.value), image: selection.show.image, text: selection.show.text, onClick: freezeProblemNode
42
42
  ? undefined
@@ -44,7 +44,7 @@ export function SettingForm(props) {
44
44
  function validateRequired(value) {
45
45
  if (value.show.image || value.show.text)
46
46
  return true;
47
- return getTexts("errorRequiredField");
47
+ return getTexts(t, "errorRequiredField");
48
48
  }
49
49
  function validateDuplicated(value, formValues) {
50
50
  const shows = formValues.selections.map((selection) => selection.show);
@@ -57,7 +57,7 @@ export function SettingForm(props) {
57
57
  });
58
58
  if (duplicatedIndexes.length < 2)
59
59
  return true;
60
- return getTexts("errorDuplicateChoice")(duplicatedIndexes.map((i) => i + 1).join(","));
60
+ return getTexts(t, "errorDuplicateChoice")(duplicatedIndexes.map((i) => i + 1).join(","));
61
61
  }
62
62
  const answersCount = watch("selections").filter((selection) => selection.isAnswer).length;
63
63
  const hasMultipleAnswers = answersCount > 1;
@@ -76,7 +76,7 @@ export function SettingForm(props) {
76
76
  }
77
77
  : undefined }, field.uid)))] }), _jsx(Button, { color: "grey", size: "small", startIcon: _jsx(AddFillIcon, {}), label: fields.length < 9
78
78
  ? t("선택지 추가", { context: "버튼, 렉시컬 도구 설정창" })
79
- : getTexts("errorMaxChoicesExceeded"), onClick: () => {
79
+ : getTexts(t, "errorMaxChoicesExceeded"), onClick: () => {
80
80
  if (fields.length >= 9)
81
81
  return;
82
82
  append({
@@ -13,7 +13,7 @@ export function FormIconAndLabel(props) {
13
13
  const theme = useTheme();
14
14
  const { t } = useTranslation();
15
15
  return (_jsx(Controller, { control: control, name: "iconType", render: ({ field: { value, onChange } }) => {
16
- const { startIcon, title, icons } = getIconData(value, theme);
16
+ const { startIcon, title, icons } = getIconData(value, theme, t);
17
17
  return (_jsxs(_Fragment, { children: [_jsx(Dropdown, { label: t("아이콘: {{title}}", { title }), size: "small", color: "grey", closeOnItemClick: true, bold: true, startIcon: startIcon, endIcon: _jsx(ArrowDownSFillIcon, {}), menuProps: {
18
18
  menuCss: css `
19
19
  width: 216px;
@@ -27,7 +27,7 @@ export function FormIconAndLabel(props) {
27
27
  horizontal: "center",
28
28
  },
29
29
  }, children: ICON_TYPES.map((type, index) => {
30
- const { title, startIcon } = getIconData(type, theme);
30
+ const { title, startIcon } = getIconData(type, theme, t);
31
31
  return (_jsx(DropdownItem, { index: index, label: title, preserveIconColor: true, startIcon: startIcon, onClick: () => {
32
32
  onChange(type);
33
33
  } }, index));
@@ -4,14 +4,16 @@ import styled from "@emotion/styled";
4
4
  import { css } from "@emotion/react";
5
5
  import { FormInput } from "../../../../../Form";
6
6
  import { getTexts } from "../../../../../../../../texts";
7
- const getLabelRules = () => ({
8
- required: getTexts("errorRequiredField"),
7
+ import { useTranslation } from "react-i18next";
8
+ const getLabelRules = (t) => ({
9
+ required: getTexts(t, "errorRequiredField"),
9
10
  maxLength: 12,
10
11
  });
11
12
  /** 레이블을 설정하는 Form입니다. */
12
13
  export function FormLabel(props) {
13
14
  const { control, index } = props;
14
- const labelRules = getLabelRules();
15
+ const { t } = useTranslation();
16
+ const labelRules = getLabelRules(t);
15
17
  // endIcon에 들어갈 value, error를 사용하기 위해 useController를 사용합니다.
16
18
  const { field: { value }, fieldState: { error }, } = useController({
17
19
  control,
@@ -10,7 +10,7 @@ export function FormQuestion(props) {
10
10
  const { control, index, onDelete } = props;
11
11
  const { t } = useTranslation();
12
12
  return (_jsxs(Item, { children: [_jsx(Index, { children: index + 1 }), _jsx(FormInput, { control: control, name: `evaluations.${index}.question.text`, rules: {
13
- required: getTexts("errorRequiredField"),
13
+ required: getTexts(t, "errorRequiredField"),
14
14
  }, size: "small", placeholder: t("{{index}}번 평가 항목", { index: index + 1 }), multiline: true, fullWidth: true }), onDelete && (_jsx(SquareButton, { color: "white", size: "xsmall", icon: _jsx(DeleteBinLineIcon, {}), onClick: onDelete, "aria-label": t("삭제", {
15
15
  context: "스퀘어버튼, 렉시컬 3단계 평가 입력칸 도구 설정창",
16
16
  }) }))] }));
@@ -50,7 +50,7 @@ export function SettingForm(props) {
50
50
  }
51
51
  : undefined }, field.uid))), _jsx(Button, { color: "grey", size: "small", startIcon: _jsx(AddFillIcon, {}), label: t("평가 항목 추가"), onClick: () => {
52
52
  append({
53
- question: { text: getTexts("placeholderEvaluationItem") },
53
+ question: { text: getTexts(t, "placeholderEvaluationItem") },
54
54
  selectedLabelIndex: null,
55
55
  });
56
56
  } })] }), _jsxs(Right, { children: [_jsx(Label, { children: t("아이콘, 레이블") }), _jsx(FormIconAndLabel, { control: control, labelsLength: labels.length })] })] }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: t("닫기", { context: "렉시컬 도구 설정창" }), onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: t("이대로 넣기", { context: "렉시컬 도구 설정창" }), bold: true, type: "submit" })] })] }));
@@ -23,7 +23,7 @@ export function EvaluationComponent(props) {
23
23
  const { freezeProblemNode } = useContext(LexicalCustomConfigContext);
24
24
  const { t } = useTranslation();
25
25
  const [settingOpen, setSettingOpen] = useState(false);
26
- const { icons } = getIconData(iconType, theme);
26
+ const { icons } = getIconData(iconType, theme, t);
27
27
  // label과 icons를 매핑하여 ToggelButtonData로 변환합니다.
28
28
  // 만약 둘의 길이가 같지 않다면 짧은 길이에 맞춰집니다.
29
29
  const data = _.zipWith(labels, icons, (label, { onIcon, offIcon }) => ({
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { IconType } from "./SelfEvaluationNode";
3
3
  import { Theme } from "@emotion/react";
4
+ import { TFunction } from "i18next";
4
5
  interface IconData {
5
6
  startIcon: React.ReactNode;
6
7
  title: string;
@@ -10,5 +11,5 @@ interface IconData {
10
11
  }[];
11
12
  }
12
13
  export declare const ICON_TYPES: IconType[];
13
- export declare const getIconData: (iconType: IconType, theme: Theme) => IconData;
14
+ export declare const getIconData: (iconType: IconType, theme: Theme, t: TFunction) => IconData;
14
15
  export {};
@@ -2,16 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CustomEmoGoodIcon, CustomEmoGreatIcon, CustomEmoNeutralIcon, } from "../../../../icons/custom/default";
3
3
  import { CustomEmoGoodColorIcon, CustomEmoGreatColorIcon, CustomEmoNeutralColorIcon, } from "../../../../icons/custom/colored";
4
4
  import { Number1Icon, Number2Icon, Number3Icon } from "../../../../icons";
5
- import { i18n } from "../../../../i18n/i18n";
6
5
  export const ICON_TYPES = [
7
6
  "emoji",
8
7
  "ascendingNumber",
9
8
  "descendingNumber",
10
9
  ];
11
- export const getIconData = (iconType, theme) => ({
10
+ export const getIconData = (iconType, theme, t) => ({
12
11
  emoji: {
13
12
  startIcon: _jsx(CustomEmoGreatColorIcon, {}),
14
- title: i18n.t("이모지"),
13
+ title: t("이모지"),
15
14
  icons: [
16
15
  {
17
16
  onIcon: _jsx(CustomEmoGreatColorIcon, {}),
@@ -26,7 +25,7 @@ export const getIconData = (iconType, theme) => ({
26
25
  },
27
26
  ascendingNumber: {
28
27
  startIcon: _jsx(Number1Icon, {}),
29
- title: i18n.t("숫자, 1-2-3"),
28
+ title: t("숫자, 1-2-3"),
30
29
  icons: [
31
30
  {
32
31
  onIcon: _jsx(Number1Icon, { color: theme.color.background.primary }),
@@ -44,7 +43,7 @@ export const getIconData = (iconType, theme) => ({
44
43
  },
45
44
  descendingNumber: {
46
45
  startIcon: _jsx(Number3Icon, {}),
47
- title: i18n.t("숫자, 3-2-1"),
46
+ title: t("숫자, 3-2-1"),
48
47
  icons: [
49
48
  {
50
49
  onIcon: _jsx(Number3Icon, { color: theme.color.background.primary }),
@@ -49,7 +49,7 @@ export function InputComponent(props) {
49
49
  : {
50
50
  onFocus: () => setFocus(true),
51
51
  onBlur: () => setFocus(false),
52
- }, size: "small", color: focus ? "activePrimary" : "default", placeholder: placeholder || getTexts("placeholderEnterHere"), value: valueInput, onChange: (e) => {
52
+ }, size: "small", color: focus ? "activePrimary" : "default", placeholder: placeholder || getTexts(t, "placeholderEnterHere"), value: valueInput, onChange: (e) => {
53
53
  handleChange(e.target.value);
54
54
  }, fullWidth: true }));
55
55
  }
@@ -36,10 +36,10 @@ export function SettingForm(props) {
36
36
  height: 12px;
37
37
  ` }), multiline
38
38
  ? t("서술형 입력 칸", { context: "렉시컬 단답형/서술형 도구" })
39
- : t("단답형 입력 칸", { context: "렉시컬 단답형/서술형 도구" })] }), _jsx(Content, { children: _jsxs(FormArea, { children: [_jsxs(Label, { children: [t("자리 표시자", { context: "렉시컬 단답형/서술형 도구" }), _jsx(Tooltip, { text: getTexts("descriptionDefaultInputText"), placement: "top", children: _jsx(QuestionFillIcon, { css: css `
39
+ : t("단답형 입력 칸", { context: "렉시컬 단답형/서술형 도구" })] }), _jsx(Content, { children: _jsxs(FormArea, { children: [_jsxs(Label, { children: [t("자리 표시자", { context: "렉시컬 단답형/서술형 도구" }), _jsx(Tooltip, { text: getTexts(t, "descriptionDefaultInputText"), placement: "top", children: _jsx(QuestionFillIcon, { css: css `
40
40
  width: 12px;
41
41
  height: 12px;
42
- ` }) })] }), _jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: getTexts("exampleEnterHere") })) })] }) }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: t("닫기", { context: "렉시컬 도구 설정창" }), onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: t("이대로 넣기", { context: "렉시컬 도구 설정창" }), bold: true, type: "submit" })] })] }));
42
+ ` }) })] }), _jsx(Controller, { name: "placeholder", control: control, render: ({ field: { value, onChange } }) => (_jsx(Input, { size: "small", color: "default", value: value, onChange: onChange, placeholder: getTexts(t, "exampleEnterHere") })) })] }) }), _jsxs(Buttons, { children: [_jsx(Button, { color: "grey", size: "xsmall", label: t("닫기", { context: "렉시컬 도구 설정창" }), onClick: onClose }), _jsx(Button, { color: "primary", size: "xsmall", label: t("이대로 넣기", { context: "렉시컬 도구 설정창" }), bold: true, type: "submit" })] })] }));
43
43
  }
44
44
  const Form = styled.form(({ theme }) => css `
45
45
  display: flex;
@@ -26,7 +26,7 @@ export function SelectComponent(props) {
26
26
  return (_jsxs(_Fragment, { children: [allowMultipleAnswers && (_jsxs(Alert, { children: [_jsx(AlarmWarningFillIcon, { css: css `
27
27
  width: 14px;
28
28
  height: 14px;
29
- ` }), getTexts("multipleChoicesProblem")] })), selections.map((selection, index) => (_jsx(SelectBoxView, { index: index + 1, isSelected: selected.includes(selection.value), image: selection.show.image, text: selection.show.text, onClick: freezeProblemNode
29
+ ` }), getTexts(t, "multipleChoicesProblem")] })), selections.map((selection, index) => (_jsx(SelectBoxView, { index: index + 1, isSelected: selected.includes(selection.value), image: selection.show.image, text: selection.show.text, onClick: freezeProblemNode
30
30
  ? undefined
31
31
  : () => {
32
32
  const isSelected = selected.includes(selection.value);
@@ -44,7 +44,7 @@ export function SettingForm(props) {
44
44
  function validateRequired(value) {
45
45
  if (value.image || value.text)
46
46
  return true;
47
- return getTexts("errorRequiredField");
47
+ return getTexts(t, "errorRequiredField");
48
48
  }
49
49
  function validateDuplicated(value, formValues) {
50
50
  const shows = formValues.selections.map((selection) => selection.show);
@@ -56,7 +56,7 @@ export function SettingForm(props) {
56
56
  });
57
57
  if (duplicatedIndexes.length < 2)
58
58
  return true;
59
- return getTexts("errorDuplicateChoice")(duplicatedIndexes.map((i) => i + 1).join(","));
59
+ return getTexts(t, "errorDuplicateChoice")(duplicatedIndexes.map((i) => i + 1).join(","));
60
60
  }
61
61
  return (_jsxs(Form, { onSubmit: handleSubmit(onSettingSubmit), children: [_jsxs(Title, { children: [_jsx(ListRadioIcon, { css: css `
62
62
  width: 12px;
@@ -72,7 +72,7 @@ export function SettingForm(props) {
72
72
  }
73
73
  : undefined }, field.uid)))] }), _jsx(Button, { color: "grey", size: "small", startIcon: _jsx(AddFillIcon, {}), label: fields.length < 9
74
74
  ? t("선택지 추가", { context: "버튼, 렉시컬 도구 설정창" })
75
- : getTexts("errorMaxChoicesExceeded"), onClick: () => {
75
+ : getTexts(t, "errorMaxChoicesExceeded"), onClick: () => {
76
76
  if (fields.length >= 9)
77
77
  return;
78
78
  append({
@@ -219,6 +219,7 @@ export function ComponentAdderPlugin(props) {
219
219
  const baseOptions = getBaseOptions({
220
220
  editor,
221
221
  theme,
222
+ t,
222
223
  setImageOpen,
223
224
  setVideoOpen,
224
225
  isSheetEnabled,