pollination-react-io 1.68.2 → 1.69.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.
package/build/index.esm.js
CHANGED
@@ -38014,6 +38014,14 @@ var usePollinationPanel = function () {
|
|
38014
38014
|
var panel = useMemo(function () {
|
38015
38015
|
return checkPollinationPanel() && window.parent.chrome.webview.hostObjects.sync.study;
|
38016
38016
|
}, []);
|
38017
|
+
/**
|
38018
|
+
* Get local simulation path from po-panel
|
38019
|
+
*/
|
38020
|
+
var simulationPath = useMemo(function () {
|
38021
|
+
if (!panel)
|
38022
|
+
return;
|
38023
|
+
return panel.GetSimulationFolder();
|
38024
|
+
}, [panel]);
|
38017
38025
|
/**
|
38018
38026
|
* From base64 to file
|
38019
38027
|
*/
|
@@ -38214,7 +38222,8 @@ var usePollinationPanel = function () {
|
|
38214
38222
|
getPaginatedJob: getPaginatedJob,
|
38215
38223
|
getJob: getJob,
|
38216
38224
|
deleteJob: deleteJob,
|
38217
|
-
getPlatforms: getPlatforms
|
38225
|
+
getPlatforms: getPlatforms,
|
38226
|
+
simulationPath: simulationPath
|
38218
38227
|
};
|
38219
38228
|
};
|
38220
38229
|
|
@@ -41406,7 +41415,7 @@ var ConfigureLocalRun = function (_a) {
|
|
41406
41415
|
}
|
41407
41416
|
} })),
|
41408
41417
|
React__default.createElement(Label, { label: "Select a Local Run Folder", disabled: !localConfig.isLocalJob },
|
41409
|
-
React__default.createElement(SelectLocalArtifactNative, { disabled: !localConfig.isLocalJob, onChange: handleLocalPathChange, mode: 'directory', buttonLabel: 'Local Run Folder' }))));
|
41418
|
+
React__default.createElement(SelectLocalArtifactNative, { disabled: !localConfig.isLocalJob, onChange: handleLocalPathChange, mode: 'directory', buttonLabel: 'Local Run Folder', value: localConfig && localConfig.localRunFolder }))));
|
41410
41419
|
};
|
41411
41420
|
|
41412
41421
|
function makeTypeChecker(tabsRole) {
|
@@ -44746,9 +44755,9 @@ var InputType;
|
|
44746
44755
|
})(InputType || (InputType = {}));
|
44747
44756
|
var RecipeForm = function (_a) {
|
44748
44757
|
var _b, _c;
|
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
|
-
var
|
44751
|
-
var
|
44758
|
+
var recipe = _a.recipe, projectName = _a.projectName, projectOwner = _a.projectOwner, client = _a.client, onSubmit = _a.onSubmit, _d = _a.style, style = _d === void 0 ? {} : _d, _e = _a.initAsLocal, initAsLocal = _e === void 0 ? false : _e;
|
44759
|
+
var _f = usePollinationPanel(), getJob = _f.getJob, simulationPath = _f.simulationPath;
|
44760
|
+
var _g = useState(false), loading = _g[0], setLoading = _g[1];
|
44752
44761
|
/**
|
44753
44762
|
* Input mapping
|
44754
44763
|
*/
|
@@ -44789,10 +44798,10 @@ var RecipeForm = function (_a) {
|
|
44789
44798
|
/**
|
44790
44799
|
* Hooks
|
44791
44800
|
*/
|
44792
|
-
var
|
44801
|
+
var _h = useForm({
|
44793
44802
|
resolver: Oe(schema),
|
44794
44803
|
mode: 'onChange'
|
44795
|
-
}), control =
|
44804
|
+
}), control = _h.control, register = _h.register, handleSubmit = _h.handleSubmit, resetField = _h.resetField, watch = _h.watch, _j = _h.formState, errors = _j.errors, isValid = _j.isValid;
|
44796
44805
|
var watchStudyName = watch('study-name');
|
44797
44806
|
/**
|
44798
44807
|
* Form actions
|
@@ -44869,7 +44878,7 @@ var RecipeForm = function (_a) {
|
|
44869
44878
|
/**
|
44870
44879
|
* Local study
|
44871
44880
|
*/
|
44872
|
-
var
|
44881
|
+
var _k = useState(__assign(__assign({}, _defaultConfig), { isLocalJob: initAsLocal, cloudProjectName: projectName, cloudProjectOwner: projectOwner, localRunFolder: simulationPath })), localConfig = _k[0], setLocalConfig = _k[1];
|
44873
44882
|
/**
|
44874
44883
|
* Warning for local study folder
|
44875
44884
|
*/
|
@@ -44968,10 +44977,9 @@ var RecipeForm = function (_a) {
|
|
44968
44977
|
justifyContent: 'center' }, disabled: !isValid || loading, form: recipe.metadata.name, loading: loading }, "Create Study"),
|
44969
44978
|
host !== 'web' && React__default.createElement(Button, { type: 'submit', style: { width: '100%',
|
44970
44979
|
margin: '10px 0 0 0',
|
44971
|
-
justifyContent: 'center' }, disabled: !
|
44972
|
-
|
44973
|
-
|
44974
|
-
: false, form: recipe.metadata.name, loading: loading }, "Create Study")));
|
44980
|
+
justifyContent: 'center' }, disabled: !localConfig.isLocalJob
|
44981
|
+
? !isValid || loading
|
44982
|
+
: !isValid || loading || localConfig.localRunFolder == null, form: recipe.metadata.name, loading: loading }, "Create Study")));
|
44975
44983
|
};
|
44976
44984
|
|
44977
44985
|
var defaultStyle = {
|