lumina-slides 8.3.0 → 8.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Juan Pablo Paillet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,161 +1,191 @@
1
1
  # Lumina Engine
2
2
 
3
3
  <div align="center">
4
- <br />
5
- <p>
6
- <b>The Interface Layer for the Agentic Era</b>
7
- </p>
8
- The first presentation engine designed for <b>LLMs</b>. Turn JSON into cinematic, interactive experiences.
9
- </p>
10
- <br />
11
4
 
12
- <img src="https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/demo.gif" alt="Lumina Engine Demo" width="100%" style="border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);" />
5
+ <img src="https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/demo.gif" alt="Lumina Engine Demo" width="100%" style="border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 80px -20px rgba(0,0,0,0.5);" />
13
6
 
14
7
  <br />
15
- </div>
8
+ <br />
16
9
 
17
- **Lumina Engine** is a high-performance, declarative library that enables AI agents and LLMs to generate professional, interactive UI and slide decks by simply outputting JSON. It bridges the gap between text generation and visual storytelling, offering deterministic, GPU-accelerated rendering without the hallucination of pixel-generation.
10
+ <h1>JSON-Driven Presentation Engine</h1>
11
+
12
+ <p style="font-size: 1.2em; max-width: 700px;">
13
+ A lightweight, framework-agnostic library that renders beautiful, animated slide decks from simple JSON.
14
+ Perfect for AI-generated content, dynamic dashboards, and interactive presentations.
15
+ </p>
16
+
17
+ <p style="font-size: 1em; max-width: 600px; opacity: 0.8;">
18
+ ✨ <b>60fps animations</b> · 🎨 <b>6 built-in themes</b> · 📱 <b>Responsive</b> · ⚡ <b>Zero dependencies UI</b>
19
+ </p>
18
20
 
