@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,419 @@
1
+ import { Timestamp } from '../vendor/firebase-firestore';
2
+
3
+ export interface Page {
4
+ id: string;
5
+ projectId: string;
6
+ title: string;
7
+ slug: string;
8
+ description?: string; // ページの説明
9
+ fullPath: string;
10
+ parentId?: string;
11
+ children: string[];
12
+ level: number;
13
+ order: number;
14
+ settings: PageSettings;
15
+ currentGenerationId?: string;
16
+ totalGenerations: number;
17
+ // レイアウト関連フィールド
18
+ selectedLayoutId?: string; // このページに適用するレイアウトID
19
+ // フロー管理関連フィールド
20
+ flowPosition?: { x: number; y: number }; // React Flowでの位置
21
+ // リソース関連フィールド
22
+ resourceCount?: number; // 関連リソース数
23
+ lastResourceUpdate?: Timestamp; // 最終リソース更新日時
24
+ // 🆕 ページ戦略・分析フィールド
25
+ priority?: 'highest' | 'high' | 'medium' | 'low'; // 重要度
26
+ purpose?: 'awareness' | 'consideration' | 'conversion' | 'support' | 'other'; // 目的
27
+ targetAudience?: 'potential' | 'aware' | 'consideration' | 'existing' | 'other'; // ターゲット
28
+ strategy?: string; // 戦略(自由入力)
29
+ functionalRequirements?: string; // 機能要件(自由入力)
30
+ createdAt: Timestamp;
31
+ updatedAt: Timestamp;
32
+ lastGeneratedAt?: Timestamp; // 最終生成日時
33
+ // Figmaエクスポート関連フィールド
34
+ figmaExportData?: string; // Figmaクリップボードデータ
35
+ figmaExportedAt?: Timestamp; // Figmaエクスポート日時
36
+ }
37
+
38
+ /**
39
+ * OGP (Open Graph Protocol) 設定
40
+ */
41
+ export interface OgpSettings {
42
+ /** og:title */
43
+ title?: string;
44
+ /** og:description */
45
+ description?: string;
46
+ /** og:image URL */
47
+ image?: string;
48
+ /** og:type (website, article, product など) */
49
+ type?: 'website' | 'article' | 'product' | 'profile' | string;
50
+ /** og:url */
51
+ url?: string;
52
+ /** og:site_name */
53
+ siteName?: string;
54
+ /** og:locale */
55
+ locale?: string;
56
+ }
57
+
58
+ /**
59
+ * Twitter Card 設定
60
+ */
61
+ export interface TwitterCardSettings {
62
+ /** twitter:card (summary, summary_large_image, app, player) */
63
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
64
+ /** twitter:site (@username) */
65
+ site?: string;
66
+ /** twitter:creator (@username) */
67
+ creator?: string;
68
+ /** twitter:title */
69
+ title?: string;
70
+ /** twitter:description */
71
+ description?: string;
72
+ /** twitter:image URL */
73
+ image?: string;
74
+ }
75
+
76
+ /**
77
+ * 外部リソース
78
+ */
79
+ export interface ExternalResource {
80
+ /** リソースID */
81
+ id: string;
82
+ /** リソースURL */
83
+ url: string;
84
+ /** リソースタイプ */
85
+ type: 'css' | 'js';
86
+ /** 読み込み位置 (JSのみ) */
87
+ position?: 'head' | 'body-start' | 'body-end';
88
+ /** async属性 (JSのみ) */
89
+ async?: boolean;
90
+ /** defer属性 (JSのみ) */
91
+ defer?: boolean;
92
+ /** 説明・メモ */
93
+ description?: string;
94
+ }
95
+
96
+ export interface PageSettings {
97
+ // ===== 基本設定(既存) =====
98
+ isPublished: boolean;
99
+ showInNavigation: boolean;
100
+ navigationLabel?: string;
101
+
102
+ // ===== SEO設定 =====
103
+ metaTitle?: string;
104
+ metaDescription?: string;
105
+ metaKeywords?: string;
106
+ canonicalUrl?: string;
107
+ robots?: string;
108
+
109
+ // ===== OGP設定 =====
110
+ /** @deprecated ogImageの代わりにogp.imageを使用してください */
111
+ ogImage?: string;
112
+ ogp?: OgpSettings;
113
+
114
+ // ===== Twitter Card設定 =====
115
+ twitter?: TwitterCardSettings;
116
+
117
+ // ===== カスタムコード =====
118
+ /** @deprecated customCSSの代わりにcustomCssを使用してください */
119
+ customCSS?: string;
120
+ /** @deprecated customJSの代わりにcustomJsを使用してください */
121
+ customJS?: string;
122
+ customCss?: string;
123
+ customJs?: string;
124
+
125
+ // ===== HTML挿入 =====
126
+ /** ページ固有の<head>追加HTML */
127
+ customHeadHtml?: string;
128
+ /** ページ固有の<body>開始直後HTML */
129
+ bodyStartHtml?: string;
130
+ /** ページ固有の</body>直前HTML */
131
+ bodyEndHtml?: string;
132
+
133
+ // ===== 外部リソース =====
134
+ externalCss?: ExternalResource[];
135
+ externalJs?: ExternalResource[];
136
+ }
137
+
138
+ export interface PageGeneration {
139
+ id: string;
140
+ pageId: string;
141
+ prompt: string;
142
+ result: GenerationResult;
143
+ version: number;
144
+ isCurrent: boolean;
145
+ createdAt: Timestamp;
146
+ }
147
+
148
+ export interface GenerationResult {
149
+ html: string;
150
+ css: string;
151
+ components: ComponentUsage[];
152
+ navigation: NavigationStructure;
153
+ internalLinks: InternalLink[];
154
+ metadata: GenerationMetadata;
155
+ }
156
+
157
+ export interface ComponentUsage {
158
+ componentId: string;
159
+ componentName: string;
160
+ props: Record<string, unknown>;
161
+ position: {
162
+ x: number;
163
+ y: number;
164
+ width: number;
165
+ height: number;
166
+ };
167
+ }
168
+
169
+ export interface NavigationStructure {
170
+ global: NavigationItem[];
171
+ breadcrumb: BreadcrumbItem[];
172
+ sidebar?: NavigationItem[];
173
+ footer?: NavigationItem[];
174
+ }
175
+
176
+ export interface NavigationItem {
177
+ label: string;
178
+ path: string;
179
+ pageId: string;
180
+ children?: NavigationItem[];
181
+ isActive?: boolean;
182
+ isCurrent?: boolean;
183
+ }
184
+
185
+ export interface BreadcrumbItem {
186
+ label: string;
187
+ path: string;
188
+ pageId: string;
189
+ }
190
+
191
+ export interface InternalLink {
192
+ fromPageId: string;
193
+ toPageId: string;
194
+ linkText: string;
195
+ linkType: 'navigation' | 'content' | 'breadcrumb' | 'footer';
196
+ isValid: boolean;
197
+ }
198
+
199
+ export interface GenerationMetadata {
200
+ generationTime: number;
201
+ tokenUsage: number;
202
+ quality: number;
203
+ aiModel: string;
204
+ promptVersion: string;
205
+ }
206
+
207
+ export interface CreatePageData {
208
+ title: string;
209
+ slug: string;
210
+ description?: string;
211
+ parentId?: string;
212
+ selectedLayoutId?: string;
213
+ order?: number;
214
+ settings?: Partial<PageSettings>;
215
+ // 🆕 ページ戦略・分析フィールド
216
+ priority?: 'highest' | 'high' | 'medium' | 'low';
217
+ purpose?: 'awareness' | 'consideration' | 'conversion' | 'support' | 'other';
218
+ targetAudience?: 'potential' | 'aware' | 'consideration' | 'existing' | 'other';
219
+ strategy?: string;
220
+ functionalRequirements?: string;
221
+ }
222
+
223
+ export interface UpdatePageData {
224
+ title?: string;
225
+ slug?: string;
226
+ description?: string;
227
+ parentId?: string;
228
+ order?: number;
229
+ settings?: Partial<PageSettings>;
230
+ // レイアウト関連フィールド
231
+ selectedLayoutId?: string;
232
+ // 🆕 ページ戦略・分析フィールド
233
+ priority?: 'highest' | 'high' | 'medium' | 'low';
234
+ purpose?: 'awareness' | 'consideration' | 'conversion' | 'support' | 'other';
235
+ targetAudience?: 'potential' | 'aware' | 'consideration' | 'existing' | 'other';
236
+ strategy?: string;
237
+ functionalRequirements?: string;
238
+ // Figmaエクスポート関連フィールド
239
+ figmaExportData?: string;
240
+ figmaExportedAt?: Timestamp;
241
+ }
242
+
243
+ export interface MovePageData {
244
+ newParentId?: string;
245
+ newOrder: number;
246
+ }
247
+
248
+ export const DEFAULT_PAGE_SETTINGS: PageSettings = {
249
+ isPublished: true,
250
+ showInNavigation: true,
251
+ ogp: {
252
+ type: 'website',
253
+ locale: 'ja_JP',
254
+ },
255
+ twitter: {
256
+ card: 'summary_large_image',
257
+ },
258
+ };
259
+
260
+ /**
261
+ * プロジェクトレベルのデフォルト設定
262
+ */
263
+ export interface ProjectPageSettings {
264
+ // ===== 基本SEO =====
265
+ /** デフォルトのtitleテンプレート (例: "{page} | サイト名") */
266
+ titleTemplate?: string;
267
+ /** デフォルトのdescription */
268
+ defaultDescription?: string;
269
+ /** デフォルトのkeywords */
270
+ defaultKeywords?: string;
271
+ /** 言語設定 */
272
+ language?: string;
273
+ /** 文字エンコーディング */
274
+ charset?: string;
275
+
276
+ // ===== OGP デフォルト =====
277
+ ogp?: OgpSettings;
278
+
279
+ // ===== Twitter Card デフォルト =====
280
+ twitter?: TwitterCardSettings;
281
+
282
+ // ===== Favicon =====
283
+ favicon?: {
284
+ /** 標準favicon (ICO/PNG) */
285
+ ico?: string;
286
+ /** Apple Touch Icon */
287
+ appleTouchIcon?: string;
288
+ /** 32x32 PNG */
289
+ png32?: string;
290
+ /** 16x16 PNG */
291
+ png16?: string;
292
+ /** SVG favicon */
293
+ svg?: string;
294
+ /** manifest.json URL */
295
+ manifest?: string;
296
+ };
297
+
298
+ // ===== 共通挿入コンテンツ =====
299
+ /** 全ページ共通の<head>追加HTML (analytics, fonts等) */
300
+ commonHeadHtml?: string;
301
+ /** 全ページ共通の<body>開始直後HTML */
302
+ commonBodyStartHtml?: string;
303
+ /** 全ページ共通の</body>直前HTML */
304
+ commonBodyEndHtml?: string;
305
+
306
+ // ===== 外部リソース =====
307
+ /** 全ページ共通の外部CSS */
308
+ externalCss?: ExternalResource[];
309
+ /** 全ページ共通の外部JS */
310
+ externalJs?: ExternalResource[];
311
+
312
+ // ===== 共通スタイル・スクリプト =====
313
+ /** 全ページ共通のカスタムCSS */
314
+ commonCss?: string;
315
+ /** 全ページ共通のカスタムJS */
316
+ commonJs?: string;
317
+ }
318
+
319
+ export const DEFAULT_PROJECT_PAGE_SETTINGS: ProjectPageSettings = {
320
+ titleTemplate: '{page}',
321
+ language: 'ja',
322
+ charset: 'UTF-8',
323
+ ogp: {
324
+ type: 'website',
325
+ locale: 'ja_JP',
326
+ },
327
+ twitter: {
328
+ card: 'summary_large_image',
329
+ },
330
+ };
331
+
332
+ // 🆕 ページ戦略・分析の選択肢定数
333
+ export const PAGE_PRIORITY_OPTIONS = [
334
+ { value: 'highest', label: '最高' },
335
+ { value: 'high', label: '高' },
336
+ { value: 'medium', label: '中' },
337
+ { value: 'low', label: '低' }
338
+ ] as const;
339
+
340
+ export const PAGE_PURPOSE_OPTIONS = [
341
+ { value: 'awareness', label: '集客・認知' },
342
+ { value: 'consideration', label: '理解促進・比較検討' },
343
+ { value: 'conversion', label: '行動喚起(コンバージョン)' },
344
+ { value: 'support', label: '顧客サポート・関係維持' },
345
+ { value: 'other', label: 'その他・管理的' }
346
+ ] as const;
347
+
348
+ export const PAGE_TARGET_AUDIENCE_OPTIONS = [
349
+ { value: 'potential', label: '潜在層' },
350
+ { value: 'aware', label: '課題認知層' },
351
+ { value: 'consideration', label: '比較検討層' },
352
+ { value: 'existing', label: '既存顧客・ファン層' },
353
+ { value: 'other', label: 'その他' }
354
+ ] as const;
355
+
356
+ // フロー管理用のメモデータ
357
+ export interface ProjectMemo {
358
+ id: string;
359
+ projectId: string;
360
+ content: string;
361
+ color: string;
362
+ position: { x: number; y: number };
363
+ createdAt: Timestamp;
364
+ updatedAt: Timestamp;
365
+ }
366
+
367
+ export interface CreateMemoData {
368
+ content: string;
369
+ color: string;
370
+ position: { x: number; y: number };
371
+ }
372
+
373
+ export interface UpdateMemoData {
374
+ content?: string;
375
+ color?: string;
376
+ position?: { x: number; y: number };
377
+ }
378
+
379
+ export interface PageWithComponents extends Page {
380
+ // ... existing code ...
381
+ }
382
+
383
+ // ページリソース関連の型定義
384
+ export interface PageResource {
385
+ id: string;
386
+ pageId: string;
387
+ projectId: string;
388
+ fileName: string;
389
+ originalFileName: string;
390
+ fileType: 'pdf' | 'csv' | 'md' | 'txt' | 'mp4';
391
+ fileSize: number;
392
+ description?: string;
393
+ tags?: string[]; // リソースのタグ
394
+ storageUrl: string; // Firebase Storageのダウンロード URL
395
+ storagePath: string; // Firebase Storage内のパス
396
+ uploadedBy: string; // アップロードしたユーザーID
397
+ isPublic?: boolean; // 公開設定
398
+ downloadCount: number; // ダウンロード数
399
+ createdAt: Timestamp;
400
+ updatedAt: Timestamp;
401
+ }
402
+
403
+ export interface CreatePageResourceData {
404
+ fileName: string;
405
+ fileType: 'pdf' | 'csv' | 'md' | 'txt' | 'mp4';
406
+ fileSize: number;
407
+ description?: string;
408
+ }
409
+
410
+ export interface UpdatePageResourceData {
411
+ fileName?: string;
412
+ description?: string;
413
+ downloadCount?: number;
414
+ }
415
+
416
+ export interface PageResourceUpload {
417
+ file: File;
418
+ description?: string;
419
+ }