react-reason-editor-sidebar 0.1.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.
- package/dist/Sidebar.d.ts +2 -0
- package/dist/SidebarContent.d.ts +7 -0
- package/dist/SidebarFooter.d.ts +37 -0
- package/dist/SidebarToolbar.d.ts +89 -0
- package/dist/SidebarViewMenu.d.ts +20 -0
- package/dist/app-types/fileSource.d.ts +124 -0
- package/dist/app-types/toc.d.ts +2 -0
- package/dist/app-ui/FileTypeIcon.d.ts +11 -0
- package/dist/app-ui/alert-dialog.d.ts +14 -0
- package/dist/app-ui/badge.d.ts +13 -0
- package/dist/app-ui/button.d.ts +15 -0
- package/dist/app-ui/context-menu.d.ts +28 -0
- package/dist/app-ui/dialog.d.ts +15 -0
- package/dist/app-ui/dropdown-menu.d.ts +25 -0
- package/dist/app-ui/input.d.ts +7 -0
- package/dist/app-ui/sheet.d.ts +13 -0
- package/dist/app-ui/tooltip.d.ts +7 -0
- package/dist/app-ui/tree.d.ts +23 -0
- package/dist/app-utils/file-sources/sources.d.ts +43 -0
- package/dist/app-utils/utils.d.ts +1 -0
- package/dist/dialogs/FileManagerModal.d.ts +11 -0
- package/dist/dialogs/filemanager-data.d.ts +17 -0
- package/dist/documents/DocumentTree.d.ts +59 -0
- package/dist/documents/defaultDocuments.d.ts +12 -0
- package/dist/features/ai-rewrite/AIRewriteSuggestion.d.ts +27 -0
- package/dist/features/ai-rewrite/rewriteModes.d.ts +37 -0
- package/dist/file-tree/FileTreeContextMenu.d.ts +18 -0
- package/dist/file-tree/documentUtils.d.ts +63 -0
- package/dist/file-tree/expandLevels.d.ts +32 -0
- package/dist/file-tree/filetree.d.ts +66 -0
- package/dist/file-tree/index.d.ts +9 -0
- package/dist/file-tree/useFileTreeOperations.d.ts +27 -0
- package/dist/fileSourceUtils.d.ts +2 -0
- package/dist/index.cjs +46 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.mjs +20301 -0
- package/dist/layout/sidebar/index.d.ts +10 -0
- package/dist/layout/sidebar/panelOptions.d.ts +37 -0
- package/dist/layout/sidebar/types.d.ts +227 -0
- package/dist/search/OutlineView.d.ts +51 -0
- package/dist/search/relatedDocuments.d.ts +46 -0
- package/dist/search/useActiveHeading.d.ts +40 -0
- package/dist/style.css +2 -0
- package/dist/utils/storage.d.ts +7 -0
- package/package.json +77 -0
|
@@ -0,0 +1,2 @@
|
|
|
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, onSettingsClick, 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;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SidebarContentProps } from './layout/sidebar/types';
|
|
2
|
+
import './split-pane.css';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the enabled panels for one side of the layout, stacked in a
|
|
5
|
+
* resizable vertical split when more than one panel is active.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SidebarContent: ({ panels, persistenceKey, activeDocuments, activeId, activeDocument, headings, isMobile, onSelect, onAdd, onDelete, onDuplicate, onMove, onManageTags, onRename, onOpenChange, treeRef, onExpandStateChange, onSetExpandedFolders, outlineRef, editorRef, openTabs, activeTab, onTabChange, onTabClose, onTabsClose, onTabRename, onSplitRight, onReopenLastClosed, canReopenLastClosed, onNavigate, aiProps, tipsProps, topicsProps, tabItems, onNewChat, onFileManagerOpen, deletedDocs, onRestore, }: SidebarContentProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Document } from './documents/DocumentTree';
|
|
2
|
+
import type { SidebarPanelType } from './layout/sidebar/types';
|
|
3
|
+
/** Props for the {@link SidebarFooter} component. */
|
|
4
|
+
interface SidebarFooterProps {
|
|
5
|
+
/** Panels currently visible in the left sidebar. */
|
|
6
|
+
leftPanels: SidebarPanelType[];
|
|
7
|
+
/** Changes which panels are visible in the left sidebar. */
|
|
8
|
+
onLeftPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
9
|
+
/** Panels currently visible in the right sidebar. */
|
|
10
|
+
rightPanels: SidebarPanelType[];
|
|
11
|
+
/** Changes which panels are visible in the right sidebar. */
|
|
12
|
+
onRightPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
13
|
+
/** Suppresses the settings button when `true` (mobile layout). */
|
|
14
|
+
isMobile?: boolean;
|
|
15
|
+
/** Soft-deleted documents shown in the trash dropdown. */
|
|
16
|
+
deletedDocs: Document[];
|
|
17
|
+
/** Restores a soft-deleted document by ID. */
|
|
18
|
+
onRestore?: (id: string) => void;
|
|
19
|
+
/** Opens the settings dialog, optionally navigating to a specific section. */
|
|
20
|
+
onSettingsClick?: (section?: string) => void;
|
|
21
|
+
/** Logged-in user info, or null/undefined when not authenticated. */
|
|
22
|
+
user?: {
|
|
23
|
+
name?: string;
|
|
24
|
+
email?: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/** Called when the user clicks "Login". */
|
|
27
|
+
onLogin?: () => void;
|
|
28
|
+
/** Called when the user clicks "Sign Out". */
|
|
29
|
+
onSignOut?: () => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Compact icon row pinned to the bottom of the sidebar. Includes a trash
|
|
33
|
+
* dropdown (restore deleted docs), settings button, and a panel view
|
|
34
|
+
* dropdown.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SidebarFooter: ({ leftPanels, onLeftPanelsChange, rightPanels, onRightPanelsChange, isMobile, deletedDocs, onRestore, onSettingsClick, user, onLogin, onSignOut, }: SidebarFooterProps) => import("react").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module SidebarToolbar
|
|
3
|
+
* @description Compact icon toolbar rendered at the top of the sidebar. Shows
|
|
4
|
+
* context-sensitive controls based on `leftPanels`: file-source switcher, search,
|
|
5
|
+
* and expand/collapse buttons. The file-tree actions (new file/folder, trash,
|
|
6
|
+
* file manager) render here only when the "Files" panel — which hosts them in
|
|
7
|
+
* its own header — is hidden.
|
|
8
|
+
*/
|
|
9
|
+
import { RefObject } from 'react';
|
|
10
|
+
import type { AnyFileSource } from './app-types/fileSource';
|
|
11
|
+
import type { DocumentTreeHandle } from './file-tree/filetree';
|
|
12
|
+
import type { OutlineViewHandle } from './search/OutlineView';
|
|
13
|
+
import type { SidebarPanelType, OpenTabItem } from './layout/sidebar/types';
|
|
14
|
+
import type { Document } from './documents/DocumentTree';
|
|
15
|
+
/** Props for the {@link SidebarToolbar} component. */
|
|
16
|
+
interface SidebarToolbarProps {
|
|
17
|
+
/** Panels currently visible in the left sidebar — controls which toolbar buttons are shown. */
|
|
18
|
+
leftPanels: SidebarPanelType[];
|
|
19
|
+
/** Changes which panels are visible in the left sidebar. */
|
|
20
|
+
onLeftPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
21
|
+
/** Panels currently visible in the right sidebar. */
|
|
22
|
+
rightPanels: SidebarPanelType[];
|
|
23
|
+
/** Changes which panels are visible in the right sidebar. */
|
|
24
|
+
onRightPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
25
|
+
/** ID of the currently selected document (used when creating a new sibling). */
|
|
26
|
+
activeId: string | null;
|
|
27
|
+
/** Creates a new note (`isFolder=false`) or folder (`isFolder=true`) under `parentId`. */
|
|
28
|
+
onAdd: (parentId: string | null, isFolder?: boolean) => void;
|
|
29
|
+
/** Focuses the sidebar search input. */
|
|
30
|
+
onSearchFocus: () => void;
|
|
31
|
+
/** Opens the file manager modal. */
|
|
32
|
+
onFileManagerOpen: () => void;
|
|
33
|
+
/** Available file source configurations. */
|
|
34
|
+
sources: AnyFileSource[];
|
|
35
|
+
/** The currently active file source object, or `null` if none selected. */
|
|
36
|
+
activeSource: AnyFileSource | null;
|
|
37
|
+
/** ID of the currently active file source. */
|
|
38
|
+
activeFileSourceId: string;
|
|
39
|
+
/** Called when the user selects a different file source from the dropdown. */
|
|
40
|
+
onFileSourceChange?: (sourceId: string) => void;
|
|
41
|
+
/** Selects a source by ID and updates the active source state. */
|
|
42
|
+
onSourceSelect: (sourceId: string) => void;
|
|
43
|
+
/** Whether all tree nodes are currently expanded (drives the toggle icon). */
|
|
44
|
+
allExpanded: boolean;
|
|
45
|
+
/** Tooltip label describing what the expand-all toggle will do next (cycles by folder level). */
|
|
46
|
+
expandToggleLabel: string;
|
|
47
|
+
/** Whether all outline entries are currently expanded. */
|
|
48
|
+
outlineExpanded: boolean;
|
|
49
|
+
/** Steps the tree to its next expansion level (wraps to fully collapsed). */
|
|
50
|
+
onToggleAllExpanded: () => void;
|
|
51
|
+
/** Toggles expand/collapse of all outline entries. */
|
|
52
|
+
onToggleOutlineExpanded: () => void;
|
|
53
|
+
/** Ref forwarded to the `FileTree` for imperative operations. */
|
|
54
|
+
treeRef: RefObject<DocumentTreeHandle | null>;
|
|
55
|
+
/** Ref forwarded to the `OutlineView` for imperative operations. */
|
|
56
|
+
outlineRef: RefObject<OutlineViewHandle | null>;
|
|
57
|
+
/** Soft-deleted documents shown in the trash dropdown. */
|
|
58
|
+
deletedDocs?: Document[];
|
|
59
|
+
/** Restores a soft-deleted document by ID. */
|
|
60
|
+
onRestore?: (id: string) => void;
|
|
61
|
+
/** Whether the floating reading-progress island is currently visible. */
|
|
62
|
+
showDynamicIsland?: boolean;
|
|
63
|
+
/** Toggles the floating reading-progress island. */
|
|
64
|
+
onToggleDynamicIsland?: () => void;
|
|
65
|
+
/** Opens the settings dialog, optionally navigating to a specific section. */
|
|
66
|
+
onSettingsClick?: (section?: string) => void;
|
|
67
|
+
/** Suppresses the settings button when `true` (mobile layout). */
|
|
68
|
+
isMobile?: boolean;
|
|
69
|
+
/** All currently open tab IDs. */
|
|
70
|
+
openTabs?: string[];
|
|
71
|
+
/** ID of the currently active tab. */
|
|
72
|
+
activeTab?: string | null;
|
|
73
|
+
/** Switches to a tab by ID. */
|
|
74
|
+
onTabChange?: (id: string) => void;
|
|
75
|
+
/** Closes a tab by ID. */
|
|
76
|
+
onTabClose?: (id: string) => void;
|
|
77
|
+
/** All documents (used for tab title lookup). */
|
|
78
|
+
documents?: Document[];
|
|
79
|
+
/** Unified tab list (files + chats). Overrides file-only tab derivation when set. */
|
|
80
|
+
tabItems?: OpenTabItem[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Sidebar toolbar strip. Renders different button sets based on which
|
|
84
|
+
* panels are active in `leftPanels`: the files/open-tabs panel shows
|
|
85
|
+
* file-source, search, file-manager, new-file/folder, and collapse-all
|
|
86
|
+
* buttons; the outline panel additionally shows an expand/collapse toggle.
|
|
87
|
+
*/
|
|
88
|
+
export declare const SidebarToolbar: ({ leftPanels, onLeftPanelsChange, rightPanels, onRightPanelsChange, activeId, onAdd, onSearchFocus, onFileManagerOpen, sources, activeSource, activeFileSourceId, onFileSourceChange, onSourceSelect, allExpanded, expandToggleLabel, outlineExpanded, onToggleAllExpanded, onToggleOutlineExpanded, treeRef, outlineRef, deletedDocs, onRestore, showDynamicIsland, onToggleDynamicIsland, onSettingsClick, isMobile, openTabs, activeTab, onTabChange, onTabClose, documents, tabItems, }: SidebarToolbarProps) => import("react").JSX.Element;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SidebarPanelType } from './layout/sidebar/types';
|
|
2
|
+
/** Props for the {@link SidebarViewMenu} component. */
|
|
3
|
+
interface SidebarViewMenuProps {
|
|
4
|
+
leftPanels: SidebarPanelType[];
|
|
5
|
+
onLeftPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
6
|
+
rightPanels: SidebarPanelType[];
|
|
7
|
+
onRightPanelsChange: (panels: SidebarPanelType[]) => void;
|
|
8
|
+
/** Whether the floating reading-progress island is currently visible. */
|
|
9
|
+
showDynamicIsland?: boolean;
|
|
10
|
+
/** Toggles the floating reading-progress island. */
|
|
11
|
+
onToggleDynamicIsland?: () => void;
|
|
12
|
+
/** Classes applied to the trigger button (callers use different sizing). */
|
|
13
|
+
triggerClassName?: string;
|
|
14
|
+
/** Tooltip placement for the trigger button. */
|
|
15
|
+
tooltipSide?: 'top' | 'bottom';
|
|
16
|
+
/** Menu content alignment relative to the trigger. */
|
|
17
|
+
align?: 'start' | 'end';
|
|
18
|
+
}
|
|
19
|
+
export declare const SidebarViewMenu: ({ leftPanels, onLeftPanelsChange, rightPanels, onRightPanelsChange, showDynamicIsland, onToggleDynamicIsland, triggerClassName, tooltipSide, align, }: SidebarViewMenuProps) => import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-types/fileSource
|
|
3
|
+
* @description TypeScript types for all supported file-source providers:
|
|
4
|
+
* SSH, S3, R2, B2, Google Docs, Turso DB, and the AnyFileSource union.
|
|
5
|
+
*/
|
|
6
|
+
export type FileSourceType = 'local' | 'ssh' | 's3' | 'r2' | 'b2' | 'gdocs' | 'turso';
|
|
7
|
+
export interface SSHCredentials {
|
|
8
|
+
/** SSH host name or IP address. */
|
|
9
|
+
host: string;
|
|
10
|
+
/** SSH port used for connection. */
|
|
11
|
+
port: number;
|
|
12
|
+
/** SSH user account name. */
|
|
13
|
+
username: string;
|
|
14
|
+
/** Optional password for password-based auth. */
|
|
15
|
+
password?: string;
|
|
16
|
+
/** Optional private key contents for key-based auth. */
|
|
17
|
+
privateKey?: string;
|
|
18
|
+
/** Optional passphrase for the private key. */
|
|
19
|
+
passphrase?: string;
|
|
20
|
+
/** Optional base path used as the root directory. */
|
|
21
|
+
basePath?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface S3Credentials {
|
|
24
|
+
/** AWS access key ID or S3-compatible key ID. */
|
|
25
|
+
accessKeyId: string;
|
|
26
|
+
/** AWS secret access key or S3-compatible secret. */
|
|
27
|
+
secretAccessKey: string;
|
|
28
|
+
/** Region where the bucket is hosted. */
|
|
29
|
+
region: string;
|
|
30
|
+
/** Bucket name to read/write files from. */
|
|
31
|
+
bucket: string;
|
|
32
|
+
/** Optional custom endpoint for S3-compatible providers. */
|
|
33
|
+
endpoint?: string;
|
|
34
|
+
/** Optional base path prefix inside the bucket. */
|
|
35
|
+
basePath?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface R2Credentials {
|
|
38
|
+
/** Cloudflare account ID owning the R2 bucket. */
|
|
39
|
+
accountId: string;
|
|
40
|
+
/** R2 access key ID. */
|
|
41
|
+
accessKeyId: string;
|
|
42
|
+
/** R2 secret access key. */
|
|
43
|
+
secretAccessKey: string;
|
|
44
|
+
/** R2 bucket name. */
|
|
45
|
+
bucket: string;
|
|
46
|
+
/** Optional path prefix inside the bucket. */
|
|
47
|
+
basePath?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface B2Credentials {
|
|
50
|
+
/** Backblaze access key ID. */
|
|
51
|
+
accessKeyId: string;
|
|
52
|
+
/** Backblaze secret access key. */
|
|
53
|
+
secretAccessKey: string;
|
|
54
|
+
/** Backblaze B2 bucket name. */
|
|
55
|
+
bucket: string;
|
|
56
|
+
endpoint?: string;
|
|
57
|
+
/** Optional path prefix inside the bucket. */
|
|
58
|
+
basePath?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface GoogleDocsCredentials {
|
|
61
|
+
/** OAuth access token for Google API requests. */
|
|
62
|
+
accessToken?: string;
|
|
63
|
+
/** OAuth refresh token to renew expired access tokens. */
|
|
64
|
+
refreshToken?: string;
|
|
65
|
+
/** Connected Google account email. */
|
|
66
|
+
email?: string;
|
|
67
|
+
folderIds?: string[];
|
|
68
|
+
/** Indicates whether the Google connection is active. */
|
|
69
|
+
isAuthenticated: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface TursoDBCredentials {
|
|
72
|
+
/** Turso database endpoint URL. */
|
|
73
|
+
endpoint: string;
|
|
74
|
+
/** Optional Turso auth token for protected instances. */
|
|
75
|
+
authToken?: string;
|
|
76
|
+
/** Optional database name when endpoint hosts multiple DBs. */
|
|
77
|
+
database?: string;
|
|
78
|
+
enableGoogleDocsSync?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface FileSource {
|
|
81
|
+
/** Unique source identifier. */
|
|
82
|
+
id: string;
|
|
83
|
+
/** Human-readable source label shown in UI. */
|
|
84
|
+
name: string;
|
|
85
|
+
/** Source backend type discriminator. */
|
|
86
|
+
type: FileSourceType;
|
|
87
|
+
/** Backend-specific connection credentials. */
|
|
88
|
+
credentials?: SSHCredentials | S3Credentials | R2Credentials | B2Credentials | GoogleDocsCredentials | TursoDBCredentials;
|
|
89
|
+
/** Marks this source as the default selection. */
|
|
90
|
+
isDefault?: boolean;
|
|
91
|
+
/** ISO timestamp when the source was created. */
|
|
92
|
+
createdAt: string;
|
|
93
|
+
/** ISO timestamp when the source was last updated. */
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
}
|
|
96
|
+
export interface LocalFileSource extends FileSource {
|
|
97
|
+
type: 'local';
|
|
98
|
+
credentials: undefined;
|
|
99
|
+
}
|
|
100
|
+
export interface SSHFileSource extends FileSource {
|
|
101
|
+
type: 'ssh';
|
|
102
|
+
credentials: SSHCredentials;
|
|
103
|
+
}
|
|
104
|
+
export interface S3FileSource extends FileSource {
|
|
105
|
+
type: 's3';
|
|
106
|
+
credentials: S3Credentials;
|
|
107
|
+
}
|
|
108
|
+
export interface R2FileSource extends FileSource {
|
|
109
|
+
type: 'r2';
|
|
110
|
+
credentials: R2Credentials;
|
|
111
|
+
}
|
|
112
|
+
export interface B2FileSource extends FileSource {
|
|
113
|
+
type: 'b2';
|
|
114
|
+
credentials: B2Credentials;
|
|
115
|
+
}
|
|
116
|
+
export interface GoogleDocsFileSource extends FileSource {
|
|
117
|
+
type: 'gdocs';
|
|
118
|
+
credentials: GoogleDocsCredentials;
|
|
119
|
+
}
|
|
120
|
+
export interface TursoDBFileSource extends FileSource {
|
|
121
|
+
type: 'turso';
|
|
122
|
+
credentials: TursoDBCredentials;
|
|
123
|
+
}
|
|
124
|
+
export type AnyFileSource = LocalFileSource | SSHFileSource | S3FileSource | R2FileSource | B2FileSource | GoogleDocsFileSource | TursoDBFileSource;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const SIZES: {
|
|
2
|
+
readonly sm: 14;
|
|
3
|
+
readonly md: 18;
|
|
4
|
+
readonly lg: 24;
|
|
5
|
+
};
|
|
6
|
+
interface FileTypeIconProps {
|
|
7
|
+
filename: string;
|
|
8
|
+
size?: keyof typeof SIZES | number;
|
|
9
|
+
}
|
|
10
|
+
export declare function FileTypeIcon({ filename, size }: FileTypeIconProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>): React.JSX.Element;
|
|
7
|
+
declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
11
|
+
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
12
|
+
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>): React.JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-ui/badge
|
|
3
|
+
* @description Small status-label badge with variant styles (default, secondary, outline, destructive).
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { type VariantProps } from "class-variance-authority";
|
|
7
|
+
declare const badgeVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "new" | "beta" | "highlight" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-ui/button
|
|
3
|
+
* @description Versatile button with size and variant props built on Radix Slot + CVA.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { type VariantProps } from "class-variance-authority";
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
9
|
+
size?: "sm" | "lg" | "default" | "icon" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
|
|
15
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-ui/context-menu
|
|
3
|
+
* @description Radix UI ContextMenu primitives for right-click menus with Tailwind styling.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
7
|
+
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
8
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
|
|
11
|
+
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
12
|
+
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
24
|
+
inset?: boolean;
|
|
25
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
declare const ContextMenuShortcut: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => React.JSX.Element;
|
|
28
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, hideCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
hideCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-ui/input
|
|
3
|
+
* @description Styled single-line text input with focus ring and disabled state.
|
|
4
|
+
*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
7
|
+
export { Input };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
|
13
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-ui/tree
|
|
3
|
+
* @description Headless-tree-compatible generic tree rendering primitives.
|
|
4
|
+
*/
|
|
5
|
+
import type { ItemInstance } from "@headless-tree/core";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
interface TreeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
indent?: number;
|
|
9
|
+
tree?: any;
|
|
10
|
+
}
|
|
11
|
+
declare function Tree({ indent, tree, className, ...props }: TreeProps): React.JSX.Element;
|
|
12
|
+
interface TreeItemProps<T = any> extends React.HTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
item: ItemInstance<T>;
|
|
14
|
+
indent?: number;
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function TreeItem<T = any>({ item, className, asChild, children, ...props }: Omit<TreeItemProps<T>, "indent">): React.JSX.Element;
|
|
18
|
+
interface TreeItemLabelProps<T = any> extends React.HTMLAttributes<HTMLSpanElement> {
|
|
19
|
+
item?: ItemInstance<T>;
|
|
20
|
+
}
|
|
21
|
+
declare function TreeItemLabel<T = any>({ item: propItem, children, className, ...props }: TreeItemLabelProps<T>): React.JSX.Element | null;
|
|
22
|
+
declare function TreeDragLine({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element | null;
|
|
23
|
+
export { Tree, TreeItem, TreeItemLabel, TreeDragLine };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module app-utils/file-sources/sources
|
|
3
|
+
* @description CRUD helpers for AnyFileSource records stored in
|
|
4
|
+
* localStorage. Manages the active source ID and provides typed
|
|
5
|
+
* get/add/update/delete operations.
|
|
6
|
+
*/
|
|
7
|
+
import { AnyFileSource } from '../../app-types/fileSource';
|
|
8
|
+
/**
|
|
9
|
+
* Get all file sources from localStorage
|
|
10
|
+
*/
|
|
11
|
+
export declare function getFileSources(): AnyFileSource[];
|
|
12
|
+
/**
|
|
13
|
+
* Save file sources to localStorage
|
|
14
|
+
*/
|
|
15
|
+
export declare function saveFileSources(sources: AnyFileSource[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Add a new file source
|
|
18
|
+
*/
|
|
19
|
+
export declare function addFileSource(source: Omit<AnyFileSource, 'id' | 'createdAt' | 'updatedAt'>): AnyFileSource;
|
|
20
|
+
/**
|
|
21
|
+
* Update an existing file source
|
|
22
|
+
*/
|
|
23
|
+
export declare function updateFileSource(id: string, updates: Partial<AnyFileSource>): void;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a file source
|
|
26
|
+
*/
|
|
27
|
+
export declare function deleteFileSource(id: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get the currently active file source ID
|
|
30
|
+
*/
|
|
31
|
+
export declare function getActiveFileSourceId(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Set the active file source ID
|
|
34
|
+
*/
|
|
35
|
+
export declare function setActiveFileSourceId(id: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Get the currently active file source
|
|
38
|
+
*/
|
|
39
|
+
export declare function getActiveFileSource(): AnyFileSource;
|
|
40
|
+
/**
|
|
41
|
+
* Test connection to a file source (placeholder - would need backend implementation)
|
|
42
|
+
*/
|
|
43
|
+
export declare function testFileSourceConnection(source: AnyFileSource): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cn(...inputs: (string | boolean | undefined | null)[]): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@svar-ui/react-filemanager/all.css";
|
|
2
|
+
import "./filemanager.css";
|
|
3
|
+
import type { Document } from "../documents/DocumentTree";
|
|
4
|
+
interface FileManagerModalProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: (open: boolean) => void;
|
|
7
|
+
documents?: Document[];
|
|
8
|
+
onSelectDocument?: (docId: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function FileManagerModal({ open, onOpenChange, documents, onSelectDocument, }: FileManagerModalProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module filemanager-data
|
|
3
|
+
* @description Static seed data and type definitions for the FileManagerModal
|
|
4
|
+
* demo: sample folders, files, and breadcrumb paths.
|
|
5
|
+
*/
|
|
6
|
+
import type { Document } from '../documents/DocumentTree';
|
|
7
|
+
export interface FileItem {
|
|
8
|
+
id: string;
|
|
9
|
+
parent?: string;
|
|
10
|
+
type: "folder" | "file";
|
|
11
|
+
date?: Date;
|
|
12
|
+
size?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function convertDocumentsToFileItems(documents: Document[]): FileItem[];
|
|
15
|
+
export declare function getData(documents?: Document[]): FileItem[];
|
|
16
|
+
/** Returns a map from file path → document ID for reverse-lookup when a file is opened. */
|
|
17
|
+
export declare function getPathToDocIdMap(documents: Document[]): Map<string, string>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core document entity shared across the application.
|
|
3
|
+
* A document may be a regular note or a folder (when `isFolder` is `true`).
|
|
4
|
+
*/
|
|
5
|
+
export interface Document {
|
|
6
|
+
/** Unique string identifier, typically derived from `Date.now()`. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Human-readable title shown in the sidebar and tab bar. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Serialised HTML content of the document body. */
|
|
11
|
+
content: string;
|
|
12
|
+
/** ID of the parent document, or `null` for root-level entries. */
|
|
13
|
+
parentId: string | null;
|
|
14
|
+
/** Nested children populated by the tree-builder; not persisted directly. */
|
|
15
|
+
children?: Document[];
|
|
16
|
+
/** Whether the tree node is currently open (showing children). */
|
|
17
|
+
isExpanded?: boolean;
|
|
18
|
+
/** When `true`, the item acts as a folder container rather than a note. */
|
|
19
|
+
isFolder?: boolean;
|
|
20
|
+
/** Archived status — archived items may be hidden from the main view. */
|
|
21
|
+
isArchived?: boolean;
|
|
22
|
+
/** Soft-deleted flag — items are moved to trash before permanent deletion. */
|
|
23
|
+
isDeleted?: boolean;
|
|
24
|
+
/** List of user-defined tag strings. */
|
|
25
|
+
tags?: string[];
|
|
26
|
+
/** Sharing/visibility configuration for this document. */
|
|
27
|
+
sharing?: {
|
|
28
|
+
/** Whether the document is publicly accessible via its share link. */
|
|
29
|
+
isPublic: boolean;
|
|
30
|
+
/** Per-user sharing entries. */
|
|
31
|
+
sharedWith?: Array<{
|
|
32
|
+
/** Recipient e-mail address. */
|
|
33
|
+
email: string;
|
|
34
|
+
/** Access level granted to the recipient. */
|
|
35
|
+
role: 'viewer' | 'editor' | 'commentor';
|
|
36
|
+
/** ISO timestamp when access was granted. */
|
|
37
|
+
sharedAt: string;
|
|
38
|
+
}>;
|
|
39
|
+
/** Publicly-accessible share URL. */
|
|
40
|
+
shareLink?: string;
|
|
41
|
+
/** Linked Google Docs file identifier. */
|
|
42
|
+
googleDocId?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** Props for the {@link DocumentTree} component. */
|
|
46
|
+
interface DocumentTreeProps {
|
|
47
|
+
documents: Document[];
|
|
48
|
+
activeId: string | null;
|
|
49
|
+
onSelect: (id: string) => void;
|
|
50
|
+
onAdd: (parentId: string | null) => void;
|
|
51
|
+
onDelete: (id: string) => void;
|
|
52
|
+
onToggleExpand: (id: string) => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Renders the complete document hierarchy as a scrollable sidebar panel.
|
|
56
|
+
* Root-level documents are iterated and each is rendered as a `TreeNode`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const DocumentTree: ({ documents, activeId, onSelect, onAdd, onDelete, onToggleExpand, }: DocumentTreeProps) => import("react").JSX.Element;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module defaultDocuments
|
|
3
|
+
* @description Provides the seed document list used to pre-populate the editor
|
|
4
|
+
* in a fresh environment with example content, folders, and nested notes.
|
|
5
|
+
*/
|
|
6
|
+
import type { Document } from "./DocumentTree";
|
|
7
|
+
/**
|
|
8
|
+
* Initial set of example documents shown to first-time users.
|
|
9
|
+
* Includes a welcome note, two folder nodes (Projects, Research), and
|
|
10
|
+
* several child notes with sample HTML content.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultDocuments: Document[];
|