@likec4/diagram 1.43.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +14727 -13166
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +14 -9
- package/dist/LikeC4Diagram.props.d.ts +25 -15
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4Styles.js +0 -3
- package/dist/LikeC4View.d.ts +8 -3
- package/dist/LikeC4View.js +29 -14
- package/dist/ReactLikeC4.d.ts +2 -2
- package/dist/ReactLikeC4.js +2 -2
- package/dist/StaticLikeC4Diagram.js +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -0
- package/dist/_virtual/assign-dea9f7c8.cjs.js +3 -0
- package/dist/_virtual/log-ec8d4df4.cjs.js +3 -0
- package/dist/_virtual/raise-da5b247f.cjs.js +3 -0
- package/dist/_virtual/xstate-actions.cjs.js +5 -0
- package/dist/_virtual/xstate-actions.cjs2.js +3 -0
- package/dist/_virtual/xstate-dev.cjs.js +3 -0
- package/dist/_virtual/xstate-guards.cjs.js +5 -0
- package/dist/_virtual/xstate-guards.cjs2.js +3 -0
- package/dist/base/Background.d.ts +2 -1
- package/dist/base/Background.js +11 -2
- package/dist/base/Base.d.ts +28 -0
- package/dist/base/BaseXYFlow.d.ts +5 -5
- package/dist/base/BaseXYFlow.js +38 -44
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +25 -14
- package/dist/base/updateNodes.d.ts +14 -0
- package/dist/base/updateNodes.js +51 -17
- package/dist/base-primitives/Markdown.d.ts +30 -4
- package/dist/base-primitives/Markdown.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +3 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +8 -1
- package/dist/base-primitives/edge/EdgeLabel.d.ts +3 -2
- package/dist/base-primitives/edge/EdgeLabel.js +2 -0
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +4 -0
- package/dist/base-primitives/edge/EdgePath.d.ts +4 -0
- package/dist/base-primitives/edge/EdgePath.js +29 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +6 -4
- package/dist/base-primitives/element/ElementActionButtons.js +3 -3
- package/dist/base-primitives/element/ElementData.d.ts +3 -3
- package/dist/base-primitives/element/ElementData.js +13 -7
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +3 -2
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- package/dist/base-primitives/element/ElementShape.js +5 -5
- package/dist/base-primitives/element/ElementTags.d.ts +6 -4
- package/dist/base-primitives/element/ElementTags.js +2 -1
- package/dist/base-primitives/memoEdge.js +4 -2
- package/dist/base-primitives/memoNode.d.ts +1 -1
- package/dist/base-primitives/memoNode.js +3 -3
- package/dist/components/ErrorFallback.js +52 -35
- package/dist/components/Link.js +2 -2
- package/dist/context/DiagramEventHandlers.js +2 -1
- package/dist/context/DiagramFeatures.d.ts +25 -6
- package/dist/context/DiagramFeatures.js +28 -56
- package/dist/context/IconRenderer.js +6 -6
- package/dist/context/LikeC4ModelContext.js +3 -10
- package/dist/context/TagStylesContext.js +3 -19
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +3 -3
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +5 -5
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/safeContext.d.ts +6 -3
- package/dist/hooks/safeContext.js +10 -3
- package/dist/hooks/useCallbackRef.d.ts +1 -0
- package/dist/hooks/useCallbackRef.js +13 -0
- package/dist/hooks/useCurrentView.d.ts +11 -0
- package/dist/hooks/{useCurrentViewId.js → useCurrentView.js} +7 -3
- package/dist/hooks/useCurrentViewModel.js +4 -1
- package/dist/hooks/useDiagram.d.ts +7 -113
- package/dist/hooks/useDiagram.js +7 -127
- package/dist/hooks/useDiagramCompareLayout.d.ts +35 -0
- package/dist/hooks/useDiagramCompareLayout.js +65 -0
- package/dist/hooks/useLikeC4Project.d.ts +6 -1
- package/dist/hooks/useLikeC4Project.js +14 -2
- package/dist/hooks/useMediaPrint.d.ts +6 -0
- package/dist/hooks/useUpdateEffect.js +2 -4
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +4 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/likec4diagram/DiagramUI.js +14 -7
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -2
- package/dist/likec4diagram/DiagramXYFlow.js +60 -52
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/edges/EdgeDrifts.js +38 -0
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +256 -217
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +9 -2
- package/dist/likec4diagram/custom/edges/edges.css.js +3 -4
- package/dist/likec4diagram/custom/edges/useControlPoints.d.ts +8 -0
- package/dist/likec4diagram/custom/edges/useControlPoints.js +58 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +7 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +60 -0
- package/dist/likec4diagram/custom/edges/utils.d.ts +0 -12
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +4 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.js +15 -10
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +50 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +7 -2
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +74 -29
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +2 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +4 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +1 -11
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +7 -51
- package/dist/likec4diagram/custom/nodes/toolbar/types.d.ts +5 -0
- package/dist/likec4diagram/custom/nodes/toolbar/types.js +7 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.d.ts +8 -0
- package/dist/likec4diagram/custom/nodes/toolbar/useHandlers.js +44 -0
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -10
- package/dist/likec4diagram/relationship-popover/actor.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +95 -70
- package/dist/likec4diagram/state/assign.d.ts +13 -7
- package/dist/likec4diagram/state/assign.js +43 -282
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +79 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +109 -0
- package/dist/likec4diagram/state/diagram-api.js +126 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +1783 -0
- package/dist/likec4diagram/state/machine.actions.js +644 -0
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +579 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +129 -0
- package/dist/likec4diagram/state/machine.d.ts +22 -0
- package/dist/likec4diagram/state/machine.js +127 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +327 -0
- package/dist/likec4diagram/state/machine.setup.js +93 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +208 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +14 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +178 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3131 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +386 -0
- package/dist/likec4diagram/state/machine.state.ready.focused.js +85 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +474 -0
- package/dist/likec4diagram/state/machine.state.ready.idle.js +96 -0
- package/dist/likec4diagram/state/machine.state.ready.js +262 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +128 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +40 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +511 -0
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +177 -0
- package/dist/likec4diagram/state/mediaPrintActor.d.ts +12 -0
- package/dist/likec4diagram/state/mediaPrintActor.js +18 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +31 -108
- package/dist/likec4diagram/state/syncManualLayoutActor.js +278 -142
- package/dist/likec4diagram/state/types.d.ts +7 -12
- package/dist/likec4diagram/state/utils.d.ts +19 -4
- package/dist/likec4diagram/state/utils.js +47 -4
- package/dist/likec4diagram/types.d.ts +8 -8
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +66 -0
- package/dist/likec4diagram/ui/index.d.ts +1 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +5 -4
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +237 -61
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +14 -17
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +11 -8
- package/dist/navigationpanel/NavigationPanel.js +16 -8
- package/dist/navigationpanel/NavigationPanelControls.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelControls.js +23 -17
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +2 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +62 -42
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +4 -2
- package/dist/navigationpanel/actor.d.ts +9 -205
- package/dist/navigationpanel/actor.js +6 -5
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +3 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +59 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +2 -0
- package/dist/navigationpanel/comparepanel/ComparePanel.js +42 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +60 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +5 -0
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.js +38 -0
- package/dist/navigationpanel/comparepanel/index.d.ts +1 -0
- package/dist/navigationpanel/controls/{ViewDetailsCard.d.ts → DetailsControls.d.ts} +1 -1
- package/dist/navigationpanel/controls/{ViewDetailsCard.js → DetailsControls.js} +18 -14
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +2 -0
- package/dist/navigationpanel/controls/LayoutWarning.js +102 -0
- package/dist/navigationpanel/controls/NavigationButtons.js +4 -3
- package/dist/navigationpanel/controls/OpenSource.js +2 -2
- package/dist/navigationpanel/controls/SearchControl.d.ts +2 -1
- package/dist/navigationpanel/controls/SearchControl.js +15 -17
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +26 -18
- package/dist/navigationpanel/controls/index.d.ts +2 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.d.ts +2 -2
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +5 -5
- package/dist/navigationpanel/editorpanel/CenterCamera.js +5 -2
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +21 -20
- package/dist/navigationpanel/editorpanel/EditorPanel.js +3 -3
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +2 -2
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +16 -13
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -0
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +15 -0
- package/dist/navigationpanel/styles.css.d.ts +2 -2
- package/dist/navigationpanel/styles.css.js +4 -4
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +14 -8
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +66 -66
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +68 -50
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/actions/dist/xstate-actions.cjs.js +37 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dev/dist/xstate-dev.cjs.js +59 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/assign-dea9f7c8.cjs.js +140 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/log-ec8d4df4.cjs.js +401 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/dist/raise-da5b247f.cjs.js +2716 -0
- package/dist/node_modules/.pnpm/xstate@5.24.0_patch_hash_3a1bd6d012ec67bf6e38a00c3226d1be77089442f83aeb6e424b00ca2a11d21c/node_modules/xstate/guards/dist/xstate-guards.cjs.js +26 -0
- package/dist/overlays/element-details/ElementDetails.js +7 -7
- package/dist/overlays/element-details/ElementDetailsCard.css.js +3 -3
- package/dist/overlays/element-details/ElementDetailsCard.js +7 -5
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -1
- package/dist/overlays/element-details/MetadataValue.js +2 -2
- package/dist/overlays/element-details/TabPanelDeployments.js +6 -4
- package/dist/overlays/element-details/TabPanelRelationships.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +8 -82
- package/dist/overlays/element-details/actor.js +0 -8
- package/dist/overlays/overlay/Overlay.js +10 -10
- package/dist/overlays/overlaysActor.d.ts +7 -150
- package/dist/overlays/overlaysActor.js +183 -161
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/_types.d.ts +3 -4
- package/dist/overlays/relationship-details/actor.d.ts +6 -550
- package/dist/overlays/relationship-details/actor.js +18 -3
- package/dist/overlays/relationship-details/custom/ElementActions.js +8 -5
- package/dist/overlays/relationship-details/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationship-details/hooks.js +1 -1
- package/dist/overlays/relationship-details/layout-to-xyflow.js +3 -5
- package/dist/overlays/relationship-details/layout.d.ts +3 -3
- package/dist/overlays/relationship-details/layout.js +4 -4
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/_types.d.ts +2 -3
- package/dist/overlays/relationships-browser/actor.d.ts +7 -673
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/custom/ElementActions.js +44 -37
- package/dist/overlays/relationships-browser/custom/edgeTypes.js +4 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +4 -1
- package/dist/overlays/relationships-browser/hooks.js +7 -6
- package/dist/overlays/relationships-browser/layout.d.ts +2 -2
- package/dist/overlays/relationships-browser/layout.js +3 -3
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -3
- package/dist/overlays/types.d.ts +12 -13
- package/dist/search/Search.js +2 -1
- package/dist/search/components/ElementsColumn.js +5 -3
- package/dist/search/components/PickView.js +1 -1
- package/dist/search/components/SearchByTags.js +21 -44
- package/dist/search/components/SearchInput.js +1 -1
- package/dist/search/components/ViewsColum.js +6 -4
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.d.ts +3 -66
- package/dist/shadowroot/ShadowRoot.d.ts +5 -7
- package/dist/shadowroot/ShadowRoot.js +8 -6
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +83 -21
- package/dist/utils/vector.js +98 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +58 -0
- package/dist/utils/xyflow.d.ts +52 -8
- package/dist/utils/xyflow.js +31 -11
- package/package.json +26 -24
- package/panda.buildinfo.json +124 -71
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/dist/hooks/useCurrentViewId.d.ts +0 -6
- package/dist/likec4diagram/custom/edges/utils.js +0 -23
- package/dist/likec4diagram/state/diagram-machine.d.ts +0 -2590
- package/dist/likec4diagram/state/diagram-machine.js +0 -1180
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.d.ts +0 -1
- package/dist/navigationpanel/editorpanel/LayoutDriftNotification.js +0 -56
- package/dist/utils/get-view-bounds.d.ts +0 -3
- package/dist/utils/get-view-bounds.js +0 -14
- /package/dist/base/{types.js → Base.js} +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +0 -0
- /package/dist/node_modules/.pnpm/{@tabler_icons-react@3.35.0_react@19.1.1 → @tabler_icons-react@3.35.0_react@19.2.0}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
2
|
type ElementActionButtonsProps = {
|
|
3
3
|
selected?: boolean;
|
|
4
|
-
data:
|
|
4
|
+
data: {
|
|
5
|
+
hovered?: boolean;
|
|
6
|
+
};
|
|
5
7
|
buttons: ElementActionButtons.Item[];
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
@@ -33,8 +35,8 @@ export declare function ElementActionButtons({ selected, data: { hovered: isHove
|
|
|
33
35
|
export declare namespace ElementActionButtons {
|
|
34
36
|
type Item = {
|
|
35
37
|
key?: string;
|
|
36
|
-
icon?:
|
|
37
|
-
onClick: (e:
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
onClick: (e: ReactMouseEvent) => void;
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
export {};
|
|
@@ -7,7 +7,7 @@ import { ActionIcon } from '@mantine/core';
|
|
|
7
7
|
import { useId } from '@mantine/hooks';
|
|
8
8
|
import * as m from 'motion/react-m';
|
|
9
9
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
10
|
-
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
10
|
+
import IconBolt from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js';
|
|
11
11
|
|
|
12
12
|
const container = hstack({
|
|
13
13
|
position: "absolute",
|
|
@@ -58,6 +58,7 @@ function ElementActionButtons({
|
|
|
58
58
|
scale: isHovered ? 1.1 : selected ? 0.9 : 0.8,
|
|
59
59
|
y: isHovered || selected ? 6 : 0
|
|
60
60
|
},
|
|
61
|
+
layoutDependency: `${isHovered}-${selected}`,
|
|
61
62
|
"data-likec4-hovered": isHovered,
|
|
62
63
|
className: cx("nodrag nopan", actionButtons),
|
|
63
64
|
children: buttons.map((button, index) => /* @__PURE__ */ jsx(
|
|
@@ -76,8 +77,7 @@ function ElementActionButtons({
|
|
|
76
77
|
},
|
|
77
78
|
`${id}-${button.key ?? index}`
|
|
78
79
|
))
|
|
79
|
-
}
|
|
80
|
-
`${id}-action-buttons`
|
|
80
|
+
}
|
|
81
81
|
)
|
|
82
82
|
}
|
|
83
83
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComputedNodeStyle, NodeId } from '@likec4/core';
|
|
2
|
-
import { Color
|
|
1
|
+
import { ComputedNodeStyle, MarkdownOrString, NodeId } from '@likec4/core';
|
|
2
|
+
import { Color } from '@likec4/core/types';
|
|
3
3
|
import { CSSProperties, DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
4
4
|
type RequiredData = {
|
|
5
5
|
id: NodeId;
|
|
@@ -7,7 +7,7 @@ type RequiredData = {
|
|
|
7
7
|
technology?: string | null | undefined;
|
|
8
8
|
color: Color;
|
|
9
9
|
style: ComputedNodeStyle;
|
|
10
|
-
description?:
|
|
10
|
+
description?: MarkdownOrString | null | undefined;
|
|
11
11
|
icon?: string | null;
|
|
12
12
|
};
|
|
13
13
|
type ElementDataProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ensureSizes } from '@likec4/core/types';
|
|
3
|
-
import { cx } from '@likec4/styles/css';
|
|
2
|
+
import { ensureSizes, RichText } from '@likec4/core/types';
|
|
3
|
+
import { cx, css } from '@likec4/styles/css';
|
|
4
4
|
import { elementNodeData } from '@likec4/styles/recipes';
|
|
5
5
|
import { Text } from '@mantine/core';
|
|
6
6
|
import { forwardRef } from 'react';
|
|
@@ -69,9 +69,10 @@ const Technology = forwardRef(({ data, children, className, ...props }, ref) =>
|
|
|
69
69
|
) : null;
|
|
70
70
|
});
|
|
71
71
|
const Description = forwardRef(({ data: { description, style }, className, ...props }, ref) => {
|
|
72
|
-
if (!description
|
|
72
|
+
if (!description) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
|
+
const desc = RichText.from(description);
|
|
75
76
|
const { size } = ensureSizes(style);
|
|
76
77
|
const isSm = size === "sm" || size === "xs";
|
|
77
78
|
return /* @__PURE__ */ jsx(
|
|
@@ -80,14 +81,19 @@ const Description = forwardRef(({ data: { description, style }, className, ...pr
|
|
|
80
81
|
...props,
|
|
81
82
|
className: cx(
|
|
82
83
|
className,
|
|
83
|
-
"likec4-element-description"
|
|
84
|
+
"likec4-element-description",
|
|
85
|
+
css({
|
|
86
|
+
lineClamp: isSm ? 3 : 5
|
|
87
|
+
})
|
|
84
88
|
),
|
|
85
89
|
"data-likec4-node-description": "",
|
|
86
|
-
value:
|
|
90
|
+
value: desc,
|
|
87
91
|
uselikec4palette: true,
|
|
88
92
|
hideIfEmpty: true,
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
style: {
|
|
94
|
+
// Workaround for lineClamp not working with nested TABLE elements (if markdown has tables)
|
|
95
|
+
maxHeight: desc.isMarkdown ? "8rem" : void 0
|
|
96
|
+
},
|
|
91
97
|
ref
|
|
92
98
|
}
|
|
93
99
|
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
1
2
|
import { BaseNodeData } from '../../base/types';
|
|
2
3
|
type ElementDetailsButtonProps = {
|
|
3
4
|
selected?: boolean;
|
|
4
5
|
data: BaseNodeData;
|
|
5
|
-
icon?:
|
|
6
|
-
onClick: (e:
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
onClick: (e: ReactMouseEvent) => void;
|
|
7
8
|
};
|
|
8
9
|
export declare function ElementDetailsButton({ selected, data: { hovered: isHovered, }, icon, onClick, }: ElementDetailsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -3,10 +3,9 @@ import { cx, css } from '@likec4/styles/css';
|
|
|
3
3
|
import { Box } from '@likec4/styles/jsx';
|
|
4
4
|
import { actionBtn } from '@likec4/styles/recipes';
|
|
5
5
|
import { ActionIcon } from '@mantine/core';
|
|
6
|
-
import { useId } from '@mantine/hooks';
|
|
7
6
|
import * as m from 'motion/react-m';
|
|
8
7
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
9
|
-
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
+
import IconId from '../../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js';
|
|
10
9
|
|
|
11
10
|
const container = css({
|
|
12
11
|
position: "absolute",
|
|
@@ -28,6 +27,9 @@ const container = css({
|
|
|
28
27
|
},
|
|
29
28
|
_smallZoom: {
|
|
30
29
|
display: "none"
|
|
30
|
+
},
|
|
31
|
+
_print: {
|
|
32
|
+
display: "none"
|
|
31
33
|
}
|
|
32
34
|
});
|
|
33
35
|
function ElementDetailsButton({
|
|
@@ -38,7 +40,6 @@ function ElementDetailsButton({
|
|
|
38
40
|
icon,
|
|
39
41
|
onClick
|
|
40
42
|
}) {
|
|
41
|
-
const id = useId();
|
|
42
43
|
return /* @__PURE__ */ jsx(Box, { className: cx(container, "details-button"), children: /* @__PURE__ */ jsx(
|
|
43
44
|
ActionIcon,
|
|
44
45
|
{
|
|
@@ -64,8 +65,7 @@ function ElementDetailsButton({
|
|
|
64
65
|
onClick,
|
|
65
66
|
onDoubleClick: stopPropagation,
|
|
66
67
|
children: icon ?? /* @__PURE__ */ jsx(IconId, { stroke: 1.8, style: { width: "75%" } })
|
|
67
|
-
}
|
|
68
|
-
id
|
|
68
|
+
}
|
|
69
69
|
) });
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -2,42 +2,30 @@ import { css } from '@likec4/styles/css';
|
|
|
2
2
|
|
|
3
3
|
const container = css({
|
|
4
4
|
position: "relative",
|
|
5
|
-
width: "
|
|
6
|
-
height: "
|
|
5
|
+
width: "full",
|
|
6
|
+
height: "full",
|
|
7
7
|
padding: "0",
|
|
8
8
|
margin: "0",
|
|
9
9
|
display: "flex",
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
justifyContent: "center",
|
|
12
12
|
pointerEvents: "none",
|
|
13
|
-
_before: {
|
|
14
|
-
content: '" "',
|
|
15
|
-
position: "absolute",
|
|
16
|
-
top: "[calc(100% - 4px)]",
|
|
17
|
-
left: "0",
|
|
18
|
-
width: "100%",
|
|
19
|
-
height: "24px",
|
|
20
|
-
background: "[transparent]",
|
|
21
|
-
pointerEvents: "all"
|
|
22
|
-
},
|
|
23
13
|
_focusVisible: {
|
|
24
14
|
outline: "none"
|
|
25
15
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// // filter: `grayscale(0.85) ${fallbackVar(vars.safariAnimationHook, 'blur(2px)')}`,
|
|
40
|
-
// },
|
|
16
|
+
_whenSelectable: {
|
|
17
|
+
pointerEvents: "all",
|
|
18
|
+
_before: {
|
|
19
|
+
content: '" "',
|
|
20
|
+
position: "absolute",
|
|
21
|
+
top: "[calc(100% - 4px)]",
|
|
22
|
+
left: "0",
|
|
23
|
+
width: "full",
|
|
24
|
+
height: "24px",
|
|
25
|
+
background: "transparent",
|
|
26
|
+
pointerEvents: "all"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
41
29
|
_reduceGraphicsOnPan: {
|
|
42
30
|
_before: {
|
|
43
31
|
display: "none"
|
|
@@ -151,11 +151,11 @@ function ShapeSvgOutline({ shape, w, h }) {
|
|
|
151
151
|
svg = /* @__PURE__ */ jsx(
|
|
152
152
|
"rect",
|
|
153
153
|
{
|
|
154
|
-
x: -
|
|
155
|
-
y: -
|
|
156
|
-
width: w +
|
|
157
|
-
height: h +
|
|
158
|
-
rx:
|
|
154
|
+
x: -3,
|
|
155
|
+
y: -3,
|
|
156
|
+
width: w + 6,
|
|
157
|
+
height: h + 6,
|
|
158
|
+
rx: 8
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
161
|
break;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, RefAttributes, MemoExoticComponent } from 'react';
|
|
2
2
|
import { BaseNodePropsWithData } from '../../base/types';
|
|
3
|
-
import { ForwardRefExoticComponent, RefAttributes, MemoExoticComponent } from 'react';
|
|
4
3
|
export type ElementTagProps = {
|
|
5
4
|
tag: string;
|
|
6
5
|
cursor?: 'pointer' | 'default';
|
|
7
|
-
} & Omit<
|
|
8
|
-
export declare const ElementTag: ForwardRefExoticComponent<
|
|
6
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'color'>;
|
|
7
|
+
export declare const ElementTag: ForwardRefExoticComponent<{
|
|
8
|
+
tag: string;
|
|
9
|
+
cursor?: "pointer" | "default";
|
|
10
|
+
} & Omit<Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children" | "color"> & RefAttributes<HTMLDivElement>>;
|
|
9
11
|
type Data = {
|
|
10
12
|
tags: readonly string[] | null | undefined;
|
|
11
13
|
width: number;
|
|
@@ -9,7 +9,8 @@ import { NodeToolbar, Position } from '@xyflow/react';
|
|
|
9
9
|
import { deepEqual } from 'fast-equals';
|
|
10
10
|
import { forwardRef, memo, useEffect, useCallback } from 'react';
|
|
11
11
|
import { useTagSpecification } from '../../context/TagStylesContext.js';
|
|
12
|
-
import
|
|
12
|
+
import '@xstate/react';
|
|
13
|
+
import { useDiagram } from '../../hooks/safeContext.js';
|
|
13
14
|
import { useCurrentZoom } from '../../hooks/useXYFlow.js';
|
|
14
15
|
import { stopPropagation } from '../../utils/xyflow.js';
|
|
15
16
|
|
|
@@ -4,9 +4,11 @@ import { memo } from 'react';
|
|
|
4
4
|
const isSame = (a, b) => {
|
|
5
5
|
return Math.abs(a - b) < 2.5;
|
|
6
6
|
};
|
|
7
|
-
const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) &&
|
|
7
|
+
const edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.animated ?? false, next.animated ?? false) && deepEqual(prev.source, next.source) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.target, next.target) && isSame(prev.targetY, next.targetY) && isSame(prev.targetX, next.targetX) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.targetPosition, next.targetPosition) && deepEqual(prev.data, next.data);
|
|
8
8
|
function memoEdge(Edge) {
|
|
9
|
-
|
|
9
|
+
const Memo = memo(Edge, edgePropsEqual);
|
|
10
|
+
Memo.displayName = `MemoEdge(${Edge.displayName || Edge.name})`;
|
|
11
|
+
return Memo;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export { memoEdge };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { BaseNodeProps } from '../base/types';
|
|
3
|
-
export declare function memoNode<P extends BaseNodeProps>(Node: FunctionComponent<P
|
|
3
|
+
export declare function memoNode<P extends BaseNodeProps>(Node: FunctionComponent<P>, displayName?: string): FunctionComponent<P>;
|
|
@@ -2,10 +2,10 @@ import { deepEqual } from 'fast-equals';
|
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
|
|
4
4
|
function nodePropsEqual(prev, next) {
|
|
5
|
-
return prev.id === next.id && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
5
|
+
return prev.id === next.id && deepEqual(prev.type, next.type) && deepEqual(prev.selected ?? false, next.selected ?? false) && deepEqual(prev.dragging ?? false, next.dragging ?? false) && deepEqual(prev.width ?? 0, next.width ?? 0) && deepEqual(prev.height ?? 0, next.height ?? 0) && deepEqual(prev.zIndex ?? 0, next.zIndex ?? 0) && deepEqual(prev.data, next.data);
|
|
6
6
|
}
|
|
7
7
|
const isMemoized = Symbol.for("isMemoized");
|
|
8
|
-
function memoNode(Node) {
|
|
8
|
+
function memoNode(Node, displayName = "Node") {
|
|
9
9
|
if (Node.hasOwnProperty(isMemoized)) {
|
|
10
10
|
return Node;
|
|
11
11
|
}
|
|
@@ -13,7 +13,7 @@ function memoNode(Node) {
|
|
|
13
13
|
Node,
|
|
14
14
|
nodePropsEqual
|
|
15
15
|
);
|
|
16
|
-
NodeComponent.displayName =
|
|
16
|
+
NodeComponent.displayName = displayName;
|
|
17
17
|
Object.defineProperty(NodeComponent, isMemoized, {
|
|
18
18
|
enumerable: false,
|
|
19
19
|
writable: false,
|
|
@@ -1,47 +1,64 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { css } from '@likec4/styles/css';
|
|
3
|
+
import { HStack, VStack } from '@likec4/styles/jsx';
|
|
4
|
+
import { ThemeIcon, Text, ScrollAreaAutosize, Button } from '@mantine/core';
|
|
5
|
+
import { useRef, useEffect } from 'react';
|
|
4
6
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
5
|
-
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
+
import IconX from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
6
8
|
|
|
7
9
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
8
10
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
11
|
+
const dialogRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
dialogRef.current?.showModal();
|
|
14
|
+
}, []);
|
|
9
15
|
return /* @__PURE__ */ jsx(
|
|
10
|
-
|
|
16
|
+
"dialog",
|
|
11
17
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
left: "0",
|
|
16
|
-
width: "100%",
|
|
17
|
-
height: "100%",
|
|
18
|
+
ref: dialogRef,
|
|
19
|
+
className: css({
|
|
20
|
+
margin: "0",
|
|
18
21
|
padding: "0",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
22
|
+
position: "fixed",
|
|
23
|
+
top: "10",
|
|
24
|
+
left: "10",
|
|
25
|
+
width: "[calc(100vw - ({spacing.10} * 2))]",
|
|
26
|
+
height: "max-content",
|
|
27
|
+
maxHeight: "[calc(100vh - ({spacing.10} * 3))]",
|
|
28
|
+
background: `likec4.overlay.body`,
|
|
29
|
+
rounded: "sm",
|
|
30
|
+
borderWidth: 3,
|
|
31
|
+
borderColor: `likec4.overlay.border`,
|
|
32
|
+
shadow: "xl",
|
|
33
|
+
outline: "none",
|
|
34
|
+
_backdrop: {
|
|
35
|
+
cursor: "zoom-out",
|
|
36
|
+
backdropFilter: `blur(18px)`,
|
|
37
|
+
bg: "[color-mix(in oklab, {colors.likec4.overlay.backdrop} 60%, transparent)]"
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
if (e.target?.nodeName?.toUpperCase() === "DIALOG") {
|
|
43
|
+
dialogRef.current?.close();
|
|
44
|
+
return;
|
|
43
45
|
}
|
|
44
|
-
|
|
46
|
+
},
|
|
47
|
+
onClose: (e) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
resetErrorBoundary();
|
|
50
|
+
},
|
|
51
|
+
children: /* @__PURE__ */ jsxs(HStack, { p: "xl", gap: "lg", alignItems: "flex-start", flexWrap: "nowrap", children: [
|
|
52
|
+
/* @__PURE__ */ jsx(ThemeIcon, { size: "md", radius: "xl", color: "red", children: /* @__PURE__ */ jsx(IconX, { style: { width: 20, height: 20 } }) }),
|
|
53
|
+
/* @__PURE__ */ jsxs(VStack, { flex: "1", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Text, { fz: "md", children: "Oops, something went wrong" }),
|
|
55
|
+
/* @__PURE__ */ jsx(ScrollAreaAutosize, { maw: "100%", mah: 400, type: "auto", children: /* @__PURE__ */ jsx(Text, { fz: "md", c: "red", style: { whiteSpace: "pre-wrap", userSelect: "all" }, children: errorString }) }),
|
|
56
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", mt: "md", children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "default", onClick: () => resetErrorBoundary(), children: "Reset" }),
|
|
58
|
+
/* @__PURE__ */ jsx(Text, { fz: "sm", c: "dimmed", children: "See console for more details and report the issue if it persists." })
|
|
59
|
+
] })
|
|
60
|
+
] })
|
|
61
|
+
] })
|
|
45
62
|
}
|
|
46
63
|
);
|
|
47
64
|
}
|
package/dist/components/Link.js
CHANGED
|
@@ -4,8 +4,8 @@ import { styled } from '@likec4/styles/jsx';
|
|
|
4
4
|
import { Badge, CopyButton, ActionIcon } from '@mantine/core';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
6
|
import { GithubIcon } from './GithubIcon.js';
|
|
7
|
-
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
-
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
+
import IconCheck from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js';
|
|
8
|
+
import IconCopy from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js';
|
|
9
9
|
|
|
10
10
|
const GITHUB_PREFIX = "https://github.com/";
|
|
11
11
|
const Link = forwardRef(
|
|
@@ -15,7 +15,8 @@ const defaultHandlers = {
|
|
|
15
15
|
onCanvasDblClick: null,
|
|
16
16
|
onBurgerMenuClick: null,
|
|
17
17
|
onOpenSource: null,
|
|
18
|
-
onInitialized: null
|
|
18
|
+
onInitialized: null,
|
|
19
|
+
onLayoutTypeChange: null
|
|
19
20
|
};
|
|
20
21
|
const HandlerNames = keys(defaultHandlers);
|
|
21
22
|
const DiagramEventHandlersReactContext = createContext({
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ExclusiveUnion } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "
|
|
3
|
+
declare const FeatureNames: readonly ["Controls", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Vscode", "ElementTags"];
|
|
4
4
|
export type FeatureName = typeof FeatureNames[number];
|
|
5
|
-
type
|
|
6
|
-
enableControls: 'next' | boolean;
|
|
7
|
-
};
|
|
5
|
+
export type TogglableFeature = ('ReadOnly' | 'CompareWithLatest') & FeatureName;
|
|
8
6
|
export type EnabledFeatures = {
|
|
9
|
-
[P in `enable${FeatureName}`]:
|
|
7
|
+
[P in `enable${FeatureName}`]: boolean;
|
|
10
8
|
};
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const DefaultFeatures: EnabledFeatures;
|
|
12
10
|
export declare function DiagramFeatures({ children, features, overrides, }: PropsWithChildren<ExclusiveUnion<{
|
|
13
11
|
features: {
|
|
14
12
|
features: EnabledFeatures;
|
|
@@ -21,6 +19,27 @@ export declare namespace DiagramFeatures {
|
|
|
21
19
|
var Overlays: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
22
20
|
}
|
|
23
21
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
22
|
+
export type IfEnabledProps = PropsWithChildren<{
|
|
23
|
+
feature: FeatureName;
|
|
24
|
+
/**
|
|
25
|
+
* Additional AND condition
|
|
26
|
+
* @default true
|
|
27
|
+
* @example
|
|
28
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
29
|
+
* ...
|
|
30
|
+
* </IfEnabled>
|
|
31
|
+
*/
|
|
32
|
+
and?: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Renders children only if the specified feature is enabled
|
|
36
|
+
* @param feature Feature name
|
|
37
|
+
* @param and Additional AND condition
|
|
38
|
+
* @example
|
|
39
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
40
|
+
* ...
|
|
41
|
+
* </IfEnabled>
|
|
42
|
+
*/
|
|
24
43
|
export declare function IfEnabled({ feature, children, and, }: PropsWithChildren<{
|
|
25
44
|
feature: FeatureName;
|
|
26
45
|
and?: boolean;
|
|
@@ -1,48 +1,25 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { shallowEqual } from 'fast-equals';
|
|
3
3
|
import { useContext, createContext, useState, useEffect } from 'react';
|
|
4
|
-
import { mapToObj } from 'remeda';
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
"Vscode",
|
|
24
|
-
"ElementTags"
|
|
25
|
-
];
|
|
26
|
-
const AllDisabled = mapToObj(
|
|
27
|
-
FeatureNames,
|
|
28
|
-
(name) => [`enable${name}`, false]
|
|
29
|
-
);
|
|
30
|
-
const DiagramFeaturesContext = createContext(AllDisabled);
|
|
31
|
-
const validate = (features) => {
|
|
32
|
-
let {
|
|
33
|
-
enableReadOnly,
|
|
34
|
-
enableEdgeEditing,
|
|
35
|
-
...rest
|
|
36
|
-
} = features;
|
|
37
|
-
if (enableReadOnly) {
|
|
38
|
-
enableEdgeEditing = false;
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
enableReadOnly,
|
|
42
|
-
enableEdgeEditing,
|
|
43
|
-
...rest
|
|
44
|
-
};
|
|
5
|
+
const DefaultFeatures = {
|
|
6
|
+
enableReadOnly: true,
|
|
7
|
+
enableCompareWithLatest: false,
|
|
8
|
+
enableControls: false,
|
|
9
|
+
enableDynamicViewWalkthrough: false,
|
|
10
|
+
enableElementDetails: false,
|
|
11
|
+
enableFocusMode: false,
|
|
12
|
+
enableNavigateTo: false,
|
|
13
|
+
enableNotations: false,
|
|
14
|
+
enableRelationshipBrowser: false,
|
|
15
|
+
enableRelationshipDetails: false,
|
|
16
|
+
enableSearch: false,
|
|
17
|
+
enableNavigationButtons: false,
|
|
18
|
+
enableFitView: false,
|
|
19
|
+
enableVscode: false,
|
|
20
|
+
enableElementTags: false
|
|
45
21
|
};
|
|
22
|
+
const DiagramFeaturesContext = createContext(DefaultFeatures);
|
|
46
23
|
function DiagramFeatures({
|
|
47
24
|
children,
|
|
48
25
|
features,
|
|
@@ -53,11 +30,11 @@ function DiagramFeatures({
|
|
|
53
30
|
useEffect(
|
|
54
31
|
() => {
|
|
55
32
|
setScope((current) => {
|
|
56
|
-
const next =
|
|
33
|
+
const next = {
|
|
57
34
|
...outerScope,
|
|
58
35
|
...features,
|
|
59
36
|
...overrides
|
|
60
|
-
}
|
|
37
|
+
};
|
|
61
38
|
return shallowEqual(current, next) ? current : next;
|
|
62
39
|
});
|
|
63
40
|
},
|
|
@@ -65,18 +42,13 @@ function DiagramFeatures({
|
|
|
65
42
|
);
|
|
66
43
|
return /* @__PURE__ */ jsx(DiagramFeaturesContext.Provider, { value: scope, children });
|
|
67
44
|
}
|
|
45
|
+
const overridesForOverlays = {
|
|
46
|
+
enableControls: false,
|
|
47
|
+
enableReadOnly: true,
|
|
48
|
+
enableCompareWithLatest: false
|
|
49
|
+
};
|
|
68
50
|
DiagramFeatures.Overlays = ({ children }) => {
|
|
69
|
-
return /* @__PURE__ */ jsx(
|
|
70
|
-
DiagramFeatures,
|
|
71
|
-
{
|
|
72
|
-
overrides: {
|
|
73
|
-
enableControls: false,
|
|
74
|
-
enableReadOnly: true,
|
|
75
|
-
enableEdgeEditing: false
|
|
76
|
-
},
|
|
77
|
-
children
|
|
78
|
-
}
|
|
79
|
-
);
|
|
51
|
+
return /* @__PURE__ */ jsx(DiagramFeatures, { overrides: overridesForOverlays, children });
|
|
80
52
|
};
|
|
81
53
|
function useEnabledFeatures() {
|
|
82
54
|
return useContext(DiagramFeaturesContext);
|
|
@@ -94,15 +66,15 @@ function IfNotEnabled({ feature, children }) {
|
|
|
94
66
|
return notEnabled ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
95
67
|
}
|
|
96
68
|
function IfReadOnly({ children }) {
|
|
97
|
-
const isReadOnly = useEnabledFeatures()
|
|
69
|
+
const isReadOnly = useEnabledFeatures().enableReadOnly === true;
|
|
98
70
|
return isReadOnly ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
99
71
|
}
|
|
100
72
|
function IfNotReadOnly({ children }) {
|
|
101
|
-
const isReadOnly = useEnabledFeatures()
|
|
73
|
+
const isReadOnly = useEnabledFeatures().enableReadOnly === true;
|
|
102
74
|
if (isReadOnly) {
|
|
103
75
|
return null;
|
|
104
76
|
}
|
|
105
77
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
106
78
|
}
|
|
107
79
|
|
|
108
|
-
export {
|
|
80
|
+
export { DefaultFeatures, DiagramFeatures, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
3
|
import { createContext, useContext } from 'react';
|
|
4
|
-
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
5
|
-
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
6
|
-
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
7
|
-
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
8
|
-
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
9
|
-
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.
|
|
4
|
+
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
|
|
5
|
+
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
|
|
6
|
+
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
|
|
7
|
+
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
|
|
8
|
+
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
|
|
9
|
+
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.35.0_react@19.2.0/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
|
|
10
10
|
|
|
11
11
|
const IconRendererContext = createContext(null);
|
|
12
12
|
function IconRendererProvider({
|