pollination-react-io 1.75.3 → 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 +27 -8
- package/build/index.esm.js.map +1 -1
- package/build/index.js +27 -8
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -53400,7 +53400,7 @@ var overlayOptions$1 = [
|
|
53400
53400
|
},
|
53401
53401
|
{
|
53402
53402
|
type: 'label',
|
53403
|
-
id: Action$1.
|
53403
|
+
id: Action$1.replace,
|
53404
53404
|
label: 'Replace',
|
53405
53405
|
icon: React__default.createElement(Building$1, { size: 16 }),
|
53406
53406
|
},
|
@@ -55870,19 +55870,31 @@ var CADtypeEnum;
|
|
55870
55870
|
CADtypeEnum[CADtypeEnum["HBJSON"] = 0] = "HBJSON";
|
55871
55871
|
CADtypeEnum[CADtypeEnum["VSF"] = 1] = "VSF";
|
55872
55872
|
})(CADtypeEnum || (CADtypeEnum = {}));
|
55873
|
+
var download = function (blob, fileName) {
|
55874
|
+
var file = new File([blob], fileName);
|
55875
|
+
var a = document.createElement('a');
|
55876
|
+
document.body.appendChild(a);
|
55877
|
+
a.style.display = 'none';
|
55878
|
+
a.id = 'download';
|
55879
|
+
var url = window.URL.createObjectURL(file);
|
55880
|
+
a.href = url;
|
55881
|
+
a.download = fileName;
|
55882
|
+
a.click();
|
55883
|
+
};
|
55873
55884
|
var FileCard = function (_a) {
|
55874
55885
|
var _b, _c;
|
55875
55886
|
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;
|
55876
55887
|
var host = getHost();
|
55877
55888
|
var fromFileToBase64 = usePollinationPanel().fromFileToBase64;
|
55878
55889
|
var _e = useState(false), open = _e[0], setOpen = _e[1];
|
55879
|
-
var _f = useState(false),
|
55880
|
-
var _g = useState(
|
55881
|
-
var _h = useState(
|
55890
|
+
var _f = useState(false), infoOver = _f[0], setInfoOver = _f[1];
|
55891
|
+
var _g = useState(false), downloadOver = _g[0], setDownloadOver = _g[1];
|
55892
|
+
var _h = useState(true), isLoading = _h[0], setIsLoading = _h[1];
|
55893
|
+
var _j = useState(false), isInactive = _j[0], setIsInactive = _j[1];
|
55882
55894
|
// Data to use for CAD injections
|
55883
|
-
var
|
55895
|
+
var _k = useState(), CADdata = _k[0], setCADdata = _k[1];
|
55884
55896
|
// File to send to parent
|
55885
|
-
var
|
55897
|
+
var _l = useState(), currFile = _l[0], setCurrFile = _l[1];
|
55886
55898
|
// /**
|
55887
55899
|
// * Check if run id is a valid UUID or file path (Local sim)
|
55888
55900
|
// * @param str run id
|
@@ -56028,11 +56040,18 @@ var FileCard = function (_a) {
|
|
56028
56040
|
label)
|
56029
56041
|
: React__default.createElement(LoadingIcon, { size: 14 })),
|
56030
56042
|
React__default.createElement("div", { style: { textAlign: 'right' } },
|
56031
|
-
React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return
|
56043
|
+
React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return setInfoOver(true); }, onMouseLeave: function () { return setInfoOver(false); }, onClick: function (event) {
|
56044
|
+
if (!currFile || !path)
|
56045
|
+
return;
|
56046
|
+
event.stopPropagation();
|
56047
|
+
download(currFile, path.split('/').reverse()[0]);
|
56048
|
+
} },
|
56049
|
+
React__default.createElement(Download$1, { size: 14, style: infoOver ? { color: '#40a9ff' } : {} })),
|
56050
|
+
React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return setDownloadOver(true); }, onMouseLeave: function () { return setDownloadOver(false); }, onClick: function (event) {
|
56032
56051
|
event.stopPropagation();
|
56033
56052
|
setOpen(function (prev) { return !prev; });
|
56034
56053
|
} },
|
56035
|
-
React__default.createElement(InfoCircle$1, { size: 14, style:
|
56054
|
+
React__default.createElement(InfoCircle$1, { size: 14, style: downloadOver ? { color: '#40a9ff' } : {} })))),
|
56036
56055
|
CADdata && React__default.createElement("hr", null),
|
56037
56056
|
React__default.createElement("div", { className: 'value-param' },
|
56038
56057
|
CADdata && CADdata.type === CADtypeEnum.HBJSON && React__default.createElement(SendModel, { hbjson: CADdata.data, defaultAction: Action$1.preview, optionsConfig: {
|