@oxy.so/bloom 7.30.0 → 7.31.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/docs/adoption-matrix.mdx +5 -4
- package/docs/button.mdx +17 -0
- package/docs/media-flight.mdx +5 -0
- package/docs/video-view.mdx +84 -0
- package/lib/commonjs/button/Button.js +10 -1
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/media-flight/MediaSurface.js +12 -13
- package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
- package/lib/commonjs/media-flight/expo-video-module.js +1 -1
- package/lib/commonjs/media-flight/expo-video-module.js.map +1 -1
- package/lib/commonjs/video-view/VideoView.js +62 -0
- package/lib/commonjs/video-view/VideoView.js.map +1 -0
- package/lib/commonjs/video-view/index.js +13 -0
- package/lib/commonjs/video-view/index.js.map +1 -0
- package/lib/commonjs/video-view/types.js +6 -0
- package/lib/commonjs/video-view/types.js.map +1 -0
- package/lib/module/button/Button.js +10 -1
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/media-flight/MediaSurface.js +12 -13
- package/lib/module/media-flight/MediaSurface.js.map +1 -1
- package/lib/module/media-flight/expo-video-module.js +1 -1
- package/lib/module/media-flight/expo-video-module.js.map +1 -1
- package/lib/module/video-view/VideoView.js +57 -0
- package/lib/module/video-view/VideoView.js.map +1 -0
- package/lib/module/video-view/index.js +4 -0
- package/lib/module/video-view/index.js.map +1 -0
- package/lib/module/video-view/types.js +4 -0
- package/lib/module/video-view/types.js.map +1 -0
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts +1 -1
- package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/expo-video-module.d.ts +5 -0
- package/lib/typescript/commonjs/media-flight/expo-video-module.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/types.d.ts +3 -1
- package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/video-view/VideoView.d.ts +27 -0
- package/lib/typescript/commonjs/video-view/VideoView.d.ts.map +1 -0
- package/lib/typescript/commonjs/video-view/index.d.ts +3 -0
- package/lib/typescript/commonjs/video-view/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/video-view/types.d.ts +29 -0
- package/lib/typescript/commonjs/video-view/types.d.ts.map +1 -0
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts +1 -1
- package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/expo-video-module.d.ts +5 -0
- package/lib/typescript/module/media-flight/expo-video-module.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/types.d.ts +3 -1
- package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/module/video-view/VideoView.d.ts +27 -0
- package/lib/typescript/module/video-view/VideoView.d.ts.map +1 -0
- package/lib/typescript/module/video-view/index.d.ts +3 -0
- package/lib/typescript/module/video-view/index.d.ts.map +1 -0
- package/lib/typescript/module/video-view/types.d.ts +29 -0
- package/lib/typescript/module/video-view/types.d.ts.map +1 -0
- package/package.json +18 -1
- package/src/button/Button.tsx +8 -1
- package/src/index.ts +3 -0
- package/src/index.web.ts +3 -0
- package/src/media-flight/MediaSurface.tsx +12 -19
- package/src/media-flight/expo-video-module.ts +7 -2
- package/src/media-flight/types.ts +3 -1
- package/src/video-view/VideoView.tsx +59 -0
- package/src/video-view/index.ts +2 -0
- package/src/video-view/types.ts +34 -0
- package/src/__tests__/support/adoption-matrix.ts +0 -683
- package/src/__tests__/support/card-surface.ts +0 -25
- package/src/__tests__/support/collision-fixture-barrel.ts +0 -20
- package/src/__tests__/support/commerce-harness.tsx +0 -97
- package/src/__tests__/support/composite.ts +0 -68
- package/src/__tests__/support/constructed-style-sheets.ts +0 -68
- package/src/__tests__/support/messages-in.ts +0 -10
- package/src/__tests__/support/press-host.ts +0 -30
- package/src/__tests__/support/rendered-style.ts +0 -99
- package/src/__tests__/support/unread-hook-fixture.ts +0 -33
- package/src/__tests__/support/worklet-capture-fixture.tsx +0 -28
- package/src/agent-avatar/__tests__/artwork-golden.json +0 -774
- package/src/agent-creator/__tests__/support/character-runtime-fixture.tsx +0 -26
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +0 -9346
- package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +0 -69
- package/src/theme/__tests__/fixtures/color-engine-golden.json +0 -1
|
@@ -270,7 +270,9 @@ export interface MediaVideoSlotProps<P extends VideoPlayerLike = VideoPlayerLike
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
/**
|
|
273
|
-
* Paint the video yourself.
|
|
273
|
+
* Paint the video yourself — with `VideoView` from `@oxy.so/bloom/video-view`,
|
|
274
|
+
* which keeps the web element inline (iPhone Safari never starts one that is
|
|
275
|
+
* not) and takes the slot's `player` as is.
|
|
274
276
|
*
|
|
275
277
|
* Bloom mounts a `VideoView` with the handful of props it knows about, which is
|
|
276
278
|
* enough until a consumer needs something only its OWN element can give it: a
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE video view: expo-video's `VideoView`, with inline playback on by default.
|
|
3
|
+
*
|
|
4
|
+
* expo-video's web view renders `<video playsInline={props.playsInline}>`, so
|
|
5
|
+
* the element carries `playsinline` only when a caller remembers to pass the
|
|
6
|
+
* prop. iPhone Safari will not play a `<video>` without it inline: a muted
|
|
7
|
+
* autoplay is refused outright and the element keeps showing its poster, which
|
|
8
|
+
* looks exactly like a video that has not started yet. Every Oxy app paints
|
|
9
|
+
* feeds, reels and previews that way, and none passed the prop.
|
|
10
|
+
*
|
|
11
|
+
* So the default lives here, once, and every Bloom surface that paints a video
|
|
12
|
+
* (`MediaSurface`, and through it `MediaFlightLayer`, `MediaFlightHost` and the
|
|
13
|
+
* media gallery) renders through this view. Apps render it instead of
|
|
14
|
+
* importing `VideoView` from expo-video directly. A caller may still pass
|
|
15
|
+
* `playsInline={false}`; native ignores the prop, since iOS and Android views
|
|
16
|
+
* are always inline.
|
|
17
|
+
*
|
|
18
|
+
* The module is loaded through the optional-peer boundary, never imported: an
|
|
19
|
+
* app that paints only images through `MediaSurface` must not have to install a
|
|
20
|
+
* native video module (see `media-flight/expo-video-module.ts`). When it cannot
|
|
21
|
+
* be loaded this renders nothing and says why once, in dev.
|
|
22
|
+
*/
|
|
23
|
+
import { forwardRef, type ComponentType, type RefAttributes } from 'react';
|
|
24
|
+
import type { VideoView as ExpoVideoView, VideoViewProps as ExpoVideoViewProps } from 'expo-video';
|
|
25
|
+
|
|
26
|
+
import { loadExpoVideo, warnExpoVideoUnavailable } from '../media-flight/expo-video-module';
|
|
27
|
+
import type { VideoViewHandle, VideoViewProps } from './types';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The loaded module's `VideoView`, under its real type. The boundary types it
|
|
31
|
+
* as the slice Bloom itself passes; what it holds is expo-video's class, either
|
|
32
|
+
* required as `expo-video` or handed over by `provideExpoVideo(ExpoVideo)`.
|
|
33
|
+
*/
|
|
34
|
+
type ExpoVideoViewComponent = ComponentType<ExpoVideoViewProps & RefAttributes<ExpoVideoView>>;
|
|
35
|
+
|
|
36
|
+
export const VideoView = forwardRef<VideoViewHandle, VideoViewProps>(function VideoView(
|
|
37
|
+
{ playsInline = true, player, ...props },
|
|
38
|
+
ref,
|
|
39
|
+
) {
|
|
40
|
+
const expoVideo = loadExpoVideo();
|
|
41
|
+
if (expoVideo === null) {
|
|
42
|
+
warnExpoVideoUnavailable();
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const NativeVideoView = expoVideo.VideoView as ExpoVideoViewComponent;
|
|
46
|
+
return (
|
|
47
|
+
<NativeVideoView
|
|
48
|
+
{...props}
|
|
49
|
+
ref={ref}
|
|
50
|
+
// Bloom never creates a player, so whatever arrives here is the
|
|
51
|
+
// consumer's own expo-video `VideoPlayer`; the prop is typed by its
|
|
52
|
+
// structural minimum only so `MediaSurface` need not name the package.
|
|
53
|
+
player={player as ExpoVideoViewProps['player']}
|
|
54
|
+
playsInline={playsInline}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
VideoView.displayName = 'VideoView';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* expo-video's own view types, named once for the one family that renders it.
|
|
3
|
+
*
|
|
4
|
+
* Type-only, so nothing here links `expo-video` into a bundle; the module itself
|
|
5
|
+
* is still loaded through the optional-peer boundary in
|
|
6
|
+
* `media-flight/expo-video-module.ts`. And unlike that boundary's hand-written
|
|
7
|
+
* slice, these declarations DO name the package — which is why this family is
|
|
8
|
+
* reachable only through its own subpath, `@oxy.so/bloom/video-view`: an app
|
|
9
|
+
* imports it to render video, so it has expo-video installed, while an app that
|
|
10
|
+
* renders none never loads these declarations.
|
|
11
|
+
*/
|
|
12
|
+
import type {
|
|
13
|
+
VideoView as ExpoVideoView,
|
|
14
|
+
VideoViewProps as ExpoVideoViewProps,
|
|
15
|
+
} from 'expo-video';
|
|
16
|
+
|
|
17
|
+
import type { VideoPlayerLike } from '../media-flight/expo-video-module';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* expo-video's `VideoViewProps`, every one of them, with `player` widened to
|
|
21
|
+
* Bloom's structural {@link VideoPlayerLike}: the minimum a real `VideoPlayer`
|
|
22
|
+
* satisfies and an arbitrary object does not. That widening is what lets a
|
|
23
|
+
* surface that only knows the slice (`MediaSurface`) render through this view
|
|
24
|
+
* without naming the package in its own declarations.
|
|
25
|
+
*/
|
|
26
|
+
export interface VideoViewProps extends Omit<ExpoVideoViewProps, 'player'> {
|
|
27
|
+
player?: VideoPlayerLike | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* What a `ref` on {@link VideoView} receives: expo-video's own view instance,
|
|
32
|
+
* with `nativeRef`, `enterFullscreen()`, `startPictureInPicture()` and the rest.
|
|
33
|
+
*/
|
|
34
|
+
export type VideoViewHandle = ExpoVideoView;
|