@likec4/diagram 1.28.0 → 1.29.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/bundle/index.js +1040 -1190
- package/dist/LikeC4CustomColors.js +2 -2
- package/dist/LikeC4Diagram.js +2 -2
- package/dist/LikeC4ModelProvider.js +1 -1
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/react.production.js +3 -0
- package/dist/base/BaseXYFlow.js +5 -5
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base/primitives/compound/CompoundNodeContainer.js +2 -2
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/customEdge.js +3 -3
- package/dist/base/primitives/customNode.js +2 -2
- package/dist/base/primitives/edge/EdgeContainer.js +1 -1
- package/dist/base/primitives/edge/EdgeLabel.css.d.ts +3 -0
- package/dist/base/primitives/edge/EdgeLabel.css.js +3 -0
- package/dist/base/primitives/edge/EdgeLabel.d.ts +1 -1
- package/dist/base/primitives/edge/EdgeLabel.js +3 -2
- package/dist/base/primitives/edge/EdgeLabelContainer.js +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +10 -42
- package/dist/base/primitives/edge/EdgePath.js +23 -16
- package/dist/base/primitives/edge/edge.css.js +1 -1
- package/dist/base/primitives/element/ElementActionButtons.js +1 -2
- package/dist/base/primitives/element/ElementDetailsButton.js +1 -2
- package/dist/base/primitives/element/ElementNodeContainer.js +3 -3
- package/dist/base/updateEdges.js +7 -2
- package/dist/base/updateNodes.js +11 -3
- package/dist/bundle/LikeC4View.js +3 -3
- package/dist/bundle/ReactLikeC4.js +1 -1
- package/dist/bundle/ShadowRoot.js +3 -3
- package/dist/bundle/styles.css.js +3 -3
- package/dist/context/ControlsCustomLayout.js +1 -1
- package/dist/context/DiagramEventHandlers.js +5 -5
- package/dist/context/DiagramFeatures.js +7 -7
- package/dist/context/EnsureMantine.js +2 -2
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.js +4 -4
- package/dist/context/ReduceGraphics.js +2 -2
- package/dist/context/RootContainer.js +5 -9
- package/dist/hooks/safeContext.d.ts +2 -5
- package/dist/hooks/safeContext.js +5 -4
- package/dist/hooks/useCurrentViewId.js +1 -1
- package/dist/hooks/useDiagram.d.ts +715 -150
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useMantinePortalProps.js +2 -2
- package/dist/hooks/useSetState.js +3 -3
- package/dist/hooks/useUpdateEffect.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramUI.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +2 -2
- package/dist/likec4diagram/custom/edges/NotePopover.js +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +2 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +7 -7
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -6
- package/dist/likec4diagram/custom/index.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +4 -4
- package/dist/likec4diagram/ui/controls/Controls.js +9 -9
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +4 -4
- package/dist/likec4diagram/ui/search/ElementsColumn.js +88 -77
- package/dist/likec4diagram/ui/search/LikeC4Search.d.ts +2 -1
- package/dist/likec4diagram/ui/search/LikeC4Search.js +27 -24
- package/dist/likec4diagram/ui/search/SearchInput.js +1 -1
- package/dist/likec4diagram/ui/search/ViewsColum.js +3 -2
- package/dist/likec4diagram/ui/search/state.js +11 -9
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -1
- package/dist/likec4diagram/useLayoutConstraints.js +3 -3
- package/dist/likec4model/LikeC4ModelContext.js +2 -2
- package/dist/likec4model/useLikeC4ElementsTree.js +2 -2
- package/dist/likec4model/useLikeC4Model.js +2 -2
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/cjs/react.production.js +548 -0
- package/dist/node_modules/.pnpm/react@19.0.0/node_modules/react/index.js +15 -0
- package/dist/overlays/Overlays.js +6 -6
- package/dist/overlays/element-details/ElementDetails.js +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.js +5 -5
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +6 -3
- package/dist/overlays/element-details/actor.d.ts +2 -2
- package/dist/overlays/element-details/actorContext.js +3 -3
- package/dist/overlays/overlay/Overlay.js +8 -7
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +28 -23
- package/dist/overlays/relationship-details/SelectEdge.js +3 -6
- package/dist/overlays/relationship-details/actor.d.ts +4 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.js +1 -1
- package/dist/overlays/relationship-details/hooks.d.ts +4 -1
- package/dist/overlays/relationship-details/hooks.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +9 -11
- package/dist/overlays/relationships-browser/SelectElement.js +8 -5
- package/dist/overlays/relationships-browser/actor.d.ts +2 -1
- package/dist/overlays/relationships-browser/actor.js +6 -12
- package/dist/overlays/relationships-browser/const.d.ts +2 -1
- package/dist/overlays/relationships-browser/const.js +6 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +3 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.d.ts +2 -1
- package/dist/overlays/relationships-browser/hooks.js +4 -4
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -2
- package/dist/state/DiagramActorProvider.js +7 -5
- package/dist/state/diagram-machine.d.ts +719 -146
- package/dist/state/diagram-machine.js +51 -10
- package/dist/styles.css.js +1 -1
- package/package.json +20 -16
- package/src/LikeC4Diagram.tsx +0 -1
- package/src/base/BaseXYFlow.tsx +2 -2
- package/src/base/primitives/compound/CompoundActionButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundDetailsButton.tsx +1 -1
- package/src/base/primitives/compound/CompoundNodeContainer.tsx +1 -1
- package/src/base/primitives/customEdge.ts +1 -0
- package/src/base/primitives/edge/EdgeLabel.css.ts +3 -0
- package/src/base/primitives/edge/EdgeLabel.tsx +2 -1
- package/src/base/primitives/edge/EdgePath.tsx +22 -14
- package/src/base/primitives/edge/edge.css.ts +1 -1
- package/src/base/primitives/element/ElementActionButtons.tsx +2 -2
- package/src/base/primitives/element/ElementDetailsButton.tsx +2 -2
- package/src/base/primitives/element/ElementNodeContainer.tsx +1 -1
- package/src/base/updateEdges.ts +6 -9
- package/src/base/updateNodes.ts +10 -14
- package/src/context/FramerMotionConfig.tsx +1 -1
- package/src/context/RootContainer.tsx +0 -4
- package/src/hooks/safeContext.tsx +3 -1
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +2 -2
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
- package/src/likec4diagram/ui/controls/Controls.tsx +56 -58
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -1
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +1 -1
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +1 -1
- package/src/likec4diagram/ui/search/ElementsColumn.tsx +94 -71
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +48 -55
- package/src/likec4diagram/ui/search/ViewsColum.tsx +2 -2
- package/src/likec4diagram/ui/search/state.ts +8 -6
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -1
- package/src/overlays/Overlays.tsx +2 -2
- package/src/overlays/element-details/ElementDetails.tsx +2 -2
- package/src/overlays/element-details/ElementDetailsCard.tsx +1 -1
- package/src/overlays/element-details/TabPanelDeployments.tsx +2 -0
- package/src/overlays/element-details/TabPanelStructure.tsx +2 -1
- package/src/overlays/overlay/Overlay.tsx +2 -1
- package/src/overlays/relationship-details/RelationshipDetails.tsx +25 -16
- package/src/overlays/relationship-details/SelectEdge.tsx +0 -14
- package/src/overlays/relationship-details/actor.ts +2 -1
- package/src/overlays/relationship-details/custom/edgeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +1 -3
- package/src/overlays/relationships-browser/SelectElement.tsx +2 -0
- package/src/overlays/relationships-browser/actor.ts +8 -13
- package/src/overlays/relationships-browser/const.ts +8 -1
- package/src/overlays/relationships-browser/custom/edgeTypes.tsx +2 -3
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +1 -1
- package/src/overlays/relationships-browser/useViewToNodesEdges.ts +1 -2
- package/src/state/DiagramActorProvider.tsx +7 -4
- package/src/state/diagram-machine.ts +50 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { shallowEqual } from 'fast-equals';
|
|
3
|
-
import {
|
|
3
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
4
4
|
import { mapToObj, pick, map } from 'remeda';
|
|
5
5
|
|
|
6
6
|
const FeatureNames = [
|
|
@@ -31,7 +31,7 @@ const AllDisabled = mapToObj(
|
|
|
31
31
|
FeatureNames,
|
|
32
32
|
(name) => [`enable${name}`, false]
|
|
33
33
|
);
|
|
34
|
-
const DiagramFeaturesContext = createContext(AllDisabled);
|
|
34
|
+
const DiagramFeaturesContext = reactExports.createContext(AllDisabled);
|
|
35
35
|
const validate = (features) => {
|
|
36
36
|
let {
|
|
37
37
|
enableReadOnly,
|
|
@@ -68,9 +68,9 @@ function DiagramFeatures({
|
|
|
68
68
|
features,
|
|
69
69
|
overrides
|
|
70
70
|
}) {
|
|
71
|
-
const outerScope = useContext(DiagramFeaturesContext);
|
|
72
|
-
const [scope, setScope] = useState(outerScope);
|
|
73
|
-
useEffect(
|
|
71
|
+
const outerScope = reactExports.useContext(DiagramFeaturesContext);
|
|
72
|
+
const [scope, setScope] = reactExports.useState(outerScope);
|
|
73
|
+
reactExports.useEffect(
|
|
74
74
|
() => {
|
|
75
75
|
setScope((current) => {
|
|
76
76
|
const next = validate({
|
|
@@ -99,10 +99,10 @@ DiagramFeatures.Overlays = ({ children }) => {
|
|
|
99
99
|
);
|
|
100
100
|
};
|
|
101
101
|
function useEnabledFeature(...names) {
|
|
102
|
-
return pick(useContext(DiagramFeaturesContext), map(names, (name) => `enable${name}`));
|
|
102
|
+
return pick(reactExports.useContext(DiagramFeaturesContext), map(names, (name) => `enable${name}`));
|
|
103
103
|
}
|
|
104
104
|
function useEnabledFeatures() {
|
|
105
|
-
return useContext(DiagramFeaturesContext);
|
|
105
|
+
return reactExports.useContext(DiagramFeaturesContext);
|
|
106
106
|
}
|
|
107
107
|
function IfEnabled({
|
|
108
108
|
feature,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { MantineContext } from '@mantine/core';
|
|
3
|
-
import {
|
|
3
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
4
4
|
|
|
5
5
|
function EnsureMantine({ children }) {
|
|
6
|
-
const mantineCtx = useContext(MantineContext);
|
|
6
|
+
const mantineCtx = reactExports.useContext(MantineContext);
|
|
7
7
|
if (!mantineCtx) {
|
|
8
8
|
throw new Error("LikeC4Diagram must be a child of MantineProvider");
|
|
9
9
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useMantineStyleNonce } from '@mantine/core';
|
|
3
|
-
import { LazyMotion, domMax, MotionConfig } from '
|
|
4
|
-
import '
|
|
3
|
+
import { LazyMotion, domMax, MotionConfig } from 'motion/react';
|
|
4
|
+
import '../_virtual/index.js';
|
|
5
5
|
|
|
6
6
|
const FramerMotionConfig = ({
|
|
7
7
|
reducedMotion = "user",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { IconCylinder, IconRectangularPrism, IconReorder, IconUser, IconDeviceMobile, IconBrowser } from '@tabler/icons-react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import {
|
|
4
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
5
5
|
|
|
6
|
-
const IconRendererContext = createContext(null);
|
|
6
|
+
const IconRendererContext = reactExports.createContext(null);
|
|
7
7
|
function IconRendererProvider({
|
|
8
8
|
value,
|
|
9
9
|
children
|
|
10
10
|
}) {
|
|
11
|
-
const outerScope = useContext(IconRendererContext);
|
|
11
|
+
const outerScope = reactExports.useContext(IconRendererContext);
|
|
12
12
|
if (outerScope) {
|
|
13
13
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ function IconRenderer({
|
|
|
18
18
|
element,
|
|
19
19
|
className
|
|
20
20
|
}) {
|
|
21
|
-
const RenderIcon = useContext(IconRendererContext);
|
|
21
|
+
const RenderIcon = reactExports.useContext(IconRendererContext);
|
|
22
22
|
if (!element || !element.icon || element.icon === "none") {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { createSafeContext, createOptionalContext } from '@mantine/core';
|
|
3
3
|
import { useStore } from '@nanostores/react';
|
|
4
4
|
import { atom } from 'nanostores';
|
|
5
|
-
import {
|
|
5
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
6
6
|
|
|
7
7
|
const [ReduceGraphicsModeCtx, useReducedGraphics] = createOptionalContext();
|
|
8
8
|
function useIsReducedGraphics() {
|
|
@@ -16,7 +16,7 @@ const [PanningAtomSafeCtx, usePanningAtom] = createSafeContext(
|
|
|
16
16
|
"PanningAtomSafeCtx is not provided"
|
|
17
17
|
);
|
|
18
18
|
function ReduceGraphicsContext({ reduceGraphics, children }) {
|
|
19
|
-
const $isPanningRef = useRef(null);
|
|
19
|
+
const $isPanningRef = reactExports.useRef(null);
|
|
20
20
|
if (!$isPanningRef.current) {
|
|
21
21
|
$isPanningRef.current = atom(reduceGraphics);
|
|
22
22
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { Box } from '@likec4/styles/jsx';
|
|
4
|
-
import {
|
|
4
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
5
5
|
import { usePanningAtom } from './ReduceGraphics.js';
|
|
6
6
|
|
|
7
|
-
const RootContainerContext = createContext(createRef());
|
|
7
|
+
const RootContainerContext = reactExports.createContext(reactExports.createRef());
|
|
8
8
|
function RootContainer({
|
|
9
9
|
className,
|
|
10
10
|
reduceGraphics = false,
|
|
11
11
|
children
|
|
12
12
|
}) {
|
|
13
|
-
const ref = useRef(null);
|
|
13
|
+
const ref = reactExports.useRef(null);
|
|
14
14
|
const $isPanning = usePanningAtom();
|
|
15
|
-
useEffect(() => {
|
|
15
|
+
reactExports.useEffect(() => {
|
|
16
16
|
return $isPanning.listen((isPanning) => {
|
|
17
17
|
if (isPanning) {
|
|
18
18
|
ref.current?.setAttribute("data-likec4-diagram-panning", "true");
|
|
@@ -25,10 +25,6 @@ function RootContainer({
|
|
|
25
25
|
Box,
|
|
26
26
|
{
|
|
27
27
|
className: cx("likec4-root", className),
|
|
28
|
-
css: {
|
|
29
|
-
// '--likec4-background-color': 'mantine.colors.body',
|
|
30
|
-
// '--colors-likec4-background': 'var(--mantine-color-body)',
|
|
31
|
-
},
|
|
32
28
|
ref,
|
|
33
29
|
...reduceGraphics && {
|
|
34
30
|
["data-likec4-reduced-graphics"]: true
|
|
@@ -38,7 +34,7 @@ function RootContainer({
|
|
|
38
34
|
);
|
|
39
35
|
}
|
|
40
36
|
function useRootContainer() {
|
|
41
|
-
return useContext(RootContainerContext).current;
|
|
37
|
+
return reactExports.useContext(RootContainerContext).current;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
export { RootContainer, useRootContainer };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { DiagramActorRef } from '../state/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
* To improve experience with HMR, we use `createSafeContext` as a boundary for hoooks
|
|
5
|
-
*/
|
|
6
|
-
export declare const DiagramActorSafeContext: Context<DiagramActorRef>;
|
|
2
|
+
import { Provider } from 'react';
|
|
3
|
+
export declare const DiagramActorContextProvider: Provider<DiagramActorRef>;
|
|
7
4
|
export declare const useDiagramActorRef: () => DiagramActorRef;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as reactExports } from '../_virtual/index.js';
|
|
2
2
|
|
|
3
|
-
const DiagramActorSafeContext = createContext(null);
|
|
3
|
+
const DiagramActorSafeContext = reactExports.createContext(null);
|
|
4
4
|
DiagramActorSafeContext.displayName = "DiagramActorSafeContext";
|
|
5
|
+
const DiagramActorContextProvider = DiagramActorSafeContext.Provider;
|
|
5
6
|
const useDiagramActorRef = () => {
|
|
6
|
-
const ctx = useContext(DiagramActorSafeContext);
|
|
7
|
+
const ctx = reactExports.useContext(DiagramActorSafeContext);
|
|
7
8
|
if (ctx === null) {
|
|
8
9
|
throw new Error("DiagramActorRef is not provided");
|
|
9
10
|
}
|
|
10
11
|
return ctx;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export {
|
|
14
|
+
export { DiagramActorContextProvider, useDiagramActorRef };
|
|
@@ -2,7 +2,7 @@ import { useSelector } from '@xstate/react';
|
|
|
2
2
|
import '@likec4/core';
|
|
3
3
|
import '@mantine/hooks';
|
|
4
4
|
import 'fast-equals';
|
|
5
|
-
import '
|
|
5
|
+
import '../_virtual/index.js';
|
|
6
6
|
import { useDiagramActorRef } from './safeContext.js';
|
|
7
7
|
|
|
8
8
|
const selectViewId = (s) => s.context.view.id;
|