@floegence/floe-webapp-core 0.48.6 → 0.50.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/ui/DirectoryInput.d.ts +6 -27
- package/dist/components/ui/DirectoryInput.js +41 -115
- package/dist/components/ui/DirectoryPicker.d.ts +1 -5
- package/dist/components/ui/DirectoryPicker.js +27 -116
- package/dist/components/ui/FileOpenPicker.js +95 -167
- package/dist/components/ui/FileSavePicker.js +73 -160
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/components/ui/picker/PickerBase.d.ts +58 -176
- package/dist/components/ui/picker/PickerBase.js +273 -490
- package/dist/components/ui/picker/PickerNavigation.d.ts +91 -0
- package/dist/components/ui/picker/PickerNavigation.js +160 -0
- package/dist/full.js +346 -341
- package/dist/styles.css +1 -1
- package/dist/ui.js +120 -115
- package/package.json +1 -1
|
@@ -22,7 +22,8 @@ export { DirectoryPicker, type DirectoryPickerProps } from './DirectoryPicker';
|
|
|
22
22
|
export { DirectoryInput, type DirectoryInputProps, type DirectoryInputSize, } from './DirectoryInput';
|
|
23
23
|
export { FileSavePicker, type FileSavePickerProps } from './FileSavePicker';
|
|
24
24
|
export { FileOpenPicker, normalizeFileOpenSelection, updateFileOpenSelection, type FileOpenPickerProps, type FileOpenPickerSelectionMode, } from './FileOpenPicker';
|
|
25
|
-
export { type BasePickerProps, type
|
|
25
|
+
export { type BasePickerProps, type PickerPanelProps } from './picker/PickerBase';
|
|
26
|
+
export { createFilesystemPickerDataSource, parsePickerPath, formatPickerPath, PickerNavigationError, type PickerRoot, type PickerPathContext, type PickerDataProps, type PickerDirectoryLoader, type PickerCopy, type FilesystemPickerDataSource, } from './picker/PickerNavigation';
|
|
26
27
|
export { QuoteBlock, type QuoteBlockProps } from './QuoteBlock';
|
|
27
28
|
export { HighlightBlock, InfoBlock, WarningBlock, SuccessBlock, ErrorBlock, NoteBlock, TipBlock, type HighlightBlockProps, type HighlightVariant, } from './HighlightBlock';
|
|
28
29
|
export { ProcessingIndicator, type ProcessingIndicatorProps, type ProcessingIndicatorVariant, type ProcessingIndicatorStatus, } from './ProcessingIndicator';
|
|
@@ -1,185 +1,67 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared internals for DirectoryPicker, FileOpenPicker, and FileSavePicker.
|
|
3
|
-
* NOT exported from the package entry — these are implementation details.
|
|
4
|
-
*/
|
|
5
1
|
import { type Accessor, type JSX } from 'solid-js';
|
|
6
|
-
import type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { parsePickerPath, type FilesystemPickerDataSource, type PickerDataProps } from './PickerNavigation';
|
|
3
|
+
export interface PickerPanelProps extends PickerDataProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Props for the actual constrained scrolling viewport, including host interaction markers. */
|
|
6
|
+
scrollViewportProps?: JSX.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
treeMaxHeight?: string;
|
|
8
|
+
onCreateFolder?: (parentPath: string, name: string) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface BasePickerProps extends PickerPanelProps {
|
|
13
11
|
open: boolean;
|
|
14
|
-
/** Callback when open state changes */
|
|
15
12
|
onOpenChange: (open: boolean) => void;
|
|
16
|
-
/** Full file tree data */
|
|
17
|
-
files: FileItem[];
|
|
18
|
-
/** Initial directory path (default: '/') */
|
|
19
|
-
initialPath?: string;
|
|
20
|
-
/** Dialog title - can be a string or JSX element for custom headers */
|
|
21
13
|
title?: string | JSX.Element;
|
|
22
|
-
/** Confirm button text */
|
|
23
14
|
confirmText?: string;
|
|
24
|
-
/** Cancel button text (default: 'Cancel') */
|
|
25
15
|
cancelText?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Callback when user creates a new folder.
|
|
28
|
-
* When provided, a "New Folder" button is shown.
|
|
29
|
-
*/
|
|
30
|
-
onCreateFolder?: (parentPath: string, name: string) => Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Callback when user expands a directory.
|
|
33
|
-
* Use this to dynamically load children for the expanded directory.
|
|
34
|
-
* The path parameter is the internal tree path (not the display path).
|
|
35
|
-
*/
|
|
36
|
-
onExpand?: (path: string) => void | Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Async resolver used when a navigation target may exist outside the current
|
|
39
|
-
* in-memory tree snapshot. A ready result guarantees the target path and its
|
|
40
|
-
* ancestor chain are now represented in `files`.
|
|
41
|
-
*/
|
|
42
|
-
ensurePath?: PickerEnsurePath;
|
|
43
|
-
/** Filter which directories are selectable (return false to grey-out) */
|
|
44
|
-
filter?: (item: FileItem) => boolean;
|
|
45
|
-
/** Label for the home/root directory (default: 'Root') */
|
|
46
|
-
homeLabel?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Real filesystem path of the home directory (e.g. '/home/user').
|
|
49
|
-
* When set, paths display with real filesystem paths.
|
|
50
|
-
*/
|
|
51
|
-
homePath?: string;
|
|
52
|
-
/** Additional CSS class */
|
|
53
16
|
class?: string;
|
|
54
17
|
}
|
|
55
|
-
export declare function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
homePath?: string | Accessor<string | undefined>;
|
|
87
|
-
}
|
|
88
|
-
export interface PickerTreeState {
|
|
89
|
-
selectedPath: Accessor<string>;
|
|
90
|
-
setSelectedPath: (path: string) => void;
|
|
91
|
-
expandedPaths: Accessor<Set<string>>;
|
|
92
|
-
toggleExpand: (path: string) => void;
|
|
18
|
+
export declare function pickerCopy(config: PickerDataProps): {
|
|
19
|
+
path: string;
|
|
20
|
+
go: string;
|
|
21
|
+
roots: string;
|
|
22
|
+
root: string;
|
|
23
|
+
showHidden: string;
|
|
24
|
+
loading: string;
|
|
25
|
+
retry: string;
|
|
26
|
+
empty: string;
|
|
27
|
+
emptyFiles: string;
|
|
28
|
+
invalidPath: string;
|
|
29
|
+
missingPath: string;
|
|
30
|
+
unavailableContext: string;
|
|
31
|
+
loadFailed: string;
|
|
32
|
+
currentDirectory: string;
|
|
33
|
+
newFolder: string;
|
|
34
|
+
folderName: string;
|
|
35
|
+
create: string;
|
|
36
|
+
cancel: string;
|
|
37
|
+
fileName: string;
|
|
38
|
+
fileNameRequired: string;
|
|
39
|
+
noFilesSelected: string;
|
|
40
|
+
selectionLimit: string;
|
|
41
|
+
selectedCount: (count: number) => string;
|
|
42
|
+
};
|
|
43
|
+
export declare function pickerErrorMessage(props: PickerDataProps, error: unknown): string;
|
|
44
|
+
/** One owner for dialog and embedded pickers. Identity changes close the previous session first. */
|
|
45
|
+
export declare function usePickerNavigation(props: PickerDataProps, open: Accessor<boolean>, onValidated?: (path: string) => void, onReset?: () => void): {
|
|
46
|
+
context: Accessor<import("./PickerNavigation").PickerPathContext | null>;
|
|
47
|
+
currentPath: Accessor<string>;
|
|
48
|
+
entries: Accessor<readonly import("../..").FileItem[]>;
|
|
93
49
|
pathInput: Accessor<string>;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
handleBreadcrumbClick: (path: string) => void;
|
|
113
|
-
/** Home label for display (reactive) */
|
|
114
|
-
homeLabel: Accessor<string>;
|
|
115
|
-
/** Convert internal tree path to display (real filesystem) path */
|
|
116
|
-
toDisplayPath: (internalPath: string) => string;
|
|
117
|
-
/** Monotonic counter used to reveal the selected row after async navigation. */
|
|
118
|
-
revealNonce: Accessor<number>;
|
|
119
|
-
}
|
|
120
|
-
export type PickerPathResolveStatus = 'ready' | 'missing' | 'error';
|
|
121
|
-
export type PickerPathNavigateReason = 'open' | 'path-input' | 'tree-expand' | 'tree-select' | 'breadcrumb';
|
|
122
|
-
export interface PickerEnsurePathOptions {
|
|
123
|
-
reason: PickerPathNavigateReason;
|
|
124
|
-
}
|
|
125
|
-
export interface PickerPathResolveResult {
|
|
126
|
-
status: PickerPathResolveStatus;
|
|
127
|
-
resolvedPath: string;
|
|
128
|
-
message?: string;
|
|
129
|
-
}
|
|
130
|
-
export type PickerEnsurePath = (path: string, options: PickerEnsurePathOptions) => PickerPathResolveResult | Promise<PickerPathResolveResult>;
|
|
131
|
-
export declare function resolvePickerInitialPath(initialPath: string | undefined, homePath: string | undefined): string;
|
|
132
|
-
export declare function usePickerTree(opts: UsePickerTreeOptions): PickerTreeState;
|
|
133
|
-
export interface NewFolderSectionProps {
|
|
134
|
-
parentPath: Accessor<string>;
|
|
135
|
-
onCreateFolder: (parentPath: string, name: string) => Promise<void>;
|
|
136
|
-
/** Optional function to convert internal path to display path */
|
|
137
|
-
toDisplayPath?: (internalPath: string) => string;
|
|
138
|
-
}
|
|
139
|
-
export declare function NewFolderSection(props: NewFolderSectionProps): JSX.Element;
|
|
140
|
-
export interface PathInputBarProps {
|
|
141
|
-
value: Accessor<string>;
|
|
142
|
-
onInput: (value: string) => void;
|
|
143
|
-
pending?: Accessor<boolean>;
|
|
144
|
-
error: Accessor<string>;
|
|
145
|
-
onGo: () => void;
|
|
146
|
-
onKeyDown: (e: KeyboardEvent) => void;
|
|
147
|
-
placeholder?: string;
|
|
148
|
-
}
|
|
149
|
-
export declare function PathInputBar(props: PathInputBarProps): JSX.Element;
|
|
150
|
-
export interface PickerBreadcrumbProps {
|
|
151
|
-
segments: Accessor<{
|
|
152
|
-
name: string;
|
|
153
|
-
path: string;
|
|
154
|
-
}[]>;
|
|
155
|
-
onClick: (path: string) => void;
|
|
156
|
-
}
|
|
157
|
-
export declare function PickerBreadcrumb(props: PickerBreadcrumbProps): JSX.Element;
|
|
158
|
-
export interface PickerFolderTreeProps {
|
|
159
|
-
rootFolders: Accessor<FileItem[]>;
|
|
160
|
-
selectedPath: Accessor<string>;
|
|
161
|
-
expandedPaths: Accessor<Set<string>>;
|
|
162
|
-
revealNonce?: Accessor<number>;
|
|
163
|
-
onToggle: (path: string) => void;
|
|
164
|
-
onSelect: (item: FileItem) => void;
|
|
165
|
-
onSelectRoot: () => void;
|
|
166
|
-
isSelectable: (item: FileItem) => boolean;
|
|
167
|
-
class?: string;
|
|
168
|
-
style?: JSX.CSSProperties;
|
|
169
|
-
emptyText?: string;
|
|
170
|
-
/** Label for the home/root directory (default: 'Root'). Supports accessor for reactivity. */
|
|
171
|
-
homeLabel?: string | Accessor<string>;
|
|
172
|
-
}
|
|
173
|
-
export declare function PickerFolderTree(props: PickerFolderTreeProps): JSX.Element;
|
|
174
|
-
export interface PickerTreeNodeProps {
|
|
175
|
-
item: FileItem;
|
|
176
|
-
depth: number;
|
|
177
|
-
selectedPath: Accessor<string>;
|
|
178
|
-
expandedPaths: Accessor<Set<string>>;
|
|
179
|
-
revealNonce?: Accessor<number>;
|
|
180
|
-
onToggle: (path: string) => void;
|
|
181
|
-
onSelect: (item: FileItem) => void;
|
|
182
|
-
isSelectable: (item: FileItem) => boolean;
|
|
183
|
-
registerRow: (path: string, el: HTMLButtonElement | null) => void;
|
|
184
|
-
}
|
|
185
|
-
export declare function PickerTreeNode(props: PickerTreeNodeProps): JSX.Element;
|
|
50
|
+
pending: Accessor<boolean>;
|
|
51
|
+
error: Accessor<unknown>;
|
|
52
|
+
showHidden: Accessor<boolean>;
|
|
53
|
+
active: Accessor<boolean>;
|
|
54
|
+
valid: () => boolean;
|
|
55
|
+
open: (path?: string) => Promise<void>;
|
|
56
|
+
close: () => void;
|
|
57
|
+
navigate: (rawPath: string) => Promise<boolean>;
|
|
58
|
+
setPathInput(value: string): void;
|
|
59
|
+
setShowHidden(value: boolean): Promise<void>;
|
|
60
|
+
retry(): Promise<void>;
|
|
61
|
+
};
|
|
62
|
+
/** Absolute directory navigation shared by all picker presentations. */
|
|
63
|
+
export declare function PickerPanel(props: PickerPanelProps & {
|
|
64
|
+
source: FilesystemPickerDataSource;
|
|
65
|
+
}): JSX.Element;
|
|
66
|
+
export declare const normalizePath: typeof parsePickerPath;
|
|
67
|
+
export { pickerParentPath as getParentPath } from './PickerNavigation';
|