lumina-slides 8.3.0 โ†’ 8.4.1

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/README.md CHANGED
@@ -1,161 +1,205 @@
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>
16
-
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.
8
+ <br />
18
9
 
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.
10
+ <h1>The Interface Layer for the Agentic Era</h1>
11
+
12
+ <p style="font-size: 1.2em; max-width: 600px;">
13
+ <b>Stop making your AI write HTML.</b>
14
+ <br>
15
+ Lumina turns "fuzzy" Agent thoughts into <br>
16
+ cinematic, 60fps GPU-accelerated experiences.
17
+ </p>
21
18
 
22
- ## ๐Ÿค– Why for LLMs?
19
+ <p>
20
+ <a href="#-quick-start"><strong>๐Ÿš€ Quick Start</strong></a> ยท
21
+ <a href="#-layouts--gallery"><strong>๐ŸŽจ Layout Gallery</strong></a> ยท
22
+ <a href="AGENTS.md"><strong>๐Ÿค– Agent Guide</strong></a>
23
+ </p>
23
24
 
24
- Traditional UI libraries require understanding complex component trees, CSS modules, and state management. Lumina abstracts this into a **single, flat JSON schema**.
25
+ [![Version](https://img.shields.io/npm/v/lumina-slides?style=for-the-badge&color=2563EB)](https://www.npmjs.com/package/lumina-slides)
26
+ [![Downloads](https://img.shields.io/npm/dt/lumina-slides?style=for-the-badge&color=7C3AED)](https://www.npmjs.com/package/lumina-slides)
27
+ [![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)
28
+ [![TypeScript](https://img.shields.io/badge/Written%20In-TypeScript-blue?style=for-the-badge&logo=typescript)](https://www.typescriptlang.org/)
25
29
 
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.
30
+ </div>
29
31
 
30
- ## โœจ Features
32
+ <br />
31
33
 
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.
34
+ ---
37
35
 
38
- ## ๐Ÿ“ฆ Installation
36
+ ## ๐ŸŽจ Layouts & Gallery
39
37
 
40
- ```bash
41
- npm install lumina-slides
42
- ```
38
+ Lumina comes with **"Pro" Layouts** built-in. Your agent just needs to pick the `type`.
43
39
 
44
- ## โšก Quick Start for Agents
40
+ | Layout | Description | Visual Preview |
41
+ | :------------ | :---------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------ |
42
+ | **Statement** | High-impact text. Perfect for titles, big ideas, or "cover" slides. <br><br> `type: "statement"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-statement.png" width="200" style="border-radius: 6px;"> |
43
+ | **Features** | A powerful grid system for benefits, stats, or KPIs. Automatically adapts to the number of items. <br><br> `type: "features"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-features.png" width="200" style="border-radius: 6px;"> |
44
+ | **Timeline** | Chronological events, roadmaps, or history. Horizontal scrolling with snap points. <br><br> `type: "timeline"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-timeline.png" width="200" style="border-radius: 6px;"> |
45
+ | **Steps** | Numbered process flows, tutorials, or "How-To" guides. <br><br> `type: "steps"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-steps.png" width="200" style="border-radius: 6px;"> |
46
+ | **Half** | Visual context. Image on one side, text on the other. Responsive. <br><br> `type: "half"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-half.png" width="200" style="border-radius: 6px;"> |
47
+ | **Chart** | Data visualization with Chart.js. Bar, line, pie, doughnut charts. <br><br> `type: "chart"` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-chart.png" width="200" style="border-radius: 6px;"> |
48
+ | **Embedded** | **Widget Mode**. Embed slides inside dashboards or smaller containers. <br><br> `type: "features" (compact)` | <img src="https://pailletjuanpablo.github.io/lumina-slides/layout-embedded.png" width="200" style="border-radius: 6px;"> |
45
49
 
46
- ### 1. The "System Prompt"
50
+ > [!TIP] > **See the Code**: Click on the dropdowns below to see the exact JSON used to generate these slides.
47
51
 
48
- Your agent generates this structure:
52
+ <details>
53
+ <summary><b>Example: Timeline JSON</b></summary>
49
54
 
50
55
  ```json
51
56
  {
52
- "meta": { "title": "Quarterly Review" },
53
- "slides": [
57
+ "type": "timeline",
58
+ "title": "Project History",
59
+ "timeline": [
54
60
  {
55
- "type": "statement",
56
- "title": "Q4 Performance",
57
- "subtitle": "Exceeding expectations.",
58
- "meta": { "variant": "gradient" }
61
+ "date": "2023",
62
+ "title": "Inception",
63
+ "description": "The idea is born."
59
64
  },
60
65
  {
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
- ]
66
+ "date": "2024",
67
+ "title": "Launch",
68
+ "description": "First public release."
71
69
  }
72
70
  ]
73
71
  }
74
72
  ```
75
73
 
76
- ### 2. The Engine Renders
74
+ </details>
77
75
 
78
- You pass that JSON directly to Lumina.
76
+ <details>
77
+ <summary><b>Example: Chart JSON</b></summary>
79
78
 
80
- ```typescript
81
- import { Lumina } from "lumina-slides";
82
- import "lumina-slides/style.css";
79
+ ```json
80
+ {
81
+ "type": "chart",
82
+ "chartType": "bar",
83
+ "title": "Quarterly Revenue",
84
+ "data": {
85
+ "labels": ["Q1", "Q2", "Q3", "Q4"],
86
+ "datasets": [
87
+ { "label": "Revenue", "values": [120, 150, 180, 220], "color": "c:p" }
88
+ ]
89
+ }
90
+ }
91
+ ```
83
92
 
84
- // Works in Vanilla JS, React, Angular, Svelte, etc.
85
- // No Vue installation required.
86
- const engine = new Lumina("#app", {
87
- theme: "dark",
88
- });
93
+ </details>
89
94
 
90
- // Imagine this comes from your LLM stream
91
- const llmOutput = await agent.generatePresentation();
95
+ ---
92
96
 
93
- engine.load(llmOutput);
97
+ ## ๐ŸŽญ Theming
98
+
99
+ Lumina includes **6 beautiful theme presets** out-of-the-box. Just pass the name:
100
+
101
+ ```typescript
102
+ const engine = new Lumina("#app", { theme: "ocean" });
94
103
  ```
95
104
 
96
- ## ๐Ÿงฉ Built-in Layouts
105
+ | Theme | Description | Preview |
106
+ | :----------- | :---------------------------------- | :---------------------------------------------------------------------------------------------------------------------- |
107
+ | **default** | Clean blue on dark. Professional. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-default.png" width="180" style="border-radius: 6px;"> |
108
+ | **ocean** | Cyan on slate. Calm and focused. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-ocean.png" width="180" style="border-radius: 6px;"> |
109
+ | **midnight** | Indigo on black. Bold and dramatic. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-midnight.png" width="180" style="border-radius: 6px;"> |
110
+ | **forest** | Emerald greens. Natural and fresh. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-forest.png" width="180" style="border-radius: 6px;"> |
111
+ | **cyber** | Neon pink. Sci-fi futuristic. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-cyber.png" width="180" style="border-radius: 6px;"> |
112
+ | **latte** | Light mode. Warm amber on cream. | <img src="https://pailletjuanpablo.github.io/lumina-slides/theme-latte.png" width="180" style="border-radius: 6px;"> |
97
113
 
98
- Lumina provides semantic layout types that LLMs can easily select based on context.
114
+ ---
99
115
 
100
- ### **Statement**
116
+ ## โšก Quick Start
101
117
 
102
- Big ideas, quotes, titles. Great for "cover" slides.
118
+ ### 1. Install
103
119
 
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)
120
+ ```bash
121
+ npm install lumina-slides
122
+ ```
106
123
 
107
- ### **Half**
124
+ ### 2. Implementation
108
125
 
109
- Comparisons, text + image context.
126
+ Lumina is a **Framework Agnostic** class. It mounts to any DOM node.
110
127
 
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)
128
+ ```typescript
129
+ import { Lumina } from "lumina-slides";
130
+ import "lumina-slides/style.css";
131
+
132
+ const engine = new Lumina("#app", {
133
+ theme: "dark",
134
+ loop: true,
135
+ });
113
136
 
114
- ### **Features**
137
+ // Load Data (From your API, or static)
138
+ engine.load({
139
+ meta: { title: "Demo Deck" },
140
+ slides: [
141
+ { type: "statement", title: "Hello World", subtitle: "Powered by Lumina" },
142
+ ],
143
+ });
144
+ ```
145
+
146
+ ---
115
147
 
116
- Lists of benefits, KPIs, or grid items.
148
+ ## ๐Ÿค– Building Agents?
117
149
 
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)
150
+ We have a dedicated guide for that.
120
151
 
121
- ### **Timeline**
152
+ > [!IMPORTANT] > **Read the [Agent Integration Guide](./AGENTS.md)**
153
+ >
154
+ > Learn about:
155
+ >
156
+ > - **Streaming**: How to pipe token streams directly into the engine.
157
+ > - **Aliases**: Improve latency by 30% using `t` instead of `title`.
158
+ > - **Feedback Loops**: How to let the AI know what the user is clicking.
122
159
 
123
- Chronological events, roadmaps, history.
160
+ ### Token Optimization
124
161
 
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)
162
+ Lumina includes a built-in normalizer. Your LLM can output "lazy" JSON to save money.
127
163
 
128
- ### **Steps**
164
+ | Concept | Standard | Short Alias |
165
+ | :------------- | :----------- | :---------- |
166
+ | **Header** | `title` | `t` |
167
+ | **Sub-Header** | `subtitle` | `s` |
168
+ | **Picture** | `image` | `img` |
169
+ | **Background** | `background` | `bg` |
129
170
 
130
- Tutorials, flows, numbered processes.
171
+ ---
131
172
 
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)
173
+ ## ๐Ÿ›  API Reference
134
174
 
135
- ### **Embedded (Widget Mode)**
175
+ ### `engine.load(deck)`
136
176
 
137
- Slides constrained to a container, perfect for dashboards.
177
+ Replaces the entire deck. Use this for the initial load.
138
178
 
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)
179
+ ### `engine.patch(diff)`
141
180
 
142
- ## ๐Ÿ“š API Reference
181
+ Updates **parts** of the deck. Use this for:
143
182
 
144
- ### `engine.load(deck: DeckDefinition)`
183
+ - Real-time streaming (appending slides).
184
+ - Correcting typos live.
185
+ - Updating a "Status" slide based on live data.
145
186
 
146
- Loads a new deck. This is reactive - calling it again with new data (e.g. streaming chunks) will update the view seamlessly.
187
+ ### `engine.on(event, handler)`
147
188
 
148
- ### `engine.on(event, callback)`
189
+ Listen to user behavior.
149
190
 
150
- Listen to interactions to create loops where the user's action prompts the AI for the next step.
191
+ - `action`: User clicked a button.
192
+ - `slideChange`: User navigated.
151
193
 
152
194
  ```typescript
153
- engine.on("action", (payload) => {
154
- // Feed user interaction back to the AI
155
- agent.send(`User clicked on button: ${payload.value}`);
195
+ engine.on("action", (e) => {
196
+ // e.value = "buy_now_clicked"
197
+ // Tell the Agent to proceed to checkout!
156
198
  });
157
199
  ```
158
200
 
159
- ## ๐Ÿ“„ License
201
+ ---
160
202
 
161
- MIT
203
+ <div align="center">
204
+ <p>Built with โค๏ธ by <a href="https://pailletjp.com">Juan Pablo Paillet</a>.</p>
205
+ </div>