@octaviaflow/core 3.1.0-beta.82 → 3.1.0-beta.84
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/ExecutionConsole/ExecutionConsole.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.d.ts +6 -1
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/index.cjs +95 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +295 -245
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionConsole.d.ts","sourceRoot":"","sources":["../../../src/components/ExecutionConsole/ExecutionConsole.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"ExecutionConsole.d.ts","sourceRoot":"","sources":["../../../src/components/ExecutionConsole/ExecutionConsole.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA2D,MAAM,OAAO,CAAC;AAGhG,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;qEACiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,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AAS,GACV,EAAE,qBAAqB,2CAsdvB"}
|
|
@@ -50,6 +50,11 @@ export interface FilePickerProps {
|
|
|
50
50
|
closeOnEsc?: boolean;
|
|
51
51
|
/** Empty-folder copy. */
|
|
52
52
|
emptyTitle?: string;
|
|
53
|
+
/** Display names for opaque paths. Some backends use ids as "paths"
|
|
54
|
+
* (cloud drives) — seed this with known `path → name` pairs (e.g. a saved
|
|
55
|
+
* value's display name) so crumbs and the folder footer never show raw
|
|
56
|
+
* ids. Names discovered while browsing are learned automatically. */
|
|
57
|
+
pathLabels?: Record<string, string>;
|
|
53
58
|
/** Hidden input name for form submission. */
|
|
54
59
|
name?: string;
|
|
55
60
|
form?: string;
|
|
@@ -57,7 +62,7 @@ export interface FilePickerProps {
|
|
|
57
62
|
className?: string;
|
|
58
63
|
"aria-label"?: string;
|
|
59
64
|
}
|
|
60
|
-
export declare function FilePicker({ value: valueProp, defaultValue, onChange, loadChildren, rootPath, rootLabel, separator, selectMode, initialPath, placeholder, disabled, size, error, helperText, label, required, clearable, searchable, onSearch, searchDepth, searchLimit, closeOnEsc, emptyTitle, name, form, id, className, "aria-label": ariaLabel, }: FilePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare function FilePicker({ value: valueProp, defaultValue, onChange, loadChildren, rootPath, rootLabel, separator, selectMode, initialPath, placeholder, disabled, size, error, helperText, label, required, clearable, searchable, onSearch, searchDepth, searchLimit, closeOnEsc, emptyTitle, pathLabels, name, form, id, className, "aria-label": ariaLabel, }: FilePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
61
66
|
export declare namespace FilePicker {
|
|
62
67
|
var displayName: string;
|
|
63
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,YAAY,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CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IACtD,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoDD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,QAAc,EACd,SAAkB,EAClB,SAAe,EACf,UAAmB,EACnB,WAAW,EACX,WAA8B,EAC9B,QAAgB,EAChB,IAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAgB,EAChB,SAAgB,EAChB,UAAkB,EAClB,QAAQ,EACR,WAAe,EACf,WAAiB,EACjB,UAAiB,EACjB,UAAmC,EACnC,IAAI,EACJ,IAAI,EACJ,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgBhD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhD,MAA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oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;0EAGsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAoDD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,SAAS,EAChB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,QAAc,EACd,SAAkB,EAClB,SAAe,EACf,UAAmB,EACnB,WAAW,EACX,WAA8B,EAC9B,QAAgB,EAChB,IAAW,EACX,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAgB,EAChB,SAAgB,EAChB,UAAkB,EAClB,QAAQ,EACR,WAAe,EACf,WAAiB,EACjB,UAAiB,EACjB,UAAmC,EACnC,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,EAAE,EACF,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,eAAe,2CAuhBjB;yBArjBe,UAAU"}
|
package/dist/index.cjs
CHANGED
|
@@ -16544,11 +16544,17 @@ function ExecutionConsole({
|
|
|
16544
16544
|
}, [running]);
|
|
16545
16545
|
(0, import_react86.useEffect)(() => {
|
|
16546
16546
|
if (!open || !autoScroll) return;
|
|
16547
|
+
const logsEl = logsRef.current;
|
|
16548
|
+
if (running && logsEl) {
|
|
16549
|
+
logsEl.scrollTop = logsEl.scrollHeight;
|
|
16550
|
+
lastScrollTopRef.current = logsEl.scrollTop;
|
|
16551
|
+
return;
|
|
16552
|
+
}
|
|
16547
16553
|
const el = logEndRef.current;
|
|
16548
16554
|
if (el && typeof el.scrollIntoView === "function") {
|
|
16549
16555
|
el.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
16550
16556
|
}
|
|
16551
|
-
}, [filteredLogs.length, open, autoScroll]);
|
|
16557
|
+
}, [filteredLogs.length, open, autoScroll, running]);
|
|
16552
16558
|
const handleLogsScroll = () => {
|
|
16553
16559
|
const el = logsRef.current;
|
|
16554
16560
|
if (!el) return;
|
|
@@ -16568,14 +16574,14 @@ function ExecutionConsole({
|
|
|
16568
16574
|
return next;
|
|
16569
16575
|
});
|
|
16570
16576
|
};
|
|
16571
|
-
const toggleLineExpand = (index) => {
|
|
16577
|
+
const toggleLineExpand = (0, import_react86.useCallback)((index) => {
|
|
16572
16578
|
setExpandedLines((prev) => {
|
|
16573
16579
|
const next = new Set(prev);
|
|
16574
16580
|
if (next.has(index)) next.delete(index);
|
|
16575
16581
|
else next.add(index);
|
|
16576
16582
|
return next;
|
|
16577
16583
|
});
|
|
16578
|
-
};
|
|
16584
|
+
}, []);
|
|
16579
16585
|
const handleCopy = () => {
|
|
16580
16586
|
if (onCopy) {
|
|
16581
16587
|
onCopy();
|
|
@@ -16851,38 +16857,17 @@ function ExecutionConsole({
|
|
|
16851
16857
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__empty-title", children: logs.length === 0 ? "No log entries" : "No logs match the filters" }),
|
|
16852
16858
|
logs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__empty-hint", children: "Output will appear here when the step runs." })
|
|
16853
16859
|
] }) }),
|
|
16854
|
-
!loading && filteredLogs.map((log, i) =>
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16863
|
-
|
|
16864
|
-
|
|
16865
|
-
"button",
|
|
16866
|
-
{
|
|
16867
|
-
type: "button",
|
|
16868
|
-
className: "ods-console__line-toggle",
|
|
16869
|
-
onClick: () => toggleLineExpand(i),
|
|
16870
|
-
"aria-label": expanded ? "Collapse log detail" : "Expand log detail",
|
|
16871
|
-
"aria-expanded": expanded,
|
|
16872
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ChevronIcon2, { open: expanded })
|
|
16873
|
-
}
|
|
16874
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__line-toggle ods-console__line-toggle--placeholder" }),
|
|
16875
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__timestamp", children: log.timestamp }),
|
|
16876
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: cn("ods-console__level", `ods-console__level--${log.level}`), children: log.level.toUpperCase() }),
|
|
16877
|
-
log.nodeLabel && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__node-tag", title: log.nodeId, children: log.nodeLabel }),
|
|
16878
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__message", children: q(query, log.message) })
|
|
16879
|
-
] }),
|
|
16880
|
-
canExpand && expanded && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("pre", { className: "ods-console__detail", children: typeof log.detail === "string" ? log.detail : safeStringify(log.detail) })
|
|
16881
|
-
]
|
|
16882
|
-
},
|
|
16883
|
-
i
|
|
16884
|
-
);
|
|
16885
|
-
}),
|
|
16860
|
+
!loading && filteredLogs.map((log, i) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
16861
|
+
ConsoleLine,
|
|
16862
|
+
{
|
|
16863
|
+
log,
|
|
16864
|
+
index: i,
|
|
16865
|
+
expanded: expandedLines.has(i),
|
|
16866
|
+
query,
|
|
16867
|
+
onToggleExpand: toggleLineExpand
|
|
16868
|
+
},
|
|
16869
|
+
i
|
|
16870
|
+
)),
|
|
16886
16871
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { ref: logEndRef })
|
|
16887
16872
|
]
|
|
16888
16873
|
}
|
|
@@ -16891,6 +16876,42 @@ function ExecutionConsole({
|
|
|
16891
16876
|
}
|
|
16892
16877
|
);
|
|
16893
16878
|
}
|
|
16879
|
+
var ConsoleLine = (0, import_react86.memo)(function ConsoleLine2({
|
|
16880
|
+
log,
|
|
16881
|
+
index,
|
|
16882
|
+
expanded,
|
|
16883
|
+
query,
|
|
16884
|
+
onToggleExpand
|
|
16885
|
+
}) {
|
|
16886
|
+
const canExpand = log.detail !== void 0 && log.detail !== null;
|
|
16887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
16888
|
+
"div",
|
|
16889
|
+
{
|
|
16890
|
+
className: cn("ods-console__line", `ods-console__line--${log.level}`),
|
|
16891
|
+
"data-testid": "console-log-line",
|
|
16892
|
+
children: [
|
|
16893
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "ods-console__line-row", children: [
|
|
16894
|
+
canExpand ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
16895
|
+
"button",
|
|
16896
|
+
{
|
|
16897
|
+
type: "button",
|
|
16898
|
+
className: "ods-console__line-toggle",
|
|
16899
|
+
onClick: () => onToggleExpand(index),
|
|
16900
|
+
"aria-label": expanded ? "Collapse log detail" : "Expand log detail",
|
|
16901
|
+
"aria-expanded": expanded,
|
|
16902
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ChevronIcon2, { open: expanded })
|
|
16903
|
+
}
|
|
16904
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__line-toggle ods-console__line-toggle--placeholder" }),
|
|
16905
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__timestamp", children: log.timestamp }),
|
|
16906
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: cn("ods-console__level", `ods-console__level--${log.level}`), children: log.level.toUpperCase() }),
|
|
16907
|
+
log.nodeLabel && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__node-tag", title: log.nodeId, children: log.nodeLabel }),
|
|
16908
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ods-console__message", children: q(query, log.message) })
|
|
16909
|
+
] }),
|
|
16910
|
+
canExpand && expanded && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("pre", { className: "ods-console__detail", children: typeof log.detail === "string" ? log.detail : safeStringify(log.detail) })
|
|
16911
|
+
]
|
|
16912
|
+
}
|
|
16913
|
+
);
|
|
16914
|
+
});
|
|
16894
16915
|
function q(query, text) {
|
|
16895
16916
|
const trimmed = query.trim();
|
|
16896
16917
|
if (!trimmed) return text;
|
|
@@ -19889,6 +19910,7 @@ function FilePicker({
|
|
|
19889
19910
|
searchLimit = 200,
|
|
19890
19911
|
closeOnEsc = true,
|
|
19891
19912
|
emptyTitle = "This folder is empty",
|
|
19913
|
+
pathLabels,
|
|
19892
19914
|
name,
|
|
19893
19915
|
form,
|
|
19894
19916
|
id,
|
|
@@ -19903,6 +19925,8 @@ function FilePicker({
|
|
|
19903
19925
|
const value = valueProp ?? valueState;
|
|
19904
19926
|
const [open, setOpen] = (0, import_react97.useState)(false);
|
|
19905
19927
|
const [navPath, setNavPath] = (0, import_react97.useState)(rootPath);
|
|
19928
|
+
const [trail, setTrail] = (0, import_react97.useState)([]);
|
|
19929
|
+
const [nameByPath, setNameByPath] = (0, import_react97.useState)({});
|
|
19906
19930
|
const [cache, setCache] = (0, import_react97.useState)({});
|
|
19907
19931
|
const cacheRef = (0, import_react97.useRef)(cache);
|
|
19908
19932
|
cacheRef.current = cache;
|
|
@@ -19924,6 +19948,11 @@ function FilePicker({
|
|
|
19924
19948
|
try {
|
|
19925
19949
|
const items2 = await loadChildren(folder);
|
|
19926
19950
|
setCache((prev) => ({ ...prev, [folder]: { status: "loaded", items: items2 } }));
|
|
19951
|
+
setNameByPath((prev) => {
|
|
19952
|
+
const next = { ...prev };
|
|
19953
|
+
for (const it of items2) next[it.path] = it.name;
|
|
19954
|
+
return next;
|
|
19955
|
+
});
|
|
19927
19956
|
return items2;
|
|
19928
19957
|
} catch (e) {
|
|
19929
19958
|
const err = e?.message || "Failed to load folder.";
|
|
@@ -19936,6 +19965,7 @@ function FilePicker({
|
|
|
19936
19965
|
const openAt = (0, import_react97.useCallback)(() => {
|
|
19937
19966
|
const start = initialPath ?? (value ? parentOf(value, rootPath, separator) ?? rootPath : rootPath);
|
|
19938
19967
|
setNavPath(start);
|
|
19968
|
+
setTrail([]);
|
|
19939
19969
|
setQuery("");
|
|
19940
19970
|
setActiveIndex(-1);
|
|
19941
19971
|
setOpen(true);
|
|
@@ -20020,12 +20050,13 @@ function FilePicker({
|
|
|
20020
20050
|
(item) => {
|
|
20021
20051
|
if (item.disabled) return;
|
|
20022
20052
|
if (item.isDirectory) {
|
|
20053
|
+
setTrail((t) => navPath === rootPath ? t : [...t, navPath]);
|
|
20023
20054
|
navigate(item.path);
|
|
20024
20055
|
} else if (canSelectFiles) {
|
|
20025
20056
|
commit(item.path, item);
|
|
20026
20057
|
}
|
|
20027
20058
|
},
|
|
20028
|
-
[navigate, canSelectFiles, commit]
|
|
20059
|
+
[navigate, canSelectFiles, commit, navPath, rootPath]
|
|
20029
20060
|
);
|
|
20030
20061
|
(0, import_react97.useEffect)(() => {
|
|
20031
20062
|
if (!open) return;
|
|
@@ -20058,11 +20089,30 @@ function FilePicker({
|
|
|
20058
20089
|
if (isSearching) return search?.results ?? [];
|
|
20059
20090
|
return [...rawItems].sort(folderFirstThenName);
|
|
20060
20091
|
}, [isSearching, search, rawItems]);
|
|
20092
|
+
const displayName = (0, import_react97.useCallback)(
|
|
20093
|
+
(p) => p === rootPath ? rootLabel : nameByPath[p] ?? pathLabels?.[p] ?? baseName(p, separator),
|
|
20094
|
+
[rootPath, rootLabel, nameByPath, pathLabels, separator]
|
|
20095
|
+
);
|
|
20061
20096
|
const crumbs = (0, import_react97.useMemo)(() => {
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20065
|
-
|
|
20097
|
+
if (navPath === rootPath) return [{ path: rootPath, label: rootLabel }];
|
|
20098
|
+
const derived = ancestorsOf(navPath, rootPath, separator);
|
|
20099
|
+
const derivedValid = derived[derived.length - 1] === navPath;
|
|
20100
|
+
const chain = derivedValid && (derived.length > 2 || trail.length === 0) ? derived : [rootPath, ...trail.filter((p) => p !== rootPath), navPath];
|
|
20101
|
+
return chain.map((p, i) => ({ path: p, label: i === 0 ? rootLabel : displayName(p) }));
|
|
20102
|
+
}, [navPath, rootPath, rootLabel, separator, trail, displayName]);
|
|
20103
|
+
const parent = trail.length ? trail[trail.length - 1] : parentOf(navPath, rootPath, separator);
|
|
20104
|
+
const goUp = (0, import_react97.useCallback)(() => {
|
|
20105
|
+
if (!parent) return;
|
|
20106
|
+
setTrail((t) => t.length ? t.slice(0, -1) : t);
|
|
20107
|
+
navigate(parent);
|
|
20108
|
+
}, [parent, navigate]);
|
|
20109
|
+
const goToCrumb = (0, import_react97.useCallback)(
|
|
20110
|
+
(path, index) => {
|
|
20111
|
+
setTrail(crumbs.slice(1, index).map((c) => c.path));
|
|
20112
|
+
navigate(path);
|
|
20113
|
+
},
|
|
20114
|
+
[crumbs, navigate]
|
|
20115
|
+
);
|
|
20066
20116
|
const onPopoverKeyDown = (e) => {
|
|
20067
20117
|
const inSearch = e.target?.tagName === "INPUT";
|
|
20068
20118
|
if (e.key === "ArrowDown") {
|
|
@@ -20172,7 +20222,7 @@ function FilePicker({
|
|
|
20172
20222
|
className: "ods-file-picker__up",
|
|
20173
20223
|
"aria-label": "Up one folder",
|
|
20174
20224
|
disabled: !parent,
|
|
20175
|
-
onClick:
|
|
20225
|
+
onClick: goUp,
|
|
20176
20226
|
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons36.FolderParentIcon, { size: "sm" })
|
|
20177
20227
|
}
|
|
20178
20228
|
),
|
|
@@ -20189,7 +20239,7 @@ function FilePicker({
|
|
|
20189
20239
|
),
|
|
20190
20240
|
"aria-current": isLast ? "page" : void 0,
|
|
20191
20241
|
disabled: isLast,
|
|
20192
|
-
onClick: () => !isLast &&
|
|
20242
|
+
onClick: () => !isLast && goToCrumb(c.path, i),
|
|
20193
20243
|
children: c.label
|
|
20194
20244
|
}
|
|
20195
20245
|
),
|
|
@@ -20241,7 +20291,7 @@ function FilePicker({
|
|
|
20241
20291
|
{
|
|
20242
20292
|
icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons36.FolderIcon, {}),
|
|
20243
20293
|
title: isSearching ? "No matches" : emptyTitle,
|
|
20244
|
-
description: isSearching ? `Nothing under \u201C${
|
|
20294
|
+
description: isSearching ? `Nothing under \u201C${displayName(navPath) || rootLabel}\u201D matches \u201C${query.trim()}\u201D.` : void 0
|
|
20245
20295
|
}
|
|
20246
20296
|
) }) : items.map((it, i) => {
|
|
20247
20297
|
const active = i === activeIndex;
|
|
@@ -20286,14 +20336,14 @@ function FilePicker({
|
|
|
20286
20336
|
showFooter && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ods-file-picker__footer", children: [
|
|
20287
20337
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "ods-file-picker__footer-path", title: navPath, children: [
|
|
20288
20338
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ods-file-picker__footer-label", children: "Selected" }),
|
|
20289
|
-
navPath
|
|
20339
|
+
displayName(navPath)
|
|
20290
20340
|
] }),
|
|
20291
20341
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
20292
20342
|
"button",
|
|
20293
20343
|
{
|
|
20294
20344
|
type: "button",
|
|
20295
20345
|
className: "ods-file-picker__use",
|
|
20296
|
-
onClick: () => commit(navPath, { name:
|
|
20346
|
+
onClick: () => commit(navPath, { name: displayName(navPath), path: navPath, isDirectory: true }),
|
|
20297
20347
|
children: [
|
|
20298
20348
|
"Use this folder",
|
|
20299
20349
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_icons36.ChevronRightIcon, { size: "sm", "aria-hidden": "true" })
|