@likec4/diagram 1.45.0 → 1.46.2
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 +2488 -1959
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +8 -7
- package/dist/LikeC4Diagram.props.d.ts +4 -12
- package/dist/LikeC4ProjectsProvider.js +8 -4
- package/dist/LikeC4View.js +1 -5
- package/dist/ReactLikeC4.d.ts +1 -4
- package/dist/StaticLikeC4Diagram.js +0 -2
- package/dist/base-primitives/NodeHandles.d.ts +2 -1
- package/dist/base-primitives/NodeHandles.js +22 -18
- 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 +2 -3
- package/dist/base-primitives/edge/EdgeLabel.js +16 -16
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -4
- package/dist/base-primitives/edge/EdgePath.js +13 -18
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +0 -1
- package/dist/context/DiagramFeatures.d.ts +1 -1
- package/dist/context/DiagramFeatures.js +1 -0
- package/dist/context/EnsureMantine.js +2 -1
- package/dist/context/IconRenderer.js +6 -6
- package/dist/editor/LikeC4EditorProvider.d.ts +22 -0
- package/dist/editor/LikeC4EditorProvider.js +12 -0
- package/dist/editor/__tests__/fixture.d.ts +205 -0
- package/dist/editor/applyChangesToManualLayout.d.ts +8 -0
- package/dist/editor/applyChangesToManualLayout.js +182 -0
- package/dist/editor/editorActor.actions.d.ts +201 -0
- package/dist/editor/editorActor.actions.js +149 -0
- package/dist/editor/editorActor.d.ts +653 -0
- package/dist/editor/editorActor.js +324 -0
- package/dist/editor/hotkeyActor.d.ts +7 -0
- package/dist/editor/hotkeyActor.js +19 -0
- package/dist/editor/index.d.ts +3 -2
- package/dist/editor/useEditorActorLogic.d.ts +565 -0
- package/dist/editor/useEditorActorLogic.js +54 -0
- package/dist/hooks/safeContext.d.ts +3 -2
- package/dist/hooks/safeContext.js +7 -4
- package/dist/hooks/useDiagram.d.ts +4 -2
- package/dist/hooks/useDiagram.js +19 -8
- package/dist/hooks/useDiagramCompareLayout.d.ts +8 -0
- package/dist/hooks/useDiagramCompareLayout.js +22 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/likec4diagram/DiagramXYFlow.js +1 -2
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +1 -5
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +74 -48
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/edges.css.js +30 -24
- package/dist/likec4diagram/custom/edges/useControlPoints.js +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +4 -9
- package/dist/likec4diagram/custom/nodes/nodes.js +3 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +127 -14
- package/dist/likec4diagram/state/DiagramActorProvider.js +63 -71
- package/dist/likec4diagram/state/assign.d.ts +4 -1
- package/dist/likec4diagram/state/assign.js +11 -8
- package/dist/likec4diagram/state/createViewChange.js +13 -9
- package/dist/likec4diagram/state/diagram-api.d.ts +20 -2
- package/dist/likec4diagram/state/diagram-api.js +58 -44
- package/dist/likec4diagram/state/hotkeyActor.d.ts +1 -1
- package/dist/likec4diagram/state/hotkeyActor.js +12 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +774 -195
- package/dist/likec4diagram/state/machine.actions.js +185 -74
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +93 -31
- package/dist/likec4diagram/state/machine.actions.layout.js +16 -4
- package/dist/likec4diagram/state/machine.d.ts +5 -4
- package/dist/likec4diagram/state/machine.js +11 -6
- package/dist/likec4diagram/state/machine.setup.d.ts +20 -9
- package/dist/likec4diagram/state/machine.setup.js +18 -3
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +34 -18
- package/dist/likec4diagram/state/machine.state.initializing.js +10 -10
- package/dist/likec4diagram/state/machine.state.navigating.js +28 -9
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1368 -434
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +363 -39
- package/dist/likec4diagram/state/machine.state.ready.focused.js +17 -4
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +104 -38
- package/dist/likec4diagram/state/machine.state.ready.idle.js +14 -5
- package/dist/likec4diagram/state/machine.state.ready.js +13 -90
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +18 -6
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +204 -31
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +14 -1
- package/dist/likec4diagram/state/types.d.ts +6 -2
- package/dist/likec4diagram/state/utils.d.ts +33 -7
- package/dist/likec4diagram/state/utils.js +23 -7
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +5 -9
- package/dist/navigationpanel/NavigationPanel.js +6 -9
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +40 -14
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +6 -4
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +2 -2
- package/dist/navigationpanel/controls/DetailsControls.js +2 -2
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +2 -2
- package/dist/navigationpanel/controls/ToggleReadonly.js +25 -17
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.2.0 → @tabler_icons-react@3.36.0_react@19.2.3}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/overlays/Overlays.js +23 -11
- package/dist/overlays/element-details/ElementDetailsCard.css.js +8 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +4 -6
- package/dist/overlays/element-details/TabPanelDeployments.js +3 -3
- package/dist/overlays/element-details/TabPanelRelationships.js +12 -7
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlaysActor.js +6 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +3 -3
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/search/components/ElementsColumn.js +16 -11
- package/dist/search/components/PickView.js +3 -1
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -1
- package/dist/search/components/ViewsColum.js +14 -9
- package/dist/search/components/utils.d.ts +6 -0
- package/dist/search/components/utils.js +4 -1
- package/dist/shadowroot/styles.css.js +6 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/xyflow.d.ts +2 -3
- package/dist/utils/xyflow.js +9 -8
- package/package.json +22 -22
- package/panda.buildinfo.json +61 -80
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/edge/edge.css.d.ts +0 -4
- package/dist/base-primitives/edge/edge.css.js +0 -71
- package/dist/editor/LikeC4EditorContext.d.ts +0 -21
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +0 -46
- package/dist/likec4diagram/state/syncManualLayoutActor.js +0 -309
- package/dist/utils/vector.d.ts +0 -86
- package/dist/utils/vector.js +0 -127
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ActionFunction, Values } from 'xstate';
|
|
2
2
|
import { Context, Events, EmittedEvents } from './machine.setup';
|
|
3
3
|
import { XYFlowInstance } from '../../hooks';
|
|
4
|
-
import { SyncLayoutActorLogic } from './syncManualLayoutActor';
|
|
5
4
|
import { HotkeyActorLogic } from './hotkeyActor';
|
|
6
5
|
import { OverlaysActorLogic } from '../../overlays/overlaysActor';
|
|
7
6
|
import { SearchActorLogic } from '../../search/searchActor';
|
|
8
7
|
import { MediaPrintActorLogic } from './mediaPrintActor';
|
|
8
|
+
import { EditorActorLogic } from '../../editor';
|
|
9
9
|
import { DiagramView } from '@likec4/core';
|
|
10
10
|
/**
|
|
11
11
|
* To be in `initializing` state, the diagram must wait for two events:
|
|
@@ -21,11 +21,6 @@ export declare const initializing: {
|
|
|
21
21
|
type: "xyflow.init";
|
|
22
22
|
instance: XYFlowInstance;
|
|
23
23
|
}, Events, undefined, Values<{
|
|
24
|
-
syncManualLayoutActorLogic: {
|
|
25
|
-
src: "syncManualLayoutActorLogic";
|
|
26
|
-
logic: SyncLayoutActorLogic;
|
|
27
|
-
id: "syncLayout";
|
|
28
|
-
};
|
|
29
24
|
hotkeyActorLogic: {
|
|
30
25
|
src: "hotkeyActorLogic";
|
|
31
26
|
logic: HotkeyActorLogic;
|
|
@@ -46,6 +41,11 @@ export declare const initializing: {
|
|
|
46
41
|
logic: MediaPrintActorLogic;
|
|
47
42
|
id: "mediaPrint";
|
|
48
43
|
};
|
|
44
|
+
editorActor: {
|
|
45
|
+
src: "editorActor";
|
|
46
|
+
logic: EditorActorLogic;
|
|
47
|
+
id: "editor";
|
|
48
|
+
};
|
|
49
49
|
}>, never, never, never, never>;
|
|
50
50
|
target: string;
|
|
51
51
|
};
|
|
@@ -53,15 +53,14 @@ export declare const initializing: {
|
|
|
53
53
|
actions: ActionFunction<Context, {
|
|
54
54
|
type: "update.view";
|
|
55
55
|
view: DiagramView;
|
|
56
|
+
source?: "editor" | "external";
|
|
57
|
+
} | {
|
|
58
|
+
type: "update.view";
|
|
59
|
+
view: DiagramView;
|
|
60
|
+
source?: "editor" | "external";
|
|
56
61
|
xynodes: import("../types").Types.Node[];
|
|
57
62
|
xyedges: import("../types").Types.Edge[];
|
|
58
|
-
source?: "internal" | "external";
|
|
59
63
|
}, Events, undefined, Values<{
|
|
60
|
-
syncManualLayoutActorLogic: {
|
|
61
|
-
src: "syncManualLayoutActorLogic";
|
|
62
|
-
logic: SyncLayoutActorLogic;
|
|
63
|
-
id: "syncLayout";
|
|
64
|
-
};
|
|
65
64
|
hotkeyActorLogic: {
|
|
66
65
|
src: "hotkeyActorLogic";
|
|
67
66
|
logic: HotkeyActorLogic;
|
|
@@ -82,7 +81,12 @@ export declare const initializing: {
|
|
|
82
81
|
logic: MediaPrintActorLogic;
|
|
83
82
|
id: "mediaPrint";
|
|
84
83
|
};
|
|
85
|
-
|
|
84
|
+
editorActor: {
|
|
85
|
+
src: "editorActor";
|
|
86
|
+
logic: EditorActorLogic;
|
|
87
|
+
id: "editor";
|
|
88
|
+
};
|
|
89
|
+
}>, never, never, never, never>[];
|
|
86
90
|
target: string;
|
|
87
91
|
};
|
|
88
92
|
};
|
|
@@ -96,11 +100,6 @@ export declare const isReady: {
|
|
|
96
100
|
always: ({
|
|
97
101
|
guard: "isReady";
|
|
98
102
|
actions: ActionFunction<Context, Events, Events, undefined, Values<{
|
|
99
|
-
syncManualLayoutActorLogic: {
|
|
100
|
-
src: "syncManualLayoutActorLogic";
|
|
101
|
-
logic: SyncLayoutActorLogic;
|
|
102
|
-
id: "syncLayout";
|
|
103
|
-
};
|
|
104
103
|
hotkeyActorLogic: {
|
|
105
104
|
src: "hotkeyActorLogic";
|
|
106
105
|
logic: HotkeyActorLogic;
|
|
@@ -121,11 +120,20 @@ export declare const isReady: {
|
|
|
121
120
|
logic: MediaPrintActorLogic;
|
|
122
121
|
id: "mediaPrint";
|
|
123
122
|
};
|
|
123
|
+
editorActor: {
|
|
124
|
+
src: "editorActor";
|
|
125
|
+
logic: EditorActorLogic;
|
|
126
|
+
id: "editor";
|
|
127
|
+
};
|
|
124
128
|
}>, never, Values<{
|
|
125
129
|
isReady: {
|
|
126
130
|
type: "isReady";
|
|
127
131
|
params: unknown;
|
|
128
132
|
};
|
|
133
|
+
"enabled: Editor": {
|
|
134
|
+
type: "enabled: Editor";
|
|
135
|
+
params: unknown;
|
|
136
|
+
};
|
|
129
137
|
"enabled: FitView": {
|
|
130
138
|
type: "enabled: FitView";
|
|
131
139
|
params: unknown;
|
|
@@ -158,6 +166,10 @@ export declare const isReady: {
|
|
|
158
166
|
type: "enabled: DynamicViewWalkthrough";
|
|
159
167
|
params: unknown;
|
|
160
168
|
};
|
|
169
|
+
"focus.node: autoUnfocus": {
|
|
170
|
+
type: "focus.node: autoUnfocus";
|
|
171
|
+
params: unknown;
|
|
172
|
+
};
|
|
161
173
|
"enabled: Overlays": {
|
|
162
174
|
type: "enabled: Overlays";
|
|
163
175
|
params: unknown;
|
|
@@ -170,6 +182,10 @@ export declare const isReady: {
|
|
|
170
182
|
type: "is dynamic view";
|
|
171
183
|
params: unknown;
|
|
172
184
|
};
|
|
185
|
+
"is same view": {
|
|
186
|
+
type: "is same view";
|
|
187
|
+
params: unknown;
|
|
188
|
+
};
|
|
173
189
|
"is another view": {
|
|
174
190
|
type: "is another view";
|
|
175
191
|
params: unknown;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emitInitialized } from './machine.actions.js';
|
|
1
|
+
import { emitInitialized, assignXYDataFromView } from './machine.actions.js';
|
|
2
2
|
import { fitDiagram } from './machine.actions.layout.js';
|
|
3
3
|
import { machine } from './machine.setup.js';
|
|
4
4
|
import { x as xstateActions_cjsExports } from '../../_virtual/xstate-actions.cjs.js';
|
|
@@ -16,15 +16,15 @@ const initializing = machine.createStateConfig({
|
|
|
16
16
|
target: "isReady"
|
|
17
17
|
},
|
|
18
18
|
"update.view": {
|
|
19
|
-
actions:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
actions: [
|
|
20
|
+
assignXYDataFromView(),
|
|
21
|
+
xstateActions_cjsExports.assign(({ context }) => ({
|
|
22
|
+
initialized: {
|
|
23
|
+
...context.initialized,
|
|
24
|
+
xydata: true
|
|
25
|
+
}
|
|
26
|
+
}))
|
|
27
|
+
],
|
|
28
28
|
target: "isReady"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BBox } from '@likec4/core/types';
|
|
2
2
|
import { invariant, nonNullable } from '@likec4/core/utils';
|
|
3
|
+
import { isTruthy } from 'remeda';
|
|
3
4
|
import { enqueueActions, assertEvent } from 'xstate';
|
|
5
|
+
import { convertToXYFlow } from '../convert-to-xyflow.js';
|
|
4
6
|
import { mergeXYNodesEdges } from './assign.js';
|
|
5
7
|
import { disableCompareWithLatest } from './machine.actions.js';
|
|
6
8
|
import { machine, targetState } from './machine.setup.js';
|
|
7
|
-
import { calcViewportForBounds, findCorrespondingNode, nodeRef } from './utils.js';
|
|
9
|
+
import { calcViewportForBounds, findCorrespondingNode, findNodeByModelFqn, nodeRef } from './utils.js';
|
|
8
10
|
import { cancelFitDiagram, raiseSetViewport, raiseFitDiagram } from './machine.actions.layout.js';
|
|
9
11
|
|
|
10
12
|
const handleBrowserForwardBackward = () => machine.assign(({ context, event }) => {
|
|
@@ -73,17 +75,24 @@ const navigating = machine.createStateConfig({
|
|
|
73
75
|
history
|
|
74
76
|
}
|
|
75
77
|
} = context;
|
|
78
|
+
const eventWithXYData = "xynodes" in event ? event : {
|
|
79
|
+
...event,
|
|
80
|
+
...convertToXYFlow({
|
|
81
|
+
dynamicViewVariant: context.dynamicViewVariant,
|
|
82
|
+
view: event.view,
|
|
83
|
+
where: context.where
|
|
84
|
+
})
|
|
85
|
+
};
|
|
76
86
|
invariant(xyflow, "xyflow is not initialized");
|
|
77
87
|
const calcZoomTowardsNextViewport = (nextViewport2) => {
|
|
78
88
|
const zoom = xyflow.getZoom();
|
|
79
|
-
const coef = nextViewport2.zoom < zoom ? 0.
|
|
89
|
+
const coef = nextViewport2.zoom < zoom ? 0.8 : 0.4;
|
|
80
90
|
return zoom + (nextViewport2.zoom - zoom) * coef;
|
|
81
91
|
};
|
|
82
92
|
const fromHistory = history[currentIndex];
|
|
83
93
|
if (fromHistory && fromHistory.viewId === event.view.id) {
|
|
84
|
-
console.log("Navigating: fromHistory", fromHistory);
|
|
85
94
|
enqueue.assign({
|
|
86
|
-
...mergeXYNodesEdges(context,
|
|
95
|
+
...mergeXYNodesEdges(context, eventWithXYData),
|
|
87
96
|
dynamicViewVariant: fromHistory.dynamicViewVariant ?? context.dynamicViewVariant,
|
|
88
97
|
viewportChangedManually: fromHistory.viewportChangedManually
|
|
89
98
|
});
|
|
@@ -128,7 +137,7 @@ const navigating = machine.createStateConfig({
|
|
|
128
137
|
context,
|
|
129
138
|
event.view.bounds
|
|
130
139
|
);
|
|
131
|
-
const { fromNode, toNode } = findCorrespondingNode(context,
|
|
140
|
+
const { fromNode, toNode } = findCorrespondingNode(context, eventWithXYData);
|
|
132
141
|
if (fromNode && toNode) {
|
|
133
142
|
const elFrom = xyflow.getInternalNode(fromNode.id);
|
|
134
143
|
const fromPoint = xyflow.flowToScreenPosition({
|
|
@@ -158,8 +167,10 @@ const navigating = machine.createStateConfig({
|
|
|
158
167
|
viewport: { ...nextViewport },
|
|
159
168
|
viewportChangedManually: false
|
|
160
169
|
});
|
|
170
|
+
const focusOnElement = context.lastOnNavigate?.focusOnElement;
|
|
171
|
+
const nodeToFocus = isTruthy(focusOnElement) ? findNodeByModelFqn(eventWithXYData.xynodes, focusOnElement) : null;
|
|
161
172
|
enqueue.assign({
|
|
162
|
-
...mergeXYNodesEdges(context,
|
|
173
|
+
...mergeXYNodesEdges(context, eventWithXYData),
|
|
163
174
|
viewportChangedManually: false,
|
|
164
175
|
lastOnNavigate: null,
|
|
165
176
|
navigationHistory: {
|
|
@@ -167,9 +178,17 @@ const navigating = machine.createStateConfig({
|
|
|
167
178
|
history: updatedHistory
|
|
168
179
|
}
|
|
169
180
|
});
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
181
|
+
if (nodeToFocus) {
|
|
182
|
+
enqueue.raise({
|
|
183
|
+
type: "focus.node",
|
|
184
|
+
nodeId: nodeToFocus.id,
|
|
185
|
+
autoUnfocus: true
|
|
186
|
+
}, { delay: 150 });
|
|
187
|
+
} else {
|
|
188
|
+
enqueue(raiseFitDiagram({
|
|
189
|
+
delay: 100
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
173
192
|
})
|
|
174
193
|
]
|
|
175
194
|
}
|