pollination-react-io 1.6.1 → 1.7.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.js CHANGED
@@ -21576,7 +21576,6 @@ var useAPIClient = function (config) {
21576
21576
  React.useEffect(function () {
21577
21577
  if (!config)
21578
21578
  return;
21579
- client.current = new APIClient(__assign$3({ basePath: basePath }, config));
21580
21579
  setLoading(true);
21581
21580
  client.current.user.getMe()
21582
21581
  .then(function (_a) {
@@ -21592,6 +21591,275 @@ var useAPIClient = function (config) {
21592
21591
  };
21593
21592
  };
21594
21593
 
21594
+ function checkDotNet() {
21595
+ try {
21596
+ if (typeof window.parent.chrome === 'undefined') {
21597
+ console.error('[POLLINATION-DEBUG]: chrome not found.');
21598
+ return false;
21599
+ }
21600
+ }
21601
+ catch (_a) {
21602
+ console.error('[POLLINATION-DEBUG]: chrome not found.');
21603
+ return false;
21604
+ }
21605
+ try {
21606
+ if (typeof window.parent.chrome.webview === 'undefined') {
21607
+ console.error('[POLLINATION-DEBUG]: webview not found.');
21608
+ return false;
21609
+ }
21610
+ }
21611
+ catch (_b) {
21612
+ console.error('[POLLINATION-DEBUG]: webview not found.');
21613
+ return false;
21614
+ }
21615
+ return true;
21616
+ }
21617
+ function checkRuby() {
21618
+ try {
21619
+ if (typeof window.sketchup === 'undefined') {
21620
+ console.error('[POLLINATION-DEBUG]: sketchup not found.');
21621
+ return false;
21622
+ }
21623
+ }
21624
+ catch (_a) {
21625
+ console.error('[POLLINATION-DEBUG]: sketchup not found.');
21626
+ return false;
21627
+ }
21628
+ return true;
21629
+ }
21630
+ function sendMessageDotNet(message) {
21631
+ if (!checkDotNet())
21632
+ return undefined;
21633
+ var json = JSON.stringify(message);
21634
+ try {
21635
+ window.parent.chrome.webview.postMessage(json);
21636
+ }
21637
+ catch (_a) {
21638
+ throw new Error('Failed to post message to dotNet.');
21639
+ }
21640
+ return message;
21641
+ }
21642
+ function sendMessageRuby(message) {
21643
+ if (!checkRuby())
21644
+ return undefined;
21645
+ console.error('[POLLINATION-DEBUG]: sendMesssageRuby not yet implemented');
21646
+ return message;
21647
+ }
21648
+ // not sure if this will work from Streamlit?
21649
+ function getHost(key, defaultValue) {
21650
+ if (key === void 0) { key = '__host__'; }
21651
+ if (defaultValue === void 0) { defaultValue = 'web'; }
21652
+ // getting stored value
21653
+ var retrieved = localStorage.getItem(key);
21654
+ if (!retrieved)
21655
+ return defaultValue;
21656
+ return typeof retrieved === 'string' ? retrieved.toLowerCase() : JSON.parse(retrieved).toLowerCase();
21657
+ }
21658
+
21659
+ var useArtifacts = function (owner, name, client) {
21660
+ var listArtifacts = React.useCallback(function (path) {
21661
+ if (!(client === null || client === void 0 ? void 0 : client.artifacts))
21662
+ return;
21663
+ // let key: string[] | undefined = undefined
21664
+ // if (path) {
21665
+ // key = [path]
21666
+ // }
21667
+ return client.artifacts.listArtifacts({
21668
+ owner: owner,
21669
+ name: name,
21670
+ page: 1,
21671
+ perPage: 50,
21672
+ path: path
21673
+ }).then(function (r) { return r.data; });
21674
+ }, [client.artifacts, owner, name]);
21675
+ var downloadArtifact = React.useCallback(function (path) {
21676
+ if (!(client === null || client === void 0 ? void 0 : client.artifacts))
21677
+ return;
21678
+ return client.artifacts.downloadArtifact({
21679
+ owner: owner,
21680
+ name: name,
21681
+ path: path
21682
+ }).then(function (r) { return r.data; });
21683
+ }, [client.artifacts, owner, name]);
21684
+ var deleteArtifact = React.useCallback(function (path) { return __awaiter$1(void 0, void 0, void 0, function () {
21685
+ var key;
21686
+ return __generator$1(this, function (_a) {
21687
+ switch (_a.label) {
21688
+ case 0:
21689
+ if (!(client === null || client === void 0 ? void 0 : client.artifacts))
21690
+ return [2 /*return*/];
21691
+ key = undefined;
21692
+ if (path) {
21693
+ key = [path];
21694
+ }
21695
+ return [4 /*yield*/, client.artifacts.deleteArtifact({
21696
+ owner: owner,
21697
+ name: name,
21698
+ path: key
21699
+ })];
21700
+ case 1:
21701
+ _a.sent();
21702
+ return [2 /*return*/];
21703
+ }
21704
+ });
21705
+ }); }, [client.artifacts, owner, name]);
21706
+ var uploadArtifact = React.useCallback(function (folderRoot, file) { return __awaiter$1(void 0, void 0, void 0, function () {
21707
+ var filePath, rootKey, uploadKey, result, _a, url, fields, payload;
21708
+ return __generator$1(this, function (_b) {
21709
+ switch (_b.label) {
21710
+ case 0:
21711
+ if (!(client === null || client === void 0 ? void 0 : client.artifacts))
21712
+ return [2 /*return*/];
21713
+ filePath = file.path || file.name;
21714
+ if (!filePath) {
21715
+ return [2 /*return*/];
21716
+ }
21717
+ // folder file paths start with "/" which
21718
+ // must be removed before merging string with rootkey
21719
+ if (filePath.startsWith('/')) {
21720
+ filePath = filePath.slice(1);
21721
+ }
21722
+ rootKey = folderRoot ? folderRoot.key : '';
21723
+ uploadKey = filePath;
21724
+ if (rootKey.endsWith('/')) {
21725
+ uploadKey = "".concat(rootKey).concat(filePath);
21726
+ }
21727
+ else if (rootKey !== '') {
21728
+ uploadKey = "".concat(rootKey, "/").concat(filePath);
21729
+ }
21730
+ return [4 /*yield*/, client.artifacts.createArtifact({
21731
+ owner: owner,
21732
+ name: name,
21733
+ keyRequest: { key: uploadKey }
21734
+ })];
21735
+ case 1:
21736
+ result = _b.sent();
21737
+ _a = result.data, url = _a.url, fields = _a.fields;
21738
+ payload = new FormData();
21739
+ Object.keys(fields).forEach(function (key) { return payload.append(key, fields[key]); });
21740
+ payload.append('file', file);
21741
+ return [4 /*yield*/, fetch(url, {
21742
+ method: 'POST',
21743
+ mode: 'no-cors',
21744
+ body: payload,
21745
+ })];
21746
+ case 2:
21747
+ _b.sent();
21748
+ return [2 /*return*/, result.data];
21749
+ }
21750
+ });
21751
+ }); }, [client.artifacts, owner, name]);
21752
+ return {
21753
+ listArtifacts: listArtifacts,
21754
+ deleteArtifact: deleteArtifact,
21755
+ downloadArtifact: downloadArtifact,
21756
+ uploadArtifact: uploadArtifact
21757
+ };
21758
+ };
21759
+
21760
+ var useCreateStudy = function (accountName, projectName, client) {
21761
+ var host = getHost();
21762
+ var uploadArtifact = useArtifacts(accountName, projectName, client).uploadArtifact;
21763
+ var processEntry = React.useCallback(function (_a) {
21764
+ var name = _a[0], value = _a[1];
21765
+ return new Promise(function (resolve, reject) {
21766
+ if (!(value instanceof File)) {
21767
+ resolve({
21768
+ name: name,
21769
+ type: 'JobArgument',
21770
+ value: value
21771
+ });
21772
+ }
21773
+ else {
21774
+ resolve(uploadArtifact(undefined, value).then(function (data) { return ({
21775
+ name: name,
21776
+ type: 'JobPathArgument',
21777
+ source: {
21778
+ type: 'ProjectFolder',
21779
+ path: value.name
21780
+ }
21781
+ }); }));
21782
+ }
21783
+ });
21784
+ }, [uploadArtifact]);
21785
+ var webCreateJob = React.useCallback(function (_a, data) {
21786
+ var name = _a.name, source = _a.source, description = _a.description;
21787
+ if (!client)
21788
+ return;
21789
+ if (!name || !source || !data)
21790
+ return;
21791
+ if (!uploadArtifact)
21792
+ return;
21793
+ return Promise.all(Object.entries(data).map(function (d) { return processEntry(d); }))
21794
+ .then(function (jobArguments) {
21795
+ var job = {
21796
+ type: 'Job',
21797
+ api_version: 'v1beta1',
21798
+ name: name,
21799
+ description: description,
21800
+ source: source,
21801
+ arguments: [jobArguments]
21802
+ };
21803
+ client.jobs.createJob({
21804
+ owner: accountName,
21805
+ name: projectName,
21806
+ // @ts-ignore
21807
+ job: job
21808
+ })
21809
+ .then(function (res) {
21810
+ window.open("https://app.pollination.cloud/".concat(accountName, "/projects/").concat(projectName, "/studies/").concat(res.data.id), '_newtab');
21811
+ })
21812
+ .catch(function (err) {
21813
+ var data = err.response.data;
21814
+ throw new Error(data.detail);
21815
+ });
21816
+ });
21817
+ }, [accountName, client, processEntry, projectName, uploadArtifact]);
21818
+ var rhinoCreateJob = React.useCallback(function (_a, data, key) {
21819
+ var name = _a.name, source = _a.source, description = _a.description;
21820
+ if (key === void 0) { key = performance.now().toString(); }
21821
+ return __awaiter$1(void 0, void 0, void 0, function () {
21822
+ var job, response;
21823
+ return __generator$1(this, function (_b) {
21824
+ switch (_b.label) {
21825
+ case 0:
21826
+ if (!checkDotNet || !client || !uploadArtifact)
21827
+ return [2 /*return*/];
21828
+ if (!name || !source || !data)
21829
+ return [2 /*return*/];
21830
+ return [4 /*yield*/, Promise.all(Object.entries(data).map(function (d) { return processEntry(d); }))
21831
+ .then(function (jobArguments) { return ({
21832
+ type: 'Job',
21833
+ api_version: 'v1beta1',
21834
+ name: name,
21835
+ description: description,
21836
+ source: source,
21837
+ arguments: [jobArguments]
21838
+ }); })];
21839
+ case 1:
21840
+ job = _b.sent();
21841
+ response = sendMessageDotNet({ action: 'CreateStudy', data: job, uniqueId: key });
21842
+ return [2 /*return*/, response];
21843
+ }
21844
+ });
21845
+ });
21846
+ }, [client, processEntry, uploadArtifact]);
21847
+ var createJob = React.useMemo(function () {
21848
+ switch (host) {
21849
+ case 'web':
21850
+ return webCreateJob;
21851
+ case 'rhino':
21852
+ return rhinoCreateJob;
21853
+ default:
21854
+ return undefined;
21855
+ }
21856
+ }, [host, rhinoCreateJob, webCreateJob]);
21857
+ return {
21858
+ host: host,
21859
+ createStudy: createJob
21860
+ };
21861
+ };
21862
+
21595
21863
  /**
21596
21864
  * Lodash (Custom Build) <https://lodash.com/>
21597
21865
  * Build: `lodash modularize exports="npm" -o ./`
@@ -23443,71 +23711,6 @@ function stubFalse() {
23443
23711
  module.exports = isEqual;
23444
23712
  });
23445
23713
 
23446
- function checkDotNet() {
23447
- try {
23448
- if (typeof window.parent.chrome === 'undefined') {
23449
- console.error('[POLLINATION-DEBUG]: chrome not found.');
23450
- return false;
23451
- }
23452
- }
23453
- catch (_a) {
23454
- console.error('[POLLINATION-DEBUG]: chrome not found.');
23455
- return false;
23456
- }
23457
- try {
23458
- if (typeof window.parent.chrome.webview === 'undefined') {
23459
- console.error('[POLLINATION-DEBUG]: webview not found.');
23460
- return false;
23461
- }
23462
- }
23463
- catch (_b) {
23464
- console.error('[POLLINATION-DEBUG]: webview not found.');
23465
- return false;
23466
- }
23467
- return true;
23468
- }
23469
- function checkRuby() {
23470
- try {
23471
- if (typeof window.sketchup === 'undefined') {
23472
- console.error('[POLLINATION-DEBUG]: sketchup not found.');
23473
- return false;
23474
- }
23475
- }
23476
- catch (_a) {
23477
- console.error('[POLLINATION-DEBUG]: sketchup not found.');
23478
- return false;
23479
- }
23480
- return true;
23481
- }
23482
- function sendMessageDotNet(message) {
23483
- if (!checkDotNet())
23484
- return undefined;
23485
- var json = JSON.stringify(message);
23486
- try {
23487
- window.parent.chrome.webview.postMessage(json);
23488
- }
23489
- catch (_a) {
23490
- throw new Error('Failed to post message to dotNet.');
23491
- }
23492
- return message;
23493
- }
23494
- function sendMessageRuby(message) {
23495
- if (!checkRuby())
23496
- return undefined;
23497
- console.error('[POLLINATION-DEBUG]: sendMesssageRuby not yet implemented');
23498
- return message;
23499
- }
23500
- // not sure if this will work from Streamlit?
23501
- function getHost(key, defaultValue) {
23502
- if (key === void 0) { key = '__host__'; }
23503
- if (defaultValue === void 0) { defaultValue = 'web'; }
23504
- // getting stored value
23505
- var retrieved = localStorage.getItem(key);
23506
- if (!retrieved)
23507
- return defaultValue;
23508
- return typeof retrieved === 'string' ? retrieved.toLowerCase() : JSON.parse(retrieved).toLowerCase();
23509
- }
23510
-
23511
23714
  var useGetHbjson = function () {
23512
23715
  var host = getHost();
23513
23716
  var _a = React.useState(undefined), hbjson = _a[0], setHbjson = _a[1];
@@ -23824,107 +24027,6 @@ var useHbjsontoVTK = function () {
23824
24027
  };
23825
24028
  };
23826
24029
 
23827
- var useArtifacts = function (owner, name, client) {
23828
- var listArtifacts = React.useCallback(function (path) {
23829
- if (!(client === null || client === void 0 ? void 0 : client.artifacts))
23830
- return;
23831
- var key = undefined;
23832
- if (path) {
23833
- key = [path];
23834
- }
23835
- return client.artifacts.listArtifacts({
23836
- owner: owner,
23837
- name: name,
23838
- page: 1,
23839
- perPage: 50,
23840
- path: key
23841
- }).then(function (r) { return r.data; });
23842
- }, [client.artifacts, owner, name]);
23843
- var downloadArtifact = React.useCallback(function (path) {
23844
- if (!(client === null || client === void 0 ? void 0 : client.artifacts))
23845
- return;
23846
- return client.artifacts.downloadArtifact({
23847
- owner: owner,
23848
- name: name,
23849
- path: path
23850
- }).then(function (r) { return r.data; });
23851
- }, [client.artifacts, owner, name]);
23852
- var deleteArtifact = React.useCallback(function (path) { return __awaiter$1(void 0, void 0, void 0, function () {
23853
- var key;
23854
- return __generator$1(this, function (_a) {
23855
- switch (_a.label) {
23856
- case 0:
23857
- if (!(client === null || client === void 0 ? void 0 : client.artifacts))
23858
- return [2 /*return*/];
23859
- key = undefined;
23860
- if (path) {
23861
- key = [path];
23862
- }
23863
- return [4 /*yield*/, client.artifacts.deleteArtifact({
23864
- owner: owner,
23865
- name: name,
23866
- path: key
23867
- })];
23868
- case 1:
23869
- _a.sent();
23870
- return [2 /*return*/];
23871
- }
23872
- });
23873
- }); }, [client.artifacts, owner, name]);
23874
- var uploadArtifact = React.useCallback(function (folderRoot, file) { return __awaiter$1(void 0, void 0, void 0, function () {
23875
- var filePath, rootKey, uploadKey, result, _a, url, fields, payload;
23876
- return __generator$1(this, function (_b) {
23877
- switch (_b.label) {
23878
- case 0:
23879
- if (!(client === null || client === void 0 ? void 0 : client.artifacts))
23880
- return [2 /*return*/];
23881
- filePath = file.path || file.name;
23882
- if (!filePath) {
23883
- return [2 /*return*/];
23884
- }
23885
- // folder file paths start with "/" which
23886
- // must be removed before merging string with rootkey
23887
- if (filePath.startsWith('/')) {
23888
- filePath = filePath.slice(1);
23889
- }
23890
- rootKey = folderRoot ? folderRoot.key : '';
23891
- uploadKey = filePath;
23892
- if (rootKey.endsWith('/')) {
23893
- uploadKey = "".concat(rootKey).concat(filePath);
23894
- }
23895
- else if (rootKey !== '') {
23896
- uploadKey = "".concat(rootKey, "/").concat(filePath);
23897
- }
23898
- return [4 /*yield*/, client.artifacts.createArtifact({
23899
- owner: owner,
23900
- name: name,
23901
- keyRequest: { key: uploadKey }
23902
- })];
23903
- case 1:
23904
- result = _b.sent();
23905
- _a = result.data, url = _a.url, fields = _a.fields;
23906
- payload = new FormData();
23907
- Object.keys(fields).forEach(function (key) { return payload.append(key, fields[key]); });
23908
- payload.append('file', file);
23909
- return [4 /*yield*/, fetch(url, {
23910
- method: 'POST',
23911
- mode: 'no-cors',
23912
- body: payload,
23913
- })];
23914
- case 2:
23915
- _b.sent();
23916
- return [2 /*return*/, result.data];
23917
- }
23918
- });
23919
- }); }, [client.artifacts, owner, name]);
23920
- return {
23921
- listArtifacts: listArtifacts,
23922
- deleteArtifact: deleteArtifact,
23923
- downloadArtifact: downloadArtifact,
23924
- uploadArtifact: uploadArtifact
23925
- };
23926
- };
23927
-
23928
24030
  function composeRefs(...o){return e=>o.forEach((o=>function(o,e){"function"==typeof o?o(e):null!=o&&(o.current=e);}(o,e)))}function useComposedRefs(...e){return React__namespace.useCallback(composeRefs(...e),e)}
