@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.
- package/dist/CdsProvider.d.ts +2 -2
- package/dist/CdsProvider.js +1 -11
- package/dist/i18n/i18n.d.ts +14 -3
- package/dist/i18n/i18n.js +32 -34
- 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 +1 -0
- package/dist/index.js +1 -0
- package/dist/patterns/LexicalEditor/components/FileSelectInput.js +7 -8
- package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +3 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +2 -2
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormPlaceholder.js +3 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -14
- 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 +5 -3
- 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 +2 -1
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/iconData.js +4 -5
- 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 +1 -0
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +84 -83
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.d.ts +2 -0
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +49 -94
- package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +4 -2
- package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +17 -8
- package/dist/patterns/LexicalEditor/plugins/TogglePlugin/index.js +54 -2
- package/dist/texts.d.ts +2 -1
- package/dist/texts.js +11 -12
- package/package.json +1 -2
|
@@ -18,10 +18,10 @@ import { $isProblemSelectNode, } from "../../nodes/ProblemSelectNode";
|
|
|
18
18
|
import { $isSheetInputNode } from "../../nodes/SheetInputNode";
|
|
19
19
|
import { $isSheetSelectNode, } from "../../nodes/SheetSelectNode";
|
|
20
20
|
import { $isSelfEvaluationNode, } from "../../nodes/SelfEvaluationNode";
|
|
21
|
-
import {
|
|
22
|
-
function getParagraphContextMenuOptions(editor, node) {
|
|
21
|
+
import { useTranslation } from "react-i18next";
|
|
22
|
+
function getParagraphContextMenuOptions(editor, node, t) {
|
|
23
23
|
return [
|
|
24
|
-
new ComponentPickerOption(
|
|
24
|
+
new ComponentPickerOption(t("본문", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
25
25
|
icon: _jsx(TextIcon, {}),
|
|
26
26
|
// eslint-disable-next-line i18next/no-literal-string
|
|
27
27
|
keywords: ["normal", "paragraph", "p", "text", "본문", "단락", "내용"],
|
|
@@ -32,9 +32,9 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
32
32
|
}),
|
|
33
33
|
...[1, 2, 3].map((n) => {
|
|
34
34
|
const titleMap = {
|
|
35
|
-
1:
|
|
36
|
-
2:
|
|
37
|
-
3:
|
|
35
|
+
1: t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
36
|
+
2: t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
37
|
+
3: t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
38
38
|
};
|
|
39
39
|
const iconMap = {
|
|
40
40
|
1: _jsx(H1Icon, {}),
|
|
@@ -50,7 +50,7 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
50
50
|
}),
|
|
51
51
|
});
|
|
52
52
|
}),
|
|
53
|
-
new ComponentPickerOption(
|
|
53
|
+
new ComponentPickerOption(t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
54
54
|
icon: _jsx(ListUnorderedIcon, {}),
|
|
55
55
|
keywords: ["bulleted list", "unordered list", "ul"],
|
|
56
56
|
onSelect: () => {
|
|
@@ -58,7 +58,7 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
58
58
|
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
|
|
59
59
|
},
|
|
60
60
|
}),
|
|
61
|
-
new ComponentPickerOption(
|
|
61
|
+
new ComponentPickerOption(t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
62
62
|
icon: _jsx(ListOrderedIcon, {}),
|
|
63
63
|
keywords: ["numbered list", "ordered list", "ol"],
|
|
64
64
|
onSelect: () => {
|
|
@@ -66,7 +66,7 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
66
66
|
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
|
|
67
67
|
},
|
|
68
68
|
}),
|
|
69
|
-
new ComponentPickerOption(
|
|
69
|
+
new ComponentPickerOption(t("인용 블록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
70
70
|
icon: _jsx(DoubleQuotesLIcon, {}),
|
|
71
71
|
keywords: ["block quote"],
|
|
72
72
|
onSelect: () => editor.update(() => {
|
|
@@ -74,7 +74,7 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
74
74
|
$setBlocksType(selection, () => $createQuoteNode());
|
|
75
75
|
}),
|
|
76
76
|
}),
|
|
77
|
-
new ComponentPickerOption(
|
|
77
|
+
new ComponentPickerOption(t("코드 블록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
78
78
|
icon: _jsx(CodeViewIcon, {}),
|
|
79
79
|
keywords: ["javascript", "python", "js", "codeblock"],
|
|
80
80
|
onSelect: () => editor.update(() => {
|
|
@@ -91,7 +91,7 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
91
91
|
}
|
|
92
92
|
}),
|
|
93
93
|
}),
|
|
94
|
-
new ComponentPickerOption(
|
|
94
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
95
95
|
icon: _jsx(CloseFillIcon, {}),
|
|
96
96
|
keywords: [],
|
|
97
97
|
onSelect: () => {
|
|
@@ -102,13 +102,13 @@ function getParagraphContextMenuOptions(editor, node) {
|
|
|
102
102
|
}),
|
|
103
103
|
];
|
|
104
104
|
}
|
|
105
|
-
function getHeadingContextMenuOptions(editor, node) {
|
|
105
|
+
function getHeadingContextMenuOptions(editor, node, t) {
|
|
106
106
|
return [
|
|
107
107
|
...[1, 2, 3].map((n) => {
|
|
108
108
|
const titleMap = {
|
|
109
|
-
1:
|
|
110
|
-
2:
|
|
111
|
-
3:
|
|
109
|
+
1: t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
110
|
+
2: t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
111
|
+
3: t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
112
112
|
};
|
|
113
113
|
const iconMap = {
|
|
114
114
|
1: _jsx(H1Icon, {}),
|
|
@@ -124,7 +124,7 @@ function getHeadingContextMenuOptions(editor, node) {
|
|
|
124
124
|
}),
|
|
125
125
|
});
|
|
126
126
|
}),
|
|
127
|
-
new ComponentPickerOption(
|
|
127
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
128
128
|
icon: _jsx(CloseFillIcon, {}),
|
|
129
129
|
keywords: [],
|
|
130
130
|
onSelect: () => {
|
|
@@ -135,9 +135,9 @@ function getHeadingContextMenuOptions(editor, node) {
|
|
|
135
135
|
}),
|
|
136
136
|
];
|
|
137
137
|
}
|
|
138
|
-
function getListContextMenuOptions(editor, theme, node) {
|
|
138
|
+
function getListContextMenuOptions(editor, theme, node, t) {
|
|
139
139
|
return [
|
|
140
|
-
new ComponentPickerOption(
|
|
140
|
+
new ComponentPickerOption(t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
141
141
|
icon: _jsx(ListUnorderedIcon, {}),
|
|
142
142
|
keywords: ["bulleted list", "unordered list", "ul"],
|
|
143
143
|
onSelect: () => {
|
|
@@ -145,7 +145,7 @@ function getListContextMenuOptions(editor, theme, node) {
|
|
|
145
145
|
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
|
|
146
146
|
},
|
|
147
147
|
}),
|
|
148
|
-
new ComponentPickerOption(
|
|
148
|
+
new ComponentPickerOption(t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
|
|
149
149
|
icon: _jsx(ListOrderedIcon, {}),
|
|
150
150
|
keywords: ["numbered list", "ordered list", "ol"],
|
|
151
151
|
onSelect: () => {
|
|
@@ -153,7 +153,7 @@ function getListContextMenuOptions(editor, theme, node) {
|
|
|
153
153
|
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
|
|
154
154
|
},
|
|
155
155
|
}),
|
|
156
|
-
new ComponentPickerOption(
|
|
156
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
157
157
|
icon: _jsx(CloseFillIcon, {}),
|
|
158
158
|
keywords: [],
|
|
159
159
|
onSelect: () => {
|
|
@@ -164,13 +164,19 @@ function getListContextMenuOptions(editor, theme, node) {
|
|
|
164
164
|
}),
|
|
165
165
|
];
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* 토글 노드를 헤딩 노드로 변환하는 함수
|
|
169
|
+
* - 토글 컨테이너의 제목을 지정된 Heading 노드로 변환하고 (제목이 빈 경우 빈 텍스트 노드를 추가)
|
|
170
|
+
* - 본문과 컨테이너를 언랩하여 계층을 평탄화한다.
|
|
171
|
+
*/
|
|
167
172
|
function convertToggleTitleToHeading(container, tag) {
|
|
168
|
-
const
|
|
169
|
-
|
|
173
|
+
const children = container.getChildren();
|
|
174
|
+
const titleNode = children.find($isToggleTitleNode);
|
|
175
|
+
if (!titleNode) {
|
|
170
176
|
return;
|
|
171
177
|
}
|
|
172
|
-
const contentNode =
|
|
173
|
-
if (
|
|
178
|
+
const contentNode = children.find($isToggleContentNode);
|
|
179
|
+
if (!contentNode) {
|
|
174
180
|
return;
|
|
175
181
|
}
|
|
176
182
|
const headingNode = $createHeadingNode(tag);
|
|
@@ -188,13 +194,13 @@ function convertToggleTitleToHeading(container, tag) {
|
|
|
188
194
|
$unwrapNode(container);
|
|
189
195
|
headingNode.selectStart();
|
|
190
196
|
}
|
|
191
|
-
function getToggleContextMenuOptions(editor, container) {
|
|
197
|
+
function getToggleContextMenuOptions(editor, container, t) {
|
|
192
198
|
return [
|
|
193
199
|
...[1, 2, 3].map((n) => {
|
|
194
200
|
const titleMap = {
|
|
195
|
-
1:
|
|
196
|
-
2:
|
|
197
|
-
3:
|
|
201
|
+
1: t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
202
|
+
2: t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
203
|
+
3: t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
|
|
198
204
|
};
|
|
199
205
|
const iconMap = {
|
|
200
206
|
1: _jsx(H1Icon, {}),
|
|
@@ -209,7 +215,7 @@ function getToggleContextMenuOptions(editor, container) {
|
|
|
209
215
|
}),
|
|
210
216
|
});
|
|
211
217
|
}),
|
|
212
|
-
new ComponentPickerOption(
|
|
218
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
213
219
|
icon: _jsx(CloseFillIcon, {}),
|
|
214
220
|
keywords: [],
|
|
215
221
|
onSelect: () => {
|
|
@@ -218,9 +224,9 @@ function getToggleContextMenuOptions(editor, container) {
|
|
|
218
224
|
}),
|
|
219
225
|
];
|
|
220
226
|
}
|
|
221
|
-
function getProblemInputContextMenuOptions(node) {
|
|
227
|
+
function getProblemInputContextMenuOptions(node, t) {
|
|
222
228
|
return [
|
|
223
|
-
new ComponentPickerOption(
|
|
229
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
224
230
|
icon: _jsx(CloseFillIcon, {}),
|
|
225
231
|
keywords: [],
|
|
226
232
|
onSelect: () => {
|
|
@@ -229,9 +235,9 @@ function getProblemInputContextMenuOptions(node) {
|
|
|
229
235
|
}),
|
|
230
236
|
];
|
|
231
237
|
}
|
|
232
|
-
function getProblemSelectContextMenuOptions(node) {
|
|
238
|
+
function getProblemSelectContextMenuOptions(node, t) {
|
|
233
239
|
return [
|
|
234
|
-
new ComponentPickerOption(
|
|
240
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
235
241
|
icon: _jsx(CloseFillIcon, {}),
|
|
236
242
|
keywords: [],
|
|
237
243
|
onSelect: () => {
|
|
@@ -240,9 +246,9 @@ function getProblemSelectContextMenuOptions(node) {
|
|
|
240
246
|
}),
|
|
241
247
|
];
|
|
242
248
|
}
|
|
243
|
-
function getSheetInputContextMenuOptions(node) {
|
|
249
|
+
function getSheetInputContextMenuOptions(node, t) {
|
|
244
250
|
return [
|
|
245
|
-
new ComponentPickerOption(
|
|
251
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
246
252
|
icon: _jsx(CloseFillIcon, {}),
|
|
247
253
|
keywords: [],
|
|
248
254
|
onSelect: () => {
|
|
@@ -251,9 +257,9 @@ function getSheetInputContextMenuOptions(node) {
|
|
|
251
257
|
}),
|
|
252
258
|
];
|
|
253
259
|
}
|
|
254
|
-
function getSheetSelectContextMenuOptions(node) {
|
|
260
|
+
function getSheetSelectContextMenuOptions(node, t) {
|
|
255
261
|
return [
|
|
256
|
-
new ComponentPickerOption(
|
|
262
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
257
263
|
icon: _jsx(CloseFillIcon, {}),
|
|
258
264
|
keywords: [],
|
|
259
265
|
onSelect: () => {
|
|
@@ -262,9 +268,9 @@ function getSheetSelectContextMenuOptions(node) {
|
|
|
262
268
|
}),
|
|
263
269
|
];
|
|
264
270
|
}
|
|
265
|
-
function getSelfEvaluationContextMenuOptions(node) {
|
|
271
|
+
function getSelfEvaluationContextMenuOptions(node, t) {
|
|
266
272
|
return [
|
|
267
|
-
new ComponentPickerOption(
|
|
273
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
268
274
|
icon: _jsx(CloseFillIcon, {}),
|
|
269
275
|
keywords: [],
|
|
270
276
|
onSelect: () => {
|
|
@@ -273,9 +279,9 @@ function getSelfEvaluationContextMenuOptions(node) {
|
|
|
273
279
|
}),
|
|
274
280
|
];
|
|
275
281
|
}
|
|
276
|
-
function getImageContextMenuOptions(node) {
|
|
282
|
+
function getImageContextMenuOptions(node, t) {
|
|
277
283
|
return [
|
|
278
|
-
new ComponentPickerOption(
|
|
284
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
279
285
|
icon: _jsx(CloseFillIcon, {}),
|
|
280
286
|
keywords: [],
|
|
281
287
|
onSelect: () => {
|
|
@@ -284,9 +290,9 @@ function getImageContextMenuOptions(node) {
|
|
|
284
290
|
}),
|
|
285
291
|
];
|
|
286
292
|
}
|
|
287
|
-
function getVideoContextMenuOptions(node) {
|
|
293
|
+
function getVideoContextMenuOptions(node, t) {
|
|
288
294
|
return [
|
|
289
|
-
new ComponentPickerOption(
|
|
295
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
290
296
|
icon: _jsx(CloseFillIcon, {}),
|
|
291
297
|
keywords: [],
|
|
292
298
|
onSelect: () => {
|
|
@@ -295,12 +301,12 @@ function getVideoContextMenuOptions(node) {
|
|
|
295
301
|
}),
|
|
296
302
|
];
|
|
297
303
|
}
|
|
298
|
-
function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
304
|
+
function getColoredQuoteContextMenuOptions(editor, theme, node, t) {
|
|
299
305
|
return [
|
|
300
|
-
new ComponentPickerOption(
|
|
306
|
+
new ComponentPickerOption(t("회색"), {
|
|
301
307
|
icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.marbleOnContainer })),
|
|
302
|
-
iconContainerClassName: css `
|
|
303
|
-
background: ${theme.color.container.marbleContainer};
|
|
308
|
+
iconContainerClassName: css `
|
|
309
|
+
background: ${theme.color.container.marbleContainer};
|
|
304
310
|
`,
|
|
305
311
|
keywords: ["grey", "gray"],
|
|
306
312
|
onSelect: () => {
|
|
@@ -309,10 +315,10 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
309
315
|
});
|
|
310
316
|
},
|
|
311
317
|
}),
|
|
312
|
-
new ComponentPickerOption(
|
|
318
|
+
new ComponentPickerOption(t("빨간색"), {
|
|
313
319
|
icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.redOnContainer })),
|
|
314
|
-
iconContainerClassName: css `
|
|
315
|
-
background: ${theme.color.container.redContainer};
|
|
320
|
+
iconContainerClassName: css `
|
|
321
|
+
background: ${theme.color.container.redContainer};
|
|
316
322
|
`,
|
|
317
323
|
keywords: ["red"],
|
|
318
324
|
onSelect: () => {
|
|
@@ -321,10 +327,10 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
321
327
|
});
|
|
322
328
|
},
|
|
323
329
|
}),
|
|
324
|
-
new ComponentPickerOption(
|
|
330
|
+
new ComponentPickerOption(t("노란색"), {
|
|
325
331
|
icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.yellowOnContainer })),
|
|
326
|
-
iconContainerClassName: css `
|
|
327
|
-
background: ${theme.color.container.yellowContainer};
|
|
332
|
+
iconContainerClassName: css `
|
|
333
|
+
background: ${theme.color.container.yellowContainer};
|
|
328
334
|
`,
|
|
329
335
|
keywords: ["yellow"],
|
|
330
336
|
onSelect: () => {
|
|
@@ -333,10 +339,10 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
333
339
|
});
|
|
334
340
|
},
|
|
335
341
|
}),
|
|
336
|
-
new ComponentPickerOption(
|
|
342
|
+
new ComponentPickerOption(t("파란색"), {
|
|
337
343
|
icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.blueOnContainer })),
|
|
338
|
-
iconContainerClassName: css `
|
|
339
|
-
background: ${theme.color.container.blueContainer};
|
|
344
|
+
iconContainerClassName: css `
|
|
345
|
+
background: ${theme.color.container.blueContainer};
|
|
340
346
|
`,
|
|
341
347
|
keywords: ["blue"],
|
|
342
348
|
onSelect: () => {
|
|
@@ -345,10 +351,10 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
345
351
|
});
|
|
346
352
|
},
|
|
347
353
|
}),
|
|
348
|
-
new ComponentPickerOption(
|
|
354
|
+
new ComponentPickerOption(t("초록색"), {
|
|
349
355
|
icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.greenOnContainer })),
|
|
350
|
-
iconContainerClassName: css `
|
|
351
|
-
background: ${theme.color.container.greenContainer};
|
|
356
|
+
iconContainerClassName: css `
|
|
357
|
+
background: ${theme.color.container.greenContainer};
|
|
352
358
|
`,
|
|
353
359
|
keywords: ["green"],
|
|
354
360
|
onSelect: () => {
|
|
@@ -357,7 +363,7 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
357
363
|
});
|
|
358
364
|
},
|
|
359
365
|
}),
|
|
360
|
-
new ComponentPickerOption(
|
|
366
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
361
367
|
icon: _jsx(CloseFillIcon, {}),
|
|
362
368
|
keywords: [],
|
|
363
369
|
onSelect: () => {
|
|
@@ -368,9 +374,9 @@ function getColoredQuoteContextMenuOptions(editor, theme, node) {
|
|
|
368
374
|
}),
|
|
369
375
|
];
|
|
370
376
|
}
|
|
371
|
-
function getUploadFileContextMenuOptions(editor, node) {
|
|
377
|
+
function getUploadFileContextMenuOptions(editor, node, t) {
|
|
372
378
|
return [
|
|
373
|
-
new ComponentPickerOption(
|
|
379
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
374
380
|
icon: _jsx(CloseFillIcon, {}),
|
|
375
381
|
keywords: [],
|
|
376
382
|
onSelect: () => {
|
|
@@ -384,58 +390,53 @@ function getUploadFileContextMenuOptions(editor, node) {
|
|
|
384
390
|
export function useContextMenuOptions(props) {
|
|
385
391
|
const { isSheetEnabled, isQuizEnabled, showFileUpload } = props;
|
|
386
392
|
const theme = useTheme();
|
|
393
|
+
const { t } = useTranslation();
|
|
387
394
|
return (editor, node, setImageOpen, setVideoOpen, setFileOpen) => {
|
|
388
395
|
if ($isProblemInputNode(node)) {
|
|
389
|
-
return getProblemInputContextMenuOptions(node);
|
|
396
|
+
return getProblemInputContextMenuOptions(node, t);
|
|
390
397
|
}
|
|
391
398
|
else if ($isProblemSelectNode(node)) {
|
|
392
|
-
return getProblemSelectContextMenuOptions(node);
|
|
399
|
+
return getProblemSelectContextMenuOptions(node, t);
|
|
393
400
|
}
|
|
394
401
|
else if ($isSheetInputNode(node)) {
|
|
395
|
-
return getSheetInputContextMenuOptions(node);
|
|
402
|
+
return getSheetInputContextMenuOptions(node, t);
|
|
396
403
|
}
|
|
397
404
|
else if ($isSheetSelectNode(node)) {
|
|
398
|
-
return getSheetSelectContextMenuOptions(node);
|
|
405
|
+
return getSheetSelectContextMenuOptions(node, t);
|
|
399
406
|
}
|
|
400
407
|
else if ($isSelfEvaluationNode(node)) {
|
|
401
|
-
return getSelfEvaluationContextMenuOptions(node);
|
|
408
|
+
return getSelfEvaluationContextMenuOptions(node, t);
|
|
402
409
|
}
|
|
403
410
|
else if ($isImageNode(node)) {
|
|
404
|
-
return getImageContextMenuOptions(node);
|
|
411
|
+
return getImageContextMenuOptions(node, t);
|
|
405
412
|
}
|
|
406
413
|
else if ($isVideoNode(node)) {
|
|
407
|
-
return getVideoContextMenuOptions(node);
|
|
414
|
+
return getVideoContextMenuOptions(node, t);
|
|
408
415
|
}
|
|
409
416
|
else if (node instanceof ParagraphNode) {
|
|
410
|
-
return getParagraphContextMenuOptions(editor, node);
|
|
417
|
+
return getParagraphContextMenuOptions(editor, node, t);
|
|
411
418
|
}
|
|
412
419
|
else if (node instanceof HeadingNode) {
|
|
413
|
-
return getHeadingContextMenuOptions(editor, node);
|
|
420
|
+
return getHeadingContextMenuOptions(editor, node, t);
|
|
414
421
|
}
|
|
415
422
|
else if (node instanceof ListNode || node instanceof ListItemNode) {
|
|
416
|
-
return getListContextMenuOptions(editor, theme, node);
|
|
423
|
+
return getListContextMenuOptions(editor, theme, node, t);
|
|
417
424
|
}
|
|
418
425
|
else if ($isToggleContainerNode(node)) {
|
|
419
|
-
return getToggleContextMenuOptions(editor, node);
|
|
420
|
-
}
|
|
421
|
-
else if ($isToggleTitleNode(node) || $isToggleContentNode(node)) {
|
|
422
|
-
const parent = node.getParent();
|
|
423
|
-
if (parent && $isToggleContainerNode(parent)) {
|
|
424
|
-
return getToggleContextMenuOptions(editor, parent);
|
|
425
|
-
}
|
|
426
|
-
return [];
|
|
426
|
+
return getToggleContextMenuOptions(editor, node, t);
|
|
427
427
|
}
|
|
428
428
|
else if ($isColoredQuoteNode(node)) {
|
|
429
|
-
return getColoredQuoteContextMenuOptions(editor, theme, node);
|
|
429
|
+
return getColoredQuoteContextMenuOptions(editor, theme, node, t);
|
|
430
430
|
}
|
|
431
431
|
else if ($isFileNode(node)) {
|
|
432
|
-
return getUploadFileContextMenuOptions(editor, node);
|
|
432
|
+
return getUploadFileContextMenuOptions(editor, node, t);
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
435
|
return [
|
|
436
436
|
...getBaseOptions({
|
|
437
437
|
editor,
|
|
438
438
|
theme,
|
|
439
|
+
t,
|
|
439
440
|
setImageOpen,
|
|
440
441
|
setVideoOpen,
|
|
441
442
|
isSheetEnabled,
|
|
@@ -443,7 +444,7 @@ export function useContextMenuOptions(props) {
|
|
|
443
444
|
setFileOpen,
|
|
444
445
|
showFileUpload,
|
|
445
446
|
}),
|
|
446
|
-
new ComponentPickerOption(
|
|
447
|
+
new ComponentPickerOption(t("블록 삭제"), {
|
|
447
448
|
icon: _jsx(CloseFillIcon, {}),
|
|
448
449
|
keywords: [],
|
|
449
450
|
onSelect: () => {
|
package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { MenuOption } from "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
|
10
10
|
import { LexicalEditor } from "lexical";
|
|
11
11
|
import { ReactElement } from "react";
|
|
12
12
|
import { Theme } from "@emotion/react";
|
|
13
|
+
import { TFunction } from "i18next";
|
|
13
14
|
export declare class ComponentDrawerOption extends MenuOption {
|
|
14
15
|
title: string;
|
|
15
16
|
component: ReactElement;
|
|
@@ -33,6 +34,7 @@ export declare class ComponentPickerOption extends MenuOption {
|
|
|
33
34
|
export declare function getBaseOptions(props: {
|
|
34
35
|
editor: LexicalEditor;
|
|
35
36
|
theme: Theme;
|
|
37
|
+
t: TFunction;
|
|
36
38
|
setImageOpen: (open: boolean) => void;
|
|
37
39
|
setVideoOpen: (open: boolean) => void;
|
|
38
40
|
setFileOpen: (open: boolean) => void;
|