@lumir-company/editor 0.4.5 → 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/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  - [파일명 커스터마이징](#파일명-커스터마이징)
19
19
  - [커스텀 업로더](#2-커스텀-업로더)
20
20
  - [동영상 업로드 및 임베딩](#동영상-업로드-및-임베딩)
21
+ - [비디오 플레이어 동작 (커스텀 블록)](#비디오-플레이어-동작-커스텀-블록)
21
22
  - [이미지·동영상 업로드 상세 가이드](#이미지동영상-업로드-상세-가이드)
22
23
  - [이미지·비디오 삭제](#이미지비디오-삭제)
23
24
  - [HTML 미리보기](#html-미리보기)
@@ -359,12 +360,24 @@ const imageUrl = await s3Uploader(imageFile);
359
360
 
360
361
  ### 데이터 내부 동영상 임베딩
361
362
 
362
- 동영상 블록은 `initialContent` / `onContentChange`에 포함됩니다. 저장 시 `{ type: "video", props: { url: "..." } }` 형태로 블록이 유지됩니다.
363
+ 동영상 블록은 `initialContent` / `onContentChange`에 포함됩니다. 저장 시 `{ type: "video", props: { url: "...", previewWidth?, previewHeight? } }` 형태로 블록이 유지됩니다.
363
364
 
364
- - **재생**: 화면에서 동영상을 재생하려면 `allowVideoUpload={true}`로 두어야 합니다. 이렇게 해야 video 확장이 활성화되어 BlockNote 기본 플레이어가 렌더링됩니다.
365
+ - **재생**: 화면에서 동영상을 재생하려면 `allowVideoUpload={true}`로 두어야 합니다. LumirEditor는 **커스텀 비디오 블록**을 사용하여 플레이어를 렌더링합니다.
365
366
  - `allowVideoUpload={false}`인 상태에서 initialContent에 video 블록만 넣으면 데이터는 보존되지만, 재생 UI는 비활성화된 확장 때문에 표시되지 않을 수 있습니다.
366
367
  - **지원 URL**: 비디오 블록의 `url`은 **직접 재생 가능한 비디오 파일 URL**만 지원합니다(예: S3에 업로드된 `.mp4`, `.webm`, `.ogg`). YouTube·Vimeo 등 스트리밍 페이지 URL(`youtube.com/watch?v=...` 등)은 `<video>` 요소의 `src`로 재생되지 않으므로, 해당 링크를 video 블록 URL로 넣으면 재생되지 않습니다. YouTube 임베드가 필요하면 별도 embed 블록 또는 iframe 삽입 방식을 고려해야 합니다.
367
368
 
369
+ ### 비디오 플레이어 동작 (커스텀 블록)
370
+
371
+ LumirEditor의 비디오 블록은 BlockNote 기본 플레이어를 대체한 **커스텀 비디오 블록**입니다.
372
+
373
+ | 항목 | 동작 |
374
+ |------|------|
375
+ | **더보기 / 다운로드** | 미노출 (UI에서 제거됨) |
376
+ | **우클릭 메뉴** | 비디오 영역에서 컨텍스트 메뉴 비활성화 |
377
+ | **사이즈 조절** | 편집 모드에서 좌·우·하단 리사이즈 핸들로 크기 조절 가능. `previewWidth`, `previewHeight`로 블록에 저장됨 (기본 640×360) |
378
+
379
+ 블록 데이터에 `previewWidth`(px), `previewHeight`(px)가 없으면 기본값이 적용됩니다.
380
+
368
381
  ---
369
382
 
370
383
  ## 이미지·동영상 업로드 상세 가이드
@@ -491,14 +504,17 @@ const imageUrl = await s3Uploader(imageFile);
491
504
  {
492
505
  "type": "video",
493
506
  "props": {
494
- "url": "https://your-cdn.com/videos/clip_xxx.mp4"
507
+ "url": "https://your-cdn.com/videos/clip_xxx.mp4",
508
+ "previewWidth": 640,
509
+ "previewHeight": 360
495
510
  },
496
511
  "content": [],
497
512
  "children": []
498
513
  }
499
514
  ```
500
515
 
501
- `url`은 반드시 **브라우저에서 직접 재생 가능한 URL**이어야 합니다. 동영상은 YouTube/Vimeo 링크가 아니라, 업로드 후 받은 `.mp4` 등 직접 재생 URL만 지원합니다.
516
+ - `url`: 필수. 브라우저에서 직접 재생 가능한 URL이어야 합니다. YouTube/Vimeo 링크가 아니라, 업로드 후 받은 `.mp4` 등 직접 재생 URL만 지원합니다.
517
+ - `previewWidth`, `previewHeight`: 선택. 픽셀 단위. 없으면 기본 640×360이 적용되며, 에디터에서 리사이즈하면 저장됩니다.
502
518
 
503
519
  ### 6. 삭제 시 콜백
504
520
 
package/dist/index.d.mts CHANGED
@@ -260,6 +260,38 @@ declare const HtmlPreviewBlock: {
260
260
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
261
261
  };
262
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
+ };
263
295
  htmlPreview: {
264
296
  config: {
265
297
  readonly type: "htmlPreview";
@@ -758,70 +790,6 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
758
790
  fileBlockAccept: string[];
759
791
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
760
792
  };
761
- video: {
762
- config: {
763
- type: "video";
764
- propSchema: {
765
- textAlignment: {
766
- default: "left";
767
- values: readonly ["left", "center", "right", "justify"];
768
- };
769
- backgroundColor: {
770
- default: "default";
771
- };
772
- name: {
773
- default: "";
774
- };
775
- url: {
776
- default: "";
777
- };
778
- caption: {
779
- default: "";
780
- };
781
- showPreview: {
782
- default: true;
783
- };
784
- previewWidth: {
785
- default: undefined;
786
- type: "number";
787
- };
788
- };
789
- content: "none";
790
- isFileBlock: true;
791
- fileBlockAccept: string[];
792
- };
793
- implementation: _blocknote_core.TiptapBlockImplementation<{
794
- type: "video";
795
- propSchema: {
796
- textAlignment: {
797
- default: "left";
798
- values: readonly ["left", "center", "right", "justify"];
799
- };
800
- backgroundColor: {
801
- default: "default";
802
- };
803
- name: {
804
- default: "";
805
- };
806
- url: {
807
- default: "";
808
- };
809
- caption: {
810
- default: "";
811
- };
812
- showPreview: {
813
- default: true;
814
- };
815
- previewWidth: {
816
- default: undefined;
817
- type: "number";
818
- };
819
- };
820
- content: "none";
821
- isFileBlock: true;
822
- fileBlockAccept: string[];
823
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
824
- };
825
793
  audio: {
826
794
  config: {
827
795
  type: "audio";
package/dist/index.d.ts CHANGED
@@ -260,6 +260,38 @@ declare const HtmlPreviewBlock: {
260
260
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
261
261
  };
262
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
+ };
263
295
  htmlPreview: {
264
296
  config: {
265
297
  readonly type: "htmlPreview";
@@ -758,70 +790,6 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
758
790
  fileBlockAccept: string[];
759
791
  }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
760
792
  };
761
- video: {
762
- config: {
763
- type: "video";
764
- propSchema: {
765
- textAlignment: {
766
- default: "left";
767
- values: readonly ["left", "center", "right", "justify"];
768
- };
769
- backgroundColor: {
770
- default: "default";
771
- };
772
- name: {
773
- default: "";
774
- };
775
- url: {
776
- default: "";
777
- };
778
- caption: {
779
- default: "";
780
- };
781
- showPreview: {
782
- default: true;
783
- };
784
- previewWidth: {
785
- default: undefined;
786
- type: "number";
787
- };
788
- };
789
- content: "none";
790
- isFileBlock: true;
791
- fileBlockAccept: string[];
792
- };
793
- implementation: _blocknote_core.TiptapBlockImplementation<{
794
- type: "video";
795
- propSchema: {
796
- textAlignment: {
797
- default: "left";
798
- values: readonly ["left", "center", "right", "justify"];
799
- };
800
- backgroundColor: {
801
- default: "default";
802
- };
803
- name: {
804
- default: "";
805
- };
806
- url: {
807
- default: "";
808
- };
809
- caption: {
810
- default: "";
811
- };
812
- showPreview: {
813
- default: true;
814
- };
815
- previewWidth: {
816
- default: undefined;
817
- type: "number";
818
- };
819
- };
820
- content: "none";
821
- isFileBlock: true;
822
- fileBlockAccept: string[];
823
- }, any, _blocknote_core.InlineContentSchema, _blocknote_core.StyleSchema>;
824
- };
825
793
  audio: {
826
794
  config: {
827
795
  type: "audio";