23929
24031
 
23930
24032
  function _extends$f() {
@@ -31206,13 +31308,16 @@ function toNumber(value) {
31206
31308
 
31207
31309
  var lodash_debounce = debounce;
31208
31310
 
31209
- var css_248z$9 = ":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: 1rem;\n color: var(--slate12);\n cursor: pointer;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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.poll-combobox {\n width: 100%;\n}\n\n.poll-combobox-content {\n z-index: 100;\n display: flex;\n flex-direction: column;\n width: 100%;\n background-color: white;\n border: 1px solid var(--slate5);\n border-radius: 0px 0px 4px 4px;\n gap: 2px;\n box-sizing: border-box;\n transition: max-height 0.5s ease-in-out;\n}\n\n.poll-combobox-item {\n display: inline-block;\n border-radius: 2px;\n padding: 2px 8px;\n transition: background-color 0.15s linear, color 0.15s linear;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.poll-select-item[data-state=checked] {\n background-color: var(--primary2);\n color: white;\n}\n\n.poll-select-item:focus-visible {\n background-color: var(--primary0);\n outline: solid 1px var(--primary);\n color: unset;\n outline-color: var(--primary);\n}\n\n.poll-select-item:hover {\n background-color: var(--primary0);\n cursor: pointer;\n color: unset;\n}\n\n.poll-separator {\n background-color: var(--slate5);\n height: 1px;\n width: 100%;\n margin: 4px 0;\n}\n\n.poll-combo-footer-container {\n transition: opacity 0.5s ease-in-out;\n}\n\n.poll-combo-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.poll-combo-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.poll-combo-group-disabled:hover {\n box-shadow: none;\n}\n\n.poll-combo-group input {\n width: 100%;\n}\n\n.poll-combo-group input::placeholder {\n color: var(--slate1);\n}\n\n.poll-combo-group-disabled input::placeholder {\n color: var(--slate10);\n}\n\n.poll-combo-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.poll-combo-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.poll-combo-group i,\n.poll-combo-group svg {\n border-radius: inherit;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.poll-combo-group button,\n.poll-combo-group input {\n display: flex;\n padding: 8px 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}\n\n.poll-combo-group button:first-child,\n.poll-combo-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n\n.poll-combo-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-left-color: #096dd9;\n}\n\n.poll-combo-group button:not(:last-child),\n.poll-combo-group input:not(:last-child) {\n border-right: none;\n}\n\n.poll-combo-group button:focus-visible,\n.poll-combo-group input:focus-visible {\n outline: none;\n}\n\n.poll-combo-group button:focus,\n.poll-combo-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.poll-combo-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.poll-combo-group button:hover,\n.poll-combo-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.poll-combo-group-disabled:hover button:hover,\n.poll-combo-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}";
31311
+ var css_248z$9 = ":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: 1rem;\n color: var(--slate12);\n cursor: pointer;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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.poll-combobox {\n width: 100%;\n}\n\n.poll-combobox-content {\n z-index: 100;\n display: flex;\n flex-direction: column;\n width: 100%;\n background-color: white;\n border: 1px solid var(--slate5);\n border-radius: 0px 0px 4px 4px;\n gap: 2px;\n box-sizing: border-box;\n transition: max-height 0.5s ease-in-out;\n}\n\n.poll-combobox-item {\n display: inline-block;\n border-radius: 2px;\n padding: 2px 8px;\n transition: background-color 0.15s linear, color 0.15s linear;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.poll-select-item[data-state=checked] {\n background-color: var(--primary2);\n color: white;\n}\n\n.poll-select-item:focus-visible {\n background-color: var(--primary0);\n outline: solid 1px var(--primary);\n color: unset;\n outline-color: var(--primary);\n}\n\n.poll-select-item:hover {\n background-color: var(--primary0);\n cursor: pointer;\n color: unset;\n}\n\n.poll-separator {\n background-color: var(--slate5);\n height: 1px;\n width: 100%;\n margin: 4px 0;\n}\n\n.poll-combo-header-container {\n transition: opacity 0.5s ease-in-out;\n}\n\n.poll-combo-footer-container {\n transition: opacity 0.5s ease-in-out;\n}\n\n.poll-combo-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.poll-combo-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.poll-combo-group-disabled:hover {\n box-shadow: none;\n}\n\n.poll-combo-group input {\n width: 100%;\n}\n\n.poll-combo-group input::placeholder {\n color: var(--slate1);\n}\n\n.poll-combo-group-disabled input::placeholder {\n color: var(--slate10);\n}\n\n.poll-combo-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.poll-combo-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.poll-combo-group i,\n.poll-combo-group svg {\n border-radius: inherit;\n background-color: rgba(0, 0, 0, 0);\n}\n\n.poll-combo-group button,\n.poll-combo-group input {\n display: flex;\n padding: 8px 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}\n\n.poll-combo-group button:first-child,\n.poll-combo-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n\n.poll-combo-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-left-color: #096dd9;\n}\n\n.poll-combo-group button:not(:last-child),\n.poll-combo-group input:not(:last-child) {\n border-right: none;\n}\n\n.poll-combo-group button:focus-visible,\n.poll-combo-group input:focus-visible {\n outline: none;\n}\n\n.poll-combo-group button:focus,\n.poll-combo-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.poll-combo-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.poll-combo-group button:hover,\n.poll-combo-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.poll-combo-group-disabled:hover button:hover,\n.poll-combo-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}";
31210
31312
  styleInject(css_248z$9);
31211
31313
 
31212
31314
  var ICON_SIZE = 18;
31213
31315
  var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31214
- 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;
31215
- var _e = React.useState(items), inputItems = _e[0], setInputItems = _e[1];
31316
+ 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, _d = _a.icon, icon = _d === void 0 ? React__default["default"].createElement(CursorText$1, null) : _d, inputStyle = _a.inputStyle, menuStyle = _a.menuStyle, inputProps = _a.inputProps, header = _a.header, footer = _a.footer, _e = _a.noMatchText, noMatchText = _e === void 0 ? 'No matching items' : _e, onScrollReachEnd = _a.onScrollReachEnd, _f = _a.stateReducer, stateReducer = _f === void 0 ? function (state, _a) {
31317
+ _a.type; var changes = _a.changes;
31318
+ return changes;
31319
+ } : _f;
31320
+ var _g = React.useState(items), inputItems = _g[0], setInputItems = _g[1];
31216
31321
  React.useEffect(function () {
31217
31322
  setInputItems(items);
31218
31323
  }, [items]);
@@ -31221,7 +31326,7 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31221
31326
  lodash_debounce(onScrollReachEnd, 1000, { leading: true, trailing: false })
31222
31327
  : undefined;
31223
31328
  }, [onScrollReachEnd]);
