@morscherlab/mint-sdk 1.3.0-beta.3 → 1.3.0-beta.4
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/FilePicker.vue.d.ts +4 -1
- package/dist/components/index.js +1 -1
- package/dist/components/internal/FilePickerListInternal.vue.d.ts +2 -0
- package/dist/{components-CvY105kJ.js → components-CF0XMy8W.js} +326 -234
- package/dist/components-CF0XMy8W.js.map +1 -0
- package/dist/composables/createFilePickerAdapter.d.ts +5 -1
- package/dist/composables/filePicker/usePickerNavigation.d.ts +3 -2
- package/dist/composables/index.js +1 -1
- package/dist/composables/useFilePicker.d.ts +4 -1
- package/dist/{composables-DL4Vca7L.js → composables-Dlyz_Aiv.js} +92 -29
- package/dist/{composables-DL4Vca7L.js.map → composables-Dlyz_Aiv.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/install.js +1 -1
- package/dist/{plotly.min-D6Ge6qgX.js → plotly.min-DDhZCNEM.js} +2 -2
- package/dist/{plotly.min-D6Ge6qgX.js.map → plotly.min-DDhZCNEM.js.map} +1 -1
- package/dist/styles.css +32 -1
- package/dist/types/auth.d.ts +4 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/fileBrowserTypes.d.ts +13 -0
- package/dist/types/filePicker.d.ts +8 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/__tests__/components/ActionMenu.test.ts +10 -0
- package/src/__tests__/components/FilePicker.test.ts +65 -1
- package/src/__tests__/composables/createFilePickerAdapter.test.ts +92 -1
- package/src/__tests__/composables/usePickerNavigation.test.ts +61 -1
- package/src/__tests__/composables/usePlatformFilePickerAdapter.test.ts +18 -6
- package/src/components/ActionMenu.vue +10 -2
- package/src/components/FilePicker.vue +42 -0
- package/src/components/internal/FilePickerListInternal.vue +11 -2
- package/src/composables/createFilePickerAdapter.ts +82 -22
- package/src/composables/filePicker/usePickerNavigation.ts +29 -2
- package/src/composables/useFilePicker.ts +8 -1
- package/src/composables/usePlatformFilePickerAdapter.ts +26 -4
- package/src/styles/components/action-menu.css +10 -0
- package/src/styles/components/file-picker.css +23 -1
- package/src/types/auth.ts +4 -0
- package/src/types/components.ts +4 -0
- package/src/types/fileBrowserTypes.ts +15 -0
- package/src/types/filePicker.ts +8 -1
- package/src/types/index.ts +2 -0
- package/dist/components-CvY105kJ.js.map +0 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { PickerAdapter, PickerRequest } from '../types/filePicker';
|
|
2
|
-
import { FileBrowserLocation, FileDirectoryListing, ServerMount } from '../types/fileBrowserTypes';
|
|
2
|
+
import { FileBrowserLocation, FileDirectoryListing, FileDirectoryTree, FileSearchResult, ServerMount } from '../types/fileBrowserTypes';
|
|
3
3
|
export interface FilePickerTransport {
|
|
4
4
|
listMounts(request?: PickerRequest): Promise<ServerMount[]>;
|
|
5
5
|
browse(location: FileBrowserLocation, request?: PickerRequest): Promise<FileDirectoryListing>;
|
|
6
|
+
/** `GET …/filesystem/tree`: one request fills the cache for the subfolders too. */
|
|
7
|
+
tree?(location: FileBrowserLocation, request?: PickerRequest): Promise<FileDirectoryTree>;
|
|
8
|
+
/** `GET …/filesystem/search`: replaces the folder-by-folder search walk. */
|
|
9
|
+
search?(location: FileBrowserLocation, query: string, recursive: boolean, request?: PickerRequest): Promise<FileSearchResult>;
|
|
6
10
|
}
|
|
7
11
|
export interface FilePickerAdapterOptions {
|
|
8
12
|
/** Show this directory's contents directly and prevent navigation outside it. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PickerAdapter, PickerNode, PickerRequest, PickerTreeRow } from '../../types/filePicker';
|
|
2
|
-
export declare function usePickerNavigation(adapter: () => PickerAdapter, request: () => PickerRequest, systemFilter?: (node: PickerNode) => boolean): {
|
|
1
|
+
import { PickerAdapter, PickerNode, PickerRequest, PickerSort, PickerTreeRow } from '../../types/filePicker';
|
|
2
|
+
export declare function usePickerNavigation(adapter: () => PickerAdapter, request: () => PickerRequest, systemFilter?: (node: PickerNode) => boolean, sort?: () => PickerSort | undefined): {
|
|
3
3
|
path: import('vue').ShallowRef<string, string>;
|
|
4
4
|
trail: import('vue').Ref<{
|
|
5
5
|
path: string;
|
|
@@ -87,6 +87,7 @@ export declare function usePickerNavigation(adapter: () => PickerAdapter, reques
|
|
|
87
87
|
expansionErrors: import('vue').Ref<Map<string, string> & Omit<Map<string, string>, keyof Map<any, any>>, Map<string, string> | (Map<string, string> & Omit<Map<string, string>, keyof Map<any, any>>)>;
|
|
88
88
|
loading: import('vue').ShallowRef<boolean, boolean>;
|
|
89
89
|
error: import('vue').ShallowRef<string, string>;
|
|
90
|
+
truncated: import('vue').ShallowRef<boolean, boolean>;
|
|
90
91
|
rows: import('vue').ComputedRef<PickerTreeRow[]>;
|
|
91
92
|
isAllowed: (node: PickerNode) => boolean;
|
|
92
93
|
clear: () => void;
|
|
@@ -3,5 +3,5 @@ import { $r as snapToSlot, An as getControlDefaults, B as toBioTemplateComponent
|
|
|
3
3
|
import { $ as pluginFormDataFromPayload, A as parseDelimitedText, At as getPresenceClientId, B as useRackEditor, Bt as useRovingFocus, C as useExperimentSamples, Ct as controlValuesToComponentBindingsById, Dt as useAppExperiment, E as useSampleGroups, Et as APP_EXPERIMENT_KEY, F as useAutoGroup, Ft as candidateMatchesSearch, G as useDoseCalculator, H as reorderList, I as extractSampleNamesFromDesignData, It as normalizeSearchQuery, J as usePluginJobCenter, K as combinePluginJobSources, L as extractSampleOptionsFromDesignData, Lt as useTextSearch, M as useFileImport, Mt as usePlatformContext, N as validateImportFile, Nt as useTheme, Ot as getInjectedFrontendRevision, P as extractSamplesFromDesignData, Pt as useToast, Q as getPluginPageSelectorItems, R as unwrapExperimentDesignData, Rt as compareSortValues, S as useScheduleDrag, St as controlValuesToComponentBindings, T as useExpansionSet, U as useListReorder, V as REORDER_ANNOUNCER_STYLE, W as useReorderAnnouncer, X as downloadBlob, Y as createPluginClient, Z as downloadPluginEndpoint, _ as toBioTemplateComponentPropsByComponent, _t as defineWellPlateDoseComponentBindings, a as useExperimentSelector, at as buildPluginEndpointUrl, b as useTemplateCollection, bt as defineControlModel, c as DEFAULT_PRESETS, ct as usePluginWorkspace, d as useReagentSeries, dt as useFormBuilder, et as uploadPluginEndpoint, f as useGroupAssignment, ft as evaluateCondition, g as getBioTemplateComponentProps, gt as defineWellPlateControlProps, h as useBioTemplateWorkspace, ht as defineDoseDesignControlModel, i as useAnalysisArtifacts, it as usePluginSettings, j as readFileAsText, jt as usePresenceHeartbeat, k as detectDelimiter, kt as useRuntimeAlignment, l as DEFAULT_UNITS, lt as DEFAULT_MOBILE_VIEWPORT_QUERY, m as useBioTemplatePackWorkspace, mt as defineDoseCalculatorControlProps, nt as usePluginClient, o as useDebouncedWatch, ot as resolvePluginBaseUrl, p as useBioTemplatePresetWorkspace, pt as useForm, q as useJobsStatusTray, rt as usePluginEventStream, s as useProtocolTemplates, st as useRequestSyncState, tt as useCurrentExperiment, u as generateDilutionSeries, ut as useMobileSupportGate, v as useBioTemplateComponents, vt as defineWellPlateDoseControlProps, w as useExperimentData, wt as controlValuesToComponentProps, x as useExperimentSave, y as useBioTemplateControls, yt as useControlWorkspace, z as DEFAULT_COLORS, zt as useSortedItems } from "../validation-B4Y8_eEe.js";
|
|
4
4
|
import { a as useApi, r as AuthenticationRequiredError } from "../experiment-DgllIc3I.js";
|
|
5
5
|
import { t as ANALYSIS_FILE_ARTIFACT_SCHEMA } from "../analysisArtifactTypes-Cy3D0Ipg.js";
|
|
6
|
-
import { a as buildAnalysisArtifactTargetQuery, c as resizedLeadingPanelWidth, d as useManualLayoutResize, f as useWellPlateEditor, h as useAuth, i as encodePlatformPickerPath, l as resizedTrailingPanelWidth, m as usePasskey, n as createFilePickerAdapter, o as parseAnalysisArtifactTarget, p as resolvePluginFrontendBase, r as decodePlatformPickerPath, s as useFileBrowser, t as usePlatformFilePickerAdapter, u as resizedVerticalSplitPercent } from "../composables-
|
|
6
|
+
import { a as buildAnalysisArtifactTargetQuery, c as resizedLeadingPanelWidth, d as useManualLayoutResize, f as useWellPlateEditor, h as useAuth, i as encodePlatformPickerPath, l as resizedTrailingPanelWidth, m as usePasskey, n as createFilePickerAdapter, o as parseAnalysisArtifactTarget, p as resolvePluginFrontendBase, r as decodePlatformPickerPath, s as useFileBrowser, t as usePlatformFilePickerAdapter, u as resizedVerticalSplitPercent } from "../composables-Dlyz_Aiv.js";
|
|
7
7
|
export { ANALYSIS_FILE_ARTIFACT_SCHEMA, APP_EXPERIMENT_KEY, ATOMIC_WEIGHTS, AuthenticationRequiredError, DATE_PRESET_OPTIONS, DEFAULT_COLORS, DEFAULT_MOBILE_VIEWPORT_QUERY, DEFAULT_PRESETS, DEFAULT_UNITS, EXPERIMENT_STATUS_LABELS, EXPERIMENT_STATUS_OPTIONS, EXPERIMENT_STATUS_VARIANT_MAP, REORDER_ANNOUNCER_STYLE, SORT_OPTIONS, addMinutes, buildAnalysisArtifactTargetQuery, buildPluginEndpointUrl, candidateMatchesSearch, combinePluginJobSources, compareSortValues, compareTime, controlValuesToComponentBindings, controlValuesToComponentBindingsById, controlValuesToComponentProps, controlsToFormSchema, controlsToSectionFormSchema, controlsToSectionFormSchemas, controlsToSettingsSchema, controlsToSidebarPanels, controlsToTopBarSettingsConfig, controlsToViewIds, controlsToViewItems, createFilePickerAdapter, createGeneratedAnalysisTransport, createPluginClient, datePresetToISO, decodePlatformPickerPath, defineControlComponentBindings, defineControlModel, defineControls, defineDoseCalculatorControlProps, defineDoseDesignControlModel, defineWellPlateControlProps, defineWellPlateDoseComponentBindings, defineWellPlateDoseControlProps, detectDelimiter, downloadBlob, downloadPluginEndpoint, durationMinutes, encodePlatformPickerPath, evaluateCondition, experimentIdFromRoute, extractSampleNamesFromDesignData, extractSampleOptionsFromDesignData, extractSamplesFromDesignData, findAvailableSlots, findNearestTimeSlotIndex, formatDuration, formatExperimentDate, formatExperimentStatus, formatTime, formatTimeSlot, fromMinutes, generateDilutionSeries, generateTimeSlots, getBioTemplateComponentBindings, getBioTemplateComponentProps, getBioTemplateControlSchema, getControlDefaults, getDefaultControlView, getExperimentStatusVariant, getFieldRegistryEntry, getInjectedFrontendRevision, getPluginPageSelectorItems, getPresenceClientId, getTypeDefault, isTimeInRange, normalizeSearchQuery, parseAnalysisArtifactTarget, parseDelimitedText, parseTime, pluginFormDataFromPayload, rangesOverlap, readFileAsText, reorderList, requireBioTemplateControlSchema, resizedLeadingPanelWidth, resizedTrailingPanelWidth, resizedVerticalSplitPercent, resolveCurrentPluginId, resolveExperimentCode, resolvePluginBaseUrl, resolvePluginFrontendBase, snapToSlot, toBioTemplateComponentBindings, toBioTemplateComponentBindingsById, toBioTemplateComponentProps, toBioTemplateComponentPropsByComponent, toBioTemplateComponentPropsById, toMinutes, unwrapExperimentDesignData, uploadPluginEndpoint, useAnalysisArtifacts, useApi, useAppExperiment, useAuth, useAutoGroup, useBioTemplateComponents, useBioTemplateControls, useBioTemplatePackWorkspace, useBioTemplatePresetWorkspace, useBioTemplateWorkspace, useChemicalFormula, useConcentrationUnits, useControlSchema, useControlWorkspace, useCurrentExperiment, useDebouncedWatch, useDoseCalculator, useEventListener, useExpansionSet, useExperimentData, useExperimentSamples, useExperimentSave, useExperimentSelector, useFileBrowser, useFileImport, useFocusTrap, useForm, useFormBuilder, useGeneratedAnalysis, useGroupAssignment, useJobsStatusTray, useListReorder, useListSelection, useManualLayoutResize, useMenuKeyboard, useMobileSupportGate, usePasskey, usePlatformContext, usePlatformFilePickerAdapter, usePluginClient, usePluginEventStream, usePluginJobCenter, usePluginJobs, usePluginSettings, usePluginWorkspace, usePresenceHeartbeat, useProtocolTemplates, useRackEditor, useReagentSeries, useReorderAnnouncer, useRequestSyncState, useRovingFocus, useRuntimeAlignment, useSampleGroups, useScheduleDrag, useSelectionLimit, useSequenceUtils, useSortedItems, useTemplateCollection, useTextSearch, useTheme, useTimeUtils, useToast, useWellPlateEditor, validateImportFile };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { PickerAdapter, PickerCapabilities, PickerNode, PickerSelection, PickerSelectionMode, PickerSource } from '../types/filePicker';
|
|
2
|
+
import { PickerAdapter, PickerCapabilities, PickerNode, PickerSelection, PickerSelectionMode, PickerSort, PickerSource } from '../types/filePicker';
|
|
3
3
|
import { SegmentedOption } from '../types';
|
|
4
4
|
interface PickerStateProps {
|
|
5
5
|
open: boolean;
|
|
@@ -9,6 +9,7 @@ interface PickerStateProps {
|
|
|
9
9
|
capabilities: PickerCapabilities;
|
|
10
10
|
initialPath: string;
|
|
11
11
|
initialSelection: PickerSelection | null;
|
|
12
|
+
defaultSort: PickerSort;
|
|
12
13
|
systemFilter?: (node: PickerNode, source: PickerSource) => boolean;
|
|
13
14
|
}
|
|
14
15
|
type PickerEmit = {
|
|
@@ -28,6 +29,7 @@ export declare function useFilePicker(props: PickerStateProps, emit: PickerEmit,
|
|
|
28
29
|
source: import('vue').ShallowRef<PickerSource, PickerSource>;
|
|
29
30
|
query: import('vue').ShallowRef<string, string>;
|
|
30
31
|
recursive: import('vue').ShallowRef<boolean, boolean>;
|
|
32
|
+
sort: import('vue').ShallowRef<PickerSort, PickerSort>;
|
|
31
33
|
skipBlanks: import('vue').ShallowRef<boolean, boolean>;
|
|
32
34
|
reviewing: import('vue').ShallowRef<boolean, boolean>;
|
|
33
35
|
nav: {
|
|
@@ -118,6 +120,7 @@ export declare function useFilePicker(props: PickerStateProps, emit: PickerEmit,
|
|
|
118
120
|
expansionErrors: Ref<Map<string, string> & Omit<Map<string, string>, keyof Map<any, any>>, Map<string, string> | (Map<string, string> & Omit<Map<string, string>, keyof Map<any, any>>)>;
|
|
119
121
|
loading: import('vue').ShallowRef<boolean, boolean>;
|
|
120
122
|
error: import('vue').ShallowRef<string, string>;
|
|
123
|
+
truncated: import('vue').ShallowRef<boolean, boolean>;
|
|
121
124
|
rows: import('vue').ComputedRef<import('..').PickerTreeRow[]>;
|
|
122
125
|
isAllowed: (node: PickerNode) => boolean;
|
|
123
126
|
clear: () => void;
|
|
@@ -1092,34 +1092,78 @@ function createFilePickerAdapter(transport, options = {}) {
|
|
|
1092
1092
|
unavailableReason: mount.available === false ? "This mount is offline." : void 0
|
|
1093
1093
|
};
|
|
1094
1094
|
});
|
|
1095
|
+
} else if (transport.tree) {
|
|
1096
|
+
const tree = await transport.tree(location, request);
|
|
1097
|
+
check(request, token);
|
|
1098
|
+
for (const listing of tree.listings ?? []) {
|
|
1099
|
+
const at = {
|
|
1100
|
+
mount_id: listing.mount_id,
|
|
1101
|
+
path: listing.path
|
|
1102
|
+
};
|
|
1103
|
+
validateLocation(at);
|
|
1104
|
+
if (at.mount_id !== location.mount_id) throw new Error("Invalid file picker directory entry.");
|
|
1105
|
+
if (!listing.truncated) listings.set(encodePlatformPickerPath(at.mount_id, at.path), toNodes(at, listing));
|
|
1106
|
+
}
|
|
1107
|
+
const cached = listings.get(key);
|
|
1108
|
+
if (!cached) throw new Error("This directory exceeds the server listing limit. Choose a smaller data directory.");
|
|
1109
|
+
return cached;
|
|
1095
1110
|
} else {
|
|
1096
1111
|
const listing = await transport.browse(location, request);
|
|
1097
1112
|
check(request, token);
|
|
1098
1113
|
if (listing.truncated) throw new Error("This directory exceeds the server listing limit. Choose a smaller data directory.");
|
|
1099
|
-
|
|
1100
|
-
nodes = (listing.entries ?? []).map((entry) => {
|
|
1101
|
-
if (!isRelativePath(entry.path) || !entry.name || entry.path !== `${location.path ? `${location.path}/` : ""}${entry.name}` || entry.name.includes("/")) throw new Error("Invalid file picker directory entry.");
|
|
1102
|
-
const common = {
|
|
1103
|
-
path: encodePlatformPickerPath(location.mount_id, entry.path),
|
|
1104
|
-
parentPath: atRoot ? null : key,
|
|
1105
|
-
parentName: `${mountLabels.get(location.mount_id) ?? location.mount_id}${location.path ? ` / ${location.path}` : ""}`,
|
|
1106
|
-
name: entry.name,
|
|
1107
|
-
bytes: entry.size_bytes,
|
|
1108
|
-
modifiedAt: entry.modified_at
|
|
1109
|
-
};
|
|
1110
|
-
return entry.kind === "directory" ? {
|
|
1111
|
-
...common,
|
|
1112
|
-
kind: "folder"
|
|
1113
|
-
} : {
|
|
1114
|
-
...common,
|
|
1115
|
-
kind: "file",
|
|
1116
|
-
format: pickerFormat(entry.name)
|
|
1117
|
-
};
|
|
1118
|
-
});
|
|
1114
|
+
nodes = toNodes(location, listing);
|
|
1119
1115
|
}
|
|
1120
1116
|
listings.set(key, nodes);
|
|
1121
1117
|
return nodes;
|
|
1122
1118
|
}
|
|
1119
|
+
function toNodes(location, listing) {
|
|
1120
|
+
return (listing.entries ?? []).map((entry) => {
|
|
1121
|
+
if (entry.path !== `${location.path ? `${location.path}/` : ""}${entry.name}`) throw new Error("Invalid file picker directory entry.");
|
|
1122
|
+
return toNode(location.mount_id, entry);
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
/** One entry, parented on the folder its mount-relative path names. */
|
|
1126
|
+
function toNode(mountId, entry) {
|
|
1127
|
+
if (!isRelativePath(entry.path) || !entry.name || entry.name.includes("/") || entry.path !== entry.name && !entry.path.endsWith(`/${entry.name}`)) throw new Error("Invalid file picker directory entry.");
|
|
1128
|
+
const parent = entry.path.slice(0, Math.max(0, entry.path.length - entry.name.length - 1));
|
|
1129
|
+
const atRoot = root && mountId === root.mount_id && parent === root.path;
|
|
1130
|
+
const common = {
|
|
1131
|
+
path: encodePlatformPickerPath(mountId, entry.path),
|
|
1132
|
+
parentPath: atRoot ? null : encodePlatformPickerPath(mountId, parent),
|
|
1133
|
+
parentName: `${mountLabels.get(mountId) ?? mountId}${parent ? ` / ${parent}` : ""}`,
|
|
1134
|
+
name: entry.name,
|
|
1135
|
+
bytes: entry.size_bytes,
|
|
1136
|
+
modifiedAt: entry.modified_at
|
|
1137
|
+
};
|
|
1138
|
+
return entry.kind === "directory" ? {
|
|
1139
|
+
...common,
|
|
1140
|
+
kind: "folder"
|
|
1141
|
+
} : {
|
|
1142
|
+
...common,
|
|
1143
|
+
kind: "file",
|
|
1144
|
+
format: pickerFormat(entry.name)
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
async function serverSearch(query, scope, request) {
|
|
1148
|
+
const token = begin(request);
|
|
1149
|
+
const decoded = scope.path ? decodePlatformPickerPath(scope.path) : void 0;
|
|
1150
|
+
const location = decoded ? {
|
|
1151
|
+
mount_id: decoded.mountId,
|
|
1152
|
+
path: decoded.path
|
|
1153
|
+
} : root;
|
|
1154
|
+
validateLocation(location);
|
|
1155
|
+
const result = await transport.search(location, query, scope.recursive, request);
|
|
1156
|
+
check(request, token);
|
|
1157
|
+
const prefix = location.path ? `${location.path}/` : "";
|
|
1158
|
+
const nodes = (result.entries ?? []).map((entry) => {
|
|
1159
|
+
if (!entry.path.startsWith(prefix) || !scope.recursive && entry.path.slice(prefix.length).includes("/")) throw new Error("Invalid file picker directory entry.");
|
|
1160
|
+
return toNode(location.mount_id, entry);
|
|
1161
|
+
});
|
|
1162
|
+
return result.truncated ? {
|
|
1163
|
+
nodes,
|
|
1164
|
+
truncated: true
|
|
1165
|
+
} : nodes;
|
|
1166
|
+
}
|
|
1123
1167
|
return {
|
|
1124
1168
|
mounts: !root,
|
|
1125
1169
|
mountOf(path) {
|
|
@@ -1133,6 +1177,7 @@ function createFilePickerAdapter(transport, options = {}) {
|
|
|
1133
1177
|
listRoot: async (request) => read("", request, begin(request)),
|
|
1134
1178
|
listChildren: async (path, request) => read(path, request, begin(request)),
|
|
1135
1179
|
async search(query, scope, request) {
|
|
1180
|
+
if (transport.search && (scope.path || root)) return serverSearch(query, scope, request);
|
|
1136
1181
|
const token = begin(request);
|
|
1137
1182
|
const matches = [];
|
|
1138
1183
|
const queue = [scope.path];
|
|
@@ -1144,7 +1189,10 @@ function createFilePickerAdapter(transport, options = {}) {
|
|
|
1144
1189
|
const path = queue.shift();
|
|
1145
1190
|
if (visited.has(path)) continue;
|
|
1146
1191
|
visited.add(path);
|
|
1147
|
-
if (visited.size > 500)
|
|
1192
|
+
if (visited.size > 500) return {
|
|
1193
|
+
nodes: matches,
|
|
1194
|
+
truncated: true
|
|
1195
|
+
};
|
|
1148
1196
|
const nodes = await read(path, currentRequest, token);
|
|
1149
1197
|
check(request, token);
|
|
1150
1198
|
if (currentRequest?.refresh) {
|
|
@@ -1155,7 +1203,10 @@ function createFilePickerAdapter(transport, options = {}) {
|
|
|
1155
1203
|
if (node.name.toLowerCase().includes(needle)) matches.push(node);
|
|
1156
1204
|
if (scope.recursive && node.kind === "folder" && !node.unavailableReason) queue.push(node.path);
|
|
1157
1205
|
}
|
|
1158
|
-
if (matches.length > 1e4)
|
|
1206
|
+
if (matches.length > 1e4) return {
|
|
1207
|
+
nodes: matches.slice(0, 1e4),
|
|
1208
|
+
truncated: true
|
|
1209
|
+
};
|
|
1159
1210
|
}
|
|
1160
1211
|
return matches;
|
|
1161
1212
|
}
|
|
@@ -1163,6 +1214,14 @@ function createFilePickerAdapter(transport, options = {}) {
|
|
|
1163
1214
|
}
|
|
1164
1215
|
//#endregion
|
|
1165
1216
|
//#region src/composables/usePlatformFilePickerAdapter.ts
|
|
1217
|
+
function query(location, request) {
|
|
1218
|
+
const params = new URLSearchParams({
|
|
1219
|
+
mount_id: location.mount_id,
|
|
1220
|
+
path: location.path
|
|
1221
|
+
});
|
|
1222
|
+
if (request?.refresh) params.set("refresh", "true");
|
|
1223
|
+
return params;
|
|
1224
|
+
}
|
|
1166
1225
|
/** Adapt the authenticated MINT mount API without exposing absolute host paths. */
|
|
1167
1226
|
function usePlatformFilePickerAdapter(options = {}) {
|
|
1168
1227
|
const api = useApi({ baseUrl: options.apiBaseUrl ?? getInjectedPlatformContext()?.platformApiUrl });
|
|
@@ -1178,16 +1237,20 @@ function usePlatformFilePickerAdapter(options = {}) {
|
|
|
1178
1237
|
}
|
|
1179
1238
|
},
|
|
1180
1239
|
browse(location, request) {
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
});
|
|
1185
|
-
|
|
1186
|
-
|
|
1240
|
+
return api.get(`/filesystem/browse?${query(location, request)}`, { signal: request?.signal });
|
|
1241
|
+
},
|
|
1242
|
+
tree(location, request) {
|
|
1243
|
+
return api.get(`/filesystem/tree?${query(location, request)}`, { signal: request?.signal });
|
|
1244
|
+
},
|
|
1245
|
+
search(location, text, recursive, request) {
|
|
1246
|
+
const params = query(location, request);
|
|
1247
|
+
params.set("q", text);
|
|
1248
|
+
params.set("recursive", String(recursive));
|
|
1249
|
+
return api.get(`/filesystem/search?${params}`, { signal: request?.signal });
|
|
1187
1250
|
}
|
|
1188
1251
|
}, options);
|
|
1189
1252
|
}
|
|
1190
1253
|
//#endregion
|
|
1191
1254
|
export { buildAnalysisArtifactTargetQuery as a, resizedLeadingPanelWidth as c, useManualLayoutResize as d, useWellPlateEditor as f, useAuth as h, encodePlatformPickerPath as i, resizedTrailingPanelWidth as l, usePasskey as m, createFilePickerAdapter as n, parseAnalysisArtifactTarget as o, resolvePluginFrontendBase as p, decodePlatformPickerPath as r, useFileBrowser as s, usePlatformFilePickerAdapter as t, resizedVerticalSplitPercent as u };
|
|
1192
1255
|
|
|
1193
|
-
//# sourceMappingURL=composables-
|
|
1256
|
+
//# sourceMappingURL=composables-Dlyz_Aiv.js.map
|