@niivue/uikit 1.0.0-rc.29 → 1.0.0-rc.30

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
@@ -604,7 +604,10 @@ what was chosen ("No file chosen", one name, or "3 files"; a long name keeps
604
604
  its tail behind leading dots). Pressing the button, Enter or Space on it, or
605
605
  `open(id)` asks the bridge with the spec's `accept`, `multiple` and
606
606
  `directory`; the picker then shows the names and fires `onPick`, or
607
- `onCancel` when the chooser closed empty.
607
+ `onCancel` when the chooser closed empty. The browser bridge adds the last
608
+ part of a multi-part extension to `accept` (`.nii.gz` brings `.gz`), since
609
+ Chrome's chooser on macOS matches only that part and would grey the files
610
+ out; other files ending in it (a `.tar.gz`) are then offered too.
608
611
 
609
612
  ```ts
610
613
  import {
package/dist/host.d.ts CHANGED
@@ -37,6 +37,15 @@ export declare const FILE_PICKER_CANCEL_GRACE_MS = 1000;
37
37
  * clicks the anchor can cancel the download before it starts.
38
38
  */
39
39
  export declare const DOWNLOAD_REVOKE_DELAY_MS = 40000;
40
+ /**
41
+ * An `accept` list the browser chooser can match. Chrome's chooser on macOS
42
+ * matches only the last part of a file's extension, so `.nii.gz` alone greys
43
+ * out every `.nii.gz` file; each multi-part extension also brings its last
44
+ * part (`.gz`), after the list as given. The chooser then offers other files
45
+ * with that last part too (a `.tar.gz`), and the caller sees them. MIME types
46
+ * pass through.
47
+ */
48
+ export declare function browserAccept(accept: string): string;
40
49
  /**
41
50
  * A file picker that drives a hidden `<input type="file">`. The input is
42
51
  * attached to the body while the chooser is open (some browsers ignore a
@@ -44,7 +53,8 @@ export declare const DOWNLOAD_REVOKE_DELAY_MS = 40000;
44
53
  * empty array through the input's `cancel` event or, where there is none
45
54
  * (Safari before 16.4, Chrome before 113), once the window has had focus
46
55
  * back for `FILE_PICKER_CANCEL_GRACE_MS` with no pick. `directory` sets
47
- * `webkitdirectory`, which every current engine honours.
56
+ * `webkitdirectory`, which every current engine honours. `accept` goes
57
+ * through `browserAccept`.
48
58
  */
49
59
  export declare function createBrowserFilePicker(doc?: FilePickerDocument, win?: BridgeWindow): FilePickerBridge;
50
60
  /** The subset of a Document and URL the browser download uses. */