@molecule/app-photo-lightbox-svelte 0.0.1-stage → 1.1.0
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 +123 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,130 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-11-21T12:46:55.949Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
1
9
|
# @molecule/app-photo-lightbox-svelte
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Svelte fullscreen photo viewer.
|
|
12
|
+
|
|
13
|
+
Exports `PhotoLightbox` (modal overlay with prev/next arrows, keyboard
|
|
14
|
+
navigation via ArrowLeft / ArrowRight / Escape, backdrop-click close,
|
|
15
|
+
optional captions, and an "N / total" counter) and the `LightboxPhoto`
|
|
16
|
+
type — the Svelte counterpart of `@molecule/app-photo-lightbox-react`, with
|
|
17
|
+
the same props (React names) and the same DOM for the same input.
|
|
18
|
+
|
|
19
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
20
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
21
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```svelte
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { PhotoLightbox, type LightboxPhoto } from '@molecule/app-photo-lightbox-svelte'
|
|
28
|
+
|
|
29
|
+
const photos: LightboxPhoto[] = [
|
|
30
|
+
{ src: '/images/photo1.jpg', alt: 'Mountain view', caption: 'Summit at dawn' },
|
|
31
|
+
{ src: '/images/photo2.jpg', alt: 'Valley below' },
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
let open = $state(false)
|
|
35
|
+
let index = $state(0)
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<PhotoLightbox
|
|
39
|
+
{photos}
|
|
40
|
+
{open}
|
|
41
|
+
onClose={() => (open = false)}
|
|
42
|
+
{index}
|
|
43
|
+
onIndexChange={(next) => (index = next)}
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Type
|
|
48
|
+
|
|
49
|
+
`feature`
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install @molecule/app-photo-lightbox-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
### Interfaces
|
|
4
60
|
|
|
61
|
+
#### `LightboxPhoto`
|
|
62
|
+
|
|
63
|
+
A single photo entry for the lightbox, with src, optional alt text, and
|
|
64
|
+
optional caption (a snippet or plain text).
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
interface LightboxPhoto {
|
|
68
|
+
/** Image URL. */
|
|
69
|
+
src: string
|
|
70
|
+
/** Alternative text (also the dialog's accessible label when present). */
|
|
71
|
+
alt?: string
|
|
72
|
+
/** Optional caption rendered under the image. */
|
|
73
|
+
caption?: Snippet | string
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### `PhotoLightboxProps`
|
|
78
|
+
|
|
79
|
+
Props accepted by the {@link PhotoLightbox} component (React's names).
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
interface PhotoLightboxProps {
|
|
83
|
+
/** Photos to browse. */
|
|
84
|
+
photos: LightboxPhoto[]
|
|
85
|
+
/** Whether the lightbox is open. */
|
|
86
|
+
open: boolean
|
|
87
|
+
/** Called when the user closes (close button, backdrop, Escape). */
|
|
88
|
+
onClose: () => void
|
|
89
|
+
/** Initial active index. Defaults to `0`. */
|
|
90
|
+
initialIndex?: number
|
|
91
|
+
/** Called whenever the active index changes (arrows, keyboard). */
|
|
92
|
+
onIndexChange?: (index: number) => void
|
|
93
|
+
}
|
|
5
94
|
```
|
|
6
|
-
|
|
95
|
+
|
|
96
|
+
### Constants
|
|
97
|
+
|
|
98
|
+
#### `PhotoLightbox`
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
const PhotoLightbox: LegacyComponentType
|
|
7
102
|
```
|
|
8
103
|
|
|
9
|
-
|
|
104
|
+
## Injection Notes
|
|
105
|
+
|
|
106
|
+
### Requirements
|
|
107
|
+
|
|
108
|
+
Peer dependencies:
|
|
109
|
+
|
|
110
|
+
- `@molecule/app-svelte` ^3.5.0
|
|
111
|
+
- `@molecule/app-ui` ^1.4.0
|
|
112
|
+
- `@molecule/app-ui-svelte` ^1.1.0
|
|
113
|
+
- `svelte` ^5.0.0
|
|
114
|
+
|
|
115
|
+
### Runtime Dependencies
|
|
116
|
+
|
|
117
|
+
- `@molecule/app-svelte`
|
|
118
|
+
- `@molecule/app-ui`
|
|
119
|
+
- `@molecule/app-ui-svelte`
|
|
120
|
+
- `svelte`
|
|
121
|
+
|
|
122
|
+
Companion locale bond: `@molecule/app-locales-photo-lightbox` (keys
|
|
123
|
+
`lightbox.close` / `lightbox.previous` / `lightbox.next`). The overlay is
|
|
124
|
+
`position: fixed` at `z-index: 100` with a near-black backdrop in both
|
|
125
|
+
themes; it does NOT lock body scroll while open. Requires the app-svelte i18n
|
|
126
|
+
provider and a wired ClassMap bond.
|
|
127
|
+
|
|
128
|
+
## Translations
|
|
10
129
|
|
|
11
|
-
|
|
130
|
+
Translation strings are provided by `@molecule/app-locales-photo-lightbox`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-photo-lightbox-svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Fullscreen photo viewer with prev/next arrows, keyboard nav, close",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-photo-lightbox-svelte",
|
|
6
6
|
"type": "module",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
58
58
|
"@molecule/app-i18n": "1.2.2",
|
|
59
59
|
"@molecule/app-icons": "1.0.4",
|
|
60
|
-
"@molecule/app-svelte": "3.
|
|
61
|
-
"@molecule/app-ui": "1.
|
|
62
|
-
"@molecule/app-ui-svelte": "1.1
|
|
60
|
+
"@molecule/app-svelte": "3.9.0",
|
|
61
|
+
"@molecule/app-ui": "1.5.0",
|
|
62
|
+
"@molecule/app-ui-svelte": "1.2.1",
|
|
63
63
|
"@sveltejs/package": "3.0.2",
|
|
64
64
|
"@sveltejs/vite-plugin-svelte": "7.1.2",
|
|
65
65
|
"@types/node": "26.6.5",
|