@darajs/ui-causal-graph-editor 1.21.3 → 1.21.5

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/dist/index.js CHANGED
@@ -20605,9 +20605,15 @@ const EZ = G.div`
20605
20605
  width: 10px;
20606
20606
  height: 10px;
20607
20607
 
20608
- color: ${(e) => e.theme.colors.grey4};
20608
+ color: ${(e) => {
20609
+ var n;
20610
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20611
+ }};
20609
20612
 
20610
- background-color: ${(e) => e.theme.colors.grey4};
20613
+ background-color: ${(e) => {
20614
+ var n;
20615
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20616
+ }};
20611
20617
  border-radius: 5px;
20612
20618
 
20613
20619
  animation: dot-flashing 1s infinite linear alternate;
@@ -20627,9 +20633,15 @@ const EZ = G.div`
20627
20633
  width: 10px;
20628
20634
  height: 10px;
20629
20635
 
20630
- color: ${(e) => e.theme.colors.grey4};
20636
+ color: ${(e) => {
20637
+ var n;
20638
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20639
+ }};
20631
20640
 
20632
- background-color: ${(e) => e.theme.colors.grey4};
20641
+ background-color: ${(e) => {
20642
+ var n;
20643
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20644
+ }};
20633
20645
  border-radius: 5px;
20634
20646
 
20635
20647
  animation: dot-flashing 1s infinite alternate;
@@ -20642,9 +20654,15 @@ const EZ = G.div`
20642
20654
  width: 10px;
20643
20655
  height: 10px;
20644
20656
 
20645
- color: ${(e) => e.theme.colors.grey4};
20657
+ color: ${(e) => {
20658
+ var n;
20659
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20660
+ }};
20646
20661
 
20647
- background-color: ${(e) => e.theme.colors.grey4};
20662
+ background-color: ${(e) => {
20663
+ var n;
20664
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20665
+ }};
20648
20666
  border-radius: 5px;
20649
20667
 
20650
20668
  animation: dot-flashing 1s infinite alternate;
@@ -20653,17 +20671,23 @@ const EZ = G.div`
20653
20671
 
20654
20672
  @keyframes dot-flashing {
20655
20673
  0% {
20656
- background-color: ${(e) => e.theme.colors.grey4};
20674
+ background-color: ${(e) => {
20675
+ var n;
20676
+ return (n = e.$grey4) !== null && n !== void 0 ? n : e.theme.colors.grey4;
20677
+ }};
20657
20678
  }
20658
20679
 
20659
20680
  50%,
20660
20681
  100% {
20661
- background-color: ${(e) => e.theme.colors.grey3};
20682
+ background-color: ${(e) => {
20683
+ var n;
20684
+ return (n = e.$grey3) !== null && n !== void 0 ? n : e.theme.colors.grey3;
20685
+ }};
20662
20686
  }
20663
20687
  }
