pollination-react-io 1.68.0 → 1.68.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.
- package/build/index.esm.js +39 -35
- package/build/index.esm.js.map +1 -1
- package/build/index.js +39 -35
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -44748,6 +44748,7 @@ var RecipeForm = function (_a) {
|
|
44748
44748
|
var _b, _c;
|
44749
44749
|
var recipe = _a.recipe, projectName = _a.projectName, projectOwner = _a.projectOwner, client = _a.client, onSubmit = _a.onSubmit, _d = _a.style, style = _d === void 0 ? {} : _d;
|
44750
44750
|
var getJob = usePollinationPanel().getJob;
|
44751
|
+
var _e = useState(false), loading = _e[0], setLoading = _e[1];
|
44751
44752
|
/**
|
44752
44753
|
* Input mapping
|
44753
44754
|
*/
|
@@ -44788,17 +44789,18 @@ var RecipeForm = function (_a) {
|
|
44788
44789
|
/**
|
44789
44790
|
* Hooks
|
44790
44791
|
*/
|
44791
|
-
var
|
44792
|
+
var _f = useForm({
|
44792
44793
|
resolver: Oe(schema),
|
44793
44794
|
mode: 'onChange'
|
44794
|
-
}), control =
|
44795
|
+
}), control = _f.control, register = _f.register, handleSubmit = _f.handleSubmit, resetField = _f.resetField, watch = _f.watch, _g = _f.formState, errors = _g.errors, isValid = _g.isValid;
|
44795
44796
|
var watchStudyName = watch('study-name');
|
44796
44797
|
/**
|
44797
44798
|
* Form actions
|
44798
44799
|
* @param data Output data
|
44799
44800
|
*/
|
44800
44801
|
var _onSubmit = function (data) {
|
44801
|
-
console.log(data)
|
44802
|
+
// console.log(data)
|
44803
|
+
setLoading(true);
|
44802
44804
|
// Get study name and description
|
44803
44805
|
// Remove them from inputs
|
44804
44806
|
var studyName = data['study-name'];
|
@@ -44811,7 +44813,10 @@ var RecipeForm = function (_a) {
|
|
44811
44813
|
if (!val)
|
44812
44814
|
delete data[key];
|
44813
44815
|
});
|
44814
|
-
onSubmit(studyName, data, studyDescription, localConfig)
|
44816
|
+
onSubmit(studyName, data, studyDescription, localConfig)
|
44817
|
+
.finally(function () {
|
44818
|
+
setLoading(false);
|
44819
|
+
});
|
44815
44820
|
};
|
44816
44821
|
var onErrors = function (err) {
|
44817
44822
|
console.log(err);
|
@@ -44864,7 +44869,7 @@ var RecipeForm = function (_a) {
|
|
44864
44869
|
/**
|
44865
44870
|
* Local study
|
44866
44871
|
*/
|
44867
|
-
var
|
44872
|
+
var _h = useState(__assign(__assign({}, _defaultConfig), { cloudProjectName: projectName, cloudProjectOwner: projectOwner })), localConfig = _h[0], setLocalConfig = _h[1];
|
44868
44873
|
/**
|
44869
44874
|
* Warning for local study folder
|
44870
44875
|
*/
|
@@ -44960,13 +44965,13 @@ var RecipeForm = function (_a) {
|
|
44960
44965
|
React__default.createElement(Ie, null),
|
44961
44966
|
host === 'web' && React__default.createElement(Button, { type: 'submit', style: { width: '100%',
|
44962
44967
|
margin: '10px 0 0 0',
|
44963
|
-
justifyContent: 'center' }, disabled: isValid
|
44968
|
+
justifyContent: 'center' }, disabled: !isValid || loading, form: recipe.metadata.name, loading: loading }, "Create Study"),
|
44964
44969
|
host !== 'web' && React__default.createElement(Button, { type: 'submit', style: { width: '100%',
|
44965
44970
|
margin: '10px 0 0 0',
|
44966
|
-
justifyContent: 'center' }, disabled: isValid
|
44971
|
+
justifyContent: 'center' }, disabled: !isValid || loading ||
|
44967
44972
|
localConfig.isLocalJob
|
44968
44973
|
? localConfig.localRunFolder == null
|
44969
|
-
: false, form: recipe.metadata.name }, "Create Study")));
|
44974
|
+
: false, form: recipe.metadata.name, loading: loading }, "Create Study")));
|
44970
44975
|
};
|
44971
44976
|
|
44972
44977
|
var defaultStyle = {
|
@@ -47218,7 +47223,7 @@ var JobTabs;
|
|
47218
47223
|
JobTabs["workspace"] = "workspace";
|
47219
47224
|
})(JobTabs || (JobTabs = {}));
|
47220
47225
|
|
47221
|
-
var css_248z$6 = ":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.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space:
|
47226
|
+
var css_248z$6 = ":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.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item4 {\n grid-area: date;\n color: var(--slate10);\n font-size: 0.9rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: right !important;\n}\n\n.item5 {\n grid-area: author;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item6 {\n grid-area: recipe;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item7 {\n grid-area: description;\n white-space: wrap;\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.item8 {\n grid-area: status;\n font-size: 0.9rem;\n}\n\n.status-label {\n font-weight: 500;\n}\n\n.item9 {\n grid-area: time;\n text-align: right !important;\n white-space: wrap;\n}\n\n.item10 {\n grid-area: cpu;\n text-align: right !important;\n white-space: wrap;\n}\n\n.link {\n text-decoration: none;\n color: var(--primary3);\n cursor: pointer;\n}\n\n.link:hover {\n color: var(--primary3);\n}\n\n.light-text {\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun date date\" \"author recipe recipe recipe recipe recipe\" \"status status status status cpu time\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.35rem;\n transition: box-shadow 0.3s ease 0s, border-color 0.3s ease 0s;\n grid-template-rows: 52px 38px 46px 46px auto;\n border-radius: 6px;\n line-height: 1.5;\n}\n\n.grid-container:hover {\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 cursor: pointer;\n}\n\n.disable-click {\n box-shadow: none !important;\n cursor: default !important;\n}\n\n.grid-container > div {\n text-align: left;\n padding: 1rem;\n vertical-align: middle;\n}\n\n.description-expander {\n all: unset;\n}\n\n.description-expander:focus {\n outline: 0 !important;\n}\n\n@media (max-width: 600px) {\n .grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun studyrun studyrun\" \"date date date date date date\" \"author author author recipe recipe recipe\" \"status status status status status status\" \"time time time cpu cpu cpu\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.15rem;\n transition: box-shadow 0.3s;\n grid-template-rows: 52px 52px 32px 32px 32px 32px auto;\n }\n .item1 {\n text-align: left !important;\n }\n .item2 {\n text-align: right !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item3, .item4 {\n text-align: center !important;\n }\n .item5 {\n font-size: 0.8rem;\n }\n .item6 {\n white-space: nowrap;\n font-size: 0.8rem;\n }\n .item7 {\n font-size: 0.8rem;\n text-align: center !important;\n }\n .item8 {\n font-size: 1rem;\n text-align: center !important;\n }\n .item9 {\n text-align: left !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item10 {\n text-align: right !important;\n }\n .grid-container > div {\n text-align: left;\n vertical-align: middle;\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}";
|
47222
47227
|
styleInject(css_248z$6);
|
47223
47228
|
|
47224
47229
|
var IconContext = /*#__PURE__*/createContext({});
|
@@ -48948,15 +48953,15 @@ var StudyCard = function (_a) {
|
|
48948
48953
|
? '#40a9ff' : '#000')
|
48949
48954
|
} }))))),
|
48950
48955
|
React__default.createElement("div", { className: 'item3' },
|
48951
|
-
React__default.createElement("
|
48956
|
+
React__default.createElement("button", { style: { all: 'unset', margin: '0 8px 0 0', cursor: 'pointer' }, title: 'See study info', onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
48957
|
+
e.stopPropagation();
|
48958
|
+
setSeeDescription(function (prev) { return !prev; });
|
48959
|
+
setSeeAction(false);
|
48960
|
+
} },
|
48961
|
+
React__default.createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })),
|
48962
|
+
React__default.createElement("span", null,
|
48952
48963
|
study ? (_g = study.spec.name) !== null && _g !== void 0 ? _g : "Study: ".concat(study.id) : '--',
|
48953
|
-
study && total > 1 && "(#".concat(total, ")"),
|
48954
|
-
React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px', cursor: 'pointer' }, title: 'See study info', onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
48955
|
-
e.stopPropagation();
|
48956
|
-
setSeeDescription(function (prev) { return !prev; });
|
48957
|
-
setSeeAction(false);
|
48958
|
-
} },
|
48959
|
-
React__default.createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })))),
|
48964
|
+
study && total > 1 && "(#".concat(total, ")"))),
|
48960
48965
|
React__default.createElement("div", { className: 'item4', title: study && dayjs_min(study.status.started_at).format('[on] MMM DD YYYY [at] hh:mm') }, study ? dayjs_min(study.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
48961
48966
|
React__default.createElement("div", { className: 'item5' },
|
48962
48967
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
@@ -49270,28 +49275,27 @@ var RunCard = function (_a) {
|
|
49270
49275
|
? '#40a9ff' : '#000')
|
49271
49276
|
} }))))),
|
49272
49277
|
React__default.createElement("div", { className: 'item3' },
|
49273
|
-
React__default.createElement("
|
49274
|
-
|
49275
|
-
|
49276
|
-
|
49277
|
-
|
49278
|
-
|
49279
|
-
|
49280
|
-
|
49281
|
-
|
49282
|
-
|
49283
|
-
|
49284
|
-
|
49285
|
-
|
49286
|
-
|
49287
|
-
|
49288
|
-
|
49289
|
-
React__default.createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })))),
|
49278
|
+
React__default.createElement("button", { style: { all: 'unset', margin: '0 8px 0 0', cursor: 'pointer' }, onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
49279
|
+
e.stopPropagation();
|
49280
|
+
setSeeDescription(function (prev) { return !prev; });
|
49281
|
+
setSeeAction(false);
|
49282
|
+
} },
|
49283
|
+
React__default.createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })),
|
49284
|
+
React__default.createElement("a", { className: 'link', title: 'Go to study page', onMouseOver: function (e) { return toggleHover('study', true); }, onMouseLeave: function (e) { return toggleHover('study', false); }, onClick: function (e) {
|
49285
|
+
e.stopPropagation();
|
49286
|
+
if (!localRun) {
|
49287
|
+
if (!projectName || !study)
|
49288
|
+
return;
|
49289
|
+
window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id);
|
49290
|
+
}
|
49291
|
+
}, style: { all: 'unset', cursor: 'pointer', color: "".concat(hover.study
|
49292
|
+
? '#40a9ff' : '#000') } }, localRun ? (localStudy ? localStudy.name : _run['studyName'] // Get name from _run
|
49293
|
+
) : (study ? (_h = study.spec.name) !== null && _h !== void 0 ? _h : "Study: ".concat(study.id) : '--'))),
|
49290
49294
|
React__default.createElement("div", { className: 'item4', title: run && dayjs_min(run.status.started_at).format('[on] MMM DD YYYY [at] hh:mm') }, run ? dayjs_min(run.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
49291
49295
|
React__default.createElement("div", { className: 'item5' },
|
49292
49296
|
React__default.createElement("span", { style: { marginRight: '0.75rem' } },
|
49293
49297
|
!localRun && React__default.createElement(Avatar, { color: hover.author ? '#40a9ff' : undefined, src: run ? (_j = run.author) === null || _j === void 0 ? void 0 : _j.picture_url : '', size: 24 }),
|
49294
|
-
localRun && run &&
|
49298
|
+
localRun && run && React__default.createElement(Avatar, { color: hover.author ? '#40a9ff' : undefined, src: (localStudy && (localStudy === null || localStudy === void 0 ? void 0 : localStudy.author)) ? (_k = localStudy.author) === null || _k === void 0 ? void 0 : _k.picture_url : (_l = run.author) === null || _l === void 0 ? void 0 : _l.picture_url, size: 24 })),
|
49295
49299
|
React__default.createElement("a", { className: 'link', onClick: function (e) {
|
49296
49300
|
var _a;
|
49297
49301
|
e.stopPropagation();
|