pollination-react-io 1.74.0 → 1.74.2

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
- studyId?: string;
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
- studyId?: string;
9
- runId?: string;
10
+ run?: Run | LocalRun;
10
11
  projectOwner?: string;
11
12
  projectName?: string;
12
13
  client?: APIClient;
@@ -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, studyId = _a.studyId, runId = _a.runId, label = _a.label, path = _a.path, file = _a.file, description = _a.description, onClicked = _a.onClicked, _d = _a.isCloud, isCloud = _d === void 0 ? true : _d;
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];
@@ -49878,9 +49878,9 @@ var FileCard = function (_a) {
49878
49878
  useEffect(function () {
49879
49879
  if (isCloud) {
49880
49880
  // Generate Blob on click
49881
- studyId && downloadArtifact(path, studyId)
49881
+ run && downloadArtifact(path, run.status.job_id)
49882
49882
  .then(function (url) { return fetchAndSet(url); })
49883
- .catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description, runId: runId }); });
49883
+ .catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description }); });
49884
49884
  }
49885
49885
  else {
49886
49886
  // Some inputs has path == null
@@ -49894,7 +49894,7 @@ var FileCard = function (_a) {
49894
49894
  base64AndFetch(path);
49895
49895
  }
49896
49896
  }
49897
- }, [studyId, runId, label, path]);
49897
+ }, [run, label, path]);
49898
49898
  return React__default.createElement("div", { className: isInactive
49899
49899
  ? 'card-param card-folder-inactive'
49900
49900
  : 'card-param card-folder', tabIndex: 0, role: 'button', key: label, onClick: function (event) {
@@ -49943,10 +49943,10 @@ var FileCard = function (_a) {
49943
49943
  // @ts-ignore
49944
49944
  defaultAction: Action$1.preview, optionsConfig: {
49945
49945
  add: true,
49946
- delete: false,
49946
+ delete: (host === 'revit'),
49947
49947
  'subscribe-preview': false,
49948
- clear: true,
49949
- preview: true
49948
+ clear: (host !== 'revit'),
49949
+ preview: (host !== 'revit')
49950
49950
  }, key: CADdata.id, defaultKey: CADdata.id })),
49951
49951
  open && React__default.createElement("div", { className: 'card-description' }, description));
49952
49952
  };
@@ -49977,7 +49977,7 @@ var css_248z$2 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --
49977
49977
  styleInject(css_248z$2);
49978
49978
 
49979
49979
  var RunContent = function (_a) {
49980
- 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;
49980
+ 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
49981
  var _c = useState([]), currData = _c[0], setCurrData = _c[1];
49982
49982
  var fileExplorer = usePollinationPanel().fileExplorer;
49983
49983
  var _d = useState([]), currParams = _d[0], setCurrParams = _d[1];
@@ -49994,7 +49994,7 @@ var RunContent = function (_a) {
49994
49994
  switch (i.type) {
49995
49995
  case 'StepFileInput':
49996
49996
  case 'StepFileOutput':
49997
- files.push({ runId: runId, label: i.name,
49997
+ files.push({ run: run, label: i.name,
49998
49998
  path: i.source.path, description: i.description });
49999
49999
  break;
50000
50000
  case 'StepFolderInput':
@@ -50036,10 +50036,10 @@ var RunContent = function (_a) {
50036
50036
  };
50037
50037
  return React__default.createElement("div", { className: 'cards-container', style: __assign({}, style) },
50038
50038
  React__default.createElement("h5", { className: 'cards-container-title' }, title || 'Something'),
50039
- currFiles.length > 0 && projectOwner && projectName && client && runId && React__default.createElement("div", { style: { padding: '20px' } },
50039
+ currFiles.length > 0 && projectOwner && projectName && client && run && React__default.createElement("div", { style: { padding: '20px' } },
50040
50040
  React__default.createElement("div", { className: 'cards' }, currFiles.map(function (_a, index) {
50041
50041
  var label = _a.label, path = _a.path, description = _a.description;
50042
- return React__default.createElement(FileCard, { projectOwner: projectOwner, projectName: projectName, studyId: studyId, runId: runId, client: client, key: "filecard-".concat(index), label: label, path: path, description: description, onClicked: onFileClicked, isCloud: isCloud });
50042
+ 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
50043
  }))),
50044
50044
  currFolders.length > 0 && React__default.createElement("div", { style: { padding: '20px' } },
50045
50045
  React__default.createElement("div", { className: 'cards' }, currFolders.map(function (_a, index) {
@@ -50086,11 +50086,11 @@ var RunDetails = function (_a) {
50086
50086
  }, [run]);
50087
50087
  return (React__default.createElement("div", null,
50088
50088
  outputs &&
50089
- React__default.createElement(RunContent, { title: 'Outputs', inputData: outputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud }),
50089
+ 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
50090
  recipeInputs &&
50091
- React__default.createElement(RunContent, { title: 'Inputs', inputData: recipeInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud }),
50091
+ 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
50092
  extraInputs && extraInputs.length > 0 &&
50093
- React__default.createElement(RunContent, { title: 'Extra Inputs', inputData: extraInputs, projectName: projectName, projectOwner: projectOwner, studyId: run.status.job_id, runId: run.id, client: client, style: style, getFileCard: getFileCard, getFolderCard: getFolderCard, isCloud: isCloud })));
50093
+ 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
50094
  };
50095
50095
 
50096
50096
  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}";