@likec4/diagram 1.32.2 → 1.34.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/README.md +25 -0
- package/bundle/{chunk-DlHyKoeo.js → chunk-Dd7et66b.js} +533 -487
- package/bundle/custom.js +53 -50
- package/bundle/index.js +471 -311
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/StaticLikeC4Diagram.d.ts +1 -1
- package/dist/base/primitives/MarkdownBlock.d.ts +27 -0
- package/dist/base/primitives/MarkdownBlock.js +42 -0
- package/dist/base/primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base/primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base/primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base/primitives/element/ElementDetailsButton.js +1 -1
- package/dist/base/primitives/element/ElementTags.d.ts +1 -1
- package/dist/base/primitives/element/ElementTags.js +116 -125
- package/dist/base/primitives/element/ElementTitle.css.js +6 -1
- package/dist/base/primitives/element/ElementTitle.d.ts +3 -2
- package/dist/base/primitives/element/ElementTitle.js +9 -6
- package/dist/base/primitives/index.d.ts +1 -0
- package/dist/bundle/LikeC4View.d.ts +1 -1
- package/dist/bundle/LikeC4View.js +1 -1
- package/dist/bundle/LikeC4View.props.d.ts +1 -1
- package/dist/bundle/ReactLikeC4.d.ts +1 -1
- package/dist/bundle/custom.js +31 -0
- package/dist/bundle/index.js +1 -0
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -1
- package/dist/components/SearchControl.js +1 -1
- package/dist/context/DiagramFeatures.d.ts +3 -2
- package/dist/context/DiagramFeatures.js +16 -1
- package/dist/context/IconRenderer.js +6 -1
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/components.d.ts +2 -2
- package/dist/custom/customNodes.js +18 -0
- package/dist/custom/hooks.d.ts +3 -3
- package/dist/custom/index.js +31 -0
- package/dist/hooks/safeContext.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +2 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.js +1 -0
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +5 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -1
- package/dist/likec4diagram/types.d.ts +3 -2
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +1 -1
- package/dist/likec4diagram/ui/controls/Controls.js +3 -1
- package/dist/likec4diagram/ui/controls/LayoutDriftNotification.js +1 -1
- package/dist/likec4diagram/ui/controls/ManualLayoutToolsButton.js +9 -1
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +2 -1
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +2 -1
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +19 -15
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -1
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +4 -1
- package/dist/likec4diagram/useViewToNodesEdges.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +41 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +30 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +13 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +13 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +4 -2
- package/dist/overlays/element-details/ElementDetailsCard.js +127 -12
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -1
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +2 -2
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -1
- package/dist/overlays/relationship-details/SelectEdge.js +2 -1
- package/dist/overlays/relationship-details/_types.d.ts +4 -3
- package/dist/overlays/relationship-details/actor.d.ts +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -1
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +2 -2
- package/dist/overlays/relationship-details/hooks.d.ts +10 -10
- package/dist/overlays/relationship-details/layout-to-xyflow.js +4 -4
- package/dist/overlays/relationship-details/layout.d.ts +5 -3
- package/dist/overlays/relationship-details/layout.js +2 -2
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -1
- package/dist/overlays/relationships-browser/SelectElement.js +2 -1
- package/dist/overlays/relationships-browser/_types.d.ts +3 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +3 -3
- package/dist/overlays/relationships-browser/layout.d.ts +4 -3
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/search/components/ElementsColumn.js +2 -2
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +4 -3
- package/dist/state/DiagramActorProvider.js +9 -1
- package/dist/state/diagram-machine.js +1 -1
- package/dist/styles-min.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css2.js +1 -1
- package/package.json +25 -19
- package/panda.buildinfo.json +881 -862
- package/src/LikeC4Diagram.props.ts +1 -1
- package/src/StaticLikeC4Diagram.tsx +1 -1
- package/src/base/primitives/MarkdownBlock.tsx +66 -0
- package/src/base/primitives/element/ElementTags.tsx +118 -116
- package/src/base/primitives/element/ElementTitle.css.ts +7 -1
- package/src/base/primitives/element/ElementTitle.tsx +14 -9
- package/src/base/primitives/index.ts +1 -0
- package/src/bundle/LikeC4View.props.ts +1 -1
- package/src/bundle/LikeC4View.tsx +1 -1
- package/src/bundle/ReactLikeC4.tsx +1 -1
- package/src/context/DiagramFeatures.tsx +7 -7
- package/src/custom/components.ts +2 -0
- package/src/custom/hooks.ts +5 -0
- package/src/hooks/useXYFlow.ts +9 -1
- package/src/index.ts +18 -6
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +1 -1
- package/src/likec4diagram/types.ts +2 -2
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +21 -16
- package/src/likec4diagram/useViewToNodesEdges.ts +2 -1
- package/src/overlays/element-details/ElementDetailsCard.css.ts +3 -1
- package/src/overlays/element-details/ElementDetailsCard.tsx +101 -17
- package/src/overlays/relationship-details/_types.ts +12 -3
- package/src/overlays/relationship-details/layout-to-xyflow.ts +3 -2
- package/src/overlays/relationship-details/layout.ts +7 -4
- package/src/overlays/relationships-browser/_types.ts +2 -1
- package/src/overlays/relationships-browser/layout.ts +7 -4
- package/src/search/components/ElementsColumn.tsx +1 -1
- package/src/search/components/ViewsColum.tsx +2 -2
- package/src/state/DiagramActorProvider.tsx +10 -2
- package/src/state/diagram-machine.ts +1 -1
|
@@ -90,5 +90,20 @@ function IfEnabled({
|
|
|
90
90
|
const enabled = useEnabledFeatures()[`enable${feature}`] === true;
|
|
91
91
|
return enabled && and ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
92
92
|
}
|
|
93
|
+
function IfNotEnabled({ feature, children }) {
|
|
94
|
+
const notEnabled = useEnabledFeatures()[`enable${feature}`] !== true;
|
|
95
|
+
return notEnabled ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
96
|
+
}
|
|
97
|
+
function IfReadOnly({ children }) {
|
|
98
|
+
const isReadOnly = useEnabledFeatures()[`enableReadOnly`] === true;
|
|
99
|
+
return isReadOnly ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
100
|
+
}
|
|
101
|
+
function IfNotReadOnly({ children }) {
|
|
102
|
+
const isReadOnly = useEnabledFeatures()[`enableReadOnly`] === true;
|
|
103
|
+
if (isReadOnly) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
107
|
+
}
|
|
93
108
|
|
|
94
|
-
export { AllDisabled, DiagramFeatures, IfEnabled, useEnabledFeatures };
|
|
109
|
+
export { AllDisabled, DiagramFeatures, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
|
-
import { IconCylinder, IconRectangularPrism, IconReorder, IconUser, IconDeviceMobile, IconBrowser } from '@tabler/icons-react';
|
|
4
3
|
import { useContext, createContext } from 'react';
|
|
4
|
+
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
|
|
5
|
+
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
|
|
6
|
+
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
|
|
7
|
+
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
|
|
8
|
+
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
|
|
9
|
+
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
|
|
5
10
|
|
|
6
11
|
const IconRendererContext = createContext(null);
|
|
7
12
|
function IconRendererProvider({
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { isTagColorSpecified } from '@likec4/core';
|
|
3
3
|
import { useMantineStyleNonce } from '@mantine/core';
|
|
4
4
|
import { useDeepCompareMemo } from '@react-hookz/web';
|
|
5
|
-
import {
|
|
5
|
+
import { useContext, createContext } from 'react';
|
|
6
6
|
import { pipe, entries, flatMap, join } from 'remeda';
|
|
7
7
|
import { useLikeC4Specification } from '../likec4model/useLikeC4Model.js';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CompoundActionButton, CompoundDetailsButton, CompoundNodeContainer, CompoundTitle, DefaultHandles, ElementActionButtons, ElementDetailsButton, ElementNodeContainer, ElementShape, ElementTag, ElementTags, ElementTitle, } from '../base/primitives';
|
|
1
|
+
export { CompoundActionButton, CompoundDetailsButton, CompoundNodeContainer, CompoundTitle, DefaultHandles, ElementActionButtons, ElementDetailsButton, ElementNodeContainer, ElementShape, ElementTag, ElementTags, ElementTitle, MarkdownBlock, } from '../base/primitives';
|
|
2
2
|
export { IconOrShapeRenderer, IconRenderer, IconRendererProvider, } from '../context/IconRenderer';
|
|
3
3
|
export { CompoundActions, CompoundDeploymentNode, CompoundDeploymentToolbar, CompoundDetailsButtonWithHandler, CompoundElementNode, CompoundElementToolbar, DeploymentElementActions, DeploymentElementToolbar, DeploymentNode, ElementActions, ElementDetailsButtonWithHandler, ElementNode, ElementToolbar, Toolbar, ViewGroupNode, } from '../likec4diagram/custom/nodes';
|
|
4
|
-
export { IfEnabled, IfNotEnabled, IfNotReadOnly, } from '../context/DiagramFeatures';
|
|
4
|
+
export { IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, } from '../context/DiagramFeatures';
|
|
5
5
|
export { Overlay, type OverlayProps, } from '../overlays/overlay/Overlay';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useLikeC4Model } from '../likec4model/useLikeC4Model.js';
|
|
3
|
+
import { customNode } from '../base/primitives/customNode.js';
|
|
4
|
+
|
|
5
|
+
function customDiagramNode(Node) {
|
|
6
|
+
return customNode((props) => {
|
|
7
|
+
const viewModel = useLikeC4Model().view(props.data.viewId);
|
|
8
|
+
const model = viewModel.node(props.id);
|
|
9
|
+
return /* @__PURE__ */ jsx(Node, { nodeProps: props, nodeModel: model });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const elementNode = customDiagramNode;
|
|
13
|
+
const deploymentNode = customDiagramNode;
|
|
14
|
+
const compoundElementNode = customDiagramNode;
|
|
15
|
+
const compoundDeploymentNode = customDiagramNode;
|
|
16
|
+
const viewGroupNode = customDiagramNode;
|
|
17
|
+
|
|
18
|
+
export { compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, viewGroupNode };
|
package/dist/custom/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { DiagramActorEvent, DiagramActorRef, DiagramContext, } from '../state/types';
|
|
2
2
|
export { useDiagramEventHandlers, } from '../context/DiagramEventHandlers';
|
|
3
|
-
export { type EnabledFeatures, useEnabledFeatures, } from '../context/DiagramFeatures';
|
|
3
|
+
export { type EnabledFeatures, type FeatureName, useEnabledFeatures, } from '../context/DiagramFeatures';
|
|
4
4
|
export { useCurrentViewId, } from '../hooks/useCurrentViewId';
|
|
5
|
-
export { useDiagram, useDiagramContext, } from '../hooks/useDiagram';
|
|
6
|
-
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi, } from '../hooks/useXYFlow';
|
|
5
|
+
export { type DiagramApi, useDiagram, useDiagramActorRef, useDiagramContext, } from '../hooks/useDiagram';
|
|
6
|
+
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi, type XYFlowInstance, type XYStoreApi, } from '../hooks/useXYFlow';
|
|
7
7
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from '../likec4model/useLikeC4Model';
|
|
8
8
|
export { useMantinePortalProps } from '../hooks/useMantinePortalProps';
|
|
9
9
|
export { useSetState } from '../hooks/useSetState';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, viewGroupNode } from './customNodes.js';
|
|
2
|
+
export { CompoundActionButton } from '../base/primitives/compound/CompoundActionButton.js';
|
|
3
|
+
export { CompoundDetailsButton } from '../base/primitives/compound/CompoundDetailsButton.js';
|
|
4
|
+
export { CompoundNodeContainer } from '../base/primitives/compound/CompoundNodeContainer.js';
|
|
5
|
+
export { CompoundTitle } from '../base/primitives/compound/CompoundTitle.js';
|
|
6
|
+
export { DefaultHandles } from '../base/primitives/NodeHandles.js';
|
|
7
|
+
export { ElementActionButtons } from '../base/primitives/element/ElementActionButtons.js';
|
|
8
|
+
export { ElementDetailsButton } from '../base/primitives/element/ElementDetailsButton.js';
|
|
9
|
+
export { ElementNodeContainer } from '../base/primitives/element/ElementNodeContainer.js';
|
|
10
|
+
export { ElementShape } from '../base/primitives/element/ElementShape.js';
|
|
11
|
+
export { ElementTag, ElementTags } from '../base/primitives/element/ElementTags.js';
|
|
12
|
+
export { ElementTitle } from '../base/primitives/element/ElementTitle.js';
|
|
13
|
+
export { MarkdownBlock } from '../base/primitives/MarkdownBlock.js';
|
|
14
|
+
export { IconOrShapeRenderer, IconRenderer, IconRendererProvider } from '../context/IconRenderer.js';
|
|
15
|
+
export { CompoundActions } from '../likec4diagram/custom/nodes/CompoundActions.js';
|
|
16
|
+
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode } from '../likec4diagram/custom/nodes/nodes.js';
|
|
17
|
+
export { CompoundDeploymentToolbar, CompoundElementToolbar } from '../likec4diagram/custom/nodes/toolbar/CompoundToolbar.js';
|
|
18
|
+
export { DeploymentElementActions, ElementActions } from '../likec4diagram/custom/nodes/ElementActions.js';
|
|
19
|
+
export { DeploymentElementToolbar, ElementToolbar } from '../likec4diagram/custom/nodes/toolbar/ElementToolbar.js';
|
|
20
|
+
export { Toolbar } from '../likec4diagram/custom/nodes/toolbar/Toolbar.js';
|
|
21
|
+
export { IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures } from '../context/DiagramFeatures.js';
|
|
22
|
+
export { Overlay } from '../overlays/overlay/Overlay.js';
|
|
23
|
+
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
24
|
+
export { useCurrentViewId } from '../hooks/useCurrentViewId.js';
|
|
25
|
+
export { useDiagram, useDiagramContext } from '../hooks/useDiagram.js';
|
|
26
|
+
export { useDiagramActorRef } from '../hooks/safeContext.js';
|
|
27
|
+
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from '../hooks/useXYFlow.js';
|
|
28
|
+
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../likec4model/useLikeC4Model.js';
|
|
29
|
+
export { useMantinePortalProps } from '../hooks/useMantinePortalProps.js';
|
|
30
|
+
export { useSetState } from '../hooks/useSetState.js';
|
|
31
|
+
export { useUpdateEffect } from '../hooks/useUpdateEffect.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactFlowInstance, ReactFlowState, InternalNode } from '@xyflow/react';
|
|
2
2
|
import { Types } from '../likec4diagram/types';
|
|
3
3
|
import { EdgeMarkerType, HandleType, XYPosition } from '@xyflow/system';
|
|
4
4
|
import { ReactNode, CSSProperties } from 'react';
|
|
@@ -51,6 +51,7 @@ export declare const useXYFlow: () => ReactFlowInstance<Types.Node, {
|
|
|
51
51
|
controlPoints: XYPosition[] | undefined | null;
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
|
+
export type XYFlowInstance = ReactFlowInstance<Types.Node, Types.Edge>;
|
|
54
55
|
export declare function useXYStore<StateSlice = unknown>(selector: (state: ReactFlowState<Types.Node, Types.Edge>) => StateSlice, equalityFn?: (a: NoInfer<StateSlice>, b: NoInfer<StateSlice>) => boolean): StateSlice;
|
|
55
56
|
export declare const useXYStoreApi: () => {
|
|
56
57
|
getState: () => ReactFlowState<Types.Node, {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export type { ControlsCustomLayout, ControlsCustomLayoutProps } from './context/ControlsCustomLayout';
|
|
2
2
|
export { FramerMotionConfig } from './context/FramerMotionConfig';
|
|
3
3
|
export { IconRendererProvider } from './context/IconRenderer';
|
|
4
|
-
export { LikeC4Diagram } from './LikeC4Diagram';
|
|
5
|
-
export type
|
|
6
|
-
export {
|
|
7
|
-
export { LikeC4ModelProvider } from './LikeC4ModelProvider';
|
|
4
|
+
export { LikeC4Diagram, type LikeC4DiagramProps, } from './LikeC4Diagram';
|
|
5
|
+
export { Overlay, type OverlayProps, } from './overlays/overlay/Overlay';
|
|
6
|
+
export { LikeC4ModelProvider, type LikeC4ModelProviderProps, } from './LikeC4ModelProvider';
|
|
8
7
|
export * from './custom/hooks';
|
|
9
8
|
export type { ChangeEvent, CustomNodes, DiagramNodeWithNavigate, ElementIconRenderer, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, OnCanvasClick, OnChange, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, PaddingUnit, PaddingWithUnit, WhereOperator, } from './LikeC4Diagram.props';
|
|
10
|
-
export { StaticLikeC4Diagram } from './StaticLikeC4Diagram';
|
|
11
|
-
export type { StaticLikeC4DiagramProps } from './StaticLikeC4Diagram';
|
|
9
|
+
export { StaticLikeC4Diagram, type StaticLikeC4DiagramProps, } from './StaticLikeC4Diagram';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { useDiagramEventHandlers } from './context/DiagramEventHandlers.js';
|
|
|
8
8
|
export { useEnabledFeatures } from './context/DiagramFeatures.js';
|
|
9
9
|
export { useCurrentViewId } from './hooks/useCurrentViewId.js';
|
|
10
10
|
export { useDiagram, useDiagramContext } from './hooks/useDiagram.js';
|
|
11
|
+
export { useDiagramActorRef } from './hooks/safeContext.js';
|
|
11
12
|
export { useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from './hooks/useXYFlow.js';
|
|
12
13
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from './likec4model/useLikeC4Model.js';
|
|
13
14
|
export { useMantinePortalProps } from './hooks/useMantinePortalProps.js';
|
|
@@ -2,7 +2,6 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
|
2
2
|
import { nameFromFqn } from '@likec4/core';
|
|
3
3
|
import { cx, css } from '@likec4/styles/css';
|
|
4
4
|
import { Menu, MenuTarget, MenuDropdown, MenuLabel, MenuDivider, Box, ActionIcon, MenuItem, Stack, Group, Text, TooltipGroup, Space, Tooltip as Tooltip$1 } from '@mantine/core';
|
|
5
|
-
import { IconInfoCircle, IconArrowRight, IconZoomScan, IconFileSymlink } from '@tabler/icons-react';
|
|
6
5
|
import { memo, useCallback, Fragment as Fragment$1, forwardRef } from 'react';
|
|
7
6
|
import { pipe, map, filter, isTruthy, partition } from 'remeda';
|
|
8
7
|
import { Link } from '../../../components/Link.js';
|
|
@@ -11,8 +10,12 @@ import { findDiagramNode, findDiagramEdge } from '../../../state/utils.js';
|
|
|
11
10
|
import { menuDropdown, endpoint, title, menuItemRelationship } from './RelationshipsDropdownMenu.css.js';
|
|
12
11
|
import { useLikeC4Model } from '../../../likec4model/useLikeC4Model.js';
|
|
13
12
|
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
13
|
+
import IconInfoCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js';
|
|
14
14
|
import { useEnabledFeatures, IfEnabled } from '../../../context/DiagramFeatures.js';
|
|
15
15
|
import { useDiagramEventHandlers } from '../../../context/DiagramEventHandlers.js';
|
|
16
|
+
import IconArrowRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js';
|
|
17
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
18
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
16
19
|
|
|
17
20
|
const stopPropagation = (e) => e.stopPropagation();
|
|
18
21
|
const Tooltip = Tooltip$1.withProps({
|
|
@@ -192,7 +195,7 @@ const Relationship = forwardRef(({
|
|
|
192
195
|
] })
|
|
193
196
|
] }),
|
|
194
197
|
/* @__PURE__ */ jsx(Box, { className: title, children: r.title || "untitled" }),
|
|
195
|
-
r.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: r.description }),
|
|
198
|
+
r.description.nonEmpty && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: r.description.text }),
|
|
196
199
|
links.length > 0 && /* @__PURE__ */ jsx(
|
|
197
200
|
Stack,
|
|
198
201
|
{
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { hasAtLeast } from '@likec4/core';
|
|
3
|
-
import { IconZoomScan, IconTransform } from '@tabler/icons-react';
|
|
4
3
|
import { useMemo } from 'react';
|
|
5
4
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
6
5
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
6
|
+
import IconZoomScan from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
7
|
+
import IconTransform from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
7
8
|
import { ElementActionButtons } from '../../../base/primitives/element/ElementActionButtons.js';
|
|
8
9
|
|
|
9
10
|
const ElementActions = ({
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
3
3
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
4
4
|
import { CompoundActions } from './CompoundActions.js';
|
|
5
5
|
import { DeploymentElementActions, ElementActions } from './ElementActions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { CompoundElementToolbar, CompoundDeploymentToolbar } from './toolbar/CompoundToolbar.js';
|
|
7
7
|
import { DeploymentElementToolbar, ElementToolbar } from './toolbar/ElementToolbar.js';
|
|
8
8
|
import { customNode } from '../../../base/primitives/customNode.js';
|
|
9
|
+
import { CompoundDetailsButton } from '../../../base/primitives/compound/CompoundDetailsButton.js';
|
|
9
10
|
import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
|
|
10
11
|
import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.js';
|
|
11
12
|
import { DefaultHandles } from '../../../base/primitives/NodeHandles.js';
|
|
@@ -13,7 +14,6 @@ import { ElementNodeContainer } from '../../../base/primitives/element/ElementNo
|
|
|
13
14
|
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
14
15
|
import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
|
|
15
16
|
import { ElementTags } from '../../../base/primitives/element/ElementTags.js';
|
|
16
|
-
import { CompoundDetailsButton } from '../../../base/primitives/compound/CompoundDetailsButton.js';
|
|
17
17
|
import { ElementDetailsButton } from '../../../base/primitives/element/ElementDetailsButton.js';
|
|
18
18
|
|
|
19
19
|
function ElementDetailsButtonWithHandler(props) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ElementShapes } from '@likec4/core';
|
|
3
3
|
import { Menu, MenuTarget, Button, MenuDropdown, MenuItem } from '@mantine/core';
|
|
4
|
-
import { IconSelector, IconCheck } from '@tabler/icons-react';
|
|
5
4
|
import { useEnabledFeatures } from '../../../../context/DiagramFeatures.js';
|
|
6
5
|
import { stopPropagation } from '../../../../utils/xyflow.js';
|
|
7
6
|
import { useHandlers, GoToSourceButton, BrowseRelationshipsButton } from './_shared.js';
|
|
8
7
|
import { ColorButton } from './ColorButton.js';
|
|
9
8
|
import { Toolbar } from './Toolbar.js';
|
|
9
|
+
import IconSelector from '../../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js';
|
|
10
|
+
import IconCheck from '../../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
10
11
|
|
|
11
12
|
function ElementToolbar(props) {
|
|
12
13
|
const { enableVscode, enableRelationshipBrowser } = useEnabledFeatures();
|
|
@@ -2,11 +2,12 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { invariant, defaultTheme } from '@likec4/core';
|
|
3
3
|
import { Tooltip as Tooltip$1, ActionIcon } from '@mantine/core';
|
|
4
4
|
import { useCallbackRef } from '@mantine/hooks';
|
|
5
|
-
import { IconFileSymlink, IconTransform } from '@tabler/icons-react';
|
|
6
5
|
import { useState } from 'react';
|
|
7
6
|
import { keys } from 'remeda';
|
|
8
7
|
import { useDiagram } from '../../../../hooks/useDiagram.js';
|
|
9
8
|
import { useDiagramEventHandlers } from '../../../../context/DiagramEventHandlers.js';
|
|
9
|
+
import IconFileSymlink from '../../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
10
|
+
import IconTransform from '../../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js';
|
|
10
11
|
|
|
11
12
|
const {
|
|
12
13
|
primary,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeploymentFqn, DiagramEdge, DiagramNode, Fqn, IconUrl, ViewId } from '@likec4/core/types';
|
|
1
|
+
import { DeploymentFqn, DiagramEdge, DiagramNode, Fqn, IconUrl, RichTextOrEmpty, ViewId } from '@likec4/core/types';
|
|
2
2
|
import { XYPosition } from '@xyflow/system';
|
|
3
3
|
import { OptionalKeysOf, Simplify } from 'type-fest';
|
|
4
4
|
import { Base, ReactFlowEdge, ReactFlowNode } from '../base/types';
|
|
@@ -8,7 +8,8 @@ type NonOptional<T extends object> = Simplify<{
|
|
|
8
8
|
[P in OptionalKeysOf<T>]-?: T[P] | undefined;
|
|
9
9
|
}>;
|
|
10
10
|
export declare namespace Types {
|
|
11
|
-
type LeafNodeData = Base.NodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'technology' | '
|
|
11
|
+
type LeafNodeData = Base.NodeData & NonOptional<Pick<DiagramNode, 'id' | 'title' | 'technology' | 'color' | 'shape' | 'width' | 'level' | 'height' | 'style' | 'tags' | 'position'>> & {
|
|
12
|
+
description: RichTextOrEmpty;
|
|
12
13
|
/**
|
|
13
14
|
* View this node belongs to
|
|
14
15
|
*/
|
|
@@ -2,12 +2,12 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Popover, PopoverTarget, PopoverDropdown, Box, FloatingIndicator, Text, Flex, UnstyledButton } from '@mantine/core';
|
|
3
3
|
import { useHover, useUncontrolled, clampUseMovePosition, useMove, useMergedRef } from '@mantine/hooks';
|
|
4
4
|
import { useDebouncedCallback } from '@react-hookz/web';
|
|
5
|
-
import { IconLayoutDashboard } from '@tabler/icons-react';
|
|
6
5
|
import { useState, forwardRef } from 'react';
|
|
7
6
|
import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
8
7
|
import { Tooltip, ActionIcon } from './_shared.js';
|
|
9
8
|
import { autolayoutIndicator, autolayoutButton, spacingSliderBody, spacingSliderThumb } from './styles.css.js';
|
|
10
9
|
import { useDiagramEventHandlers } from '../../../context/DiagramEventHandlers.js';
|
|
10
|
+
import IconLayoutDashboard from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js';
|
|
11
11
|
|
|
12
12
|
const selector = (state) => ({
|
|
13
13
|
viewId: state.view.id,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { ActionIconGroup, Group, Stack, Box, Badge, Loader } from '@mantine/core';
|
|
4
|
-
import { IconFileSymlink, IconFocusCentered, IconMenu2 } from '@tabler/icons-react';
|
|
5
4
|
import { m, LayoutGroup } from 'motion/react';
|
|
6
5
|
import { memo } from 'react';
|
|
7
6
|
import { SearchControl } from '../../../components/SearchControl.js';
|
|
@@ -17,6 +16,9 @@ import { ToggleReadonly } from './ToggleReadonly.js';
|
|
|
17
16
|
import { useDiagramEventHandlers } from '../../../context/DiagramEventHandlers.js';
|
|
18
17
|
import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
|
|
19
18
|
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
19
|
+
import IconFileSymlink from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js';
|
|
20
|
+
import IconFocusCentered from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js';
|
|
21
|
+
import IconMenu2 from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu2.js';
|
|
20
22
|
import { stopPropagation } from '../../../utils/xyflow.js';
|
|
21
23
|
|
|
22
24
|
const ControlsDefaultLayout = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { HoverCard, HoverCardTarget, HoverCardDropdown, Notification, Text, Code } from '@mantine/core';
|
|
3
|
-
import { IconAlertTriangle } from '@tabler/icons-react';
|
|
4
3
|
import { css } from '@likec4/styles/css';
|
|
5
4
|
import { ActionIcon } from './_shared.js';
|
|
5
|
+
import IconAlertTriangle from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js';
|
|
6
6
|
|
|
7
7
|
const LayoutDriftNotification = (props) => /* @__PURE__ */ jsxs(
|
|
8
8
|
HoverCard,
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Popover, PopoverTarget, PopoverDropdown, Group, ActionIconGroup } from '@mantine/core';
|
|
3
|
-
import { IconLayoutCollage, IconLayoutBoardSplit, IconLayoutAlignLeft, IconLayoutAlignCenter, IconLayoutAlignRight, IconLayoutAlignTop, IconLayoutAlignMiddle, IconLayoutAlignBottom, IconRouteOff } from '@tabler/icons-react';
|
|
4
3
|
import { useDiagram } from '../../../hooks/useDiagram.js';
|
|
5
4
|
import { Tooltip, ActionIcon } from './_shared.js';
|
|
5
|
+
import IconLayoutCollage from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js';
|
|
6
|
+
import IconLayoutBoardSplit from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js';
|
|
7
|
+
import IconLayoutAlignLeft from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js';
|
|
8
|
+
import IconLayoutAlignCenter from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js';
|
|
9
|
+
import IconLayoutAlignRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js';
|
|
10
|
+
import IconLayoutAlignTop from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js';
|
|
11
|
+
import IconLayoutAlignMiddle from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js';
|
|
12
|
+
import IconLayoutAlignBottom from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js';
|
|
13
|
+
import IconRouteOff from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js';
|
|
6
14
|
|
|
7
15
|
const Action = ({
|
|
8
16
|
label,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
|
|
3
2
|
import { AnimatePresence, m } from 'motion/react';
|
|
4
3
|
import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
5
4
|
import { ActionIcon } from './_shared.js';
|
|
5
|
+
import IconChevronLeft from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js';
|
|
6
|
+
import IconChevronRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
6
7
|
|
|
7
8
|
const NavigationButtons = () => {
|
|
8
9
|
const diagram = useDiagram();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { IconLock, IconLockOpen2 } from '@tabler/icons-react';
|
|
3
2
|
import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
4
3
|
import { Tooltip, ActionIcon } from './_shared.js';
|
|
4
|
+
import IconLock from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js';
|
|
5
|
+
import IconLockOpen2 from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js';
|
|
5
6
|
|
|
6
7
|
const selector = (state) => ({
|
|
7
8
|
visible: state.features.enableReadOnly !== true,
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { RichText } from '@likec4/core/types';
|
|
2
3
|
import { cx } from '@likec4/styles/css';
|
|
3
4
|
import { Card, CardSection, Button, Group, Text, Spoiler, Stack } from '@mantine/core';
|
|
4
5
|
import { useLocalStorage } from '@mantine/hooks';
|
|
5
|
-
import { IconMenu } from '@tabler/icons-react';
|
|
6
6
|
import { AnimatePresence, m } from 'motion/react';
|
|
7
7
|
import { Link } from '../../../components/Link.js';
|
|
8
8
|
import { useDiagramContext } from '../../../hooks/useDiagram.js';
|
|
9
9
|
import { card, title, description } from './DiagramTitlePanel.css.js';
|
|
10
|
+
import IconMenu from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconMenu.js';
|
|
11
|
+
import { MarkdownBlock } from '../../../base/primitives/MarkdownBlock.js';
|
|
10
12
|
|
|
13
|
+
function selector(context) {
|
|
14
|
+
return {
|
|
15
|
+
id: context.view.id,
|
|
16
|
+
title: context.view.title ?? "untitled",
|
|
17
|
+
description: RichText.from(context.view.description),
|
|
18
|
+
links: context.view.links,
|
|
19
|
+
isNotActiveWalkthrough: context.activeWalkthrough === null
|
|
20
|
+
};
|
|
21
|
+
}
|
|
11
22
|
function DiagramTitlePanel() {
|
|
12
|
-
const { id, title: title$1, description: description$1, links, isNotActiveWalkthrough } = useDiagramContext(
|
|
13
|
-
id: s.view.id,
|
|
14
|
-
title: s.view.title ?? "untitled",
|
|
15
|
-
description: s.view.description,
|
|
16
|
-
links: s.view.links,
|
|
17
|
-
isNotActiveWalkthrough: s.activeWalkthrough === null
|
|
18
|
-
}));
|
|
23
|
+
const { id, title: title$1, description: description$1, links, isNotActiveWalkthrough } = useDiagramContext(selector);
|
|
19
24
|
const [isCollapsed, setCollapsed] = useLocalStorage({
|
|
20
25
|
key: "diagram-title-webview-collapsed",
|
|
21
26
|
defaultValue: false
|
|
@@ -111,24 +116,23 @@ function DiagramTitlePanel() {
|
|
|
111
116
|
}
|
|
112
117
|
)
|
|
113
118
|
] }),
|
|
114
|
-
description$1 && /* @__PURE__ */ jsx(
|
|
119
|
+
description$1.nonEmpty && /* @__PURE__ */ jsx(
|
|
115
120
|
Spoiler,
|
|
116
121
|
{
|
|
117
|
-
maxHeight:
|
|
122
|
+
maxHeight: 60,
|
|
118
123
|
showLabel: /* @__PURE__ */ jsx(Button, { component: "div", color: "gray", variant: "light", fz: "10", size: "compact-xs", tabIndex: -1, children: "show more" }),
|
|
119
124
|
hideLabel: /* @__PURE__ */ jsx(Button, { component: "div", color: "gray", variant: "light", fz: "10", size: "compact-xs", tabIndex: -1, children: "hide" }),
|
|
120
125
|
children: /* @__PURE__ */ jsx(
|
|
121
|
-
|
|
126
|
+
MarkdownBlock,
|
|
122
127
|
{
|
|
123
|
-
component: "div",
|
|
124
|
-
size: "sm",
|
|
125
128
|
className: description,
|
|
126
|
-
|
|
129
|
+
textScale: 0.9,
|
|
130
|
+
value: description$1
|
|
127
131
|
}
|
|
128
132
|
)
|
|
129
133
|
}
|
|
130
134
|
),
|
|
131
|
-
|
|
135
|
+
description$1.isEmpty && /* @__PURE__ */ jsx(
|
|
132
136
|
Text,
|
|
133
137
|
{
|
|
134
138
|
component: "div",
|
|
@@ -2,7 +2,6 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { cx, css } from '@likec4/styles/css';
|
|
3
3
|
import { Tooltip, ThemeIcon, ActionIcon, Paper, Tabs, TabsList, TabsTab, TabsPanel, ScrollAreaAutosize, Stack, Card, Group, Box, Badge, Text } from '@mantine/core';
|
|
4
4
|
import { useLocalStorage } from '@mantine/hooks';
|
|
5
|
-
import { IconAlertTriangle, IconHelpCircle, IconArrowDownRight } from '@tabler/icons-react';
|
|
6
5
|
import { AnimatePresence, m } from 'motion/react';
|
|
7
6
|
import { memo, useState } from 'react';
|
|
8
7
|
import { ceil, isNonNullish } from 'remeda';
|
|
@@ -10,6 +9,9 @@ import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
|
10
9
|
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
11
10
|
import { container, icon, card, tabPanel, shapeBadge, elementNotation } from './NotationPanel.css.js';
|
|
12
11
|
import { useMantinePortalProps } from '../../../hooks/useMantinePortalProps.js';
|
|
12
|
+
import IconAlertTriangle from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js';
|
|
13
|
+
import IconHelpCircle from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js';
|
|
14
|
+
import IconArrowDownRight from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js';
|
|
13
15
|
import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
|
|
14
16
|
|
|
15
17
|
const ElementNotation = ({ value }) => {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { Box, Button, Badge, ButtonGroup } from '@mantine/core';
|
|
4
|
-
import { IconPlayerPlayFilled, IconPlayerSkipBackFilled, IconPlayerStopFilled, IconPlayerSkipForwardFilled } from '@tabler/icons-react';
|
|
5
4
|
import { AnimatePresence, m } from 'motion/react';
|
|
6
5
|
import { isTruthy, isNonNull } from 'remeda';
|
|
7
6
|
import { useDiagramContext, useDiagram } from '../../../hooks/useDiagram.js';
|
|
8
7
|
import { parallelStateFrame, btn, buttons, container } from './DynamicViewWalkthrough.css.js';
|
|
9
8
|
import { useXYStore } from '../../../hooks/useXYFlow.js';
|
|
9
|
+
import IconPlayerPlayFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js';
|
|
10
|
+
import IconPlayerSkipBackFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js';
|
|
11
|
+
import IconPlayerStopFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js';
|
|
12
|
+
import IconPlayerSkipForwardFilled from '../../../node_modules/.pnpm/@tabler_icons-react@3.31.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js';
|
|
10
13
|
|
|
11
14
|
function DynamicViewWalkthrough() {
|
|
12
15
|
const isMobile = useXYStore((s) => s.width <= 750);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Queue, whereOperatorAsPredicate, nonNullable, GroupElementKind, invariant } from '@likec4/core';
|
|
1
|
+
import { Queue, whereOperatorAsPredicate, nonNullable, GroupElementKind, RichText, invariant } from '@likec4/core';
|
|
2
2
|
import { useCustomCompareMemo } from '@react-hookz/web';
|
|
3
3
|
import { shallowEqual, deepEqual } from 'fast-equals';
|
|
4
4
|
import { pick, hasAtLeast } from 'remeda';
|
|
@@ -88,7 +88,7 @@ function viewToNodesEdge(opts) {
|
|
|
88
88
|
id: node.id,
|
|
89
89
|
title: node.title,
|
|
90
90
|
technology: node.technology,
|
|
91
|
-
description: node.description,
|
|
91
|
+
description: RichText.from(node.description),
|
|
92
92
|
height: node.height,
|
|
93
93
|
width: node.width,
|
|
94
94
|
level: node.level,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
|
2
|
+
import defaultAttributes from './defaultAttributes.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license @tabler/icons-react v3.31.0 - MIT
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license.
|
|
8
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
13
|
+
const Component = forwardRef(
|
|
14
|
+
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement(
|
|
15
|
+
"svg",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
...defaultAttributes[type],
|
|
19
|
+
width: size,
|
|
20
|
+
height: size,
|
|
21
|
+
className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(" "),
|
|
22
|
+
...type === "filled" ? {
|
|
23
|
+
fill: color
|
|
24
|
+
} : {
|
|
25
|
+
strokeWidth: stroke,
|
|
26
|
+
stroke: color
|
|
27
|
+
},
|
|
28
|
+
...rest
|
|
29
|
+
},
|
|
30
|
+
[
|
|
31
|
+
title && createElement("title", { key: "svg-title" }, title),
|
|
32
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
33
|
+
...Array.isArray(children) ? children : [children]
|
|
34
|
+
]
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
Component.displayName = `${iconNamePascal}`;
|
|
38
|
+
return Component;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { createReactComponent as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @tabler/icons-react v3.31.0 - MIT
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var defaultAttributes = {
|
|
9
|
+
outline: {
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
width: 24,
|
|
12
|
+
height: 24,
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
fill: "none",
|
|
15
|
+
stroke: "currentColor",
|
|
16
|
+
strokeWidth: 2,
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
},
|
|
20
|
+
filled: {
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 24,
|
|
23
|
+
height: 24,
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
fill: "currentColor",
|
|
26
|
+
stroke: "none"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { defaultAttributes as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import createReactComponent from '../createReactComponent.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license @tabler/icons-react v3.31.0 - MIT
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var IconAlertTriangle = createReactComponent("outline", "alert-triangle", "IconAlertTriangle", [["path", { "d": "M12 9v4", "key": "svg-0" }], ["path", { "d": "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]]);
|
|
12
|
+
|
|
13
|
+
export { IconAlertTriangle as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import createReactComponent from '../createReactComponent.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license @tabler/icons-react v3.31.0 - MIT
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var IconArrowDownRight = createReactComponent("outline", "arrow-down-right", "IconArrowDownRight", [["path", { "d": "M7 7l10 10", "key": "svg-0" }], ["path", { "d": "M17 8l0 9l-9 0", "key": "svg-1" }]]);
|
|
12
|
+
|
|
13
|
+
export { IconArrowDownRight as default };
|