hanseol-dev 5.0.2-dev.16 → 5.0.2-dev.160
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/dist/agents/common/sub-agent.d.ts +14 -0
- package/dist/agents/common/sub-agent.d.ts.map +1 -1
- package/dist/agents/common/sub-agent.js +98 -4
- package/dist/agents/common/sub-agent.js.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/office/excel-agent.d.ts +1 -1
- package/dist/agents/office/excel-agent.d.ts.map +1 -1
- package/dist/agents/office/excel-agent.js +6 -6
- package/dist/agents/office/excel-agent.js.map +1 -1
- package/dist/agents/office/excel-create-agent.d.ts +3 -0
- package/dist/agents/office/excel-create-agent.d.ts.map +1 -0
- package/dist/agents/office/excel-create-agent.js +38 -0
- package/dist/agents/office/excel-create-agent.js.map +1 -0
- package/dist/agents/office/excel-create-prompts.d.ts +4 -0
- package/dist/agents/office/excel-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/excel-create-prompts.js +154 -0
- package/dist/agents/office/excel-create-prompts.js.map +1 -0
- package/dist/agents/office/index.d.ts +6 -3
- package/dist/agents/office/index.d.ts.map +1 -1
- package/dist/agents/office/index.js +6 -3
- package/dist/agents/office/index.js.map +1 -1
- package/dist/agents/office/powerpoint-agent.d.ts +1 -1
- package/dist/agents/office/powerpoint-agent.d.ts.map +1 -1
- package/dist/agents/office/powerpoint-agent.js +6 -6
- package/dist/agents/office/powerpoint-agent.js.map +1 -1
- package/dist/agents/office/powerpoint-create-agent.d.ts +3 -0
- package/dist/agents/office/powerpoint-create-agent.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-create-agent.js +1118 -0
- package/dist/agents/office/powerpoint-create-agent.js.map +1 -0
- package/dist/agents/office/powerpoint-create-prompts.d.ts +129 -0
- package/dist/agents/office/powerpoint-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-create-prompts.js +1454 -0
- package/dist/agents/office/powerpoint-create-prompts.js.map +1 -0
- package/dist/agents/office/prompts.d.ts +8 -4
- package/dist/agents/office/prompts.d.ts.map +1 -1
- package/dist/agents/office/prompts.js +297 -96
- package/dist/agents/office/prompts.js.map +1 -1
- package/dist/agents/office/word-agent.d.ts +1 -1
- package/dist/agents/office/word-agent.d.ts.map +1 -1
- package/dist/agents/office/word-agent.js +6 -6
- package/dist/agents/office/word-agent.js.map +1 -1
- package/dist/agents/office/word-create-agent.d.ts +3 -0
- package/dist/agents/office/word-create-agent.d.ts.map +1 -0
- package/dist/agents/office/word-create-agent.js +38 -0
- package/dist/agents/office/word-create-agent.js.map +1 -0
- package/dist/agents/office/word-create-prompts.d.ts +4 -0
- package/dist/agents/office/word-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/word-create-prompts.js +164 -0
- package/dist/agents/office/word-create-prompts.js.map +1 -0
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/pipe/pipe-runner.d.ts.map +1 -1
- package/dist/pipe/pipe-runner.js +20 -0
- package/dist/pipe/pipe-runner.js.map +1 -1
- package/dist/prompts/agents/planning.d.ts.map +1 -1
- package/dist/prompts/agents/planning.js +20 -11
- package/dist/prompts/agents/planning.js.map +1 -1
- package/dist/prompts/shared/tool-usage.d.ts.map +1 -1
- package/dist/prompts/shared/tool-usage.js +6 -3
- package/dist/prompts/shared/tool-usage.js.map +1 -1
- package/dist/prompts/system/plan-execute.js +1 -1
- package/dist/tools/office/excel-client.js +4 -4
- package/dist/tools/office/excel-tools/index.d.ts +2 -0
- package/dist/tools/office/excel-tools/index.d.ts.map +1 -1
- package/dist/tools/office/excel-tools/index.js +12 -0
- package/dist/tools/office/excel-tools/index.js.map +1 -1
- package/dist/tools/office/excel-tools/sheet-builders.d.ts +8 -0
- package/dist/tools/office/excel-tools/sheet-builders.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/sheet-builders.js +414 -0
- package/dist/tools/office/excel-tools/sheet-builders.js.map +1 -0
- package/dist/tools/office/excel-tools.d.ts +1 -1
- package/dist/tools/office/excel-tools.d.ts.map +1 -1
- package/dist/tools/office/excel-tools.js +1 -1
- package/dist/tools/office/excel-tools.js.map +1 -1
- package/dist/tools/office/powerpoint-client.d.ts +3 -0
- package/dist/tools/office/powerpoint-client.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-client.js +143 -10
- package/dist/tools/office/powerpoint-client.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/export.js +16 -1
- package/dist/tools/office/powerpoint-tools/export.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/index.d.ts +2 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/index.js +7 -0
- package/dist/tools/office/powerpoint-tools/index.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools/launch.js +2 -0
- package/dist/tools/office/powerpoint-tools/launch.js.map +1 -1
- package/dist/tools/office/powerpoint-tools/layout-builders.d.ts +12 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.js +785 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.js +1 -1
- package/dist/tools/office/powerpoint-tools/slides.js.map +1 -1
- package/dist/tools/office/powerpoint-tools.d.ts +1 -1
- package/dist/tools/office/powerpoint-tools.d.ts.map +1 -1
- package/dist/tools/office/powerpoint-tools.js +1 -1
- package/dist/tools/office/powerpoint-tools.js.map +1 -1
- package/dist/tools/office/word-client.js +4 -4
- package/dist/tools/office/word-tools/index.d.ts +4 -1
- package/dist/tools/office/word-tools/index.d.ts.map +1 -1
- package/dist/tools/office/word-tools/index.js +15 -0
- package/dist/tools/office/word-tools/index.js.map +1 -1
- package/dist/tools/office/word-tools/section-builders.d.ts +10 -0
- package/dist/tools/office/word-tools/section-builders.d.ts.map +1 -0
- package/dist/tools/office/word-tools/section-builders.js +421 -0
- package/dist/tools/office/word-tools/section-builders.js.map +1 -0
- package/dist/tools/office/word-tools.d.ts +1 -1
- package/dist/tools/office/word-tools.d.ts.map +1 -1
- package/dist/tools/office/word-tools.js +1 -1
- package/dist/tools/office/word-tools.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +7 -4
- package/dist/tools/registry.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1454 @@
|
|
|
1
|
+
export const PPT_CREATE_ENHANCEMENT_PROMPT = `You are an elite presentation design consultant specializing in modern HTML/CSS slide design.
|
|
2
|
+
|
|
3
|
+
Each slide will be rendered as a standalone HTML page (1920×1080px) using ONLY CSS — no images, no external resources.
|
|
4
|
+
Your job: design a cohesive visual system and detailed content plan that produces beautiful HTML slides.
|
|
5
|
+
|
|
6
|
+
OUTPUT FORMAT (structured text, max 1000 words):
|
|
7
|
+
|
|
8
|
+
1. DOCUMENT_TYPE: pitch deck / business report / training / product launch / general
|
|
9
|
+
2. AUDIENCE: Target audience description
|
|
10
|
+
3. MOOD: modern-minimal / bold-energetic / corporate-elegant / warm-friendly / academic-clean
|
|
11
|
+
|
|
12
|
+
4. COLOR PALETTE (6 hex values — choose colors that match the topic and mood):
|
|
13
|
+
- primary: Deep main color for headers and key elements (e.g., #1B2A4A for corporate, #6C63FF for tech)
|
|
14
|
+
- accent: Vibrant contrast color for highlights and CTAs (e.g., #00D4AA, #FF6B35)
|
|
15
|
+
- background: Page background — near white (#F8F9FA) or near black (#0D1117) or subtle tint
|
|
16
|
+
- text: Main text color — dark (#1A1A2E) for light bg, light (#E8E8E8) for dark bg
|
|
17
|
+
- accent_light: Light tint of accent for subtle backgrounds (e.g., #E8F5F0)
|
|
18
|
+
- gradient_end: Secondary gradient color paired with primary (e.g., #2D5F8A)
|
|
19
|
+
|
|
20
|
+
5. FONTS: title_font, body_font (system only: Segoe UI, Malgun Gothic, Arial, Calibri, Georgia)
|
|
21
|
+
6. SLIDE PLAN: 12-18 slides, each with:
|
|
22
|
+
- Slide number and type (title / content / data / comparison / process / highlight / table / closing)
|
|
23
|
+
- Title in user's language
|
|
24
|
+
- Specific content direction (what data, text, visuals to include)
|
|
25
|
+
- CSS layout approach (e.g., "flexbox 3-column card grid with box-shadow", "CSS grid 2×2 with gradient headers", "conic-gradient donut chart + metric cards", "CSS bar chart using flex-end alignment")
|
|
26
|
+
7. DESIGN NOTES: Overall HTML/CSS approach — gradients (linear-gradient, radial-gradient), box-shadows, border-radius, flexbox/grid layouts, CSS shapes, pseudo-elements for decoration
|
|
27
|
+
|
|
28
|
+
KEY PRINCIPLES FOR HTML SLIDES:
|
|
29
|
+
- Each slide is a full 1920×1080px HTML page — use the ENTIRE space (flex:1 to stretch content)
|
|
30
|
+
- CSS-only visuals: gradients, box-shadow, border-radius, conic-gradient for pie/donut charts
|
|
31
|
+
- MAXIMUM 4 items per slide (2×2 grid preferred)
|
|
32
|
+
- NO images, NO external fonts, NO JavaScript
|
|
33
|
+
|
|
34
|
+
VISUAL DIVERSITY IS CRITICAL — a presentation with only text cards is BORING:
|
|
35
|
+
- For DATA: specify CSS bar charts (vertical bars using flex-end + height%), donut charts (conic-gradient), progress bars, horizontal bars
|
|
36
|
+
- For COMPARISON: styled tables with colored headers, side-by-side columns
|
|
37
|
+
- For PROCESS/FLOW: horizontal step boxes with arrow connectors (→), numbered phases, timeline layouts
|
|
38
|
+
- For METRICS: big number spotlights (72-96px font), KPI dashboards with trend arrows (▲▼)
|
|
39
|
+
- For MIXED: left column text + right column chart, or top chart + bottom summary cards
|
|
40
|
+
- In a 10-12 slide deck, plan at least: 2 chart/data viz slides, 1-2 table slides, 1-2 flow/process slides, 2-3 card slides, 1-2 metric spotlight slides
|
|
41
|
+
- NEVER plan all slides as "card grid" — that makes every slide look identical
|
|
42
|
+
|
|
43
|
+
LANGUAGE RULE: ALL slide titles and content MUST be in the SAME language as the user's instruction.
|
|
44
|
+
Korean input → Korean output. English slogans for Korean input = FAILURE.
|
|
45
|
+
|
|
46
|
+
Output structured text only. No preamble.`;
|
|
47
|
+
export const PPT_STRUCTURED_PLANNING_PROMPT = `You are a presentation structure planner. Output ONLY valid JSON — no markdown, no explanation, no code fences.
|
|
48
|
+
|
|
49
|
+
Given the user's instruction and CREATIVE GUIDANCE, produce a JSON object with this exact structure:
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
"design": {
|
|
53
|
+
"primary_color": "<CHOOSE: deep color matching the topic — NOT #1B2A4A>",
|
|
54
|
+
"accent_color": "<CHOOSE: vibrant contrast color — NOT #00D4AA>",
|
|
55
|
+
"background_color": "<CHOOSE: near-white or near-black or subtle tint>",
|
|
56
|
+
"text_color": "<CHOOSE: must contrast with background>",
|
|
57
|
+
"accent_light": "<CHOOSE: light tint of your accent color>",
|
|
58
|
+
"gradient_end": "<CHOOSE: secondary gradient paired with primary>",
|
|
59
|
+
"font_title": "Segoe UI",
|
|
60
|
+
"font_body": "Malgun Gothic",
|
|
61
|
+
"mood": "modern-minimal",
|
|
62
|
+
"design_notes": "Describe your visual approach in 1-2 sentences"
|
|
63
|
+
},
|
|
64
|
+
"slides": [
|
|
65
|
+
{ "type": "title", "title": "...", "content_direction": "..." },
|
|
66
|
+
{ "type": "content", "title": "...", "content_direction": "..." },
|
|
67
|
+
{ "type": "closing", "title": "...", "content_direction": "..." }
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
═══ FIELD DEFINITIONS ═══
|
|
72
|
+
• design.primary_color: Deep main color (headers, key elements)
|
|
73
|
+
• design.accent_color: Vibrant contrast (highlights, CTAs)
|
|
74
|
+
• design.background_color: Page background (near white, near black, or subtle tint)
|
|
75
|
+
• design.text_color: Main text color (must contrast with background)
|
|
76
|
+
• design.accent_light: Light tint for subtle section backgrounds
|
|
77
|
+
• design.gradient_end: Paired gradient color for primary
|
|
78
|
+
• design.font_title: System font for titles (Segoe UI, Arial, Georgia, Calibri)
|
|
79
|
+
• design.font_body: System font for body (Malgun Gothic, Segoe UI, Arial, Calibri)
|
|
80
|
+
• design.mood: One of modern-minimal, bold-energetic, corporate-elegant, warm-friendly, academic-clean
|
|
81
|
+
• design.design_notes: 1-2 sentence visual approach description
|
|
82
|
+
|
|
83
|
+
• slides[].type: One of "title", "content", "closing"
|
|
84
|
+
• slides[].title: Slide title in user's language (max 60 chars)
|
|
85
|
+
• slides[].content_direction: The ACTUAL TEXT AND DATA to display on this slide (6-10 sentences).
|
|
86
|
+
⚠⚠⚠ content_direction = REAL CONTENT the viewer will read. NOT layout instructions.
|
|
87
|
+
Include: specific numbers, names, descriptions, bullet point text, table data.
|
|
88
|
+
⚠ MUST be DETAILED — 6-10 sentences with specific data. Sparse directions produce empty slides.
|
|
89
|
+
⚠ Each item/card/row MUST include: title + 3-4 supporting details with specific data. 2-sentence items = FAILURE.
|
|
90
|
+
Optionally end with ONE short layout hint (e.g., "Layout: 3-column cards" or "Layout: comparison table").
|
|
91
|
+
✓ GOOD: "총매출 1,250억원(전년비 15%↑), 영업이익 180억원(14.4%), 순이익 95억원(7.6%). 사업부별: 클라우드 45%(562억), AI솔루션 30%(375억), 컨설팅 25%(312억). 클라우드가 전년비 32% 성장하며 최대 성장 동력. 영업이익률 업계 평균(10%) 대비 4.4%p 상회. Layout: bar chart"
|
|
92
|
+
✓ GOOD: "3 core services: (1) 클라우드 인프라 — 하이브리드 클라우드 구축 및 운영, AWS/Azure 호환, 99.9% SLA 보장, 현재 50+ 기업 고객 (2) AI 솔루션 — 자연어처리/영상분석 AI 모델, 진단 정확도 98.2%, 처리 속도 실시간, 월 100만건 처리 (3) 컨설팅 — IT 전략 및 디지털 전환 자문, 평균 프로젝트 ROI 250%, 12개월 이내 효과 실현. Layout: 3-column cards"
|
|
93
|
+
✗ BAD: "클라우드, AI, 컨설팅 3개 서비스" ← Too sparse! No details!
|
|
94
|
+
✗ BAD: "왼쪽에 개요 텍스트, 오른쪽에 카드" ← Layout instruction, NOT content!
|
|
95
|
+
✗ BAD: "#accent_light 배경, #primary 글씨" ← CSS instruction, NOT content!
|
|
96
|
+
|
|
97
|
+
═══ SLIDE TYPE GUIDELINES ═══
|
|
98
|
+
Every presentation MUST have: 1 title slide (first) + 1 closing slide (last)
|
|
99
|
+
Content slides between them — aim for 12-15 total slides (up to 18 if the user requests many topics).
|
|
100
|
+
⚠ Current year: ${new Date().getFullYear()}. For dates/timelines/roadmaps with no explicit year in the user's request, use ${new Date().getFullYear()} or later. If the user specifies a year (e.g., "2024년 3분기"), USE THAT YEAR — do not override it.
|
|
101
|
+
|
|
102
|
+
For each content slide, the content_direction should specify:
|
|
103
|
+
- What information to show (specific text, numbers, names)
|
|
104
|
+
- How to lay it out (cards, columns, table, big number, timeline, etc.)
|
|
105
|
+
- This is the ONLY instruction the HTML-generating LLM will see, so be DETAILED
|
|
106
|
+
|
|
107
|
+
═══ TEMPLATES ═══
|
|
108
|
+
PITCH DECK (startup/사업계획서/피치덱): 15 slides
|
|
109
|
+
title → problem → solution → market size → product(1) → product(2) → business model → competition → traction → team → financials → roadmap → investment ask → fund usage → closing
|
|
110
|
+
|
|
111
|
+
BUSINESS REPORT (보고서/분석/실적): 10 slides
|
|
112
|
+
title → executive summary → key metrics → analysis → comparison → spotlight → breakdown → action plan → recommendations → closing
|
|
113
|
+
|
|
114
|
+
TRAINING (교육/세미나/강의): 10 slides
|
|
115
|
+
title → objectives → core concepts → key data → process → details → case study → summary → key takeaway → closing
|
|
116
|
+
|
|
117
|
+
PRODUCT LAUNCH (제품/출시/소개): 11 slides
|
|
118
|
+
title → market need → overview → key feature → features → metrics → use cases → pricing → timeline → CTA → closing
|
|
119
|
+
|
|
120
|
+
GENERAL (발표/프레젠테이션): 10 slides
|
|
121
|
+
title → overview → key points → data → detail → spotlight → comparison → process → summary → closing
|
|
122
|
+
|
|
123
|
+
═══ THE #1 RULE — ONE VISUAL APPROACH PER SLIDE ═══
|
|
124
|
+
⚠⚠⚠ Each slide's content_direction MUST describe EXACTLY ONE visual layout.
|
|
125
|
+
The HTML renderer creates ONE visual element per slide — no more.
|
|
126
|
+
If a topic needs 2 visual elements, SPLIT IT INTO 2 SLIDES.
|
|
127
|
+
|
|
128
|
+
GOOD content_direction (ONE visual each):
|
|
129
|
+
✓ "총매출 1,250억원(전년비 15%↑), 영업이익 180억원(14.4%), 순이익 120억원. Layout: bar chart"
|
|
130
|
+
✓ "Comparison table: 4 rows (MediAI, CompA, CompB, CompC) × 3 columns (정확도, 속도, 데이터량). Highlight MediAI row. Layout: comparison table"
|
|
131
|
+
✓ "$45B 시장 규모, 28% 연평균 성장률, 5% 1년 내 점유율 목표. Layout: big numbers"
|
|
132
|
+
✓ "데이터 수집 → 전처리 → AI 분석 → 결과 리포트 → 의사 확인. 각 단계별 소요시간 표시. Layout: process flow"
|
|
133
|
+
✓ "매출 구성: 구독형 45%, 라이선스 30%, 컨설팅 25%. Layout: donut chart"
|
|
134
|
+
✓ "3 core services: (1) 클라우드 인프라, (2) AI 솔루션, (3) 컨설팅. Layout: 2×2 grid"
|
|
135
|
+
✓ "목표 달성률: 매출 92%, 고객 확보 87%, 시장점유율 73%, 만족도 95%. Layout: progress bars"
|
|
136
|
+
|
|
137
|
+
BAD content_direction (MULTIPLE visuals = OVERFLOW):
|
|
138
|
+
✗ "테이블로 수익 모델 + 수익 그래프 + 파트너십 + 라이선싱" ← 4 sections!
|
|
139
|
+
✗ "원형 차트 + 투자 조건 테이블 + 단계적 계획 + 바 차트" ← 4 sections!
|
|
140
|
+
✗ "레이더 차트 + 데이터 바 + 차별화 카드 4개" ← 3 sections!
|
|
141
|
+
✗ "성장 차트 + 시장 분할 파이 + 기회 텍스트 + 과제 텍스트" ← 4 sections!
|
|
142
|
+
|
|
143
|
+
═══ SPLITTING DENSE TOPICS INTO MULTIPLE SLIDES ═══
|
|
144
|
+
⚠ If a user topic has 4+ sub-items, you MUST split it into 2 slides:
|
|
145
|
+
• "비즈니스모델" → "수익 모델" (pricing table) + "수익 성장 전망" (bar chart)
|
|
146
|
+
• "시장분석" → "시장 규모" (3 big metrics) + "고객 세분화" (pie chart or cards)
|
|
147
|
+
• "투자조건" → "투자 조건" (table) + "자금 사용 계획" (pie or bar chart)
|
|
148
|
+
• "경쟁우위" → "경쟁사 비교" (comparison table) + "핵심 차별화" (3 card grid)
|
|
149
|
+
• "경쟁분석" → "경쟁사 비교" (comparison table ONLY) + "SWOT 분석" (2×2 grid ONLY). NEVER put table AND SWOT on same slide.
|
|
150
|
+
• "AI 솔루션" → "핵심 기능" (3 card grid) + "진단 프로세스" (process flow)
|
|
151
|
+
• "제품/플랫폼" → "핵심 기능" (3 card grid with feature descriptions) — NOT a hub-and-spoke diagram
|
|
152
|
+
• "마케팅/GTM 전략" → "마케팅 채널 전략" (3 cards) + "성과 지표" (metrics or table). NEVER put 4 strategy columns on one slide.
|
|
153
|
+
• "로드맵" → "단기 로드맵 2026" (3 milestone cards) + "장기 비전 2027-2028" (3 milestone cards)
|
|
154
|
+
• "팀 소개" (4+ members) → "창업진 소개" (2-3 people) + "핵심 팀원" (2-3 people)
|
|
155
|
+
This keeps each slide clean with generous whitespace.
|
|
156
|
+
|
|
157
|
+
═══ CONTENT DENSITY — FILL THE SLIDE ═══
|
|
158
|
+
⚠⚠⚠ Each slide is 1920×1080px. Content MUST fill 85-95% of vertical space. EMPTY slides = FAILURE.
|
|
159
|
+
⚠ content_direction MUST contain 6-10 sentences of ACTUAL DATA and details.
|
|
160
|
+
⚠ Each item: title + 3-5 detailed bullets with specific numbers, names, and descriptions.
|
|
161
|
+
⚠ Tables: 5-8 data rows × 3-4 columns for rich comparison. Fill EVERY cell with real data.
|
|
162
|
+
⚠ Timeline/Roadmap: 4-5 milestones with dates, descriptions, and key metrics.
|
|
163
|
+
If a roadmap has 6+ items, SPLIT into 2 slides with 3-4 items each.
|
|
164
|
+
⚠ Data/metrics: 3-4 big numbers with trend indicators AND supporting context text below each.
|
|
165
|
+
⚠ Cards: 3-4 cards, each with a title + 3-4 bullet points + a summary sentence.
|
|
166
|
+
⚠ Donut/Pie charts: include 4-5 segments with labels + a summary box below the chart.
|
|
167
|
+
⚠ The more SPECIFIC DATA you include in content_direction, the better the slide will look.
|
|
168
|
+
Empty-looking slides are the #1 quality complaint — always err on the side of MORE content.
|
|
169
|
+
|
|
170
|
+
═══ OVERVIEW / AGENDA SLIDES ═══
|
|
171
|
+
⚠ Overview/agenda slides listing presentation sections: MAXIMUM 5 items.
|
|
172
|
+
Use a numbered list style (1-5) or compact 2-column grid. NEVER use 6-7+ horizontal cards.
|
|
173
|
+
Each item: short title (2-3 words) + 1-line description only.
|
|
174
|
+
If the presentation has 10+ sections, group related topics: "시장 및 경쟁" instead of separate "시장 분석" + "경쟁 분석".
|
|
175
|
+
Overview slides should be concise — just a navigation map, not a content dump.
|
|
176
|
+
|
|
177
|
+
═══ TITLE & CLOSING SLIDE FORMAT ═══
|
|
178
|
+
⚠ Title slide (FIRST):
|
|
179
|
+
• title: Company/topic name ONLY — max 3-4 words, rendered at 96px by system
|
|
180
|
+
✓ GOOD: "MediAI" ✓ GOOD: "삼성전자 AI센터"
|
|
181
|
+
✗ BAD: "MediAI - 인공지능으로 의료 혁신을 선도합니다" (too long, wraps at 96px)
|
|
182
|
+
• content_direction: The actual subtitle/tagline TEXT. 1-2 lines, under 120 chars.
|
|
183
|
+
✓ GOOD: "AI 기반 의료 진단 혁신 플랫폼 — 투자유치 발표자료"
|
|
184
|
+
✗ BAD: "회사 로고, 슬로건, 연락처 정보" (instruction, not subtitle)
|
|
185
|
+
• Do NOT include visual/layout instructions — title uses a fixed premium template
|
|
186
|
+
⚠ Closing slide (LAST):
|
|
187
|
+
• title: "감사합니다" (Korean) or "Thank You" (English)
|
|
188
|
+
• content_direction: Same company/topic name as title slide
|
|
189
|
+
• Do NOT include visual/layout instructions — closing uses a fixed premium template
|
|
190
|
+
|
|
191
|
+
═══ LAYOUT VARIETY + VISUAL TYPE — MANDATORY ═══
|
|
192
|
+
⚠⚠⚠ You MUST vary the visual approach. No more than 2 slides with the same layout hint.
|
|
193
|
+
Available layouts (use at least 5 different types across the presentation):
|
|
194
|
+
- "2×2 grid": 4 cards in 2 rows × 2 columns (MAX 2 slides)
|
|
195
|
+
- "bar chart": CSS vertical/horizontal bars showing data trends or comparisons
|
|
196
|
+
- "donut chart": conic-gradient pie/donut with metric labels
|
|
197
|
+
- "comparison table": styled table with 3-4 rows, colored headers
|
|
198
|
+
- "process flow": horizontal step boxes connected by arrows (→), numbered phases
|
|
199
|
+
- "big numbers": 2-3 large metric spotlights (72-96px) with trend indicators (▲▼)
|
|
200
|
+
- "2-column split": left panel + right content (chart + text, or metric + details)
|
|
201
|
+
- "timeline": 3-4 milestone steps horizontal with dates
|
|
202
|
+
- "progress bars": horizontal bars showing completion/comparison percentages
|
|
203
|
+
- "hero stat": one large central metric with supporting context
|
|
204
|
+
⚠ Each content_direction MUST end with a "Layout:" hint specifying the visual type.
|
|
205
|
+
⚠ If your plan has 3+ slides all using "cards/grid" layout, REWRITE to use charts, tables, flows instead.
|
|
206
|
+
⚠ A 10-slide deck MUST have: at least 2 chart/data-viz slides, at least 1 table slide, at least 1 process/flow slide.
|
|
207
|
+
⚠ NEVER plan a presentation where every slide is cards — that is LAZY and BORING.
|
|
208
|
+
|
|
209
|
+
═══ COLOR PALETTE RULES ═══
|
|
210
|
+
⚠ NEVER use placeholder/example colors. EVERY presentation must have a UNIQUE palette:
|
|
211
|
+
• Medical/Health: blues + greens (#0B5394, #27AE60)
|
|
212
|
+
• Tech/AI: purples + cyans (#6C63FF, #00BCD4)
|
|
213
|
+
• Finance: navy + gold (#1A237E, #F4A300)
|
|
214
|
+
• Education: teal + orange (#00796B, #FF7043)
|
|
215
|
+
• Marketing: coral + purple (#FF6B6B, #7C3AED)
|
|
216
|
+
⚠ Choose colors that MATCH the specific topic. Generic blue = LAZY.
|
|
217
|
+
⚠ Ensure accent_color has HIGH contrast with primary_color.
|
|
218
|
+
|
|
219
|
+
═══ HARD RULES ═══
|
|
220
|
+
⚠ First slide MUST be type "title"
|
|
221
|
+
⚠ Last slide MUST be type "closing" with "감사합니다"/"Thank You" as title
|
|
222
|
+
⚠ ALL titles and content_direction MUST be in the SAME language as the user's instruction
|
|
223
|
+
⚠ content_direction: MUST contain ACTUAL TEXT/DATA the viewer will read. Layout hint is optional and goes at the END.
|
|
224
|
+
⚠ content_direction that is ONLY layout/visual instructions (no real data) = FAILURE. The HTML generator will display it literally.
|
|
225
|
+
⚠ HARD MAXIMUM: 13 slides total. Slides beyond 13 are DISCARDED by the system. Aim for 10-12.
|
|
226
|
+
⚠ FEWER, HIGHER-QUALITY slides > many mediocre slides. 12 excellent slides beats 15 mixed ones.
|
|
227
|
+
⚠ Each slide's content_direction must be unique and substantive — no generic placeholders
|
|
228
|
+
⚠ NEVER use "스크린샷", "screenshot", "이미지", "사진", "placeholder", "[내용]" in content_direction
|
|
229
|
+
— the system cannot insert images. Describe REAL text/data content to display.
|
|
230
|
+
⚠ Do NOT create a separate "연락처"/"Contact" slide — the closing slide already handles this.
|
|
231
|
+
— Use that slot for valuable content instead (e.g., competitive advantage, key metrics, next steps).
|
|
232
|
+
|
|
233
|
+
Output ONLY the JSON object. No preamble, no markdown fences, no explanation.`;
|
|
234
|
+
export function extractLayoutHint(contentDirection) {
|
|
235
|
+
const match = contentDirection.match(/Layout:\s*(.+?)$/im);
|
|
236
|
+
if (!match)
|
|
237
|
+
return 'cards';
|
|
238
|
+
const hint = match[1].trim().toLowerCase();
|
|
239
|
+
if (/card|grid/.test(hint))
|
|
240
|
+
return 'cards';
|
|
241
|
+
if (/bar\s*chart/.test(hint))
|
|
242
|
+
return 'bar_chart';
|
|
243
|
+
if (/donut|pie/.test(hint))
|
|
244
|
+
return 'donut_chart';
|
|
245
|
+
if (/comparison\s*table|table/.test(hint))
|
|
246
|
+
return 'table';
|
|
247
|
+
if (/process|flow/.test(hint))
|
|
248
|
+
return 'process_flow';
|
|
249
|
+
if (/big\s*num|metric/.test(hint))
|
|
250
|
+
return 'big_numbers';
|
|
251
|
+
if (/split|2-col|two.col/.test(hint))
|
|
252
|
+
return 'two_col_split';
|
|
253
|
+
if (/timeline|milestone|roadmap/.test(hint))
|
|
254
|
+
return 'timeline';
|
|
255
|
+
if (/progress\s*bar/.test(hint))
|
|
256
|
+
return 'progress_bars';
|
|
257
|
+
if (/hero|spotlight/.test(hint))
|
|
258
|
+
return 'hero_stat';
|
|
259
|
+
return 'cards';
|
|
260
|
+
}
|
|
261
|
+
export function checkLayoutCompliance(html, layoutType) {
|
|
262
|
+
switch (layoutType) {
|
|
263
|
+
case 'donut_chart':
|
|
264
|
+
if (!html.includes('conic-gradient')) {
|
|
265
|
+
return 'WRONG LAYOUT: Expected donut/pie chart with conic-gradient. You MUST use conic-gradient on a border-radius:50% div. Copy the REQUIRED HTML structure from the prompt.';
|
|
266
|
+
}
|
|
267
|
+
break;
|
|
268
|
+
case 'bar_chart': {
|
|
269
|
+
const hasFlexEnd = /flex-end/.test(html);
|
|
270
|
+
const barHeights = html.match(/style="[^"]*height:\s*\d+%/g) || [];
|
|
271
|
+
if (!hasFlexEnd || barHeights.length < 3) {
|
|
272
|
+
return `WRONG LAYOUT: Expected CSS bar chart with flex-end + at least 3 bars with height:XX%. Found flex-end:${hasFlexEnd}, bars:${barHeights.length}. Copy the REQUIRED HTML structure with .chart-area, .bar-group, .bar elements.`;
|
|
273
|
+
}
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case 'table':
|
|
277
|
+
if (!html.includes('<table') || !html.includes('<th')) {
|
|
278
|
+
return 'WRONG LAYOUT: Expected HTML <table> with <th> header cells. Copy the REQUIRED HTML structure.';
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case 'process_flow': {
|
|
282
|
+
const arrowCount = (html.match(/→/g) || []).length;
|
|
283
|
+
const hasSteps = /class="[^"]*step/i.test(html);
|
|
284
|
+
if (arrowCount < 2 || !hasSteps) {
|
|
285
|
+
return `WRONG LAYOUT: Expected process flow with step boxes and → arrows. Found arrows:${arrowCount}, steps:${hasSteps}. You MUST have .step divs connected by .arrow divs containing "→".`;
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
case 'progress_bars': {
|
|
290
|
+
const hasFill = /bar-fill/i.test(html);
|
|
291
|
+
const hasTrack = /bar-track/i.test(html);
|
|
292
|
+
const widthBars = html.match(/style="[^"]*width:\s*\d+%/g) || [];
|
|
293
|
+
if (!hasFill || !hasTrack || widthBars.length < 3) {
|
|
294
|
+
return `WRONG LAYOUT: Expected progress bars with .bar-track + .bar-fill + width:XX%. Found fill:${hasFill}, track:${hasTrack}, bars:${widthBars.length}. Copy the REQUIRED HTML structure.`;
|
|
295
|
+
}
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
case 'timeline': {
|
|
299
|
+
const hasMilestone = /class="[^"]*milestone/i.test(html);
|
|
300
|
+
const milestoneCount = (html.match(/class="milestone"/g) || []).length;
|
|
301
|
+
if (!hasMilestone || milestoneCount < 2) {
|
|
302
|
+
return `WRONG LAYOUT: Expected timeline with .milestone cards. Found ${milestoneCount} milestones. You MUST have 3-4 .milestone divs side by side.`;
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
case 'big_numbers': {
|
|
307
|
+
const bigFonts = html.match(/font-size:\s*(?:7[2-9]|[89]\d|1[0-2]\d)px/g) || [];
|
|
308
|
+
if (bigFonts.length < 2) {
|
|
309
|
+
return `WRONG LAYOUT: Expected big number metrics with font-size 72-96px. Found ${bigFonts.length} large fonts. Each .metric-card MUST have a .metric-value with font-size:80px.`;
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case 'hero_stat': {
|
|
314
|
+
const heroFont = html.match(/font-size:\s*(?:9[6-9]|1[0-2]\d)px/g) || [];
|
|
315
|
+
if (heroFont.length < 1) {
|
|
316
|
+
return `WRONG LAYOUT: Expected hero stat with font-size 96-128px. You MUST have ONE .hero-number with font-size:128px.`;
|
|
317
|
+
}
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
function getLayoutSpecificCss(layoutType, design) {
|
|
324
|
+
const layouts = {
|
|
325
|
+
cards: `═══ REQUIRED LAYOUT: CARD GRID ═══
|
|
326
|
+
⚠⚠⚠ You MUST create a CARD GRID layout. Using any other layout = FAILURE.
|
|
327
|
+
|
|
328
|
+
CSS:
|
|
329
|
+
.content { flex:1; display:grid; grid-template-columns:1fr 1fr; grid-template-rows:1fr 1fr; gap:24px; }
|
|
330
|
+
.card { display:flex; flex-direction:column; justify-content:flex-start; gap:12px; padding:32px 28px; border-radius:16px; background:#fff; box-shadow:0 4px 20px rgba(0,0,0,0.06); overflow:hidden; }
|
|
331
|
+
|
|
332
|
+
⚠ grid-template-rows:1fr 1fr is CRITICAL — it forces cards to stretch and fill vertical space. Without it, cards collapse to content height leaving huge empty bottom.
|
|
333
|
+
• MAX 4 cards (2×2). Each: icon/badge + title (32-40px) + 4-5 bullets (26px) with specific data + stat/metric at bottom.
|
|
334
|
+
• If only 3 items: grid-template-columns:1fr 1fr 1fr; grid-template-rows:1fr; (all 3 in one row)
|
|
335
|
+
• MINIMUM CARD CONTENT: title + 4-5 detailed bullet points with numbers/data + bottom metric. A card with only 2 bullets = FAILURE.
|
|
336
|
+
• Card bottom stat: use margin-top:auto to push it to card bottom, creating visual anchor.
|
|
337
|
+
• ⚠ NEVER have empty grid cells. If you have 3 items, use 3 columns. If 4, use 2×2.`,
|
|
338
|
+
bar_chart: `═══ REQUIRED LAYOUT: BAR CHART ═══
|
|
339
|
+
⚠⚠⚠ You MUST create a CSS BAR CHART with vertical bars. Cards/numbers/tables = FAILURE.
|
|
340
|
+
|
|
341
|
+
CSS:
|
|
342
|
+
.content { flex:1; display:flex; flex-direction:column; }
|
|
343
|
+
.chart-area { flex:1; display:flex; align-items:flex-end; gap:32px; padding:40px 60px 20px; }
|
|
344
|
+
.bar-group { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; }
|
|
345
|
+
.bar-value { font-size:28px; font-weight:700; color:${design.primary_color}; }
|
|
346
|
+
.bar { width:80%; border-radius:8px 8px 0 0; background:linear-gradient(180deg, ${design.accent_color}, ${design.primary_color}); min-height:20px; }
|
|
347
|
+
.bar-label { font-size:26px; font-weight:600; color:${design.text_color}; text-align:center; min-width:120px; }
|
|
348
|
+
.insight-row { padding:20px 60px; background:${design.accent_light}; border-radius:12px; margin-top:20px; font-size:26px; color:${design.text_color}; }
|
|
349
|
+
|
|
350
|
+
CRITICAL PATTERN — your .content div MUST contain this structure:
|
|
351
|
+
<div class="content">
|
|
352
|
+
<div class="chart-area">
|
|
353
|
+
<div class="bar-group">
|
|
354
|
+
<div class="bar-value">VALUE</div>
|
|
355
|
+
<div class="bar" style="height:75%"></div>
|
|
356
|
+
<div class="bar-label">LABEL</div>
|
|
357
|
+
</div>
|
|
358
|
+
<!-- 3-6 bar-groups like above -->
|
|
359
|
+
</div>
|
|
360
|
+
<div class="insight-row">KEY INSIGHT TEXT</div>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
⚠ Each bar MUST have style="height:XX%" (tallest=85%, others proportional). align-items:flex-end on .chart-area makes bars grow upward.
|
|
364
|
+
⚠ The insight-row at bottom provides context and fills space. Be creative with the insight text.
|
|
365
|
+
⚠⚠⚠ .chart-area and .insight-row MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
366
|
+
donut_chart: `═══ REQUIRED LAYOUT: DONUT/PIE CHART ═══
|
|
367
|
+
⚠⚠⚠ You MUST create a CSS DONUT CHART using conic-gradient. Cards/tables = FAILURE.
|
|
368
|
+
|
|
369
|
+
CSS:
|
|
370
|
+
.content { flex:1; display:grid; grid-template-columns:1fr 1fr; gap:40px; align-items:center; }
|
|
371
|
+
.donut-wrap { display:flex; justify-content:center; align-items:center; }
|
|
372
|
+
.donut { width:400px; height:400px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
|
|
373
|
+
.donut-hole { width:200px; height:200px; border-radius:50%; background:${design.background_color}; display:flex; align-items:center; justify-content:center; }
|
|
374
|
+
.donut-center { font-size:48px; font-weight:800; color:${design.primary_color}; }
|
|
375
|
+
.legend { display:flex; flex-direction:column; gap:28px; }
|
|
376
|
+
.legend-item { display:flex; align-items:center; gap:16px; font-size:28px; }
|
|
377
|
+
.legend-dot { width:20px; height:20px; border-radius:50%; flex-shrink:0; }
|
|
378
|
+
|
|
379
|
+
CRITICAL PATTERN — the donut MUST use conic-gradient with ACTUAL data percentages:
|
|
380
|
+
<div class="donut" style="background:conic-gradient(${design.primary_color} 0% 45%, ${design.accent_color} 45% 75%, ${design.gradient_end} 75% 100%);">
|
|
381
|
+
|
|
382
|
+
⚠ conic-gradient segments MUST add to 100%. Adjust percentages to match the ACTUAL DATA.
|
|
383
|
+
⚠ Left: donut with center hole showing total/summary. Right: legend with colored dots + labels + values.`,
|
|
384
|
+
table: `═══ REQUIRED LAYOUT: DATA TABLE ═══
|
|
385
|
+
⚠⚠⚠ You MUST create a styled HTML TABLE with <table>/<th>/<td>. Cards = FAILURE.
|
|
386
|
+
|
|
387
|
+
CSS:
|
|
388
|
+
.content { flex:1; display:flex; flex-direction:column; }
|
|
389
|
+
table { width:100%; border-collapse:separate; border-spacing:0; border-radius:12px; overflow:hidden; flex:1; }
|
|
390
|
+
th { padding:20px 24px; background:${design.primary_color}; color:#fff; font-size:26px; font-weight:700; text-align:left; }
|
|
391
|
+
td { padding:20px 24px; font-size:26px; border-bottom:1px solid ${design.accent_light}; color:${design.text_color}; }
|
|
392
|
+
tr:nth-child(even) td { background:${design.accent_light}40; }
|
|
393
|
+
tr.highlight td { background:${design.accent_color}15; font-weight:600; }
|
|
394
|
+
.summary-bar { margin-top:auto; padding:20px 24px; background:${design.accent_light}; border-radius:12px; font-size:26px; color:${design.text_color}; }
|
|
395
|
+
|
|
396
|
+
⚠ table uses flex:1 to stretch vertically. Use larger padding on td (28-32px) if fewer rows to fill space.
|
|
397
|
+
⚠ Header: dark ${design.primary_color} background with WHITE text. 6-8 rows × 3-5 columns. EVERY cell real data.
|
|
398
|
+
⚠ Add .summary-bar below table with margin-top:auto to anchor it at the bottom and fill remaining space.
|
|
399
|
+
⚠⚠⚠ <table> and .summary-bar MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
400
|
+
process_flow: `═══ REQUIRED LAYOUT: PROCESS FLOW ═══
|
|
401
|
+
⚠⚠⚠ You MUST create a HORIZONTAL PROCESS FLOW with step boxes + arrows (→). Cards without arrows = FAILURE.
|
|
402
|
+
|
|
403
|
+
CSS:
|
|
404
|
+
.content { flex:1; display:flex; align-items:stretch; gap:0; }
|
|
405
|
+
.step { flex:1; display:flex; flex-direction:column; align-items:center; padding:32px 20px; background:${design.accent_light}; border-radius:16px; text-align:center; gap:16px; }
|
|
406
|
+
.step-number { width:52px; height:52px; border-radius:50%; background:linear-gradient(135deg, ${design.primary_color}, ${design.gradient_end}); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:700; flex-shrink:0; }
|
|
407
|
+
.step-title { font-size:28px; font-weight:700; color:${design.primary_color}; }
|
|
408
|
+
.step-desc { font-size:24px; color:${design.text_color}; line-height:1.5; flex:1; }
|
|
409
|
+
.step-time { font-size:24px; color:${design.accent_color}; font-weight:600; margin-top:auto; padding-top:12px; border-top:2px solid ${design.accent_color}40; }
|
|
410
|
+
.arrow { width:60px; display:flex; align-items:center; justify-content:center; font-size:44px; color:${design.accent_color}; flex-shrink:0; }
|
|
411
|
+
|
|
412
|
+
CRITICAL PATTERN — your .content MUST alternate .step and .arrow divs:
|
|
413
|
+
<div class="content">
|
|
414
|
+
<div class="step">
|
|
415
|
+
<div class="step-number">1</div>
|
|
416
|
+
<div class="step-title">STEP TITLE</div>
|
|
417
|
+
<div class="step-desc">Description text</div>
|
|
418
|
+
<div class="step-time">Duration/detail</div>
|
|
419
|
+
</div>
|
|
420
|
+
<div class="arrow">→</div>
|
|
421
|
+
<div class="step">...</div>
|
|
422
|
+
<div class="arrow">→</div>
|
|
423
|
+
<div class="step">...</div>
|
|
424
|
+
</div>
|
|
425
|
+
|
|
426
|
+
⚠ 3-5 steps with → arrows between them. align-items:stretch makes all steps equal height.
|
|
427
|
+
⚠ .step-time with margin-top:auto anchors it at the bottom of each step.
|
|
428
|
+
⚠⚠⚠ .step and .arrow divs MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
429
|
+
big_numbers: `═══ REQUIRED LAYOUT: BIG NUMBER METRICS ═══
|
|
430
|
+
⚠⚠⚠ You MUST create BIG NUMBER SPOTLIGHT cards with 72-96px numbers. Tables/small text = FAILURE.
|
|
431
|
+
|
|
432
|
+
CSS:
|
|
433
|
+
.content { flex:1; display:flex; gap:40px; align-items:stretch; }
|
|
434
|
+
.metric-card { flex:1; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:48px 32px; border-radius:20px; background:#fff; box-shadow:0 4px 24px rgba(0,0,0,0.06); text-align:center; gap:20px; }
|
|
435
|
+
.metric-value { font-size:80px; font-weight:800; color:${design.primary_color}; line-height:1; }
|
|
436
|
+
.metric-unit { font-size:32px; font-weight:600; color:${design.accent_color}; }
|
|
437
|
+
.metric-label { font-size:28px; font-weight:600; color:${design.text_color}; }
|
|
438
|
+
.metric-desc { font-size:24px; color:${design.text_color}aa; line-height:1.5; }
|
|
439
|
+
.metric-trend { font-size:26px; font-weight:600; margin-top:auto; }
|
|
440
|
+
|
|
441
|
+
⚠ 2-3 metric cards side by side. Each: huge number (font-size:80px), unit, label, description, trend.
|
|
442
|
+
⚠ align-items:stretch makes cards fill full height. justify-content:center within each card centers content.
|
|
443
|
+
⚠ Trend colors: green (#10B981) for positive ▲, red (#EF4444) for negative ▼.
|
|
444
|
+
⚠⚠⚠ .metric-card divs MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
445
|
+
two_col_split: `═══ REQUIRED LAYOUT: 2-COLUMN SPLIT ═══
|
|
446
|
+
⚠⚠⚠ You MUST create a 2-COLUMN layout. Single column = FAILURE.
|
|
447
|
+
|
|
448
|
+
CSS:
|
|
449
|
+
.content { flex:1; display:grid; grid-template-columns:1fr 1fr; gap:32px; }
|
|
450
|
+
.left-col { display:flex; flex-direction:column; gap:20px; justify-content:center; padding:20px; }
|
|
451
|
+
.right-col { display:flex; flex-direction:column; gap:20px; justify-content:center; padding:20px; }
|
|
452
|
+
|
|
453
|
+
⚠ Left column: primary content (big metric, chart, or main visual). Right: supporting detail cards or text.
|
|
454
|
+
⚠ Both columns stretch full height. Keep text LARGE (28-32px) — don't try to squeeze too much.
|
|
455
|
+
⚠ MAX 3-4 items per column. If content overflows, reduce items instead of shrinking text.`,
|
|
456
|
+
timeline: `═══ REQUIRED LAYOUT: TIMELINE ═══
|
|
457
|
+
⚠⚠⚠ You MUST create a HORIZONTAL TIMELINE with milestone cards. Generic cards = FAILURE.
|
|
458
|
+
|
|
459
|
+
CSS:
|
|
460
|
+
.content { flex:1; display:flex; align-items:stretch; gap:24px; }
|
|
461
|
+
.milestone { flex:1; display:flex; flex-direction:column; padding:32px; border-radius:16px; background:#fff; box-shadow:0 4px 20px rgba(0,0,0,0.06); gap:16px; }
|
|
462
|
+
.milestone-date { font-size:24px; font-weight:700; color:${design.accent_color}; }
|
|
463
|
+
.milestone-icon { width:52px; height:52px; border-radius:50%; background:linear-gradient(135deg, ${design.primary_color}, ${design.gradient_end}); display:flex; align-items:center; justify-content:center; color:#fff; font-size:24px; }
|
|
464
|
+
.milestone-title { font-size:30px; font-weight:700; color:${design.primary_color}; }
|
|
465
|
+
.milestone-desc { font-size:26px; color:${design.text_color}; line-height:1.5; flex:1; }
|
|
466
|
+
.milestone-kpi { font-size:24px; font-weight:600; color:${design.accent_color}; margin-top:auto; padding-top:16px; border-top:2px solid ${design.accent_light}; }
|
|
467
|
+
|
|
468
|
+
⚠ 3-4 .milestone cards side by side. Each: date → icon → title → description → KPI at bottom.
|
|
469
|
+
⚠ align-items:stretch + flex:1 on .milestone-desc ensures all cards are equal height.
|
|
470
|
+
⚠ .milestone-kpi with margin-top:auto anchors it at the bottom of each card.
|
|
471
|
+
⚠⚠⚠ .milestone divs MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
472
|
+
progress_bars: `═══ REQUIRED LAYOUT: PROGRESS BARS ═══
|
|
473
|
+
⚠⚠⚠ You MUST create FULL-WIDTH HORIZONTAL PROGRESS BARS. Small bars inside cards = FAILURE.
|
|
474
|
+
|
|
475
|
+
CSS:
|
|
476
|
+
.content { flex:1; display:flex; flex-direction:column; justify-content:space-evenly; gap:0; padding:20px 0; }
|
|
477
|
+
.bar-item { display:flex; flex-direction:column; gap:10px; }
|
|
478
|
+
.bar-header { display:flex; justify-content:space-between; align-items:baseline; }
|
|
479
|
+
.bar-label { font-size:28px; font-weight:600; color:${design.text_color}; }
|
|
480
|
+
.bar-value { font-size:28px; font-weight:700; color:${design.primary_color}; }
|
|
481
|
+
.bar-track { width:100%; height:44px; background:${design.accent_light}; border-radius:22px; overflow:hidden; }
|
|
482
|
+
.bar-fill { height:100%; border-radius:22px; background:linear-gradient(90deg, ${design.primary_color}, ${design.accent_color}); }
|
|
483
|
+
|
|
484
|
+
CRITICAL PATTERN — your .content MUST be a vertical stack of .bar-item divs:
|
|
485
|
+
<div class="content">
|
|
486
|
+
<div class="bar-item">
|
|
487
|
+
<div class="bar-header">
|
|
488
|
+
<span class="bar-label">Category Name</span>
|
|
489
|
+
<span class="bar-value">85%</span>
|
|
490
|
+
</div>
|
|
491
|
+
<div class="bar-track"><div class="bar-fill" style="width:85%"></div></div>
|
|
492
|
+
</div>
|
|
493
|
+
<!-- repeat 4-6 bar-items -->
|
|
494
|
+
</div>
|
|
495
|
+
|
|
496
|
+
⚠ justify-content:space-evenly distributes bars across the full height — NO empty bottom.
|
|
497
|
+
⚠ Each bar: header row (label + percentage) + track div containing fill div with style="width:XX%".
|
|
498
|
+
⚠ 4-6 bars. Bar height:44px. Use gradient fills. The structure above is non-negotiable.
|
|
499
|
+
⚠⚠⚠ .bar-item divs MUST be DIRECT children of .content. Do NOT wrap them in a container div.`,
|
|
500
|
+
hero_stat: `═══ REQUIRED LAYOUT: HERO STAT ═══
|
|
501
|
+
⚠⚠⚠ You MUST create a SINGLE LARGE CENTRAL METRIC. Cards/tables = FAILURE.
|
|
502
|
+
|
|
503
|
+
CSS:
|
|
504
|
+
.content { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:24px; }
|
|
505
|
+
.hero-number { font-size:128px; font-weight:900; color:${design.primary_color}; line-height:1; }
|
|
506
|
+
.hero-unit { font-size:48px; font-weight:600; color:${design.accent_color}; }
|
|
507
|
+
.hero-label { font-size:36px; font-weight:600; color:${design.text_color}; }
|
|
508
|
+
.hero-context { font-size:28px; color:${design.text_color}aa; text-align:center; max-width:800px; line-height:1.6; }
|
|
509
|
+
.supporting-row { display:flex; gap:60px; margin-top:48px; }
|
|
510
|
+
.supporting-item { text-align:center; }
|
|
511
|
+
.supporting-value { font-size:40px; font-weight:700; color:${design.primary_color}; }
|
|
512
|
+
.supporting-label { font-size:24px; color:${design.text_color}aa; margin-top:8px; }
|
|
513
|
+
|
|
514
|
+
⚠ ONE giant number (font-size:128px) center stage. Description below. Optional 2-3 supporting metrics in a row.
|
|
515
|
+
⚠ This is the ONLY layout where justify-content:center on .content is correct.`,
|
|
516
|
+
};
|
|
517
|
+
return layouts[layoutType] || layouts.cards;
|
|
518
|
+
}
|
|
519
|
+
export function postProcessSlideHtml(html) {
|
|
520
|
+
const fixStyle = `<style id="viewport-fill">
|
|
521
|
+
body{display:flex!important;flex-direction:column!important;height:1080px!important;min-height:1080px!important;overflow:hidden!important;font-size:max(26px,1.35vw)}
|
|
522
|
+
body>*:first-child{flex:0 0 auto!important}
|
|
523
|
+
body>*:not(:first-child):not(style):not(script){flex:1 1 0!important;min-height:0!important;align-content:stretch!important;align-items:stretch!important}
|
|
524
|
+
body>*:not(:first-child):not(style):not(script)>*{align-self:stretch!important;min-height:0}
|
|
525
|
+
.slide-title{flex:0 0 auto!important}
|
|
526
|
+
.content{flex:1 1 0!important;min-height:0!important;align-content:stretch!important;align-items:stretch!important}
|
|
527
|
+
.content>*{align-self:stretch!important;min-height:0}
|
|
528
|
+
.content>:only-child{display:flex!important;flex-direction:column!important;justify-content:space-evenly!important;flex:1 1 0!important;min-height:0!important}
|
|
529
|
+
</style>`;
|
|
530
|
+
if (html.includes('</head>')) {
|
|
531
|
+
return html.replace('</head>', fixStyle + '</head>');
|
|
532
|
+
}
|
|
533
|
+
if (html.includes('</style>')) {
|
|
534
|
+
return html.replace(/<\/style>(?![\s\S]*<\/style>)/, fixStyle + '</style>');
|
|
535
|
+
}
|
|
536
|
+
return html;
|
|
537
|
+
}
|
|
538
|
+
export function buildReviewPrompt(html, expectedLayout, slideTitle) {
|
|
539
|
+
return `You are a presentation slide quality reviewer. Evaluate this HTML slide and output ONLY a JSON object.
|
|
540
|
+
|
|
541
|
+
EXPECTED LAYOUT: "${expectedLayout}"
|
|
542
|
+
SLIDE TITLE: "${slideTitle}"
|
|
543
|
+
|
|
544
|
+
HTML (first 3000 chars):
|
|
545
|
+
${html.slice(0, 3000)}
|
|
546
|
+
|
|
547
|
+
Evaluate:
|
|
548
|
+
1. LAYOUT (1-10): Does it use "${expectedLayout}" layout? Wrong layout type = score 1.
|
|
549
|
+
2. READABILITY (1-10): Font sizes ≥26px? Good contrast? Text readable?
|
|
550
|
+
3. FILL (1-10): Content fills 80-90% of 1920×1080? No huge empty areas?
|
|
551
|
+
|
|
552
|
+
Output JSON ONLY (no markdown fences):
|
|
553
|
+
{"layout":N,"readability":N,"fill":N,"pass":true/false,"feedback":"specific fix needed or empty string"}
|
|
554
|
+
|
|
555
|
+
PASS = all scores ≥ 7. FAIL = any score < 7.`;
|
|
556
|
+
}
|
|
557
|
+
export function buildSlideHtmlPrompt(slideTitle, contentDirection, design, slideIndex, totalSlides, language, layoutType = 'cards') {
|
|
558
|
+
const langRule = language === 'ko'
|
|
559
|
+
? 'ALL visible text MUST be in Korean. Write naturally in Korean.'
|
|
560
|
+
: 'ALL visible text MUST be in English.';
|
|
561
|
+
const styleVariants = [
|
|
562
|
+
'LIGHT',
|
|
563
|
+
'ACCENT_HEADER',
|
|
564
|
+
'GRADIENT_BG',
|
|
565
|
+
];
|
|
566
|
+
const styleVariant = styleVariants[slideIndex % styleVariants.length];
|
|
567
|
+
const styleGuide = {
|
|
568
|
+
'LIGHT': `Background: ${design.background_color}. Title: ${design.primary_color}, 48-56px bold. Cards/elements use white background with box-shadow.`,
|
|
569
|
+
'ACCENT_HEADER': `Add a bold accent bar at top (height:6px, background: linear-gradient(90deg, ${design.accent_color}, ${design.primary_color})). Title directly below. Background: ${design.background_color}.`,
|
|
570
|
+
'GRADIENT_BG': `Subtle gradient background: linear-gradient(150deg, ${design.background_color} 0%, ${design.accent_light} 50%, ${design.background_color} 100%). Elements use stronger shadows (0 8px 32px rgba(0,0,0,0.08)).`,
|
|
571
|
+
};
|
|
572
|
+
return `You are a world-class web designer creating a presentation slide as a complete HTML page.
|
|
573
|
+
Output ONLY the complete HTML document — nothing else. No explanation, no markdown fences.
|
|
574
|
+
|
|
575
|
+
═══ SLIDE INFO ═══
|
|
576
|
+
Title: "${slideTitle}"
|
|
577
|
+
Slide ${slideIndex + 1} of ${totalSlides}
|
|
578
|
+
|
|
579
|
+
═══ CONTENT DIRECTION (what to show on this slide) ═══
|
|
580
|
+
${contentDirection}
|
|
581
|
+
|
|
582
|
+
⚠⚠⚠ CRITICAL: The content_direction above is a GUIDE for what content to create.
|
|
583
|
+
Generate REAL, specific, professional text based on it. NEVER display the content_direction text literally on the slide.
|
|
584
|
+
If it says "3 big metrics: X, Y, Z" → create 3 beautifully formatted metric cards with X, Y, Z values.
|
|
585
|
+
If it says "Layout: comparison table" → create a table with the DATA mentioned, not the word "comparison table".
|
|
586
|
+
|
|
587
|
+
═══ DESIGN SYSTEM ═══
|
|
588
|
+
Primary: ${design.primary_color} | Accent: ${design.accent_color} | Background: ${design.background_color}
|
|
589
|
+
Text: ${design.text_color} | Accent Light: ${design.accent_light} | Gradient End: ${design.gradient_end}
|
|
590
|
+
Title Font: ${design.font_title} | Body Font: ${design.font_body}
|
|
591
|
+
Mood: ${design.mood} | Notes: ${design.design_notes}
|
|
592
|
+
|
|
593
|
+
═══ THIS SLIDE'S VISUAL STYLE ═══
|
|
594
|
+
${styleGuide[styleVariant]}
|
|
595
|
+
This ensures visual variety across slides. Follow this style direction.
|
|
596
|
+
|
|
597
|
+
═══ MANDATORY CSS BOILERPLATE — COPY EXACTLY ═══
|
|
598
|
+
Your <style> tag MUST start with these EXACT rules (copy verbatim):
|
|
599
|
+
|
|
600
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
601
|
+
html, body {
|
|
602
|
+
width: 1920px; height: 1080px; overflow: hidden;
|
|
603
|
+
font-family: "${design.font_body}", "${design.font_title}", "Segoe UI", "Malgun Gothic", Arial, sans-serif;
|
|
604
|
+
word-break: keep-all;
|
|
605
|
+
overflow-wrap: break-word;
|
|
606
|
+
}
|
|
607
|
+
body {
|
|
608
|
+
display: flex; flex-direction: column;
|
|
609
|
+
padding: 60px 80px;
|
|
610
|
+
height: 1080px;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
⚠ word-break:keep-all is CRITICAL for Korean text — without it, words break at random characters.
|
|
614
|
+
⚠ body MUST be display:flex + flex-direction:column + height:1080px for vertical fill.
|
|
615
|
+
⚠ The main content container (the one with cards/table/chart) MUST use class="content" — required for post-processing.
|
|
616
|
+
|
|
617
|
+
═══ TECHNICAL REQUIREMENTS ═══
|
|
618
|
+
1. Complete HTML: <!DOCTYPE html> through </html>
|
|
619
|
+
2. ALL styling in <style> tag — no external resources, images, fonts, or scripts
|
|
620
|
+
3. System fonts ONLY. NO <img> tags.
|
|
621
|
+
4. Use CSS for visuals: gradients, shapes, shadows, borders, pseudo-elements
|
|
622
|
+
5. FIXED pixel layout — NO max-width, NO media queries, NO percentage widths below 80%
|
|
623
|
+
6. body IS the container — no wrapper divs. Content goes directly in body.
|
|
624
|
+
|
|
625
|
+
═══ VERTICAL FILL — THE #1 QUALITY RULE ═══
|
|
626
|
+
⚠⚠⚠ Content MUST fill the ENTIRE 1920×1080 slide. Empty space = FAILURE.
|
|
627
|
+
⚠⚠⚠ NEVER have more than 150px of empty whitespace anywhere on the slide.
|
|
628
|
+
|
|
629
|
+
MANDATORY STRUCTURE (body has EXACTLY 2 direct children):
|
|
630
|
+
body (display:flex, flex-direction:column, height:1080px, padding:60px 80px)
|
|
631
|
+
→ .slide-title (flex:0 0 auto — title text only, NO extra margin-bottom)
|
|
632
|
+
→ .content (flex:1 — STRETCHES to fill ALL remaining vertical space)
|
|
633
|
+
|
|
634
|
+
⚠ body MUST have exactly 2 direct children: .slide-title and .content. No accent bars, no spacers, no extra divs between them.
|
|
635
|
+
⚠ .slide-title should include any accent bars/decorations AS PART OF the title section, not as separate body children.
|
|
636
|
+
⚠ .content MUST use flex:1 to stretch. NEVER use justify-content:center on .content — it creates dead space.
|
|
637
|
+
⚠⚠⚠ ALL content elements (cards, bars, table, timeline items) MUST be DIRECT CHILDREN of .content. NEVER wrap them in a container/wrapper div inside .content. Wrong: .content > .wrapper > items. Right: .content > items.
|
|
638
|
+
|
|
639
|
+
${getLayoutSpecificCss(layoutType, design)}
|
|
640
|
+
|
|
641
|
+
═══ DESIGN RULES ═══
|
|
642
|
+
1. Title: 48-64px bold. Body: 26-32px. MINIMUM any visible text: 26px. NEVER use font-size below 26px for any text element. If content doesn't fit at 26px, REDUCE ITEM COUNT instead of shrinking text. Card descriptions: 26-30px. Card titles: 32-40px. Labels/captions: 26px minimum. body { font-size: 26px; } is MANDATORY.
|
|
643
|
+
2. Use gradients, box-shadow (0 4px 20px rgba(0,0,0,0.06)), border-radius (12-20px)
|
|
644
|
+
3. Follow the REQUIRED LAYOUT specified above exactly. Do NOT substitute a different layout type.
|
|
645
|
+
4. LAYOUT LIMITS: MAX 4 cards (2×2 grid), MAX 2 cards per row. Tables: 5-8 rows for rich data. Timeline: 4-5 steps.
|
|
646
|
+
⚠ If content_direction lists 5+ items, group them into 4 cards (combine related items).
|
|
647
|
+
5. ⚠⚠⚠ NEVER use position:absolute. ALL layout MUST use flexbox/grid. position:absolute is STRIPPED by the renderer.
|
|
648
|
+
6. ⚠ NEVER use hub-and-spoke or center-circle layouts (a circle in the center with items around it). The overlapping circle ALWAYS covers text. Use a simple card grid instead.
|
|
649
|
+
7. ⚠ MAXIMUM 4 columns in any grid layout. 5+ columns = text too small. Use 2-3 columns + 2 rows instead.
|
|
650
|
+
8. PIE/DONUT: conic-gradient on border-radius:50% div ONLY. No clip-path or rotated divs.
|
|
651
|
+
9. Bar chart labels: min-width:120px, text-align:center. Never let labels wrap per-character.
|
|
652
|
+
10. ⚠ NO LINE CHARTS in CSS — lines/dots never align correctly. Use bar charts (flex-end alignment) or donut charts (conic-gradient) instead.
|
|
653
|
+
11. CSS CHARTS THAT WORK: vertical bar charts (flex-end + height%), horizontal bar charts (width%), donut/pie charts (conic-gradient + border-radius:50%), progress bars (width%). Use these liberally for data visualization.
|
|
654
|
+
12. Table headers: dark background (${design.primary_color}) with WHITE text. Never transparent.
|
|
655
|
+
|
|
656
|
+
═══ SPACE UTILIZATION — NO DEAD ZONES ═══
|
|
657
|
+
⚠ Content MUST be distributed across the full 1080px height. No section should be >150px of empty whitespace.
|
|
658
|
+
⚠ If using a colored header/banner area, it MUST NOT exceed 20% of slide height (216px max).
|
|
659
|
+
⚠ The main content area (.content with flex:1) must contain the MAJORITY of visible information.
|
|
660
|
+
⚠ Cards stretch to fill height via align-items:stretch from parent — but they MUST have DENSE content inside (see CARD CONTENT DENSITY above).
|
|
661
|
+
⚠ NEVER use justify-content:center or align-items:center on .content — it bunches content in the center with empty space around it.
|
|
662
|
+
⚠ NEVER use justify-content:space-between on individual cards — it creates huge gaps between sparse items. Use flex-start + gap instead.
|
|
663
|
+
⚠ Cards in a row: parent uses align-items:stretch (default) so cards fill the full height.
|
|
664
|
+
|
|
665
|
+
═══ TABLE COMPLETENESS — MANDATORY ═══
|
|
666
|
+
⚠ If you create a table, EVERY cell MUST contain real data. Empty cells = FAILURE.
|
|
667
|
+
⚠ For comparison tables: fill ALL columns for ALL competitors/items with realistic data.
|
|
668
|
+
⚠ Example: 5-company comparison → all 5 columns must have data in every row.
|
|
669
|
+
⚠ NEVER create a table with only 1 column filled — that's not a comparison, it's a list.
|
|
670
|
+
|
|
671
|
+
═══ CONTENT RULES ═══
|
|
672
|
+
• ${langRule}
|
|
673
|
+
• Korean text only — never Chinese characters (漢字), Japanese, or other scripts
|
|
674
|
+
• Generate REAL, specific content — no placeholders
|
|
675
|
+
• BALANCE density and readability — fill 80-90% of the slide area with meaningful content. Avoid both sparse slides and overloaded slides.
|
|
676
|
+
• If the user specifies a year in their request, USE THAT YEAR faithfully. Only default to ${new Date().getFullYear()} for content with no explicit year.
|
|
677
|
+
• ALL content MUST fit within 1080px height. Use compact padding (24-32px) and dense content. Fill 85-95% of slide area.
|
|
678
|
+
• Each section: 3-5 detailed bullet points with specific data. Dense content beats wide padding.
|
|
679
|
+
• body MUST set font-size: 26px as the base. All text inherits at least 26px unless explicitly larger.
|
|
680
|
+
|
|
681
|
+
═══ PAGE NUMBER ═══
|
|
682
|
+
Bottom-right: "${slideIndex + 1}" (12px, opacity 0.4)
|
|
683
|
+
|
|
684
|
+
Output the complete HTML document now. Start with <!DOCTYPE html> and end with </html>.`;
|
|
685
|
+
}
|
|
686
|
+
export function buildLayoutSetPrompt(design) {
|
|
687
|
+
const moodGuide = {
|
|
688
|
+
'modern-minimal': 'Clean lines, subtle shadows (0 2px 16px rgba(0,0,0,0.06)), generous whitespace, thin borders (1px), smooth border-radius (12-16px)',
|
|
689
|
+
'bold-energetic': 'Strong gradients, deep shadows (0 8px 32px rgba(0,0,0,0.12)), thick accent bars, high contrast, border-radius (8-12px)',
|
|
690
|
+
'corporate-elegant': 'Refined spacing, subtle gradients, structured grids, sophisticated thin shadows, serif-like feel',
|
|
691
|
+
'warm-friendly': 'Rounded corners (20px+), soft warm shadows, inviting spacing (32-40px gaps), gentle color transitions',
|
|
692
|
+
'academic-clean': 'Tight grids, minimal decoration, clear hierarchy, thin rules (1px borders), data-first design',
|
|
693
|
+
};
|
|
694
|
+
return `You are a CSS layout architect. Create reusable slide layout components.
|
|
695
|
+
|
|
696
|
+
DESIGN: Primary:${design.primary_color} Accent:${design.accent_color} BG:${design.background_color} Text:${design.text_color} AccentLight:${design.accent_light} GradEnd:${design.gradient_end}
|
|
697
|
+
Fonts: ${design.font_title} / ${design.font_body} | Mood: ${design.mood}
|
|
698
|
+
Style: ${moodGuide[design.mood] || moodGuide['modern-minimal']}
|
|
699
|
+
|
|
700
|
+
Create exactly 8 layout components. Keep CSS minimal — only essential styles.
|
|
701
|
+
|
|
702
|
+
FORMAT per layout:
|
|
703
|
+
---LAYOUT: name---
|
|
704
|
+
USE: description
|
|
705
|
+
CSS:
|
|
706
|
+
.content{flex:1;display:grid;...}
|
|
707
|
+
HTML:
|
|
708
|
+
<div class="content">...</div>
|
|
709
|
+
---END---
|
|
710
|
+
|
|
711
|
+
REQUIRED (one each):
|
|
712
|
+
1. bar-chart: flex-end aligned bars with height:XX%
|
|
713
|
+
2. donut-chart: conic-gradient circle + legend
|
|
714
|
+
3. progress-bars: .bar-track + .bar-fill with width:XX%
|
|
715
|
+
4. data-table: <table> with colored header
|
|
716
|
+
5. process-flow: step boxes with arrows
|
|
717
|
+
6. big-numbers: 2-3 large metric cards (72-96px)
|
|
718
|
+
7. card-grid: 2x2 or 3-col cards
|
|
719
|
+
8. timeline: horizontal milestone cards
|
|
720
|
+
|
|
721
|
+
Use {{VALUE1}} {{LABEL1}} {{TEXT1}} {{PERCENT1}} as placeholders in HTML.
|
|
722
|
+
|
|
723
|
+
RULES:
|
|
724
|
+
- Use design colors in CSS. .content must have flex:1.
|
|
725
|
+
- Use grid with explicit fr rows (1fr 1fr). Min font: 26px body, 32px titles.
|
|
726
|
+
- No position:absolute, no images, no external resources.
|
|
727
|
+
- Keep each layout CONCISE — minimal CSS, clean HTML skeleton.`;
|
|
728
|
+
}
|
|
729
|
+
export function parseLayoutSet(text) {
|
|
730
|
+
const results = [];
|
|
731
|
+
const blocks = text.split(/---\s*LAYOUT\s*:\s*/i);
|
|
732
|
+
for (const block of blocks) {
|
|
733
|
+
const trimmed = block.trim();
|
|
734
|
+
if (!trimmed || trimmed.length < 40)
|
|
735
|
+
continue;
|
|
736
|
+
const nameMatch = trimmed.match(/^([^\n]+?)\s*---/);
|
|
737
|
+
if (!nameMatch)
|
|
738
|
+
continue;
|
|
739
|
+
const name = nameMatch[1].trim().replace(/\*+/g, '');
|
|
740
|
+
const useMatch = trimmed.match(/USE:\s*(.+)/i);
|
|
741
|
+
const description = useMatch ? useMatch[1].trim() : name;
|
|
742
|
+
const cssMatch = trimmed.match(/CSS\s*:\s*\n?([\s\S]*?)(?=\n\s*HTML\s*:)/i);
|
|
743
|
+
if (!cssMatch)
|
|
744
|
+
continue;
|
|
745
|
+
let css = cssMatch[1].trim().replace(/^```\s*(?:css)?\s*\n?/, '').replace(/\n?```\s*$/, '').trim();
|
|
746
|
+
const htmlMatch = trimmed.match(/HTML\s*:\s*\n?([\s\S]*?)(?=\n?---\s*END\s*---|$)/i);
|
|
747
|
+
if (!htmlMatch)
|
|
748
|
+
continue;
|
|
749
|
+
let skeleton = htmlMatch[1].trim().replace(/^```\s*(?:html)?\s*\n?/, '').replace(/\n?```\s*$/, '').trim();
|
|
750
|
+
if (css.length > 10 && skeleton.length > 10) {
|
|
751
|
+
results.push({ name, description, css, skeleton });
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
return results;
|
|
755
|
+
}
|
|
756
|
+
export function buildAllSkeletonsPrompt(slides, layouts) {
|
|
757
|
+
const layoutList = layouts.map(l => ` - "${l.name}": ${l.description}`).join('\n');
|
|
758
|
+
const slideList = slides
|
|
759
|
+
.map((s, i) => {
|
|
760
|
+
if (s.type === 'title' || s.type === 'closing')
|
|
761
|
+
return null;
|
|
762
|
+
const cd = s.content_direction.replace(/\n/g, ' ').slice(0, 200);
|
|
763
|
+
return ` Slide ${i + 1}: "${s.title}" — ${cd}`;
|
|
764
|
+
})
|
|
765
|
+
.filter(Boolean)
|
|
766
|
+
.join('\n');
|
|
767
|
+
return `You are a presentation layout composer. For each content slide, choose the best layout and create an HTML skeleton.
|
|
768
|
+
|
|
769
|
+
AVAILABLE LAYOUTS:
|
|
770
|
+
${layoutList}
|
|
771
|
+
|
|
772
|
+
SLIDES:
|
|
773
|
+
${slideList}
|
|
774
|
+
|
|
775
|
+
OUTPUT FORMAT — for each content slide:
|
|
776
|
+
===SLIDE:N===
|
|
777
|
+
LAYOUT: layout-name
|
|
778
|
+
<div class="content">
|
|
779
|
+
<!-- adapted skeleton from the chosen layout, with {{PLACEHOLDER}} markers -->
|
|
780
|
+
<!-- adjust element count to match the slide's content -->
|
|
781
|
+
</div>
|
|
782
|
+
===END===
|
|
783
|
+
|
|
784
|
+
RULES:
|
|
785
|
+
⚠ Use at least 5 DIFFERENT layouts across all slides. Never use the same layout 3+ times.
|
|
786
|
+
⚠ Match layout to content: data → chart, comparison → table, steps → flow, metrics → numbers.
|
|
787
|
+
⚠ Adapt element count: if content has 4 items → 4 cards/bars. If 3 steps → 3 step divs.
|
|
788
|
+
⚠ Output ONLY the .content div — no <html>, no <style>, no boilerplate.
|
|
789
|
+
⚠ Skip title and closing slides (they use fixed templates).
|
|
790
|
+
⚠ Placeholders: {{VALUE1}}, {{LABEL1}}, {{TEXT1}}, {{PERCENT1}}, {{HEIGHT1}}, {{TITLE}}, {{INSIGHT}}, etc.
|
|
791
|
+
⚠ Keep skeletons minimal and structural — just the div hierarchy with class names and placeholders.
|
|
792
|
+
|
|
793
|
+
MINIMUM CONTENT DENSITY PER SKELETON:
|
|
794
|
+
⚠ Each card skeleton MUST include: {{TITLE}}, {{BULLET1}}, {{BULLET2}}, {{BULLET3}}, {{BULLET4}}, {{STAT}} — at least 6 placeholders per card.
|
|
795
|
+
⚠ Each progress bar MUST include: {{LABEL}}, {{VALUE}}, {{PERCENT}}, {{DETAIL}} — label + value + bar + detail text.
|
|
796
|
+
⚠ Each timeline milestone MUST include: {{DATE}}, {{TITLE}}, {{DESC1}}, {{DESC2}}, {{KPI}} — 5 placeholders minimum.
|
|
797
|
+
⚠ Each table row MUST have ALL columns filled with {{DATA}} placeholders. Include 5-8 rows.
|
|
798
|
+
⚠ NEVER create a skeleton with only 2 content items per element — that produces EMPTY slides.`;
|
|
799
|
+
}
|
|
800
|
+
export function parseSkeletons(text) {
|
|
801
|
+
const results = new Map();
|
|
802
|
+
const blocks = text.split(/===\s*SLIDE\s*:\s*/i);
|
|
803
|
+
for (const block of blocks) {
|
|
804
|
+
const trimmed = block.trim();
|
|
805
|
+
if (!trimmed)
|
|
806
|
+
continue;
|
|
807
|
+
const numMatch = trimmed.match(/^(\d+)\s*===/);
|
|
808
|
+
if (!numMatch)
|
|
809
|
+
continue;
|
|
810
|
+
const slideNum = parseInt(numMatch[1], 10);
|
|
811
|
+
const layoutMatch = trimmed.match(/LAYOUT\s*:\s*([^\n]+)/i);
|
|
812
|
+
const layout = layoutMatch ? layoutMatch[1].trim() : '';
|
|
813
|
+
const contentMatch = trimmed.match(/(<div[\s\S]*)<\/div>\s*(?:===\s*END\s*===|$)/i);
|
|
814
|
+
let skeleton = contentMatch ? contentMatch[1].trim() + '</div>' : '';
|
|
815
|
+
if (!skeleton || skeleton.length < 20) {
|
|
816
|
+
const fallbackMatch = trimmed.match(/LAYOUT\s*:[^\n]+\n([\s\S]*?)(?:===\s*END\s*===|$)/i);
|
|
817
|
+
skeleton = fallbackMatch ? fallbackMatch[1].trim() : '';
|
|
818
|
+
}
|
|
819
|
+
if (layout && skeleton.length > 20) {
|
|
820
|
+
results.set(slideNum, { layout, skeleton });
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return results;
|
|
824
|
+
}
|
|
825
|
+
export function buildFillPrompt(skeleton, layoutCss, contentDirection, slideTitle, design, slideIndex, totalSlides, language, layoutType = 'cards') {
|
|
826
|
+
const langRule = language === 'ko'
|
|
827
|
+
? 'ALL visible text MUST be in Korean. Write naturally in Korean.'
|
|
828
|
+
: 'ALL visible text MUST be in English.';
|
|
829
|
+
const styleVariants = [
|
|
830
|
+
`STYLE: Clean white cards with subtle shadow (0 4px 20px rgba(0,0,0,0.06)), 16px border-radius. Background: ${design.background_color}.`,
|
|
831
|
+
`STYLE: Cards with colored left border (4px solid ${design.accent_color}) and ${design.accent_light} tinted background. No box-shadow.`,
|
|
832
|
+
`STYLE: Cards with gradient TOP border (4px solid, background-image: linear-gradient(90deg, ${design.primary_color}, ${design.accent_color})). White card body with medium shadow.`,
|
|
833
|
+
`STYLE: Slide background uses subtle gradient: linear-gradient(150deg, ${design.background_color} 0%, ${design.accent_light} 50%, ${design.background_color} 100%). Cards have stronger shadow (0 8px 32px rgba(0,0,0,0.08)).`,
|
|
834
|
+
`STYLE: Bold accent bar at top of slide (height:6px, background: linear-gradient(90deg, ${design.accent_color}, ${design.primary_color})). Clean white cards below with subtle shadow.`,
|
|
835
|
+
];
|
|
836
|
+
const styleGuide = styleVariants[slideIndex % styleVariants.length];
|
|
837
|
+
const layoutFillRules = {
|
|
838
|
+
cards: `CARD DENSITY: Each card MUST contain: title (32-40px bold) + 4-5 bullet points (26-28px) with specific numbers and data + metric/stat at bottom. 3 cards with 2 bullets = FAILURE. Cards MUST be DIRECT children of .content grid. NEVER have empty grid cells.`,
|
|
839
|
+
progress_bars: `PROGRESS BAR DENSITY: 5-6 bars total. Each bar MUST have: category title + bold percentage value + progress bar + 1-line detail text below the bar explaining context. .bar-item divs MUST be DIRECT children of .content — NO wrapper container.`,
|
|
840
|
+
bar_chart: `BAR CHART DENSITY: 4-6 bars with value labels on top. Add a 2-line insight row at the bottom of the chart area. Include axis labels and context.`,
|
|
841
|
+
donut_chart: `DONUT DENSITY: 4-5 colored segments. Legend items MUST include: colored dot + category name + absolute value + percentage. Add a 2-sentence summary paragraph below the legend.`,
|
|
842
|
+
table: `TABLE DENSITY: 6-8 data rows × 3-5 columns. ALL cells MUST contain real data — no empty cells. Add a summary bar below the table with key insight text. Use larger padding (28-32px) on td. <table> and .summary-bar MUST be DIRECT children of .content.`,
|
|
843
|
+
timeline: `TIMELINE DENSITY: Each milestone MUST have: date (24px) + title (30px bold) + 3-4 sentence description (26px) + KPI metric at bottom. No sparse milestones with 1-line descriptions. .milestone divs MUST be DIRECT children of .content.`,
|
|
844
|
+
process_flow: `PROCESS FLOW DENSITY: Each step MUST have: number + title (28px bold) + 2-3 sentence description (24px) + time/metric at bottom. Include → arrows between steps.`,
|
|
845
|
+
big_numbers: `METRIC DENSITY: Each metric card MUST have: large number (72-80px) + unit (32px) + label (28px) + 2-3 sentence context description (24px) + trend indicator (▲▼ with color). Minimum 3 metric cards.`,
|
|
846
|
+
two_col_split: `SPLIT DENSITY: Left column: primary visual or metric with context. Right column: 4-5 detailed bullet points with specific numbers. Both columns MUST be content-rich.`,
|
|
847
|
+
hero_stat: `HERO DENSITY: Central number (128px) + unit + label + 2-3 sentence context paragraph + row of 2-3 supporting metrics below with labels.`,
|
|
848
|
+
};
|
|
849
|
+
const layoutRule = layoutFillRules[layoutType] || layoutFillRules['cards'];
|
|
850
|
+
return `You are filling content into a pre-built HTML slide skeleton.
|
|
851
|
+
Output ONLY the complete HTML document — no explanation, no markdown.
|
|
852
|
+
|
|
853
|
+
═══ SLIDE ═══
|
|
854
|
+
Title (display this exactly as .slide-title h1): "${slideTitle}"
|
|
855
|
+
Position: ${slideIndex + 1} of ${totalSlides} (for page number only, NOT in the title)
|
|
856
|
+
|
|
857
|
+
═══ CONTENT DIRECTION ═══
|
|
858
|
+
${contentDirection}
|
|
859
|
+
|
|
860
|
+
⚠ Generate REAL, specific content based on the direction above. Never display placeholder text.
|
|
861
|
+
⚠ The .slide-title h1 must show ONLY "${slideTitle}" — never include slide numbers or position info in the title.
|
|
862
|
+
|
|
863
|
+
═══ SKELETON (preserve this structure, replace {{PLACEHOLDERS}} with real content) ═══
|
|
864
|
+
${skeleton}
|
|
865
|
+
|
|
866
|
+
═══ LAYOUT CSS ═══
|
|
867
|
+
${layoutCss}
|
|
868
|
+
|
|
869
|
+
═══ DESIGN SYSTEM ═══
|
|
870
|
+
Primary: ${design.primary_color} | Accent: ${design.accent_color} | BG: ${design.background_color}
|
|
871
|
+
Text: ${design.text_color} | Accent Light: ${design.accent_light} | Gradient End: ${design.gradient_end}
|
|
872
|
+
Title Font: ${design.font_title} | Body Font: ${design.font_body} | Mood: ${design.mood}
|
|
873
|
+
|
|
874
|
+
═══ THIS SLIDE'S VISUAL STYLE ═══
|
|
875
|
+
${styleGuide}
|
|
876
|
+
Follow this style direction to ensure visual variety across slides.
|
|
877
|
+
|
|
878
|
+
═══ BUILD THE COMPLETE HTML PAGE ═══
|
|
879
|
+
1. Start with <!DOCTYPE html><html><head><style>
|
|
880
|
+
2. In <style>: BOILERPLATE (below) + LAYOUT CSS (above) + any extra styling you want
|
|
881
|
+
3. In <body>: .slide-title with the title, then the SKELETON with placeholders filled
|
|
882
|
+
4. Replace EVERY {{PLACEHOLDER}} with professional content from the content direction
|
|
883
|
+
5. If content needs more/fewer elements than the skeleton has, adapt the structure
|
|
884
|
+
6. Add visual polish: gradients, shadows, accent colors from the design system
|
|
885
|
+
|
|
886
|
+
BOILERPLATE CSS (copy into <style>):
|
|
887
|
+
* { margin:0; padding:0; box-sizing:border-box; }
|
|
888
|
+
html, body { width:1920px; height:1080px; overflow:hidden; font-family:"${design.font_body}","${design.font_title}","Segoe UI","Malgun Gothic",Arial,sans-serif; word-break:keep-all; overflow-wrap:break-word; }
|
|
889
|
+
body { display:flex; flex-direction:column; padding:60px 80px; height:1080px; background:${design.background_color}; color:${design.text_color}; font-size:26px; }
|
|
890
|
+
.slide-title h1 { font-size:52px; font-weight:700; color:${design.primary_color}; margin-bottom:20px; font-family:"${design.font_title}","Segoe UI",sans-serif; }
|
|
891
|
+
.content { flex:1; }
|
|
892
|
+
|
|
893
|
+
RULES:
|
|
894
|
+
⚠ ${langRule}
|
|
895
|
+
⚠ Korean text only — never Chinese characters (漢字), Japanese, or other scripts.
|
|
896
|
+
⚠ Font minimum: 26px for ALL text. Reduce items instead of shrinking text.
|
|
897
|
+
⚠ NO position:absolute. Flexbox/grid only.
|
|
898
|
+
⚠ NO images, NO external fonts, NO JavaScript.
|
|
899
|
+
⚠ .content MUST have flex:1 to fill remaining vertical space.
|
|
900
|
+
⚠ Page number: bottom-right corner, "${slideIndex + 1}" (font-size:12px, opacity:0.4).
|
|
901
|
+
|
|
902
|
+
═══ VERTICAL FILL — CRITICAL ═══
|
|
903
|
+
⚠⚠⚠ Content MUST fill 85-95% of the 1080px slide height. Empty slides = FAILURE.
|
|
904
|
+
|
|
905
|
+
${layoutRule}
|
|
906
|
+
|
|
907
|
+
⚠ The skeleton has {{PLACEHOLDERS}} — replace them AND ADD MORE CONTENT beyond what placeholders specify:
|
|
908
|
+
- Each card/section: 3-5 detailed bullet points with specific data (not 1-2 sparse lines)
|
|
909
|
+
- Include specific numbers, percentages, comparisons, and context in every bullet
|
|
910
|
+
- Add supporting insight text below data visualizations
|
|
911
|
+
- Titles: 40-52px bold. Body text: 26-30px. Metrics: 48-64px.
|
|
912
|
+
⚠ If the skeleton has 3 cards with 2 bullets each → expand to 4-5 bullets per card.
|
|
913
|
+
⚠ NEVER leave the bottom 30% of the slide empty.
|
|
914
|
+
⚠ Use compact but dense layout: 24-32px padding inside cards, 12-16px between items. Dense content > wide padding.
|
|
915
|
+
⚠⚠⚠ ALL content elements (cards, bars, table, items) MUST be DIRECT children of .content. NEVER wrap them in a container/wrapper div.
|
|
916
|
+
|
|
917
|
+
Output the complete HTML now.`;
|
|
918
|
+
}
|
|
919
|
+
export function buildContentFillJsonPrompt(slideTitle, contentDirection, layoutType, language) {
|
|
920
|
+
const langRule = language === 'ko'
|
|
921
|
+
? 'ALL text MUST be in Korean. Write naturally in Korean. Never use Chinese characters (漢字).'
|
|
922
|
+
: 'ALL text MUST be in English.';
|
|
923
|
+
const schemas = {
|
|
924
|
+
cards: `{
|
|
925
|
+
"cards": [
|
|
926
|
+
{ "icon": "single emoji", "title": "Card title (2-5 words)", "bullets": ["Detail with number/data", "Another detail", "Third point", "Fourth point"], "stat": "Key metric (e.g., 97.8% 정확도)" }
|
|
927
|
+
]
|
|
928
|
+
}
|
|
929
|
+
RULES: 3-4 cards. Each: icon + title + 4-5 bullets with specific data + stat.`,
|
|
930
|
+
bar_chart: `{
|
|
931
|
+
"bars": [
|
|
932
|
+
{ "label": "Category name", "value": "Display value (e.g. 1,250억원)", "height": 85 }
|
|
933
|
+
],
|
|
934
|
+
"insight": "1-2 sentence key insight about the data"
|
|
935
|
+
}
|
|
936
|
+
RULES: 4-6 bars. height: 10-90 (tallest=85, others proportional). Values with units.`,
|
|
937
|
+
donut_chart: `{
|
|
938
|
+
"segments": [
|
|
939
|
+
{ "label": "Segment name", "value": "Display value (e.g. 562억원)", "percent": 45 }
|
|
940
|
+
],
|
|
941
|
+
"centerText": "Center label (e.g. 총 1,250억원)",
|
|
942
|
+
"summary": "1-2 sentence summary"
|
|
943
|
+
}
|
|
944
|
+
RULES: 3-5 segments. Percents MUST sum to exactly 100.`,
|
|
945
|
+
table: `{
|
|
946
|
+
"headers": ["Column 1", "Column 2", "Column 3", "Column 4"],
|
|
947
|
+
"rows": [["data", "data", "data", "data"]],
|
|
948
|
+
"highlightRow": 0,
|
|
949
|
+
"summary": "1-2 sentence summary"
|
|
950
|
+
}
|
|
951
|
+
RULES: 3-5 columns. 5-7 rows. ALL cells real data. highlightRow: 0-indexed or null.`,
|
|
952
|
+
process_flow: `{
|
|
953
|
+
"steps": [
|
|
954
|
+
{ "title": "Step name (2-4 words)", "desc": "2-3 sentence description with details", "detail": "Duration or metric" }
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
RULES: 3-5 steps. Each: title + detailed description + time/metric.`,
|
|
958
|
+
big_numbers: `{
|
|
959
|
+
"metrics": [
|
|
960
|
+
{ "value": "1,250", "unit": "억원", "label": "Metric Name", "desc": "1-2 sentence context", "trend": "▲ 15%", "positive": true }
|
|
961
|
+
]
|
|
962
|
+
}
|
|
963
|
+
RULES: 2-3 metrics. value=number only, unit=separate. trend: ▲/▼ + percentage.`,
|
|
964
|
+
timeline: `{
|
|
965
|
+
"milestones": [
|
|
966
|
+
{ "date": "2026 Q1", "title": "Milestone name", "desc": "2-3 sentence description", "kpi": "Target metric" }
|
|
967
|
+
]
|
|
968
|
+
}
|
|
969
|
+
RULES: 3-4 milestones with dates, descriptions, and KPI targets.`,
|
|
970
|
+
progress_bars: `{
|
|
971
|
+
"bars": [
|
|
972
|
+
{ "label": "Category name", "value": "Display (e.g. 92%)", "percent": 92, "detail": "Brief context" }
|
|
973
|
+
]
|
|
974
|
+
}
|
|
975
|
+
RULES: 4-6 bars. percent: 5-100. Include context detail for each.`,
|
|
976
|
+
hero_stat: `{
|
|
977
|
+
"number": "97.8",
|
|
978
|
+
"unit": "%",
|
|
979
|
+
"label": "Metric Name",
|
|
980
|
+
"context": "2-3 sentence context explaining significance",
|
|
981
|
+
"supporting": [
|
|
982
|
+
{ "value": "45개국", "label": "Supporting metric name" }
|
|
983
|
+
]
|
|
984
|
+
}
|
|
985
|
+
RULES: 1 hero number + context + 2-3 supporting metrics.`,
|
|
986
|
+
two_col_split: `{
|
|
987
|
+
"leftTitle": "Left column heading",
|
|
988
|
+
"leftItems": [
|
|
989
|
+
{ "label": "Item name", "value": "Item value with data" }
|
|
990
|
+
],
|
|
991
|
+
"rightTitle": "Right column heading",
|
|
992
|
+
"rightBullets": ["Detailed bullet point with data"]
|
|
993
|
+
}
|
|
994
|
+
RULES: Left: 3-5 key-value items. Right: 4-6 detailed bullets.`,
|
|
995
|
+
};
|
|
996
|
+
return `Extract content from the direction below and output ONLY valid JSON.
|
|
997
|
+
Do NOT output markdown fences, explanations, or anything besides the JSON object.
|
|
998
|
+
|
|
999
|
+
SLIDE TITLE: "${slideTitle}"
|
|
1000
|
+
LAYOUT TYPE: ${layoutType}
|
|
1001
|
+
|
|
1002
|
+
CONTENT DIRECTION:
|
|
1003
|
+
${contentDirection}
|
|
1004
|
+
|
|
1005
|
+
REQUIRED JSON SCHEMA:
|
|
1006
|
+
${schemas[layoutType]}
|
|
1007
|
+
|
|
1008
|
+
${langRule}
|
|
1009
|
+
Use SPECIFIC numbers, names, percentages from the content direction.
|
|
1010
|
+
Each text field must be substantive (not 1-2 generic words).
|
|
1011
|
+
If the content direction lacks specific data, generate realistic professional data that fits the topic.
|
|
1012
|
+
|
|
1013
|
+
Output the JSON object now:`;
|
|
1014
|
+
}
|
|
1015
|
+
export function parseContentFillJson(raw, layoutType) {
|
|
1016
|
+
let cleaned = raw.trim();
|
|
1017
|
+
if (cleaned.startsWith('```')) {
|
|
1018
|
+
cleaned = cleaned.replace(/^```(?:json|JSON)?\s*\n?/, '').replace(/\n?```\s*$/, '');
|
|
1019
|
+
}
|
|
1020
|
+
const firstBrace = cleaned.indexOf('{');
|
|
1021
|
+
const lastBrace = cleaned.lastIndexOf('}');
|
|
1022
|
+
if (firstBrace >= 0 && lastBrace > firstBrace) {
|
|
1023
|
+
cleaned = cleaned.slice(firstBrace, lastBrace + 1);
|
|
1024
|
+
}
|
|
1025
|
+
let parsed = null;
|
|
1026
|
+
try {
|
|
1027
|
+
parsed = JSON.parse(cleaned);
|
|
1028
|
+
}
|
|
1029
|
+
catch {
|
|
1030
|
+
try {
|
|
1031
|
+
const repaired = cleaned.replace(/,\s*([}\]])/g, '$1');
|
|
1032
|
+
parsed = JSON.parse(repaired);
|
|
1033
|
+
}
|
|
1034
|
+
catch {
|
|
1035
|
+
return null;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
if (!parsed)
|
|
1039
|
+
return null;
|
|
1040
|
+
switch (layoutType) {
|
|
1041
|
+
case 'cards':
|
|
1042
|
+
if (!Array.isArray(parsed['cards']) || parsed['cards'].length === 0)
|
|
1043
|
+
return null;
|
|
1044
|
+
break;
|
|
1045
|
+
case 'bar_chart':
|
|
1046
|
+
if (!Array.isArray(parsed['bars']) || parsed['bars'].length === 0)
|
|
1047
|
+
return null;
|
|
1048
|
+
break;
|
|
1049
|
+
case 'donut_chart':
|
|
1050
|
+
if (!Array.isArray(parsed['segments']) || parsed['segments'].length === 0)
|
|
1051
|
+
return null;
|
|
1052
|
+
break;
|
|
1053
|
+
case 'table':
|
|
1054
|
+
if (!Array.isArray(parsed['headers']) || !Array.isArray(parsed['rows']))
|
|
1055
|
+
return null;
|
|
1056
|
+
break;
|
|
1057
|
+
case 'process_flow':
|
|
1058
|
+
if (!Array.isArray(parsed['steps']) || parsed['steps'].length === 0)
|
|
1059
|
+
return null;
|
|
1060
|
+
break;
|
|
1061
|
+
case 'big_numbers':
|
|
1062
|
+
if (!Array.isArray(parsed['metrics']) || parsed['metrics'].length === 0)
|
|
1063
|
+
return null;
|
|
1064
|
+
break;
|
|
1065
|
+
case 'timeline':
|
|
1066
|
+
if (!Array.isArray(parsed['milestones']) || parsed['milestones'].length === 0)
|
|
1067
|
+
return null;
|
|
1068
|
+
break;
|
|
1069
|
+
case 'progress_bars':
|
|
1070
|
+
if (!Array.isArray(parsed['bars']) || parsed['bars'].length === 0)
|
|
1071
|
+
return null;
|
|
1072
|
+
break;
|
|
1073
|
+
case 'hero_stat':
|
|
1074
|
+
if (!parsed['number'])
|
|
1075
|
+
return null;
|
|
1076
|
+
break;
|
|
1077
|
+
case 'two_col_split':
|
|
1078
|
+
if (!parsed['leftTitle'] && !parsed['rightTitle'])
|
|
1079
|
+
return null;
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
return parsed;
|
|
1083
|
+
}
|
|
1084
|
+
function escapeHtmlTemplate(text) {
|
|
1085
|
+
return text
|
|
1086
|
+
.replace(/&/g, '&')
|
|
1087
|
+
.replace(/</g, '<')
|
|
1088
|
+
.replace(/>/g, '>')
|
|
1089
|
+
.replace(/"/g, '"');
|
|
1090
|
+
}
|
|
1091
|
+
function wrapSlide(design, title, slideNum, contentCss, contentHtml, variant = 0) {
|
|
1092
|
+
const bgVariants = [
|
|
1093
|
+
`background:${design.background_color};`,
|
|
1094
|
+
`background:linear-gradient(160deg,${design.background_color} 0%,${design.accent_light}40 100%);`,
|
|
1095
|
+
`background:${design.background_color};`,
|
|
1096
|
+
];
|
|
1097
|
+
const bodyBg = bgVariants[variant % bgVariants.length];
|
|
1098
|
+
const accentBar = variant % 3 === 2
|
|
1099
|
+
? `<div style="height:4px;background:linear-gradient(90deg,${design.accent_color},${design.primary_color});margin-bottom:12px;border-radius:2px;flex-shrink:0"></div>`
|
|
1100
|
+
: '';
|
|
1101
|
+
return `<!DOCTYPE html>
|
|
1102
|
+
<html lang="ko">
|
|
1103
|
+
<head><meta charset="UTF-8"><style>
|
|
1104
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
1105
|
+
html,body{width:1920px;height:1080px;overflow:hidden;font-family:"${design.font_body}","${design.font_title}","Segoe UI","Malgun Gothic",Arial,sans-serif;word-break:keep-all;overflow-wrap:break-word}
|
|
1106
|
+
body{display:flex;flex-direction:column;padding:60px 80px;height:1080px;${bodyBg}color:${design.text_color};font-size:26px}
|
|
1107
|
+
.slide-title{flex:0 0 auto;margin-bottom:20px}
|
|
1108
|
+
.slide-title h1{font-size:48px;font-weight:700;color:${design.primary_color};font-family:"${design.font_title}","Segoe UI",sans-serif}
|
|
1109
|
+
.title-bar{width:80px;height:3px;background:${design.accent_color};border-radius:2px;margin-top:12px}
|
|
1110
|
+
.page-number{position:absolute;bottom:20px;right:80px;font-size:12px;opacity:0.4}
|
|
1111
|
+
${contentCss}
|
|
1112
|
+
</style></head>
|
|
1113
|
+
<body>
|
|
1114
|
+
<div class="slide-title">${accentBar}<h1>${escapeHtmlTemplate(title)}</h1><div class="title-bar"></div></div>
|
|
1115
|
+
${contentHtml}
|
|
1116
|
+
<div class="page-number">${slideNum}</div>
|
|
1117
|
+
</body></html>`;
|
|
1118
|
+
}
|
|
1119
|
+
function buildCardsContent(design, data) {
|
|
1120
|
+
const n = Math.min((data.cards || []).length, 4);
|
|
1121
|
+
const cols = n <= 3 ? `repeat(${n},1fr)` : '1fr 1fr';
|
|
1122
|
+
const is2x2 = n === 4;
|
|
1123
|
+
const gridExtra = is2x2 ? 'grid-template-rows:1fr 1fr' : 'grid-template-rows:1fr';
|
|
1124
|
+
const cardPad = is2x2 ? '28px 24px' : '36px 32px';
|
|
1125
|
+
const cardGap = is2x2 ? '10px' : '14px';
|
|
1126
|
+
const h2Size = is2x2 ? '32px' : '34px';
|
|
1127
|
+
const liSize = is2x2 ? '26px' : '28px';
|
|
1128
|
+
const liMargin = is2x2 ? '8px' : '12px';
|
|
1129
|
+
const css = `.content{flex:1;display:grid;grid-template-columns:${cols};${gridExtra};gap:24px}
|
|
1130
|
+
.card{background:#fff;border-radius:16px;padding:${cardPad};box-shadow:0 4px 20px rgba(0,0,0,0.06);display:flex;flex-direction:column;gap:${cardGap};overflow:hidden}
|
|
1131
|
+
.card-icon{font-size:36px;line-height:1}
|
|
1132
|
+
.card h2{font-size:${h2Size};font-weight:700;color:${design.primary_color}}
|
|
1133
|
+
.card ul{list-style:none;flex:1}
|
|
1134
|
+
.card li{margin-bottom:${liMargin};padding-left:22px;position:relative;font-size:${liSize};line-height:1.4}
|
|
1135
|
+
.card li::before{content:"•";color:${design.accent_color};position:absolute;left:0;font-weight:bold}
|
|
1136
|
+
.card-stat{margin-top:auto;padding-top:12px;border-top:2px solid ${design.accent_light};font-size:24px;font-weight:600;color:${design.accent_color}}`;
|
|
1137
|
+
const maxBullets = n <= 3 ? 5 : 3;
|
|
1138
|
+
const cards = (data.cards || []).slice(0, 4).map(c => `
|
|
1139
|
+
<div class="card">
|
|
1140
|
+
<div class="card-icon">${c.icon || '📌'}</div>
|
|
1141
|
+
<h2>${escapeHtmlTemplate(c.title || '')}</h2>
|
|
1142
|
+
<ul>${(c.bullets || []).slice(0, maxBullets).map(b => `<li>${escapeHtmlTemplate(b)}</li>`).join('')}</ul>
|
|
1143
|
+
${c.stat ? `<div class="card-stat">${escapeHtmlTemplate(c.stat)}</div>` : ''}
|
|
1144
|
+
</div>`).join('');
|
|
1145
|
+
return { css, html: `<div class="content">${cards}\n</div>` };
|
|
1146
|
+
}
|
|
1147
|
+
function buildBarChartContent(design, data) {
|
|
1148
|
+
const css = `.content{flex:1;display:flex;flex-direction:column}
|
|
1149
|
+
.chart-area{flex:1;display:flex;align-items:stretch;gap:32px;padding:20px 60px 0}
|
|
1150
|
+
.bar-group{flex:1;display:flex;flex-direction:column;align-items:center}
|
|
1151
|
+
.bar-spacer{flex:1}
|
|
1152
|
+
.bar-value{font-size:28px;font-weight:700;color:${design.primary_color};margin-bottom:8px;flex-shrink:0}
|
|
1153
|
+
.bar{width:80%;border-radius:8px 8px 0 0;background:linear-gradient(180deg,${design.accent_color},${design.primary_color});flex-shrink:0}
|
|
1154
|
+
.bar-label{font-size:24px;font-weight:600;color:${design.text_color};text-align:center;min-width:120px;word-break:keep-all;padding:12px 0;flex-shrink:0}
|
|
1155
|
+
.insight-row{padding:20px 60px;background:${design.accent_light};border-radius:12px;margin-top:16px;font-size:26px;color:${design.text_color};line-height:1.5;flex-shrink:0}`;
|
|
1156
|
+
const maxH = Math.max(...(data.bars || []).map(b => b.height || 50), 1);
|
|
1157
|
+
const bars = (data.bars || []).slice(0, 6).map(b => {
|
|
1158
|
+
const normalized = Math.max(8, Math.round(((b.height || 50) / maxH) * 85));
|
|
1159
|
+
return `
|
|
1160
|
+
<div class="bar-group">
|
|
1161
|
+
<div class="bar-spacer"></div>
|
|
1162
|
+
<div class="bar-value">${escapeHtmlTemplate(b.value || '')}</div>
|
|
1163
|
+
<div class="bar" style="height:${normalized}%"></div>
|
|
1164
|
+
<div class="bar-label">${escapeHtmlTemplate(b.label || '')}</div>
|
|
1165
|
+
</div>`;
|
|
1166
|
+
}).join('');
|
|
1167
|
+
return {
|
|
1168
|
+
css,
|
|
1169
|
+
html: `<div class="content">
|
|
1170
|
+
<div class="chart-area">${bars}</div>
|
|
1171
|
+
<div class="insight-row">${escapeHtmlTemplate(data.insight || '')}</div>
|
|
1172
|
+
</div>`,
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
function buildDonutChartContent(design, data) {
|
|
1176
|
+
const segColors = [design.primary_color, design.accent_color, design.gradient_end, '#FF6B6B', '#4ECDC4', '#45B7D1'];
|
|
1177
|
+
const segs = (data.segments || []).slice(0, 6);
|
|
1178
|
+
const totalPct = segs.reduce((s, seg) => s + (seg.percent || 0), 0);
|
|
1179
|
+
let cumPct = 0;
|
|
1180
|
+
const stops = segs.map((s, i) => {
|
|
1181
|
+
const start = cumPct;
|
|
1182
|
+
const pct = totalPct > 0 ? (s.percent / totalPct) * 100 : 100 / segs.length;
|
|
1183
|
+
cumPct += pct;
|
|
1184
|
+
return `${segColors[i % segColors.length]} ${start.toFixed(1)}% ${cumPct.toFixed(1)}%`;
|
|
1185
|
+
}).join(',');
|
|
1186
|
+
const css = `.content{flex:1;display:grid;grid-template-columns:1.2fr 1fr;gap:40px;align-items:center;align-content:center}
|
|
1187
|
+
.donut-wrap{display:flex;justify-content:center;align-items:center}
|
|
1188
|
+
.donut{width:500px;height:500px;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 32px rgba(0,0,0,0.08)}
|
|
1189
|
+
.donut-hole{width:240px;height:240px;border-radius:50%;background:${design.background_color};display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px}
|
|
1190
|
+
.donut-center{font-size:30px;font-weight:800;color:${design.primary_color};text-align:center;line-height:1.3}
|
|
1191
|
+
.legend{display:flex;flex-direction:column;gap:28px}
|
|
1192
|
+
.legend-item{display:flex;align-items:center;gap:16px;font-size:28px;padding:12px 16px;background:#fff;border-radius:12px;box-shadow:0 2px 8px rgba(0,0,0,0.04)}
|
|
1193
|
+
.legend-dot{width:24px;height:24px;border-radius:50%;flex-shrink:0}
|
|
1194
|
+
.legend-value{font-weight:700;color:${design.primary_color};margin-left:auto;white-space:nowrap}
|
|
1195
|
+
.chart-summary{grid-column:1/3;padding:16px 24px;background:${design.accent_light};border-radius:12px;font-size:26px;color:${design.text_color};line-height:1.5}`;
|
|
1196
|
+
const legendHtml = segs.map((s, i) => `
|
|
1197
|
+
<div class="legend-item">
|
|
1198
|
+
<div class="legend-dot" style="background:${segColors[i % segColors.length]}"></div>
|
|
1199
|
+
<span>${escapeHtmlTemplate(s.label || '')}</span>
|
|
1200
|
+
<span class="legend-value">${escapeHtmlTemplate(s.value || '')} (${s.percent}%)</span>
|
|
1201
|
+
</div>`).join('');
|
|
1202
|
+
return {
|
|
1203
|
+
css,
|
|
1204
|
+
html: `<div class="content">
|
|
1205
|
+
<div class="donut-wrap">
|
|
1206
|
+
<div class="donut" style="background:conic-gradient(${stops})">
|
|
1207
|
+
<div class="donut-hole"><div class="donut-center">${escapeHtmlTemplate(data.centerText || '')}</div></div>
|
|
1208
|
+
</div>
|
|
1209
|
+
</div>
|
|
1210
|
+
<div class="legend">${legendHtml}</div>
|
|
1211
|
+
${data.summary ? `<div class="chart-summary">${escapeHtmlTemplate(data.summary)}</div>` : ''}
|
|
1212
|
+
</div>`,
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
function buildTableContent(design, data) {
|
|
1216
|
+
const css = `.content{flex:1;display:flex;flex-direction:column}
|
|
1217
|
+
.data-table{width:100%;border-collapse:collapse;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,0.05);flex:1}
|
|
1218
|
+
.data-table th{background:${design.primary_color};color:#fff;font-size:26px;text-align:left;padding:20px 24px;font-weight:700}
|
|
1219
|
+
.data-table td{font-size:26px;color:${design.text_color};padding:20px 24px;border-bottom:1px solid ${design.accent_light}}
|
|
1220
|
+
.data-table tr:last-child td{border-bottom:none}
|
|
1221
|
+
.data-table tr:nth-child(even){background:${design.accent_light}20}
|
|
1222
|
+
.data-table tr.highlight td{background:${design.accent_color}15;font-weight:600}
|
|
1223
|
+
.table-summary{margin-top:auto;padding:16px 24px;background:${design.accent_light};border-radius:12px;font-size:26px;color:${design.text_color};line-height:1.5}`;
|
|
1224
|
+
const headers = (data.headers || []).map(h => `<th>${escapeHtmlTemplate(h)}</th>`).join('');
|
|
1225
|
+
const rows = (data.rows || []).map((row, ri) => {
|
|
1226
|
+
const cls = ri === data.highlightRow ? ' class="highlight"' : '';
|
|
1227
|
+
const cells = (row || []).map(c => `<td>${escapeHtmlTemplate(String(c || ''))}</td>`).join('');
|
|
1228
|
+
return `<tr${cls}>${cells}</tr>`;
|
|
1229
|
+
}).join('\n');
|
|
1230
|
+
return {
|
|
1231
|
+
css,
|
|
1232
|
+
html: `<div class="content">
|
|
1233
|
+
<table class="data-table"><thead><tr>${headers}</tr></thead><tbody>\n${rows}\n</tbody></table>
|
|
1234
|
+
${data.summary ? `<div class="table-summary">${escapeHtmlTemplate(data.summary)}</div>` : ''}
|
|
1235
|
+
</div>`,
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
function buildProcessFlowContent(design, data) {
|
|
1239
|
+
const n = Math.min((data.steps || []).length, 5);
|
|
1240
|
+
const titleSz = n <= 3 ? '34px' : '32px';
|
|
1241
|
+
const descSz = n <= 3 ? '28px' : '27px';
|
|
1242
|
+
const detailSz = n <= 3 ? '28px' : '26px';
|
|
1243
|
+
const css = `.content{flex:1;display:flex;align-items:stretch;gap:0}
|
|
1244
|
+
.step{flex:1;display:flex;flex-direction:column;align-items:center;padding:36px 24px;background:#fff;border-radius:16px;text-align:center;gap:16px;box-shadow:0 4px 20px rgba(0,0,0,0.06)}
|
|
1245
|
+
.step-num{width:52px;height:52px;border-radius:50%;background:linear-gradient(135deg,${design.primary_color},${design.gradient_end});color:#fff;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;flex-shrink:0}
|
|
1246
|
+
.step-title{font-size:${titleSz};font-weight:700;color:${design.primary_color}}
|
|
1247
|
+
.step-desc{font-size:${descSz};color:${design.text_color};line-height:1.5;flex:1}
|
|
1248
|
+
.step-detail{font-size:${detailSz};color:${design.accent_color};font-weight:600;padding-top:14px;border-top:2px solid ${design.accent_color}40;margin-top:auto}
|
|
1249
|
+
.arrow{width:48px;display:flex;align-items:center;justify-content:center;font-size:40px;color:${design.accent_color};flex-shrink:0}`;
|
|
1250
|
+
const steps = (data.steps || []).slice(0, 5);
|
|
1251
|
+
const stepsHtml = steps.map((s, i) => {
|
|
1252
|
+
const stepDiv = `
|
|
1253
|
+
<div class="step">
|
|
1254
|
+
<div class="step-num">${i + 1}</div>
|
|
1255
|
+
<div class="step-title">${escapeHtmlTemplate(s.title || '')}</div>
|
|
1256
|
+
<div class="step-desc">${escapeHtmlTemplate(s.desc || '')}</div>
|
|
1257
|
+
${s.detail ? `<div class="step-detail">${escapeHtmlTemplate(s.detail)}</div>` : ''}
|
|
1258
|
+
</div>`;
|
|
1259
|
+
return i < steps.length - 1 ? stepDiv + '\n <div class="arrow">→</div>' : stepDiv;
|
|
1260
|
+
}).join('');
|
|
1261
|
+
return { css, html: `<div class="content">${stepsHtml}\n</div>` };
|
|
1262
|
+
}
|
|
1263
|
+
function buildBigNumbersContent(design, data) {
|
|
1264
|
+
const css = `.content{flex:1;display:flex;gap:40px;align-items:stretch}
|
|
1265
|
+
.metric-card{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:48px 32px;border-radius:20px;background:#fff;box-shadow:0 4px 24px rgba(0,0,0,0.06);text-align:center;gap:20px}
|
|
1266
|
+
.metric-value{font-size:88px;font-weight:800;color:${design.primary_color};line-height:1}
|
|
1267
|
+
.metric-unit{font-size:34px;font-weight:600;color:${design.accent_color}}
|
|
1268
|
+
.metric-label{font-size:30px;font-weight:600;color:${design.text_color}}
|
|
1269
|
+
.metric-desc{font-size:26px;color:${design.text_color}aa;line-height:1.5}
|
|
1270
|
+
.metric-trend{font-size:28px;font-weight:600;margin-top:auto}`;
|
|
1271
|
+
const metrics = (data.metrics || []).slice(0, 3).map(m => `
|
|
1272
|
+
<div class="metric-card">
|
|
1273
|
+
<div class="metric-value">${escapeHtmlTemplate(m.value || '')}</div>
|
|
1274
|
+
<div class="metric-unit">${escapeHtmlTemplate(m.unit || '')}</div>
|
|
1275
|
+
<div class="metric-label">${escapeHtmlTemplate(m.label || '')}</div>
|
|
1276
|
+
<div class="metric-desc">${escapeHtmlTemplate(m.desc || '')}</div>
|
|
1277
|
+
<div class="metric-trend" style="color:${m.positive !== false ? '#10B981' : '#EF4444'}">${escapeHtmlTemplate(m.trend || '')}</div>
|
|
1278
|
+
</div>`).join('');
|
|
1279
|
+
return { css, html: `<div class="content">${metrics}\n</div>` };
|
|
1280
|
+
}
|
|
1281
|
+
function buildTimelineContent(design, data) {
|
|
1282
|
+
const n = Math.min((data.milestones || []).length, 4);
|
|
1283
|
+
const titleSz = n <= 3 ? '36px' : '32px';
|
|
1284
|
+
const descSz = n <= 3 ? '30px' : '27px';
|
|
1285
|
+
const kpiSz = n <= 3 ? '28px' : '26px';
|
|
1286
|
+
const pad = n <= 3 ? '40px 32px' : '36px 24px';
|
|
1287
|
+
const css = `.content{flex:1;display:flex;align-items:stretch;gap:20px}
|
|
1288
|
+
.milestone{flex:1;display:flex;flex-direction:column;padding:${pad};border-radius:16px;background:#fff;box-shadow:0 4px 20px rgba(0,0,0,0.06);gap:16px}
|
|
1289
|
+
.ms-date{display:inline-block;padding:8px 16px;border-radius:8px;background:${design.primary_color};color:#fff;font-size:24px;font-weight:700;align-self:flex-start}
|
|
1290
|
+
.ms-title{font-size:${titleSz};font-weight:700;color:${design.primary_color}}
|
|
1291
|
+
.ms-desc{font-size:${descSz};color:${design.text_color};line-height:1.55;flex:1}
|
|
1292
|
+
.ms-kpi{font-size:${kpiSz};font-weight:600;color:${design.accent_color};padding-top:16px;border-top:2px solid ${design.accent_light};margin-top:auto}`;
|
|
1293
|
+
const milestones = (data.milestones || []).slice(0, 4).map((m) => `
|
|
1294
|
+
<div class="milestone">
|
|
1295
|
+
<div class="ms-date">${escapeHtmlTemplate(m.date || '')}</div>
|
|
1296
|
+
<div class="ms-title">${escapeHtmlTemplate(m.title || '')}</div>
|
|
1297
|
+
<div class="ms-desc">${escapeHtmlTemplate(m.desc || '')}</div>
|
|
1298
|
+
${m.kpi ? `<div class="ms-kpi">${escapeHtmlTemplate(m.kpi)}</div>` : ''}
|
|
1299
|
+
</div>`).join('');
|
|
1300
|
+
return { css, html: `<div class="content">${milestones}\n</div>` };
|
|
1301
|
+
}
|
|
1302
|
+
function buildProgressBarsContent(design, data) {
|
|
1303
|
+
const css = `.content{flex:1;display:flex;flex-direction:column;justify-content:space-evenly;gap:0;padding:20px 0}
|
|
1304
|
+
.bar-item{display:flex;flex-direction:column;gap:10px}
|
|
1305
|
+
.bar-header{display:flex;justify-content:space-between;align-items:baseline}
|
|
1306
|
+
.bar-label{font-size:28px;font-weight:600;color:${design.text_color}}
|
|
1307
|
+
.bar-val{font-size:28px;font-weight:700;color:${design.primary_color}}
|
|
1308
|
+
.bar-track{width:100%;height:44px;background:${design.accent_light};border-radius:22px;overflow:hidden}
|
|
1309
|
+
.bar-fill{height:100%;border-radius:22px;background:linear-gradient(90deg,${design.primary_color},${design.accent_color})}
|
|
1310
|
+
.bar-detail{font-size:22px;color:${design.text_color}88;margin-top:-2px}`;
|
|
1311
|
+
const bars = (data.bars || []).slice(0, 6).map(b => `
|
|
1312
|
+
<div class="bar-item">
|
|
1313
|
+
<div class="bar-header"><span class="bar-label">${escapeHtmlTemplate(b.label || '')}</span><span class="bar-val">${escapeHtmlTemplate(b.value || '')}</span></div>
|
|
1314
|
+
<div class="bar-track"><div class="bar-fill" style="width:${Math.max(5, Math.min(100, b.percent || 50))}%"></div></div>
|
|
1315
|
+
${b.detail ? `<div class="bar-detail">${escapeHtmlTemplate(b.detail)}</div>` : ''}
|
|
1316
|
+
</div>`).join('');
|
|
1317
|
+
return { css, html: `<div class="content">${bars}\n</div>` };
|
|
1318
|
+
}
|
|
1319
|
+
function buildHeroStatContent(design, data) {
|
|
1320
|
+
const css = `.content{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px}
|
|
1321
|
+
.hero-number{font-size:128px;font-weight:900;color:${design.primary_color};line-height:1}
|
|
1322
|
+
.hero-unit{font-size:48px;font-weight:600;color:${design.accent_color}}
|
|
1323
|
+
.hero-label{font-size:36px;font-weight:600;color:${design.text_color}}
|
|
1324
|
+
.hero-context{font-size:28px;color:${design.text_color}aa;text-align:center;max-width:800px;line-height:1.6}
|
|
1325
|
+
.supporting-row{display:flex;gap:60px;margin-top:48px}
|
|
1326
|
+
.sup-item{text-align:center}
|
|
1327
|
+
.sup-value{font-size:40px;font-weight:700;color:${design.primary_color}}
|
|
1328
|
+
.sup-label{font-size:24px;color:${design.text_color}aa;margin-top:8px}`;
|
|
1329
|
+
const supporting = (data.supporting || []).slice(0, 3).map(s => `
|
|
1330
|
+
<div class="sup-item">
|
|
1331
|
+
<div class="sup-value">${escapeHtmlTemplate(s.value || '')}</div>
|
|
1332
|
+
<div class="sup-label">${escapeHtmlTemplate(s.label || '')}</div>
|
|
1333
|
+
</div>`).join('');
|
|
1334
|
+
return {
|
|
1335
|
+
css,
|
|
1336
|
+
html: `<div class="content">
|
|
1337
|
+
<div class="hero-number">${escapeHtmlTemplate(data.number || '')}</div>
|
|
1338
|
+
<div class="hero-unit">${escapeHtmlTemplate(data.unit || '')}</div>
|
|
1339
|
+
<div class="hero-label">${escapeHtmlTemplate(data.label || '')}</div>
|
|
1340
|
+
<div class="hero-context">${escapeHtmlTemplate(data.context || '')}</div>
|
|
1341
|
+
${supporting ? `<div class="supporting-row">${supporting}</div>` : ''}
|
|
1342
|
+
</div>`,
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
function buildTwoColSplitContent(design, data) {
|
|
1346
|
+
const css = `.content{flex:1;display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:stretch}
|
|
1347
|
+
.col{display:flex;flex-direction:column;gap:14px;justify-content:space-evenly}
|
|
1348
|
+
.col h2{font-size:36px;font-weight:700;color:${design.primary_color};margin-bottom:12px;padding-bottom:12px;border-bottom:3px solid ${design.accent_color}}
|
|
1349
|
+
.kv-item{display:flex;justify-content:space-between;align-items:center;padding:22px 24px;background:#fff;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,0.04);font-size:28px}
|
|
1350
|
+
.kv-label{color:${design.text_color};font-weight:500}
|
|
1351
|
+
.kv-value{color:${design.primary_color};font-weight:700;font-size:28px}
|
|
1352
|
+
.col ul{list-style:none;display:flex;flex-direction:column;gap:10px}
|
|
1353
|
+
.col li{padding:16px 16px 16px 30px;position:relative;font-size:28px;line-height:1.5;background:#fff;border-radius:10px;box-shadow:0 1px 8px rgba(0,0,0,0.03)}
|
|
1354
|
+
.col li::before{content:"•";color:${design.accent_color};position:absolute;left:12px;font-weight:bold}`;
|
|
1355
|
+
const leftItems = (data.leftItems || []).slice(0, 6).map(item => `
|
|
1356
|
+
<div class="kv-item"><span class="kv-label">${escapeHtmlTemplate(item.label || '')}</span><span class="kv-value">${escapeHtmlTemplate(item.value || '')}</span></div>`).join('');
|
|
1357
|
+
const rightBullets = (data.rightBullets || []).slice(0, 6).map(b => `<li>${escapeHtmlTemplate(b)}</li>`).join('');
|
|
1358
|
+
return {
|
|
1359
|
+
css,
|
|
1360
|
+
html: `<div class="content">
|
|
1361
|
+
<div class="col">
|
|
1362
|
+
<h2>${escapeHtmlTemplate(data.leftTitle || '')}</h2>
|
|
1363
|
+
${leftItems}
|
|
1364
|
+
</div>
|
|
1365
|
+
<div class="col">
|
|
1366
|
+
<h2>${escapeHtmlTemplate(data.rightTitle || '')}</h2>
|
|
1367
|
+
<ul>${rightBullets}</ul>
|
|
1368
|
+
</div>
|
|
1369
|
+
</div>`,
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
export function buildContentSlideHtml(design, title, layoutType, data, slideNum, variant = 0) {
|
|
1373
|
+
const builders = {
|
|
1374
|
+
cards: (d, dt) => buildCardsContent(d, dt),
|
|
1375
|
+
bar_chart: (d, dt) => buildBarChartContent(d, dt),
|
|
1376
|
+
donut_chart: (d, dt) => buildDonutChartContent(d, dt),
|
|
1377
|
+
table: (d, dt) => buildTableContent(d, dt),
|
|
1378
|
+
process_flow: (d, dt) => buildProcessFlowContent(d, dt),
|
|
1379
|
+
big_numbers: (d, dt) => buildBigNumbersContent(d, dt),
|
|
1380
|
+
timeline: (d, dt) => buildTimelineContent(d, dt),
|
|
1381
|
+
progress_bars: (d, dt) => buildProgressBarsContent(d, dt),
|
|
1382
|
+
hero_stat: (d, dt) => buildHeroStatContent(d, dt),
|
|
1383
|
+
two_col_split: (d, dt) => buildTwoColSplitContent(d, dt),
|
|
1384
|
+
};
|
|
1385
|
+
const builder = builders[layoutType] || builders.cards;
|
|
1386
|
+
const content = builder(design, data);
|
|
1387
|
+
return wrapSlide(design, title, slideNum, content.css, content.html, variant);
|
|
1388
|
+
}
|
|
1389
|
+
export const PPT_CREATE_SYSTEM_PROMPT = `You are an elite PowerPoint presentation creator.
|
|
1390
|
+
You build NEW presentations using high-level layout builder tools.
|
|
1391
|
+
Each tool call creates ONE complete, professionally-designed slide.
|
|
1392
|
+
|
|
1393
|
+
═══ AVAILABLE TOOLS ═══
|
|
1394
|
+
Lifecycle: powerpoint_create, powerpoint_save
|
|
1395
|
+
Slides: ppt_build_title_slide, ppt_build_layout_a, ppt_build_layout_b, ppt_build_layout_c, ppt_build_layout_d, ppt_build_layout_e, ppt_build_layout_f, ppt_build_closing_slide
|
|
1396
|
+
Chart: powerpoint_add_chart (use sparingly — prefer Layout D or F for data)
|
|
1397
|
+
Complete: complete (call AFTER saving)
|
|
1398
|
+
|
|
1399
|
+
═══ WORKFLOW ═══
|
|
1400
|
+
1. powerpoint_create — launch PowerPoint
|
|
1401
|
+
2. ppt_build_title_slide — first slide
|
|
1402
|
+
3. ppt_build_layout_[a-f] — content slides (one tool call per slide)
|
|
1403
|
+
4. ppt_build_closing_slide — MUST be the absolute LAST content slide
|
|
1404
|
+
5. powerpoint_save — save file
|
|
1405
|
+
6. complete — report summary
|
|
1406
|
+
|
|
1407
|
+
═══ CONTENT QUALITY ═══
|
|
1408
|
+
• ALL text MUST be in the same language as the user's instruction
|
|
1409
|
+
• Korean input → Korean titles, bullets, table headers, everything
|
|
1410
|
+
• NEVER use placeholder text like "[내용]", "XXX", "lorem ipsum"
|
|
1411
|
+
• Generate REAL, specific, professional content with concrete data
|
|
1412
|
+
|
|
1413
|
+
═══ RULES ═══
|
|
1414
|
+
1. Build each slide COMPLETELY with one tool call before moving to the next
|
|
1415
|
+
2. NEVER go back to modify a previous slide
|
|
1416
|
+
3. NEVER use HTML tags in text — use \\n for line breaks
|
|
1417
|
+
4. The LAST tool before "complete" MUST be powerpoint_save
|
|
1418
|
+
5. If save fails with path error, try "C:\\\\temp\\\\presentation.pptx"`;
|
|
1419
|
+
export const PPT_CREATE_PLANNING_PROMPT = `You are a presentation structure planner.
|
|
1420
|
+
Given the user's instruction and CREATIVE GUIDANCE, create the execution plan.
|
|
1421
|
+
|
|
1422
|
+
⚠ LANGUAGE RULE: ALL slide titles and content MUST be in the SAME language as the user's instruction.
|
|
1423
|
+
|
|
1424
|
+
OUTPUT FORMAT:
|
|
1425
|
+
MODE: CREATE
|
|
1426
|
+
DESIGN DECISIONS:
|
|
1427
|
+
- COLOR_SCHEME: [MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN]
|
|
1428
|
+
- DESIGN_STYLE: [sidebar / top_band / clean]
|
|
1429
|
+
TOTAL_SLIDES: [number]
|
|
1430
|
+
SLIDE_PLAN:
|
|
1431
|
+
- Slide 1: [Title] | Tool: ppt_build_title_slide | Subtitle: [text]
|
|
1432
|
+
- Slide N: [Title] | Tool: [tool name] | Content: [summary]`;
|
|
1433
|
+
export function buildSlideSystemPrompt(toolName, title, direction, guidance, language) {
|
|
1434
|
+
if (!toolName.startsWith('ppt_build_layout_'))
|
|
1435
|
+
return '';
|
|
1436
|
+
const langRule = language === 'ko'
|
|
1437
|
+
? 'ALL text MUST be in Korean.'
|
|
1438
|
+
: 'ALL text MUST be in English.';
|
|
1439
|
+
return `You are building slide "${title}" for a PowerPoint presentation.
|
|
1440
|
+
You have exactly ONE tool available. Call it with the correct parameters.
|
|
1441
|
+
|
|
1442
|
+
═══ CONTENT DIRECTION ═══
|
|
1443
|
+
${direction}
|
|
1444
|
+
|
|
1445
|
+
═══ CREATIVE CONTEXT ═══
|
|
1446
|
+
${guidance}
|
|
1447
|
+
|
|
1448
|
+
═══ RULES ═══
|
|
1449
|
+
• ${langRule}
|
|
1450
|
+
• Generate REAL, specific, professional content with concrete data
|
|
1451
|
+
• NEVER use placeholder text
|
|
1452
|
+
• Call the tool EXACTLY ONCE with all required parameters`;
|
|
1453
|
+
}
|
|
1454
|
+
//# sourceMappingURL=powerpoint-create-prompts.js.map
|