31224
- var _f = useCombobox({
31329
+ var _h = useCombobox({
31225
31330
  items: inputItems,
31226
31331
  onInputValueChange: function (_a) {
31227
31332
  var inputValue = _a.inputValue;
@@ -31233,9 +31338,10 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31233
31338
  setInputItems(items);
31234
31339
  }
31235
31340
  },
31341
+ stateReducer: stateReducer
31236
31342
  // to what extent is this necessary?
31237
31343
  // environment: environment ? environment : undefined
31238
- }), isOpen = _f.isOpen, getToggleButtonProps = _f.getToggleButtonProps, getMenuProps = _f.getMenuProps, getInputProps = _f.getInputProps, getComboboxProps = _f.getComboboxProps, highlightedIndex = _f.highlightedIndex, getItemProps = _f.getItemProps, openMenu = _f.openMenu, closeMenu = _f.closeMenu, selectItem = _f.selectItem, selectedItem = _f.selectedItem, inputValue = _f.inputValue;
31344
+ }), isOpen = _h.isOpen, getToggleButtonProps = _h.getToggleButtonProps, getMenuProps = _h.getMenuProps, getInputProps = _h.getInputProps, getComboboxProps = _h.getComboboxProps, highlightedIndex = _h.highlightedIndex, getItemProps = _h.getItemProps, openMenu = _h.openMenu, closeMenu = _h.closeMenu, selectItem = _h.selectItem, selectedItem = _h.selectedItem, inputValue = _h.inputValue;
31239
31345
  React.useImperativeHandle(ref, function () { return ({
31240
31346
  selectItem: selectItem,
31241
31347
  selectedItem: selectedItem,
@@ -31244,9 +31350,7 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31244
31350
  React.useEffect(function () {
31245
31351
  if (!selectedItem)
31246
31352
  return;
31247
- if (setSelected) {
31248
- setSelected(selectedItem);
31249
- }
31353
+ setSelected && setSelected(selectedItem);
31250
31354
  closeMenu();
31251
31355
  }, [closeMenu, selectedItem, setSelected]);
31252
31356
  return (React__default["default"].createElement("div", { "data-testid": "ComboBoxSelect", className: "poll-combobox" },
@@ -31269,7 +31373,7 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31269
31373
  display: 'flex',
31270
31374
  color: 'white',
31271
31375
  zIndex: 20,
31272
- } }, selectedItem ? React__default["default"].createElement(CheckCircle$1, { size: ICON_SIZE }) : React__default["default"].createElement(CursorText$1, { size: ICON_SIZE })),
31376
+ } }, selectedItem ? React__default["default"].createElement(CheckCircle$1, { size: ICON_SIZE }) : React__default["default"].cloneElement(icon, { size: ICON_SIZE })),
31273
31377
  loading
