likec4 1.9.0 → 1.10.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.
- package/dist/__app__/react/likec4.tsx +64 -12
- package/dist/__app__/src/chunks/{-index-overview-BAmvrzHU.js → -index-overview-CR08x_EG.js} +6 -6
- package/dist/__app__/src/chunks/{likec4-BqIZe8Y0.js → likec4-BFZn233G.js} +165 -117
- package/dist/__app__/src/chunks/{main-BZtdykGF.js → main-D12NE066.js} +3176 -2946
- package/dist/__app__/src/chunks/{mantine-Bhi3pgTf.js → mantine-BnwtT_Nz.js} +54 -53
- package/dist/__app__/src/chunks/{tanstack-router-Bc_WYOzY.js → tanstack-router-DKnF_3kP.js} +1 -1
- package/dist/__app__/src/main.js +1 -1
- package/dist/__app__/src/style.css +1 -1
- package/dist/__app__/webcomponent/webcomponent.js +3251 -3003
- package/dist/cli/index.mjs +115 -74
- package/dist/index.d.mts +856 -705
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.DKLo7EEm.mjs +1221 -0
- package/package.json +23 -20
- package/react/index.d.ts +1065 -9
- package/react/index.mjs +3534 -3190
- package/react/style.css +1 -0
- package/dist/shared/likec4.D4BZc04H.mjs +0 -1219
- package/react/LikeC4Browser.css.d.ts +0 -4
- package/react/LikeC4Browser.d.ts +0 -31
- package/react/LikeC4ViewElement.d.ts +0 -56
- package/react/ShadowRoot.d.ts +0 -6
- package/react/ShadowRootMantineProvider.d.ts +0 -7
- package/react/styles.css.d.ts +0 -4
- package/react/styles.d.ts +0 -4
- package/react/types-filter.d.ts +0 -33
- package/react/types.d.ts +0 -76
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
LikeC4Browser,
|
|
3
|
+
LikeC4ViewEmbedded,
|
|
4
|
+
type LikeC4ViewProps as BaseLikeC4ViewProps,
|
|
5
|
+
ReactLikeC4 as GenericReactLikeC4,
|
|
6
|
+
type ReactLikeC4Props as GenericReactLikeC4Props,
|
|
7
|
+
useColorScheme
|
|
8
|
+
} from 'likec4/react'
|
|
3
9
|
import { memo, useCallback, useState } from 'react'
|
|
4
10
|
import { Icons } from 'virtual:likec4/icons'
|
|
5
11
|
import {
|
|
@@ -18,16 +24,34 @@ type IconRendererProps = {
|
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
function RenderIcon({ node }: IconRendererProps) {
|
|
22
28
|
const IconComponent = Icons[node.icon ?? '']
|
|
23
29
|
return IconComponent ? <IconComponent /> : null
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
export { isLikeC4ViewId, LikeC4Views }
|
|
32
|
+
export { isLikeC4ViewId, LikeC4Views, RenderIcon }
|
|
33
|
+
|
|
34
|
+
export type LikeC4ViewProps = BaseLikeC4ViewProps<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
const NotFound = ({ viewId }: { viewId: string }) => (
|
|
37
|
+
<div
|
|
38
|
+
style={{
|
|
39
|
+
margin: '1rem 0'
|
|
40
|
+
}}>
|
|
41
|
+
<div
|
|
42
|
+
style={{
|
|
43
|
+
margin: '0 auto',
|
|
44
|
+
display: 'inline-block',
|
|
45
|
+
padding: '2rem',
|
|
46
|
+
background: 'rgba(250,82,82,.15)',
|
|
47
|
+
color: '#ffa8a8'
|
|
48
|
+
}}>
|
|
49
|
+
View <code>{viewId}</code> not found
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
)
|
|
29
53
|
|
|
30
|
-
|
|
54
|
+
const LikeC4ViewMemo = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4View({
|
|
31
55
|
viewId,
|
|
32
56
|
interactive = true,
|
|
33
57
|
colorScheme: explicitColorScheme,
|
|
@@ -40,6 +64,9 @@ export const LikeC4View = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4V
|
|
|
40
64
|
showNavigationButtons = false,
|
|
41
65
|
showNotations = false,
|
|
42
66
|
enableFocusMode = false,
|
|
67
|
+
browserClassName,
|
|
68
|
+
browserStyle,
|
|
69
|
+
mantineTheme,
|
|
43
70
|
...props
|
|
44
71
|
}) {
|
|
45
72
|
const view = LikeC4Views[viewId]
|
|
@@ -52,23 +79,23 @@ export const LikeC4View = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4V
|
|
|
52
79
|
onNavigateTo(null)
|
|
53
80
|
}, [onNavigateTo])
|
|
54
81
|
|
|
82
|
+
const colorScheme = useColorScheme(explicitColorScheme)
|
|
83
|
+
|
|
55
84
|
if (!view) {
|
|
56
|
-
|
|
85
|
+
return <NotFound viewId={viewId} />
|
|
57
86
|
}
|
|
58
87
|
|
|
59
88
|
if (browserViewId && !browserView) {
|
|
60
|
-
|
|
89
|
+
return <NotFound viewId={browserViewId} />
|
|
61
90
|
}
|
|
62
91
|
|
|
63
92
|
if (interactive && enableFocusMode) {
|
|
64
93
|
console.warn('Focus mode is not supported in interactive mode')
|
|
65
94
|
}
|
|
66
95
|
|
|
67
|
-
const colorScheme = useColorScheme(explicitColorScheme)
|
|
68
|
-
|
|
69
96
|
return (
|
|
70
97
|
<>
|
|
71
|
-
<
|
|
98
|
+
<LikeC4ViewEmbedded<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>
|
|
72
99
|
view={view}
|
|
73
100
|
colorScheme={colorScheme}
|
|
74
101
|
injectFontCss={injectFontCss}
|
|
@@ -81,6 +108,7 @@ export const LikeC4View = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4V
|
|
|
81
108
|
showNotations={showNotations}
|
|
82
109
|
enableFocusMode={enableFocusMode}
|
|
83
110
|
where={where}
|
|
111
|
+
mantineTheme={mantineTheme}
|
|
84
112
|
{...props}
|
|
85
113
|
/>
|
|
86
114
|
{browserView && (
|
|
@@ -93,9 +121,33 @@ export const LikeC4View = /* @__PURE__ */ memo<LikeC4ViewProps>(function LikeC4V
|
|
|
93
121
|
onClose={closeBrowser}
|
|
94
122
|
renderIcon={RenderIcon}
|
|
95
123
|
where={where}
|
|
124
|
+
className={browserClassName}
|
|
125
|
+
style={browserStyle}
|
|
126
|
+
mantineTheme={mantineTheme}
|
|
96
127
|
/>
|
|
97
128
|
)}
|
|
98
129
|
</>
|
|
99
130
|
)
|
|
100
131
|
})
|
|
101
|
-
|
|
132
|
+
LikeC4ViewMemo.displayName = 'LikeC4ViewMemo'
|
|
133
|
+
export { LikeC4ViewMemo as LikeC4View }
|
|
134
|
+
|
|
135
|
+
export type ReactLikeC4Props =
|
|
136
|
+
& Omit<GenericReactLikeC4Props<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>, 'view' | 'renderIcon'>
|
|
137
|
+
& {
|
|
138
|
+
viewId: LikeC4ViewId
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function ReactLikeC4({ viewId, ...props }: ReactLikeC4Props) {
|
|
142
|
+
const view = LikeC4Views[viewId]
|
|
143
|
+
if (!view) {
|
|
144
|
+
return <NotFound viewId={viewId} />
|
|
145
|
+
}
|
|
146
|
+
return (
|
|
147
|
+
<GenericReactLikeC4
|
|
148
|
+
view={view}
|
|
149
|
+
renderIcon={RenderIcon}
|
|
150
|
+
{...props}
|
|
151
|
+
/>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
@@ -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 { u, c as createReactComponent, I as IconFolderFilled, e, a as useUpdateEffect, n 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 { u, c as createReactComponent, I as IconFolderFilled, e, a as useUpdateEffect, n as nonexhaustive } from "./main-D12NE066.js";
|
|
4
|
+
import { u as useRouter } from "./tanstack-router-DKnF_3kP.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-BFZn233G.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-BnwtT_Nz.js";
|
|
8
8
|
import { usePreviewUrl } from "virtual:likec4/previews";
|
|
9
9
|
function a(...n) {
|
|
10
10
|
return u(c, n);
|
|
@@ -15,14 +15,14 @@ function c(n, r) {
|
|
|
15
15
|
return o;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* @license @tabler/icons-react v3.
|
|
18
|
+
* @license @tabler/icons-react v3.16.0 - MIT
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the MIT license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
23
|
var IconLoader = createReactComponent("outline", "loader", "IconLoader", [["path", { d: "M12 6l0 -3", key: "svg-0" }], ["path", { d: "M16.25 7.75l2.15 -2.15", key: "svg-1" }], ["path", { d: "M18 12l3 0", key: "svg-2" }], ["path", { d: "M16.25 16.25l2.15 2.15", key: "svg-3" }], ["path", { d: "M12 18l0 3", key: "svg-4" }], ["path", { d: "M7.75 16.25l-2.15 2.15", key: "svg-5" }], ["path", { d: "M6 12l-3 0", key: "svg-6" }], ["path", { d: "M7.75 7.75l-2.15 -2.15", key: "svg-7" }]]);
|
|
24
24
|
/**
|
|
25
|
-
* @license @tabler/icons-react v3.
|
|
25
|
+
* @license @tabler/icons-react v3.16.0 - MIT
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the MIT license.
|
|
28
28
|
* See the LICENSE file in the root directory of this source tree.
|