@likec4/diagram 1.46.4 → 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 +7332 -5799
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +20 -14
- package/dist/LikeC4Diagram.props.d.ts +2 -6
- package/dist/LikeC4ProjectsOverview.d.ts +7 -0
- package/dist/LikeC4ProjectsOverview.js +32 -0
- 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.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.d.ts +4 -3
- package/dist/base-primitives/compound/CompoundNodeContainer.js +6 -4
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- 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 +3 -3
- package/dist/base-primitives/element/ElementShape.js +109 -20
- 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 +11 -0
- package/dist/components/NavigationPanel.js +50 -0
- 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/DiagramEventHandlers.js +1 -1
- 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 +11 -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/useLikeC4Project.js +10 -2
- package/dist/hooks/useLikeC4Styles.js +0 -3
- 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 +9 -5
- package/dist/index.js +6 -3
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.js +26 -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 +8 -7
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +1 -38
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +35 -19
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.js +9 -5
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +46 -10
- 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/likec4diagram/xyflow-sequence/utils.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanel.js +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +6 -4
- package/dist/navigationpanel/NavigationPanelDropdown.js +7 -7
- 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/LogoButton.d.ts +1 -0
- package/dist/navigationpanel/controls/{BurgerButton.js → LogoButton.js} +5 -5
- 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/controls/index.d.ts +1 -1
- 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.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/IconFileText.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/edgeTypes.js +0 -1
- 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/ProjectsOverview.d.ts +13 -0
- package/dist/projects-overview/ProjectsOverview.js +57 -0
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +17 -0
- package/dist/projects-overview/ProjectsOverviewXY.js +98 -0
- package/dist/projects-overview/_types.d.ts +34 -0
- package/dist/projects-overview/actor.d.ts +121 -0
- package/dist/projects-overview/actor.js +359 -0
- package/dist/projects-overview/context.d.ts +4 -0
- package/dist/projects-overview/context.js +9 -0
- package/dist/projects-overview/custom/edgeTypes.d.ts +3 -0
- package/dist/projects-overview/custom/edgeTypes.js +23 -0
- package/dist/projects-overview/custom/index.d.ts +2 -0
- package/dist/projects-overview/custom/nodeTypes.d.ts +2 -0
- package/dist/projects-overview/custom/nodeTypes.js +45 -0
- package/dist/projects-overview/hooks.d.ts +5 -0
- package/dist/projects-overview/hooks.js +14 -0
- package/dist/projects-overview/index.d.ts +1 -0
- package/dist/projects-overview/layouted-to-xyflow.d.ts +6 -0
- package/dist/projects-overview/layouted-to-xyflow.js +49 -0
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -0
- package/dist/projects-overview/panel/ProjectsOverviewPanel.js +11 -0
- package/dist/projects-overview/persistence.d.ts +5 -0
- package/dist/projects-overview/persistence.js +24 -0
- 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.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 +23 -22
- package/panda.buildinfo.json +93 -84
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/base-primitives/element/ElementNodeContainer.css.d.ts +0 -1
- package/dist/base-primitives/element/ElementNodeContainer.css.js +0 -39
- 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/navigationpanel/controls/BurgerButton.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/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
- /package/dist/{overlays/relationships-browser → projects-overview}/custom/styles.css.d.ts +0 -0
|
@@ -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>>;
|
|
@@ -1,25 +1,57 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import { cx
|
|
2
|
+
import { RichText } from '@likec4/core/types';
|
|
3
|
+
import { cx } from '@likec4/styles/css';
|
|
4
4
|
import { elementNodeData } from '@likec4/styles/recipes';
|
|
5
|
-
import { Text } from '@mantine/core';
|
|
6
5
|
import { forwardRef } from 'react';
|
|
7
|
-
import {
|
|
6
|
+
import { isTruthy } from 'remeda';
|
|
8
7
|
import { IconRenderer } from '../../context/IconRenderer.js';
|
|
8
|
+
import { useLikeC4Styles } from '../../hooks/useLikeC4Styles.js';
|
|
9
9
|
import { Markdown } from '../Markdown.js';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
ref,
|
|
16
|
-
className: cx(
|
|
17
|
-
className,
|
|
18
|
-
elementNodeData(),
|
|
19
|
-
"likec4-element"
|
|
20
|
-
)
|
|
11
|
+
const resolveIconColor = (styles, data) => {
|
|
12
|
+
const iconColor = data.style.iconColor;
|
|
13
|
+
if (!iconColor) {
|
|
14
|
+
return void 0;
|
|
21
15
|
}
|
|
22
|
-
)
|
|
16
|
+
const colors = styles.colors(iconColor).elements;
|
|
17
|
+
return iconColor === data.color ? colors.stroke : colors.fill;
|
|
18
|
+
};
|
|
19
|
+
const Root = forwardRef(({
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
data,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) => {
|
|
25
|
+
const styles = useLikeC4Styles();
|
|
26
|
+
const iconSize = data.style.iconSize ? styles.nodeSizes(data.style).values.iconSize : void 0;
|
|
27
|
+
const resolvedIconColor = resolveIconColor(styles, data);
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
...props,
|
|
32
|
+
ref,
|
|
33
|
+
className: cx(
|
|
34
|
+
className,
|
|
35
|
+
elementNodeData({
|
|
36
|
+
iconPosition: data.style.iconPosition,
|
|
37
|
+
withIconColor: !!resolvedIconColor
|
|
38
|
+
}),
|
|
39
|
+
"likec4-element"
|
|
40
|
+
),
|
|
41
|
+
style: {
|
|
42
|
+
...style,
|
|
43
|
+
...iconSize && {
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
"--likec4-icon-size": `${iconSize}px`
|
|
46
|
+
},
|
|
47
|
+
...resolvedIconColor && {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
"--likec4-icon-color": resolvedIconColor
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
23
55
|
const Icon = ({ data, ...props }) => /* @__PURE__ */ jsx(IconRenderer, { element: data, ...props });
|
|
24
56
|
const Content = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
25
57
|
"div",
|
|
@@ -32,20 +64,16 @@ const Content = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx
|
|
|
32
64
|
ref
|
|
33
65
|
}
|
|
34
66
|
));
|
|
35
|
-
const Title = forwardRef(({ data: { title
|
|
36
|
-
const { size } = ensureSizes(style);
|
|
37
|
-
const isSm = size === "sm" || size === "xs";
|
|
67
|
+
const Title = forwardRef(({ data: { title }, className, ...props }, ref) => {
|
|
38
68
|
return /* @__PURE__ */ jsx(
|
|
39
|
-
|
|
69
|
+
"div",
|
|
40
70
|
{
|
|
41
|
-
component: "div",
|
|
42
71
|
...props,
|
|
43
72
|
className: cx(
|
|
44
73
|
className,
|
|
45
74
|
"likec4-element-title"
|
|
46
75
|
),
|
|
47
76
|
"data-likec4-node-title": "",
|
|
48
|
-
lineClamp: isSm ? 2 : 3,
|
|
49
77
|
ref,
|
|
50
78
|
children: title
|
|
51
79
|
}
|
|
@@ -54,9 +82,8 @@ const Title = forwardRef(({ data: { title, style }, className, ...props }, ref)
|
|
|
54
82
|
const Technology = forwardRef(({ data, children, className, ...props }, ref) => {
|
|
55
83
|
const text = data?.technology ?? children;
|
|
56
84
|
return isTruthy(text) ? /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
85
|
+
"div",
|
|
58
86
|
{
|
|
59
|
-
component: "div",
|
|
60
87
|
...props,
|
|
61
88
|
className: cx(
|
|
62
89
|
className,
|
|
@@ -68,23 +95,18 @@ const Technology = forwardRef(({ data, children, className, ...props }, ref) =>
|
|
|
68
95
|
}
|
|
69
96
|
) : null;
|
|
70
97
|
});
|
|
71
|
-
const Description = forwardRef(({ data: { description
|
|
98
|
+
const Description = forwardRef(({ data: { description }, className, ...props }, ref) => {
|
|
72
99
|
if (!description) {
|
|
73
100
|
return null;
|
|
74
101
|
}
|
|
75
102
|
const desc = RichText.from(description);
|
|
76
|
-
const { size } = ensureSizes(style);
|
|
77
|
-
const isSm = size === "sm" || size === "xs";
|
|
78
103
|
return /* @__PURE__ */ jsx(
|
|
79
104
|
Markdown,
|
|
80
105
|
{
|
|
81
106
|
...props,
|
|
82
107
|
className: cx(
|
|
83
108
|
className,
|
|
84
|
-
"likec4-element-description"
|
|
85
|
-
css({
|
|
86
|
-
lineClamp: isSm ? 3 : 5
|
|
87
|
-
})
|
|
109
|
+
"likec4-element-description"
|
|
88
110
|
),
|
|
89
111
|
"data-likec4-node-description": "",
|
|
90
112
|
value: desc,
|
|
@@ -98,24 +120,15 @@ const Description = forwardRef(({ data: { description, style }, className, ...pr
|
|
|
98
120
|
}
|
|
99
121
|
);
|
|
100
122
|
});
|
|
101
|
-
function ElementData({
|
|
102
|
-
return /* @__PURE__ */ jsxs(
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
/* @__PURE__ */ jsx(Icon, { data }),
|
|
111
|
-
/* @__PURE__ */ jsxs(Content, { children: [
|
|
112
|
-
/* @__PURE__ */ jsx(Title, { data }),
|
|
113
|
-
/* @__PURE__ */ jsx(Technology, { data }),
|
|
114
|
-
/* @__PURE__ */ jsx(Description, { data })
|
|
115
|
-
] })
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
);
|
|
123
|
+
function ElementData({ data }) {
|
|
124
|
+
return /* @__PURE__ */ jsxs(Root, { data, children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Icon, { data }),
|
|
126
|
+
/* @__PURE__ */ jsxs(Content, { children: [
|
|
127
|
+
/* @__PURE__ */ jsx(Title, { data }),
|
|
128
|
+
/* @__PURE__ */ jsx(Technology, { data }),
|
|
129
|
+
/* @__PURE__ */ jsx(Description, { data })
|
|
130
|
+
] })
|
|
131
|
+
] });
|
|
119
132
|
}
|
|
120
133
|
ElementData.Root = Root;
|
|
121
134
|
ElementData.Icon = Icon;
|
|
@@ -5,7 +5,7 @@ import { actionBtn } from '@likec4/styles/recipes';
|
|
|
5
5
|
import { ActionIcon } from '@mantine/core';
|
|
6
6
|
import * as m from 'motion/react-m';
|
|
7
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
8
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.
|
|
8
|
+
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';
|
|
9
9
|
|
|
10
10
|
const container = css({
|
|
11
11
|
position: "absolute",
|
|
@@ -64,6 +64,7 @@ function ElementDetailsButton({
|
|
|
64
64
|
whileTap: { scale: 1.15 },
|
|
65
65
|
onClick,
|
|
66
66
|
onDoubleClick: stopPropagation,
|
|
67
|
+
tabIndex: -1,
|
|
67
68
|
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
68
69
|
}
|
|
69
70
|
) });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Color,
|
|
1
|
+
import { Color, ComputedNodeStyle, ElementShape } from '@likec4/core/types';
|
|
2
2
|
import { MotionNodeLayoutOptions } from 'motion/react';
|
|
3
3
|
import { CSSProperties, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
4
4
|
import { BaseNodePropsWithData } from '../../base/types';
|
|
5
5
|
type RequiredData = {
|
|
6
6
|
color: Color;
|
|
7
7
|
shape: ElementShape;
|
|
8
|
-
style?:
|
|
8
|
+
style?: ComputedNodeStyle;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Top-level primitive to compose leaf nodes renderers.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { ensureSizes } from '@likec4/core/types';
|
|
3
3
|
import { cx } from '@likec4/styles/css';
|
|
4
|
+
import { elementNode } from '@likec4/styles/recipes';
|
|
4
5
|
import * as m from 'motion/react-m';
|
|
5
6
|
import { forwardRef } from 'react';
|
|
6
|
-
import { container } from './ElementNodeContainer.css.js';
|
|
7
7
|
|
|
8
8
|
const ElementNodeContainer = forwardRef(({
|
|
9
9
|
nodeProps: {
|
|
@@ -39,9 +39,8 @@ const ElementNodeContainer = forwardRef(({
|
|
|
39
39
|
{
|
|
40
40
|
ref,
|
|
41
41
|
className: cx(
|
|
42
|
-
|
|
42
|
+
elementNode(),
|
|
43
43
|
"group",
|
|
44
|
-
"likec4-element-node",
|
|
45
44
|
className
|
|
46
45
|
),
|
|
47
46
|
initial: false,
|
|
@@ -63,6 +62,7 @@ const ElementNodeContainer = forwardRef(({
|
|
|
63
62
|
style: {
|
|
64
63
|
...style
|
|
65
64
|
},
|
|
65
|
+
tabIndex: -1,
|
|
66
66
|
...rest,
|
|
67
67
|
children
|
|
68
68
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { nonexhaustive } from '@likec4/core';
|
|
3
3
|
import { elementShapeRecipe } from '@likec4/styles/recipes';
|
|
4
4
|
import { roundDpr } from '../../utils/roundDpr.js';
|
|
5
5
|
|
|
6
|
-
function cylinderSVGPath(diameter, height, tilt = 0.
|
|
6
|
+
function cylinderSVGPath(diameter, height, tilt = 0.07) {
|
|
7
7
|
const radius = Math.round(diameter / 2);
|
|
8
8
|
const rx = radius;
|
|
9
9
|
const ry = roundDpr(tilt * radius);
|
|
@@ -21,6 +21,48 @@ function cylinderSVGPath(diameter, height, tilt = 0.065) {
|
|
|
21
21
|
rx
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
+
function docSVGPath(width, height) {
|
|
25
|
+
const waveHeight = height / 8;
|
|
26
|
+
const baseY = roundDpr(height - waveHeight / 2);
|
|
27
|
+
const amplitude = roundDpr(height / 6);
|
|
28
|
+
const radius = 6;
|
|
29
|
+
const path = `
|
|
30
|
+
M 0 ${baseY}
|
|
31
|
+
V ${radius}
|
|
32
|
+
Q 0 0 ${radius} 0
|
|
33
|
+
H ${width - radius}
|
|
34
|
+
Q ${width} 0 ${width} ${radius}
|
|
35
|
+
V ${baseY}
|
|
36
|
+
C ${roundDpr(width * 0.75)} ${baseY + amplitude}, ${roundDpr(width * 0.5)} ${baseY - amplitude}, 0 ${baseY}
|
|
37
|
+
`.replace(/\s+/g, " ").trim();
|
|
38
|
+
return {
|
|
39
|
+
path
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function bucketSVGPath(width, height) {
|
|
43
|
+
const cx = width / 2;
|
|
44
|
+
const topRx = roundDpr(cx);
|
|
45
|
+
const topRy = roundDpr(Math.min(height / 8, topRx * 0.08));
|
|
46
|
+
const bottomRx = roundDpr(topRx * 0.8);
|
|
47
|
+
const bottomRy = roundDpr(topRy * 1.05);
|
|
48
|
+
const topY = topRy;
|
|
49
|
+
const bottomY = height - bottomRy;
|
|
50
|
+
const leftBottomX = cx - bottomRx;
|
|
51
|
+
const path = `
|
|
52
|
+
M ${width},${topY}
|
|
53
|
+
a ${topRx},${topRy} 0,0,0 ${-width} 0
|
|
54
|
+
L ${leftBottomX},${bottomY}
|
|
55
|
+
a ${bottomRx},${bottomRy} 0,0,0 ${bottomRx * 2} 0
|
|
56
|
+
Z
|
|
57
|
+
`.replace(/\s+/g, " ").trim();
|
|
58
|
+
return {
|
|
59
|
+
path,
|
|
60
|
+
topRx,
|
|
61
|
+
topRy,
|
|
62
|
+
bottomRx,
|
|
63
|
+
bottomRy
|
|
64
|
+
};
|
|
65
|
+
}
|
|
24
66
|
function queueSVGPath(width, height, tilt = 0.185) {
|
|
25
67
|
const diameter = height;
|
|
26
68
|
const radius = Math.round(diameter / 2);
|
|
@@ -64,6 +106,17 @@ function ShapeSvg({ shape, w, h }) {
|
|
|
64
106
|
] })
|
|
65
107
|
] });
|
|
66
108
|
}
|
|
109
|
+
case "document": {
|
|
110
|
+
const { path } = docSVGPath(w, h);
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
"path",
|
|
113
|
+
{
|
|
114
|
+
d: path,
|
|
115
|
+
"data-likec4-fill": "fill",
|
|
116
|
+
strokeWidth: 2
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
67
120
|
case "browser": {
|
|
68
121
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
122
|
/* @__PURE__ */ jsx(
|
|
@@ -123,12 +176,39 @@ function ShapeSvg({ shape, w, h }) {
|
|
|
123
176
|
/* @__PURE__ */ jsx("ellipse", { cx: rx, cy: ry, ry: ry - 0.75, rx, "data-likec4-fill": "mix-stroke", strokeWidth: 2 })
|
|
124
177
|
] });
|
|
125
178
|
}
|
|
179
|
+
case "bucket": {
|
|
180
|
+
const { path, topRx, topRy } = bucketSVGPath(w, h);
|
|
181
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
182
|
+
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
"ellipse",
|
|
185
|
+
{
|
|
186
|
+
cx: w / 2,
|
|
187
|
+
cy: topRy,
|
|
188
|
+
rx: topRx,
|
|
189
|
+
ry: topRy,
|
|
190
|
+
"data-likec4-fill": "mix-stroke",
|
|
191
|
+
strokeWidth: 2
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
] });
|
|
195
|
+
}
|
|
126
196
|
case "storage":
|
|
127
197
|
case "cylinder": {
|
|
128
198
|
const { path, rx, ry } = cylinderSVGPath(w, h);
|
|
129
199
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
130
200
|
/* @__PURE__ */ jsx("path", { d: path, strokeWidth: 2 }),
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
"ellipse",
|
|
203
|
+
{
|
|
204
|
+
cx: rx,
|
|
205
|
+
cy: ry,
|
|
206
|
+
ry,
|
|
207
|
+
rx: rx - 0.75,
|
|
208
|
+
"data-likec4-fill": "mix-stroke",
|
|
209
|
+
strokeWidth: 2
|
|
210
|
+
}
|
|
211
|
+
)
|
|
132
212
|
] });
|
|
133
213
|
}
|
|
134
214
|
default: {
|
|
@@ -139,12 +219,18 @@ function ShapeSvg({ shape, w, h }) {
|
|
|
139
219
|
function ShapeSvgOutline({ shape, w, h }) {
|
|
140
220
|
let svg;
|
|
141
221
|
switch (shape) {
|
|
222
|
+
case "bucket":
|
|
223
|
+
svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: bucketSVGPath(w + 6, h + 6).path }) });
|
|
224
|
+
break;
|
|
142
225
|
case "queue":
|
|
143
|
-
svg = /* @__PURE__ */ jsx("path", { d: queueSVGPath(w, h).path });
|
|
226
|
+
svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: queueSVGPath(w + 6, h + 6).path }) });
|
|
227
|
+
break;
|
|
228
|
+
case "document":
|
|
229
|
+
svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: docSVGPath(w + 6, h + 6).path }) });
|
|
144
230
|
break;
|
|
145
231
|
case "storage":
|
|
146
232
|
case "cylinder": {
|
|
147
|
-
svg = /* @__PURE__ */ jsx("path", { d: cylinderSVGPath(w, h).path });
|
|
233
|
+
svg = /* @__PURE__ */ jsx("g", { transform: "translate(-3 -3)", children: /* @__PURE__ */ jsx("path", { d: cylinderSVGPath(w + 6, h + 6).path }) });
|
|
148
234
|
break;
|
|
149
235
|
}
|
|
150
236
|
default: {
|
|
@@ -163,26 +249,29 @@ function ShapeSvgOutline({ shape, w, h }) {
|
|
|
163
249
|
}
|
|
164
250
|
return /* @__PURE__ */ jsx("g", { className: "likec4-shape-outline", children: svg });
|
|
165
251
|
}
|
|
166
|
-
function ShapeHtml({ multiple, withOutLine }) {
|
|
167
|
-
return /* @__PURE__ */ jsxs(
|
|
168
|
-
"div",
|
|
169
|
-
{
|
|
170
|
-
className: elementShapeRecipe({
|
|
171
|
-
shapetype: "html"
|
|
172
|
-
}),
|
|
173
|
-
children: [
|
|
174
|
-
multiple && /* @__PURE__ */ jsx("div", { className: "likec4-shape-multiple" }),
|
|
175
|
-
withOutLine && /* @__PURE__ */ jsx("div", { className: "likec4-shape-outline" })
|
|
176
|
-
]
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
252
|
function ElementShape({ data, width, height, showSeletionOutline = true }) {
|
|
181
253
|
let w = !!width && width > 10 ? width : data.width;
|
|
182
254
|
let h = !!height && height > 10 ? height : data.height;
|
|
183
255
|
const isMultiple = data.style?.multiple ?? false;
|
|
256
|
+
const borderStyle = data.style?.border ?? "none";
|
|
257
|
+
const withBorder = borderStyle !== "none";
|
|
184
258
|
if (data.shape === "rectangle") {
|
|
185
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ jsxs(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
style: {
|
|
263
|
+
borderStyle
|
|
264
|
+
},
|
|
265
|
+
className: elementShapeRecipe({
|
|
266
|
+
shapetype: "html",
|
|
267
|
+
withBorder
|
|
268
|
+
}),
|
|
269
|
+
children: [
|
|
270
|
+
isMultiple && /* @__PURE__ */ jsx("div", { className: "likec4-shape-multiple" }),
|
|
271
|
+
showSeletionOutline && /* @__PURE__ */ jsx("div", { className: "likec4-shape-outline" })
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
);
|
|
186
275
|
}
|
|
187
276
|
const className = elementShapeRecipe({
|
|
188
277
|
shapetype: "svg"
|
|
@@ -12,6 +12,10 @@ type Data = {
|
|
|
12
12
|
tags: readonly string[] | null | undefined;
|
|
13
13
|
width: number;
|
|
14
14
|
};
|
|
15
|
-
type ElementTagsProps = BaseNodePropsWithData<Data
|
|
16
|
-
|
|
15
|
+
export type ElementTagsProps = BaseNodePropsWithData<Data> & {
|
|
16
|
+
onTagClick?: (tag: `#${string}`) => void;
|
|
17
|
+
onTagMouseEnter?: (tag: `#${string}`) => void;
|
|
18
|
+
onTagMouseLeave?: (tag: `#${string}`) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const ElementTags: MemoExoticComponent<({ id, data: { tags, width, hovered }, onTagClick, onTagMouseEnter, onTagMouseLeave }: ElementTagsProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
17
21
|
export {};
|