synapse-react-client 4.0.12 → 4.0.13

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/SWC.index.js CHANGED
@@ -109,7 +109,7 @@ var x = { BackendDestinationEnum: r }, S = {
109
109
  sendSearchResultsReturnedEvent: y,
110
110
  sendSearchResultReturnedEvent: v,
111
111
  sendSearchResultClickedEvent: _
112
- }, T = "4.0.12";
112
+ }, T = "4.0.13";
113
113
  //#endregion
114
114
  export { w as Analytics, a as HttpClient, d as Palettes, o as SynapseClient, C as SynapseComponents, n as SynapseConstants, S as SynapseContext, x as SynapseEnums, m as SynapseQueries, T as SynapseReactClientVersion, p as SynapseSessionManager, i as xssOptions };
115
115
 
@@ -7,10 +7,10 @@ import g from "@mui/icons-material/Close";
7
7
  import _ from "react-draggable";
8
8
  //#region src/components/DraggableDialog/DraggableDialog.tsx
9
9
  function v({ open: v = !1, onClose: y, title: b, children: x }) {
10
- let S = f(p().breakpoints.down("sm")), C = r(null), [w, T] = i(), [E, D] = i({
10
+ let S = p(), C = f(S.breakpoints.down("sm")), w = r(null), [T, E] = i(), [D, O] = i({
11
11
  x: 100,
12
12
  y: 100
13
- }), { width: O, height: k, handleResizeStart: A } = e({
13
+ }), { width: k, height: A, handleResizeStart: j } = e({
14
14
  initialWidth: 600,
15
15
  initialHeight: 500,
16
16
  minWidth: 300,
@@ -21,26 +21,26 @@ function v({ open: v = !1, onClose: y, title: b, children: x }) {
21
21
  if (n(() => {
22
22
  function e() {
23
23
  let e = {
24
- left: -(O - 100),
24
+ left: -(k - 100),
25
25
  top: 0,
26
26
  right: window.innerWidth - 100,
27
27
  bottom: window.innerHeight - 100
28
28
  };
29
- T(e), D((t) => ({
29
+ E(e), O((t) => ({
30
30
  x: Math.max(e.left, Math.min(t.x, e.right)),
31
31
  y: Math.max(e.top, Math.min(t.y, e.bottom))
32
32
  }));
33
33
  }
34
34
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
35
- }, [O, k]), !v) return null;
36
- let j = /* @__PURE__ */ h(l, {
35
+ }, [k, A]), !v) return null;
36
+ let M = /* @__PURE__ */ h(l, {
37
37
  elevation: 5,
38
38
  sx: {
39
39
  display: "flex",
40
40
  flexDirection: "column",
41
- height: S ? "95vh" : `${k}px`,
42
- width: S ? "95vw" : `${O}px`,
43
- ...S && { position: "fixed" }
41
+ height: C ? "95vh" : `${A}px`,
42
+ width: C ? "95vw" : `${k}px`,
43
+ ...C && { position: "fixed" }
44
44
  },
45
45
  children: [
46
46
  /* @__PURE__ */ h(u, {
@@ -78,28 +78,28 @@ function v({ open: v = !1, onClose: y, title: b, children: x }) {
78
78
  return /* @__PURE__ */ m(a, {
79
79
  sx: {
80
80
  position: "fixed",
81
- zIndex: 1e3,
81
+ zIndex: S.zIndex.modal,
82
82
  top: 0,
83
83
  left: 0,
84
- pointerEvents: S ? "auto" : "none"
84
+ pointerEvents: C ? "auto" : "none"
85
85
  },
86
- children: S ? j : /* @__PURE__ */ m(_, {
87
- position: E,
88
- onDrag: (e, t) => D({
86
+ children: C ? M : /* @__PURE__ */ m(_, {
87
+ position: D,
88
+ onDrag: (e, t) => O({
89
89
  x: t.x,
90
90
  y: t.y
91
91
  }),
92
- nodeRef: C,
93
- bounds: w,
92
+ nodeRef: w,
93
+ bounds: T,
94
94
  handle: ".drag-handle",
95
95
  children: /* @__PURE__ */ m(a, {
96
- ref: C,
96
+ ref: w,
97
97
  sx: { pointerEvents: "auto" },
98
98
  children: /* @__PURE__ */ m(t, {
99
- width: O,
100
- height: k,
101
- onResizeStart: A,
102
- children: j
99
+ width: k,
100
+ height: A,
101
+ onResizeStart: j,
102
+ children: M
103
103
  })
104
104
  })
105
105
  })
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableDialog.js","names":[],"sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"sourcesContent":["import Draggable, { DraggableBounds } from 'react-draggable'\nimport {\n Box,\n IconButton,\n Paper,\n Stack,\n Typography,\n Divider,\n useMediaQuery,\n useTheme,\n DialogContent,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport { useRef, ReactNode, useEffect, useState } from 'react'\nimport { useResizable } from '../ResizableContainer/hooks/useResizable'\nimport { ResizableContainer } from '../ResizableContainer/ResizableContainer'\n\ntype DraggableDialogProps = {\n open?: boolean\n onClose?: () => void\n children: ReactNode\n title?: ReactNode\n}\n\nexport default function DraggableDialog({\n open = false,\n onClose,\n title,\n children,\n}: DraggableDialogProps) {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'))\n const draggableRef = useRef<HTMLDivElement>(null)\n const [bounds, setBounds] = useState<DraggableBounds>()\n const [position, setPosition] = useState({ x: 100, y: 100 })\n const { width, height, handleResizeStart } = useResizable({\n initialWidth: 600,\n initialHeight: 500,\n minWidth: 300,\n minHeight: 200,\n maxWidth: 1200,\n maxHeight: 800,\n })\n\n useEffect(() => {\n // Calculate draggable bounds to keep dialog within viewport with margin\n function updateBounds() {\n const margin = 100\n const dialogWidth = width\n\n const newBounds = {\n left: -(dialogWidth - margin),\n top: 0,\n right: window.innerWidth - margin,\n bottom: window.innerHeight - margin,\n }\n\n setBounds(newBounds)\n\n // Clamp dialog position to new bounds to keep it visible after window resize\n setPosition(prevPosition => ({\n x: Math.max(newBounds.left, Math.min(prevPosition.x, newBounds.right)),\n y: Math.max(newBounds.top, Math.min(prevPosition.y, newBounds.bottom)),\n }))\n }\n updateBounds()\n window.addEventListener('resize', updateBounds)\n return () => window.removeEventListener('resize', updateBounds)\n }, [width, height])\n\n if (!open) {\n return null\n }\n\n const paperContent = (\n <Paper\n elevation={5}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n height: isMobile ? '95vh' : `${height}px`,\n width: isMobile ? '95vw' : `${width}px`,\n ...(isMobile && {\n position: 'fixed',\n }),\n }}\n >\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n gap=\"5px\"\n className=\"drag-handle\"\n sx={{\n padding: '20px',\n cursor: 'move',\n }}\n >\n <Typography variant=\"headline1\">{title}</Typography>\n <Box sx={{ flexGrow: 1 }} />\n <IconButton onClick={onClose}>\n <CloseIcon />\n </IconButton>\n </Stack>\n <Divider sx={{ mx: 2 }} />\n <DialogContent\n sx={{\n height: '100%',\n maxWidth: '100%',\n padding: '16px',\n }}\n >\n {children}\n </DialogContent>\n </Paper>\n )\n\n return (\n <Box\n sx={{\n position: 'fixed',\n zIndex: 1000,\n top: 0,\n left: 0,\n pointerEvents: isMobile ? 'auto' : 'none',\n }}\n >\n {isMobile ? (\n paperContent\n ) : (\n <Draggable\n position={position}\n onDrag={(e, data) => setPosition({ x: data.x, y: data.y })}\n nodeRef={draggableRef}\n bounds={bounds}\n handle=\".drag-handle\"\n >\n <Box ref={draggableRef} sx={{ pointerEvents: 'auto' }}>\n <ResizableContainer\n width={width}\n height={height}\n onResizeStart={handleResizeStart}\n >\n {paperContent}\n </ResizableContainer>\n </Box>\n </Draggable>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;AAwBA,SAAwB,EAAgB,EACtC,UAAO,IACP,YACA,UACA,eACuB;CAEvB,IAAM,IAAW,EADH,GACiB,CAAM,YAAY,KAAK,KAAK,CAAC,EACtD,IAAe,EAAuB,KAAK,EAC3C,CAAC,GAAQ,KAAa,GAA2B,EACjD,CAAC,GAAU,KAAe,EAAS;EAAE,GAAG;EAAK,GAAG;EAAK,CAAC,EACtD,EAAE,UAAO,WAAQ,yBAAsB,EAAa;EACxD,cAAc;EACd,eAAe;EACf,UAAU;EACV,WAAW;EACX,UAAU;EACV,WAAW;EACZ,CAAC;AA4BF,KA1BA,QAAgB;EAEd,SAAS,IAAe;GACtB,IAGM,IAAY;IAChB,MAAM,EAAE,IAAc;IACtB,KAAK;IACL,OAAO,OAAO,aAAa;IAC3B,QAAQ,OAAO,cAAc;IAC9B;AAKD,GAHA,EAAU,EAAU,EAGpB,GAAY,OAAiB;IAC3B,GAAG,KAAK,IAAI,EAAU,MAAM,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D,kBAAC,GAAD;KACS;KACC;KACR,eAAe;eAEd;KACkB,CAAA;IACjB,CAAA;GACI,CAAA;EAEV,CAAA"}
1
+ {"version":3,"file":"DraggableDialog.js","names":[],"sources":["../../../src/components/DraggableDialog/DraggableDialog.tsx"],"sourcesContent":["import Draggable, { DraggableBounds } from 'react-draggable'\nimport {\n Box,\n IconButton,\n Paper,\n Stack,\n Typography,\n Divider,\n useMediaQuery,\n useTheme,\n DialogContent,\n} from '@mui/material'\nimport CloseIcon from '@mui/icons-material/Close'\nimport { useRef, ReactNode, useEffect, useState } from 'react'\nimport { useResizable } from '../ResizableContainer/hooks/useResizable'\nimport { ResizableContainer } from '../ResizableContainer/ResizableContainer'\n\ntype DraggableDialogProps = {\n open?: boolean\n onClose?: () => void\n children: ReactNode\n title?: ReactNode\n}\n\nexport default function DraggableDialog({\n open = false,\n onClose,\n title,\n children,\n}: DraggableDialogProps) {\n const theme = useTheme()\n const isMobile = useMediaQuery(theme.breakpoints.down('sm'))\n const draggableRef = useRef<HTMLDivElement>(null)\n const [bounds, setBounds] = useState<DraggableBounds>()\n const [position, setPosition] = useState({ x: 100, y: 100 })\n const { width, height, handleResizeStart } = useResizable({\n initialWidth: 600,\n initialHeight: 500,\n minWidth: 300,\n minHeight: 200,\n maxWidth: 1200,\n maxHeight: 800,\n })\n\n useEffect(() => {\n // Calculate draggable bounds to keep dialog within viewport with margin\n function updateBounds() {\n const margin = 100\n const dialogWidth = width\n\n const newBounds = {\n left: -(dialogWidth - margin),\n top: 0,\n right: window.innerWidth - margin,\n bottom: window.innerHeight - margin,\n }\n\n setBounds(newBounds)\n\n // Clamp dialog position to new bounds to keep it visible after window resize\n setPosition(prevPosition => ({\n x: Math.max(newBounds.left, Math.min(prevPosition.x, newBounds.right)),\n y: Math.max(newBounds.top, Math.min(prevPosition.y, newBounds.bottom)),\n }))\n }\n updateBounds()\n window.addEventListener('resize', updateBounds)\n return () => window.removeEventListener('resize', updateBounds)\n }, [width, height])\n\n if (!open) {\n return null\n }\n\n const paperContent = (\n <Paper\n elevation={5}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n height: isMobile ? '95vh' : `${height}px`,\n width: isMobile ? '95vw' : `${width}px`,\n ...(isMobile && {\n position: 'fixed',\n }),\n }}\n >\n <Stack\n direction=\"row\"\n alignItems=\"center\"\n gap=\"5px\"\n className=\"drag-handle\"\n sx={{\n padding: '20px',\n cursor: 'move',\n }}\n >\n <Typography variant=\"headline1\">{title}</Typography>\n <Box sx={{ flexGrow: 1 }} />\n <IconButton onClick={onClose}>\n <CloseIcon />\n </IconButton>\n </Stack>\n <Divider sx={{ mx: 2 }} />\n <DialogContent\n sx={{\n height: '100%',\n maxWidth: '100%',\n padding: '16px',\n }}\n >\n {children}\n </DialogContent>\n </Paper>\n )\n\n return (\n <Box\n sx={{\n position: 'fixed',\n zIndex: theme.zIndex.modal,\n top: 0,\n left: 0,\n pointerEvents: isMobile ? 'auto' : 'none',\n }}\n >\n {isMobile ? (\n paperContent\n ) : (\n <Draggable\n position={position}\n onDrag={(e, data) => setPosition({ x: data.x, y: data.y })}\n nodeRef={draggableRef}\n bounds={bounds}\n handle=\".drag-handle\"\n >\n <Box ref={draggableRef} sx={{ pointerEvents: 'auto' }}>\n <ResizableContainer\n width={width}\n height={height}\n onResizeStart={handleResizeStart}\n >\n {paperContent}\n </ResizableContainer>\n </Box>\n </Draggable>\n )}\n </Box>\n )\n}\n"],"mappings":";;;;;;;;AAwBA,SAAwB,EAAgB,EACtC,UAAO,IACP,YACA,UACA,eACuB;CACvB,IAAM,IAAQ,GAAU,EAClB,IAAW,EAAc,EAAM,YAAY,KAAK,KAAK,CAAC,EACtD,IAAe,EAAuB,KAAK,EAC3C,CAAC,GAAQ,KAAa,GAA2B,EACjD,CAAC,GAAU,KAAe,EAAS;EAAE,GAAG;EAAK,GAAG;EAAK,CAAC,EACtD,EAAE,UAAO,WAAQ,yBAAsB,EAAa;EACxD,cAAc;EACd,eAAe;EACf,UAAU;EACV,WAAW;E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