@g9tm/lynxcontrols-media 2.2.1 → 2.4.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 CHANGED
@@ -14,7 +14,8 @@ import { G9DropZone, G9Lightbox, G9MediaGrid } from '@g9tm/lynxcontrols-media';
14
14
  | --- | --- |
15
15
  | **`G9BlurhashView`** | The blurhash of a photo until the photo decodes. It is drawn as a tiny BMP that the image scales with bilinear filtering: the soft blur a blurhash is meant to be, cheaper than SVG cells. |
16
16
  | **`G9MediaGrid`** | One to four tiles (and «+k» on the fourth) in a post or a message; a tap opens the photo. |
17
- | **`G9Lightbox`** | The photos full screen on black on Lynx's native `<viewpager>` (one photo per swipe), with the position and a close button. It opens in the host's popups layer above the tab bar, the system back closes it, and automation sees it as covering the page. |
17
+ | **`G9Lightbox`** | The photos full screen on black, paged by `G9MediaPager` (one photo per swipe, RTL mirrored), with the position and a close button. It opens in the host's popups layer above the tab bar, the system back closes it, and automation sees it as covering the page. |
18
+ | **`G9MediaPager`** | The lightbox's pages on their own: one photo per swipe, fitted, in reading order (mirrored in RTL: a viewpager lays pages out left to right). For a page or sheet that brings its own title, actions or route. |
18
19
  | **`G9ImageCropper`** | Drag to place a photo in a frame (round for an avatar), − zoom + to scale (a pinch where the host reports it); reports the crop in image pixels. |
19
20
  | **`G9VoicePlayer`** | A voice note: play / pause, the waveform with the played part filled, the time. |
20
21
  | **`G9DropZone`** | A tappable area that opens the system chooser on a phone. Around content it is the target of files dropped on the window (a host that emits `g9:drag` / `g9:drop`), with a dashed cover while they are dragged over. Without the optional `files` capability (`G9FilePicker`) it shows disabled. |
@@ -0,0 +1,15 @@
1
+ # G9BlurhashView
2
+
3
+ `import { G9BlurhashView } from '@g9tm/lynxcontrols-media';`
4
+
5
+ A blurhash placeholder under a photo that fades in on load (one SVG built per hash).
6
+
7
+ Props:
8
+ - `hash`: string
9
+ - `height`: string | number
10
+ - `width`: string | number
11
+ - `radius?`: number
12
+ - `mode?`: 'aspectFill' | 'aspectFit'
13
+ - `src?`: string
14
+
15
+ Example: `<G9BlurhashView hash="hash" height={height} width={width} />`
@@ -0,0 +1,17 @@
1
+ # G9DropZone
2
+
3
+ `import { G9DropZone } from '@g9tm/lynxcontrols-media';`
4
+
5
+ Two uses: `<G9DropZone label onFiles />` is a tappable area that opens the chooser (the way in on a phone); `<G9DropZone label onFiles>{thread}</G9DropZone>` makes the content the target of files dropped on the window, w
6
+
7
+ Props:
8
+ - `label`: string
9
+ - `onFiles`: (files: readonly G9FileRef[]) => void
10
+ - `children?`: ReactNode
11
+ - `disabled?`: boolean
12
+ - `hint?`: string
13
+ - `accept?`: string
14
+ - `multiple?`: boolean = true
15
+ - `tapToPick?`: boolean
16
+
17
+ Example: `<G9DropZone label="Label" onFiles={() => {}} />`
@@ -0,0 +1,15 @@
1
+ # G9ImageCropper
2
+
3
+ `import { G9ImageCropper } from '@g9tm/lynxcontrols-media';`
4
+
5
+ Drag to place, − zoom + to scale (a pinch where the host reports it); the crop rectangle in image pixels comes out.
6
+
7
+ Props:
8
+ - `frame`: object
9
+ - `image`: object
10
+ - `src`: string
11
+ - `onChange?`: (crop: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }, state: G9CropState) => void
12
+ - `maxZoom?`: number
13
+ - `round?`: boolean
14
+
15
+ Example: `<G9ImageCropper frame={frame} image={image} src="src" />`
@@ -0,0 +1,16 @@
1
+ # G9Lightbox
2
+
3
+ `import { G9Lightbox } from '@g9tm/lynxcontrols-media';`
4
+
5
+ The photos full screen on black: swipe between them (Lynx's native `<viewpager>`, snapping), the position «۲ / ۵», a close button; fades in with opacity only.
6
+
7
+ Props:
8
+ - `index`: number
9
+ - `items`: object[]
10
+ - `onClose`: () => void
11
+ - `open`: boolean
12
+ - `onIndexChange?`: (index: number) => void
13
+ - `closeLabel?`: string
14
+ - `actions?`: ReactNode
15
+
16
+ Example: `<G9Lightbox index={1} items={items} onClose={() => {}} open />`
@@ -0,0 +1,15 @@
1
+ # G9MediaGrid
2
+
3
+ `import { G9MediaGrid } from '@g9tm/lynxcontrols-media';`
4
+
5
+ 1–4 tiles (and «+k» on the fourth) in a chat or feed post; a tap opens the photo.
6
+
7
+ Props:
8
+ - `items`: object[]
9
+ - `width`: number
10
+ - `onOpen?`: (index: number) => void
11
+ - `radius?`: number
12
+ - `gap?`: number
13
+ - `height?`: number
14
+
15
+ Example: `<G9MediaGrid items={items} width={1} />`
@@ -0,0 +1,12 @@
1
+ # G9MediaPager
2
+
3
+ `import { G9MediaPager } from '@g9tm/lynxcontrols-media';`
4
+
5
+ Pictures one per page, swiped (Lynx's native `<viewpager>`, snapping), each fitted on the page.
6
+
7
+ Props:
8
+ - `index`: number
9
+ - `items`: object[]
10
+ - `onIndexChange?`: (index: number) => void
11
+
12
+ Example: `<G9MediaPager index={1} items={items} />`
@@ -0,0 +1,17 @@
1
+ # G9VoicePlayer
2
+
3
+ `import { G9VoicePlayer } from '@g9tm/lynxcontrols-media';`
4
+
5
+ A voice note: play/pause, the waveform filling as it plays, the time left.
6
+
7
+ Props:
8
+ - `duration`: number
9
+ - `onToggle`: () => void
10
+ - `playing`: boolean
11
+ - `position`: number
12
+ - `onSeek?`: (fraction: number) => void
13
+ - `pauseLabel?`: string
14
+ - `playLabel?`: string
15
+ - `bars?`: number
16
+
17
+ Example: `<G9VoicePlayer duration={1} onToggle={() => {}} playing position={1} />`