31274
31378
  ? (React__default["default"].createElement("button", { tabIndex: -1, disabled: disabled, style: {
31275
31379
  borderBottomRightRadius: isOpen ? 0 : 4,
@@ -31278,9 +31382,7 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31278
31382
  : selectedItem
31279
31383
  ? (React__default["default"].createElement("button", { tabIndex: -1, disabled: disabled, onClick: function () {
31280
31384
  selectItem(null);
31281
- if (setSelected) {
31282
- setSelected(undefined);
31283
- }
31385
+ setSelected && setSelected(undefined);
31284
31386
  }, style: {
31285
31387
  borderBottomRightRadius: isOpen ? 0 : 4,
31286
31388
  } },
@@ -31295,6 +31397,12 @@ var ComboBox = React__default["default"].forwardRef(function ComboBox(_a, ref) {
31295
31397
  padding: isOpen ? '6px 4px' : 0,
31296
31398
  visibility: isOpen ? undefined : 'hidden'
31297
31399
  } },
31400
+ header &&
31401
+ React__default["default"].createElement("div", { className: 'poll-combo-header-container', style: {
31402
+ opacity: isOpen ? 1 : 0
31403
+ } },
31404
+ header,
31405
+ React__default["default"].createElement(Root$8, { key: "poll-separator", className: "poll-separator" })),
31298
31406
  React__default["default"].createElement(PerfectScrollbar, { options: {
31299
31407
  wheelPropagation: false,
31300
31408
  }, onYReachEnd: function () {
@@ -34010,30 +34118,28 @@ var Logo = function () { return (React__default["default"].createElement("div",
34010
34118
  backgroundColor: 'rgba(0,0,0,0)',
34011
34119
  } }))); };
34012
34120
 
34013
- 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: 1rem;\n color: var(--slate12);\n cursor: pointer;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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 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}";
34121
+ 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: 1rem;\n color: var(--slate12);\n cursor: pointer;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\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 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: 8px 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 line-height: 1.5rem;\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}";
34014
34122
  styleInject(css_248z$5);
34015
34123
 
34016
34124
  var SettingsButton = function (_a) {
34017
- 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["default"].createElement(CaretDownFill$1, null) : _c, helpText = _a.helpText
34018
- // prefix
34019
- ;
34125
+ 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["default"].createElement(CaretDownFill$1, null) : _c, helpText = _a.helpText, _d = _a.icon, icon = _d === void 0 ? React__default["default"].createElement(Logo, null) : _d;
34020
34126
  return (React__default["default"].createElement(ConditionalWrapper, { condition: typeof helpText !== 'undefined' || disabled, wrapper: function (children) { return React__default["default"].createElement(InputDescription, { helpText: disabled ? 'Enabled in Pollination CAD plugins.' : helpText }, children); } },
34021
34127
  React__default["default"].createElement("div", { className: "btn-group ".concat(disabled && 'btn-group-disabled') },
34022
34128
  React__default["default"].createElement("button", { type: 'button', onClick: onClick, disabled: disabled, style: {
34023
34129
  flex: 1,
34024
34130
  } },
34025
- React__default["default"].createElement(Logo, null),
34131
+ icon,
34026
34132
  label),
34027
34133
  options && options.length
34028
34134
  && React__default["default"].createElement(React__default["default"].Fragment, null, asButtons ?
34029
34135
  React__default["default"].createElement(React__default["default"].Fragment, null, options.reduce(function (p, c) { return __spreadArray$2(__spreadArray$2([], p, true), c.options, true); }, []).map(function (o) {
34030
34136
  var _a;
34031
- return React__default["default"].createElement("button", { key: o.id, style: {
34137
+ return React__default["default"].createElement("button", { type: 'button', key: o.id, style: {
34032
34138
  boxShadow: !disabled && o.checked ? 'inset 0px 0px 9px 4px #096dd9' : undefined
34033
34139
  }, onClick: function (e) { return o.onSelect && o.onSelect(o); } }, (_a = o.icon) !== null && _a !== void 0 ? _a : o.label);
34034
34140
  }))
34035
34141
  :
34036
- React__default["default"].createElement(Dropdown, { trigger: (React__default["default"].createElement("button", null, triggerIcon)), optionGroups: options, contentProps: {
34142
+ React__default["default"].createElement(Dropdown, { trigger: (React__default["default"].createElement("button", { type: 'button' }, triggerIcon)), optionGroups: options, contentProps: {
34037
34143
  align: 'end',
34038
34144
  style: {
34039
34145
  fontSize: 'clamp(0.65rem, 8vw - 0.75rem, 0.85rem)',
@@ -34041,7 +34147,7 @@ var SettingsButton = function (_a) {
34041
34147
  }, disabled: disabled })))));
34042
34148
  };
34043
34149
 
34044
- var css_248z$4 = ":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.text-input {\n width: 100%;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n border: 1px solid var(--primary);\n}\n\n.text-input: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.text-input-disabled:hover {\n box-shadow: none;\n}\n\n.text-input input {\n width: 100%;\n color: var(--slate12);\n}\n\n.text-input input::placeholder {\n color: var(--slate10);\n}\n\n.text-input i svg {\n fill: var(--primary);\n}\n\n.text-input button,\n.text-input input {\n display: flex;\n padding: 8px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: none;\n line-height: 1.5rem;\n}\n\n.text-input button:first-child,\n.text-input input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n\n.text-input button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-left-color: #096dd9;\n}\n\n.text-input button:not(:last-child),\n.text-input input:not(:last-child) {\n border-right: none;\n}\n\n.text-input button:focus-visible,\n.text-input input:focus-visible {\n outline: none;\n}\n\n.text-input button:focus,\n.text-input input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.text-input:after {\n content: \"\";\n clear: both;\n display: table;\n}";
34150
+ var css_248z$4 = ":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.text-input {\n width: 100%;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n border: 1px solid var(--primary);\n}\n\n.text-input: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.text-input-disabled:hover {\n box-shadow: none;\n}\n\n.text-input input {\n width: 100%;\n color: var(--slate12);\n}\n\n.text-input input::placeholder {\n color: var(--slate10);\n}\n\n.text-input i svg {\n fill: var(--primary);\n}\n\n.text-input button,\n.text-input input {\n display: flex;\n padding: 9px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: none;\n line-height: 1.5rem;\n}\n\n.text-input button:first-child,\n.text-input input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n\n.text-input button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-left-color: #096dd9;\n}\n\n.text-input button:not(:last-child),\n.text-input input:not(:last-child) {\n border-right: none;\n}\n\n.text-input button:focus-visible,\n.text-input input:focus-visible {\n outline: none;\n}\n\n.text-input button:focus,\n.text-input input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.text-input:after {\n content: \"\";\n clear: both;\n display: table;\n}";
34045
34151
  styleInject(css_248z$4);
34046
34152
 
34047
34153
  const VisuallyHidden=/*#__PURE__*/React__namespace.forwardRef(((i,o)=>/*#__PURE__*/React__namespace.createElement(Primitive.span,_extends$f({},i,{ref:o,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...i.style}}))));const Root$2=VisuallyHidden;
@@ -34201,17 +34307,17 @@ var GetModelActions;
34201
34307
  })(GetModelActions || (GetModelActions = {}));
34202
34308
 
34203
34309
  var GetModel = function (_a) {
34204
- var onChange = _a.onChange, setHbjson = _a.setHbjson, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Model' : _b;
34310
+ var onChange = _a.onChange, setHbjson = _a.setHbjson, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Get Model' : _b, _c = _a.showHelpText, showHelpText = _c === void 0 ? true : _c;
34205
34311
  var subscribeRef = React.useRef();
34206
- var _c = React.useState(performance.now().toString()), key = _c[0], setKey = _c[1];
34207
- var _d = React.useState(Boolean(optionsConfig) && typeof optionsConfig !== 'undefined' &&
34208
- typeof optionsConfig.selection !== 'undefined' &&
34209
- typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false), selection = _d[0], setSelection = _d[1];
34312
+ var _d = React.useState(performance.now().toString()), key = _d[0], setKey = _d[1];
34210
34313
  var _e = React.useState(Boolean(optionsConfig) && typeof optionsConfig !== 'undefined' &&
34314
+ typeof optionsConfig.selection !== 'undefined' &&
34315
+ typeof optionsConfig.selection.selected !== 'undefined' ? optionsConfig.selection.selected : false), selection = _e[0], setSelection = _e[1];
34316
+ var _f = React.useState(Boolean(optionsConfig) && typeof optionsConfig !== 'undefined' &&
34211
34317
  typeof optionsConfig.subscribe !== 'undefined' &&
34212
- typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false), subscribe = _e[0], setSubscribe = _e[1];
34318
+ typeof optionsConfig.subscribe.selected !== 'undefined' ? optionsConfig.subscribe.selected : false), subscribe = _f[0], setSubscribe = _f[1];
34213
34319
  // pollination-react-io hooks
34214
- var _f = useGetHbjson(), host = _f.host, hbjson = _f.hbjson, getHbjson = _f.getHbjson;
34320
+ var _g = useGetHbjson(), host = _g.host, hbjson = _g.hbjson, getHbjson = _g.getHbjson;
34215
34321
  // set selection and subscribe on props change
34216
34322
  React.useEffect(function () {
34217
34323
  if (!optionsConfig)
@@ -34226,16 +34332,17 @@ var GetModel = function (_a) {
34226
34332
  setSubscribe(sub);
34227
34333
  }, [optionsConfig]);
34228
34334
  React.useEffect(function () {
34229
- if (!hbjson || !setHbjson)
34335
+ if (!hbjson)
34230
34336
  return;
34231
34337
  var fr = new FileReader();
34232
34338
  fr.onload = function () {
34233
34339
  if (typeof this.result !== 'string')
34234
34340
  return;
34235
- setHbjson({ hbjson: JSON.parse(this.result) });
34341
+ setHbjson && setHbjson({ hbjson: JSON.parse(this.result) });
34236
34342
  };
34237
34343
  fr.readAsText(hbjson);
34238
- }, [hbjson, setHbjson]);
34344
+ onChange && onChange(new File([hbjson], "Model_linked_from_".concat(host, ".hbjson")));
34345
+ }, [hbjson, host, onChange, setHbjson]);
34239
34346
  // subscribe
34240
34347
  React.useEffect(function () {
34241
34348
  if (!getHbjson)
@@ -34310,7 +34417,7 @@ var GetModel = function (_a) {
34310
34417
  return typeof optionsConfig[o.id] === 'undefined' ? true :
34311
34418
  typeof optionsConfig[o.id].show === 'undefined' ? true : optionsConfig[o.id].show;
34312
34419
  }),
34313
- }] : undefined, asButtons: true, label: buttonLabel, helpText: "Get ".concat(selection ? 'selected ' : '', " model").concat(subscribe ? ' continuously' : '', ".") })));
34420
+ }] : undefined, asButtons: true, label: buttonLabel, helpText: showHelpText && "Get ".concat(selection ? 'selected ' : '', " model").concat(subscribe ? ' continuously' : '', "."), icon: hbjson ? React__default["default"].createElement(CheckCircle$1, null) : undefined })));
34314
34421
  };
34315
34422
 
34316
34423
  // Generated with util/create-component.js
@@ -35291,6 +35398,7 @@ exports.sendMessageDotNet = sendMessageDotNet;
35291
35398
  exports.sendMessageRuby = sendMessageRuby;
35292
35399
  exports.useAPIClient = useAPIClient;
35293
35400
  exports.useArtifacts = useArtifacts;
35401
+ exports.useCreateStudy = useCreateStudy;
35294
35402
  exports.useGetGeometry = useGetGeometry;
35295
35403
  exports.useGetHbjson = useGetHbjson;
35296
35404
  exports.useHbjsontoVTK = useHbjsontoVTK;