@team-monolith/cds 1.120.3 → 1.121.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.
Files changed (194) hide show
  1. package/@types/emotion.d.ts +162 -162
  2. package/README.md +37 -37
  3. package/dist/CdsProvider.js +4 -4
  4. package/dist/components/AlertDialog/AlertDialog.js +54 -54
  5. package/dist/components/AlertDialog/AlertDialogActions.js +7 -7
  6. package/dist/components/AlertDialog/AlertDialogContent.js +8 -8
  7. package/dist/components/AlertDialog/AlertDialogTitle.js +34 -34
  8. package/dist/components/AnimatedButton.js +32 -32
  9. package/dist/components/Banner.js +51 -51
  10. package/dist/components/Book/Book.js +174 -174
  11. package/dist/components/Button.js +179 -179
  12. package/dist/components/CheckboxInput.js +148 -148
  13. package/dist/components/FileTypeAlertDialog.js +4 -4
  14. package/dist/components/Input.js +53 -53
  15. package/dist/components/InputBase.js +72 -72
  16. package/dist/components/Modal.js +4 -4
  17. package/dist/components/OverflowTooltip.js +4 -4
  18. package/dist/components/Pagination.js +56 -56
  19. package/dist/components/PinInput.js +64 -64
  20. package/dist/components/Popover.js +27 -27
  21. package/dist/components/RadioInput.js +73 -73
  22. package/dist/components/Slider.js +58 -58
  23. package/dist/components/SquareButton.js +109 -109
  24. package/dist/components/Switch.js +69 -69
  25. package/dist/components/SwitchButton.js +107 -107
  26. package/dist/components/Tag.js +72 -72
  27. package/dist/components/Tooltip.js +19 -19
  28. package/dist/foundation/breakpoints.js +16 -16
  29. package/dist/icons/custom/colored/AiSocroomColor.js +1 -1
  30. package/dist/icons/custom/colored/ai-helper.svg +4 -4
  31. package/dist/icons/custom/colored/ai-quiz-color.svg +20 -20
  32. package/dist/icons/custom/colored/ai-socroom-color.svg +15 -15
  33. package/dist/icons/custom/colored/badge-color.svg +4 -4
  34. package/dist/icons/custom/colored/badge-gold.svg +11 -11
  35. package/dist/icons/custom/colored/badge-green.svg +11 -11
  36. package/dist/icons/custom/colored/badge-silver.svg +11 -11
  37. package/dist/icons/custom/colored/basic-plus.svg +31 -31
  38. package/dist/icons/custom/colored/basic.svg +3 -3
  39. package/dist/icons/custom/colored/board-color.svg +5 -5
  40. package/dist/icons/custom/colored/cast-cloudy-color.svg +6 -6
  41. package/dist/icons/custom/colored/cast-partly-color.svg +7 -7
  42. package/dist/icons/custom/colored/cast-rainbow-color.svg +13 -13
  43. package/dist/icons/custom/colored/cast-sunny-color.svg +4 -4
  44. package/dist/icons/custom/colored/clap-bronze.svg +8 -8
  45. package/dist/icons/custom/colored/clap-gold.svg +8 -8
  46. package/dist/icons/custom/colored/clap-silver.svg +8 -8
  47. package/dist/icons/custom/colored/class.svg +13 -13
  48. package/dist/icons/custom/colored/codap-color.svg +13 -13
  49. package/dist/icons/custom/colored/ebook-color.svg +5 -5
  50. package/dist/icons/custom/colored/embedded-color.svg +38 -38
  51. package/dist/icons/custom/colored/emo-clap-color.svg +252 -252
  52. package/dist/icons/custom/colored/emo-good-color.svg +68 -68
  53. package/dist/icons/custom/colored/emo-great-color.svg +67 -67
  54. package/dist/icons/custom/colored/emo-heart-color.svg +239 -239
  55. package/dist/icons/custom/colored/emo-hundred-color.svg +194 -194
  56. package/dist/icons/custom/colored/emo-neutral-color.svg +76 -76
  57. package/dist/icons/custom/colored/emo-stars-color.svg +121 -121
  58. package/dist/icons/custom/colored/emo-thumbup-color.svg +238 -238
  59. package/dist/icons/custom/colored/empty.svg +1 -1
  60. package/dist/icons/custom/colored/entry-color.svg +4 -4
  61. package/dist/icons/custom/colored/filename-all-color.svg +4 -4
  62. package/dist/icons/custom/colored/filename-doc-color.svg +5 -5
  63. package/dist/icons/custom/colored/filename-hwp-color.svg +6 -6
  64. package/dist/icons/custom/colored/filename-img-color.svg +6 -6
  65. package/dist/icons/custom/colored/filename-mp4-color.svg +5 -5
  66. package/dist/icons/custom/colored/filename-pdf-color.svg +12 -12
  67. package/dist/icons/custom/colored/filename-ppt-color.svg +6 -6
  68. package/dist/icons/custom/colored/filename-xls-color.svg +5 -5
  69. package/dist/icons/custom/colored/filename-zip-color.svg +5 -5
  70. package/dist/icons/custom/colored/google.svg +13 -13
  71. package/dist/icons/custom/colored/hand-fill.svg +4 -4
  72. package/dist/icons/custom/colored/judge-color.svg +6 -6
  73. package/dist/icons/custom/colored/makecode-color.svg +4 -4
  74. package/dist/icons/custom/colored/master.svg +12 -12
  75. package/dist/icons/custom/colored/material.svg +6 -6
  76. package/dist/icons/custom/colored/medal-bronze.svg +9 -9
  77. package/dist/icons/custom/colored/medal-gold.svg +9 -9
  78. package/dist/icons/custom/colored/medal-silver.svg +9 -9
  79. package/dist/icons/custom/colored/pro.svg +4 -4
  80. package/dist/icons/custom/colored/problem.svg +7 -7
  81. package/dist/icons/custom/colored/python-color.svg +4 -4
  82. package/dist/icons/custom/colored/quiz-color.svg +12 -12
  83. package/dist/icons/custom/colored/resource-color.svg +13 -13
  84. package/dist/icons/custom/colored/scratch-color.svg +6 -6
  85. package/dist/icons/custom/colored/type-helper.svg +9 -9
  86. package/dist/icons/custom/colored/whale.svg +7 -7
  87. package/dist/icons/custom/colored/worksheet-color.svg +5 -5
  88. package/dist/icons/custom/default/AiSocroom.js +1 -1
  89. package/dist/icons/custom/default/ai-quiz.svg +8 -8
  90. package/dist/icons/custom/default/ai-socroom.svg +1 -1
  91. package/dist/icons/custom/default/badge.svg +4 -4
  92. package/dist/icons/custom/default/board.svg +5 -5
  93. package/dist/icons/custom/default/cast-cloudy.svg +3 -3
  94. package/dist/icons/custom/default/cast-partly.svg +4 -4
  95. package/dist/icons/custom/default/cast-rainbow.svg +12 -12
  96. package/dist/icons/custom/default/cast-sunny.svg +3 -3
  97. package/dist/icons/custom/default/codap.svg +11 -11
  98. package/dist/icons/custom/default/ebook.svg +3 -3
  99. package/dist/icons/custom/default/embedded.svg +4 -4
  100. package/dist/icons/custom/default/emo-clap.svg +6 -6
  101. package/dist/icons/custom/default/emo-good.svg +12 -12
  102. package/dist/icons/custom/default/emo-great.svg +12 -12
  103. package/dist/icons/custom/default/emo-heart.svg +5 -5
  104. package/dist/icons/custom/default/emo-hundred.svg +3 -3
  105. package/dist/icons/custom/default/emo-neutral.svg +14 -14
  106. package/dist/icons/custom/default/emo-stars.svg +14 -14
  107. package/dist/icons/custom/default/emo-thumbup.svg +3 -3
  108. package/dist/icons/custom/default/entry.svg +4 -4
  109. package/dist/icons/custom/default/fab.svg +10 -10
  110. package/dist/icons/custom/default/grant-alt.svg +5 -5
  111. package/dist/icons/custom/default/grant.svg +4 -4
  112. package/dist/icons/custom/default/hand-line.svg +3 -3
  113. package/dist/icons/custom/default/judge.svg +3 -3
  114. package/dist/icons/custom/default/makecode.svg +5 -5
  115. package/dist/icons/custom/default/pdf.svg +3 -3
  116. package/dist/icons/custom/default/python.svg +7 -7
  117. package/dist/icons/custom/default/quiz.svg +4 -4
  118. package/dist/icons/custom/default/resource.svg +11 -11
  119. package/dist/icons/custom/default/scratch.svg +3 -3
  120. package/dist/icons/custom/default/scroll-alt.svg +5 -5
  121. package/dist/icons/custom/default/scroll-fill.svg +4 -4
  122. package/dist/icons/custom/default/scroll-line.svg +5 -5
  123. package/dist/icons/custom/default/symbol.svg +4 -4
  124. package/dist/icons/custom/default/worksheet.svg +4 -4
  125. package/dist/icons/custom/svgrColoredTemplate.js +26 -26
  126. package/dist/icons/custom/svgrDefaultTemplate.js +26 -26
  127. package/dist/patterns/Accordion.js +20 -20
  128. package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +60 -60
  129. package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +27 -27
  130. package/dist/patterns/Dropdown/DropdownMenu/style.js +19 -19
  131. package/dist/patterns/LexicalEditor/Plugins.js +36 -36
  132. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +23 -23
  133. package/dist/patterns/LexicalEditor/components/InsertImageDialog/ImagePreview.js +4 -4
  134. package/dist/patterns/LexicalEditor/components/InsertImageDialog/InsertImageDialog.js +15 -15
  135. package/dist/patterns/LexicalEditor/components/InsertVideoDialog/InsertVideoDialog.js +17 -17
  136. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -2
  137. package/dist/patterns/LexicalEditor/hr.svg +3 -3
  138. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -44
  139. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +25 -25
  140. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +8 -8
  141. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageResizer.js +60 -60
  142. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +19 -19
  143. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.js +49 -49
  144. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSolution.js +7 -7
  145. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +73 -73
  146. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +5 -5
  147. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.js +7 -7
  148. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxComponent.js +69 -69
  149. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxEdit.js +3 -3
  150. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -15
  151. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +28 -28
  152. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/FormSelection.js +54 -54
  153. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +61 -61
  154. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.js +75 -75
  155. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +17 -17
  156. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +7 -7
  157. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +28 -28
  158. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +52 -52
  159. package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +7 -7
  160. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +25 -25
  161. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +53 -53
  162. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxComponent.js +54 -54
  163. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxView.js +5 -5
  164. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +21 -21
  165. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormSelection.js +42 -42
  166. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +71 -71
  167. package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoComponent.js +6 -6
  168. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdder.js +51 -51
  169. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +13 -17
  170. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/menu.svg +7 -7
  171. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/plus.svg +2 -2
  172. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.d.ts +1 -5
  173. package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +47 -306
  174. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuItem.js +32 -32
  175. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuList.js +32 -32
  176. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +75 -105
  177. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/componentPickerOptionUtils.d.ts +24 -0
  178. package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/componentPickerOptionUtils.js +221 -0
  179. package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +49 -49
  180. package/dist/patterns/LexicalEditor/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatPopup.js +36 -36
  181. package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +7 -7
  182. package/dist/patterns/LexicalEditor/theme.js +243 -243
  183. package/dist/patterns/SegmentedControl/SegmentedControlButton.js +10 -10
  184. package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +8 -8
  185. package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +2 -2
  186. package/dist/patterns/Tabs.js +43 -43
  187. package/dist/patterns/ToggleButtonGroup/ToggleButton.js +40 -40
  188. package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.js +11 -11
  189. package/dist/utils/hover.js +12 -12
  190. package/dist/utils/reset.js +19 -19
  191. package/dist/utils/types.d.ts +1 -0
  192. package/dist/utils/types.js +3 -0
  193. package/dist/utils/visuallyHidden.js +10 -10
  194. package/package.json +109 -109
