@g9tm/lynxcontrols-media 2.3.0 → 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.
@@ -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} />`