@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,374 @@
1
+ import { Timestamp } from '../vendor/firebase-firestore';
2
+
3
+ // =====================================================
4
+ // Website(Webサイト)
5
+ // =====================================================
6
+
7
+ // Webサイトのカテゴリ
8
+ export type WebsiteCategory =
9
+ | 'landing' // ランディングページ
10
+ | 'corporate' // コーポレートサイト
11
+ | 'portfolio' // ポートフォリオ
12
+ | 'blog' // ブログ
13
+ | 'ecommerce' // ECサイト
14
+ | 'other'; // その他
15
+
16
+ // Webサイト
17
+ export interface Website {
18
+ id: string;
19
+ title: string;
20
+ description: string;
21
+ userId: string;
22
+ pageCount: number;
23
+ sourceWebsiteMasterId?: string; // 作成元のWebサイトマスターID
24
+ settings: {
25
+ theme: 'light' | 'dark' | 'corporate' | 'modern';
26
+ primaryColor: string;
27
+ fontFamily: string;
28
+ domain?: string;
29
+ favicon?: string;
30
+ };
31
+ // 直近の生成設定を保存して、再編集・再利用を可能にする
32
+ lastGenerationConfig?: {
33
+ prompt?: string;
34
+ pageMasterId?: string;
35
+ websiteMasterId?: string;
36
+ theme?: 'light' | 'dark' | 'corporate' | 'modern';
37
+ primaryColor?: string;
38
+ modelName?: string;
39
+ };
40
+ metadata: {
41
+ tags: string[];
42
+ category?: WebsiteCategory;
43
+ isPublished?: boolean;
44
+ publishedUrl?: string;
45
+ };
46
+ createdAt: Timestamp;
47
+ updatedAt: Timestamp;
48
+ }
49
+
50
+ // =====================================================
51
+ // WebPage(Webページ)
52
+ // =====================================================
53
+
54
+ // ページのカテゴリ(Webサイトのページタイプ)
55
+ // マルチページWebサイトにおける各ページの種類を表す
56
+ export type PageCategory =
57
+ | 'home' // トップページ・ホームページ
58
+ | 'services' // サービス紹介ページ
59
+ | 'about' // 会社概要・自己紹介ページ
60
+ | 'contact' // お問い合わせページ
61
+ | 'pricing' // 料金・プランページ
62
+ | 'portfolio' // 実績・ポートフォリオページ
63
+ | 'blog' // ブログ・お知らせページ
64
+ | 'news' // ニュース・更新情報ページ
65
+ | 'faq' // よくある質問ページ
66
+ | 'team' // チーム紹介ページ
67
+ | 'custom'; // その他のカスタムページ
68
+
69
+ // セクションカテゴリ(ページマスター用)
70
+ // ページ内のセクション・コンポーネントの種類を表す
71
+ export type SectionCategory =
72
+ | 'hero' // ヒーローセクション
73
+ | 'features' // 機能紹介セクション
74
+ | 'pricing' // 料金セクション
75
+ | 'testimonials' // お客様の声セクション
76
+ | 'contact' // お問い合わせフォームセクション
77
+ | 'about' // 会社概要セクション
78
+ | 'blog' // ブログセクション
79
+ | 'footer' // フッターセクション
80
+ | 'header' // ヘッダーセクション
81
+ | 'cta' // CTAセクション
82
+ | 'gallery' // ギャラリーセクション
83
+ | 'team' // チーム紹介セクション
84
+ | 'faq' // FAQセクション
85
+ | 'custom'; // カスタムセクション
86
+
87
+ // Webページ
88
+ export interface WebPage {
89
+ id: string;
90
+ websiteId: string;
91
+ title: string;
92
+ slug: string;
93
+ pageNumber: number;
94
+ pageMasterId?: string;
95
+ content: {
96
+ title?: string;
97
+ description?: string;
98
+ html?: string;
99
+ css?: string;
100
+ sections?: PageSection[];
101
+ metadata?: Record<string, unknown>;
102
+ };
103
+ seo?: {
104
+ metaTitle?: string;
105
+ metaDescription?: string;
106
+ ogImage?: string;
107
+ keywords?: string[];
108
+ };
109
+ layoutMode?: 'absolute' | 'auto';
110
+ userId: string;
111
+ createdAt: Timestamp;
112
+ updatedAt: Timestamp;
113
+ }
114
+
115
+ // ページセクション
116
+ export interface PageSection {
117
+ id: string;
118
+ type: PageCategory;
119
+ order: number;
120
+ content: {
121
+ html?: string;
122
+ css?: string;
123
+ data?: Record<string, unknown>;
124
+ };
125
+ }
126
+
127
+ // =====================================================
128
+ // WebsitePlan(Webサイト生成計画)
129
+ // =====================================================
130
+
131
+ // 計画内の個別ページ
132
+ export interface PagePlanItem {
133
+ id: string;
134
+ title: string;
135
+ pageNumber: number;
136
+ slug: string;
137
+ category: PageCategory;
138
+ content: {
139
+ title: string;
140
+ description?: string;
141
+ sections?: string[];
142
+ notes?: string;
143
+ };
144
+ recommendedMaster?: string;
145
+ // 画像・ビジュアル関連
146
+ visualElements?: {
147
+ needsImage?: boolean;
148
+ imageDescription?: string;
149
+ imageStyle?: 'realistic' | 'illustration' | 'icon' | 'diagram' | 'flat' | 'minimal';
150
+ };
151
+ // Figma参照情報(デザイン再現時に使用)
152
+ figmaReference?: {
153
+ url: string; // FigmaのURL
154
+ nodeId?: string; // 特定のノードID
155
+ nodeName?: string; // ノード名
156
+ description?: string; // このデザインの説明
157
+ };
158
+ // 計画編集用フィールド
159
+ userInstructions?: string;
160
+ isDeleted?: boolean;
161
+ isNew?: boolean;
162
+ }
163
+
164
+ // Webサイト生成計画
165
+ export interface WebsitePlan {
166
+ overview: string;
167
+ pages: PagePlanItem[];
168
+ structure: {
169
+ totalPages: number;
170
+ navigation: NavigationItem[];
171
+ sitemap: string;
172
+ };
173
+ theme: {
174
+ primaryColor: string;
175
+ mood: string;
176
+ targetAudience: string;
177
+ };
178
+ // Figma参照情報(計画全体のソース)
179
+ figmaSource?: {
180
+ url: string; // 元のFigma URL
181
+ fileKey?: string; // Figmaファイルキー
182
+ nodeName?: string; // メインノード名
183
+ isDesignReproduction?: boolean; // デザイン再現モードかどうか
184
+ };
185
+ }
186
+
187
+ // ナビゲーション項目
188
+ export interface NavigationItem {
189
+ label: string;
190
+ slug: string;
191
+ order: number;
192
+ children?: NavigationItem[];
193
+ }
194
+
195
+ // =====================================================
196
+ // 作成・更新用データ型
197
+ // =====================================================
198
+
199
+ export interface CreateWebsiteData {
200
+ title: string;
201
+ description: string;
202
+ sourceWebsiteMasterId?: string;
203
+ settings?: Partial<Website['settings']>;
204
+ metadata?: Partial<Website['metadata']>;
205
+ }
206
+
207
+ export interface UpdateWebsiteData {
208
+ title?: string;
209
+ description?: string;
210
+ pageCount?: number;
211
+ settings?: Partial<Website['settings']>;
212
+ metadata?: Partial<Website['metadata']>;
213
+ lastGenerationConfig?: Website['lastGenerationConfig'];
214
+ }
215
+
216
+ export interface CreatePageData {
217
+ title: string;
218
+ slug: string;
219
+ pageNumber: number;
220
+ pageMasterId?: string;
221
+ content: WebPage['content'];
222
+ seo?: WebPage['seo'];
223
+ layoutMode?: 'absolute' | 'auto';
224
+ }
225
+
226
+ export interface UpdatePageData {
227
+ title?: string;
228
+ slug?: string;
229
+ pageNumber?: number;
230
+ pageMasterId?: string;
231
+ content?: Partial<WebPage['content']>;
232
+ seo?: Partial<WebPage['seo']>;
233
+ layoutMode?: 'absolute' | 'auto';
234
+ }
235
+
236
+ // =====================================================
237
+ // フィルター用型
238
+ // =====================================================
239
+
240
+ export interface WebsiteFilter {
241
+ userId?: string;
242
+ tags?: string[];
243
+ search?: string;
244
+ category?: WebsiteCategory;
245
+ isPublished?: boolean;
246
+ }
247
+
248
+ export interface PageFilter {
249
+ websiteId?: string;
250
+ category?: PageCategory;
251
+ search?: string;
252
+ }
253
+
254
+ // =====================================================
255
+ // AI生成用型
256
+ // =====================================================
257
+
258
+ // ページ生成リクエスト
259
+ export interface PageGenerationRequest {
260
+ prompt: string;
261
+ pageMasterId?: string;
262
+ pageMasterInfo?: {
263
+ htmlTemplate: string;
264
+ cssStyles?: string;
265
+ category: PageCategory;
266
+ samplePages?: PageGenerationResult[];
267
+ };
268
+ attachedFiles?: Array<{
269
+ name: string;
270
+ type: string;
271
+ data: string;
272
+ }>;
273
+ theme?: Website['settings']['theme'];
274
+ primaryColor?: string;
275
+ websiteContext?: {
276
+ title: string;
277
+ description: string;
278
+ existingPages?: Array<{
279
+ title: string;
280
+ slug: string;
281
+ category: PageCategory;
282
+ }>;
283
+ };
284
+ }
285
+
286
+ // ページ生成結果
287
+ export interface PageGenerationResult {
288
+ title: string;
289
+ slug: string;
290
+ pageNumber: number;
291
+ category: PageCategory;
292
+ content: WebPage['content'];
293
+ html: string;
294
+ css: string;
295
+ seo?: WebPage['seo'];
296
+ metadata?: {
297
+ pageNumber: number;
298
+ category: string;
299
+ generatedAt: string;
300
+ modelName: string;
301
+ estimatedTime: string;
302
+ };
303
+ }
304
+
305
+ // Webサイト生成リクエスト
306
+ export interface WebsiteGenerationRequest {
307
+ prompt: string;
308
+ pageCount?: number;
309
+ websiteMasterId?: string;
310
+ websiteMasterInfo?: {
311
+ name: string;
312
+ description: string;
313
+ pages: Array<{
314
+ title: string;
315
+ slug: string;
316
+ category: PageCategory;
317
+ }>;
318
+ };
319
+ attachedFiles?: Array<{
320
+ name: string;
321
+ type: string;
322
+ data: string;
323
+ }>;
324
+ theme?: Website['settings']['theme'];
325
+ primaryColor?: string;
326
+ /** When true, skip theme settings and prioritize Figma design fidelity */
327
+ codingMode?: boolean;
328
+ }
329
+
330
+ // =====================================================
331
+ // 一覧表示用の拡張型
332
+ // =====================================================
333
+
334
+ // 一覧表示用(先頭ページ含む)
335
+ export interface WebsiteWithFirstPage extends Website {
336
+ firstPage?: {
337
+ html: string;
338
+ title: string;
339
+ slug: string;
340
+ };
341
+ }
342
+
343
+ // =====================================================
344
+ // 出力用型
345
+ // =====================================================
346
+
347
+ export interface WebsiteExportOptions {
348
+ format: 'html' | 'zip' | 'json';
349
+ includeAssets?: boolean;
350
+ minify?: boolean;
351
+ }
352
+
353
+ export interface WebsiteExportResult {
354
+ success: boolean;
355
+ data?: string;
356
+ downloadUrl?: string;
357
+ error?: string;
358
+ }
359
+
360
+ // =====================================================
361
+ // 生成ステータス
362
+ // =====================================================
363
+
364
+ export interface WebsiteGenerationStatus {
365
+ status: 'idle' | 'planning' | 'generating' | 'completed' | 'error';
366
+ progress: number;
367
+ currentPage?: number;
368
+ totalPages?: number;
369
+ message?: string;
370
+ error?: string;
371
+ completedPages?: number[];
372
+ startedAt?: Timestamp;
373
+ completedAt?: Timestamp;
374
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `firebase/firestore` の型互換シム。
3
+ *
4
+ * 取り込んだ型定義(types/slide.ts 等)が createdAt/updatedAt の型として
5
+ * Timestamp を参照しているだけで、値としては使っていない。
6
+ * ワイヤーフレーム編集にバックエンドは不要なので、実体を持たない型だけを置く。
7
+ */
8
+ export type Timestamp = {
9
+ seconds: number
10
+ nanoseconds: number
11
+ toDate(): Date
12
+ toMillis(): number
13
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `firebase/functions` のシム。
3
+ *
4
+ * 使っているのは HtmlImportDialog の「URLからHTMLを取り込む」1機能だけで、
5
+ * 実体はサーバー側の Cloud Functions。このエディタはローカル完結のため、
6
+ * 呼ばれたら理由を明示して失敗させる(黙って握り潰さない)。
7
+ */
8
+ export function httpsCallable<Req = unknown, Res = unknown>(
9
+ _functions: unknown,
10
+ name: string,
11
+ ): (data: Req) => Promise<{ data: Res }> {
12
+ return async () => {
13
+ throw new Error(
14
+ `この機能(${name})はサーバー側の処理を必要とするため、ローカル版のワイヤーフレーム編集では使えません。`,
15
+ )
16
+ }
17
+ }