@@ -1,81 +1,57 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  /**
3
2
  * Context Menu (:: 버튼)
4
3
  */
5
4
  import { $createParagraphNode, ParagraphNode, } from "lexical";
6
- import { ComponentPickerOption, getBaseOptions, } from "../ComponentPickerMenuPlugin";
7
5
  import { $createHeadingNode, $createQuoteNode, HeadingNode, } from "@lexical/rich-text";
8
6
  import { $setBlocksType } from "@lexical/selection";
9
7
  import { ListItemNode, ListNode, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, } from "@lexical/list";
10
8
  import { $createCodeNode } from "@lexical/code";
11
- import { H1Icon, H2Icon, H3Icon, CloseFillIcon, ListUnorderedIcon, ListOrderedIcon, InputMethodLineIcon, CodeViewIcon, DoubleQuotesLIcon, TextIcon, } from "../../../../icons";
12
9
  import { $isColoredQuoteNode, } from "../../nodes/ColoredQuoteNode";
13
10
  import { useTheme } from "@emotion/react";
14
- import { css } from "@emotion/css";
15
- import { $isFileNode, $isImageNode, $isVideoNode, $isProblemInputNode, } from "../../nodes";
16
- import { $isProblemSelectNode, } from "../../nodes/ProblemSelectNode";
17
- import { $isSheetInputNode } from "../../nodes/SheetInputNode";
18
- import { $isSheetSelectNode, } from "../../nodes/SheetSelectNode";
19
- import { $isSelfEvaluationNode, } from "../../nodes/SelfEvaluationNode";
20
11
  import { useTranslation } from "react-i18next";
