@lumir-company/editor 0.1.0

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/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # LumirEditor
2
+
3
+ ๐Ÿ–ผ๏ธ **์ด๋ฏธ์ง€ ์ „์šฉ** BlockNote ๊ธฐ๋ฐ˜ Rich Text ์—๋””ํ„ฐ
4
+
5
+ ## โœจ ํ•ต์‹ฌ ํŠน์ง•
6
+
7
+ - **์ด๋ฏธ์ง€ ์ „์šฉ**: ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ/๋“œ๋ž˜๊ทธ์•ค๋“œ๋กญ๋งŒ ์ง€์› (S3 ์—ฐ๋™ ๋˜๋Š” ์ปค์Šคํ…€ ์—…๋กœ๋”)
8
+ - **๋กœ๋”ฉ ์Šคํ”ผ๋„ˆ**: ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ์ค‘ ์ž๋™ ์Šคํ”ผ๋„ˆ ํ‘œ์‹œ
9
+ - **์• ๋‹ˆ๋ฉ”์ด์…˜ ์ตœ์ ํ™”**: ๊ธฐ๋ณธ ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋น„ํ™œ์„ฑํ™”๋กœ ์„ฑ๋Šฅ ํ–ฅ์ƒ
10
+ - **TypeScript**: ์™„์ „ํ•œ ํƒ€์ž… ์•ˆ์ „์„ฑ
11
+ - **๊ฒฝ๋Ÿ‰ํ™”**: ๋น„๋””์˜ค/์˜ค๋””์˜ค/ํŒŒ์ผ ์—…๋กœ๋“œ ๊ธฐ๋Šฅ ์ œ๊ฑฐ
12
+
13
+ ## ๐Ÿ“ฆ ์„ค์น˜
14
+
15
+ ```bash
16
+ npm install @lumir-company/editor
17
+ ```
18
+
19
+ ## ๐Ÿš€ ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•
20
+
21
+ ### 1. CSS ์ž„ํฌํŠธ (ํ•„์ˆ˜)
22
+
23
+ ```tsx
24
+ import "@lumir-company/editor/style.css";
25
+ ```
26
+
27
+ ### 2. ๊ธฐ๋ณธ ์‚ฌ์šฉ
28
+
29
+ ```tsx
30
+ import { LumirEditor } from "@lumir-company/editor";
31
+ import "@lumir-company/editor/style.css";
32
+
33
+ export default function App() {
34
+ return (
35
+ <div className="w-full h-[400px]">
36
+ <LumirEditor onContentChange={(blocks) => console.log(blocks)} />
37
+ </div>
38
+ );
39
+ }
40
+ ```
41
+
42
+ ### 3. Next.js์—์„œ ์‚ฌ์šฉ (SSR ๋น„ํ™œ์„ฑํ™”)
43
+
44
+ ```tsx
45
+ "use client";
46
+ import dynamic from "next/dynamic";
47
+
48
+ const LumirEditor = dynamic(
49
+ () =>
50
+ import("@lumir-company/editor").then((m) => ({ default: m.LumirEditor })),
51
+ { ssr: false }
52
+ );
53
+
54
+ export default function Editor() {
55
+ return (
56
+ <div className="w-full h-[500px]">
57
+ <LumirEditor />
58
+ </div>
59
+ );
60
+ }
61
+ ```
62
+
63
+ ## ๐Ÿ“š ํ•ต์‹ฌ Props
64
+
65
+ | Prop | ํƒ€์ž… | ๊ธฐ๋ณธ๊ฐ’ | ์„ค๋ช… |
66
+ | ----------------- | ---------------------------------- | --------- | ---------------- |
67
+ | `initialContent` | `DefaultPartialBlock[] \| string` | - | ์ดˆ๊ธฐ ์ฝ˜ํ…์ธ  |
68
+ | `onContentChange` | `(blocks) => void` | - | ์ฝ˜ํ…์ธ  ๋ณ€๊ฒฝ ์ฝœ๋ฐฑ |
69
+ | `uploadFile` | `(file: File) => Promise<string>` | - | ์ปค์Šคํ…€ ์—…๋กœ๋” |
70
+ | `s3Upload` | `S3UploaderConfig` | - | S3 ์—…๋กœ๋“œ ์„ค์ • |
71
+ | `className` | `string` | `""` | CSS ํด๋ž˜์Šค |
72
+ | `theme` | `"light" \| "dark" \| ThemeObject` | `"light"` | ์—๋””ํ„ฐ ํ…Œ๋งˆ |
73
+ | `editable` | `boolean` | `true` | ํŽธ์ง‘ ๊ฐ€๋Šฅ ์—ฌ๋ถ€ |
74
+
75
+ ### S3 ์—…๋กœ๋“œ ์„ค์ •
76
+
77
+ ```tsx
78
+ interface S3UploaderConfig {
79
+ apiEndpoint: string; // '/api/s3/presigned' (ํ•„์ˆ˜)
80
+ env: "development" | "production"; // ํ™˜๊ฒฝ (ํ•„์ˆ˜)
81
+ path: string; // ํŒŒ์ผ ๊ฒฝ๋กœ (ํ•„์ˆ˜)
82
+ }
83
+ ```
84
+
85
+ ์ง€์› ์ด๋ฏธ์ง€ ํŒŒ์ผ
86
+ "image/png", // PNG
87
+ "image/jpeg", // JPEG/JPG
88
+ "image/jpg", // JPG
89
+ "image/gif", // GIF (์• ๋‹ˆ๋ฉ”์ด์…˜ ํฌํ•จ)
90
+ "image/webp", // WebP
91
+ "image/bmp", // BMP
92
+ "image/svg+xml", // SVG
93
+
94
+ ## ๐Ÿ–ผ๏ธ ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ๋ฐฉ์‹
95
+
96
+ ### 1. S3 ์—…๋กœ๋“œ (๊ถŒ์žฅ)
97
+
98
+ ```tsx
99
+ <LumirEditor
100
+ s3Upload={{
101
+ apiEndpoint: "/api/s3/presigned",
102
+ env: "development",
103
+ path: "depth1/depth2/depth3",
104
+ }}
105
+ onContentChange={(blocks) => console.log(blocks)}
106
+ />
107
+ ```
108
+
109
+ ### 2. ์ปค์Šคํ…€ ์—…๋กœ๋”
110
+
111
+ ```tsx
112
+ <LumirEditor
113
+ uploadFile={async (file) => {
114
+ const formData = new FormData();
115
+ formData.append("image", file);
116
+ const response = await fetch("/api/upload", {
117
+ method: "POST",
118
+ body: formData,
119
+ });
120
+ return (await response.json()).url;
121
+ }}
122
+ />
123
+ ```
124
+
125
+ ### 3. S3 Helper ํ•จ์ˆ˜ ์‚ฌ์šฉ
126
+
127
+ ```tsx
128
+ import { LumirEditor, createS3Uploader } from "@lumir-company/editor";
129
+
130
+ const s3Uploader = createS3Uploader({
131
+ apiEndpoint: "/api/s3/presigned",
132
+ env: "production",
133
+ path: "images",
134
+ });
135
+
136
+ <LumirEditor uploadFile={s3Uploader} />;
137
+ ```
138
+
139
+ ## ๐Ÿ“– ์ฃผ์š” ํƒ€์ž…
140
+
141
+ ```tsx
142
+ import type {
143
+ LumirEditorProps,
144
+ DefaultPartialBlock,
145
+ S3UploaderConfig,
146
+ ContentUtils,
147
+ EditorConfig,
148
+ } from "@lumir-company/editor";
149
+
150
+ // ์ฝ˜ํ…์ธ  ๊ฒ€์ฆ
151
+ const isValidContent = ContentUtils.isValidJSONString(jsonString);
152
+ const blocks = ContentUtils.parseJSONContent(jsonString);
153
+
154
+ // ์—๋””ํ„ฐ ์„ค์ •
155
+ const tableConfig = EditorConfig.getDefaultTableConfig();
156
+ const headingConfig = EditorConfig.getDefaultHeadingConfig();
157
+ ```
158
+
159
+ ## ๐Ÿ’ก ์‚ฌ์šฉ ํŒ
160
+
161
+ ```tsx
162
+ // 1. ์ปจํ…Œ์ด๋„ˆ ํฌ๊ธฐ ์„ค์ •
163
+ <div className="h-[400px]">
164
+ <LumirEditor />
165
+ </div>
166
+
167
+ // 2. ์ฝ๊ธฐ ์ „์šฉ ๋ชจ๋“œ
168
+ <LumirEditor
169
+ editable={false}
170
+ initialContent={savedContent}
171
+ />
172
+
173
+ // 3. ํ…Œ๋งˆ ์ ์šฉ
174
+ <LumirEditor theme="dark" />
175
+
176
+ // 4. ๋ฐ˜์‘ํ˜• ๋””์ž์ธ
177
+ <div className="w-full h-64 md:h-96 lg:h-[500px]">
178
+ <LumirEditor className="h-full" />
179
+ </div>
180
+ ```
181
+
182
+ ## โš ๏ธ ์ค‘์š” ์‚ฌํ•ญ
183
+
184
+ 1. **CSS ์ž„ํฌํŠธ ํ•„์ˆ˜**: `import "@lumir-company/editor/style.css";`
185
+ 2. **Next.js SSR ๋น„ํ™œ์„ฑํ™”**: `dynamic`์œผ๋กœ ํด๋ผ์ด์–ธํŠธ ์‚ฌ์ด๋“œ ๋ Œ๋”๋ง๋งŒ ์‚ฌ์šฉ
186
+ 3. **์ด๋ฏธ์ง€๋งŒ ์ง€์›**: PNG, JPG, GIF, WebP, BMP, SVG (๋น„๋””์˜ค/์˜ค๋””์˜ค/ํŒŒ์ผ โŒ)
187
+ 4. **S3 ์„ค์ •**: ๊ณ„์ธต ๊ตฌ์กฐ `{env}/{path}/{filename}`
188
+
189
+ ## ๐Ÿ“„ ๋ผ์ด์„ ์Šค
190
+
191
+ MIT License
@@ -0,0 +1,140 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PartialBlock, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, BlockNoteEditor } from '@blocknote/core';
3
+ export { BlockNoteEditor, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
4
+
5
+ /**
6
+ * LumirEditor์—์„œ ์‚ฌ์šฉํ•˜๋Š” BlockNote ์—๋””ํ„ฐ ํƒ€์ž…
7
+ */
8
+ type EditorType = BlockNoteEditor<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
9
+ /**
10
+ * LumirEditor์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๋ณธ ๋ธ”๋ก ํƒ€์ž…
11
+ */
12
+ type DefaultPartialBlock = PartialBlock<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
13
+ /**
14
+ * LumirEditor ์ปดํฌ๋„ŒํŠธ์˜ Props ์ธํ„ฐํŽ˜์ด์Šค
15
+ */
16
+ interface LumirEditorProps {
17
+ initialContent?: DefaultPartialBlock[] | string;
18
+ initialEmptyBlocks?: number;
19
+ placeholder?: string;
20
+ uploadFile?: (file: File) => Promise<string>;
21
+ s3Upload?: {
22
+ apiEndpoint: string;
23
+ env: "development" | "production";
24
+ path: string;
25
+ };
26
+ allowVideoUpload?: boolean;
27
+ allowAudioUpload?: boolean;
28
+ allowFileUpload?: boolean;
29
+ tables?: {
30
+ splitCells?: boolean;
31
+ cellBackgroundColor?: boolean;
32
+ cellTextColor?: boolean;
33
+ headers?: boolean;
34
+ };
35
+ heading?: {
36
+ levels?: (1 | 2 | 3 | 4 | 5 | 6)[];
37
+ };
38
+ defaultStyles?: boolean;
39
+ disableExtensions?: string[];
40
+ tabBehavior?: "prefer-navigate-ui" | "prefer-indent";
41
+ trailingBlock?: boolean;
42
+ editable?: boolean;
43
+ theme?: "light" | "dark" | Partial<Record<string, unknown>> | {
44
+ light: Partial<Record<string, unknown>>;
45
+ dark: Partial<Record<string, unknown>>;
46
+ };
47
+ formattingToolbar?: boolean;
48
+ linkToolbar?: boolean;
49
+ sideMenu?: boolean;
50
+ emojiPicker?: boolean;
51
+ filePanel?: boolean;
52
+ tableHandles?: boolean;
53
+ onSelectionChange?: () => void;
54
+ className?: string;
55
+ sideMenuAddButton?: boolean;
56
+ onContentChange?: (content: DefaultPartialBlock[]) => void;
57
+ }
58
+
59
+ /**
60
+ * ์ฝ˜ํ…์ธ  ๊ด€๋ฆฌ ์œ ํ‹ธ๋ฆฌํ‹ฐ
61
+ * ๊ธฐ๋ณธ ๋ธ”๋ก ์ƒ์„ฑ ๋ฐ ์ฝ˜ํ…์ธ  ๊ฒ€์ฆ ๋กœ์ง์„ ๋‹ด๋‹น
62
+ */
63
+ declare class ContentUtils {
64
+ /**
65
+ * JSON ๋ฌธ์ž์—ด์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค
66
+ * @param jsonString ๊ฒ€์ฆํ•  JSON ๋ฌธ์ž์—ด
67
+ * @returns ์œ ํšจํ•œ JSON ๋ฌธ์ž์—ด์ธ์ง€ ์—ฌ๋ถ€
68
+ */
69
+ static isValidJSONString(jsonString: string): boolean;
70
+ /**
71
+ * JSON ๋ฌธ์ž์—ด์„ DefaultPartialBlock ๋ฐฐ์—ด๋กœ ํŒŒ์‹ฑํ•ฉ๋‹ˆ๋‹ค
72
+ * @param jsonString JSON ๋ฌธ์ž์—ด
73
+ * @returns ํŒŒ์‹ฑ๋œ ๋ธ”๋ก ๋ฐฐ์—ด ๋˜๋Š” null (ํŒŒ์‹ฑ ์‹คํŒจ ์‹œ)
74
+ */
75
+ static parseJSONContent(jsonString: string): DefaultPartialBlock[] | null;
76
+ /**
77
+ * ๊ธฐ๋ณธ paragraph ๋ธ”๋ก ์ƒ์„ฑ
78
+ * @returns ๊ธฐ๋ณธ ์„ค์ •์ด ์ ์šฉ๋œ DefaultPartialBlock
79
+ */
80
+ static createDefaultBlock(): DefaultPartialBlock;
81
+ /**
82
+ * ์ฝ˜ํ…์ธ  ์œ ํšจ์„ฑ ๊ฒ€์ฆ ๋ฐ ๊ธฐ๋ณธ๊ฐ’ ์„ค์ •
83
+ * @param content ์‚ฌ์šฉ์ž ์ œ๊ณต ์ฝ˜ํ…์ธ  (๊ฐ์ฒด ๋ฐฐ์—ด ๋˜๋Š” JSON ๋ฌธ์ž์—ด)
84
+ * @param emptyBlockCount ๋นˆ ๋ธ”๋ก ๊ฐœ์ˆ˜ (๊ธฐ๋ณธ๊ฐ’: 3)
85
+ * @returns ๊ฒ€์ฆ๋œ ์ฝ˜ํ…์ธ  ๋ฐฐ์—ด
86
+ */
87
+ static validateContent(content?: DefaultPartialBlock[] | string, emptyBlockCount?: number): DefaultPartialBlock[];
88
+ /**
89
+ * ๋นˆ ๋ธ”๋ก๋“ค์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค
90
+ * @param emptyBlockCount ์ƒ์„ฑํ•  ๋ธ”๋ก ๊ฐœ์ˆ˜
91
+ * @returns ์ƒ์„ฑ๋œ ๋นˆ ๋ธ”๋ก ๋ฐฐ์—ด
92
+ */
93
+ private static createEmptyBlocks;
94
+ }
95
+ /**
96
+ * ์—๋””ํ„ฐ ์„ค์ • ๊ด€๋ฆฌ ์œ ํ‹ธ๋ฆฌํ‹ฐ
97
+ * ๊ฐ์ข… ์„ค์ •์˜ ๊ธฐ๋ณธ๊ฐ’๊ณผ ๊ฒ€์ฆ ๋กœ์ง์„ ๋‹ด๋‹น
98
+ */
99
+ declare class EditorConfig {
100
+ /**
101
+ * ํ…Œ์ด๋ธ” ์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ
102
+ * @param userTables ์‚ฌ์šฉ์ž ํ…Œ์ด๋ธ” ์„ค์ •
103
+ * @returns ๊ธฐ๋ณธ๊ฐ’์ด ์ ์šฉ๋œ ํ…Œ์ด๋ธ” ์„ค์ •
104
+ */
105
+ static getDefaultTableConfig(userTables?: LumirEditorProps["tables"]): {
106
+ splitCells: boolean;
107
+ cellBackgroundColor: boolean;
108
+ cellTextColor: boolean;
109
+ headers: boolean;
110
+ };
111
+ /**
112
+ * ํ—ค๋”ฉ ์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ
113
+ * @param userHeading ์‚ฌ์šฉ์ž ํ—ค๋”ฉ ์„ค์ •
114
+ * @returns ๊ธฐ๋ณธ๊ฐ’์ด ์ ์šฉ๋œ ํ—ค๋”ฉ ์„ค์ •
115
+ */
116
+ static getDefaultHeadingConfig(userHeading?: LumirEditorProps["heading"]): {
117
+ levels?: (1 | 2 | 3 | 4 | 5 | 6)[];
118
+ };
119
+ /**
120
+ * ๋น„ํ™œ์„ฑํ™”ํ•  ํ™•์žฅ ๊ธฐ๋Šฅ ๋ชฉ๋ก ์ƒ์„ฑ
121
+ * @param userExtensions ์‚ฌ์šฉ์ž ์ •์˜ ๋น„ํ™œ์„ฑ ํ™•์žฅ
122
+ * @param allowVideo ๋น„๋””์˜ค ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
123
+ * @param allowAudio ์˜ค๋””์˜ค ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
124
+ * @param allowFile ์ผ๋ฐ˜ ํŒŒ์ผ ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
125
+ * @returns ๋น„ํ™œ์„ฑํ™”ํ•  ํ™•์žฅ ๊ธฐ๋Šฅ ๋ชฉ๋ก
126
+ */
127
+ static getDisabledExtensions(userExtensions?: string[], allowVideo?: boolean, allowAudio?: boolean, allowFile?: boolean): string[];
128
+ }
129
+ declare function LumirEditor({ initialContent, initialEmptyBlocks, uploadFile, s3Upload, tables, heading, defaultStyles, disableExtensions, tabBehavior, trailingBlock, allowVideoUpload, allowAudioUpload, allowFileUpload, editable, theme, formattingToolbar, linkToolbar, sideMenu, emojiPicker, filePanel, tableHandles, onSelectionChange, className, sideMenuAddButton, onContentChange, }: LumirEditorProps): react_jsx_runtime.JSX.Element;
130
+
131
+ declare function cn(...inputs: (string | undefined | null | false)[]): string;
132
+
133
+ interface S3UploaderConfig {
134
+ apiEndpoint: string;
135
+ env: "production" | "development";
136
+ path: string;
137
+ }
138
+ declare const createS3Uploader: (config: S3UploaderConfig) => (file: File) => Promise<string>;
139
+
140
+ export { ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, LumirEditor, type LumirEditorProps, type S3UploaderConfig, cn, createS3Uploader };
@@ -0,0 +1,140 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PartialBlock, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, BlockNoteEditor } from '@blocknote/core';
3
+ export { BlockNoteEditor, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, PartialBlock } from '@blocknote/core';
4
+
5
+ /**
6
+ * LumirEditor์—์„œ ์‚ฌ์šฉํ•˜๋Š” BlockNote ์—๋””ํ„ฐ ํƒ€์ž…
7
+ */
8
+ type EditorType = BlockNoteEditor<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
9
+ /**
10
+ * LumirEditor์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ๋ณธ ๋ธ”๋ก ํƒ€์ž…
11
+ */
12
+ type DefaultPartialBlock = PartialBlock<DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
13
+ /**
14
+ * LumirEditor ์ปดํฌ๋„ŒํŠธ์˜ Props ์ธํ„ฐํŽ˜์ด์Šค
15
+ */
16
+ interface LumirEditorProps {
17
+ initialContent?: DefaultPartialBlock[] | string;
18
+ initialEmptyBlocks?: number;
19
+ placeholder?: string;
20
+ uploadFile?: (file: File) => Promise<string>;
21
+ s3Upload?: {
22
+ apiEndpoint: string;
23
+ env: "development" | "production";
24
+ path: string;
25
+ };
26
+ allowVideoUpload?: boolean;
27
+ allowAudioUpload?: boolean;
28
+ allowFileUpload?: boolean;
29
+ tables?: {
30
+ splitCells?: boolean;
31
+ cellBackgroundColor?: boolean;
32
+ cellTextColor?: boolean;
33
+ headers?: boolean;
34
+ };
35
+ heading?: {
36
+ levels?: (1 | 2 | 3 | 4 | 5 | 6)[];
37
+ };
38
+ defaultStyles?: boolean;
39
+ disableExtensions?: string[];
40
+ tabBehavior?: "prefer-navigate-ui" | "prefer-indent";
41
+ trailingBlock?: boolean;
42
+ editable?: boolean;
43
+ theme?: "light" | "dark" | Partial<Record<string, unknown>> | {
44
+ light: Partial<Record<string, unknown>>;
45
+ dark: Partial<Record<string, unknown>>;
46
+ };
47
+ formattingToolbar?: boolean;
48
+ linkToolbar?: boolean;
49
+ sideMenu?: boolean;
50
+ emojiPicker?: boolean;
51
+ filePanel?: boolean;
52
+ tableHandles?: boolean;
53
+ onSelectionChange?: () => void;
54
+ className?: string;
55
+ sideMenuAddButton?: boolean;
56
+ onContentChange?: (content: DefaultPartialBlock[]) => void;
57
+ }
58
+
59
+ /**
60
+ * ์ฝ˜ํ…์ธ  ๊ด€๋ฆฌ ์œ ํ‹ธ๋ฆฌํ‹ฐ
61
+ * ๊ธฐ๋ณธ ๋ธ”๋ก ์ƒ์„ฑ ๋ฐ ์ฝ˜ํ…์ธ  ๊ฒ€์ฆ ๋กœ์ง์„ ๋‹ด๋‹น
62
+ */
63
+ declare class ContentUtils {
64
+ /**
65
+ * JSON ๋ฌธ์ž์—ด์˜ ์œ ํšจ์„ฑ์„ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค
66
+ * @param jsonString ๊ฒ€์ฆํ•  JSON ๋ฌธ์ž์—ด
67
+ * @returns ์œ ํšจํ•œ JSON ๋ฌธ์ž์—ด์ธ์ง€ ์—ฌ๋ถ€
68
+ */
69
+ static isValidJSONString(jsonString: string): boolean;
70
+ /**
71
+ * JSON ๋ฌธ์ž์—ด์„ DefaultPartialBlock ๋ฐฐ์—ด๋กœ ํŒŒ์‹ฑํ•ฉ๋‹ˆ๋‹ค
72
+ * @param jsonString JSON ๋ฌธ์ž์—ด
73
+ * @returns ํŒŒ์‹ฑ๋œ ๋ธ”๋ก ๋ฐฐ์—ด ๋˜๋Š” null (ํŒŒ์‹ฑ ์‹คํŒจ ์‹œ)
74
+ */
75
+ static parseJSONContent(jsonString: string): DefaultPartialBlock[] | null;
76
+ /**
77
+ * ๊ธฐ๋ณธ paragraph ๋ธ”๋ก ์ƒ์„ฑ
78
+ * @returns ๊ธฐ๋ณธ ์„ค์ •์ด ์ ์šฉ๋œ DefaultPartialBlock
79
+ */
80
+ static createDefaultBlock(): DefaultPartialBlock;
81
+ /**
82
+ * ์ฝ˜ํ…์ธ  ์œ ํšจ์„ฑ ๊ฒ€์ฆ ๋ฐ ๊ธฐ๋ณธ๊ฐ’ ์„ค์ •
83
+ * @param content ์‚ฌ์šฉ์ž ์ œ๊ณต ์ฝ˜ํ…์ธ  (๊ฐ์ฒด ๋ฐฐ์—ด ๋˜๋Š” JSON ๋ฌธ์ž์—ด)
84
+ * @param emptyBlockCount ๋นˆ ๋ธ”๋ก ๊ฐœ์ˆ˜ (๊ธฐ๋ณธ๊ฐ’: 3)
85
+ * @returns ๊ฒ€์ฆ๋œ ์ฝ˜ํ…์ธ  ๋ฐฐ์—ด
86
+ */
87
+ static validateContent(content?: DefaultPartialBlock[] | string, emptyBlockCount?: number): DefaultPartialBlock[];
88
+ /**
89
+ * ๋นˆ ๋ธ”๋ก๋“ค์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค
90
+ * @param emptyBlockCount ์ƒ์„ฑํ•  ๋ธ”๋ก ๊ฐœ์ˆ˜
91
+ * @returns ์ƒ์„ฑ๋œ ๋นˆ ๋ธ”๋ก ๋ฐฐ์—ด
92
+ */
93
+ private static createEmptyBlocks;
94
+ }
95
+ /**
96
+ * ์—๋””ํ„ฐ ์„ค์ • ๊ด€๋ฆฌ ์œ ํ‹ธ๋ฆฌํ‹ฐ
97
+ * ๊ฐ์ข… ์„ค์ •์˜ ๊ธฐ๋ณธ๊ฐ’๊ณผ ๊ฒ€์ฆ ๋กœ์ง์„ ๋‹ด๋‹น
98
+ */
99
+ declare class EditorConfig {
100
+ /**
101
+ * ํ…Œ์ด๋ธ” ์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ
102
+ * @param userTables ์‚ฌ์šฉ์ž ํ…Œ์ด๋ธ” ์„ค์ •
103
+ * @returns ๊ธฐ๋ณธ๊ฐ’์ด ์ ์šฉ๋œ ํ…Œ์ด๋ธ” ์„ค์ •
104
+ */
105
+ static getDefaultTableConfig(userTables?: LumirEditorProps["tables"]): {
106
+ splitCells: boolean;
107
+ cellBackgroundColor: boolean;
108
+ cellTextColor: boolean;
109
+ headers: boolean;
110
+ };
111
+ /**
112
+ * ํ—ค๋”ฉ ์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์ ์šฉ
113
+ * @param userHeading ์‚ฌ์šฉ์ž ํ—ค๋”ฉ ์„ค์ •
114
+ * @returns ๊ธฐ๋ณธ๊ฐ’์ด ์ ์šฉ๋œ ํ—ค๋”ฉ ์„ค์ •
115
+ */
116
+ static getDefaultHeadingConfig(userHeading?: LumirEditorProps["heading"]): {
117
+ levels?: (1 | 2 | 3 | 4 | 5 | 6)[];
118
+ };
119
+ /**
120
+ * ๋น„ํ™œ์„ฑํ™”ํ•  ํ™•์žฅ ๊ธฐ๋Šฅ ๋ชฉ๋ก ์ƒ์„ฑ
121
+ * @param userExtensions ์‚ฌ์šฉ์ž ์ •์˜ ๋น„ํ™œ์„ฑ ํ™•์žฅ
122
+ * @param allowVideo ๋น„๋””์˜ค ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
123
+ * @param allowAudio ์˜ค๋””์˜ค ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
124
+ * @param allowFile ์ผ๋ฐ˜ ํŒŒ์ผ ์—…๋กœ๋“œ ํ—ˆ์šฉ ์—ฌ๋ถ€
125
+ * @returns ๋น„ํ™œ์„ฑํ™”ํ•  ํ™•์žฅ ๊ธฐ๋Šฅ ๋ชฉ๋ก
126
+ */
127
+ static getDisabledExtensions(userExtensions?: string[], allowVideo?: boolean, allowAudio?: boolean, allowFile?: boolean): string[];
128
+ }
129
+ declare function LumirEditor({ initialContent, initialEmptyBlocks, uploadFile, s3Upload, tables, heading, defaultStyles, disableExtensions, tabBehavior, trailingBlock, allowVideoUpload, allowAudioUpload, allowFileUpload, editable, theme, formattingToolbar, linkToolbar, sideMenu, emojiPicker, filePanel, tableHandles, onSelectionChange, className, sideMenuAddButton, onContentChange, }: LumirEditorProps): react_jsx_runtime.JSX.Element;
130
+
131
+ declare function cn(...inputs: (string | undefined | null | false)[]): string;
132
+
133
+ interface S3UploaderConfig {
134
+ apiEndpoint: string;
135
+ env: "production" | "development";
136
+ path: string;
137
+ }
138
+ declare const createS3Uploader: (config: S3UploaderConfig) => (file: File) => Promise<string>;
139
+
140
+ export { ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, LumirEditor, type LumirEditorProps, type S3UploaderConfig, cn, createS3Uploader };