@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.
- package/LICENSE +21 -0
- package/NOTICE +52 -0
- package/README.md +143 -0
- package/dist/editor.css +2 -0
- package/package.json +94 -0
- package/src/components/DeckSlideRender.tsx +21 -0
- package/src/components/SaveNote.tsx +21 -0
- package/src/components/auth/AuthProvider.tsx +44 -0
- package/src/components/ui/accordion.tsx +57 -0
- package/src/components/ui/alert-dialog.tsx +141 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.tsx +76 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/context-menu.tsx +200 -0
- package/src/components/ui/dialog.tsx +122 -0
- package/src/components/ui/dropdown-menu.tsx +201 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/popover.tsx +33 -0
- package/src/components/ui/scroll-area.tsx +48 -0
- package/src/components/ui/scrubbable-label.tsx +95 -0
- package/src/components/ui/select.tsx +159 -0
- package/src/components/ui/separator.tsx +31 -0
- package/src/components/ui/slider.tsx +28 -0
- package/src/components/ui/switch.tsx +29 -0
- package/src/components/ui/tabs.tsx +55 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/components/viewer/useDeck.ts +58 -0
- package/src/editor/EditorContext.tsx +632 -0
- package/src/editor/EditorToolbar.tsx +446 -0
- package/src/editor/FrontendVisualEditor.tsx +2595 -0
- package/src/editor/autosave.ts +34 -0
- package/src/editor/components/AiPromptPopover.tsx +378 -0
- package/src/editor/components/BreakpointGuides.tsx +323 -0
- package/src/editor/components/BreakpointSelector.tsx +180 -0
- package/src/editor/components/ComponentPropertyEditor.tsx +426 -0
- package/src/editor/components/CssEditorDialog.tsx +168 -0
- package/src/editor/components/EditorCanvas.tsx +987 -0
- package/src/editor/components/EditorContextMenu.tsx +515 -0
- package/src/editor/components/EditorFooter.tsx +81 -0
- package/src/editor/components/EditorHeader.tsx +524 -0
- package/src/editor/components/EditorLayerPanel.tsx +1197 -0
- package/src/editor/components/EditorPropertyPanel.tsx +2996 -0
- package/src/editor/components/EditorSidebar.tsx +226 -0
- package/src/editor/components/FigmaColorPicker.tsx +1577 -0
- package/src/editor/components/HtmlEditorDialog.tsx +71 -0
- package/src/editor/components/HtmlImportDialog.tsx +346 -0
- package/src/editor/components/JsEditorDialog.tsx +175 -0
- package/src/editor/components/LayerTreeItem.tsx +494 -0
- package/src/editor/components/MasterComponentEditor.tsx +846 -0
- package/src/editor/components/MediaLibraryDialog.tsx +447 -0
- package/src/editor/components/PageSettingsDialog.tsx +776 -0
- package/src/editor/components/VariablePicker.tsx +355 -0
- package/src/editor/components/VariablesDialog.tsx +564 -0
- package/src/editor/components/VariantEditor.tsx +687 -0
- package/src/editor/components/VariantMatrix.tsx +507 -0
- package/src/editor/components/component-panel/CategoryAccordion.tsx +139 -0
- package/src/editor/components/component-panel/ComponentGrid.tsx +51 -0
- package/src/editor/components/component-panel/ComponentItem.tsx +368 -0
- package/src/editor/components/component-panel/ComponentPanel.tsx +275 -0
- package/src/editor/components/component-panel/ComponentSearch.tsx +82 -0
- package/src/editor/components/component-panel/VariantList.tsx +260 -0
- package/src/editor/components/component-panel/index.ts +12 -0
- package/src/editor/components/index.ts +48 -0
- package/src/editor/components/multi-page/CanvasZoomControls.tsx +71 -0
- package/src/editor/components/multi-page/InfiniteCanvas.tsx +95 -0
- package/src/editor/components/multi-page/MultiPageCanvasView.tsx +1404 -0
- package/src/editor/components/multi-page/PageFrameOverlay.tsx +76 -0
- package/src/editor/components/multi-page/PageLabel.tsx +34 -0
- package/src/editor/components/multi-page/PageLivePreview.tsx +242 -0
- package/src/editor/components/multi-page/PageThumbnail.tsx +59 -0
- package/src/editor/components/multi-page/index.ts +7 -0
- package/src/editor/components/ppt/PptChrome.tsx +2508 -0
- package/src/editor/components/ppt/PptComments.tsx +589 -0
- package/src/editor/components/ppt/PptDesignProposals.tsx +275 -0
- package/src/editor/components/ppt/PptFormatPane.tsx +320 -0
- package/src/editor/components/ppt/PptNotes.tsx +246 -0
- package/src/editor/components/property-panel/AlignmentPanel.tsx +110 -0
- package/src/editor/components/property-panel/AutoLayoutPanel.tsx +615 -0
- package/src/editor/components/property-panel/BorderSection.tsx +104 -0
- package/src/editor/components/property-panel/CompactNumberInput.tsx +237 -0
- package/src/editor/components/property-panel/CompactSizeInput.tsx +148 -0
- package/src/editor/components/property-panel/EffectSection.tsx +157 -0
- package/src/editor/components/property-panel/FillSection.tsx +69 -0
- package/src/editor/components/property-panel/GoogleFontPicker.tsx +192 -0
- package/src/editor/components/property-panel/ImageSection.tsx +206 -0
- package/src/editor/components/property-panel/ImgSrcSection.tsx +125 -0
- package/src/editor/components/property-panel/InstanceOverrideSection.tsx +413 -0
- package/src/editor/components/property-panel/LayoutSection.tsx +105 -0
- package/src/editor/components/property-panel/LinkSection.tsx +103 -0
- package/src/editor/components/property-panel/PropertyVariablePicker.tsx +311 -0
- package/src/editor/components/property-panel/ScalePanel.tsx +212 -0
- package/src/editor/components/property-panel/TypographySection.tsx +230 -0
- package/src/editor/components/property-panel/UnitAwareNumberInput.tsx +238 -0
- package/src/editor/components/property-panel/VariableAwareColorInput.tsx +477 -0
- package/src/editor/components/property-panel/VariableAwareInput.tsx +606 -0
- package/src/editor/components/property-panel/VariableAwareSizeInput.tsx +588 -0
- package/src/editor/components/property-panel/VariableAwareUnitInput.tsx +546 -0
- package/src/editor/components/property-panel/index.ts +24 -0
- package/src/editor/components/property-panel/unit-utils.ts +261 -0
- package/src/editor/components/shell/EditorTopBar.tsx +392 -0
- package/src/editor/components/shell/LeftPanel.tsx +47 -0
- package/src/editor/components/shell/PagesPanel.tsx +118 -0
- package/src/editor/components/variables-panel/ColorValueCell.tsx +165 -0
- package/src/editor/components/variables-panel/TextValueCell.tsx +116 -0
- package/src/editor/components/variables-panel/VariablesPanel.tsx +518 -0
- package/src/editor/components/variables-panel/index.ts +7 -0
- package/src/editor/constants.ts +468 -0
- package/src/editor/contexts/EditorArtboardContext.tsx +229 -0
- package/src/editor/contexts/EditorComponentsContext.tsx +1320 -0
- package/src/editor/contexts/EditorDocumentContext.tsx +113 -0
- package/src/editor/contexts/EditorHistoryContext.tsx +516 -0
- package/src/editor/contexts/EditorRefsContext.tsx +204 -0
- package/src/editor/contexts/EditorSelectionContext.tsx +54 -0
- package/src/editor/contexts/EditorToolContext.tsx +58 -0
- package/src/editor/contexts/EditorUIStateContext.tsx +122 -0
- package/src/editor/contexts/EditorVariablesContext.tsx +397 -0
- package/src/editor/contexts/EditorViewContext.tsx +101 -0
- package/src/editor/contexts/MultiPageCanvasContext.tsx +498 -0
- package/src/editor/contexts/index.ts +17 -0
- package/src/editor/editor-skin.css +122 -0
- package/src/editor/hooks/index.ts +38 -0
- package/src/editor/hooks/useAiReplace.ts +397 -0
- package/src/editor/hooks/useAltMeasure.ts +67 -0
- package/src/editor/hooks/useBrowserZoomPrevention.ts +121 -0
- package/src/editor/hooks/useCanvasControls.ts +1222 -0
- package/src/editor/hooks/useComponentEditMode.ts +658 -0
- package/src/editor/hooks/useComponentInstances.ts +515 -0
- package/src/editor/hooks/useContextMenuHandler.ts +157 -0
- package/src/editor/hooks/useCoordinateTransform.ts +207 -0
- package/src/editor/hooks/useDragResize.ts +1317 -0
- package/src/editor/hooks/useDrawingMode.ts +472 -0
- package/src/editor/hooks/useEditorColors.ts +144 -0
- package/src/editor/hooks/useEditorMessages.ts +108 -0
- package/src/editor/hooks/useElementActions.ts +1754 -0
- package/src/editor/hooks/useElementSelection.ts +1573 -0
- package/src/editor/hooks/useFocusManagement.ts +249 -0
- package/src/editor/hooks/useGoogleFonts.ts +305 -0
- package/src/editor/hooks/useIframeInitializer.ts +584 -0
- package/src/editor/hooks/useIframeSetup.ts +360 -0
- package/src/editor/hooks/useImageUpload.ts +270 -0
- package/src/editor/hooks/useInfiniteCanvas.ts +301 -0
- package/src/editor/hooks/useKeyboardShortcuts.ts +205 -0
- package/src/editor/hooks/useMarqueeSelection.ts +388 -0
- package/src/editor/hooks/useMediaLibrary.ts +129 -0
- package/src/editor/hooks/usePageSettingsManager.ts +739 -0
- package/src/editor/hooks/useResizablePanel.ts +163 -0
- package/src/editor/hooks/useRichPaste.ts +255 -0
- package/src/editor/hooks/useTouchGestures.ts +197 -0
- package/src/editor/index.ts +27 -0
- package/src/editor/types/page-settings.ts +513 -0
- package/src/editor/types.ts +382 -0
- package/src/editor/utils/align-elements.ts +169 -0
- package/src/editor/utils/api-json.ts +21 -0
- package/src/editor/utils/aspect-lock.ts +50 -0
- package/src/editor/utils/component-renderer.ts +702 -0
- package/src/editor/utils/component-sync.ts +845 -0
- package/src/editor/utils/crop-mode.ts +265 -0
- package/src/editor/utils/dom-utils.ts +2238 -0
- package/src/editor/utils/element-effects.ts +218 -0
- package/src/editor/utils/eyedropper.ts +35 -0
- package/src/editor/utils/figma-export.ts +560 -0
- package/src/editor/utils/figma-kiwi-decoder.ts +722 -0
- package/src/editor/utils/figma-kiwi-encoder.ts +583 -0
- package/src/editor/utils/figma-paste.ts +2262 -0
- package/src/editor/utils/flex-reorder.ts +231 -0
- package/src/editor/utils/flex-utils.ts +1230 -0
- package/src/editor/utils/geometry.ts +232 -0
- package/src/editor/utils/grid-layout.ts +210 -0
- package/src/editor/utils/html-utils.ts +470 -0
- package/src/editor/utils/index.ts +11 -0
- package/src/editor/utils/ink-style.ts +57 -0
- package/src/editor/utils/inline-format.ts +236 -0
- package/src/editor/utils/measure-distance.ts +120 -0
- package/src/editor/utils/override-apply.ts +526 -0
- package/src/editor/utils/override-detection.ts +613 -0
- package/src/editor/utils/paste-processors.ts +609 -0
- package/src/editor/utils/paste-sanitizer.ts +244 -0
- package/src/editor/utils/restore-flow.ts +188 -0
- package/src/editor/utils/shape-library.ts +171 -0
- package/src/editor/utils/slide-root.ts +29 -0
- package/src/editor/utils/smart-guides.ts +218 -0
- package/src/editor/utils/style-utils.ts +685 -0
- package/src/editor/utils/table-edit.ts +151 -0
- package/src/editor/utils/tailwind-mappings.ts +778 -0
- package/src/editor/utils/tailwind-utils.ts +804 -0
- package/src/editor/utils/text-highlight.ts +216 -0
- package/src/editor/utils/theme-to-variables.ts +341 -0
- package/src/editor/utils/variant-resolver.ts +456 -0
- package/src/editor/utils/viewport-utils.ts +295 -0
- package/src/hooks/useEditorHistory.ts +195 -0
- package/src/hooks/useEditorShortcuts.ts +260 -0
- package/src/index.ts +40 -0
- package/src/io.ts +134 -0
- package/src/lib/agent/slide-agent/types.ts +547 -0
- package/src/lib/agent/website-agent/types.ts +805 -0
- package/src/lib/api/auth-fetch.ts +58 -0
- package/src/lib/deck.ts +69 -0
- package/src/lib/export.ts +47 -0
- package/src/lib/firebase/config.ts +29 -0
- package/src/lib/firebase/css-variables.ts +378 -0
- package/src/lib/firebase/editor-components.ts +677 -0
- package/src/lib/firebase/storage.ts +469 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/editor.css +52 -0
- package/src/styles/skin.css +122 -0
- package/src/types/css-variables.ts +645 -0
- package/src/types/editor-components.ts +944 -0
- package/src/types/editor.ts +420 -0
- package/src/types/page-master.ts +197 -0
- package/src/types/page.ts +419 -0
- package/src/types/slide.ts +402 -0
- package/src/types/website-theme.ts +788 -0
- package/src/types/website.ts +374 -0
- package/src/vendor/firebase-firestore.ts +13 -0
- 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
|
+
}
|