@likec4/diagram 1.42.1 → 1.44.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 +6198 -4860
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +28 -14
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +28 -4
- package/dist/LikeC4View.js +28 -17
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/ReactLikeC4.js +5 -7
- package/dist/StaticLikeC4Diagram.js +2 -2
- 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/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +4 -3
- package/dist/base/updateNodes.js +3 -2
- 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/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -0
- package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
- 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 +9 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- 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 +24 -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 +2 -18
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +4 -4
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -1
- 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 +60 -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 +54 -51
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -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/ElementNodeDrifts.d.ts +4 -0
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
- 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 +5 -7
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
- package/dist/likec4diagram/state/assign.d.ts +4 -2
- package/dist/likec4diagram/state/assign.js +39 -103
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +90 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
- package/dist/likec4diagram/state/diagram-api.js +134 -0
- package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
- package/dist/likec4diagram/state/hotkeyActor.js +17 -1
- package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
- package/dist/likec4diagram/state/machine.actions.js +735 -0
- package/dist/likec4diagram/state/machine.d.ts +3717 -0
- package/dist/likec4diagram/state/machine.js +141 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
- package/dist/likec4diagram/state/machine.setup.js +71 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
- package/dist/likec4diagram/state/machine.state.ready.js +437 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
- package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
- package/dist/likec4diagram/state/types.d.ts +4 -7
- package/dist/likec4diagram/state/utils.d.ts +4 -2
- package/dist/likec4diagram/state/utils.js +4 -1
- package/dist/likec4diagram/types.d.ts +6 -1
- 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.js +10 -12
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +225 -54
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
- package/dist/navigationpanel/NavigationPanel.js +11 -7
- 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 +11 -7
- package/dist/navigationpanel/actor.js +5 -4
- 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 +19 -16
- 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 +10 -10
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
- 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.js +18 -88
- package/dist/overlays/element-details/MetadataValue.d.ts +9 -0
- package/dist/overlays/element-details/MetadataValue.js +261 -0
- 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 +3 -2
- package/dist/overlays/overlaysActor.d.ts +304 -62
- package/dist/overlays/overlaysActor.js +132 -131
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/actor.d.ts +14 -2
- package/dist/overlays/relationship-details/actor.js +23 -5
- 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/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +239 -173
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/const.d.ts +3 -3
- package/dist/overlays/relationships-browser/const.js +3 -3
- 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/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/shadowroot/ShadowRoot.js +53 -12
- package/dist/shadowroot/styles.css.d.ts +0 -4
- package/dist/shadowroot/styles.css.js +1 -41
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +78 -21
- package/dist/utils/vector.js +91 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +57 -0
- package/dist/utils/xyflow.d.ts +49 -7
- package/dist/utils/xyflow.js +63 -11
- package/package.json +28 -27
- package/panda.buildinfo.json +140 -83
- 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,
|
|
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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useCustomCompareMemo } from '@react-hookz/web';
|
|
3
3
|
import { ReactFlowProvider } from '@xyflow/react';
|
|
4
|
-
import { deepEqual } from 'fast-equals';
|
|
5
4
|
import { useRef } from 'react';
|
|
6
5
|
import { isPlainObject, mapValues } from 'remeda';
|
|
7
6
|
import { RootContainer } from './components/RootContainer.js';
|
|
@@ -11,7 +10,7 @@ import { LikeC4DiagramUI } from './likec4diagram/DiagramUI.js';
|
|
|
11
10
|
import { LikeC4DiagramXYFlow } from './likec4diagram/DiagramXYFlow.js';
|
|
12
11
|
import { DiagramActorProvider } from './likec4diagram/state/DiagramActorProvider.js';
|
|
13
12
|
import { LikeC4Styles } from './LikeC4Styles.js';
|
|
14
|
-
import {
|
|
13
|
+
import { pickViewBounds } from './utils/view-bounds.js';
|
|
15
14
|
import { MinZoom, MaxZoom, FitViewPaddings } from './base/const.js';
|
|
16
15
|
import { EnsureMantine } from './context/EnsureMantine.js';
|
|
17
16
|
import { FramerMotionConfig } from './context/FramerMotionConfig.js';
|
|
@@ -31,6 +30,7 @@ function LikeC4Diagram({
|
|
|
31
30
|
onNodeContextMenu,
|
|
32
31
|
onOpenSource,
|
|
33
32
|
onBurgerMenuClick,
|
|
33
|
+
onLayoutTypeChange,
|
|
34
34
|
onInitialized,
|
|
35
35
|
view,
|
|
36
36
|
className,
|
|
@@ -46,16 +46,16 @@ function LikeC4Diagram({
|
|
|
46
46
|
enableElementDetails = false,
|
|
47
47
|
enableRelationshipDetails = false,
|
|
48
48
|
enableRelationshipBrowser = false,
|
|
49
|
+
enableCompareWithLatest = !!onLayoutTypeChange,
|
|
49
50
|
nodesDraggable = !readonly,
|
|
50
51
|
nodesSelectable = !readonly || enableFocusMode || !!onNavigateTo || !!onNodeClick,
|
|
51
|
-
|
|
52
|
+
enableNotations = false,
|
|
52
53
|
showNavigationButtons = !!onNavigateTo,
|
|
53
54
|
enableDynamicViewWalkthrough = false,
|
|
54
55
|
dynamicViewVariant,
|
|
55
56
|
enableSearch = false,
|
|
56
57
|
initialWidth,
|
|
57
58
|
initialHeight,
|
|
58
|
-
experimentalEdgeEditing = !readonly,
|
|
59
59
|
reduceGraphics = "auto",
|
|
60
60
|
renderIcon,
|
|
61
61
|
where,
|
|
@@ -65,7 +65,7 @@ function LikeC4Diagram({
|
|
|
65
65
|
}) {
|
|
66
66
|
const id = useId();
|
|
67
67
|
const initialRef = useRef(null);
|
|
68
|
-
const bounds =
|
|
68
|
+
const bounds = pickViewBounds(view, dynamicViewVariant);
|
|
69
69
|
const fitViewPadding = useNormalizedViewPadding(_fitViewPadding);
|
|
70
70
|
if (initialRef.current == null) {
|
|
71
71
|
initialRef.current = {
|
|
@@ -101,11 +101,11 @@ function LikeC4Diagram({
|
|
|
101
101
|
enableSearch,
|
|
102
102
|
enableNavigationButtons: showNavigationButtons && !!onNavigateTo,
|
|
103
103
|
enableDynamicViewWalkthrough: view._type === "dynamic" && enableDynamicViewWalkthrough,
|
|
104
|
-
|
|
105
|
-
enableNotations: showNotations,
|
|
104
|
+
enableNotations,
|
|
106
105
|
enableVscode: !!onOpenSource,
|
|
107
106
|
enableControls: controls,
|
|
108
|
-
enableElementTags
|
|
107
|
+
enableElementTags,
|
|
108
|
+
enableCompareWithLatest: enableCompareWithLatest && !!onLayoutTypeChange
|
|
109
109
|
},
|
|
110
110
|
children: /* @__PURE__ */ jsxs(
|
|
111
111
|
DiagramEventHandlers,
|
|
@@ -122,7 +122,8 @@ function LikeC4Diagram({
|
|
|
122
122
|
onNodeContextMenu,
|
|
123
123
|
onOpenSource,
|
|
124
124
|
onBurgerMenuClick,
|
|
125
|
-
onInitialized
|
|
125
|
+
onInitialized,
|
|
126
|
+
onLayoutTypeChange
|
|
126
127
|
},
|
|
127
128
|
children: [
|
|
128
129
|
/* @__PURE__ */ jsx(LikeC4Styles, { id }),
|
|
@@ -138,6 +139,7 @@ function LikeC4Diagram({
|
|
|
138
139
|
zoomable,
|
|
139
140
|
pannable,
|
|
140
141
|
fitViewPadding,
|
|
142
|
+
nodesDraggable,
|
|
141
143
|
nodesSelectable,
|
|
142
144
|
where: where ?? null,
|
|
143
145
|
dynamicViewVariant,
|
|
@@ -145,8 +147,6 @@ function LikeC4Diagram({
|
|
|
145
147
|
/* @__PURE__ */ jsx(
|
|
146
148
|
LikeC4DiagramXYFlow,
|
|
147
149
|
{
|
|
148
|
-
nodesDraggable,
|
|
149
|
-
nodesSelectable,
|
|
150
150
|
background,
|
|
151
151
|
reactFlowProps,
|
|
152
152
|
renderNodes,
|
|
@@ -182,8 +182,11 @@ function useNormalizedViewPadding(raw) {
|
|
|
182
182
|
return toLiteralPaddingWithUnit(raw);
|
|
183
183
|
},
|
|
184
184
|
[raw],
|
|
185
|
-
|
|
185
|
+
compareViewPaddingObject
|
|
186
186
|
);
|
|
187
187
|
}
|
|
188
|
+
const compareViewPaddingObject = ([a], [b]) => {
|
|
189
|
+
return a === b || isPlainObject(a) && isPlainObject(b) && a.bottom == b.bottom && a.left == b.left && a.right == b.right && a.top == b.top;
|
|
190
|
+
};
|
|
188
191
|
|
|
189
192
|
export { LikeC4Diagram };
|
|
@@ -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';
|
|
@@ -39,6 +39,11 @@ export type PaddingWithUnit = `${number}${PaddingUnit}` | number;
|
|
|
39
39
|
* bottom: '8px',
|
|
40
40
|
* left: '8px',
|
|
41
41
|
* }
|
|
42
|
+
*
|
|
43
|
+
* {
|
|
44
|
+
* x: '16px',
|
|
45
|
+
* y: '16px',
|
|
46
|
+
* }
|
|
42
47
|
*/
|
|
43
48
|
export type ViewPadding = PaddingWithUnit | {
|
|
44
49
|
top?: PaddingWithUnit;
|
|
@@ -78,8 +83,8 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
78
83
|
*/
|
|
79
84
|
fitView?: boolean | undefined;
|
|
80
85
|
/**
|
|
81
|
-
* Padding around the diagram
|
|
82
|
-
* @default
|
|
86
|
+
* Padding around the diagram (number - pixels)
|
|
87
|
+
* @default 16 - 16px
|
|
83
88
|
*
|
|
84
89
|
* @see {@link ViewPadding}
|
|
85
90
|
*
|
|
@@ -88,15 +93,15 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
88
93
|
* <LikeC4Diagram
|
|
89
94
|
* fitViewPadding={{
|
|
90
95
|
* x: '16px',
|
|
91
|
-
* y:
|
|
96
|
+
* y: 16,
|
|
92
97
|
* }}
|
|
93
98
|
* />
|
|
94
99
|
*
|
|
95
100
|
* <LikeC4Diagram
|
|
96
101
|
* fitViewPadding={{
|
|
97
|
-
* top:
|
|
102
|
+
* top: 8,
|
|
98
103
|
* right: '8px',
|
|
99
|
-
* bottom: '
|
|
104
|
+
* bottom: '1px',
|
|
100
105
|
* left: '8px',
|
|
101
106
|
* }}
|
|
102
107
|
* />
|
|
@@ -135,9 +140,9 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
135
140
|
* Display notations in the bottom right corner
|
|
136
141
|
* (Active if only notations are present)
|
|
137
142
|
*
|
|
138
|
-
* @default
|
|
143
|
+
* @default false
|
|
139
144
|
*/
|
|
140
|
-
|
|
145
|
+
enableNotations?: boolean | undefined;
|
|
141
146
|
/**
|
|
142
147
|
* Display dropdown with details on relationship's label click
|
|
143
148
|
* @default false
|
|
@@ -169,6 +174,11 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
169
174
|
* @default false
|
|
170
175
|
*/
|
|
171
176
|
enableDynamicViewWalkthrough?: boolean | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Enable "Compare with auto layout" action when view was manually modified and out of sync with latest model
|
|
179
|
+
* @default true if `onLayoutTypeChange` is set, false otherwise
|
|
180
|
+
*/
|
|
181
|
+
enableCompareWithLatest?: boolean | undefined;
|
|
172
182
|
/**
|
|
173
183
|
* Default dynamic view display variant
|
|
174
184
|
* @default 'diagram'
|
|
@@ -179,11 +189,6 @@ export interface LikeC4DiagramProperties<A extends Any = Unknown> {
|
|
|
179
189
|
* @default false
|
|
180
190
|
*/
|
|
181
191
|
enableElementTags?: boolean | undefined;
|
|
182
|
-
/**
|
|
183
|
-
* Experimental feature to enable edge editing
|
|
184
|
-
* @default false
|
|
185
|
-
*/
|
|
186
|
-
experimentalEdgeEditing?: boolean | undefined;
|
|
187
192
|
/**
|
|
188
193
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
189
194
|
* Enable it if you have a large or static view
|
|
@@ -235,6 +240,7 @@ export type OnEdgeClick<A extends Any = Unknown> = (edge: DiagramEdge<A>, event:
|
|
|
235
240
|
* On pane/canvas click (not on any node or edge)
|
|
236
241
|
*/
|
|
237
242
|
export type OnCanvasClick = (event: ReactMouseEvent) => void;
|
|
243
|
+
export type OnCanvasContextMenu = (event: ReactMouseEvent | MouseEvent) => void;
|
|
238
244
|
export type ChangeEvent = {
|
|
239
245
|
change: ViewChange;
|
|
240
246
|
};
|
|
@@ -243,12 +249,13 @@ export type OnInitialized = (params: {
|
|
|
243
249
|
diagram: DiagramApi;
|
|
244
250
|
xyflow: XYFlowInstance;
|
|
245
251
|
}) => void;
|
|
252
|
+
export type OnLayoutTypeChange = (layoutType: LayoutType) => void;
|
|
246
253
|
export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
|
|
247
254
|
onChange?: OnChange | null | undefined;
|
|
248
255
|
onNavigateTo?: OnNavigateTo<A> | null | undefined;
|
|
249
256
|
onNodeClick?: OnNodeClick<A> | null | undefined;
|
|
250
257
|
onNodeContextMenu?: OnNodeClick<A> | null | undefined;
|
|
251
|
-
onCanvasContextMenu?:
|
|
258
|
+
onCanvasContextMenu?: OnCanvasContextMenu | null | undefined;
|
|
252
259
|
onEdgeClick?: OnEdgeClick<A> | null | undefined;
|
|
253
260
|
onEdgeContextMenu?: OnEdgeClick<A> | null | undefined;
|
|
254
261
|
onCanvasClick?: OnCanvasClick | null | undefined;
|
|
@@ -256,4 +263,11 @@ export interface LikeC4DiagramEventHandlers<A extends Any = Unknown> {
|
|
|
256
263
|
onBurgerMenuClick?: null | undefined | (() => void);
|
|
257
264
|
onOpenSource?: OnOpenSource<A> | null | undefined;
|
|
258
265
|
onInitialized?: OnInitialized | null | undefined;
|
|
266
|
+
/**
|
|
267
|
+
* Triggered when user changes layout type (e.g. from 'manual' to 'auto')
|
|
268
|
+
* Expected another `view` to be passed to the diagram
|
|
269
|
+
*
|
|
270
|
+
* @param layoutType new layout type
|
|
271
|
+
*/
|
|
272
|
+
onLayoutTypeChange?: OnLayoutTypeChange | null | undefined;
|
|
259
273
|
}
|
|
@@ -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/LikeC4View.d.ts
CHANGED
|
@@ -56,9 +56,28 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
|
56
56
|
fitView?: boolean | undefined;
|
|
57
57
|
/**
|
|
58
58
|
* Padding around the diagram
|
|
59
|
-
* @default '
|
|
59
|
+
* @default '16px'
|
|
60
60
|
*
|
|
61
61
|
* @see {@link ViewPadding}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <LikeC4View
|
|
66
|
+
* fitViewPadding={{
|
|
67
|
+
* x: '16px',
|
|
68
|
+
* y: 16,
|
|
69
|
+
* }}
|
|
70
|
+
* />
|
|
71
|
+
*
|
|
72
|
+
* <LikeC4View
|
|
73
|
+
* fitViewPadding={{
|
|
74
|
+
* top: 8,
|
|
75
|
+
* right: '8px',
|
|
76
|
+
* bottom: '1px',
|
|
77
|
+
* left: '8px',
|
|
78
|
+
* }}
|
|
79
|
+
* />
|
|
80
|
+
* ```
|
|
62
81
|
*/
|
|
63
82
|
fitViewPadding?: ViewPadding | undefined;
|
|
64
83
|
/**
|
|
@@ -70,7 +89,7 @@ export interface LikeC4ViewProps<A extends t.aux.Any = t.aux.UnknownLayouted> {
|
|
|
70
89
|
* Display notations of the view
|
|
71
90
|
* @default false
|
|
72
91
|
*/
|
|
73
|
-
|
|
92
|
+
enableNotations?: boolean | undefined;
|
|
74
93
|
/**
|
|
75
94
|
* If double click on a node should enable focus mode, i.e. highlight incoming/outgoing edges
|
|
76
95
|
* Conflicts with `browser` prop
|
|
@@ -210,7 +229,12 @@ export interface LikeC4BrowserProps {
|
|
|
210
229
|
* Display notations of the view
|
|
211
230
|
* @default true
|
|
212
231
|
*/
|
|
213
|
-
|
|
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;
|
|
214
238
|
/**
|
|
215
239
|
* Improve performance by hiding certain elements and reducing visual effects (disable mix-blend, shadows, animations)
|
|
216
240
|
*
|
|
@@ -236,4 +260,4 @@ export interface LikeC4BrowserProps {
|
|
|
236
260
|
*
|
|
237
261
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
238
262
|
*/
|
|
239
|
-
export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, background, browser, showNavigationButtons,
|
|
263
|
+
export declare function LikeC4View<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, pannable, zoomable, keepAspectRatio, colorScheme, injectFontCss, controls, background, browser, showNavigationButtons, enableNotations, enableFocusMode, enableDynamicViewWalkthrough, enableElementDetails, enableRelationshipDetails, enableRelationshipBrowser, reduceGraphics, mantineTheme, styleNonce, style, reactFlowProps, renderNodes, children, ...props }: LikeC4ViewProps<A>): import("react/jsx-runtime").JSX.Element;
|
package/dist/LikeC4View.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { cx, css } from '@likec4/styles/css';
|
|
3
|
-
import { Box
|
|
4
|
-
import {
|
|
3
|
+
import { Box } from '@likec4/styles/jsx';
|
|
4
|
+
import { ActionIcon } from '@mantine/core';
|
|
5
5
|
import { useState } from 'react';
|
|
6
6
|
import { isBoolean } from 'remeda';
|
|
7
7
|
import { FitViewPaddings } from './base/const.js';
|
|
8
8
|
import { ErrorMessage, ViewNotFound } from './components/ViewNotFound.js';
|
|
9
9
|
import { FramerMotionConfig } from './context/FramerMotionConfig.js';
|
|
10
|
+
import { useCallbackRef } from './hooks/useCallbackRef.js';
|
|
10
11
|
import { useOptionalLikeC4Model } from './hooks/useLikeC4Model.js';
|
|
11
12
|
import { LikeC4Diagram } from './LikeC4Diagram.js';
|
|
12
13
|
import { Overlay } from './overlays/overlay/Overlay.js';
|
|
13
14
|
import { ShadowRoot } from './shadowroot/ShadowRoot.js';
|
|
14
|
-
import {
|
|
15
|
-
import IconX from './node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
15
|
+
import { pickViewBounds } from './utils/view-bounds.js';
|
|
16
|
+
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
17
|
|
|
17
18
|
const cssInteractive = css({
|
|
18
19
|
cursor: "pointer",
|
|
@@ -33,7 +34,7 @@ function LikeC4View({
|
|
|
33
34
|
background = "transparent",
|
|
34
35
|
browser = true,
|
|
35
36
|
showNavigationButtons = false,
|
|
36
|
-
|
|
37
|
+
enableNotations,
|
|
37
38
|
enableFocusMode = false,
|
|
38
39
|
enableDynamicViewWalkthrough = false,
|
|
39
40
|
enableElementDetails = false,
|
|
@@ -49,14 +50,21 @@ function LikeC4View({
|
|
|
49
50
|
...props
|
|
50
51
|
}) {
|
|
51
52
|
const likec4model = useOptionalLikeC4Model();
|
|
52
|
-
const [
|
|
53
|
+
const [layoutType, setLayoutType] = useState("manual");
|
|
54
|
+
const [browserViewId, _onNavigateTo] = useState(null);
|
|
55
|
+
const onNavigateTo = useCallbackRef((viewId2) => {
|
|
56
|
+
if (viewId2 && viewId2 !== browserViewId) {
|
|
57
|
+
setLayoutType("manual");
|
|
58
|
+
}
|
|
59
|
+
_onNavigateTo(viewId2);
|
|
60
|
+
});
|
|
53
61
|
const onNavigateToThisView = useCallbackRef(() => {
|
|
54
62
|
onNavigateTo(viewId);
|
|
55
63
|
});
|
|
56
64
|
if (!likec4model) {
|
|
57
65
|
return /* @__PURE__ */ jsx(ErrorMessage, { children: "LikeC4Model not found. Make sure you provided LikeC4ModelProvider." });
|
|
58
66
|
}
|
|
59
|
-
const view = likec4model.findView(viewId)?.$
|
|
67
|
+
const view = likec4model.findView(viewId)?.$layouted;
|
|
60
68
|
if (!view) {
|
|
61
69
|
return /* @__PURE__ */ jsx(ViewNotFound, { viewId });
|
|
62
70
|
}
|
|
@@ -67,13 +75,13 @@ function LikeC4View({
|
|
|
67
75
|
'" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
|
|
68
76
|
] });
|
|
69
77
|
}
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const hasNotations =
|
|
73
|
-
|
|
78
|
+
const browserViewModel = browserViewId ? likec4model.findView(browserViewId) : null;
|
|
79
|
+
const browserView = layoutType === "manual" ? browserViewModel?.$layouted : browserViewModel?.$view;
|
|
80
|
+
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
81
|
+
const browserViewHasNotations = (browserView?.notation?.nodes?.length ?? 0) > 0;
|
|
74
82
|
const isBrowserEnabled = browser !== false;
|
|
75
83
|
const browserProps = isBoolean(browser) ? {} : browser;
|
|
76
|
-
const bounds =
|
|
84
|
+
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
77
85
|
return /* @__PURE__ */ jsx(
|
|
78
86
|
ShadowRoot,
|
|
79
87
|
{
|
|
@@ -98,10 +106,10 @@ function LikeC4View({
|
|
|
98
106
|
background,
|
|
99
107
|
fitView: true,
|
|
100
108
|
fitViewPadding: FitViewPaddings.default,
|
|
101
|
-
|
|
109
|
+
enableNotations: hasNotations,
|
|
102
110
|
enableDynamicViewWalkthrough,
|
|
103
111
|
showNavigationButtons,
|
|
104
|
-
|
|
112
|
+
enableCompareWithLatest: false,
|
|
105
113
|
enableFocusMode,
|
|
106
114
|
enableRelationshipDetails,
|
|
107
115
|
enableElementDetails,
|
|
@@ -142,17 +150,20 @@ function LikeC4View({
|
|
|
142
150
|
enableRelationshipDetails: true,
|
|
143
151
|
enableSearch: true,
|
|
144
152
|
enableElementTags: true,
|
|
153
|
+
enableCompareWithLatest: true,
|
|
145
154
|
controls: true,
|
|
146
155
|
readonly: true,
|
|
156
|
+
nodesDraggable: false,
|
|
147
157
|
fitView: true,
|
|
148
158
|
...props,
|
|
149
159
|
fitViewPadding: FitViewPaddings.withControls,
|
|
150
160
|
...browserProps,
|
|
151
|
-
|
|
152
|
-
renderNodes
|
|
161
|
+
enableNotations: browserViewHasNotations && (browserProps.enableNotations ?? true),
|
|
162
|
+
renderNodes,
|
|
163
|
+
onLayoutTypeChange: setLayoutType
|
|
153
164
|
}
|
|
154
165
|
),
|
|
155
|
-
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "
|
|
166
|
+
/* @__PURE__ */ jsx(Box, { pos: "absolute", top: "4", right: "4", zIndex: "999", children: /* @__PURE__ */ jsx(
|
|
156
167
|
ActionIcon,
|
|
157
168
|
{
|
|
158
169
|
variant: "default",
|
package/dist/ReactLikeC4.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export type ReactLikeC4Props<A extends t.aux.Any = t.aux.UnknownLayouted> = {
|
|
|
36
36
|
*
|
|
37
37
|
* Component is wrapped in ShadowRoot to isolate styles.
|
|
38
38
|
*/
|
|
39
|
-
export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, colorScheme, injectFontCss,
|
|
39
|
+
export declare function ReactLikeC4<A extends t.aux.Any = t.aux.UnknownLayouted>({ viewId, className, colorScheme, injectFontCss, enableNotations, keepAspectRatio, style, mantineTheme, styleNonce, ...props }: ReactLikeC4Props<A>): import("react/jsx-runtime").JSX.Element;
|
package/dist/ReactLikeC4.js
CHANGED
|
@@ -4,15 +4,15 @@ 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,
|
|
11
11
|
className,
|
|
12
12
|
colorScheme,
|
|
13
13
|
injectFontCss = true,
|
|
14
|
+
enableNotations,
|
|
14
15
|
keepAspectRatio,
|
|
15
|
-
showNotations,
|
|
16
16
|
style,
|
|
17
17
|
mantineTheme,
|
|
18
18
|
styleNonce,
|
|
@@ -33,10 +33,8 @@ function ReactLikeC4({
|
|
|
33
33
|
'" is not layouted. Make sure you have LikeC4ModelProvider with layouted model.'
|
|
34
34
|
] });
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
const hasNotations =
|
|
38
|
-
showNotations ??= hasNotations;
|
|
39
|
-
const bounds = getViewBounds(view, props.dynamicViewVariant);
|
|
36
|
+
const bounds = pickViewBounds(view, props.dynamicViewVariant);
|
|
37
|
+
const hasNotations = !!enableNotations && (view.notation?.nodes?.length ?? 0) > 0;
|
|
40
38
|
return /* @__PURE__ */ jsx(
|
|
41
39
|
ShadowRoot,
|
|
42
40
|
{
|
|
@@ -54,7 +52,7 @@ function ReactLikeC4({
|
|
|
54
52
|
LikeC4Diagram,
|
|
55
53
|
{
|
|
56
54
|
view,
|
|
57
|
-
|
|
55
|
+
enableNotations: hasNotations,
|
|
58
56
|
...props
|
|
59
57
|
}
|
|
60
58
|
)
|
|
@@ -24,13 +24,13 @@ function StaticLikeC4Diagram({
|
|
|
24
24
|
zoomable: false,
|
|
25
25
|
controls: false,
|
|
26
26
|
background,
|
|
27
|
-
|
|
27
|
+
enableNotations: false,
|
|
28
28
|
enableElementDetails: false,
|
|
29
29
|
enableRelationshipDetails,
|
|
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<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;
|