@deephaven/embed-widget 0.85.33 → 0.85.34
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/assets/{App-166056d1.js → App-ad7ab28d.js} +2 -2
- package/build/assets/{App-166056d1.js.map → App-ad7ab28d.js.map} +1 -1
- package/build/assets/{Chart-d0ece919.js → Chart-9ecbe58b.js} +2 -2
- package/build/assets/{Chart-d0ece919.js.map → Chart-9ecbe58b.js.map} +1 -1
- package/build/assets/{IrisGrid-5c931259.js → IrisGrid-57b764d8.js} +3 -3
- package/build/assets/IrisGrid-57b764d8.js.map +1 -0
- package/build/assets/IrisGridThemeProvider-bacb572e.js +11 -0
- package/build/assets/IrisGridThemeProvider-bacb572e.js.map +1 -0
- package/build/assets/{LocalWorkspaceStorage-945bb24c.js → LocalWorkspaceStorage-de4384df.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-945bb24c.js.map → LocalWorkspaceStorage-de4384df.js.map} +1 -1
- package/build/assets/{LogPanel-2d296efa.js → LogPanel-0104fb18.js} +2 -2
- package/build/assets/{LogPanel-2d296efa.js.map → LogPanel-0104fb18.js.map} +1 -1
- package/build/assets/{MarkdownEditor-1df683e1.js → MarkdownEditor-d00ea0c4.js} +2 -2
- package/build/assets/{MarkdownEditor-1df683e1.js.map → MarkdownEditor-d00ea0c4.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-aa719630.js → MarkdownNotebook-0e269872.js} +2 -2
- package/build/assets/{MarkdownNotebook-aa719630.js.map → MarkdownNotebook-0e269872.js.map} +1 -1
- package/build/assets/Plot-3a902da3.js +2 -0
- package/build/assets/{Plot-31b244ee.js.map → Plot-3a902da3.js.map} +1 -1
- package/build/assets/{Plotly-17aec1e4.js → Plotly-1865457e.js} +2 -2
- package/build/assets/{Plotly-17aec1e4.js.map → Plotly-1865457e.js.map} +1 -1
- package/build/assets/index-597911fb.js +13 -0
- package/build/assets/index-597911fb.js.map +1 -0
- package/build/assets/{index-af4f692e.js → index-6bbfd4c2.js} +2 -2
- package/build/assets/{index-af4f692e.js.map → index-6bbfd4c2.js.map} +1 -1
- package/build/assets/{index-ab391b03.js → index-ff1dc6d1.js} +3 -3
- package/build/assets/{index-ab391b03.js.map → index-ff1dc6d1.js.map} +1 -1
- package/build/assets/plotly-fbbd3005.js +7 -0
- package/build/assets/{plotly-2d4bc30c.js.map → plotly-fbbd3005.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +7 -7
- package/build/assets/IrisGrid-5c931259.js.map +0 -1
- package/build/assets/IrisGridThemeProvider-cc31dc12.js +0 -11
- package/build/assets/IrisGridThemeProvider-cc31dc12.js.map +0 -1
- package/build/assets/Plot-31b244ee.js +0 -2
- package/build/assets/index-91ca0589.js +0 -13
- package/build/assets/index-91ca0589.js.map +0 -1
- package/build/assets/plotly-2d4bc30c.js +0 -7
package/build/assets/{LocalWorkspaceStorage-945bb24c.js → LocalWorkspaceStorage-de4384df.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as d,J as I,E as c,H as A,bg as de,K as fe}from"./vendor-9e6eb436.js";import{L as F,q as he,a as N}from"./index-af4f692e.js";import{A as S,a6 as K,F as ve,u as pe,l as T,a1 as me,a7 as be,ae as ge,ag as U,aQ as ye,bp as Me,aZ as Pe,aV as we,bq as Se,aW as Oe,br as Ce,aT as xe,bs as Ee,be as De,an as Ie,a0 as Te,$ as Le,aX as je,bt as B,bu as z,bv as G,bw as W,a2 as k,a3 as _e,a4 as Ae}from"./LogPanel-2d296efa.js";function Fe(n,e){d.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}function H(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ne(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?H(Object(t),!0).forEach(function(r){M(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M(n,e,t){return e=Re(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Re(n){var e=$e(n,"string");return typeof e=="symbol"?e:String(e)}function $e(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Y=F.module("ContextMenu");class C extends d.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),M(this,"container",void 0),M(this,"oldFocus",void 0),M(this,"activeSubMenuRef",void 0),M(this,"subMenuTimer",void 0),M(this,"rAF",void 0),M(this,"initialPosition",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=I.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=I.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:r}=this.props,{activeSubMenu:i}=this.state;if(i!==t.activeSubMenu)if(i==null){var a;(a=this.container.current)===null||a===void 0||a.focus()}else this.setActiveSubMenuPosition();if(e.actions!==r&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var o;(o=this.container.current)===null||o===void 0||o.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:r}=this.props,i=S.getMenuItems(r),a=[],o=i.length-1;o>=0;o-=1){var s=i[o];s instanceof Promise?this.initMenuPromise(s):a.push(s)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:S.sortActions(a)})}initMenuPromise(e){var t=K.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(t)})),t.then(r=>{this.setState(i=>{var a=i.pendingItems.indexOf(t);if(a>=0){var o=i.pendingItems.slice();return o.splice(a,1),{menuItems:S.sortActions(i.menuItems.concat(r)),pendingItems:o}}return null})},r=>{K.isCanceled(r)||(this.setState(i=>{var a=i.pendingItems.indexOf(t);if(a>=0){var o=i.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),Y.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,r,i,{options:a,updatePosition:o,subMenuParentWidth:s,subMenuParentHeight:u,top:l,left:v}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:f,left:b}=this.initialPosition,{width:p,height:h}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},P=((r=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;h===0||p===0||(f+h>window.innerHeight&&(f-h-u>0?f-=h-u:f=window.innerHeight-h),b+p>window.innerWidth&&(b=b-p-s),(v!==b||l!==f)&&(this.setState({hasOverflow:P}),o(f,b)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Y.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,r=!1;t&&!r;)r=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=t.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=S.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=S.getNextMenuItem(i,1,t)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:r}=this.state,i=t[e].actions?e:null;r!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:r}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(r.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r),r>=0&&r<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:r}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:o,menuItems:s,mouseIndex:u,pendingItems:l,subMenuTop:v,subMenuLeft:f,subMenuParentWidth:b,subMenuParentHeight:p}=this.state,h=0;h<s.length;h+=1){var P=s[h];h>0&&P.group!==s[h-1].group&&e.push(c.jsx("hr",{},"".concat(h,".separator")));var g=c.jsx(ve,{ref:i===h?this.activeSubMenuRef:null,isKeyboardSelected:o===h,isMouseSelected:u===h,menuItem:P,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},h);e.push(g)}var O=null;l.length>0&&(O=c.jsx("div",{className:"loading",children:c.jsx(he,{className:"loading-spinner-vertical-align"})}));var{menuStyle:L,"data-testid":$}=this.props,w=i!==null&&v!==null&&f!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:A({"has-overflow":a},"context-menu-container"),style:Ne({top:t,left:r},L),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:C.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":$,children:[e,O]}),w&&i!==null&&v!==null&&f!==null&&c.jsx(C,{actions:s[i].actions||[],closeMenu:this.handleCloseSubMenu,top:v,left:f,updatePosition:(y,x)=>{this.setState({subMenuTop:y,subMenuLeft:x})},subMenuParentWidth:b,subMenuParentHeight:p},"sub-".concat(i))]})}}M(C,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Ke=C;function Z(n,e,t){return e=Ue(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ue(n){var e=Be(n,"string");return typeof e=="symbol"?e:String(e)}function Be(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ze extends d.Component{constructor(e){super(e),Z(this,"container",void 0),Z(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=I.createRef(),this.openMenu=I.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),r=e.clientY-t.top,i=e.clientX-t.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var s=document.elementFromPoint(i,r),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});s==null||s.dispatchEvent(u)});return}if(S.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var o=S.getMenuItems(e.contextActions);o.length!==0&&(e.preventDefault(),this.setState({actions:o,top:r,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:r,top:i,left:a}=this.state;return r&&(e=c.jsx(Ke,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(o,s)=>{this.setState({top:o,left:s})},"data-testid":t})),c.jsx("div",{className:A("context-menu-root",{active:r}),ref:this.container,children:e})}}const Lt=ze;function Ge(n,e){var t=pe(),r=d.useMemo(()=>new t.CoreClient(n,e),[t,n,e]);return d.useEffect(()=>()=>{r.disconnect()},[r]),r}var se=d.createContext(null);function jt(n){var{serverUrl:e,options:t,children:r}=n,i=Ge(e,t);return c.jsx(se.Provider,{value:i,children:r})}function We(){return T(se,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}var ke=1e4;function _t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ke;return new Promise((r,i)=>{var a,o=setTimeout(()=>{var u;(u=a)===null||u===void 0||u(),i(new me("Timeout looking for variable ".concat(e)))},t);function s(u){var l,v=u.created.find(f=>f.title===e);clearTimeout(o),(l=a)===null||l===void 0||l(),v!=null?r(v):i(new Error("Variable ".concat(e," not found")))}a=n.subscribeToFieldUpdates(s)})}function He(n){var e=[...n.entries()].filter(t=>{var[,r]=t;return ge(r)||U(r)});return e.map(t=>{var[r,i]=t;if(U(i)){var{DashboardPlugin:a}=i;return c.jsx(a,{},r)}var{component:o}=i;return c.jsx(o,{},r)})}function At(){var n=be(),e=d.useMemo(()=>He(n),[n]);return e}var Ft=d.createContext({}),Nt=d.createContext({}),Ye=d.createContext(null);function q(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ze(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?q(Object(t),!0).forEach(function(r){qe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):q(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qe(n,e,t){return e=Je(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Je(n){var e=Xe(n,"string");return typeof e=="symbol"?e:String(e)}function Xe(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qe=100,j=()=>{},Ve=Object.freeze({});function et(n){var{id:e="default",children:t,emptyDashboard:r,layoutConfig:i,layoutSettings:a=Ve,onLayoutConfigChange:o=j,onGoldenLayoutChange:s=j,onLayoutInitialized:u=j,fallbackComponent:l=Ce,hydrate:v,dehydrate:f,panelWrapper:b}=n,p=d.useRef(null),[h,P]=d.useState(!1),[g,O]=d.useState();d.useEffect(function(){if(!p.current){O(void 0);return}var w=Ze({},ye.makeDefaultLayout());w.settings===void 0&&(w.settings={}),Object.assign(w.settings,a),w.content=[];var y=new Me(w,p.current),x=()=>{y.off("initialised",x),P(!0)};return y.on("initialised",x),l!=null&&y.setFallbackComponent(l),y.init(),O(y),s(y),()=>{y.destroy()}},[a,l,s,P,O]);var L=d.useMemo(()=>de(()=>{g!=null&&g.isInitialised&&(g==null||g.updateSize())},Qe),[g]);return Fe(p.current,L),c.jsxs("div",{className:"dashboard-container w-100 h-100",children:[c.jsx("div",{className:"w-100 h-100",ref:p}),h&&g&&c.jsx(Pe.Provider,{value:g,children:c.jsx(we.Provider,{value:e,children:c.jsx(Se,{children:c.jsx(Oe,{emptyDashboard:r,id:e,layout:g,layoutConfig:i,onLayoutChange:o,onLayoutInitialized:u,hydrate:v,dehydrate:f,panelWrapper:b,children:t})})})})]})}var R="CREATE_DASHBOARD";function tt(n,e){try{n.off(R,e)}catch{}}function Rt(n,e){return n.on(R,e),()=>tt(n,e)}function $t(n,e){n.emit(R,e)}var nt=["id","isActive","plugins"];function J(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function X(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?J(Object(t),!0).forEach(function(r){rt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rt(n,e,t){return e=it(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function it(n){var e=at(n,"string");return typeof e=="symbol"?e:String(e)}function at(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ot(n,e){if(n==null)return{};var t=st(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function st(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function ut(n){var{id:e,isActive:t,plugins:r}=n,i=ot(n,nt),[a,o]=d.useState(t),s=fe(),u=d.useCallback(l=>{s(e===xe?Ee({layoutConfig:l}):De(e,{layoutConfig:l}))},[e,s]);return!a&&t&&o(!0),a?c.jsx(et,X(X({id:e,onLayoutConfigChange:u},i),{},{children:r})):c.jsx(N,{})}var lt=d.createContext(null);function Q(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function ct(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){Q(a,r,i,o,s,"next",u)}function s(u){Q(a,r,i,o,s,"throw",u)}o(void 0)})}}var ue=d.createContext(null);function Kt(n){var{children:e}=n,t=We(),[r,i]=d.useState(),[a,o]=d.useState();d.useEffect(function(){var l=!1;function v(){return f.apply(this,arguments)}function f(){return f=ct(function*(){try{var b=yield t.getServerConfigValues();l||i(new Map(b))}catch(p){l||o(p)}}),f.apply(this,arguments)}return v(),()=>{l=!0}},[t]);var s=r==null;return s||a!=null?c.jsx(N,{isLoading:s&&a==null,errorMessage:Ie(a)}):c.jsx(ue.Provider,{value:r,children:e})}function Ut(){return T(ue,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function V(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function dt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){V(a,r,i,o,s,"next",u)}function s(u){V(a,r,i,o,s,"throw",u)}o(void 0)})}}function ee(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function te(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ee(Object(t),!0).forEach(function(r){ft(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ee(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ft(n,e,t){return e=ht(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ht(n){var e=vt(n,"string");return typeof e=="symbol"?e:String(e)}function vt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bt(n){var{dashboards:e,activeDashboard:t,onLayoutInitialized:r,onGoldenLayoutChange:i,plugins:a,emptyDashboard:o=c.jsx(N,{})}=n,s=Te(),u=d.useCallback((l,v)=>{var{metadata:f}=l;try{if(f!=null){var b=Le(f);return te(te({fetch:function(){var p=dt(function*(){return s(b)});function h(){return p.apply(this,arguments)}return h}()},l),{},{localDashboardId:v})}}catch{}return je.hydrate(l,v)},[s]);return c.jsx("div",{className:"tab-content",children:e.map(l=>c.jsx("div",{className:A("tab-pane",{active:l.id===t}),children:c.jsx(ut,{id:l.id,isActive:l.id===t,emptyDashboard:o,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:r,onGoldenLayoutChange:i,hydrate:u,plugins:a},l.key)},l.id))})}function zt(){return T(lt,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function Gt(){return T(Ye,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function ne(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function re(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){ne(a,r,i,o,s,"next",u)}function s(u){ne(a,r,i,o,s,"throw",u)}o(void 0)})}}function ie(n,e,t){return e=pt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pt(n){var e=mt(n,"string");return typeof e=="symbol"?e:String(e)}function mt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wt{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";ie(this,"storageService",void 0),ie(this,"root",void 0),this.storageService=e,this.root=t}getLayouts(){var e=this;return re(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(r=>r.basename)})()}getLayout(e){var t=this;return re(function*(){var r=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield r.text();return JSON.parse(i)})()}}function bt(n){return n.version===2}function gt(n){return Array.isArray(n)}function ae(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function yt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){ae(a,r,i,o,s,"next",u)}function s(u){ae(a,r,i,o,s,"throw",u)}o(void 0)})}}var E=F.module("UserLayoutUtils"),Mt={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:B.COMPONENT,title:B.TITLE,isClosable:!1},{type:"react-component",component:z.COMPONENT,title:z.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:G.COMPONENT,title:G.TITLE,isClosable:!1},{type:"react-component",component:W.COMPONENT,title:W.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},Pt={layoutConfig:[],links:[],filterSets:[],version:2};function le(n){if(bt(n))return n;if(gt(n)){var e=n;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(n))}function wt(n){return _.apply(this,arguments)}function _(){return _=yt(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var t=yield n.getLayouts();if(t.length>0)try{var r=yield n.getLayout(t[0]);return le(r)}catch(i){E.error("Unable to load layout",t[0],":",i),E.warn("No valid layouts found, falling back to default layout")}}catch(i){E.error("Unable to fetch layout list",i),E.warn("Falling back to default layout")}return e?Mt:Pt}),_.apply(this,arguments)}function St(n){var{filterSets:e,layoutConfig:t,links:r,pluginDataMap:i}=n,a={filterSets:e,layoutConfig:t,links:r,pluginDataMap:i,version:2};return a}const Ot={exportLayout:St,getDefaultLayout:wt,normalizeLayout:le};function oe(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function D(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){oe(a,r,i,o,s,"next",u)}function s(u){oe(a,r,i,o,s,"throw",u)}o(void 0)})}}function ce(n,e,t){return e=Ct(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ct(n){var e=xt(n,"string");return typeof e=="symbol"?e:String(e)}function xt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Et=F.module("LocalWorkspaceStorage");class m{static getBooleanServerConfig(e,t){var r,i;if((e==null||(r=e.get(t))===null||r===void 0?void 0:r.toLowerCase())==="true")return!0;if((e==null||(i=e.get(t))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var t={defaultDateTimeFormat:k.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:k.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:_e.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Ae.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},r={defaultDateTimeFormat:e==null?void 0:e.get("dateTimeFormat"),formatter:[],timeZone:e==null?void 0:e.get("timeZone"),showTimeZone:m.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:m.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:m.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:(e==null?void 0:e.get("decimalFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:(e==null?void 0:e.get("integerFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("integerFormat")}:void 0,truncateNumbersWithPound:m.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:m.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:m.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:(e==null?void 0:e.get("isMinimapEnabled"))!==void 0?{isMinimapEnabled:m.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:m.getBooleanServerConfig(e,"web.webgl"),webglEditable:m.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(r),a=0;a<i.length;a+=1){var o=i[a];r[o]!==void 0&&(t[o]=r[o])}return t}static makeWorkspaceData(e,t){return D(function*(){var{filterSets:r,links:i,layoutConfig:a,pluginDataMap:o={}}=yield Ot.getDefaultLayout(e,t==null?void 0:t.isConsoleAvailable);return{settings:{},layoutConfig:a,closed:[{}],links:i,filterSets:r,pluginDataMap:o}})()}static makeDefaultWorkspace(e,t){return D(function*(){return{data:yield m.makeWorkspaceData(e,t)}})()}constructor(e){ce(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return D(function*(){try{var r,i=JSON.parse((r=localStorage.getItem(m.STORAGE_KEY))!==null&&r!==void 0?r:"");return i}catch{return Et.info("Unable to load workspace data, initializing to default data"),m.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return D(function*(){return localStorage.setItem(m.STORAGE_KEY,JSON.stringify(e)),e})()}}ce(m,"STORAGE_KEY","deephaven.WorkspaceStorage");export{Bt as A,Lt as C,et as D,ke as F,Wt as G,m as L,Kt as S,Nt as U,We as a,Gt as b,Ut as c,At as d,Fe as e,_t as f,jt as g,se as h,He as i,Ye as j,Ft as k,Rt as l,R as m,ut as n,$t as o,lt as p,Ot as q,bt as r,tt as s,gt as t,zt as u,Mt as v,Pt as w,le as x,wt as y,St as z};
|
|
2
|
-
//# sourceMappingURL=LocalWorkspaceStorage-
|
|
1
|
+
import{r as d,J as I,E as c,H as A,bg as de,K as fe}from"./vendor-9e6eb436.js";import{L as F,q as he,a as N}from"./index-6bbfd4c2.js";import{A as S,a6 as K,F as ve,u as pe,l as T,a1 as me,a7 as be,ae as ge,ag as U,aQ as ye,bp as Me,aZ as Pe,aV as we,bq as Se,aW as Oe,br as Ce,aT as xe,bs as Ee,be as De,an as Ie,a0 as Te,$ as Le,aX as je,bt as B,bu as z,bv as G,bw as W,a2 as k,a3 as _e,a4 as Ae}from"./LogPanel-0104fb18.js";function Fe(n,e){d.useEffect(()=>{if(n!=null){var t=new window.ResizeObserver(e);return t.observe(n),()=>{n!=null&&t.unobserve(n)}}},[n,e])}function H(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ne(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?H(Object(t),!0).forEach(function(r){M(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function M(n,e,t){return e=Re(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Re(n){var e=$e(n,"string");return typeof e=="symbol"?e:String(e)}function $e(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Y=F.module("ContextMenu");class C extends d.PureComponent{static handleContextMenu(e){e.metaKey||(e.stopPropagation(),e.preventDefault())}constructor(e){super(e),M(this,"container",void 0),M(this,"oldFocus",void 0),M(this,"activeSubMenuRef",void 0),M(this,"subMenuTimer",void 0),M(this,"rAF",void 0),M(this,"initialPosition",void 0),this.handleBlur=this.handleBlur.bind(this),this.handleCloseSubMenu=this.handleCloseSubMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMenuItemClick=this.handleMenuItemClick.bind(this),this.handleMenuItemContextMenu=this.handleMenuItemContextMenu.bind(this),this.handleMenuItemMouseMove=this.handleMenuItemMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleWindowResize=this.handleWindowResize.bind(this),this.container=I.createRef(),this.oldFocus=document.activeElement,this.activeSubMenuRef=I.createRef(),this.subMenuTimer=0,this.rAF=0,this.initialPosition={top:e.top,left:e.left},this.state={menuItems:[],pendingItems:[],activeSubMenu:null,hasOverflow:!1,subMenuTop:null,subMenuLeft:null,subMenuParentWidth:0,subMenuParentHeight:0,keyboardIndex:-1,mouseIndex:-1}}componentDidMount(){this.initMenu(),this.verifyPosition(),window.addEventListener("resize",this.handleWindowResize),this.rAF=window.requestAnimationFrame(()=>{var e;(e=this.container.current)===null||e===void 0||e.focus();var{onMenuOpened:t}=this.props;t(this)})}componentDidUpdate(e,t){var{actions:r}=this.props,{activeSubMenu:i}=this.state;if(i!==t.activeSubMenu)if(i==null){var a;(a=this.container.current)===null||a===void 0||a.focus()}else this.setActiveSubMenuPosition();if(e.actions!==r&&(this.initMenu(),this.container.current==null||!this.container.current.contains(document.activeElement))){var o;(o=this.container.current)===null||o===void 0||o.focus()}this.verifyPosition()}componentWillUnmount(){this.cancelPromises(),window.removeEventListener("resize",this.handleWindowResize),cancelAnimationFrame(this.rAF)}getKeyboardIndex(){var{options:e}=this.props;if(e.separateKeyboardMouse!==void 0&&e.separateKeyboardMouse){var{keyboardIndex:t}=this.state;return t}return this.getMouseIndex()}setKeyboardIndex(e){var{options:t}=this.props;t.separateKeyboardMouse!==void 0&&t.separateKeyboardMouse?this.setState({keyboardIndex:e}):this.setMouseIndex(e)}getMouseIndex(){var{mouseIndex:e}=this.state;return e}setMouseIndex(e){this.setState({mouseIndex:e})}initMenu(){this.cancelPromises(),cancelAnimationFrame(this.rAF);var{options:e}=this.props,t=e.initialKeyboardIndex;t===void 0&&(t=-1);for(var{actions:r}=this.props,i=S.getMenuItems(r),a=[],o=i.length-1;o>=0;o-=1){var s=i[o];s instanceof Promise?this.initMenuPromise(s):a.push(s)}this.setState({mouseIndex:-1,keyboardIndex:t,activeSubMenu:null,menuItems:S.sortActions(a)})}initMenuPromise(e){var t=K.makeCancelable(e);this.setState(r=>({pendingItems:r.pendingItems.concat(t)})),t.then(r=>{this.setState(i=>{var a=i.pendingItems.indexOf(t);if(a>=0){var o=i.pendingItems.slice();return o.splice(a,1),{menuItems:S.sortActions(i.menuItems.concat(r)),pendingItems:o}}return null})},r=>{K.isCanceled(r)||(this.setState(i=>{var a=i.pendingItems.indexOf(t);if(a>=0){var o=i.pendingItems.slice();return o.splice(a,1),{pendingItems:o}}return null}),Y.error(r))})}cancelPromises(){var{pendingItems:e}=this.state;e.map(t=>t.cancel())}setActiveSubMenuPosition(){if(this.activeSubMenuRef.current!==null){var e=this.activeSubMenuRef.current.getBoundingClientRect();this.setState({subMenuTop:e.top,subMenuLeft:e.right,subMenuParentHeight:e.height,subMenuParentWidth:e.width})}}verifyPosition(){var e,t,r,i,{options:a,updatePosition:o,subMenuParentWidth:s,subMenuParentHeight:u,top:l,left:v}=this.props;if(!(!this.container.current||a.doNotVerifyPosition!=null&&a.doNotVerifyPosition)){var{top:f,left:b}=this.initialPosition,{width:p,height:h}=(e=(t=this.container.current)===null||t===void 0?void 0:t.getBoundingClientRect())!==null&&e!==void 0?e:{width:0,height:0},P=((r=(i=this.container.current)===null||i===void 0?void 0:i.scrollHeight)!==null&&r!==void 0?r:0)>window.innerHeight;h===0||p===0||(f+h>window.innerHeight&&(f-h-u>0?f-=h-u:f=window.innerHeight-h),b+p>window.innerWidth&&(b=b-p-s),(v!==b||l!==f)&&(this.setState({hasOverflow:P}),o(f,b)))}}handleWindowResize(){this.container.current&&this.closeMenu(!0)}handleBlur(e){if(!this.container.current){Y.warn("Container is null!");return}if(!this.container.current.contains(e.relatedTarget)){for(var t=e.relatedTarget,r=!1;t&&!r;)r=t.hasAttribute("data-dh-context-menu"),t=t.parentElement;r||this.closeMenu(!0)}}isEscapeKey(e){var{left:t}=this.props;return e==="Escape"||t<0&&e==="ArrowRight"||e==="ArrowLeft"}handleKeyDown(e){var{menuItems:t}=this.state,r=this.getKeyboardIndex(),i=r,a=!1;if(e.key==="Enter"||e.key===" "){r>=0&&r<t.length&&this.handleMenuItemClick(t[r],e);return}if(e.key==="ArrowRight"?r>=0&&r<=t.length?a=!0:i=0:this.isEscapeKey(e.key)?i=null:e.key==="ArrowUp"||e.shiftKey&&e.key==="Tab"?i=S.getNextMenuItem(i,-1,t):(e.key==="ArrowDown"||e.key==="Tab")&&(i=S.getNextMenuItem(i,1,t)),a){this.openSubMenu(r),e.preventDefault(),e.stopPropagation();return}r!==i&&(i!==null?this.setKeyboardIndex(i):(this.closeMenu(),this.oldFocus instanceof HTMLElement&&this.oldFocus.focus()),e.preventDefault(),e.stopPropagation())}openSubMenu(e){var{menuItems:t,activeSubMenu:r}=this.state,i=t[e].actions?e:null;r!==i&&this.setState({activeSubMenu:i,subMenuTop:null,subMenuLeft:null})}closeMenu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,{closeMenu:t,onMenuClosed:r}=this.props;cancelAnimationFrame(this.rAF),this.rAF=window.requestAnimationFrame(()=>{t(e),r(this)})}closeSubMenu(){this.setState({activeSubMenu:null})}handleCloseSubMenu(e){e?this.closeMenu(!0):this.closeSubMenu()}handleMenuItemClick(e,t){t.preventDefault(),t.stopPropagation();var{menuItems:r}=this.state;e!=null&&(e.disabled===void 0||!e.disabled)&&(e.actions!=null?this.openSubMenu(r.indexOf(e)):e.action!=null&&(e.action(t.nativeEvent),this.closeMenu(!0)))}handleMenuItemContextMenu(e,t){t.metaKey||this.handleMenuItemClick(e,t)}handleMenuItemMouseMove(e){var{menuItems:t}=this.state,r=t.indexOf(e);this.setMouseIndex(r),r>=0&&r<t.length&&(e.disabled===void 0||!e.disabled)&&this.openSubMenu(r)}handleMouseLeave(){this.setMouseIndex(-1)}render(){for(var e=[],{top:t,left:r}=this.props,{activeSubMenu:i,hasOverflow:a,keyboardIndex:o,menuItems:s,mouseIndex:u,pendingItems:l,subMenuTop:v,subMenuLeft:f,subMenuParentWidth:b,subMenuParentHeight:p}=this.state,h=0;h<s.length;h+=1){var P=s[h];h>0&&P.group!==s[h-1].group&&e.push(c.jsx("hr",{},"".concat(h,".separator")));var g=c.jsx(ve,{ref:i===h?this.activeSubMenuRef:null,isKeyboardSelected:o===h,isMouseSelected:u===h,menuItem:P,closeMenu:this.handleCloseSubMenu,onMenuItemClick:this.handleMenuItemClick,onMenuItemMouseMove:this.handleMenuItemMouseMove,onMenuItemContextMenu:this.handleMenuItemContextMenu},h);e.push(g)}var O=null;l.length>0&&(O=c.jsx("div",{className:"loading",children:c.jsx(he,{className:"loading-spinner-vertical-align"})}));var{menuStyle:L,"data-testid":$}=this.props,w=i!==null&&v!==null&&f!==null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:A({"has-overflow":a},"context-menu-container"),style:Ne({top:t,left:r},L),ref:this.container,"data-dh-context-menu":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,onMouseLeave:this.handleMouseLeave,onContextMenu:C.handleContextMenu,role:"menuitem",tabIndex:0,"data-testid":$,children:[e,O]}),w&&i!==null&&v!==null&&f!==null&&c.jsx(C,{actions:s[i].actions||[],closeMenu:this.handleCloseSubMenu,top:v,left:f,updatePosition:(y,x)=>{this.setState({subMenuTop:y,subMenuLeft:x})},subMenuParentWidth:b,subMenuParentHeight:p},"sub-".concat(i))]})}}M(C,"defaultProps",{subMenuParentWidth:0,subMenuParentHeight:0,closeMenu(){},onMenuOpened(){},onMenuClosed(){},options:{},menuStyle:{},"data-testid":void 0});const Ke=C;function Z(n,e,t){return e=Ue(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ue(n){var e=Be(n,"string");return typeof e=="symbol"?e:String(e)}function Be(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ze extends d.Component{constructor(e){super(e),Z(this,"container",void 0),Z(this,"openMenu",void 0),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.container=I.createRef(),this.openMenu=I.createRef(),this.state={actions:null,left:0,top:0}}componentDidMount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.addEventListener("contextmenu",this.handleContextMenu)}componentWillUnmount(){var e;(e=this.container.current)!==null&&e!==void 0&&e.parentElement&&this.container.current.parentElement.removeEventListener("contextmenu",this.handleContextMenu)}handleContextMenu(e){if(this.container.current){var t=this.container.current.getBoundingClientRect(),r=e.clientY-t.top,i=e.clientX-t.left,{actions:a}=this.state;if(a!=null&&e.target===this.container.current){e.preventDefault(),this.setState({actions:null},()=>{var s=document.elementFromPoint(i,r),u=new MouseEvent("contextmenu",{clientX:e.clientX,clientY:e.clientY,bubbles:!0,cancelable:!0});s==null||s.dispatchEvent(u)});return}if(S.isContextActionEvent(e)&&!(e.metaKey||e.ctrlKey)){var o=S.getMenuItems(e.contextActions);o.length!==0&&(e.preventDefault(),this.setState({actions:o,top:r,left:i}))}}}handleMenuClose(e){e===this.openMenu.current&&this.setState({actions:null})}render(){var e=null,{"data-testid":t}=this.props,{actions:r,top:i,left:a}=this.state;return r&&(e=c.jsx(Ke,{ref:this.openMenu,actions:r,onMenuClosed:this.handleMenuClose,top:i,left:a,updatePosition:(o,s)=>{this.setState({top:o,left:s})},"data-testid":t})),c.jsx("div",{className:A("context-menu-root",{active:r}),ref:this.container,children:e})}}const Lt=ze;function Ge(n,e){var t=pe(),r=d.useMemo(()=>new t.CoreClient(n,e),[t,n,e]);return d.useEffect(()=>()=>{r.disconnect()},[r]),r}var se=d.createContext(null);function jt(n){var{serverUrl:e,options:t,children:r}=n,i=Ge(e,t);return c.jsx(se.Provider,{value:i,children:r})}function We(){return T(se,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}var ke=1e4;function _t(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ke;return new Promise((r,i)=>{var a,o=setTimeout(()=>{var u;(u=a)===null||u===void 0||u(),i(new me("Timeout looking for variable ".concat(e)))},t);function s(u){var l,v=u.created.find(f=>f.title===e);clearTimeout(o),(l=a)===null||l===void 0||l(),v!=null?r(v):i(new Error("Variable ".concat(e," not found")))}a=n.subscribeToFieldUpdates(s)})}function He(n){var e=[...n.entries()].filter(t=>{var[,r]=t;return ge(r)||U(r)});return e.map(t=>{var[r,i]=t;if(U(i)){var{DashboardPlugin:a}=i;return c.jsx(a,{},r)}var{component:o}=i;return c.jsx(o,{},r)})}function At(){var n=be(),e=d.useMemo(()=>He(n),[n]);return e}var Ft=d.createContext({}),Nt=d.createContext({}),Ye=d.createContext(null);function q(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ze(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?q(Object(t),!0).forEach(function(r){qe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):q(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qe(n,e,t){return e=Je(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Je(n){var e=Xe(n,"string");return typeof e=="symbol"?e:String(e)}function Xe(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Qe=100,j=()=>{},Ve=Object.freeze({});function et(n){var{id:e="default",children:t,emptyDashboard:r,layoutConfig:i,layoutSettings:a=Ve,onLayoutConfigChange:o=j,onGoldenLayoutChange:s=j,onLayoutInitialized:u=j,fallbackComponent:l=Ce,hydrate:v,dehydrate:f,panelWrapper:b}=n,p=d.useRef(null),[h,P]=d.useState(!1),[g,O]=d.useState();d.useEffect(function(){if(!p.current){O(void 0);return}var w=Ze({},ye.makeDefaultLayout());w.settings===void 0&&(w.settings={}),Object.assign(w.settings,a),w.content=[];var y=new Me(w,p.current),x=()=>{y.off("initialised",x),P(!0)};return y.on("initialised",x),l!=null&&y.setFallbackComponent(l),y.init(),O(y),s(y),()=>{y.destroy()}},[a,l,s,P,O]);var L=d.useMemo(()=>de(()=>{g!=null&&g.isInitialised&&(g==null||g.updateSize())},Qe),[g]);return Fe(p.current,L),c.jsxs("div",{className:"dashboard-container w-100 h-100",children:[c.jsx("div",{className:"w-100 h-100",ref:p}),h&&g&&c.jsx(Pe.Provider,{value:g,children:c.jsx(we.Provider,{value:e,children:c.jsx(Se,{children:c.jsx(Oe,{emptyDashboard:r,id:e,layout:g,layoutConfig:i,onLayoutChange:o,onLayoutInitialized:u,hydrate:v,dehydrate:f,panelWrapper:b,children:t})})})})]})}var R="CREATE_DASHBOARD";function tt(n,e){try{n.off(R,e)}catch{}}function Rt(n,e){return n.on(R,e),()=>tt(n,e)}function $t(n,e){n.emit(R,e)}var nt=["id","isActive","plugins"];function J(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function X(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?J(Object(t),!0).forEach(function(r){rt(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function rt(n,e,t){return e=it(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function it(n){var e=at(n,"string");return typeof e=="symbol"?e:String(e)}function at(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ot(n,e){if(n==null)return{};var t=st(n,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function st(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function ut(n){var{id:e,isActive:t,plugins:r}=n,i=ot(n,nt),[a,o]=d.useState(t),s=fe(),u=d.useCallback(l=>{s(e===xe?Ee({layoutConfig:l}):De(e,{layoutConfig:l}))},[e,s]);return!a&&t&&o(!0),a?c.jsx(et,X(X({id:e,onLayoutConfigChange:u},i),{},{children:r})):c.jsx(N,{})}var lt=d.createContext(null);function Q(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function ct(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){Q(a,r,i,o,s,"next",u)}function s(u){Q(a,r,i,o,s,"throw",u)}o(void 0)})}}var ue=d.createContext(null);function Kt(n){var{children:e}=n,t=We(),[r,i]=d.useState(),[a,o]=d.useState();d.useEffect(function(){var l=!1;function v(){return f.apply(this,arguments)}function f(){return f=ct(function*(){try{var b=yield t.getServerConfigValues();l||i(new Map(b))}catch(p){l||o(p)}}),f.apply(this,arguments)}return v(),()=>{l=!0}},[t]);var s=r==null;return s||a!=null?c.jsx(N,{isLoading:s&&a==null,errorMessage:Ie(a)}):c.jsx(ue.Provider,{value:r,children:e})}function Ut(){return T(ue,"No server config available in useServerConfig. Was code wrapped in ServerConfigBootstrap or ServerConfigContext.Provider?")}function V(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function dt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){V(a,r,i,o,s,"next",u)}function s(u){V(a,r,i,o,s,"throw",u)}o(void 0)})}}function ee(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function te(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ee(Object(t),!0).forEach(function(r){ft(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ee(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ft(n,e,t){return e=ht(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ht(n){var e=vt(n,"string");return typeof e=="symbol"?e:String(e)}function vt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Bt(n){var{dashboards:e,activeDashboard:t,onLayoutInitialized:r,onGoldenLayoutChange:i,plugins:a,emptyDashboard:o=c.jsx(N,{})}=n,s=Te(),u=d.useCallback((l,v)=>{var{metadata:f}=l;try{if(f!=null){var b=Le(f);return te(te({fetch:function(){var p=dt(function*(){return s(b)});function h(){return p.apply(this,arguments)}return h}()},l),{},{localDashboardId:v})}}catch{}return je.hydrate(l,v)},[s]);return c.jsx("div",{className:"tab-content",children:e.map(l=>c.jsx("div",{className:A("tab-pane",{active:l.id===t}),children:c.jsx(ut,{id:l.id,isActive:l.id===t,emptyDashboard:o,layoutConfig:l.layoutConfig,layoutSettings:l.layoutSettings,onLayoutInitialized:r,onGoldenLayoutChange:i,hydrate:u,plugins:a},l.key)},l.id))})}function zt(){return T(lt,"No IdeConnection available in useConnection. Was code wrapped in ConnectionContext.Provider?")}function Gt(){return T(Ye,"No user available in useUser. Was code wrapped in UserBootstrap or UserContext.Provider?")}function ne(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function re(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){ne(a,r,i,o,s,"next",u)}function s(u){ne(a,r,i,o,s,"throw",u)}o(void 0)})}}function ie(n,e,t){return e=pt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function pt(n){var e=mt(n,"string");return typeof e=="symbol"?e:String(e)}function mt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Wt{constructor(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";ie(this,"storageService",void 0),ie(this,"root",void 0),this.storageService=e,this.root=t}getLayouts(){var e=this;return re(function*(){var t=yield e.storageService.listItems(e.root,"*.json");return t.map(r=>r.basename)})()}getLayout(e){var t=this;return re(function*(){var r=yield t.storageService.loadFile("".concat(t.root,"/").concat(e)),i=yield r.text();return JSON.parse(i)})()}}function bt(n){return n.version===2}function gt(n){return Array.isArray(n)}function ae(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function yt(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){ae(a,r,i,o,s,"next",u)}function s(u){ae(a,r,i,o,s,"throw",u)}o(void 0)})}}var E=F.module("UserLayoutUtils"),Mt={layoutConfig:[{type:"column",content:[{type:"row",height:40,content:[{type:"stack",content:[{type:"react-component",component:B.COMPONENT,title:B.TITLE,isClosable:!1},{type:"react-component",component:z.COMPONENT,title:z.TITLE,isClosable:!1}]},{type:"stack",width:25,content:[{type:"react-component",component:G.COMPONENT,title:G.TITLE,isClosable:!1},{type:"react-component",component:W.COMPONENT,title:W.TITLE,isClosable:!1}]}]},{type:"row",content:[{type:"stack",title:"Notebooks",content:[]}]}]}],links:[],filterSets:[],version:2},Pt={layoutConfig:[],links:[],filterSets:[],version:2};function le(n){if(bt(n))return n;if(gt(n)){var e=n;return{layoutConfig:e,links:[],filterSets:[],version:2}}throw new Error("Unexpected layout import format: ".concat(n))}function wt(n){return _.apply(this,arguments)}function _(){return _=yt(function*(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;try{var t=yield n.getLayouts();if(t.length>0)try{var r=yield n.getLayout(t[0]);return le(r)}catch(i){E.error("Unable to load layout",t[0],":",i),E.warn("No valid layouts found, falling back to default layout")}}catch(i){E.error("Unable to fetch layout list",i),E.warn("Falling back to default layout")}return e?Mt:Pt}),_.apply(this,arguments)}function St(n){var{filterSets:e,layoutConfig:t,links:r,pluginDataMap:i}=n,a={filterSets:e,layoutConfig:t,links:r,pluginDataMap:i,version:2};return a}const Ot={exportLayout:St,getDefaultLayout:wt,normalizeLayout:le};function oe(n,e,t,r,i,a,o){try{var s=n[a](o),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(r,i)}function D(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(u){oe(a,r,i,o,s,"next",u)}function s(u){oe(a,r,i,o,s,"throw",u)}o(void 0)})}}function ce(n,e,t){return e=Ct(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ct(n){var e=xt(n,"string");return typeof e=="symbol"?e:String(e)}function xt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var Et=F.module("LocalWorkspaceStorage");class m{static getBooleanServerConfig(e,t){var r,i;if((e==null||(r=e.get(t))===null||r===void 0?void 0:r.toLowerCase())==="true")return!0;if((e==null||(i=e.get(t))===null||i===void 0?void 0:i.toLowerCase())==="false")return!1}static makeDefaultWorkspaceSettings(e){for(var t={defaultDateTimeFormat:k.DEFAULT_DATETIME_FORMAT_STRING,formatter:[],timeZone:k.DEFAULT_TIME_ZONE_ID,showTimeZone:!1,showTSeparator:!0,disableMoveConfirmation:!1,defaultDecimalFormatOptions:{defaultFormatString:_e.DEFAULT_FORMAT_STRING},defaultIntegerFormatOptions:{defaultFormatString:Ae.DEFAULT_FORMAT_STRING},truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,defaultNotebookSettings:{isMinimapEnabled:!1},webgl:!0,webglEditable:!0,gridDensity:"regular"},r={defaultDateTimeFormat:e==null?void 0:e.get("dateTimeFormat"),formatter:[],timeZone:e==null?void 0:e.get("timeZone"),showTimeZone:m.getBooleanServerConfig(e,"showTimeZone"),showTSeparator:m.getBooleanServerConfig(e,"showTSeparator"),disableMoveConfirmation:m.getBooleanServerConfig(e,"disableMoveConfirmation"),defaultDecimalFormatOptions:(e==null?void 0:e.get("decimalFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("decimalFormat")}:void 0,defaultIntegerFormatOptions:(e==null?void 0:e.get("integerFormat"))!==void 0?{defaultFormatString:e==null?void 0:e.get("integerFormat")}:void 0,truncateNumbersWithPound:m.getBooleanServerConfig(e,"truncateNumbersWithPound"),showEmptyStrings:m.getBooleanServerConfig(e,"showEmptyStrings"),showNullStrings:m.getBooleanServerConfig(e,"showNullStrings"),defaultNotebookSettings:(e==null?void 0:e.get("isMinimapEnabled"))!==void 0?{isMinimapEnabled:m.getBooleanServerConfig(e,"isMinimapEnabled")}:void 0,webgl:m.getBooleanServerConfig(e,"web.webgl"),webglEditable:m.getBooleanServerConfig(e,"web.webgl.editable")},i=Object.keys(r),a=0;a<i.length;a+=1){var o=i[a];r[o]!==void 0&&(t[o]=r[o])}return t}static makeWorkspaceData(e,t){return D(function*(){var{filterSets:r,links:i,layoutConfig:a,pluginDataMap:o={}}=yield Ot.getDefaultLayout(e,t==null?void 0:t.isConsoleAvailable);return{settings:{},layoutConfig:a,closed:[{}],links:i,filterSets:r,pluginDataMap:o}})()}static makeDefaultWorkspace(e,t){return D(function*(){return{data:yield m.makeWorkspaceData(e,t)}})()}constructor(e){ce(this,"layoutStorage",void 0),this.layoutStorage=e}load(e){var t=this;return D(function*(){try{var r,i=JSON.parse((r=localStorage.getItem(m.STORAGE_KEY))!==null&&r!==void 0?r:"");return i}catch{return Et.info("Unable to load workspace data, initializing to default data"),m.makeDefaultWorkspace(t.layoutStorage,e)}})()}save(e){return D(function*(){return localStorage.setItem(m.STORAGE_KEY,JSON.stringify(e)),e})()}}ce(m,"STORAGE_KEY","deephaven.WorkspaceStorage");export{Bt as A,Lt as C,et as D,ke as F,Wt as G,m as L,Kt as S,Nt as U,We as a,Gt as b,Ut as c,At as d,Fe as e,_t as f,jt as g,se as h,He as i,Ye as j,Ft as k,Rt as l,R as m,ut as n,$t as o,lt as p,Ot as q,bt as r,tt as s,gt as t,zt as u,Mt as v,Pt as w,le as x,wt as y,St as z};
|
|
2
|
+
//# sourceMappingURL=LocalWorkspaceStorage-de4384df.js.map
|