strata-react 1.3.10 → 1.3.11

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/UPGRADING.md CHANGED
@@ -12,6 +12,7 @@ time. While the version is 0.x, any release may break.
12
12
  Every PR that changes what an app sees adds a line here (see `CLAUDE.md`, "Changelog").
13
13
 
14
14
  ## 2026-11-24
15
+ - `RateChoice` (the speed in `MediaPlayer`, `VideoClock`, `CompareVideo`, `CompareVideoGrid`) is React Aria's `Select`, not a native select (#324): a test that did `user.selectOptions(getByRole("combobox", { name: "Playback speed" }), "1.5×")` now clicks `getByRole("button", { name: /Playback speed/ })` and then `findByRole("option", { name: "1.5×" })`. Visual baselines with a player move: the control is narrower, so a phone-width player's controls can fit on one row.
15
16
  - `createApi`'s `post`/`put`/`patch` send a `Blob`, bytes, `FormData`, `URLSearchParams` or a stream as it is (a Blob with its own type as Content-Type); before, any body was `JSON.stringify`ed, so such a body arrived as `{}`. `createTypedApi` takes `body` (not `json`) on an operation whose request body has only a non-JSON media type, so a workaround that went round the typed client through `fetchJson` can be deleted.
16
17
  - `SayAgain` inside a `ClipsProvider` takes the recordings of `text` and the provider's `lang` itself; one given `parts` or `lang` is unchanged, and outside a provider nothing changes.
17
18
 
@@ -99,7 +99,7 @@ export type VolumeControlProps = {
99
99
  };
100
100
  /** A mute button and a volume slider with its value in percent. Muting sets the volume to 0 and remembers the level; unmuting puts it back. Moving the slider from 0 unmutes. */
101
101
  export declare function VolumeControl({ volume, onVolumeChange, max, disabled, className }: VolumeControlProps): React.JSX.Element;
102
- /** A choice of playback speed ("0.5×", "1×", "1.5×") on a native select, named "Playback speed". */
102
+ /** A choice of playback speed ("0.5×", "1×", "1.5×"), named "Playback speed": React Aria's Select. */
103
103
  export declare function RateChoice({ rate, onRateChange, rates, className }: {
104
104
  rate: number;
105
105
  onRateChange: (rate: number) => void;
package/dist/index.js CHANGED
@@ -6,12 +6,12 @@ import { a as useMicrophone, c as fetchJson, d as useLoad, f as StrataToastRegio
6
6
  import { n as useSharedCursor, r as geo, t as CursorScope } from "./cursor-DDGBPiTJ.js";
7
7
  import { a as useColorScheme, i as colorSchemeScript, n as ColorSchemeChoice, o as useSystemColorScheme, r as ThemeProvider, s as Density, t as COLOR_SCHEME_STORAGE_KEY } from "./theme-By3DSUTs.js";
8
8
  import * as React from "react";
9
- import { Autocomplete, Button as Button$1, Cell, Checkbox as Checkbox$1, Collection, Column, Dialog as Dialog$1, DialogTrigger, Disclosure as Disclosure$1, DisclosurePanel, DropIndicator, DropZone, FileTrigger, GridLayout, GridList, GridListItem, Header, Heading, Input as Input$1, Keyboard, Link, ListBox, ListBoxItem, ListLayout, ListStateContext, Menu as Menu$1, MenuItem, MenuSection, MenuTrigger, Modal, ModalOverlay, Popover as Popover$1, RouterProvider, Row, SearchField, Separator, Slider as Slider$1, SliderThumb, SliderTrack, SubmenuTrigger, Switch as Switch$1, Tab, TabList, TabPanel, Table, TableBody, TableHeader, TableLayout, Tabs as Tabs$1, Text, ToggleButton, ToggleButtonGroup, Tree as Tree$1, TreeItem, TreeItemContent, Virtualizer, useDragAndDrop, useFilter } from "react-aria-components";
9
+ import { Autocomplete, Button as Button$1, Cell, Checkbox as Checkbox$1, Collection, Column, Dialog as Dialog$1, DialogTrigger, Disclosure as Disclosure$1, DisclosurePanel, DropIndicator, DropZone, FileTrigger, GridLayout, GridList, GridListItem, Header, Heading, Input as Input$1, Keyboard, Link, ListBox, ListBoxItem, ListLayout, ListStateContext, Menu as Menu$1, MenuItem, MenuSection, MenuTrigger, Modal, ModalOverlay, Popover as Popover$1, RouterProvider, Row, SearchField, Select, SelectValue, Separator, Slider as Slider$1, SliderThumb, SliderTrack, SubmenuTrigger, Switch as Switch$1, Tab, TabList, TabPanel, Table, TableBody, TableHeader, TableLayout, Tabs as Tabs$1, Text, ToggleButton, ToggleButtonGroup, Tree as Tree$1, TreeItem, TreeItemContent, Virtualizer, useDragAndDrop, useFilter } from "react-aria-components";
10
10
  import { ArrowDown, ArrowUp, ArrowUpDown, ArrowUpRight, Ban, Check, ChevronDown, ChevronLeft, ChevronRight, CircleAlert, CircleCheck, CircleDashed, Clock, CloudOff, Columns2, Ellipsis, Eye, EyeOff, FileQuestion, Flag, Folder, FolderOpen, GripVertical, History, ImageOff, Info, KeyRound, LayoutGrid, List, Loader, LoaderCircle, Lock, Maximize, Maximize2, Minimize, Minus, PanelBottomClose, PanelBottomOpen, PanelLeftClose, PanelLeftOpen, PanelRightClose, PanelRightOpen, PanelTopClose, PanelTopOpen, Pause, Pencil, Play, Redo2, RotateCcw, RotateCw, Scan, Search, Send, SkipBack, SkipForward, SlidersHorizontal, Square, StepBack, StepForward, Trash2, TriangleAlert, Undo2, Upload, Volume2, VolumeX, X, ZoomIn, ZoomOut } from "lucide-react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { Link as Link$1, NavLink, useHref, useNavigate, useSearchParams } from "react-router";
13
13
  import { createSortedRowModel, flexRender, rowSortingFeature, tableFeatures, useTable } from "@tanstack/react-table";
14
- import { VisuallyHidden, mergeProps, useDrag, useDrop, useFocusRing, useMove, useSlider, useSliderThumb } from "react-aria";
14
+ import { UNSAFE_PortalProvider, VisuallyHidden, mergeProps, useDrag, useDrop, useFocusRing, useMove, useSlider, useSliderThumb, useUNSAFE_PortalContext } from "react-aria";
15
15
  import { LayoutInfo, Rect, Size, useSliderState } from "react-stately";
16
16
  import { hashKey, useInfiniteQuery, useQuery, useQueryClient } from "@tanstack/react-query";
17
17
  import pixelmatch from "pixelmatch";
@@ -2935,10 +2935,15 @@ function FullscreenFrame({ label, active, onActiveChange, modal: allowModal = tr
2935
2935
  };
2936
2936
  }, [active, allowModal]);
2937
2937
  const modal = allowModal && active && !native && (!canFullscreen() || refused);
2938
+ const outer = useUNSAFE_PortalContext();
2939
+ const getContainer = React.useCallback(() => native && ref.current ? ref.current : outer.getContainer?.() ?? document.body, [native, outer]);
2938
2940
  const inner = /* @__PURE__ */ jsx("div", {
2939
2941
  ref,
2940
2942
  className: cn(active && "flex h-full min-h-0 flex-col bg-background p-4", className),
2941
- children
2943
+ children: /* @__PURE__ */ jsx(UNSAFE_PortalProvider, {
2944
+ getContainer,
2945
+ children
2946
+ })
2942
2947
  });
2943
2948
  if (!modal) return inner;
2944
2949
  return /* @__PURE__ */ jsx(ModalOverlay, {
@@ -3275,7 +3280,7 @@ function VolumeControl({ volume, onVolumeChange, max = 100, disabled, className
3275
3280
  })]
3276
3281
  });
3277
3282
  }
