lumina-slides 9.0.7 → 9.0.8
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/package.json
CHANGED
|
@@ -156,6 +156,59 @@
|
|
|
156
156
|
engine.load(myDeckData);</code></pre>
|
|
157
157
|
</div>
|
|
158
158
|
|
|
159
|
+
<!-- STUDIO -->
|
|
160
|
+
<div v-else-if="activeSection === 'studio'" id="studio">
|
|
161
|
+
<h1>Studio</h1>
|
|
162
|
+
<p class="lead">Build and edit decks visually with the built-in Studio: inspector, toolbar, and one-click export.</p>
|
|
163
|
+
<div class="my-8 rounded-xl overflow-hidden border border-white/10 shadow-2xl">
|
|
164
|
+
<img src="/studio.gif" alt="Lumina Studio" class="w-full" />
|
|
165
|
+
</div>
|
|
166
|
+
<p>Mount Lumina with <code>studioEmbed: true</code> on a DOM node and optionally pass an <code>initialDeck</code>. When the user saves in Studio, listen for the <code>save</code> event to get the full deck object.</p>
|
|
167
|
+
|
|
168
|
+
<pre class="language-js"><code><span class="text-purple-400">import</span> { Lumina } <span class="text-purple-400">from</span> <span class="text-green-400">'lumina-slides'</span>;
|
|
169
|
+
<span class="text-purple-400">import</span> <span class="text-green-400">'lumina-slides/style.css'</span>;
|
|
170
|
+
|
|
171
|
+
<span class="text-gray-500">// Optional: deck to load when the app starts. Omit for an empty deck.</span>
|
|
172
|
+
<span class="text-blue-400">const</span> initialDeck = {
|
|
173
|
+
meta: { title: <span class="text-green-400">'My Presentation'</span> },
|
|
174
|
+
slides: [
|
|
175
|
+
{ type: <span class="text-green-400">'statement'</span>, title: <span class="text-green-400">'Welcome'</span>, subtitle: <span class="text-green-400">'Edit in Studio.'</span> },
|
|
176
|
+
{
|
|
177
|
+
type: <span class="text-green-400">'features'</span>,
|
|
178
|
+
title: <span class="text-green-400">'Features'</span>,
|
|
179
|
+
features: [
|
|
180
|
+
{ title: <span class="text-green-400">'One'</span>, description: <span class="text-green-400">'First feature'</span> },
|
|
181
|
+
{ title: <span class="text-green-400">'Two'</span>, description: <span class="text-green-400">'Second feature'</span> }
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
<span class="text-blue-400">const</span> engine = <span class="text-blue-400">new</span> Lumina(<span class="text-green-400">'#app'</span>, {
|
|
188
|
+
studioEmbed: <span class="text-yellow-400">true</span>,
|
|
189
|
+
initialDeck
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
engine.on(<span class="text-green-400">'save'</span>, (deck) => {
|
|
193
|
+
<span class="text-gray-500">// Persist to your backend, download as JSON, or load elsewhere</span>
|
|
194
|
+
console.log(<span class="text-green-400">'Deck saved:'</span>, deck);
|
|
195
|
+
});</code></pre>
|
|
196
|
+
|
|
197
|
+
<h3>Options</h3>
|
|
198
|
+
<div class="overflow-x-auto border border-white/10 rounded-lg my-6">
|
|
199
|
+
<table class="w-full text-left text-sm text-white/70">
|
|
200
|
+
<thead class="bg-white/5 text-white font-bold">
|
|
201
|
+
<tr><th class="p-3 border-b border-white/10">Option</th><th class="p-3 border-b border-white/10">Description</th></tr>
|
|
202
|
+
</thead>
|
|
203
|
+
<tbody class="divide-y divide-white/5">
|
|
204
|
+
<tr><td class="p-3 font-mono text-blue-400">studioEmbed: true</td><td class="p-3">Renders the Studio UI (inspector, toolbar) next to the deck.</td></tr>
|
|
205
|
+
<tr><td class="p-3 font-mono text-blue-400">initialDeck</td><td class="p-3">Optional. Deck object <code>{ meta, slides }</code> to load on init. Omit for an empty deck.</td></tr>
|
|
206
|
+
</tbody>
|
|
207
|
+
</table>
|
|
208
|
+
</div>
|
|
209
|
+
<p>When the user clicks <strong>Save</strong> in Studio, Lumina emits <code>save</code> with the full deck. Use it to persist, export, or feed into another Lumina instance.</p>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
159
212
|
<!-- DECK STRUCTURE -->
|
|
160
213
|
<div v-else-if="activeSection === 'deck'" id="deck">
|
|
161
214
|
<h1>Deck Structure</h1>
|
|
@@ -3198,6 +3251,7 @@ const navigation = [
|
|
|
3198
3251
|
{ id: 'intro', label: 'Introduction' },
|
|
3199
3252
|
{ id: 'install', label: 'Installation' },
|
|
3200
3253
|
{ id: 'setup', label: 'Quick Start' },
|
|
3254
|
+
{ id: 'studio', label: 'Studio' },
|
|
3201
3255
|
{ id: 'theming', label: 'Theming & Presets' }
|
|
3202
3256
|
]
|
|
3203
3257
|
},
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<LuminaStudioEmbed :deck="
|
|
2
|
+
<LuminaStudioEmbed :deck="deck" @save="onSave" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
6
|
import type { Ref } from 'vue';
|
|
7
|
+
import { computed, unref } from 'vue';
|
|
7
8
|
import { bus } from '../../core/events';
|
|
8
9
|
import type { Deck } from '../../core/types';
|
|
9
10
|
import LuminaStudioEmbed from './LuminaStudioEmbed.vue';
|
|
10
11
|
|
|
11
|
-
defineProps<{
|
|
12
|
+
const props = defineProps<{
|
|
12
13
|
/** Ref to the current deck; engine.load() updates this. */
|
|
13
14
|
deckRef: Ref<Deck | null> | Deck | null;
|
|
14
15
|
}>();
|
|
15
16
|
|
|
17
|
+
const deck = computed(() => unref(props.deckRef));
|
|
18
|
+
|
|
16
19
|
function onSave(deck: Deck) {
|
|
17
20
|
bus.emit('save', deck);
|
|
18
21
|
}
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
85
|
<script setup lang="ts">
|
|
86
|
-
import { computed, ref, onMounted, watch } from 'vue';
|
|
87
|
-
import {
|
|
86
|
+
import { computed, inject, ref, onMounted, watch } from 'vue';
|
|
87
|
+
import { routeLocationKey } from 'vue-router';
|
|
88
88
|
import { useEditor } from '../../composables/useEditor';
|
|
89
89
|
import { useAuth } from '../../composables/useAuth';
|
|
90
90
|
import { saveDeck, updateDeck } from '../../utils/firebase';
|
|
@@ -97,7 +97,7 @@ const props = withDefaults(defineProps<{ embedMode?: boolean }>(), { embedMode:
|
|
|
97
97
|
const emit = defineEmits<{ save: [deck: Deck] }>();
|
|
98
98
|
|
|
99
99
|
const editor = useEditor();
|
|
100
|
-
const route =
|
|
100
|
+
const route = inject(routeLocationKey) ?? { params: {} as Record<string, string | string[]> };
|
|
101
101
|
const { user } = useAuth();
|
|
102
102
|
const isSaving = ref(false);
|
|
103
103
|
// const showSaveModal = ref(false);
|