@tutti-os/workspace-file-manager 0.0.214 → 0.0.216

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
@@ -73,7 +73,9 @@ When another host wants to reuse this package:
73
73
  `createWorkspaceFileManagerI18nRuntime(...)`.
74
74
  5. Provide `resolveContextMenu` when using the React surface so blank,
75
75
  directory, and file menus stay host-owned.
76
- 6. Override wording in the host runtime when the host intentionally owns the
76
+ 6. Optionally provide `renderToolbarTrailingActions` for product-owned primary
77
+ toolbar actions (for example upload) after Refresh.
78
+ 7. Override wording in the host runtime when the host intentionally owns the
77
79
  product phrasing; otherwise fall back to the package defaults.
78
80
 
79
81
  This keeps the package reusable across different hosts without pushing host
package/dist/index.d.ts CHANGED
@@ -69,6 +69,14 @@ declare function resolveWorkspaceFileManagerContextMenuTarget(input: {
69
69
  entry: WorkspaceFileEntry | null;
70
70
  }): WorkspaceFileManagerContextMenuTarget;
71
71
 
72
+ interface WorkspaceFileManagerToolbarTrailingActionsContext {
73
+ currentDirectoryPath: string;
74
+ isBusy: boolean;
75
+ isLoading: boolean;
76
+ isMutating: boolean;
77
+ }
78
+ type RenderWorkspaceFileManagerToolbarTrailingActions = (context: WorkspaceFileManagerToolbarTrailingActionsContext) => ReactElement | null;
79
+
72
80
  interface WorkspaceFileManagerProps {
73
81
  className?: string;
74
82
  dateLocale?: TuttiDateLocale;
@@ -81,6 +89,12 @@ interface WorkspaceFileManagerProps {
81
89
  renderExternalLocationContent?: (location: Extract<WorkspaceFileLocation, {
82
90
  kind: "external";
83
91
  }>) => ReactElement | null;
92
+ /**
93
+ * Optional host actions rendered in the toolbar trailing cluster, after
94
+ * Refresh and before Search. Use for product-owned primary affordances such
95
+ * as upload; keep multi-step transfer UX outside this package.
96
+ */
97
+ renderToolbarTrailingActions?: RenderWorkspaceFileManagerToolbarTrailingActions;
84
98
  i18n: WorkspaceFileManagerI18nRuntime;
85
99
  session: WorkspaceFileManagerSession;
86
100
  /**
@@ -92,7 +106,7 @@ interface WorkspaceFileManagerProps {
92
106
  showPreviewPanel?: boolean;
93
107
  surface?: "card" | "embedded";
94
108
  }
95
- declare function WorkspaceFileManager({ className, dateLocale, entryDragMode, i18n, onCopyEntry, onDirectoryExpanded, onEntryDragStart, resolveContextMenu, resolveEntryIconUrl, renderExternalLocationContent, session, showLocationSidebar, showPreviewPanel, surface }: WorkspaceFileManagerProps): ReactElement;
109
+ declare function WorkspaceFileManager({ className, dateLocale, entryDragMode, i18n, onCopyEntry, onDirectoryExpanded, onEntryDragStart, resolveContextMenu, resolveEntryIconUrl, renderExternalLocationContent, renderToolbarTrailingActions, session, showLocationSidebar, showPreviewPanel, surface }: WorkspaceFileManagerProps): ReactElement;
96
110
 
97
111
  interface WorkspaceFileManagerContextMenuProps {
98
112
  contextMenu: {
@@ -142,4 +156,4 @@ declare function useWorkspaceFileEntryIconUrls(input: {
142
156
  reportEntryIconViewportLeave: (entry: WorkspaceFileEntry) => void;
143
157
  };
144
158
 
145
- export { type ResolveWorkspaceFileManagerContextMenu, WorkspaceFileEntry, WorkspaceFileEntryIcon, WorkspaceFileLocation, WorkspaceFileManager, WorkspaceFileManagerContextMenu, type WorkspaceFileManagerContextMenuActionItem, type WorkspaceFileManagerContextMenuItem, type WorkspaceFileManagerContextMenuProps, type WorkspaceFileManagerContextMenuRequest, type WorkspaceFileManagerContextMenuSeparatorItem, type WorkspaceFileManagerContextMenuSubmenuItem, type WorkspaceFileManagerContextMenuTarget, WorkspaceFileManagerCreateDialog, type WorkspaceFileManagerEntryDragMode, WorkspaceFileManagerI18nRuntime, type WorkspaceFileManagerProps, WorkspaceFileManagerSession, resolveWorkspaceFileManagerContextMenuTarget, useWorkspaceFileEntryIconUrls };
159
+ export { type RenderWorkspaceFileManagerToolbarTrailingActions, type ResolveWorkspaceFileManagerContextMenu, WorkspaceFileEntry, WorkspaceFileEntryIcon, WorkspaceFileLocation, WorkspaceFileManager, WorkspaceFileManagerContextMenu, type WorkspaceFileManagerContextMenuActionItem, type WorkspaceFileManagerContextMenuItem, type WorkspaceFileManagerContextMenuProps, type WorkspaceFileManagerContextMenuRequest, type WorkspaceFileManagerContextMenuSeparatorItem, type WorkspaceFileManagerContextMenuSubmenuItem, type WorkspaceFileManagerContextMenuTarget, WorkspaceFileManagerCreateDialog, type WorkspaceFileManagerEntryDragMode, WorkspaceFileManagerI18nRuntime, type WorkspaceFileManagerProps, WorkspaceFileManagerSession, type WorkspaceFileManagerToolbarTrailingActionsContext, resolveWorkspaceFileManagerContextMenuTarget, useWorkspaceFileEntryIconUrls };
package/dist/index.js CHANGED
@@ -3016,6 +3016,7 @@ function WorkspaceFileManagerToolbar({
3016
3016
  isSearching,
3017
3017
  arrangeMode,
3018
3018
  layoutMode,
3019
+ renderToolbarTrailingActions,
3019
3020
  searchQuery,
3020
3021
  onGoBack,
3021
3022
  onGoForward,
@@ -3103,6 +3104,12 @@ function WorkspaceFileManagerToolbar({
3103
3104
  ]
3104
3105
  }
3105
3106
  ),
3107
+ renderToolbarTrailingActions?.({
3108
+ currentDirectoryPath,
3109
+ isBusy,
3110
+ isLoading,
3111
+ isMutating
3112
+ }) ?? null,
3106
3113
  /* @__PURE__ */ jsx7(
3107
3114
  WorkspaceFileManagerToolbarSearch,
3108
3115
  {
@@ -3890,6 +3897,7 @@ function WorkspaceFileManager({
3890
3897
  resolveContextMenu,
3891
3898
  resolveEntryIconUrl,
3892
3899
  renderExternalLocationContent,
3900
+ renderToolbarTrailingActions,
3893
3901
  session,
3894
3902
  showLocationSidebar = true,
3895
3903
  showPreviewPanel = true,
@@ -4189,6 +4197,7 @@ function WorkspaceFileManager({
4189
4197
  onArrangeModeChange: setArrangeMode,
4190
4198
  onDirectoryExpanded,
4191
4199
  onLayoutModeChange: setLayoutMode,
4200
+ renderToolbarTrailingActions,
4192
4201
  session
4193
4202
  }
4194
4203
  ),
@@ -4230,6 +4239,7 @@ function WorkspaceFileManagerToolbarContainer({
4230
4239
  onArrangeModeChange,
4231
4240
  onDirectoryExpanded,
4232
4241
  onLayoutModeChange,
4242
+ renderToolbarTrailingActions,
4233
4243
  session
4234
4244
  }) {
4235
4245
  const { view } = useWorkspaceFileManagerToolbarView(session, i18n);
@@ -4279,6 +4289,7 @@ function WorkspaceFileManagerToolbarContainer({
4279
4289
  isSearching: view.isSearching,
4280
4290
  arrangeMode,
4281
4291
  layoutMode,
4292
+ renderToolbarTrailingActions,
4282
4293
  searchQuery,
4283
4294
  onArrangeModeChange,
4284
4295
  onGoBack: () => {