@likec4/diagram 1.22.0 → 1.23.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/dist/LikeC4Diagram.js +2 -3
- package/dist/base/BaseXYFlow.js +0 -1
- package/dist/base/example/custom.d.ts +1 -1
- package/dist/base/primitives/customEdge.d.ts +1 -1
- package/dist/base/primitives/edge/EdgePath.d.ts +1 -1
- package/dist/context/DiagramEventHandlers.d.ts +6 -2
- package/dist/context/DiagramEventHandlers.js +25 -20
- package/dist/context/DiagramFeatures.d.ts +1 -1
- package/dist/context/DiagramFeatures.js +9 -22
- package/dist/{style.css → diagram.css} +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/safeContext.d.ts +7 -0
- package/dist/hooks/safeContext.js +14 -0
- package/dist/hooks/useCurrentViewId.js +1 -1
- package/dist/hooks/useDiagram.d.ts +7250 -6596
- package/dist/hooks/useDiagram.js +29 -14
- package/dist/index.js +1 -1
- package/dist/likec4diagram/DiagramUI.js +12 -5
- package/dist/likec4diagram/XYFlow.js +11 -5
- package/dist/likec4diagram/custom/edges/NotePopover.js +1 -2
- package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +6 -7
- package/dist/likec4diagram/custom/index.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +1 -1
- package/dist/likec4diagram/ui/controls/ChangeAutoLayoutButton.js +1 -2
- package/dist/likec4diagram/ui/controls/Controls.js +5 -13
- package/dist/likec4diagram/ui/controls/NavigationButtons.js +1 -2
- package/dist/likec4diagram/ui/controls/ToggleReadonly.d.ts +1 -0
- package/dist/likec4diagram/ui/controls/ToggleReadonly.js +28 -0
- package/dist/likec4diagram/ui/diagram-title/DiagramTitlePanel.js +8 -9
- package/dist/likec4diagram/ui/notation/NotationPanel.js +1 -2
- package/dist/likec4diagram/ui/search/LikeC4Search.js +2 -4
- package/dist/likec4diagram/ui/search/ViewsColum.js +1 -1
- package/dist/likec4diagram/ui/search/state.js +1 -1
- package/dist/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.js +1 -2
- package/dist/likec4diagram/useViewToNodesEdges.d.ts +0 -1
- package/dist/likec4diagram/useViewToNodesEdges.js +0 -2
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Accordion/Accordion.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ActionIcon/ActionIcon.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Affix/Affix.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Alert/Alert.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Anchor/Anchor.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AngleSlider/AngleSlider.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AppShell/AppShell.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/AspectRatio/AspectRatio.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Avatar/Avatar.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/BackgroundImage/BackgroundImage.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Badge/Badge.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Blockquote/Blockquote.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Breadcrumbs/Breadcrumbs.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Burger/Burger.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Button/Button.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Card/Card.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Center/Center.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/Checkbox.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/CheckboxCard/CheckboxCard.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Checkbox/CheckboxIndicator/CheckboxIndicator.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Chip/Chip.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/CloseButton/CloseButton.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Code/Code.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorInput/ColorInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorPicker/ColorPicker.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ColorSwatch/ColorSwatch.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Combobox/Combobox.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Container/Container.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Dialog/Dialog.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Divider/Divider.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Drawer/Drawer.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Fieldset/Fieldset.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Flex/Flex.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/FloatingIndicator/FloatingIndicator.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Grid/Grid.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Group/Group.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Image/Image.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Indicator/Indicator.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/InlineInput/InlineInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Input/Input.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Kbd/Kbd.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/List/List.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Loader/Loader.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/LoadingOverlay/LoadingOverlay.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Mark/Mark.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Menu/Menu.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Modal/Modal.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ModalBase/ModalBase.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/NavLink/NavLink.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Notification/Notification.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/NumberInput/NumberInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Overlay/Overlay.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Pagination/Pagination.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Paper/Paper.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PasswordInput/PasswordInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Pill/Pill.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PillsInput/PillsInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/PinInput/PinInput.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Popover/Popover.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Progress/Progress.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/Radio.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/RadioCard/RadioCard.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Radio/RadioIndicator/RadioIndicator.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Rating/Rating.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/RingProgress/RingProgress.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ScrollArea/ScrollArea.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SegmentedControl/SegmentedControl.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SemiCircleProgress/SemiCircleProgress.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/SimpleGrid/SimpleGrid.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Skeleton/Skeleton.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Slider/Slider.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Spoiler/Spoiler.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Stack/Stack.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Stepper/Stepper.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Switch/Switch.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Table/Table.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/TableOfContents/TableOfContents.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tabs/Tabs.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/ThemeIcon/ThemeIcon.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Timeline/Timeline.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Title/Title.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tooltip/Tooltip.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/Tree/Tree.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/TypographyStylesProvider/TypographyStylesProvider.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/UnstyledButton/UnstyledButton.module.css.mjs.vanilla.css.js +1 -0
- package/dist/node_modules/.pnpm/@mantine_core@7.17.0_@mantine_hooks@7.17.0_react@19.0.0__@types_react@19.0.8_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@mantine/core/esm/components/VisuallyHidden/VisuallyHidden.module.css.mjs.vanilla.css.js +1 -0
- package/dist/overlays/Overlays.d.ts +4 -1
- package/dist/overlays/Overlays.js +72 -60
- package/dist/overlays/element-details/ElementDetails.d.ts +6 -0
- package/dist/overlays/element-details/ElementDetails.js +31 -0
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -9
- package/dist/overlays/element-details/TabPanelDeployments.js +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +3 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +20 -20
- package/dist/overlays/element-details/actor.d.ts +20626 -0
- package/dist/overlays/element-details/actor.js +68 -0
- package/dist/overlays/element-details/actorContext.d.ts +7 -0
- package/dist/overlays/element-details/actorContext.js +14 -0
- package/dist/overlays/overlay/Overlay.css.js +87 -87
- package/dist/overlays/overlay/Overlay.js +16 -1
- package/dist/overlays/overlaysActor.d.ts +190 -0
- package/dist/overlays/overlaysActor.js +233 -0
- package/dist/overlays/relationship-details/actor.d.ts +130 -4
- package/dist/overlays/relationship-details/actor.js +2 -2
- package/dist/overlays/relationship-details/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +17 -0
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +17 -19
- package/dist/overlays/relationships-browser/actor.d.ts +1095 -8
- package/dist/overlays/relationships-browser/actor.js +181 -173
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -2
- package/dist/overlays/relationships-browser/custom/edgeTypes.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +17 -0
- package/dist/overlays/relationships-browser/hooks.d.ts +1 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -5
- package/dist/overlays/types.d.ts +29 -0
- package/dist/{likec4diagram/DiagramActor.d.ts → state/DiagramActorProvider.d.ts} +2 -2
- package/dist/state/DiagramActorProvider.js +77 -0
- package/dist/{likec4diagram/state → state}/assign.d.ts +2 -2
- package/dist/{likec4diagram/state → state}/assign.js +2 -2
- package/dist/state/diagram-machine.d.ts +11680 -0
- package/dist/{likec4diagram/state/machine.js → state/diagram-machine.js} +120 -192
- package/dist/{likec4diagram/state → state}/hotkeyActor.d.ts +1 -1
- package/dist/state/hotkeyActor.js +26 -0
- package/dist/state/inspector.d.ts +4 -0
- package/dist/{likec4diagram/state → state}/syncManualLayoutActor.d.ts +7 -8
- package/dist/{likec4diagram/state → state}/syncManualLayoutActor.js +7 -13
- package/dist/state/types.d.ts +19 -0
- package/dist/state/utils.d.ts +17 -0
- package/dist/{likec4diagram/state → state}/utils.js +20 -1
- package/package.json +20 -25
- package/src/LikeC4Diagram.tsx +3 -5
- package/src/base/BaseXYFlow.tsx +2 -1
- package/src/base/primitives/compound/CompoundTitle.css.ts +0 -5
- package/src/context/DiagramEventHandlers.tsx +27 -13
- package/src/context/DiagramFeatures.tsx +9 -22
- package/src/hooks/index.ts +0 -1
- package/src/hooks/safeContext.tsx +16 -0
- package/src/hooks/useCurrentViewId.ts +2 -2
- package/src/hooks/useDiagram.ts +47 -15
- package/src/likec4diagram/DiagramUI.tsx +14 -11
- package/src/likec4diagram/XYFlow.tsx +13 -6
- package/src/likec4diagram/custom/edges/NotePopover.tsx +1 -2
- package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +1 -1
- package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +6 -7
- package/src/likec4diagram/custom/nodes/toolbar/Toolbar.tsx +1 -1
- package/src/likec4diagram/ui/controls/ChangeAutoLayoutButton.tsx +2 -3
- package/src/likec4diagram/ui/controls/Controls.tsx +4 -4
- package/src/likec4diagram/ui/controls/NavigationButtons.tsx +1 -2
- package/src/likec4diagram/ui/controls/ToggleReadonly.tsx +30 -0
- package/src/likec4diagram/ui/diagram-title/DiagramTitlePanel.tsx +8 -11
- package/src/likec4diagram/ui/notation/NotationPanel.tsx +2 -3
- package/src/likec4diagram/ui/search/LikeC4Search.tsx +1 -4
- package/src/likec4diagram/ui/search/ViewsColum.tsx +1 -1
- package/src/likec4diagram/ui/search/state.ts +1 -1
- package/src/likec4diagram/ui/walkthrough/DynamicViewWalkthrough.tsx +1 -2
- package/src/likec4diagram/useViewToNodesEdges.ts +0 -4
- package/src/overlays/Overlays.tsx +81 -71
- package/src/overlays/element-details/ElementDetails.tsx +33 -0
- package/src/overlays/element-details/ElementDetailsCard.tsx +8 -18
- package/src/overlays/element-details/TabPanelDeployments.tsx +1 -1
- package/src/overlays/element-details/TabPanelRelationships.tsx +33 -32
- package/src/overlays/element-details/actor.ts +102 -0
- package/src/overlays/element-details/actorContext.tsx +16 -0
- package/src/overlays/overlay/Overlay.tsx +14 -11
- package/src/overlays/overlaysActor.ts +278 -0
- package/src/overlays/relationship-details/actor.ts +8 -11
- package/src/overlays/relationship-details/custom/nodeTypes.tsx +18 -0
- package/src/overlays/relationships-browser/RelationshipsBrowser.tsx +23 -29
- package/src/overlays/relationships-browser/actor.ts +216 -220
- package/src/overlays/relationships-browser/custom/ElementActions.tsx +3 -2
- package/src/overlays/relationships-browser/custom/nodeTypes.tsx +20 -0
- package/src/overlays/relationships-browser/hooks.ts +7 -5
- package/src/overlays/types.ts +39 -0
- package/src/state/DiagramActorProvider.tsx +97 -0
- package/src/{likec4diagram/state → state}/assign.ts +4 -4
- package/src/{likec4diagram/state/machine.ts → state/diagram-machine.ts} +152 -203
- package/src/state/hotkeyActor.ts +29 -0
- package/src/state/inspector.ts +5 -0
- package/src/{likec4diagram/state → state}/syncManualLayoutActor.ts +14 -21
- package/src/state/types.ts +23 -0
- package/src/{likec4diagram/state → state}/utils.ts +24 -2
- package/dist/hooks/useDiagramActor.d.ts +0 -5
- package/dist/hooks/useDiagramActor.js +0 -21
- package/dist/hooks/useDiagramContext.d.ts +0 -3
- package/dist/hooks/useDiagramContext.js +0 -10
- package/dist/likec4diagram/DiagramActor.js +0 -71
- package/dist/likec4diagram/state/actorContext.d.ts +0 -51923
- package/dist/likec4diagram/state/actorContext.js +0 -12
- package/dist/likec4diagram/state/hotkeyActor.js +0 -18
- package/dist/likec4diagram/state/inspector.d.ts +0 -5
- package/dist/likec4diagram/state/machine.d.ts +0 -10979
- package/dist/likec4diagram/state/utils.d.ts +0 -8
- package/src/hooks/useDiagramActor.ts +0 -27
- package/src/hooks/useDiagramContext.ts +0 -14
- package/src/likec4diagram/DiagramActor.tsx +0 -79
- package/src/likec4diagram/state/actorContext.ts +0 -8
- package/src/likec4diagram/state/hotkeyActor.ts +0 -20
- package/src/likec4diagram/state/inspector.ts +0 -23
- /package/dist/{likec4diagram/state → state}/aligners.d.ts +0 -0
- /package/dist/{likec4diagram/state → state}/aligners.js +0 -0
- /package/src/{likec4diagram/state → state}/aligners.ts +0 -0
|
@@ -4,20 +4,17 @@ import { IconMenu } from '@tabler/icons-react'
|
|
|
4
4
|
import clsx from 'clsx'
|
|
5
5
|
import { AnimatePresence, m } from 'framer-motion'
|
|
6
6
|
import { Link } from '../../../components/Link'
|
|
7
|
-
import { useDiagramContext } from '../../../hooks/
|
|
8
|
-
import type { DiagramContext } from '../../state/machine'
|
|
7
|
+
import { useDiagramContext } from '../../../hooks/useDiagram'
|
|
9
8
|
import * as css from './DiagramTitlePanel.css'
|
|
10
9
|
|
|
11
|
-
const selector = (s: DiagramContext) => ({
|
|
12
|
-
id: s.view.id,
|
|
13
|
-
title: s.view.title ?? 'untitled',
|
|
14
|
-
description: s.view.description,
|
|
15
|
-
links: s.view.links,
|
|
16
|
-
isNotActiveWalkthrough: s.activeWalkthrough === null,
|
|
17
|
-
})
|
|
18
|
-
|
|
19
10
|
export function DiagramTitlePanel() {
|
|
20
|
-
const { id, title, description, links, isNotActiveWalkthrough } = useDiagramContext(
|
|
11
|
+
const { id, title, description, links, isNotActiveWalkthrough } = useDiagramContext(s => ({
|
|
12
|
+
id: s.view.id,
|
|
13
|
+
title: s.view.title ?? 'untitled',
|
|
14
|
+
description: s.view.description,
|
|
15
|
+
links: s.view.links,
|
|
16
|
+
isNotActiveWalkthrough: s.activeWalkthrough === null,
|
|
17
|
+
}))
|
|
21
18
|
const [isCollapsed, setCollapsed] = useLocalStorage({
|
|
22
19
|
key: 'diagram-title-webview-collapsed',
|
|
23
20
|
defaultValue: false,
|
|
@@ -24,10 +24,9 @@ import { memo, useState } from 'react'
|
|
|
24
24
|
import { ceil, isNonNullish } from 'remeda'
|
|
25
25
|
import { ElementShape } from '../../../base/primitives'
|
|
26
26
|
import { useMantinePortalProps } from '../../../hooks'
|
|
27
|
-
import { useDiagram } from '../../../hooks/useDiagram'
|
|
28
|
-
import { useDiagramContext } from '../../../hooks/useDiagramContext'
|
|
27
|
+
import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram'
|
|
29
28
|
import { useXYStore } from '../../../hooks/useXYFlow'
|
|
30
|
-
import { DiagramContext } from '../../../
|
|
29
|
+
import type { DiagramContext } from '../../../state/types'
|
|
31
30
|
import { vars } from '../../../theme-vars'
|
|
32
31
|
import * as css from './NotationPanel.css'
|
|
33
32
|
|
|
@@ -105,10 +105,7 @@ export function LikeC4Search() {
|
|
|
105
105
|
|
|
106
106
|
function LikeC4SearchOverlay() {
|
|
107
107
|
const close = useCloseSearch()
|
|
108
|
-
const
|
|
109
|
-
const { ref: forcusRef, focused } = useFocusWithin()
|
|
110
|
-
|
|
111
|
-
const ref = useMergedRef(forcusRef, focusTrapRef)
|
|
108
|
+
const ref = useFocusTrap()
|
|
112
109
|
|
|
113
110
|
useWindowEvent(
|
|
114
111
|
'keydown',
|
|
@@ -20,7 +20,7 @@ import { IconStack2, IconZoomScan } from '@tabler/icons-react'
|
|
|
20
20
|
import clsx from 'clsx'
|
|
21
21
|
import { m } from 'framer-motion'
|
|
22
22
|
import { first } from 'remeda'
|
|
23
|
-
import { useCurrentViewId } from '../../../hooks'
|
|
23
|
+
import { useCurrentViewId } from '../../../hooks/useCurrentViewId'
|
|
24
24
|
import { useLikeC4Model } from '../../../likec4model/useLikeC4Model'
|
|
25
25
|
import { emptyBoX } from './_shared.css'
|
|
26
26
|
import { useCloseSearchAndNavigateTo, useNormalizedSearch } from './state'
|
|
@@ -66,7 +66,7 @@ export function useCloseSearchAndNavigateTo() {
|
|
|
66
66
|
const fromNode = fromElementFqn
|
|
67
67
|
? diagram.getContext().view.nodes.find(n => DiagramNode.modelRef(n) === fromElementFqn)?.id
|
|
68
68
|
: undefined
|
|
69
|
-
if (diagram.currentView
|
|
69
|
+
if (diagram.currentView.id === viewId && fromNode) {
|
|
70
70
|
diagram.focusNode(fromNode)
|
|
71
71
|
return
|
|
72
72
|
}
|
|
@@ -9,8 +9,7 @@ import clsx from 'clsx'
|
|
|
9
9
|
import { AnimatePresence, m } from 'framer-motion'
|
|
10
10
|
import { isNonNull, isTruthy } from 'remeda'
|
|
11
11
|
import { useXYStore } from '../../../hooks'
|
|
12
|
-
import { useDiagram } from '../../../hooks/useDiagram'
|
|
13
|
-
import { useDiagramContext } from '../../../hooks/useDiagramContext'
|
|
12
|
+
import { useDiagram, useDiagramContext } from '../../../hooks/useDiagram'
|
|
14
13
|
import * as css from './DynamicViewWalkthrough.css'
|
|
15
14
|
|
|
16
15
|
export function DynamicViewWalkthrough() {
|
|
@@ -21,7 +21,6 @@ import type { Types } from './types'
|
|
|
21
21
|
function viewToNodesEdge(opts: {
|
|
22
22
|
view: Pick<DiagramView, 'id' | 'nodes' | 'edges' | '__'>
|
|
23
23
|
where: WhereOperator<string, string> | undefined
|
|
24
|
-
nodesDraggable: boolean
|
|
25
24
|
nodesSelectable: boolean
|
|
26
25
|
}): {
|
|
27
26
|
xynodes: Types.Node[]
|
|
@@ -29,7 +28,6 @@ function viewToNodesEdge(opts: {
|
|
|
29
28
|
} {
|
|
30
29
|
const {
|
|
31
30
|
view,
|
|
32
|
-
nodesDraggable: draggable,
|
|
33
31
|
nodesSelectable: selectable,
|
|
34
32
|
} = opts
|
|
35
33
|
const isDynamicView = view.__ === 'dynamic',
|
|
@@ -95,7 +93,6 @@ function viewToNodesEdge(opts: {
|
|
|
95
93
|
|
|
96
94
|
const base = {
|
|
97
95
|
id,
|
|
98
|
-
draggable: draggable,
|
|
99
96
|
selectable: selectable && node.kind !== ElementKind.Group,
|
|
100
97
|
focusable: selectable && !isCompound,
|
|
101
98
|
deletable: false,
|
|
@@ -281,7 +278,6 @@ export function useViewToNodesEdges({
|
|
|
281
278
|
}: {
|
|
282
279
|
view: DiagramView
|
|
283
280
|
where: WhereOperator<string, string> | undefined
|
|
284
|
-
nodesDraggable: boolean
|
|
285
281
|
nodesSelectable: boolean
|
|
286
282
|
}) {
|
|
287
283
|
return useDeepCompareMemo(() => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { nonexhaustive } from '@likec4/core'
|
|
2
|
+
import { Box, Button, Code, Group, Notification, ScrollAreaAutosize } from '@mantine/core'
|
|
3
3
|
import { IconX } from '@tabler/icons-react'
|
|
4
|
-
import {
|
|
4
|
+
import { useSelector } from '@xstate/react'
|
|
5
5
|
import { AnimatePresence, useReducedMotion } from 'framer-motion'
|
|
6
6
|
import { animate } from 'framer-motion/dom'
|
|
7
7
|
import { memo, useEffect, useMemo } from 'react'
|
|
8
8
|
import { type FallbackProps, ErrorBoundary } from 'react-error-boundary'
|
|
9
|
+
import { isNonNullish } from 'remeda'
|
|
10
|
+
import type { AnyActorRef } from 'xstate'
|
|
9
11
|
import { DiagramFeatures } from '../context'
|
|
10
12
|
import { useXYStore } from '../hooks'
|
|
11
|
-
import {
|
|
12
|
-
import { useDiagramActorState } from '../hooks/useDiagramActor'
|
|
13
|
-
import type { MachineSnapshot } from '../likec4diagram/state/machine'
|
|
14
|
-
import { ElementDetailsCard } from './element-details/ElementDetailsCard'
|
|
13
|
+
import { ElementDetails } from './element-details/ElementDetails'
|
|
15
14
|
import { Overlay } from './overlay/Overlay'
|
|
15
|
+
import { type OverlaysActorRef, type OverlaysActorSnapshot } from './overlaysActor'
|
|
16
16
|
import { RelationshipDetails } from './relationship-details/RelationshipDetails'
|
|
17
17
|
import { RelationshipsBrowser } from './relationships-browser/RelationshipsBrowser'
|
|
18
18
|
|
|
@@ -31,7 +31,9 @@ function Fallback({ error, resetErrorBoundary }: FallbackProps) {
|
|
|
31
31
|
title={'Oops, something went wrong'}
|
|
32
32
|
p={'xl'}
|
|
33
33
|
withCloseButton={false}>
|
|
34
|
-
<
|
|
34
|
+
<ScrollAreaAutosize maw={'100%'} mah={400}>
|
|
35
|
+
<Code block>{errorString}</Code>
|
|
36
|
+
</ScrollAreaAutosize>
|
|
35
37
|
<Group gap={'xs'} mt="xl">
|
|
36
38
|
<Button color="gray" size="xs" variant="light" onClick={() => resetErrorBoundary()}>Reset</Button>
|
|
37
39
|
</Group>
|
|
@@ -40,40 +42,50 @@ function Fallback({ error, resetErrorBoundary }: FallbackProps) {
|
|
|
40
42
|
)
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
const selectOverlays = (s: OverlaysActorSnapshot) => {
|
|
46
|
+
return s.context.overlays.map((overlay) => {
|
|
47
|
+
switch (overlay.type) {
|
|
48
|
+
case 'relationshipsBrowser':
|
|
49
|
+
return s.children[overlay.id]
|
|
50
|
+
? {
|
|
51
|
+
type: overlay.type,
|
|
52
|
+
actorRef: s.children[overlay.id]!,
|
|
53
|
+
}
|
|
54
|
+
: null
|
|
55
|
+
case 'relationshipDetails':
|
|
56
|
+
return s.children[overlay.id]
|
|
57
|
+
? {
|
|
58
|
+
type: overlay.type,
|
|
59
|
+
actorRef: s.children[overlay.id]!,
|
|
60
|
+
}
|
|
61
|
+
: null
|
|
62
|
+
case 'elementDetails':
|
|
63
|
+
return s.children[overlay.id]
|
|
64
|
+
? {
|
|
65
|
+
type: overlay.type,
|
|
66
|
+
actorRef: s.children[overlay.id]!,
|
|
67
|
+
}
|
|
68
|
+
: null
|
|
69
|
+
default:
|
|
70
|
+
nonexhaustive(overlay)
|
|
71
|
+
}
|
|
72
|
+
}).filter(isNonNullish)
|
|
73
|
+
}
|
|
74
|
+
const compareSelectOverlays = <T extends ReturnType<typeof selectOverlays>>(a: T, b: T) => {
|
|
75
|
+
return a.length === b.length && a.every((overlay, i) => {
|
|
76
|
+
return overlay.actorRef === b[i]!.actorRef
|
|
77
|
+
})
|
|
78
|
+
}
|
|
58
79
|
|
|
59
|
-
export const Overlays = memo(() => {
|
|
80
|
+
export const Overlays = memo(({ overlaysActorRef }: { overlaysActorRef: OverlaysActorRef }) => {
|
|
60
81
|
const xyflowDomNode = useXYStore(s => s.domNode)
|
|
61
82
|
const xyflowRendererDom = useMemo(() => xyflowDomNode?.querySelector('.react-flow__renderer') ?? null, [
|
|
62
83
|
xyflowDomNode,
|
|
63
84
|
])
|
|
64
|
-
const
|
|
65
|
-
const {
|
|
66
|
-
relationshipsBrowserActor,
|
|
67
|
-
relationshipDetailsActor,
|
|
68
|
-
activeElementDetailsOf,
|
|
69
|
-
viewId,
|
|
70
|
-
fromNode,
|
|
71
|
-
rectFromNode,
|
|
72
|
-
} = useDiagramActorState(selector, equals)
|
|
73
|
-
|
|
85
|
+
const overlays = useSelector(overlaysActorRef, selectOverlays, compareSelectOverlays)
|
|
74
86
|
const isMotionReduced = useReducedMotion() ?? false
|
|
75
87
|
|
|
76
|
-
const isActiveOverlay =
|
|
88
|
+
const isActiveOverlay = overlays.length > 0
|
|
77
89
|
|
|
78
90
|
useEffect(() => {
|
|
79
91
|
if (!xyflowRendererDom || isMotionReduced) return
|
|
@@ -86,47 +98,45 @@ export const Overlays = memo(() => {
|
|
|
86
98
|
})
|
|
87
99
|
}, [isActiveOverlay, xyflowRendererDom])
|
|
88
100
|
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
101
|
+
const close = (actorRef: AnyActorRef) => {
|
|
102
|
+
overlaysActorRef.send({ type: 'close', actorId: actorRef.id })
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const overlaysReact = overlays.map((overlay) => {
|
|
106
|
+
switch (overlay.type) {
|
|
107
|
+
case 'relationshipsBrowser':
|
|
108
|
+
return (
|
|
109
|
+
<Overlay
|
|
110
|
+
key={overlay.actorRef.sessionId}
|
|
111
|
+
onClose={() => close(overlay.actorRef)}>
|
|
112
|
+
<RelationshipsBrowser actorRef={overlay.actorRef} />
|
|
113
|
+
</Overlay>
|
|
114
|
+
)
|
|
115
|
+
case 'relationshipDetails':
|
|
116
|
+
return (
|
|
117
|
+
<Overlay
|
|
118
|
+
key={overlay.actorRef.sessionId}
|
|
119
|
+
onClose={() => close(overlay.actorRef)}>
|
|
120
|
+
<RelationshipDetails actorRef={overlay.actorRef} />
|
|
121
|
+
</Overlay>
|
|
122
|
+
)
|
|
123
|
+
case 'elementDetails':
|
|
124
|
+
return (
|
|
125
|
+
<ElementDetails
|
|
126
|
+
key={overlay.actorRef.sessionId}
|
|
127
|
+
actorRef={overlay.actorRef}
|
|
128
|
+
onClose={() => close(overlay.actorRef)} />
|
|
129
|
+
)
|
|
130
|
+
default:
|
|
131
|
+
nonexhaustive(overlay)
|
|
132
|
+
}
|
|
94
133
|
})
|
|
95
134
|
|
|
96
135
|
return (
|
|
97
136
|
<DiagramFeatures.Overlays>
|
|
98
|
-
<ErrorBoundary FallbackComponent={Fallback} onReset={
|
|
99
|
-
<AnimatePresence onExitComplete={onClose}>
|
|
100
|
-
{relationshipsBrowserActor && (
|
|
101
|
-
<Overlay
|
|
102
|
-
key={'relationships-browser'}
|
|
103
|
-
onClose={() => relationshipsBrowserActor.send({ type: 'close' })}>
|
|
104
|
-
<RelationshipsBrowser actorRef={relationshipsBrowserActor} />
|
|
105
|
-
</Overlay>
|
|
106
|
-
)}
|
|
107
|
-
</AnimatePresence>
|
|
108
|
-
<AnimatePresence onExitComplete={onClose}>
|
|
109
|
-
{relationshipDetailsActor && (
|
|
110
|
-
<Overlay
|
|
111
|
-
key={'relationship-details'}
|
|
112
|
-
onClose={() => relationshipDetailsActor.send({ type: 'close' })}>
|
|
113
|
-
<RelationshipDetails actorRef={relationshipDetailsActor} />
|
|
114
|
-
</Overlay>
|
|
115
|
-
)}
|
|
116
|
-
</AnimatePresence>
|
|
117
|
-
|
|
118
|
-
{/* TODO: Somehow ElementDetailsCard does not work properly inside AnimatePresence} */}
|
|
137
|
+
<ErrorBoundary FallbackComponent={Fallback} onReset={() => overlaysActorRef.send({ type: 'close.all' })}>
|
|
119
138
|
<AnimatePresence>
|
|
120
|
-
{
|
|
121
|
-
<ElementDetailsCard
|
|
122
|
-
key={'element-details'}
|
|
123
|
-
fqn={activeElementDetailsOf}
|
|
124
|
-
viewId={viewId}
|
|
125
|
-
fromNode={fromNode}
|
|
126
|
-
rectFromNode={rectFromNode}
|
|
127
|
-
onClose={onClose}
|
|
128
|
-
/>
|
|
129
|
-
)}
|
|
139
|
+
{overlaysReact}
|
|
130
140
|
</AnimatePresence>
|
|
131
141
|
</ErrorBoundary>
|
|
132
142
|
</DiagramFeatures.Overlays>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallbackRef } from '@mantine/hooks'
|
|
2
|
+
import { useSelector } from '@xstate/react'
|
|
3
|
+
import { shallowEqual } from 'fast-equals'
|
|
4
|
+
import type { ElementDetailsActorRef } from './actor'
|
|
5
|
+
import { ElementDetailsActorContext } from './actorContext'
|
|
6
|
+
import { ElementDetailsCard } from './ElementDetailsCard'
|
|
7
|
+
|
|
8
|
+
export type ElementDetailsProps = {
|
|
9
|
+
actorRef: ElementDetailsActorRef
|
|
10
|
+
onClose: () => void
|
|
11
|
+
}
|
|
12
|
+
export function ElementDetails({
|
|
13
|
+
actorRef,
|
|
14
|
+
onClose,
|
|
15
|
+
}: ElementDetailsProps) {
|
|
16
|
+
const props = useSelector(
|
|
17
|
+
actorRef,
|
|
18
|
+
useCallbackRef((s) => ({
|
|
19
|
+
viewId: s.context.currentView.id,
|
|
20
|
+
fromNode: s.context.initiatedFrom.node,
|
|
21
|
+
rectFromNode: s.context.initiatedFrom.clientRect,
|
|
22
|
+
fqn: s.context.subject,
|
|
23
|
+
})),
|
|
24
|
+
shallowEqual,
|
|
25
|
+
)
|
|
26
|
+
return (
|
|
27
|
+
<ElementDetailsActorContext value={actorRef}>
|
|
28
|
+
<ElementDetailsCard
|
|
29
|
+
onClose={onClose}
|
|
30
|
+
{...props} />
|
|
31
|
+
</ElementDetailsActorContext>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -42,7 +42,7 @@ import { clamp, isNullish, map, only, partition, pipe } from 'remeda'
|
|
|
42
42
|
import { Link } from '../../components/Link'
|
|
43
43
|
import { DiagramFeatures, IconRenderer, IfEnabled } from '../../context'
|
|
44
44
|
import { useUpdateEffect } from '../../hooks'
|
|
45
|
-
import { useDiagram } from '../../hooks/useDiagram'
|
|
45
|
+
import { useDiagram, useDiagramContext } from '../../hooks/useDiagram'
|
|
46
46
|
import type { OnNavigateTo } from '../../LikeC4Diagram.props'
|
|
47
47
|
import { useLikeC4Model } from '../../likec4model'
|
|
48
48
|
import * as css from './ElementDetailsCard.css'
|
|
@@ -116,14 +116,6 @@ export function ElementDetailsCard({
|
|
|
116
116
|
|
|
117
117
|
const elementModel = viewModel.$model.element(fqn)
|
|
118
118
|
|
|
119
|
-
// const incoming = elementModel.incoming().map(r => r.id).toArray()
|
|
120
|
-
// const outgoing = elementModel.outgoing().map(r => r.id).toArray()
|
|
121
|
-
// const incomingInView = unique(nodeModel.incoming().flatMap(e => e.$edge.relations).toArray())
|
|
122
|
-
// const outgoingInView = unique(nodeModel.outgoing().flatMap(e => e.$edge.relations).toArray())
|
|
123
|
-
// const notIncludedRelations = [
|
|
124
|
-
// ...incoming,
|
|
125
|
-
// ...outgoing
|
|
126
|
-
// ].filter(r => !incomingInView.includes(r) && !outgoingInView.includes(r)).length
|
|
127
119
|
const [viewsOf, otherViews] = pipe(
|
|
128
120
|
[...elementModel.views()],
|
|
129
121
|
map(v => v.$view),
|
|
@@ -229,6 +221,7 @@ export function ElementDetailsCard({
|
|
|
229
221
|
ref={ref}
|
|
230
222
|
className={css.dialog}
|
|
231
223
|
layout
|
|
224
|
+
layoutRoot
|
|
232
225
|
initial={{
|
|
233
226
|
'--backdrop-blur': '0px',
|
|
234
227
|
'--backdrop-opacity': '10%',
|
|
@@ -301,9 +294,7 @@ export function ElementDetailsCard({
|
|
|
301
294
|
{elementIcon}
|
|
302
295
|
<Box>
|
|
303
296
|
<Text
|
|
304
|
-
component={
|
|
305
|
-
layout="position"
|
|
306
|
-
layoutId={`${viewId}:element:title:${fqn}`}
|
|
297
|
+
component={'div'}
|
|
307
298
|
className={css.title}>
|
|
308
299
|
{elementModel.title}
|
|
309
300
|
</Text>
|
|
@@ -359,9 +350,9 @@ export function ElementDetailsCard({
|
|
|
359
350
|
radius="sm"
|
|
360
351
|
onClick={e => {
|
|
361
352
|
e.stopPropagation()
|
|
362
|
-
diagram.openSource({
|
|
363
|
-
|
|
364
|
-
})
|
|
353
|
+
// diagram.openSource({
|
|
354
|
+
// element: elementModel.id,
|
|
355
|
+
// })
|
|
365
356
|
}}>
|
|
366
357
|
<IconFileSymlink stroke={1.8} style={{ width: '62%' }} />
|
|
367
358
|
</ActionIcon>
|
|
@@ -432,11 +423,10 @@ export function ElementDetailsCard({
|
|
|
432
423
|
enableRelationshipBrowser: false,
|
|
433
424
|
enableNavigateTo: false,
|
|
434
425
|
}}>
|
|
435
|
-
{opened &&
|
|
426
|
+
{opened && activeTab === 'Relationships' && (
|
|
436
427
|
<TabPanelRelationships
|
|
437
428
|
element={elementModel}
|
|
438
|
-
node={nodeModel}
|
|
439
|
-
currentView={diagram.currentView()} />
|
|
429
|
+
node={nodeModel ?? null} />
|
|
440
430
|
)}
|
|
441
431
|
</DiagramFeatures>
|
|
442
432
|
</TabsPanel>
|
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { Box, Group, Paper, Stack, Text, ThemeIcon } from '@mantine/core'
|
|
1
|
+
import { type LikeC4Model, nameFromFqn } from '@likec4/core'
|
|
2
|
+
import { Box, Group, Paper, Stack, Text, ThemeIcon, Tooltip as MantineTooltip } from '@mantine/core'
|
|
3
3
|
import { IconArrowRight, IconInfoCircle } from '@tabler/icons-react'
|
|
4
|
-
import {
|
|
4
|
+
import { useSelector } from '@xstate/react'
|
|
5
5
|
import { useState } from 'react'
|
|
6
6
|
import { unique } from 'remeda'
|
|
7
|
-
import { relationshipsBrowserActor } from '../relationships-browser/actor'
|
|
8
7
|
import { RelationshipsBrowser } from '../relationships-browser/RelationshipsBrowser'
|
|
8
|
+
import { useElementDetailsActorRef } from './actorContext'
|
|
9
9
|
import * as css from './TabPanelRelationships.css'
|
|
10
10
|
|
|
11
11
|
type RelationshipsTabPanelProps = {
|
|
12
|
-
|
|
13
|
-
node: LikeC4Model.Node
|
|
12
|
+
node: LikeC4Model.Node | null
|
|
14
13
|
element: LikeC4Model.Element
|
|
15
14
|
}
|
|
16
15
|
|
|
16
|
+
const Tooltip = MantineTooltip.withProps({
|
|
17
|
+
color: 'dark',
|
|
18
|
+
fz: 'xs',
|
|
19
|
+
openDelay: 600,
|
|
20
|
+
closeDelay: 120,
|
|
21
|
+
label: '',
|
|
22
|
+
children: null,
|
|
23
|
+
offset: 8,
|
|
24
|
+
withinPortal: false,
|
|
25
|
+
})
|
|
26
|
+
|
|
17
27
|
export function TabPanelRelationships({
|
|
18
|
-
currentView,
|
|
19
28
|
node,
|
|
20
29
|
element,
|
|
21
30
|
}: RelationshipsTabPanelProps) {
|
|
31
|
+
const delailsActor = useElementDetailsActorRef()
|
|
32
|
+
const relationshipsBrowserActor = useSelector(delailsActor, s => s.children[`${delailsActor.id}-relationships`])
|
|
22
33
|
const [scope, setScope] = useState<'global' | 'view'>('view')
|
|
23
34
|
|
|
24
35
|
const incoming = [...element.incoming()].map(r => r.id)
|
|
25
36
|
const outgoing = [...element.outgoing()].map(r => r.id)
|
|
26
37
|
|
|
27
|
-
const incomingInView = unique([...node.incoming()].flatMap(e => e.$edge.relations))
|
|
28
|
-
const outgoingInView = unique([...node.outgoing()].flatMap(e => e.$edge.relations))
|
|
38
|
+
const incomingInView = node ? unique([...node.incoming()].flatMap(e => e.$edge.relations)) : []
|
|
39
|
+
const outgoingInView = node ? unique([...node.outgoing()].flatMap(e => e.$edge.relations)) : []
|
|
29
40
|
|
|
30
41
|
const notIncludedRelations = [
|
|
31
42
|
...incoming,
|
|
@@ -57,22 +68,24 @@ export function TabPanelRelationships({
|
|
|
57
68
|
</Group>
|
|
58
69
|
</Box>
|
|
59
70
|
{notIncludedRelations > 0 && (
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
<Tooltip label="Current view does not include some relationships">
|
|
72
|
+
<Group
|
|
73
|
+
mt={'xs'}
|
|
74
|
+
gap={6}
|
|
75
|
+
c="orange"
|
|
76
|
+
style={{ cursor: 'pointer' }}>
|
|
77
|
+
<IconInfoCircle style={{ width: 14 }} />
|
|
78
|
+
<Text fz="sm">
|
|
79
|
+
{notIncludedRelations} relationship{notIncludedRelations > 1 ? 's are' : ' is'} hidden
|
|
80
|
+
</Text>
|
|
81
|
+
</Group>
|
|
82
|
+
</Tooltip>
|
|
70
83
|
)}
|
|
71
84
|
</Group>
|
|
72
85
|
)}
|
|
73
86
|
|
|
74
87
|
<Box className={css.xyflow}>
|
|
75
|
-
<
|
|
88
|
+
{relationshipsBrowserActor && <RelationshipsBrowser actorRef={relationshipsBrowserActor} />}
|
|
76
89
|
</Box>
|
|
77
90
|
</Stack>
|
|
78
91
|
)
|
|
@@ -141,15 +154,3 @@ function RelationshipsStat({
|
|
|
141
154
|
</Paper>
|
|
142
155
|
)
|
|
143
156
|
}
|
|
144
|
-
|
|
145
|
-
const EmbeddedRelationshipsBrowser = ({ subjectId, currentView }: { subjectId: Fqn; currentView: DiagramView }) => {
|
|
146
|
-
const actor = useActorRef(relationshipsBrowserActor, {
|
|
147
|
-
input: {
|
|
148
|
-
subject: subjectId,
|
|
149
|
-
scope: currentView,
|
|
150
|
-
closeable: false,
|
|
151
|
-
enableNavigationMenu: false,
|
|
152
|
-
},
|
|
153
|
-
})
|
|
154
|
-
return <RelationshipsBrowser actorRef={actor} />
|
|
155
|
-
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type DiagramView, type Fqn, type NodeId } from '@likec4/core'
|
|
2
|
+
import { type Rect } from '@xyflow/system'
|
|
3
|
+
import {
|
|
4
|
+
type ActorLogicFrom,
|
|
5
|
+
type ActorRefFromLogic,
|
|
6
|
+
type SnapshotFrom,
|
|
7
|
+
assign,
|
|
8
|
+
sendTo,
|
|
9
|
+
setup,
|
|
10
|
+
spawnChild,
|
|
11
|
+
stopChild,
|
|
12
|
+
} from 'xstate'
|
|
13
|
+
import { relationshipsBrowserLogic } from '../relationships-browser/actor'
|
|
14
|
+
|
|
15
|
+
export type Input = {
|
|
16
|
+
subject: Fqn
|
|
17
|
+
currentView: DiagramView
|
|
18
|
+
initiatedFrom?: {
|
|
19
|
+
node?: NodeId
|
|
20
|
+
clientRect?: Rect
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type Context = {
|
|
25
|
+
subject: Fqn
|
|
26
|
+
currentView: DiagramView
|
|
27
|
+
initiatedFrom: {
|
|
28
|
+
node: NodeId | null
|
|
29
|
+
clientRect: Rect | null
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type Events =
|
|
34
|
+
| { type: 'change.subject'; subject: Fqn }
|
|
35
|
+
| { type: 'close' }
|
|
36
|
+
|
|
37
|
+
export const elementDetailsLogic = setup({
|
|
38
|
+
types: {
|
|
39
|
+
context: {} as Context,
|
|
40
|
+
input: {} as Input,
|
|
41
|
+
events: {} as Events,
|
|
42
|
+
children: {} as {
|
|
43
|
+
[key: `${string}-relationships`]: 'relationshipsBrowserLogic'
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
actors: {
|
|
47
|
+
relationshipsBrowserLogic,
|
|
48
|
+
},
|
|
49
|
+
}).createMachine({
|
|
50
|
+
id: 'element-details',
|
|
51
|
+
context: ({ input }) => ({
|
|
52
|
+
...input,
|
|
53
|
+
initiatedFrom: {
|
|
54
|
+
node: input.initiatedFrom?.node ?? null,
|
|
55
|
+
clientRect: input.initiatedFrom?.clientRect ?? null,
|
|
56
|
+
},
|
|
57
|
+
}),
|
|
58
|
+
initial: 'active',
|
|
59
|
+
states: {
|
|
60
|
+
'active': {
|
|
61
|
+
entry: spawnChild('relationshipsBrowserLogic', {
|
|
62
|
+
id: ({ self }) => `${self.id}-relationships`,
|
|
63
|
+
input: ({ context }) => ({
|
|
64
|
+
subject: context.subject,
|
|
65
|
+
scope: context.currentView,
|
|
66
|
+
enableNavigationMenu: false,
|
|
67
|
+
closeable: false,
|
|
68
|
+
}),
|
|
69
|
+
}),
|
|
70
|
+
exit: [
|
|
71
|
+
sendTo(({ self }) => `${self.id}-relationships`, { type: 'close' }),
|
|
72
|
+
stopChild(({ self }) => `${self.id}-relationships`),
|
|
73
|
+
],
|
|
74
|
+
on: {
|
|
75
|
+
'change.subject': {
|
|
76
|
+
actions: assign({
|
|
77
|
+
subject: ({ event }) => event.subject,
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
'close': 'closed',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
closed: {
|
|
84
|
+
id: 'closed',
|
|
85
|
+
type: 'final',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
// exit: assign({
|
|
89
|
+
// initialized: false,
|
|
90
|
+
// xyflow: null,
|
|
91
|
+
// layouted: null,
|
|
92
|
+
// xystore: null,
|
|
93
|
+
// xyedges: [],
|
|
94
|
+
// xynodes: [],
|
|
95
|
+
// }),
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
export interface ElementDetailsLogic extends ActorLogicFrom<typeof elementDetailsLogic> {
|
|
99
|
+
}
|
|
100
|
+
export interface ElementDetailsActorRef extends ActorRefFromLogic<ElementDetailsLogic> {
|
|
101
|
+
}
|
|
102
|
+
export type ElementDetailsSnapshot = SnapshotFrom<ElementDetailsLogic>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react'
|
|
2
|
+
import type { ElementDetailsActorRef } from './actor'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* To improve experience with HMR, we use `createSafeContext` as a boundary for hoooks
|
|
6
|
+
*/
|
|
7
|
+
export const ElementDetailsActorContext = createContext<ElementDetailsActorRef>(null as any)
|
|
8
|
+
ElementDetailsActorContext.displayName = 'ElementDetailsActorContext'
|
|
9
|
+
|
|
10
|
+
export const useElementDetailsActorRef = () => {
|
|
11
|
+
const ctx = useContext(ElementDetailsActorContext)
|
|
12
|
+
if (ctx === null) {
|
|
13
|
+
throw new Error('ElementDetailsActorRef is not provided')
|
|
14
|
+
}
|
|
15
|
+
return ctx
|
|
16
|
+
}
|