react-reason-editor-sidebar 0.1.133 → 0.1.135

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/Sidebar.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import type { SidebarProps } from './layout/sidebar/types';
2
- export declare const Sidebar: ({ documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onSetExpandedFolders, onMove, onManageTags, onRename, onSearchFocus, isOpen, onOpenChange, isMobile, leftPanels, onLeftPanelsChange, rightPanels, onRightPanelsChange, settingsHref, onRestore, newDocumentId, showDynamicIsland, onToggleDynamicIsland, activeFileSourceId, onFileSourceChange, headings, onNavigate, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabsClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, aiProps, tipsProps, topicsProps, tabItems, onNewChat, }: SidebarProps) => import("react").JSX.Element;
2
+ export declare const Sidebar: ({ documents, activeId, activeDocument, onSelect, onAdd, onDelete, onDuplicate, onCreateFile, onSetExpandedFolders, onMove, onManageTags, onRename, onSearchFocus, isOpen, onOpenChange, isMobile, leftPanels, onLeftPanelsChange, rightPanels, onRightPanelsChange, settingsHref, onRestore, newDocumentId, showDynamicIsland, onToggleDynamicIsland, activeFileSourceId, onFileSourceChange, headings, onNavigate, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabsClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, aiProps, tipsProps, topicsProps, tabItems, onNewChat, }: SidebarProps) => import("react").JSX.Element;
@@ -1,11 +1,18 @@
1
1
  import "@svar-ui/react-filemanager/all.css";
2
2
  import "./filemanager.css";
3
3
  import type { Document } from "../documents/DocumentTree";
4
+ import type { FileManagerCreateRequest } from "../layout/sidebar/types";
5
+ export type { FileManagerCreateRequest };
4
6
  interface FileManagerModalProps {
5
7
  open: boolean;
6
8
  onOpenChange: (open: boolean) => void;
7
9
  documents?: Document[];
8
10
  onSelectDocument?: (docId: string) => void;
11
+ /**
12
+ * Persists a new file or folder. Without it "Add new" and "Upload file"
13
+ * are inert: the file manager has no storage of its own, so nothing would
14
+ * survive the next re-render.
15
+ */
16
+ onCreateFile?: (request: FileManagerCreateRequest) => void | Promise<void>;
9
17
  }
10
- export declare function FileManagerModal({ open, onOpenChange, documents, onSelectDocument, }: FileManagerModalProps): import("react").JSX.Element;
11
- export {};
18
+ export declare function FileManagerModal({ open, onOpenChange, documents, onSelectDocument, onCreateFile, }: FileManagerModalProps): import("react").JSX.Element;
@@ -11,7 +11,20 @@ export interface FileItem {
11
11
  date?: Date;
12
12
  size?: number;
13
13
  }
14
+ /**
15
+ * Builds the "/a/b/c" path the file manager uses as an item ID by walking the
16
+ * document's `parentId` chain and slugifying every title on the way up.
17
+ * `0` is the file manager's root, which is not a real document.
18
+ */
19
+ export declare function pathOf(documents: Document[], doc: Document): string;
14
20
  export declare function convertDocumentsToFileItems(documents: Document[]): FileItem[];
15
21
  export declare function getData(documents?: Document[]): FileItem[];
16
22
  /** Returns a map from file path → document ID for reverse-lookup when a file is opened. */
17
23
  export declare function getPathToDocIdMap(documents: Document[]): Map<string, string>;
24
+ /**
25
+ * Returns a map from *every* file-manager path → document ID, folders
26
+ * included. "Add new" and "Upload file" report the destination as a path,
27
+ * and the host needs to turn that path back into a `parentId`, which means
28
+ * folders have to be resolvable too.
29
+ */
30
+ export declare function getPathToNodeIdMap(documents: Document[]): Map<string, string>;