@arbidocs/react 0.5.8 → 0.5.10

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/dist/index.d.cts CHANGED
@@ -14177,6 +14177,8 @@ declare function hasVideoTrack(blob: Blob): Promise<boolean>;
14177
14177
  */
14178
14178
  interface UploadFilesInput {
14179
14179
  files: File[];
14180
+ /** Upload to this member workspace instead of the currently open workspace. */
14181
+ workspaceExtId?: string;
14180
14182
  /** Where the upload started (a folder path); null or absent: the workspace root. */
14181
14183
  folder?: string | null;
14182
14184
  shared: boolean;
package/dist/index.d.ts CHANGED
@@ -14177,6 +14177,8 @@ declare function hasVideoTrack(blob: Blob): Promise<boolean>;
14177
14177
  */
14178
14178
  interface UploadFilesInput {
14179
14179
  files: File[];
14180
+ /** Upload to this member workspace instead of the currently open workspace. */
14181
+ workspaceExtId?: string;
14180
14182
  /** Where the upload started (a folder path); null or absent: the workspace root. */
14181
14183
  folder?: string | null;
14182
14184
  shared: boolean;
package/dist/index.js CHANGED
@@ -3128,7 +3128,8 @@ function useUploadFiles() {
3128
3128
  const direct = settings?.use_s3_direct_upload === true;
3129
3129
  return useCallback(
3130
3130
  async (input, onProgress) => {
3131
- const workspaceId = arbi.getWorkspaceId();
3131
+ const openWorkspaceId2 = arbi.getWorkspaceId();
3132
+ const workspaceId = input.workspaceExtId ?? openWorkspaceId2;
3132
3133
  const groups = /* @__PURE__ */ new Map();
3133
3134
  for (const file of input.files) {
3134
3135
  const folder = uploadFolderOf(file, input.folder);
@@ -3139,7 +3140,7 @@ function useUploadFiles() {
3139
3140
  for (let i = 0; i < files.length; i += BATCH_SIZE2)
3140
3141
  batches.push({ folder, files: files.slice(i, i + BATCH_SIZE2) });
3141
3142
  let workspaceKey = null;
3142
- if (direct && resolveWorkspaceKey) {
3143
+ if (direct && workspaceId === openWorkspaceId2 && resolveWorkspaceKey) {
3143
3144
  try {
3144
3145
  workspaceKey = await resolveWorkspaceKey(workspaceId);
3145
3146
  } catch {
@@ -3186,6 +3187,7 @@ function useUploadFiles() {
3186
3187
  shared: input.shared,
3187
3188
  folder: folder ?? void 0,
3188
3189
  configExtId: input.configExtId ?? void 0,
3190
+ workspaceExtId: workspaceId !== openWorkspaceId2 ? workspaceId : void 0,
3189
3191
  onProgress: (loaded) => {
3190
3192
  loadedByBatch[index] = Math.min(loaded, bytes);
3191
3193
  report();