3278
- /** A choice of playback speed ("0.5×", "1×", "1.5×") on a native select, named "Playback speed". */
3283
+ /** A choice of playback speed ("0.5×", "1×", "1.5×"), named "Playback speed": React Aria's Select. */
3279
3284
  function RateChoice({ rate, onRateChange, rates = [
3280
3285
  .5,
3281
3286
  1,
@@ -3283,15 +3288,34 @@ function RateChoice({ rate, onRateChange, rates = [
3283
3288
  1.5,
3284
3289
  2
3285
3290
  ], className }) {
3286
- return /* @__PURE__ */ jsx(NativeSelect, {
3291
+ return /* @__PURE__ */ jsxs(Select, {
3287
3292
  "aria-label": "Playback speed",
3288
- value: String(rate),
3289
- onChange: (e) => onRateChange(Number(e.target.value)),
3293
+ selectedKey: String(rate),
3294
+ onSelectionChange: (key) => key !== null && onRateChange(Number(key)),
3290
3295
  className: cn("w-auto", className),
3291
- children: rates.map((r) => /* @__PURE__ */ jsx("option", {
3292
- value: String(r),
3293
- children: `${r}×`
3294
- }, r))
3296
+ children: [/* @__PURE__ */ jsxs(Button$1, {
3297
+ className: cn("flex w-full items-center justify-between gap-2 rounded-control border border-input bg-background pr-2 pl-3 type-body text-foreground transition-state", controlHeight.default),
3298
+ children: [/* @__PURE__ */ jsx(SelectValue, { className: "tabular-nums" }), /* @__PURE__ */ jsx(ChevronDown, {
3299
+ "aria-hidden": true,
3300
+ className: "size-4 text-muted-foreground"
3301
+ })]
3302
+ }), /* @__PURE__ */ jsx(Popover$1, {
3303
+ placement: "bottom start",
3304
+ offset: 4,
3305
+ className: cn("layer-overlay min-w-(--trigger-width) p-1", overlaySurface),
3306
+ children: /* @__PURE__ */ jsx(ListBox, {
3307
+ className: "outline-none",
3308
+ children: rates.map((r) => /* @__PURE__ */ jsx(ListBoxItem, {
3309
+ id: String(r),
3310
+ textValue: `${r}×`,
3311
+ className: "flex min-h-(--control-h-sm) cursor-pointer items-center justify-between gap-3 rounded-control px-2 type-body-sm tabular-nums outline-none focus:bg-muted selected:font-medium",
3312
+ children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [`${r}×`, isSelected && /* @__PURE__ */ jsx(Check, {
3313
+ "aria-hidden": true,
3314
+ className: "size-4"
3315
+ })] })
3316
+ }, r))
3317
+ })
3318
+ })]
3295
3319
  });
3296
3320
  }
3297
3321
  /**