@floegence/floe-webapp-core 0.12.0 → 0.13.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/components/file-browser/DirectoryTree.d.ts +4 -0
- package/dist/components/file-browser/DragPreview.d.ts +6 -0
- package/dist/components/file-browser/FileBrowser.d.ts +6 -0
- package/dist/components/file-browser/FileGridView.d.ts +4 -0
- package/dist/components/file-browser/FileListView.d.ts +4 -0
- package/dist/components/file-browser/types.d.ts +33 -0
- package/dist/components/ui/Form.d.ts +116 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/context/FileBrowserDragContext.d.ts +84 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useFileBrowserDrag.d.ts +67 -0
- package/dist/index.js +475 -456
- package/dist/index10.js +2 -2
- package/dist/index100.js +31 -12
- package/dist/index101.js +19 -13
- package/dist/index102.js +127 -10
- package/dist/index103.js +13 -22
- package/dist/index104.js +10 -10
- package/dist/index105.js +22 -8
- package/dist/index106.js +8 -72
- package/dist/index107.js +8 -5
- package/dist/index108.js +74 -11
- package/dist/index109.js +143 -24
- package/dist/index11.js +4 -4
- package/dist/index110.js +5 -32
- package/dist/index111.js +11 -91
- package/dist/index112.js +23 -24
- package/dist/index113.js +28 -42
- package/dist/index114.js +92 -15
- package/dist/index115.js +27 -35
- package/dist/index116.js +45 -63
- package/dist/index117.js +14 -84
- package/dist/index118.js +35 -13
- package/dist/index119.js +62 -2760
- package/dist/index12.js +5 -5
- package/dist/index120.js +84 -7
- package/dist/index121.js +13 -17
- package/dist/index122.js +2761 -38
- package/dist/index123.js +7 -31
- package/dist/index124.js +17 -1111
- package/dist/index125.js +121 -28
- package/dist/index126.js +38 -130
- package/dist/index127.js +34 -0
- package/dist/index128.js +1114 -0
- package/dist/index129.js +33 -0
- package/dist/index13.js +3 -3
- package/dist/index130.js +134 -0
- package/dist/index14.js +4 -4
- package/dist/index15.js +5 -5
- package/dist/index16.js +5 -5
- package/dist/index17.js +4 -4
- package/dist/index18.js +7 -7
- package/dist/index19.js +2 -2
- package/dist/index2.js +6 -6
- package/dist/index20.js +2 -2
- package/dist/index21.js +1 -1
- package/dist/index22.js +4 -4
- package/dist/index23.js +4 -4
- package/dist/index24.js +3 -3
- package/dist/index25.js +1 -1
- package/dist/index26.js +5 -5
- package/dist/index27.js +1 -1
- package/dist/index28.js +3 -3
- package/dist/index29.js +2 -2
- package/dist/index3.js +2 -2
- package/dist/index30.js +3 -3
- package/dist/index31.js +4 -4
- package/dist/index32.js +1 -1
- package/dist/index33.js +2 -2
- package/dist/index34.js +1 -1
- package/dist/index35.js +189 -801
- package/dist/index36.js +828 -77
- package/dist/index37.js +86 -37
- package/dist/index38.js +37 -66
- package/dist/index39.js +69 -2104
- package/dist/index4.js +1 -1
- package/dist/index40.js +2104 -146
- package/dist/index41.js +141 -23
- package/dist/index42.js +25 -45
- package/dist/index43.js +45 -10
- package/dist/index44.js +10 -27
- package/dist/index45.js +27 -186
- package/dist/index46.js +240 -351
- package/dist/index47.js +352 -120
- package/dist/index48.js +150 -321
- package/dist/index49.js +379 -116
- package/dist/index5.js +4 -4
- package/dist/index50.js +242 -178
- package/dist/index51.js +182 -145
- package/dist/index52.js +142 -113
- package/dist/index53.js +119 -47
- package/dist/index54.js +50 -91
- package/dist/index55.js +84 -301
- package/dist/index56.js +308 -8
- package/dist/index57.js +9 -142
- package/dist/index58.js +108 -70
- package/dist/index59.js +95 -40
- package/dist/index6.js +2 -2
- package/dist/index60.js +43 -36
- package/dist/index61.js +36 -38
- package/dist/index62.js +34 -32
- package/dist/index63.js +35 -43
- package/dist/index64.js +50 -278
- package/dist/index65.js +277 -8
- package/dist/index66.js +9 -59
- package/dist/index67.js +51 -75
- package/dist/index68.js +58 -148
- package/dist/index69.js +158 -122
- package/dist/index7.js +2 -2
- package/dist/index70.js +137 -18
- package/dist/index71.js +18 -136
- package/dist/index72.js +135 -22
- package/dist/index73.js +23 -33
- package/dist/index74.js +33 -29
- package/dist/index75.js +23 -22
- package/dist/index76.js +18 -278
- package/dist/index77.js +271 -59
- package/dist/index78.js +71 -58
- package/dist/index79.js +63 -9
- package/dist/index8.js +2 -2
- package/dist/index80.js +7 -7
- package/dist/index81.js +8 -45
- package/dist/index82.js +45 -115
- package/dist/index83.js +109 -67
- package/dist/index84.js +54 -53
- package/dist/index85.js +69 -30
- package/dist/index86.js +28 -89
- package/dist/index87.js +90 -44
- package/dist/index88.js +40 -29
- package/dist/index89.js +31 -42
- package/dist/index9.js +1 -1
- package/dist/index90.js +48 -25
- package/dist/index91.js +21 -168
- package/dist/index92.js +168 -36
- package/dist/index93.js +38 -63
- package/dist/index94.js +62 -90
- package/dist/index95.js +83 -108
- package/dist/index96.js +111 -129
- package/dist/index97.js +129 -32
- package/dist/index98.js +29 -511
- package/dist/index99.js +519 -36
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface DirectoryTreeProps {
|
|
2
2
|
class?: string;
|
|
3
|
+
/** Instance ID for drag operations */
|
|
4
|
+
instanceId?: string;
|
|
5
|
+
/** Whether drag and drop is enabled */
|
|
6
|
+
enableDragDrop?: boolean;
|
|
3
7
|
}
|
|
4
8
|
/**
|
|
5
9
|
* Collapsible directory tree for sidebar navigation (folders only)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating preview that follows the cursor during drag operations.
|
|
3
|
+
* Shows dragged items with a count badge for multiple items.
|
|
4
|
+
* Uses CSS transform for GPU-accelerated smooth positioning.
|
|
5
|
+
*/
|
|
6
|
+
export declare function DragPreview(): import("solid-js").JSX.Element;
|
|
@@ -44,6 +44,12 @@ export interface FileBrowserProps {
|
|
|
44
44
|
overrideContextMenuItems?: ContextMenuItem[];
|
|
45
45
|
/** Default context menu items to hide */
|
|
46
46
|
hideContextMenuItems?: FileContextMenuProps['hideItems'];
|
|
47
|
+
/** Unique instance identifier for cross-browser drag operations */
|
|
48
|
+
instanceId?: string;
|
|
49
|
+
/** Whether drag and drop is enabled (default: true) */
|
|
50
|
+
enableDragDrop?: boolean;
|
|
51
|
+
/** Callback when items are moved via drag and drop */
|
|
52
|
+
onDragMove?: (items: FileItem[], targetPath: string, sourceInstanceId: string) => void;
|
|
47
53
|
}
|
|
48
54
|
/**
|
|
49
55
|
* Professional file browser component with list/grid views and directory tree sidebar
|
|
@@ -134,6 +134,39 @@ export interface ScrollPosition {
|
|
|
134
134
|
top: number;
|
|
135
135
|
left: number;
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Represents an item being dragged in a file browser
|
|
139
|
+
*/
|
|
140
|
+
export interface FileDraggedItem {
|
|
141
|
+
/** The file item being dragged */
|
|
142
|
+
item: FileItem;
|
|
143
|
+
/** Instance ID of the source FileBrowser */
|
|
144
|
+
sourceInstanceId: string;
|
|
145
|
+
/** The path where the item was dragged from */
|
|
146
|
+
sourcePath: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Information about a potential drop target
|
|
150
|
+
*/
|
|
151
|
+
export interface FileDropTarget {
|
|
152
|
+
/** Instance ID of the target FileBrowser */
|
|
153
|
+
instanceId: string;
|
|
154
|
+
/** Path where the item would be dropped */
|
|
155
|
+
targetPath: string;
|
|
156
|
+
/** The folder item being dropped onto, or null for current directory root */
|
|
157
|
+
targetItem: FileItem | null;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Props for enabling drag behavior on a FileBrowser
|
|
161
|
+
*/
|
|
162
|
+
export interface FileBrowserDragProps {
|
|
163
|
+
/** Unique instance identifier for cross-browser drag operations */
|
|
164
|
+
instanceId?: string;
|
|
165
|
+
/** Whether drag and drop is enabled (default: true) */
|
|
166
|
+
enableDragDrop?: boolean;
|
|
167
|
+
/** Callback when items are moved via drag and drop */
|
|
168
|
+
onDragMove?: (items: FileItem[], targetPath: string, sourceInstanceId: string) => void;
|
|
169
|
+
}
|
|
137
170
|
/**
|
|
138
171
|
* File browser context value for internal state management
|
|
139
172
|
*/
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type JSX, type Accessor } from 'solid-js';
|
|
2
|
+
export interface FormProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
|
|
3
|
+
/** Called when form is submitted */
|
|
4
|
+
onSubmit?: (e: SubmitEvent) => void | Promise<void>;
|
|
5
|
+
/** Additional class names */
|
|
6
|
+
class?: string;
|
|
7
|
+
children: JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Form wrapper with built-in submission state management.
|
|
11
|
+
* Automatically prevents default form behavior and tracks submitting state.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Form(props: FormProps): JSX.Element;
|
|
14
|
+
export interface FormFieldProps {
|
|
15
|
+
/** Field name for identification */
|
|
16
|
+
name?: string;
|
|
17
|
+
/** Additional class names */
|
|
18
|
+
class?: string;
|
|
19
|
+
children: JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Container for a form field. Provides context for label, control, and message components.
|
|
23
|
+
*/
|
|
24
|
+
export declare function FormField(props: FormFieldProps): JSX.Element;
|
|
25
|
+
export interface FormLabelProps extends JSX.LabelHTMLAttributes<HTMLLabelElement> {
|
|
26
|
+
/** Whether the field is required */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Additional class names */
|
|
29
|
+
class?: string;
|
|
30
|
+
children: JSX.Element;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Label for a form field. Automatically associates with the field control.
|
|
34
|
+
*/
|
|
35
|
+
export declare function FormLabel(props: FormLabelProps): JSX.Element;
|
|
36
|
+
export interface FormControlProps {
|
|
37
|
+
/** Additional class names */
|
|
38
|
+
class?: string;
|
|
39
|
+
children: JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Wrapper for form input elements. Passes field context props to children.
|
|
43
|
+
* Children should accept id, aria-describedby, and aria-invalid props.
|
|
44
|
+
*/
|
|
45
|
+
export declare function FormControl(props: FormControlProps): JSX.Element;
|
|
46
|
+
export interface FormDescriptionProps {
|
|
47
|
+
/** Additional class names */
|
|
48
|
+
class?: string;
|
|
49
|
+
children: JSX.Element;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Helper text displayed below a form field.
|
|
53
|
+
*/
|
|
54
|
+
export declare function FormDescription(props: FormDescriptionProps): JSX.Element;
|
|
55
|
+
export interface FormMessageProps {
|
|
56
|
+
/** Error message to display */
|
|
57
|
+
error?: string;
|
|
58
|
+
/** Additional class names */
|
|
59
|
+
class?: string;
|
|
60
|
+
children?: JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Error or validation message for a form field.
|
|
64
|
+
* Automatically uses field context for accessibility.
|
|
65
|
+
*/
|
|
66
|
+
export declare function FormMessage(props: FormMessageProps): JSX.Element;
|
|
67
|
+
export interface FormActionsProps {
|
|
68
|
+
/** Alignment of action buttons */
|
|
69
|
+
align?: 'start' | 'center' | 'end' | 'between';
|
|
70
|
+
/** Additional class names */
|
|
71
|
+
class?: string;
|
|
72
|
+
children: JSX.Element;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Container for form action buttons (Submit, Cancel, etc.)
|
|
76
|
+
*/
|
|
77
|
+
export declare function FormActions(props: FormActionsProps): JSX.Element;
|
|
78
|
+
export interface FormSectionProps {
|
|
79
|
+
/** Section title */
|
|
80
|
+
title?: string;
|
|
81
|
+
/** Section description */
|
|
82
|
+
description?: string;
|
|
83
|
+
/** Additional class names */
|
|
84
|
+
class?: string;
|
|
85
|
+
children: JSX.Element;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Groups related form fields with an optional title and description.
|
|
89
|
+
*/
|
|
90
|
+
export declare function FormSection(props: FormSectionProps): JSX.Element;
|
|
91
|
+
export interface FormDividerProps {
|
|
92
|
+
/** Optional label text */
|
|
93
|
+
label?: string;
|
|
94
|
+
/** Additional class names */
|
|
95
|
+
class?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Visual divider between form sections.
|
|
99
|
+
*/
|
|
100
|
+
export declare function FormDivider(props: FormDividerProps): JSX.Element;
|
|
101
|
+
export interface FormRowProps {
|
|
102
|
+
/** Number of columns on desktop (default: 2) */
|
|
103
|
+
cols?: 1 | 2 | 3 | 4;
|
|
104
|
+
/** Additional class names */
|
|
105
|
+
class?: string;
|
|
106
|
+
children: JSX.Element;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Horizontal layout for multiple form fields. Stacks on mobile.
|
|
110
|
+
*/
|
|
111
|
+
export declare function FormRow(props: FormRowProps): JSX.Element;
|
|
112
|
+
/**
|
|
113
|
+
* Hook to access form submission state from within the form.
|
|
114
|
+
* Returns undefined if used outside a Form component.
|
|
115
|
+
*/
|
|
116
|
+
export declare function useFormSubmitting(): Accessor<boolean> | undefined;
|
|
@@ -13,4 +13,5 @@ export { type BasePickerProps } from './picker/PickerBase';
|
|
|
13
13
|
export { QuoteBlock, type QuoteBlockProps } from './QuoteBlock';
|
|
14
14
|
export { HighlightBlock, InfoBlock, WarningBlock, SuccessBlock, ErrorBlock, NoteBlock, TipBlock, type HighlightBlockProps, type HighlightVariant, } from './HighlightBlock';
|
|
15
15
|
export { ProcessingIndicator, type ProcessingIndicatorProps, type ProcessingIndicatorVariant, type ProcessingIndicatorStatus, } from './ProcessingIndicator';
|
|
16
|
+
export { Form, FormField, FormLabel, FormControl, FormDescription, FormMessage, FormActions, FormSection, FormDivider, FormRow, useFormSubmitting, type FormProps, type FormFieldProps, type FormLabelProps, type FormControlProps, type FormDescriptionProps, type FormMessageProps, type FormActionsProps, type FormSectionProps, type FormDividerProps, type FormRowProps, } from './Form';
|
|
16
17
|
export { LineChart, AreaChart, DataBarChart, DataPieChart, MonitoringChart, type ChartDataPoint, type ChartSeries, type ChartVariant, type LineChartProps, type AreaChartProps, type DataBarChartProps, type DataPieChartProps, type MonitoringChartProps, } from './Charts';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type JSX, type Accessor } from 'solid-js';
|
|
2
|
+
import type { FileItem } from '../components/file-browser/types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an item being dragged
|
|
5
|
+
*/
|
|
6
|
+
export interface DraggedItem {
|
|
7
|
+
item: FileItem;
|
|
8
|
+
sourceInstanceId: string;
|
|
9
|
+
sourcePath: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Current drop target information
|
|
13
|
+
*/
|
|
14
|
+
export interface DropTarget {
|
|
15
|
+
instanceId: string;
|
|
16
|
+
targetPath: string;
|
|
17
|
+
/** The target folder item, or null if dropping into current directory root */
|
|
18
|
+
targetItem: FileItem | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Global drag state for FileBrowser instances
|
|
22
|
+
*/
|
|
23
|
+
export interface FileBrowserDragState {
|
|
24
|
+
isDragging: boolean;
|
|
25
|
+
draggedItems: DraggedItem[];
|
|
26
|
+
sourceInstanceId: string | null;
|
|
27
|
+
pointerPosition: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
dropTarget: DropTarget | null;
|
|
32
|
+
/** Whether the current drop target is valid */
|
|
33
|
+
isValidDrop: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A registered FileBrowser instance that can participate in drag operations
|
|
37
|
+
*/
|
|
38
|
+
export interface FileBrowserDragInstance {
|
|
39
|
+
instanceId: string;
|
|
40
|
+
currentPath: Accessor<string>;
|
|
41
|
+
files: Accessor<FileItem[]>;
|
|
42
|
+
/** Called when items are dropped onto this instance */
|
|
43
|
+
onDragMove: ((items: FileItem[], targetPath: string, sourceInstanceId: string) => void) | undefined;
|
|
44
|
+
/** Get the scrollable container element for auto-scroll */
|
|
45
|
+
getScrollContainer: () => HTMLElement | null;
|
|
46
|
+
/** Get the sidebar scroll container for auto-scroll */
|
|
47
|
+
getSidebarScrollContainer: () => HTMLElement | null;
|
|
48
|
+
/** Optimistically remove items from display */
|
|
49
|
+
optimisticRemove: (paths: string[]) => void;
|
|
50
|
+
/** Optimistically insert an item */
|
|
51
|
+
optimisticInsert: (parentPath: string, item: FileItem) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Context value for FileBrowser drag operations
|
|
55
|
+
*/
|
|
56
|
+
export interface FileBrowserDragContextValue {
|
|
57
|
+
dragState: Accessor<FileBrowserDragState>;
|
|
58
|
+
registerInstance: (instance: FileBrowserDragInstance) => void;
|
|
59
|
+
unregisterInstance: (instanceId: string) => void;
|
|
60
|
+
getInstance: (instanceId: string) => FileBrowserDragInstance | undefined;
|
|
61
|
+
getInstances: () => Map<string, FileBrowserDragInstance>;
|
|
62
|
+
startDrag: (items: DraggedItem[], x: number, y: number) => void;
|
|
63
|
+
updateDrag: (x: number, y: number) => void;
|
|
64
|
+
setDropTarget: (target: DropTarget | null, isValid: boolean) => void;
|
|
65
|
+
endDrag: (commit: boolean) => void;
|
|
66
|
+
canDropOn: (draggedItems: DraggedItem[], targetPath: string, targetItem: FileItem | null, targetInstanceId: string) => boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface FileBrowserDragProviderProps {
|
|
69
|
+
children: JSX.Element;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Provider for global FileBrowser drag state management.
|
|
73
|
+
* Should be mounted at the application/Deck level to enable cross-component dragging.
|
|
74
|
+
*/
|
|
75
|
+
export declare function FileBrowserDragProvider(props: FileBrowserDragProviderProps): JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* Hook to access FileBrowser drag context.
|
|
78
|
+
* Returns undefined if used outside of FileBrowserDragProvider.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useFileBrowserDrag(): FileBrowserDragContextValue | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Hook to check if FileBrowser drag context is available
|
|
83
|
+
*/
|
|
84
|
+
export declare function hasFileBrowserDragContext(): boolean;
|
package/dist/context/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export { WidgetRegistryProvider, useWidgetRegistry, createWidgetRegistry, type W
|
|
|
9
9
|
export { DeckProvider, useDeck, createDeckService, type DeckWidget, type DeckLayout, type DragState, type ResizeState, type DeckContextValue, } from './DeckContext';
|
|
10
10
|
export { WidgetStateProvider, useWidgetStateContext, useWidgetState, useCurrentWidgetId, type WidgetStateContextValue, type WidgetStateProviderProps, } from './WidgetStateContext';
|
|
11
11
|
export { ViewActivationProvider, useViewActivation, type ViewActivationContextValue, type ViewActivationProviderProps } from './ViewActivationContext';
|
|
12
|
+
export { FileBrowserDragProvider, useFileBrowserDrag, hasFileBrowserDragContext, type DraggedItem, type DropTarget, type FileBrowserDragState, type FileBrowserDragInstance, type FileBrowserDragContextValue, type FileBrowserDragProviderProps, } from './FileBrowserDragContext';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { useResizeObserver, type Size } from './useResizeObserver';
|
|
|
4
4
|
export { useKeybind } from './useKeybind';
|
|
5
5
|
export { usePersisted } from './usePersisted';
|
|
6
6
|
export { useDeckDrag } from './useDeckDrag';
|
|
7
|
+
export { useFileBrowserItemDrag, useFileBrowserDropTarget, type UseFileBrowserItemDragOptions, type FileBrowserItemDragHandlers, type UseFileBrowserDropTargetOptions, type FileBrowserDropTargetResult, } from './useFileBrowserDrag';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
import type { FileItem } from '../components/file-browser/types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the useFileBrowserItemDrag hook
|
|
5
|
+
*/
|
|
6
|
+
export interface UseFileBrowserItemDragOptions {
|
|
7
|
+
/** Instance ID of this FileBrowser */
|
|
8
|
+
instanceId: string;
|
|
9
|
+
/** Get currently selected items */
|
|
10
|
+
getSelectedItems: () => FileItem[];
|
|
11
|
+
/** Current directory path */
|
|
12
|
+
currentPath: Accessor<string>;
|
|
13
|
+
/** Check if an item is selected */
|
|
14
|
+
isSelected: (id: string) => boolean;
|
|
15
|
+
/** Select item on drag start if not already selected */
|
|
16
|
+
selectItem: (id: string, multi: boolean) => void;
|
|
17
|
+
/** Whether drag is enabled */
|
|
18
|
+
enabled?: Accessor<boolean>;
|
|
19
|
+
/** Called when drag starts (for haptic feedback on mobile) */
|
|
20
|
+
onDragStart?: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return value from useFileBrowserItemDrag
|
|
24
|
+
*/
|
|
25
|
+
export interface FileBrowserItemDragHandlers {
|
|
26
|
+
/** Returns true if currently dragging */
|
|
27
|
+
isDragging: Accessor<boolean>;
|
|
28
|
+
/** Props to spread on draggable items */
|
|
29
|
+
getDragHandlers: (item: FileItem) => {
|
|
30
|
+
onPointerDown: (e: PointerEvent) => void;
|
|
31
|
+
'data-draggable': string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hook to add drag behavior to FileBrowser items.
|
|
36
|
+
* Must be used within a FileBrowserDragProvider context.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useFileBrowserItemDrag(options: UseFileBrowserItemDragOptions): FileBrowserItemDragHandlers;
|
|
39
|
+
/**
|
|
40
|
+
* Hook to make an element a drop target for file browser drag operations.
|
|
41
|
+
*/
|
|
42
|
+
export interface UseFileBrowserDropTargetOptions {
|
|
43
|
+
/** Instance ID of this FileBrowser */
|
|
44
|
+
instanceId: string;
|
|
45
|
+
/** The folder item this target represents, or null for current directory root */
|
|
46
|
+
targetItem: Accessor<FileItem | null>;
|
|
47
|
+
/** The target path for dropping */
|
|
48
|
+
targetPath: Accessor<string>;
|
|
49
|
+
/** Whether this drop target is enabled */
|
|
50
|
+
enabled?: Accessor<boolean>;
|
|
51
|
+
}
|
|
52
|
+
export interface FileBrowserDropTargetResult {
|
|
53
|
+
/** Whether this target is currently being hovered during a drag */
|
|
54
|
+
isDropTarget: Accessor<boolean>;
|
|
55
|
+
/** Whether the current drop is valid */
|
|
56
|
+
isValidDrop: Accessor<boolean>;
|
|
57
|
+
/** Props to spread on the drop target element */
|
|
58
|
+
getDropTargetProps: () => {
|
|
59
|
+
onPointerEnter: (e: PointerEvent) => void;
|
|
60
|
+
onPointerLeave: (e: PointerEvent) => void;
|
|
61
|
+
'data-drop-target': string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Hook to make an element a drop target for FileBrowser drag operations.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useFileBrowserDropTarget(options: UseFileBrowserDropTargetOptions): FileBrowserDropTargetResult;
|