12
+ import { getComponentPickerOptions, getQuoteColorOptions, getRemoveBlockMenu, } from "../ComponentPickerMenuPlugin/componentPickerOptionUtils";
21
13
  function getParagraphContextMenuOptions(editor, node, t) {
22
14
  return [
23
- new ComponentPickerOption(t("본문", { context: "렉시컬 드롭다운 메뉴" }), {
24
- icon: _jsx(TextIcon, {}),
25
- // eslint-disable-next-line i18next/no-literal-string
26
- keywords: ["normal", "paragraph", "p", "text", "본문", "단락", "내용"],
15
+ getComponentPickerOptions({
16
+ key: "p",
27
17
  onSelect: () => editor.update(() => {
28
18
  const selection = node.selectStart();
29
19
  $setBlocksType(selection, () => $createParagraphNode());
30
20
  }),
31
- }),
21
+ }, t),
32
22
  ...[1, 2, 3].map((n) => {
33
- const titleMap = {
34
- 1: t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
35
- 2: t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
36
- 3: t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
37
- };
38
- const iconMap = {
39
- 1: _jsx(H1Icon, {}),
40
- 2: _jsx(H2Icon, {}),
41
- 3: _jsx(H3Icon, {}),
42
- };
43
- return new ComponentPickerOption(titleMap[n], {
44
- icon: iconMap[n],
45
- keywords: ["heading", "header", `h${n}`, titleMap[n]],
23
+ const headerKey = `h${n}`;
24
+ return getComponentPickerOptions({
25
+ key: headerKey,
46
26
  onSelect: () => editor.update(() => {
47
27
  const selection = node.selectStart();
48
- $setBlocksType(selection, () => $createHeadingNode(`h${n}`));
28
+ $setBlocksType(selection, () => $createHeadingNode(headerKey));
49
29
  }),
50
- });
30
+ }, t);
51
31
  }),
52
- new ComponentPickerOption(t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
53
- icon: _jsx(ListUnorderedIcon, {}),
54
- keywords: ["bulleted list", "unordered list", "ul"],
32
+ getComponentPickerOptions({
33
+ key: "ul",
55
34
  onSelect: () => {
56
35
  node.selectStart();
57
36
  editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
58
37
  },
59
- }),
60
- new ComponentPickerOption(t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
61
- icon: _jsx(ListOrderedIcon, {}),
62
- keywords: ["numbered list", "ordered list", "ol"],
38
+ }, t),
39
+ getComponentPickerOptions({
40
+ key: "ol",
63
41
  onSelect: () => {
64
42
  node.selectStart();
65
43
  editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
66
44
  },
67
- }),
68
- new ComponentPickerOption(t("인용 블록", { context: "렉시컬 드롭다운 메뉴" }), {
69
- icon: _jsx(DoubleQuotesLIcon, {}),
70
- keywords: ["block quote"],
45
+ }, t),
46
+ getComponentPickerOptions({
47
+ key: "quote",
71
48
  onSelect: () => editor.update(() => {
72
49
  const selection = node.selectStart();
73
50
  $setBlocksType(selection, () => $createQuoteNode());
74
51
  }),
75
- }),
76
- new ComponentPickerOption(t("코드 블록", { context: "렉시컬 드롭다운 메뉴" }), {
77
- icon: _jsx(CodeViewIcon, {}),
78
- keywords: ["javascript", "python", "js", "codeblock"],
52
+ }, t),
53
+ getComponentPickerOptions({
54
+ key: "code",
79
55
  onSelect: () => editor.update(() => {
80
56
  const selection = node.selectStart();
81
57
  if (selection.isCollapsed()) {
@@ -89,307 +65,72 @@ function getParagraphContextMenuOptions(editor, node, t) {
89
65
  selection.insertRawText(textContent);
90
66
  }
91
67
  }),
92
- }),
93
- new ComponentPickerOption(t("블록 삭제"), {
94
- icon: _jsx(CloseFillIcon, {}),
95
- keywords: [],
96
- onSelect: () => {
97
- editor.update(() => {
98
- node.remove();
99
- });
100
- },
101
- }),
68
+ }, t),
69
+ getRemoveBlockMenu(editor, node, t),
102
70
  ];
