pollination-react-io 1.60.0 → 1.61.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/hooks/index.d.ts +1 -0
- package/build/hooks/usePollinationPanel.d.ts +2 -0
- package/build/index.esm.js +47 -2
- package/build/index.esm.js.map +1 -1
- package/build/index.js +47 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/hooks/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { PanelMessageOut } from './types';
|
2
2
|
import { Job, Run } from '@pollination-solutions/pollination-sdk';
|
3
|
+
import { ProjectJobInfo } from './useCreateStudy';
|
3
4
|
export declare const usePollinationPanel: () => {
|
4
5
|
getFileBase64: (key?: any, accept?: any) => PanelMessageOut;
|
5
6
|
saveFileBase64: (key: string, file: File | Blob, subFolder: string, fileName: string) => Promise<PanelMessageOut>;
|
@@ -9,4 +10,5 @@ export declare const usePollinationPanel: () => {
|
|
9
10
|
fetchLocalJob: (path?: any) => Job;
|
10
11
|
fetchLocalLog: (path?: any) => any;
|
11
12
|
fileExplorer: (root: string) => PanelMessageOut;
|
13
|
+
getPaginatedJob: (projectSlug: string, pageSize: number, curPage: number) => ProjectJobInfo[];
|
12
14
|
};
|
package/build/index.esm.js
CHANGED
@@ -37976,6 +37976,9 @@ var usePollinationPanel = function () {
|
|
37976
37976
|
var panel = useMemo(function () {
|
37977
37977
|
return checkPollinationPanel() && window.parent.chrome.webview.hostObjects.sync.study;
|
37978
37978
|
}, []);
|
37979
|
+
/**
|
37980
|
+
* From base64 to file
|
37981
|
+
*/
|
37979
37982
|
var saveFileBase64 = useCallback(function (key, file, subFolder, fileName) { return __awaiter$1(void 0, void 0, void 0, function () {
|
37980
37983
|
var base64;
|
37981
37984
|
return __generator$1(this, function (_a) {
|
@@ -37994,6 +37997,9 @@ var usePollinationPanel = function () {
|
|
37994
37997
|
}
|
37995
37998
|
});
|
37996
37999
|
}); }, [panel]);
|
38000
|
+
/**
|
38001
|
+
* Select a file and generate base64 representation
|
38002
|
+
*/
|
37997
38003
|
var getFileBase64 = useCallback(function (key, accept) {
|
37998
38004
|
if (key === void 0) { key = performance.now().toString(); }
|
37999
38005
|
if (accept === void 0) { accept = 'HBJSON|*.hbjson'; }
|
@@ -38001,21 +38007,33 @@ var usePollinationPanel = function () {
|
|
38001
38007
|
return;
|
38002
38008
|
return panel.GetArtifactAsBase64(key, accept);
|
38003
38009
|
}, [panel]);
|
38010
|
+
/**
|
38011
|
+
* Get file paths from dir
|
38012
|
+
*/
|
38004
38013
|
var getFilesFromDir = useCallback(function (root) {
|
38005
38014
|
if (!panel)
|
38006
38015
|
return;
|
38007
38016
|
return panel.GetFilePaths(root);
|
38008
38017
|
}, [panel]);
|
38018
|
+
/**
|
38019
|
+
* From file path to base64
|
38020
|
+
*/
|
38009
38021
|
var fromFileToBase64 = useCallback(function (filePath) {
|
38010
38022
|
if (!panel)
|
38011
38023
|
return;
|
38012
38024
|
return panel.FromFileToBase64(filePath);
|
38013
38025
|
}, [panel]);
|
38026
|
+
/**
|
38027
|
+
* Run file explorer
|
38028
|
+
*/
|
38014
38029
|
var fileExplorer = useCallback(function (root) {
|
38015
38030
|
if (!panel)
|
38016
38031
|
return;
|
38017
38032
|
return panel.FileExplorer(root);
|
38018
38033
|
}, [panel]);
|
38034
|
+
/**
|
38035
|
+
* Fetch local run
|
38036
|
+
*/
|
38019
38037
|
var fetchLocalRun = useCallback(function (path) {
|
38020
38038
|
if (path === void 0) { path = ''; }
|
38021
38039
|
if (!panel)
|
@@ -38029,6 +38047,9 @@ var usePollinationPanel = function () {
|
|
38029
38047
|
throw error;
|
38030
38048
|
}
|
38031
38049
|
}, [panel]);
|
38050
|
+
/**
|
38051
|
+
* Fetch local job
|
38052
|
+
*/
|
38032
38053
|
var fetchLocalJob = useCallback(function (path) {
|
38033
38054
|
var _a;
|
38034
38055
|
if (path === void 0) { path = ''; }
|
@@ -38045,6 +38066,9 @@ var usePollinationPanel = function () {
|
|
38045
38066
|
return undefined;
|
38046
38067
|
}
|
38047
38068
|
}, [panel]);
|
38069
|
+
/**
|
38070
|
+
* Fetch local log
|
38071
|
+
*/
|
38048
38072
|
var fetchLocalLog = useCallback(function (path) {
|
38049
38073
|
if (path === void 0) { path = ''; }
|
38050
38074
|
if (!panel)
|
@@ -38058,6 +38082,26 @@ var usePollinationPanel = function () {
|
|
38058
38082
|
return undefined;
|
38059
38083
|
}
|
38060
38084
|
}, [panel]);
|
38085
|
+
/**
|
38086
|
+
* Get array of ProjectJobInfo from DB
|
38087
|
+
* @param projectSlug Project slug <USER/PROJECT_NAME>
|
38088
|
+
* @param pageSize Page size
|
38089
|
+
* @param curPage Current page
|
38090
|
+
* @returns Array of ProjectJobInfo
|
38091
|
+
*/
|
38092
|
+
var getPaginatedJob = function (projectSlug, pageSize, curPage) {
|
38093
|
+
if (!panel)
|
38094
|
+
return;
|
38095
|
+
try {
|
38096
|
+
var message = panel.GetPaginatedJob(projectSlug, pageSize, curPage);
|
38097
|
+
var arr = JSON.parse(message.data);
|
38098
|
+
return arr;
|
38099
|
+
}
|
38100
|
+
catch (error) {
|
38101
|
+
// Do nothing. It is written at the end
|
38102
|
+
return undefined;
|
38103
|
+
}
|
38104
|
+
};
|
38061
38105
|
return {
|
38062
38106
|
getFileBase64: getFileBase64,
|
38063
38107
|
saveFileBase64: saveFileBase64,
|
@@ -38066,7 +38110,8 @@ var usePollinationPanel = function () {
|
|
38066
38110
|
fetchLocalRun: fetchLocalRun,
|
38067
38111
|
fetchLocalJob: fetchLocalJob,
|
38068
38112
|
fetchLocalLog: fetchLocalLog,
|
38069
|
-
fileExplorer: fileExplorer
|
38113
|
+
fileExplorer: fileExplorer,
|
38114
|
+
getPaginatedJob: getPaginatedJob
|
38070
38115
|
};
|
38071
38116
|
};
|
38072
38117
|
|
@@ -50526,5 +50571,5 @@ var RunTable = function (_a) {
|
|
50526
50571
|
React__default.createElement(ChevronRight$1, null)))))));
|
50527
50572
|
};
|
50528
50573
|
|
50529
|
-
export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FilePreview, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeForm, RunCard, RunDetails, RunRow, RunTable, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, _defaultConfig, checkDotNet, checkPollinationPanel, checkRuby, formatBytes, getHost, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, useRunCommand, useRuns, useSendHbjson, useSendMessage, useWindowDimensions };
|
50574
|
+
export { APIClient, AuthUser, Avatar, Button, ComboBox, ComboFileSelector, ConditionalWrapper, ConfigureLocalRun, CreateStudy, Dropdown, FileInput, FilePreview, FormInput, GetGeometry, GetModel, InputDescription, Label, Logo, NumberInput, RadioList, RecipeForm, RunCard, RunDetails, RunRow, RunTable, SelectAccount, SelectCloudArtifacts, SelectLocalArtifacts, SelectProject, SelectRecipe, SelectRun, SelectStudy, SendGeometry, SendModel, SendResults, SettingsButton, StudyCard, TextInput, Tooltip, _defaultConfig, checkDotNet, checkPollinationPanel, checkRuby, formatBytes, getHost, recipeLinkFromSource, sendMessageDotNet, sendMessageRuby, useAPIClient, useArtifacts, useCreateStudy, useGetGeometry, useGetHbjson, useHbjsontoVTK, useJobs, useManageSettings, usePollinationPanel, useRunCommand, useRuns, useSendHbjson, useSendMessage, useWindowDimensions };
|
50530
50575
|
//# sourceMappingURL=index.esm.js.map
|