@likec4/diagram 1.43.0 → 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 +5746 -4674
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +13 -10
- package/dist/LikeC4Diagram.props.d.ts +16 -7
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +5 -0
- package/dist/LikeC4View.js +22 -11
- 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 +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 +5 -4
- 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 +7 -5
- 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 +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 +17 -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/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/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 +1 -1
- 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 +19 -18
- package/panda.buildinfo.json +107 -66
- 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
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { VIEW_FOLDERS_SEPARATOR, normalizeViewPath } from '@likec4/core/model';
|
|
3
3
|
import { ifilter, ifirst, toArray, compareNaturalHierarchically, nonexhaustive } from '@likec4/core/utils';
|
|
4
4
|
import { cx, css } from '@likec4/styles/css';
|
|
5
5
|
import { HStack, VStack, Box } from '@likec4/styles/jsx';
|
|
6
6
|
import { vstack, hstack } from '@likec4/styles/patterns';
|
|
7
|
-
import { PopoverDropdown,
|
|
7
|
+
import { PopoverDropdown, ScrollAreaAutosize, Input, createScopedKeydownHandler, rem, Button, Divider, Highlight, UnstyledButton, Breadcrumbs } from '@mantine/core';
|
|
8
8
|
import { useThrottledCallback, useUncontrolled } from '@mantine/hooks';
|
|
9
9
|
import { useMountEffect } from '@react-hookz/web';
|
|
10
10
|
import { useSelector } from '@xstate/react';
|
|
11
|
-
import { deepEqual } from 'fast-equals';
|
|
12
|
-
import { useRef } from 'react';
|
|
11
|
+
import { shallowEqual, deepEqual } from 'fast-equals';
|
|
12
|
+
import { memo, useDeferredValue, useState, useEffect, useRef } from 'react';
|
|
13
13
|
import { isEmpty, pipe, sort, isArray } from 'remeda';
|
|
14
14
|
import { NavigationLink } from '../components/NavigationLink.js';
|
|
15
15
|
import { useLikeC4Model } from '../hooks/useLikeC4Model.js';
|
|
16
16
|
import { ProjectsMenu } from './dropdown/ProjectsMenu.js';
|
|
17
|
-
import { useNavigationActor, useNavigationActorContext, useNavigationActorRef } from './hooks.js';
|
|
17
|
+
import { useNavigationActor, useNavigationActorSnapshot, useNavigationActorContext, useNavigationActorRef } from './hooks.js';
|
|
18
18
|
import { breadcrumbTitle } from './styles.css.js';
|
|
19
19
|
import { useOnDiagramEvent } from '../hooks/useDiagram.js';
|
|
20
|
-
import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
21
|
-
import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
22
|
-
import IconDirectionSignFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
23
|
-
import IconStack2 from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
24
|
-
import IconZoomScan from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
25
|
-
import IconStarFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
26
|
-
import IconFolderFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
20
|
+
import IconSearch from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
|
|
21
|
+
import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
22
|
+
import IconDirectionSignFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js';
|
|
23
|
+
import IconStack2 from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
|
|
24
|
+
import IconZoomScan from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
25
|
+
import IconStarFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js';
|
|
26
|
+
import IconFolderFilled from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js';
|
|
27
27
|
|
|
28
28
|
const scopedKeydownHandler = createScopedKeydownHandler({
|
|
29
29
|
siblingSelector: "[data-likec4-focusable]",
|
|
@@ -32,19 +32,24 @@ const scopedKeydownHandler = createScopedKeydownHandler({
|
|
|
32
32
|
loop: true,
|
|
33
33
|
orientation: "vertical"
|
|
34
34
|
});
|
|
35
|
-
function
|
|
35
|
+
function hasSearchQuerySelector(s) {
|
|
36
|
+
return s.context.searchQuery.trim().length >= 2;
|
|
37
|
+
}
|
|
38
|
+
const NavigationPanelDropdown = memo(() => {
|
|
36
39
|
const actor = useNavigationActor();
|
|
37
|
-
const
|
|
40
|
+
const hasSearchQuery = useNavigationActorSnapshot(hasSearchQuerySelector);
|
|
38
41
|
useOnDiagramEvent("paneClick", () => {
|
|
39
42
|
actor.closeDropdown();
|
|
40
43
|
});
|
|
41
44
|
useOnDiagramEvent("nodeClick", () => {
|
|
42
45
|
actor.closeDropdown();
|
|
43
46
|
});
|
|
47
|
+
useOnDiagramEvent("edgeClick", () => {
|
|
48
|
+
actor.closeDropdown();
|
|
49
|
+
});
|
|
44
50
|
const setSearchQuery = useThrottledCallback((value) => {
|
|
45
51
|
actor.send({ type: "searchQuery.change", value });
|
|
46
52
|
}, 250);
|
|
47
|
-
const hasSearchQuery = searchQuery.trim().length >= 2;
|
|
48
53
|
return /* @__PURE__ */ jsxs(
|
|
49
54
|
PopoverDropdown,
|
|
50
55
|
{
|
|
@@ -64,10 +69,8 @@ function NavigationPanelDropdown() {
|
|
|
64
69
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", children: /* @__PURE__ */ jsx(
|
|
65
70
|
SearchInput,
|
|
66
71
|
{
|
|
67
|
-
|
|
68
|
-
onChange: setSearchQuery
|
|
69
|
-
"data-likec4-focusable": true,
|
|
70
|
-
onKeyDown: scopedKeydownHandler
|
|
72
|
+
defaultValue: actor.actorRef.getSnapshot().context.searchQuery,
|
|
73
|
+
onChange: setSearchQuery
|
|
71
74
|
}
|
|
72
75
|
) }),
|
|
73
76
|
/* @__PURE__ */ jsx(
|
|
@@ -89,32 +92,44 @@ function NavigationPanelDropdown() {
|
|
|
89
92
|
overscrollBehavior: "none"
|
|
90
93
|
}
|
|
91
94
|
},
|
|
92
|
-
children: hasSearchQuery ? /* @__PURE__ */ jsx(SearchResults, {
|
|
95
|
+
children: hasSearchQuery ? /* @__PURE__ */ jsx(SearchResults, {}) : /* @__PURE__ */ jsx(FolderColumns, {})
|
|
93
96
|
}
|
|
94
97
|
)
|
|
95
98
|
]
|
|
96
99
|
}
|
|
97
100
|
);
|
|
101
|
+
});
|
|
102
|
+
NavigationPanelDropdown.displayName = "NavigationPanelDropdown";
|
|
103
|
+
function selectSearchQuery(s) {
|
|
104
|
+
return normalizeViewPath(s.context.searchQuery);
|
|
98
105
|
}
|
|
99
106
|
const compare = compareNaturalHierarchically(VIEW_FOLDERS_SEPARATOR);
|
|
100
|
-
|
|
107
|
+
const SearchResults = memo(() => {
|
|
101
108
|
const likec4model = useLikeC4Model();
|
|
102
109
|
const actor = useNavigationActor();
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
const searchQuery = useSelector(actor.actorRef, selectSearchQuery);
|
|
111
|
+
const deferredSearchQuery = useDeferredValue(searchQuery);
|
|
112
|
+
const isSearchByPath = deferredSearchQuery.includes(VIEW_FOLDERS_SEPARATOR);
|
|
113
|
+
const highlight = isSearchByPath ? deferredSearchQuery.split(VIEW_FOLDERS_SEPARATOR) : deferredSearchQuery;
|
|
114
|
+
const [found, setFound] = useState([]);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
setFound((current) => {
|
|
117
|
+
const results = pipe(
|
|
118
|
+
likec4model.views(),
|
|
119
|
+
ifilter((v) => {
|
|
120
|
+
if (isSearchByPath && v.$view.title) {
|
|
121
|
+
return normalizeViewPath(v.$view.title).toLowerCase().includes(deferredSearchQuery);
|
|
122
|
+
}
|
|
123
|
+
return v.id.toLowerCase().includes(deferredSearchQuery) || !!v.title?.toLowerCase().includes(deferredSearchQuery);
|
|
124
|
+
}),
|
|
125
|
+
ifirst(20),
|
|
126
|
+
toArray(),
|
|
127
|
+
sort((a, b) => compare(a.folder.path, b.folder.path))
|
|
128
|
+
);
|
|
129
|
+
return shallowEqual(results, current) ? current : results;
|
|
130
|
+
});
|
|
131
|
+
}, [likec4model, deferredSearchQuery, isSearchByPath]);
|
|
116
132
|
if (found.length === 0) return /* @__PURE__ */ jsx("div", { children: "no results" });
|
|
117
|
-
const highlight = isSearchByPath ? searchQuery.split(VIEW_FOLDERS_SEPARATOR) : searchQuery;
|
|
118
133
|
return /* @__PURE__ */ jsx(
|
|
119
134
|
ScrollAreaAutosize,
|
|
120
135
|
{
|
|
@@ -147,7 +162,7 @@ function SearchResults({ searchQuery }) {
|
|
|
147
162
|
)) })
|
|
148
163
|
}
|
|
149
164
|
);
|
|
150
|
-
}
|
|
165
|
+
});
|
|
151
166
|
const foundedViewClass = hstack({
|
|
152
167
|
gap: "xxs",
|
|
153
168
|
rounded: "sm",
|
|
@@ -317,13 +332,16 @@ function folderColumn(folder, context) {
|
|
|
317
332
|
viewId: s.id,
|
|
318
333
|
title: s.title ?? s.id,
|
|
319
334
|
description: s.description.nonEmpty && s.description.text || null,
|
|
320
|
-
selected: s.id === context.viewModel
|
|
335
|
+
selected: s.id === context.viewModel?.id
|
|
321
336
|
}))
|
|
322
337
|
]
|
|
323
338
|
};
|
|
324
339
|
}
|
|
325
340
|
const selectColumns = (context) => {
|
|
326
341
|
const viewModel = context.viewModel;
|
|
342
|
+
if (!viewModel) {
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
327
345
|
const likec4model = viewModel.$model;
|
|
328
346
|
const columns = [
|
|
329
347
|
folderColumn(likec4model.rootViewFolder, context)
|
|
@@ -336,7 +354,7 @@ const selectColumns = (context) => {
|
|
|
336
354
|
}
|
|
337
355
|
return columns;
|
|
338
356
|
};
|
|
339
|
-
|
|
357
|
+
const FolderColumns = memo(() => {
|
|
340
358
|
const columns = useNavigationActorContext(selectColumns, deepEqual);
|
|
341
359
|
return /* @__PURE__ */ jsx(HStack, { gap: "xs", alignItems: "stretch", children: columns.flatMap((column, i) => [
|
|
342
360
|
i > 0 && /* @__PURE__ */ jsx(Divider, { orientation: "vertical" }, "divider" + i),
|
|
@@ -344,12 +362,12 @@ function FolderColumns() {
|
|
|
344
362
|
FolderColumn,
|
|
345
363
|
{
|
|
346
364
|
data: column,
|
|
347
|
-
isLast: i == columns.length - 1
|
|
365
|
+
isLast: i > 0 && i == columns.length - 1
|
|
348
366
|
},
|
|
349
367
|
column.folderPath
|
|
350
368
|
)
|
|
351
369
|
]) });
|
|
352
|
-
}
|
|
370
|
+
});
|
|
353
371
|
function FolderColumn({ data, isLast }) {
|
|
354
372
|
const ref = useRef(null);
|
|
355
373
|
const actor = useNavigationActorRef();
|
|
@@ -364,6 +382,7 @@ function FolderColumn({ data, isLast }) {
|
|
|
364
382
|
useMountEffect(() => {
|
|
365
383
|
if (isLast && ref.current) {
|
|
366
384
|
ref.current.scrollIntoView({
|
|
385
|
+
block: "nearest",
|
|
367
386
|
inline: "nearest",
|
|
368
387
|
behavior: "smooth"
|
|
369
388
|
});
|
|
@@ -414,7 +433,7 @@ function FolderColumnItem({ columnItem, ...props }) {
|
|
|
414
433
|
nonexhaustive(columnItem);
|
|
415
434
|
}
|
|
416
435
|
}
|
|
417
|
-
function SearchInput(
|
|
436
|
+
function SearchInput(props) {
|
|
418
437
|
const [_value, handleChange] = useUncontrolled({
|
|
419
438
|
...props,
|
|
420
439
|
finalValue: ""
|
|
@@ -427,8 +446,9 @@ function SearchInput({ onKeyDown, ...props }) {
|
|
|
427
446
|
variant: "unstyled",
|
|
428
447
|
height: rem(26),
|
|
429
448
|
value: _value,
|
|
430
|
-
onKeyDown,
|
|
449
|
+
onKeyDown: scopedKeydownHandler,
|
|
431
450
|
onChange: (e) => handleChange(e.currentTarget.value),
|
|
451
|
+
"data-likec4-focusable": true,
|
|
432
452
|
classNames: {
|
|
433
453
|
wrapper: css({
|
|
434
454
|
flexGrow: 1,
|
|
@@ -11,5 +11,5 @@ export declare const Breadcrumbs: ForwardRefExoticComponent< BreadcrumbsProps &
|
|
|
11
11
|
component?: any;
|
|
12
12
|
renderRoot?: (props: Record<string, any>) => React.ReactNode;
|
|
13
13
|
}>;
|
|
14
|
-
export type PanelActionIconProps = Partial<NavigationPanelActionIconVariant> & Omit<ActionIconProps, keyof NavigationPanelActionIconVariant> & HTMLMotionProps<'button'>;
|
|
14
|
+
export type PanelActionIconProps = Partial<NavigationPanelActionIconVariant> & Omit<ActionIconProps, keyof NavigationPanelActionIconVariant> & Omit<HTMLMotionProps<'button'>, keyof NavigationPanelActionIconVariant>;
|
|
15
15
|
export declare const PanelActionIcon: ForwardRefExoticComponent<Omit<PanelActionIconProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,7 +4,7 @@ import { navigationPanelActionIcon } from '@likec4/styles/recipes';
|
|
|
4
4
|
import { ActionIcon, ThemeIcon, Tooltip as Tooltip$1, Breadcrumbs } from '@mantine/core';
|
|
5
5
|
import * as m from 'motion/react-m';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
-
import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
+
import IconChevronRight from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js';
|
|
8
8
|
|
|
9
9
|
const Tooltip = Tooltip$1.withProps({
|
|
10
10
|
color: "dark",
|
|
@@ -19,6 +19,7 @@ const Tooltip = Tooltip$1.withProps({
|
|
|
19
19
|
const BreadcrumbsSeparator = () => /* @__PURE__ */ jsx(
|
|
20
20
|
ThemeIcon,
|
|
21
21
|
{
|
|
22
|
+
component: m.div,
|
|
22
23
|
variant: "transparent",
|
|
23
24
|
size: 16,
|
|
24
25
|
className: css({
|
|
@@ -42,6 +43,7 @@ const PanelActionIcon = forwardRef(({
|
|
|
42
43
|
variant = "default",
|
|
43
44
|
className,
|
|
44
45
|
disabled = false,
|
|
46
|
+
type,
|
|
45
47
|
...others
|
|
46
48
|
}, ref) => /* @__PURE__ */ jsx(
|
|
47
49
|
ActionIcon,
|
|
@@ -63,7 +65,7 @@ const PanelActionIcon = forwardRef(({
|
|
|
63
65
|
...others,
|
|
64
66
|
className: cx(
|
|
65
67
|
className,
|
|
66
|
-
navigationPanelActionIcon({ variant })
|
|
68
|
+
navigationPanelActionIcon({ variant, type })
|
|
67
69
|
),
|
|
68
70
|
ref
|
|
69
71
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ViewId } from '@likec4/core/types';
|
|
2
|
-
import {
|
|
1
|
+
import { LayoutedView, ViewId } from '@likec4/core/types';
|
|
2
|
+
import { ActorRefFromLogic, SnapshotFrom, StateMachine, Values, NonReducibleUnknown, MetaObject, AnyActorLogic, ConditionalRequired, InputFrom, RequiredLogicInput, IsNotNever, ActorRef, MachineSnapshot, AnyActorRef, StateValue, AnyEventObject, ActionFunction } from 'xstate';
|
|
3
3
|
import { CurrentViewModel } from '../hooks/useCurrentViewModel';
|
|
4
4
|
export interface NavigationPanelActorInput {
|
|
5
|
-
|
|
5
|
+
view: LayoutedView;
|
|
6
|
+
viewModel: CurrentViewModel | null;
|
|
6
7
|
}
|
|
7
8
|
export type NavigationPanelActorEvent = {
|
|
8
9
|
type: 'update.inputs';
|
|
@@ -74,7 +75,8 @@ export type DropdownColumnItem = {
|
|
|
74
75
|
selected: boolean;
|
|
75
76
|
};
|
|
76
77
|
export interface NavigationPanelActorContext {
|
|
77
|
-
|
|
78
|
+
view: LayoutedView;
|
|
79
|
+
viewModel: CurrentViewModel | null;
|
|
78
80
|
/**
|
|
79
81
|
* Who activated the dropdown
|
|
80
82
|
* (if `click` then the dropdown is always open until dismissed)
|
|
@@ -156,7 +158,8 @@ declare const _actorLogic: StateMachine<NavigationPanelActorContext, NavigationP
|
|
|
156
158
|
selectedFolder: string;
|
|
157
159
|
searchQuery: string;
|
|
158
160
|
folderColumns: never[];
|
|
159
|
-
|
|
161
|
+
view: LayoutedView;
|
|
162
|
+
viewModel: CurrentViewModel | null;
|
|
160
163
|
};
|
|
161
164
|
readonly initial: "idle";
|
|
162
165
|
readonly entry: readonly ["update activatedBy", "reset selected folder"];
|
|
@@ -287,10 +290,11 @@ declare const _actorLogic: StateMachine<NavigationPanelActorContext, NavigationP
|
|
|
287
290
|
};
|
|
288
291
|
};
|
|
289
292
|
}>;
|
|
290
|
-
|
|
293
|
+
type InferredMachine = typeof _actorLogic;
|
|
294
|
+
export interface NavigationPanelActorLogic extends InferredMachine {
|
|
291
295
|
}
|
|
292
296
|
export declare const navigationPanelActorLogic: NavigationPanelActorLogic;
|
|
293
297
|
export type NavigationPanelActorSnapshot = SnapshotFrom<NavigationPanelActorLogic>;
|
|
294
|
-
export interface NavigationPanelActorRef extends
|
|
298
|
+
export interface NavigationPanelActorRef extends ActorRefFromLogic<NavigationPanelActorLogic> {
|
|
295
299
|
}
|
|
296
300
|
export {};
|
|
@@ -37,16 +37,17 @@ const _actorLogic = setup({
|
|
|
37
37
|
return { selectedFolder: event.folderPath };
|
|
38
38
|
}),
|
|
39
39
|
"reset selected folder": assign({
|
|
40
|
-
selectedFolder: ({ context }) => context.viewModel
|
|
40
|
+
selectedFolder: ({ context }) => context.viewModel?.folder.path ?? ""
|
|
41
41
|
}),
|
|
42
42
|
"update inputs": assign(({ context, event }) => {
|
|
43
43
|
assertEvent(event, "update.inputs");
|
|
44
|
-
const viewChanged = event.inputs.viewModel
|
|
44
|
+
const viewChanged = event.inputs.viewModel?.id !== context.viewModel?.id;
|
|
45
45
|
let selectedFolder = context.selectedFolder;
|
|
46
|
-
if (!event.inputs.viewModel
|
|
47
|
-
selectedFolder = event.inputs.viewModel
|
|
46
|
+
if (!event.inputs.viewModel?.folder.path.startsWith(selectedFolder)) {
|
|
47
|
+
selectedFolder = event.inputs.viewModel?.folder.path ?? "";
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
+
view: event.inputs.view,
|
|
50
51
|
viewModel: event.inputs.viewModel,
|
|
51
52
|
selectedFolder,
|
|
52
53
|
// allow dropdown to close on mouse leave if view changed
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@likec4/styles/css';
|
|
3
|
+
import { Box } from '@likec4/styles/jsx';
|
|
4
|
+
import { hstack } from '@likec4/styles/patterns';
|
|
5
|
+
import { navigationPanelActionIcon } from '@likec4/styles/recipes';
|
|
6
|
+
import { Menu, UnstyledButton, Badge } from '@mantine/core';
|
|
7
|
+
import IconChevronDown from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js';
|
|
8
|
+
|
|
9
|
+
function CompareActionsMenu({
|
|
10
|
+
onResetManualLayout
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
Menu,
|
|
14
|
+
{
|
|
15
|
+
withinPortal: false,
|
|
16
|
+
floatingStrategy: "absolute",
|
|
17
|
+
shadow: "lg",
|
|
18
|
+
position: "bottom-start",
|
|
19
|
+
offset: { mainAxis: 4 },
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsxs(
|
|
22
|
+
UnstyledButton,
|
|
23
|
+
{
|
|
24
|
+
className: cx(
|
|
25
|
+
"mantine-active",
|
|
26
|
+
navigationPanelActionIcon({
|
|
27
|
+
variant: "default"
|
|
28
|
+
}),
|
|
29
|
+
hstack({
|
|
30
|
+
gap: "2",
|
|
31
|
+
py: "1.5",
|
|
32
|
+
px: "2",
|
|
33
|
+
lineHeight: "1",
|
|
34
|
+
rounded: "sm",
|
|
35
|
+
textStyle: "xs",
|
|
36
|
+
fontWeight: "medium",
|
|
37
|
+
color: {
|
|
38
|
+
base: "likec4.panel.action",
|
|
39
|
+
_hover: "likec4.panel.action.hover"
|
|
40
|
+
},
|
|
41
|
+
userSelect: "none"
|
|
42
|
+
})
|
|
43
|
+
),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(Box, { children: "Actions" }),
|
|
46
|
+
/* @__PURE__ */ jsx(IconChevronDown, { size: 12, stroke: 2, opacity: 0.7 })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
/* @__PURE__ */ jsxs(Menu.Dropdown, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(Menu.Item, { disabled: true, rightSection: /* @__PURE__ */ jsx(Badge, { size: "xs", radius: "sm", children: "Soon" }), children: "Apply changes" }),
|
|
52
|
+
/* @__PURE__ */ jsx(Menu.Item, { fz: "sm", onClick: onResetManualLayout, children: "Reset manual layout" })
|
|
53
|
+
] })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { CompareActionsMenu };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { hstack } from '@likec4/styles/patterns';
|
|
3
|
+
import { AnimatePresence } from 'motion/react';
|
|
4
|
+
import * as m from 'motion/react-m';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { ComparePanelControls } from './ComparePanelControls.js';
|
|
7
|
+
import { useEnabledFeatures } from '../../context/DiagramFeatures.js';
|
|
8
|
+
|
|
9
|
+
const ComparePanel = memo(() => {
|
|
10
|
+
const { enableCompareWithLatest } = useEnabledFeatures();
|
|
11
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: enableCompareWithLatest && /* @__PURE__ */ jsx(
|
|
12
|
+
m.div,
|
|
13
|
+
{
|
|
14
|
+
layout: "position",
|
|
15
|
+
className: hstack({
|
|
16
|
+
gap: "2",
|
|
17
|
+
layerStyle: "likec4.panel",
|
|
18
|
+
position: "relative",
|
|
19
|
+
px: "2",
|
|
20
|
+
py: "1",
|
|
21
|
+
pl: "3",
|
|
22
|
+
pointerEvents: "all"
|
|
23
|
+
}),
|
|
24
|
+
initial: {
|
|
25
|
+
opacity: 0,
|
|
26
|
+
translateX: -20
|
|
27
|
+
},
|
|
28
|
+
animate: {
|
|
29
|
+
opacity: 1,
|
|
30
|
+
translateX: 0
|
|
31
|
+
},
|
|
32
|
+
exit: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
translateX: -20
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ jsx(ComparePanelControls, {})
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
});
|
|
40
|
+
ComparePanel.displayName = "ComparePanel";
|
|
41
|
+
|
|
42
|
+
export { ComparePanel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ComparePanelControls(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Box, HStack } from '@likec4/styles/jsx';
|
|
3
|
+
import { Divider as Divider$1 } from '@mantine/core';
|
|
4
|
+
import { useDiagramCompareLayout } from '../../hooks/useDiagramCompareLayout.js';
|
|
5
|
+
import { PanelActionIcon } from '../_common.js';
|
|
6
|
+
import { CompareActionsMenu } from './CompareActionsMenu.js';
|
|
7
|
+
import { LayoutTypeSwitcher } from './LayoutTypeSwitcher.js';
|
|
8
|
+
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';
|
|
9
|
+
|
|
10
|
+
const Divider = Divider$1.withProps({
|
|
11
|
+
mx: 2,
|
|
12
|
+
size: "xs",
|
|
13
|
+
orientation: "vertical"
|
|
14
|
+
});
|
|
15
|
+
function ComparePanelControls() {
|
|
16
|
+
const [ctx, { toggleCompare, switchLayout, resetManualLayout }] = useDiagramCompareLayout();
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
Box,
|
|
20
|
+
{
|
|
21
|
+
css: {
|
|
22
|
+
textStyle: "xs",
|
|
23
|
+
color: "likec4.panel.text",
|
|
24
|
+
userSelect: "none"
|
|
25
|
+
},
|
|
26
|
+
children: "Compare"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
LayoutTypeSwitcher,
|
|
31
|
+
{
|
|
32
|
+
value: ctx.layout,
|
|
33
|
+
onChange: switchLayout
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
ctx.isEditable && /* @__PURE__ */ jsxs(HStack, { gap: "1", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
CompareActionsMenu,
|
|
40
|
+
{
|
|
41
|
+
onResetManualLayout: resetManualLayout
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(Divider, {})
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
PanelActionIcon,
|
|
48
|
+
{
|
|
49
|
+
size: "sm",
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
toggleCompare();
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ jsx(IconX, {})
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { ComparePanelControls };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { invariant } from '@likec4/core';
|
|
3
|
+
import { css } from '@likec4/styles/css';
|
|
4
|
+
import { SegmentedControl } from '@mantine/core';
|
|
5
|
+
import * as m from 'motion/react-m';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
function LayoutTypeSwitcher({
|
|
9
|
+
value,
|
|
10
|
+
onChange
|
|
11
|
+
}) {
|
|
12
|
+
const data = useMemo(() => [
|
|
13
|
+
{ value: "manual", label: "Saved" },
|
|
14
|
+
{ value: "auto", label: "Latest" }
|
|
15
|
+
], []);
|
|
16
|
+
return /* @__PURE__ */ jsx(m.div, { layout: "position", children: /* @__PURE__ */ jsx(
|
|
17
|
+
SegmentedControl,
|
|
18
|
+
{
|
|
19
|
+
size: "xs",
|
|
20
|
+
color: value === "manual" ? "orange" : "green",
|
|
21
|
+
value,
|
|
22
|
+
component: m.div,
|
|
23
|
+
onChange: (layout) => {
|
|
24
|
+
invariant(layout === "manual" || layout === "auto", "Invalid layout type");
|
|
25
|
+
onChange(layout);
|
|
26
|
+
},
|
|
27
|
+
classNames: {
|
|
28
|
+
label: css({
|
|
29
|
+
fontSize: "xxs",
|
|
30
|
+
fontWeight: "medium"
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
data
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { LayoutTypeSwitcher };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ComparePanel } from './ComparePanel';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PopoverProps } from '@mantine/core';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const DetailsControls: (props: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { extractViewTitleFromPath } from '@likec4/core/model';
|
|
3
|
+
import { RichText } from '@likec4/core/types';
|
|
2
4
|
import { cx, css } from '@likec4/styles/css';
|
|
3
5
|
import { HStack, Box, styled } from '@likec4/styles/jsx';
|
|
4
6
|
import { hstack, vstack } from '@likec4/styles/patterns';
|
|
5
7
|
import { Popover, UnstyledButton, Text, Badge } from '@mantine/core';
|
|
8
|
+
import { deepEqual } from 'fast-equals';
|
|
6
9
|
import * as m from 'motion/react-m';
|
|
7
10
|
import { useState } from 'react';
|
|
8
11
|
import { Link } from '../../components/Link.js';
|
|
9
|
-
import {
|
|
12
|
+
import { useOnDiagramEvent } from '../../hooks/useDiagram.js';
|
|
10
13
|
import { useMantinePortalProps } from '../../hooks/useMantinePortalProps.js';
|
|
11
14
|
import { useNavigationActorSnapshot } from '../hooks.js';
|
|
12
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
13
|
-
import IconLink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
15
|
+
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
|
|
16
|
+
import IconLink from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js';
|
|
17
|
+
import { useDiagram } from '../../hooks/safeContext.js';
|
|
14
18
|
import { ElementTag } from '../../base-primitives/element/ElementTags.js';
|
|
15
19
|
import { Markdown } from '../../base-primitives/Markdown.js';
|
|
16
20
|
|
|
17
21
|
const selector = ({ context }) => {
|
|
18
|
-
const view = context.
|
|
22
|
+
const view = context.view;
|
|
19
23
|
return {
|
|
20
24
|
id: view.id,
|
|
21
|
-
title: view.
|
|
22
|
-
description: view.description,
|
|
23
|
-
tags: view.tags,
|
|
24
|
-
links: view.links
|
|
25
|
+
title: context.viewModel?.title ?? (view.title && extractViewTitleFromPath(view.title)) ?? "Untitled View",
|
|
26
|
+
description: context.viewModel?.description ?? RichText.from(view.description),
|
|
27
|
+
tags: view.tags ?? [],
|
|
28
|
+
links: view.links ?? []
|
|
25
29
|
};
|
|
26
30
|
};
|
|
27
|
-
const
|
|
31
|
+
const DetailsControls = (props) => {
|
|
28
32
|
const [opened, setOpened] = useState(false);
|
|
29
|
-
const data = useNavigationActorSnapshot(selector);
|
|
33
|
+
const data = useNavigationActorSnapshot(selector, deepEqual);
|
|
30
34
|
const portalProps = useMantinePortalProps();
|
|
31
35
|
return /* @__PURE__ */ jsxs(
|
|
32
36
|
Popover,
|
|
@@ -71,11 +75,11 @@ const ViewDetailsCardTrigger = ({ linksCount, onOpen }) => /* @__PURE__ */ jsx(P
|
|
|
71
75
|
userSelect: "none",
|
|
72
76
|
cursor: "pointer",
|
|
73
77
|
color: {
|
|
74
|
-
base: "likec4.panel.action
|
|
75
|
-
_hover: "likec4.panel.action
|
|
78
|
+
base: "likec4.panel.action",
|
|
79
|
+
_hover: "likec4.panel.action.hover"
|
|
76
80
|
},
|
|
77
81
|
backgroundColor: {
|
|
78
|
-
_hover: "likec4.panel.action
|
|
82
|
+
_hover: "likec4.panel.action.bg.hover"
|
|
79
83
|
},
|
|
80
84
|
display: {
|
|
81
85
|
base: "none",
|
|
@@ -244,4 +248,4 @@ const ViewBadgeLabel = styled("div", {
|
|
|
244
248
|
}
|
|
245
249
|
});
|
|
246
250
|
|
|
247
|
-
export {
|
|
251
|
+
export { DetailsControls };
|