likec4 0.53.0 → 0.56.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/dist/@likec4/core/errors/index.js +4 -19
- package/dist/@likec4/diagrams/components/FullscreenDiagramBrowser.js +1 -1
- package/dist/@likec4/diagrams/components/primitives/fullscreen/FullscreenDiagram.js +1 -1
- package/dist/@likec4/diagrams/components/primitives/responsive/ResponsiveDiagram.js +1 -1
- package/dist/@likec4/diagrams/diagram/Diagram.js +1 -1
- package/dist/@likec4/diagrams/diagram/nodes/NodeLinkBtn.js +1 -1
- package/dist/@likec4/diagrams/diagram/nodes/NodeZoomBtn.js +1 -1
- package/dist/@likec4/diagrams/hooks/useImageLoader.js +1 -1
- package/dist/@likec4/diagrams/hooks/usePrefersLightMode.js +1 -1
- package/dist/__app__/src/components/ThemePanelToggle.jsx +1 -1
- package/dist/__app__/src/components/sidebar/Sidebar.jsx +1 -1
- package/dist/__app__/src/components/view-page/ExportDiagram.jsx +1 -1
- package/dist/__app__/src/pages/embed.page.jsx +1 -1
- package/dist/__app__/src/pages/export.page.jsx +1 -1
- package/dist/__app__/src/pages/index-page/index.jsx +1 -1
- package/dist/__app__/src/pages/useTransparentBackground.js +1 -1
- package/dist/__app__/src/pages/view-page/ViewAsReact.jsx +1 -1
- package/dist/__app__/src/pages/view-page/other-formats/ViewAsD2.jsx +1 -1
- package/dist/__app__/src/pages/view-page/other-formats/ViewAsMmd.jsx +1 -1
- package/dist/cli/index.js +227 -227
- package/package.json +21 -21
|
@@ -44,28 +44,13 @@ export class RelationRefError extends BaseError {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export function normalizeError(e) {
|
|
47
|
-
if (e instanceof BaseError) {
|
|
47
|
+
if (e instanceof BaseError || e instanceof Error) {
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
|
-
if (e instanceof Error) {
|
|
51
|
-
return new UnknownError(e.message, { cause: e });
|
|
52
|
-
}
|
|
53
|
-
if (e === null || e === void 0) {
|
|
54
|
-
return new UnknownError("Undefined error");
|
|
55
|
-
}
|
|
56
50
|
const message = isString(e) ? e : stringify(e);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const error = normalizeError(e);
|
|
61
|
-
return {
|
|
62
|
-
name: error.name,
|
|
63
|
-
message: error.stack ? error.stack : `${error.name}: ${error.message}`,
|
|
64
|
-
error
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export function throwNormalizedError(e) {
|
|
68
|
-
throw normalizeError(e);
|
|
51
|
+
const error = new UnknownError(message);
|
|
52
|
+
Error.captureStackTrace(error, normalizeError);
|
|
53
|
+
return error;
|
|
69
54
|
}
|
|
70
55
|
export function invariant(condition, message) {
|
|
71
56
|
if (condition) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { invariant } from "@likec4/core";
|
|
3
|
-
import { useSyncedRef } from "@react-hookz/web
|
|
3
|
+
import { useSyncedRef } from "@react-hookz/web";
|
|
4
4
|
import { useCallback } from "react";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
6
6
|
import { useViewIdFromHash } from "../hooks/useViewIdFromHash.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { invariant } from "@likec4/core";
|
|
3
|
-
import { useKeyboardEvent, useMeasure } from "@react-hookz/web
|
|
3
|
+
import { useKeyboardEvent, useMeasure } from "@react-hookz/web";
|
|
4
4
|
import { disableBodyScroll, enableBodyScroll } from "body-scroll-lock-upgrade";
|
|
5
5
|
import { useEffect, useRef } from "react";
|
|
6
6
|
import { Diagram } from "../../../diagram/Diagram.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMeasure } from "@react-hookz/web
|
|
2
|
+
import { useMeasure } from "@react-hookz/web";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { Diagram } from "../../../diagram/index.js";
|
|
5
5
|
export const ResponsiveDiagram = /* @__PURE__ */ forwardRef(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { nonNullable, defaultTheme as theme } from "@likec4/core";
|
|
3
|
-
import { useHookableRef, useUpdateEffect } from "@react-hookz/web
|
|
3
|
+
import { useHookableRef, useUpdateEffect } from "@react-hookz/web";
|
|
4
4
|
import { useSpring } from "@react-spring/konva";
|
|
5
5
|
import { clamp, isNil } from "rambdax";
|
|
6
6
|
import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { invariant } from "@likec4/core";
|
|
3
3
|
import { isEqualSimple } from "@react-hookz/deep-equal/esnext";
|
|
4
|
-
import { useToggle } from "@react-hookz/web
|
|
4
|
+
import { useToggle } from "@react-hookz/web";
|
|
5
5
|
import { useSpring } from "@react-spring/konva";
|
|
6
6
|
import { mix, toHex } from "khroma";
|
|
7
7
|
import { memo } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { isEqualSimple } from "@react-hookz/deep-equal/esnext";
|
|
3
|
-
import { useToggle } from "@react-hookz/web
|
|
3
|
+
import { useToggle } from "@react-hookz/web";
|
|
4
4
|
import { useSpring } from "@react-spring/konva";
|
|
5
5
|
import { lighten, mix, toHex } from "khroma";
|
|
6
6
|
import { memo } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
-
import { useIsMounted } from "@react-hookz/web
|
|
2
|
+
import { useIsMounted } from "@react-hookz/web";
|
|
3
3
|
import { invariant } from "@likec4/core";
|
|
4
4
|
const imageElements = /* @__PURE__ */ new Map();
|
|
5
5
|
export default function useImageLoader(url, crossOrigin, referrerpolicy) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MoonIcon } from '@radix-ui/react-icons';
|
|
2
2
|
import { IconButton, ThemePanel } from '@radix-ui/themes';
|
|
3
|
-
import { useToggle } from '@react-hookz/web
|
|
3
|
+
import { useToggle } from '@react-hookz/web';
|
|
4
4
|
export const ThemePanelToggle = import.meta.env.PROD
|
|
5
5
|
? () => null
|
|
6
6
|
: () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Button, Flex, IconButton, ScrollArea, Separator } from '@radix-ui/themes';
|
|
2
|
-
import { useClickOutside, useToggle } from '@react-hookz/web
|
|
2
|
+
import { useClickOutside, useToggle } from '@react-hookz/web';
|
|
3
3
|
import { HamburgerMenuIcon, ArrowLeftIcon } from '@radix-ui/react-icons';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { cn } from '../../utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Diagram, useDiagramApi } from '@likec4/diagrams';
|
|
2
2
|
import { Box, Portal } from '@radix-ui/themes';
|
|
3
|
-
import { useDebouncedEffect } from '@react-hookz/web
|
|
3
|
+
import { useDebouncedEffect } from '@react-hookz/web';
|
|
4
4
|
import { memo, useRef } from 'react';
|
|
5
5
|
function downloadBlob(blob, name) {
|
|
6
6
|
// Convert your blob into a Blob URL (a special url that points to an object in the browser's memory)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Diagram } from '@likec4/diagrams';
|
|
2
|
-
import { useWindowSize } from '@react-hookz/web
|
|
2
|
+
import { useWindowSize } from '@react-hookz/web';
|
|
3
3
|
import { DiagramNotFound } from '../components';
|
|
4
4
|
import { useLikeC4View } from '../data';
|
|
5
5
|
import { useTransparentBackground } from './useTransparentBackground';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Diagram } from '@likec4/diagrams';
|
|
2
|
-
import { useWindowSize } from '@react-hookz/web
|
|
2
|
+
import { useWindowSize } from '@react-hookz/web';
|
|
3
3
|
import { DiagramNotFound } from '../components';
|
|
4
4
|
import { useLikeC4View } from '../data';
|
|
5
5
|
import { useTransparentBackground } from './useTransparentBackground';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Diagram } from '@likec4/diagrams';
|
|
2
2
|
import { Box, Card, Container, Flex, Heading, IconButton, Inset, Section, Separator, Text } from '@radix-ui/themes';
|
|
3
|
-
import { useDebouncedEffect } from '@react-hookz/web
|
|
3
|
+
import { useDebouncedEffect } from '@react-hookz/web';
|
|
4
4
|
import { useAtomValue } from 'jotai';
|
|
5
5
|
import { memo, useState } from 'react';
|
|
6
6
|
import { isEmpty } from 'remeda';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useIsomorphicLayoutEffect } from '@react-hookz/web
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@react-hookz/web';
|
|
2
2
|
// To get the transparent background
|
|
3
3
|
// We need to add a class to the HTML element
|
|
4
4
|
export function useTransparentBackground(enabled = true) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Diagram, useDiagramApi } from '@likec4/diagrams';
|
|
2
2
|
import { Box } from '@radix-ui/themes';
|
|
3
|
-
import { useWindowSize } from '@react-hookz/web
|
|
3
|
+
import { useWindowSize } from '@react-hookz/web';
|
|
4
4
|
import { useCallback, useEffect, useRef } from 'react';
|
|
5
5
|
import { $pages } from '../../router';
|
|
6
6
|
import { cn } from '../../utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Button, Code, ScrollArea } from '@radix-ui/themes';
|
|
2
|
-
import { useAsync } from '@react-hookz/web
|
|
2
|
+
import { useAsync } from '@react-hookz/web';
|
|
3
3
|
import { d2Source } from 'virtual:likec4/d2-sources';
|
|
4
4
|
import { CopyToClipboard } from '../../../components';
|
|
5
5
|
import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Code, ScrollArea } from '@radix-ui/themes';
|
|
2
|
-
import { useAsync } from '@react-hookz/web
|
|
2
|
+
import { useAsync } from '@react-hookz/web';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { mmdSource } from 'virtual:likec4/mmd-sources';
|
|
5
5
|
import { CopyToClipboard } from '../../../components';
|