@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.
- package/@types/emotion.d.ts +162 -162
- package/README.md +37 -37
- package/dist/CdsProvider.js +4 -4
- package/dist/components/AlertDialog/AlertDialog.js +54 -54
- package/dist/components/AlertDialog/AlertDialogActions.js +7 -7
- package/dist/components/AlertDialog/AlertDialogContent.js +8 -8
- package/dist/components/AlertDialog/AlertDialogTitle.js +34 -34
- package/dist/components/AnimatedButton.js +32 -32
- package/dist/components/Banner.js +51 -51
- package/dist/components/Book/Book.js +174 -174
- package/dist/components/Button.js +179 -179
- package/dist/components/CheckboxInput.js +148 -148
- package/dist/components/FileTypeAlertDialog.js +4 -4
- package/dist/components/Input.js +53 -53
- package/dist/components/InputBase.js +72 -72
- package/dist/components/Modal.js +4 -4
- package/dist/components/OverflowTooltip.js +4 -4
- package/dist/components/Pagination.js +56 -56
- package/dist/components/PinInput.js +64 -64
- package/dist/components/Popover.js +27 -27
- package/dist/components/RadioInput.js +73 -73
- package/dist/components/Slider.js +58 -58
- package/dist/components/SquareButton.js +109 -109
- package/dist/components/Switch.js +69 -69
- package/dist/components/SwitchButton.js +107 -107
- package/dist/components/Tag.js +72 -72
- package/dist/components/Tooltip.js +19 -19
- package/dist/foundation/breakpoints.js +16 -16
- package/dist/icons/custom/colored/AiSocroomColor.js +1 -1
- package/dist/icons/custom/colored/ai-helper.svg +4 -4
- package/dist/icons/custom/colored/ai-quiz-color.svg +20 -20
- package/dist/icons/custom/colored/ai-socroom-color.svg +15 -15
- package/dist/icons/custom/colored/badge-color.svg +4 -4
- package/dist/icons/custom/colored/badge-gold.svg +11 -11
- package/dist/icons/custom/colored/badge-green.svg +11 -11
- package/dist/icons/custom/colored/badge-silver.svg +11 -11
- package/dist/icons/custom/colored/basic-plus.svg +31 -31
- package/dist/icons/custom/colored/basic.svg +3 -3
- package/dist/icons/custom/colored/board-color.svg +5 -5
- package/dist/icons/custom/colored/cast-cloudy-color.svg +6 -6
- package/dist/icons/custom/colored/cast-partly-color.svg +7 -7
- package/dist/icons/custom/colored/cast-rainbow-color.svg +13 -13
- package/dist/icons/custom/colored/cast-sunny-color.svg +4 -4
- package/dist/icons/custom/colored/clap-bronze.svg +8 -8
- package/dist/icons/custom/colored/clap-gold.svg +8 -8
- package/dist/icons/custom/colored/clap-silver.svg +8 -8
- package/dist/icons/custom/colored/class.svg +13 -13
- package/dist/icons/custom/colored/codap-color.svg +13 -13
- package/dist/icons/custom/colored/ebook-color.svg +5 -5
- package/dist/icons/custom/colored/embedded-color.svg +38 -38
- package/dist/icons/custom/colored/emo-clap-color.svg +252 -252
- package/dist/icons/custom/colored/emo-good-color.svg +68 -68
- package/dist/icons/custom/colored/emo-great-color.svg +67 -67
- package/dist/icons/custom/colored/emo-heart-color.svg +239 -239
- package/dist/icons/custom/colored/emo-hundred-color.svg +194 -194
- package/dist/icons/custom/colored/emo-neutral-color.svg +76 -76
- package/dist/icons/custom/colored/emo-stars-color.svg +121 -121
- package/dist/icons/custom/colored/emo-thumbup-color.svg +238 -238
- package/dist/icons/custom/colored/empty.svg +1 -1
- package/dist/icons/custom/colored/entry-color.svg +4 -4
- package/dist/icons/custom/colored/filename-all-color.svg +4 -4
- package/dist/icons/custom/colored/filename-doc-color.svg +5 -5
- package/dist/icons/custom/colored/filename-hwp-color.svg +6 -6
- package/dist/icons/custom/colored/filename-img-color.svg +6 -6
- package/dist/icons/custom/colored/filename-mp4-color.svg +5 -5
- package/dist/icons/custom/colored/filename-pdf-color.svg +12 -12
- package/dist/icons/custom/colored/filename-ppt-color.svg +6 -6
- package/dist/icons/custom/colored/filename-xls-color.svg +5 -5
- package/dist/icons/custom/colored/filename-zip-color.svg +5 -5
- package/dist/icons/custom/colored/google.svg +13 -13
- package/dist/icons/custom/colored/hand-fill.svg +4 -4
- package/dist/icons/custom/colored/judge-color.svg +6 -6
- package/dist/icons/custom/colored/makecode-color.svg +4 -4
- package/dist/icons/custom/colored/master.svg +12 -12
- package/dist/icons/custom/colored/material.svg +6 -6
- package/dist/icons/custom/colored/medal-bronze.svg +9 -9
- package/dist/icons/custom/colored/medal-gold.svg +9 -9
- package/dist/icons/custom/colored/medal-silver.svg +9 -9
- package/dist/icons/custom/colored/pro.svg +4 -4
- package/dist/icons/custom/colored/problem.svg +7 -7
- package/dist/icons/custom/colored/python-color.svg +4 -4
- package/dist/icons/custom/colored/quiz-color.svg +12 -12
- package/dist/icons/custom/colored/resource-color.svg +13 -13
- package/dist/icons/custom/colored/scratch-color.svg +6 -6
- package/dist/icons/custom/colored/type-helper.svg +9 -9
- package/dist/icons/custom/colored/whale.svg +7 -7
- package/dist/icons/custom/colored/worksheet-color.svg +5 -5
- package/dist/icons/custom/default/AiSocroom.js +1 -1
- package/dist/icons/custom/default/ai-quiz.svg +8 -8
- package/dist/icons/custom/default/ai-socroom.svg +1 -1
- package/dist/icons/custom/default/badge.svg +4 -4
- package/dist/icons/custom/default/board.svg +5 -5
- package/dist/icons/custom/default/cast-cloudy.svg +3 -3
- package/dist/icons/custom/default/cast-partly.svg +4 -4
- package/dist/icons/custom/default/cast-rainbow.svg +12 -12
- package/dist/icons/custom/default/cast-sunny.svg +3 -3
- package/dist/icons/custom/default/codap.svg +11 -11
- package/dist/icons/custom/default/ebook.svg +3 -3
- package/dist/icons/custom/default/embedded.svg +4 -4
- package/dist/icons/custom/default/emo-clap.svg +6 -6
- package/dist/icons/custom/default/emo-good.svg +12 -12
- package/dist/icons/custom/default/emo-great.svg +12 -12
- package/dist/icons/custom/default/emo-heart.svg +5 -5
- package/dist/icons/custom/default/emo-hundred.svg +3 -3
- package/dist/icons/custom/default/emo-neutral.svg +14 -14
- package/dist/icons/custom/default/emo-stars.svg +14 -14
- package/dist/icons/custom/default/emo-thumbup.svg +3 -3
- package/dist/icons/custom/default/entry.svg +4 -4
- package/dist/icons/custom/default/fab.svg +10 -10
- package/dist/icons/custom/default/grant-alt.svg +5 -5
- package/dist/icons/custom/default/grant.svg +4 -4
- package/dist/icons/custom/default/hand-line.svg +3 -3
- package/dist/icons/custom/default/judge.svg +3 -3
- package/dist/icons/custom/default/makecode.svg +5 -5
- package/dist/icons/custom/default/pdf.svg +3 -3
- package/dist/icons/custom/default/python.svg +7 -7
- package/dist/icons/custom/default/quiz.svg +4 -4
- package/dist/icons/custom/default/resource.svg +11 -11
- package/dist/icons/custom/default/scratch.svg +3 -3
- package/dist/icons/custom/default/scroll-alt.svg +5 -5
- package/dist/icons/custom/default/scroll-fill.svg +4 -4
- package/dist/icons/custom/default/scroll-line.svg +5 -5
- package/dist/icons/custom/default/symbol.svg +4 -4
- package/dist/icons/custom/default/worksheet.svg +4 -4
- package/dist/icons/custom/svgrColoredTemplate.js +26 -26
- package/dist/icons/custom/svgrDefaultTemplate.js +26 -26
- package/dist/patterns/Accordion.js +20 -20
- package/dist/patterns/Dropdown/DropdownItem/DropdownItem.js +60 -60
- package/dist/patterns/Dropdown/DropdownMenu/DropdownMenu.js +27 -27
- package/dist/patterns/Dropdown/DropdownMenu/style.js +19 -19
- package/dist/patterns/LexicalEditor/Plugins.js +36 -36
- package/dist/patterns/LexicalEditor/components/FileSelectInput.js +23 -23
- package/dist/patterns/LexicalEditor/components/InsertImageDialog/ImagePreview.js +4 -4
- package/dist/patterns/LexicalEditor/components/InsertImageDialog/InsertImageDialog.js +15 -15
- package/dist/patterns/LexicalEditor/components/InsertVideoDialog/InsertVideoDialog.js +17 -17
- package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -2
- package/dist/patterns/LexicalEditor/hr.svg +3 -3
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -44
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +25 -25
- package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +8 -8
- package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageResizer.js +60 -60
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +19 -19
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SegmentedInput.js +49 -49
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/FormSolution.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/SettingForm.js +73 -73
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/SettingForm/TextTypeDropdown.js +5 -5
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/TextInput.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxComponent.js +69 -69
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxEdit.js +3 -3
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectBox/SelectBoxView.js +15 -15
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +28 -28
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/FormSelection.js +54 -54
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SettingForm/SettingForm.js +61 -61
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/Evaluation.js +75 -75
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormIconAndLabel.js +17 -17
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormIconAndLabel/FormLabel.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/FormQuestion.js +28 -28
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/Evaluation/SettingForm/SettingForm.js +52 -52
- package/dist/patterns/LexicalEditor/nodes/SelfEvaluationNode/EvaluationComponent/EvaluationComponent.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +25 -25
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/SettingForm.js +53 -53
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxComponent.js +54 -54
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectBox/SelectBoxView.js +5 -5
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +21 -21
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/FormSelection.js +42 -42
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SettingForm/SettingForm.js +71 -71
- package/dist/patterns/LexicalEditor/nodes/VideoNode/VideoComponent.js +6 -6
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdder.js +51 -51
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/ComponentAdderPlugin.js +13 -17
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/menu.svg +7 -7
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/plus.svg +2 -2
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.d.ts +1 -5
- package/dist/patterns/LexicalEditor/plugins/ComponentAdderPlugin/useContextMenuOptions.js +47 -306
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuItem.js +32 -32
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuList.js +32 -32
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuPlugin.js +75 -105
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/componentPickerOptionUtils.d.ts +24 -0
- package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/componentPickerOptionUtils.js +221 -0
- package/dist/patterns/LexicalEditor/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +49 -49
- package/dist/patterns/LexicalEditor/plugins/FloatingTextFormatToolbarPlugin/FloatingTextFormatPopup.js +36 -36
- package/dist/patterns/LexicalEditor/plugins/ParagraphPlaceholderPlugin/index.js +7 -7
- package/dist/patterns/LexicalEditor/theme.js +243 -243
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +10 -10
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +8 -8
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +2 -2
- package/dist/patterns/Tabs.js +43 -43
- package/dist/patterns/ToggleButtonGroup/ToggleButton.js +40 -40
- package/dist/patterns/ToggleButtonGroup/ToggleButtonGroup.js +11 -11
- package/dist/utils/hover.js +12 -12
- package/dist/utils/reset.js +19 -19
- package/dist/utils/types.d.ts +1 -0
- package/dist/utils/types.js +3 -0
- package/dist/utils/visuallyHidden.js +10 -10
- 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
|
-
|
|
24
|
-
|
|
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
|
|
34
|
-
|
|
35
|
-
|
|
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(
|
|
28
|
+
$setBlocksType(selection, () => $createHeadingNode(headerKey));
|
|
49
29
|
}),
|
|
50
|
-
});
|
|
30
|
+
}, t);
|
|
51
31
|
}),
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
61
|
-
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
|
108
|
-
|
|
109
|
-
|
|
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(
|
|
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,
|
|
87
|
+
function getListContextMenuOptions(editor, node, t) {
|
|
138
88
|
return [
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
148
|
-
|
|
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
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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(
|
|
330
|
-
const { isSheetEnabled, isQuizEnabled, showFileUpload } = props;
|
|
116
|
+
export function useContextMenuOptions() {
|
|
331
117
|
const theme = useTheme();
|
|
332
118
|
const { t } = useTranslation();
|
|
333
|
-
return (editor, node
|
|
334
|
-
if (
|
|
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,
|
|
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
|
}
|
package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuItem.js
CHANGED
|
@@ -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
|
`;
|
package/dist/patterns/LexicalEditor/plugins/ComponentPickerMenuPlugin/ComponentPickerMenuList.js
CHANGED
|
@@ -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
|
`;
|