@likec4/diagram 1.57.0 → 1.59.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/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeMarkers.d.ts +8 -8
- package/dist/base-primitives/element/ElementActionButtons.d.ts +2 -1
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +4 -2
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.d.ts +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/base-primitives/element/ElementTags.d.ts +1 -1
- package/dist/base-primitives/element/ElementTags.js +1 -3
- package/dist/components/ErrorFallback.d.ts +2 -2
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/PortalToContainer.d.ts +1 -1
- package/dist/components/RootContainer.d.ts +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/components/SearchControl.d.ts +2 -2
- package/dist/components/ViewNotFound.d.ts +2 -2
- package/dist/context/CurrentViewModelProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DiagramEventHandlers.d.ts +1 -1
- package/dist/context/EnsureMantine.d.ts +1 -1
- package/dist/context/FramerMotionConfig.d.ts +3 -3
- package/dist/context/FramerMotionConfig.js +2 -2
- package/dist/context/IconRenderer.d.ts +2 -2
- package/dist/context/IconRenderer.js +32 -12
- package/dist/context/LikeC4ModelContext.d.ts +1 -1
- package/dist/context/TagStylesContext.d.ts +4 -3
- package/dist/context/TagStylesContext.js +20 -22
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
- package/dist/editor/actor/actions.d.ts +74 -15
- package/dist/editor/actor/actions.js +91 -25
- package/dist/editor/actor/hotkey.d.ts +1 -1
- package/dist/editor/actor/hotkey.js +7 -0
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/machine.js +1 -0
- package/dist/editor/actor/setup.d.ts +25 -4
- package/dist/editor/actor/setup.js +8 -6
- package/dist/editor/actor/state.editor.d.ts +64 -14
- package/dist/editor/actor/state.editor.js +12 -11
- package/dist/editor/actor/state.sync-queue.d.ts +283 -91
- package/dist/editor/actor/state.sync-queue.js +93 -56
- package/dist/editor/actor/types.d.ts +6 -1
- package/dist/editor/actor/types.js +1 -1
- package/dist/editor/useEditorActorLogic.js +14 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.d.ts +5 -0
- package/dist/hooks/useEditorActor.js +4 -3
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/likec4diagram/DiagramUI.d.ts +1 -1
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +54 -17
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +140 -18
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/edges.css.js +6 -2
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +4 -4
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/toolbar/Toolbar.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +2 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +118 -46
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +49 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +519 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +116 -62
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +561 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +112 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +47 -40
- package/dist/navigationpanel/_common.d.ts +2 -2
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanel.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/ComparePanelControls.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/comparepanel/LayoutTypeSwitcher.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/controls/LayoutWarning.d.ts +1 -1
- package/dist/navigationpanel/controls/LogoButton.d.ts +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.d.ts +1 -1
- package/dist/navigationpanel/controls/OpenSource.d.ts +1 -1
- package/dist/navigationpanel/controls/SearchControl.d.ts +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/EditorPanel.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +5 -5
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/ElementDetailsCard.d.ts +1 -1
- package/dist/overlays/element-details/MetadataValue.d.ts +2 -2
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +1 -1
- package/dist/overlays/relationship-details/SelectEdge.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/ElementActions.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/EmptyNode.d.ts +1 -1
- package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +4 -4
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/ProjectsOverview.d.ts +1 -1
- package/dist/projects-overview/actor.js +4 -4
- package/dist/projects-overview/custom/nodeTypes.d.ts +1 -1
- package/dist/projects-overview/panel/ProjectsOverviewPanel.d.ts +1 -1
- package/dist/search/Search.d.ts +1 -1
- package/dist/search/Search.js +1 -1
- package/dist/search/XStateSearchAdapter.d.ts +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ElementsColumn.d.ts +1 -1
- package/dist/search/components/PickView.d.ts +1 -1
- package/dist/search/components/SearchByTags.d.ts +1 -1
- package/dist/search/components/SearchInput.d.ts +1 -1
- package/dist/search/components/ViewsColum.d.ts +3 -3
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +2 -3
- package/dist/shadowroot/ShadowRoot.js +95 -41
- package/dist/shadowroot/index.d.ts +1 -0
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +30 -43
- package/panda.buildinfo.json +271 -295
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/shadowroot/styles.css.d.ts +0 -12
- package/dist/shadowroot/styles.css.js +0 -59
|
@@ -66,6 +66,7 @@ function ElementActionButtons({ selected = false, data: { hovered: isHovered = f
|
|
|
66
66
|
break;
|
|
67
67
|
default: variant = "normal";
|
|
68
68
|
}
|
|
69
|
+
const isActionVisible = isHovered || selected;
|
|
69
70
|
return /* @__PURE__ */ jsx("div", {
|
|
70
71
|
className: actionButtons(),
|
|
71
72
|
children: /* @__PURE__ */ jsx(m.div, {
|
|
@@ -83,7 +84,9 @@ function ElementActionButtons({ selected = false, data: { hovered: isHovered = f
|
|
|
83
84
|
initial: false,
|
|
84
85
|
whileTap: { scale: 1 },
|
|
85
86
|
whileHover: { scale: 1.3 },
|
|
86
|
-
tabIndex: -1,
|
|
87
|
+
tabIndex: isActionVisible ? 0 : -1,
|
|
88
|
+
inert: isActionVisible ? void 0 : true,
|
|
89
|
+
"aria-label": button.ariaLabel ?? button.key ?? "Element action",
|
|
87
90
|
onClick: button.onClick,
|
|
88
91
|
onDoubleClick: stopPropagation,
|
|
89
92
|
children: button.icon || /* @__PURE__ */ jsx(IconBolt, {})
|
|
@@ -47,10 +47,12 @@ type SlotProps = {
|
|
|
47
47
|
* </ElementData.Root>
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
export declare function ElementData({ data }: ElementDataProps
|
|
50
|
+
export declare function ElementData({ data, 'aria-hidden': ariaHidden }: ElementDataProps & {
|
|
51
|
+
'aria-hidden'?: boolean | undefined;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
51
53
|
export declare namespace ElementData {
|
|
52
54
|
var Root: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & ElementDataProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
53
|
-
var Icon: ({ data, ...props }: IconProps) => import("react
|
|
55
|
+
var Icon: ({ data, ...props }: IconProps) => import("react").JSX.Element;
|
|
54
56
|
var Content: import("react").ForwardRefExoticComponent<Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
55
57
|
var Title: import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
56
58
|
var Technology: import("react").ForwardRefExoticComponent<((import("type-fest/source/merge-exclusive").Without<SlotProps, {
|
|
@@ -101,9 +101,10 @@ var Description = forwardRef(({ data: { description }, className, ...props }, re
|
|
|
101
101
|
* </ElementData.Root>
|
|
102
102
|
* ```
|
|
103
103
|
*/
|
|
104
|
-
function ElementData({ data }) {
|
|
104
|
+
function ElementData({ data, "aria-hidden": ariaHidden }) {
|
|
105
105
|
return /* @__PURE__ */ jsxs(Root, {
|
|
106
106
|
data,
|
|
107
|
+
"aria-hidden": ariaHidden,
|
|
107
108
|
children: [/* @__PURE__ */ jsx(Icon, { data }), /* @__PURE__ */ jsxs(Content, { children: [
|
|
108
109
|
/* @__PURE__ */ jsx(Title, { data }),
|
|
109
110
|
/* @__PURE__ */ jsx(Technology, { data }),
|
|
@@ -4,7 +4,8 @@ type ElementDetailsButtonProps = {
|
|
|
4
4
|
selected?: boolean;
|
|
5
5
|
data: BaseNodeData;
|
|
6
6
|
icon?: ReactNode;
|
|
7
|
+
ariaLabel?: string;
|
|
7
8
|
onClick: (e: ReactMouseEvent) => void;
|
|
8
9
|
};
|
|
9
|
-
export declare function ElementDetailsButton({ selected, data: { hovered: isHovered, }, icon, onClick, }: ElementDetailsButtonProps): import("react
|
|
10
|
+
export declare function ElementDetailsButton({ selected, data: { hovered: isHovered, }, icon, ariaLabel, onClick, }: ElementDetailsButtonProps): import("react").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -47,7 +47,7 @@ var container = css({
|
|
|
47
47
|
_smallZoom: { display: "none" },
|
|
48
48
|
_print: { display: "none" }
|
|
49
49
|
});
|
|
50
|
-
function ElementDetailsButton({ selected = false, data: { hovered: isHovered = false }, icon, onClick }) {
|
|
50
|
+
function ElementDetailsButton({ selected = false, data: { hovered: isHovered = false }, icon, ariaLabel = "Open details", onClick }) {
|
|
51
51
|
let variant;
|
|
52
52
|
switch (true) {
|
|
53
53
|
case isHovered:
|
|
@@ -58,6 +58,7 @@ function ElementDetailsButton({ selected = false, data: { hovered: isHovered = f
|
|
|
58
58
|
break;
|
|
59
59
|
default: variant = "normal";
|
|
60
60
|
}
|
|
61
|
+
const isActionVisible = isHovered || selected;
|
|
61
62
|
return /* @__PURE__ */ jsx(Box$1, {
|
|
62
63
|
className: cx(container, "details-button"),
|
|
63
64
|
children: /* @__PURE__ */ jsx(ActionIcon, {
|
|
@@ -70,7 +71,9 @@ function ElementDetailsButton({ selected = false, data: { hovered: isHovered = f
|
|
|
70
71
|
whileTap: "whileTap",
|
|
71
72
|
onClick,
|
|
72
73
|
onDoubleClick: stopPropagation,
|
|
73
|
-
tabIndex: -1,
|
|
74
|
+
tabIndex: isActionVisible ? 0 : -1,
|
|
75
|
+
inert: isActionVisible ? void 0 : true,
|
|
76
|
+
"aria-label": ariaLabel,
|
|
74
77
|
children: icon ?? /* @__PURE__ */ jsx(IconId, {
|
|
75
78
|
stroke: 1.8,
|
|
76
79
|
style: { width: "75%" }
|
|
@@ -2,8 +2,8 @@ import "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { cx } from "@likec4/styles/css";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import * as m from "motion/react-m";
|
|
6
5
|
import { ensureSizes } from "@likec4/core/types";
|
|
6
|
+
import * as m from "motion/react-m";
|
|
7
7
|
import { elementNode } from "@likec4/styles/recipes";
|
|
8
8
|
//#region src/base-primitives/element/ElementNodeContainer.tsx
|
|
9
9
|
var variants = {
|
|
@@ -14,5 +14,5 @@ type ElementShapeProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
showSelectionOutline?: boolean | undefined;
|
|
16
16
|
};
|
|
17
|
-
export declare function ElementShape({ data, width, height, showSelectionOutline }: ElementShapeProps): import("react
|
|
17
|
+
export declare function ElementShape({ data, width, height, showSelectionOutline }: ElementShapeProps): import("react").JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -324,6 +324,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
324
324
|
const borderStyle = data.style?.border ?? "none";
|
|
325
325
|
const withBorder = borderStyle !== "none";
|
|
326
326
|
if (data.shape === "rectangle") return /* @__PURE__ */ jsxs("div", {
|
|
327
|
+
"aria-hidden": true,
|
|
327
328
|
style: { borderStyle },
|
|
328
329
|
className: elementShapeRecipe({
|
|
329
330
|
shapetype: "html",
|
|
@@ -337,6 +338,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
337
338
|
withOutline: showSelectionOutline
|
|
338
339
|
});
|
|
339
340
|
return /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && /* @__PURE__ */ jsx("svg", {
|
|
341
|
+
"aria-hidden": true,
|
|
340
342
|
className,
|
|
341
343
|
"data-likec4-shape-multiple": "true",
|
|
342
344
|
viewBox: `0 0 ${w} ${h}`,
|
|
@@ -347,6 +349,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
347
349
|
h
|
|
348
350
|
})
|
|
349
351
|
}), /* @__PURE__ */ jsxs("svg", {
|
|
352
|
+
"aria-hidden": true,
|
|
350
353
|
className,
|
|
351
354
|
viewBox: `0 0 ${w} ${h}`,
|
|
352
355
|
children: [/* @__PURE__ */ jsx(ShapeSvgOutline, {
|
|
@@ -17,5 +17,5 @@ export type ElementTagsProps = BaseNodePropsWithData<Data> & {
|
|
|
17
17
|
onTagMouseEnter?: (tag: `#${string}`) => void;
|
|
18
18
|
onTagMouseLeave?: (tag: `#${string}`) => void;
|
|
19
19
|
};
|
|
20
|
-
export declare const ElementTags: MemoExoticComponent<({ id, data: { tags, width, hovered }, onTagClick, onTagMouseEnter, onTagMouseLeave }: ElementTagsProps) => import("react
|
|
20
|
+
export declare const ElementTags: MemoExoticComponent<({ id, data: { tags, width, hovered }, onTagClick, onTagMouseEnter, onTagMouseLeave }: ElementTagsProps) => import("react").JSX.Element | null>;
|
|
21
21
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useCurrentZoomAtLeast } from "../../hooks/useXYFlow.js";
|
|
3
3
|
import { stopPropagation } from "../../utils/xyflow.js";
|
|
4
|
-
import { useTagSpecification } from "../../context/TagStylesContext.js";
|
|
5
4
|
import { css, cx } from "@likec4/styles/css";
|
|
6
5
|
import { forwardRef, memo, useCallback, useEffect } from "react";
|
|
7
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { NodeToolbar, Position, useStore } from "@xyflow/react";
|
|
9
8
|
import { deepEqual } from "fast-equals";
|
|
10
9
|
import { hasAtLeast } from "remeda";
|
|
11
|
-
import { isTagColorSpecified } from "@likec4/core";
|
|
12
10
|
import { useDebouncedState, useHover } from "@mantine/hooks";
|
|
13
11
|
import { Box, HStack } from "@likec4/styles/jsx";
|
|
14
12
|
import { hstack } from "@likec4/styles/patterns";
|
|
@@ -18,7 +16,7 @@ var ElementTag = forwardRef(({ tag, cursor, className, style, ...props }, ref) =
|
|
|
18
16
|
return /* @__PURE__ */ jsxs(Box, {
|
|
19
17
|
ref,
|
|
20
18
|
"data-likec4-tag": tag,
|
|
21
|
-
className: cx(likec4tag(
|
|
19
|
+
className: cx(likec4tag(), className),
|
|
22
20
|
...props,
|
|
23
21
|
style: {
|
|
24
22
|
cursor,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ErrorBoundaryProps, FallbackProps } from 'react-error-boundary';
|
|
2
|
-
export declare function ErrorFallback({ error, resetErrorBoundary }: FallbackProps): import("react
|
|
3
|
-
export declare function ErrorBoundary(props: Pick<ErrorBoundaryProps, 'onReset' | 'onError' | 'children'>): import("react
|
|
2
|
+
export declare function ErrorFallback({ error, resetErrorBoundary }: FallbackProps): import("react").JSX.Element;
|
|
3
|
+
export declare function ErrorBoundary(props: Pick<ErrorBoundaryProps, 'onReset' | 'onError' | 'children'>): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { css } from "@likec4/styles/css";
|
|
3
3
|
import { IconX } from "@tabler/icons-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useRef } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button, ScrollAreaAutosize, Text, ThemeIcon } from "@mantine/core";
|
|
7
7
|
import { HStack, VStack } from "@likec4/styles/jsx";
|
|
@@ -10,10 +10,8 @@ import { ErrorBoundary } from "react-error-boundary";
|
|
|
10
10
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
11
11
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
12
12
|
const dialogRef = useRef(null);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
dialogRef.current?.showModal();
|
|
15
|
-
}, []);
|
|
16
13
|
return /* @__PURE__ */ jsx("dialog", {
|
|
14
|
+
open: true,
|
|
17
15
|
ref: dialogRef,
|
|
18
16
|
className: css({
|
|
19
17
|
margin: "0",
|
|
@@ -111,4 +109,4 @@ function ErrorBoundary$1(props) {
|
|
|
111
109
|
}
|
|
112
110
|
__name(ErrorBoundary$1, "ErrorBoundary");
|
|
113
111
|
//#endregion
|
|
114
|
-
export { ErrorBoundary$1 as ErrorBoundary };
|
|
112
|
+
export { ErrorBoundary$1 as ErrorBoundary, ErrorFallback };
|
package/dist/components/Link.js
CHANGED
|
@@ -3,7 +3,7 @@ import { GithubIcon } from "./GithubIcon.js";
|
|
|
3
3
|
import { css, cx } from "@likec4/styles/css";
|
|
4
4
|
import { IconCheck, IconCopy } from "@tabler/icons-react";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { ActionIcon, Badge, CopyButton } from "@mantine/core";
|
|
8
8
|
import { styled } from "@likec4/styles/jsx";
|
|
9
9
|
//#region src/components/Link.tsx
|
|
@@ -17,7 +17,7 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
17
17
|
radius: "sm",
|
|
18
18
|
size: "sm",
|
|
19
19
|
tt: "none",
|
|
20
|
-
leftSection:
|
|
20
|
+
leftSection: null,
|
|
21
21
|
rightSection: /* @__PURE__ */ jsx(CopyButton, {
|
|
22
22
|
value: url,
|
|
23
23
|
timeout: 1500,
|
|
@@ -52,8 +52,8 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
52
52
|
backgroundColor: {
|
|
53
53
|
base: "transparent",
|
|
54
54
|
_hover: {
|
|
55
|
-
base: "mantine.
|
|
56
|
-
_dark: "mantine.
|
|
55
|
+
base: "mantine.gray[1]",
|
|
56
|
+
_dark: "mantine.dark[5]"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}),
|
|
@@ -85,14 +85,14 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
85
85
|
_hover: "underline"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
children: [isGithub && /* @__PURE__ */ jsx(GithubIcon, {
|
|
88
|
+
children: [!value.title && isGithub && /* @__PURE__ */ jsx(GithubIcon, {
|
|
89
89
|
height: "12",
|
|
90
90
|
width: "12",
|
|
91
91
|
style: {
|
|
92
92
|
verticalAlign: "middle",
|
|
93
93
|
marginRight: "4px"
|
|
94
94
|
}
|
|
95
|
-
}), isGithub ? url.replace(GITHUB_PREFIX, "") : url]
|
|
95
|
+
}), value.title ?? (isGithub ? url.replace(GITHUB_PREFIX, "") : url)]
|
|
96
96
|
})
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ForwardRefComponent, HTMLMotionProps } from 'motion/react';
|
|
2
2
|
import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
-
import { StyleContextProvider, StyleContextConsumer } from '
|
|
4
|
-
import { NavigationPanelRecipe } from '
|
|
3
|
+
import { StyleContextProvider, StyleContextConsumer } from '../../styled-system/jsx';
|
|
4
|
+
import { NavigationPanelRecipe } from '../../styled-system/recipes';
|
|
5
5
|
export declare const NavigationPanel: {
|
|
6
6
|
Root: StyleContextProvider<ForwardRefComponent<"div", HTMLMotionProps<"div">>, NavigationPanelRecipe>;
|
|
7
7
|
Body: StyleContextConsumer<ForwardRefComponent<"div", HTMLMotionProps<"div">>>;
|
|
@@ -21,7 +21,7 @@ var LogoButton = forwardRef(({ className, ...props }, ref) => {
|
|
|
21
21
|
var NavigationPanel = {
|
|
22
22
|
Root: withProvider(m$1.div, "root", { shouldForwardProp }),
|
|
23
23
|
Body: withContext(m$1.div, "body", { shouldForwardProp }),
|
|
24
|
-
Logo: withContext(LogoButton, "logo"),
|
|
24
|
+
Logo: withContext(LogoButton, "logo", { shouldForwardProp }),
|
|
25
25
|
Label: withContext(m$1.div, "label", { shouldForwardProp }),
|
|
26
26
|
Dropdown: withContext(m$1.div, "dropdown", { shouldForwardProp })
|
|
27
27
|
};
|
|
@@ -3,4 +3,4 @@ import { PropsWithChildren } from 'react';
|
|
|
3
3
|
* PortalToContainer is used to render elements outside the LikeC4DiagramXYFlow, but inside the container.
|
|
4
4
|
* It is used internally by the library.
|
|
5
5
|
*/
|
|
6
|
-
export declare function PortalToContainer({ children }: PropsWithChildren): import("react
|
|
6
|
+
export declare function PortalToContainer({ children }: PropsWithChildren): import("react").JSX.Element;
|
|
@@ -8,15 +8,15 @@ var root = css({
|
|
|
8
8
|
border: "1px solid",
|
|
9
9
|
borderColor: {
|
|
10
10
|
base: "default.border",
|
|
11
|
-
_light: "mantine.
|
|
12
|
-
_dark: "mantine.
|
|
11
|
+
_light: "mantine.gray[4]",
|
|
12
|
+
_dark: "mantine.dark[4]",
|
|
13
13
|
_hover: "default.border"
|
|
14
14
|
},
|
|
15
15
|
cursor: "pointer",
|
|
16
16
|
background: {
|
|
17
17
|
base: "default",
|
|
18
18
|
_light: "white",
|
|
19
|
-
_dark: "mantine.
|
|
19
|
+
_dark: "mantine.dark[6]",
|
|
20
20
|
_hover: "default.hover"
|
|
21
21
|
},
|
|
22
22
|
width: "100%",
|
|
@@ -49,19 +49,19 @@ var shortcut = css({
|
|
|
49
49
|
border: "1px solid",
|
|
50
50
|
transition: "fast",
|
|
51
51
|
_light: {
|
|
52
|
-
color: "mantine.
|
|
53
|
-
borderColor: "mantine.
|
|
52
|
+
color: "mantine.gray[7]",
|
|
53
|
+
borderColor: "mantine.gray[2]"
|
|
54
54
|
},
|
|
55
55
|
_dark: {
|
|
56
|
-
color: "mantine.
|
|
57
|
-
borderColor: "mantine.
|
|
56
|
+
color: "mantine.dark[0]",
|
|
57
|
+
borderColor: "mantine.dark[7]"
|
|
58
58
|
},
|
|
59
59
|
backgroundColor: {
|
|
60
|
-
_light: "mantine.
|
|
61
|
-
_dark: "mantine.
|
|
60
|
+
_light: "mantine.gray[2]/70",
|
|
61
|
+
_dark: "mantine.dark[8]/70",
|
|
62
62
|
_groupHover: {
|
|
63
|
-
_light: "mantine.
|
|
64
|
-
_dark: "mantine.
|
|
63
|
+
_light: "mantine.gray[2]",
|
|
64
|
+
_dark: "mantine.dark[8]"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementProps, UnstyledButtonProps } from '@mantine/core';
|
|
2
|
-
interface SearchControlProps extends UnstyledButtonProps, ElementProps<'button'> {
|
|
2
|
+
interface SearchControlProps extends Omit<UnstyledButtonProps, 'className'>, ElementProps<'button'> {
|
|
3
3
|
}
|
|
4
|
-
export declare function SearchControl({ className, ...others }: SearchControlProps): import("react
|
|
4
|
+
export declare function SearchControl({ className, ...others }: SearchControlProps): import("react").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare function ErrorMessage({ children }: PropsWithChildren): import("react
|
|
2
|
+
export declare function ErrorMessage({ children }: PropsWithChildren): import("react").JSX.Element;
|
|
3
3
|
export declare function ViewNotFound({ viewId }: {
|
|
4
4
|
viewId: string;
|
|
5
|
-
}): import("react
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare function CurrentViewModelProvider({ children }: PropsWithChildren): import("react
|
|
2
|
+
export declare function CurrentViewModelProvider({ children }: PropsWithChildren): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MantineProviderProps } from '@mantine/core';
|
|
2
|
-
export declare function DefaultMantineProvider({ children, theme, ...props }: MantineProviderProps): import("react
|
|
2
|
+
export declare function DefaultMantineProvider({ children, theme, ...props }: MantineProviderProps): import("react").JSX.Element;
|
|
@@ -9,7 +9,7 @@ export type DiagramEventHandlersContext = RequiredOrNull<LikeC4DiagramEventHandl
|
|
|
9
9
|
};
|
|
10
10
|
export declare function DiagramEventHandlers({ handlers, children, }: PropsWithChildren<{
|
|
11
11
|
handlers: Required<LikeC4DiagramEventHandlers>;
|
|
12
|
-
}>): import("react
|
|
12
|
+
}>): import("react").JSX.Element;
|
|
13
13
|
export declare function useDiagramEventHandlers(): DiagramEventHandlersContext;
|
|
14
14
|
export declare function useDiagramEventHandlersRef(): DiagramEventHandlersRef;
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
type EnsureMantineProps = PropsWithChildren<{}>;
|
|
3
|
-
export declare function EnsureMantine({ children }: EnsureMantineProps): import("react
|
|
3
|
+
export declare function EnsureMantine({ children }: EnsureMantineProps): import("react").JSX.Element;
|
|
4
4
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function FramerMotionConfig({ reducedMotion, children, }: PropsWithChildren<{
|
|
3
3
|
/**
|
|
4
4
|
* If true, will respect the device prefersReducedMotion setting by switching
|
|
5
5
|
* transform animations off.
|
|
6
6
|
*/
|
|
7
|
-
reducedMotion?:
|
|
8
|
-
}>)
|
|
7
|
+
reducedMotion?: 'always' | 'never' | 'user' | undefined;
|
|
8
|
+
}>): import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMantineStyleNonce } from "@mantine/core";
|
|
4
4
|
import { LazyMotion, MotionConfig, domMax } from "motion/react";
|
|
5
5
|
//#region src/context/FramerMotionConfig.tsx
|
|
6
|
-
|
|
6
|
+
function FramerMotionConfig({ reducedMotion = "user", children }) {
|
|
7
7
|
const nonce = useMantineStyleNonce()?.();
|
|
8
8
|
return /* @__PURE__ */ jsx(LazyMotion, {
|
|
9
9
|
features: domMax,
|
|
@@ -14,6 +14,6 @@ var FramerMotionConfig = ({ reducedMotion = "user", children }) => {
|
|
|
14
14
|
children
|
|
15
15
|
})
|
|
16
16
|
});
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
//#endregion
|
|
19
19
|
export { FramerMotionConfig };
|
|
@@ -17,7 +17,7 @@ import { ElementIconRenderer } from '../LikeC4Diagram.props';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function IconRendererProvider({ value, children, }: PropsWithChildren<{
|
|
19
19
|
value: ElementIconRenderer | null;
|
|
20
|
-
}>): import("react
|
|
20
|
+
}>): import("react").JSX.Element;
|
|
21
21
|
export declare function IconRenderer({ element, className, style, }: {
|
|
22
22
|
element?: {
|
|
23
23
|
id: string;
|
|
@@ -36,4 +36,4 @@ export declare function IconOrShapeRenderer({ element, className, style, }: {
|
|
|
36
36
|
};
|
|
37
37
|
className?: string;
|
|
38
38
|
style?: CSSProperties | undefined;
|
|
39
|
-
}): import("react
|
|
39
|
+
}): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { cx } from "@likec4/styles/css";
|
|
3
3
|
import { IconBrowser, IconCylinder, IconDeviceMobile, IconFileText, IconRectangularPrism, IconReorder, IconUser } from "@tabler/icons-react";
|
|
4
|
-
import { createContext, useContext } from "react";
|
|
4
|
+
import { createContext, useContext, useMemo } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/context/IconRenderer.tsx
|
|
7
7
|
var IconRendererContext = createContext(null);
|
|
@@ -47,17 +47,28 @@ function IconRenderer({ element, className, style }) {
|
|
|
47
47
|
const RenderIcon = useContext(IconRendererContext);
|
|
48
48
|
if (!element || !element.icon || element.icon === "none") return null;
|
|
49
49
|
let icon;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
switch (true) {
|
|
51
|
+
case element.icon.startsWith("data:image/svg+xml"):
|
|
52
|
+
icon = /* @__PURE__ */ jsx(SvgDataUrlIcon, {
|
|
53
|
+
dataUrl: element.icon,
|
|
54
|
+
alt: element.title
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
case element.icon.startsWith("http://"):
|
|
58
|
+
case element.icon.startsWith("https://"):
|
|
59
|
+
case element.icon.startsWith("data:image"):
|
|
60
|
+
icon = /* @__PURE__ */ jsx("img", {
|
|
61
|
+
src: element.icon,
|
|
62
|
+
alt: element.title
|
|
63
|
+
});
|
|
64
|
+
break;
|
|
65
|
+
case !!RenderIcon:
|
|
66
|
+
icon = /* @__PURE__ */ jsx(RenderIcon, { node: element });
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
icon = null;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
61
72
|
if (!icon) return null;
|
|
62
73
|
return /* @__PURE__ */ jsx("div", {
|
|
63
74
|
className: cx(className, "likec4-element-icon"),
|
|
@@ -93,5 +104,14 @@ function IconOrShapeRenderer({ element, className, style }) {
|
|
|
93
104
|
style
|
|
94
105
|
});
|
|
95
106
|
}
|
|
107
|
+
function SvgDataUrlIcon({ dataUrl, ...props }) {
|
|
108
|
+
const svgContent = useMemo(() => decodeSvgDataUrl(dataUrl), [dataUrl]);
|
|
109
|
+
if (!svgContent) return null;
|
|
110
|
+
return /* @__PURE__ */ jsx("span", {
|
|
111
|
+
...props,
|
|
112
|
+
style: { display: "contents" },
|
|
113
|
+
dangerouslySetInnerHTML: { __html: svgContent }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
96
116
|
//#endregion
|
|
97
117
|
export { IconOrShapeRenderer, IconRenderer, IconRendererProvider };
|
|
@@ -6,7 +6,7 @@ type UnknownLayouted = t.aux.UnknownLayouted;
|
|
|
6
6
|
export declare const LikeC4ModelContextProvider: Provider<LikeC4Model<any> | null>;
|
|
7
7
|
export type CurrentViewModel = LikeC4ViewModel<UnknownLayouted, LayoutedView<UnknownLayouted>>;
|
|
8
8
|
export declare const CurrentViewModelContext: Provider<CurrentViewModel | null>;
|
|
9
|
-
export declare function EnsureCurrentViewModel({ children }: PropsWithChildren): import("react
|
|
9
|
+
export declare function EnsureCurrentViewModel({ children }: PropsWithChildren): import("react").JSX.Element | null;
|
|
10
10
|
/**
|
|
11
11
|
* @returns The LikeC4Model from context, or null if no LikeC4ModelProvider is found.
|
|
12
12
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TagSpecification } from '@likec4/core';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
export declare function
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export declare function generateColorVars(spec: TagSpecification): string;
|
|
4
|
+
export declare function TagStylesProvider({ children, id }: PropsWithChildren<{
|
|
5
|
+
id: string;
|
|
6
|
+
}>): import("react").JSX.Element;
|
|
6
7
|
export declare function useTagSpecifications(): Record<string, TagSpecification>;
|
|
7
8
|
export declare function useTagSpecification(tag: string): TagSpecification;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useLikeC4Specification } from "../hooks/useLikeC4Model.js";
|
|
3
|
-
import { createContext, memo
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, memo } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { entries, flatMap, isEmpty, join, pipe } from "remeda";
|
|
6
6
|
import { isTagColorSpecified } from "@likec4/core";
|
|
7
7
|
import { useMantineStyleNonce } from "@mantine/core";
|
|
8
|
-
import { DefaultTagColors } from "@likec4/core/styles";
|
|
8
|
+
import { DefaultTagColors, getContrastedColorsAPCA, isValidColor } from "@likec4/core/styles";
|
|
9
9
|
//#region src/context/TagStylesContext.tsx
|
|
10
|
-
var TagStylesContext = createContext({});
|
|
11
10
|
var radixColors = DefaultTagColors;
|
|
12
|
-
|
|
11
|
+
function generateColorVars(spec) {
|
|
13
12
|
const color = spec.color;
|
|
14
|
-
if (isTagColorSpecified(spec)) return `
|
|
13
|
+
if (isTagColorSpecified(spec) && isValidColor(color)) return `
|
|
15
14
|
--colors-likec4-tag-bg: ${color};
|
|
16
15
|
--colors-likec4-tag-bg-hover: color-mix(in oklab, ${color}, var(--colors-likec4-mix-color) 20%);
|
|
16
|
+
--colors-likec4-tag-text: ${getContrastedColorsAPCA(color).hiContrast};
|
|
17
17
|
`;
|
|
18
18
|
if (!radixColors.includes(color)) return "";
|
|
19
|
-
let textcolor =
|
|
19
|
+
let textcolor = `var(--colors-${color}-12)`;
|
|
20
20
|
if ([
|
|
21
21
|
"mint",
|
|
22
22
|
"grass",
|
|
23
23
|
"lime",
|
|
24
24
|
"yellow",
|
|
25
25
|
"amber"
|
|
26
|
-
].includes(color)) textcolor = "
|
|
26
|
+
].includes(color)) textcolor = "rgba(0 0 0 / 0.85)";
|
|
27
27
|
return `
|
|
28
28
|
--colors-likec4-tag-border: var(--colors-${color}-8);
|
|
29
29
|
--colors-likec4-tag-bg: var(--colors-${color}-9);
|
|
30
30
|
--colors-likec4-tag-bg-hover: var(--colors-${color}-10);
|
|
31
|
-
--colors-likec4-tag-text:
|
|
31
|
+
--colors-likec4-tag-text: ${textcolor};
|
|
32
32
|
`;
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
|
+
var TagStylesContext = createContext({});
|
|
34
35
|
function generateStylesheet(tags, rootSelector) {
|
|
35
36
|
if (!tags || isEmpty(tags)) return "";
|
|
36
37
|
return pipe(entries(tags), flatMap(([tag, spec]) => [
|
|
@@ -39,17 +40,17 @@ function generateStylesheet(tags, rootSelector) {
|
|
|
39
40
|
"}"
|
|
40
41
|
]), join("\n"));
|
|
41
42
|
}
|
|
42
|
-
function TagStylesProvider({ children,
|
|
43
|
+
function TagStylesProvider({ children, id }) {
|
|
43
44
|
const tags = useLikeC4Specification().tags;
|
|
44
45
|
const nonce = useMantineStyleNonce()?.();
|
|
45
|
-
const stylesheet = generateStylesheet(tags,
|
|
46
|
-
return /* @__PURE__ */ jsxs(
|
|
46
|
+
const stylesheet = generateStylesheet(tags, `#${id}`);
|
|
47
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [stylesheet !== "" && /* @__PURE__ */ jsx(TagStylesheet, {
|
|
48
|
+
nonce,
|
|
49
|
+
stylesheet
|
|
50
|
+
}), /* @__PURE__ */ jsx(TagStylesContext.Provider, {
|
|
47
51
|
value: tags,
|
|
48
|
-
children
|
|
49
|
-
|
|
50
|
-
stylesheet
|
|
51
|
-
}), children]
|
|
52
|
-
});
|
|
52
|
+
children
|
|
53
|
+
})] });
|
|
53
54
|
}
|
|
54
55
|
var TagStylesheet = memo(({ stylesheet, nonce }) => {
|
|
55
56
|
return /* @__PURE__ */ jsx("style", {
|
|
@@ -59,8 +60,5 @@ var TagStylesheet = memo(({ stylesheet, nonce }) => {
|
|
|
59
60
|
nonce
|
|
60
61
|
});
|
|
61
62
|
});
|
|
62
|
-
function useTagSpecification(tag) {
|
|
63
|
-
return useContext(TagStylesContext)[tag] ?? { color: "tomato" };
|
|
64
|
-
}
|
|
65
63
|
//#endregion
|
|
66
|
-
export { TagStylesProvider,
|
|
64
|
+
export { TagStylesProvider, generateColorVars };
|
package/dist/custom/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export type { OverlayProps } from '../overlays/overlay/Overlay';
|
|
|
13
13
|
export { PortalToContainer } from '../components/PortalToContainer';
|
|
14
14
|
export { FramerMotionConfig } from '../context/FramerMotionConfig';
|
|
15
15
|
export { NavigationPanel } from '../components/NavigationPanel';
|
|
16
|
+
export { ErrorBoundary, ErrorFallback } from '../components/ErrorFallback';
|
package/dist/custom/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useDiagramContext, useOnDiagramEvent } from "../hooks/useDiagram.js";
|
|
|
9
9
|
import { useCurrentView, useCurrentViewId } from "../hooks/useCurrentView.js";
|
|
10
10
|
import { useOptionalCurrentViewModel, useOptionalLikeC4Model } from "../context/LikeC4ModelContext.js";
|
|
11
11
|
import { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from "../hooks/useLikeC4Model.js";
|
|
12
|
+
import { ErrorBoundary, ErrorFallback } from "../components/ErrorFallback.js";
|
|
12
13
|
import { useCurrentViewModel } from "../hooks/useCurrentViewModel.js";
|
|
13
14
|
import { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from "../hooks/useLikeC4Project.js";
|
|
14
15
|
import { useLikeC4Styles } from "../hooks/useLikeC4Styles.js";
|
|
@@ -35,6 +36,6 @@ import { CompoundDeploymentToolbar, CompoundElementToolbar } from "../likec4diag
|
|
|
35
36
|
import { DeploymentElementToolbar, ElementToolbar } from "../likec4diagram/custom/nodes/toolbar/ElementToolbar.js";
|
|
36
37
|
import { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode } from "../likec4diagram/custom/nodes/nodes.js";
|
|
37
38
|
import { SequenceActorNode, SequenceParallelArea } from "../likec4diagram/custom/nodes/SequenceActorNode.js";
|
|
38
|
-
import { NavigationPanel } from "../components/NavigationPanel.js";
|
|
39
39
|
import { compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, sequenceActorNode, viewGroupNode } from "./customNodes.js";
|
|
40
|
-
|
|
40
|
+
import { NavigationPanel } from "../components/NavigationPanel.js";
|
|
41
|
+
export { Base, CompoundActionButton, CompoundActions, CompoundDeploymentNode, CompoundDeploymentToolbar, CompoundDetailsButton, CompoundDetailsButtonWithHandler, CompoundElementNode, CompoundElementToolbar, CompoundNodeContainer, CompoundTitle, DefaultHandles, DeploymentElementActions, DeploymentElementToolbar, DeploymentNode, ElementActionButtons, ElementActions, ElementData, ElementDetailsButton, ElementDetailsButtonWithHandler, ElementNode, ElementNodeContainer, ElementShape, ElementTag, ElementTags, ElementToolbar, ErrorBoundary, ErrorFallback, FramerMotionConfig, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, Markdown, NavigationPanel, Overlay, PortalToContainer, SequenceActorNode, SequenceParallelArea, Toolbar, ViewGroupNode, compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, memoEdge, memoNode, sequenceActorNode, useCurrentView, useCurrentViewId, useCurrentViewModel, useDiagram, useDiagramActorRef, useDiagramContext, useDiagramEventHandlers, useEnabledFeatures, useHasProjects, useLikeC4Model, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, useLikeC4Specification, useLikeC4Styles, useLikeC4ViewModel, useOnDiagramEvent, useOptionalCurrentViewModel, useOptionalLikeC4Model, useSetState, useUpdateEffect, viewGroupNode };
|