103
71
  }
104
72
  function getHeadingContextMenuOptions(editor, node, t) {
105
73
  return [
106
74
  ...[1, 2, 3].map((n) => {
107
- const titleMap = {
108
- 1: t("큰 제목", { context: "렉시컬 드롭다운 메뉴" }),
109
- 2: t("중간 제목", { context: "렉시컬 드롭다운 메뉴" }),
110
- 3: t("작은 제목", { context: "렉시컬 드롭다운 메뉴" }),
111
- };
112
- const iconMap = {
113
- 1: _jsx(H1Icon, {}),
114
- 2: _jsx(H2Icon, {}),
115
- 3: _jsx(H3Icon, {}),
116
- };
117
- return new ComponentPickerOption(titleMap[n], {
118
- icon: iconMap[n],
119
- keywords: ["heading", "header", `h${n}`, titleMap[n]],
75
+ const headerKey = `h${n}`;
76
+ return getComponentPickerOptions({
77
+ key: headerKey,
120
78
  onSelect: () => editor.update(() => {
121
79
  const selection = node.selectStart();
122
- $setBlocksType(selection, () => $createHeadingNode(`h${n}`));
80
+ $setBlocksType(selection, () => $createHeadingNode(headerKey));
123
81
  }),
124
- });
125
- }),
126
- new ComponentPickerOption(t("블록 삭제"), {
127
- icon: _jsx(CloseFillIcon, {}),
128
- keywords: [],
129
- onSelect: () => {
130
- editor.update(() => {
131
- node.remove();
132
- });
133
- },
82
+ }, t);
134
83
  }),
84
+ getRemoveBlockMenu(editor, node, t),
135
85
  ];
136
86
  }
