@sanity/types 5.14.0-next.8 → 5.14.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 (2) hide show
  1. package/lib/index.d.ts +28 -1
  2. package/package.json +5 -5
package/lib/index.d.ts CHANGED
@@ -2755,7 +2755,19 @@ interface AssetSourceComponentProps {
2755
2755
  onSelect: (assetFromSource: AssetFromSource[]) => void;
2756
2756
  onChangeAction?: (action: AssetSourceComponentAction) => void;
2757
2757
  schemaType?: ImageSchemaType | FileSchemaType;
2758
- /** @beta */
2758
+ /**
2759
+ * The uploader instance for tracking upload progress.
2760
+ *
2761
+ * When `action` is `'upload'`:
2762
+ * - If `uploader` is provided: Picker mode. Files are available via
2763
+ * `uploader.getFiles()`. The source should upload these files and report
2764
+ * progress via the uploader.
2765
+ * - If `uploader` is undefined: Component mode. The source should show its
2766
+ * own file selection UI, handle uploads internally, and call `onSelect`
2767
+ * when complete.
2768
+ *
2769
+ * @beta
2770
+ */
2759
2771
  uploader?: AssetSourceUploader;
2760
2772
  /**
2761
2773
  * The asset to open in source. Only provided when action is 'openInSource'.
@@ -2788,6 +2800,21 @@ interface AssetSource {
2788
2800
  icon?: ComponentType;
2789
2801
  /** @beta */
2790
2802
  Uploader?: AssetSourceUploaderClass;
2803
+ /**
2804
+ * Specifies how uploads should be initiated for this source.
2805
+ *
2806
+ * - `'picker'` (default): The studio opens a native file picker first,
2807
+ * then passes the selected files to the source via the `uploader` prop.
2808
+ * Progress is tracked via the uploader and shown in the studio UI.
2809
+ *
2810
+ * - `'component'`: The studio renders the source component directly with
2811
+ * `action: 'upload'`. The source provides its own UI for selecting and
2812
+ * uploading files, and tracks progress internally. When complete, the
2813
+ * source calls `onSelect` with the uploaded assets.
2814
+ *
2815
+ * @beta
2816
+ */
2817
+ uploadMode?: 'picker' | 'component';
2791
2818
  /**
2792
2819
  * Resolve how to open an asset in its original source.
2793
2820
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/types",
3
- "version": "5.14.0-next.8+9db645e03f",
3
+ "version": "5.14.0",
4
4
  "description": "Type definitions for common Sanity data structures",
5
5
  "keywords": [
6
6
  "cms",
@@ -47,10 +47,10 @@
47
47
  "react": "^19.2.4",
48
48
  "rimraf": "^5.0.10",
49
49
  "vitest": "^4.0.18",
50
- "@repo/package.config": "5.14.0-next.8+9db645e03f",
51
- "@repo/eslint-config": "5.14.0-next.8+9db645e03f",
52
- "@repo/test-config": "5.14.0-next.8+9db645e03f",
53
- "@repo/tsconfig": "5.14.0-next.8+9db645e03f"
50
+ "@repo/eslint-config": "5.14.0",
51
+ "@repo/package.config": "5.14.0",
52
+ "@repo/test-config": "5.14.0",
53
+ "@repo/tsconfig": "5.14.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@types/react": "^19.2"