@gendive/slide 0.1.12 → 0.1.14
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 +100 -18
- package/dist/ai/hooks/useAiGeneration.d.ts +1 -1
- package/dist/ai/services/providers/devdiveProvider.d.ts +7 -1
- package/dist/ai/types/index.d.ts +16 -0
- package/dist/devdive-slide.cjs.js +99 -98
- package/dist/devdive-slide.cjs.js.map +1 -1
- package/dist/devdive-slide.es.js +9947 -9614
- package/dist/devdive-slide.es.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/pptxParser.d.ts +10 -0
- package/dist/slide.css +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# DevDive Slide
|
|
2
2
|
|
|
3
|
-
React 기반 프레젠테이션 에디터 라이브러리. Canva 스타일의 이미지 크롭, PPTX
|
|
3
|
+
React 기반 프레젠테이션 에디터 라이브러리. Canva 스타일의 이미지 크롭, PPTX 내보내기, AI 슬라이드 생성을 지원합니다.
|
|
4
4
|
|
|
5
5
|
## 주요 기능
|
|
6
6
|
|
|
@@ -9,22 +9,115 @@ React 기반 프레젠테이션 에디터 라이브러리. Canva 스타일의
|
|
|
9
9
|
- **이미지** - 드래그 앤 드롭, Canva 스타일 크롭, 확대/축소
|
|
10
10
|
- **템플릿** - 다양한 레이아웃 및 테마 프리셋
|
|
11
11
|
- **PPTX 내보내기** - 모든 요소를 PowerPoint로 변환
|
|
12
|
+
- **AI 슬라이드 생성** - DevDive AI로 슬라이드 자동 생성 및 편집
|
|
13
|
+
- **AI 이미지 생성** - 텍스트 프롬프트 기반 이미지 생성
|
|
12
14
|
|
|
13
15
|
## 설치
|
|
14
16
|
|
|
15
17
|
```bash
|
|
16
|
-
pnpm
|
|
18
|
+
pnpm add @gendive/slide
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## 사용법
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
### 기본 사용
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { MantineProvider } from '@mantine/core';
|
|
27
|
+
import '@mantine/core/styles.css';
|
|
28
|
+
import { Editor, devdiveTheme } from '@gendive/slide';
|
|
29
|
+
import '@gendive/slide/style.css';
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
return (
|
|
33
|
+
<MantineProvider theme={devdiveTheme}>
|
|
34
|
+
<Editor
|
|
35
|
+
aiConfig={{
|
|
36
|
+
provider: 'devdive',
|
|
37
|
+
apiKey: 'YOUR_API_KEY',
|
|
38
|
+
model: 'gpt-4o',
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
</MantineProvider>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 라이트 모드
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { MantineProvider } from '@mantine/core';
|
|
50
|
+
import '@mantine/core/styles.css';
|
|
51
|
+
import { Editor, devdiveThemeLight } from '@gendive/slide';
|
|
52
|
+
import '@gendive/slide/style.css';
|
|
53
|
+
|
|
54
|
+
function App() {
|
|
55
|
+
return (
|
|
56
|
+
<MantineProvider theme={devdiveThemeLight} forceColorScheme="light">
|
|
57
|
+
<Editor
|
|
58
|
+
aiConfig={{
|
|
59
|
+
provider: 'devdive',
|
|
60
|
+
apiKey: 'YOUR_API_KEY',
|
|
61
|
+
model: 'gpt-4o',
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</MantineProvider>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 커스텀 API 엔드포인트 (내부 프록시)
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Editor
|
|
73
|
+
aiConfig={{
|
|
74
|
+
provider: 'devdive',
|
|
75
|
+
apiKey: '',
|
|
76
|
+
baseUrl: '/api/model/text-generation/v1',
|
|
77
|
+
model: 'gpt-4o',
|
|
78
|
+
skipAuth: true,
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Editor 외부에서 AI 설정
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import { initAiConfig } from '@gendive/slide';
|
|
87
|
+
|
|
88
|
+
initAiConfig({
|
|
89
|
+
provider: 'devdive',
|
|
90
|
+
apiKey: 'YOUR_API_KEY',
|
|
91
|
+
baseUrl: '/api/model/text-generation/v1',
|
|
92
|
+
model: 'gpt-4o',
|
|
93
|
+
});
|
|
23
94
|
```
|
|
24
95
|
|
|
25
|
-
##
|
|
96
|
+
## Peer Dependencies
|
|
97
|
+
|
|
98
|
+
호스트 앱에서 다음 패키지를 제공해야 합니다:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"react": "^18 || ^19",
|
|
103
|
+
"react-dom": "^18 || ^19",
|
|
104
|
+
"@mantine/core": "^7",
|
|
105
|
+
"@mantine/hooks": "^7"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> **참고**: `@mantine/core/styles.css`는 호스트 앱에서 직접 import해야 합니다. 패키지 번들에는 Mantine CSS가 포함되지 않습니다.
|
|
110
|
+
|
|
111
|
+
## 개발
|
|
26
112
|
|
|
27
113
|
```bash
|
|
114
|
+
# 의존성 설치
|
|
115
|
+
pnpm install
|
|
116
|
+
|
|
117
|
+
# 개발 서버
|
|
118
|
+
pnpm dev
|
|
119
|
+
|
|
120
|
+
# 라이브러리 빌드
|
|
28
121
|
pnpm build:lib
|
|
29
122
|
```
|
|
30
123
|
|
|
@@ -32,21 +125,10 @@ pnpm build:lib
|
|
|
32
125
|
|
|
33
126
|
- **React 19** + **TypeScript 5.6**
|
|
34
127
|
- **Vite** - 빌드 도구
|
|
128
|
+
- **Mantine 7** - UI 컴포넌트
|
|
35
129
|
- **Zustand** - 상태 관리
|
|
36
130
|
- **Konva** / **react-konva** - 캔버스 렌더링
|
|
37
131
|
- **PptxGenJS** - PPTX 생성
|
|
38
|
-
- **Tailwind CSS 4** - 스타일링
|
|
39
|
-
|
|
40
|
-
## 사용법
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
import { Editor, useEditorStore } from '@devdive/slide';
|
|
44
|
-
import '@devdive/slide/style.css';
|
|
45
|
-
|
|
46
|
-
function App() {
|
|
47
|
-
return <Editor />;
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
132
|
|
|
51
133
|
## 라이선스
|
|
52
134
|
|
|
@@ -20,7 +20,7 @@ export declare const useAiGeneration: () => {
|
|
|
20
20
|
generateText: (request: AiTextRequest) => Promise<import('..').AiTextResponse>;
|
|
21
21
|
generateSlides: (request: AiSlideGenerationRequest) => Promise<import('..').AiSlideGenerationResponse>;
|
|
22
22
|
generateSlideContent: (request: SlideContentRequest) => Promise<AiGeneratedSlide>;
|
|
23
|
-
generateImage: (
|
|
23
|
+
generateImage: (request: AiImageRequest) => Promise<AiImageResponse>;
|
|
24
24
|
suggestDesign: (_request: AiDesignRequest) => Promise<AiDesignSuggestion[]>;
|
|
25
25
|
reset: () => void;
|
|
26
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiTextRequest, AiTextResponse, AiSlideGenerationRequest, AiSlideGenerationResponse, AiGeneratedSlide, DevDiveConfig } from '../../types';
|
|
1
|
+
import { AiTextRequest, AiTextResponse, AiSlideGenerationRequest, AiSlideGenerationResponse, AiGeneratedSlide, AiImageRequest, AiImageResponse, DevDiveConfig } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* @description DevDive API 에러
|
|
4
4
|
*/
|
|
@@ -52,6 +52,11 @@ export interface SlideContentRequest {
|
|
|
52
52
|
* @Todo vibecode - IR 스타일 프롬프트로 슬라이드별 콘텐츠 생성
|
|
53
53
|
*/
|
|
54
54
|
export declare const generateSlideContentWithDevDive: (request: SlideContentRequest, config: DevDiveConfig) => Promise<AiGeneratedSlide>;
|
|
55
|
+
/**
|
|
56
|
+
* @description DevDive 이미지 생성 (텍스트 → 이미지)
|
|
57
|
+
* @Todo vibecode - /api/model/image-generation/v2/gemini-3-pro-image-txt-to-img
|
|
58
|
+
*/
|
|
59
|
+
export declare const generateImageWithDevDive: (request: AiImageRequest, config: DevDiveConfig) => Promise<AiImageResponse>;
|
|
55
60
|
/**
|
|
56
61
|
* @description DevDive Provider
|
|
57
62
|
*/
|
|
@@ -59,4 +64,5 @@ export declare const devdiveProvider: {
|
|
|
59
64
|
generateText: (request: AiTextRequest, config: DevDiveConfig) => Promise<AiTextResponse>;
|
|
60
65
|
generateSlides: (request: AiSlideGenerationRequest, config: DevDiveConfig) => Promise<AiSlideGenerationResponse>;
|
|
61
66
|
generateSlideContent: (request: SlideContentRequest, config: DevDiveConfig) => Promise<AiGeneratedSlide>;
|
|
67
|
+
generateImage: (request: AiImageRequest, config: DevDiveConfig) => Promise<AiImageResponse>;
|
|
62
68
|
};
|
package/dist/ai/types/index.d.ts
CHANGED
|
@@ -164,6 +164,22 @@ export interface AiDesignSuggestion {
|
|
|
164
164
|
preview?: ThemeColors;
|
|
165
165
|
layoutId?: LayoutType;
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* @description DevDive 이미지 생성 요청 (텍스트 → 이미지)
|
|
169
|
+
* @Todo vibecode - POST /api/model/image-generation/v2/gemini-3-pro-image-txt-to-img
|
|
170
|
+
*/
|
|
171
|
+
export interface DevDiveImageGenerationRequest {
|
|
172
|
+
prompt: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* @description DevDive 이미지 생성 응답
|
|
176
|
+
* @Todo vibecode - base64 이미지 데이터 반환
|
|
177
|
+
*/
|
|
178
|
+
export interface DevDiveImageGenerationResponse {
|
|
179
|
+
base64_image_data: string;
|
|
180
|
+
cost: number;
|
|
181
|
+
output_text: string;
|
|
182
|
+
}
|
|
167
183
|
/**
|
|
168
184
|
* @description AI 스토어 상태
|
|
169
185
|
*/
|