137
- function getListContextMenuOptions(editor, theme, node, t) {
87
+ function getListContextMenuOptions(editor, node, t) {
138
88
  return [
139
- new ComponentPickerOption(t("일반 목록", { context: "렉시컬 드롭다운 메뉴" }), {
140
- icon: _jsx(ListUnorderedIcon, {}),
141
- keywords: ["bulleted list", "unordered list", "ul"],
89
+ getComponentPickerOptions({
90
+ key: "ul",
142
91
  onSelect: () => {
143
92
  node.selectStart();
144
93
  editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);
145
94
  },
146
- }),
147
- new ComponentPickerOption(t("숫자 목록", { context: "렉시컬 드롭다운 메뉴" }), {
148
- icon: _jsx(ListOrderedIcon, {}),
149
- keywords: ["numbered list", "ordered list", "ol"],
95
+ }, t),
96
+ getComponentPickerOptions({
97
+ key: "ol",
150
98
  onSelect: () => {
151
99
  node.selectStart();
152
100
  editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);
153
101
  },
154
- }),
155
- new ComponentPickerOption(t("블록 삭제"), {
156
- icon: _jsx(CloseFillIcon, {}),
157
- keywords: [],
158
- onSelect: () => {
159
- editor.update(() => {
160
- node.remove();
161
- });
162
- },
163
- }),
164
- ];
165
- }
166
- function getProblemInputContextMenuOptions(node, t) {
167
- return [
168
- new ComponentPickerOption(t("블록 삭제"), {
169
- icon: _jsx(CloseFillIcon, {}),
170
- keywords: [],
171
- onSelect: () => {
172
- node.remove();
173
- },
174
- }),
175
- ];
176
- }
177
- function getProblemSelectContextMenuOptions(node, t) {
178
- return [
179
- new ComponentPickerOption(t("블록 삭제"), {
180
- icon: _jsx(CloseFillIcon, {}),
181
- keywords: [],
182
- onSelect: () => {
183
- node.remove();
184
- },
185
- }),
186
- ];
187
- }
188
- function getSheetInputContextMenuOptions(node, t) {
189
- return [
190
- new ComponentPickerOption(t("블록 삭제"), {
191
- icon: _jsx(CloseFillIcon, {}),
192
- keywords: [],
193
- onSelect: () => {
194
- node.remove();
195
- },
196
- }),
197
- ];
198
- }
199
- function getSheetSelectContextMenuOptions(node, t) {
200
- return [
201
- new ComponentPickerOption(t("블록 삭제"), {
202
- icon: _jsx(CloseFillIcon, {}),
203
- keywords: [],
204
- onSelect: () => {
205
- node.remove();
206
- },
207
- }),
208
- ];
209
- }
210
- function getSelfEvaluationContextMenuOptions(node, t) {
211
- return [
212
- new ComponentPickerOption(t("블록 삭제"), {
213
- icon: _jsx(CloseFillIcon, {}),
214
- keywords: [],
215
- onSelect: () => {
216
- node.remove();
217
- },
218
- }),
219
- ];
220
- }
221
- function getImageContextMenuOptions(node, t) {
222
- return [
223
- new ComponentPickerOption(t("블록 삭제"), {
224
- icon: _jsx(CloseFillIcon, {}),
225
- keywords: [],
226
- onSelect: () => {
227
- node.remove();
228
- },
229
- }),
230
- ];
231
- }
232
- function getVideoContextMenuOptions(node, t) {
233
- return [
234
- new ComponentPickerOption(t("블록 삭제"), {
235
- icon: _jsx(CloseFillIcon, {}),
236
- keywords: [],
237
- onSelect: () => {
238
- node.remove();
239
- },
240
- }),
102
+ }, t),
103
+ getRemoveBlockMenu(editor, node, t),
241
104
  ];
