@likec4/diagram 1.43.0 → 1.45.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 +14727 -13166
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +14 -9
- package/dist/LikeC4Diagram.props.d.ts +25 -15
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +8 -3
- package/dist/LikeC4View.js +29 -14
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/ReactLikeC4.js +2 -2
- package/dist/StaticLikeC4Diagram.js +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +25 -14
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -17
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +8 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +29 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +6 -4
- package/dist/base-primitives/element/ElementActionButtons.js +3 -3
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +25 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +3 -19
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +3 -3
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +5 -5
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +65 -0
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +60 -52
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +256 -217
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +9 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +50 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +74 -29
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -10
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +95 -70
- package/dist/likec4diagram/state/assign.d.ts +13 -7
- package/dist/likec4diagram/state/assign.js +43 -282
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +79 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +109 -0
- package/dist/likec4diagram/state/diagram-api.js +126 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +1783 -0
- package/dist/likec4diagram/state/machine.actions.js +644 -0
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +22 -0
- package/dist/likec4diagram/state/machine.js +127 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +327 -0
- package/dist/likec4diagram/state/machine.setup.js +93 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +208 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +14 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +178 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3131 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +262 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +31 -108
- package/dist/likec4diagram/state/syncManualLayoutActor.js +278 -142
- package/dist/likec4diagram/state/types.d.ts +7 -12
- package/dist/likec4diagram/state/utils.d.ts +19 -4
- package/dist/likec4diagram/state/utils.js +47 -4
- package/dist/likec4diagram/types.d.ts +8 -8
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +237 -61
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +14 -17
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +16 -8
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +9 -205
- package/dist/navigationpanel/actor.js +6 -5
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +26 -18
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +68 -50
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +7 -5
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -82
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -150
- package/dist/overlays/overlaysActor.js +183 -161
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -550
- package/dist/overlays/relationship-details/actor.js +18 -3
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -673
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +8 -6
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +83 -21
- package/dist/utils/vector.js +98 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +58 -0
- package/dist/utils/xyflow.d.ts +52 -8
- package/dist/utils/xyflow.js +31 -11
- package/package.json +26 -24
- package/panda.buildinfo.json +124 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
package/dist/LikeC4Diagram.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type LikeC4DiagramProps<A extends Any = Any> = PropsWithChildren<LikeC4Di
|
|
|
8
8
|
*
|
|
9
9
|
* Use {@link ReactLikeC4} or {@link LikeC4View} for ready-to-use component
|
|
10
10
|
*/
|
|
11
|
-
export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onBurgerMenuClick, onInitialized, view, className, readonly, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, nodesDraggable, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight,
|
|
11
|
+
export declare function LikeC4Diagram<A extends Any = Any>({ onCanvasClick, onCanvasContextMenu, onCanvasDblClick, onEdgeClick, onChange, onEdgeContextMenu, onNavigateTo, onNodeClick, onNodeContextMenu, onOpenSource, onBurgerMenuClick, onLayoutTypeChange, onInitialized, view, className, readonly, controls, fitView, fitViewPadding: _fitViewPadding, pannable, zoomable, background, enableElementTags, enableFocusMode, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, enableCompareWithLatest, nodesDraggable, nodesSelectable, enableNotations, showNavigationButtons, enableDynamicViewWalkthrough, dynamicViewVariant, enableSearch, initialWidth, initialHeight, reduceGraphics, renderIcon, where, reactFlowProps, renderNodes, children, }: LikeC4DiagramProps<A>): import("react/jsx-runtime").JSX.Element;
|
package/dist/LikeC4Diagram.js
CHANGED
|
@@ -11,7 +11,7 @@ import { LikeC4DiagramUI } from './likec4diagram/DiagramUI.js';
|
|
|
11
11
|
import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
|
|
12
12
|
import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
|
|
13
13
|
import { LikeC4Styles } from './LikeC4Styles.js';
|
|
14
|
-
import {
|
|
14
|
+
import { pickViewBounds } from './utils/view-bounds.js';
|
|
15
15
|
import { MinZoom, MaxZoom, FitViewPaddings } from './base/const.js';
|
|
16
16
|
import { EnsureMantine } from './context/EnsureMantine.js';
|
|
17
17
|
import { FramerMotionConfig } from './context/FramerMotionConfig.js';
|
|
@@ -31,6 +31,7 @@ function LikeC4Diagram({
|
|
|
31
31
|
onNodeContextMenu,
|
|
32
32
|
onOpenSource,
|
|
33
33
|
onBurgerMenuClick,
|
|
34
|
+
onLayoutTypeChange,
|
|
34
35
|
onInitialized,
|
|
35
36
|
view,
|
|
36
37
|
className,
|
|
@@ -46,6 +47,7 @@ function LikeC4Diagram({
|
|
|
46
47
|
enableElementDetails = false,
|
|
47
48
|
enableRelationshipDetails = false,
|
|
48
49
|
enableRelationshipBrowser = false,
|
|
50
|
+
enableCompareWithLatest = !!onLayoutTypeChange,
|
|
49
51
|
nodesDraggable = !readonly,
|
|
50
52
|
nodesSelectable = !readonly || enableFocusMode || !!onNavigateTo || !!onNodeClick,
|
|
51
53
|
enableNotations = false,
|
|
@@ -55,7 +57,6 @@ function LikeC4Diagram({
|
|
|
55
57
|
enableSearch = false,
|
|
56
58
|
initialWidth,
|
|
57
59
|
initialHeight,
|
|
58
|
-
experimentalEdgeEditing = !readonly,
|
|
59
60
|
reduceGraphics = "auto",
|
|
60
61
|
renderIcon,
|
|
61
62
|
where,
|
|
@@ -65,7 +66,7 @@ function LikeC4Diagram({
|
|
|
65
66
|
}) {
|
|
66
67
|
const id = useId();
|
|
67
68
|
const initialRef = useRef(null);
|
|
68
|
-
const bounds =
|
|
69
|
+
const bounds = pickViewBounds(view, dynamicViewVariant);
|
|
69
70
|
const fitViewPadding = useNormalizedViewPadding(_fitViewPadding);
|
|
70
71
|
if (initialRef.current == null) {
|
|
71
72
|
initialRef.current = {
|
|
@@ -101,11 +102,11 @@ function LikeC4Diagram({
|
|
|
101
102
|
enableSearch,
|
|
102
103
|
enableNavigationButtons: showNavigationButtons && !!onNavigateTo,
|
|
103
104
|
enableDynamicViewWalkthrough: view._type === "dynamic" && enableDynamicViewWalkthrough,
|
|
104
|
-
enableEdgeEditing: experimentalEdgeEditing,
|
|
105
105
|
enableNotations,
|
|
106
106
|
enableVscode: !!onOpenSource,
|
|
107
107
|
enableControls: controls,
|
|
108
|
-
enableElementTags
|
|
108
|
+
enableElementTags,
|
|
109
|
+
enableCompareWithLatest: enableCompareWithLatest && !!onLayoutTypeChange
|
|
109
110
|
},
|
|
110
111
|
children: /* @__PURE__ */ jsxs(
|
|
111
112
|
DiagramEventHandlers,
|
|
@@ -122,7 +123,8 @@ function LikeC4Diagram({
|
|
|
122
123
|
onNodeContextMenu,
|
|
123
124
|
onOpenSource,
|
|
124
125
|
onBurgerMenuClick,
|
|
125
|
-
onInitialized
|
|
126
|
+
onInitialized,
|
|
127
|
+
onLayoutTypeChange
|
|
126
128
|
},
|
|
127
129
|
children: [
|
|
128
130
|
/* @__PURE__ */ jsx(LikeC4Styles, { id }),
|
|
@@ -138,6 +140,7 @@ function LikeC4Diagram({
|
|
|
138
140
|
zoomable,
|
|
139
141
|
pannable,
|
|
140
142
|
fitViewPadding,
|
|
143
|
+
nodesDraggable,
|
|
141
144
|
nodesSelectable,
|
|
142
145
|
where: where ?? null,
|
|
143
146
|
dynamicViewVariant,
|
|
@@ -145,8 +148,6 @@ function LikeC4Diagram({
|
|
|
145
148
|
/* @__PURE__ */ jsx(
|
|
146
149
|
LikeC4DiagramXYFlow,
|
|
147
150
|
{
|
|
148
|
-
nodesDraggable,
|
|
149
|
-
nodesSelectable,
|
|
150
151
|
background,
|
|
151
152
|
reactFlowProps,
|
|
152
153
|
renderNodes,
|
|
@@ -179,7 +180,11 @@ function useNormalizedViewPadding(raw) {
|
|
|
179
180
|
if (isPlainObject(raw)) {
|
|
180
181
|
return mapValues(raw, toLiteralPaddingWithUnit);
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
const v = toLiteralPaddingWithUnit(raw);
|
|
184
|
+
return {
|
|
185
|
+
x: v,
|
|
186
|
+
y: v
|
|
187
|
+
};
|
|
183
188
|
},
|
|
184
189
|
[raw],
|
|
185
190
|
deepEqual
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagramEdge, DiagramNode, DynamicViewDisplayVariant, LayoutedView, ViewChange, WhereOperator } from '@likec4/core/types';
|
|
1
|
+
import { DiagramEdge, DiagramNode, DynamicViewDisplayVariant, LayoutedView, LayoutType, ViewChange, WhereOperator } from '@likec4/core/types';
|
|
2
2
|
import { ReactFlowProps } from '@xyflow/react';
|
|
3
3
|
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
4
4
|
import { CamelCasedProperties, SetRequired } from 'type-fest';
|
|
@@ -29,6 +29,14 @@ export type LikeC4ColorScheme = 'light' | 'dark';
|
|
|
29
29
|
export type OverrideReactFlowProps = Pick<ReactFlowProps<Types.AnyNode, Types.AnyEdge>, 'paneClickDistance' | 'nodeClickDistance' | 'selectionKeyCode' | 'panActivationKeyCode' | 'multiSelectionKeyCode' | 'zoomActivationKeyCode' | 'snapToGrid' | 'snapGrid' | 'onlyRenderVisibleElements' | 'nodesDraggable' | 'nodesFocusable' | 'elementsSelectable' | 'selectNodesOnDrag' | 'panOnDrag' | 'preventScrolling' | 'zoomOnScroll' | 'zoomOnPinch' | 'panOnScroll' | 'panOnScrollSpeed' | 'panOnScrollMode' | 'zoomOnDoubleClick' | 'nodeDragThreshold'>;
|
|
30
30
|
export type PaddingUnit = 'px' | '%';
|
|
31
31
|
export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
|
|
32
|
+
export type ViewPaddings = {
|
|
33
|
+
top?: PaddingWithUnit;
|
|
34
|
+
right?: PaddingWithUnit;
|
|
35
|
+
bottom?: PaddingWithUnit;
|
|
36
|
+
left?: PaddingWithUnit;
|
|
37
|
+
x?: PaddingWithUnit;
|
|
38
|
+
y?: PaddingWithUnit;
|
|
39
|
+
};
|
|
32
40
|
/**
|
|
33
41
|
* Padding around the diagram
|
|
34
42
|
*
|
|
@@ -45,14 +53,7 @@ export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
|
|
|
45
53
|
* y: '16px',
|
|
46
54
|
* }
|
|
47
55
|
*/
|
|
48
|
-
export type ViewPadding = PaddingWithUnit |
|
|
49
|
-
top?: PaddingWithUnit;
|
|
50
|
-
right?: PaddingWithUnit;
|
|
51
|
-
bottom?: PaddingWithUnit;
|
|
52
|
-
left?: PaddingWithUnit;
|
|
53
|
-
x?: PaddingWithUnit;
|
|
54
|
-
y?: PaddingWithUnit;
|
|
55
|
-
};
|
|
56
|
+
export type ViewPadding = PaddingWithUnit | ViewPaddings;
|
|
56
57
|
export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
57
58
|
view: LayoutedView<A>;
|
|
58
59
|
className?: string | undefined;
|
|
@@ -174,6 +175,11 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
174
175
|
* @default false
|
|
175
176
|
*/
|
|
176
177
|
enableDynamicViewWalkthrough?: boolean | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
|
|
180
|
+
* @default true if `onLayoutTypeChange` is set, false otherwise
|
|
181
|
+
*/
|
|
182
|
+
enableCompareWithLatest?: boolean | undefined;
|
|
177
183
|
/**
|
|
178
184
|
* Default dynamic view display variant
|
|
179
185
|
* @default 'diagram'
|
|
@@ -184,11 +190,6 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
184
190
|
* @default false
|
|
185
191
|
*/
|
|
186
192
|
enableElementTags?: boolean | undefined;
|
|
187
|
-
/**
|
|
188
|
-
* Experimental feature to enable edge editing
|
|
189
|
-
* @default false
|
|
190
|
-
*/
|
|
191
|
-
experimentalEdgeEditing?: boolean | undefined;
|
|
192
193
|
/**
|
|
193
194
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
194
195
|
* Enable it if you have a large or static view
|
|
@@ -240,6 +241,7 @@ export type OnEdgeClick<A extends Any = Unknown> = (edge: DiagramEdge<A>, event:
|
|
|
240
241
|
* On pane/canvas click (not on any node or edge)
|
|
241
242
|
*/
|
|
242
243
|
export type OnCanvasClick = (event: ReactMouseEvent) => void;
|
|
244
|
+
export type OnCanvasContextMenu = (event: ReactMouseEvent | MouseEvent) => void;
|
|
243
245
|
export type ChangeEvent = {
|
|
244
246
|
change: ViewChange;
|
|
245
247
|
};
|
|
@@ -248,12 +250,13 @@ export type OnInitialized = (params: {
|
|
|
248
250
|
diagram: DiagramApi;
|
|
249
251
|
xyflow: XYFlowInstance;
|
|
250
252
|
}) => void;
|
|
253
|
+
export type OnLayoutTypeChange = (layoutType: LayoutType) => void;
|
|
251
254
|
export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
|
|
252
255
|
onChange?: OnChange | null | undefined;
|
|
253
256
|
onNavigateTo?: OnNavigateTo<A> | null | undefined;
|
|
254
257
|
onNodeClick?: OnNodeClick<A> | null | undefined;
|
|
255
258
|
onNodeContextMenu?: OnNodeClick<A> | null | undefined;
|
|
256
|
-
onCanvasContextMenu?:
|
|
259
|
+
onCanvasContextMenu?: OnCanvasContextMenu | null | undefined;
|
|
257
260
|
onEdgeClick?: OnEdgeClick<A> | null | undefined;
|
|
258
261
|
onEdgeContextMenu?: OnEdgeClick<A> | null | undefined;
|
|
259
262
|
onCanvasClick?: OnCanvasClick | null | undefined;
|
|
@@ -261,4 +264,11 @@ export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
|
|
|
261
264
|
onBurgerMenuClick?: null | undefined | (() => void);
|
|
262
265
|
onOpenSource?: OnOpenSource<A> | null | undefined;
|
|
263
266
|
onInitialized?: OnInitialized | null | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* Triggered when user changes layout type (e.g. from 'manual' to 'auto')
|
|
269
|
+
* Expected another `view` to be passed to the diagram
|
|
270
|
+
*
|
|
271
|
+
* @param layoutType new layout type
|
|
272
|
+
*/
|
|
273
|
+
onLayoutTypeChange?: OnLayoutTypeChange | null | undefined;
|
|
264
274
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useCallbackRef } from '@mantine/hooks';
|
|
3
2
|
import { useCustomCompareMemo } from '@react-hookz/web';
|
|
4
3
|
import { shallowEqual } from 'fast-equals';
|
|
5
4
|
import { useContext } from 'react';
|
|
6
5
|
import { LikeC4ProjectsContext } from './context/LikeC4ProjectsContext.js';
|
|
6
|
+
import { useCallbackRef } from './hooks/useCallbackRef.js';
|
|
7
7
|
|
|
8
8
|
function LikeC4ProjectsProvider({
|
|
9
9
|
children,
|
package/dist/LikeC4Styles.js
CHANGED
|
@@ -7,7 +7,6 @@ import { useLikeC4Styles } from './hooks/useLikeC4Styles.js';
|
|
|
7
7
|
|
|
8
8
|
const scheme = (scheme2) => `[data-mantine-color-scheme="${scheme2}"]`;
|
|
9
9
|
const whenDark = scheme("dark");
|
|
10
|
-
const whenLight = scheme("light");
|
|
11
10
|
const MAX_DEPTH = 5;
|
|
12
11
|
const generateCompoundColors = (rootSelector, name, colors, depth) => {
|
|
13
12
|
const compoundDarkColor = (color) => toHex(
|
|
@@ -47,8 +46,6 @@ ${selector} {
|
|
|
47
46
|
--likec4-palette-relation-stroke: ${relationships.line};
|
|
48
47
|
--likec4-palette-relation-label: ${relationships.label};
|
|
49
48
|
--likec4-palette-relation-label-bg: ${relationships.labelBg};
|
|
50
|
-
}
|
|
51
|
-
${whenLight} ${selector} {
|
|
52
49
|
--likec4-palette-relation-stroke-selected: ${toRgba(mix(relationships.line, "black", 85))};
|
|
53
50
|
}
|
|
54
51
|
${whenDark} ${selector} {
|
package/dist/LikeC4View.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ElementIconRenderer, NodeRenderers, OverrideReactFlowProps, PaddingWithUnit, ViewPadding } from './LikeC4Diagram.props';
|
|
3
3
|
import type * as t from '@likec4/core/types';
|
|
4
4
|
export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
@@ -159,7 +159,7 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
|
159
159
|
/**
|
|
160
160
|
* Children to render inside the diagram (not inside the browser overlay)
|
|
161
161
|
*/
|
|
162
|
-
children?:
|
|
162
|
+
children?: ReactNode | undefined;
|
|
163
163
|
}
|
|
164
164
|
export interface LikeC4BrowserProps {
|
|
165
165
|
/**
|
|
@@ -230,6 +230,11 @@ export interface LikeC4BrowserProps {
|
|
|
230
230
|
* @default true
|
|
231
231
|
*/
|
|
232
232
|
enableNotations?: boolean | undefined;
|
|
233
|
+
/**
|
|
234
|
+
* Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
|
|
235
|
+
* @default true
|
|
236
|
+
*/
|
|
237
|
+
enableCompareWithLatest?: boolean | undefined;
|
|
233
238
|
/**
|
|
234
239
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
235
240
|
*
|
|
@@ -245,7 +250,7 @@ export interface LikeC4BrowserProps {
|
|
|
245
250
|
/**
|
|
246
251
|
* Children to render inside the browser overlay
|
|
247
252
|
*/
|
|
248
|
-
children?:
|
|
253
|
+
children?: ReactNode | undefined;
|
|
249
254
|
}
|
|
250
255
|
/**
|
|
251
256
|
* Ready-to-use component to display embedded LikeC4 view,
|
package/dist/LikeC4View.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cx, css } from '@likec4/styles/css';
|
|
3
|
-
import { Box
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { Box } from '@likec4/styles/jsx';
|
|
4
|
+
import { ActionIcon } from '@mantine/core';
|
|
5
|
+
import { AnimatePresence } from 'motion/react';
|
|
6
|
+
import { useRef, useState } from 'react';
|
|
6
7
|
import { isBoolean } from 'remeda';
|
|
7
8
|
import { FitViewPaddings } from './base/const.js';
|
|
8
9
|
import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
|
|
9
10
|
import { FramerMotionConfig } from './context/FramerMotionConfig.js';
|
|
11
|
+
import { useCallbackRef } from './hooks/useCallbackRef.js';
|
|
10
12
|
import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
|
|
11
13
|
import { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
12
14
|
import { Overlay } from './overlays/overlay/Overlay.js';
|
|
13
15
|
import { ShadowRoot } from './shadowroot/ShadowRoot.js';
|
|
14
|
-
import {
|
|
15
|
-
import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
16
|
+
import { pickViewBounds } from './utils/view-bounds.js';
|
|
17
|
+
import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
16
18
|
|
|
17
19
|
const cssInteractive = css({
|
|
18
20
|
cursor: "pointer",
|
|
@@ -48,15 +50,23 @@ function LikeC4View({
|
|
|
48
50
|
children,
|
|
49
51
|
...props
|
|
50
52
|
}) {
|
|
53
|
+
const rootRef = useRef(null);
|
|
51
54
|
const likec4model = useOptionalLikeC4Model();
|
|
52
|
-
const [
|
|
55
|
+
const [layoutType, setLayoutType] = useState("manual");
|
|
56
|
+
const [browserViewId, _onNavigateTo] = useState(null);
|
|
57
|
+
const onNavigateTo = useCallbackRef((viewId2) => {
|
|
58
|
+
if (viewId2 && viewId2 !== browserViewId) {
|
|
59
|
+
setLayoutType("manual");
|
|
60
|
+
}
|
|
61
|
+
_onNavigateTo(viewId2);
|
|
62
|
+
});
|
|
53
63
|
const onNavigateToThisView = useCallbackRef(() => {
|
|
54
64
|
onNavigateTo(viewId);
|
|
55
65
|
});
|
|
56
66
|
if (!likec4model) {
|
|
57
67
|
return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you provided LikeC4ModelProvider." });
|
|
58
68
|
}
|
|
59
|
-
const view = likec4model.findView(viewId)?.$
|
|
69
|
+
const view = likec4model.findView(viewId)?.$layouted;
|
|
60
70
|
if (!view) {
|
|
61
71
|
return /* @__PURE__ */ jsx(ViewNotFound, { viewId });
|
|
62
72
|
}
|
|
@@ -67,15 +77,18 @@ function LikeC4View({
|
|
|
67
77
|
'" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
|
|
68
78
|
] });
|
|
69
79
|
}
|
|
70
|
-
const
|
|
80
|
+
const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
|
|
81
|
+
const browserView = layoutType === "manual" ? browserViewModel?.$layouted : browserViewModel?.$view;
|
|
71
82
|
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
72
83
|
const browserViewHasNotations = (browserView?.notation?.nodes?.length ?? 0) > 0;
|
|
73
84
|
const isBrowserEnabled = browser !== false;
|
|
74
85
|
const browserProps = isBoolean(browser) ? {} : browser;
|
|
75
|
-
const bounds =
|
|
86
|
+
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
87
|
+
const root = rootRef.current ? { root: rootRef.current } : void 0;
|
|
76
88
|
return /* @__PURE__ */ jsx(
|
|
77
89
|
ShadowRoot,
|
|
78
90
|
{
|
|
91
|
+
ref: rootRef,
|
|
79
92
|
injectFontCss,
|
|
80
93
|
theme: mantineTheme,
|
|
81
94
|
colorScheme,
|
|
@@ -100,7 +113,7 @@ function LikeC4View({
|
|
|
100
113
|
enableNotations: hasNotations,
|
|
101
114
|
enableDynamicViewWalkthrough,
|
|
102
115
|
showNavigationButtons,
|
|
103
|
-
|
|
116
|
+
enableCompareWithLatest: false,
|
|
104
117
|
enableFocusMode,
|
|
105
118
|
enableRelationshipDetails,
|
|
106
119
|
enableElementDetails,
|
|
@@ -124,7 +137,7 @@ function LikeC4View({
|
|
|
124
137
|
...props
|
|
125
138
|
}
|
|
126
139
|
),
|
|
127
|
-
browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose: () => onNavigateTo(null), children: [
|
|
140
|
+
/* @__PURE__ */ jsx(AnimatePresence, { ...root, children: browserView && /* @__PURE__ */ jsxs(Overlay, { openDelay: 0, onClose: () => onNavigateTo(null), children: [
|
|
128
141
|
/* @__PURE__ */ jsx(
|
|
129
142
|
LikeC4Diagram,
|
|
130
143
|
{
|
|
@@ -141,6 +154,7 @@ function LikeC4View({
|
|
|
141
154
|
enableRelationshipDetails: true,
|
|
142
155
|
enableSearch: true,
|
|
143
156
|
enableElementTags: true,
|
|
157
|
+
enableCompareWithLatest: true,
|
|
144
158
|
controls: true,
|
|
145
159
|
readonly: true,
|
|
146
160
|
nodesDraggable: false,
|
|
@@ -149,10 +163,11 @@ function LikeC4View({
|
|
|
149
163
|
fitViewPadding: FitViewPaddings.withControls,
|
|
150
164
|
...browserProps,
|
|
151
165
|
enableNotations: browserViewHasNotations && (browserProps.enableNotations ?? true),
|
|
152
|
-
renderNodes
|
|
166
|
+
renderNodes,
|
|
167
|
+
onLayoutTypeChange: setLayoutType
|
|
153
168
|
}
|
|
154
169
|
),
|
|
155
|
-
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "
|
|
170
|
+
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", children: /* @__PURE__ */ jsx(
|
|
156
171
|
ActionIcon,
|
|
157
172
|
{
|
|
158
173
|
variant: "default",
|
|
@@ -164,7 +179,7 @@ function LikeC4View({
|
|
|
164
179
|
children: /* @__PURE__ */ jsx(IconX, {})
|
|
165
180
|
}
|
|
166
181
|
) })
|
|
167
|
-
] })
|
|
182
|
+
] }) })
|
|
168
183
|
] })
|
|
169
184
|
}
|
|
170
185
|
);
|
package/dist/ReactLikeC4.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
3
|
import { LikeC4DiagramEventHandlers, LikeC4DiagramProperties } from './LikeC4Diagram.props';
|
|
4
4
|
import type * as t from '@likec4/core/types';
|
|
@@ -26,7 +26,7 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
26
26
|
mantineTheme?: any;
|
|
27
27
|
/** Function to generate nonce attribute added to all generated `<style />` tags */
|
|
28
28
|
styleNonce?: string | (() => string) | undefined;
|
|
29
|
-
children?:
|
|
29
|
+
children?: ReactNode | undefined;
|
|
30
30
|
} & Except<LikeC4DiagramProperties<A>, 'view', {
|
|
31
31
|
requireExactProps: true;
|
|
32
32
|
}> & LikeC4DiagramEventHandlers<A>;
|
package/dist/ReactLikeC4.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
|
|
|
4
4
|
import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
|
|
5
5
|
import { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
6
6
|
import { ShadowRoot } from './shadowroot/ShadowRoot.js';
|
|
7
|
-
import {
|
|
7
|
+
import { pickViewBounds } from './utils/view-bounds.js';
|
|
8
8
|
|
|
9
9
|
function ReactLikeC4({
|
|
10
10
|
viewId,
|
|
@@ -33,7 +33,7 @@ function ReactLikeC4({
|
|
|
33
33
|
'" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
|
|
34
34
|
] });
|
|
35
35
|
}
|
|
36
|
-
const bounds =
|
|
36
|
+
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
37
37
|
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
38
38
|
return /* @__PURE__ */ jsx(
|
|
39
39
|
ShadowRoot,
|
|
@@ -30,7 +30,7 @@ function StaticLikeC4Diagram({
|
|
|
30
30
|
enableRelationshipBrowser,
|
|
31
31
|
enableDynamicViewWalkthrough: false,
|
|
32
32
|
showNavigationButtons: false,
|
|
33
|
-
|
|
33
|
+
enableCompareWithLatest: false,
|
|
34
34
|
enableFocusMode: false,
|
|
35
35
|
enableSearch: false,
|
|
36
36
|
nodesSelectable: false,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { __require as requireXstateActions_cjs } from '../node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js';
|
|
2
|
+
|
|
3
|
+
var xstateActions_cjsExports = requireXstateActions_cjs();
|
|
4
|
+
|
|
5
|
+
export { xstateActions_cjsExports as x };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { __require as requireXstateGuards_cjs } from '../node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js';
|
|
2
|
+
|
|
3
|
+
var xstateGuards_cjsExports = requireXstateGuards_cjs();
|
|
4
|
+
|
|
5
|
+
export { xstateGuards_cjsExports as x };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BackgroundProps } from '@xyflow/react';
|
|
2
|
+
import { NamedExoticComponent } from 'react';
|
|
2
3
|
export type XYBackgroundVariant = 'dots' | 'lines' | 'cross';
|
|
3
4
|
export type XYBackground = XYBackgroundVariant | BackgroundProps;
|
|
4
5
|
export type XYBackgroundProps = {
|
|
5
6
|
background: XYBackground;
|
|
6
7
|
};
|
|
7
|
-
export declare
|
|
8
|
+
export declare const Background: NamedExoticComponent<XYBackgroundProps>;
|
package/dist/base/Background.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { nonexhaustive } from '@likec4/core';
|
|
3
3
|
import { Background as Background$1, BackgroundVariant } from '@xyflow/react';
|
|
4
|
+
import { deepEqual } from 'fast-equals';
|
|
5
|
+
import { memo } from 'react';
|
|
4
6
|
|
|
5
7
|
function literalToEnum(value) {
|
|
6
8
|
switch (value) {
|
|
@@ -14,11 +16,18 @@ function literalToEnum(value) {
|
|
|
14
16
|
nonexhaustive(value);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
const compareProps = (prev, next) => {
|
|
20
|
+
if (typeof prev.background === "string" && typeof next.background === "string") {
|
|
21
|
+
return prev.background === next.background;
|
|
22
|
+
}
|
|
23
|
+
return deepEqual(prev.background, next.background);
|
|
24
|
+
};
|
|
25
|
+
const Background = memo(({ background }) => {
|
|
18
26
|
if (typeof background === "string") {
|
|
19
27
|
return /* @__PURE__ */ jsx(Background$1, { variant: literalToEnum(background), size: 2, gap: 20 });
|
|
20
28
|
}
|
|
21
29
|
return /* @__PURE__ */ jsx(Background$1, { ...background });
|
|
22
|
-
}
|
|
30
|
+
}, compareProps);
|
|
31
|
+
Background.displayName = "Background";
|
|
23
32
|
|
|
24
33
|
export { Background };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type WithDimmed = {
|
|
2
|
+
data: {
|
|
3
|
+
dimmed?: Base.Dimmed;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type WithHovered = {
|
|
7
|
+
data: {
|
|
8
|
+
hovered?: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare function setDimmed<T extends WithDimmed>(value: T, dimmed: 'immediate' | boolean): T;
|
|
12
|
+
declare function setDimmed(dimmed: 'immediate' | boolean): <T extends WithDimmed>(value: T) => T;
|
|
13
|
+
declare function setHovered<T extends WithHovered>(value: T, hovered: boolean): T;
|
|
14
|
+
declare function setHovered(hovered: boolean): <T extends WithHovered>(value: T) => T;
|
|
15
|
+
type WithData<D> = {
|
|
16
|
+
data: D;
|
|
17
|
+
};
|
|
18
|
+
declare function setData<E extends WithData<any>>(value: E, state: Partial<E['data']>): E;
|
|
19
|
+
declare function setData<E extends WithData<any>>(state: Partial<NoInfer<E['data']>>): (value: E) => E;
|
|
20
|
+
export declare const Base: {
|
|
21
|
+
setDimmed: typeof setDimmed;
|
|
22
|
+
setHovered: typeof setHovered;
|
|
23
|
+
setData: typeof setData;
|
|
24
|
+
};
|
|
25
|
+
export declare namespace Base {
|
|
26
|
+
type Dimmed = 'immediate' | boolean;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -4,12 +4,12 @@ import { ViewPadding } from '../LikeC4Diagram.props';
|
|
|
4
4
|
import { XYBackground } from './Background';
|
|
5
5
|
import { BaseEdge, BaseNode } from './types';
|
|
6
6
|
export type BaseXYFlowProps<NodeType extends BaseNode, EdgeType extends BaseEdge> = Simplify<{
|
|
7
|
-
pannable
|
|
8
|
-
zoomable
|
|
9
|
-
nodesSelectable
|
|
10
|
-
nodesDraggable
|
|
7
|
+
pannable: boolean;
|
|
8
|
+
zoomable: boolean;
|
|
9
|
+
nodesSelectable: boolean;
|
|
10
|
+
nodesDraggable: boolean;
|
|
11
11
|
background?: 'transparent' | 'solid' | XYBackground;
|
|
12
12
|
fitViewPadding?: ViewPadding | undefined;
|
|
13
13
|
onViewportResize?: undefined | (() => void);
|
|
14
|
-
} & SetRequired<Omit<ReactFlowProps<NodeType, EdgeType>, 'defaultNodes' | 'defaultEdges' | '
|
|
14
|
+
} & SetRequired<Omit<ReactFlowProps<NodeType, EdgeType>, 'defaultNodes' | 'defaultEdges' | 'fitViewOptions' | 'nodesSelectable' | 'nodesDraggable'>, 'nodes' | 'edges' | 'onNodesChange' | 'onEdgesChange'>>;
|
|
15
15
|
export declare function BaseXYFlow<NodeType extends BaseNode, EdgeType extends BaseEdge>({ nodes, edges, onEdgesChange, onNodesChange, className, pannable, zoomable, nodesSelectable, nodesDraggable, background, children, colorMode, fitViewPadding, fitView, zoomOnDoubleClick, onViewportResize, onMoveEnd, onNodeMouseEnter, onNodeMouseLeave, onEdgeMouseEnter, onEdgeMouseLeave, ...props }: BaseXYFlowProps<NodeType, EdgeType>): import("react/jsx-runtime").JSX.Element;
|