@likec4/diagram 1.42.1 → 1.44.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 +6198 -4860
- package/dist/LikeC4Diagram.d.ts +1 -1
- package/dist/LikeC4Diagram.js +15 -12
- package/dist/LikeC4Diagram.props.d.ts +28 -14
- package/dist/LikeC4ProjectsProvider.js +1 -1
- package/dist/LikeC4View.d.ts +28 -4
- package/dist/LikeC4View.js +28 -17
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/ReactLikeC4.js +5 -7
- package/dist/StaticLikeC4Diagram.js +2 -2
- 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/const.d.ts +1 -1
- package/dist/base/const.js +1 -1
- package/dist/base/index.d.ts +6 -2
- package/dist/base/types.d.ts +1 -28
- package/dist/base/updateEdges.js +4 -3
- package/dist/base/updateNodes.js +3 -2
- package/dist/base-primitives/compound/CompoundActionButton.js +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +1 -1
- 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 +4 -0
- package/dist/base-primitives/edge/EdgeLabel.d.ts +1 -0
- 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 +9 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +3 -2
- package/dist/base-primitives/element/ElementActionButtons.js +1 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +2 -5
- package/dist/base-primitives/element/ElementNodeContainer.css.js +15 -27
- 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 +24 -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 +2 -18
- package/dist/context/index.d.ts +1 -1
- package/dist/custom/customNodes.js +3 -2
- package/dist/custom/hooks.d.ts +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +4 -4
- package/dist/editor/LikeC4EditorContext.d.ts +21 -0
- package/dist/editor/index.d.ts +2 -0
- package/dist/hooks/index.d.ts +2 -1
- 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 +60 -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 +54 -51
- package/dist/likec4diagram/convert-to-xyflow.d.ts +0 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +249 -220
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +7 -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/ElementNodeDrifts.d.ts +4 -0
- package/dist/likec4diagram/custom/nodes/ElementNodeDrifts.js +46 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -1
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +9 -1
- package/dist/likec4diagram/custom/nodes/nodes.js +13 -9
- 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 +5 -7
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +3 -2
- package/dist/likec4diagram/state/DiagramActorProvider.js +96 -70
- package/dist/likec4diagram/state/assign.d.ts +4 -2
- package/dist/likec4diagram/state/assign.js +39 -103
- package/dist/likec4diagram/state/createViewChange.d.ts +3 -0
- package/dist/likec4diagram/state/createViewChange.js +90 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +113 -0
- package/dist/likec4diagram/state/diagram-api.js +134 -0
- package/dist/likec4diagram/state/hotkeyActor.d.ts +7 -0
- package/dist/likec4diagram/state/hotkeyActor.js +17 -1
- package/dist/likec4diagram/state/machine.actions.d.ts +2099 -0
- package/dist/likec4diagram/state/machine.actions.js +735 -0
- package/dist/likec4diagram/state/machine.d.ts +3717 -0
- package/dist/likec4diagram/state/machine.js +141 -0
- package/dist/likec4diagram/state/machine.setup.d.ts +284 -0
- package/dist/likec4diagram/state/machine.setup.js +71 -0
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +183 -0
- package/dist/likec4diagram/state/machine.state.initializing.js +55 -0
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +117 -0
- package/dist/likec4diagram/state/machine.state.navigating.js +45 -0
- package/dist/likec4diagram/state/machine.state.ready.d.ts +3666 -0
- package/dist/likec4diagram/state/machine.state.ready.js +437 -0
- package/dist/likec4diagram/state/syncManualLayoutActor.d.ts +220 -63
- package/dist/likec4diagram/state/syncManualLayoutActor.js +218 -143
- package/dist/likec4diagram/state/types.d.ts +4 -7
- package/dist/likec4diagram/state/utils.d.ts +4 -2
- package/dist/likec4diagram/state/utils.js +4 -1
- package/dist/likec4diagram/types.d.ts +6 -1
- 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.js +10 -12
- package/dist/likec4diagram/useLayoutConstraints.d.ts +10 -5
- package/dist/likec4diagram/useLayoutConstraints.js +225 -54
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +0 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +15 -15
- package/dist/navigationpanel/NavigationPanel.js +11 -7
- 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 +11 -7
- package/dist/navigationpanel/actor.js +5 -4
- 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 +19 -16
- 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 +10 -10
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +31 -14
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +2 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +66 -49
- 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.js +18 -88
- package/dist/overlays/element-details/MetadataValue.d.ts +9 -0
- package/dist/overlays/element-details/MetadataValue.js +261 -0
- 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 +3 -2
- package/dist/overlays/overlaysActor.d.ts +304 -62
- package/dist/overlays/overlaysActor.js +132 -131
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -3
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/actor.d.ts +14 -2
- package/dist/overlays/relationship-details/actor.js +23 -5
- 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/relationships-browser/RelationshipsBrowser.js +6 -4
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.d.ts +239 -173
- package/dist/overlays/relationships-browser/actor.js +132 -110
- package/dist/overlays/relationships-browser/const.d.ts +3 -3
- package/dist/overlays/relationships-browser/const.js +3 -3
- 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/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/shadowroot/ShadowRoot.js +53 -12
- package/dist/shadowroot/styles.css.d.ts +0 -4
- package/dist/shadowroot/styles.css.js +1 -41
- package/dist/styles.css2.js +1 -1
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/vector.d.ts +78 -21
- package/dist/utils/vector.js +91 -24
- package/dist/utils/view-bounds.d.ts +8 -0
- package/dist/utils/view-bounds.js +57 -0
- package/dist/utils/xyflow.d.ts +49 -7
- package/dist/utils/xyflow.js +63 -11
- package/package.json +28 -27
- package/panda.buildinfo.json +140 -83
- 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,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,11 @@
|
|
|
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 CustomFeatures = {
|
|
6
|
-
enableControls: 'next' | boolean;
|
|
7
|
-
};
|
|
8
5
|
export type EnabledFeatures = {
|
|
9
|
-
[P in `enable${FeatureName}`]:
|
|
6
|
+
[P in `enable${FeatureName}`]: boolean;
|
|
10
7
|
};
|
|
11
|
-
export declare const
|
|
8
|
+
export declare const DefaultFeatures: EnabledFeatures;
|
|
12
9
|
export declare function DiagramFeatures({ children, features, overrides, }: PropsWithChildren<ExclusiveUnion<{
|
|
13
10
|
features: {
|
|
14
11
|
features: EnabledFeatures;
|
|
@@ -21,6 +18,27 @@ export declare namespace DiagramFeatures {
|
|
|
21
18
|
var Overlays: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
22
19
|
}
|
|
23
20
|
export declare function useEnabledFeatures(): EnabledFeatures;
|
|
21
|
+
export type IfEnabledProps = PropsWithChildren<{
|
|
22
|
+
feature: FeatureName;
|
|
23
|
+
/**
|
|
24
|
+
* Additional AND condition
|
|
25
|
+
* @default true
|
|
26
|
+
* @example
|
|
27
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
28
|
+
* ...
|
|
29
|
+
* </IfEnabled>
|
|
30
|
+
*/
|
|
31
|
+
and?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Renders children only if the specified feature is enabled
|
|
35
|
+
* @param feature Feature name
|
|
36
|
+
* @param and Additional AND condition
|
|
37
|
+
* @example
|
|
38
|
+
* <IfEnabled feature="ReadOnly" and={isSomething}>
|
|
39
|
+
* ...
|
|
40
|
+
* </IfEnabled>
|
|
41
|
+
*/
|
|
24
42
|
export declare function IfEnabled({ feature, children, and, }: PropsWithChildren<{
|
|
25
43
|
feature: FeatureName;
|
|
26
44
|
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({
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createContext
|
|
1
|
+
import 'react/jsx-runtime';
|
|
2
|
+
import { createContext } from 'react';
|
|
3
3
|
|
|
4
4
|
const LikeC4ModelContext = createContext(null);
|
|
5
5
|
const CurrentViewModelContext = createContext(null);
|
|
6
|
-
function EnsureCurrentViewModel({ children }) {
|
|
7
|
-
const viewmodel = useContext(CurrentViewModelContext);
|
|
8
|
-
if (!viewmodel) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
12
|
-
}
|
|
13
6
|
|
|
14
|
-
export { CurrentViewModelContext,
|
|
7
|
+
export { CurrentViewModelContext, LikeC4ModelContext };
|
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { isTagColorSpecified } from '@likec4/core';
|
|
3
|
+
import { DefaultTagColors } from '@likec4/core/styles';
|
|
3
4
|
import { useMantineStyleNonce } from '@mantine/core';
|
|
4
5
|
import { createContext, memo, useContext } from 'react';
|
|
5
6
|
import { isEmpty, pipe, entries, flatMap, join } from 'remeda';
|
|
6
7
|
import { useLikeC4Specification } from '../hooks/useLikeC4Model.js';
|
|
7
8
|
|
|
8
9
|
const TagStylesContext = createContext({});
|
|
9
|
-
const radixColors =
|
|
10
|
-
"yellow",
|
|
11
|
-
"orange",
|
|
12
|
-
"amber",
|
|
13
|
-
"tomato",
|
|
14
|
-
"red",
|
|
15
|
-
"ruby",
|
|
16
|
-
"crimson",
|
|
17
|
-
"pink",
|
|
18
|
-
"pink",
|
|
19
|
-
"purple",
|
|
20
|
-
"violet",
|
|
21
|
-
"indigo",
|
|
22
|
-
"blue",
|
|
23
|
-
"teal",
|
|
24
|
-
"grass",
|
|
25
|
-
"lime"
|
|
26
|
-
];
|
|
10
|
+
const radixColors = DefaultTagColors;
|
|
27
11
|
const generateColorVars = (spec) => {
|
|
28
12
|
const color = spec.color;
|
|
29
13
|
if (isTagColorSpecified(spec)) {
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DiagramEventHandlers, useDiagramEventHandlers } from './DiagramEventHandlers';
|
|
2
|
-
export {
|
|
2
|
+
export { DefaultFeatures, DiagramFeatures, IfEnabled, IfNotEnabled, useEnabledFeatures, } from './DiagramFeatures';
|
|
3
3
|
export type { EnabledFeatures } from './DiagramFeatures';
|
|
4
4
|
export { EnsureMantine } from './EnsureMantine';
|
|
5
5
|
export { FramerMotionConfig } from './FramerMotionConfig';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useLikeC4Model } from '../hooks/useLikeC4Model.js';
|
|
3
3
|
|
|
4
4
|
function customDiagramNode(Node) {
|
|
5
5
|
return ((props) => {
|
|
6
6
|
const viewId = props.data.viewId;
|
|
7
|
-
const
|
|
7
|
+
const likec4 = useLikeC4Model();
|
|
8
|
+
const viewModel = likec4.findView(viewId);
|
|
8
9
|
if (!viewModel) {
|
|
9
10
|
console.error(`View "${viewId}" not found, requested by customNode "${props.data.id}"`, { props });
|
|
10
11
|
return null;
|
package/dist/custom/hooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { DiagramActorEvent, DiagramActorRef, DiagramContext, } from '../likec4diagram/state/types';
|
|
2
2
|
export { useDiagramEventHandlers, } from '../context/DiagramEventHandlers';
|
|
3
3
|
export { type EnabledFeatures, type FeatureName, useEnabledFeatures, } from '../context/DiagramFeatures';
|
|
4
|
-
export { useCurrentViewId, } from '../hooks/
|
|
4
|
+
export { useCurrentView, useCurrentViewId, } from '../hooks/useCurrentView';
|
|
5
5
|
export { type DiagramApi, useDiagram, useDiagramActorRef, useDiagramContext, useOnDiagramEvent, } from '../hooks/useDiagram';
|
|
6
6
|
export { useCurrentViewModel, } from '../hooks/useCurrentViewModel';
|
|
7
7
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, } from '../hooks/useLikeC4Model';
|
package/dist/custom/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './hooks';
|
|
|
4
4
|
export * from './primitives';
|
|
5
5
|
export type { BaseEdge, BaseEdgeData, BaseEdgeProps, BaseEdgePropsWithData, BaseNode, BaseNodeData, BaseNodeProps, BaseNodePropsWithData, } from '../base/types';
|
|
6
6
|
export type { ChangeEvent, DiagramNodeWithNavigate, ElementIconRenderer, ElementIconRendererProps, LikeC4ColorScheme, LikeC4DiagramEventHandlers, LikeC4DiagramProperties, NodeRenderers, OnCanvasClick, OnChange, OnEdgeClick, OnNavigateTo, OnNodeClick, OpenSourceParams, PaddingUnit, PaddingWithUnit, ViewPadding, WhereOperator, } from '../LikeC4Diagram.props';
|
|
7
|
-
export { Base } from '../base/
|
|
7
|
+
export { Base } from '../base/Base';
|
|
8
8
|
export type { Types } from '../likec4diagram/types';
|
|
9
9
|
export { type EnabledFeatures, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures, } from '../context/DiagramFeatures';
|
|
10
10
|
export { Overlay } from '../overlays/overlay/Overlay';
|
package/dist/custom/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, sequenceActorNode, viewGroupNode } from './customNodes.js';
|
|
2
|
-
export { Base } from '../base/
|
|
2
|
+
export { Base } from '../base/Base.js';
|
|
3
3
|
export { IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, useEnabledFeatures } from '../context/DiagramFeatures.js';
|
|
4
4
|
export { Overlay } from '../overlays/overlay/Overlay.js';
|
|
5
5
|
export { PortalToContainer } from '../components/PortalToContainer.js';
|
|
@@ -13,9 +13,9 @@ export { DeploymentElementToolbar, ElementToolbar } from '../likec4diagram/custo
|
|
|
13
13
|
export { SequenceActorNode, SequenceParallelArea } from '../likec4diagram/custom/nodes/SequenceActorNode.js';
|
|
14
14
|
export { Toolbar } from '../likec4diagram/custom/nodes/toolbar/Toolbar.js';
|
|
15
15
|
export { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
|
|
16
|
-
export { useCurrentViewId } from '../hooks/
|
|
17
|
-
export { useDiagram,
|
|
18
|
-
export {
|
|
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
19
|
export { useCurrentViewModel } from '../hooks/useCurrentViewModel.js';
|
|
20
20
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from '../hooks/useLikeC4Model.js';
|
|
21
21
|
export { useHasProjects, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from '../hooks/useLikeC4Project.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { OnChange } from '../LikeC4Diagram.props';
|
|
3
|
+
import type * as t from '@likec4/core/types';
|
|
4
|
+
export type LikeC4EditorContextType = {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch a view by its ID and layout type.
|
|
7
|
+
*
|
|
8
|
+
* @param viewId - The ID of the view to fetch.
|
|
9
|
+
* @param layout - The layout type to use when fetching the view.
|
|
10
|
+
*/
|
|
11
|
+
fetchView(viewId: t.ViewId, layout?: t.LayoutType): Promise<t.LayoutedView>;
|
|
12
|
+
syncManualLayout(viewId: t.ViewId): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Callback invoked when the view changes.
|
|
15
|
+
*/
|
|
16
|
+
onChange: OnChange;
|
|
17
|
+
};
|
|
18
|
+
export declare function LikeC4EditorContext({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function EnsureEditorContext({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export declare function useOptionalLikeC4Editor(): LikeC4EditorContextType | null;
|
|
21
|
+
export declare function useLikeC4Editor(): LikeC4EditorContextType;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export { useCallbackRef } from './useCallbackRef';
|
|
1
2
|
export { useId } from './useId';
|
|
2
3
|
export { useMantinePortalProps } from './useMantinePortalProps';
|
|
3
4
|
export { useSetState } from './useSetState';
|
|
4
5
|
export { useUpdateEffect } from './useUpdateEffect';
|
|
5
6
|
export { useCurrentZoom, useIsZoomTooSmall, useXYFlow, useXYInternalNode, useXYStore, useXYStoreApi } from './useXYFlow';
|
|
6
7
|
export type { XYFlowInstance, XYStoreApi, XYStoreState } from './useXYFlow';
|
|
7
|
-
export { useCurrentViewId } from './
|
|
8
|
+
export { useCurrentView, useCurrentViewId } from './useCurrentView';
|
|
8
9
|
export { useCurrentViewModel } from './useCurrentViewModel';
|
|
9
10
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from './useLikeC4Model';
|
|
10
11
|
export { useHasProjects, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, } from './useLikeC4Project';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DiagramApi } from '../likec4diagram/state/diagram-api';
|
|
2
2
|
import { Provider } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { UnknownLayouted } from '@likec4/core';
|
|
4
|
+
import { DiagramActorRef } from '../custom';
|
|
5
|
+
export declare const DiagramActorContextProvider: Provider<DiagramApi< UnknownLayouted>>;
|
|
6
|
+
export declare function useDiagramActorRef(): DiagramActorRef;
|
|
7
|
+
export declare function useDiagram(): DiagramApi< UnknownLayouted>;
|
|
@@ -3,12 +3,19 @@ import { useContext, createContext } from 'react';
|
|
|
3
3
|
const DiagramActorSafeContext = createContext(null);
|
|
4
4
|
DiagramActorSafeContext.displayName = "DiagramActorSafeContext";
|
|
5
5
|
const DiagramActorContextProvider = DiagramActorSafeContext.Provider;
|
|
6
|
-
|
|
6
|
+
function useDiagramActorRef() {
|
|
7
|
+
const ctx = useContext(DiagramActorSafeContext);
|
|
8
|
+
if (ctx === null) {
|
|
9
|
+
throw new Error("DiagramActorRef is not provided");
|
|
10
|
+
}
|
|
11
|
+
return ctx.actor;
|
|
12
|
+
}
|
|
13
|
+
function useDiagram() {
|
|
7
14
|
const ctx = useContext(DiagramActorSafeContext);
|
|
8
15
|
if (ctx === null) {
|
|
9
16
|
throw new Error("DiagramActorRef is not provided");
|
|
10
17
|
}
|
|
11
18
|
return ctx;
|
|
12
|
-
}
|
|
19
|
+
}
|
|
13
20
|
|
|
14
|
-
export { DiagramActorContextProvider, useDiagramActorRef };
|
|
21
|
+
export { DiagramActorContextProvider, useDiagram, useDiagramActorRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | null | undefined): T;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
function useCallbackRef(callback) {
|
|
4
|
+
const ref = useRef(callback);
|
|
5
|
+
ref.current = callback;
|
|
6
|
+
const callbackRef = useRef(null);
|
|
7
|
+
if (callbackRef.current == null) {
|
|
8
|
+
callbackRef.current = ((...args) => ref.current?.(...args));
|
|
9
|
+
}
|
|
10
|
+
return callbackRef.current;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { useCallbackRef };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LayoutedView, ViewId } from '@likec4/core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns current view id
|
|
4
|
+
* Should be used only inside LikeC4Diagram
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCurrentViewId(): ViewId;
|
|
7
|
+
/**
|
|
8
|
+
* Returns current view
|
|
9
|
+
* Should be used only inside LikeC4Diagram
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCurrentView(): LayoutedView;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useSelector } from '@xstate/react';
|
|
2
|
-
import '
|
|
3
|
-
import 'fast-equals';
|
|
2
|
+
import { shallowEqual } from 'fast-equals';
|
|
4
3
|
import 'react';
|
|
5
4
|
import { useDiagramActorRef } from './safeContext.js';
|
|
6
5
|
|
|
@@ -9,5 +8,10 @@ function useCurrentViewId() {
|
|
|
9
8
|
const actorRef = useDiagramActorRef();
|
|
10
9
|
return useSelector(actorRef, selectViewId);
|
|
11
10
|
}
|
|
11
|
+
const selectView = (s) => s.context.view;
|
|
12
|
+
function useCurrentView() {
|
|
13
|
+
const actorRef = useDiagramActorRef();
|
|
14
|
+
return useSelector(actorRef, selectView, shallowEqual);
|
|
15
|
+
}
|
|
12
16
|
|
|
13
|
-
export { useCurrentViewId };
|
|
17
|
+
export { useCurrentView, useCurrentViewId };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { CurrentViewModelContext } from '../context/LikeC4ModelContext.js';
|
|
3
3
|
|
|
4
|
+
function useOptionalCurrentViewModel() {
|
|
5
|
+
return useContext(CurrentViewModelContext);
|
|
6
|
+
}
|
|
4
7
|
function useCurrentViewModel() {
|
|
5
8
|
const vm = useContext(CurrentViewModelContext);
|
|
6
9
|
if (!vm) {
|
|
@@ -9,4 +12,4 @@ function useCurrentViewModel() {
|
|
|
9
12
|
return vm;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
export { useCurrentViewModel };
|
|
15
|
+
export { useCurrentViewModel, useOptionalCurrentViewModel };
|