pollination-react-io 1.75.4 → 1.76.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 +26 -7
- package/build/index.esm.js.map +1 -1
- package/build/index.js +26 -7
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -55897,19 +55897,31 @@ var CADtypeEnum;
|
|
55897
55897
|
CADtypeEnum[CADtypeEnum["HBJSON"] = 0] = "HBJSON";
|
55898
55898
|
CADtypeEnum[CADtypeEnum["VSF"] = 1] = "VSF";
|
55899
55899
|
})(CADtypeEnum || (CADtypeEnum = {}));
|
55900
|
+
var download = function (blob, fileName) {
|
55901
|
+
var file = new File([blob], fileName);
|
55902
|
+
var a = document.createElement('a');
|
55903
|
+
document.body.appendChild(a);
|
55904
|
+
a.style.display = 'none';
|
55905
|
+
a.id = 'download';
|
55906
|
+
var url = window.URL.createObjectURL(file);
|
55907
|
+
a.href = url;
|
55908
|
+
a.download = fileName;
|
55909
|
+
a.click();
|
55910
|
+
};
|
55900
55911
|
var FileCard = function (_a) {
|
55901
55912
|
var _b, _c;
|
55902
55913
|
var projectOwner = _a.projectOwner, projectName = _a.projectName, client = _a.client, run = _a.run, label = _a.label, path = _a.path, file = _a.file, description = _a.description, onClicked = _a.onClicked, _d = _a.isCloud, isCloud = _d === void 0 ? true : _d;
|
55903
55914
|
var host = getHost();
|
55904
55915
|
var fromFileToBase64 = usePollinationPanel().fromFileToBase64;
|
55905
55916
|
var _e = React.useState(false), open = _e[0], setOpen = _e[1];
|
55906
|
-
var _f = React.useState(false),
|
55907
|
-
var _g = React.useState(
|
55908
|
-
var _h = React.useState(
|
55917
|
+
var _f = React.useState(false), infoOver = _f[0], setInfoOver = _f[1];
|
55918
|
+
var _g = React.useState(false), downloadOver = _g[0], setDownloadOver = _g[1];
|
55919
|
+
var _h = React.useState(true), isLoading = _h[0], setIsLoading = _h[1];
|
55920
|
+
var _j = React.useState(false), isInactive = _j[0], setIsInactive = _j[1];
|
55909
55921
|
// Data to use for CAD injections
|
55910
|
-
var
|
55922
|
+
var _k = React.useState(), CADdata = _k[0], setCADdata = _k[1];
|
55911
55923
|
// File to send to parent
|
55912
|
-
var
|
55924
|
+
var _l = React.useState(), currFile = _l[0], setCurrFile = _l[1];
|
55913
55925
|
// /**
|
55914
55926
|
// * Check if run id is a valid UUID or file path (Local sim)
|
55915
55927
|
// * @param str run id
|
@@ -56055,11 +56067,18 @@ var FileCard = function (_a) {
|
|
56055
56067
|
label)
|
56056
56068
|
: React__default["default"].createElement(LoadingIcon, { size: 14 })),
|
56057
56069
|
React__default["default"].createElement("div", { style: { textAlign: 'right' } },
|
56058
|
-
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return
|
56070
|
+
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return setInfoOver(true); }, onMouseLeave: function () { return setInfoOver(false); }, onClick: function (event) {
|
56071
|
+
if (!currFile || !path)
|
56072
|
+
return;
|
56073
|
+
event.stopPropagation();
|
56074
|
+
download(currFile, path.split('/').reverse()[0]);
|
56075
|
+
} },
|
56076
|
+
React__default["default"].createElement(Download$1, { size: 14, style: infoOver ? { color: '#40a9ff' } : {} })),
|
56077
|
+
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return setDownloadOver(true); }, onMouseLeave: function () { return setDownloadOver(false); }, onClick: function (event) {
|
56059
56078
|
event.stopPropagation();
|
56060
56079
|
setOpen(function (prev) { return !prev; });
|
56061
56080
|
} },
|
56062
|
-
React__default["default"].createElement(InfoCircle$1, { size: 14, style:
|
56081
|
+
React__default["default"].createElement(InfoCircle$1, { size: 14, style: downloadOver ? { color: '#40a9ff' } : {} })))),
|
56063
56082
|
CADdata && React__default["default"].createElement("hr", null),
|
56064
56083
|
React__default["default"].createElement("div", { className: 'value-param' },
|
56065
56084
|
CADdata && CADdata.type === CADtypeEnum.HBJSON && React__default["default"].createElement(SendModel, { hbjson: CADdata.data, defaultAction: Action$1.preview, optionsConfig: {
|