pollination-react-io 1.58.1 → 1.59.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.
@@ -7,4 +7,5 @@ export declare const usePollinationPanel: () => {
7
7
  getFilesFromDir: (root: any) => PanelMessageOut;
8
8
  fetchLocalRun: (path?: any) => Run;
9
9
  fetchLocalJob: (path?: any) => Job;
10
+ fileExplorer: (root: string) => PanelMessageOut;
10
11
  };
@@ -38005,6 +38005,11 @@ var usePollinationPanel = function () {
38005
38005
  return;
38006
38006
  return panel.FromFileToBase64(filePath);
38007
38007
  }, [panel]);
38008
+ var fileExplorer = useCallback(function (root) {
38009
+ if (!panel)
38010
+ return;
38011
+ return panel.FileExplorer(root);
38012
+ }, [panel]);
38008
38013
  var fetchLocalRun = useCallback(function (path) {
38009
38014
  if (path === void 0) { path = ''; }
38010
38015
  if (!panel)
@@ -38040,7 +38045,8 @@ var usePollinationPanel = function () {
38040
38045
  fromFileToBase64: fromFileToBase64,
38041
38046
  getFilesFromDir: getFilesFromDir,
38042
38047
  fetchLocalRun: fetchLocalRun,
38043
- fetchLocalJob: fetchLocalJob
38048
+ fetchLocalJob: fetchLocalJob,
38049
+ fileExplorer: fileExplorer
38044
38050
  };
38045
38051
  };
38046
38052
 
@@ -48723,7 +48729,7 @@ var RunCard = function (_a) {
48723
48729
  var _b;
48724
48730
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
48725
48731
  var projectName = _a.projectName, projectOwner = _a.projectOwner, _run = _a.run, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, getTab = _a.getTab, defaultTab = _a.defaultTab, getValue = _a.getValue, _o = _a.interval, interval = _o === void 0 ? 5000 : _o, _p = _a.canWrite, canWrite = _p === void 0 ? false : _p, _q = _a.localRun, localRun = _q === void 0 ? false : _q, _r = _a.loaderNode, loaderNode = _r === void 0 ? undefined : _r;
48726
- var _s = usePollinationPanel(), fetchLocalRun = _s.fetchLocalRun, fetchLocalJob = _s.fetchLocalJob;
48732
+ var _s = usePollinationPanel(), fetchLocalRun = _s.fetchLocalRun, fetchLocalJob = _s.fetchLocalJob, fileExplorer = _s.fileExplorer;
48727
48733
  var disabled = useMemo(function () {
48728
48734
  if (!localRun)
48729
48735
  return;
@@ -48899,9 +48905,14 @@ var RunCard = function (_a) {
48899
48905
  React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
48900
48906
  e.stopPropagation();
48901
48907
  getTab(RunTabs.workspace);
48902
- toggleHover(RunTabs.workspace, true);
48903
- toggleHover(RunTabs.details, false);
48904
- toggleHover(RunTabs.debug, false);
48908
+ if (localRun) {
48909
+ fileExplorer(_run.id);
48910
+ }
48911
+ else {
48912
+ toggleHover(RunTabs.workspace, true);
48913
+ toggleHover(RunTabs.details, false);
48914
+ toggleHover(RunTabs.debug, false);
48915
+ }
48905
48916
  }, onMouseOver: function (e) {
48906
48917
  toggleHover('workspaceOver', true);
48907
48918
  }, onMouseLeave: function (e) {
@@ -49532,6 +49543,7 @@ styleInject(css_248z$2);
49532
49543
  var RunContent = function (_a) {
49533
49544
  var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName, studyId = _a.studyId, runId = _a.runId, client = _a.client, title = _a.title, style = _a.style, getFileCard = _a.getFileCard, getFolderCard = _a.getFolderCard, _b = _a.isCloud, isCloud = _b === void 0 ? true : _b;
49534
49545
  var _c = useState([]), currData = _c[0], setCurrData = _c[1];
49546
+ var fileExplorer = usePollinationPanel().fileExplorer;
49535
49547
  var _d = useState([]), currParams = _d[0], setCurrParams = _d[1];
49536
49548
  var _e = useState([]), currFiles = _e[0], setCurrFiles = _e[1];
49537
49549
  var _f = useState([]), currFolders = _f[0], setCurrFolders = _f[1];
@@ -49581,14 +49593,9 @@ var RunContent = function (_a) {
49581
49593
  * @param card Folder card props
49582
49594
  */
49583
49595
  var onFolderClicked = function (card) {
49584
- if (isCloud) {
49585
- getFolderCard(card);
49586
- // window.location.href = `/${projectOwner}/projects/${projectName}/studies/${studyId}/runs/${runId}/workspace?path=${card.path}`
49587
- }
49588
- else {
49589
- // TODO: Fix it later when Local is ready
49590
- getFolderCard(card);
49591
- // alert(runId.concat('/').concat(card.path))
49596
+ getFolderCard(card);
49597
+ if (!isCloud) {
49598
+ fileExplorer(card.path);
49592
49599
  }
49593
49600
  };
49594
49601
  return React__default.createElement("div", { className: 'cards-container', style: __assign({}, style) },