@likec4/diagram 1.48.0 → 1.49.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/README.md +7 -9
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +77 -79
- package/dist/LikeC4Diagram.props.d.ts +9 -1
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +4 -4
- package/dist/LikeC4Styles.d.ts +2 -1
- package/dist/LikeC4View.d.ts +14 -1
- package/dist/LikeC4View.js +31 -18
- package/dist/ReactLikeC4.d.ts +2 -1
- package/dist/ReactLikeC4.js +3 -1
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +3 -3
- package/dist/adhoc-editor/hooks.js +5 -23
- package/dist/adhoc-editor/index.d.ts +1 -1
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
- package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
- package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
- package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
- package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
- package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
- package/dist/base/const.d.ts +1 -0
- package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
- package/dist/base-primitives/element/ElementActionButtons.js +35 -10
- package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.js +2 -4
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -16
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.js +10 -1
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +5 -3
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +5 -4
- package/dist/context/IconRenderer.js +51 -24
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorProvider.js +1 -1
- package/dist/editor/applyChangesToManualLayout.js +7 -7
- package/dist/editor/editorActor.actions.js +20 -20
- package/dist/editor/editorActor.states.js +0 -9
- package/dist/editor/useEditorActorLogic.d.ts +1 -2
- package/dist/editor/useEditorActorLogic.js +8 -11
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +2 -6
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +8 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +5 -7
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
- package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
- package/dist/likec4diagram/state/machine.actions.js +78 -21
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
- package/dist/likec4diagram/state/machine.js +4 -1
- package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
- package/dist/likec4diagram/state/machine.state.ready.js +11 -3
- package/dist/likec4diagram/state/utils.d.ts +2 -1
- package/dist/likec4diagram/state/utils.js +1 -1
- package/dist/likec4diagram/types.d.ts +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +125 -86
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
- package/dist/navigationpanel/NavigationPanel.js +2 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/controls/DetailsControls.js +4 -4
- package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
- package/dist/navigationpanel/controls/LogoButton.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
- 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 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +7 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/overlaysActor.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -6
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/search/Search.d.ts +2 -1
- package/dist/search/Search.js +108 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +93 -59
- package/dist/search/components/PickView.js +8 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +11 -11
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.js +4 -1
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +3 -2
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +1 -1
- package/dist/utils/xyflow.d.ts +10 -5
- package/dist/utils/xyflow.js +24 -22
- package/package.json +29 -28
- package/panda.buildinfo.json +175 -86
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -52554
- package/bundle/package.json +0 -4
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
- package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
- package/dist/adhoc-editor/actor.d.ts +0 -131
- package/dist/adhoc-editor/actor.editor.js +0 -96
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
- 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 +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { cx } from '@likec4/styles/css';
|
|
3
|
-
import {
|
|
3
|
+
import { useStore } from '@nanostores/react';
|
|
4
4
|
import { atom } from 'nanostores';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useRef, useState, useMemo } from 'react';
|
|
6
|
+
import { ReduceGraphicsModeProvider, PanningAtomSafeCtx, RootContainerContextProvider } from '../context/RootContainerContext.js';
|
|
7
7
|
|
|
8
8
|
function RootContainer({
|
|
9
9
|
id,
|
|
@@ -11,28 +11,21 @@ function RootContainer({
|
|
|
11
11
|
reduceGraphics = false,
|
|
12
12
|
children
|
|
13
13
|
}) {
|
|
14
|
-
const [mounted, setMounted] = useState(false);
|
|
15
14
|
const ref = useRef(null);
|
|
16
|
-
const $isPanning =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
return $isPanning.listen((isPanning) => {
|
|
22
|
-
ref.current?.setAttribute("data-likec4-diagram-panning", isPanning ? "true" : "false");
|
|
23
|
-
});
|
|
24
|
-
}, [$isPanning]);
|
|
25
|
-
const ctx = useMemo(() => ({ id, ref }), [id, ref]);
|
|
26
|
-
return /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanning, children: /* @__PURE__ */ jsx(ReduceGraphicsModeCtx.Provider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(
|
|
15
|
+
const [$isPanning] = useState(() => atom(false));
|
|
16
|
+
const isPanning = useStore($isPanning);
|
|
17
|
+
const ctx = useMemo(() => ({ id, ref, selector: `#${id}` }), [id, ref]);
|
|
18
|
+
return /* @__PURE__ */ jsx(ReduceGraphicsModeProvider, { value: reduceGraphics, children: /* @__PURE__ */ jsx(PanningAtomSafeCtx, { value: $isPanning, children: /* @__PURE__ */ jsx(
|
|
27
19
|
"div",
|
|
28
20
|
{
|
|
29
21
|
id,
|
|
30
22
|
className: cx("likec4-root", className),
|
|
31
23
|
ref,
|
|
24
|
+
"data-likec4-diagram-panning": isPanning,
|
|
32
25
|
...reduceGraphics && {
|
|
33
26
|
["data-likec4-reduced-graphics"]: true
|
|
34
27
|
},
|
|
35
|
-
children:
|
|
28
|
+
children: /* @__PURE__ */ jsx(RootContainerContextProvider, { value: ctx, children })
|
|
36
29
|
}
|
|
37
30
|
) }) });
|
|
38
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
2
|
+
export declare function ErrorMessage({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ViewNotFound({ viewId }: {
|
|
4
4
|
viewId: string;
|
|
5
|
-
})
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
function ErrorMessage({ children }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
style: {
|
|
8
|
+
margin: "1em 0"
|
|
9
|
+
},
|
|
10
|
+
children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
style: {
|
|
14
|
+
margin: "0 auto",
|
|
15
|
+
display: "inline-block",
|
|
16
|
+
padding: "2em",
|
|
17
|
+
background: "rgba(250,82,82,.15)",
|
|
18
|
+
color: "#ffa8a8"
|
|
19
|
+
},
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function ViewNotFound({ viewId }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(ErrorMessage, { children: [
|
|
28
|
+
"View ",
|
|
29
|
+
/* @__PURE__ */ jsx("code", { children: viewId }),
|
|
30
|
+
" not found"
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
29
33
|
|
|
30
34
|
export { ErrorMessage, ViewNotFound };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useCurrentViewId } from '../hooks/useCurrentView.js';
|
|
3
|
+
import { useOptionalLikeC4Model, CurrentViewModelContext } from './LikeC4ModelContext.js';
|
|
4
|
+
|
|
5
|
+
function CurrentViewModelProvider({ children }) {
|
|
6
|
+
const viewId = useCurrentViewId();
|
|
7
|
+
const likec4model = useOptionalLikeC4Model();
|
|
8
|
+
const viewmodel = likec4model?.findView(viewId) ?? null;
|
|
9
|
+
return /* @__PURE__ */ jsx(CurrentViewModelContext, { value: viewmodel, children });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { CurrentViewModelProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MantineProviderProps } from '@mantine/core';
|
|
2
|
-
export declare function DefaultMantineProvider({ children, ...props }: MantineProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DefaultMantineProvider({ children, theme, ...props }: MantineProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -58,9 +58,18 @@ const DefaultTheme = createTheme({
|
|
|
58
58
|
});
|
|
59
59
|
function DefaultMantineProvider({
|
|
60
60
|
children,
|
|
61
|
+
theme,
|
|
61
62
|
...props
|
|
62
63
|
}) {
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
MantineProvider,
|
|
66
|
+
{
|
|
67
|
+
defaultColorScheme: "auto",
|
|
68
|
+
theme: theme ?? DefaultTheme,
|
|
69
|
+
...props,
|
|
70
|
+
children
|
|
71
|
+
}
|
|
72
|
+
);
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
export { DefaultMantineProvider };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { aux } from '@likec4/core/types';
|
|
2
1
|
import { PropsWithChildren, RefObject } from 'react';
|
|
3
2
|
import { LikeC4DiagramEventHandlers } from '../LikeC4Diagram.props';
|
|
4
3
|
type RequiredOrNull<T> = {
|
|
5
4
|
[P in keyof T]-?: NonNullable<T[P]> | null;
|
|
6
5
|
};
|
|
6
|
+
type DiagramEventHandlersRef = RefObject<Required<LikeC4DiagramEventHandlers>>;
|
|
7
7
|
export type DiagramEventHandlersContext = RequiredOrNull<LikeC4DiagramEventHandlers> & {
|
|
8
|
-
handlersRef:
|
|
8
|
+
handlersRef: DiagramEventHandlersRef;
|
|
9
9
|
};
|
|
10
|
-
export declare function DiagramEventHandlers
|
|
11
|
-
handlers: Required<LikeC4DiagramEventHandlers
|
|
10
|
+
export declare function DiagramEventHandlers({ handlers, children, }: PropsWithChildren<{
|
|
11
|
+
handlers: Required<LikeC4DiagramEventHandlers>;
|
|
12
12
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare function useDiagramEventHandlers(): DiagramEventHandlersContext;
|
|
14
|
-
export declare function useDiagramEventHandlersRef
|
|
14
|
+
export declare function useDiagramEventHandlersRef(): DiagramEventHandlersRef;
|
|
15
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useSyncedRef } from '@react-hookz/web';
|
|
3
|
-
import { useContext,
|
|
4
|
-
import {
|
|
3
|
+
import { useContext, useMemo, createContext } from 'react';
|
|
4
|
+
import { isFunction, mapToObj, keys } from 'remeda';
|
|
5
5
|
|
|
6
6
|
const defaultHandlers = {
|
|
7
7
|
onNavigateTo: null,
|
|
@@ -18,6 +18,9 @@ const defaultHandlers = {
|
|
|
18
18
|
onLayoutTypeChange: null
|
|
19
19
|
};
|
|
20
20
|
const HandlerNames = keys(defaultHandlers);
|
|
21
|
+
const DiagramEventHandlersRefContext = createContext({
|
|
22
|
+
current: defaultHandlers
|
|
23
|
+
});
|
|
21
24
|
const DiagramEventHandlersReactContext = createContext({
|
|
22
25
|
...mapToObj(HandlerNames, (name) => [name, null]),
|
|
23
26
|
handlersRef: {
|
|
@@ -41,10 +44,13 @@ function DiagramEventHandlers({
|
|
|
41
44
|
}),
|
|
42
45
|
handlersRef
|
|
43
46
|
}), [handlersRef, ...deps]);
|
|
44
|
-
return /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children });
|
|
47
|
+
return /* @__PURE__ */ jsx(DiagramEventHandlersRefContext.Provider, { value: handlersRef, children: /* @__PURE__ */ jsx(DiagramEventHandlersReactContext.Provider, { value, children }) });
|
|
45
48
|
}
|
|
46
49
|
function useDiagramEventHandlers() {
|
|
47
50
|
return useContext(DiagramEventHandlersReactContext);
|
|
48
51
|
}
|
|
52
|
+
function useDiagramEventHandlersRef() {
|
|
53
|
+
return useContext(DiagramEventHandlersRefContext);
|
|
54
|
+
}
|
|
49
55
|
|
|
50
|
-
export { DiagramEventHandlers, useDiagramEventHandlers };
|
|
56
|
+
export { DiagramEventHandlers, useDiagramEventHandlers, useDiagramEventHandlersRef };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExclusiveUnion } from '@likec4/core/types';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
declare const FeatureNames: readonly ["Controls", "Editor", "ReadOnly", "FocusMode", "NavigateTo", "ElementDetails", "RelationshipDetails", "RelationshipBrowser", "Search", "NavigationButtons", "Notations", "DynamicViewWalkthrough", "FitView", "CompareWithLatest", "Notes", "Vscode", "ElementTags"];
|
|
4
5
|
export type FeatureName = typeof FeatureNames[number];
|
|
5
6
|
export type TogglableFeature = ('ReadOnly' | 'CompareWithLatest') & FeatureName;
|
|
6
7
|
export type EnabledFeatures = {
|
|
@@ -14,9 +15,9 @@ export declare function DiagramFeatures({ children, features, overrides, }: Prop
|
|
|
14
15
|
overrides: {
|
|
15
16
|
overrides: Partial<EnabledFeatures>;
|
|
16
17
|
};
|
|
17
|
-
}>>):
|
|
18
|
+
}>>): JSX.Element;
|
|
18
19
|
export declare namespace DiagramFeatures {
|
|
19
|
-
var Overlays: ({ children }: PropsWithChildren) =>
|
|
20
|
+
var Overlays: ({ children }: PropsWithChildren) => JSX.Element;
|
|
20
21
|
}
|
|
21
22
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
22
23
|
export type IfEnabledProps = PropsWithChildren<{
|
|
@@ -43,10 +44,10 @@ export type IfEnabledProps = PropsWithChildren<{
|
|
|
43
44
|
export declare function IfEnabled({ feature, children, and, }: PropsWithChildren<{
|
|
44
45
|
feature: FeatureName;
|
|
45
46
|
and?: boolean;
|
|
46
|
-
}>):
|
|
47
|
+
}>): JSX.Element | null;
|
|
47
48
|
export declare function IfNotEnabled({ feature, children }: PropsWithChildren<{
|
|
48
49
|
feature: FeatureName;
|
|
49
|
-
}>):
|
|
50
|
-
export declare function IfReadOnly({ children }: PropsWithChildren):
|
|
51
|
-
export declare function IfNotReadOnly({ children }: PropsWithChildren):
|
|
50
|
+
}>): JSX.Element | null;
|
|
51
|
+
export declare function IfReadOnly({ children }: PropsWithChildren): JSX.Element | null;
|
|
52
|
+
export declare function IfNotReadOnly({ children }: PropsWithChildren): JSX.Element | null;
|
|
52
53
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useContext, createContext
|
|
2
|
+
import { useContext, createContext } from 'react';
|
|
3
3
|
import { useSetState } from '../hooks/useSetState.js';
|
|
4
|
+
import { useUpdateEffect } from '../hooks/useUpdateEffect.js';
|
|
4
5
|
|
|
5
6
|
const DefaultFeatures = {
|
|
6
7
|
enableEditor: false,
|
|
@@ -18,7 +19,8 @@ const DefaultFeatures = {
|
|
|
18
19
|
enableNavigationButtons: false,
|
|
19
20
|
enableFitView: false,
|
|
20
21
|
enableVscode: false,
|
|
21
|
-
enableElementTags: false
|
|
22
|
+
enableElementTags: false,
|
|
23
|
+
enableNotes: false
|
|
22
24
|
};
|
|
23
25
|
const DiagramFeaturesContext = createContext(DefaultFeatures);
|
|
24
26
|
function DiagramFeatures({
|
|
@@ -32,7 +34,7 @@ function DiagramFeatures({
|
|
|
32
34
|
...features,
|
|
33
35
|
...overrides
|
|
34
36
|
}));
|
|
35
|
-
|
|
37
|
+
useUpdateEffect(
|
|
36
38
|
() => {
|
|
37
39
|
setScope({
|
|
38
40
|
...outerScope,
|
|
@@ -3,8 +3,6 @@ export declare const FramerMotionConfig: ({ reducedMotion, children, }: PropsWit
|
|
|
3
3
|
/**
|
|
4
4
|
* If true, will respect the device prefersReducedMotion setting by switching
|
|
5
5
|
* transform animations off.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
6
|
*/
|
|
9
|
-
reducedMotion?: "always" | "never" | "user";
|
|
7
|
+
reducedMotion?: "always" | "never" | "user" | undefined;
|
|
10
8
|
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementShape } from '@likec4/core';
|
|
2
|
-
import { CSSProperties, PropsWithChildren } from 'react';
|
|
2
|
+
import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import { ElementIconRenderer } from '../LikeC4Diagram.props';
|
|
4
4
|
/**
|
|
5
5
|
* Provider for custom element icon renderers
|
|
@@ -26,13 +26,14 @@ export declare function IconRenderer({ element, className, style, }: {
|
|
|
26
26
|
};
|
|
27
27
|
className?: string | undefined;
|
|
28
28
|
style?: CSSProperties | undefined;
|
|
29
|
-
}):
|
|
30
|
-
export declare function IconOrShapeRenderer({ element, className, }: {
|
|
29
|
+
}): ReactNode;
|
|
30
|
+
export declare function IconOrShapeRenderer({ element, className, style, }: {
|
|
31
31
|
element: {
|
|
32
32
|
id: string;
|
|
33
33
|
title: string;
|
|
34
34
|
shape: ElementShape;
|
|
35
35
|
icon?: string | null | undefined;
|
|
36
36
|
};
|
|
37
|
-
className
|
|
37
|
+
className?: string;
|
|
38
|
+
style?: CSSProperties | undefined;
|
|
38
39
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
8
|
-
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
9
|
-
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
10
|
-
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
4
|
+
import IconRectangularPrism from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js';
|
|
5
|
+
import IconFileText from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js';
|
|
6
|
+
import IconCylinder from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js';
|
|
7
|
+
import IconReorder from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js';
|
|
8
|
+
import IconUser from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js';
|
|
9
|
+
import IconDeviceMobile from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js';
|
|
10
|
+
import IconBrowser from '../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js';
|
|
11
11
|
|
|
12
12
|
const IconRendererContext = createContext(null);
|
|
13
13
|
function IconRendererProvider({
|
|
@@ -20,6 +20,26 @@ function IconRendererProvider({
|
|
|
20
20
|
}
|
|
21
21
|
return /* @__PURE__ */ jsx(IconRendererContext.Provider, { value, children });
|
|
22
22
|
}
|
|
23
|
+
function decodeSvgDataUrl(dataUrl) {
|
|
24
|
+
if (!dataUrl.startsWith("data:image/svg+xml")) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
if (dataUrl.includes(";base64,")) {
|
|
29
|
+
const base64Content = dataUrl.split(";base64,")[1];
|
|
30
|
+
if (base64Content) {
|
|
31
|
+
return atob(base64Content);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
const encodedContent = dataUrl.split(",")[1];
|
|
35
|
+
if (encodedContent) {
|
|
36
|
+
return decodeURIComponent(encodedContent);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
23
43
|
function IconRenderer({
|
|
24
44
|
element,
|
|
25
45
|
className,
|
|
@@ -31,7 +51,12 @@ function IconRenderer({
|
|
|
31
51
|
}
|
|
32
52
|
let icon;
|
|
33
53
|
if (element.icon.startsWith("http://") || element.icon.startsWith("https://") || element.icon.startsWith("data:image")) {
|
|
34
|
-
|
|
54
|
+
const svgContent = element.icon.startsWith("data:image/svg+xml") ? decodeSvgDataUrl(element.icon) : null;
|
|
55
|
+
if (svgContent) {
|
|
56
|
+
icon = /* @__PURE__ */ jsx("span", { style: { display: "contents" }, dangerouslySetInnerHTML: { __html: svgContent } });
|
|
57
|
+
} else {
|
|
58
|
+
icon = /* @__PURE__ */ jsx("img", { src: element.icon, alt: element.title });
|
|
59
|
+
}
|
|
35
60
|
} else if (RenderIcon) {
|
|
36
61
|
icon = /* @__PURE__ */ jsx(RenderIcon, { node: element });
|
|
37
62
|
}
|
|
@@ -60,27 +85,29 @@ const ShapeIcons = {
|
|
|
60
85
|
rectangle: IconRectangularPrism,
|
|
61
86
|
storage: IconCylinder,
|
|
62
87
|
bucket: IconCylinder,
|
|
63
|
-
document: IconFileText
|
|
88
|
+
document: IconFileText,
|
|
89
|
+
component: IconRectangularPrism
|
|
64
90
|
};
|
|
65
91
|
function IconOrShapeRenderer({
|
|
66
92
|
element,
|
|
67
|
-
className
|
|
93
|
+
className,
|
|
94
|
+
style
|
|
68
95
|
}) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return
|
|
96
|
+
if (!element.icon || element.icon === "none") {
|
|
97
|
+
const ShapeIcon = ShapeIcons[element.shape];
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: cx(
|
|
102
|
+
className,
|
|
103
|
+
"likec4-shape-icon"
|
|
104
|
+
),
|
|
105
|
+
style,
|
|
106
|
+
children: /* @__PURE__ */ jsx(ShapeIcon, {})
|
|
107
|
+
}
|
|
108
|
+
);
|
|
72
109
|
}
|
|
73
|
-
|
|
74
|
-
return /* @__PURE__ */ jsx(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
className: cx(
|
|
78
|
-
className,
|
|
79
|
-
"likec4-shape-icon"
|
|
80
|
-
),
|
|
81
|
-
children: /* @__PURE__ */ jsx(ShapeIcon, {})
|
|
82
|
-
}
|
|
83
|
-
);
|
|
110
|
+
return /* @__PURE__ */ jsx(IconRenderer, { element, className, style });
|
|
84
111
|
}
|
|
85
112
|
|
|
86
113
|
export { IconOrShapeRenderer, IconRenderer, IconRendererProvider };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { LikeC4Model, LikeC4ViewModel } from '@likec4/core/model';
|
|
2
|
-
import {
|
|
3
|
-
import { PropsWithChildren,
|
|
2
|
+
import { LayoutedView } from '@likec4/core/types';
|
|
3
|
+
import { PropsWithChildren, Provider } from 'react';
|
|
4
4
|
import type * as t from '@likec4/core/types';
|
|
5
5
|
type UnknownLayouted = t.aux.UnknownLayouted;
|
|
6
|
-
export declare const
|
|
7
|
-
export type CurrentViewModel = LikeC4ViewModel<UnknownLayouted,
|
|
8
|
-
export declare const CurrentViewModelContext:
|
|
6
|
+
export declare const LikeC4ModelContextProvider: Provider<LikeC4Model<any> | null>;
|
|
7
|
+
export type CurrentViewModel = LikeC4ViewModel<UnknownLayouted, LayoutedView<UnknownLayouted>>;
|
|
8
|
+
export declare const CurrentViewModelContext: Provider<CurrentViewModel | null>;
|
|
9
9
|
export declare function EnsureCurrentViewModel({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
/**
|
|
11
|
+
* @returns The LikeC4Model from context, or null if no LikeC4ModelProvider is found.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useOptionalLikeC4Model<A extends t.aux.Any = UnknownLayouted>(): LikeC4Model<A> | null;
|
|
14
|
+
export declare function useOptionalCurrentViewModel(): CurrentViewModel | null;
|
|
10
15
|
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
|
-
import { createContext } from 'react';
|
|
2
|
+
import { useContext, createContext } from 'react';
|
|
3
3
|
|
|
4
4
|
const LikeC4ModelContext = createContext(null);
|
|
5
|
-
const
|
|
5
|
+
const LikeC4ModelContextProvider = LikeC4ModelContext.Provider;
|
|
6
|
+
const CurrentViewModelCtx = createContext(null);
|
|
7
|
+
const CurrentViewModelContext = CurrentViewModelCtx.Provider;
|
|
8
|
+
function useOptionalLikeC4Model() {
|
|
9
|
+
return useContext(LikeC4ModelContext);
|
|
10
|
+
}
|
|
11
|
+
function useOptionalCurrentViewModel() {
|
|
12
|
+
return useContext(CurrentViewModelCtx);
|
|
13
|
+
}
|
|
6
14
|
|
|
7
|
-
export { CurrentViewModelContext,
|
|
15
|
+
export { CurrentViewModelContext, LikeC4ModelContextProvider, useOptionalCurrentViewModel, useOptionalLikeC4Model };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LikeC4Project, ProjectId } from '@likec4/core/types';
|
|
2
|
-
import {
|
|
2
|
+
import { Provider } from 'react';
|
|
3
3
|
export type LikeC4ProjectsContext = {
|
|
4
4
|
projects: ReadonlyArray<LikeC4Project>;
|
|
5
5
|
onProjectChange: (id: ProjectId) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const LikeC4ProjectsContextProvider: Provider<LikeC4ProjectsContext | null>;
|
|
8
|
+
export declare function useOptionalProjectsContext(): LikeC4ProjectsContext | null;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { createContext } from 'react';
|
|
1
|
+
import { useContext, createContext } from 'react';
|
|
2
2
|
|
|
3
3
|
const LikeC4ProjectsContext = createContext(null);
|
|
4
|
+
const LikeC4ProjectsContextProvider = LikeC4ProjectsContext.Provider;
|
|
5
|
+
function useOptionalProjectsContext() {
|
|
6
|
+
return useContext(LikeC4ProjectsContext);
|
|
7
|
+
}
|
|
4
8
|
|
|
5
|
-
export {
|
|
9
|
+
export { LikeC4ProjectsContextProvider, useOptionalProjectsContext };
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { WritableAtom } from 'nanostores';
|
|
2
|
-
import { RefObject,
|
|
3
|
-
export declare const
|
|
2
|
+
import { RefObject, Provider } from 'react';
|
|
3
|
+
export declare const RootContainerContextProvider: Provider<{
|
|
4
4
|
id: string;
|
|
5
|
+
selector: string;
|
|
5
6
|
ref: RefObject<HTMLDivElement | null>;
|
|
6
7
|
} | null>;
|
|
8
|
+
export declare function useRootContainerContext(): {
|
|
9
|
+
id: string;
|
|
10
|
+
selector: string;
|
|
11
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
12
|
+
} | null;
|
|
7
13
|
export declare function useRootContainer(): {
|
|
8
14
|
id: string;
|
|
15
|
+
selector: string;
|
|
9
16
|
ref: RefObject<HTMLDivElement | null>;
|
|
10
17
|
};
|
|
11
18
|
export declare function useRootContainerRef(): RefObject<HTMLDivElement | null>;
|
|
12
19
|
export declare function useRootContainerElement(): HTMLDivElement | null;
|
|
13
|
-
export declare const
|
|
20
|
+
export declare const ReduceGraphicsModeProvider: Provider<boolean | null>;
|
|
14
21
|
/**
|
|
15
22
|
* Hook to determine if reduced graphics mode is enabled.
|
|
16
23
|
*/
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { createSafeContext } from '@mantine/core';
|
|
2
2
|
import '@nanostores/react';
|
|
3
|
-
import {
|
|
3
|
+
import { useContext, createContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const RootContainerContext = createContext(null);
|
|
6
|
+
const RootContainerContextProvider = RootContainerContext.Provider;
|
|
7
|
+
function useRootContainerContext() {
|
|
8
|
+
return useContext(RootContainerContext);
|
|
9
|
+
}
|
|
6
10
|
function useRootContainer() {
|
|
7
|
-
const ctx =
|
|
11
|
+
const ctx = useRootContainerContext();
|
|
8
12
|
if (!ctx) {
|
|
9
13
|
throw new Error("useRootContainer must be used within a RootContainer");
|
|
10
14
|
}
|
|
@@ -17,6 +21,7 @@ function useRootContainerElement() {
|
|
|
17
21
|
return useRootContainer().ref.current;
|
|
18
22
|
}
|
|
19
23
|
const ReduceGraphicsModeCtx = createContext(null);
|
|
24
|
+
const ReduceGraphicsModeProvider = ReduceGraphicsModeCtx.Provider;
|
|
20
25
|
function useIsReducedGraphics() {
|
|
21
26
|
const isReduced = useContext(ReduceGraphicsModeCtx);
|
|
22
27
|
if (isReduced === null) {
|
|
@@ -28,4 +33,4 @@ const [PanningAtomSafeCtx, usePanningAtom] = createSafeContext(
|
|
|
28
33
|
"PanningAtomSafeCtx is not provided"
|
|
29
34
|
);
|
|
30
35
|
|
|
31
|
-
export { PanningAtomSafeCtx,
|
|
36
|
+
export { PanningAtomSafeCtx, ReduceGraphicsModeProvider, RootContainerContextProvider, useIsReducedGraphics, usePanningAtom, useRootContainer, useRootContainerContext, useRootContainerElement, useRootContainerRef };
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { isTagColorSpecified } from '@likec4/core';
|
|
3
3
|
import { DefaultTagColors } from '@likec4/core/styles';
|
|
4
4
|
import { useMantineStyleNonce } from '@mantine/core';
|
|
5
|
-
import { createContext, memo
|
|
5
|
+
import { useContext, createContext, memo } from 'react';
|
|
6
6
|
import { isEmpty, pipe, entries, flatMap, join } from 'remeda';
|
|
7
7
|
import { useLikeC4Specification } from '../hooks/useLikeC4Model.js';
|
|
8
8
|
|
package/dist/custom/index.js
CHANGED
|
@@ -5,28 +5,16 @@ export { Overlay } from '../overlays/overlay/Overlay.js';
|
|
|
5
5
|
export { PortalToContainer } from '../components/PortalToContainer.js';
|
|
6
6
|
export { ShadowRoot } from '../shadowroot/ShadowRoot.js';
|
|
7
7
|
export { FramerMotionConfig } from '../context/FramerMotionConfig.js';
|
|
8
|
+
export { CompoundActionButton } from '../base-primitives/compound/CompoundActionButton.js';
|
|
8
9
|
export { CompoundActions } from '../likec4diagram/custom/nodes/CompoundActions.js';
|
|
9
10
|
export { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode } from '../likec4diagram/custom/nodes/nodes.js';
|
|
10
11
|
export { CompoundDeploymentToolbar, CompoundElementToolbar } from '../likec4diagram/custom/nodes/toolbar/CompoundToolbar.js';
|
|
11
|
-
export { DeploymentElementActions, ElementActions } from '../likec4diagram/custom/nodes/ElementActions.js';
|
|
12
|
-
export { DeploymentElementToolbar, ElementToolbar } from '../likec4diagram/custom/nodes/toolbar/ElementToolbar.js';
|
|
13
|
-
export { SequenceActorNode, SequenceParallelArea } from '../likec4diagram/custom/nodes/SequenceActorNode.js';
|
|
14
|
-
export { Toolbar } from '../likec4diagram/custom/nodes/toolbar/Toolbar.js';
|
|
15
|
-
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
16
|
-
export { useCurrentView, useCurrentViewId } from '../hooks/useCurrentView.js';
|
|
17
|
-
export { useDiagram, useDiagramActorRef } from '../hooks/safeContext.js';
|
|
18
|
-
export { useDiagramContext, useOnDiagramEvent } from '../hooks/useDiagram.js';
|
|
19
|
-
export { useCurrentViewModel, useOptionalCurrentViewModel } from '../hooks/useCurrentViewModel.js';
|
|
20
|
-
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, useOptionalLikeC4Model } from '../hooks/useLikeC4Model.js';
|
|
21
|
-
export { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from '../hooks/useLikeC4Project.js';
|
|
22
|
-
export { useLikeC4Styles } from '../hooks/useLikeC4Styles.js';
|
|
23
|
-
export { useSetState } from '../hooks/useSetState.js';
|
|
24
|
-
export { useUpdateEffect } from '../hooks/useUpdateEffect.js';
|
|
25
|
-
export { CompoundActionButton } from '../base-primitives/compound/CompoundActionButton.js';
|
|
26
12
|
export { CompoundDetailsButton } from '../base-primitives/compound/CompoundDetailsButton.js';
|
|
27
13
|
export { CompoundNodeContainer } from '../base-primitives/compound/CompoundNodeContainer.js';
|
|
28
14
|
export { CompoundTitle } from '../base-primitives/compound/CompoundTitle.js';
|
|
29
15
|
export { DefaultHandles } from '../base-primitives/NodeHandles.js';
|
|
16
|
+
export { DeploymentElementActions, ElementActions } from '../likec4diagram/custom/nodes/ElementActions.js';
|
|
17
|
+
export { DeploymentElementToolbar, ElementToolbar } from '../likec4diagram/custom/nodes/toolbar/ElementToolbar.js';
|
|
30
18
|
export { ElementActionButtons } from '../base-primitives/element/ElementActionButtons.js';
|
|
31
19
|
export { ElementData } from '../base-primitives/element/ElementData.js';
|
|
32
20
|
export { ElementDetailsButton } from '../base-primitives/element/ElementDetailsButton.js';
|
|
@@ -34,5 +22,18 @@ export { ElementNodeContainer } from '../base-primitives/element/ElementNodeCont
|
|
|
34
22
|
export { ElementShape } from '../base-primitives/element/ElementShape.js';
|
|
35
23
|
export { ElementTag, ElementTags } from '../base-primitives/element/ElementTags.js';
|
|
36
24
|
export { Markdown } from '../base-primitives/Markdown.js';
|
|
25
|
+
export { SequenceActorNode, SequenceParallelArea } from '../likec4diagram/custom/nodes/SequenceActorNode.js';
|
|
26
|
+
export { Toolbar } from '../likec4diagram/custom/nodes/toolbar/Toolbar.js';
|
|
37
27
|
export { memoEdge } from '../base-primitives/memoEdge.js';
|
|
38
28
|
export { memoNode } from '../base-primitives/memoNode.js';
|
|
29
|
+
export { useCurrentView, useCurrentViewId } from '../hooks/useCurrentView.js';
|
|
30
|
+
export { useCurrentViewModel } from '../hooks/useCurrentViewModel.js';
|
|
31
|
+
export { useDiagram, useDiagramActorRef } from '../hooks/safeContext.js';
|
|
32
|
+
export { useDiagramContext, useOnDiagramEvent } from '../hooks/useDiagram.js';
|
|
33
|
+
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
34
|
+
export { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from '../hooks/useLikeC4Project.js';
|
|
35
|
+
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../hooks/useLikeC4Model.js';
|
|
36
|
+
export { useLikeC4Styles } from '../hooks/useLikeC4Styles.js';
|
|
37
|
+
export { useOptionalCurrentViewModel, useOptionalLikeC4Model } from '../context/LikeC4ModelContext.js';
|
|
38
|
+
export { useSetState } from '../hooks/useSetState.js';
|
|
39
|
+
export { useUpdateEffect } from '../hooks/useUpdateEffect.js';
|