pollination-react-io 1.13.1 → 1.13.3
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/SendGeometry/SendGeometry.types.d.ts +0 -1
- package/build/SendResults/SendResults.types.d.ts +5 -0
- package/build/hooks/useCreateStudy.d.ts +4 -3
- package/build/index.esm.js +361 -99
- package/build/index.esm.js.map +1 -1
- package/build/index.js +361 -99
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -21783,9 +21783,18 @@ var useArtifacts = function (owner, name, client) {
|
|
|
21783
21783
|
var useCreateStudy = function (accountName, projectName, client) {
|
|
21784
21784
|
var host = getHost();
|
|
21785
21785
|
var uploadArtifact = useArtifacts(accountName, projectName, client).uploadArtifact;
|
|
21786
|
-
|
|
21786
|
+
// uploads all file inputs for cloud studies
|
|
21787
|
+
var processEntryCloud = useCallback(function (_a, input) {
|
|
21787
21788
|
var name = _a[0], value = _a[1];
|
|
21788
21789
|
return new Promise(function (resolve, reject) {
|
|
21790
|
+
var type = input.type;
|
|
21791
|
+
if (type !== 'DAGFileInput') {
|
|
21792
|
+
resolve({
|
|
21793
|
+
name: name,
|
|
21794
|
+
type: 'JobArgument',
|
|
21795
|
+
value: value
|
|
21796
|
+
});
|
|
21797
|
+
}
|
|
21789
21798
|
// true for files selected via SelectCloudArtifacts
|
|
21790
21799
|
if (typeof value.pollination_cloud_path === 'string') {
|
|
21791
21800
|
resolve({
|
|
@@ -21796,55 +21805,89 @@ var useCreateStudy = function (accountName, projectName, client) {
|
|
|
21796
21805
|
path: value.pollination_cloud_path
|
|
21797
21806
|
}
|
|
21798
21807
|
});
|
|
21799
|
-
// true for files selected via SelectLocalArtifactNative
|
|
21800
21808
|
}
|
|
21801
|
-
|
|
21802
|
-
|
|
21809
|
+
// true for files selected via SelectLocalArtifactNative
|
|
21810
|
+
if (typeof value.pollination_local_path === 'string') {
|
|
21811
|
+
reject('Running cloud simulations with local artifacts not yet supported.');
|
|
21812
|
+
// resolve({
|
|
21813
|
+
// name,
|
|
21814
|
+
// type: 'JobPathArgument',
|
|
21815
|
+
// source: {
|
|
21816
|
+
// type: 'ProjectFolder',
|
|
21817
|
+
// path: value.pollination_local_path
|
|
21818
|
+
// }
|
|
21819
|
+
// })
|
|
21820
|
+
}
|
|
21821
|
+
// true for file uploaders
|
|
21822
|
+
if (value instanceof File) {
|
|
21823
|
+
if (!uploadArtifact) {
|
|
21824
|
+
reject('useCreateStudy: uploadArtifact is undefined but the user needs to upload input files.');
|
|
21825
|
+
}
|
|
21826
|
+
resolve(uploadArtifact(undefined, value)
|
|
21827
|
+
.then(function (data) { return ({
|
|
21803
21828
|
name: name,
|
|
21804
21829
|
type: 'JobPathArgument',
|
|
21805
21830
|
source: {
|
|
21806
21831
|
type: 'ProjectFolder',
|
|
21807
|
-
path: value.
|
|
21832
|
+
path: value.name
|
|
21808
21833
|
}
|
|
21809
|
-
});
|
|
21810
|
-
// true for files selected via SelectLocalArtifactNative
|
|
21834
|
+
}); }));
|
|
21811
21835
|
}
|
|
21812
|
-
|
|
21836
|
+
});
|
|
21837
|
+
}, [uploadArtifact]);
|
|
21838
|
+
// downloads, saves all file inputs for handling by plugins for local runs
|
|
21839
|
+
// regardless of whether it's a local run or cloud run, platform will handle input files
|
|
21840
|
+
var processEntryLocal = useCallback(function (_a, input) {
|
|
21841
|
+
var name = _a[0], value = _a[1];
|
|
21842
|
+
return new Promise(function (resolve, reject) {
|
|
21843
|
+
var type = input.type;
|
|
21844
|
+
if (type !== 'DAGFileInput') {
|
|
21813
21845
|
resolve({
|
|
21814
21846
|
name: name,
|
|
21815
21847
|
type: 'JobArgument',
|
|
21816
21848
|
value: value
|
|
21817
21849
|
});
|
|
21818
21850
|
}
|
|
21819
|
-
|
|
21820
|
-
|
|
21821
|
-
reject('useCreateStudy: uploadArtifact is undefined but the user needs to upload input files.');
|
|
21822
|
-
}
|
|
21823
|
-
resolve(uploadArtifact(undefined, value)
|
|
21824
|
-
.then(function (data) { return ({
|
|
21851
|
+
if (typeof value.pollination_local_path === 'string') {
|
|
21852
|
+
resolve({
|
|
21825
21853
|
name: name,
|
|
21826
21854
|
type: 'JobPathArgument',
|
|
21827
21855
|
source: {
|
|
21828
21856
|
type: 'ProjectFolder',
|
|
21829
|
-
path: value.
|
|
21857
|
+
path: value.pollination_local_path
|
|
21830
21858
|
}
|
|
21831
|
-
});
|
|
21859
|
+
});
|
|
21860
|
+
}
|
|
21861
|
+
// if the file is cloud hosted, or from CAD application - download / save
|
|
21862
|
+
if (value instanceof File) {
|
|
21863
|
+
reject('File nputs to local simulations, including .hbjson models, must be provided using the local file selector.');
|
|
21864
|
+
// resolve({
|
|
21865
|
+
// name,
|
|
21866
|
+
// type: 'JobPathArgument',
|
|
21867
|
+
// source: {
|
|
21868
|
+
// type: 'ProjectFolder',
|
|
21869
|
+
// path: download(value)
|
|
21870
|
+
// }
|
|
21871
|
+
// })
|
|
21832
21872
|
}
|
|
21833
21873
|
});
|
|
21834
|
-
}, [
|
|
21874
|
+
}, []);
|
|
21835
21875
|
var createStudy = useCallback(function (_a, data, onSuccess) {
|
|
21836
|
-
var name = _a.name,
|
|
21837
|
-
if (!client || !name || !
|
|
21876
|
+
var name = _a.name, recipe = _a.recipe, description = _a.description;
|
|
21877
|
+
if (!client || !name || !recipe || !data) {
|
|
21838
21878
|
return new Promise(function (resolve, reject) { return resolve(); });
|
|
21839
21879
|
}
|
|
21840
|
-
return Promise.all(Object.entries(data).map(function (d) {
|
|
21880
|
+
return Promise.all(Object.entries(data).map(function (d) {
|
|
21881
|
+
var input = recipe.inputs.find(function (i) { return i.name === d[0]; });
|
|
21882
|
+
return processEntryCloud(d, input);
|
|
21883
|
+
}))
|
|
21841
21884
|
.then(function (jobArguments) {
|
|
21842
21885
|
var job = {
|
|
21843
21886
|
type: 'Job',
|
|
21844
21887
|
api_version: 'v1beta1',
|
|
21845
21888
|
name: name,
|
|
21846
21889
|
description: description,
|
|
21847
|
-
source: source,
|
|
21890
|
+
source: recipe.source,
|
|
21848
21891
|
arguments: [jobArguments]
|
|
21849
21892
|
};
|
|
21850
21893
|
return client.jobs.createJob({
|
|
@@ -21861,10 +21904,9 @@ var useCreateStudy = function (accountName, projectName, client) {
|
|
|
21861
21904
|
throw new Error(data.detail);
|
|
21862
21905
|
});
|
|
21863
21906
|
});
|
|
21864
|
-
}, [accountName, client,
|
|
21865
|
-
// TODO: add parameters to create a cloud study using Rhino's handlers
|
|
21907
|
+
}, [accountName, client, processEntryCloud, projectName]);
|
|
21866
21908
|
var createLocalStudy = useCallback(function (_a, data, _b, key) {
|
|
21867
|
-
var name = _a.name,
|
|
21909
|
+
var name = _a.name, description = _a.description, recipe = _a.recipe;
|
|
21868
21910
|
var localCPUCount = _b.localCPUCount, localRunFolder = _b.localRunFolder, isLocalJob = _b.isLocalJob;
|
|
21869
21911
|
if (key === void 0) { key = performance.now().toString(); }
|
|
21870
21912
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -21874,15 +21916,18 @@ var useCreateStudy = function (accountName, projectName, client) {
|
|
|
21874
21916
|
case 0:
|
|
21875
21917
|
if (!checkDotNet || !client || !uploadArtifact)
|
|
21876
21918
|
return [2 /*return*/];
|
|
21877
|
-
if (!name || !
|
|
21919
|
+
if (!name || !recipe || !data)
|
|
21878
21920
|
return [2 /*return*/];
|
|
21879
|
-
return [4 /*yield*/, Promise.all(Object.entries(data).map(function (d) {
|
|
21921
|
+
return [4 /*yield*/, Promise.all(Object.entries(data).map(function (d) {
|
|
21922
|
+
var input = recipe.inputs.find(function (i) { return i.name === d[0]; });
|
|
21923
|
+
return processEntryLocal(d, input);
|
|
21924
|
+
}))
|
|
21880
21925
|
.then(function (jobArguments) { return ({
|
|
21881
21926
|
type: 'Job',
|
|
21882
21927
|
api_version: 'v1beta1',
|
|
21883
21928
|
name: name,
|
|
21884
21929
|
description: description,
|
|
21885
|
-
source: source,
|
|
21930
|
+
source: recipe.source,
|
|
21886
21931
|
arguments: [jobArguments]
|
|
21887
21932
|
}); })];
|
|
21888
21933
|
case 1:
|
|
@@ -21899,12 +21944,11 @@ var useCreateStudy = function (accountName, projectName, client) {
|
|
|
21899
21944
|
data: jobInfo,
|
|
21900
21945
|
uniqueId: key
|
|
21901
21946
|
});
|
|
21902
|
-
console.log('response: ', response.data);
|
|
21903
21947
|
return [2 /*return*/, response];
|
|
21904
21948
|
}
|
|
21905
21949
|
});
|
|
21906
21950
|
});
|
|
21907
|
-
}, [client,
|
|
21951
|
+
}, [client, processEntryLocal, uploadArtifact]);
|
|
21908
21952
|
return {
|
|
21909
21953
|
host: host,
|
|
21910
21954
|
createStudy: createStudy,
|
|
@@ -32037,11 +32081,11 @@ function useDirection(t,n){const[r,o]=React.useState("ltr"),[i,u]=React.useState
|
|
|
32037
32081
|
|
|
32038
32082
|
function useControllableState({prop:o,defaultProp:r,onChange:n=(()=>{})}){const[a,u]=function({defaultProp:o,onChange:r}){const n=React.useState(o),[a]=n,u=React.useRef(a),c=useCallbackRef$1(r);return React.useEffect((()=>{u.current!==a&&(c(a),u.current=a);}),[a,u,c]),n}({defaultProp:r,onChange:n}),c=void 0!==o,f=c?o:a,l=useCallbackRef$1(n);return [f,React.useCallback((e=>{if(c){const t=e,r="function"==typeof e?t(o):e;r!==o&&l(r);}else u(e);}),[c,o,u,l])]}
|
|
32039
32083
|
|
|
32040
|
-
function createCollection(c){const n=c+"CollectionProvider",[l,i]=createContextScope(n),[f,a]=l(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{const{scope:r,children:t}=e,c=React__default.useRef(null),n=React__default.useRef(new Map).current;return React__default.createElement(f,{scope:r,itemMap:n,collectionRef:c},t)},m=c+"CollectionSlot",s=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l}=t,i=a(m,n),f=useComposedRefs(c,i.collectionRef);return React__default.createElement(Slot,{ref:f},l)})),p=c+"CollectionItemSlot",d="data-radix-collection-item",R=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l,...i}=t,f=React__default.useRef(null),u=useComposedRefs(c,f),m=a(p,n);return React__default.useEffect((()=>(m.itemMap.set(f,{ref:f,...i}),()=>{m.itemMap.delete(f);}))),/*#__PURE__*/React__default.createElement(Slot,{[d]:"",ref:u},l)}));return [{Provider:u,Slot:s,ItemSlot:R},function(e){const r=a(c+"CollectionConsumer",e);return React__default.useCallback((()=>{const e=r.collectionRef.current;if(!e)return [];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)))}),[r.collectionRef,r.itemMap])},i]}
|
|
32084
|
+
function createCollection$1(c){const n=c+"CollectionProvider",[l,i]=createContextScope(n),[f,a]=l(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{const{scope:r,children:t}=e,c=React__default.useRef(null),n=React__default.useRef(new Map).current;return React__default.createElement(f,{scope:r,itemMap:n,collectionRef:c},t)},m=c+"CollectionSlot",s=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l}=t,i=a(m,n),f=useComposedRefs(c,i.collectionRef);return React__default.createElement(Slot,{ref:f},l)})),p=c+"CollectionItemSlot",d="data-radix-collection-item",R=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l,...i}=t,f=React__default.useRef(null),u=useComposedRefs(c,f),m=a(p,n);return React__default.useEffect((()=>(m.itemMap.set(f,{ref:f,...i}),()=>{m.itemMap.delete(f);}))),/*#__PURE__*/React__default.createElement(Slot,{[d]:"",ref:u},l)}));return [{Provider:u,Slot:s,ItemSlot:R},function(e){const r=a(c+"CollectionConsumer",e);return React__default.useCallback((()=>{const e=r.collectionRef.current;if(!e)return [];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)))}),[r.collectionRef,r.itemMap])},i]}
|
|
32041
32085
|
|
|
32042
32086
|
function composeEventHandlers$1(e,n,{checkForDefaultPrevented:t=!0}={}){return function(r){if(null==e||e(r),!1===t||!r.defaultPrevented)return null==n?void 0:n(r)}}
|
|
32043
32087
|
|
|
32044
|
-
const f$5={bubbles:!1,cancelable:!0},[p$2,l$3,m$3]=createCollection("RovingFocusGroup"),[d$4,v$1]=createContextScope("RovingFocusGroup",[m$3]);const[g$2,F$2]=d$4("RovingFocusGroup");const RovingFocusGroup=/*#__PURE__*/React.forwardRef(((e,o)=>/*#__PURE__*/React.createElement(p$2.Provider,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/React.createElement(p$2.Slot,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/React.createElement(w$2,_extends$B({},e,{ref:o}))))));const w$2=/*#__PURE__*/React.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:c,orientation:p,dir:m="ltr",loop:d=!1,currentTabStopId:v,defaultCurrentTabStopId:F,onCurrentTabStopIdChange:w,onEntryFocus:b,...x}=t,E=React.useRef(null),I=useComposedRefs(n,E),[G=null,h]=useControllableState({prop:v,defaultProp:F,onChange:w}),[T,A]=React.useState(!1),y=useCallbackRef$1(b),D=l$3(c),S=React.useRef(!1);return React.useEffect((()=>{const e=E.current;if(e)return e.addEventListener("rovingFocusGroup.onEntryFocus",y),()=>e.removeEventListener("rovingFocusGroup.onEntryFocus",y)}),[y]),/*#__PURE__*/React.createElement(g$2,{scope:c,orientation:p,dir:m,loop:d,currentTabStopId:G,onItemFocus:React.useCallback((e=>h(e)),[h]),onItemShiftTab:React.useCallback((()=>A(!0)),[])},/*#__PURE__*/React.createElement(Primitive.div,_extends$B({tabIndex:T?-1:0,"data-orientation":p},x,{ref:I,style:{outline:"none",...t.style},onMouseDown:composeEventHandlers$1(t.onMouseDown,(()=>{S.current=!0;})),onFocus:composeEventHandlers$1(t.onFocus,(e=>{const o=!S.current;if(e.target===e.currentTarget&&o&&!T){const o=new Event("rovingFocusGroup.onEntryFocus",f$5);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=D().filter((e=>e.focusable));R$2([e.find((e=>e.active)),e.find((e=>e.id===G)),...e].filter(Boolean).map((e=>e.ref.current)));}}S.current=!1;})),onBlur:composeEventHandlers$1(t.onBlur,(()=>A(!1)))})))}));const RovingFocusGroupItem=/*#__PURE__*/React.forwardRef(((e,o)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:c=!1,...f}=e,m=useId(),d=F$2("RovingFocusGroupItem",n),v=d.currentTabStopId===m,g=l$3(n);return React.createElement(p$2.ItemSlot,{scope:n,id:m,focusable:i,active:c},/*#__PURE__*/React.createElement(Primitive.span,_extends$B({tabIndex:v?0:-1,"data-orientation":d.orientation},f,{ref:o,onMouseDown:composeEventHandlers$1(e.onMouseDown,(e=>{i?d.onItemFocus(m):e.preventDefault();})),onFocus:composeEventHandlers$1(e.onFocus,(()=>d.onItemFocus(m))),onKeyDown:composeEventHandlers$1(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return "rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return "vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:b$2[t]}(e,d.orientation,d.dir);if(void 0!==o){e.preventDefault();let n=g().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const i=n.indexOf(e.currentTarget);n=d.loop?(t=i+1,(r=n).map(((e,o)=>r[(t+o)%r.length]))):n.slice(i+1);}setTimeout((()=>R$2(n)));}var r,t;}))})))}));const b$2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R$2(e){const o=document.activeElement;for(const r of e){if(r===o)return;if(r.focus(),document.activeElement!==o)return}}const Root$4=RovingFocusGroup;const Item$2=RovingFocusGroupItem;
|
|
32088
|
+
const f$5={bubbles:!1,cancelable:!0},[p$2,l$3,m$3]=createCollection$1("RovingFocusGroup"),[d$4,v$1]=createContextScope("RovingFocusGroup",[m$3]);const[g$2,F$2]=d$4("RovingFocusGroup");const RovingFocusGroup=/*#__PURE__*/React.forwardRef(((e,o)=>/*#__PURE__*/React.createElement(p$2.Provider,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/React.createElement(p$2.Slot,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/React.createElement(w$2,_extends$B({},e,{ref:o}))))));const w$2=/*#__PURE__*/React.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:c,orientation:p,dir:m="ltr",loop:d=!1,currentTabStopId:v,defaultCurrentTabStopId:F,onCurrentTabStopIdChange:w,onEntryFocus:b,...x}=t,E=React.useRef(null),I=useComposedRefs(n,E),[G=null,h]=useControllableState({prop:v,defaultProp:F,onChange:w}),[T,A]=React.useState(!1),y=useCallbackRef$1(b),D=l$3(c),S=React.useRef(!1);return React.useEffect((()=>{const e=E.current;if(e)return e.addEventListener("rovingFocusGroup.onEntryFocus",y),()=>e.removeEventListener("rovingFocusGroup.onEntryFocus",y)}),[y]),/*#__PURE__*/React.createElement(g$2,{scope:c,orientation:p,dir:m,loop:d,currentTabStopId:G,onItemFocus:React.useCallback((e=>h(e)),[h]),onItemShiftTab:React.useCallback((()=>A(!0)),[])},/*#__PURE__*/React.createElement(Primitive.div,_extends$B({tabIndex:T?-1:0,"data-orientation":p},x,{ref:I,style:{outline:"none",...t.style},onMouseDown:composeEventHandlers$1(t.onMouseDown,(()=>{S.current=!0;})),onFocus:composeEventHandlers$1(t.onFocus,(e=>{const o=!S.current;if(e.target===e.currentTarget&&o&&!T){const o=new Event("rovingFocusGroup.onEntryFocus",f$5);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=D().filter((e=>e.focusable));R$2([e.find((e=>e.active)),e.find((e=>e.id===G)),...e].filter(Boolean).map((e=>e.ref.current)));}}S.current=!1;})),onBlur:composeEventHandlers$1(t.onBlur,(()=>A(!1)))})))}));const RovingFocusGroupItem=/*#__PURE__*/React.forwardRef(((e,o)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:c=!1,...f}=e,m=useId(),d=F$2("RovingFocusGroupItem",n),v=d.currentTabStopId===m,g=l$3(n);return React.createElement(p$2.ItemSlot,{scope:n,id:m,focusable:i,active:c},/*#__PURE__*/React.createElement(Primitive.span,_extends$B({tabIndex:v?0:-1,"data-orientation":d.orientation},f,{ref:o,onMouseDown:composeEventHandlers$1(e.onMouseDown,(e=>{i?d.onItemFocus(m):e.preventDefault();})),onFocus:composeEventHandlers$1(e.onFocus,(()=>d.onItemFocus(m))),onKeyDown:composeEventHandlers$1(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return "rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return "vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:b$2[t]}(e,d.orientation,d.dir);if(void 0!==o){e.preventDefault();let n=g().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const i=n.indexOf(e.currentTarget);n=d.loop?(t=i+1,(r=n).map(((e,o)=>r[(t+o)%r.length]))):n.slice(i+1);}setTimeout((()=>R$2(n)));}var r,t;}))})))}));const b$2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R$2(e){const o=document.activeElement;for(const r of e){if(r===o)return;if(r.focus(),document.activeElement!==o)return}}const Root$4=RovingFocusGroup;const Item$2=RovingFocusGroupItem;
|
|
32045
32089
|
|
|
32046
32090
|
const Portal=/*#__PURE__*/React.forwardRef(((a,i)=>{var n,d;const{containerRef:s,style:u,...c}=a,m=null!==(n=null==s?void 0:s.current)&&void 0!==n?n:null===globalThis||void 0===globalThis||null===(d=globalThis.document)||void 0===d?void 0:d.body,[,f]=React.useState({});return useLayoutEffect((()=>{f({});}),[]),m?/*#__PURE__*/e$7.createPortal(/*#__PURE__*/React.createElement(Primitive.div,_extends$B({"data-radix-portal":""},c,{ref:i,style:m===document.body?{position:"absolute",top:0,left:0,zIndex:2147483647,...u}:void 0})),m):null}));
|
|
32047
32091
|
|
|
@@ -32067,6 +32111,8 @@ let n$1,o$1=0;function useBodyPointerEvents({disabled:r}){const i=React.useRef(!
|
|
|
32067
32111
|
|
|
32068
32112
|
const u$1=/*#__PURE__*/React.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});const DismissableLayer=/*#__PURE__*/React.forwardRef(((l,m)=>{const{disableOutsidePointerEvents:f=!1,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:b,onInteractOutside:E,onDismiss:y,...w}=l,h=React.useContext(u$1),[D,x]=React.useState(null),[,C]=React.useState({}),L=useComposedRefs(m,(e=>x(e))),P=Array.from(h.layers),[O]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),g=P.indexOf(O),B=D?P.indexOf(D):-1,R=h.layersWithOutsidePointerEventsDisabled.size>0,F=B>=g,S=function(e){const n=useCallbackRef$1(e),r=React.useRef(!1);return React.useEffect((()=>{const e=e=>{if(e.target&&!r.current){d$1("dismissableLayer.pointerDownOutside",n,{originalEvent:e});}r.current=!1;},t=window.setTimeout((()=>{document.addEventListener("pointerdown",e);}),0);return ()=>{window.clearTimeout(t),document.removeEventListener("pointerdown",e);}}),[n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...h.branches].some((e=>e.contains(t)));F&&!n&&(null==v||v(e),null==E||E(e),e.defaultPrevented||null==y||y());})),W=function(e){const n=useCallbackRef$1(e),r=React.useRef(!1);return React.useEffect((()=>{const e=e=>{if(e.target&&!r.current){d$1("dismissableLayer.focusOutside",n,{originalEvent:e});}};return document.addEventListener("focusin",e),()=>document.removeEventListener("focusin",e)}),[n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...h.branches].some((e=>e.contains(t)))||(null==b||b(e),null==E||E(e),e.defaultPrevented||null==y||y());}));return useEscapeKeydown((e=>{B===h.layers.size-1&&(null==p||p(e),e.defaultPrevented||null==y||y());})),useBodyPointerEvents({disabled:f}),React.useEffect((()=>{D&&(f&&h.layersWithOutsidePointerEventsDisabled.add(D),h.layers.add(D),c$1());}),[D,f,h]),React.useEffect((()=>()=>{D&&(h.layers.delete(D),h.layersWithOutsidePointerEventsDisabled.delete(D),c$1());}),[D,h]),React.useEffect((()=>{const e=()=>C({});return document.addEventListener("dismissableLayer.update",e),()=>document.removeEventListener("dismissableLayer.update",e)}),[]),/*#__PURE__*/React.createElement(Primitive.div,_extends$B({},w,{ref:L,style:{pointerEvents:R?F?"auto":"none":void 0,...l.style},onFocusCapture:composeEventHandlers$1(l.onFocusCapture,W.onFocusCapture),onBlurCapture:composeEventHandlers$1(l.onBlurCapture,W.onBlurCapture),onPointerDownCapture:composeEventHandlers$1(l.onPointerDownCapture,S.onPointerDownCapture)}))}));function c$1(){const e=new Event("dismissableLayer.update");document.dispatchEvent(e);}function d$1(e,t,n){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});return t&&r.addEventListener(e,t,{once:!0}),!r.dispatchEvent(s)}
|
|
32069
32113
|
|
|
32114
|
+
function createCollection(c){const n=c+"CollectionProvider",[l,i]=createContextScope(n),[f,a]=l(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{const{scope:r,children:t}=e,c=React__default.useRef(null),n=React__default.useRef(new Map).current;return React__default.createElement(f,{scope:r,itemMap:n,collectionRef:c},t)},m=c+"CollectionSlot",s=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l}=t,i=a(m,n),f=useComposedRefs(c,i.collectionRef);return React__default.createElement(Slot,{ref:f},l)})),p=c+"CollectionItemSlot",d="data-radix-collection-item",R=/*#__PURE__*/React__default.forwardRef(((t,c)=>{const{scope:n,children:l,...i}=t,f=React__default.useRef(null),u=useComposedRefs(c,f),m=a(p,n);return React__default.useEffect((()=>(m.itemMap.set(f,{ref:f,...i}),()=>{m.itemMap.delete(f);}))),/*#__PURE__*/React__default.createElement(Slot,{[d]:"",ref:u},l)}));return [{Provider:u,Slot:s,ItemSlot:R},function(e){const r=a(c+"CollectionConsumer",e);return React__default.useCallback((()=>{const e=r.collectionRef.current;if(!e)return [];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)))}),[r.collectionRef,r.itemMap])},i]}
|
|
32115
|
+
|
|
32070
32116
|
var getDefaultParent = function (originalTarget) {
|
|
32071
32117
|
if (typeof document === 'undefined') {
|
|
32072
32118
|
return null;
|
|
@@ -32078,9 +32124,15 @@ var counterMap = new WeakMap();
|
|
|
32078
32124
|
var uncontrolledNodes = new WeakMap();
|
|
32079
32125
|
var markerMap = {};
|
|
32080
32126
|
var lockCount = 0;
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
|
|
32127
|
+
/**
|
|
32128
|
+
* Marks everything except given node(or nodes) as aria-hidden
|
|
32129
|
+
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
32130
|
+
* @param [parentNode] - top element, defaults to document.body
|
|
32131
|
+
* @param {String} [markerName] - a special attribute to mark every node
|
|
32132
|
+
* @param {String} [controlAttribute] - html Attribute to control
|
|
32133
|
+
* @return {Undo} undo command
|
|
32134
|
+
*/
|
|
32135
|
+
var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
|
|
32084
32136
|
var targets = Array.isArray(originalTarget) ? originalTarget : [originalTarget];
|
|
32085
32137
|
if (!markerMap[markerName]) {
|
|
32086
32138
|
markerMap[markerName] = new WeakMap();
|
|
@@ -32088,16 +32140,17 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32088
32140
|
var markerCounter = markerMap[markerName];
|
|
32089
32141
|
var hiddenNodes = [];
|
|
32090
32142
|
var elementsToKeep = new Set();
|
|
32091
|
-
var
|
|
32143
|
+
var elementsToStop = new Set(targets);
|
|
32144
|
+
var keep = function (el) {
|
|
32092
32145
|
if (!el || elementsToKeep.has(el)) {
|
|
32093
32146
|
return;
|
|
32094
32147
|
}
|
|
32095
32148
|
elementsToKeep.add(el);
|
|
32096
32149
|
keep(el.parentNode);
|
|
32097
|
-
}
|
|
32150
|
+
};
|
|
32098
32151
|
targets.forEach(keep);
|
|
32099
32152
|
var deep = function (parent) {
|
|
32100
|
-
if (!parent ||
|
|
32153
|
+
if (!parent || elementsToStop.has(parent)) {
|
|
32101
32154
|
return;
|
|
32102
32155
|
}
|
|
32103
32156
|
Array.prototype.forEach.call(parent.children, function (node) {
|
|
@@ -32105,7 +32158,7 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32105
32158
|
deep(node);
|
|
32106
32159
|
}
|
|
32107
32160
|
else {
|
|
32108
|
-
var attr = node.getAttribute(
|
|
32161
|
+
var attr = node.getAttribute(controlAttribute);
|
|
32109
32162
|
var alreadyHidden = attr !== null && attr !== 'false';
|
|
32110
32163
|
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
32111
32164
|
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
@@ -32119,7 +32172,7 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32119
32172
|
node.setAttribute(markerName, 'true');
|
|
32120
32173
|
}
|
|
32121
32174
|
if (!alreadyHidden) {
|
|
32122
|
-
node.setAttribute(
|
|
32175
|
+
node.setAttribute(controlAttribute, 'true');
|
|
32123
32176
|
}
|
|
32124
32177
|
}
|
|
32125
32178
|
});
|
|
@@ -32135,7 +32188,7 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32135
32188
|
markerCounter.set(node, markerValue);
|
|
32136
32189
|
if (!counterValue) {
|
|
32137
32190
|
if (!uncontrolledNodes.has(node)) {
|
|
32138
|
-
node.removeAttribute(
|
|
32191
|
+
node.removeAttribute(controlAttribute);
|
|
32139
32192
|
}
|
|
32140
32193
|
uncontrolledNodes.delete(node);
|
|
32141
32194
|
}
|
|
@@ -32145,6 +32198,7 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32145
32198
|
});
|
|
32146
32199
|
lockCount--;
|
|
32147
32200
|
if (!lockCount) {
|
|
32201
|
+
// clear
|
|
32148
32202
|
counterMap = new WeakMap();
|
|
32149
32203
|
counterMap = new WeakMap();
|
|
32150
32204
|
uncontrolledNodes = new WeakMap();
|
|
@@ -32152,6 +32206,24 @@ var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
|
32152
32206
|
}
|
|
32153
32207
|
};
|
|
32154
32208
|
};
|
|
32209
|
+
/**
|
|
32210
|
+
* Marks everything except given node(or nodes) as aria-hidden
|
|
32211
|
+
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
32212
|
+
* @param [parentNode] - top element, defaults to document.body
|
|
32213
|
+
* @param {String} [markerName] - a special attribute to mark every node
|
|
32214
|
+
* @return {Undo} undo command
|
|
32215
|
+
*/
|
|
32216
|
+
var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
32217
|
+
if (markerName === void 0) { markerName = 'data-aria-hidden'; }
|
|
32218
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
32219
|
+
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
32220
|
+
if (!activeParentNode) {
|
|
32221
|
+
return function () { return null; };
|
|
32222
|
+
}
|
|
32223
|
+
// we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
|
|
32224
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
|
|
32225
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
|
|
32226
|
+
};
|
|
32155
32227
|
|
|
32156
32228
|
var zeroRightClassName = 'right-scroll-bar-position';
|
|
32157
32229
|
var fullWidthClassName = 'width-before-scroll-bar';
|
|
@@ -32538,18 +32610,20 @@ if (typeof window !== 'undefined') {
|
|
|
32538
32610
|
}
|
|
32539
32611
|
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
32540
32612
|
|
|
32541
|
-
var
|
|
32542
|
-
|
|
32543
|
-
return
|
|
32544
|
-
!(styles.overflowY === styles.overflowX && styles.overflowY === 'visible') // scrollable
|
|
32545
|
-
);
|
|
32613
|
+
var alwaysContainsScroll = function (node) {
|
|
32614
|
+
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
32615
|
+
return node.tagName === 'TEXTAREA';
|
|
32546
32616
|
};
|
|
32547
|
-
var
|
|
32617
|
+
var elementCanBeScrolled = function (node, overflow) {
|
|
32548
32618
|
var styles = window.getComputedStyle(node);
|
|
32549
|
-
return (
|
|
32550
|
-
|
|
32551
|
-
|
|
32552
|
-
|
|
32619
|
+
return (
|
|
32620
|
+
// not-not-scrollable
|
|
32621
|
+
styles[overflow] !== 'hidden' &&
|
|
32622
|
+
// contains scroll inside self
|
|
32623
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
32624
|
+
};
|
|
32625
|
+
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
32626
|
+
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
32553
32627
|
var locationCouldBeScrolled = function (axis, node) {
|
|
32554
32628
|
var current = node;
|
|
32555
32629
|
do {
|
|
@@ -32715,7 +32789,9 @@ function RemoveScrollSideCar(props) {
|
|
|
32715
32789
|
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
|
|
32716
32790
|
// self event, and should be canceled
|
|
32717
32791
|
if (sourceEvent && sourceEvent.should) {
|
|
32718
|
-
event.
|
|
32792
|
+
if (event.cancelable) {
|
|
32793
|
+
event.preventDefault();
|
|
32794
|
+
}
|
|
32719
32795
|
return;
|
|
32720
32796
|
}
|
|
32721
32797
|
// outside or shard event
|
|
@@ -32726,7 +32802,9 @@ function RemoveScrollSideCar(props) {
|
|
|
32726
32802
|
.filter(function (node) { return node.contains(event.target); });
|
|
32727
32803
|
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
32728
32804
|
if (shouldStop) {
|
|
32729
|
-
event.
|
|
32805
|
+
if (event.cancelable) {
|
|
32806
|
+
event.preventDefault();
|
|
32807
|
+
}
|
|
32730
32808
|
}
|
|
32731
32809
|
}
|
|
32732
32810
|
}, []);
|
|
@@ -34587,29 +34665,29 @@ const [$b73a6c6685e72184$var$LabelProvider, $b73a6c6685e72184$var$useLabelContex
|
|
|
34587
34665
|
/**
|
|
34588
34666
|
* Set a given ref to a given value
|
|
34589
34667
|
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
34590
|
-
*/ function $6ed0406888f73fc4$var$setRef$
|
|
34668
|
+
*/ function $6ed0406888f73fc4$var$setRef$2(ref, value) {
|
|
34591
34669
|
if (typeof ref === 'function') ref(value);
|
|
34592
34670
|
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
34593
34671
|
}
|
|
34594
34672
|
/**
|
|
34595
34673
|
* A utility to compose multiple refs together
|
|
34596
34674
|
* Accepts callback refs and RefObject(s)
|
|
34597
|
-
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af$
|
|
34598
|
-
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$
|
|
34675
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af$2(...refs) {
|
|
34676
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$2(ref, node)
|
|
34599
34677
|
)
|
|
34600
34678
|
;
|
|
34601
34679
|
}
|
|
34602
34680
|
/**
|
|
34603
34681
|
* A custom hook that composes multiple refs
|
|
34604
34682
|
* Accepts callback refs and RefObject(s)
|
|
34605
|
-
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$
|
|
34683
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(...refs) {
|
|
34606
34684
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34607
|
-
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$
|
|
34685
|
+
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$2(...refs), refs);
|
|
34608
34686
|
}
|
|
34609
34687
|
|
|
34610
34688
|
/* -------------------------------------------------------------------------------------------------
|
|
34611
34689
|
* createContextScope
|
|
34612
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$
|
|
34690
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$2(scopeName, createContextScopeDeps = []) {
|
|
34613
34691
|
let defaultContexts = [];
|
|
34614
34692
|
/* -----------------------------------------------------------------------------------------------
|
|
34615
34693
|
* createContext
|
|
@@ -34666,12 +34744,12 @@ const [$b73a6c6685e72184$var$LabelProvider, $b73a6c6685e72184$var$useLabelContex
|
|
|
34666
34744
|
createScope.scopeName = scopeName;
|
|
34667
34745
|
return [
|
|
34668
34746
|
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
34669
|
-
$c512c27ab02ef895$var$composeContextScopes$
|
|
34747
|
+
$c512c27ab02ef895$var$composeContextScopes$2(createScope, ...createContextScopeDeps)
|
|
34670
34748
|
];
|
|
34671
34749
|
}
|
|
34672
34750
|
/* -------------------------------------------------------------------------------------------------
|
|
34673
34751
|
* composeContextScopes
|
|
34674
|
-
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$
|
|
34752
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$2(...scopes) {
|
|
34675
34753
|
const baseScope = scopes[0];
|
|
34676
34754
|
if (scopes.length === 1) return baseScope;
|
|
34677
34755
|
const createScope1 = ()=>{
|
|
@@ -34706,10 +34784,10 @@ const [$b73a6c6685e72184$var$LabelProvider, $b73a6c6685e72184$var$useLabelContex
|
|
|
34706
34784
|
|
|
34707
34785
|
/* -------------------------------------------------------------------------------------------------
|
|
34708
34786
|
* Slot
|
|
34709
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$
|
|
34787
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
34710
34788
|
const { children: children , ...slotProps } = props;
|
|
34711
34789
|
const childrenArray = Children.toArray(children);
|
|
34712
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$
|
|
34790
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$2);
|
|
34713
34791
|
if (slottable) {
|
|
34714
34792
|
// the new element to render is the one passed as a child of `Slottable`
|
|
34715
34793
|
const newElement = slottable.props.children;
|
|
@@ -34721,35 +34799,35 @@ const [$b73a6c6685e72184$var$LabelProvider, $b73a6c6685e72184$var$useLabelContex
|
|
|
34721
34799
|
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
34722
34800
|
} else return child;
|
|
34723
34801
|
});
|
|
34724
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$
|
|
34802
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$2, _extends$B({}, slotProps, {
|
|
34725
34803
|
ref: forwardedRef
|
|
34726
34804
|
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
34727
34805
|
}
|
|
34728
|
-
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$
|
|
34806
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$2, _extends$B({}, slotProps, {
|
|
34729
34807
|
ref: forwardedRef
|
|
34730
34808
|
}), children);
|
|
34731
34809
|
});
|
|
34732
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac1360$
|
|
34810
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360$2.displayName = 'Slot';
|
|
34733
34811
|
/* -------------------------------------------------------------------------------------------------
|
|
34734
34812
|
* SlotClone
|
|
34735
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$
|
|
34813
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
34736
34814
|
const { children: children , ...slotProps } = props;
|
|
34737
34815
|
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
34738
|
-
...$5e63c961fc1ce211$var$mergeProps$
|
|
34739
|
-
ref: $6ed0406888f73fc4$export$43e446d32b3d21af$
|
|
34816
|
+
...$5e63c961fc1ce211$var$mergeProps$2(slotProps, children.props),
|
|
34817
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af$2(forwardedRef, children.ref)
|
|
34740
34818
|
});
|
|
34741
34819
|
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
34742
34820
|
});
|
|
34743
|
-
$5e63c961fc1ce211$var$SlotClone$
|
|
34821
|
+
$5e63c961fc1ce211$var$SlotClone$2.displayName = 'SlotClone';
|
|
34744
34822
|
/* -------------------------------------------------------------------------------------------------
|
|
34745
34823
|
* Slottable
|
|
34746
|
-
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$
|
|
34824
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$2 = ({ children: children })=>{
|
|
34747
34825
|
return /*#__PURE__*/ createElement(Fragment$2, null, children);
|
|
34748
34826
|
};
|
|
34749
|
-
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$
|
|
34750
|
-
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$
|
|
34827
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$2(child) {
|
|
34828
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$2;
|
|
34751
34829
|
}
|
|
34752
|
-
function $5e63c961fc1ce211$var$mergeProps$
|
|
34830
|
+
function $5e63c961fc1ce211$var$mergeProps$2(slotProps, childProps) {
|
|
34753
34831
|
// all child props should override
|
|
34754
34832
|
const overrideProps = {
|
|
34755
34833
|
...childProps
|
|
@@ -34799,7 +34877,7 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
34799
34877
|
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$1 = $8927f6f2acc4f386$var$NODES$1.reduce((primitive, node)=>{
|
|
34800
34878
|
const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
34801
34879
|
const { asChild: asChild , ...primitiveProps } = props;
|
|
34802
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360$
|
|
34880
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360$2 : node;
|
|
34803
34881
|
useEffect(()=>{
|
|
34804
34882
|
window[Symbol.for('radix-ui')] = true;
|
|
34805
34883
|
}, []);
|
|
@@ -34814,6 +34892,199 @@ const $8927f6f2acc4f386$var$NODES$1 = [
|
|
|
34814
34892
|
};
|
|
34815
34893
|
}, {});
|
|
34816
34894
|
|
|
34895
|
+
/* -------------------------------------------------------------------------------------------------
|
|
34896
|
+
* createContextScope
|
|
34897
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(scopeName, createContextScopeDeps = []) {
|
|
34898
|
+
let defaultContexts = [];
|
|
34899
|
+
/* -----------------------------------------------------------------------------------------------
|
|
34900
|
+
* createContext
|
|
34901
|
+
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
34902
|
+
const BaseContext = /*#__PURE__*/ createContext(defaultContext);
|
|
34903
|
+
const index = defaultContexts.length;
|
|
34904
|
+
defaultContexts = [
|
|
34905
|
+
...defaultContexts,
|
|
34906
|
+
defaultContext
|
|
34907
|
+
];
|
|
34908
|
+
function Provider(props) {
|
|
34909
|
+
const { scope: scope , children: children , ...context } = props;
|
|
34910
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
34911
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34912
|
+
const value = useMemo(()=>context
|
|
34913
|
+
, Object.values(context));
|
|
34914
|
+
return /*#__PURE__*/ createElement(Context.Provider, {
|
|
34915
|
+
value: value
|
|
34916
|
+
}, children);
|
|
34917
|
+
}
|
|
34918
|
+
function useContext$1(consumerName, scope) {
|
|
34919
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
34920
|
+
const context = useContext(Context);
|
|
34921
|
+
if (context) return context;
|
|
34922
|
+
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
34923
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
34924
|
+
}
|
|
34925
|
+
Provider.displayName = rootComponentName + 'Provider';
|
|
34926
|
+
return [
|
|
34927
|
+
Provider,
|
|
34928
|
+
useContext$1
|
|
34929
|
+
];
|
|
34930
|
+
}
|
|
34931
|
+
/* -----------------------------------------------------------------------------------------------
|
|
34932
|
+
* createScope
|
|
34933
|
+
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
34934
|
+
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
34935
|
+
return /*#__PURE__*/ createContext(defaultContext);
|
|
34936
|
+
});
|
|
34937
|
+
return function useScope(scope) {
|
|
34938
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
34939
|
+
return useMemo(()=>({
|
|
34940
|
+
[`__scope${scopeName}`]: {
|
|
34941
|
+
...scope,
|
|
34942
|
+
[scopeName]: contexts
|
|
34943
|
+
}
|
|
34944
|
+
})
|
|
34945
|
+
, [
|
|
34946
|
+
scope,
|
|
34947
|
+
contexts
|
|
34948
|
+
]);
|
|
34949
|
+
};
|
|
34950
|
+
};
|
|
34951
|
+
createScope.scopeName = scopeName;
|
|
34952
|
+
return [
|
|
34953
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
34954
|
+
$c512c27ab02ef895$var$composeContextScopes$1(createScope, ...createContextScopeDeps)
|
|
34955
|
+
];
|
|
34956
|
+
}
|
|
34957
|
+
/* -------------------------------------------------------------------------------------------------
|
|
34958
|
+
* composeContextScopes
|
|
34959
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$1(...scopes) {
|
|
34960
|
+
const baseScope = scopes[0];
|
|
34961
|
+
if (scopes.length === 1) return baseScope;
|
|
34962
|
+
const createScope1 = ()=>{
|
|
34963
|
+
const scopeHooks = scopes.map((createScope)=>({
|
|
34964
|
+
useScope: createScope(),
|
|
34965
|
+
scopeName: createScope.scopeName
|
|
34966
|
+
})
|
|
34967
|
+
);
|
|
34968
|
+
return function useComposedScopes(overrideScopes) {
|
|
34969
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
34970
|
+
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
34971
|
+
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
34972
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
34973
|
+
const scopeProps = useScope(overrideScopes);
|
|
34974
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
34975
|
+
return {
|
|
34976
|
+
...nextScopes,
|
|
34977
|
+
...currentScope
|
|
34978
|
+
};
|
|
34979
|
+
}, {});
|
|
34980
|
+
return useMemo(()=>({
|
|
34981
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
34982
|
+
})
|
|
34983
|
+
, [
|
|
34984
|
+
nextScopes1
|
|
34985
|
+
]);
|
|
34986
|
+
};
|
|
34987
|
+
};
|
|
34988
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
34989
|
+
return createScope1;
|
|
34990
|
+
}
|
|
34991
|
+
|
|
34992
|
+
/**
|
|
34993
|
+
* Set a given ref to a given value
|
|
34994
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
34995
|
+
*/ function $6ed0406888f73fc4$var$setRef$1(ref, value) {
|
|
34996
|
+
if (typeof ref === 'function') ref(value);
|
|
34997
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
34998
|
+
}
|
|
34999
|
+
/**
|
|
35000
|
+
* A utility to compose multiple refs together
|
|
35001
|
+
* Accepts callback refs and RefObject(s)
|
|
35002
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs) {
|
|
35003
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$1(ref, node)
|
|
35004
|
+
)
|
|
35005
|
+
;
|
|
35006
|
+
}
|
|
35007
|
+
/**
|
|
35008
|
+
* A custom hook that composes multiple refs
|
|
35009
|
+
* Accepts callback refs and RefObject(s)
|
|
35010
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(...refs) {
|
|
35011
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35012
|
+
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs), refs);
|
|
35013
|
+
}
|
|
35014
|
+
|
|
35015
|
+
/* -------------------------------------------------------------------------------------------------
|
|
35016
|
+
* Slot
|
|
35017
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
35018
|
+
const { children: children , ...slotProps } = props;
|
|
35019
|
+
const childrenArray = Children.toArray(children);
|
|
35020
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$1);
|
|
35021
|
+
if (slottable) {
|
|
35022
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
35023
|
+
const newElement = slottable.props.children;
|
|
35024
|
+
const newChildren = childrenArray.map((child)=>{
|
|
35025
|
+
if (child === slottable) {
|
|
35026
|
+
// because the new element will be the one rendered, we are only interested
|
|
35027
|
+
// in grabbing its children (`newElement.props.children`)
|
|
35028
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
35029
|
+
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
35030
|
+
} else return child;
|
|
35031
|
+
});
|
|
35032
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$1, _extends$B({}, slotProps, {
|
|
35033
|
+
ref: forwardedRef
|
|
35034
|
+
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
35035
|
+
}
|
|
35036
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$1, _extends$B({}, slotProps, {
|
|
35037
|
+
ref: forwardedRef
|
|
35038
|
+
}), children);
|
|
35039
|
+
});
|
|
35040
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360$1.displayName = 'Slot';
|
|
35041
|
+
/* -------------------------------------------------------------------------------------------------
|
|
35042
|
+
* SlotClone
|
|
35043
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
35044
|
+
const { children: children , ...slotProps } = props;
|
|
35045
|
+
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
35046
|
+
...$5e63c961fc1ce211$var$mergeProps$1(slotProps, children.props),
|
|
35047
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af$1(forwardedRef, children.ref)
|
|
35048
|
+
});
|
|
35049
|
+
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
35050
|
+
});
|
|
35051
|
+
$5e63c961fc1ce211$var$SlotClone$1.displayName = 'SlotClone';
|
|
35052
|
+
/* -------------------------------------------------------------------------------------------------
|
|
35053
|
+
* Slottable
|
|
35054
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1 = ({ children: children })=>{
|
|
35055
|
+
return /*#__PURE__*/ createElement(Fragment$2, null, children);
|
|
35056
|
+
};
|
|
35057
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$1(child) {
|
|
35058
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1;
|
|
35059
|
+
}
|
|
35060
|
+
function $5e63c961fc1ce211$var$mergeProps$1(slotProps, childProps) {
|
|
35061
|
+
// all child props should override
|
|
35062
|
+
const overrideProps = {
|
|
35063
|
+
...childProps
|
|
35064
|
+
};
|
|
35065
|
+
for(const propName in childProps){
|
|
35066
|
+
const slotPropValue = slotProps[propName];
|
|
35067
|
+
const childPropValue = childProps[propName];
|
|
35068
|
+
const isHandler = /^on[A-Z]/.test(propName); // if it's a handler, modify the override by composing the base handler
|
|
35069
|
+
if (isHandler) overrideProps[propName] = (...args)=>{
|
|
35070
|
+
childPropValue === null || childPropValue === void 0 || childPropValue(...args);
|
|
35071
|
+
slotPropValue === null || slotPropValue === void 0 || slotPropValue(...args);
|
|
35072
|
+
};
|
|
35073
|
+
else if (propName === 'style') overrideProps[propName] = {
|
|
35074
|
+
...slotPropValue,
|
|
35075
|
+
...childPropValue
|
|
35076
|
+
};
|
|
35077
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
35078
|
+
slotPropValue,
|
|
35079
|
+
childPropValue
|
|
35080
|
+
].filter(Boolean).join(' ');
|
|
35081
|
+
}
|
|
35082
|
+
return {
|
|
35083
|
+
...slotProps,
|
|
35084
|
+
...overrideProps
|
|
35085
|
+
};
|
|
35086
|
+
}
|
|
35087
|
+
|
|
34817
35088
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
34818
35089
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
34819
35090
|
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
@@ -34996,7 +35267,7 @@ const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
|
34996
35267
|
* RovingFocusGroup
|
|
34997
35268
|
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';
|
|
34998
35269
|
const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
34999
|
-
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$
|
|
35270
|
+
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$2($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
35000
35271
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
35001
35272
|
]);
|
|
35002
35273
|
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
@@ -35012,7 +35283,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
|
|
|
35012
35283
|
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
35013
35284
|
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
|
35014
35285
|
const ref = useRef(null);
|
|
35015
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$
|
|
35286
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, ref);
|
|
35016
35287
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
35017
35288
|
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
|
35018
35289
|
prop: currentTabStopIdProp,
|
|
@@ -35269,7 +35540,7 @@ const $921a889cee6df7e8$export$99c2b779aa4e8b8b$1 = (props)=>{
|
|
|
35269
35540
|
const child = typeof children === 'function' ? children({
|
|
35270
35541
|
present: presence.isPresent
|
|
35271
35542
|
}) : Children.only(children);
|
|
35272
|
-
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$
|
|
35543
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(presence.ref, child.ref);
|
|
35273
35544
|
const forceMount = typeof children === 'function';
|
|
35274
35545
|
return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
|
|
35275
35546
|
ref: ref
|
|
@@ -35382,12 +35653,12 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b$1.displayName = 'Presence';
|
|
|
35382
35653
|
/* -------------------------------------------------------------------------------------------------
|
|
35383
35654
|
* Radio
|
|
35384
35655
|
* -----------------------------------------------------------------------------------------------*/ const $ce77a8961b41be9e$var$RADIO_NAME = 'Radio';
|
|
35385
|
-
const [$ce77a8961b41be9e$var$createRadioContext, $ce77a8961b41be9e$export$67d2296460f1b002] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$
|
|
35656
|
+
const [$ce77a8961b41be9e$var$createRadioContext, $ce77a8961b41be9e$export$67d2296460f1b002] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$2($ce77a8961b41be9e$var$RADIO_NAME);
|
|
35386
35657
|
const [$ce77a8961b41be9e$var$RadioProvider, $ce77a8961b41be9e$var$useRadioContext] = $ce77a8961b41be9e$var$createRadioContext($ce77a8961b41be9e$var$RADIO_NAME);
|
|
35387
35658
|
const $ce77a8961b41be9e$export$d7b12c4107be0d61 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
35388
35659
|
const { __scopeRadio: __scopeRadio , 'aria-labelledby': ariaLabelledby , name: name , checked: checked = false , required: required , disabled: disabled , value: value = 'on' , onCheck: onCheck , ...radioProps } = props;
|
|
35389
35660
|
const [button, setButton] = useState(null);
|
|
35390
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$
|
|
35661
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, (node)=>setButton(node)
|
|
35391
35662
|
);
|
|
35392
35663
|
const labelId = $b73a6c6685e72184$export$feddbbf47baabdb9(button);
|
|
35393
35664
|
const labelledBy = ariaLabelledby || labelId;
|
|
@@ -35500,7 +35771,7 @@ const $f99a8c78507165f7$var$ARROW_KEYS = [
|
|
|
35500
35771
|
/* -------------------------------------------------------------------------------------------------
|
|
35501
35772
|
* RadioGroup
|
|
35502
35773
|
* -----------------------------------------------------------------------------------------------*/ const $f99a8c78507165f7$var$RADIO_GROUP_NAME = 'RadioGroup';
|
|
35503
|
-
const [$f99a8c78507165f7$var$createRadioGroupContet, $f99a8c78507165f7$export$c547093f11b76da2] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$
|
|
35774
|
+
const [$f99a8c78507165f7$var$createRadioGroupContet, $f99a8c78507165f7$export$c547093f11b76da2] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$2($f99a8c78507165f7$var$RADIO_GROUP_NAME, [
|
|
35504
35775
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4,
|
|
35505
35776
|
$ce77a8961b41be9e$export$67d2296460f1b002
|
|
35506
35777
|
]);
|
|
@@ -35549,7 +35820,7 @@ const $f99a8c78507165f7$export$9f866c100ef519e4 = /*#__PURE__*/ forwardRef((prop
|
|
|
35549
35820
|
const rovingFocusGroupScope = $f99a8c78507165f7$var$useRovingFocusGroupScope(__scopeRadioGroup);
|
|
35550
35821
|
const radioScope = $f99a8c78507165f7$var$useRadioScope(__scopeRadioGroup);
|
|
35551
35822
|
const ref = useRef(null);
|
|
35552
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$
|
|
35823
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, ref);
|
|
35553
35824
|
const checked = context.value === itemProps.value;
|
|
35554
35825
|
const isArrowKeyPressedRef = useRef(false);
|
|
35555
35826
|
useEffect(()=>{
|
|
@@ -40112,16 +40383,16 @@ var CreateStudy = function (_a) {
|
|
|
40112
40383
|
window.open("".concat(basePath, "/").concat(accountName, "/projects/").concat(projectName, "/studies/").concat(studyId));
|
|
40113
40384
|
}, [basePath]);
|
|
40114
40385
|
var handleCreateStudy = useCallback(function (name, data, description) {
|
|
40115
|
-
if (!state.recipe
|
|
40386
|
+
if (!state.recipe || !state.recipe.source) {
|
|
40116
40387
|
return new Promise(function (resolve, reject) { return resolve(); });
|
|
40117
40388
|
}
|
|
40118
40389
|
if (host !== 'web') {
|
|
40119
|
-
return createLocalStudy({ name: name,
|
|
40390
|
+
return createLocalStudy({ name: name, recipe: state.recipe, description: description }, data, localStudyConfig);
|
|
40120
40391
|
}
|
|
40121
40392
|
else {
|
|
40122
|
-
return createStudy({ name: name,
|
|
40393
|
+
return createStudy({ name: name, recipe: state.recipe, description: description }, data, handleCreateStudySuccess);
|
|
40123
40394
|
}
|
|
40124
|
-
}, [
|
|
40395
|
+
}, [createStudy, createLocalStudy, handleCreateStudySuccess, host, localStudyConfig, state.recipe]);
|
|
40125
40396
|
return (React__default.createElement("div", { "data-testid": "CreateProject", style: __assign(__assign({}, defaultStyle), style) },
|
|
40126
40397
|
React__default.createElement(Tabs, { selectedIndex: activeTabIndex, onSelect: function (index) { return setActiveTabIndex(index); }, forceRenderTabPanel: true },
|
|
40127
40398
|
React__default.createElement("div", { style: {
|
|
@@ -41001,7 +41272,7 @@ var getAction = function (key) {
|
|
|
41001
41272
|
}
|
|
41002
41273
|
};
|
|
41003
41274
|
var SendResults = function (_a) {
|
|
41004
|
-
var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b;
|
|
41275
|
+
var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b, geometryOptions = _a.geometryOptions;
|
|
41005
41276
|
var _c = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action.preview), selOpt = _c[0], setSelOpt = _c[1];
|
|
41006
41277
|
var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
|
|
41007
41278
|
var sendMessage = useSendMessage().sendMessage;
|
|
@@ -41017,32 +41288,23 @@ var SendResults = function (_a) {
|
|
|
41017
41288
|
sendMessage('SubscribePreviewResults', {
|
|
41018
41289
|
data: results,
|
|
41019
41290
|
uniqueId: key,
|
|
41020
|
-
options:
|
|
41021
|
-
layer: 'StreamlitLayer',
|
|
41022
|
-
units: 'Meters',
|
|
41023
|
-
},
|
|
41291
|
+
options: geometryOptions,
|
|
41024
41292
|
});
|
|
41025
41293
|
return function () {
|
|
41026
41294
|
sendMessage('ClearResults', {
|
|
41027
41295
|
data: results,
|
|
41028
41296
|
uniqueId: key,
|
|
41029
|
-
options:
|
|
41030
|
-
layer: 'StreamlitLayer',
|
|
41031
|
-
units: 'Meters',
|
|
41032
|
-
},
|
|
41297
|
+
options: geometryOptions,
|
|
41033
41298
|
});
|
|
41034
41299
|
};
|
|
41035
|
-
}, [key, results, selOpt, sendMessage]);
|
|
41300
|
+
}, [geometryOptions, key, results, selOpt, sendMessage]);
|
|
41036
41301
|
return (React__default.createElement(SettingsButton, { disabled: !sendMessage, onClick: function () {
|
|
41037
41302
|
if (!sendMessage)
|
|
41038
41303
|
return;
|
|
41039
41304
|
sendMessage(getAction(selOpt), {
|
|
41040
41305
|
data: results,
|
|
41041
41306
|
uniqueId: key,
|
|
41042
|
-
options:
|
|
41043
|
-
layer: 'StreamlitLayer',
|
|
41044
|
-
units: 'Meters',
|
|
41045
|
-
},
|
|
41307
|
+
options: geometryOptions,
|
|
41046
41308
|
});
|
|
41047
41309
|
}, options: [{
|
|
41048
41310
|
type: 'radio',
|