@team-monolith/cds 1.129.2-alpha.2 → 1.130.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emotion.d.ts +185 -0
- package/dist/index.d.ts +8 -1
- package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.d.ts +1 -0
- package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.js +2 -1
- package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +4 -0
- package/dist/patterns/LexicalEditor/LexicalEditor.js +9 -7
- package/dist/patterns/LexicalEditor/Plugins.d.ts +1 -0
- package/dist/patterns/LexicalEditor/Plugins.js +65 -61
- package/dist/patterns/LexicalEditor/components/FileSelectInput.js +24 -23
- package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -1
- package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.d.ts +7 -0
- package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.js +53 -0
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.d.ts +0 -27
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -115
- package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.d.ts +27 -0
- package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.js +85 -0
- package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.d.ts +6 -0
- package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.js +91 -0
- package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +108 -102
- package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +7 -7
- package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +4 -4
- package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +4 -4
- package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +4 -4
- package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.d.ts +1 -0
- package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.js +106 -0
- package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.d.ts +8 -0
- package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.js +6 -0
- package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/index.d.ts +1 -0
- package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +15 -14
- package/dist/patterns/LexicalEditor/uploadConstants.d.ts +6 -0
- package/dist/patterns/LexicalEditor/uploadConstants.js +4 -0
- package/package.json +3 -7
- package/@types/emotion.d.ts +0 -197
- package/node_modules/react-i18next/.eslintrc.json +0 -74
- package/node_modules/react-i18next/.husky/pre-commit +0 -1
- package/node_modules/react-i18next/.prettierignore +0 -4
- package/node_modules/react-i18next/CHANGELOG.md +0 -1433
- package/node_modules/react-i18next/LICENSE +0 -22
- package/node_modules/react-i18next/README.md +0 -181
- package/node_modules/react-i18next/TransWithoutContext.d.mts +0 -1
- package/node_modules/react-i18next/TransWithoutContext.d.ts +0 -129
- package/node_modules/react-i18next/dist/amd/react-i18next.js +0 -867
- package/node_modules/react-i18next/dist/amd/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/dist/commonjs/I18nextProvider.js +0 -21
- package/node_modules/react-i18next/dist/commonjs/Trans.js +0 -54
- package/node_modules/react-i18next/dist/commonjs/TransWithoutContext.js +0 -330
- package/node_modules/react-i18next/dist/commonjs/Translation.js +0 -19
- package/node_modules/react-i18next/dist/commonjs/context.js +0 -81
- package/node_modules/react-i18next/dist/commonjs/defaults.js +0 -26
- package/node_modules/react-i18next/dist/commonjs/i18nInstance.js +0 -13
- package/node_modules/react-i18next/dist/commonjs/index.js +0 -128
- package/node_modules/react-i18next/dist/commonjs/initReactI18next.js +0 -15
- package/node_modules/react-i18next/dist/commonjs/unescape.js +0 -32
- package/node_modules/react-i18next/dist/commonjs/useSSR.js +0 -34
- package/node_modules/react-i18next/dist/commonjs/useTranslation.js +0 -114
- package/node_modules/react-i18next/dist/commonjs/utils.js +0 -76
- package/node_modules/react-i18next/dist/commonjs/withSSR.js +0 -27
- package/node_modules/react-i18next/dist/commonjs/withTranslation.js +0 -39
- package/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -15
- package/node_modules/react-i18next/dist/es/Trans.js +0 -43
- package/node_modules/react-i18next/dist/es/TransWithoutContext.js +0 -321
- package/node_modules/react-i18next/dist/es/Translation.js +0 -12
- package/node_modules/react-i18next/dist/es/context.js +0 -42
- package/node_modules/react-i18next/dist/es/defaults.js +0 -18
- package/node_modules/react-i18next/dist/es/i18nInstance.js +0 -5
- package/node_modules/react-i18next/dist/es/index.js +0 -18
- package/node_modules/react-i18next/dist/es/initReactI18next.js +0 -9
- package/node_modules/react-i18next/dist/es/package.json +0 -1
- package/node_modules/react-i18next/dist/es/unescape.js +0 -25
- package/node_modules/react-i18next/dist/es/useSSR.js +0 -27
- package/node_modules/react-i18next/dist/es/useTranslation.js +0 -107
- package/node_modules/react-i18next/dist/es/utils.js +0 -62
- package/node_modules/react-i18next/dist/es/withSSR.js +0 -20
- package/node_modules/react-i18next/dist/es/withTranslation.js +0 -32
- package/node_modules/react-i18next/dist/umd/react-i18next.js +0 -871
- package/node_modules/react-i18next/dist/umd/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/helpers.d.ts +0 -3
- package/node_modules/react-i18next/icu.macro.d.mts +0 -1
- package/node_modules/react-i18next/icu.macro.d.ts +0 -103
- package/node_modules/react-i18next/icu.macro.js +0 -729
- package/node_modules/react-i18next/index.d.mts +0 -1
- package/node_modules/react-i18next/index.d.ts +0 -209
- package/node_modules/react-i18next/initReactI18next.d.mts +0 -1
- package/node_modules/react-i18next/initReactI18next.d.ts +0 -3
- package/node_modules/react-i18next/lint-staged.config.mjs +0 -4
- package/node_modules/react-i18next/package.json +0 -167
- package/node_modules/react-i18next/react-i18next.js +0 -871
- package/node_modules/react-i18next/react-i18next.min.js +0 -1
- package/node_modules/react-i18next/src/I18nextProvider.js +0 -7
- package/node_modules/react-i18next/src/Trans.js +0 -45
- package/node_modules/react-i18next/src/TransWithoutContext.js +0 -479
- package/node_modules/react-i18next/src/Translation.js +0 -14
- package/node_modules/react-i18next/src/context.js +0 -54
- package/node_modules/react-i18next/src/defaults.js +0 -20
- package/node_modules/react-i18next/src/i18nInstance.js +0 -7
- package/node_modules/react-i18next/src/index.js +0 -22
- package/node_modules/react-i18next/src/initReactI18next.js +0 -11
- package/node_modules/react-i18next/src/unescape.js +0 -31
- package/node_modules/react-i18next/src/useSSR.js +0 -33
- package/node_modules/react-i18next/src/useTranslation.js +0 -171
- package/node_modules/react-i18next/src/utils.js +0 -93
- package/node_modules/react-i18next/src/withSSR.js +0 -21
- package/node_modules/react-i18next/src/withTranslation.js +0 -35
- package/node_modules/react-i18next/vitest.workspace.typescript.mts +0 -52
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
export interface CodleFontFamilies {
|
|
3
|
+
ui: string;
|
|
4
|
+
title: string;
|
|
5
|
+
code: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CodleColors {
|
|
8
|
+
background: {
|
|
9
|
+
neutralBase: string;
|
|
10
|
+
neutralBaseActive: string;
|
|
11
|
+
neutralBaseDisabled: string;
|
|
12
|
+
neutralAlt: string;
|
|
13
|
+
neutralAltActive: string;
|
|
14
|
+
neutralAltDisabled: string;
|
|
15
|
+
primary: string;
|
|
16
|
+
primaryActive: string;
|
|
17
|
+
primaryDisabled: string;
|
|
18
|
+
secondary: string;
|
|
19
|
+
secondaryActive: string;
|
|
20
|
+
secondaryDisabled: string;
|
|
21
|
+
danger: string;
|
|
22
|
+
dangerActive: string;
|
|
23
|
+
dangerDisabled: string;
|
|
24
|
+
success: string;
|
|
25
|
+
successActive: string;
|
|
26
|
+
successDisabled: string;
|
|
27
|
+
info: string;
|
|
28
|
+
infoActive: string;
|
|
29
|
+
infoDisabled: string;
|
|
30
|
+
warning: string;
|
|
31
|
+
warningActive: string;
|
|
32
|
+
warningDisabled: string;
|
|
33
|
+
inverse: string;
|
|
34
|
+
inverseActive: string;
|
|
35
|
+
inverseDisabled: string;
|
|
36
|
+
};
|
|
37
|
+
foreground: {
|
|
38
|
+
neutralBase: string;
|
|
39
|
+
neutralBaseActive: string;
|
|
40
|
+
neutralBaseDisabled: string;
|
|
41
|
+
neutralAlt: string;
|
|
42
|
+
neutralAltActive: string;
|
|
43
|
+
neutralAltDisabled: string;
|
|
44
|
+
primary: string;
|
|
45
|
+
primaryActive: string;
|
|
46
|
+
primaryDisabled: string;
|
|
47
|
+
secondary: string;
|
|
48
|
+
secondaryActive: string;
|
|
49
|
+
secondaryDisabled: string;
|
|
50
|
+
danger: string;
|
|
51
|
+
dangerActive: string;
|
|
52
|
+
dangerDisabled: string;
|
|
53
|
+
success: string;
|
|
54
|
+
successActive: string;
|
|
55
|
+
successDisabled: string;
|
|
56
|
+
info: string;
|
|
57
|
+
infoActive: string;
|
|
58
|
+
infoDisabled: string;
|
|
59
|
+
warning: string;
|
|
60
|
+
warningActive: string;
|
|
61
|
+
warningDisabled: string;
|
|
62
|
+
};
|
|
63
|
+
container: {
|
|
64
|
+
blueContainer: string;
|
|
65
|
+
blueOnContainer: string;
|
|
66
|
+
orangeContainer: string;
|
|
67
|
+
orangeOnContainer: string;
|
|
68
|
+
redContainer: string;
|
|
69
|
+
redOnContainer: string;
|
|
70
|
+
greenContainer: string;
|
|
71
|
+
greenOnContainer: string;
|
|
72
|
+
tealContainer: string;
|
|
73
|
+
tealOnContainer: string;
|
|
74
|
+
yellowContainer: string;
|
|
75
|
+
yellowOnContainer: string;
|
|
76
|
+
obsidianContainer: string;
|
|
77
|
+
obsidianOnContainer: string;
|
|
78
|
+
marbleContainer: string;
|
|
79
|
+
marbleOnContainer: string;
|
|
80
|
+
};
|
|
81
|
+
brand: {
|
|
82
|
+
brandOriginal: string;
|
|
83
|
+
brandAlt: string;
|
|
84
|
+
brandAccent: string;
|
|
85
|
+
brandFaded: string;
|
|
86
|
+
pdf: string;
|
|
87
|
+
pdfAlt: string;
|
|
88
|
+
quiz: string;
|
|
89
|
+
quizAlt: string;
|
|
90
|
+
python: string;
|
|
91
|
+
pythonAlt: string;
|
|
92
|
+
embedded: string;
|
|
93
|
+
embeddedAlt: string;
|
|
94
|
+
board: string;
|
|
95
|
+
boardAlt: string;
|
|
96
|
+
scratch: string;
|
|
97
|
+
scratchAlt: string;
|
|
98
|
+
entry: string;
|
|
99
|
+
entryAlt: string;
|
|
100
|
+
video: string;
|
|
101
|
+
videoAlt: string;
|
|
102
|
+
worksheet: string;
|
|
103
|
+
worksheetAlt: string;
|
|
104
|
+
ebook: string;
|
|
105
|
+
ebookAlt: string;
|
|
106
|
+
makecode: string;
|
|
107
|
+
makecodeAlt: string;
|
|
108
|
+
codap: string;
|
|
109
|
+
codapAlt: string;
|
|
110
|
+
aiQuiz: string;
|
|
111
|
+
aiQuizAlt: string;
|
|
112
|
+
aiSocroom: string;
|
|
113
|
+
aiSocroomAlt: string;
|
|
114
|
+
aiHtml: string;
|
|
115
|
+
aiHtmlAlt: string;
|
|
116
|
+
visang: string;
|
|
117
|
+
decorativeRed: string;
|
|
118
|
+
decorativePink: string;
|
|
119
|
+
decorativeAmber: string;
|
|
120
|
+
decorativeCoral: string;
|
|
121
|
+
decorativeGrass: string;
|
|
122
|
+
decorativeGreen: string;
|
|
123
|
+
decorativeBlue: string;
|
|
124
|
+
decorativeIndigo: string;
|
|
125
|
+
decorativePurple: string;
|
|
126
|
+
decorativeBrown: string;
|
|
127
|
+
decorativeCopper: string;
|
|
128
|
+
decorativeGold: string;
|
|
129
|
+
decorativeSilver: string;
|
|
130
|
+
decorativeGray: string;
|
|
131
|
+
decorativeBlack: string;
|
|
132
|
+
decorativeRedContainer: string;
|
|
133
|
+
decorativeRedOnContainer: string;
|
|
134
|
+
decorativeIndigoContainer: string;
|
|
135
|
+
decorativeIndigoOnContainer: string;
|
|
136
|
+
decorativeGreenContainer: string;
|
|
137
|
+
decorativeGreenOnContainer: string;
|
|
138
|
+
decorativePurpleContainer: string;
|
|
139
|
+
decorativePurpleOnContainer: string;
|
|
140
|
+
decorativeGoldContainer: string;
|
|
141
|
+
decorativeGoldOnContainer: string;
|
|
142
|
+
decorativeGrayContainer: string;
|
|
143
|
+
decorativeGrayOnContainer: string;
|
|
144
|
+
decorativeBlackContainer: string;
|
|
145
|
+
decorativeBlackOnContainer: string;
|
|
146
|
+
};
|
|
147
|
+
blanket: {
|
|
148
|
+
neutral: string;
|
|
149
|
+
neutralLight: string;
|
|
150
|
+
neutralHeavy: string;
|
|
151
|
+
inverse: string;
|
|
152
|
+
inverseLight: string;
|
|
153
|
+
inverseHeavy: string;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface CodleTypography {
|
|
157
|
+
heading1Regular: SerializedStyles;
|
|
158
|
+
heading1Bold: SerializedStyles;
|
|
159
|
+
heading2Regular: SerializedStyles;
|
|
160
|
+
heading2Bold: SerializedStyles;
|
|
161
|
+
heading3Regular: SerializedStyles;
|
|
162
|
+
heading3Bold: SerializedStyles;
|
|
163
|
+
heading4Regular: SerializedStyles;
|
|
164
|
+
heading4Bold: SerializedStyles;
|
|
165
|
+
heading5Regular: SerializedStyles;
|
|
166
|
+
heading5Bold: SerializedStyles;
|
|
167
|
+
heading6Regular: SerializedStyles;
|
|
168
|
+
heading6Bold: SerializedStyles;
|
|
169
|
+
body1Regular: SerializedStyles;
|
|
170
|
+
body1Medium: SerializedStyles;
|
|
171
|
+
body1SemiBold: SerializedStyles;
|
|
172
|
+
body1Bold: SerializedStyles;
|
|
173
|
+
body2Regular: SerializedStyles;
|
|
174
|
+
body2Medium: SerializedStyles;
|
|
175
|
+
body2SemiBold: SerializedStyles;
|
|
176
|
+
body2Bold: SerializedStyles;
|
|
177
|
+
body3Regular: SerializedStyles;
|
|
178
|
+
body3Medium: SerializedStyles;
|
|
179
|
+
body3SemiBold: SerializedStyles;
|
|
180
|
+
body3Bold: SerializedStyles;
|
|
181
|
+
captionRegular: SerializedStyles;
|
|
182
|
+
captionMedium: SerializedStyles;
|
|
183
|
+
captionSemiBold: SerializedStyles;
|
|
184
|
+
captionBold: SerializedStyles;
|
|
185
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { CodleColors, CodleFontFamilies, CodleTypography } from './emotion.ts';
|
|
2
|
+
declare module "@emotion/react" {
|
|
3
|
+
interface Theme {
|
|
4
|
+
color: CodleColors;
|
|
5
|
+
fontFamily: CodleFontFamilies;
|
|
6
|
+
typography: CodleTypography;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
2
9
|
export * from './components/AlertDialog';
|
|
3
10
|
export * from './components/Badge';
|
|
4
11
|
export * from './components/DecoratedNumber';
|
|
@@ -2,6 +2,7 @@ export type LexicalCustomConfig = {
|
|
|
2
2
|
freezeProblemNode: boolean;
|
|
3
3
|
showQuizSolution: boolean;
|
|
4
4
|
showFileUpload: boolean;
|
|
5
|
+
compactEditorMode: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const LexicalCustomConfigContext: import('react').Context<LexicalCustomConfig>;
|
|
7
8
|
export { LexicalCustomConfigContext };
|
|
@@ -21,6 +21,10 @@ export interface LexicalEditorProps {
|
|
|
21
21
|
showFileUpload?: boolean;
|
|
22
22
|
/** 에디터가 마운트될 때 자동으로 포커스를 설정할지 여부. true가 디폴트입니다. */
|
|
23
23
|
autoFocus?: boolean;
|
|
24
|
+
/** 게시글 단순 작성 모드. true면 슬래시/블록핸들/드래그앤드롭을 끄고, ContentEditable 위에
|
|
25
|
+
* 업로드 그리드 툴바를 노출하며, 전용 compact 노드(이미지/파일)만 삽입한다.
|
|
26
|
+
* false가 디폴트이며 다른 사용처는 기존 풀 기능 에디터로 동작한다. */
|
|
27
|
+
compactEditorMode?: boolean;
|
|
24
28
|
/** 외부에서 플러그인을 주입하는 경우 활용함 */
|
|
25
29
|
children?: JSX.Element | string | (JSX.Element | string)[];
|
|
26
30
|
}
|
|
@@ -21,33 +21,35 @@ function f(e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
23
|
function p(l) {
|
|
24
|
-
let { className: f, contentEditableClassName: p, value: m, onChange: h, editable: g = !0, showQuizSolution: _ = !1, freezeProblemNode: v = !1, isSheetEnabled: y = !1, isQuizEnabled: b = !1, showFileUpload: x = !1, autoFocus: S = !0,
|
|
24
|
+
let { className: f, contentEditableClassName: p, value: m, onChange: h, editable: g = !0, showQuizSolution: _ = !1, freezeProblemNode: v = !1, isSheetEnabled: y = !1, isQuizEnabled: b = !1, showFileUpload: x = !1, autoFocus: S = !0, compactEditorMode: C = !1, children: w } = l, T = {
|
|
25
25
|
namespace: "CustomLexicalEditor",
|
|
26
26
|
onError: (e) => console.error(e),
|
|
27
27
|
nodes: n,
|
|
28
28
|
theme: e(i(), g),
|
|
29
29
|
editorState: m && u(m) ? JSON.stringify(m) : void 0,
|
|
30
30
|
editable: g
|
|
31
|
-
},
|
|
31
|
+
}, E = h ? (e) => {
|
|
32
32
|
d(m, e) || h(e);
|
|
33
33
|
} : void 0;
|
|
34
34
|
return /* @__PURE__ */ o(t.Provider, {
|
|
35
35
|
value: {
|
|
36
36
|
freezeProblemNode: v,
|
|
37
37
|
showQuizSolution: _,
|
|
38
|
-
showFileUpload: x
|
|
38
|
+
showFileUpload: x,
|
|
39
|
+
compactEditorMode: C
|
|
39
40
|
},
|
|
40
41
|
children: /* @__PURE__ */ s(c, {
|
|
41
|
-
initialConfig:
|
|
42
|
+
initialConfig: T,
|
|
42
43
|
children: [/* @__PURE__ */ o(r, {
|
|
43
44
|
className: f,
|
|
44
45
|
contentEditableClassName: p,
|
|
45
|
-
onChange:
|
|
46
|
+
onChange: E,
|
|
46
47
|
isSheetEnabled: y,
|
|
47
48
|
isQuizEnabled: b,
|
|
48
49
|
showFileUpload: x,
|
|
49
|
-
autoFocus: S
|
|
50
|
-
|
|
50
|
+
autoFocus: S,
|
|
51
|
+
compactEditorMode: C
|
|
52
|
+
}), /* @__PURE__ */ o(a, { children: w })]
|
|
51
53
|
})
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -17,18 +17,19 @@ import { ListMaxIndentLevelPlugin as h } from "./plugins/ListMaxIndentLevelPlugi
|
|
|
17
17
|
import { DragDropPastePlugin as g } from "./plugins/DragDropPastePlugin/index.js";
|
|
18
18
|
import { ParagraphPlaceholderPlugin as _ } from "./plugins/ParagraphPlaceholderPlugin/index.js";
|
|
19
19
|
import { AutoLinkPlugin as v } from "./plugins/AutoLinkPlugin/index.js";
|
|
20
|
-
import {
|
|
21
|
-
import b from "
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
20
|
+
import { CompactToolbarPlugin as y } from "./plugins/CompactToolbarPlugin/CompactToolbarPlugin.js";
|
|
21
|
+
import { useState as b } from "react";
|
|
22
|
+
import x from "@emotion/styled";
|
|
23
|
+
import { Fragment as S, jsx as C, jsxs as w } from "@emotion/react/jsx-runtime";
|
|
24
|
+
import { useTranslation as T } from "react-i18next";
|
|
25
|
+
import { RichTextPlugin as E } from "@lexical/react/LexicalRichTextPlugin";
|
|
26
|
+
import { ContentEditable as D } from "@lexical/react/LexicalContentEditable";
|
|
27
|
+
import { HistoryPlugin as O } from "@lexical/react/LexicalHistoryPlugin";
|
|
28
|
+
import { OnChangePlugin as k } from "@lexical/react/LexicalOnChangePlugin";
|
|
29
|
+
import { LexicalErrorBoundary as A } from "@lexical/react/LexicalErrorBoundary";
|
|
30
|
+
import { MarkdownShortcutPlugin as j } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
31
|
+
import { useLexicalEditable as M } from "@lexical/react/useLexicalEditable";
|
|
32
|
+
import { ListPlugin as ee } from "@lexical/react/LexicalListPlugin";
|
|
32
33
|
import { TabIndentationPlugin as N } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
33
34
|
import { HorizontalRulePlugin as P } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
34
35
|
import { AutoFocusPlugin as F } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
@@ -37,76 +38,78 @@ import { LinkPlugin as L } from "@lexical/react/LexicalLinkPlugin";
|
|
|
37
38
|
import { ClickableLinkPlugin as R } from "@lexical/react/LexicalClickableLinkPlugin";
|
|
38
39
|
//#region src/cds/patterns/LexicalEditor/Plugins.tsx
|
|
39
40
|
function z(p) {
|
|
40
|
-
let { className:
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
let { className: x, contentEditableClassName: D, onChange: z, isSheetEnabled: U, isQuizEnabled: W, showFileUpload: G, autoFocus: K, compactEditorMode: q } = p, { t: J } = T(), Y = M(), [X, Z] = b(null), [Q, $] = b(!1);
|
|
42
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
43
|
+
q && Y && /* @__PURE__ */ C(y, {}),
|
|
44
|
+
!q && /* @__PURE__ */ C(g, {}),
|
|
45
|
+
/* @__PURE__ */ C(E, {
|
|
46
|
+
contentEditable: /* @__PURE__ */ C(B, {
|
|
47
|
+
className: x,
|
|
48
|
+
children: /* @__PURE__ */ C(V, {
|
|
47
49
|
ref: (e) => {
|
|
48
|
-
e !== null &&
|
|
50
|
+
e !== null && Z(e);
|
|
49
51
|
},
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
-
className:
|
|
52
|
-
isEditable:
|
|
52
|
+
children: /* @__PURE__ */ C(H, {
|
|
53
|
+
className: D,
|
|
54
|
+
isEditable: Y,
|
|
55
|
+
compactEditorMode: q
|
|
53
56
|
})
|
|
54
57
|
})
|
|
55
58
|
}),
|
|
56
59
|
placeholder: null,
|
|
57
|
-
ErrorBoundary:
|
|
60
|
+
ErrorBoundary: A
|
|
58
61
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ C(k, {
|
|
60
63
|
onChange: (e) => {
|
|
61
64
|
z?.(e.toJSON());
|
|
62
65
|
},
|
|
63
66
|
ignoreSelectionChange: !0
|
|
64
67
|
}),
|
|
65
|
-
K && /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
K && /* @__PURE__ */ C(F, {}),
|
|
69
|
+
Y && /* @__PURE__ */ w(S, { children: [
|
|
70
|
+
/* @__PURE__ */ C(N, {}),
|
|
71
|
+
!q && /* @__PURE__ */ C(u, {
|
|
69
72
|
isSheetEnabled: U,
|
|
70
73
|
isQuizEnabled: W,
|
|
71
74
|
showFileUpload: G
|
|
72
75
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ C(j, { transformers: e }),
|
|
77
|
+
/* @__PURE__ */ C(O, {}),
|
|
78
|
+
/* @__PURE__ */ C(_, { placeholder: J(q ? "내용을 입력하세요." : "명령어 사용 시에는 '/'를 누르세요. 블록에 마우스를 올려 나타나는 '+'를 클릭하면 아래에 블록을 추가할 수 있습니다.") })
|
|
76
79
|
] }),
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
anchorElem:
|
|
80
|
+
X && Y && /* @__PURE__ */ w(S, { children: [
|
|
81
|
+
!q && /* @__PURE__ */ C(d, {
|
|
82
|
+
anchorElem: X,
|
|
80
83
|
isSheetEnabled: U,
|
|
81
84
|
isQuizEnabled: W,
|
|
82
85
|
showFileUpload: G
|
|
83
86
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
anchorElem:
|
|
87
|
-
isLinkEditMode:
|
|
88
|
-
setIsLinkEditMode:
|
|
87
|
+
/* @__PURE__ */ C(f, { anchorElem: X }),
|
|
88
|
+
/* @__PURE__ */ C(m, {
|
|
89
|
+
anchorElem: X,
|
|
90
|
+
isLinkEditMode: Q,
|
|
91
|
+
setIsLinkEditMode: $
|
|
89
92
|
})
|
|
90
93
|
] }),
|
|
91
|
-
!
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
94
|
+
!Y && /* @__PURE__ */ C(R, {}),
|
|
95
|
+
/* @__PURE__ */ C(ee, {}),
|
|
96
|
+
/* @__PURE__ */ C(P, {}),
|
|
97
|
+
/* @__PURE__ */ C(s, {}),
|
|
98
|
+
/* @__PURE__ */ C(c, {}),
|
|
99
|
+
/* @__PURE__ */ C(l, {}),
|
|
100
|
+
/* @__PURE__ */ C(I, {}),
|
|
101
|
+
/* @__PURE__ */ C(L, {}),
|
|
102
|
+
/* @__PURE__ */ C(h, { maxDepth: 5 }),
|
|
103
|
+
/* @__PURE__ */ C(t, {}),
|
|
104
|
+
/* @__PURE__ */ C(n, {}),
|
|
105
|
+
/* @__PURE__ */ C(r, {}),
|
|
106
|
+
/* @__PURE__ */ C(i, {}),
|
|
107
|
+
/* @__PURE__ */ C(a, {}),
|
|
108
|
+
/* @__PURE__ */ C(o, {}),
|
|
109
|
+
/* @__PURE__ */ C(v, {})
|
|
107
110
|
] });
|
|
108
111
|
}
|
|
109
|
-
var B =
|
|
112
|
+
var B = x.div`
|
|
110
113
|
min-height: 150px;
|
|
111
114
|
border: 0;
|
|
112
115
|
display: flex;
|
|
@@ -114,18 +117,19 @@ var B = b.div`
|
|
|
114
117
|
outline: 0;
|
|
115
118
|
z-index: 0;
|
|
116
119
|
overflow: auto;
|
|
117
|
-
`, V =
|
|
120
|
+
`, V = x.div`
|
|
118
121
|
flex: auto;
|
|
119
122
|
position: relative;
|
|
120
123
|
z-index: -1;
|
|
121
|
-
`, H =
|
|
124
|
+
`, H = x(D, { shouldForwardProp: (e) => e !== "isEditable" && e !== "compactEditorMode" })`
|
|
122
125
|
border: 0;
|
|
123
126
|
font-size: 15px;
|
|
124
127
|
display: block;
|
|
125
128
|
position: relative;
|
|
126
129
|
outline: 0;
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
padding-left: 16px;
|
|
131
|
+
// ComponentAdder 를 위한 공간. compact 모드는 Adder가 없으므로 들여쓰지 않는다.
|
|
132
|
+
${({ isEditable: e, compactEditorMode: t }) => e && !t && "padding-left: 64px;"}
|
|
129
133
|
// ScrollArea에서 스크롤이 발생해도 64px 더 아래로 내릴 수 있도록 합니다.
|
|
130
134
|
padding-bottom: 64px;
|
|
131
135
|
min-height: 150px;
|
|
@@ -3,6 +3,7 @@ import { stdin_default as t } from "../../../node_modules/.pnpm/remixicon@4.3.0/
|
|
|
3
3
|
import { Button as n } from "../../../components/Button.js";
|
|
4
4
|
import { CdsContext as r } from "../../../CdsProvider.js";
|
|
5
5
|
import { getTexts as i } from "../../../texts.js";
|
|
6
|
+
import "../uploadConstants.js";
|
|
6
7
|
import { css as a, useTheme as o } from "@emotion/react";
|
|
7
8
|
import { useContext as s, useRef as c, useState as l } from "react";
|
|
8
9
|
import u from "@emotion/styled";
|
|
@@ -23,65 +24,65 @@ var g = (e, t) => ({
|
|
|
23
24
|
accept: "*",
|
|
24
25
|
errorStr: t("업로드할 수 없는 파일입니다. 모든 파일을 업로드해주세요.")
|
|
25
26
|
}
|
|
26
|
-
})[e]
|
|
27
|
-
function
|
|
28
|
-
let { onChange:
|
|
29
|
-
return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p(
|
|
27
|
+
})[e];
|
|
28
|
+
function _(u) {
|
|
29
|
+
let { onChange: _, fileType: S, onFileSubmit: C } = u, [w, T] = l(null), E = c(null), { t: D } = m(), { accept: O, errorStr: k } = g(S, D), A = s(r), j = o();
|
|
30
|
+
return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p(b, { children: [/* @__PURE__ */ f(n, {
|
|
30
31
|
fullWidth: !0,
|
|
31
32
|
color: "grey",
|
|
32
33
|
size: "medium",
|
|
33
|
-
label:
|
|
34
|
+
label: D("파일 선택하기"),
|
|
34
35
|
onClick: () => {
|
|
35
|
-
|
|
36
|
+
E.current?.click();
|
|
36
37
|
},
|
|
37
38
|
startIcon: /* @__PURE__ */ f(t, {})
|
|
38
|
-
}), /* @__PURE__ */ f(
|
|
39
|
+
}), /* @__PURE__ */ f(x, { children: w && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(e, { css: a`
|
|
39
40
|
padding: 0 4px;
|
|
40
41
|
width: 24px;
|
|
41
42
|
height: 24px;
|
|
42
|
-
color: ${
|
|
43
|
-
` }), /* @__PURE__ */ f(
|
|
44
|
-
ref:
|
|
43
|
+
color: ${j.color.background.danger};
|
|
44
|
+
` }), /* @__PURE__ */ f(y, { children: w })] }) })] }), /* @__PURE__ */ f(v, {
|
|
45
|
+
ref: E,
|
|
45
46
|
type: "file",
|
|
46
|
-
accept:
|
|
47
|
+
accept: O,
|
|
47
48
|
onChange: async (e) => {
|
|
48
49
|
let t = e.target.files?.[0];
|
|
49
50
|
if (!t) return;
|
|
50
|
-
if (t.size >=
|
|
51
|
-
|
|
51
|
+
if (t.size >= 1073741824) {
|
|
52
|
+
T(i(D, "errorFileTooLarge")), e.target.value = "";
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
if (
|
|
55
|
-
|
|
55
|
+
if (O && !(O === "*" || (O.startsWith(".") ? O.slice(1) === t.name.split(".").pop()?.toLowerCase() : new RegExp(O.replace("*", ".*")).test(t.type)))) {
|
|
56
|
+
T(k), e.target.value = "";
|
|
56
57
|
return;
|
|
57
58
|
}
|
|
58
|
-
let n =
|
|
59
|
+
let n = A.lexical?.uploadByFile;
|
|
59
60
|
if (n) {
|
|
60
61
|
let e = await n(t);
|
|
61
|
-
|
|
62
|
+
_(e), C?.({
|
|
62
63
|
url: e,
|
|
63
64
|
name: t.name,
|
|
64
65
|
size: t.size,
|
|
65
66
|
uploadDate: h().format("YYYY.MM.DD HH:mm:ss")
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
T(null);
|
|
69
70
|
}
|
|
70
71
|
})] });
|
|
71
72
|
}
|
|
72
|
-
var
|
|
73
|
+
var v = u.input`
|
|
73
74
|
display: none;
|
|
74
|
-
`,
|
|
75
|
+
`, y = u.div(({ theme: e }) => a`
|
|
75
76
|
color: ${e.color.foreground.danger};
|
|
76
77
|
font-family: ${e.fontFamily.ui};
|
|
77
78
|
font-size: 14px;
|
|
78
79
|
font-weight: 400;
|
|
79
80
|
line-height: 20px;
|
|
80
|
-
`),
|
|
81
|
+
`), b = u.div`
|
|
81
82
|
display: flex;
|
|
82
83
|
flex-direction: column;
|
|
83
84
|
gap: 4px;
|
|
84
|
-
`,
|
|
85
|
+
`, x = u.div`
|
|
85
86
|
padding-left: 8px;
|
|
86
87
|
display: flex;
|
|
87
88
|
flex-direction: row;
|
|
@@ -89,4 +90,4 @@ var y = u.input`
|
|
|
89
90
|
gap: 4px;
|
|
90
91
|
`;
|
|
91
92
|
//#endregion
|
|
92
|
-
export {
|
|
93
|
+
export { _ as FileSelectInput };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CdsContext as e } from "../../../../CdsProvider.js";
|
|
2
2
|
import { getTexts as t } from "../../../../texts.js";
|
|
3
|
+
import "../../uploadConstants.js";
|
|
3
4
|
import { useContext as n, useEffect as r, useRef as i } from "react";
|
|
4
5
|
import a from "@emotion/styled";
|
|
5
6
|
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
@@ -20,7 +21,7 @@ function l({ open: a, onClose: l, onChange: d }) {
|
|
|
20
21
|
l();
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
|
-
if (r.size >=
|
|
24
|
+
if (r.size >= 1073741824) {
|
|
24
25
|
n?.("upload", t(m, "errorFileTooLarge")), e.target.value = "", l();
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { stdin_default as e } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/delete-bin-line.js";
|
|
2
|
+
import { OverflowTooltip as t } from "../../../../components/OverflowTooltip.js";
|
|
3
|
+
import { FileDetailContainer as n, FileInfo as r, FileName as i, FileOptionalInfo as a, FileSize as o, IconContainer as s, getFileIcon as c } from "./fileStyles.js";
|
|
4
|
+
import { css as l } from "@emotion/react";
|
|
5
|
+
import u from "@emotion/styled";
|
|
6
|
+
import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { useTranslation as p } from "react-i18next";
|
|
8
|
+
import { $getNodeByKey as m } from "lexical";
|
|
9
|
+
import { useLexicalComposerContext as h } from "@lexical/react/LexicalComposerContext";
|
|
10
|
+
//#region src/cds/patterns/LexicalEditor/nodes/FileNode/CompactFileView.tsx
|
|
11
|
+
function g({ fileName: r, fileSize: l, nodeKey: u, fileUploadDate: g }) {
|
|
12
|
+
let [y] = h(), { t: b } = p();
|
|
13
|
+
return /* @__PURE__ */ d(n, {
|
|
14
|
+
isSelected: !1,
|
|
15
|
+
children: /* @__PURE__ */ f(_, { children: [
|
|
16
|
+
/* @__PURE__ */ d(s, { children: c(r) }),
|
|
17
|
+
/* @__PURE__ */ d(i, { children: /* @__PURE__ */ d(t, { text: r }) }),
|
|
18
|
+
/* @__PURE__ */ d(a, { children: g }),
|
|
19
|
+
/* @__PURE__ */ f(o, { children: [(l / (1024 * 1024)).toFixed(1), " MB"] }),
|
|
20
|
+
/* @__PURE__ */ d(v, {
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: () => {
|
|
23
|
+
y.update(() => {
|
|
24
|
+
m(u)?.remove();
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
"aria-label": b("삭제", { context: "버튼, 게시글 본문 파일" }),
|
|
28
|
+
children: /* @__PURE__ */ d(e, {})
|
|
29
|
+
})
|
|
30
|
+
] })
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var _ = u(r)`
|
|
34
|
+
cursor: default;
|
|
35
|
+
`, v = u.button(({ theme: e }) => l`
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
width: 24px;
|
|
41
|
+
height: 24px;
|
|
42
|
+
padding: 0;
|
|
43
|
+
border: 0;
|
|
44
|
+
background: transparent;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
color: ${e.color.foreground.neutralBaseDisabled};
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
color: ${e.color.foreground.neutralBase};
|
|
50
|
+
}
|
|
51
|
+
`);
|
|
52
|
+
//#endregion
|
|
53
|
+
export { g as CompactFileView };
|