likec4 1.0.0 → 1.0.1

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.
@@ -19750,7 +19750,9 @@ const theme = {
19750
19750
  })
19751
19751
  });
19752
19752
  function RadixTheme({ children: children2 }) {
19753
- const { colorScheme } = useMantineColorScheme(), computedScheme = useComputedColorScheme(), appearance = colorScheme === "auto" ? computedScheme : colorScheme;
19753
+ const { colorScheme } = useMantineColorScheme(), computedScheme = useComputedColorScheme(void 0, {
19754
+ getInitialValueInEffect: !1
19755
+ }), appearance = colorScheme === "auto" ? computedScheme : colorScheme;
19754
19756
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
19755
19757
  Theme,
19756
19758
  {
@@ -19768,7 +19770,7 @@ function RootComponent() {
19768
19770
  MantineProvider,
19769
19771
  {
19770
19772
  ...theme$1 && { forceColorScheme: theme$1 },
19771
- defaultColorScheme: "dark",
19773
+ defaultColorScheme: theme$1 ?? "dark",
19772
19774
  theme,
19773
19775
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(RadixTheme, { children: [
19774
19776
  /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollRestoration, {}),
@@ -36644,7 +36646,7 @@ function Header({ diagram }) {
36644
36646
  /* @__PURE__ */ jsxRuntimeExports.jsx(ColorSchemeToggle, {}),
36645
36647
  /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { orientation: "vertical" }),
36646
36648
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { ml: "xs", size: isTablet ? "sm" : "xs", leftSection: /* @__PURE__ */ jsxRuntimeExports.jsx(IconShare, { size: 14 }), onClick: open, children: "Share" }),
36647
- /* @__PURE__ */ jsxRuntimeExports.jsx(ExportButton, {})
36649
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ExportButton, { diagram })
36648
36650
  ] }),
36649
36651
  /* @__PURE__ */ jsxRuntimeExports.jsx(
36650
36652
  ShareModal,
@@ -36753,10 +36755,27 @@ function ViewPageButton({
36753
36755
  ] })
36754
36756
  ] });
36755
36757
  }
36756
- function ExportButton() {
36758
+ function downloadImage(name, dataUrl) {
36759
+ const a = document.createElement("a");
36760
+ a.setAttribute("download", `${name}.png`), a.setAttribute("href", dataUrl), a.click();
36761
+ }
36762
+ function ExportButton({ diagram }) {
36757
36763
  const params = useParams({
36758
36764
  from: "/view/$viewId"
36759
- });
36765
+ }), onClick = async () => {
36766
+ const { toPng } = await import("./index-CgQjA8pD.js"), imageWidth = diagram.width + 32, imageHeight = diagram.height + 32;
36767
+ toPng(document.querySelector(".react-flow__viewport"), {
36768
+ backgroundColor: "transparent",
36769
+ width: imageWidth,
36770
+ height: imageHeight,
36771
+ cacheBust: !0,
36772
+ style: {
36773
+ width: imageWidth + "px",
36774
+ height: imageHeight + "px",
36775
+ transform: "translate(16px, 16px) scale(1)"
36776
+ }
36777
+ }).then((data) => downloadImage(diagram.id, data));
36778
+ };
36760
36779
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu, { shadow: "md", width: 200, trigger: "click-hover", openDelay: 200, children: [
36761
36780
  /* @__PURE__ */ jsxRuntimeExports.jsx(MenuTarget, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
36762
36781
  Button,
@@ -36771,7 +36790,7 @@ function ExportButton() {
36771
36790
  ) }),
36772
36791
  /* @__PURE__ */ jsxRuntimeExports.jsxs(MenuDropdown, { children: [
36773
36792
  /* @__PURE__ */ jsxRuntimeExports.jsx(MenuLabel, { children: "Current view" }),
36774
- /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { children: "Export as .png" }),
36793
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { onClick, children: "Export as .png" }),
36775
36794
  /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { component: Link$1, to: "/view/$viewId/dot", search: !0, params, children: "Export as .dot" }),
36776
36795
  /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { component: Link$1, to: "/view/$viewId/d2", search: !0, params, children: "Export as .d2" }),
36777
36796
  /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { component: Link$1, to: "/view/$viewId/mmd", search: !0, params, children: "Export as .mmd" }),
@@ -37018,22 +37037,22 @@ const ViewViewIdReactLegacyLazyImport = createFileRoute(
37018
37037
  path: "/react-legacy",
37019
37038
  getParentRoute: () => ViewViewIdRoute
37020
37039
  }).lazy(
37021
- () => import("./view._viewId.react-legacy.lazy-CbH8iz1R.js").then((d2) => d2.Route)
37040
+ () => import("./view._viewId.react-legacy.lazy-Cr471Itv.js").then((d2) => d2.Route)
37022
37041
  ), ViewViewIdMmdLazyRoute = ViewViewIdMmdLazyImport.update({
37023
37042
  path: "/mmd",
37024
37043
  getParentRoute: () => ViewViewIdRoute
37025
37044
  }).lazy(
37026
- () => import("./view._viewId.mmd.lazy-BH_rg5NV.js").then((d2) => d2.Route)
37045
+ () => import("./view._viewId.mmd.lazy-AyTROblc.js").then((d2) => d2.Route)
37027
37046
  ), ViewViewIdDotLazyRoute = ViewViewIdDotLazyImport.update({
37028
37047
  path: "/dot",
37029
37048
  getParentRoute: () => ViewViewIdRoute
37030
37049
  }).lazy(
37031
- () => import("./view._viewId.dot.lazy-KvXSJdzM.js").then((d2) => d2.Route)
37050
+ () => import("./view._viewId.dot.lazy-DDXp1Pjx.js").then((d2) => d2.Route)
37032
37051
  ), ViewViewIdD2LazyRoute = ViewViewIdD2LazyImport.update({
37033
37052
  path: "/d2",
37034
37053
  getParentRoute: () => ViewViewIdRoute
37035
37054
  }).lazy(
37036
- () => import("./view._viewId.d2.lazy-BRVYHRy1.js").then((d2) => d2.Route)
37055
+ () => import("./view._viewId.d2.lazy-D9gktAvw.js").then((d2) => d2.Route)
37037
37056
  ), ViewViewIdEditorRoute = Route2.update({
37038
37057
  path: "/editor",
37039
37058
  getParentRoute: () => ViewViewIdRoute
@@ -1 +1 @@
1
- import "./main-C8jsNnb9.js";
1
+ import "./main-DocCFjZN.js";