242
105
  }
243
106
  function getColoredQuoteContextMenuOptions(editor, theme, node, t) {
244
107
  return [
245
- new ComponentPickerOption(t("회색"), {
246
- icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.marbleOnContainer })),
247
- iconContainerClassName: css `
248
- background: ${theme.color.container.marbleContainer};
249
- `,
250
- keywords: ["grey", "gray"],
251
- onSelect: () => {
252
- editor.update(() => {
253
- node.setColor("grey");
254
- });
255
- },
256
- }),
257
- new ComponentPickerOption(t("빨간색"), {
258
- icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.redOnContainer })),
259
- iconContainerClassName: css `
260
- background: ${theme.color.container.redContainer};
261
- `,
262
- keywords: ["red"],
263
- onSelect: () => {
264
- editor.update(() => {
265
- node.setColor("red");
266
- });
267
- },
268
- }),
269
- new ComponentPickerOption(t("노란색"), {
270
- icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.yellowOnContainer })),
271
- iconContainerClassName: css `
272
- background: ${theme.color.container.yellowContainer};
273
- `,
274
- keywords: ["yellow"],
275
- onSelect: () => {
276
- editor.update(() => {
277
- node.setColor("yellow");
278
- });
279
- },
280
- }),
281
- new ComponentPickerOption(t("파란색"), {
282
- icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.blueOnContainer })),
283
- iconContainerClassName: css `
284
- background: ${theme.color.container.blueContainer};
285
- `,
286
- keywords: ["blue"],
287
- onSelect: () => {
288
- editor.update(() => {
289
- node.setColor("blue");
290
- });
291
- },
292
- }),
293
- new ComponentPickerOption(t("초록색"), {
294
- icon: (_jsx(InputMethodLineIcon, { color: theme.color.container.greenOnContainer })),
295
- iconContainerClassName: css `
296
- background: ${theme.color.container.greenContainer};
297
- `,
298
- keywords: ["green"],
299
- onSelect: () => {
300
- editor.update(() => {
301
- node.setColor("green");
302
- });
303
- },
304
- }),
305
- new ComponentPickerOption(t("블록 삭제"), {
306
- icon: _jsx(CloseFillIcon, {}),
307
- keywords: [],
308
- onSelect: () => {
309
- editor.update(() => {
310
- node.remove();
311
- });
312
- },
313
- }),
314
- ];
315
- }
316
- function getUploadFileContextMenuOptions(editor, node, t) {
317
- return [
318
- new ComponentPickerOption(t("블록 삭제"), {
319
- icon: _jsx(CloseFillIcon, {}),
320
- keywords: [],
321
- onSelect: () => {
322
- editor.update(() => {
323
- node.remove();
324
- });
325
- },
326
- }),
108
+ getQuoteColorOptions(editor, node, "grey", t, theme),
109
+ getQuoteColorOptions(editor, node, "red", t, theme),
110
+ getQuoteColorOptions(editor, node, "yellow", t, theme),
111
+ getQuoteColorOptions(editor, node, "blue", t, theme),
112
+ getQuoteColorOptions(editor, node, "green", t, theme),
113
+ getRemoveBlockMenu(editor, node, t),
327
114
  ];
328
115
  }