19
- > [!IMPORTANT] > **Building an Agent?**
20
- > Read the complete **[Lumina for Agents Guide](https://github.com/PailletJuanPablo/lumina-slides/blob/main/AGENTS.md)** to learn about Streaming, Auto-Layouts, and Token Optimization.
21
+ <p>
22
+ <a href="#-quick-start"><strong>🚀 Quick Start</strong></a> ·
23
+ <a href="#-layouts--gallery"><strong>🎨 Layout Gallery</strong></a> ·
24
+ <a href="AGENTS.md"><strong>🤖 Agent Guide</strong></a>
25
+ </p>
21
26
 
22
- ## 🤖 Why for LLMs?
27
+ [![Version](https://img.shields.io/npm/v/lumina-slides?style=for-the-badge&color=2563EB)](https://www.npmjs.com/package/lumina-slides)
28
+ [![Downloads](https://img.shields.io/npm/dt/lumina-slides?style=for-the-badge&color=7C3AED)](https://www.npmjs.com/package/lumina-slides)
29
+ [![License](https://img.shields.io/github/license/PailletJuanPablo/lumina-slides?style=for-the-badge&color=DB2777)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/LICENSE)
30
+ [![TypeScript](https://img.shields.io/badge/Written%20In-TypeScript-blue?style=for-the-badge&logo=typescript)](https://www.typescriptlang.org/)
23
31
 
24
- Traditional UI libraries require understanding complex component trees, CSS modules, and state management. Lumina abstracts this into a **single, flat JSON schema**.
32
+ </div>
25
33
 
26
- - **structured_output Friendly**: Designed to match the capabilities of models like GPT-4o, Claude 3.5 Sonnet, and Gemini Pro.
27
- - **Hallucination Proof**: The renderer handles the "how", the LLM only cares about the "what".
28
- - **Zero Config**: No build steps or bundler configuration needed to generate visual content dynamically.
34
+ <br />
29
35
 
30
- ## ✨ Features
36
+ ---
31
37
 
32
- - **📄 JSON-First Architecture**: Define entire decks, including content, styling, and flow, in one serializable object.
33
- - **⚡ Reactive & Performant**: Built on Vue 3 + GSAP for 60fps animations even on mobile.
34
- - **🎨 Cinematic Layouts**: "Pro" layouts (`timeline`, `statement`, `features`) that look good by default.
35
- - **🛡️ Type Safe**: Full TypeScript support with exported types for your AI system prompts.
36
- - **🔌 Event Driven**: Hook into every user interaction to feed state back to your agent.
38
+ ## 🎨 Layouts & Gallery
37
39
 
38
- ## 📦 Installation
40
+ Lumina includes **7 built-in layouts** ready to use. Just set the `type` property in your JSON:
39
41
 
40
- ```bash
41
- npm install lumina-slides
42
- ```
42
+ | Layout | Description | Visual Preview |
43
+ | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |
44
+ | **Statement** | Bold title slides for introductions, transitions, or key messages. Supports title, subtitle, and background. <br><br> `type: "statement"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-statement.png" width="200" style="border-radius: 6px;"> |
45
+ | **Features** | Auto-grid layout for showcasing features, benefits, or stats. Adapts columns based on item count. <br><br> `type: "features"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-features.png" width="200" style="border-radius: 6px;"> |
46
+ | **Timeline** | Horizontal timeline with snap navigation. Great for roadmaps, history, or process flows. <br><br> `type: "timeline"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-timeline.png" width="200" style="border-radius: 6px;"> |
47
+ | **Steps** | Numbered step-by-step guide. Perfect for tutorials, instructions, or procedures. <br><br> `type: "steps"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-steps.png" width="200" style="border-radius: 6px;"> |
48
+ | **Half** | Split layout with image on one side, content on the other. Fully responsive. <br><br> `type: "half"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-half.png" width="200" style="border-radius: 6px;"> |
49
+ | **Chart** | Data visualization with Chart.js. Supports bar, line, pie, and doughnut charts. <br><br> `type: "chart"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-chart.png" width="200" style="border-radius: 6px;"> |
50
+ | **Flex** | Declarative auto-layout system. Define structure with rows, columns, and nested containers. <br><br> `type: "flex"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-flex-demo.png" width="200" style="border-radius: 6px;"> |
43
51
 
44
- ## Quick Start for Agents
52
+ > [!TIP] > **Embedded Mode**: All layouts can be rendered in compact containers (dashboards, widgets) by using the `compact: true` option.
45
53
 
46
- ### 1. The "System Prompt"
54
+ > [!TIP] > **See the Code**: Click on the dropdowns below to see the exact JSON used to generate these slides.
47
55
 
48
- Your agent generates this structure:
56
+ <details>
57
+ <summary><b>Example: Timeline JSON</b></summary>
49
58
 
50
59
  ```json
51
60
  {
52
- "meta": { "title": "Quarterly Review" },
53
- "slides": [
61
+ "type": "timeline",
62
+ "title": "Project History",
63
+ "timeline": [
54
64
  {
55
- "type": "statement",
56
- "title": "Q4 Performance",
57
- "subtitle": "Exceeding expectations.",
58
- "meta": { "variant": "gradient" }
65
+ "date": "2023",
66
+ "title": "Inception",
67
+ "description": "The idea is born."
59
68
  },
60
69
  {
61
- "type": "features",
62
- "title": "Key Metrics",
63
- "features": [
64
- {
65
- "title": "Growth",
66
- "description": "+145% YoY",
67
- "icon": "trending-up"
68
- },
69
- { "title": "Retention", "description": "98% Renewal", "icon": "users" }
70
- ]
70
+ "date": "2024",
71
+ "title": "Launch",
72
+ "description": "First public release."
71
73
  }
72
74
  ]
73
75
  }
74
76
  ```
75
77
 
76
- ### 2. The Engine Renders
77
-
78
- You pass that JSON directly to Lumina.
79
-
80
- ```typescript
81
- import { Lumina } from "lumina-slides";
82
- import "lumina-slides/style.css";
83
-
84
- // Works in Vanilla JS, React, Angular, Svelte, etc.
85
- // No Vue installation required.
86
- const engine = new Lumina("#app", {
87
- theme: "dark",
88
- });
78
+ </details>
89
79
 
90
- // Imagine this comes from your LLM stream
91
- const llmOutput = await agent.generatePresentation();
80
+ <details>
81
+ <summary><b>Example: Chart JSON</b></summary>
92
82
 
93
- engine.load(llmOutput);
83
+ ```json
84
+ {
85
+ "type": "chart",
86
+ "chartType": "bar",
87
+ "title": "Quarterly Revenue",
88
+ "data": {
89
+ "labels": ["Q1", "Q2", "Q3", "Q4"],
90
+ "datasets": [
91
+ { "label": "Revenue", "values": [120, 150, 180, 220], "color": "c:p" }
92
+ ]
93
+ }
94
+ }
94
95
  ```
95
96
 
96
- ## 🧩 Built-in Layouts
97
-
98
- Lumina provides semantic layout types that LLMs can easily select based on context.
97
+ </details>
99
98
 
100
- ### **Statement**
99
+ ---
101
100
 
102
- Big ideas, quotes, titles. Great for "cover" slides.
101
+ ## 🎭 Theming
103
102
 
104
- [![Statement Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-statement.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-statement.json)
105
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-statement.json)
103
+ Lumina includes **6 beautiful theme presets** out-of-the-box. Just pass the name:
106
104
 
107
- ### **Half**
105
+ ```typescript
106
+ const engine = new Lumina("#app", { theme: "ocean" });
107
+ ```
108
108
 
109
- Comparisons, text + image context.
109
+ | Theme | Description | Preview |
110
+ | :----------- | :---------------------------------- | :---------------------------------------------------------------------------------------------------------------------- |
111
+ | **default** | Clean blue on dark. Professional. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-default.png" width="180" style="border-radius: 6px;"> |
112
+ | **ocean** | Cyan on slate. Calm and focused. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-ocean.png" width="180" style="border-radius: 6px;"> |
113
+ | **midnight** | Indigo on black. Bold and dramatic. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-midnight.png" width="180" style="border-radius: 6px;"> |
114
+ | **forest** | Emerald greens. Natural and fresh. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-forest.png" width="180" style="border-radius: 6px;"> |
115
+ | **cyber** | Neon pink. Sci-fi futuristic. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-cyber.png" width="180" style="border-radius: 6px;"> |
116
+ | **latte** | Light mode. Warm amber on cream. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-latte.png" width="180" style="border-radius: 6px;"> |
110
117
 
111
- [![Half Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-half.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-half.json)
112
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-half.json)
118
+ ---
113
119
 
114
- ### **Features**
120
+ ## ⚡ Quick Start
115
121
 
116
- Lists of benefits, KPIs, or grid items.
122
+ ### 1. Install
117
123
 
118
- [![Features Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-features.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-features.json)
119
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-features.json)
124
+ ```bash
125
+ npm install lumina-slides
126
+ ```
120
127
 
121
- ### **Timeline**
128
+ ### 2. Implementation
122
129
 
123
- Chronological events, roadmaps, history.
130
+ Lumina is a **Framework Agnostic** class. It mounts to any DOM node.
124
131
 
125
- [![Timeline Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-timeline.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-timeline.json)
126
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-timeline.json)
132
+ ```typescript
133
+ import { Lumina } from "lumina-slides";
134
+ import "lumina-slides/style.css";
127
135
 
128
- ### **Steps**
136
+ const engine = new Lumina("#app", {
137
+ theme: "dark",
138
+ loop: true,
139
+ });
129
140
 
130
- Tutorials, flows, numbered processes.
141
+ // Load Data (From your API, or static)
142
+ engine.load({
143
+ meta: { title: "Demo Deck" },
144
+ slides: [
145
+ { type: "statement", title: "Hello World", subtitle: "Powered by Lumina" },
146
+ ],
147
+ });
148
+ ```
131
149
 
132
- [![Steps Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-steps.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-steps.json)
133
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-steps.json)
150
+ ---
134
151
 
135
- ### **Embedded (Widget Mode)**
152
+ ## 🤖 Building Agents?
136
153
 
137
- Slides constrained to a container, perfect for dashboards.
154
+ We have a dedicated guide for that.
138
155
 
139
- [![Embedded Layout](https://raw.githubusercontent.com/PailletJuanPablo/lumina-slides/main/public/layout-embedded.png)](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-embedded.json)
140
- [View JSON Source](https://github.com/PailletJuanPablo/lumina-slides/blob/main/public/layout-embedded.json)
156
+ > [!IMPORTANT] > **Read the [Agent Integration Guide](./AGENTS.md)**
157
+ >
158
+ > Learn about:
159
+ >
160
+ > - **Streaming**: How to pipe token streams directly into the engine.
161
+ > - **Aliases**: Improve latency by 30% using `t` instead of `title`.
162
+ > - **Feedback Loops**: How to let the AI know what the user is clicking.
141
163
 
142
- ## 📚 API Reference
164
+ ### Token Optimization
143
165
 
144
- ### `engine.load(deck: DeckDefinition)`
166
+ Lumina includes a built-in normalizer. Your LLM can output "lazy" JSON to save money.
145
167
 
146
- Loads a new deck. This is reactive - calling it again with new data (e.g. streaming chunks) will update the view seamlessly.
168
+ | Concept | Standard | Short Alias |
169
+ | :------------- | :----------- | :---------- |
170
+ | **Header** | `title` | `t` |
171
+ | **Sub-Header** | `subtitle` | `s` |
172
+ | **Picture** | `image` | `img` |
173
+ | **Background** | `background` | `bg` |
147
174
 
148
- ### `engine.on(event, callback)`
175
+ ---
149
176
 
150
- Listen to interactions to create loops where the user's action prompts the AI for the next step.
177
+ ## 📚 Documentation & Resources
151
178
 
152
- ```typescript
153
- engine.on("action", (payload) => {
154
- // Feed user interaction back to the AI
155
- agent.send(`User clicked on button: ${payload.value}`);
156
- });
157
- ```
179
+ | Resource | Description |
180
+ | :-------------------------------------------------------------------------------------- | :--------------------------------------------------------------- |
181
+ | 📖 **[Full Documentation](https://pailletjuanpablo.github.io/lumina-slides/)** | Complete guides, examples, and live playground |
182
+ | 🔧 **[API Reference](https://pailletjuanpablo.github.io/lumina-slides/#/api)** | TypeDoc-generated API docs with all methods and types |
183
+ | 🤖 **[Agent Integration Guide](./AGENTS.md)** | How to integrate Lumina with AI agents (OpenAI, Anthropic, etc.) |
184
+ | 📝 **[LLM System Prompt](https://pailletjuanpablo.github.io/lumina-slides/prompt.txt)** | Ready-to-use system prompt for your AI to generate slides |
185
+ | 🎮 **[Live Playground](https://pailletjuanpablo.github.io/lumina-slides/#/playground)** | Try Lumina in your browser with live JSON editing |
158
186
 
159
- ## 📄 License
187
+ ---
160
188
 
161
- MIT
189
+ <div align="center">
190
+ <p>Built with ❤️ by <a href="https://pailletjp.com">Juan Pablo Paillet</a>.</p>
191
+ </div>