@swiftbrowser/react 0.9.11 → 0.9.13

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 CHANGED
@@ -230,7 +230,11 @@ another sidebar row adds one (the first choice does not), and back or
230
230
  forward selects the row the entry recorded, through the row's own tap. The
231
231
  URL is left alone: an app that maps screens to paths sets them with
232
232
  `history.replaceState` on the entry the renderer made (a `pushState` of its
233
- own would add a second entry for the same screen).
233
+ own would add a second entry for the same screen). When the app pops on its
234
+ own (the bar's back button), the renderer's step back is asynchronous and
235
+ the app's `replaceState` for what it shows now runs before it lands; the
236
+ renderer sets that URL again on the entry it arrives at, so the address bar
237
+ follows either back button.
234
238
  On a phone, a `fill` island follows the on-screen keyboard (`keyboard`,
235
239
  on by default for `fill`, or `mount(..., { keyboard: true })`): its height
236
240
  becomes a bottom inset, so a field, a bottom search field or a chat's
@@ -262,6 +266,10 @@ swapped item (`{playing ? <ToolbarItem>…stop…</ToolbarItem> :
262
266
  <ToolbarItem placement="bottomBar">{toolButtons}</ToolbarItem>
263
267
  ```
264
268
 
269
+ `placement="largeTitle"` (iOS 26) puts a view in the large title row in
270
+ place of the title's text, a logo beside the screen's name say; it scrolls
271
+ away with the content and the bar shows `navigationTitle` once it has.
272
+
265
273
  ```tsx
266
274
  <List
267
275
  navigationTitle="Notes"
@@ -304,7 +312,11 @@ it as on iOS: `NavigationSplitView` is two columns when regular (the
304
312
  sidebar's toggle button hides and shows the sidebar) and one stack when
305
313
  compact, which pushes the detail while a `List(selection:)` in the sidebar
306
314
  has a selection and clears it on back (lists without a selection, and
307
- anything a sheet, popover or inspector presents, have no say); `.inspector` is a trailing panel when
315
+ anything a sheet, popover or inspector presents, have no say). A detail
316
+ that is a `NavigationStack` with a `path` binding keeps what it pushes in
317
+ that binding in both widths, so an app that mirrors the path in the URL
318
+ sees the same path on a phone as in a wide window, and a path it starts
319
+ with (a reload onto a deep link) is shown over the detail; `.inspector` is a trailing panel when
308
320
  regular and a sheet when compact; `Table` shows every column under sortable
309
321
  titles when regular and the first column when compact.
310
322
 
@@ -333,6 +345,10 @@ scroll view's leading edge (or `scrollPositionAnchor`), and setting it
333
345
  scrolls there, on that scroll view's axes only. `proxy.scrollTo(id, anchor,
334
346
  { axes: 'horizontal' })` limits a reader's scroll the same way, so a pager
335
347
  inside a list leaves the list where it is.
348
+ `onScrollVisibilityChange={(visible) => …}` (or `{ threshold, action }`,
349
+ 0.5 by default) is `.onScrollVisibilityChange`: it hears when that share
350
+ of the view comes into its scroll view's visible area, below a bar the
351
+ view scrolls under, or leaves it.
336
352
  Name a coordinate space with `coordinateSpace="page"` on the `ScrollView`
337
353
  (or any view), and a `GeometryReader` inside reads its frame there with
338
354
  `proxy.frame({ named: 'page' })`, updated as the page scrolls.
@@ -1 +1 @@
1
- {"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/components/split.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzG,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,OAAO,EAA8B,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,MAAM,6BAA6B,GAAG,WAAW,GAAG,KAAK,GAAG,cAAc,GAAG,YAAY,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAChE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,gDAA6C,CAAC;AAEhF,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,YAAY,CA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CAAC,EAAE,CAAC,UAAU,EAAE,6BAA6B,KAAK,IAAI,CAAC;CAChF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,SAAS,CAqD9E;AAwCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,EAAE,MAAM,UAAO,GAAG,IAAI,CAO/H;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAE9E"}
package/dist/index.js CHANGED
@@ -1416,7 +1416,9 @@ function SplitColumn({ report, children }) {
1416
1416
  return /* @__PURE__ */ jsx(NavigationContext.Provider, { value: null, children: /* @__PURE__ */ jsx(SplitSelectionContext.Provider, { value: report, children }) });
1417
1417
  }
1418
1418
  function CompactSplit({ sidebar, detail, selected, clear }) {
1419
- const [extra, setExtra] = useState([]);
1419
+ const [internal, setInternal] = useState([]);
1420
+ const detailStack = isValidElement(detail) && detail.type === NavigationStack ? detail.props : null;
1421
+ const [extra, setExtra] = detailStack?.path !== void 0 ? readBinding(detailStack.path, detailStack.onPathChange) : [internal, setInternal];
1420
1422
  const base = selected ? [{ view: /* @__PURE__ */ jsx(DetailScope, { children: detail }) }] : [];
1421
1423
  const path = [...base, ...extra];
1422
1424
  const setPath = (next) => {
@@ -1674,6 +1676,8 @@ function toolbarPlacement(name) {
1674
1676
  return "leading";
1675
1677
  case "principal":
1676
1678
  return "principal";
1679
+ case "largeTitle":
1680
+ return "largeTitle";
1677
1681
  case "bottomBar":
1678
1682
  return "bottom";
1679
1683
  case "secondaryAction":
@@ -1750,6 +1754,7 @@ const MODIFIER_KEYS = /* @__PURE__ */ new Set([
1750
1754
  "alert",
1751
1755
  "confirmationDialog",
1752
1756
  "presentationDetents",
1757
+ "onScrollVisibilityChange",
1753
1758
  "onTapGesture",
1754
1759
  "dragGesture",
1755
1760
  "magnifyGesture",
@@ -2091,6 +2096,10 @@ function apply(key, value, node, sides) {
2091
2096
  case "presentationDetents":
2092
2097
  sides.push(presentationDetents(value));
2093
2098
  return node;
2099
+ case "onScrollVisibilityChange": {
2100
+ const spec = typeof value === "function" ? { action: value } : value;
2101
+ return sb("styled", { style: { scrollVisibility: { threshold: spec.threshold ?? 0.5 } } }, { scrollvisibility: (event) => spec.action(event.visible) }, node);
2102
+ }
2094
2103
  case "onTapGesture":
2095
2104
  return sb("tapgesture", {}, { tap: value }, node);
2096
2105
  case "dragGesture": {