@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
@@ -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 { i18n } from "../../../../i18n/i18n";
22
- function getParagraphContextMenuOptions(editor, node) {
21
+ import { useTranslation } from "react-i18next";
22
+ function getParagraphContextMenuOptions(editor, node, t) {
23
23
  return [
24
- new ComponentPickerOption(i18n.t("본문", { context: "렉시컬 드롭다운 메뉴" }), {
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: i18n.t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
36
- 2: i18n.t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
37
- 3: i18n.t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
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(i18n.t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("인용 블록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("코드 블록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("블록 삭제"), {
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: i18n.t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
110
- 2: i18n.t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
111
- 3: i18n.t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
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(i18n.t("블록 삭제"), {
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(i18n.t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
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(i18n.t("블록 삭제"), {
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 titleNode = container.getFirstChild();
169
- if (!$isToggleTitleNode(titleNode)) {
173
+ const children = container.getChildren();
174
+ const titleNode = children.find($isToggleTitleNode);
175
+ if (!titleNode) {
170
176
  return;
171
177
  }
172
- const contentNode = titleNode.getNextSibling();
173
- if (!$isToggleContentNode(contentNode)) {
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: i18n.t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
196
- 2: i18n.t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
197
- 3: i18n.t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("회색"), {
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(i18n.t("빨간색"), {
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(i18n.t("노란색"), {
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(i18n.t("파란색"), {
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(i18n.t("초록색"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
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(i18n.t("블록 삭제"), {
447
+ new ComponentPickerOption(t("블록 삭제"), {
447
448
  icon: _jsx(CloseFillIcon, {}),
448
449
  keywords: [],
449
450
  onSelect: () => {
@@ -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;