pollination-react-io 1.92.1 → 1.92.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.
- package/build/GetGeometry/GetGeometry.types.d.ts +1 -0
- package/build/index.esm.js +26 -19
- package/build/index.esm.js.map +1 -1
- package/build/index.js +26 -19
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -38595,6 +38595,9 @@ var usePollinationPanel = function () {
|
|
38595
38595
|
return;
|
38596
38596
|
try {
|
38597
38597
|
var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.status]);
|
38598
|
+
if (message.data === '') {
|
38599
|
+
console.log('[LOCAL RUN]: Status file not found');
|
38600
|
+
}
|
38598
38601
|
var run = JSON.parse(message.data);
|
38599
38602
|
return run;
|
38600
38603
|
}
|
@@ -38613,6 +38616,9 @@ var usePollinationPanel = function () {
|
|
38613
38616
|
return;
|
38614
38617
|
try {
|
38615
38618
|
var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.job]);
|
38619
|
+
if (message.data === '') {
|
38620
|
+
console.log('[LOCAL RUN]: Job file not found');
|
38621
|
+
}
|
38616
38622
|
var localJob = JSON.parse(message.data);
|
38617
38623
|
var job = (_a = localJob === null || localJob === void 0 ? void 0 : localJob.LocalJob) === null || _a === void 0 ? void 0 : _a.Job;
|
38618
38624
|
job['author'] = (_b = localJob === null || localJob === void 0 ? void 0 : localJob.LocalJob) === null || _b === void 0 ? void 0 : _b.JobAuthor;
|
@@ -38633,6 +38639,9 @@ var usePollinationPanel = function () {
|
|
38633
38639
|
return;
|
38634
38640
|
try {
|
38635
38641
|
var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.logs]);
|
38642
|
+
if (message.data === '') {
|
38643
|
+
console.log('[LOCAL RUN]: Log file not found');
|
38644
|
+
}
|
38636
38645
|
return message.data;
|
38637
38646
|
}
|
38638
38647
|
catch (error) {
|
@@ -47680,21 +47689,16 @@ var GetModelActions;
|
|
47680
47689
|
})(GetModelActions || (GetModelActions = {}));
|
47681
47690
|
|
47682
47691
|
var GetGeometry = function (_a) {
|
47683
|
-
var setParentState = _a.setParentState, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Geometry' : _b, _c = _a.defaultKey, defaultKey = _c === void 0 ? 'get-geometry-btn' : _c;
|
47692
|
+
var setParentState = _a.setParentState, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Geometry' : _b, _c = _a.defaultKey, defaultKey = _c === void 0 ? 'get-geometry-btn' : _c, _d = _a.useIcon, useIcon = _d === void 0 ? false : _d;
|
47684
47693
|
var subscribeRef = useRef();
|
47685
47694
|
var sendMessage = useSendMessage().sendMessage;
|
47686
|
-
var
|
47687
|
-
var
|
47688
|
-
|
47689
|
-
|
47690
|
-
var
|
47691
|
-
typeof optionsConfig.subscribe !== 'undefined' &&
|
47692
|
-
typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false), subscribe = _f[0], setSubscribe = _f[1];
|
47693
|
-
var _g = useState(Boolean(optionsConfig) && typeof optionsConfig !== 'undefined' &&
|
47694
|
-
typeof optionsConfig.preview !== 'undefined' &&
|
47695
|
-
typeof optionsConfig.preview.selected !== 'undefined' ? optionsConfig.preview.selected : false), preview = _g[0], setPreview = _g[1];
|
47695
|
+
var _e = useState(performance.now().toString()), key = _e[0], setKey = _e[1];
|
47696
|
+
var _f = useState(false), isClicked = _f[0], setIsClicked = _f[1];
|
47697
|
+
var _g = useState(), selection = _g[0], setSelection = _g[1];
|
47698
|
+
var _h = useState(), subscribe = _h[0], setSubscribe = _h[1];
|
47699
|
+
var _j = useState(), preview = _j[0], setPreview = _j[1];
|
47696
47700
|
// pollination-react-io hooks
|
47697
|
-
var
|
47701
|
+
var _k = useGetGeometry(), host = _k.host, geometry = _k.geometry, getGeometry = _k.getGeometry;
|
47698
47702
|
// set selection and subscribe on props change
|
47699
47703
|
useEffect(function () {
|
47700
47704
|
if (!optionsConfig)
|
@@ -47710,7 +47714,8 @@ var GetGeometry = function (_a) {
|
|
47710
47714
|
setSubscribe(sub);
|
47711
47715
|
}, [optionsConfig]);
|
47712
47716
|
useEffect(function () {
|
47713
|
-
|
47717
|
+
// Send data only after the first click
|
47718
|
+
if (!geometry || !setParentState || !isClicked)
|
47714
47719
|
return;
|
47715
47720
|
var fr = new FileReader();
|
47716
47721
|
fr.onload = function () {
|
@@ -47747,7 +47752,7 @@ var GetGeometry = function (_a) {
|
|
47747
47752
|
clearInterval(subscribeRef.current);
|
47748
47753
|
subscribeRef.current = undefined;
|
47749
47754
|
}
|
47750
|
-
}, [getGeometry, key, subscribe, subscribeRef]);
|
47755
|
+
}, [getGeometry, key, subscribe, subscribeRef, selection]);
|
47751
47756
|
// selection and subscription
|
47752
47757
|
useEffect(function () {
|
47753
47758
|
// If selection is deactivated and subscription is active
|
@@ -47758,9 +47763,10 @@ var GetGeometry = function (_a) {
|
|
47758
47763
|
setKey(performance.now().toString());
|
47759
47764
|
}
|
47760
47765
|
}, [selection]);
|
47761
|
-
return (React__default.createElement(SettingsButton, { onClick: function () {
|
47766
|
+
return (React__default.createElement(SettingsButton, { icon: useIcon && undefined, onClick: function () {
|
47762
47767
|
if (!getGeometry)
|
47763
47768
|
return;
|
47769
|
+
setIsClicked(true);
|
47764
47770
|
getGeometry(key, selection, true);
|
47765
47771
|
}, disabled: typeof getGeometry === 'undefined',
|
47766
47772
|
// @ts-ignore
|
@@ -56393,7 +56399,7 @@ var RunCard = function (_a) {
|
|
56393
56399
|
if (run.status.finished_at)
|
56394
56400
|
setStopRefresh(true);
|
56395
56401
|
setIsReady(true);
|
56396
|
-
}
|
56402
|
+
}
|
56397
56403
|
}), run = _11.data, error = _11.error;
|
56398
56404
|
var sendRun = useCallback(function (run) { return getValue(run); }, [getValue]);
|
56399
56405
|
/**
|
@@ -56468,11 +56474,12 @@ var RunCard = function (_a) {
|
|
56468
56474
|
setHover(__assign(__assign({}, emptyHover), (_a = {}, _a[defaultTab] = true, _a)));
|
56469
56475
|
}, [defaultTab, emptyHover]);
|
56470
56476
|
var localStudyURLname = useMemo(function () {
|
56477
|
+
var _a, _b;
|
56471
56478
|
if (!localStudy)
|
56472
56479
|
return;
|
56473
|
-
|
56474
|
-
|
56475
|
-
|
56480
|
+
if (localStudy === null || localStudy === void 0 ? void 0 : localStudy.name)
|
56481
|
+
return 'hello';
|
56482
|
+
return (_b = (_a = localStudy === null || localStudy === void 0 ? void 0 : localStudy.name) === null || _a === void 0 ? void 0 : _a.replace(/[^a-zA-Z0-9]/g, '')) === null || _b === void 0 ? void 0 : _b.replace(/[ ()]/g, '');
|
56476
56483
|
}, [localStudy]);
|
56477
56484
|
/**
|
56478
56485
|
* Rendering - if error
|