@thanh01.pmt/presentation-kit 0.2.1 → 0.2.3
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/ai/index.cjs +429 -0
- package/dist/ai/index.cjs.map +1 -0
- package/dist/ai/index.d.cts +206 -0
- package/dist/ai/index.d.ts +206 -0
- package/dist/ai/index.js +417 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/chunk-3IKL6SBP.js +746 -0
- package/dist/chunk-3IKL6SBP.js.map +1 -0
- package/dist/{chunk-PAHIW5IX.js → chunk-JOW4QWKF.js} +3 -741
- package/dist/chunk-JOW4QWKF.js.map +1 -0
- package/dist/chunk-O5MCKVEA.cjs +757 -0
- package/dist/chunk-O5MCKVEA.cjs.map +1 -0
- package/dist/{chunk-RJMPTRL3.cjs → chunk-VLAPHJOC.cjs} +2 -746
- package/dist/chunk-VLAPHJOC.cjs.map +1 -0
- package/dist/click-css-BGZI3XKk.d.cts +124 -0
- package/dist/click-css-eWONB-hS.d.ts +124 -0
- package/dist/index.cjs +51 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -22
- package/dist/index.d.ts +5 -22
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/presets-B1N2_jKl.d.ts +22 -0
- package/dist/presets-JpoJbNKE.d.cts +22 -0
- package/dist/react/index.cjs +15 -14
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +3 -2
- package/dist/react/index.d.ts +3 -2
- package/dist/react/index.js +3 -2
- package/dist/react/index.js.map +1 -1
- package/dist/{click-css-C84mdmU0.d.cts → types-DnR81ReX.d.cts} +1 -122
- package/dist/{click-css-C84mdmU0.d.ts → types-DnR81ReX.d.ts} +1 -122
- package/package.json +10 -3
- package/dist/chunk-PAHIW5IX.js.map +0 -1
- package/dist/chunk-RJMPTRL3.cjs.map +0 -1
package/dist/ai/index.js
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides } from '../chunk-3IKL6SBP.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var listSlidePresetsSchema = z.object({
|
|
5
|
+
category: z.enum([
|
|
6
|
+
"all",
|
|
7
|
+
"cover",
|
|
8
|
+
"content",
|
|
9
|
+
"split",
|
|
10
|
+
"code",
|
|
11
|
+
"metrics",
|
|
12
|
+
"diagram",
|
|
13
|
+
"quote",
|
|
14
|
+
"assessment"
|
|
15
|
+
]).optional().describe("Optional category filter for layout presets")
|
|
16
|
+
});
|
|
17
|
+
var createSlideFromPresetSchema = z.object({
|
|
18
|
+
presetId: z.string().describe(
|
|
19
|
+
"ID of the layout preset: title-hero, two-column-split, code-explainer, metrics-3-card, process-flow, quote-highlight, quiz-checkpoint, tiered-practice-3cards, agenda-timeline, takeaways-summary"
|
|
20
|
+
),
|
|
21
|
+
title: z.string().describe("Slide heading or title"),
|
|
22
|
+
subtitle: z.string().optional().describe("Optional subtitle or section context"),
|
|
23
|
+
content: z.record(z.string()).optional().describe(
|
|
24
|
+
"Key-value pairs for preset sections. For two-column-split: leftCol, rightCol. For code-explainer: code, language, notes. For metrics-3-card: card1Title, card1Val, card1Desc, etc."
|
|
25
|
+
),
|
|
26
|
+
customMarkdownBody: z.string().optional().describe(
|
|
27
|
+
"Raw markdown body to place inside the layout container (overrides content key-value pairs if provided)"
|
|
28
|
+
),
|
|
29
|
+
presenterNotes: z.array(z.string()).optional().describe(
|
|
30
|
+
"Teacher talk track, cold-call check questions, or scaffolding notes for this slide"
|
|
31
|
+
)
|
|
32
|
+
});
|
|
33
|
+
var applySlideLayoutSchema = z.object({
|
|
34
|
+
markdown: z.string().describe("Full Markdown slide deck content"),
|
|
35
|
+
slideIndex: z.number().int().min(0).describe("0-based index of the target slide to modify"),
|
|
36
|
+
presetId: z.string().optional().describe("Optional preset ID to apply to this slide"),
|
|
37
|
+
boxes: z.array(
|
|
38
|
+
z.object({
|
|
39
|
+
id: z.string(),
|
|
40
|
+
target: z.string().optional(),
|
|
41
|
+
pos: z.tuple([z.number(), z.number(), z.number(), z.number()]).describe("[x, y, width, height] in 1280x720 canvas coordinates"),
|
|
42
|
+
fontSize: z.string().optional(),
|
|
43
|
+
color: z.string().optional(),
|
|
44
|
+
textAlign: z.enum(["left", "center", "right", "justify"]).optional(),
|
|
45
|
+
style: z.string().optional()
|
|
46
|
+
})
|
|
47
|
+
).optional().describe("Custom boxes if not using presetId")
|
|
48
|
+
});
|
|
49
|
+
var updatePresenterNotesSchema = z.object({
|
|
50
|
+
markdown: z.string().describe("Full Markdown slide deck content"),
|
|
51
|
+
slideIndex: z.number().int().min(0).describe("0-based index of the target slide"),
|
|
52
|
+
notes: z.array(z.string()).describe("List of speaker notes / talk tracks to set for this slide")
|
|
53
|
+
});
|
|
54
|
+
var generateDeckOutlineSchema = z.object({
|
|
55
|
+
topic: z.string().describe("Main subject or topic of the presentation"),
|
|
56
|
+
durationMins: z.number().int().min(3).max(120).default(15).describe("Estimated duration in minutes (5m: 5-7 slides, 15m: 12-18 slides, 30m: 25-35 slides)"),
|
|
57
|
+
audience: z.string().describe("Target audience profile (e.g. Grade 10 students, junior developers, enterprise clients)"),
|
|
58
|
+
keyObjectives: z.array(z.string()).describe("2-4 key learning or decision objectives"),
|
|
59
|
+
techStack: z.string().optional().describe("Optional programming language, framework, or hardware kit")
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// src/ai/tools.ts
|
|
63
|
+
function executeListSlidePresets(params) {
|
|
64
|
+
const category = params?.category;
|
|
65
|
+
const presets = !category || category === "all" ? SLIDE_LAYOUT_PRESETS : getSlideLayoutPresetsByCategory(category);
|
|
66
|
+
return {
|
|
67
|
+
count: presets.length,
|
|
68
|
+
presets: presets.map((p) => ({
|
|
69
|
+
id: p.id,
|
|
70
|
+
name: p.name,
|
|
71
|
+
category: p.category,
|
|
72
|
+
description: p.description,
|
|
73
|
+
boxCount: p.layout.boxes.length,
|
|
74
|
+
snippetPreview: p.markdownSnippet.split("\n").slice(0, 8).join("\n") + "\n..."
|
|
75
|
+
}))
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function executeCreateSlideFromPreset(params) {
|
|
79
|
+
const preset = getSlideLayoutPresetById(params.presetId);
|
|
80
|
+
if (!preset) {
|
|
81
|
+
return {
|
|
82
|
+
success: false,
|
|
83
|
+
slideMarkdown: "",
|
|
84
|
+
error: `Preset with ID "${params.presetId}" not found. Use listSlidePresets to see available layout templates.`
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const layoutComment = serializeLayoutToComment(preset.layout);
|
|
88
|
+
const title = params.title;
|
|
89
|
+
const subtitle = params.subtitle ? `
|
|
90
|
+
### ${params.subtitle}` : "";
|
|
91
|
+
let body = params.customMarkdownBody;
|
|
92
|
+
if (!body) {
|
|
93
|
+
const c = params.content || {};
|
|
94
|
+
switch (preset.id) {
|
|
95
|
+
case "title-hero":
|
|
96
|
+
body = `${subtitle}
|
|
97
|
+
|
|
98
|
+
**Presenter:** ${c.speaker || "Lead Instructor"} | **Duration:** ${c.duration || "45 mins"} | **Topic:** ${c.topic || title}`;
|
|
99
|
+
break;
|
|
100
|
+
case "two-column-split":
|
|
101
|
+
body = `<div class="columns-2">
|
|
102
|
+
<div>
|
|
103
|
+
|
|
104
|
+
### ${c.leftHeader || "Approach A"}
|
|
105
|
+
${c.leftCol || "- Point 1\n- Point 2\n- Point 3"}
|
|
106
|
+
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
|
|
110
|
+
### ${c.rightHeader || "Approach B"}
|
|
111
|
+
${c.rightCol || "- Point 1\n- Point 2\n- Point 3"}
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
</div>`;
|
|
115
|
+
break;
|
|
116
|
+
case "code-explainer":
|
|
117
|
+
body = `<div class="columns-2">
|
|
118
|
+
<div>
|
|
119
|
+
|
|
120
|
+
\`\`\`${c.lang || "ts"}
|
|
121
|
+
${c.code || "// Core implementation logic\nconst isValid = true;"}
|
|
122
|
+
\`\`\`
|
|
123
|
+
|
|
124
|
+
</div>
|
|
125
|
+
<div>
|
|
126
|
+
|
|
127
|
+
### \u{1F50D} Key Invariants:
|
|
128
|
+
${c.notes || "1. **Validation:** Checks payload before processing\n2. **Execution:** Enforces deterministic state\n3. **Resilience:** Handles edge case errors"}
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
</div>`;
|
|
132
|
+
break;
|
|
133
|
+
case "metrics-3-card":
|
|
134
|
+
body = `<div class="columns-3">
|
|
135
|
+
<div>
|
|
136
|
+
|
|
137
|
+
# ${c.metric1Val || "99.9%"}
|
|
138
|
+
### ${c.metric1Title || "Availability"}
|
|
139
|
+
${c.metric1Desc || "Automated multi-region failover routing."}
|
|
140
|
+
|
|
141
|
+
</div>
|
|
142
|
+
<div>
|
|
143
|
+
|
|
144
|
+
# ${c.metric2Val || "10x"}
|
|
145
|
+
### ${c.metric2Title || "Throughput"}
|
|
146
|
+
${c.metric2Desc || "Sub-millisecond processing latency."}
|
|
147
|
+
|
|
148
|
+
</div>
|
|
149
|
+
<div>
|
|
150
|
+
|
|
151
|
+
# ${c.metric3Val || "0"}
|
|
152
|
+
### ${c.metric3Title || "Breaches"}
|
|
153
|
+
${c.metric3Desc || "Continuous SOC2 compliance auditing."}
|
|
154
|
+
|
|
155
|
+
</div>
|
|
156
|
+
</div>`;
|
|
157
|
+
break;
|
|
158
|
+
case "process-flow":
|
|
159
|
+
body = `\`\`\`mermaid
|
|
160
|
+
${c.mermaid || "graph LR\n A[1. Ingress] --> B[2. Gateway]\n B --> C[3. Service]\n C --> D[4. Storage]"}
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
${c.summary || "- **Phase 1 & 2:** Client connection and load balancing.\n- **Phase 3 & 4:** Business logic execution and data commit."}`;
|
|
164
|
+
break;
|
|
165
|
+
case "quote-highlight":
|
|
166
|
+
body = `> "${c.quote || "Simplicity is prerequisite for reliability."}"
|
|
167
|
+
>
|
|
168
|
+
> \u2014 **${c.author || "Architecture Principle"}**`;
|
|
169
|
+
break;
|
|
170
|
+
case "quiz-checkpoint":
|
|
171
|
+
body = `> **Question:** ${c.question || "Which architecture pattern best ensures reliable message delivery?"}
|
|
172
|
+
|
|
173
|
+
- **A.** ${c.optA || "Direct synchronous HTTP request with short timeout"}
|
|
174
|
+
- **B.** ${c.optB || "Persistent Message Queue with Dead-Letter Queue (Correct)"}
|
|
175
|
+
- **C.** ${c.optC || "In-memory client cache without persistence"}
|
|
176
|
+
- **D.** ${c.optD || "Silently dropping failed packets"}`;
|
|
177
|
+
break;
|
|
178
|
+
case "tiered-practice-3cards":
|
|
179
|
+
body = `<div class="columns-3">
|
|
180
|
+
<div>
|
|
181
|
+
|
|
182
|
+
### \u{1F949} Bronze Tier
|
|
183
|
+
${c.bronze || "- Implement baseline function\n- Pass 2 sample unit tests"}
|
|
184
|
+
|
|
185
|
+
</div>
|
|
186
|
+
<div>
|
|
187
|
+
|
|
188
|
+
### \u{1F948} Silver Tier
|
|
189
|
+
${c.silver || "- Add boundary error handling\n- Optimize algorithm complexity"}
|
|
190
|
+
|
|
191
|
+
</div>
|
|
192
|
+
<div>
|
|
193
|
+
|
|
194
|
+
### \u{1F947} Gold Tier
|
|
195
|
+
${c.gold || "- Design extension feature\n- Write automated integration tests"}
|
|
196
|
+
|
|
197
|
+
</div>
|
|
198
|
+
</div>`;
|
|
199
|
+
break;
|
|
200
|
+
default:
|
|
201
|
+
body = preset.markdownSnippet.replace(/^<!--[\s\S]*?-->\n*/, "").replace(/^#\s+[^\n]+\n*/, "").trim();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const notes = params.presenterNotes && params.presenterNotes.length > 0 ? `
|
|
205
|
+
|
|
206
|
+
<!--
|
|
207
|
+
Presenter Notes:
|
|
208
|
+
${params.presenterNotes.map((n) => `- ${n}`).join("\n")}
|
|
209
|
+
-->` : `
|
|
210
|
+
|
|
211
|
+
<!--
|
|
212
|
+
Presenter Notes:
|
|
213
|
+
- Explain the primary concept on this slide.
|
|
214
|
+
- Ask a diagnostic cold-call question to check comprehension.
|
|
215
|
+
-->`;
|
|
216
|
+
const slideMarkdown = `${layoutComment}
|
|
217
|
+
|
|
218
|
+
## ${title}${body ? "\n\n" + body : ""}${notes}`;
|
|
219
|
+
return {
|
|
220
|
+
success: true,
|
|
221
|
+
slideMarkdown,
|
|
222
|
+
presetName: preset.name
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function executeApplySlideLayout(params) {
|
|
226
|
+
let layoutData = null;
|
|
227
|
+
if (params.presetId) {
|
|
228
|
+
const preset = getSlideLayoutPresetById(params.presetId);
|
|
229
|
+
if (!preset) {
|
|
230
|
+
return {
|
|
231
|
+
success: false,
|
|
232
|
+
updatedMarkdown: params.markdown,
|
|
233
|
+
error: `Preset with ID "${params.presetId}" not found.`
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
layoutData = preset.layout;
|
|
237
|
+
} else if (params.boxes && params.boxes.length > 0) {
|
|
238
|
+
layoutData = { boxes: params.boxes };
|
|
239
|
+
}
|
|
240
|
+
const updatedMarkdown = updateSlideLayoutInMarkdown(
|
|
241
|
+
params.markdown,
|
|
242
|
+
params.slideIndex,
|
|
243
|
+
layoutData
|
|
244
|
+
);
|
|
245
|
+
return {
|
|
246
|
+
success: true,
|
|
247
|
+
updatedMarkdown
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
function executeUpdatePresenterNotes(params) {
|
|
251
|
+
const { frontmatter, slides } = splitMarkdownSlides(params.markdown);
|
|
252
|
+
if (params.slideIndex < 0 || params.slideIndex >= slides.length) {
|
|
253
|
+
return {
|
|
254
|
+
success: false,
|
|
255
|
+
updatedMarkdown: params.markdown,
|
|
256
|
+
error: `Slide index ${params.slideIndex} out of bounds (total slides: ${slides.length})`
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
let slideContent = slides[params.slideIndex];
|
|
260
|
+
const notesCommentRegex = /<!--\s*(?:Presenter Notes|Notes):\s*([\s\S]*?)-->/i;
|
|
261
|
+
const newNotesComment = `<!--
|
|
262
|
+
Presenter Notes:
|
|
263
|
+
${params.notes.map((n) => `- ${n}`).join("\n")}
|
|
264
|
+
-->`;
|
|
265
|
+
if (notesCommentRegex.test(slideContent)) {
|
|
266
|
+
slideContent = slideContent.replace(notesCommentRegex, newNotesComment);
|
|
267
|
+
} else {
|
|
268
|
+
slideContent = `${slideContent.trimEnd()}
|
|
269
|
+
|
|
270
|
+
${newNotesComment}`;
|
|
271
|
+
}
|
|
272
|
+
slides[params.slideIndex] = slideContent;
|
|
273
|
+
const joined = slides.join("\n---\n");
|
|
274
|
+
const updatedMarkdown = frontmatter ? `${frontmatter}
|
|
275
|
+
|
|
276
|
+
${joined}` : joined;
|
|
277
|
+
return {
|
|
278
|
+
success: true,
|
|
279
|
+
updatedMarkdown
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function executeGenerateDeckOutline(params) {
|
|
283
|
+
const d = params.durationMins;
|
|
284
|
+
let targetSlideCount = 12;
|
|
285
|
+
let formatLabel = "15 min (Short Talk)";
|
|
286
|
+
if (d <= 7) {
|
|
287
|
+
targetSlideCount = 6;
|
|
288
|
+
formatLabel = "5 min (Lightning Talk)";
|
|
289
|
+
} else if (d <= 20) {
|
|
290
|
+
targetSlideCount = 14;
|
|
291
|
+
formatLabel = "15 min (Short Talk)";
|
|
292
|
+
} else if (d <= 35) {
|
|
293
|
+
targetSlideCount = 28;
|
|
294
|
+
formatLabel = "30 min (Conference Talk)";
|
|
295
|
+
} else {
|
|
296
|
+
targetSlideCount = 42;
|
|
297
|
+
formatLabel = "45-60 min (Keynote / Workshop)";
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
topic: params.topic,
|
|
301
|
+
audience: params.audience,
|
|
302
|
+
durationMins: d,
|
|
303
|
+
format: formatLabel,
|
|
304
|
+
recommendedSlideCount: targetSlideCount,
|
|
305
|
+
structureGuidelines: [
|
|
306
|
+
'Apply the "One Idea Per Slide" invariant.',
|
|
307
|
+
"Enforce Word Budget: Maximum 40 words per card or column (Zero-Scroll Invariant).",
|
|
308
|
+
"Target 16:9 aspect ratio in 1280x720 coordinate space.",
|
|
309
|
+
"Every slide must conclude with Presenter Notes: Teacher talk track + 1 diagnostic cold-call question."
|
|
310
|
+
],
|
|
311
|
+
suggestedOutline: [
|
|
312
|
+
{ slide: 1, type: "title-hero", title: `\u{1F680} ${params.topic}`, intent: "Opening hook and speaker credentialing" },
|
|
313
|
+
{ slide: 2, type: "agenda-timeline", title: "\u{1F5FA}\uFE0F Session Milestones", intent: "Set time budget expectations and learning deliverables" },
|
|
314
|
+
{ slide: 3, type: "two-column-split", title: "\u26A1 Problem vs Opportunity", intent: "Contrast legacy bottlenecks against the modern solution" },
|
|
315
|
+
{ slide: 4, type: "process-flow", title: "\u{1F504} Architectural Flow", intent: "High-level system topology and sequence diagram" },
|
|
316
|
+
{ slide: 5, type: "code-explainer", title: "\u{1F4BB} Core Code Walkthrough", intent: "Deep-dive into production implementation logic" },
|
|
317
|
+
{ slide: 6, type: "metrics-3-card", title: "\u{1F4CA} Benchmark Results", intent: "Quantify performance and reliability gains" },
|
|
318
|
+
{ slide: 7, type: "tiered-practice-3cards", title: "\u{1F6E0}\uFE0F Hands-On Challenge", intent: "Differentiated practice across Bronze, Silver, and Gold tiers" },
|
|
319
|
+
{ slide: 8, type: "quiz-checkpoint", title: "\u{1F3AF} Formative Checkpoint", intent: "Real-time diagnostic voting to verify mastery" },
|
|
320
|
+
{ slide: 9, type: "takeaways-summary", title: "\u{1F3C1} Key Takeaways", intent: "Synthesis of 3 core lessons and next action items" }
|
|
321
|
+
].slice(0, Math.max(5, Math.min(targetSlideCount, 10)))
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// src/ai/prompt.ts
|
|
326
|
+
var SLIDE_DESIGN_PROMPT_CONTRACT = `
|
|
327
|
+
# SYSTEM MANDATE: PROFESSIONAL PRESENTATION & SLIDE DESIGN INVARIANTS
|
|
328
|
+
|
|
329
|
+
You are an expert Presentation Architect & Visual Designer for educational, technical, and executive decks.
|
|
330
|
+
When generating or modifying Marp slide presentations, you MUST STRICTLY obey the following non-negotiable rules:
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## 1. DURATION-INDEXED SLIDE PACING
|
|
335
|
+
Structure decks based on allocated talk time (averaging 1.5 - 2 minutes per slide):
|
|
336
|
+
- **5 min (Lightning Talk):** 5 - 7 slides [Hook -> 2-3 Core Points -> CTA / Summary]
|
|
337
|
+
- **15 min (Short Tech Talk):** 12 - 16 slides [Title -> Agenda -> Hook -> 3-4 Concepts -> Lab/Demo -> Summary]
|
|
338
|
+
- **30 min (Conference / Class):** 24 - 32 slides [Full 5E Learning Cycle + Interactive Formative Checkpoint]
|
|
339
|
+
- **45-60 min (Keynote / Workshop):** 36 - 50 slides [Modular Micro-cycles + Tiered Hands-on Exercises]
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## 2. THE "ONE IDEA PER SLIDE" RULE
|
|
344
|
+
- Each slide communicates **EXACTLY ONE** pedagogical or architectural concept.
|
|
345
|
+
- Never pack multiple distinct topics into a single slide.
|
|
346
|
+
- If a concept has both theory and code, split into: (Slide A) Concept Diagram -> (Slide B) Code Walkthrough.
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## 3. STRICT WORD BUDGET (ZERO-SCROLL INVARIANT)
|
|
351
|
+
- **Hard Limit:** Maximum **35 - 40 words** per card or column.
|
|
352
|
+
- Never write paragraphs longer than 2 sentences. Use structured bullets with bold anchor terms:
|
|
353
|
+
- Format: \`- **Key Concept:** Concise explanation in a single line.\`
|
|
354
|
+
- Vertical scrolling inside a slide is STRICTLY FORBIDDEN. Content must fit the 16:9 (1280x720) canvas cleanly.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 4. TWO-COLUMN & CARD BALANCED LAYOUTS
|
|
359
|
+
- Avoid centered vertical walls of text. Use responsive side-by-side card wrappers:
|
|
360
|
+
\`\`\`html
|
|
361
|
+
<div class="columns-2">
|
|
362
|
+
<div>
|
|
363
|
+
### \u{1F534} Legacy / Challenge
|
|
364
|
+
- High idle compute overhead
|
|
365
|
+
- Cascading timeout failures
|
|
366
|
+
</div>
|
|
367
|
+
<div>
|
|
368
|
+
### \u{1F7E2} Modern / Solution
|
|
369
|
+
- Event-driven webhook streams
|
|
370
|
+
- Automatic queue backpressure
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
\`\`\`
|
|
374
|
+
- For 3 metrics or bronze/silver/gold differentiation, use \`<div class="columns-3">...</div>\`.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 5. MANDATORY PRESENTER NOTES (TEACHER TALK TRACK)
|
|
379
|
+
Every single slide MUST conclude with an HTML comment block containing:
|
|
380
|
+
1. **Talk Track:** 2-3 sentences of what the speaker should say out loud.
|
|
381
|
+
2. **Cold-Call Check Question:** 1 diagnostic question to ask a specific student or attendee.
|
|
382
|
+
3. **Scaffolding Tip:** 1 hint or real-world analogy if learners look confused.
|
|
383
|
+
|
|
384
|
+
Example:
|
|
385
|
+
\`\`\`markdown
|
|
386
|
+
<!--
|
|
387
|
+
Presenter Notes:
|
|
388
|
+
- Walk through the primary bottleneck when scaling database writes under high concurrency.
|
|
389
|
+
- Cold-call: "Alex, if traffic spikes 10x in 1 minute, which subsystem will experience lock contention first?"
|
|
390
|
+
- Scaffolding tip: Remind the room of the I/O saturation trade-off discussed in the previous module.
|
|
391
|
+
-->
|
|
392
|
+
\`\`\`
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 6. MARP COMPATIBLE YAML LAYOUT HEADERS
|
|
397
|
+
When a precise coordinate layout is specified, include the clean YAML block at the very top of the slide:
|
|
398
|
+
\`\`\`markdown
|
|
399
|
+
<!-- layout:
|
|
400
|
+
boxes:
|
|
401
|
+
- id: heading
|
|
402
|
+
target: h2
|
|
403
|
+
pos: [80, 50, 1120, 70]
|
|
404
|
+
fontSize: 2rem
|
|
405
|
+
- id: col-left
|
|
406
|
+
target: '.columns-2 > div:first-child'
|
|
407
|
+
pos: [80, 150, 530, 510]
|
|
408
|
+
- id: col-right
|
|
409
|
+
target: '.columns-2 > div:last-child'
|
|
410
|
+
pos: [670, 150, 530, 510]
|
|
411
|
+
-->
|
|
412
|
+
\`\`\`
|
|
413
|
+
`;
|
|
414
|
+
|
|
415
|
+
export { SLIDE_DESIGN_PROMPT_CONTRACT, applySlideLayoutSchema, createSlideFromPresetSchema, executeApplySlideLayout, executeCreateSlideFromPreset, executeGenerateDeckOutline, executeListSlidePresets, executeUpdatePresenterNotes, generateDeckOutlineSchema, listSlidePresetsSchema, updatePresenterNotesSchema };
|
|
416
|
+
//# sourceMappingURL=index.js.map
|
|
417
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ai/schemas.ts","../../src/ai/tools.ts","../../src/ai/prompt.ts"],"names":[],"mappings":";;;AAMO,IAAM,sBAAA,GAAyB,EAAE,MAAA,CAAO;AAAA,EAC7C,QAAA,EAAU,EAAE,IAAA,CAAK;AAAA,IACf,KAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACD,CAAA,CAAE,QAAA,EAAS,CAAE,SAAS,6CAA6C;AACtE,CAAC;AAEM,IAAM,2BAAA,GAA8B,EAAE,MAAA,CAAO;AAAA,EAClD,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAA,IACnB;AAAA,GACF;AAAA,EACA,KAAA,EAA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","file":"index.js","sourcesContent":["// ═══════════════════════════════════════════════════════════════════════════════\n// @learnwell/presentation-kit — AI Tool Schemas (Zod)\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport { z } from 'zod';\n\nexport const listSlidePresetsSchema = z.object({\n category: z.enum([\n 'all',\n 'cover',\n 'content',\n 'split',\n 'code',\n 'metrics',\n 'diagram',\n 'quote',\n 'assessment',\n ]).optional().describe('Optional category filter for layout presets'),\n});\n\nexport const createSlideFromPresetSchema = z.object({\n presetId: z.string().describe(\n 'ID of the layout preset: title-hero, two-column-split, code-explainer, metrics-3-card, process-flow, quote-highlight, quiz-checkpoint, tiered-practice-3cards, agenda-timeline, takeaways-summary'\n ),\n title: z.string().describe('Slide heading or title'),\n subtitle: z.string().optional().describe('Optional subtitle or section context'),\n content: z.record(z.string()).optional().describe(\n 'Key-value pairs for preset sections. For two-column-split: leftCol, rightCol. For code-explainer: code, language, notes. For metrics-3-card: card1Title, card1Val, card1Desc, etc.'\n ),\n customMarkdownBody: z.string().optional().describe(\n 'Raw markdown body to place inside the layout container (overrides content key-value pairs if provided)'\n ),\n presenterNotes: z.array(z.string()).optional().describe(\n 'Teacher talk track, cold-call check questions, or scaffolding notes for this slide'\n ),\n});\n\nexport const applySlideLayoutSchema = z.object({\n markdown: z.string().describe('Full Markdown slide deck content'),\n slideIndex: z.number().int().min(0).describe('0-based index of the target slide to modify'),\n presetId: z.string().optional().describe('Optional preset ID to apply to this slide'),\n boxes: z.array(\n z.object({\n id: z.string(),\n target: z.string().optional(),\n pos: z.tuple([z.number(), z.number(), z.number(), z.number()]).describe('[x, y, width, height] in 1280x720 canvas coordinates'),\n fontSize: z.string().optional(),\n color: z.string().optional(),\n textAlign: z.enum(['left', 'center', 'right', 'justify']).optional(),\n style: z.string().optional(),\n })\n ).optional().describe('Custom boxes if not using presetId'),\n});\n\nexport const updatePresenterNotesSchema = z.object({\n markdown: z.string().describe('Full Markdown slide deck content'),\n slideIndex: z.number().int().min(0).describe('0-based index of the target slide'),\n notes: z.array(z.string()).describe('List of speaker notes / talk tracks to set for this slide'),\n});\n\nexport const generateDeckOutlineSchema = z.object({\n topic: z.string().describe('Main subject or topic of the presentation'),\n durationMins: z.number().int().min(3).max(120).default(15).describe('Estimated duration in minutes (5m: 5-7 slides, 15m: 12-18 slides, 30m: 25-35 slides)'),\n audience: z.string().describe('Target audience profile (e.g. Grade 10 students, junior developers, enterprise clients)'),\n keyObjectives: z.array(z.string()).describe('2-4 key learning or decision objectives'),\n techStack: z.string().optional().describe('Optional programming language, framework, or hardware kit'),\n});\n","// ═══════════════════════════════════════════════════════════════════════════════\n// @learnwell/presentation-kit — AI Tool Handlers\n// Pure execution handlers for Vercel AI SDK / OpenAI tool calls\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport {\n SLIDE_LAYOUT_PRESETS,\n getSlideLayoutPresetById,\n getSlideLayoutPresetsByCategory,\n type SlideLayoutCategory,\n} from '../core/layout/presets.js';\nimport {\n updateSlideLayoutInMarkdown,\n splitMarkdownSlides,\n serializeLayoutToComment,\n} from '../core/layout/serializer.js';\nimport type { SlideLayoutData } from '../types.js';\n\n/**\n * Execute: listSlidePresets\n */\nexport function executeListSlidePresets(params?: { category?: string }) {\n const category = params?.category;\n const presets = (!category || category === 'all')\n ? SLIDE_LAYOUT_PRESETS\n : getSlideLayoutPresetsByCategory(category as SlideLayoutCategory);\n\n return {\n count: presets.length,\n presets: presets.map(p => ({\n id: p.id,\n name: p.name,\n category: p.category,\n description: p.description,\n boxCount: p.layout.boxes.length,\n snippetPreview: p.markdownSnippet.split('\\n').slice(0, 8).join('\\n') + '\\n...',\n })),\n };\n}\n\n/**\n * Execute: createSlideFromPreset\n */\nexport function executeCreateSlideFromPreset(params: {\n presetId: string;\n title: string;\n subtitle?: string;\n content?: Record<string, string>;\n customMarkdownBody?: string;\n presenterNotes?: string[];\n}): { success: boolean; slideMarkdown: string; presetName?: string; error?: string } {\n const preset = getSlideLayoutPresetById(params.presetId);\n if (!preset) {\n return {\n success: false,\n slideMarkdown: '',\n error: `Preset with ID \"${params.presetId}\" not found. Use listSlidePresets to see available layout templates.`,\n };\n }\n\n const layoutComment = serializeLayoutToComment(preset.layout);\n const title = params.title;\n const subtitle = params.subtitle ? `\\n### ${params.subtitle}` : '';\n\n let body = params.customMarkdownBody;\n\n if (!body) {\n const c = params.content || {};\n switch (preset.id) {\n case 'title-hero':\n body = `${subtitle}\\n\\n**Presenter:** ${c.speaker || 'Lead Instructor'} | **Duration:** ${c.duration || '45 mins'} | **Topic:** ${c.topic || title}`;\n break;\n\n case 'two-column-split':\n body = `<div class=\"columns-2\">\\n<div>\\n\\n### ${c.leftHeader || 'Approach A'}\\n${c.leftCol || '- Point 1\\n- Point 2\\n- Point 3'}\\n\\n</div>\\n<div>\\n\\n### ${c.rightHeader || 'Approach B'}\\n${c.rightCol || '- Point 1\\n- Point 2\\n- Point 3'}\\n\\n</div>\\n</div>`;\n break;\n\n case 'code-explainer':\n body = `<div class=\"columns-2\">\\n<div>\\n\\n\\`\\`\\`${c.lang || 'ts'}\\n${c.code || '// Core implementation logic\\nconst isValid = true;'}\\n\\`\\`\\`\\n\\n</div>\\n<div>\\n\\n### 🔍 Key Invariants:\\n${c.notes || '1. **Validation:** Checks payload before processing\\n2. **Execution:** Enforces deterministic state\\n3. **Resilience:** Handles edge case errors'}\\n\\n</div>\\n</div>`;\n break;\n\n case 'metrics-3-card':\n body = `<div class=\"columns-3\">\\n<div>\\n\\n# ${c.metric1Val || '99.9%'}\\n### ${c.metric1Title || 'Availability'}\\n${c.metric1Desc || 'Automated multi-region failover routing.'}\\n\\n</div>\\n<div>\\n\\n# ${c.metric2Val || '10x'}\\n### ${c.metric2Title || 'Throughput'}\\n${c.metric2Desc || 'Sub-millisecond processing latency.'}\\n\\n</div>\\n<div>\\n\\n# ${c.metric3Val || '0'}\\n### ${c.metric3Title || 'Breaches'}\\n${c.metric3Desc || 'Continuous SOC2 compliance auditing.'}\\n\\n</div>\\n</div>`;\n break;\n\n case 'process-flow':\n body = `\\`\\`\\`mermaid\\n${c.mermaid || 'graph LR\\n A[1. Ingress] --> B[2. Gateway]\\n B --> C[3. Service]\\n C --> D[4. Storage]'}\\n\\`\\`\\`\\n\\n${c.summary || '- **Phase 1 & 2:** Client connection and load balancing.\\n- **Phase 3 & 4:** Business logic execution and data commit.'}`;\n break;\n\n case 'quote-highlight':\n body = `> \"${c.quote || 'Simplicity is prerequisite for reliability.'}\"\\n> \\n> — **${c.author || 'Architecture Principle'}**`;\n break;\n\n case 'quiz-checkpoint':\n body = `> **Question:** ${c.question || 'Which architecture pattern best ensures reliable message delivery?'}\\n\\n- **A.** ${c.optA || 'Direct synchronous HTTP request with short timeout'}\\n- **B.** ${c.optB || 'Persistent Message Queue with Dead-Letter Queue (Correct)'}\\n- **C.** ${c.optC || 'In-memory client cache without persistence'}\\n- **D.** ${c.optD || 'Silently dropping failed packets'}`;\n break;\n\n case 'tiered-practice-3cards':\n body = `<div class=\"columns-3\">\\n<div>\\n\\n### 🥉 Bronze Tier\\n${c.bronze || '- Implement baseline function\\n- Pass 2 sample unit tests'}\\n\\n</div>\\n<div>\\n\\n### 🥈 Silver Tier\\n${c.silver || '- Add boundary error handling\\n- Optimize algorithm complexity'}\\n\\n</div>\\n<div>\\n\\n### 🥇 Gold Tier\\n${c.gold || '- Design extension feature\\n- Write automated integration tests'}\\n\\n</div>\\n</div>`;\n break;\n\n default:\n body = preset.markdownSnippet.replace(/^<!--[\\s\\S]*?-->\\n*/, '').replace(/^#\\s+[^\\n]+\\n*/, '').trim();\n }\n }\n\n const notes = params.presenterNotes && params.presenterNotes.length > 0\n ? `\\n\\n<!--\\nPresenter Notes:\\n${params.presenterNotes.map(n => `- ${n}`).join('\\n')}\\n-->`\n : `\\n\\n<!--\\nPresenter Notes:\\n- Explain the primary concept on this slide.\\n- Ask a diagnostic cold-call question to check comprehension.\\n-->`;\n\n const slideMarkdown = `${layoutComment}\\n\\n## ${title}${body ? '\\n\\n' + body : ''}${notes}`;\n\n return {\n success: true,\n slideMarkdown,\n presetName: preset.name,\n };\n}\n\n/**\n * Execute: applySlideLayout\n */\nexport function executeApplySlideLayout(params: {\n markdown: string;\n slideIndex: number;\n presetId?: string;\n boxes?: SlideLayoutData['boxes'];\n}): { success: boolean; updatedMarkdown: string; error?: string } {\n let layoutData: SlideLayoutData | null = null;\n\n if (params.presetId) {\n const preset = getSlideLayoutPresetById(params.presetId);\n if (!preset) {\n return {\n success: false,\n updatedMarkdown: params.markdown,\n error: `Preset with ID \"${params.presetId}\" not found.`,\n };\n }\n layoutData = preset.layout;\n } else if (params.boxes && params.boxes.length > 0) {\n layoutData = { boxes: params.boxes };\n }\n\n const updatedMarkdown = updateSlideLayoutInMarkdown(\n params.markdown,\n params.slideIndex,\n layoutData\n );\n\n return {\n success: true,\n updatedMarkdown,\n };\n}\n\n/**\n * Execute: updatePresenterNotes\n */\nexport function executeUpdatePresenterNotes(params: {\n markdown: string;\n slideIndex: number;\n notes: string[];\n}): { success: boolean; updatedMarkdown: string; error?: string } {\n const { frontmatter, slides } = splitMarkdownSlides(params.markdown);\n\n if (params.slideIndex < 0 || params.slideIndex >= slides.length) {\n return {\n success: false,\n updatedMarkdown: params.markdown,\n error: `Slide index ${params.slideIndex} out of bounds (total slides: ${slides.length})`,\n };\n }\n\n let slideContent = slides[params.slideIndex];\n const notesCommentRegex = /<!--\\s*(?:Presenter Notes|Notes):\\s*([\\s\\S]*?)-->/i;\n const newNotesComment = `<!--\\nPresenter Notes:\\n${params.notes.map(n => `- ${n}`).join('\\n')}\\n-->`;\n\n if (notesCommentRegex.test(slideContent)) {\n slideContent = slideContent.replace(notesCommentRegex, newNotesComment);\n } else {\n slideContent = `${slideContent.trimEnd()}\\n\\n${newNotesComment}`;\n }\n\n slides[params.slideIndex] = slideContent;\n const joined = slides.join('\\n---\\n');\n const updatedMarkdown = frontmatter ? `${frontmatter}\\n\\n${joined}` : joined;\n\n return {\n success: true,\n updatedMarkdown,\n };\n}\n\n/**\n * Execute: generateDeckOutline (indexed by talk duration)\n */\nexport function executeGenerateDeckOutline(params: {\n topic: string;\n durationMins: number;\n audience: string;\n keyObjectives: string[];\n techStack?: string;\n}) {\n const d = params.durationMins;\n let targetSlideCount = 12;\n let formatLabel = '15 min (Short Talk)';\n\n if (d <= 7) {\n targetSlideCount = 6;\n formatLabel = '5 min (Lightning Talk)';\n } else if (d <= 20) {\n targetSlideCount = 14;\n formatLabel = '15 min (Short Talk)';\n } else if (d <= 35) {\n targetSlideCount = 28;\n formatLabel = '30 min (Conference Talk)';\n } else {\n targetSlideCount = 42;\n formatLabel = '45-60 min (Keynote / Workshop)';\n }\n\n return {\n topic: params.topic,\n audience: params.audience,\n durationMins: d,\n format: formatLabel,\n recommendedSlideCount: targetSlideCount,\n structureGuidelines: [\n 'Apply the \"One Idea Per Slide\" invariant.',\n 'Enforce Word Budget: Maximum 40 words per card or column (Zero-Scroll Invariant).',\n 'Target 16:9 aspect ratio in 1280x720 coordinate space.',\n 'Every slide must conclude with Presenter Notes: Teacher talk track + 1 diagnostic cold-call question.',\n ],\n suggestedOutline: [\n { slide: 1, type: 'title-hero', title: `🚀 ${params.topic}`, intent: 'Opening hook and speaker credentialing' },\n { slide: 2, type: 'agenda-timeline', title: '🗺️ Session Milestones', intent: 'Set time budget expectations and learning deliverables' },\n { slide: 3, type: 'two-column-split', title: '⚡ Problem vs Opportunity', intent: 'Contrast legacy bottlenecks against the modern solution' },\n { slide: 4, type: 'process-flow', title: '🔄 Architectural Flow', intent: 'High-level system topology and sequence diagram' },\n { slide: 5, type: 'code-explainer', title: '💻 Core Code Walkthrough', intent: 'Deep-dive into production implementation logic' },\n { slide: 6, type: 'metrics-3-card', title: '📊 Benchmark Results', intent: 'Quantify performance and reliability gains' },\n { slide: 7, type: 'tiered-practice-3cards', title: '🛠️ Hands-On Challenge', intent: 'Differentiated practice across Bronze, Silver, and Gold tiers' },\n { slide: 8, type: 'quiz-checkpoint', title: '🎯 Formative Checkpoint', intent: 'Real-time diagnostic voting to verify mastery' },\n { slide: 9, type: 'takeaways-summary', title: '🏁 Key Takeaways', intent: 'Synthesis of 3 core lessons and next action items' },\n ].slice(0, Math.max(5, Math.min(targetSlideCount, 10))),\n };\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// @learnwell/presentation-kit — Slide Design Prompt Contract & System Invariants\n// \n// Modeled after battle-tested presentation orchestrators (e.g. slides-ai-plugin)\n// Provides rigorous invariants for LLM slide generation across web & PPTX.\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport const SLIDE_DESIGN_PROMPT_CONTRACT = `\n# SYSTEM MANDATE: PROFESSIONAL PRESENTATION & SLIDE DESIGN INVARIANTS\n\nYou are an expert Presentation Architect & Visual Designer for educational, technical, and executive decks.\nWhen generating or modifying Marp slide presentations, you MUST STRICTLY obey the following non-negotiable rules:\n\n---\n\n## 1. DURATION-INDEXED SLIDE PACING\nStructure decks based on allocated talk time (averaging 1.5 - 2 minutes per slide):\n- **5 min (Lightning Talk):** 5 - 7 slides [Hook -> 2-3 Core Points -> CTA / Summary]\n- **15 min (Short Tech Talk):** 12 - 16 slides [Title -> Agenda -> Hook -> 3-4 Concepts -> Lab/Demo -> Summary]\n- **30 min (Conference / Class):** 24 - 32 slides [Full 5E Learning Cycle + Interactive Formative Checkpoint]\n- **45-60 min (Keynote / Workshop):** 36 - 50 slides [Modular Micro-cycles + Tiered Hands-on Exercises]\n\n---\n\n## 2. THE \"ONE IDEA PER SLIDE\" RULE\n- Each slide communicates **EXACTLY ONE** pedagogical or architectural concept.\n- Never pack multiple distinct topics into a single slide.\n- If a concept has both theory and code, split into: (Slide A) Concept Diagram -> (Slide B) Code Walkthrough.\n\n---\n\n## 3. STRICT WORD BUDGET (ZERO-SCROLL INVARIANT)\n- **Hard Limit:** Maximum **35 - 40 words** per card or column.\n- Never write paragraphs longer than 2 sentences. Use structured bullets with bold anchor terms:\n - Format: \\`- **Key Concept:** Concise explanation in a single line.\\`\n- Vertical scrolling inside a slide is STRICTLY FORBIDDEN. Content must fit the 16:9 (1280x720) canvas cleanly.\n\n---\n\n## 4. TWO-COLUMN & CARD BALANCED LAYOUTS\n- Avoid centered vertical walls of text. Use responsive side-by-side card wrappers:\n \\`\\`\\`html\n <div class=\"columns-2\">\n <div>\n ### 🔴 Legacy / Challenge\n - High idle compute overhead\n - Cascading timeout failures\n </div>\n <div>\n ### 🟢 Modern / Solution\n - Event-driven webhook streams\n - Automatic queue backpressure\n </div>\n </div>\n \\`\\`\\`\n- For 3 metrics or bronze/silver/gold differentiation, use \\`<div class=\"columns-3\">...</div>\\`.\n\n---\n\n## 5. MANDATORY PRESENTER NOTES (TEACHER TALK TRACK)\nEvery single slide MUST conclude with an HTML comment block containing:\n1. **Talk Track:** 2-3 sentences of what the speaker should say out loud.\n2. **Cold-Call Check Question:** 1 diagnostic question to ask a specific student or attendee.\n3. **Scaffolding Tip:** 1 hint or real-world analogy if learners look confused.\n\nExample:\n\\`\\`\\`markdown\n<!--\nPresenter Notes:\n- Walk through the primary bottleneck when scaling database writes under high concurrency.\n- Cold-call: \"Alex, if traffic spikes 10x in 1 minute, which subsystem will experience lock contention first?\"\n- Scaffolding tip: Remind the room of the I/O saturation trade-off discussed in the previous module.\n-->\n\\`\\`\\`\n\n---\n\n## 6. MARP COMPATIBLE YAML LAYOUT HEADERS\nWhen a precise coordinate layout is specified, include the clean YAML block at the very top of the slide:\n\\`\\`\\`markdown\n<!-- layout:\n boxes:\n - id: heading\n target: h2\n pos: [80, 50, 1120, 70]\n fontSize: 2rem\n - id: col-left\n target: '.columns-2 > div:first-child'\n pos: [80, 150, 530, 510]\n - id: col-right\n target: '.columns-2 > div:last-child'\n pos: [670, 150, 530, 510]\n-->\n\\`\\`\\`\n`;\n"]}
|