feat: V2Media 컴포넌트 추가 및 통합 미디어 기능 정의
- 새로운 V2Media 컴포넌트를 추가하여 파일, 이미지, 비디오, 오디오 등 다양한 미디어 타입을 지원합니다. - V2Media의 설정 스키마와 기본 속성을 정의하고, 관련 설정 패널을 통합하였습니다. - 기존 컴포넌트 목록에 V2Media를 포함시켜 통합 미디어 기능을 강화하였습니다. - componentConfig 스키마에서 v2-repeater를 제거하여 불필요한 항목을 정리하였습니다.
This commit is contained in:
@@ -106,6 +106,7 @@ import "./v2-location-swap-selector/LocationSwapSelectorRenderer";
|
||||
import "./v2-table-search-widget";
|
||||
import "./v2-tabs-widget/tabs-component";
|
||||
import "./v2-category-manager/V2CategoryManagerRenderer";
|
||||
import "./v2-media"; // 통합 미디어 컴포넌트
|
||||
|
||||
/**
|
||||
* 컴포넌트 초기화 함수
|
||||
|
||||
78
frontend/lib/registry/components/v2-media/index.ts
Normal file
78
frontend/lib/registry/components/v2-media/index.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* V2Media 컴포넌트 정의
|
||||
*
|
||||
* 파일, 이미지, 비디오, 오디오 등 다양한 미디어 타입을 지원하는 통합 미디어 컴포넌트
|
||||
*/
|
||||
|
||||
import { ComponentCategory } from "@/types/component";
|
||||
import { createComponentDefinition } from "../../utils/createComponentDefinition";
|
||||
import { V2MediaConfigPanel } from "@/components/v2/config-panels/V2MediaConfigPanel";
|
||||
import { V2Media } from "@/components/v2/V2Media";
|
||||
|
||||
export const V2MediaDefinition = createComponentDefinition({
|
||||
id: "v2-media",
|
||||
name: "V2 미디어",
|
||||
description: "파일, 이미지, 비디오, 오디오 등 다양한 미디어 타입 지원",
|
||||
category: ComponentCategory.INPUT,
|
||||
webType: "file",
|
||||
version: "2.0.0",
|
||||
component: V2Media,
|
||||
|
||||
// 기본 속성
|
||||
defaultProps: {
|
||||
config: {
|
||||
mediaType: "file",
|
||||
multiple: false,
|
||||
preview: true,
|
||||
maxSize: 10, // MB
|
||||
accept: "*/*",
|
||||
showFileList: true,
|
||||
dragDrop: true,
|
||||
},
|
||||
},
|
||||
|
||||
// 설정 스키마
|
||||
configSchema: {
|
||||
mediaType: {
|
||||
type: "select",
|
||||
label: "미디어 타입",
|
||||
options: [
|
||||
{ value: "file", label: "파일" },
|
||||
{ value: "image", label: "이미지" },
|
||||
{ value: "video", label: "비디오" },
|
||||
{ value: "audio", label: "오디오" },
|
||||
],
|
||||
},
|
||||
multiple: {
|
||||
type: "boolean",
|
||||
label: "다중 업로드",
|
||||
},
|
||||
preview: {
|
||||
type: "boolean",
|
||||
label: "미리보기",
|
||||
},
|
||||
maxSize: {
|
||||
type: "number",
|
||||
label: "최대 크기 (MB)",
|
||||
},
|
||||
accept: {
|
||||
type: "text",
|
||||
label: "허용 파일 형식",
|
||||
placeholder: "*/* 또는 image/*",
|
||||
},
|
||||
},
|
||||
|
||||
// 이벤트
|
||||
events: ["onChange", "onUpload", "onDelete"],
|
||||
|
||||
// 아이콘
|
||||
icon: "Upload",
|
||||
|
||||
// 태그
|
||||
tags: ["media", "file", "image", "upload", "v2"],
|
||||
|
||||
// 설정 패널
|
||||
configPanel: V2MediaConfigPanel,
|
||||
});
|
||||
|
||||
export default V2MediaDefinition;
|
||||
@@ -643,7 +643,6 @@ const componentOverridesSchemaRegistry: Record<string, z.ZodType<Record<string,
|
||||
"v2-media": v2MediaOverridesSchema,
|
||||
"v2-biz": v2BizOverridesSchema,
|
||||
"v2-hierarchy": v2HierarchyOverridesSchema,
|
||||
"v2-repeater": v2RepeaterOverridesSchema,
|
||||
};
|
||||
|
||||
// ============================================
|
||||
|
||||
Reference in New Issue
Block a user