@likec4/diagram 1.47.0 → 1.48.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/LICENSE +1 -1
- package/README.md +1 -1
- package/bundle/index.js +5489 -4909
- package/dist/LikeC4Diagram.js +18 -12
- package/dist/LikeC4Diagram.props.d.ts +1 -5
- package/dist/LikeC4ProjectsProvider.js +7 -5
- package/dist/LikeC4Styles.d.ts +2 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +9 -1
- package/dist/LikeC4View.js +10 -8
- package/dist/ReactLikeC4.d.ts +12 -2
- package/dist/ReactLikeC4.js +5 -3
- package/dist/adhoc-editor/ActorProvider.d.ts +7 -0
- package/dist/adhoc-editor/ActorProvider.js +41 -0
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorNavigationPanel.js +32 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +71 -0
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +1 -0
- package/dist/adhoc-editor/SelectElementOverlay.js +124 -0
- package/dist/adhoc-editor/actor.d.ts +131 -0
- package/dist/adhoc-editor/actor.editor.d.ts +54 -0
- package/dist/adhoc-editor/actor.editor.js +96 -0
- package/dist/adhoc-editor/actor.js +20 -0
- package/dist/adhoc-editor/actor.layouter.d.ts +48 -0
- package/dist/adhoc-editor/actor.layouter.js +66 -0
- package/dist/adhoc-editor/actor.types.d.ts +57 -0
- package/dist/adhoc-editor/actor.types.js +22 -0
- package/dist/adhoc-editor/hooks.d.ts +14 -0
- package/dist/adhoc-editor/hooks.js +47 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +6 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +104 -0
- package/dist/base/const.d.ts +1 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +3 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +3 -1
- package/dist/base-primitives/compound/CompoundNodeContainer.js +6 -4
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- package/dist/base-primitives/edge/EdgeLabelContainer.js +5 -1
- package/dist/base-primitives/element/ElementActionButtons.js +31 -58
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -1
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +2 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -0
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.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/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +9 -28
- package/dist/components/RootContainer.js +5 -8
- package/dist/context/DefaultMantineProvider.d.ts +2 -0
- package/dist/context/DefaultMantineProvider.js +66 -0
- package/dist/context/DiagramFeatures.js +12 -11
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/IconRenderer.d.ts +14 -0
- package/dist/context/IconRenderer.js +8 -8
- package/dist/context/TagStylesContext.js +12 -4
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +2 -2
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +2 -2
- package/dist/editor/applyChangesToManualLayout.js +1 -0
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +2 -2
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +22 -64
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -564
- package/dist/editor/useEditorActorLogic.js +8 -12
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCurrentViewModel.d.ts +10 -0
- package/dist/hooks/useDiagram.js +2 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +1 -1
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +2 -2
- package/dist/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.js +25 -12
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -14
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +68 -35
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -5
- package/dist/likec4diagram/custom/nodes/nodes.js +25 -6
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +7 -6
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +2 -2
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -15
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +14 -15
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- package/dist/likec4diagram/state/machine.actions.d.ts +65 -0
- package/dist/likec4diagram/state/machine.actions.js +51 -39
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +22 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +32 -14
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +31 -30
- package/dist/likec4diagram/state/machine.setup.d.ts +21 -5
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +81 -49
- package/dist/likec4diagram/state/machine.state.ready.d.ts +508 -582
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +80 -69
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +13 -14
- package/dist/likec4diagram/state/utils.js +11 -3
- package/dist/likec4diagram/types.d.ts +9 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.js +4 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +5 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +10 -8
- package/dist/navigationpanel/NavigationPanel.js +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +1 -2
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +5 -5
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +4 -5
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- 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/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +3 -3
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +67 -67
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +14 -0
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +4 -4
- package/dist/overlays/element-details/ElementDetailsCard.js +4 -4
- package/dist/overlays/element-details/MetadataValue.js +6 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +7 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -25
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +3 -2
- package/dist/overlays/overlaysActor.js +18 -0
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +2 -2
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.js +1 -1
- package/dist/projects-overview/actor.js +8 -31
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +1 -4
- package/dist/search/Search.js +89 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +3 -4
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +5 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +2 -2
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +1 -1
- package/dist/search/components/utils.js +1 -1
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +12 -9
- package/dist/search/searchActor.d.ts +1 -1
- package/dist/shadowroot/ShadowRoot.js +20 -19
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +1 -34
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.js +9 -5
- package/dist/utils/xyflow.d.ts +19 -3
- package/dist/utils/xyflow.js +52 -9
- package/package.json +21 -20
- package/panda.buildinfo.json +80 -104
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @tabler_icons-react@3.36.0_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import '@likec4/core';
|
|
3
|
+
import { cx } from '@likec4/styles/css';
|
|
4
|
+
import { Box, styled } from '@likec4/styles/jsx';
|
|
5
|
+
import { vstack, hstack, txt } from '@likec4/styles/patterns';
|
|
6
|
+
import { ActionIcon } from '@mantine/core';
|
|
7
|
+
import { AnimatePresence, LayoutGroup, m } from 'motion/react';
|
|
8
|
+
import IconCirclePlus from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js';
|
|
9
|
+
import IconTrash from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js';
|
|
10
|
+
|
|
11
|
+
function ViewRulesPanel({
|
|
12
|
+
rules,
|
|
13
|
+
onToggle,
|
|
14
|
+
onDelete
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(Box, { p: "1", children: [
|
|
17
|
+
/* @__PURE__ */ jsx(styled.h4, { mt: "0", fontSize: "md", fontWeight: "normal", children: "View Rules" }),
|
|
18
|
+
/* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", propagate: true, children: /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsx(m.div, { layout: true, layoutRoot: true, className: vstack({ gap: "1" }), children: rules.map((rule) => /* @__PURE__ */ jsx(
|
|
19
|
+
m.div,
|
|
20
|
+
{
|
|
21
|
+
layout: "position",
|
|
22
|
+
onClick: () => {
|
|
23
|
+
return onToggle(rule);
|
|
24
|
+
},
|
|
25
|
+
initial: {
|
|
26
|
+
opacity: 0,
|
|
27
|
+
y: -50
|
|
28
|
+
},
|
|
29
|
+
animate: {
|
|
30
|
+
opacity: rule.enabled ? 1 : 0.5,
|
|
31
|
+
scale: rule.enabled ? 1 : 0.98,
|
|
32
|
+
y: 0
|
|
33
|
+
},
|
|
34
|
+
exit: {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
scale: 0.95,
|
|
37
|
+
y: -50
|
|
38
|
+
},
|
|
39
|
+
className: cx(
|
|
40
|
+
hstack({
|
|
41
|
+
p: "1",
|
|
42
|
+
px: "2",
|
|
43
|
+
flexWrap: "nowrap",
|
|
44
|
+
rounded: "sm",
|
|
45
|
+
colorPalette: "teal",
|
|
46
|
+
// colorPalette: rule.type === 'include' ? 'green' : 'red',
|
|
47
|
+
gap: "2",
|
|
48
|
+
border: "default"
|
|
49
|
+
// opacity: rule.enabled ? 1 : 0.5,
|
|
50
|
+
})
|
|
51
|
+
// rule.type !== 'include' && css({ colorPalette: 'red' }),
|
|
52
|
+
),
|
|
53
|
+
children: /* @__PURE__ */ jsx(
|
|
54
|
+
ViewRule,
|
|
55
|
+
{
|
|
56
|
+
rule,
|
|
57
|
+
onToggle: () => onToggle(rule),
|
|
58
|
+
onDelete: () => onDelete(rule)
|
|
59
|
+
},
|
|
60
|
+
rule.id
|
|
61
|
+
)
|
|
62
|
+
},
|
|
63
|
+
rule.id
|
|
64
|
+
)) }) }) })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
function ViewRule({ rule, onToggle, onDelete }) {
|
|
68
|
+
rule.type === "include";
|
|
69
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(PredicatIcon, { children: /* @__PURE__ */ jsx(IconCirclePlus, { size: 14 }) }),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
m.div,
|
|
73
|
+
{
|
|
74
|
+
layout: true,
|
|
75
|
+
animate: {
|
|
76
|
+
originX: 0,
|
|
77
|
+
scale: rule.enabled ? 1 : 0.9
|
|
78
|
+
},
|
|
79
|
+
className: txt({ flex: 1, truncate: true }),
|
|
80
|
+
children: JSON.stringify(rule.expr)
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
ActionIcon,
|
|
85
|
+
{
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
onDelete();
|
|
89
|
+
},
|
|
90
|
+
variant: "subtle",
|
|
91
|
+
color: "red",
|
|
92
|
+
children: /* @__PURE__ */ jsx(IconTrash, {})
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
const PredicatIcon = styled("div", {
|
|
98
|
+
base: {
|
|
99
|
+
display: "contents",
|
|
100
|
+
color: "colorPalette.9"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export { ViewRulesPanel };
|
package/dist/base/const.d.ts
CHANGED
package/dist/base/const.js
CHANGED
package/dist/base/updateEdges.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deepEqual } from 'fast-equals';
|
|
2
|
-
import { isDefined, pickBy, isShallowEqual } from 'remeda';
|
|
2
|
+
import { isDefined, hasSubObject, pickBy, isShallowEqual } from 'remeda';
|
|
3
3
|
|
|
4
4
|
const EMPTY_OBJ = {};
|
|
5
5
|
function _update(current, updated) {
|
|
@@ -13,8 +13,31 @@ function _update(current, updated) {
|
|
|
13
13
|
if (!existing) {
|
|
14
14
|
return update;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if (existing === update) {
|
|
17
|
+
return existing;
|
|
18
|
+
}
|
|
19
|
+
const isSameData = hasSubObject(existing.data, update.data);
|
|
20
|
+
let data = isSameData ? existing.data : update.data;
|
|
21
|
+
if (!isSameData) {
|
|
22
|
+
if (isDefined(existing.data.hovered) && !isDefined(update.data.hovered)) {
|
|
23
|
+
data = {
|
|
24
|
+
...data,
|
|
25
|
+
hovered: existing.data.hovered
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (isDefined(existing.data.dimmed) && !isDefined(update.data.dimmed)) {
|
|
29
|
+
data = {
|
|
30
|
+
...data,
|
|
31
|
+
dimmed: existing.data.dimmed
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (isDefined(existing.data.active) && !isDefined(update.data.active)) {
|
|
35
|
+
data = {
|
|
36
|
+
...data,
|
|
37
|
+
active: existing.data.active
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
18
41
|
if (isSameData && deepEqual(existing.hidden, update.hidden ?? existing.hidden) && deepEqual(existing.selected, update.selected ?? existing.selected) && deepEqual(existing.selectable, update.selectable ?? existing.selectable) && deepEqual(existing.focusable, update.focusable ?? existing.focusable) && deepEqual(existing.animated, update.animated ?? existing.animated) && deepEqual(existing.className, update.className) && deepEqual(existing.zIndex, update.zIndex ?? existing.zIndex) && deepEqual(existing.label, update.label) && deepEqual(existing.sourceHandle, update.sourceHandle) && deepEqual(existing.targetHandle, update.targetHandle) && deepEqual(existing.style ?? EMPTY_OBJ, update.style ?? EMPTY_OBJ)) {
|
|
19
42
|
return existing;
|
|
20
43
|
}
|
package/dist/base/updateNodes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getNodeDimensions } from '@xyflow/system';
|
|
2
|
-
import { deepEqual } from 'fast-equals';
|
|
3
|
-
import { isDefined, hasSubObject, pickBy
|
|
2
|
+
import { deepEqual, shallowEqual } from 'fast-equals';
|
|
3
|
+
import { isDefined, hasSubObject, pickBy } from 'remeda';
|
|
4
4
|
|
|
5
5
|
const EMPTY_OBJ = {};
|
|
6
6
|
function _update(current, updated) {
|
|
@@ -12,6 +12,9 @@ function _update(current, updated) {
|
|
|
12
12
|
if (!existing) {
|
|
13
13
|
return update;
|
|
14
14
|
}
|
|
15
|
+
if (existing === update) {
|
|
16
|
+
return existing;
|
|
17
|
+
}
|
|
15
18
|
const isSameData = hasSubObject(existing.data, update.data);
|
|
16
19
|
let data = isSameData ? existing.data : update.data;
|
|
17
20
|
if (!isSameData) {
|
|
@@ -36,8 +39,8 @@ function _update(current, updated) {
|
|
|
36
39
|
}
|
|
37
40
|
const handles = haveHandles && isSameHandles ? existing.handles : update.handles;
|
|
38
41
|
return {
|
|
39
|
-
// Retain existing properties that are defined, except parentId
|
|
40
|
-
...pickBy(existing, (v, k) => isDefined(v) && k !== "parentId"),
|
|
42
|
+
// Retain existing properties that are defined, except parentId and handles
|
|
43
|
+
...pickBy(existing, (v, k) => isDefined(v) && k !== "parentId" && k !== "handles"),
|
|
41
44
|
// Retain measured dimensions from existing if present
|
|
42
45
|
..."measured" in existing && {
|
|
43
46
|
measured: {
|
|
@@ -54,7 +57,7 @@ function _update(current, updated) {
|
|
|
54
57
|
data
|
|
55
58
|
};
|
|
56
59
|
});
|
|
57
|
-
return
|
|
60
|
+
return shallowEqual(current, updated) ? current : updated;
|
|
58
61
|
}
|
|
59
62
|
function updateNodes(current, update) {
|
|
60
63
|
if (isDefined(update)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RichTextOrEmpty as RichTextType } from '@likec4/core/types';
|
|
2
|
-
import { JsxStyleProps } from '
|
|
2
|
+
import { JsxStyleProps } from '@likec4/styles/types';
|
|
3
3
|
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefAttributes } from 'react';
|
|
4
4
|
export type MarkdownProps = Omit<ComponentPropsWithoutRef<'div'>, 'dangerouslySetInnerHTML' | 'children' | 'color'> & {
|
|
5
5
|
value: RichTextType;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AutoLayoutDirection } from '@likec4/core/types';
|
|
2
2
|
/**
|
|
3
3
|
* XYFlow requires handles to be defined on nodes.
|
|
4
4
|
*/
|
|
5
|
-
export declare
|
|
5
|
+
export declare function DefaultHandles({ direction }: {
|
|
6
|
+
direction?: AutoLayoutDirection | undefined;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { nonexhaustive } from '@likec4/core';
|
|
2
3
|
import { Position, Handle } from '@xyflow/react';
|
|
3
|
-
import { memo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className: "likec4-node-handle-center"
|
|
5
|
+
function DefaultHandles({ direction = "TB" }) {
|
|
6
|
+
let sourcePosition, targetPosition;
|
|
7
|
+
switch (direction) {
|
|
8
|
+
case "TB": {
|
|
9
|
+
sourcePosition = Position.Bottom;
|
|
10
|
+
targetPosition = Position.Top;
|
|
11
|
+
break;
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
type: "target",
|
|
19
|
-
position,
|
|
20
|
-
className: "likec4-node-handle-center"
|
|
13
|
+
case "BT": {
|
|
14
|
+
sourcePosition = Position.Top;
|
|
15
|
+
targetPosition = Position.Bottom;
|
|
16
|
+
break;
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
case "LR": {
|
|
19
|
+
sourcePosition = Position.Right;
|
|
20
|
+
targetPosition = Position.Left;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
case "RL": {
|
|
24
|
+
sourcePosition = Position.Left;
|
|
25
|
+
targetPosition = Position.Right;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
default: {
|
|
29
|
+
nonexhaustive(direction);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
Handle,
|
|
35
|
+
{
|
|
36
|
+
type: "source",
|
|
37
|
+
position: sourcePosition,
|
|
38
|
+
className: "likec4-node-handle-center"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
Handle,
|
|
43
|
+
{
|
|
44
|
+
type: "target",
|
|
45
|
+
position: targetPosition,
|
|
46
|
+
className: "likec4-node-handle-center"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
24
51
|
|
|
25
52
|
export { DefaultHandles };
|
|
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
|
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
8
8
|
import { compoundActionBtn } from './actionbtns.css.js';
|
|
9
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.
|
|
9
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
10
10
|
|
|
11
11
|
function CompoundActionButton({
|
|
12
12
|
data: {
|
|
@@ -34,6 +34,7 @@ function CompoundActionButton({
|
|
|
34
34
|
className: "likec4-compound-navigation compound-action",
|
|
35
35
|
whileTap: { scale: 1 },
|
|
36
36
|
onClick: stopPropagation,
|
|
37
|
+
tabIndex: -1,
|
|
37
38
|
children: /* @__PURE__ */ jsx(
|
|
38
39
|
ActionIcon,
|
|
39
40
|
{
|
|
@@ -44,6 +45,7 @@ function CompoundActionButton({
|
|
|
44
45
|
}),
|
|
45
46
|
actionBtn({ variant: "transparent" })
|
|
46
47
|
),
|
|
48
|
+
tabIndex: -1,
|
|
47
49
|
onClick,
|
|
48
50
|
onDoubleClick: stopPropagation,
|
|
49
51
|
children: icon ?? /* @__PURE__ */ jsx(IconZoomScan, { stroke: 2 })
|
|
@@ -6,7 +6,7 @@ import { useDebouncedValue } from '@mantine/hooks';
|
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
8
8
|
import { compoundActionBtn } from './actionbtns.css.js';
|
|
9
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.
|
|
9
|
+
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
|
|
10
10
|
|
|
11
11
|
function CompoundDetailsButton({
|
|
12
12
|
data: {
|
|
@@ -30,6 +30,7 @@ function CompoundDetailsButton({
|
|
|
30
30
|
},
|
|
31
31
|
whileTap: { scale: 1 },
|
|
32
32
|
className: "likec4-compound-details details-button",
|
|
33
|
+
tabIndex: -1,
|
|
33
34
|
children: /* @__PURE__ */ jsx(
|
|
34
35
|
ActionIcon,
|
|
35
36
|
{
|
|
@@ -40,6 +41,7 @@ function CompoundDetailsButton({
|
|
|
40
41
|
}),
|
|
41
42
|
actionBtn({ variant: "transparent" })
|
|
42
43
|
),
|
|
44
|
+
tabIndex: -1,
|
|
43
45
|
onClick,
|
|
44
46
|
onDoubleClick: stopPropagation,
|
|
45
47
|
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
@@ -3,6 +3,7 @@ import { cx } from '@likec4/styles/css';
|
|
|
3
3
|
import { compoundNode } from '@likec4/styles/recipes';
|
|
4
4
|
import * as m from 'motion/react-m';
|
|
5
5
|
import { clamp } from 'remeda';
|
|
6
|
+
import { MAX_COMPOUND_DEPTH } from '../../base/const.js';
|
|
6
7
|
|
|
7
8
|
function CompoundNodeContainer({
|
|
8
9
|
nodeProps: {
|
|
@@ -21,20 +22,20 @@ function CompoundNodeContainer({
|
|
|
21
22
|
min: 0,
|
|
22
23
|
max: 100
|
|
23
24
|
});
|
|
24
|
-
const isTransparent = opacity <
|
|
25
|
-
const MIN_OPACITY =
|
|
25
|
+
const isTransparent = opacity < 98;
|
|
26
|
+
const MIN_OPACITY = 50;
|
|
26
27
|
const borderOpacity = MIN_OPACITY + clamp((100 - MIN_OPACITY) * (opacity / 100), {
|
|
27
28
|
min: 0,
|
|
28
29
|
max: 100 - MIN_OPACITY
|
|
29
30
|
});
|
|
30
31
|
const compoundClass = compoundNode({
|
|
31
32
|
isTransparent,
|
|
32
|
-
inverseColor: opacity <
|
|
33
|
+
inverseColor: opacity < 70,
|
|
33
34
|
borderStyle: data.style.border ?? (isTransparent ? "dashed" : "none")
|
|
34
35
|
});
|
|
35
36
|
const depth = clamp(data.depth ?? 1, {
|
|
36
37
|
min: 1,
|
|
37
|
-
max:
|
|
38
|
+
max: MAX_COMPOUND_DEPTH
|
|
38
39
|
});
|
|
39
40
|
return /* @__PURE__ */ jsx(
|
|
40
41
|
m.div,
|
|
@@ -50,6 +51,7 @@ function CompoundNodeContainer({
|
|
|
50
51
|
...isDimmed !== false && {
|
|
51
52
|
"data-likec4-dimmed": isDimmed
|
|
52
53
|
},
|
|
54
|
+
tabIndex: -1,
|
|
53
55
|
style: {
|
|
54
56
|
...style,
|
|
55
57
|
// @ts-expect-error
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Text } from '@mantine/core';
|
|
3
2
|
import { IconRenderer } from '../../context/IconRenderer.js';
|
|
4
3
|
|
|
5
4
|
function CompoundTitle({ data }) {
|
|
@@ -9,7 +8,7 @@ function CompoundTitle({ data }) {
|
|
|
9
8
|
});
|
|
10
9
|
return /* @__PURE__ */ jsxs("div", { className: "likec4-compound-title-container", children: [
|
|
11
10
|
elementIcon,
|
|
12
|
-
/* @__PURE__ */ jsx(
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "likec4-compound-title", children: data.title })
|
|
13
12
|
] });
|
|
14
13
|
}
|
|
15
14
|
|
|
@@ -3,7 +3,7 @@ import { cx } from '@likec4/styles/css';
|
|
|
3
3
|
import { edgeActionBtn } from '@likec4/styles/recipes';
|
|
4
4
|
import { ActionIcon } from '@mantine/core';
|
|
5
5
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
6
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.
|
|
6
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
7
7
|
|
|
8
8
|
function EdgeActionButton({ icon, onClick }) {
|
|
9
9
|
return /* @__PURE__ */ jsx(
|
|
@@ -14,10 +14,11 @@ function EdgeContainer({
|
|
|
14
14
|
dimmed: isDimmed = false,
|
|
15
15
|
...data
|
|
16
16
|
},
|
|
17
|
-
animated,
|
|
17
|
+
animated = false,
|
|
18
18
|
children,
|
|
19
19
|
style
|
|
20
20
|
}) {
|
|
21
|
+
animated = animated || isActive;
|
|
21
22
|
const props = {
|
|
22
23
|
className: cx(
|
|
23
24
|
className,
|
|
@@ -28,8 +29,10 @@ function EdgeContainer({
|
|
|
28
29
|
"data-likec4-color": color,
|
|
29
30
|
"data-edge-dir": data.dir ?? "forward",
|
|
30
31
|
"data-edge-active": isActive,
|
|
31
|
-
"data-edge-animated": animated || isActive,
|
|
32
32
|
"data-likec4-hovered": isHovered,
|
|
33
|
+
...animated && {
|
|
34
|
+
"data-likec4-animated": animated
|
|
35
|
+
},
|
|
33
36
|
...selected && {
|
|
34
37
|
"data-likec4-selected": selected
|
|
35
38
|
},
|
|
@@ -7,7 +7,7 @@ import { ZIndexes } from '../../base/const.js';
|
|
|
7
7
|
import { useXYStore } from '../../hooks/useXYFlow.js';
|
|
8
8
|
|
|
9
9
|
const toCssVarValue = (value) => {
|
|
10
|
-
if (value === void 0) return
|
|
10
|
+
if (value === void 0) return "";
|
|
11
11
|
return isNumber(value) ? `${Math.round(value)}px` : value;
|
|
12
12
|
};
|
|
13
13
|
function EdgeLabelContainer({
|
|
@@ -42,6 +42,7 @@ function EdgeLabelContainer({
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
const translate = labelXY?.translate ?? "";
|
|
45
|
+
animated = animated || isActive;
|
|
45
46
|
return /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
@@ -55,6 +56,9 @@ function EdgeLabelContainer({
|
|
|
55
56
|
"data-likec4-color": color,
|
|
56
57
|
"data-edge-active": isActive,
|
|
57
58
|
"data-edge-animated": animated || isActive,
|
|
59
|
+
...animated && {
|
|
60
|
+
"data-likec4-animated": animated
|
|
61
|
+
},
|
|
58
62
|
...selected !== false && {
|
|
59
63
|
"data-likec4-selected": selected
|
|
60
64
|
},
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
|
-
import {
|
|
4
|
-
import { hstack } from '@likec4/styles/patterns';
|
|
5
|
-
import { actionBtn } from '@likec4/styles/recipes';
|
|
3
|
+
import { actionButtons, actionBtn } from '@likec4/styles/recipes';
|
|
6
4
|
import { ActionIcon } from '@mantine/core';
|
|
7
5
|
import { useId } from '@mantine/hooks';
|
|
8
6
|
import * as m from 'motion/react-m';
|
|
9
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
10
|
-
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.
|
|
8
|
+
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
|
|
11
9
|
|
|
12
|
-
const container = hstack({
|
|
13
|
-
position: "absolute",
|
|
14
|
-
zIndex: 1,
|
|
15
|
-
justifyContent: "center",
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
_smallZoom: {
|
|
18
|
-
display: "none"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
const actionButtons = hstack({
|
|
22
|
-
gap: "1.5",
|
|
23
|
-
justifyContent: "center",
|
|
24
|
-
alignItems: "center"
|
|
25
|
-
});
|
|
26
10
|
function ElementActionButtons({
|
|
27
11
|
selected = false,
|
|
28
12
|
data: {
|
|
@@ -34,53 +18,42 @@ function ElementActionButtons({
|
|
|
34
18
|
if (!buttons.length) {
|
|
35
19
|
return null;
|
|
36
20
|
}
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { className: actionButtons(), children: /* @__PURE__ */ jsx(
|
|
22
|
+
m.div,
|
|
39
23
|
{
|
|
40
|
-
|
|
24
|
+
layoutRoot: true,
|
|
25
|
+
initial: false,
|
|
41
26
|
style: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
originY: 0
|
|
28
|
+
},
|
|
29
|
+
animate: {
|
|
30
|
+
opacity: isHovered || selected ? 1 : 0.75,
|
|
31
|
+
scale: isHovered ? 1.1 : selected ? 0.9 : 0.8,
|
|
32
|
+
y: isHovered || selected ? 6 : 0
|
|
47
33
|
},
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
layoutDependency: `${isHovered}-${selected}`,
|
|
35
|
+
"data-likec4-hovered": isHovered,
|
|
36
|
+
className: cx("nodrag nopan"),
|
|
37
|
+
onClick: stopPropagation,
|
|
38
|
+
children: buttons.map((button, index) => /* @__PURE__ */ jsx(
|
|
39
|
+
ActionIcon,
|
|
50
40
|
{
|
|
51
|
-
|
|
41
|
+
component: m.button,
|
|
42
|
+
className: actionBtn({}),
|
|
52
43
|
initial: false,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
animate: {
|
|
57
|
-
opacity: isHovered || selected ? 1 : 0.75,
|
|
58
|
-
scale: isHovered ? 1.1 : selected ? 0.9 : 0.8,
|
|
59
|
-
y: isHovered || selected ? 6 : 0
|
|
44
|
+
whileTap: { scale: 1 },
|
|
45
|
+
whileHover: {
|
|
46
|
+
scale: 1.3
|
|
60
47
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
className: actionBtn({}),
|
|
69
|
-
initial: false,
|
|
70
|
-
whileTap: { scale: 1 },
|
|
71
|
-
whileHover: {
|
|
72
|
-
scale: 1.3
|
|
73
|
-
},
|
|
74
|
-
onClick: button.onClick,
|
|
75
|
-
onDoubleClick: stopPropagation,
|
|
76
|
-
children: button.icon || /* @__PURE__ */ jsx(IconBolt, {})
|
|
77
|
-
},
|
|
78
|
-
`${id}-${button.key ?? index}`
|
|
79
|
-
))
|
|
80
|
-
}
|
|
81
|
-
)
|
|
48
|
+
tabIndex: -1,
|
|
49
|
+
onClick: button.onClick,
|
|
50
|
+
onDoubleClick: stopPropagation,
|
|
51
|
+
children: button.icon || /* @__PURE__ */ jsx(IconBolt, {})
|
|
52
|
+
},
|
|
53
|
+
`${id}-${button.key ?? index}`
|
|
54
|
+
))
|
|
82
55
|
}
|
|
83
|
-
);
|
|
56
|
+
) });
|
|
84
57
|
}
|
|
85
58
|
|
|
86
59
|
export { ElementActionButtons };
|
|
@@ -10,9 +10,8 @@ type RequiredData = {
|
|
|
10
10
|
description?: MarkdownOrString | null | undefined;
|
|
11
11
|
icon?: string | null;
|
|
12
12
|
};
|
|
13
|
-
type ElementDataProps = {
|
|
13
|
+
export type ElementDataProps = {
|
|
14
14
|
data: RequiredData;
|
|
15
|
-
iconSize?: number;
|
|
16
15
|
};
|
|
17
16
|
type IconProps = {
|
|
18
17
|
data: {
|
|
@@ -27,6 +26,7 @@ type SlotProps = {
|
|
|
27
26
|
data: RequiredData;
|
|
28
27
|
className?: string;
|
|
29
28
|
style?: CSSProperties;
|
|
29
|
+
[key: `data-${string}`]: string;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* Renders an element title, technology, description, and icon.
|
|
@@ -37,19 +37,19 @@ type SlotProps = {
|
|
|
37
37
|
* ```
|
|
38
38
|
* or
|
|
39
39
|
* ```tsx
|
|
40
|
-
* <ElementData.Root>
|
|
40
|
+
* <ElementData.Root {...nodeProps} >
|
|
41
41
|
* <ElementData.Icon {...nodeProps} />
|
|
42
|
-
* <ElementData.
|
|
42
|
+
* <ElementData.Content>
|
|
43
43
|
* <ElementData.Title {...nodeProps} />
|
|
44
44
|
* <ElementData.Technology {...nodeProps} />
|
|
45
45
|
* <ElementData.Description {...nodeProps} />
|
|
46
|
-
* </ElementData.
|
|
46
|
+
* </ElementData.Content>
|
|
47
47
|
* </ElementData.Root>
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
export declare function ElementData({
|
|
50
|
+
export declare function ElementData({ data }: ElementDataProps): import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
export declare namespace ElementData {
|
|
52
|
-
var Root: import("react").ForwardRefExoticComponent<
|
|
52
|
+
var Root: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & ElementDataProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
53
|
var Icon: ({ data, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
var Content: import("react").ForwardRefExoticComponent<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
55
|
var Title: import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<HTMLDivElement>>;
|