pollination-react-io 1.1.2 → 1.2.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.
@@ -5,7 +5,10 @@ export declare enum GetModelActions {
5
5
  export interface GetGeometryProps {
6
6
  setParentState?: (data: any) => void;
7
7
  optionsConfig?: {
8
- [index in GetModelActions]: boolean;
8
+ [index in GetModelActions]: {
9
+ show?: boolean;
10
+ selected?: boolean;
11
+ };
9
12
  };
10
13
  buttonLabel?: string;
11
14
  }
@@ -5,7 +5,10 @@ export declare enum GetModelActions {
5
5
  export interface GetModelProps {
6
6
  setParentState?: (data: any) => any;
7
7
  optionsConfig?: {
8
- [index in GetModelActions]: boolean;
8
+ [index in GetModelActions]: {
9
+ show?: boolean;
10
+ selected?: boolean;
11
+ };
9
12
  };
10
13
  buttonLabel?: string;
11
14
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { RecipeInputsFormProps } from './RecipeInputsForm.types';
3
+ import './RecipeInputsForm.scss';
3
4
  declare const RecipeInputsForm: React.FC<RecipeInputsFormProps>;
4
5
  export default RecipeInputsForm;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SelectAccountProps } from './SelectAccount.types';
3
- import '../styles/buttons.scss';
3
+ import '../styles/buttons-group.scss';
4
4
  import '../styles/variables.scss';
5
5
  export declare const SelectAccount: React.FC<SelectAccountProps>;
6
6
  export default SelectAccount;
@@ -5,5 +5,4 @@ export interface SelectAccountProps {
5
5
  authUser?: UserPrivate;
6
6
  client?: APIClient;
7
7
  setSelAccount?: (account: Account) => void;
8
- environment: Window;
9
8
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SelectProjectProps } from './SelectProject.types';
3
- import '../styles/buttons.scss';
3
+ import '../styles/buttons-group.scss';
4
4
  import '../styles/variables.scss';
5
5
  export declare const SelectProject: React.FC<SelectProjectProps>;
6
6
  export default SelectProject;
@@ -3,7 +3,6 @@ import { APIClient } from '../hooks';
3
3
  export interface SelectProjectProps {
4
4
  authUser?: UserPrivate;
5
5
  client?: APIClient;
6
- projectOwner: string[];
6
+ projectOwner: string;
7
7
  setSelProject?: (project: Project) => void;
8
- environment?: Window;
9
8
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SelectStudyProps } from './SelectStudy.types';
3
- import '../styles/buttons.scss';
3
+ import '../styles/buttons-group.scss';
4
4
  import '../styles/variables.scss';
5
5
  export declare const SelectStudy: React.FC<SelectStudyProps>;
6
6
  export default SelectStudy;
@@ -7,5 +7,4 @@ export interface SelectStudyProps {
7
7
  client?: APIClient;
8
8
  setSelStudy?: (project: Project) => void;
9
9
  queryConfig?: Partial<ProjectsApiListProjectsRequest>;
10
- environment?: Window;
11
10
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { SendResultsProps } from './SendResults.types';
3
- import '../styles/buttons.scss';
3
+ import '../styles/buttons-group.scss';
4
4
  export declare const SendResults: React.FC<SendResultsProps>;
5
5
  export default SendResults;
@@ -14,6 +14,5 @@ export interface ComboBoxProps {
14
14
  footer?: string | ReactNode;
15
15
  noMatchText?: string;
16
16
  ref?: Ref<any>;
17
- environment?: Window;
18
17
  onScrollReachEnd?: (...args: any) => void;
19
18
  }
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { InputDescriptionProps } from './InputDescriptionTypes';
3
+ export declare const InputDescription: FC<InputDescriptionProps>;
4
+ export default InputDescription;
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export interface InputDescriptionProps {
3
+ helpText: ReactNode;
4
+ }
@@ -1,6 +1,6 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import { OptionGroup } from '../Dropdown/Dropdown';
3
- import '../../styles/buttons.scss';
3
+ import '../../styles/buttons-group.scss';
4
4
  export interface SettingsButtonProps {
5
5
  onClick: () => void;
6
6
  label: string | ReactNode;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, HTMLProps, ReactNode } from "react";
1
+ import { CSSProperties, HTMLProps, ReactNode } from 'react';
2
2
  export interface TextInputProps {
3
3
  inputProps?: HTMLProps<HTMLInputElement>;
4
4
  icon?: ReactNode;
@@ -3,7 +3,7 @@ export * from './ConditionalWrapper';
3
3
  export * from './ComboBox/ComboBox';
4
4
  export * from './Dropdown/Dropdown';
5
5
  export * from './FileInput/FileInput';
6
- export * from './InputLabel/InputLabel';
6
+ export * from './InputDescription/InputDescription';
7
7
  export * from './Label/Label';
8
8
  export * from './Logo';
9
9
  export * from './SettingsButton';
@@ -31119,7 +31119,7 @@ styleInject(css_248z$9);
31119
31119
 
31120
31120
  var ICON_SIZE = 18;
31121
31121
  var ComboBox = React__default.forwardRef(function ComboBox(_a, ref) {
31122
- var items = _a.items, renderItem = _a.renderItem, setSelected = _a.setSelected, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, inputStyle = _a.inputStyle, menuStyle = _a.menuStyle, inputProps = _a.inputProps, footer = _a.footer, _d = _a.noMatchText, noMatchText = _d === void 0 ? 'No matching items' : _d; _a.environment; var onScrollReachEnd = _a.onScrollReachEnd;
31122
+ var items = _a.items, renderItem = _a.renderItem, setSelected = _a.setSelected, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, inputStyle = _a.inputStyle, menuStyle = _a.menuStyle, inputProps = _a.inputProps, footer = _a.footer, _d = _a.noMatchText, noMatchText = _d === void 0 ? 'No matching items' : _d, onScrollReachEnd = _a.onScrollReachEnd;
31123
31123
  var _e = useState(items), inputItems = _e[0], setInputItems = _e[1];
31124
31124
  useEffect(function () {
31125
31125
  setInputItems(items);
@@ -33859,12 +33859,12 @@ var FileInput = function (_a) {
33859
33859
  React__default.createElement("input", __assign$3({ type: "file", name: "file" }, getInputProps()))));
33860
33860
  };
33861
33861
 
33862
- var InputLabel = function (_a) {
33862
+ var InputDescription = function (_a) {
33863
33863
  var helpText = _a.helpText, children = _a.children;
33864
33864
  return (React__default.createElement("div", { style: {
33865
33865
  display: 'flex',
33866
33866
  flexDirection: 'column',
33867
- width: 'fit-content',
33867
+ width: '100%',
33868
33868
  color: 'var(--primary)',
33869
33869
  fontSize: '0.75rem',
33870
33870
  textAlign: 'end',
@@ -33891,14 +33891,14 @@ var Logo = function () { return (React__default.createElement("div", { style: {
33891
33891
  backgroundColor: 'rgba(0,0,0,0)',
33892
33892
  } }))); };
33893
33893
 
33894
- var css_248z$5 = ":root {\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n:root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n* {\n font-family: -apple-system, BlinkMacSystemFont, \"avenir next\", avenir, helvetica, \"helvetica neue\", ubuntu, roboto, noto, \"segoe ui\", arial, sans-serif;\n color: var(--slate12);\n margin: 0;\n font-size: 17px;\n}\n\nh1 {\n font-size: 3rem;\n}\n\nh2 {\n font-size: 2.25rem;\n}\n\nh3 {\n font-size: 1.5rem;\n}\n\nh4 {\n font-size: 1.25rem;\n}\n\nh5 {\n font-size: 1rem;\n}\n\nh6 {\n font-size: 0.875rem;\n}\n\nlabel {\n font-size: 1.125;\n color: var(--slate12);\n}\n\nli {\n font-size: 0.95rem;\n}\n\n.secondary {\n font-size: 0.875rem;\n color: var(--slate10);\n}\n\np,\nspan {\n color: var(--slate12);\n}\n\ninput::placeholder {\n color: var(--slate11);\n}\n\n.btn-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.btn-group:hover {\n box-shadow: 0 1px 2px 0 rgba(26, 115, 232, 0.45), 0 1px 3px 1px rgba(26, 115, 232, 0.3);\n}\n\n.btn-group-disabled:hover {\n box-shadow: none;\n}\n\n.btn-group input {\n width: 100%;\n}\n\n.btn-group input::placeholder {\n color: var(--primary1);\n}\n\n.btn-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.btn-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.btn-group i,\n.btn-group svg {\n background-color: rgba(0, 0, 0, 0);\n}\n\n.btn-group button,\n.btn-group input {\n display: flex;\n padding: 6px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: 1px solid var(--primary);\n border-left-color: #096dd9;\n transition: box-shadow 0.125s ease-in-out;\n}\n\n.btn-group button:active {\n box-shadow: inset 0px 0px 14px 14px #096dd9;\n}\n\n.btn-group button:first-child,\n.btn-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-left-color: var(--primary);\n}\n\n.btn-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n\n.btn-group button:not(:last-child),\n.btn-group input:not(:last-child) {\n border-right: none;\n}\n\n.btn-group button:focus-visible,\n.btn-group input:focus-visible {\n outline: none;\n}\n\n.btn-group button:focus,\n.btn-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.btn-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.btn-group button:hover,\n.btn-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.btn-group-disabled:hover button:hover,\n.btn-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}\n\n.options-content {\n font-size: clamp(0.65rem, 8vw - 0.75rem, 0.85rem);\n}";
33894
+ var css_248z$5 = ":root {\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n:root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n* {\n font-family: -apple-system, BlinkMacSystemFont, \"avenir next\", avenir, helvetica, \"helvetica neue\", ubuntu, roboto, noto, \"segoe ui\", arial, sans-serif;\n color: var(--slate12);\n margin: 0;\n font-size: 17px;\n}\n\nh1 {\n font-size: 3rem;\n}\n\nh2 {\n font-size: 2.25rem;\n}\n\nh3 {\n font-size: 1.5rem;\n}\n\nh4 {\n font-size: 1.25rem;\n}\n\nh5 {\n font-size: 1rem;\n}\n\nh6 {\n font-size: 0.875rem;\n}\n\nlabel {\n font-size: 1.125;\n color: var(--slate12);\n}\n\nli {\n font-size: 0.95rem;\n}\n\n.secondary {\n font-size: 0.875rem;\n color: var(--slate10);\n}\n\np,\nspan {\n color: var(--slate12);\n}\n\ninput::placeholder {\n color: var(--slate11);\n}\n\n.btn-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.btn-group:hover {\n box-shadow: 0 1px 2px 0 rgba(26, 115, 232, 0.45), 0 1px 3px 1px rgba(26, 115, 232, 0.3);\n}\n\n.btn-group-disabled:hover {\n box-shadow: none;\n}\n\n.btn-group input {\n width: 100%;\n}\n\n.btn-group input::placeholder {\n color: var(--primary1);\n}\n\n.btn-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.btn-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.btn-group i,\n.btn-group svg {\n background-color: rgba(0, 0, 0, 0);\n}\n\n.btn-group button,\n.btn-group input {\n display: flex;\n padding: 6px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: 1px solid var(--primary);\n border-left-color: #096dd9;\n transition: box-shadow 0.125s ease-in-out;\n}\n\n.btn-group button:active {\n box-shadow: inset 0px 0px 14px 14px #096dd9;\n}\n\n.btn-group button:first-child,\n.btn-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-left-color: var(--primary);\n}\n\n.btn-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n\n.btn-group button:not(:last-child),\n.btn-group input:not(:last-child) {\n border-right: none;\n}\n\n.btn-group button:focus-visible,\n.btn-group input:focus-visible {\n outline: none;\n}\n\n.btn-group button:focus,\n.btn-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.btn-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.btn-group button:hover,\n.btn-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.btn-group-disabled:hover button:hover {\n box-shadow: none;\n}\n\n.btn-group-disabled:hover button:hover,\n.btn-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}\n\n.options-content {\n font-size: clamp(0.65rem, 8vw - 0.75rem, 0.85rem);\n}";
33895
33895
  styleInject(css_248z$5);
33896
33896
 
33897
33897
  var SettingsButton = function (_a) {
33898
33898
  var onClick = _a.onClick, label = _a.label, options = _a.options, asButtons = _a.asButtons, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.triggerIcon, triggerIcon = _c === void 0 ? React__default.createElement(CaretDownFill$1, null) : _c, helpText = _a.helpText
33899
33899
  // prefix
33900
33900
  ;
33901
- return (React__default.createElement(ConditionalWrapper, { condition: typeof helpText !== 'undefined' || disabled, wrapper: function (children) { return React__default.createElement(InputLabel, { helpText: disabled ? 'Enabled in Pollination CAD plugins.' : helpText }, children); } },
33901
+ return (React__default.createElement(ConditionalWrapper, { condition: typeof helpText !== 'undefined' || disabled, wrapper: function (children) { return React__default.createElement(InputDescription, { helpText: disabled ? 'Enabled in Pollination CAD plugins.' : helpText }, children); } },
33902
33902
  React__default.createElement("div", { className: "btn-group ".concat(disabled && 'btn-group-disabled') },
33903
33903
  React__default.createElement("button", { type: 'button', onClick: onClick, disabled: disabled, style: {
33904
33904
  flex: 1,
@@ -33984,10 +33984,27 @@ var GetGeometry = function (_a) {
33984
33984
  var setParentState = _a.setParentState, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Geometry' : _b;
33985
33985
  var subscribeRef = useRef();
33986
33986
  var _c = useState(performance.now().toString()), key = _c[0], setKey = _c[1];
33987
- var _d = useState(false), selection = _d[0], setSelection = _d[1];
33988
- var _e = useState(false), subscribe = _e[0], setSubscribe = _e[1];
33987
+ var _d = useState(typeof optionsConfig !== 'undefined' &&
33988
+ typeof optionsConfig.selection !== 'undefined' &&
33989
+ typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false), selection = _d[0], setSelection = _d[1];
33990
+ var _e = useState(typeof optionsConfig !== 'undefined' &&
33991
+ typeof optionsConfig.subscribe !== 'undefined' &&
33992
+ typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false), subscribe = _e[0], setSubscribe = _e[1];
33989
33993
  // pollination-react-io hooks
33990
33994
  var _f = useGetGeometry(), host = _f.host, geometry = _f.geometry, getGeometry = _f.getGeometry;
33995
+ // set selection and subscribe on props change
33996
+ useEffect(function () {
33997
+ if (!optionsConfig)
33998
+ return;
33999
+ var sel = typeof optionsConfig !== 'undefined' &&
34000
+ typeof optionsConfig.selection !== 'undefined' &&
34001
+ typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false;
34002
+ var sub = typeof optionsConfig !== 'undefined' &&
34003
+ typeof optionsConfig.subscribe !== 'undefined' &&
34004
+ typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false;
34005
+ setSelection(sel);
34006
+ setSubscribe(sub);
34007
+ }, [optionsConfig]);
33991
34008
  useEffect(function () {
33992
34009
  if (!geometry || !setParentState)
33993
34010
  return;
@@ -34052,7 +34069,8 @@ var GetGeometry = function (_a) {
34052
34069
  ].filter(function (o) {
34053
34070
  if (!optionsConfig)
34054
34071
  return true;
34055
- return typeof optionsConfig[o.id] === 'undefined' ? true : optionsConfig[o.id];
34072
+ return typeof optionsConfig[o.id] === 'undefined' ? true :
34073
+ typeof optionsConfig[o.id].show === 'undefined' ? true : optionsConfig[o.id].show;
34056
34074
  }),
34057
34075
  }] : undefined, asButtons: true, label: buttonLabel, helpText: "Get ".concat(selection ? 'selected ' : '', " geometry").concat(subscribe ? ' continuously' : '', ".") }));
34058
34076
  };
@@ -34067,10 +34085,27 @@ var GetModel = function (_a) {
34067
34085
  var setParentState = _a.setParentState, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Model' : _b;
34068
34086
  var subscribeRef = useRef();
34069
34087
  var _c = useState(performance.now().toString()), key = _c[0], setKey = _c[1];
34070
- var _d = useState(false), selection = _d[0], setSelection = _d[1];
34071
- var _e = useState(false), subscribe = _e[0], setSubscribe = _e[1];
34088
+ var _d = useState(typeof optionsConfig !== 'undefined' &&
34089
+ typeof optionsConfig.selection !== 'undefined' &&
34090
+ typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false), selection = _d[0], setSelection = _d[1];
34091
+ var _e = useState(typeof optionsConfig !== 'undefined' &&
34092
+ typeof optionsConfig.subscribe !== 'undefined' &&
34093
+ typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false), subscribe = _e[0], setSubscribe = _e[1];
34072
34094
  // pollination-react-io hooks
34073
34095
  var _f = useGetHbjson(), host = _f.host, hbjson = _f.hbjson, getHbjson = _f.getHbjson;
34096
+ // set selection and subscribe on props change
34097
+ useEffect(function () {
34098
+ if (!optionsConfig)
34099
+ return;
34100
+ var sel = typeof optionsConfig !== 'undefined' &&
34101
+ typeof optionsConfig.selection !== 'undefined' &&
34102
+ typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false;
34103
+ var sub = typeof optionsConfig !== 'undefined' &&
34104
+ typeof optionsConfig.subscribe !== 'undefined' &&
34105
+ typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false;
34106
+ setSelection(sel);
34107
+ setSubscribe(sub);
34108
+ }, [optionsConfig]);
34074
34109
  useEffect(function () {
34075
34110
  if (!hbjson || !setParentState)
34076
34111
  return;
@@ -34152,7 +34187,8 @@ var GetModel = function (_a) {
34152
34187
  ].filter(function (o) {
34153
34188
  if (!optionsConfig)
34154
34189
  return true;
34155
- return typeof optionsConfig[o.id] === 'undefined' ? true : optionsConfig[o.id];
34190
+ return typeof optionsConfig[o.id] === 'undefined' ? true :
34191
+ typeof optionsConfig[o.id].show === 'undefined' ? true : optionsConfig[o.id].show;
34156
34192
  }),
34157
34193
  }] : undefined, asButtons: true, label: buttonLabel, helpText: "Get ".concat(selection ? 'selected ' : '', " model").concat(subscribe ? ' continuously' : '', ".") })));
34158
34194
  };
@@ -34319,7 +34355,7 @@ styleInject(css_248z);
34319
34355
 
34320
34356
  var SelectAccount = function (_a) {
34321
34357
  var _b;
34322
- var authUser = _a.authUser, client = _a.client, setSelAccount = _a.setSelAccount, environment = _a.environment;
34358
+ var authUser = _a.authUser, client = _a.client, setSelAccount = _a.setSelAccount;
34323
34359
  var comboBoxRef = useRef();
34324
34360
  var _c = useState(function () { return authUser ? [authUser] : []; }), accounts = _c[0], setAccounts = _c[1];
34325
34361
  var _d = useState(false), loading = _d[0], setLoading = _d[1];
@@ -34378,7 +34414,7 @@ var SelectAccount = function (_a) {
34378
34414
  return;
34379
34415
  setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { page: q.page ? q.page + 1 : 1 })); });
34380
34416
  }, []);
34381
- return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment,
34417
+ return (React__default.createElement(ComboBox, { ref: comboBoxRef,
34382
34418
  // @ts-ignore
34383
34419
  items: accounts ? accounts.map(function (a) {
34384
34420
  // @ts-ignore
@@ -34409,7 +34445,7 @@ var SelectAccount = function (_a) {
34409
34445
 
34410
34446
  var SelectStudy = function (_a) {
34411
34447
  var _b, _c;
34412
- var authUser = _a.authUser, client = _a.client, projectName = _a.projectName, projectOwner = _a.projectOwner, setSelStudy = _a.setSelStudy, environment = _a.environment;
34448
+ var authUser = _a.authUser, client = _a.client, projectName = _a.projectName, projectOwner = _a.projectOwner, setSelStudy = _a.setSelStudy;
34413
34449
  var comboBoxRef = useRef();
34414
34450
  var _d = useState(), studies = _d[0], setStudies = _d[1];
34415
34451
  var _e = useState(false), loading = _e[0], setLoading = _e[1];
@@ -34470,7 +34506,7 @@ var SelectStudy = function (_a) {
34470
34506
  return;
34471
34507
  setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { page: q.page ? q.page + 1 : 1 })); });
34472
34508
  }, []);
34473
- return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment, items: (_b = studies === null || studies === void 0 ? void 0 : studies.map(function (r) { var _a; return (__assign$3(__assign$3({}, r), { name: (_a = r.spec.name) !== null && _a !== void 0 ? _a : "".concat(r.recipe.metadata.name, " : ").concat(r.status.id.slice(0, 5), "...") })); })) !== null && _b !== void 0 ? _b : [], setSelected: setSelStudy, inputProps: {
34509
+ return (React__default.createElement(ComboBox, { ref: comboBoxRef, items: (_b = studies === null || studies === void 0 ? void 0 : studies.map(function (r) { var _a; return (__assign$3(__assign$3({}, r), { name: (_a = r.spec.name) !== null && _a !== void 0 ? _a : "".concat(r.recipe.metadata.name, " : ").concat(r.status.id.slice(0, 5), "...") })); })) !== null && _b !== void 0 ? _b : [], setSelected: setSelStudy, inputProps: {
34474
34510
  placeholder: 'Select a study...',
34475
34511
  }, loading: loading, disabled: !authUser || !queryConfig.name || !queryConfig.owner, footer: (React__default.createElement("div", { key: "footer", style: {
34476
34512
  width: '100%',
@@ -34481,21 +34517,21 @@ var SelectStudy = function (_a) {
34481
34517
  };
34482
34518
 
34483
34519
  var SelectProject = function (_a) {
34484
- var _b;
34485
- var authUser = _a.authUser, client = _a.client, projectOwner = _a.projectOwner, setSelProject = _a.setSelProject, environment = _a.environment;
34520
+ var _b, _c;
34521
+ var authUser = _a.authUser, client = _a.client, projectOwner = _a.projectOwner, setSelProject = _a.setSelProject;
34486
34522
  var comboBoxRef = useRef();
34487
- var _c = useState(), projects = _c[0], setProjects = _c[1];
34488
- var _d = useState(false), loading = _d[0], setLoading = _d[1];
34523
+ var _d = useState(), projects = _d[0], setProjects = _d[1];
34524
+ var _e = useState(false), loading = _e[0], setLoading = _e[1];
34489
34525
  var totalRunsRef = useRef({
34490
34526
  loaded: 0,
34491
34527
  total: undefined
34492
34528
  });
34493
- var _e = useState(0), total = _e[0], setTotal = _e[1];
34494
- var _f = useState({
34495
- owner: projectOwner !== null && projectOwner !== void 0 ? projectOwner : (authUser && [authUser.username]),
34529
+ var _f = useState(0), total = _f[0], setTotal = _f[1];
34530
+ var _g = useState({
34531
+ owner: (_b = [projectOwner]) !== null && _b !== void 0 ? _b : (authUser && [authUser.username]),
34496
34532
  page: 1,
34497
34533
  perPage: 10,
34498
- }), queryConfig = _f[0], setQueryConfig = _f[1];
34534
+ }), queryConfig = _g[0], setQueryConfig = _g[1];
34499
34535
  // resetting query
34500
34536
  useEffect(function () {
34501
34537
  // reset total loaded
@@ -34508,7 +34544,7 @@ var SelectProject = function (_a) {
34508
34544
  comboBoxRef.current.selectItem(null);
34509
34545
  }
34510
34546
  setProjects([]);
34511
- setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { owner: projectOwner, page: 1 })); });
34547
+ setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { owner: [projectOwner], page: 1 })); });
34512
34548
  }, [projectOwner]);
34513
34549
  var fetchProjects = useCallback(function (queryConfig) {
34514
34550
  if (!authUser)
@@ -34541,19 +34577,19 @@ var SelectProject = function (_a) {
34541
34577
  return;
34542
34578
  setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { page: q.page ? q.page + 1 : 1 })); });
34543
34579
  }, []);
34544
- return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment, items: projects !== null && projects !== void 0 ? projects : [], setSelected: setSelProject, inputProps: {
34580
+ return (React__default.createElement(ComboBox, { ref: comboBoxRef, items: projects !== null && projects !== void 0 ? projects : [], setSelected: setSelProject, inputProps: {
34545
34581
  placeholder: 'Select a project...',
34546
34582
  }, loading: loading, disabled: !authUser || !queryConfig.owner, footer: (React__default.createElement("div", { key: "footer", style: {
34547
34583
  width: '100%',
34548
34584
  display: 'flex',
34549
34585
  justifyContent: 'center',
34550
34586
  color: 'var(--grey4)',
34551
- } }, "Showing ".concat((_b = projects === null || projects === void 0 ? void 0 : projects.length) !== null && _b !== void 0 ? _b : 0, " of ").concat(total, " projects"))), onScrollReachEnd: onScrollReachEnd }));
34587
+ } }, "Showing ".concat((_c = projects === null || projects === void 0 ? void 0 : projects.length) !== null && _c !== void 0 ? _c : 0, " of ").concat(total, " projects"))), onScrollReachEnd: onScrollReachEnd }));
34552
34588
  };
34553
34589
 
34554
34590
  var SelectRecipe = function (_a) {
34555
34591
  var _b, _c;
34556
- var authUser = _a.authUser, client = _a.client, projectName = _a.projectName, projectOwner = _a.projectOwner, setSelRecipe = _a.setSelRecipe, environment = _a.environment;
34592
+ var authUser = _a.authUser, client = _a.client, projectName = _a.projectName, projectOwner = _a.projectOwner, setSelRecipe = _a.setSelRecipe;
34557
34593
  var comboBoxRef = useRef();
34558
34594
  var _d = useState(), recipes = _d[0], setRecipes = _d[1];
34559
34595
  var _e = useState(false), loading = _e[0], setLoading = _e[1];
@@ -34613,7 +34649,7 @@ var SelectRecipe = function (_a) {
34613
34649
  return;
34614
34650
  setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { page: q.page ? q.page + 1 : 1 })); });
