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.
Files changed (28) hide show
  1. package/{dist/__app__ → __app__}/react/likec4.tsx +9 -26
  2. package/{dist/__app__/src/chunks/-index-overview-DrCqsLHx.js → __app__/src/chunks/-index-overview-CBnvpD1d.js} +4 -4
  3. package/{dist/__app__/src/chunks/likec4-DF_Jsv_p.js → __app__/src/chunks/likec4-DslTxitT.js} +14 -14
  4. package/{dist/__app__/src/chunks/main-E2hyQKFO.js → __app__/src/chunks/main-ByUdz_Be.js} +14153 -13715
  5. package/{dist/__app__/src/chunks/mantine-BzD51ZKm.js → __app__/src/chunks/mantine-oFa3ZrEq.js} +427 -253
  6. package/{dist/__app__/src/chunks/tanstack-router-CF1kJvtP.js → __app__/src/chunks/tanstack-router-BWjXKr0n.js} +1 -1
  7. package/{dist/__app__ → __app__}/src/main.js +1 -1
  8. package/{dist/__app__ → __app__}/src/style.css +1 -1
  9. package/{dist/__app__ → __app__}/webcomponent/webcomponent.js +30811 -30120
  10. package/dist/chunks/prompt.mjs +3 -3
  11. package/dist/cli/index.mjs +210 -179
  12. package/dist/index.d.mts +1693 -742
  13. package/dist/index.d.ts +1693 -742
  14. package/dist/index.mjs +1 -1
  15. package/dist/shared/likec4.lgHXhASw.mjs +1832 -0
  16. package/package.json +25 -26
  17. package/react/index.d.ts +891 -423
  18. package/react/index.mjs +32737 -31318
  19. package/react/style.css +1 -1
  20. package/dist/shared/likec4.BkLj38-D.mjs +0 -1824
  21. /package/{dist/__app__ → __app__}/favicon.ico +0 -0
  22. /package/{dist/__app__ → __app__}/favicon.svg +0 -0
  23. /package/{dist/__app__ → __app__}/index.html +0 -0
  24. /package/{dist/__app__ → __app__}/robots.txt +0 -0
  25. /package/{dist/__app__ → __app__}/src/chunks/-view-lazy-data-WZmbIsHq.js +0 -0
  26. /package/{dist/__app__ → __app__}/src/chunks/index-CIsxIzOH.js +0 -0
  27. /package/{dist/__app__ → __app__}/src/const.js +0 -0
  28. /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 { likec4model as likeC4Model, LikeC4Views, useLikeC4ModelAtom as useLikeC4Model } from 'virtual:likec4/model'
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.Layouted.ViewModel =>
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 => useLikeC4Model().view(viewId).view as any
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 <NotFound viewId={viewId} />
90
+ return <ViewNotFound viewId={viewId} />
108
91
  }
109
92
 
110
93
  if (browserViewId && !browserView) {
111
- return <NotFound viewId={browserViewId} />
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 <NotFound viewId={viewId} />
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-E2hyQKFO.js";
4
- import { u as useRouter } from "./tanstack-router-CF1kJvtP.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-DF_Jsv_p.js";
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-BzD51ZKm.js";
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
@@ -6087,23 +6087,23 @@ export {
6087
6087
  BackgroundVariant as c,
6088
6088
  useReactFlow as d,
6089
6089
  useStoreApi as e,
6090
- useStore as f,
6090
+ useInternalNode as f,
6091
6091
  getDefaultExportFromCjs as g,
6092
- useNodesData as h,
6092
+ useStore as h,
6093
6093
  index as i,
6094
- getNodeDimensions as j,
6095
- createWithEqualityFn as k,
6096
- applyNodeChanges as l,
6097
- applyEdgeChanges as m,
6098
- getViewportForBounds as n,
6099
- getBoundsOfRects as o,
6100
- boxToRect as p,
6101
- useStoreWithEqualityFn as q,
6102
- getBezierPath as r,
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
- Panel as t,
6104
+ getBezierPath as t,
6105
6105
  useNodesState as u,
6106
- useOnViewportChange as v,
6106
+ Panel as v,
6107
6107
  withSelectorExports as w,
6108
- useInternalNode as x
6108
+ useOnViewportChange as x
6109
6109
  };