@growgroup/visual-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.
Files changed (219) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +52 -0
  3. package/README.md +143 -0
  4. package/dist/editor.css +2 -0
  5. package/package.json +94 -0
  6. package/src/components/DeckSlideRender.tsx +21 -0
  7. package/src/components/SaveNote.tsx +21 -0
  8. package/src/components/auth/AuthProvider.tsx +44 -0
  9. package/src/components/ui/accordion.tsx +57 -0
  10. package/src/components/ui/alert-dialog.tsx +141 -0
  11. package/src/components/ui/badge.tsx +36 -0
  12. package/src/components/ui/button.tsx +56 -0
  13. package/src/components/ui/card.tsx +76 -0
  14. package/src/components/ui/checkbox.tsx +30 -0
  15. package/src/components/ui/collapsible.tsx +11 -0
  16. package/src/components/ui/context-menu.tsx +200 -0
  17. package/src/components/ui/dialog.tsx +122 -0
  18. package/src/components/ui/dropdown-menu.tsx +201 -0
  19. package/src/components/ui/input.tsx +22 -0
  20. package/src/components/ui/label.tsx +26 -0
  21. package/src/components/ui/popover.tsx +33 -0
  22. package/src/components/ui/scroll-area.tsx +48 -0
  23. package/src/components/ui/scrubbable-label.tsx +95 -0
  24. package/src/components/ui/select.tsx +159 -0
  25. package/src/components/ui/separator.tsx +31 -0
  26. package/src/components/ui/slider.tsx +28 -0
  27. package/src/components/ui/switch.tsx +29 -0
  28. package/src/components/ui/tabs.tsx +55 -0
  29. package/src/components/ui/textarea.tsx +22 -0
  30. package/src/components/ui/tooltip.tsx +32 -0
  31. package/src/components/viewer/useDeck.ts +58 -0
  32. package/src/editor/EditorContext.tsx +632 -0
  33. package/src/editor/EditorToolbar.tsx +446 -0
  34. package/src/editor/FrontendVisualEditor.tsx +2595 -0
  35. package/src/editor/autosave.ts +34 -0
  36. package/src/editor/components/AiPromptPopover.tsx +378 -0
  37. package/src/editor/components/BreakpointGuides.tsx +323 -0
  38. package/src/editor/components/BreakpointSelector.tsx +180 -0
  39. package/src/editor/components/ComponentPropertyEditor.tsx +426 -0
  40. package/src/editor/components/CssEditorDialog.tsx +168 -0
  41. package/src/editor/components/EditorCanvas.tsx +987 -0
  42. package/src/editor/components/EditorContextMenu.tsx +515 -0
  43. package/src/editor/components/EditorFooter.tsx +81 -0
  44. package/src/editor/components/EditorHeader.tsx +524 -0
  45. package/src/editor/components/EditorLayerPanel.tsx +1197 -0
  46. package/src/editor/components/EditorPropertyPanel.tsx +2996 -0
  47. package/src/editor/components/EditorSidebar.tsx +226 -0
  48. package/src/editor/components/FigmaColorPicker.tsx +1577 -0
  49. package/src/editor/components/HtmlEditorDialog.tsx +71 -0
  50. package/src/editor/components/HtmlImportDialog.tsx +346 -0
  51. package/src/editor/components/JsEditorDialog.tsx +175 -0
  52. package/src/editor/components/LayerTreeItem.tsx +494 -0
  53. package/src/editor/components/MasterComponentEditor.tsx +846 -0
  54. package/src/editor/components/MediaLibraryDialog.tsx +447 -0
  55. package/src/editor/components/PageSettingsDialog.tsx +776 -0
  56. package/src/editor/components/VariablePicker.tsx +355 -0
  57. package/src/editor/components/VariablesDialog.tsx +564 -0
  58. package/src/editor/components/VariantEditor.tsx +687 -0
  59. package/src/editor/components/VariantMatrix.tsx +507 -0
  60. package/src/editor/components/component-panel/CategoryAccordion.tsx +139 -0
  61. package/src/editor/components/component-panel/ComponentGrid.tsx +51 -0
  62. package/src/editor/components/component-panel/ComponentItem.tsx +368 -0
  63. package/src/editor/components/component-panel/ComponentPanel.tsx +275 -0
  64. package/src/editor/components/component-panel/ComponentSearch.tsx +82 -0
  65. package/src/editor/components/component-panel/VariantList.tsx +260 -0
  66. package/src/editor/components/component-panel/index.ts +12 -0
  67. package/src/editor/components/index.ts +48 -0
  68. package/src/editor/components/multi-page/CanvasZoomControls.tsx +71 -0
  69. package/src/editor/components/multi-page/InfiniteCanvas.tsx +95 -0
  70. package/src/editor/components/multi-page/MultiPageCanvasView.tsx +1404 -0
  71. package/src/editor/components/multi-page/PageFrameOverlay.tsx +76 -0
  72. package/src/editor/components/multi-page/PageLabel.tsx +34 -0
  73. package/src/editor/components/multi-page/PageLivePreview.tsx +242 -0
  74. package/src/editor/components/multi-page/PageThumbnail.tsx +59 -0
  75. package/src/editor/components/multi-page/index.ts +7 -0
  76. package/src/editor/components/ppt/PptChrome.tsx +2508 -0
  77. package/src/editor/components/ppt/PptComments.tsx +589 -0
  78. package/src/editor/components/ppt/PptDesignProposals.tsx +275 -0
  79. package/src/editor/components/ppt/PptFormatPane.tsx +320 -0
  80. package/src/editor/components/ppt/PptNotes.tsx +246 -0
  81. package/src/editor/components/property-panel/AlignmentPanel.tsx +110 -0
  82. package/src/editor/components/property-panel/AutoLayoutPanel.tsx +615 -0
  83. package/src/editor/components/property-panel/BorderSection.tsx +104 -0
  84. package/src/editor/components/property-panel/CompactNumberInput.tsx +237 -0
  85. package/src/editor/components/property-panel/CompactSizeInput.tsx +148 -0
  86. package/src/editor/components/property-panel/EffectSection.tsx +157 -0
  87. package/src/editor/components/property-panel/FillSection.tsx +69 -0
  88. package/src/editor/components/property-panel/GoogleFontPicker.tsx +192 -0
  89. package/src/editor/components/property-panel/ImageSection.tsx +206 -0
  90. package/src/editor/components/property-panel/ImgSrcSection.tsx +125 -0
  91. package/src/editor/components/property-panel/InstanceOverrideSection.tsx +413 -0
  92. package/src/editor/components/property-panel/LayoutSection.tsx +105 -0
  93. package/src/editor/components/property-panel/LinkSection.tsx +103 -0
  94. package/src/editor/components/property-panel/PropertyVariablePicker.tsx +311 -0
  95. package/src/editor/components/property-panel/ScalePanel.tsx +212 -0
  96. package/src/editor/components/property-panel/TypographySection.tsx +230 -0
  97. package/src/editor/components/property-panel/UnitAwareNumberInput.tsx +238 -0
  98. package/src/editor/components/property-panel/VariableAwareColorInput.tsx +477 -0
  99. package/src/editor/components/property-panel/VariableAwareInput.tsx +606 -0
  100. package/src/editor/components/property-panel/VariableAwareSizeInput.tsx +588 -0
  101. package/src/editor/components/property-panel/VariableAwareUnitInput.tsx +546 -0
  102. package/src/editor/components/property-panel/index.ts +24 -0
  103. package/src/editor/components/property-panel/unit-utils.ts +261 -0
  104. package/src/editor/components/shell/EditorTopBar.tsx +392 -0
  105. package/src/editor/components/shell/LeftPanel.tsx +47 -0
  106. package/src/editor/components/shell/PagesPanel.tsx +118 -0
  107. package/src/editor/components/variables-panel/ColorValueCell.tsx +165 -0
  108. package/src/editor/components/variables-panel/TextValueCell.tsx +116 -0
  109. package/src/editor/components/variables-panel/VariablesPanel.tsx +518 -0
  110. package/src/editor/components/variables-panel/index.ts +7 -0
  111. package/src/editor/constants.ts +468 -0
  112. package/src/editor/contexts/EditorArtboardContext.tsx +229 -0
  113. package/src/editor/contexts/EditorComponentsContext.tsx +1320 -0
  114. package/src/editor/contexts/EditorDocumentContext.tsx +113 -0
  115. package/src/editor/contexts/EditorHistoryContext.tsx +516 -0
  116. package/src/editor/contexts/EditorRefsContext.tsx +204 -0
  117. package/src/editor/contexts/EditorSelectionContext.tsx +54 -0
  118. package/src/editor/contexts/EditorToolContext.tsx +58 -0
  119. package/src/editor/contexts/EditorUIStateContext.tsx +122 -0
  120. package/src/editor/contexts/EditorVariablesContext.tsx +397 -0
  121. package/src/editor/contexts/EditorViewContext.tsx +101 -0
  122. package/src/editor/contexts/MultiPageCanvasContext.tsx +498 -0
  123. package/src/editor/contexts/index.ts +17 -0
  124. package/src/editor/editor-skin.css +122 -0
  125. package/src/editor/hooks/index.ts +38 -0
  126. package/src/editor/hooks/useAiReplace.ts +397 -0
  127. package/src/editor/hooks/useAltMeasure.ts +67 -0
  128. package/src/editor/hooks/useBrowserZoomPrevention.ts +121 -0
  129. package/src/editor/hooks/useCanvasControls.ts +1222 -0
  130. package/src/editor/hooks/useComponentEditMode.ts +658 -0
  131. package/src/editor/hooks/useComponentInstances.ts +515 -0
  132. package/src/editor/hooks/useContextMenuHandler.ts +157 -0
  133. package/src/editor/hooks/useCoordinateTransform.ts +207 -0
  134. package/src/editor/hooks/useDragResize.ts +1317 -0
  135. package/src/editor/hooks/useDrawingMode.ts +472 -0
  136. package/src/editor/hooks/useEditorColors.ts +144 -0
  137. package/src/editor/hooks/useEditorMessages.ts +108 -0
  138. package/src/editor/hooks/useElementActions.ts +1754 -0
  139. package/src/editor/hooks/useElementSelection.ts +1573 -0
  140. package/src/editor/hooks/useFocusManagement.ts +249 -0
  141. package/src/editor/hooks/useGoogleFonts.ts +305 -0
  142. package/src/editor/hooks/useIframeInitializer.ts +584 -0
  143. package/src/editor/hooks/useIframeSetup.ts +360 -0
  144. package/src/editor/hooks/useImageUpload.ts +270 -0
  145. package/src/editor/hooks/useInfiniteCanvas.ts +301 -0
  146. package/src/editor/hooks/useKeyboardShortcuts.ts +205 -0
  147. package/src/editor/hooks/useMarqueeSelection.ts +388 -0
  148. package/src/editor/hooks/useMediaLibrary.ts +129 -0
  149. package/src/editor/hooks/usePageSettingsManager.ts +739 -0
  150. package/src/editor/hooks/useResizablePanel.ts +163 -0
  151. package/src/editor/hooks/useRichPaste.ts +255 -0
  152. package/src/editor/hooks/useTouchGestures.ts +197 -0
  153. package/src/editor/index.ts +27 -0
  154. package/src/editor/types/page-settings.ts +513 -0
  155. package/src/editor/types.ts +382 -0
  156. package/src/editor/utils/align-elements.ts +169 -0
  157. package/src/editor/utils/api-json.ts +21 -0
  158. package/src/editor/utils/aspect-lock.ts +50 -0
  159. package/src/editor/utils/component-renderer.ts +702 -0
  160. package/src/editor/utils/component-sync.ts +845 -0
  161. package/src/editor/utils/crop-mode.ts +265 -0
  162. package/src/editor/utils/dom-utils.ts +2238 -0
  163. package/src/editor/utils/element-effects.ts +218 -0
  164. package/src/editor/utils/eyedropper.ts +35 -0
  165. package/src/editor/utils/figma-export.ts +560 -0
  166. package/src/editor/utils/figma-kiwi-decoder.ts +722 -0
  167. package/src/editor/utils/figma-kiwi-encoder.ts +583 -0
  168. package/src/editor/utils/figma-paste.ts +2262 -0
  169. package/src/editor/utils/flex-reorder.ts +231 -0
  170. package/src/editor/utils/flex-utils.ts +1230 -0
  171. package/src/editor/utils/geometry.ts +232 -0
  172. package/src/editor/utils/grid-layout.ts +210 -0
  173. package/src/editor/utils/html-utils.ts +470 -0
  174. package/src/editor/utils/index.ts +11 -0
  175. package/src/editor/utils/ink-style.ts +57 -0
  176. package/src/editor/utils/inline-format.ts +236 -0
  177. package/src/editor/utils/measure-distance.ts +120 -0
  178. package/src/editor/utils/override-apply.ts +526 -0
  179. package/src/editor/utils/override-detection.ts +613 -0
  180. package/src/editor/utils/paste-processors.ts +609 -0
  181. package/src/editor/utils/paste-sanitizer.ts +244 -0
  182. package/src/editor/utils/restore-flow.ts +188 -0
  183. package/src/editor/utils/shape-library.ts +171 -0
  184. package/src/editor/utils/slide-root.ts +29 -0
  185. package/src/editor/utils/smart-guides.ts +218 -0
  186. package/src/editor/utils/style-utils.ts +685 -0
  187. package/src/editor/utils/table-edit.ts +151 -0
  188. package/src/editor/utils/tailwind-mappings.ts +778 -0
  189. package/src/editor/utils/tailwind-utils.ts +804 -0
  190. package/src/editor/utils/text-highlight.ts +216 -0
  191. package/src/editor/utils/theme-to-variables.ts +341 -0
  192. package/src/editor/utils/variant-resolver.ts +456 -0
  193. package/src/editor/utils/viewport-utils.ts +295 -0
  194. package/src/hooks/useEditorHistory.ts +195 -0
  195. package/src/hooks/useEditorShortcuts.ts +260 -0
  196. package/src/index.ts +40 -0
  197. package/src/io.ts +134 -0
  198. package/src/lib/agent/slide-agent/types.ts +547 -0
  199. package/src/lib/agent/website-agent/types.ts +805 -0
  200. package/src/lib/api/auth-fetch.ts +58 -0
  201. package/src/lib/deck.ts +69 -0
  202. package/src/lib/export.ts +47 -0
  203. package/src/lib/firebase/config.ts +29 -0
  204. package/src/lib/firebase/css-variables.ts +378 -0
  205. package/src/lib/firebase/editor-components.ts +677 -0
  206. package/src/lib/firebase/storage.ts +469 -0
  207. package/src/lib/utils.ts +6 -0
  208. package/src/styles/editor.css +52 -0
  209. package/src/styles/skin.css +122 -0
  210. package/src/types/css-variables.ts +645 -0
  211. package/src/types/editor-components.ts +944 -0
  212. package/src/types/editor.ts +420 -0
  213. package/src/types/page-master.ts +197 -0
  214. package/src/types/page.ts +419 -0
  215. package/src/types/slide.ts +402 -0
  216. package/src/types/website-theme.ts +788 -0
  217. package/src/types/website.ts +374 -0
  218. package/src/vendor/firebase-firestore.ts +13 -0
  219. package/src/vendor/firebase-functions.ts +17 -0
