{
  "_description": "Lumina JSON examples and implementation snippets for LLMs. Use deckExamples to learn slide types; metaExamples for meta/slide options; implementationSnippets for vanilla JS integration.",
  "deckExamples": {
    "statement": {
      "meta": { "title": "Statement example" },
      "slides": [
        {
          "type": "statement",
          "tag": "Tag (optional)",
          "title": "Headline",
          "subtitle": "Supporting text. Omit tag or subtitle if not needed."
        }
      ]
    },
    "features": {
      "meta": { "title": "Features example" },
      "slides": [
        {
          "type": "features",
          "title": "Feature Grid",
          "description": "Optional section description.",
          "features": [
            { "class": "", "title": "One", "desc": "Short description", "icon": "fa-bolt" },
            { "class": "", "title": "Two", "desc": "Icons: fa-*, or 'star','zap','check'", "icon": "star" }
          ]
        }
      ]
    },
    "half": {
      "meta": { "title": "Half (split) example" },
      "slides": [
        {
          "type": "half",
          "imageSide": "left",
          "image": "https://example.com/photo.jpg",
          "tag": "Optional tag",
          "title": "Split layout",
          "paragraphs": ["First paragraph.", "Second paragraph."],
          "cta": "Optional button label"
        }
      ]
    },
    "timeline": {
      "meta": { "title": "Timeline example" },
      "slides": [
        {
          "type": "timeline",
          "title": "Chronology",
          "subtitle": "Optional subtitle",
          "timeline": [
            { "date": "Q1 2024", "title": "Phase A", "description": "What happened." },
            { "date": "Q2 2024", "title": "Phase B", "description": "Next steps." }
          ]
        }
      ]
    },
    "steps": {
      "meta": { "title": "Steps example" },
      "slides": [
        {
          "type": "steps",
          "title": "How it works",
          "subtitle": "Optional",
          "steps": [
            { "step": "01", "title": "First", "description": "Optional description" },
            { "step": "02", "title": "Second", "description": "Optional" }
          ]
        }
      ]
    },
    "flex": {
      "meta": { "title": "Flex example" },
      "slides": [
        {
          "type": "flex",
          "direction": "horizontal",
          "gap": "lg",
          "padding": "lg",
          "elements": [
            { "type": "image", "src": "https://example.com/img.jpg", "size": "half", "fill": true },
            {
              "type": "content",
              "size": "half",
              "valign": "center",
              "elements": [
                { "type": "title", "text": "Flex layout", "size": "2xl" },
                { "type": "text", "text": "Flow-based. Elements: title, text, bullets, ordered, image, video, button, timeline, stepper, spacer, content.", "muted": true },
                { "type": "button", "label": "CTA", "variant": "primary" }
              ]
            }
          ]
        }
      ]
    },
    "chart": {
      "meta": { "title": "Chart example" },
      "slides": [
        {
          "type": "chart",
          "chartType": "bar",
          "title": "Revenue",
          "subtitle": "Optional",
          "data": {
            "labels": ["Q1", "Q2", "Q3", "Q4"],
            "datasets": [
              { "label": "2024", "values": [120, 150, 180, 220], "color": "c:p" }
            ]
          }
        }
      ]
    },
    "diagram": {
      "meta": { "title": "Diagram example (Vue Flow)" },
      "slides": [
        {
          "type": "diagram",
          "title": "Flow (optional)",
          "nodes": [
            { "id": "1", "type": "input", "label": "Start", "position": { "x": 250, "y": 5 } },
            { "id": "2", "label": "Process", "position": { "x": 100, "y": 100 } },
            { "id": "3", "label": "End", "position": { "x": 400, "y": 100 } }
          ],
          "edges": [
            { "id": "e1-2", "source": "1", "target": "2", "animated": true },
            { "id": "e1-3", "source": "1", "target": "3" }
          ],
          "config": { "fitView": true }
        }
      ]
    },
    "custom": {
      "meta": { "title": "Custom HTML example" },
      "slides": [
        {
          "type": "custom",
          "html": "<div class='custom-hero'><h1>Custom HTML</h1><p>Full control. Scripts are sanitized.</p></div>",
          "css": ".custom-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: white; }"
        }
      ]
    },
    "video": {
      "meta": { "title": "Video example" },
      "slides": [
        {
          "type": "video",
          "title": "Optional overlay",
          "video": {
            "type": "video",
            "src": "https://example.com/video.mp4",
            "autoplay": false,
            "muted": false,
            "controls": true
          }
        }
      ]
    },
    "free": {
      "meta": { "title": "Free (composition) example" },
      "slides": [
        {
          "type": "free",
          "elements": [
            { "type": "text", "text": "Absolutely positioned.", "fontSize": "2rem", "fontWeight": "bold" },
            { "type": "image", "src": "https://example.com/img.jpg", "width": 200, "height": 120 },
            { "type": "box", "width": 100, "height": 100, "backgroundColor": "#3b82f6" }
          ],
          "timelineTracks": {
            "s0-elements-0": { "0": { "opacity": 0, "x": -20 }, "0.3": { "opacity": 1, "x": 0 }, "1": { "opacity": 1 } },
            "s0-elements-1": { "0": { "opacity": 0, "scale": 0.8 }, "0.5": { "opacity": 1, "scale": 1 }, "1": { "opacity": 1 } }
          }
        }
      ]
    }
  },
  "metaExamples": {
    "initialElementState": {
      "usage": "Start elements hidden; reveal with engine.element(id).show(). Keys: s{N}-{path} (e.g. s0-tag, s1-features-0) or custom ids.",
      "example": {
        "meta": {
          "title": "Reveal on demand",
          "initialElementState": {
            "s0-tag": { "visible": false },
            "s0-title": { "visible": false },
            "s0-subtitle": { "visible": false }
          }
        }
      }
    },
    "elementControl": {
      "usage": "defaultVisible: false hides ALL elements by default. Override per id in initialElementState. Use with engine.element(id).show() or revealInSequence.",
      "example": {
        "meta": {
          "title": "All hidden by default",
          "elementControl": { "defaultVisible": false },
          "initialElementState": { "s0-title": { "visible": true } }
        }
      }
    },
    "effects": {
      "usage": "Override animation in meta or slide.meta. Keys: durationIn, durationOut, stagger, ease, revealDelayMs, revealDuration, revealEase, elementDuration, elementEase.",
      "example": {
        "meta": {
          "title": "Animation overrides",
          "effects": { "durationIn": 1, "revealDelayMs": 400 }
        }
      }
    },
    "timelineTracks": {
      "usage": "Per-slide. Remotion-style: progress 0–1 drives keyframes. Keys = element ids; values = { '0'|'0.25'|'1': { opacity?, x?, y?, scale?, rotate?, visible? } }. Use engine.seekTo(progress) or engine.playTimeline(duration).",
      "example": {
        "slide": {
          "type": "statement",
          "title": "Animated",
          "subtitle": "Tag, title, subtitle have keyframes.",
          "timelineTracks": {
            "s0-tag": { "0": { "opacity": 0, "y": 20 }, "0.2": { "opacity": 1, "y": 0 }, "1": { "opacity": 1 } },
            "s0-title": { "0": { "opacity": 0, "y": 24 }, "0.4": { "opacity": 1, "y": 0 }, "1": { "opacity": 1 } },
            "s0-subtitle": { "0": { "opacity": 0 }, "0.6": { "opacity": 1 }, "1": { "opacity": 1 } }
          }
        }
      }
    }
  },
  "implementationSnippets": {
    "basic": "import { Lumina } from 'lumina-slides';\nimport 'lumina-slides/style.css';\n\nconst engine = new Lumina('#app', {\n  theme: 'ocean',\n  loop: true,\n  navigation: true,\n  touch: true,\n});\n\nengine.load({\n  meta: { title: 'My Deck' },\n  slides: [\n    { type: 'statement', title: 'Hello', subtitle: 'World' },\n    { type: 'features', title: 'Features', features: [\n      { class: '', title: 'A', desc: 'Desc A', icon: 'star' },\n    ]},\n  ],\n});\n\nengine.on('slideChange', ({ index, slide }) => console.log('Slide', index, slide.type));\nengine.on('action', (p) => console.log('Action', p));",
    "elementControl": "// 1) Deck: meta.initialElementState and optionally elementControl.defaultVisible\nconst deck = {\n  meta: {\n    title: 'Reveal',\n    initialElementState: { 's0-tag': { visible: false }, 's0-title': { visible: false }, 's0-subtitle': { visible: false } },\n  },\n  slides: [{ type: 'statement', tag: 'Hi', title: 'Reveal on demand', subtitle: 'Use element(id).show().' }],\n};\n\nconst engine = new Lumina('#app', { theme: 'midnight' });\n\n// 2) Register ready and slideChange BEFORE load. element(id) is null until slide is mounted.\nengine.on('ready', () => {\n  [\"s0-tag\", \"s0-title\", \"s0-subtitle\"].forEach((id, i) => {\n    setTimeout(() => engine.element(id).show(), (i + 1) * 600);\n  });\n});\nengine.on('slideChange', (e) => {\n  if (e.index === 0) engine.resetSlide(0);\n  engine.revealInSequence(e.index, { delayMs: 500, preset: 'fadeUp' });\n});\n\nengine.load(deck);\n\n// Or: engine.element(0, 'tag').show(); engine.element(0, 'title').animate({ to: { opacity: 1, y: 0 }, duration: 0.5 });",
    "timeline": "// Deck: slide.timelineTracks = { [elementId]: { '0': { opacity, x, y, scale, rotate?, visible? }, '0.3': {...}, '1': {...} } }\nconst deck = {\n  meta: { title: 'Timeline' },\n  slides: [{\n    type: 'statement',\n    title: 'Keyframes',\n    subtitle: 'Scrub or play.',\n    timelineTracks: {\n      's0-tag': { '0': { opacity: 0, y: 20 }, '0.2': { opacity: 1, y: 0 }, '1': { opacity: 1 } },\n      's0-title': { '0': { opacity: 0, x: -30 }, '0.4': { opacity: 1, x: 0 }, '1': { opacity: 1 } },\n    },\n  }],\n};\n\nconst engine = new Lumina('#app');\nengine.load(deck);\n\n// Scrub: engine.seekTo(0.5);\n// Play: const [promise, cancel] = engine.playTimeline(5); promise.then(() => console.log('done'));\n// Read: engine.timelineProgress",
    "streaming": "import { Lumina, parsePartialJson } from 'lumina-slides';\nimport 'lumina-slides/style.css';\n\nconst engine = new Lumina('#app', { theme: 'midnight' });\nlet buffer = '';\n\nasync function onStreamChunk(chunk) {\n  buffer += chunk;\n  const json = parsePartialJson(buffer);\n  if (json && json.meta && json.slides) engine.load(json);\n}\n\n// Or with debounce: import { createDebouncedLoader } from 'lumina-slides';\n// const onChunk = createDebouncedLoader((deck) => engine.load(deck), 80);\n// onChunk(buffer);"
  },
  "elementIdConvention": "Format s{slideIndex}-{path}: s0-tag, s0-title, s0-subtitle; s1-features-0, s1-features-1; s2-elements-0-elements-1 (flex). statement: tag, title, subtitle. features: header, features-0, features-1, ... half: media, tag, title, content, cta. timeline: title, subtitle, timeline-0, ... steps: title, subtitle, steps-0, ... flex: elements-0, elements-0-elements-1, ... free: elements-0, elements-1, ... chart: title, subtitle, chart. diagram: nodes.i, edges.i (or node's id).",
  "chartTypes": ["bar", "line", "pie", "doughnut"],
  "colorTokens": "c:p (primary), c:s (secondary), c:m (muted). Or any CSS color (hex, rgb).",
  "themePresets": ["default", "ocean", "midnight", "forest", "cyber", "latte", "sunset", "monochrome"]
}