34615
34651
  }, []);
34616
- return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment, items: (_b = recipes === null || recipes === void 0 ? void 0 : recipes.map(function (r, i) { return (__assign$3(__assign$3({}, r), { name: "".concat(r.metadata.name, "-").concat(r.metadata.tag), id: "".concat(r.metadata.name, "-").concat(r.metadata.tag) })); })) !== null && _b !== void 0 ? _b : [], renderItem: function (item) { return (React__default.createElement("div", { style: {
34652
+ return (React__default.createElement(ComboBox, { ref: comboBoxRef, items: (_b = recipes === null || recipes === void 0 ? void 0 : recipes.map(function (r, i) { return (__assign$3(__assign$3({}, r), { name: "".concat(r.metadata.name, "-").concat(r.metadata.tag), id: "".concat(r.metadata.name, "-").concat(r.metadata.tag) })); })) !== null && _b !== void 0 ? _b : [], renderItem: function (item) { return (React__default.createElement("div", { style: {
34617
34653
  display: 'flex',
34618
34654
  alignItems: 'center',
34619
34655
  gap: 8,
@@ -34631,7 +34667,7 @@ var SelectRecipe = function (_a) {
34631
34667
 
34632
34668
  var SelectRun = function (_a) {
34633
34669
  var _b, _c;
34634
- var authUser = _a.authUser, client = _a.client, projectOwner = _a.projectOwner, projectName = _a.projectName, jobId = _a.jobId, setSelRun = _a.setSelRun, environment = _a.environment;
34670
+ var authUser = _a.authUser, client = _a.client, projectOwner = _a.projectOwner, projectName = _a.projectName, jobId = _a.jobId, setSelRun = _a.setSelRun;
34635
34671
  var comboBoxRef = useRef();
34636
34672
  var _d = useState(), runs = _d[0], setRuns = _d[1];
34637
34673
  var _e = useState(false), loading = _e[0], setLoading = _e[1];
@@ -34693,7 +34729,7 @@ var SelectRun = function (_a) {
34693
34729
  return;
34694
34730
  setQueryConfig(function (q) { return (__assign$3(__assign$3({}, q), { page: q.page ? q.page + 1 : 1 })); });
34695
34731
  }, []);
34696
- return (React__default.createElement(ComboBox, { ref: comboBoxRef, environment: environment, items: (_b = runs === null || runs === void 0 ? void 0 : runs.map(function (r) { return (__assign$3(__assign$3({}, r), { name: "".concat(r.recipe.metadata.name, " : ").concat(r.status.status) })); })) !== null && _b !== void 0 ? _b : [], renderItem: function (item, i) { return (React__default.createElement("div", { style: {
34732
+ return (React__default.createElement(ComboBox, { ref: comboBoxRef, items: (_b = runs === null || runs === void 0 ? void 0 : runs.map(function (r) { return (__assign$3(__assign$3({}, r), { name: "".concat(r.recipe.metadata.name, " : ").concat(r.status.status) })); })) !== null && _b !== void 0 ? _b : [], renderItem: function (item, i) { return (React__default.createElement("div", { style: {
34697
34733
  display: 'flex',
34698
34734
  justifyContent: 'space-between',
34699
34735
  paddingRight: 14
@@ -34986,7 +35022,7 @@ var SendResults = function (_a) {
34986
35022
  var _c = useState(false), toggleHide = _c[0], setToggleHide = _c[1];
34987
35023
  var disabled = !sendGeometry || !geometry || host !== 'revit';
34988
35024
  var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0]; _d[1];
34989
- return (React__default.createElement(ConditionalWrapper, { condition: disabled, wrapper: function (children) { return (React__default.createElement(InputLabel, { helpText: 'Available in the Pollination Revit Plugin' }, children)); } },
35025
+ return (React__default.createElement(ConditionalWrapper, { condition: disabled, wrapper: function (children) { return (React__default.createElement(InputDescription, { helpText: 'Available in the Pollination Revit Plugin' }, children)); } },
34990
35026
  React__default.createElement("div", { className: "btn-group ".concat(disabled && 'btn-group-disabled') },
34991
35027
  React__default.createElement("button", { onClick: function () {
34992
35028
  if (disabled)