likec4 1.17.1 → 1.18.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/__app__ → __app__}/react/likec4.tsx +9 -26
- package/{dist/__app__/src/chunks/-index-overview-DrCqsLHx.js → __app__/src/chunks/-index-overview-CBnvpD1d.js} +4 -4
- package/{dist/__app__/src/chunks/likec4-DF_Jsv_p.js → __app__/src/chunks/likec4-DslTxitT.js} +14 -14
- package/{dist/__app__/src/chunks/main-E2hyQKFO.js → __app__/src/chunks/main-ByUdz_Be.js} +14153 -13715
- package/{dist/__app__/src/chunks/mantine-BzD51ZKm.js → __app__/src/chunks/mantine-oFa3ZrEq.js} +427 -253
- package/{dist/__app__/src/chunks/tanstack-router-CF1kJvtP.js → __app__/src/chunks/tanstack-router-BWjXKr0n.js} +1 -1
- package/{dist/__app__ → __app__}/src/main.js +1 -1
- package/{dist/__app__ → __app__}/src/style.css +1 -1
- package/{dist/__app__ → __app__}/webcomponent/webcomponent.js +30811 -30120
- package/dist/chunks/prompt.mjs +3 -3
- package/dist/cli/index.mjs +210 -179
- package/dist/index.d.mts +1693 -742
- package/dist/index.d.ts +1693 -742
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.lgHXhASw.mjs +1832 -0
- package/package.json +25 -26
- package/react/index.d.ts +891 -423
- package/react/index.mjs +32737 -31318
- package/react/style.css +1 -1
- package/dist/shared/likec4.BkLj38-D.mjs +0 -1824
- /package/{dist/__app__ → __app__}/favicon.ico +0 -0
- /package/{dist/__app__ → __app__}/favicon.svg +0 -0
- /package/{dist/__app__ → __app__}/index.html +0 -0
- /package/{dist/__app__ → __app__}/robots.txt +0 -0
- /package/{dist/__app__ → __app__}/src/chunks/-view-lazy-data-WZmbIsHq.js +0 -0
- /package/{dist/__app__ → __app__}/src/chunks/index-CIsxIzOH.js +0 -0
- /package/{dist/__app__ → __app__}/src/const.js +0 -0
- /package/{dist/__app__ → __app__}/src/icons.js +0 -0
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
type LikeC4ViewProps as BaseLikeC4ViewProps,
|
|
7
7
|
ReactLikeC4 as GenericReactLikeC4,
|
|
8
8
|
type ReactLikeC4Props as GenericReactLikeC4Props,
|
|
9
|
-
useColorScheme
|
|
9
|
+
useColorScheme,
|
|
10
|
+
ViewNotFound
|
|
10
11
|
} from 'likec4/react'
|
|
11
12
|
import { memo, type PropsWithChildren, useCallback, useState } from 'react'
|
|
12
13
|
import { Icons } from 'virtual:likec4/icons'
|
|
13
14
|
import type { DiagramView, LikeC4ElementKind, LikeC4Tag, LikeC4ViewId } from 'virtual:likec4/model'
|
|
14
|
-
import {
|
|
15
|
+
import { likeC4Model, LikeC4Views, useLikeC4Model } from 'virtual:likec4/model'
|
|
15
16
|
|
|
16
17
|
type IconRendererProps = {
|
|
17
18
|
node: {
|
|
@@ -28,10 +29,10 @@ export function RenderIcon({ node }: IconRendererProps) {
|
|
|
28
29
|
|
|
29
30
|
export { likeC4Model, LikeC4Views, useLikeC4Model }
|
|
30
31
|
|
|
31
|
-
export const useLikeC4ViewModel = (viewId: LikeC4ViewId): LikeC4Model.
|
|
32
|
-
useLikeC4Model().view(viewId)
|
|
32
|
+
export const useLikeC4ViewModel = (viewId: LikeC4ViewId): LikeC4Model.View => useLikeC4Model().view(viewId as any)
|
|
33
33
|
|
|
34
|
-
export const useLikeC4View = (viewId: LikeC4ViewId): DiagramView =>
|
|
34
|
+
export const useLikeC4View = (viewId: LikeC4ViewId): DiagramView =>
|
|
35
|
+
useLikeC4Model().view(viewId as any).$view as DiagramView
|
|
35
36
|
|
|
36
37
|
export type LikeC4ViewProps = BaseLikeC4ViewProps<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>
|
|
37
38
|
|
|
@@ -43,24 +44,6 @@ export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
|
|
|
43
44
|
)
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
const NotFound = ({ viewId }: { viewId: string }) => (
|
|
47
|
-
<div
|
|
48
|
-
style={{
|
|
49
|
-
margin: '1rem 0'
|
|
50
|
-
}}>
|
|
51
|
-
<div
|
|
52
|
-
style={{
|
|
53
|
-
margin: '0 auto',
|
|
54
|
-
display: 'inline-block',
|
|
55
|
-
padding: '2rem',
|
|
56
|
-
background: 'rgba(250,82,82,.15)',
|
|
57
|
-
color: '#ffa8a8'
|
|
58
|
-
}}>
|
|
59
|
-
View <code>{viewId}</code> not found
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
)
|
|
63
|
-
|
|
64
47
|
export function LikeC4ModelProvider({ children }: PropsWithChildren) {
|
|
65
48
|
const likeC4Model = useLikeC4Model()
|
|
66
49
|
return (
|
|
@@ -104,11 +87,11 @@ const LikeC4ViewMemo = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4View
|
|
|
104
87
|
const colorScheme = useColorScheme(explicitColorScheme)
|
|
105
88
|
|
|
106
89
|
if (!view) {
|
|
107
|
-
return <
|
|
90
|
+
return <ViewNotFound viewId={viewId} />
|
|
108
91
|
}
|
|
109
92
|
|
|
110
93
|
if (browserViewId && !browserView) {
|
|
111
|
-
return <
|
|
94
|
+
return <ViewNotFound viewId={browserViewId} />
|
|
112
95
|
}
|
|
113
96
|
|
|
114
97
|
if (interactive && enableFocusMode) {
|
|
@@ -169,7 +152,7 @@ export type ReactLikeC4Props =
|
|
|
169
152
|
const ReactLikeC4Memo = /* @__PURE__ */ memo<ReactLikeC4Props>(function ReactLikeC4({ viewId, ...props }) {
|
|
170
153
|
const view = LikeC4Views[viewId]
|
|
171
154
|
if (!view) {
|
|
172
|
-
return <
|
|
155
|
+
return <ViewNotFound viewId={viewId} />
|
|
173
156
|
}
|
|
174
157
|
return (
|
|
175
158
|
<LikeC4ModelProvider>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useOverviewGraph } from "virtual:likec4/overview-graph";
|
|
3
|
-
import { c as createReactComponent, I as IconFolderFilled, n, u as useUpdateEffect, i, a as nonexhaustive } from "./main-
|
|
4
|
-
import { u as useRouter } from "./tanstack-router-
|
|
5
|
-
import { B as BaseEdge, H as Handle, P as Position, u as useNodesState, a as useEdgesState, i as index, b as Background, c as BackgroundVariant } from "./likec4-
|
|
3
|
+
import { c as createReactComponent, I as IconFolderFilled, n, u as useUpdateEffect, i, a as nonexhaustive } from "./main-ByUdz_Be.js";
|
|
4
|
+
import { u as useRouter } from "./tanstack-router-BWjXKr0n.js";
|
|
5
|
+
import { B as BaseEdge, H as Handle, P as Position, u as useNodesState, a as useEdgesState, i as index, b as Background, c as BackgroundVariant } from "./likec4-DslTxitT.js";
|
|
6
6
|
import { memo, useRef, useMemo } from "react";
|
|
7
|
-
import { P as Paper, c as clsx, G as Group, T as ThemeIcon, a as Text, C as Card, b as CardSection, d as Center, I as Image, B as Box, u as useMantineColorScheme } from "./mantine-
|
|
7
|
+
import { P as Paper, c as clsx, G as Group, T as ThemeIcon, a as Text, C as Card, b as CardSection, d as Center, I as Image, B as Box, u as useMantineColorScheme } from "./mantine-oFa3ZrEq.js";
|
|
8
8
|
import { usePreviewUrl } from "virtual:likec4/previews";
|
|
9
9
|
/**
|
|
10
10
|
* @license @tabler/icons-react v3.17.0 - MIT
|
package/{dist/__app__/src/chunks/likec4-DF_Jsv_p.js → __app__/src/chunks/likec4-DslTxitT.js}
RENAMED
|
@@ -6087,23 +6087,23 @@ export {
|
|
|
6087
6087
|
BackgroundVariant as c,
|
|
6088
6088
|
useReactFlow as d,
|
|
6089
6089
|
useStoreApi as e,
|
|
6090
|
-
|
|
6090
|
+
useInternalNode as f,
|
|
6091
6091
|
getDefaultExportFromCjs as g,
|
|
6092
|
-
|
|
6092
|
+
useStore as h,
|
|
6093
6093
|
index as i,
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6094
|
+
useNodesData as j,
|
|
6095
|
+
getNodeDimensions as k,
|
|
6096
|
+
createWithEqualityFn as l,
|
|
6097
|
+
applyNodeChanges as m,
|
|
6098
|
+
applyEdgeChanges as n,
|
|
6099
|
+
getViewportForBounds as o,
|
|
6100
|
+
getBoundsOfRects as p,
|
|
6101
|
+
boxToRect as q,
|
|
6102
|
+
useStoreWithEqualityFn as r,
|
|
6103
6103
|
shallow$1 as s,
|
|
6104
|
-
|
|
6104
|
+
getBezierPath as t,
|
|
6105
6105
|
useNodesState as u,
|
|
6106
|
-
|
|
6106
|
+
Panel as v,
|
|
6107
6107
|
withSelectorExports as w,
|
|
6108
|
-
|
|
6108
|
+
useOnViewportChange as x
|
|
6109
6109
|
};
|