@@ -0,0 +1,402 @@
1
+ import { Timestamp } from '../vendor/firebase-firestore';
2
+
3
+ // デザイン自由度設定
4
+ // - strict: テンプレート厳守(現行動作)- スライドマスターのデザインを完全に踏襲
5
+ // - standard: テーマガイドライン準拠、レイアウト最適化許可(デフォルト)
6
+ // - creative: テーマカラーのみ準拠、自由なデザイン
7
+ export type DesignFlexibility = 'strict' | 'standard' | 'creative';
8
+
9
+ // スライドマスター(テンプレート)
10
+ export interface SlideMaster {
11
+ id: string;
12
+ name: string;
13
+ description: string;
14
+ category: 'title' | 'content' | 'comparison' | 'chart' | 'conclusion' | 'image' | 'quote' | 'agenda';
15
+ userId: string;
16
+ isPublic?: boolean;
17
+ layout: {
18
+ aspectRatio: '16:9';
19
+ width: number; // 1920
20
+ height: number; // 1080
21
+ sections: Array<{
22
+ type: 'header' | 'content' | 'footer' | 'sidebar';
23
+ position: { x: number; y: number; width: number; height: number };
24
+ styles?: Record<string, string>;
25
+ }>;
26
+ };
27
+ template: {
28
+ htmlTemplate: string;
29
+ cssClasses: string[];
30
+ nextjsCode: string;
31
+ };
32
+ metadata: {
33
+ usageCount: number;
34
+ tags: string[];
35
+ author: string;
36
+ version: string;
37
+ rating: number;
38
+ reviews: unknown[];
39
+ };
40
+ // AI生成されたスライド(1スライドマスター = 1スライド)
41
+ generatedSlide?: SlideGenerationResult;
42
+ // 生成時のプロンプト情報(再生成用)
43
+ generationInfo?: {
44
+ prompt: string;
45
+ attachedFiles?: Array<{
46
+ name: string;
47
+ type: string;
48
+ size: number;
49
+ data: string;
50
+ }>;
51
+ modelName?: string;
52
+ };
53
+ createdAt: Timestamp;
54
+ updatedAt: Timestamp;
55
+ }
56
+
57
+ // プレゼンテーション
58
+ export interface SlidePresentation {
59
+ id: string;
60
+ title: string;
61
+ description: string;
62
+ userId: string;
63
+ slideCount: number;
64
+ sourcePresentationMasterId?: string; // ⛅ 作成元のプレゼンテーションマスターID
65
+ settings: {
66
+ theme: 'light' | 'dark' | 'corporate' | 'modern';
67
+ primaryColor: string;
68
+ fontFamily: string;
69
+ aspectRatio: '16:9';
70
+ };
71
+ // 🆕 直近の生成設定を保存して、再編集・再利用を可能にする
72
+ lastGenerationConfig?: {
73
+ prompt?: string;
74
+ slideMasterId?: string;
75
+ presentationMasterId?: string; // ⛅ 直近で使用したプレゼンテーションマスターID
76
+ theme?: 'light' | 'dark' | 'corporate' | 'modern';
77
+ primaryColor?: string;
78
+ modelName?: string;
79
+ useOriginalGeneration?: boolean;
80
+ slideHeightMode?: 'fixed' | 'auto';
81
+ };
82
+ metadata: {
83
+ totalDuration?: number; // 分
84
+ tags: string[];
85
+ category?: string;
86
+ };
87
+ createdAt: Timestamp;
88
+ updatedAt: Timestamp;
89
+ }
90
+
91
+
92
+ // スライド
93
+ export interface Slide {
94
+ id: string;
95
+ presentationId: string;
96
+ title: string;
97
+ slideNumber: number;
98
+ slideMasterId?: string;
99
+ content: {
100
+ title?: string;
101
+ subtitle?: string;
102
+ bulletPoints?: string[];
103
+ imageUrl?: string;
104
+ customContent?: string;
105
+ chartData?: unknown;
106
+ notes?: string; // スピーカーノート
107
+ html?: string; // 生成されたHTMLコンテンツ
108
+ css?: string; // 生成されたCSSスタイル
109
+ category?: SlideMaster['category']; // スライドのカテゴリ
110
+ metadata?: Record<string, unknown>; // その他のメタデータ
111
+ };
112
+ generatedHtml?: string;
113
+ layoutMode?: 'absolute' | 'auto'; // 🆕 レイアウトモード
114
+ userId: string;
115
+ createdAt: Timestamp;
116
+ updatedAt: Timestamp;
117
+ }
118
+
119
+ // 作成用データ型
120
+ export interface CreateSlideMasterData {
121
+ name: string;
122
+ description: string;
123
+ category: SlideMaster['category'];
124
+ layout: SlideMaster['layout'];
125
+ template: SlideMaster['template'];
126
+ metadata?: Partial<SlideMaster['metadata']>;
127
+ }
128
+
129
+ export interface UpdateSlideMasterData {
130
+ name?: string;
131
+ description?: string;
132
+ category?: SlideMaster['category'];
133
+ layout?: SlideMaster['layout'];
134
+ template?: SlideMaster['template'];
135
+ metadata?: Partial<SlideMaster['metadata']>;
136
+ }
137
+
138
+ export interface CreatePresentationData {
139
+ title: string;
140
+ description: string;
141
+ sourcePresentationMasterId?: string; // ⛅ 作成元のプレゼンテーションマスターID
142
+ settings?: Partial<SlidePresentation['settings']>;
143
+ metadata?: Partial<SlidePresentation['metadata']>;
144
+ }
145
+
146
+ export interface UpdatePresentationData {
147
+ title?: string;
148
+ description?: string;
149
+ slideCount?: number;
150
+ settings?: Partial<SlidePresentation['settings']>;
151
+ metadata?: Partial<SlidePresentation['metadata']>;
152
+ lastGenerationConfig?: SlidePresentation['lastGenerationConfig'];
153
+ }
154
+
155
+ export interface CreateSlideData {
156
+ title: string;
157
+ slideNumber: number;
158
+ slideMasterId?: string;
159
+ content: Slide['content'];
160
+ settings?: {
161
+ backgroundColor?: string;
162
+ transition?: string;
163
+ duration?: number;
164
+ };
165
+ metadata?: {
166
+ generatedAt?: Date;
167
+ modelName?: string;
168
+ generationTime?: string;
169
+ };
170
+ }
171
+
172
+ export interface UpdateSlideData {
173
+ title?: string;
174
+ slideNumber?: number;
175
+ slideMasterId?: string;
176
+ content?: Partial<Slide['content']>;
177
+ generatedHtml?: string;
178
+ layoutMode?: 'absolute' | 'auto'; // 🆕 レイアウトモード
179
+ }
180
+
181
+ // フィルター用型
182
+ export interface SlideMasterFilter {
183
+ category?: SlideMaster['category'];
184
+ userId?: string;
185
+ tags?: string[];
186
+ search?: string;
187
+ isPublic?: boolean;
188
+ }
189
+
190
+ export interface PresentationFilter {
191
+ userId?: string;
192
+ tags?: string[];
193
+ search?: string;
194
+ category?: string;
195
+ }
196
+
197
+ // AI生成用型 - 計画内の個別スライド
198
+ export interface SlidePlanItem {
199
+ id: string; // 一意識別子(並び替え・編集用)
200
+ title: string;
201
+ slideNumber: number;
202
+ category: SlideMaster['category'];
203
+ content: {
204
+ title: string;
205
+ subtitle?: string;
206
+ bulletPoints?: string[];
207
+ notes?: string;
208
+ };
209
+ slideDescription?: string; // そのスライドでカバーすべき内容の短い説明
210
+ templateId?: string; // 推奨するスライドテンプレートID
211
+ recommendedMaster?: string; // スライドマスターID
212
+ // 画像・ビジュアル関連
213
+ visualElements?: {
214
+ needsImage?: boolean; // 画像生成が必要かどうか
215
+ imageDescription?: string; // 必要な画像の説明
216
+ imageStyle?: 'realistic' | 'illustration' | 'icon' | 'diagram' | 'flat' | 'minimal';
217
+ diagramType?: 'flowchart' | 'comparison' | 'timeline' | 'hierarchy' | 'process' | 'cycle';
218
+ };
219
+ // 計画編集用フィールド
220
+ userInstructions?: string; // ユーザーの追加指示メモ
221
+ isDeleted?: boolean; // 削除フラグ(論理削除)
222
+ isNew?: boolean; // 新規追加フラグ
223
+ }
224
+
225
+ export interface SlidePresentationPlan {
226
+ overview: string;
227
+ slides: SlidePlanItem[];
228
+ structure: {
229
+ totalSlides: number;
230
+ estimatedDuration: number; // 分
231
+ flow: string; // プレゼンの流れ説明
232
+ };
233
+ theme: {
234
+ primaryColor: string;
235
+ mood: string;
236
+ audience: string;
237
+ };
238
+ }
239
+
240
+ // 一覧表示用の拡張型(先頭スライド含む)
241
+ export interface PresentationWithFirstSlide extends SlidePresentation {
242
+ firstSlide?: {
243
+ html: string;
244
+ title: string;
245
+ };
246
+ }
247
+
248
+ // スライドマスター生成用型
249
+ export interface SlideMasterGenerationRequest {
250
+ name: string;
251
+ description: string;
252
+ category: SlideMaster['category'];
253
+ samplePrompt: string; // サンプルスライド生成用プロンプト
254
+ slideCount?: number; // 自動生成するサンプルスライド数(デフォルト1枚)
255
+ attachedFiles?: Array<{
256
+ name: string;
257
+ type: string;
258
+ size: number;
259
+ data: string;
260
+ }>;
261
+ }
262
+
263
+ // プレゼンテーション生成リクエスト(スライドマスター情報含む)
264
+ export interface PresentationGenerationRequest {
265
+ prompt: string;
266
+ slideMasterId?: string;
267
+ slideMasterInfo?: {
268
+ htmlTemplate: string;
269
+ cssStyles?: string;
270
+ category: SlideMaster['category'];
271
+ sampleSlides?: SlideGenerationResult[];
272
+ };
273
+ attachedFiles?: Array<{
274
+ name: string;
275
+ type: string;
276
+ data: string;
277
+ }>;
278
+ theme?: SlidePresentation['settings']['theme'];
279
+ primaryColor?: string;
280
+ }
281
+
282
+ export interface SlideGenerationResult {
283
+ title: string;
284
+ slideNumber: number;
285
+ category: SlideMaster['category'];
286
+ content: Slide['content'];
287
+ html: string;
288
+ css: string;
289
+ notes?: string; // スピーカーノート
290
+ mainComponent?: {
291
+ name: string;
292
+ code: string;
293
+ props: Record<string, unknown>;
294
+ };
295
+ explanation?: string;
296
+ slideMasterId?: string;
297
+ metadata?: {
298
+ slideNumber: number;
299
+ category: string;
300
+ generatedAt: string;
301
+ modelName: string;
302
+ estimatedTime: string;
303
+ };
304
+ }
305
+
306
+ // 出力用型
307
+ export interface SlideExportOptions {
308
+ format: 'html' | 'figma';
309
+ includeNotes?: boolean;
310
+ theme?: string;
311
+ resolution?: '1920x1080' | '1280x720';
312
+ }
313
+
314
+ export interface SlideExportResult {
315
+ success: boolean;
316
+ data?: string;
317
+ downloadUrl?: string;
318
+ error?: string;
319
+ }
320
+
321
+ // 🆕 プレゼンテーションマスターのカテゴリ
322
+ export type PresentationMasterCategory =
323
+ | 'proposal' // 企画提案書
324
+ | 'design' // デザインコンセプト
325
+ | 'requirements' // 要件定義書
326
+ | 'report' // レポート・報告書
327
+ | 'pitch' // ピッチデック
328
+ | 'training' // 研修・教育資料
329
+ | 'other'; // その他
330
+
331
+ // 🆕 プレゼンテーションマスター内のスライド定義
332
+ export interface PresentationMasterSlide {
333
+ id: string;
334
+ slideMasterId: string; // 参照するスライドマスターID
335
+ slideOrder: number; // スライド順序(1始まり)
336
+ title?: string; // カスタムタイトル(上書き用)
337
+ notes?: string; // 生成時の指示メモ
338
+ overrides?: { // スライドマスターからの上書き設定
339
+ category?: SlideMaster['category'];
340
+ variables?: Record<string, string>;
341
+ };
342
+ }
343
+
344
+ // 🆕 プレゼンテーションマスター(テンプレート)
345
+ export interface PresentationMaster {
346
+ id: string;
347
+ name: string; // 例: "企画提案書テンプレート"
348
+ description: string;
349
+ category: PresentationMasterCategory;
350
+ userId: string;
351
+
352
+ // スライド構成(順序付きリスト)
353
+ slides: PresentationMasterSlide[];
354
+
355
+ settings: {
356
+ theme: 'light' | 'dark' | 'corporate' | 'modern';
357
+ primaryColor: string;
358
+ fontFamily: string;
359
+ aspectRatio: '16:9';
360
+ };
361
+
362
+ metadata: {
363
+ usageCount: number;
364
+ tags: string[];
365
+ author: string;
366
+ version: string;
367
+ estimatedDuration?: number; // 推定所要時間(分)
368
+ isPublic: boolean;
369
+ };
370
+
371
+ createdAt: Timestamp;
372
+ updatedAt: Timestamp;
373
+ }
374
+
375
+ // 🆕 プレゼンテーションマスター作成用データ型
376
+ export interface CreatePresentationMasterData {
377
+ name: string;
378
+ description: string;
379
+ category: PresentationMasterCategory;
380
+ slides: Omit<PresentationMasterSlide, 'id'>[];
381
+ settings?: Partial<PresentationMaster['settings']>;
382
+ metadata?: Partial<PresentationMaster['metadata']>;
383
+ }
384
+
385
+ // 🆕 プレゼンテーションマスター更新用データ型
386
+ export interface UpdatePresentationMasterData {
387
+ name?: string;
388
+ description?: string;
389
+ category?: PresentationMasterCategory;
390
+ slides?: PresentationMasterSlide[];
391
+ settings?: Partial<PresentationMaster['settings']>;
392
+ metadata?: Partial<PresentationMaster['metadata']>;
393
+ }
394
+
395
+ // 🆕 プレゼンテーションマスターフィルター
396
+ export interface PresentationMasterFilter {
397
+ category?: PresentationMasterCategory;
398
+ userId?: string;
399
+ tags?: string[];
400
+ search?: string;
401
+ isPublic?: boolean;
402
+ }