pollination-react-io 1.68.2 → 1.69.1

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.
@@ -8,4 +8,5 @@ export interface RecipeFormProps {
8
8
  client: APIClient;
9
9
  style?: CSSProperties;
10
10
  onSubmit?: (name: string, jobArguments: any[], description?: string, localConfig?: any) => Promise<void> | Promise<PanelMessageIn | undefined>;
11
+ initAsLocal?: boolean;
11
12
  }
@@ -14,4 +14,5 @@ export declare const usePollinationPanel: () => {
14
14
  getJob: (projectSlug: string) => ProjectJobInfo[];
15
15
  deleteJob: (projectSlug: string, path: string, subfolder: string) => any;
16
16
  getPlatforms: (projectSlug: string) => {};
17
+ simulationPath: string;
17
18
  };
@@ -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 getJob = usePollinationPanel().getJob;
44751
- var _e = useState(false), loading = _e[0], setLoading = _e[1];
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 _f = useForm({
44801
+ var _h = useForm({
44793
44802
  resolver: Oe(schema),
44794
44803
  mode: 'onChange'
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;
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 _h = useState(__assign(__assign({}, _defaultConfig), { cloudProjectName: projectName, cloudProjectOwner: projectOwner })), localConfig = _h[0], setLocalConfig = _h[1];
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: !isValid || loading ||
44972
- localConfig.isLocalJob
44973
- ? localConfig.localRunFolder == null
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 = {
@@ -49844,7 +49852,7 @@ var FileCard = function (_a) {
49844
49852
  border: '1px solid var(--slate9)',
49845
49853
  // @ts-ignore
49846
49854
  highlight: 'var(--slate7)'
49847
- }, hbjson: CADdata.data, buttonLabel: label, defaultAction: Action$1.add, optionsConfig: {
49855
+ }, hbjson: CADdata.data, buttonLabel: label, defaultAction: Action$1.preview, optionsConfig: {
49848
49856
  add: true,
49849
49857
  delete: false,
49850
49858
  'subscribe-preview': false,
@@ -49857,7 +49865,7 @@ var FileCard = function (_a) {
49857
49865
  border: '1px solid var(--slate9)',
49858
49866
  // @ts-ignore
49859
49867
  highlight: 'var(--slate7)'
49860
- }, results: CADdata.data, buttonLabel: label, defaultAction: Action$1.add, optionsConfig: {
49868
+ }, results: CADdata.data, buttonLabel: label, defaultAction: Action$1.preview, optionsConfig: {
49861
49869
  add: true,
49862
49870
  delete: false,
49863
49871
  'subscribe-preview': false,