20664
20688
  `;
20665
20689
  function CZ(e) {
20666
- return T.jsx(EZ, { className: e.className, style: e.style, children: T.jsx(_Z, { "data-testid": "LOADING" }) });
20690
+ return T.jsx(EZ, { className: e.className, style: e.style, children: T.jsx(_Z, { $grey3: e.grey3, $grey4: e.grey4, "data-testid": "LOADING" }) });
20667
20691
  }
20668
20692
  var SZ = /* @__PURE__ */ new Map([
20669
20693
  ["avi", "video/avi"],
@@ -2676,9 +2676,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2676
2676
  width: 10px;
2677
2677
  height: 10px;
2678
2678
 
2679
- color: ${e=>e.theme.colors.grey4};
2679
+ color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2680
2680
 
2681
- background-color: ${e=>e.theme.colors.grey4};
2681
+ background-color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2682
2682
  border-radius: 5px;
2683
2683
 
2684
2684
  animation: dot-flashing 1s infinite linear alternate;
@@ -2698,9 +2698,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2698
2698
  width: 10px;
2699
2699
  height: 10px;
2700
2700
 
2701
- color: ${e=>e.theme.colors.grey4};
2701
+ color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2702
2702
 
2703
- background-color: ${e=>e.theme.colors.grey4};
2703
+ background-color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2704
2704
  border-radius: 5px;
2705
2705
 
2706
2706
  animation: dot-flashing 1s infinite alternate;
@@ -2713,9 +2713,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2713
2713
  width: 10px;
2714
2714
  height: 10px;
2715
2715
 
2716
- color: ${e=>e.theme.colors.grey4};
2716
+ color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2717
2717
 
2718
- background-color: ${e=>e.theme.colors.grey4};
2718
+ background-color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2719
2719
  border-radius: 5px;
2720
2720
 
2721
2721
  animation: dot-flashing 1s infinite alternate;
@@ -2724,15 +2724,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2724
2724
 
2725
2725
  @keyframes dot-flashing {
2726
2726
  0% {
2727
- background-color: ${e=>e.theme.colors.grey4};
2727
+ background-color: ${e=>{var n;return(n=e.$grey4)!==null&&n!==void 0?n:e.theme.colors.grey4}};
2728
2728
  }
2729
2729
 
2730
2730
  50%,
2731
2731
  100% {
2732
- background-color: ${e=>e.theme.colors.grey3};
2732
+ background-color: ${e=>{var n;return(n=e.$grey3)!==null&&n!==void 0?n:e.theme.colors.grey3}};
2733
2733
  }
2734
2734
  }
2735
- `;function K7(e){return D.jsx(Y7,{className:e.className,style:e.style,children:D.jsx(X7,{"data-testid":"LOADING"})})}var Q7=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function Nf(e,n){var t=Z7(e);if(typeof t.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof n=="string"?n:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function Z7(e){var n=e.name,t=n&&n.lastIndexOf(".")!==-1;if(t&&!e.type){var r=n.split(".").pop().toLowerCase(),i=Q7.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var J7=[".DS_Store","Thumbs.db"];function e9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,n9(e)&&e.dataTransfer?i9(e.dataTransfer,e.type):t9(e)]})})}function n9(e){return!!e.dataTransfer}function t9(e){var n=r9(e.target)?e.target.files?yb(e.target.files):[]:[];return n.map(function(t){return Nf(t)})}function r9(e){return e!==null}function i9(e,n){return Cl(this,void 0,void 0,function(){var t,r;return Sl(this,function(i){switch(i.label){case 0:return e.items?(t=yb(e.items).filter(function(o){return o.kind==="file"}),n!=="drop"?[2,t]:[4,Promise.all(t.map(o9))]):[3,2];case 1:return r=i.sent(),[2,zO(GO(r))];case 2:return[2,zO(yb(e.files).map(function(o){return Nf(o)}))]}})})}function zO(e){return e.filter(function(n){return J7.indexOf(n.name)===-1})}function yb(e){for(var n=[],t=0;t<e.length;t++){var r=e[t];n.push(r)}return n}function o9(e){if(typeof e.webkitGetAsEntry!="function")return UO(e);var n=e.webkitGetAsEntry();return n&&n.isDirectory?WO(n):UO(e)}function GO(e){return e.reduce(function(n,t){return bB(n,Array.isArray(t)?GO(t):[t])},[])}function UO(e){var n=e.getAsFile();if(!n)return Promise.reject(e+" is not a File");var t=Nf(n);return Promise.resolve(t)}function a9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,e.isDirectory?WO(e):s9(e)]})})}function WO(e){var n=e.createReader();return new Promise(function(t,r){var i=[];function o(){var a=this;n.readEntries(function(s){return Cl(a,void 0,void 0,function(){var l,c,f;return Sl(this,function(h){switch(h.label){case 0:if(s.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=h.sent(),t(l),[3,4];case 3:return c=h.sent(),r(c),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(a9)),i.push(f),o(),h.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function s9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,new Promise(function(t,r){e.file(function(i){var o=Nf(i,e.fullPath);t(o)},function(i){r(i)})})]})})}var Lf={},HO;function u9(){return HO||(HO=1,Lf.__esModule=!0,Lf.default=function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(",");if(t.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return t.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0}),Lf}var l9=u9();const c9=Zt(l9);function qO(e,n){return h9(e)||f9(e,n)||d9()}function d9(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function f9(e,n){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(t.push(s.value),!(n&&t.length===n));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return t}}function h9(e){if(Array.isArray(e))return e}var p9="file-invalid-type",g9="file-too-large",v9="file-too-small",m9="too-many-files",y9=function(n){n=Array.isArray(n)&&n.length===1?n[0]:n;var t=Array.isArray(n)?"one of ".concat(n.join(", ")):n;return{code:p9,message:"File type must be ".concat(t)}},VO=function(n){return{code:g9,message:"File is larger than ".concat(n," bytes")}},YO=function(n){return{code:v9,message:"File is smaller than ".concat(n," bytes")}},b9={code:m9,message:"Too many files"};function XO(e,n){var t=e.type==="application/x-moz-file"||c9(e,n);return[t,t?null:y9(n)]}function KO(e,n,t){if(ic(e.size))if(ic(n)&&ic(t)){if(e.size>t)return[!1,VO(t)];if(e.size<n)return[!1,YO(n)]}else{if(ic(n)&&e.size<n)return[!1,YO(n)];if(ic(t)&&e.size>t)return[!1,VO(t)]}return[!0,null]}function ic(e){return e!=null}function w9(e){var n=e.files,t=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple;return!o&&n.length>1?!1:n.every(function(a){var s=XO(a,t),l=qO(s,1),c=l[0],f=KO(a,r,i),h=qO(f,1),p=h[0];return c&&p})}function Rf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function $f(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function QO(e){e.preventDefault()}function x9(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function E9(e){return e.indexOf("Edge/")!==-1}function _9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return x9(e)||E9(e)}function ao(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return n.some(function(s){return!Rf(r)&&s&&s.apply(void 0,[r].concat(o)),Rf(r)})}}function C9(e){return D9(e)||T9(e)||S9()}function S9(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function T9(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function D9(e){if(Array.isArray(e)){for(var n=0,t=new Array(e.length);n<e.length;n++)t[n]=e[n];return t}}function bb(e,n){return O9(e)||k9(e,n)||I9()}function I9(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function k9(e,n){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(t.push(s.value),!(n&&t.length===n));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return t}}function O9(e){if(Array.isArray(e))return e}function ZO(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function Mi(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ZO(t,!0).forEach(function(r){wb(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ZO(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function wb(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ff(e,n){if(e==null)return{};var t=A9(e,n),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function A9(e,n){if(e==null)return{};var t={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(n.indexOf(i)>=0)&&(t[i]=e[i]);return t}var JO=C.forwardRef(function(e,n){var t=e.children,r=Ff(e,["children"]),i=P9(r),o=i.open,a=Ff(i,["open"]);return C.useImperativeHandle(n,function(){return{open:o}},[o]),C.createElement(C.Fragment,null,t(Mi({},a,{open:o})))});JO.displayName="Dropzone",JO.propTypes={children:he.func,accept:he.oneOfType([he.string,he.arrayOf(he.string)]),multiple:he.bool,preventDropOnDocument:he.bool,noClick:he.bool,noKeyboard:he.bool,noDrag:he.bool,noDragEventsBubbling:he.bool,minSize:he.number,maxSize:he.number,disabled:he.bool,getFilesFromEvent:he.func,onFileDialogCancel:he.func,onDragEnter:he.func,onDragLeave:he.func,onDragOver:he.func,onDrop:he.func,onDropAccepted:he.func,onDropRejected:he.func};var M9={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function P9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.accept,t=e.disabled,r=t===void 0?!1:t,i=e.getFilesFromEvent,o=i===void 0?e9:i,a=e.maxSize,s=a===void 0?1/0:a,l=e.minSize,c=l===void 0?0:l,f=e.multiple,h=f===void 0?!0:f,p=e.onDragEnter,v=e.onDragLeave,y=e.onDragOver,m=e.onDrop,w=e.onDropAccepted,x=e.onDropRejected,S=e.onFileDialogCancel,T=e.preventDropOnDocument,_=T===void 0?!0:T,I=e.noClick,O=I===void 0?!1:I,k=e.noKeyboard,B=k===void 0?!1:k,z=e.noDrag,W=z===void 0?!1:z,K=e.noDragEventsBubbling,Z=K===void 0?!1:K,H=C.useRef(null),le=C.useRef(null),ue=C.useReducer(N9,M9),Q=bb(ue,2),re=Q[0],de=Q[1],fe=re.isFocused,Se=re.isFileDialogActive,se=re.draggedFiles,_e=C.useCallback(function(){le.current&&(de({type:"openDialog"}),le.current.value=null,le.current.click())},[de]),Be=function(){Se&&setTimeout(function(){if(le.current){var Ze=le.current.files;Ze.length||(de({type:"closeDialog"}),typeof S=="function"&&S())}},300)};C.useEffect(function(){return window.addEventListener("focus",Be,!1),function(){window.removeEventListener("focus",Be,!1)}},[le,Se,S]);var ke=C.useCallback(function(L){!H.current||!H.current.isEqualNode(L.target)||(L.keyCode===32||L.keyCode===13)&&(L.preventDefault(),_e())},[H,le]),Pe=C.useCallback(function(){de({type:"focus"})},[]),Ne=C.useCallback(function(){de({type:"blur"})},[]),Te=C.useCallback(function(){O||(_9()?setTimeout(_e,0):_e())},[le,O]),me=C.useRef([]),be=function(Ze){H.current&&H.current.contains(Ze.target)||(Ze.preventDefault(),me.current=[])};C.useEffect(function(){return _&&(document.addEventListener("dragover",QO,!1),document.addEventListener("drop",be,!1)),function(){_&&(document.removeEventListener("dragover",QO),document.removeEventListener("drop",be))}},[H,_]);var Ue=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L),me.current=[].concat(C9(me.current),[L.target]),$f(L)&&Promise.resolve(o(L)).then(function(Ze){Rf(L)&&!Z||(de({draggedFiles:Ze,isDragActive:!0,type:"setDraggedFiles"}),p&&p(L))})},[o,p,Z]),an=C.useCallback(function(L){if(L.preventDefault(),L.persist(),Qe(L),L.dataTransfer)try{L.dataTransfer.dropEffect="copy"}catch{}return $f(L)&&y&&y(L),!1},[y,Z]),bn=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L);var Ze=me.current.filter(function(zn){return H.current&&H.current.contains(zn)}),Mn=Ze.indexOf(L.target);Mn!==-1&&Ze.splice(Mn,1),me.current=Ze,!(Ze.length>0)&&(de({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),$f(L)&&v&&v(L))},[H,v,Z]),Pn=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L),me.current=[],$f(L)&&Promise.resolve(o(L)).then(function(Ze){if(!(Rf(L)&&!Z)){var Mn=[],zn=[];Ze.forEach(function(En){var wt=XO(En,n),_n=bb(wt,2),vt=_n[0],Yt=_n[1],Dt=KO(En,c,s),In=bb(Dt,2),hr=In[0],Wr=In[1];if(vt&&hr)Mn.push(En);else{var di=[Yt,Wr].filter(function(fi){return fi});zn.push({file:En,errors:di})}}),!h&&Mn.length>1&&(Mn.forEach(function(En){zn.push({file:En,errors:[b9]})}),Mn.splice(0)),de({acceptedFiles:Mn,fileRejections:zn,type:"setFiles"}),m&&m(Mn,zn,L),zn.length>0&&x&&x(zn,L),Mn.length>0&&w&&w(Mn,L)}}),de({type:"reset"})},[h,n,c,s,o,m,w,x,Z]),Je=function(Ze){return r?null:Ze},Xe=function(Ze){return B?null:Je(Ze)},An=function(Ze){return W?null:Je(Ze)},Qe=function(Ze){Z&&Ze.stopPropagation()},it=C.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ze=L.refKey,Mn=Ze===void 0?"ref":Ze,zn=L.onKeyDown,En=L.onFocus,wt=L.onBlur,_n=L.onClick,vt=L.onDragEnter,Yt=L.onDragOver,Dt=L.onDragLeave,In=L.onDrop,hr=Ff(L,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Mi(wb({onKeyDown:Xe(ao(zn,ke)),onFocus:Xe(ao(En,Pe)),onBlur:Xe(ao(wt,Ne)),onClick:Je(ao(_n,Te)),onDragEnter:An(ao(vt,Ue)),onDragOver:An(ao(Yt,an)),onDragLeave:An(ao(Dt,bn)),onDrop:An(ao(In,Pn))},Mn,H),!r&&!B?{tabIndex:0}:{},{},hr)}},[H,ke,Pe,Ne,Te,Ue,an,bn,Pn,B,W,r]),Jn=C.useCallback(function(L){L.stopPropagation()},[]),Hn=C.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ze=L.refKey,Mn=Ze===void 0?"ref":Ze,zn=L.onChange,En=L.onClick,wt=Ff(L,["refKey","onChange","onClick"]),_n=wb({accept:n,multiple:h,type:"file",style:{display:"none"},onChange:Je(ao(zn,Pn)),onClick:Je(ao(En,Jn)),autoComplete:"off",tabIndex:-1},Mn,le);return Mi({},_n,{},wt)}},[le,n,h,Pn,r]),un=se.length,Fn=un>0&&w9({files:se,accept:n,minSize:c,maxSize:s,multiple:h}),fn=un>0&&!Fn;return Mi({},re,{isDragAccept:Fn,isDragReject:fn,isFocused:fe&&!r,getRootProps:it,getInputProps:Hn,rootRef:H,inputRef:le,open:Je(_e)})}function N9(e,n){switch(n.type){case"focus":return Mi({},e,{isFocused:!0});case"blur":return Mi({},e,{isFocused:!1});case"openDialog":return Mi({},e,{isFileDialogActive:!0});case"closeDialog":return Mi({},e,{isFileDialogActive:!1});case"setDraggedFiles":var t=n.isDragActive,r=n.draggedFiles;return Mi({},e,{draggedFiles:r,isDragActive:t});case"setFiles":return Mi({},e,{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections});case"reset":return Mi({},e,{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}U.div`
2735
+ `;function K7(e){return D.jsx(Y7,{className:e.className,style:e.style,children:D.jsx(X7,{$grey3:e.grey3,$grey4:e.grey4,"data-testid":"LOADING"})})}var Q7=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function Nf(e,n){var t=Z7(e);if(typeof t.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof n=="string"?n:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function Z7(e){var n=e.name,t=n&&n.lastIndexOf(".")!==-1;if(t&&!e.type){var r=n.split(".").pop().toLowerCase(),i=Q7.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var J7=[".DS_Store","Thumbs.db"];function e9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,n9(e)&&e.dataTransfer?i9(e.dataTransfer,e.type):t9(e)]})})}function n9(e){return!!e.dataTransfer}function t9(e){var n=r9(e.target)?e.target.files?yb(e.target.files):[]:[];return n.map(function(t){return Nf(t)})}function r9(e){return e!==null}function i9(e,n){return Cl(this,void 0,void 0,function(){var t,r;return Sl(this,function(i){switch(i.label){case 0:return e.items?(t=yb(e.items).filter(function(o){return o.kind==="file"}),n!=="drop"?[2,t]:[4,Promise.all(t.map(o9))]):[3,2];case 1:return r=i.sent(),[2,zO(GO(r))];case 2:return[2,zO(yb(e.files).map(function(o){return Nf(o)}))]}})})}function zO(e){return e.filter(function(n){return J7.indexOf(n.name)===-1})}function yb(e){for(var n=[],t=0;t<e.length;t++){var r=e[t];n.push(r)}return n}function o9(e){if(typeof e.webkitGetAsEntry!="function")return UO(e);var n=e.webkitGetAsEntry();return n&&n.isDirectory?WO(n):UO(e)}function GO(e){return e.reduce(function(n,t){return bB(n,Array.isArray(t)?GO(t):[t])},[])}function UO(e){var n=e.getAsFile();if(!n)return Promise.reject(e+" is not a File");var t=Nf(n);return Promise.resolve(t)}function a9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,e.isDirectory?WO(e):s9(e)]})})}function WO(e){var n=e.createReader();return new Promise(function(t,r){var i=[];function o(){var a=this;n.readEntries(function(s){return Cl(a,void 0,void 0,function(){var l,c,f;return Sl(this,function(h){switch(h.label){case 0:if(s.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=h.sent(),t(l),[3,4];case 3:return c=h.sent(),r(c),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(a9)),i.push(f),o(),h.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function s9(e){return Cl(this,void 0,void 0,function(){return Sl(this,function(n){return[2,new Promise(function(t,r){e.file(function(i){var o=Nf(i,e.fullPath);t(o)},function(i){r(i)})})]})})}var Lf={},HO;function u9(){return HO||(HO=1,Lf.__esModule=!0,Lf.default=function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(",");if(t.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return t.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0}),Lf}var l9=u9();const c9=Zt(l9);function qO(e,n){return h9(e)||f9(e,n)||d9()}function d9(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function f9(e,n){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(t.push(s.value),!(n&&t.length===n));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return t}}function h9(e){if(Array.isArray(e))return e}var p9="file-invalid-type",g9="file-too-large",v9="file-too-small",m9="too-many-files",y9=function(n){n=Array.isArray(n)&&n.length===1?n[0]:n;var t=Array.isArray(n)?"one of ".concat(n.join(", ")):n;return{code:p9,message:"File type must be ".concat(t)}},VO=function(n){return{code:g9,message:"File is larger than ".concat(n," bytes")}},YO=function(n){return{code:v9,message:"File is smaller than ".concat(n," bytes")}},b9={code:m9,message:"Too many files"};function XO(e,n){var t=e.type==="application/x-moz-file"||c9(e,n);return[t,t?null:y9(n)]}function KO(e,n,t){if(ic(e.size))if(ic(n)&&ic(t)){if(e.size>t)return[!1,VO(t)];if(e.size<n)return[!1,YO(n)]}else{if(ic(n)&&e.size<n)return[!1,YO(n)];if(ic(t)&&e.size>t)return[!1,VO(t)]}return[!0,null]}function ic(e){return e!=null}function w9(e){var n=e.files,t=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple;return!o&&n.length>1?!1:n.every(function(a){var s=XO(a,t),l=qO(s,1),c=l[0],f=KO(a,r,i),h=qO(f,1),p=h[0];return c&&p})}function Rf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function $f(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function QO(e){e.preventDefault()}function x9(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function E9(e){return e.indexOf("Edge/")!==-1}function _9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return x9(e)||E9(e)}function ao(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return n.some(function(s){return!Rf(r)&&s&&s.apply(void 0,[r].concat(o)),Rf(r)})}}function C9(e){return D9(e)||T9(e)||S9()}function S9(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function T9(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function D9(e){if(Array.isArray(e)){for(var n=0,t=new Array(e.length);n<e.length;n++)t[n]=e[n];return t}}function bb(e,n){return O9(e)||k9(e,n)||I9()}function I9(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function k9(e,n){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]"){var t=[],r=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(t.push(s.value),!(n&&t.length===n));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw o}}return t}}function O9(e){if(Array.isArray(e))return e}function ZO(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,r)}return t}function Mi(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ZO(t,!0).forEach(function(r){wb(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ZO(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function wb(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ff(e,n){if(e==null)return{};var t=A9(e,n),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function A9(e,n){if(e==null)return{};var t={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(n.indexOf(i)>=0)&&(t[i]=e[i]);return t}var JO=C.forwardRef(function(e,n){var t=e.children,r=Ff(e,["children"]),i=P9(r),o=i.open,a=Ff(i,["open"]);return C.useImperativeHandle(n,function(){return{open:o}},[o]),C.createElement(C.Fragment,null,t(Mi({},a,{open:o})))});JO.displayName="Dropzone",JO.propTypes={children:he.func,accept:he.oneOfType([he.string,he.arrayOf(he.string)]),multiple:he.bool,preventDropOnDocument:he.bool,noClick:he.bool,noKeyboard:he.bool,noDrag:he.bool,noDragEventsBubbling:he.bool,minSize:he.number,maxSize:he.number,disabled:he.bool,getFilesFromEvent:he.func,onFileDialogCancel:he.func,onDragEnter:he.func,onDragLeave:he.func,onDragOver:he.func,onDrop:he.func,onDropAccepted:he.func,onDropRejected:he.func};var M9={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function P9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.accept,t=e.disabled,r=t===void 0?!1:t,i=e.getFilesFromEvent,o=i===void 0?e9:i,a=e.maxSize,s=a===void 0?1/0:a,l=e.minSize,c=l===void 0?0:l,f=e.multiple,h=f===void 0?!0:f,p=e.onDragEnter,v=e.onDragLeave,y=e.onDragOver,m=e.onDrop,w=e.onDropAccepted,x=e.onDropRejected,S=e.onFileDialogCancel,T=e.preventDropOnDocument,_=T===void 0?!0:T,I=e.noClick,O=I===void 0?!1:I,k=e.noKeyboard,B=k===void 0?!1:k,z=e.noDrag,W=z===void 0?!1:z,K=e.noDragEventsBubbling,Z=K===void 0?!1:K,H=C.useRef(null),le=C.useRef(null),ue=C.useReducer(N9,M9),Q=bb(ue,2),re=Q[0],de=Q[1],fe=re.isFocused,Se=re.isFileDialogActive,se=re.draggedFiles,_e=C.useCallback(function(){le.current&&(de({type:"openDialog"}),le.current.value=null,le.current.click())},[de]),Be=function(){Se&&setTimeout(function(){if(le.current){var Ze=le.current.files;Ze.length||(de({type:"closeDialog"}),typeof S=="function"&&S())}},300)};C.useEffect(function(){return window.addEventListener("focus",Be,!1),function(){window.removeEventListener("focus",Be,!1)}},[le,Se,S]);var ke=C.useCallback(function(L){!H.current||!H.current.isEqualNode(L.target)||(L.keyCode===32||L.keyCode===13)&&(L.preventDefault(),_e())},[H,le]),Pe=C.useCallback(function(){de({type:"focus"})},[]),Ne=C.useCallback(function(){de({type:"blur"})},[]),Te=C.useCallback(function(){O||(_9()?setTimeout(_e,0):_e())},[le,O]),me=C.useRef([]),be=function(Ze){H.current&&H.current.contains(Ze.target)||(Ze.preventDefault(),me.current=[])};C.useEffect(function(){return _&&(document.addEventListener("dragover",QO,!1),document.addEventListener("drop",be,!1)),function(){_&&(document.removeEventListener("dragover",QO),document.removeEventListener("drop",be))}},[H,_]);var Ue=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L),me.current=[].concat(C9(me.current),[L.target]),$f(L)&&Promise.resolve(o(L)).then(function(Ze){Rf(L)&&!Z||(de({draggedFiles:Ze,isDragActive:!0,type:"setDraggedFiles"}),p&&p(L))})},[o,p,Z]),an=C.useCallback(function(L){if(L.preventDefault(),L.persist(),Qe(L),L.dataTransfer)try{L.dataTransfer.dropEffect="copy"}catch{}return $f(L)&&y&&y(L),!1},[y,Z]),bn=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L);var Ze=me.current.filter(function(zn){return H.current&&H.current.contains(zn)}),Mn=Ze.indexOf(L.target);Mn!==-1&&Ze.splice(Mn,1),me.current=Ze,!(Ze.length>0)&&(de({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),$f(L)&&v&&v(L))},[H,v,Z]),Pn=C.useCallback(function(L){L.preventDefault(),L.persist(),Qe(L),me.current=[],$f(L)&&Promise.resolve(o(L)).then(function(Ze){if(!(Rf(L)&&!Z)){var Mn=[],zn=[];Ze.forEach(function(En){var wt=XO(En,n),_n=bb(wt,2),vt=_n[0],Yt=_n[1],Dt=KO(En,c,s),In=bb(Dt,2),hr=In[0],Wr=In[1];if(vt&&hr)Mn.push(En);else{var di=[Yt,Wr].filter(function(fi){return fi});zn.push({file:En,errors:di})}}),!h&&Mn.length>1&&(Mn.forEach(function(En){zn.push({file:En,errors:[b9]})}),Mn.splice(0)),de({acceptedFiles:Mn,fileRejections:zn,type:"setFiles"}),m&&m(Mn,zn,L),zn.length>0&&x&&x(zn,L),Mn.length>0&&w&&w(Mn,L)}}),de({type:"reset"})},[h,n,c,s,o,m,w,x,Z]),Je=function(Ze){return r?null:Ze},Xe=function(Ze){return B?null:Je(Ze)},An=function(Ze){return W?null:Je(Ze)},Qe=function(Ze){Z&&Ze.stopPropagation()},it=C.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ze=L.refKey,Mn=Ze===void 0?"ref":Ze,zn=L.onKeyDown,En=L.onFocus,wt=L.onBlur,_n=L.onClick,vt=L.onDragEnter,Yt=L.onDragOver,Dt=L.onDragLeave,In=L.onDrop,hr=Ff(L,["refKey","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Mi(wb({onKeyDown:Xe(ao(zn,ke)),onFocus:Xe(ao(En,Pe)),onBlur:Xe(ao(wt,Ne)),onClick:Je(ao(_n,Te)),onDragEnter:An(ao(vt,Ue)),onDragOver:An(ao(Yt,an)),onDragLeave:An(ao(Dt,bn)),onDrop:An(ao(In,Pn))},Mn,H),!r&&!B?{tabIndex:0}:{},{},hr)}},[H,ke,Pe,Ne,Te,Ue,an,bn,Pn,B,W,r]),Jn=C.useCallback(function(L){L.stopPropagation()},[]),Hn=C.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ze=L.refKey,Mn=Ze===void 0?"ref":Ze,zn=L.onChange,En=L.onClick,wt=Ff(L,["refKey","onChange","onClick"]),_n=wb({accept:n,multiple:h,type:"file",style:{display:"none"},onChange:Je(ao(zn,Pn)),onClick:Je(ao(En,Jn)),autoComplete:"off",tabIndex:-1},Mn,le);return Mi({},_n,{},wt)}},[le,n,h,Pn,r]),un=se.length,Fn=un>0&&w9({files:se,accept:n,minSize:c,maxSize:s,multiple:h}),fn=un>0&&!Fn;return Mi({},re,{isDragAccept:Fn,isDragReject:fn,isFocused:fe&&!r,getRootProps:it,getInputProps:Hn,rootRef:H,inputRef:le,open:Je(_e)})}function N9(e,n){switch(n.type){case"focus":return Mi({},e,{isFocused:!0});case"blur":return Mi({},e,{isFocused:!1});case"openDialog":return Mi({},e,{isFileDialogActive:!0});case"closeDialog":return Mi({},e,{isFileDialogActive:!1});case"setDraggedFiles":var t=n.isDragActive,r=n.draggedFiles;return Mi({},e,{draggedFiles:r,isDragActive:t});case"setFiles":return Mi({},e,{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections});case"reset":return Mi({},e,{isFileDialogActive:!1,isDragActive:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]});default:return e}}U.div`
2736
2736
  display: flex;
2737
2737
  flex: 1 1 auto;
2738
2738
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darajs/ui-causal-graph-editor",
3
- "version": "1.21.3",
3
+ "version": "1.21.5",
4
4
  "description": "CausalGraph editor for the Dara UI framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -34,9 +34,9 @@
34
34
  "@babel/preset-env": "^7.15.8",
35
35
  "@babel/preset-react": "^7.14.5",
36
36
  "@babel/preset-typescript": "^7.15.0",
37
- "@darajs/eslint-config": "1.21.3",
38
- "@darajs/prettier-config": "1.21.3",
39
- "@darajs/stylelint-config": "1.21.3",
37
+ "@darajs/eslint-config": "1.21.5",
38
+ "@darajs/prettier-config": "1.21.5",
39
+ "@darajs/stylelint-config": "1.21.5",
40
40
  "@storybook/react-vite": "^9.0.17",
41
41
  "@testing-library/dom": "^9.3.0",
42
42
  "@testing-library/jest-dom": "^5.16.5",
@@ -71,12 +71,12 @@
71
71
  "typescript": "^5.8.2"
72
72
  },
73
73
  "dependencies": {
74
- "@darajs/styled-components": "1.21.3",
75
- "@darajs/ui-components": "1.21.3",
76
- "@darajs/ui-icons": "1.21.3",
77
- "@darajs/ui-notifications": "1.21.3",
78
- "@darajs/ui-utils": "1.21.3",
79
- "@darajs/ui-widgets": "1.21.3",
74
+ "@darajs/styled-components": "1.21.5",
75
+ "@darajs/ui-components": "1.21.5",
76
+ "@darajs/ui-icons": "1.21.5",
77
+ "@darajs/ui-notifications": "1.21.5",
78
+ "@darajs/ui-utils": "1.21.5",
79
+ "@darajs/ui-widgets": "1.21.5",
80
80
  "comlink": "^4.4.1",
81
81
  "cytoscape": "^3.23.0",
82
82
  "cytoscape-fcose": "^2.2.0",
@@ -109,5 +109,5 @@
109
109
  "publishConfig": {
110
110
  "access": "public"
111
111
  },
112
- "gitHead": "ca0217cbace44d9a817b6a4d0b188b0ed00a8f58"
112
+ "gitHead": "4ea4352df7197c149f2de10125143cc1c3e317f6"
113
113
  }