lumina-slides 9.0.0 → 9.0.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/dist/lumina-slides.js +5005 -5003
- package/dist/lumina-slides.umd.cjs +120 -120
- package/package.json +1 -1
- package/src/components/site/SiteDocs.vue +11 -5
- package/src/core/store.ts +5 -1
- package/src/core/types.ts +10 -6
package/package.json
CHANGED
|
@@ -352,12 +352,21 @@ engine.load(myDeckData);</code></pre>
|
|
|
352
352
|
<ul>
|
|
353
353
|
<li><code>theme</code> — Preset name (<code>default</code>, <code>ocean</code>, <code>midnight</code>, <code>forest</code>, <code>cyber</code>, <code>latte</code>, <code>sunset</code>, <code>monochrome</code>) or a <code>ThemeConfig</code> object.</li>
|
|
354
354
|
<li><code>loop</code> — Loop back to the first slide after the last. Default: <code>false</code>.</li>
|
|
355
|
-
<li><code>navigation</code>, <code>keyboard</code>, <code>touch</code> — Enable/disable navigation. Defaults: <code>true</code>.</li>
|
|
356
355
|
<li><code>selector</code> — Override the mount selector (default from constructor).</li>
|
|
357
356
|
<li><code>debug</code> — Enable debug logs. Default: <code>false</code>.</li>
|
|
358
357
|
<li><code>studio</code> — Enable Studio (page builder) mode. Default: <code>false</code>.</li>
|
|
359
358
|
</ul>
|
|
360
359
|
|
|
360
|
+
<h3>Navigation</h3>
|
|
361
|
+
<p>Control how users move between slides (buttons, keyboard, touch):</p>
|
|
362
|
+
<ul>
|
|
363
|
+
<li><code>navigation</code> — Master switch. If <code>false</code>, prev/next buttons are disabled and keyboard/touch do nothing. Default: <code>true</code>.</li>
|
|
364
|
+
<li><code>keyboard</code> — Enable keyboard shortcuts for next/prev. Only applies when <code>navigation</code> is true. Default: <code>true</code>.</li>
|
|
365
|
+
<li><code>touch</code> — Enable touch/swipe for next/prev. Only applies when <code>navigation</code> is true. Default: <code>true</code>.</li>
|
|
366
|
+
<li><code>ui.showControls</code> — Show or hide the prev/next (and speaker-notes) buttons in the footer. When hidden, keyboard and touch still work if enabled. Default: <code>true</code>.</li>
|
|
367
|
+
<li><code>keys</code> — Custom key bindings: <code>keys: { next: ['ArrowRight',' ','Enter'], prev: ['ArrowLeft','Backspace'] }</code>. Use <code>KeyboardEvent.key</code> values. You can override only one side, e.g. <code>keys: { prev: ['Backspace'] }</code> keeps default <code>next</code> and only changes <code>prev</code>.</li>
|
|
368
|
+
</ul>
|
|
369
|
+
|
|
361
370
|
<h3>elementControl</h3>
|
|
362
371
|
<p>For reveal-on-demand: <code>elementControl: { defaultVisible: false }</code> makes all elements start hidden. Override per id with <code>meta.initialElementState</code>. See <em>Element Control</em>.</p>
|
|
363
372
|
|
|
@@ -374,11 +383,8 @@ engine.load(myDeckData);</code></pre>
|
|
|
374
383
|
<span class="text-blue-400">visible</span>: <span class="text-yellow-400">true</span>,
|
|
375
384
|
<span class="text-blue-400">showProgressBar</span>: <span class="text-yellow-400">true</span>,
|
|
376
385
|
<span class="text-blue-400">showSlideCount</span>: <span class="text-yellow-400">true</span>,
|
|
377
|
-
<span class="text-blue-400">showControls</span>: <span class="text-yellow-400">true</span> <span class="text-gray-500">// Next/Prev
|
|
386
|
+
<span class="text-blue-400">showControls</span>: <span class="text-yellow-400">true</span> <span class="text-gray-500">// Next/Prev + speaker-notes; hide to rely only on keyboard/touch</span>
|
|
378
387
|
}</code></pre>
|
|
379
|
-
|
|
380
|
-
<h3>keys</h3>
|
|
381
|
-
<p>Custom key bindings: <code>keys: { next: ['ArrowRight',' '], prev: ['ArrowLeft'] }</code>.</p>
|
|
382
388
|
</div>
|
|
383
389
|
|
|
384
390
|
<!-- EVENTS -->
|
package/src/core/store.ts
CHANGED
|
@@ -114,10 +114,14 @@ function deepMerge(target: any, source: any) {
|
|
|
114
114
|
* @returns A store object containing the reactive state and methods.
|
|
115
115
|
*/
|
|
116
116
|
export function createStore(initialOptions: LuminaOptions = {}) {
|
|
117
|
+
const baseOptions = { ...DEFAULT_OPTIONS, ...initialOptions };
|
|
118
|
+
if (initialOptions && typeof initialOptions.keys === 'object') {
|
|
119
|
+
baseOptions.keys = { ...DEFAULT_OPTIONS.keys!, ...initialOptions.keys };
|
|
120
|
+
}
|
|
117
121
|
const state = reactive<LuminaState>({
|
|
118
122
|
deck: null,
|
|
119
123
|
currentIndex: 0,
|
|
120
|
-
options:
|
|
124
|
+
options: baseOptions,
|
|
121
125
|
isReady: false,
|
|
122
126
|
actionHistory: [],
|
|
123
127
|
elementState: {},
|
package/src/core/types.ts
CHANGED
|
@@ -1273,7 +1273,10 @@ export interface ThemeConfig {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
|
|
1275
1275
|
/**
|
|
1276
|
-
* Custom
|
|
1276
|
+
* Custom key bindings for next/prev slide navigation.
|
|
1277
|
+
* Values must be `KeyboardEvent.key` strings (e.g. 'ArrowRight', ' ', 'Enter', 'Backspace').
|
|
1278
|
+
* When you pass `keys` in options, it is merged with defaults: you can override only
|
|
1279
|
+
* `next` or only `prev` and the other keeps its default.
|
|
1277
1280
|
*/
|
|
1278
1281
|
export interface LuminaKeyBindings {
|
|
1279
1282
|
next: string[];
|
|
@@ -1287,7 +1290,8 @@ export interface LuminaUIOptions {
|
|
|
1287
1290
|
visible?: boolean; // Global UI visibility
|
|
1288
1291
|
showProgressBar?: boolean;
|
|
1289
1292
|
showSlideCount?: boolean;
|
|
1290
|
-
|
|
1293
|
+
/** Show or hide the prev/next (and speaker-notes) controls in the footer. When hidden, keyboard and touch still work if `navigation` and `keyboard`/`touch` allow. Default: true. */
|
|
1294
|
+
showControls?: boolean;
|
|
1291
1295
|
}
|
|
1292
1296
|
|
|
1293
1297
|
/**
|
|
@@ -1404,11 +1408,11 @@ export interface LuminaOptions {
|
|
|
1404
1408
|
selector?: string;
|
|
1405
1409
|
/** Whether to loop back to the start after the last slide. */
|
|
1406
1410
|
loop?: boolean;
|
|
1407
|
-
/**
|
|
1411
|
+
/** Master switch for slide-by-slide navigation. When false, the on-screen prev/next buttons are disabled and keyboard/touch do nothing. When true, keyboard and touch can be toggled via `keyboard` and `touch`; the nav buttons are shown/hidden with `ui.showControls`. Default: true. */
|
|
1408
1412
|
navigation?: boolean;
|
|
1409
|
-
/** Enable
|
|
1413
|
+
/** Enable or disable keyboard shortcuts for next/prev. Only has effect when `navigation` is true. Default: true. */
|
|
1410
1414
|
keyboard?: boolean;
|
|
1411
|
-
/** Enable
|
|
1415
|
+
/** Enable or disable touch/swipe for next/prev. Only has effect when `navigation` is true. Default: true. */
|
|
1412
1416
|
touch?: boolean;
|
|
1413
1417
|
/** Enable debug logs. */
|
|
1414
1418
|
debug?: boolean;
|
|
@@ -1416,7 +1420,7 @@ export interface LuminaOptions {
|
|
|
1416
1420
|
theme?: ThemeConfig | string;
|
|
1417
1421
|
/** UI element toggles. */
|
|
1418
1422
|
ui?: LuminaUIOptions;
|
|
1419
|
-
/** Custom key bindings. */
|
|
1423
|
+
/** Custom key bindings for next/prev. Example: `keys: { next: ['ArrowRight',' ','Enter'], prev: ['ArrowLeft','Backspace'] }`. Use `KeyboardEvent.key` strings. Merged with defaults at init and in `setOptions`, so you can pass e.g. `keys: { prev: ['Backspace'] }` to change only prev. */
|
|
1420
1424
|
keys?: LuminaKeyBindings;
|
|
1421
1425
|
/** Animation settings. */
|
|
1422
1426
|
animation?: LuminaAnimationOptions;
|