329
- export function useContextMenuOptions(props) {
330
- const { isSheetEnabled, isQuizEnabled, showFileUpload } = props;
116
+ export function useContextMenuOptions() {
331
117
  const theme = useTheme();
332
118
  const { t } = useTranslation();
333
- return (editor, node, setImageOpen, setVideoOpen, setFileOpen) => {
334
- if ($isProblemInputNode(node)) {
335
- return getProblemInputContextMenuOptions(node, t);
336
- }
337
- else if ($isProblemSelectNode(node)) {
338
- return getProblemSelectContextMenuOptions(node, t);
339
- }
340
- else if ($isSheetInputNode(node)) {
341
- return getSheetInputContextMenuOptions(node, t);
342
- }
343
- else if ($isSheetSelectNode(node)) {
344
- return getSheetSelectContextMenuOptions(node, t);
345
- }
346
- else if ($isSelfEvaluationNode(node)) {
347
- return getSelfEvaluationContextMenuOptions(node, t);
348
- }
349
- else if ($isImageNode(node)) {
350
- return getImageContextMenuOptions(node, t);
351
- }
352
- else if ($isVideoNode(node)) {
353
- return getVideoContextMenuOptions(node, t);
354
- }
355
- else if (node instanceof ParagraphNode) {
119
+ return (editor, node) => {
120
+ if (node instanceof ParagraphNode) {
356
121
  return getParagraphContextMenuOptions(editor, node, t);
357
122
  }
358
123
  else if (node instanceof HeadingNode) {
359
124
  return getHeadingContextMenuOptions(editor, node, t);
360
125
  }
361
126
  else if (node instanceof ListNode || node instanceof ListItemNode) {
362
- return getListContextMenuOptions(editor, theme, node, t);
127
+ return getListContextMenuOptions(editor, node, t);
363
128
  }
364
129
  else if ($isColoredQuoteNode(node)) {
365
130
  return getColoredQuoteContextMenuOptions(editor, theme, node, t);
366
131
  }
367
- else if ($isFileNode(node)) {
368
- return getUploadFileContextMenuOptions(editor, node, t);
369
- }
370
132
  else {
371
- return [
372
- ...getBaseOptions({
373
- editor,
374
- theme,
375
- t,
376
- setImageOpen,
377
- setVideoOpen,
378
- isSheetEnabled,
379
- isQuizEnabled,
380
- setFileOpen,
381
- showFileUpload,
382
- }),
383
- new ComponentPickerOption(t("블록 삭제"), {
384
- icon: _jsx(CloseFillIcon, {}),
385
- keywords: [],
386
- onSelect: () => {
387
- editor.update(() => {
388
- node.remove();
389
- });
390
- },
391
- }),
392
- ];
133
+ return [getRemoveBlockMenu(editor, node, t)];
393
134
  }
394
135
  };
395
136
  }
@@ -4,38 +4,38 @@ export function ComponentPickerMenuItem(props) {
4
4
  const { index, isSelected, onClick, onMouseEnter, option } = props;
5
5
  return (_jsxs(ItemContainer, { tabIndex: -1, ref: option.setRefElement, role: "option", "aria-selected": isSelected, id: "typeahead-item-" + index, onMouseEnter: onMouseEnter, onClick: onClick, isSelected: isSelected, children: [_jsx(IconContainer, { className: option.iconContainerClassName, children: option.icon }), _jsx(Title, { children: option.title })] }, option.key));
6
6
  }
7
- const ItemContainer = styled.li `
8
- display: flex;
9
- padding: 3px 2px;
10
- align-items: center;
11
- gap: 10px;
12
- width: 100%;
13
- cursor: pointer;
14
-
15
- ${({ isSelected }) => isSelected && "background: #eee;"}
7
+ const ItemContainer = styled.li `
8
+ display: flex;
9
+ padding: 3px 2px;
10
+ align-items: center;
11
+ gap: 10px;
12
+ width: 100%;
13
+ cursor: pointer;
14
+
15
+ ${({ isSelected }) => isSelected && "background: #eee;"}
16
16
  `;
17
- const IconContainer = styled.div `
18
- display: flex;
19
- width: 26px;
20
- height: 26px;
21
- justify-content: center;
22
- align-items: center;
23
-
24
- border-radius: 5px;
25
-
26
- background: ${({ theme }) => theme.color.foreground.neutralAlt};
27
- box-shadow: 0px 0px 0px 1px rgba(201, 201, 204, 0.48);
28
-
29
- svg {
30
- width: 18px;
31
- height: 18px;
32
- }
17
+ const IconContainer = styled.div `
18
+ display: flex;
19
+ width: 26px;
20
+ height: 26px;
21
+ justify-content: center;
22
+ align-items: center;
23
+
24
+ border-radius: 5px;
25
+
26
+ background: ${({ theme }) => theme.color.foreground.neutralAlt};
27
+ box-shadow: 0px 0px 0px 1px rgba(201, 201, 204, 0.48);
28
+
29
+ svg {
30
+ width: 18px;
31
+ height: 18px;
32
+ }
33
33
  `;
34
- const Title = styled.span `
35
- color: ${({ theme }) => theme.color.foreground.neutralBase};
36
- font-family: ${({ theme }) => theme.fontFamily.ui};
37
- font-size: 14px;
38
- font-style: normal;
39
- font-weight: 500;
40
- line-height: 20px; /* 142.857% */
34
+ const Title = styled.span `
35
+ color: ${({ theme }) => theme.color.foreground.neutralBase};
36
+ font-family: ${({ theme }) => theme.fontFamily.ui};
37
+ font-size: 14px;
38
+ font-style: normal;
39
+ font-weight: 500;
40
+ line-height: 20px; /* 142.857% */
41
41
  `;
@@ -17,37 +17,37 @@ export function ComponentPickerMenuList(props) {
17
17
  }, option: option }, option.key));
18
18
  }) }) }));
19
19
  }
20
- const Container = styled.div `
21
- position: absolute;
22
-
23
- display: flex;
24
- width: 200px;
25
- padding: 4px;
26
- flex-direction: column;
27
- align-items: flex-start;
28
- gap: 5px;
29
-
30
- border-radius: 8px;
31
- border: 1px solid #e8e8eb;
32
- background: ${({ theme }) => theme.color.background.neutralBase};
33
- box-shadow: 0px 3px 15px -3px rgba(13, 20, 33, 0.13);
20
+ const Container = styled.div `
21
+ position: absolute;
22
+
23
+ display: flex;
24
+ width: 200px;
25
+ padding: 4px;
26
+ flex-direction: column;
27
+ align-items: flex-start;
28
+ gap: 5px;
29
+
30
+ border-radius: 8px;
31
+ border: 1px solid #e8e8eb;
32
+ background: ${({ theme }) => theme.color.background.neutralBase};
33
+ box-shadow: 0px 3px 15px -3px rgba(13, 20, 33, 0.13);
34
34
  `;
35
- const ListContainer = styled.ul `
36
- padding: 0;
37
- list-style: none;
38
- margin: 0;
39
-
40
- display: flex;
41
- flex-direction: column;
42
- align-items: flex-start;
43
- gap: 1px;
44
- align-self: stretch;
45
-
46
- overflow-y: scroll;
47
-
48
- scrollbar-width: none;
49
- -ms-overflow-style: none;
50
- &::-webkit-scrollbar {
51
- display: none;
52
- }
35
+ const ListContainer = styled.ul `
36
+ padding: 0;
37
+ list-style: none;
38
+ margin: 0;
39
+
40
+ display: flex;
41
+ flex-direction: column;
42
+ align-items: flex-start;
43
+ gap: 1px;
44
+ align-self: stretch;
45
+
46
+ overflow-y: scroll;
47
+
48
+ scrollbar-width: none;
49
+ -ms-overflow-style: none;
50
+ &::-webkit-scrollbar {
51
+ display: none;
52
+ }
53
53
  `;