@team-monolith/cds 1.118.0 → 1.119.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/dist/CdsProvider.d.ts +2 -2
- package/dist/CdsProvider.js +11 -1
- package/dist/i18n/i18n.d.ts +3 -13
- package/dist/i18n/i18n.js +33 -31
- package/dist/icons/custom/colored/AiHelper.d.ts +1 -1
- package/dist/icons/custom/colored/AiHelper.js +1 -1
- package/dist/icons/custom/colored/AiQuizColor.d.ts +1 -1
- package/dist/icons/custom/colored/AiQuizColor.js +1 -1
- package/dist/icons/custom/colored/BadgeColor.d.ts +1 -1
- package/dist/icons/custom/colored/BadgeColor.js +1 -1
- package/dist/icons/custom/colored/BadgeGold.d.ts +1 -1
- package/dist/icons/custom/colored/BadgeGold.js +1 -1
- package/dist/icons/custom/colored/BadgeGreen.d.ts +1 -1
- package/dist/icons/custom/colored/BadgeGreen.js +1 -1
- package/dist/icons/custom/colored/BadgeSilver.d.ts +1 -1
- package/dist/icons/custom/colored/BadgeSilver.js +1 -1
- package/dist/icons/custom/colored/Basic.d.ts +1 -1
- package/dist/icons/custom/colored/Basic.js +1 -1
- package/dist/icons/custom/colored/BasicPlus.d.ts +1 -1
- package/dist/icons/custom/colored/BasicPlus.js +1 -1
- package/dist/icons/custom/colored/BoardColor.d.ts +1 -1
- package/dist/icons/custom/colored/BoardColor.js +1 -1
- package/dist/icons/custom/colored/CastCloudyColor.d.ts +1 -1
- package/dist/icons/custom/colored/CastCloudyColor.js +1 -1
- package/dist/icons/custom/colored/CastPartlyColor.d.ts +1 -1
- package/dist/icons/custom/colored/CastPartlyColor.js +1 -1
- package/dist/icons/custom/colored/CastRainbowColor.d.ts +1 -1
- package/dist/icons/custom/colored/CastRainbowColor.js +1 -1
- package/dist/icons/custom/colored/CastSunnyColor.d.ts +1 -1
- package/dist/icons/custom/colored/CastSunnyColor.js +1 -1
- package/dist/icons/custom/colored/ClapBronze.d.ts +1 -1
- package/dist/icons/custom/colored/ClapBronze.js +1 -1
- package/dist/icons/custom/colored/ClapGold.d.ts +1 -1
- package/dist/icons/custom/colored/ClapGold.js +1 -1
- package/dist/icons/custom/colored/ClapSilver.d.ts +1 -1
- package/dist/icons/custom/colored/ClapSilver.js +1 -1
- package/dist/icons/custom/colored/Class.d.ts +1 -1
- package/dist/icons/custom/colored/Class.js +1 -1
- package/dist/icons/custom/colored/CodapColor.d.ts +1 -1
- package/dist/icons/custom/colored/CodapColor.js +1 -1
- package/dist/icons/custom/colored/EbookColor.d.ts +1 -1
- package/dist/icons/custom/colored/EbookColor.js +1 -1
- package/dist/icons/custom/colored/EmbeddedColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmbeddedColor.js +1 -1
- package/dist/icons/custom/colored/EmoClapColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoClapColor.js +1 -1
- package/dist/icons/custom/colored/EmoGoodColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoGoodColor.js +1 -1
- package/dist/icons/custom/colored/EmoGreatColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoGreatColor.js +1 -1
- package/dist/icons/custom/colored/EmoHeartColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoHeartColor.js +1 -1
- package/dist/icons/custom/colored/EmoHundredColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoHundredColor.js +1 -1
- package/dist/icons/custom/colored/EmoNeutralColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoNeutralColor.js +1 -1
- package/dist/icons/custom/colored/EmoStarsColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoStarsColor.js +1 -1
- package/dist/icons/custom/colored/EmoThumbupColor.d.ts +1 -1
- package/dist/icons/custom/colored/EmoThumbupColor.js +1 -1
- package/dist/icons/custom/colored/Empty.d.ts +1 -1
- package/dist/icons/custom/colored/Empty.js +1 -1
- package/dist/icons/custom/colored/EntryColor.d.ts +1 -1
- package/dist/icons/custom/colored/EntryColor.js +1 -1
- package/dist/icons/custom/colored/FilenameAllColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameAllColor.js +1 -1
- package/dist/icons/custom/colored/FilenameDocColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameDocColor.js +1 -1
- package/dist/icons/custom/colored/FilenameHwpColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameHwpColor.js +1 -1
- package/dist/icons/custom/colored/FilenameImgColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameImgColor.js +1 -1
- package/dist/icons/custom/colored/FilenameMp4Color.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameMp4Color.js +1 -1
- package/dist/icons/custom/colored/FilenamePdfColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenamePdfColor.js +1 -1
- package/dist/icons/custom/colored/FilenamePptColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenamePptColor.js +1 -1
- package/dist/icons/custom/colored/FilenameXlsColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameXlsColor.js +1 -1
- package/dist/icons/custom/colored/FilenameZipColor.d.ts +1 -1
- package/dist/icons/custom/colored/FilenameZipColor.js +1 -1
- package/dist/icons/custom/colored/Google.d.ts +1 -1
- package/dist/icons/custom/colored/Google.js +1 -1
- package/dist/icons/custom/colored/HandFill.d.ts +1 -1
- package/dist/icons/custom/colored/HandFill.js +1 -1
- package/dist/icons/custom/colored/JudgeColor.d.ts +1 -1
- package/dist/icons/custom/colored/JudgeColor.js +1 -1
- package/dist/icons/custom/colored/MakecodeColor.d.ts +1 -1
- package/dist/icons/custom/colored/MakecodeColor.js +1 -1
- package/dist/icons/custom/colored/Master.d.ts +1 -1
- package/dist/icons/custom/colored/Master.js +1 -1
- package/dist/icons/custom/colored/Material.d.ts +1 -1
- package/dist/icons/custom/colored/Material.js +1 -1
- package/dist/icons/custom/colored/MedalBronze.d.ts +1 -1
- package/dist/icons/custom/colored/MedalBronze.js +1 -1
- package/dist/icons/custom/colored/MedalGold.d.ts +1 -1
- package/dist/icons/custom/colored/MedalGold.js +1 -1
- package/dist/icons/custom/colored/MedalSilver.d.ts +1 -1
- package/dist/icons/custom/colored/MedalSilver.js +1 -1
- package/dist/icons/custom/colored/Pro.d.ts +1 -1
- package/dist/icons/custom/colored/Pro.js +1 -1
- package/dist/icons/custom/colored/Problem.d.ts +1 -1
- package/dist/icons/custom/colored/Problem.js +1 -1
- package/dist/icons/custom/colored/PythonColor.d.ts +1 -1
- package/dist/icons/custom/colored/PythonColor.js +1 -1
- package/dist/icons/custom/colored/QuizColor.d.ts +1 -1
- package/dist/icons/custom/colored/QuizColor.js +1 -1
- package/dist/icons/custom/colored/ResourceColor.d.ts +1 -1
- package/dist/icons/custom/colored/ResourceColor.js +1 -1
- package/dist/icons/custom/colored/ScratchColor.d.ts +1 -1
- package/dist/icons/custom/colored/ScratchColor.js +1 -1
- package/dist/icons/custom/colored/TypeHelper.d.ts +1 -1
- package/dist/icons/custom/colored/TypeHelper.js +1 -1
- package/dist/icons/custom/colored/Whale.d.ts +1 -1
- package/dist/icons/custom/colored/Whale.js +1 -1
- package/dist/icons/custom/colored/WorksheetColor.d.ts +1 -1
- package/dist/icons/custom/colored/WorksheetColor.js +1 -1
- package/dist/icons/custom/default/AiQuiz.d.ts +1 -1
- package/dist/icons/custom/default/AiQuiz.js +1 -1
- package/dist/icons/custom/default/Badge.d.ts +1 -1
- package/dist/icons/custom/default/Badge.js +1 -1
- package/dist/icons/custom/default/Board.d.ts +1 -1
- package/dist/icons/custom/default/Board.js +1 -1
- package/dist/icons/custom/default/CastCloudy.d.ts +1 -1
- package/dist/icons/custom/default/CastCloudy.js +1 -1
- package/dist/icons/custom/default/CastPartly.d.ts +1 -1
- package/dist/icons/custom/default/CastPartly.js +1 -1
- package/dist/icons/custom/default/CastRainbow.d.ts +1 -1
- package/dist/icons/custom/default/CastRainbow.js +1 -1
- package/dist/icons/custom/default/CastSunny.d.ts +1 -1
- package/dist/icons/custom/default/CastSunny.js +1 -1
- package/dist/icons/custom/default/Codap.d.ts +1 -1
- package/dist/icons/custom/default/Codap.js +1 -1
- package/dist/icons/custom/default/Ebook.d.ts +1 -1
- package/dist/icons/custom/default/Ebook.js +1 -1
- package/dist/icons/custom/default/Embedded.d.ts +1 -1
- package/dist/icons/custom/default/Embedded.js +1 -1
- package/dist/icons/custom/default/EmoClap.d.ts +1 -1
- package/dist/icons/custom/default/EmoClap.js +1 -1
- package/dist/icons/custom/default/EmoGood.d.ts +1 -1
- package/dist/icons/custom/default/EmoGood.js +1 -1
- package/dist/icons/custom/default/EmoGreat.d.ts +1 -1
- package/dist/icons/custom/default/EmoGreat.js +1 -1
- package/dist/icons/custom/default/EmoHeart.d.ts +1 -1
- package/dist/icons/custom/default/EmoHeart.js +1 -1
- package/dist/icons/custom/default/EmoHundred.d.ts +1 -1
- package/dist/icons/custom/default/EmoHundred.js +1 -1
- package/dist/icons/custom/default/EmoNeutral.d.ts +1 -1
- package/dist/icons/custom/default/EmoNeutral.js +1 -1
- package/dist/icons/custom/default/EmoStars.d.ts +1 -1
- package/dist/icons/custom/default/EmoStars.js +1 -1
- package/dist/icons/custom/default/EmoThumbup.d.ts +1 -1
- package/dist/icons/custom/default/EmoThumbup.js +1 -1
- package/dist/icons/custom/default/Entry.d.ts +1 -1
- package/dist/icons/custom/default/Entry.js +1 -1
- package/dist/icons/custom/default/Fab.d.ts +1 -1
- package/dist/icons/custom/default/Fab.js +1 -1
- package/dist/icons/custom/default/Grant.d.ts +1 -1
- package/dist/icons/custom/default/Grant.js +1 -1
- package/dist/icons/custom/default/GrantAlt.d.ts +1 -1
- package/dist/icons/custom/default/GrantAlt.js +1 -1
- package/dist/icons/custom/default/HandLine.d.ts +1 -1
- package/dist/icons/custom/default/HandLine.js +1 -1
- package/dist/icons/custom/default/Judge.d.ts +1 -1
- package/dist/icons/custom/default/Judge.js +1 -1
- package/dist/icons/custom/default/Makecode.d.ts +1 -1
- package/dist/icons/custom/default/Makecode.js +1 -1
- package/dist/icons/custom/default/Pdf.d.ts +1 -1
- package/dist/icons/custom/default/Pdf.js +1 -1
- package/dist/icons/custom/default/Python.d.ts +1 -1
- package/dist/icons/custom/default/Python.js +1 -1
- package/dist/icons/custom/default/Quiz.d.ts +1 -1
- package/dist/icons/custom/default/Quiz.js +1 -1
- package/dist/icons/custom/default/Resource.d.ts +1 -1
- package/dist/icons/custom/default/Resource.js +1 -1
- package/dist/icons/custom/default/Scratch.d.ts +1 -1
- package/dist/icons/custom/default/Scratch.js +1 -1
- package/dist/icons/custom/default/ScrollAlt.d.ts +1 -1
- package/dist/icons/custom/default/ScrollAlt.js +1 -1
- package/dist/icons/custom/default/ScrollFill.d.ts +1 -1
- package/dist/icons/custom/default/ScrollFill.js +1 -1
- package/dist/icons/custom/default/ScrollLine.d.ts +1 -1
- package/dist/icons/custom/default/ScrollLine.js +1 -1
- package/dist/icons/custom/default/Symbol.d.ts +1 -1
- package/dist/icons/custom/default/Symbol.js +1 -1
- package/dist/icons/custom/default/Worksheet.d.ts +1 -1
- package/dist/icons/custom/default/Worksheet.js +1 -1
- package/dist/icons/custom/svgrColoredTemplate.js +1 -1
- package/dist/icons/custom/svgrDefaultTemplate.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/patterns/LexicalEditor/components/FileSelectInput.js +8 -7
- package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +1 -3
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +2 -2
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormPlaceholder.js +1 -3
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +14 -15
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +3 -3
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +2 -2
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +3 -5
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.d.ts +1 -2
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.js +5 -4
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +2 -2
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +3 -3
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +0 -1
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +56 -58
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.d.ts +0 -2
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +33 -29
- package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +2 -4
- package/dist/texts.d.ts +1 -2
- package/dist/texts.js +12 -11
- package/package.json +1 -1
|
@@ -14,14 +14,12 @@ 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";
|
|
18
17
|
/**
|
|
19
18
|
* OS 파일 다이얼로그를 열어 파일을 선택하고 업로드하는 컴포넌트입니다.
|
|
20
19
|
*/
|
|
21
20
|
export function UploadFileDialog({ open, onClose, onChange, }) {
|
|
22
21
|
const inputRef = useRef(null);
|
|
23
22
|
const cdsContext = useContext(CdsContext);
|
|
24
|
-
const { t } = useTranslation();
|
|
25
23
|
const handleFileChange = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
26
24
|
var _a, _b, _c;
|
|
27
25
|
const showFileError = (_a = cdsContext.lexical) === null || _a === void 0 ? void 0 : _a.showFileError;
|
|
@@ -32,7 +30,7 @@ export function UploadFileDialog({ open, onClose, onChange, }) {
|
|
|
32
30
|
}
|
|
33
31
|
const MAX_FILE_SIZE = 1 * 1024 * 1024 * 1024; // 1GB
|
|
34
32
|
if (file.size >= MAX_FILE_SIZE) {
|
|
35
|
-
showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", getTexts(
|
|
33
|
+
showFileError === null || showFileError === void 0 ? void 0 : showFileError("upload", getTexts("errorFileTooLarge"));
|
|
36
34
|
event.target.value = "";
|
|
37
35
|
onClose();
|
|
38
36
|
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(
|
|
57
|
+
return (_jsx(SegmentedInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, answerFormat: answerFormat, placeholder: placeholder || getTexts("placeholderEnterHere"), value: answerInput, onChange: handleChange }));
|
|
58
58
|
}
|
|
59
|
-
return (_jsx(TextInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, size: "small", color: "default", placeholder: placeholder || getTexts(
|
|
59
|
+
return (_jsx(TextInput, { readOnly: freezeProblemNode, isCorrect: isCorrect, size: "small", color: "default", placeholder: placeholder || getTexts("placeholderEnterHere"), value: answerInput, onChange: (e) => {
|
|
60
60
|
handleChange(e.target.value);
|
|
61
61
|
}, fullWidth: true }));
|
|
62
62
|
}
|
|
@@ -2,9 +2,7 @@ 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";
|
|
6
5
|
export function FormPlaceholder(props) {
|
|
7
6
|
const { control } = props;
|
|
8
|
-
|
|
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") })) }));
|
|
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") })) }));
|
|
10
8
|
}
|
|
@@ -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(
|
|
86
|
+
] })] }), _jsxs(FormArea, { children: [_jsxs(Label, { children: [t("자리 표시자", { context: "렉시컬 주관식 설정창" }), _jsx(Tooltip, { text: getTexts("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,6 +6,7 @@ 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";
|
|
9
10
|
import { useTranslation } from "react-i18next";
|
|
10
11
|
const TYPE_TO_INDEX_ICON = (type) => ({
|
|
11
12
|
primary: (_jsx(CheckFillIcon, { css: css `
|
|
@@ -25,42 +26,40 @@ const TYPE_TO_INDEX_ICON = (type) => ({
|
|
|
25
26
|
* isSelected, isAnswer, onClick에 따른 type, description 내용
|
|
26
27
|
* /images/2025-05-05-01-25-06.png
|
|
27
28
|
*/
|
|
28
|
-
function getTypeAndDescription(isSelected, isAnswer, onClick
|
|
29
|
+
function getTypeAndDescription(isSelected, isAnswer, onClick) {
|
|
29
30
|
if (isAnswer === undefined) {
|
|
30
31
|
return {
|
|
31
32
|
type: isSelected ? "primary" : undefined,
|
|
32
|
-
description: isSelected
|
|
33
|
+
description: isSelected
|
|
34
|
+
? i18n.t("선택됨")
|
|
35
|
+
: onClick
|
|
36
|
+
? i18n.t("선택하기")
|
|
37
|
+
: "",
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
40
|
if (isAnswer) {
|
|
36
41
|
return {
|
|
37
42
|
type: isSelected ? "success" : undefined,
|
|
38
43
|
description: isSelected
|
|
39
|
-
? t("선택됨, 정답", {
|
|
40
|
-
context: "렉시컬 선택지 하나의 상태",
|
|
41
|
-
})
|
|
44
|
+
? i18n.t("선택됨, 정답", { context: "렉시컬 선택지 하나의 상태" })
|
|
42
45
|
: onClick
|
|
43
|
-
? t("선택하기, 정답", {
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
: t("정답", { context: "렉시컬 선택지 하나의 상태" }),
|
|
46
|
+
? i18n.t("선택하기, 정답", { context: "렉시컬 선택지 하나의 상태" })
|
|
47
|
+
: i18n.t("정답", { context: "렉시컬 선택지 하나의 상태" }),
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
return {
|
|
50
51
|
type: isSelected ? "danger" : undefined,
|
|
51
52
|
description: isSelected
|
|
52
|
-
? t("선택됨, 오답", { context: "렉시컬 선택지 하나의 상태" })
|
|
53
|
+
? i18n.t("선택됨, 오답", { context: "렉시컬 선택지 하나의 상태" })
|
|
53
54
|
: onClick
|
|
54
|
-
? t("선택하기, 오답", {
|
|
55
|
-
|
|
56
|
-
})
|
|
57
|
-
: t("오답", { context: "렉시컬 선택지 하나의 상태" }),
|
|
55
|
+
? i18n.t("선택하기, 오답", { context: "렉시컬 선택지 하나의 상태" })
|
|
56
|
+
: i18n.t("오답", { context: "렉시컬 선택지 하나의 상태" }),
|
|
58
57
|
};
|
|
59
58
|
}
|
|
60
59
|
export function SelectBoxView(props) {
|
|
61
60
|
const { multipleSelectionsEnabled, index, isSelected, isAnswer, image, text, onClick, } = props;
|
|
62
61
|
const { t } = useTranslation();
|
|
63
|
-
const { type, description } = getTypeAndDescription(isSelected, isAnswer, onClick
|
|
62
|
+
const { type, description } = getTypeAndDescription(isSelected, isAnswer, onClick);
|
|
64
63
|
const boxRef = useRef(null);
|
|
65
64
|
const handleKeyDown = (e) => {
|
|
66
65
|
// 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(
|
|
39
|
+
` }), getTexts("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(
|
|
47
|
+
return getTexts("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(
|
|
60
|
+
return getTexts("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(
|
|
79
|
+
: getTexts("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);
|
|
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);
|
|
31
31
|
return (_jsx(DropdownItem, { index: index, label: title, preserveIconColor: true, startIcon: startIcon, onClick: () => {
|
|
32
32
|
onChange(type);
|
|
33
33
|
} }, index));
|
|
@@ -4,16 +4,14 @@ 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
|
-
|
|
8
|
-
|
|
9
|
-
required: getTexts(t, "errorRequiredField"),
|
|
7
|
+
const getLabelRules = () => ({
|
|
8
|
+
required: getTexts("errorRequiredField"),
|
|
10
9
|
maxLength: 12,
|
|
11
10
|
});
|
|
12
11
|
/** 레이블을 설정하는 Form입니다. */
|
|
13
12
|
export function FormLabel(props) {
|
|
14
13
|
const { control, index } = props;
|
|
15
|
-
const
|
|
16
|
-
const labelRules = getLabelRules(t);
|
|
14
|
+
const labelRules = getLabelRules();
|
|
17
15
|
// endIcon에 들어갈 value, error를 사용하기 위해 useController를 사용합니다.
|
|
18
16
|
const { field: { value }, fieldState: { error }, } = useController({
|
|
19
17
|
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(
|
|
13
|
+
required: getTexts("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(
|
|
53
|
+
question: { text: getTexts("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);
|
|
27
27
|
// label과 icons를 매핑하여 ToggelButtonData로 변환합니다.
|
|
28
28
|
// 만약 둘의 길이가 같지 않다면 짧은 길이에 맞춰집니다.
|
|
29
29
|
const data = _.zipWith(labels, icons, (label, { onIcon, offIcon }) => ({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { IconType } from "./SelfEvaluationNode";
|
|
3
3
|
import { Theme } from "@emotion/react";
|
|
4
|
-
import { TFunction } from "i18next";
|
|
5
4
|
interface IconData {
|
|
6
5
|
startIcon: React.ReactNode;
|
|
7
6
|
title: string;
|
|
@@ -11,5 +10,5 @@ interface IconData {
|
|
|
11
10
|
}[];
|
|
12
11
|
}
|
|
13
12
|
export declare const ICON_TYPES: IconType[];
|
|
14
|
-
export declare const getIconData: (iconType: IconType, theme: Theme
|
|
13
|
+
export declare const getIconData: (iconType: IconType, theme: Theme) => IconData;
|
|
15
14
|
export {};
|
|
@@ -2,15 +2,16 @@ 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";
|
|
5
6
|
export const ICON_TYPES = [
|
|
6
7
|
"emoji",
|
|
7
8
|
"ascendingNumber",
|
|
8
9
|
"descendingNumber",
|
|
9
10
|
];
|
|
10
|
-
export const getIconData = (iconType, theme
|
|
11
|
+
export const getIconData = (iconType, theme) => ({
|
|
11
12
|
emoji: {
|
|
12
13
|
startIcon: _jsx(CustomEmoGreatColorIcon, {}),
|
|
13
|
-
title: t("이모지"),
|
|
14
|
+
title: i18n.t("이모지"),
|
|
14
15
|
icons: [
|
|
15
16
|
{
|
|
16
17
|
onIcon: _jsx(CustomEmoGreatColorIcon, {}),
|
|
@@ -25,7 +26,7 @@ export const getIconData = (iconType, theme, t) => ({
|
|
|
25
26
|
},
|
|
26
27
|
ascendingNumber: {
|
|
27
28
|
startIcon: _jsx(Number1Icon, {}),
|
|
28
|
-
title: t("숫자, 1-2-3"),
|
|
29
|
+
title: i18n.t("숫자, 1-2-3"),
|
|
29
30
|
icons: [
|
|
30
31
|
{
|
|
31
32
|
onIcon: _jsx(Number1Icon, { color: theme.color.background.primary }),
|
|
@@ -43,7 +44,7 @@ export const getIconData = (iconType, theme, t) => ({
|
|
|
43
44
|
},
|
|
44
45
|
descendingNumber: {
|
|
45
46
|
startIcon: _jsx(Number3Icon, {}),
|
|
46
|
-
title: t("숫자, 3-2-1"),
|
|
47
|
+
title: i18n.t("숫자, 3-2-1"),
|
|
47
48
|
icons: [
|
|
48
49
|
{
|
|
49
50
|
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(
|
|
52
|
+
}, size: "small", color: focus ? "activePrimary" : "default", placeholder: placeholder || getTexts("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(
|
|
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 `
|
|
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(
|
|
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" })] })] }));
|
|
43
43
|
}
|
|
44
44
|
const Form = styled.form(({ theme }) => css `
|
|
45
45
|
display: flex;
|
package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js
CHANGED
|
@@ -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(
|
|
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
|
|
30
30
|
? undefined
|
|
31
31
|
: () => {
|
|
32
32
|
const isSelected = selected.includes(selection.value);
|
package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js
CHANGED
|
@@ -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(
|
|
47
|
+
return getTexts("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(
|
|
59
|
+
return getTexts("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(
|
|
75
|
+
: getTexts("errorMaxChoicesExceeded"), onClick: () => {
|
|
76
76
|
if (fields.length >= 9)
|
|
77
77
|
return;
|
|
78
78
|
append({
|