pollination-react-io 1.75.4 → 1.76.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.
- package/build/index.esm.js +27 -11
- package/build/index.esm.js.map +1 -1
- package/build/index.js +27 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
@@ -53205,21 +53205,18 @@ var BaseDropdown = function (_a) {
|
|
53205
53205
|
switch (o.type) {
|
53206
53206
|
case 'link':
|
53207
53207
|
return (React__default.createElement("div", { style: childOverlayStyle, className: 'basedropdown-overlay-child', key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
|
53208
|
-
e.stopPropagation();
|
53209
53208
|
window.location.href = o.to;
|
53210
53209
|
} },
|
53211
53210
|
o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
|
53212
53211
|
o.label));
|
53213
53212
|
case 'label':
|
53214
53213
|
return (React__default.createElement("div", { style: childOverlayStyle, key: o.id, tabIndex: 0, role: 'button', onClick: function (e) {
|
53215
|
-
e.stopPropagation();
|
53216
53214
|
onSelect(o);
|
53217
53215
|
} },
|
53218
53216
|
o.icon && React__default.createElement("span", { style: { marginRight: '5px' } }, o.icon),
|
53219
53217
|
o.label));
|
53220
53218
|
default:
|
53221
53219
|
return (React__default.createElement(Button, { style: childOverlayStyle, key: o.id, onClick: function (e) {
|
53222
|
-
e.stopPropagation();
|
53223
53220
|
onSelect(o);
|
53224
53221
|
} },
|
53225
53222
|
o.icon,
|
@@ -53229,7 +53226,7 @@ var BaseDropdown = function (_a) {
|
|
53229
53226
|
return (React__default.createElement("div", null,
|
53230
53227
|
React__default.createElement("div", { style: { display: 'flex' } },
|
53231
53228
|
children,
|
53232
|
-
React__default.createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up',
|
53229
|
+
React__default.createElement(Dropdown$1, { trigger: [action], overlayStyle: overlayStyle, placement: placement, animation: 'slide-up', onOverlayClick: function (e) { return e.stopPropagation(); },
|
53233
53230
|
// @ts-ignore
|
53234
53231
|
overlay: options && options.map(renderItem) },
|
53235
53232
|
React__default.createElement("button", { disabled: disabled, className: 'poll-button', style: triggerStyle, onClick: function (e) { return e.stopPropagation(); } }, icon)))));
|
@@ -55870,19 +55867,31 @@ var CADtypeEnum;
|
|
55870
55867
|
CADtypeEnum[CADtypeEnum["HBJSON"] = 0] = "HBJSON";
|
55871
55868
|
CADtypeEnum[CADtypeEnum["VSF"] = 1] = "VSF";
|
55872
55869
|
})(CADtypeEnum || (CADtypeEnum = {}));
|
55870
|
+
var download = function (blob, fileName) {
|
55871
|
+
var file = new File([blob], fileName);
|
55872
|
+
var a = document.createElement('a');
|
55873
|
+
document.body.appendChild(a);
|
55874
|
+
a.style.display = 'none';
|
55875
|
+
a.id = 'download';
|
55876
|
+
var url = window.URL.createObjectURL(file);
|
55877
|
+
a.href = url;
|
55878
|
+
a.download = fileName;
|
55879
|
+
a.click();
|
55880
|
+
};
|
55873
55881
|
var FileCard = function (_a) {
|
55874
55882
|
var _b, _c;
|
55875
55883
|
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
55884
|
var host = getHost();
|
55877
55885
|
var fromFileToBase64 = usePollinationPanel().fromFileToBase64;
|
55878
55886
|
var _e = useState(false), open = _e[0], setOpen = _e[1];
|
55879
|
-
var _f = useState(false),
|
55880
|
-
var _g = useState(
|
55881
|
-
var _h = useState(
|
55887
|
+
var _f = useState(false), infoOver = _f[0], setInfoOver = _f[1];
|
55888
|
+
var _g = useState(false), downloadOver = _g[0], setDownloadOver = _g[1];
|
55889
|
+
var _h = useState(true), isLoading = _h[0], setIsLoading = _h[1];
|
55890
|
+
var _j = useState(false), isInactive = _j[0], setIsInactive = _j[1];
|
55882
55891
|
// Data to use for CAD injections
|
55883
|
-
var
|
55892
|
+
var _k = useState(), CADdata = _k[0], setCADdata = _k[1];
|
55884
55893
|
// File to send to parent
|
55885
|
-
var
|
55894
|
+
var _l = useState(), currFile = _l[0], setCurrFile = _l[1];
|
55886
55895
|
// /**
|
55887
55896
|
// * Check if run id is a valid UUID or file path (Local sim)
|
55888
55897
|
// * @param str run id
|
@@ -56028,11 +56037,18 @@ var FileCard = function (_a) {
|
|
56028
56037
|
label)
|
56029
56038
|
: React__default.createElement(LoadingIcon, { size: 14 })),
|
56030
56039
|
React__default.createElement("div", { style: { textAlign: 'right' } },
|
56031
|
-
React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return
|
56040
|
+
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) {
|
56041
|
+
if (!currFile || !path)
|
56042
|
+
return;
|
56043
|
+
event.stopPropagation();
|
56044
|
+
download(currFile, path.split('/').reverse()[0]);
|
56045
|
+
} },
|
56046
|
+
React__default.createElement(Download$1, { size: 14, style: infoOver ? { color: '#40a9ff' } : {} })),
|
56047
|
+
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
56048
|
event.stopPropagation();
|
56033
56049
|
setOpen(function (prev) { return !prev; });
|
56034
56050
|
} },
|
56035
|
-
React__default.createElement(InfoCircle$1, { size: 14, style:
|
56051
|
+
React__default.createElement(InfoCircle$1, { size: 14, style: downloadOver ? { color: '#40a9ff' } : {} })))),
|
56036
56052
|
CADdata && React__default.createElement("hr", null),
|
56037
56053
|
React__default.createElement("div", { className: 'value-param' },
|
56038
56054
|
CADdata && CADdata.type === CADtypeEnum.HBJSON && React__default.createElement(SendModel, { hbjson: CADdata.data, defaultAction: Action$1.preview, optionsConfig: {
|