pollination-react-io 1.74.1 → 1.74.3
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.
@@ -1,12 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './Card.scss';
|
3
3
|
import { APIClient } from '../../hooks';
|
4
|
+
import { Run } from '@pollination-solutions/pollination-sdk';
|
5
|
+
import { LocalRun } from '../RunDetails.types';
|
4
6
|
export interface FileCardProps {
|
5
7
|
projectOwner?: string;
|
6
8
|
projectName?: string;
|
7
9
|
client?: APIClient;
|
8
|
-
|
9
|
-
runId?: string;
|
10
|
+
run?: Run | LocalRun;
|
10
11
|
label: string;
|
11
12
|
path: string;
|
12
13
|
description: string;
|
@@ -1,12 +1,13 @@
|
|
1
|
+
import { Run } from '@pollination-solutions/pollination-sdk';
|
1
2
|
import { CSSProperties } from 'react';
|
2
3
|
import { APIClient } from '../hooks';
|
3
4
|
import { FileCardProps } from './Cards/FileCard';
|
4
5
|
import { FolderCardProps } from './Cards/FolderCard';
|
6
|
+
import { LocalRun } from './RunDetails.types';
|
5
7
|
export interface RunContentProps {
|
6
8
|
title: string;
|
7
9
|
inputData: any[];
|
8
|
-
|
9
|
-
runId?: string;
|
10
|
+
run?: Run | LocalRun;
|
10
11
|
projectOwner?: string;
|
11
12
|
projectName?: string;
|
12
13
|
client?: APIClient;
|
package/build/index.esm.js
CHANGED
@@ -49758,7 +49758,7 @@ var CADtypeEnum;
|
|
49758
49758
|
})(CADtypeEnum || (CADtypeEnum = {}));
|
49759
49759
|
var FileCard = function (_a) {
|
49760
49760
|
var _b, _c;
|
49761
|
-
var projectOwner = _a.projectOwner, projectName = _a.projectName, client = _a.client,
|
49761
|
+
var projectOwner = _a.projectOwner, projectName = _a.projectName, client = _a.client, run = _a.run, label = _a.label, path = _a.path, file = _a.file, description = _a.description, onClicked = _a.onClicked, _d = _a.isCloud, isCloud = _d === void 0 ? true : _d;
|
49762
49762
|
var host = getHost();
|
49763
49763
|
var fromFileToBase64 = usePollinationPanel().fromFileToBase64;
|
49764
49764
|
var _e = useState(false), open = _e[0], setOpen = _e[1];
|
@@ -49831,11 +49831,13 @@ var FileCard = function (_a) {
|
|
49831
49831
|
setCurrFile(blob);
|
49832
49832
|
setCADintegration(blob);
|
49833
49833
|
setIsLoading(false);
|
49834
|
+
setIsInactive(false);
|
49834
49835
|
});
|
49835
49836
|
})
|
49836
49837
|
.catch(function (err) {
|
49837
49838
|
console.error(err);
|
49838
49839
|
setIsLoading(false);
|
49840
|
+
setIsInactive(true);
|
49839
49841
|
});
|
49840
49842
|
};
|
49841
49843
|
var extension = useMemo(function () {
|
@@ -49878,9 +49880,9 @@ var FileCard = function (_a) {
|
|
49878
49880
|
useEffect(function () {
|
49879
49881
|
if (isCloud) {
|
49880
49882
|
// Generate Blob on click
|
49881
|
-
|
49883
|
+
run && downloadArtifact(path, run.status.job_id)
|
49882
49884
|
.then(function (url) { return fetchAndSet(url); })
|
49883
|
-
.catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description
|
49885
|
+
.catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description }); });
|
49884
49886
|
}
|
49885
49887
|
else {
|
49886
49888
|
// Some inputs has path == null
|
@@ -49894,7 +49896,7 @@ var FileCard = function (_a) {
|
|
49894
49896
|
base64AndFetch(path);
|
49895
49897
|
}
|
49896
49898
|
}
|
49897
|
-
}, [
|
49899
|
+
}, [run, label, path]);
|
49898
49900
|
return React__default.createElement("div", { className: isInactive
|
49899
49901
|
? 'card-param card-folder-inactive'
|
49900
49902
|
: 'card-param card-folder', tabIndex: 0, role: 'button', key: label, onClick: function (event) {
|
@@ -49977,7 +49979,7 @@ var css_248z$2 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --
|
|
49977
49979
|
styleInject(css_248z$2);
|
49978
49980
|
|
49979
49981
|
var RunContent = function (_a) {
|
49980
|
-
var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName,
|
49982
|
+
var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName, run = _a.run, client = _a.client, title = _a.title, style = _a.style, getFileCard = _a.getFileCard, getFolderCard = _a.getFolderCard, _b = _a.isCloud, isCloud = _b === void 0 ? true : _b;
|
49981
49983
|
var _c = useState([]), currData = _c[0], setCurrData = _c[1];
|
49982
49984
|
var fileExplorer = usePollinationPanel().fileExplorer;
|
49983
49985
|
var _d = useState([]), currParams = _d[0], setCurrParams = _d[1];
|
@@ -49994,7 +49996,7 @@ var RunContent = function (_a) {
|
|
49994
49996
|
switch (i.type) {
|
49995
49997
|
case 'StepFileInput':
|
49996
49998
|
case 'StepFileOutput':
|
49997
|
-
files.push({
|
49999
|
+
files.push({ run: run, label: i.name,
|
49998
50000
|
path: i.source.path, description: i.description });
|
49999
50001
|
break;
|
50000
50002
|
case 'StepFolderInput':
|
@@ -50036,10 +50038,10 @@ var RunContent = function (_a) {
|
|
50036
50038
|
};
|
50037
50039
|
return React__default.createElement("div", { className: 'cards-container', style: __assign({}, style) },
|
50038
50040
|
React__default.createElement("h5", { className: 'cards-container-title' }, title || 'Something'),
|
50039
|
-
currFiles.length > 0 && projectOwner && projectName && client &&
|
50041
|
+
currFiles.length > 0 && projectOwner && projectName && client && run && React__default.createElement("div", { style: { padding: '20px' } },
|
50040
50042
|
React__default.createElement("div", { className: 'cards' }, currFiles.map(function (_a, index) {
|
50041
50043
|
var label = _a.label, path = _a.path, description = _a.description;
|
50042
|
-
return React__default.createElement(FileCard, { projectOwner: projectOwner, projectName: projectName,
|
50044
|
+
return React__default.createElement(FileCard, { projectOwner: projectOwner, projectName: projectName, run: run, client: client, key: "filecard-".concat(index), label: label, path: path, description: description, onClicked: onFileClicked, isCloud: isCloud });
|
50043
50045
|
}))),
|
50044
50046
|
currFolders.length > 0 && React__default.createElement("div", { style: { padding: '20px' } },
|
50045
50047
|
React__default.createElement("div", { className: 'cards' }, currFolders.map(function (_a, index) {
|
@@ -50086,11 +50088,11 @@ var RunDetails = function (_a) {
|
|
50086
50088
|
}, [run]);
|
50087
50089
|
return (React__default.createElement("div", null,
|
50088
50090
|
outputs &&
|
50089
|
-
React__default.createElement(RunContent, { title: 'Outputs', inputData: outputs, projectName: projectName, projectOwner: projectOwner,
|
50091
|
+
React__default.createElement(RunContent, { title: 'Outputs', inputData: outputs, projectName: projectName, projectOwner: projectOwner, run: run, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud }),
|
50090
50092
|
recipeInputs &&
|
50091
|
-
React__default.createElement(RunContent, { title: 'Inputs', inputData: recipeInputs, projectName: projectName, projectOwner: projectOwner,
|
50093
|
+
React__default.createElement(RunContent, { title: 'Inputs', inputData: recipeInputs, projectName: projectName, projectOwner: projectOwner, run: run, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud }),
|
50092
50094
|
extraInputs && extraInputs.length > 0 &&
|
50093
|
-
React__default.createElement(RunContent, { title: 'Extra Inputs', inputData: extraInputs, projectName: projectName, projectOwner: projectOwner,
|
50095
|
+
React__default.createElement(RunContent, { title: 'Extra Inputs', inputData: extraInputs, projectName: projectName, projectOwner: projectOwner, run: run, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud })));
|
50094
50096
|
};
|
50095
50097
|
|
50096
50098
|
var css_248z$1 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.run-progress {\n grid-area: runprogress;\n font-size: 0.9rem;\n text-align: left !important;\n}\n\n.run-link {\n grid-area: runlink;\n text-align: right !important;\n font-size: 1rem;\n white-space: nowrap;\n}\n\n.run-details {\n grid-area: rundetails;\n font-size: 0.9rem;\n}\n\n.study-run-container {\n display: grid;\n grid-template-areas: \"runprogress runprogress runprogress runprogress runprogress runlink\" \"rundetails rundetails rundetails rundetails rundetails rundetails\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.75rem;\n transition: box-shadow 0.3s ease 0s, border-color 0.3s ease 0s;\n grid-template-rows: max-content auto;\n border-radius: 6px;\n line-height: 1.5;\n}\n\n.study-run-container:hover {\n cursor: pointer;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 2px -2px, rgba(0, 0, 0, 0.12) 0px 3px 6px 0px, rgba(0, 0, 0, 0.09) 0px 5px 12px 4px;\n}\n\n.run-navigator {\n display: grid;\n grid-template-columns: min-content auto min-content min-content;\n grid-auto-rows: auto;\n align-items: center;\n grid-gap: 0.9rem;\n}\n\n.run-pg-input {\n margin: 0 4px 0 4px;\n padding: 8px 8px;\n text-align: center;\n color: rgba(0, 0, 0, 0.8509803922);\n width: min-content;\n border-radius: 2px;\n font-size: 12px;\n border: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.container-scroll {\n display: inline-flex;\n flex-direction: row;\n overflow-x: auto;\n width: 100%;\n}\n\n.blink-effect {\n animation: blinker 5s linear infinite;\n}\n\n@keyframes blinker {\n 50% {\n border: 0.1rem solid white;\n }\n}";
|