react-native-webrtc-kaleidoscope 2.7.12 → 2.8.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 +1 -1
- package/android/build.gradle +35 -18
- package/android/src/main/java/com/simiancraft/kaleidoscope/effects/CompositeFactory.kt +9 -7
- package/android/src/main/java/com/simiancraft/kaleidoscope/effects/TransformFactory.kt +9 -7
- package/android/src/main/webrtc/prefixed/com/simiancraft/kaleidoscope/webrtc/WebRtc.kt +13 -0
- package/android/src/main/webrtc/unprefixed/com/simiancraft/kaleidoscope/webrtc/WebRtc.kt +13 -0
- package/catalog/images/README.md +1 -1
- package/dist/catalog/composites/clouds/clouds.controls.d.ts +1 -1
- package/dist/catalog/composites/clouds/clouds.controls.d.ts.map +1 -1
- package/dist/catalog/composites/corporate-blobs/corporate-blobs.controls.d.ts +1 -1
- package/dist/catalog/composites/corporate-blobs/corporate-blobs.controls.d.ts.map +1 -1
- package/dist/catalog/composites/fairy-cave/fairy-cave.controls.d.ts +1 -1
- package/dist/catalog/composites/fairy-cave/fairy-cave.controls.d.ts.map +1 -1
- package/dist/catalog/composites/fairy-grotto/fairy-grotto.controls.d.ts +1 -1
- package/dist/catalog/composites/fairy-grotto/fairy-grotto.controls.d.ts.map +1 -1
- package/dist/catalog/composites/fairy-hollow/fairy-hollow.controls.d.ts +1 -1
- package/dist/catalog/composites/fairy-hollow/fairy-hollow.controls.d.ts.map +1 -1
- package/dist/catalog/composites/nebula/nebula.controls.d.ts +1 -1
- package/dist/catalog/composites/nebula/nebula.controls.d.ts.map +1 -1
- package/dist/catalog/composites/observation-deck/observation-deck.controls.d.ts +1 -1
- package/dist/catalog/composites/observation-deck/observation-deck.controls.d.ts.map +1 -1
- package/dist/catalog/composites/simianlights/simianlights.controls.d.ts +1 -1
- package/dist/catalog/composites/simianlights/simianlights.controls.d.ts.map +1 -1
- package/dist/catalog/composites/underwater/underwater.controls.d.ts +1 -1
- package/dist/catalog/composites/underwater/underwater.controls.d.ts.map +1 -1
- package/dist/catalog/composites/wizard-tower/wizard-tower.controls.d.ts +1 -1
- package/dist/catalog/composites/wizard-tower/wizard-tower.controls.d.ts.map +1 -1
- package/dist/catalog/composites/wizard-tower-night/wizard-tower-night.controls.d.ts +1 -1
- package/dist/catalog/composites/wizard-tower-night/wizard-tower-night.controls.d.ts.map +1 -1
- package/dist/catalog/shaders/anamorphic-lensflare/anamorphic-lensflare.form.d.ts +1 -1
- package/dist/catalog/shaders/anamorphic-lensflare/anamorphic-lensflare.form.d.ts.map +1 -1
- package/dist/catalog/shaders/aurora-silk/aurora-silk.form.d.ts +1 -1
- package/dist/catalog/shaders/aurora-silk/aurora-silk.form.d.ts.map +1 -1
- package/dist/catalog/shaders/blur/blur.form.d.ts +1 -1
- package/dist/catalog/shaders/blur/blur.form.d.ts.map +1 -1
- package/dist/catalog/shaders/clouds/clouds.form.d.ts +1 -1
- package/dist/catalog/shaders/clouds/clouds.form.d.ts.map +1 -1
- package/dist/catalog/shaders/corporate-blobs/corporate-blobs.form.d.ts +1 -1
- package/dist/catalog/shaders/corporate-blobs/corporate-blobs.form.d.ts.map +1 -1
- package/dist/catalog/shaders/data-mesh/data-mesh.form.d.ts +1 -1
- package/dist/catalog/shaders/data-mesh/data-mesh.form.d.ts.map +1 -1
- package/dist/catalog/shaders/fireflies/fireflies.form.d.ts +1 -1
- package/dist/catalog/shaders/fireflies/fireflies.form.d.ts.map +1 -1
- package/dist/catalog/shaders/godrays/godrays.form.d.ts +1 -1
- package/dist/catalog/shaders/godrays/godrays.form.d.ts.map +1 -1
- package/dist/catalog/shaders/halftone-waves/halftone-waves.form.d.ts +1 -1
- package/dist/catalog/shaders/halftone-waves/halftone-waves.form.d.ts.map +1 -1
- package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.d.ts +1 -1
- package/dist/catalog/shaders/kaleidoscope/kaleidoscope.form.d.ts.map +1 -1
- package/dist/catalog/shaders/light-beams-and-motes/light-beams-and-motes.form.d.ts +1 -1
- package/dist/catalog/shaders/light-beams-and-motes/light-beams-and-motes.form.d.ts.map +1 -1
- package/dist/catalog/shaders/nebula/nebula.form.d.ts +1 -1
- package/dist/catalog/shaders/nebula/nebula.form.d.ts.map +1 -1
- package/dist/catalog/shaders/neo-memphis/neo-memphis.form.d.ts +1 -1
- package/dist/catalog/shaders/neo-memphis/neo-memphis.form.d.ts.map +1 -1
- package/dist/catalog/shaders/outrun-grid/outrun-grid.form.d.ts +1 -1
- package/dist/catalog/shaders/outrun-grid/outrun-grid.form.d.ts.map +1 -1
- package/dist/catalog/shaders/plasma/plasma.form.d.ts +1 -1
- package/dist/catalog/shaders/plasma/plasma.form.d.ts.map +1 -1
- package/dist/catalog/shaders/simianlights/simianlights.form.d.ts +1 -1
- package/dist/catalog/shaders/simianlights/simianlights.form.d.ts.map +1 -1
- package/dist/src/components/form/control-form.d.ts +1 -1
- package/dist/src/components/form/control-form.d.ts.map +1 -1
- package/dist/src/components/preset-book-menu/index.d.ts +1 -1
- package/dist/src/components/preset-book-menu/index.d.ts.map +1 -1
- package/dist/src/components/preset-book-menu/index.js +3 -4
- package/dist/src/components/preset-book-menu/index.js.map +1 -1
- package/dist/src/components/preset-book-menu/layout.d.ts +1 -1
- package/dist/src/components/preset-book-menu/layout.d.ts.map +1 -1
- package/dist/src/components/preset-book-menu/preset-grid.d.ts +1 -1
- package/dist/src/components/preset-book-menu/preset-grid.d.ts.map +1 -1
- package/dist/src/components/preset-book-menu/thumbnail-source.d.ts +2 -0
- package/dist/src/components/preset-book-menu/thumbnail-source.d.ts.map +1 -0
- package/dist/src/components/preset-book-menu/thumbnail-source.js +19 -0
- package/dist/src/components/preset-book-menu/thumbnail-source.js.map +1 -0
- package/dist/src/components/preset-control-panel/composite-layer-control-panel.d.ts +1 -1
- package/dist/src/components/preset-control-panel/composite-layer-control-panel.d.ts.map +1 -1
- package/dist/src/components/preset-control-panel/control-section.d.ts +1 -1
- package/dist/src/components/preset-control-panel/control-section.d.ts.map +1 -1
- package/dist/src/components/preset-control-panel/mask-control-panel.d.ts +1 -1
- package/dist/src/components/preset-control-panel/mask-control-panel.d.ts.map +1 -1
- package/dist/src/components/preset-control-panel/transform-control-panel.d.ts +1 -1
- package/dist/src/components/preset-control-panel/transform-control-panel.d.ts.map +1 -1
- package/dist/src/components/preset-control-panel/transform-control-panel.js +2 -2
- package/dist/src/components/preset-control-panel/transform-control-panel.js.map +1 -1
- package/dist/src/components/preset-tile/index.d.ts +1 -1
- package/dist/src/components/preset-tile/index.d.ts.map +1 -1
- package/dist/src/components/preset-tile/index.js +7 -5
- package/dist/src/components/preset-tile/index.js.map +1 -1
- package/dist/src/components/theme/provider.d.ts +1 -1
- package/dist/src/components/theme/provider.d.ts.map +1 -1
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/color-picker.d.ts +1 -1
- package/dist/src/components/ui/color-picker.d.ts.map +1 -1
- package/dist/src/components/ui/label.d.ts +1 -1
- package/dist/src/components/ui/label.d.ts.map +1 -1
- package/dist/src/components/ui/point.d.ts +1 -1
- package/dist/src/components/ui/point.d.ts.map +1 -1
- package/dist/src/components/ui/polygon-field.d.ts +1 -1
- package/dist/src/components/ui/polygon-field.d.ts.map +1 -1
- package/dist/src/components/ui/readout.d.ts +1 -1
- package/dist/src/components/ui/readout.d.ts.map +1 -1
- package/dist/src/components/ui/slider.d.ts +1 -1
- package/dist/src/components/ui/slider.d.ts.map +1 -1
- package/dist/src/components/ui/switch.d.ts +1 -1
- package/dist/src/components/ui/switch.d.ts.map +1 -1
- package/ios/Kaleidoscope.podspec +16 -9
- package/ios/KaleidoscopeModule/Registration.swift +8 -3
- package/ios/KaleidoscopeModule/WebRTCTypes.swift +15 -0
- package/ios/KaleidoscopeModule/effects/CompositeProcessor.swift +5 -1
- package/ios/KaleidoscopeModule/effects/FrameBridge.swift +5 -1
- package/ios/KaleidoscopeModule/effects/TransformProcessor.swift +5 -1
- package/llms.txt +5 -5
- package/package.json +8 -7
- package/plugin/build/lib/preset-book.js +1 -1
- package/src/components/preset-book-menu/index.tsx +3 -4
- package/src/components/preset-book-menu/thumbnail-source.ts +16 -0
- package/src/components/preset-control-panel/transform-control-panel.tsx +3 -1
- package/src/components/preset-tile/index.tsx +8 -4
package/ios/Kaleidoscope.podspec
CHANGED
|
@@ -71,9 +71,10 @@ Pod::Spec.new do |s|
|
|
|
71
71
|
s.dependency 'MediaPipeTasksVision', '0.10.14'
|
|
72
72
|
|
|
73
73
|
# Fork-resolving dependency on react-native-webrtc. The Kaleidoscope target
|
|
74
|
-
# needs FRAMEWORK_SEARCH_PATHS pointing at
|
|
75
|
-
#
|
|
76
|
-
#
|
|
74
|
+
# needs FRAMEWORK_SEARCH_PATHS pointing at the fork's WebRTC framework
|
|
75
|
+
# (WebRTC.framework, or LiveKitWebRTC.framework from @livekit/react-native-webrtc
|
|
76
|
+
# 144.2.0 on) so the Swift WebRTC import in Registration.swift, FrameBridge.swift,
|
|
77
|
+
# and the Processor files resolves at compile time. We do not declare the framework
|
|
77
78
|
# directly (it is not OS-shipped, so `s.weak_framework` is wrong; and it is
|
|
78
79
|
# vended by two different forks at two different paths). Instead we depend
|
|
79
80
|
# on whichever rn-webrtc fork the consumer installed, and CocoaPods
|
|
@@ -95,12 +96,18 @@ Pod::Spec.new do |s|
|
|
|
95
96
|
# via a podspec dependency edge. The two declarations of the same pod merge
|
|
96
97
|
# in CocoaPods' dependency graph.
|
|
97
98
|
#
|
|
98
|
-
# `__dir__`
|
|
99
|
-
#
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
# Probe two places for the LiveKit fork. `__dir__` is normally
|
|
100
|
+
# `<consumer>/node_modules/react-native-webrtc-kaleidoscope/ios/`, so
|
|
101
|
+
# `../../@livekit/react-native-webrtc` is its sibling in node_modules. When the
|
|
102
|
+
# library is symlinked (a `file:` dependency, pnpm), `__dir__` is the link's
|
|
103
|
+
# real path and that sibling does not exist, so also check the app's own
|
|
104
|
+
# node_modules beside the Podfile's directory, which is where the config
|
|
105
|
+
# plugin's resolveWebrtcPod looks.
|
|
106
|
+
livekit_fork_paths = [File.expand_path('../../@livekit/react-native-webrtc', __dir__)]
|
|
107
|
+
if defined?(Pod::Config)
|
|
108
|
+
livekit_fork_paths << File.expand_path('../node_modules/@livekit/react-native-webrtc', Pod::Config.instance.installation_root.to_s)
|
|
109
|
+
end
|
|
110
|
+
if livekit_fork_paths.any? { |path| File.directory?(path) }
|
|
104
111
|
s.dependency 'livekit-react-native-webrtc'
|
|
105
112
|
else
|
|
106
113
|
s.dependency 'react-native-webrtc'
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// - one "composite" compositor (CompositeProcessor): EVERY art effect (images,
|
|
16
16
|
// blur, generative shaders, masked subjects) is now a LAYER inside a
|
|
17
17
|
// composite, delivered out-of-band via setCompositeLayers (CompositeLayers) and
|
|
18
|
-
// composited per frame. The per-effect art processors (
|
|
18
|
+
// composited per frame. The per-effect art processors (one per bundled image,
|
|
19
19
|
// the bare generative names, blur) and their data-driven registration are
|
|
20
20
|
// gone; adding a preset is pure JS (a new Composite in the book), no Swift
|
|
21
21
|
// change and no native registration. Mirrors android/.../Registration.kt
|
|
@@ -29,11 +29,16 @@
|
|
|
29
29
|
// - react-native-webrtc/react-native-webrtc -> module `react_native_webrtc`
|
|
30
30
|
// - livekit/react-native-webrtc (@livekit/react-native) -> `livekit_react_native_webrtc`
|
|
31
31
|
// We import whichever is present; the symbols are identical either way. WebRTC
|
|
32
|
-
// types (RTCVideoFrame etc.) come from WebRTC.framework
|
|
32
|
+
// types (RTCVideoFrame etc.) come from WebRTC.framework, or from LiveKitWebRTC
|
|
33
|
+
// through the aliases in WebRTCTypes.swift.
|
|
33
34
|
|
|
34
35
|
import Foundation
|
|
35
36
|
import os.log
|
|
36
|
-
|
|
37
|
+
#if canImport(LiveKitWebRTC)
|
|
38
|
+
import LiveKitWebRTC
|
|
39
|
+
#else
|
|
40
|
+
import WebRTC
|
|
41
|
+
#endif
|
|
37
42
|
#if canImport(livekit_react_native_webrtc)
|
|
38
43
|
import livekit_react_native_webrtc
|
|
39
44
|
#elseif canImport(react_native_webrtc)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The WebRTC types the effects use, resolved against whichever WebRTC framework
|
|
2
|
+
// the consumer's react-native-webrtc links.
|
|
3
|
+
//
|
|
4
|
+
// @livekit/react-native-webrtc 144.2.0 and later link LiveKitWebRTC, LiveKit's
|
|
5
|
+
// prefixed build: the module is renamed and every Objective-C class gains an LK
|
|
6
|
+
// prefix (LKRTCVideoFrame). These aliases restore the unprefixed names, so the
|
|
7
|
+
// effect code reads the same against either framework. Upstream
|
|
8
|
+
// react-native-webrtc and earlier LiveKit releases link WebRTC, unprefixed.
|
|
9
|
+
#if canImport(LiveKitWebRTC)
|
|
10
|
+
import LiveKitWebRTC
|
|
11
|
+
|
|
12
|
+
public typealias RTCCVPixelBuffer = LKRTCCVPixelBuffer
|
|
13
|
+
public typealias RTCVideoCapturer = LKRTCVideoCapturer
|
|
14
|
+
public typealias RTCVideoFrame = LKRTCVideoFrame
|
|
15
|
+
#endif
|
|
@@ -48,7 +48,11 @@ import MetalKit
|
|
|
48
48
|
import os.log
|
|
49
49
|
import QuartzCore
|
|
50
50
|
import simd
|
|
51
|
-
|
|
51
|
+
#if canImport(LiveKitWebRTC)
|
|
52
|
+
import LiveKitWebRTC
|
|
53
|
+
#else
|
|
54
|
+
import WebRTC
|
|
55
|
+
#endif
|
|
52
56
|
#if canImport(livekit_react_native_webrtc)
|
|
53
57
|
import livekit_react_native_webrtc
|
|
54
58
|
#elseif canImport(react_native_webrtc)
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
import CoreVideo
|
|
16
16
|
import Foundation
|
|
17
|
-
|
|
17
|
+
#if canImport(LiveKitWebRTC)
|
|
18
|
+
import LiveKitWebRTC
|
|
19
|
+
#else
|
|
20
|
+
import WebRTC
|
|
21
|
+
#endif
|
|
18
22
|
|
|
19
23
|
enum FrameBridge {
|
|
20
24
|
/// Extract the input CVPixelBuffer from a camera RTCVideoFrame, or nil if
|
|
@@ -32,7 +32,11 @@ import Foundation
|
|
|
32
32
|
import Metal
|
|
33
33
|
import os.log
|
|
34
34
|
import simd
|
|
35
|
-
|
|
35
|
+
#if canImport(LiveKitWebRTC)
|
|
36
|
+
import LiveKitWebRTC
|
|
37
|
+
#else
|
|
38
|
+
import WebRTC
|
|
39
|
+
#endif
|
|
36
40
|
|
|
37
41
|
// Import whichever react-native-webrtc fork is present; both expose the same
|
|
38
42
|
// VideoFrameProcessorDelegate / ProcessorProvider symbols. See Registration.swift.
|
package/llms.txt
CHANGED
|
@@ -82,7 +82,7 @@ The plugin statically analyzes ONE file to decide which image assets ship in you
|
|
|
82
82
|
|
|
83
83
|
1. **Exact filename, exact location:** `kaleidoscope.preset-book.ts` at the **project root** (the directory containing `package.json` and your app config). A book named or placed differently still typechecks and still works on web, but at prebuild NO assets are copied and every image background silently renders nothing on native. This is the most common integration mistake; the failure is silent.
|
|
84
84
|
2. **The book is parsed as text, never executed.** Keep every `image` layer's `source` statically analyzable: a single named import from `react-native-webrtc-kaleidoscope/images/<category>/<leaf>`, a `require('./local.webp')` literal, or a `const X = Asset.fromModule(require('./local.webp')).uri` binding (the binding may span lines; a formatter wrapping it at a narrow print width is fine). Do not compute sources, build layers in helper functions, or re-export the book through a barrel; the parser will not follow them, and each skipped `image` layer warns at prebuild naming the layer id.
|
|
85
|
-
3. **An `image` layer's `id` doubles as its native
|
|
85
|
+
3. **An `image` layer's `id` doubles as its native image id**: keep it equal to the image file's basename (`office-dark`, `my-bg`). Your own background images must be `.webp` (native resolves `assets/images/<id>.webp`).
|
|
86
86
|
4. **Re-run `bunx expo prebuild` after editing the book** (adding/deleting presets changes the native asset set). JS-only uniform tweaks hot-reload without it.
|
|
87
87
|
|
|
88
88
|
## Starting fileset (six files that run)
|
|
@@ -93,7 +93,7 @@ These are trimmed copies of the demo's working files (`demo/kaleidoscope.preset-
|
|
|
93
93
|
|
|
94
94
|
```ts
|
|
95
95
|
import type { KaleidoscopePresetBook } from 'react-native-webrtc-kaleidoscope';
|
|
96
|
-
// Packaged multi-layer
|
|
96
|
+
// Packaged multi-layer composites. Each carries its own taxonomy and thumbnail;
|
|
97
97
|
// delete the import + the entry to opt out of one.
|
|
98
98
|
import { clouds } from 'react-native-webrtc-kaleidoscope/composites/clouds';
|
|
99
99
|
import { corporateBlobs } from 'react-native-webrtc-kaleidoscope/composites/corporate-blobs';
|
|
@@ -150,7 +150,7 @@ export const presets = {
|
|
|
150
150
|
],
|
|
151
151
|
},
|
|
152
152
|
|
|
153
|
-
// --- Worlds: packaged
|
|
153
|
+
// --- Worlds: packaged composites, spread in as-is. One line each; delete freely. ---
|
|
154
154
|
'wizard-tower': wizardTower,
|
|
155
155
|
'wizard-tower-night': wizardTowerNight,
|
|
156
156
|
'observation-deck': observationDeck,
|
|
@@ -530,7 +530,7 @@ Each preset supplies its editor as a `controls` component on the book entry: pac
|
|
|
530
530
|
|
|
531
531
|
## Bundled assets you can reference
|
|
532
532
|
|
|
533
|
-
- **Packaged composites** (multi-layer
|
|
533
|
+
- **Packaged composites** (multi-layer stacks), each behind `react-native-webrtc-kaleidoscope/composites/<name>`: `wizard-tower`, `wizard-tower-night`, `observation-deck`, `fairy-cave`, `fairy-grotto`, `fairy-hollow`, `underwater`, `nebula`, `simianlights`, `corporate-blobs`, `clouds`. Import the export and spread it into your book.
|
|
534
534
|
- **Background images**, each behind `react-native-webrtc-kaleidoscope/images/<category>/<leaf>`: `office/office-dark`, `office/office-light`, `home/home-dark`, `home/home-light`, `nature/landscape-dark`, `nature/landscape-light`, `sci-fi/sci-fi-light`, `underwater/oceanscape-dark`, `simiancraft/simiancraft-light`, `simiancraft/simiancraft-dark`, `simiancraft/simiancraft-light-transparency`, `simiancraft/simiancraft-dark-transparency`, `corporate/corporate-logo`, `fairy-caves/grotto`, `fairy-caves/hollow`, `fairy-caves/treehouse`, `fairy-caves/treehouse-2`, `fairy-caves/treehouse-3`, `spaceship/observation-deck`, `wizard-tower/wizard-tower-1`, `wizard-tower/wizard-tower-2`, `wizard-tower/wizard-tower-night`, plus `debug/debug-resolutions` (a viewport calibration grid for verifying cover-fit). On web an image `source` can also be any image URL or data URI; native resolves bundled image ids only.
|
|
535
535
|
|
|
536
536
|
## Web vs native differences
|
|
@@ -543,7 +543,7 @@ Each preset supplies its editor as a `controls` component on the book entry: pac
|
|
|
543
543
|
|
|
544
544
|
## LiveKit
|
|
545
545
|
|
|
546
|
-
`@livekit/react-native` pulls in `@livekit/react-native-webrtc`, a fork that preserves the same `videoEffects` native classes; kaleidoscope works against either fork (pick one, never both). On native, bind to the local track's underlying `MediaStreamTrack`:
|
|
546
|
+
`@livekit/react-native` pulls in `@livekit/react-native-webrtc`, a fork that preserves the same `videoEffects` native classes; kaleidoscope works against either fork (pick one, never both), including LiveKit's prefixed WebRTC build in `@livekit/react-native-webrtc` 144.2.0 and later, detected at build time. On native, bind to the local track's underlying `MediaStreamTrack`:
|
|
547
547
|
|
|
548
548
|
```ts
|
|
549
549
|
const { kaleidoscope } = bindKaleidoscope(localCameraTrack.mediaStreamTrack, { presets });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-webrtc-kaleidoscope",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "Live video effects (blur, background replacement, generative backgrounds, flip/rotate) for react-native-webrtc, packaged as a managed-Expo-friendly Expo Module. Working on web, Android, and iOS. Active development.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -635,25 +635,26 @@
|
|
|
635
635
|
},
|
|
636
636
|
"devDependencies": {
|
|
637
637
|
"@biomejs/biome": "^2.5.14",
|
|
638
|
-
"@expo/config-plugins": "~
|
|
638
|
+
"@expo/config-plugins": "~57.0.10",
|
|
639
639
|
"@react-native-async-storage/async-storage": "1.24.0",
|
|
640
640
|
"@react-native-community/slider": "5.2.1",
|
|
641
641
|
"@semantic-release/changelog": "^7.0.0",
|
|
642
642
|
"@semantic-release/git": "^11.0.1",
|
|
643
643
|
"@semantic-release/npm": "^13.1.5",
|
|
644
644
|
"@types/bun": "^1.4.2",
|
|
645
|
-
"@types/react": "~
|
|
645
|
+
"@types/react": "~19.2.10",
|
|
646
646
|
"eslint": "^10.11.0",
|
|
647
|
-
"expo": "^
|
|
648
|
-
"expo-
|
|
647
|
+
"expo": "^57.0.28",
|
|
648
|
+
"expo-asset": "~57.0.19",
|
|
649
|
+
"expo-modules-core": "~57.0.22",
|
|
649
650
|
"knip": "^6.37.0",
|
|
650
651
|
"lefthook": "^2.1.14",
|
|
651
652
|
"livekit-client": "^2.22.3",
|
|
652
653
|
"nativewind": "4.2.x",
|
|
653
654
|
"playwright": "1.63.0",
|
|
654
655
|
"publint": "^0.3.24",
|
|
655
|
-
"react": "
|
|
656
|
-
"react-native": "0.
|
|
656
|
+
"react": "19.2.3",
|
|
657
|
+
"react-native": "0.86.3",
|
|
657
658
|
"react-native-webrtc": "^124.0.8",
|
|
658
659
|
"semantic-release": "^25.0.9",
|
|
659
660
|
"typescript": "^7.0.2"
|
|
@@ -93,7 +93,7 @@ function parseImageRefs(source) {
|
|
|
93
93
|
const sourceM = body.match(/source\s*:\s*(require\(\s*['"][^'"]+['"]\s*\)|[A-Za-z0-9_$]+)/);
|
|
94
94
|
const expr = sourceM?.[1];
|
|
95
95
|
// The warn-never-throw contract: a layer the parse cannot follow is skipped
|
|
96
|
-
// LOUDLY, naming the layer, so the missing
|
|
96
|
+
// LOUDLY, naming the layer, so the missing image surfaces at prebuild
|
|
97
97
|
// instead of on-device.
|
|
98
98
|
if (!expr) {
|
|
99
99
|
console.warn(
|
|
@@ -12,6 +12,7 @@ import { categoryTestId, familyTestId } from '../../lib/test-id';
|
|
|
12
12
|
import { PresetBookMenuLayout } from './layout';
|
|
13
13
|
import type { Category, Family, PresetBookMenuProps, PresetView } from './preset-book-menu.types';
|
|
14
14
|
import { PresetGrid } from './preset-grid';
|
|
15
|
+
import { thumbnailSource } from './thumbnail-source';
|
|
15
16
|
|
|
16
17
|
/** The grouping usePresetBookMenu returns; named so BYO-layout consumers can type it. */
|
|
17
18
|
export interface PresetBookMenuModel {
|
|
@@ -148,10 +149,7 @@ export function usePresetBookMenu<P extends KaleidoscopePresetBook>(
|
|
|
148
149
|
label: labelFor?.(id as keyof P & string) ?? preset.name,
|
|
149
150
|
family,
|
|
150
151
|
category,
|
|
151
|
-
source:
|
|
152
|
-
typeof preset.thumbnail === 'string' || typeof preset.thumbnail === 'number'
|
|
153
|
-
? preset.thumbnail
|
|
154
|
-
: undefined,
|
|
152
|
+
source: thumbnailSource(preset.thumbnail),
|
|
155
153
|
};
|
|
156
154
|
if (!viewsByFamily.has(family)) {
|
|
157
155
|
families.push(family);
|
|
@@ -207,6 +205,7 @@ function Tab({ label, active, disabled, onPress, testID }: TabProps) {
|
|
|
207
205
|
<Pressable
|
|
208
206
|
accessibilityRole="tab"
|
|
209
207
|
accessibilityState={{ selected: active, disabled }}
|
|
208
|
+
aria-selected={active}
|
|
210
209
|
testID={testID}
|
|
211
210
|
disabled={disabled}
|
|
212
211
|
onPress={onPress}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Normalize a preset's `thumbnail` into the source the picker renders: a string
|
|
2
|
+
// (web URL or native preset name) or a number (a Metro asset module id). From
|
|
3
|
+
// Expo SDK 57, a web `require('./x.webp')` yields an asset object
|
|
4
|
+
// `{ uri, width, height }` rather than a URL string; its `uri` is the URL.
|
|
5
|
+
export function thumbnailSource(thumbnail: unknown): string | number | undefined {
|
|
6
|
+
if (typeof thumbnail === 'string' || typeof thumbnail === 'number') return thumbnail;
|
|
7
|
+
if (
|
|
8
|
+
thumbnail !== null &&
|
|
9
|
+
typeof thumbnail === 'object' &&
|
|
10
|
+
'uri' in thumbnail &&
|
|
11
|
+
typeof thumbnail.uri === 'string'
|
|
12
|
+
) {
|
|
13
|
+
return thumbnail.uri;
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
@@ -43,6 +43,7 @@ function FlipToggle({
|
|
|
43
43
|
accessibilityRole="switch"
|
|
44
44
|
accessibilityLabel={accessibilityLabel}
|
|
45
45
|
accessibilityState={{ checked: on, disabled }}
|
|
46
|
+
aria-checked={on}
|
|
46
47
|
testID={testID}
|
|
47
48
|
disabled={disabled}
|
|
48
49
|
onPress={onPress}
|
|
@@ -99,7 +100,8 @@ export function TransformControlPanel({
|
|
|
99
100
|
key={deg}
|
|
100
101
|
accessibilityRole="radio"
|
|
101
102
|
accessibilityLabel={deg === 0 ? 'No rotation' : `Rotate ${deg} degrees`}
|
|
102
|
-
accessibilityState={{
|
|
103
|
+
accessibilityState={{ checked: on, disabled }}
|
|
104
|
+
aria-checked={on}
|
|
103
105
|
testID={rotateTestId(testIDPrefix, deg)}
|
|
104
106
|
disabled={disabled}
|
|
105
107
|
onPress={() => onChange({ flip: { x, y }, rotate: deg })}
|
|
@@ -55,6 +55,7 @@ export function PresetTile(props: PresetTileProps) {
|
|
|
55
55
|
<Pressable
|
|
56
56
|
accessibilityRole="radio"
|
|
57
57
|
accessibilityState={{ checked: selected, disabled }}
|
|
58
|
+
aria-checked={selected}
|
|
58
59
|
testID={testID}
|
|
59
60
|
disabled={disabled}
|
|
60
61
|
onPress={onPress}
|
|
@@ -95,6 +96,9 @@ export function PresetTile(props: PresetTileProps) {
|
|
|
95
96
|
);
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
// Inline fill; StyleSheet.absoluteFillObject was removed in React Native 0.85.
|
|
100
|
+
const fill = { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 } as const;
|
|
101
|
+
|
|
98
102
|
const styles = StyleSheet.create({
|
|
99
103
|
tile: {
|
|
100
104
|
aspectRatio: 16 / 9,
|
|
@@ -130,8 +134,8 @@ const styles = StyleSheet.create({
|
|
|
130
134
|
recessed: { backgroundColor: '#242424', borderColor: '#333' },
|
|
131
135
|
selected: { borderColor: '#4a8f3f' },
|
|
132
136
|
disabled: { opacity: 0.5 },
|
|
133
|
-
thumb: { ...
|
|
134
|
-
scrim: { ...
|
|
137
|
+
thumb: { ...fill },
|
|
138
|
+
scrim: { ...fill, backgroundColor: 'rgba(0, 0, 0, 0.35)' },
|
|
135
139
|
badge: {
|
|
136
140
|
position: 'absolute',
|
|
137
141
|
top: 4,
|
|
@@ -143,7 +147,7 @@ const styles = StyleSheet.create({
|
|
|
143
147
|
},
|
|
144
148
|
badgeText: { color: '#fff', fontSize: 9, fontWeight: '700' },
|
|
145
149
|
labelWrap: {
|
|
146
|
-
...
|
|
150
|
+
...fill,
|
|
147
151
|
alignItems: 'center',
|
|
148
152
|
justifyContent: 'center',
|
|
149
153
|
},
|
|
@@ -155,6 +159,6 @@ const styles = StyleSheet.create({
|
|
|
155
159
|
paddingHorizontal: 6,
|
|
156
160
|
},
|
|
157
161
|
// Hover/press "lights up": a translucent sheet over the whole tile.
|
|
158
|
-
glow: { ...
|
|
162
|
+
glow: { ...fill, backgroundColor: 'rgba(255, 255, 255, 0.12)' },
|
|
159
163
|
glowPressed: { backgroundColor: 'rgba(255, 255, 255, 0.04)' },
|
|
160
164
|
});
|