@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.
Files changed (90) hide show
  1. package/docs/adoption-matrix.mdx +5 -4
  2. package/docs/button.mdx +17 -0
  3. package/docs/media-flight.mdx +5 -0
  4. package/docs/video-view.mdx +84 -0
  5. package/lib/commonjs/button/Button.js +10 -1
  6. package/lib/commonjs/button/Button.js.map +1 -1
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/index.web.js.map +1 -1
  9. package/lib/commonjs/media-flight/MediaSurface.js +12 -13
  10. package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
  11. package/lib/commonjs/media-flight/expo-video-module.js +1 -1
  12. package/lib/commonjs/media-flight/expo-video-module.js.map +1 -1
  13. package/lib/commonjs/video-view/VideoView.js +62 -0
  14. package/lib/commonjs/video-view/VideoView.js.map +1 -0
  15. package/lib/commonjs/video-view/index.js +13 -0
  16. package/lib/commonjs/video-view/index.js.map +1 -0
  17. package/lib/commonjs/video-view/types.js +6 -0
  18. package/lib/commonjs/video-view/types.js.map +1 -0
  19. package/lib/module/button/Button.js +10 -1
  20. package/lib/module/button/Button.js.map +1 -1
  21. package/lib/module/index.js +3 -0
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/index.web.js +3 -0
  24. package/lib/module/index.web.js.map +1 -1
  25. package/lib/module/media-flight/MediaSurface.js +12 -13
  26. package/lib/module/media-flight/MediaSurface.js.map +1 -1
  27. package/lib/module/media-flight/expo-video-module.js +1 -1
  28. package/lib/module/media-flight/expo-video-module.js.map +1 -1
  29. package/lib/module/video-view/VideoView.js +57 -0
  30. package/lib/module/video-view/VideoView.js.map +1 -0
  31. package/lib/module/video-view/index.js +4 -0
  32. package/lib/module/video-view/index.js.map +1 -0
  33. package/lib/module/video-view/types.js +4 -0
  34. package/lib/module/video-view/types.js.map +1 -0
  35. package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts +1 -1
  39. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/media-flight/expo-video-module.d.ts +5 -0
  41. package/lib/typescript/commonjs/media-flight/expo-video-module.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/media-flight/types.d.ts +3 -1
  43. package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/video-view/VideoView.d.ts +27 -0
  45. package/lib/typescript/commonjs/video-view/VideoView.d.ts.map +1 -0
  46. package/lib/typescript/commonjs/video-view/index.d.ts +3 -0
  47. package/lib/typescript/commonjs/video-view/index.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/video-view/types.d.ts +29 -0
  49. package/lib/typescript/commonjs/video-view/types.d.ts.map +1 -0
  50. package/lib/typescript/module/button/Button.d.ts.map +1 -1
  51. package/lib/typescript/module/index.d.ts.map +1 -1
  52. package/lib/typescript/module/index.web.d.ts.map +1 -1
  53. package/lib/typescript/module/media-flight/MediaSurface.d.ts +1 -1
  54. package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
  55. package/lib/typescript/module/media-flight/expo-video-module.d.ts +5 -0
  56. package/lib/typescript/module/media-flight/expo-video-module.d.ts.map +1 -1
  57. package/lib/typescript/module/media-flight/types.d.ts +3 -1
  58. package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
  59. package/lib/typescript/module/video-view/VideoView.d.ts +27 -0
  60. package/lib/typescript/module/video-view/VideoView.d.ts.map +1 -0
  61. package/lib/typescript/module/video-view/index.d.ts +3 -0
  62. package/lib/typescript/module/video-view/index.d.ts.map +1 -0
  63. package/lib/typescript/module/video-view/types.d.ts +29 -0
  64. package/lib/typescript/module/video-view/types.d.ts.map +1 -0
  65. package/package.json +18 -1
  66. package/src/button/Button.tsx +8 -1
  67. package/src/index.ts +3 -0
  68. package/src/index.web.ts +3 -0
  69. package/src/media-flight/MediaSurface.tsx +12 -19
  70. package/src/media-flight/expo-video-module.ts +7 -2
  71. package/src/media-flight/types.ts +3 -1
  72. package/src/video-view/VideoView.tsx +59 -0
  73. package/src/video-view/index.ts +2 -0
  74. package/src/video-view/types.ts +34 -0
  75. package/src/__tests__/support/adoption-matrix.ts +0 -683
  76. package/src/__tests__/support/card-surface.ts +0 -25
  77. package/src/__tests__/support/collision-fixture-barrel.ts +0 -20
  78. package/src/__tests__/support/commerce-harness.tsx +0 -97
  79. package/src/__tests__/support/composite.ts +0 -68
  80. package/src/__tests__/support/constructed-style-sheets.ts +0 -68
  81. package/src/__tests__/support/messages-in.ts +0 -10
  82. package/src/__tests__/support/press-host.ts +0 -30
  83. package/src/__tests__/support/rendered-style.ts +0 -99
  84. package/src/__tests__/support/unread-hook-fixture.ts +0 -33
  85. package/src/__tests__/support/worklet-capture-fixture.tsx +0 -28
  86. package/src/agent-avatar/__tests__/artwork-golden.json +0 -774
  87. package/src/agent-creator/__tests__/support/character-runtime-fixture.tsx +0 -26
  88. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +0 -9346
  89. package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +0 -69
  90. 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,2 @@
1
+ export { VideoView } from './VideoView';
2
+ export type { VideoViewHandle, VideoViewProps } from './types';
@@ -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;