@lumir-company/editor 0.4.4 → 0.4.6

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/index.d.mts CHANGED
@@ -39,8 +39,9 @@ declare class LumirEditorError extends Error {
39
39
  static uploadFailed(message: string, originalError?: Error): LumirEditorError;
40
40
  /**
41
41
  * 잘못된 파일 형식 에러 생성
42
+ * @param allowVideoUpload true이면 "image and video" 메시지 사용
42
43
  */
43
- static invalidFileType(fileName: string): LumirEditorError;
44
+ static invalidFileType(fileName: string, allowVideoUpload?: boolean): LumirEditorError;
44
45
  /**
45
46
  * S3 설정 에러 생성
46
47
  */
@@ -77,6 +78,12 @@ interface LumirEditorProps {
77
78
  appendUUID?: boolean;
78
79
  /** false로 설정하면 확장자를 자동으로 붙이지 않음 (기본: true) */
79
80
  preserveExtension?: boolean;
81
+ /** 업로드 진행률(0–100) 콜백. S3 PUT 시에만 호출됨 */
82
+ onProgress?: (percent: number) => void;
83
+ /** PUT 요청 타임아웃(ms). 미설정 시 120000(120초). 대용량 비디오에 유리 */
84
+ uploadTimeoutMs?: number;
85
+ /** PUT 실패 시 재시도 횟수. 기본 2(최대 3회 시도) */
86
+ maxRetries?: number;
80
87
  };
81
88
  allowVideoUpload?: boolean;
82
89
  allowAudioUpload?: boolean;
@@ -118,10 +125,11 @@ interface LumirEditorProps {
118
125
  /** 에러 발생 시 호출되는 콜백 */
119
126
  onError?: (error: LumirEditorError) => void;
120
127
  /**
121
- * 이미지가 에디터에서 삭제될 때 호출되는 콜백
122
- * - S3 등 외부 스토리지에서 이미지를 삭제하는 용도로 사용
128
+ * 이미지·비디오(미디어)가 에디터에서 삭제될 때 호출되는 콜백
129
+ * - S3 등 외부 스토리지에서 해당 미디어를 삭제하는 용도로 사용
130
+ * - 이미지 블록과 비디오 블록 삭제 시 모두 호출됨
123
131
  * - Undo/Redo를 고려하여 지연 삭제를 권장
124
- * @param imageUrl 삭제된 이미지의 URL
132
+ * @param imageUrl 삭제된 이미지 또는 비디오의 URL
125
133
  */
126
134
  onImageDelete?: (imageUrl: string) => void;
127
135
  }
@@ -210,6 +218,12 @@ interface S3UploaderConfig {
210
218
  appendUUID?: boolean;
211
219
  /** false로 설정하면 확장자를 자동으로 붙이지 않음 (기본: true) */
212
220
  preserveExtension?: boolean;
221
+ /** 업로드 진행률(0–100) 콜백. S3 PUT 시에만 호출됨 */
222
+ onProgress?: (percent: number) => void;
223
+ /** PUT 요청 타임아웃(ms). 미설정 시 120000(120초). 대용량 비디오에 유리 */
224
+ uploadTimeoutMs?: number;
225
+ /** PUT 실패 시 재시도 횟수. 기본 2(최대 3회 시도) */
226
+ maxRetries?: number;
213
227
  }
214
228
  declare const createS3Uploader: (config: S3UploaderConfig) => (file: File) => Promise<string>;
215
229
 
@@ -246,6 +260,38 @@ declare const HtmlPreviewBlock: {
246
260
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
247
261
  };
248
262
  declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
263
+ video: {
264
+ config: {
265
+ readonly type: "video";
266
+ readonly propSchema: {
267
+ readonly url: {
268
+ readonly default: "";
269
+ };
270
+ readonly previewWidth: {
271
+ readonly default: 640;
272
+ };
273
+ readonly previewHeight: {
274
+ readonly default: 360;
275
+ };
276
+ };
277
+ readonly content: "none";
278
+ };
279
+ implementation: _blocknote_core.TiptapBlockImplementation<{
280
+ readonly type: "video";
281
+ readonly propSchema: {
282
+ readonly url: {
283
+ readonly default: "";
284
+ };
285
+ readonly previewWidth: {
286
+ readonly default: 640;
287
+ };
288
+ readonly previewHeight: {
289
+ readonly default: 360;
290
+ };
291
+ };
292
+ readonly content: "none";
293
+ }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
294
+ };
249
295
  htmlPreview: {
250
296
  config: {
251
297
  readonly type: "htmlPreview";
@@ -744,70 +790,6 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
744
790
  fileBlockAccept: string[];
745
791
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
746
792
  };
747
- video: {
748
- config: {
749
- type: "video";
750
- propSchema: {
751
- textAlignment: {
752
- default: "left";
753
- values: readonly ["left", "center", "right", "justify"];
754
- };
755
- backgroundColor: {
756
- default: "default";
757
- };
758
- name: {
759
- default: "";
760
- };
761
- url: {
762
- default: "";
763
- };
764
- caption: {
765
- default: "";
766
- };
767
- showPreview: {
768
- default: true;
769
- };
770
- previewWidth: {
771
- default: undefined;
772
- type: "number";
773
- };
774
- };
775
- content: "none";
776
- isFileBlock: true;
777
- fileBlockAccept: string[];
778
- };
779
- implementation: _blocknote_core.TiptapBlockImplementation<{
780
- type: "video";
781
- propSchema: {
782
- textAlignment: {
783
- default: "left";
784
- values: readonly ["left", "center", "right", "justify"];
785
- };
786
- backgroundColor: {
787
- default: "default";
788
- };
789
- name: {
790
- default: "";
791
- };
792
- url: {
793
- default: "";
794
- };
795
- caption: {
796
- default: "";
797
- };
798
- showPreview: {
799
- default: true;
800
- };
801
- previewWidth: {
802
- default: undefined;
803
- type: "number";
804
- };
805
- };
806
- content: "none";
807
- isFileBlock: true;
808
- fileBlockAccept: string[];
809
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
810
- };
811
793
  audio: {
812
794
  config: {
813
795
  type: "audio";
package/dist/index.d.ts CHANGED
@@ -39,8 +39,9 @@ declare class LumirEditorError extends Error {
39
39
  static uploadFailed(message: string, originalError?: Error): LumirEditorError;
40
40
  /**
41
41
  * 잘못된 파일 형식 에러 생성
42
+ * @param allowVideoUpload true이면 "image and video" 메시지 사용
42
43
  */
43
- static invalidFileType(fileName: string): LumirEditorError;
44
+ static invalidFileType(fileName: string, allowVideoUpload?: boolean): LumirEditorError;
44
45
  /**
45
46
  * S3 설정 에러 생성
46
47
  */
@@ -77,6 +78,12 @@ interface LumirEditorProps {
77
78
  appendUUID?: boolean;
78
79
  /** false로 설정하면 확장자를 자동으로 붙이지 않음 (기본: true) */
79
80
  preserveExtension?: boolean;
81
+ /** 업로드 진행률(0–100) 콜백. S3 PUT 시에만 호출됨 */
82
+ onProgress?: (percent: number) => void;
83
+ /** PUT 요청 타임아웃(ms). 미설정 시 120000(120초). 대용량 비디오에 유리 */
84
+ uploadTimeoutMs?: number;
85
+ /** PUT 실패 시 재시도 횟수. 기본 2(최대 3회 시도) */
86
+ maxRetries?: number;
80
87
  };
81
88
  allowVideoUpload?: boolean;
82
89
  allowAudioUpload?: boolean;
@@ -118,10 +125,11 @@ interface LumirEditorProps {
118
125
  /** 에러 발생 시 호출되는 콜백 */
119
126
  onError?: (error: LumirEditorError) => void;
120
127
  /**
121
- * 이미지가 에디터에서 삭제될 때 호출되는 콜백
122
- * - S3 등 외부 스토리지에서 이미지를 삭제하는 용도로 사용
128
+ * 이미지·비디오(미디어)가 에디터에서 삭제될 때 호출되는 콜백
129
+ * - S3 등 외부 스토리지에서 해당 미디어를 삭제하는 용도로 사용
130
+ * - 이미지 블록과 비디오 블록 삭제 시 모두 호출됨
123
131
  * - Undo/Redo를 고려하여 지연 삭제를 권장
124
- * @param imageUrl 삭제된 이미지의 URL
132
+ * @param imageUrl 삭제된 이미지 또는 비디오의 URL
125
133
  */
126
134
  onImageDelete?: (imageUrl: string) => void;
127
135
  }
@@ -210,6 +218,12 @@ interface S3UploaderConfig {
210
218
  appendUUID?: boolean;
211
219
  /** false로 설정하면 확장자를 자동으로 붙이지 않음 (기본: true) */
212
220
  preserveExtension?: boolean;
221
+ /** 업로드 진행률(0–100) 콜백. S3 PUT 시에만 호출됨 */
222
+ onProgress?: (percent: number) => void;
223
+ /** PUT 요청 타임아웃(ms). 미설정 시 120000(120초). 대용량 비디오에 유리 */
224
+ uploadTimeoutMs?: number;
225
+ /** PUT 실패 시 재시도 횟수. 기본 2(최대 3회 시도) */
226
+ maxRetries?: number;
213
227
  }
214
228
  declare const createS3Uploader: (config: S3UploaderConfig) => (file: File) => Promise<string>;
215
229
 
@@ -246,6 +260,38 @@ declare const HtmlPreviewBlock: {
246
260
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
247
261
  };
248
262
  declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
263
+ video: {
264
+ config: {
265
+ readonly type: "video";
266
+ readonly propSchema: {
267
+ readonly url: {
268
+ readonly default: "";
269
+ };
270
+ readonly previewWidth: {
271
+ readonly default: 640;
272
+ };
273
+ readonly previewHeight: {
274
+ readonly default: 360;
275
+ };
276
+ };
277
+ readonly content: "none";
278
+ };
279
+ implementation: _blocknote_core.TiptapBlockImplementation<{
280
+ readonly type: "video";
281
+ readonly propSchema: {
282
+ readonly url: {
283
+ readonly default: "";
284
+ };
285
+ readonly previewWidth: {
286
+ readonly default: 640;
287
+ };
288
+ readonly previewHeight: {
289
+ readonly default: 360;
290
+ };
291
+ };
292
+ readonly content: "none";
293
+ }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
294
+ };
249
295
  htmlPreview: {
250
296
  config: {
251
297
  readonly type: "htmlPreview";
@@ -744,70 +790,6 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
744
790
  fileBlockAccept: string[];
745
791
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
746
792
  };
747
- video: {
748
- config: {
749
- type: "video";
750
- propSchema: {
751
- textAlignment: {
752
- default: "left";
753
- values: readonly ["left", "center", "right", "justify"];
754
- };
755
- backgroundColor: {
756
- default: "default";
757
- };
758
- name: {
759
- default: "";
760
- };
761
- url: {
762
- default: "";
763
- };
764
- caption: {
765
- default: "";
766
- };
767
- showPreview: {
768
- default: true;
769
- };
770
- previewWidth: {
771
- default: undefined;
772
- type: "number";
773
- };
774
- };
775
- content: "none";
776
- isFileBlock: true;
777
- fileBlockAccept: string[];
778
- };
779
- implementation: _blocknote_core.TiptapBlockImplementation<{
780
- type: "video";
781
- propSchema: {
782
- textAlignment: {
783
- default: "left";
784
- values: readonly ["left", "center", "right", "justify"];
785
- };
786
- backgroundColor: {
787
- default: "default";
788
- };
789
- name: {
790
- default: "";
791
- };
792
- url: {
793
- default: "";
794
- };
795
- caption: {
796
- default: "";
797
- };
798
- showPreview: {
799
- default: true;
800
- };
801
- previewWidth: {
802
- default: undefined;
803
- type: "number";
804
- };
805
- };
806
- content: "none";
807
- isFileBlock: true;
808
- fileBlockAccept: string[];
809
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
810
- };
811
793
  audio: {
812
794
  config: {
813
795
  type: "audio";