@truedat/core 8.12.8 → 8.12.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/core",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.10",
|
|
4
4
|
"description": "Truedat Web Core",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"@tiptap/starter-kit": "3.31.3",
|
|
73
73
|
"@xyflow/react": "^12.6.4",
|
|
74
74
|
"axios": "^1.20.0",
|
|
75
|
-
"dompurify": "^3.4.
|
|
75
|
+
"dompurify": "^3.4.16",
|
|
76
76
|
"elkjs": "^0.10.0",
|
|
77
77
|
"graphql": "^16.11.0",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"lucide-react": "^1.41.0",
|
|
80
80
|
"marked": "^17.0.3",
|
|
81
|
-
"moment": "^2.
|
|
81
|
+
"moment": "^2.31.0",
|
|
82
82
|
"path-to-regexp": "^8.2.0",
|
|
83
83
|
"prop-types": "^15.8.1",
|
|
84
|
-
"query-string": "^
|
|
84
|
+
"query-string": "^9.5.1",
|
|
85
85
|
"react": "^19.2.7",
|
|
86
86
|
"react-csv": "^2.2.2",
|
|
87
87
|
"react-dom": "^19.2.7",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"swr": "^2.3.3",
|
|
100
100
|
"turndown": "^7.2.2"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "ac5f172e0ff4c087ea040ae29d1f2ea822bcadb6"
|
|
103
103
|
}
|
package/src/components/Graph.js
CHANGED
|
@@ -41,7 +41,7 @@ const DEFAULT_NODE_HEIGHT = 44;
|
|
|
41
41
|
const TRANSLATE_EXTENT_MIN_PADDING = 8000;
|
|
42
42
|
const TRANSLATE_EXTENT_SIZE_MULTIPLIER = 4;
|
|
43
43
|
const DEFAULT_GRAPH_HEIGHT = "640px";
|
|
44
|
-
const EXPANDED_GRAPH_HEIGHT = "
|
|
44
|
+
const EXPANDED_GRAPH_HEIGHT = "100%";
|
|
45
45
|
const DEFAULT_MIN_ZOOM = 0.03;
|
|
46
46
|
const DEFAULT_MAX_ZOOM = 2;
|
|
47
47
|
const FIT_VIEW_PADDING = 0.15;
|
|
@@ -1607,7 +1607,7 @@ const LayoutFlow = ({
|
|
|
1607
1607
|
<GraphControlTooltip
|
|
1608
1608
|
content={formatMessage({
|
|
1609
1609
|
id: "graph.controls.return_normal",
|
|
1610
|
-
defaultMessage: "
|
|
1610
|
+
defaultMessage: "Return to normal view",
|
|
1611
1611
|
})}
|
|
1612
1612
|
>
|
|
1613
1613
|
<ControlButton
|
|
@@ -1615,7 +1615,7 @@ const LayoutFlow = ({
|
|
|
1615
1615
|
onClick={onCloseExpanded}
|
|
1616
1616
|
aria-label={formatMessage({
|
|
1617
1617
|
id: "graph.controls.return_normal",
|
|
1618
|
-
defaultMessage: "
|
|
1618
|
+
defaultMessage: "Return to normal view",
|
|
1619
1619
|
})}
|
|
1620
1620
|
>
|
|
1621
1621
|
<Minimize2 size={20} strokeWidth={2} />
|
|
@@ -1817,9 +1817,16 @@ export const Graph = ({
|
|
|
1817
1817
|
graphOptions,
|
|
1818
1818
|
}) => {
|
|
1819
1819
|
const [expandedOpen, setExpandedOpen] = useState(false);
|
|
1820
|
-
|
|
1821
|
-
const
|
|
1822
|
-
const
|
|
1820
|
+
const expandedTriggerRef = useRef(null);
|
|
1821
|
+
const { formatMessage } = useIntl();
|
|
1822
|
+
const openExpanded = useCallback((event) => {
|
|
1823
|
+
expandedTriggerRef.current = event.currentTarget;
|
|
1824
|
+
setExpandedOpen(true);
|
|
1825
|
+
}, []);
|
|
1826
|
+
const closeExpanded = useCallback(() => {
|
|
1827
|
+
setExpandedOpen(false);
|
|
1828
|
+
expandedTriggerRef.current?.focus();
|
|
1829
|
+
}, []);
|
|
1823
1830
|
|
|
1824
1831
|
return (
|
|
1825
1832
|
<>
|
|
@@ -1843,7 +1850,6 @@ export const Graph = ({
|
|
|
1843
1850
|
<Modal
|
|
1844
1851
|
open={expandedOpen}
|
|
1845
1852
|
onClose={closeExpanded}
|
|
1846
|
-
closeIcon
|
|
1847
1853
|
size="fullscreen"
|
|
1848
1854
|
closeOnDimmerClick
|
|
1849
1855
|
closeOnEscape
|
|
@@ -1866,6 +1872,17 @@ export const Graph = ({
|
|
|
1866
1872
|
className={canvasClassName}
|
|
1867
1873
|
graphOptions={graphOptions}
|
|
1868
1874
|
/>
|
|
1875
|
+
<button
|
|
1876
|
+
className="td-graph-expanded-return"
|
|
1877
|
+
onClick={closeExpanded}
|
|
1878
|
+
type="button"
|
|
1879
|
+
>
|
|
1880
|
+
<Minimize2 size={20} strokeWidth={2} aria-hidden="true" />
|
|
1881
|
+
{formatMessage({
|
|
1882
|
+
id: "graph.controls.return_normal",
|
|
1883
|
+
defaultMessage: "Return to normal view",
|
|
1884
|
+
})}
|
|
1885
|
+
</button>
|
|
1869
1886
|
</Modal.Content>
|
|
1870
1887
|
</Modal>
|
|
1871
1888
|
) : null}
|
|
@@ -153,6 +153,27 @@ describe("<Graph />", () => {
|
|
|
153
153
|
});
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
+
it.each([0, 1])(
|
|
157
|
+
"returns from expanded view using exit %s and restores focus",
|
|
158
|
+
async (index) => {
|
|
159
|
+
render(<Graph {...props} />);
|
|
160
|
+
const trigger = screen.getByLabelText("graph.controls.open_expanded");
|
|
161
|
+
fireEvent.click(trigger);
|
|
162
|
+
const buttons = await screen.findAllByRole("button", {
|
|
163
|
+
name: "Return to normal view",
|
|
164
|
+
});
|
|
165
|
+
expect(buttons).toHaveLength(2);
|
|
166
|
+
expect(document.querySelector(".td-graph-modal > .close")).toBeNull();
|
|
167
|
+
fireEvent.click(buttons[index]);
|
|
168
|
+
await waitFor(() =>
|
|
169
|
+
expect(
|
|
170
|
+
screen.queryByRole("button", { name: "Return to normal view" }),
|
|
171
|
+
).not.toBeInTheDocument(),
|
|
172
|
+
);
|
|
173
|
+
expect(trigger).toHaveFocus();
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
|
|
156
177
|
it("uses horizontal controls by default and keeps vertical controls in fullscreen", async () => {
|
|
157
178
|
render(
|
|
158
179
|
<Graph {...props} graphOptions={{ controlsOrientation: "vertical" }} />,
|
package/src/styles/Graph.less
CHANGED
|
@@ -23,3 +23,63 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
.ui.dimmer > .ui.fullscreen.modal.td-graph-modal--expanded {
|
|
28
|
+
position: fixed;
|
|
29
|
+
inset: 0 !important;
|
|
30
|
+
width: 100% !important;
|
|
31
|
+
max-width: none;
|
|
32
|
+
height: 100dvh;
|
|
33
|
+
margin: 0 !important;
|
|
34
|
+
padding: 0;
|
|
35
|
+
border: 0;
|
|
36
|
+
border-radius: 0;
|
|
37
|
+
|
|
38
|
+
> .content {
|
|
39
|
+
position: relative;
|
|
40
|
+
height: 100%;
|
|
41
|
+
padding: 0 !important;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.td-graph-container {
|
|
47
|
+
height: 100%;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.td-graph-expanded-return {
|
|
52
|
+
position: absolute;
|
|
53
|
+
bottom: max(20px, env(safe-area-inset-bottom));
|
|
54
|
+
left: 50%;
|
|
55
|
+
z-index: 500;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
width: max-content;
|
|
61
|
+
max-width: calc(100% - 32px);
|
|
62
|
+
min-height: 44px;
|
|
63
|
+
padding: 10px 20px;
|
|
64
|
+
transform: translateX(-50%);
|
|
65
|
+
border: 1px solid #d7dde6;
|
|
66
|
+
border-radius: 999px;
|
|
67
|
+
background: #fff;
|
|
68
|
+
color: #334155;
|
|
69
|
+
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.13);
|
|
70
|
+
font: inherit;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
background: #f1f5f9;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:focus-visible {
|
|
78
|
+
outline: 2px solid var(--td-graph-accent, #ed5c17);
|
|
79
|
+
outline-offset: 2px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
svg {
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|