likec4 1.43.0 → 1.45.0
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/__app__/src/likec4.js +14888 -15044
- package/__app__/src/main.js +76 -60
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +6656 -27528
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +66 -227
- package/dist/cli/index.mjs +619 -617
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.CuC6o09-.mjs +178 -0
- package/dist/shared/{likec4.CWfMOOnG.mjs → likec4.DH1Cjktk.mjs} +1 -1
- package/dist/shared/likec4.DVpfjKrU.d.mts +4056 -0
- package/dist/shared/{likec4.DvPKV9S-.mjs → likec4.Do3Hp_xd.mjs} +2242 -2249
- package/dist/shared/{likec4.VWjIqhhl.d.mts → likec4.YFH8qb4R.d.mts} +10928 -2512
- package/dist/vite-plugin/index.d.mts +3 -3
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +6 -6
- package/package.json +38 -36
- package/react/index.d.ts +1976 -4334
- package/react/index.js +9480 -5970
- package/dist/shared/likec4.CQWzqezS.d.mts +0 -6808
- package/dist/shared/likec4.DtL27jG4.mjs +0 -548
package/__app__/src/main.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, lazy, Suspense, createContext, useContext, useState, useMemo, memo, useRef, StrictMode } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
|
-
import {
|
|
4
|
+
import { cD as useRouter, cE as isNotFound, cF as Container, bv as Alert, O as Text, cG as Code, P as Button, bc as Group, b8 as rem, bX as Title, cH as Link, cI as useNavigate, bQ as useCallbackRef, cJ as createRootRouteWithContext, cK as stripSearchParams, as as e, cL as Outlet, k as useMantineColorScheme, cM as createFileRoute, cN as useDocumentTitle, b6 as Stack, cO as Loader, cP as useStore, N as ErrorBoundary, cQ as Navigate, d as deepEqual, s as shallowEqual, cR as useParams, v as useIsomorphicLayoutEffect, cS as SimpleGrid, cT as useInViewport, cU as e$1, ce as Card, aI as Box, cV as notFound, a6 as r, bu as useTree, cW as useComputedColorScheme, bw as Tree, aZ as HoverCard, a_ as HoverCardTarget, a$ as HoverCardDropdown, T as ThemeIcon, cX as onMount, r as atom, cd as useLocalStorage, cY as Drawer, bP as ScrollArea, aB as SegmentedControl, at as ActionIcon, ay as Menu, bd as MenuTarget, be as MenuDropdown, bf as MenuItem, aY as CopyButton$1, cZ as Select, c_ as ModalRoot, c$ as ModalOverlay, d0 as ModalContent, d1 as ModalBody, bL as Tabs, bM as TabsList, bN as TabsTab, bO as TabsPanel, d2 as useMatches, d3 as useMantineTheme, d4 as useMediaQuery, d5 as useDisclosure, aC as Divider, b5 as Space, d6 as useParentMatches, d7 as MenuLabel, G as t, $ as t$1, a2 as t$2, a1 as e$2, a0 as t$3, a3 as t$4, z as t$5, a4 as n, g as t$6, a9 as dagre, aa as t$7, ab as t$8, d8 as useSearch, aL as useDebouncedCallback, d9 as LoadingOverlay, da as toBlob, aw as Tooltip, db as useAsync, dc as PanelGroup, dd as Panel, de as PanelResizeHandle, df as Burger, dg as RouterProvider, dh as createRouter$1, di as createHashHistory, dj as createBrowserHistory, dk as createTheme, b2 as Portal, A as MantineProvider } from "./vendors.js";
|
|
5
5
|
import { projects } from "likec4:projects";
|
|
6
|
-
import { c as css, L as LikeC4ProjectsProvider, u as useLikeC4Projects, I as IconRendererProvider, a as LikeC4ModelProvider,
|
|
6
|
+
import { c as css, L as LikeC4ProjectsProvider, u as useLikeC4Projects, I as IconRendererProvider, a as LikeC4ModelProvider, b as useUpdateEffect, S as StaticLikeC4Diagram, M as Markdown, B as Box$1, d as useLikeC4Model$1, e as IconStarFilled, f as IconStack2, g as IconLayoutDashboard, h as IconFileCode, i as IconFolderOpen, j as IconFolderFilled, k as IconArrowLeft, l as IconMoonStars, m as IconSun, n as IconChevronDown, o as IconAlertTriangle, p as IconCheck, q as IconCopy, r as IconExternalLink, s as IconShare, t as pickViewBounds, v as LikeC4Diagram, w as useDiagramContext } from "./likec4.js";
|
|
7
7
|
import { pageTitle, ComponentName, useHashHistory, withOverviewGraph, krokiPumlSvgUrl, isDevelopment, krokiD2SvgUrl, basepath } from "./const.js";
|
|
8
8
|
import { loadModel } from "likec4:model";
|
|
9
|
+
import { RichText } from "@likec4/core/types";
|
|
10
|
+
import { nonexhaustive, compareNatural, toArray, sortParentsFirst, invariant, DefaultMap, isDescendantOf, isAncestor, nonNullable } from "@likec4/core/utils";
|
|
11
|
+
import { exact } from "@likec4/core";
|
|
12
|
+
import { computeRelationshipsView } from "@likec4/core/compute-view/relationships";
|
|
9
13
|
function Fallback$1({ error, resetErrorBoundary }) {
|
|
10
14
|
const router = useRouter();
|
|
11
15
|
return isNotFound(error) ? /* @__PURE__ */ jsx(Container, { my: "md", children: /* @__PURE__ */ jsxs(Alert, { variant: "light", color: "orange", children: [
|
|
@@ -182,15 +186,15 @@ function LikeC4IconRendererContext({ children, projectId }) {
|
|
|
182
186
|
const IconRenderer = _renderers[projectId] ??= (props) => /* @__PURE__ */ jsx(ProjectIconRenderer, { ...props, projectId });
|
|
183
187
|
return /* @__PURE__ */ jsx(IconRendererProvider, { value: IconRenderer, children });
|
|
184
188
|
}
|
|
185
|
-
const LikeC4ModelDataContext = createContext(null), LikeC4ModelDataContextProvider = LikeC4ModelDataContext.Provider,
|
|
189
|
+
const LikeC4ModelDataContext = createContext(null), LikeC4ModelDataContextProvider = LikeC4ModelDataContext.Provider, useLikeC4ModelAtom = () => {
|
|
186
190
|
const ctx = useContext(LikeC4ModelDataContext);
|
|
187
191
|
if (ctx === null)
|
|
188
|
-
throw new Error("
|
|
192
|
+
throw new Error("LikeC4ModelAtom is not provided");
|
|
189
193
|
return ctx;
|
|
190
194
|
};
|
|
191
195
|
function LikeC4ModelContext({ likec4data, likec4model, children }) {
|
|
192
196
|
const model = useStore(likec4model);
|
|
193
|
-
return /* @__PURE__ */ jsx(LikeC4ModelDataContextProvider, { value:
|
|
197
|
+
return /* @__PURE__ */ jsx(LikeC4ModelDataContextProvider, { value: likec4model, children: /* @__PURE__ */ jsx(LikeC4ModelProvider, { likec4model: model, children }) });
|
|
194
198
|
}
|
|
195
199
|
css({
|
|
196
200
|
position: "absolute",
|
|
@@ -278,13 +282,16 @@ function useTransparentBackground(enabled = !0) {
|
|
|
278
282
|
}, [enabled]);
|
|
279
283
|
}
|
|
280
284
|
function useLikeC4Views() {
|
|
281
|
-
const $
|
|
282
|
-
return useEffect(() => $
|
|
285
|
+
const $likec4model = useLikeC4ModelAtom(), [views, setViews] = useState([]);
|
|
286
|
+
return useEffect(() => $likec4model.subscribe((next) => {
|
|
283
287
|
setViews((prev) => {
|
|
284
|
-
const nextViews =
|
|
288
|
+
const nextViews = [...next.views()].map((v) => {
|
|
289
|
+
const n2 = v.$layouted, p = prev.find((_) => _.id === v.id);
|
|
290
|
+
return p && deepEqual(n2, p) ? p : n2;
|
|
291
|
+
});
|
|
285
292
|
return shallowEqual(prev, nextViews) ? prev : nextViews;
|
|
286
293
|
});
|
|
287
|
-
}), [$
|
|
294
|
+
}), [$likec4model]), views;
|
|
288
295
|
}
|
|
289
296
|
function useCurrentViewId() {
|
|
290
297
|
return useParams({
|
|
@@ -292,9 +299,18 @@ function useCurrentViewId() {
|
|
|
292
299
|
strict: !1
|
|
293
300
|
});
|
|
294
301
|
}
|
|
295
|
-
function
|
|
296
|
-
const viewId = useCurrentViewId();
|
|
297
|
-
|
|
302
|
+
function useCurrentView() {
|
|
303
|
+
const viewId = useCurrentViewId(), $likec4model = useLikeC4ModelAtom(), [layoutType, setLayoutType] = useState("manual");
|
|
304
|
+
useUpdateEffect(() => {
|
|
305
|
+
setLayoutType("manual");
|
|
306
|
+
}, [viewId]);
|
|
307
|
+
const [view, setView] = useState($likec4model.value?.findView(viewId)?.$layouted ?? null);
|
|
308
|
+
return useEffect(() => $likec4model.subscribe((next) => {
|
|
309
|
+
setView((current) => {
|
|
310
|
+
const vm = next.findView(viewId), nextView = (layoutType === "manual" ? vm?.$layouted : vm?.$view) ?? null;
|
|
311
|
+
return deepEqual(current, nextView) ? current : nextView;
|
|
312
|
+
});
|
|
313
|
+
}), [$likec4model, viewId, layoutType]), [view, setLayoutType];
|
|
298
314
|
}
|
|
299
315
|
function useCurrentProject() {
|
|
300
316
|
const projects2 = useLikeC4Projects(), projectId = useParams({
|
|
@@ -381,15 +397,15 @@ function ViewCard({ view }) {
|
|
|
381
397
|
value: RichText.from(view.description),
|
|
382
398
|
textScale: 0.75,
|
|
383
399
|
emptyText: "No description",
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
400
|
+
className: css({
|
|
401
|
+
lineClamp: 3,
|
|
402
|
+
mt: "1",
|
|
387
403
|
transition: "fast",
|
|
388
404
|
opacity: {
|
|
389
405
|
base: 0.8,
|
|
390
406
|
_groupHover: 1
|
|
391
407
|
}
|
|
392
|
-
}
|
|
408
|
+
})
|
|
393
409
|
}
|
|
394
410
|
),
|
|
395
411
|
/* @__PURE__ */ jsx(Link, { to: "/view/$viewId/", params: { viewId: view.id }, search: !0, className: cardLink })
|
|
@@ -576,7 +592,7 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
|
|
|
576
592
|
viewId: viewId2
|
|
577
593
|
})
|
|
578
594
|
});
|
|
579
|
-
}, diagram =
|
|
595
|
+
}, [diagram] = useCurrentView(), viewId = diagram?.id ?? null, tree = useTree({
|
|
580
596
|
multiple: !1
|
|
581
597
|
});
|
|
582
598
|
tree.setHoveredNode = setHoveredNode;
|
|
@@ -774,15 +790,17 @@ function ColorSchemeToggle() {
|
|
|
774
790
|
);
|
|
775
791
|
}
|
|
776
792
|
const cssHeader = css({
|
|
793
|
+
top: "4",
|
|
794
|
+
right: "4",
|
|
777
795
|
position: "absolute",
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
backgroundColor: "mantine.colors.dark[6]/60"
|
|
781
|
-
},
|
|
796
|
+
layerStyle: "likec4.panel",
|
|
797
|
+
rounded: "md",
|
|
782
798
|
'#likec4-root:has([data-likec4-diagram-panning="true"]) &': {
|
|
783
799
|
boxShadow: "none",
|
|
784
|
-
|
|
785
|
-
|
|
800
|
+
rounded: "0"
|
|
801
|
+
},
|
|
802
|
+
_print: {
|
|
803
|
+
display: "none"
|
|
786
804
|
}
|
|
787
805
|
});
|
|
788
806
|
function SelectProject() {
|
|
@@ -967,7 +985,7 @@ function WebcomponentsPanel({ diagram }) {
|
|
|
967
985
|
function ShareModal({
|
|
968
986
|
onClose
|
|
969
987
|
}) {
|
|
970
|
-
const diagram =
|
|
988
|
+
const [diagram] = useCurrentView(), [activeTab, setActiveTab] = useState("webcomponent");
|
|
971
989
|
return diagram ? /* @__PURE__ */ jsxs(
|
|
972
990
|
ModalRoot,
|
|
973
991
|
{
|
|
@@ -1000,14 +1018,9 @@ const Header = memo(() => {
|
|
|
1000
1018
|
}
|
|
1001
1019
|
}), { breakpoints } = useMantineTheme(), isTablet = useMediaQuery(`(min-width: ${breakpoints.md})`) ?? !1, [opened, { open, close }] = useDisclosure(!1);
|
|
1002
1020
|
return /* @__PURE__ */ jsxs(
|
|
1003
|
-
|
|
1021
|
+
Box$1,
|
|
1004
1022
|
{
|
|
1005
1023
|
className: cssHeader,
|
|
1006
|
-
top: "0.5rem",
|
|
1007
|
-
right: "0.5rem",
|
|
1008
|
-
p: 4,
|
|
1009
|
-
radius: "sm",
|
|
1010
|
-
shadow: "lg",
|
|
1011
1024
|
children: [
|
|
1012
1025
|
/* @__PURE__ */ jsxs(Group, { gap: isTablet ? 6 : 4, wrap: "nowrap", children: [
|
|
1013
1026
|
isReactDiagramRoute ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1297,11 +1310,11 @@ function applyDagreLayout(g) {
|
|
|
1297
1310
|
}
|
|
1298
1311
|
function layoutRelationshipsView(data) {
|
|
1299
1312
|
const g = createGraph(), incomers = createNodes("in", data.incomers, g), subjects = createNodes("subject", data.subjects, g), outgoers = createNodes("out", data.outgoers, g), edges = [];
|
|
1300
|
-
t
|
|
1301
|
-
t$
|
|
1302
|
-
t
|
|
1313
|
+
t(
|
|
1314
|
+
t$4(
|
|
1315
|
+
t(
|
|
1303
1316
|
toArray(data.incoming),
|
|
1304
|
-
t$
|
|
1317
|
+
t$2((r2) => ({
|
|
1305
1318
|
id: r2.source.id,
|
|
1306
1319
|
source: incomers.byId(r2.source.id).graph,
|
|
1307
1320
|
target: subjects.byId(r2.target.id).graph,
|
|
@@ -1310,9 +1323,9 @@ function layoutRelationshipsView(data) {
|
|
|
1310
1323
|
// Sort by source
|
|
1311
1324
|
sortParentsFirst
|
|
1312
1325
|
),
|
|
1313
|
-
t
|
|
1326
|
+
t(
|
|
1314
1327
|
toArray(data.outgoing),
|
|
1315
|
-
t$
|
|
1328
|
+
t$2((r2) => ({
|
|
1316
1329
|
id: r2.target.id,
|
|
1317
1330
|
source: subjects.byId(r2.source.id).graph,
|
|
1318
1331
|
target: outgoers.byId(r2.target.id).graph,
|
|
@@ -1322,13 +1335,13 @@ function layoutRelationshipsView(data) {
|
|
|
1322
1335
|
sortParentsFirst
|
|
1323
1336
|
)
|
|
1324
1337
|
),
|
|
1325
|
-
t$
|
|
1338
|
+
t$2((r2) => ({
|
|
1326
1339
|
...r2,
|
|
1327
1340
|
expr: `${r2.source.id}->${r2.target.id}`
|
|
1328
1341
|
})),
|
|
1329
1342
|
// Group if same source and target
|
|
1330
|
-
t$
|
|
1331
|
-
t$
|
|
1343
|
+
t$3(e$2("expr")),
|
|
1344
|
+
t$1((grouped) => {
|
|
1332
1345
|
const source = grouped[0].source, target = grouped[0].target, name = grouped[0].expr;
|
|
1333
1346
|
g.node(source.id).outPorts.push(target.id), g.node(target.id).inPorts.push(source.id), g.setEdge(source.portId, target.portId, {
|
|
1334
1347
|
...Sizes.edgeLabel
|
|
@@ -1336,7 +1349,7 @@ function layoutRelationshipsView(data) {
|
|
|
1336
1349
|
name,
|
|
1337
1350
|
source: source.id,
|
|
1338
1351
|
target: target.id,
|
|
1339
|
-
relations: t$
|
|
1352
|
+
relations: t$2(grouped, e$2("relation"))
|
|
1340
1353
|
});
|
|
1341
1354
|
})
|
|
1342
1355
|
);
|
|
@@ -1351,21 +1364,21 @@ function layoutRelationshipsView(data) {
|
|
|
1351
1364
|
...incomers.graphNodes.values(),
|
|
1352
1365
|
...subjects.graphNodes.values(),
|
|
1353
1366
|
...outgoers.graphNodes.values()
|
|
1354
|
-
], _calculatedNodeBounds = t
|
|
1367
|
+
], _calculatedNodeBounds = t(
|
|
1355
1368
|
nodeIds,
|
|
1356
1369
|
// Compound nodes have different portId
|
|
1357
1370
|
n((n2) => n2.id === n2.portId),
|
|
1358
|
-
t$
|
|
1371
|
+
t$5((n2) => [n2.id, dagreBounds(n2.id)])
|
|
1359
1372
|
);
|
|
1360
1373
|
function nodeBounds(nodeId) {
|
|
1361
|
-
return _calculatedNodeBounds[nodeId] ??= t
|
|
1374
|
+
return _calculatedNodeBounds[nodeId] ??= t(
|
|
1362
1375
|
g.children(nodeId) ?? [],
|
|
1363
1376
|
n((id) => !id.endsWith(PortSuffix)),
|
|
1364
|
-
t$
|
|
1365
|
-
t$
|
|
1377
|
+
t$2((id) => nodeBounds(id)),
|
|
1378
|
+
t$8((bounds) => {
|
|
1366
1379
|
invariant(bounds.length > 0, `Node ${nodeId} has no nested nodes`);
|
|
1367
1380
|
}),
|
|
1368
|
-
t$
|
|
1381
|
+
t$7((acc, bounds) => ({
|
|
1369
1382
|
minY: Math.min(acc.minY, bounds.position.y),
|
|
1370
1383
|
maxY: Math.max(acc.maxY, bounds.position.y + bounds.height)
|
|
1371
1384
|
}), { minY: 1 / 0, maxY: -1 / 0 }),
|
|
@@ -1444,7 +1457,7 @@ function layoutRelationshipsView(data) {
|
|
|
1444
1457
|
const edge = g.edge(e2), ename = e2.name;
|
|
1445
1458
|
invariant(ename, "Edge has no name");
|
|
1446
1459
|
const { name, source, target, relations } = r(edges, (e22) => e22.name === ename), points = edge.points.map((p) => [p.x, p.y]);
|
|
1447
|
-
return invariant(t$
|
|
1460
|
+
return invariant(t$6(points, 1), `Edge ${name} has less than 2 points`), {
|
|
1448
1461
|
id: name,
|
|
1449
1462
|
source,
|
|
1450
1463
|
target,
|
|
@@ -1506,7 +1519,7 @@ function ExportPage() {
|
|
|
1506
1519
|
dynamic
|
|
1507
1520
|
} = useSearch({
|
|
1508
1521
|
strict: !1
|
|
1509
|
-
}), diagram =
|
|
1522
|
+
}), [diagram] = useCurrentView(), viewportRef = useRef(null), loadingOverlayRef = useRef(null), downloadedRef = useRef(!1);
|
|
1510
1523
|
useTransparentBackground();
|
|
1511
1524
|
const downloadDiagram = useDebouncedCallback(
|
|
1512
1525
|
() => {
|
|
@@ -1524,7 +1537,7 @@ function ExportPage() {
|
|
|
1524
1537
|
);
|
|
1525
1538
|
if (!diagram)
|
|
1526
1539
|
return /* @__PURE__ */ jsx("div", { children: "Loading..." });
|
|
1527
|
-
const bounds =
|
|
1540
|
+
const bounds = pickViewBounds(diagram, dynamic), extraPadding = 16, width = bounds.width + padding * 2 + extraPadding, height = bounds.height + padding * 2 + extraPadding;
|
|
1528
1541
|
return /* @__PURE__ */ jsxs(
|
|
1529
1542
|
Box$1,
|
|
1530
1543
|
{
|
|
@@ -1584,8 +1597,9 @@ function ExportPage() {
|
|
|
1584
1597
|
console.error("viewportRef.current is null");
|
|
1585
1598
|
return;
|
|
1586
1599
|
}
|
|
1600
|
+
const x = Math.round(-bounds.x + padding), y = Math.round(-bounds.y + padding);
|
|
1587
1601
|
[...viewportRef.current.querySelectorAll(".react-flow__viewport")].forEach((el) => {
|
|
1588
|
-
el.style.transform = "translate(" +
|
|
1602
|
+
el.style.transform = "translate(" + x + "px, " + y + "px)";
|
|
1589
1603
|
}), download && downloadDiagram();
|
|
1590
1604
|
}
|
|
1591
1605
|
}
|
|
@@ -1611,10 +1625,10 @@ function EmbedPage() {
|
|
|
1611
1625
|
dynamic
|
|
1612
1626
|
} = useSearch({
|
|
1613
1627
|
strict: !1
|
|
1614
|
-
}), diagram =
|
|
1628
|
+
}), [diagram] = useCurrentView();
|
|
1615
1629
|
if (useTransparentBackground(!!diagram), !diagram)
|
|
1616
1630
|
return /* @__PURE__ */ jsx("div", { children: "Loading..." });
|
|
1617
|
-
const bounds =
|
|
1631
|
+
const bounds = pickViewBounds(diagram, dynamic);
|
|
1618
1632
|
return /* @__PURE__ */ jsx(
|
|
1619
1633
|
"div",
|
|
1620
1634
|
{
|
|
@@ -1650,7 +1664,7 @@ const Route$b = createFileRoute("/_single/embed/$viewId")({
|
|
|
1650
1664
|
component: EmbedPage
|
|
1651
1665
|
});
|
|
1652
1666
|
function ViewReact() {
|
|
1653
|
-
const navigate = useNavigate(), view =
|
|
1667
|
+
const navigate = useNavigate(), [view, setLayoutType] = useCurrentView(), model = useLikeC4Model$1(), { dynamic } = useSearch({
|
|
1654
1668
|
from: "__root__"
|
|
1655
1669
|
}), onNavigateTo = useCallbackRef((viewId) => {
|
|
1656
1670
|
navigate({
|
|
@@ -1689,11 +1703,12 @@ function ViewReact() {
|
|
|
1689
1703
|
enableRelationshipDetails: !0,
|
|
1690
1704
|
enableRelationshipBrowser: !0,
|
|
1691
1705
|
enableElementTags: !0,
|
|
1692
|
-
|
|
1706
|
+
enableCompareWithLatest: !0,
|
|
1693
1707
|
enableNotations: hasNotations,
|
|
1694
1708
|
nodesDraggable: !1,
|
|
1695
1709
|
nodesSelectable: !0,
|
|
1696
1710
|
onNavigateTo,
|
|
1711
|
+
onLayoutTypeChange: setLayoutType,
|
|
1697
1712
|
onBurgerMenuClick: () => {
|
|
1698
1713
|
navigate({
|
|
1699
1714
|
to: "/"
|
|
@@ -1920,16 +1935,16 @@ function ViewAsMmd() {
|
|
|
1920
1935
|
] });
|
|
1921
1936
|
}
|
|
1922
1937
|
function ViewEditor() {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1925
|
-
to: "
|
|
1938
|
+
const navigate = useNavigate(), [view, setLayoutType] = useCurrentView(), onNavigateTo = useCallbackRef((viewId) => {
|
|
1939
|
+
navigate({
|
|
1940
|
+
to: "./",
|
|
1941
|
+
viewTransition: !1,
|
|
1926
1942
|
params: (current) => ({
|
|
1927
1943
|
...current,
|
|
1928
1944
|
viewId
|
|
1929
1945
|
}),
|
|
1930
1946
|
search: !0
|
|
1931
1947
|
});
|
|
1932
|
-
router.commitLocation(loc);
|
|
1933
1948
|
});
|
|
1934
1949
|
if (!view)
|
|
1935
1950
|
return /* @__PURE__ */ jsx(NotFound, {});
|
|
@@ -1943,7 +1958,6 @@ function ViewEditor() {
|
|
|
1943
1958
|
pannable: !0,
|
|
1944
1959
|
controls: !0,
|
|
1945
1960
|
nodesDraggable: !0,
|
|
1946
|
-
experimentalEdgeEditing: !0,
|
|
1947
1961
|
fitViewPadding: {
|
|
1948
1962
|
top: "70px",
|
|
1949
1963
|
bottom: "32px",
|
|
@@ -1959,10 +1973,12 @@ function ViewEditor() {
|
|
|
1959
1973
|
enableRelationshipDetails: !0,
|
|
1960
1974
|
enableRelationshipBrowser: !0,
|
|
1961
1975
|
enableElementTags: !0,
|
|
1976
|
+
enableCompareWithLatest: !0,
|
|
1962
1977
|
onNavigateTo,
|
|
1978
|
+
onLayoutTypeChange: setLayoutType,
|
|
1963
1979
|
onChange: (e2) => console.log(e2),
|
|
1964
1980
|
onBurgerMenuClick: () => {
|
|
1965
|
-
|
|
1981
|
+
navigate({
|
|
1966
1982
|
to: "/"
|
|
1967
1983
|
});
|
|
1968
1984
|
}
|