@likec4/diagram 1.56.0 → 1.58.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 +3 -1
- package/dist/LikeC4View.js +47 -55
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -1
- package/dist/adhoc-editor/ElementsTree.d.ts +1 -1
- package/dist/adhoc-editor/ElementsTree.js +2 -6
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
- package/dist/adhoc-editor/components/Tree.d.ts +5 -5
- package/dist/adhoc-editor/state/ActorProvider.d.ts +1 -1
- package/dist/adhoc-editor/state/panel.d.ts +1 -1
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
- package/dist/base/BaseXYFlow.d.ts +1 -1
- 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 +1 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundNodeContainer.d.ts +1 -1
- package/dist/base-primitives/compound/CompoundTitle.d.ts +1 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- 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 +1 -1
- package/dist/base-primitives/element/ElementData.d.ts +2 -2
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +1 -1
- package/dist/base-primitives/element/ElementShape.d.ts +1 -1
- 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/NavigationPanel.d.ts +2 -2
- package/dist/components/PortalToContainer.d.ts +1 -1
- package/dist/components/RootContainer.d.ts +1 -1
- package/dist/components/RootContainer.js +19 -18
- 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/DiagramFeatures.d.ts +1 -1
- package/dist/context/DiagramFeatures.js +5 -0
- 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/RootContainerContext.d.ts +10 -17
- package/dist/context/RootContainerContext.js +1 -13
- package/dist/context/ShadowRootContext.d.ts +3 -0
- package/dist/context/ShadowRootContext.js +5 -0
- package/dist/context/TagStylesContext.d.ts +2 -1
- package/dist/context/TagStylesContext.js +5 -7
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +1 -2
- package/dist/editor/LikeC4EditorCallbacks.d.ts +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +2 -2
- package/dist/editor/actor/actions.d.ts +174 -0
- package/dist/editor/actor/actions.js +188 -0
- package/dist/editor/{hotkeyActor.d.ts → actor/hotkey.d.ts} +2 -2
- package/dist/editor/{hotkeyActor.js → actor/hotkey.js} +11 -4
- package/dist/editor/{editorActor.states.d.ts → actor/machine.d.ts} +5 -3
- package/dist/editor/actor/machine.js +23 -0
- package/dist/editor/actor/setup.d.ts +55 -0
- package/dist/editor/{editorActor.setup.js → actor/setup.js} +14 -10
- package/dist/editor/actor/state.editor.d.ts +147 -0
- package/dist/editor/actor/state.editor.js +56 -0
- package/dist/editor/actor/state.sync-queue.d.ts +612 -0
- package/dist/editor/actor/state.sync-queue.js +272 -0
- package/dist/editor/actor/types.d.ts +64 -0
- package/dist/editor/actor/types.js +5 -0
- package/dist/editor/applyChangesToManualLayout.js +1 -1
- package/dist/editor/index.d.ts +2 -1
- package/dist/editor/useEditorActorLogic.d.ts +8 -2
- package/dist/editor/useEditorActorLogic.js +39 -7
- package/dist/hooks/useDiagram.js +6 -1
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useEditorActor.d.ts +9 -0
- package/dist/hooks/useEditorActor.js +27 -0
- package/dist/hooks/useLikeC4ElementsTree.d.ts +3 -2
- package/dist/hooks/useLikeC4ElementsTree.js +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/likec4diagram/DiagramUI.d.ts +1 -1
- package/dist/likec4diagram/DiagramUI.js +8 -4
- package/dist/likec4diagram/DiagramXYFlow.js +26 -14
- package/dist/likec4diagram/custom/edges/EdgeDrifts.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +127 -14
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.d.ts +1 -1
- package/dist/likec4diagram/custom/edges/edges.css.d.ts +1 -0
- package/dist/likec4diagram/custom/edges/edges.css.js +5 -1
- package/dist/likec4diagram/custom/nodes/CompoundActions.d.ts +1 -1
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -2
- 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/SequenceActorNode.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/nodes.d.ts +7 -7
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.d.ts +3 -3
- 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/relationship-popover/RelationshipPopover.d.ts +1 -1
- package/dist/likec4diagram/relationship-popover/components.d.ts +2 -2
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +1 -1
- package/dist/likec4diagram/state/aligners.js +3 -0
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +1 -0
- package/dist/likec4diagram/state/diagram-api.d.ts +16 -0
- package/dist/likec4diagram/state/diagram-api.js +13 -7
- package/dist/likec4diagram/state/machine.actions.js +10 -10
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.setup.js +1 -1
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +1 -1
- package/dist/likec4diagram/types.d.ts +2 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.d.ts +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/useLayoutConstraints.js +2 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +4 -2
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +1 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelControls.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.d.ts +1 -1
- package/dist/navigationpanel/NavigationPanelDropdown.js +2 -2
- package/dist/navigationpanel/_common.d.ts +2 -2
- 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/LayoutTypeSwitcher.d.ts +1 -1
- package/dist/navigationpanel/controls/DetailsControls.d.ts +1 -1
- 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/controls/ToggleReadonly.js +4 -2
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.d.ts +4 -0
- package/dist/navigationpanel/editorpanel/ApplySemanticLayout.js +36 -0
- 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/EditorPanel.js +45 -33
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.d.ts +1 -1
- package/dist/navigationpanel/editorpanel/ToggleReadonly.d.ts +1 -1
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +62 -62
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.d.ts +1 -1
- package/dist/overlays/Overlays.d.ts +1 -1
- package/dist/overlays/element-details/ElementDetails.d.ts +1 -1
- 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/TabPanelRelationships.d.ts +1 -1
- package/dist/overlays/element-details/TabPanelStructure.d.ts +2 -2
- package/dist/overlays/overlay/Overlay.d.ts +16 -0
- package/dist/overlays/overlay/Overlay.js +50 -52
- package/dist/overlays/overlaysActor.js +28 -27
- 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 -5
- package/dist/overlays/relationship-details/custom/nodeTypes.js +25 -24
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.d.ts +1 -1
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- 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/projects-overview/ProjectsOverview.d.ts +1 -1
- 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 +6 -3
- package/dist/search/Search.js +60 -71
- package/dist/search/XStateSearchAdapter.d.ts +1 -1
- package/dist/search/components/ElementsColumn.d.ts +1 -1
- package/dist/search/components/ElementsColumn.js +12 -8
- 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/_shared.css.d.ts +1 -1
- package/dist/search/searchActor.js +30 -26
- package/dist/shadowroot/ShadowRoot.d.ts +6 -6
- package/dist/shadowroot/ShadowRoot.js +68 -23
- package/dist/shadowroot/index.d.ts +1 -0
- package/dist/shadowroot/styles.d.ts +13 -0
- package/dist/shadowroot/styles.js +60 -0
- package/dist/styles2.js +1 -1
- package/package.json +33 -40
- package/panda.buildinfo.json +19 -22
- package/src/styles-font.css +114 -0
- package/src/styles-min.css +2 -0
- package/src/styles-xyflow.css +1 -0
- package/src/styles.css +3 -0
- package/styles-min.css +1 -1
- package/styles-xyflow.css +1 -1
- package/styles.css +1 -1
- package/dist/bundle/index.d.ts +0 -1
- package/dist/editor/editorActor.actions.d.ts +0 -153
- package/dist/editor/editorActor.actions.js +0 -133
- package/dist/editor/editorActor.setup.d.ts +0 -84
- package/dist/editor/editorActor.states.js +0 -219
- package/dist/hooks/useOverlaysActor.js +0 -11
- package/dist/hooks/useSearchActor.js +0 -11
- package/dist/shadowroot/styles.css.d.ts +0 -4
- package/dist/shadowroot/styles.css.js +0 -62
|
@@ -207,14 +207,15 @@ var emitEdgeClick = () => machine.emit(({ context, event }) => {
|
|
|
207
207
|
};
|
|
208
208
|
});
|
|
209
209
|
var triggerChange = (viewChange) => machine.enqueueActions(({ event, enqueue }) => {
|
|
210
|
-
let change
|
|
211
|
-
if (
|
|
210
|
+
let change;
|
|
211
|
+
if (viewChange) change = { ...viewChange };
|
|
212
|
+
else {
|
|
212
213
|
assertEvent(event, "trigger.change");
|
|
213
214
|
change = event.change;
|
|
214
215
|
}
|
|
215
216
|
enqueue.assign({ viewportChangedManually: true });
|
|
216
217
|
enqueue.sendTo(typedSystem.editorActor, {
|
|
217
|
-
type: "change",
|
|
218
|
+
type: "change.view",
|
|
218
219
|
change
|
|
219
220
|
});
|
|
220
221
|
});
|
|
@@ -388,14 +389,13 @@ var ensureEditorActor = () => machine.enqueueActions(({ enqueue, context, system
|
|
|
388
389
|
});
|
|
389
390
|
});
|
|
390
391
|
var startEditing = (subject = "node") => machine.sendTo(typedSystem.editorActor, {
|
|
391
|
-
type: "edit.start",
|
|
392
|
+
type: "edit.move.start",
|
|
392
393
|
subject
|
|
393
394
|
});
|
|
394
|
-
var sendSynced = () =>
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
});
|
|
395
|
+
var sendSynced = () => {
|
|
396
|
+
return machine.sendTo(typedSystem.editorActor, { type: "view.synched" });
|
|
397
|
+
};
|
|
398
|
+
var stopEditing = (wasChanged = false) => machine.sendTo(typedSystem.editorActor, { type: wasChanged ? "edit.move.end" : "edit.move.cancel" });
|
|
399
399
|
var cancelEditing = () => machine.sendTo(typedSystem.editorActor, { type: "cancel" });
|
|
400
400
|
var hasModelFqn = (node) => "modelFqn" in node.data && isTruthy(node.data.modelFqn);
|
|
401
401
|
var openElementDetails = (params) => machine.enqueueActions(({ context, event, enqueue }) => {
|
|
@@ -591,7 +591,7 @@ var stopHotKeyActor = () => machine.stopChild("hotkey");
|
|
|
591
591
|
*/
|
|
592
592
|
var AUTO_UNFOCUS_DELAY = 3e3;
|
|
593
593
|
var startAutoUnfocusTimer = () => machine.enqueueActions(({ context, enqueue }) => {
|
|
594
|
-
if (context.autoUnfocusTimer &&
|
|
594
|
+
if (context.autoUnfocusTimer && true) enqueue.raise({ type: "focus.autoUnfocus" }, {
|
|
595
595
|
delay: AUTO_UNFOCUS_DELAY,
|
|
596
596
|
id: "autoUnfocusTimer"
|
|
597
597
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActorRef, MachineSnapshot, StateMachine } from 'xstate';
|
|
2
|
-
import { EditorActorRef } from '../../editor/
|
|
2
|
+
import { EditorActorRef } from '../../editor/actor/machine';
|
|
3
3
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
4
4
|
import { SearchActorRef } from '../../search/searchActor';
|
|
5
5
|
import { Context as DiagramContext, EmittedEvents as DiagramEmittedEvents, Events as DiagramEvents, Input } from './machine.setup';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { editorActorLogic } from "../../editor/
|
|
2
|
+
import { editorActorLogic } from "../../editor/actor/machine.js";
|
|
3
3
|
import { overlaysActorLogic } from "../../overlays/overlaysActor.js";
|
|
4
4
|
import { searchActorLogic } from "../../search/searchActor.js";
|
|
5
5
|
import { hotkeyActorLogic } from "./hotkeyActor.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ActorSystem } from 'xstate';
|
|
2
|
-
import { EditorActorRef } from '../../editor/
|
|
2
|
+
import { EditorActorRef } from '../../editor/actor/machine';
|
|
3
3
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
4
4
|
import { SearchActorRef } from '../../search/searchActor';
|
|
5
5
|
import { DiagramMachineRef } from './machine';
|
|
@@ -2,7 +2,7 @@ import { BBox } from '@likec4/core/geometry';
|
|
|
2
2
|
import { DeploymentFqn, DiagramEdge, DiagramNode, DiagramView, Fqn } from '@likec4/core/types';
|
|
3
3
|
import { Viewport } from '@xyflow/system';
|
|
4
4
|
import { ActorSystem } from 'xstate';
|
|
5
|
-
import { EditorActorRef } from '../../editor/
|
|
5
|
+
import { EditorActorRef } from '../../editor/actor/machine';
|
|
6
6
|
import { OverlaysActorRef } from '../../overlays/overlaysActor';
|
|
7
7
|
import { SearchActorRef } from '../../search/searchActor';
|
|
8
8
|
import { Types } from '../types';
|
|
@@ -113,12 +113,14 @@ export declare namespace Types {
|
|
|
113
113
|
type RelationshipEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'labelBBox' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath' | 'drifts'>> & {
|
|
114
114
|
notes: MarkdownOrString | null;
|
|
115
115
|
labelXY: XYPosition | null;
|
|
116
|
+
isLabelCustomized?: boolean | undefined;
|
|
116
117
|
controlPoints: XYPosition[] | undefined | null;
|
|
117
118
|
}>;
|
|
118
119
|
type SequenceStepEdgeData = Simplify<BaseEdgeData & NonOptional<Pick<DiagramEdge, 'id' | 'label' | 'technology' | 'points' | 'dir' | 'color' | 'line' | 'head' | 'tail' | 'navigateTo' | 'astPath' | 'drifts'>> & {
|
|
119
120
|
notes: MarkdownOrString | null;
|
|
120
121
|
labelXY: XYPosition | null;
|
|
121
122
|
labelBBox: BBox;
|
|
123
|
+
isLabelCustomized?: boolean | undefined;
|
|
122
124
|
controlPoints: XYPosition[] | undefined | null;
|
|
123
125
|
}>;
|
|
124
126
|
type RelationshipEdge = BaseEdge<RelationshipEdgeData, 'relationship'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const LayoutDriftFrame: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const LayoutDriftFrame: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const NotationPanel: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const NotationPanel: MemoExoticComponent<() => import("react").JSX.Element | null>;
|
|
@@ -85,6 +85,7 @@ var Rect = class {
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
var CompoundRect = class extends Rect {
|
|
88
|
+
parent;
|
|
88
89
|
children = [];
|
|
89
90
|
constructor(xynode, parent = null) {
|
|
90
91
|
super(xynode, parent);
|
|
@@ -92,6 +93,7 @@ var CompoundRect = class extends Rect {
|
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
95
|
var Leaf = class extends Rect {
|
|
96
|
+
parent;
|
|
95
97
|
constructor(xynode, parent = null) {
|
|
96
98
|
super(xynode, parent);
|
|
97
99
|
this.parent = parent;
|
|
@@ -17,6 +17,7 @@ function diagramToXY(opts) {
|
|
|
17
17
|
const xyedges = [];
|
|
18
18
|
const nodeLookup = /* @__PURE__ */ new Map();
|
|
19
19
|
const viewLayoutDir = view.autoLayout?.direction ?? "TB";
|
|
20
|
+
const deletable = view._type !== "dynamic";
|
|
20
21
|
const queue = Queue.from(view.nodes.reduce((acc, node) => {
|
|
21
22
|
nodeLookup.set(node.id, node);
|
|
22
23
|
if (!node.parent) acc.push({
|
|
@@ -56,7 +57,7 @@ function diagramToXY(opts) {
|
|
|
56
57
|
}
|
|
57
58
|
const base = {
|
|
58
59
|
id: ns + node.id,
|
|
59
|
-
deletable
|
|
60
|
+
deletable,
|
|
60
61
|
position,
|
|
61
62
|
zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
|
|
62
63
|
style: {
|
|
@@ -188,7 +189,7 @@ function diagramToXY(opts) {
|
|
|
188
189
|
target: ns + target,
|
|
189
190
|
zIndex: ZIndexes.Edge,
|
|
190
191
|
hidden: !visiblePredicate(edge),
|
|
191
|
-
deletable
|
|
192
|
+
deletable,
|
|
192
193
|
data: {
|
|
193
194
|
id: edge.id,
|
|
194
195
|
label: edge.label,
|
|
@@ -197,6 +198,7 @@ function diagramToXY(opts) {
|
|
|
197
198
|
navigateTo: edge.navigateTo,
|
|
198
199
|
controlPoints: edge.controlPoints ?? null,
|
|
199
200
|
labelBBox: edge.labelBBox ?? null,
|
|
201
|
+
isLabelCustomized: edge.isLabelCustomized ?? false,
|
|
200
202
|
labelXY: null,
|
|
201
203
|
points: edge.points,
|
|
202
204
|
color: edge.color ?? "gray",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const NavigationPanel: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const NavigationPanel: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const NavigationPanelControls: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const NavigationPanelControls: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const NavigationPanelDropdown: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const NavigationPanelDropdown: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -12,7 +12,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
import { useMountEffect } from "@react-hookz/web";
|
|
13
13
|
import { deepEqual, shallowEqual } from "fast-equals";
|
|
14
14
|
import { isArray, isEmpty, pipe, sort } from "remeda";
|
|
15
|
-
import { Breadcrumbs, Button, Divider, Highlight, Input, PopoverDropdown, ScrollAreaAutosize, UnstyledButton, createScopedKeydownHandler
|
|
15
|
+
import { Breadcrumbs, Button, Divider, Highlight, Input, PopoverDropdown, ScrollAreaAutosize, UnstyledButton, createScopedKeydownHandler } from "@mantine/core";
|
|
16
16
|
import { compareNaturalHierarchically, ifilter, ifirst, nonexhaustive, toArray } from "@likec4/core/utils";
|
|
17
17
|
import { useSelector } from "@xstate/react";
|
|
18
18
|
import { useThrottledCallback, useUncontrolled } from "@mantine/hooks";
|
|
@@ -342,7 +342,7 @@ function SearchInput(props) {
|
|
|
342
342
|
size: "xs",
|
|
343
343
|
placeholder: "Search by title or id",
|
|
344
344
|
variant: "unstyled",
|
|
345
|
-
height:
|
|
345
|
+
height: 26,
|
|
346
346
|
value: _value,
|
|
347
347
|
onKeyDown: scopedKeydownHandler,
|
|
348
348
|
onChange: (e) => handleChange(e.currentTarget.value),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { NavigationPanelActionIconVariant } from '
|
|
1
|
+
import { NavigationPanelActionIconVariant } from '../../styled-system/recipes';
|
|
2
2
|
import { ActionIconProps, TooltipProps, PlaceholderPolymorphicProps, BreadcrumbsProps } from '@mantine/core';
|
|
3
3
|
import { HTMLMotionProps } from 'motion/react';
|
|
4
4
|
import { NamedExoticComponent, RefAttributes, ForwardRefExoticComponent } from 'react';
|
|
5
5
|
export declare const Tooltip: NamedExoticComponent< TooltipProps & RefAttributes<HTMLDivElement> & PlaceholderPolymorphicProps>;
|
|
6
|
-
export declare const BreadcrumbsSeparator: () => import("react
|
|
6
|
+
export declare const BreadcrumbsSeparator: () => import("react").JSX.Element;
|
|
7
7
|
export declare const Breadcrumbs: NamedExoticComponent< BreadcrumbsProps & RefAttributes<HTMLDivElement> & PlaceholderPolymorphicProps>;
|
|
8
8
|
export type PanelActionIconProps = Partial<NavigationPanelActionIconVariant> & Omit<ActionIconProps, keyof NavigationPanelActionIconVariant> & Omit<HTMLMotionProps<'button'>, keyof NavigationPanelActionIconVariant>;
|
|
9
9
|
export declare const PanelActionIcon: ForwardRefExoticComponent<Omit<PanelActionIconProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const ComparePanel: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const ComparePanel: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function ComparePanelControls(): import("react
|
|
1
|
+
export declare function ComparePanelControls(): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function DriftsSummary(): import("react
|
|
1
|
+
export declare function DriftsSummary(): import("react").JSX.Element | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PopoverProps } from '@mantine/core';
|
|
2
|
-
export declare const DetailsControls: (props: PopoverProps) => import("react
|
|
2
|
+
export declare const DetailsControls: (props: PopoverProps) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const LayoutWarning: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const LayoutWarning: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LogoButton: () => import("react
|
|
1
|
+
export declare const LogoButton: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NavigationButtons: () => import("react
|
|
1
|
+
export declare const NavigationButtons: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OpenSource: () => import("react
|
|
1
|
+
export declare const OpenSource: () => import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function SearchControl(): import("react
|
|
1
|
+
export declare function SearchControl(): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ToggleReadonly: () => import("react
|
|
1
|
+
export declare const ToggleReadonly: () => import("react").JSX.Element;
|
|
@@ -14,10 +14,12 @@ import * as m$1 from "motion/react-m";
|
|
|
14
14
|
var selector = (ctx) => {
|
|
15
15
|
const comparingLatest = deriveToggledFeatures(ctx).enableCompareWithLatest && !!ctx.view.drifts && ctx.view._layout === "auto";
|
|
16
16
|
const noActiveWalkthrough = !isTruthy(ctx.activeWalkthrough);
|
|
17
|
+
const hasEditor = ctx.features.enableEditor;
|
|
18
|
+
const isReadOnly = ctx.toggledFeatures.enableReadOnly ?? false;
|
|
17
19
|
return {
|
|
18
|
-
visible:
|
|
20
|
+
visible: hasEditor && noActiveWalkthrough,
|
|
19
21
|
disabled: comparingLatest,
|
|
20
|
-
isReadOnly
|
|
22
|
+
isReadOnly
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
25
|
var ToggleReadonly = () => {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { useDiagram } from "../../hooks/safeContext.js";
|
|
3
|
+
import { PanelActionIcon } from "../_common.js";
|
|
4
|
+
import { useEditorActorStateHasTag } from "../../hooks/useEditorActor.js";
|
|
5
|
+
import { Tooltip } from "./_common.js";
|
|
6
|
+
import { IconSparkles } from "@tabler/icons-react";
|
|
7
|
+
import { memo } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/navigationpanel/editorpanel/ApplySemanticLayout.tsx
|
|
10
|
+
var ApplySemanticLayout = memo(({ visible = true }) => {
|
|
11
|
+
const diagram = useDiagram();
|
|
12
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
13
|
+
label: "Semantic Layout with AI",
|
|
14
|
+
children: /* @__PURE__ */ jsx(PanelActionIcon, {
|
|
15
|
+
loading: useEditorActorStateHasTag("ai-semantic-layout"),
|
|
16
|
+
initial: { display: visible ? "block" : "none" },
|
|
17
|
+
animate: {
|
|
18
|
+
display: visible ? "block" : "none",
|
|
19
|
+
opacity: visible ? 1 : .2,
|
|
20
|
+
x: visible ? 0 : -5,
|
|
21
|
+
y: visible ? 0 : -8
|
|
22
|
+
},
|
|
23
|
+
onClick: (e) => {
|
|
24
|
+
e.stopPropagation();
|
|
25
|
+
diagram.editorActor().send({ type: "change.semantic-layout" });
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ jsx(IconSparkles, {
|
|
28
|
+
size: 14,
|
|
29
|
+
stroke: 2
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
ApplySemanticLayout.displayName = "ApplySemanticLayout";
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ApplySemanticLayout };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CenterCamera: () => import("react
|
|
1
|
+
export declare const CenterCamera: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ChangeAutoLayoutButton: () => import("react
|
|
1
|
+
export declare const ChangeAutoLayoutButton: () => import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function EditorPanel(): import("react
|
|
1
|
+
export declare function EditorPanel(): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useEnabledFeatures } from "../../context/DiagramFeatures.js";
|
|
3
|
+
import { ApplySemanticLayout } from "./ApplySemanticLayout.js";
|
|
3
4
|
import { CenterCamera } from "./CenterCamera.js";
|
|
4
5
|
import { ChangeAutoLayoutButton } from "./ChangeAutoLayoutButton.js";
|
|
5
6
|
import { ManualLayoutToolsButton } from "./ManualLayoutToolsButton.js";
|
|
@@ -10,41 +11,52 @@ import { AnimatePresence } from "motion/react";
|
|
|
10
11
|
import { vstack } from "@likec4/styles/patterns";
|
|
11
12
|
import * as m$1 from "motion/react-m";
|
|
12
13
|
//#region src/navigationpanel/editorpanel/EditorPanel.tsx
|
|
14
|
+
var variants = {
|
|
15
|
+
hidden: {
|
|
16
|
+
opacity: 0,
|
|
17
|
+
translateX: -20
|
|
18
|
+
},
|
|
19
|
+
visible: {
|
|
20
|
+
opacity: 1,
|
|
21
|
+
translateX: 0
|
|
22
|
+
},
|
|
23
|
+
exit: {
|
|
24
|
+
opacity: 0,
|
|
25
|
+
translateX: -20
|
|
26
|
+
}
|
|
27
|
+
};
|
|
13
28
|
function EditorPanel() {
|
|
14
|
-
const { enableReadOnly } = useEnabledFeatures();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ jsx(CenterCamera, {}),
|
|
44
|
-
/* @__PURE__ */ jsx(ToggleReadonly, {})
|
|
45
|
-
]
|
|
29
|
+
const { enableReadOnly, enableCompareWithLatest, enableAISemanticLayout } = useEnabledFeatures();
|
|
30
|
+
const showAiSemanticLayoutButton = !enableCompareWithLatest && !enableReadOnly && enableAISemanticLayout;
|
|
31
|
+
return /* @__PURE__ */ jsx(AnimatePresence, {
|
|
32
|
+
propagate: true,
|
|
33
|
+
children: !enableReadOnly && /* @__PURE__ */ jsx(m$1.div, {
|
|
34
|
+
layout: "position",
|
|
35
|
+
className: vstack({
|
|
36
|
+
gap: "xs",
|
|
37
|
+
layerStyle: "likec4.panel",
|
|
38
|
+
position: "relative",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
padding: "xxs",
|
|
41
|
+
pointerEvents: "all"
|
|
42
|
+
}),
|
|
43
|
+
initial: "hidden",
|
|
44
|
+
animate: "visible",
|
|
45
|
+
exit: "exit",
|
|
46
|
+
variants,
|
|
47
|
+
children: /* @__PURE__ */ jsxs(TooltipGroup, {
|
|
48
|
+
openDelay: 600,
|
|
49
|
+
closeDelay: 120,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(ChangeAutoLayoutButton, {}),
|
|
52
|
+
/* @__PURE__ */ jsx(ManualLayoutToolsButton, {}),
|
|
53
|
+
/* @__PURE__ */ jsx(CenterCamera, {}),
|
|
54
|
+
/* @__PURE__ */ jsx(ToggleReadonly, {}),
|
|
55
|
+
/* @__PURE__ */ jsx(ApplySemanticLayout, { visible: showAiSemanticLayoutButton })
|
|
56
|
+
]
|
|
57
|
+
})
|
|
46
58
|
})
|
|
47
|
-
})
|
|
59
|
+
});
|
|
48
60
|
}
|
|
49
61
|
//#endregion
|
|
50
62
|
export { EditorPanel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MemoExoticComponent } from 'react';
|
|
2
|
-
export declare const ManualLayoutToolsButton: MemoExoticComponent<() => import("react
|
|
2
|
+
export declare const ManualLayoutToolsButton: MemoExoticComponent<() => import("react").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ToggleReadonly: () => import("react
|
|
1
|
+
export declare const ToggleReadonly: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function ActiveWalkthroughControls(): import("react
|
|
1
|
+
export declare function ActiveWalkthroughControls(): import("react").JSX.Element;
|