@likec4/diagram 1.36.1 → 1.38.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.
Files changed (173) hide show
  1. package/bundle/{chunk-DHvr-RGh.js → chunk-BZV0K82k.js} +870 -900
  2. package/bundle/custom.js +64 -56
  3. package/bundle/index.js +3565 -3327
  4. package/dist/LikeC4Diagram.props.d.ts +5 -5
  5. package/dist/LikeC4Styles.js +17 -15
  6. package/dist/StaticLikeC4Diagram.d.ts +1 -1
  7. package/dist/StaticLikeC4Diagram.js +3 -0
  8. package/dist/base/BaseXYFlow.d.ts +1 -1
  9. package/dist/base/BaseXYFlow.js +25 -27
  10. package/dist/base/const.d.ts +4 -4
  11. package/dist/base/const.js +5 -4
  12. package/dist/base/primitives/MarkdownBlock.js +4 -1
  13. package/dist/base/primitives/compound/CompoundActionButton.js +27 -42
  14. package/dist/base/primitives/compound/CompoundDetailsButton.js +23 -48
  15. package/dist/base/primitives/compound/CompoundNodeContainer.js +16 -48
  16. package/dist/base/primitives/compound/CompoundTitle.js +5 -80
  17. package/dist/base/primitives/compound/actionbtns.css.js +1 -13
  18. package/dist/base/primitives/customEdge.d.ts +1 -1
  19. package/dist/base/primitives/customNode.d.ts +4 -4
  20. package/dist/base/primitives/customNode.js +7 -7
  21. package/dist/base/primitives/edge/EdgeLabel.d.ts +5 -4
  22. package/dist/base/primitives/edge/EdgeLabel.js +39 -21
  23. package/dist/base/primitives/edge/EdgeLabelContainer.js +11 -23
  24. package/dist/base/primitives/edge/edge.css.js +19 -11
  25. package/dist/base/primitives/element/ElementShape.js +38 -18
  26. package/dist/base/primitives/element/ElementTags.js +7 -4
  27. package/dist/base/primitives/element/ElementTitle.js +10 -2
  28. package/dist/base/types.d.ts +17 -21
  29. package/dist/bundle/LikeC4View.d.ts +2 -2
  30. package/dist/bundle/LikeC4View.js +4 -1
  31. package/dist/bundle/LikeC4View.props.d.ts +2 -2
  32. package/dist/bundle/ReactLikeC4.d.ts +3 -3
  33. package/dist/bundle/custom.js +2 -1
  34. package/dist/bundle/index.js +2 -1
  35. package/dist/components/Link.js +3 -2
  36. package/dist/context/ReduceGraphics.js +2 -5
  37. package/dist/context/RootContainer.js +1 -5
  38. package/dist/custom/customNodes.d.ts +32 -26
  39. package/dist/custom/customNodes.js +12 -8
  40. package/dist/custom/hooks.d.ts +2 -1
  41. package/dist/custom/index.js +2 -1
  42. package/dist/globals.css.js +1 -1
  43. package/dist/hooks/index.d.ts +1 -1
  44. package/dist/hooks/useDiagram.d.ts +18 -1
  45. package/dist/hooks/useDiagram.js +18 -2
  46. package/dist/hooks/useXYFlow.d.ts +40 -21
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +2 -1
  49. package/dist/likec4diagram/DiagramUI.js +5 -2
  50. package/dist/likec4diagram/DiagramXYFlow.js +9 -9
  51. package/dist/likec4diagram/custom/edges/RelationshipEdge.d.ts +3 -3
  52. package/dist/likec4diagram/custom/edges/RelationshipEdge.js +27 -44
  53. package/dist/likec4diagram/custom/index.js +3 -3
  54. package/dist/likec4diagram/custom/nodes/nodes.d.ts +8 -6
  55. package/dist/likec4diagram/custom/nodes/nodes.js +13 -14
  56. package/dist/likec4diagram/custom/nodes/toolbar/CompoundToolbar.js +3 -2
  57. package/dist/likec4diagram/custom/nodes/toolbar/_shared.d.ts +2 -2
  58. package/dist/likec4diagram/relationship-popover/RelationshipPopover.d.ts +2 -0
  59. package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +441 -0
  60. package/dist/likec4diagram/relationship-popover/actor.d.ts +177 -0
  61. package/dist/likec4diagram/relationship-popover/actor.js +155 -0
  62. package/dist/likec4diagram/relationship-popover/styles.css.d.ts +2 -0
  63. package/dist/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.js → relationship-popover/styles.css.js} +4 -17
  64. package/dist/likec4diagram/useLayoutConstraints.js +0 -1
  65. package/dist/likec4model/useLikeC4ElementsTree.js +1 -1
  66. package/dist/likec4model/useLikeC4Project.js +15 -1
  67. package/dist/navigationpanel/NavigationPanelDropdown.js +1 -2
  68. package/dist/navigationpanel/actor.js +1 -2
  69. package/dist/navigationpanel/controls/NavigationButtons.js +1 -5
  70. package/dist/navigationpanel/controls/ViewDetailsCard.js +2 -0
  71. package/dist/overlays/element-details/actor.d.ts +564 -8
  72. package/dist/overlays/overlay/Overlay.css.d.ts +1 -1
  73. package/dist/overlays/relationship-details/actor.d.ts +3 -1
  74. package/dist/overlays/relationship-details/hooks.d.ts +19 -1
  75. package/dist/overlays/relationship-details/layout-to-xyflow.js +0 -1
  76. package/dist/overlays/relationship-details/layout.js +1 -2
  77. package/dist/overlays/relationships-browser/actor.d.ts +26 -2
  78. package/dist/overlays/relationships-browser/custom/nodeTypes.d.ts +16 -0
  79. package/dist/overlays/relationships-browser/custom/nodeTypes.js +18 -8
  80. package/dist/overlays/relationships-browser/useViewToNodesEdges.js +0 -1
  81. package/dist/search/components/_shared.css.d.ts +1 -1
  82. package/dist/state/DiagramActorProvider.js +2 -19
  83. package/dist/state/assign.js +24 -10
  84. package/dist/state/diagram-machine.d.ts +149 -474
  85. package/dist/state/diagram-machine.js +94 -54
  86. package/dist/state/types.d.ts +1 -1
  87. package/dist/styles-min.css +1 -1
  88. package/dist/styles-xyflow.css +1 -1
  89. package/dist/styles.css +1 -1
  90. package/dist/styles.css2.js +1 -1
  91. package/dist/utils/index.d.ts +2 -1
  92. package/dist/utils/roundDpr.d.ts +1 -0
  93. package/dist/utils/roundDpr.js +20 -0
  94. package/dist/utils/xyflow.d.ts +0 -1
  95. package/dist/utils/xyflow.js +1 -7
  96. package/package.json +16 -15
  97. package/panda.buildinfo.json +91 -156
  98. package/src/LikeC4Diagram.props.ts +5 -5
  99. package/src/LikeC4Styles.tsx +22 -14
  100. package/src/StaticLikeC4Diagram.tsx +3 -0
  101. package/src/base/BaseXYFlow.tsx +26 -29
  102. package/src/base/const.ts +5 -4
  103. package/src/base/primitives/MarkdownBlock.tsx +6 -1
  104. package/src/base/primitives/compound/CompoundActionButton.tsx +31 -43
  105. package/src/base/primitives/compound/CompoundDetailsButton.tsx +26 -48
  106. package/src/base/primitives/compound/CompoundNodeContainer.tsx +15 -43
  107. package/src/base/primitives/compound/CompoundTitle.tsx +4 -76
  108. package/src/base/primitives/compound/actionbtns.css.ts +0 -12
  109. package/src/base/primitives/customEdge.ts +1 -1
  110. package/src/base/primitives/customNode.tsx +20 -24
  111. package/src/base/primitives/edge/EdgeLabel.tsx +23 -8
  112. package/src/base/primitives/edge/EdgeLabelContainer.tsx +9 -21
  113. package/src/base/primitives/edge/edge.css.ts +19 -11
  114. package/src/base/primitives/element/ElementShape.tsx +40 -18
  115. package/src/base/primitives/element/ElementTags.tsx +7 -4
  116. package/src/base/primitives/element/ElementTitle.tsx +23 -11
  117. package/src/base/types.ts +21 -25
  118. package/src/bundle/LikeC4View.props.ts +2 -2
  119. package/src/bundle/LikeC4View.tsx +8 -5
  120. package/src/bundle/ReactLikeC4.tsx +3 -3
  121. package/src/components/Link.tsx +3 -2
  122. package/src/context/RootContainer.tsx +1 -5
  123. package/src/context/TagStylesContext.tsx +2 -0
  124. package/src/custom/{customNodes.tsx → customNodes.ts} +58 -52
  125. package/src/custom/hooks.ts +7 -0
  126. package/src/globals.css +58 -5
  127. package/src/hooks/index.ts +1 -1
  128. package/src/hooks/useDiagram.ts +39 -5
  129. package/src/hooks/useXYFlow.ts +3 -1
  130. package/src/index.ts +1 -0
  131. package/src/likec4diagram/DiagramUI.tsx +3 -0
  132. package/src/likec4diagram/DiagramXYFlow.tsx +9 -11
  133. package/src/likec4diagram/custom/edges/RelationshipEdge.tsx +25 -49
  134. package/src/likec4diagram/custom/index.ts +5 -4
  135. package/src/likec4diagram/custom/nodes/nodes.tsx +13 -11
  136. package/src/likec4diagram/custom/nodes/toolbar/CompoundToolbar.tsx +3 -2
  137. package/src/likec4diagram/relationship-popover/RelationshipPopover.tsx +535 -0
  138. package/src/likec4diagram/relationship-popover/actor.ts +192 -0
  139. package/src/likec4diagram/{custom/edges/RelationshipsDropdownMenu.css.ts → relationship-popover/styles.css.ts} +3 -19
  140. package/src/likec4diagram/useLayoutConstraints.ts +0 -1
  141. package/src/likec4model/useLikeC4ElementsTree.ts +1 -1
  142. package/src/navigationpanel/NavigationPanelDropdown.tsx +1 -2
  143. package/src/navigationpanel/actor.ts +2 -2
  144. package/src/navigationpanel/controls/NavigationButtons.tsx +1 -5
  145. package/src/navigationpanel/controls/ViewDetailsCard.tsx +2 -0
  146. package/src/overlays/relationship-details/layout-to-xyflow.ts +0 -1
  147. package/src/overlays/relationship-details/layout.ts +4 -3
  148. package/src/overlays/relationships-browser/custom/nodeTypes.tsx +22 -8
  149. package/src/overlays/relationships-browser/useViewToNodesEdges.ts +0 -1
  150. package/src/state/DiagramActorProvider.tsx +2 -20
  151. package/src/state/assign.ts +24 -10
  152. package/src/state/diagram-machine.ts +101 -53
  153. package/src/state/types.ts +4 -1
  154. package/src/utils/index.ts +2 -1
  155. package/src/utils/roundDpr.ts +27 -0
  156. package/src/utils/xyflow.ts +0 -7
  157. package/dist/base/primitives/compound/CompoundNodeContainer.css.d.ts +0 -35
  158. package/dist/base/primitives/compound/CompoundNodeContainer.css.js +0 -132
  159. package/dist/base/primitives/edge/EdgeLabel.css.d.ts +0 -7
  160. package/dist/base/primitives/edge/EdgeLabel.css.js +0 -57
  161. package/dist/base/primitives/element/ElementShape.css.d.ts +0 -6
  162. package/dist/base/primitives/element/ElementShape.css.js +0 -107
  163. package/dist/likec4diagram/custom/edges/NotePopover.css.js +0 -21
  164. package/dist/likec4diagram/custom/edges/NotePopover.js +0 -91
  165. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.css.d.ts +0 -5
  166. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.d.ts +0 -13
  167. package/dist/likec4diagram/custom/edges/RelationshipsDropdownMenu.js +0 -215
  168. package/dist/likec4diagram/custom/index.d.ts +0 -62
  169. package/dist/overlays/relationship-details/custom/nodeTypes.d.ts +0 -10
  170. package/src/base/primitives/compound/CompoundNodeContainer.css.ts +0 -138
  171. package/src/base/primitives/edge/EdgeLabel.css.ts +0 -64
  172. package/src/base/primitives/element/ElementShape.css.ts +0 -112
  173. package/src/likec4diagram/custom/edges/RelationshipsDropdownMenu.tsx +0 -281
@@ -2,7 +2,7 @@ import { SlotRecipeRuntimeFn } from '@likec4/styles/types';
2
2
  export declare const backdropBlur = "--_blur";
3
3
  export declare const backdropOpacity = "--_opacity";
4
4
  export declare const level = "--_level";
5
- export declare const overlay: SlotRecipeRuntimeFn<"body" | "dialog", {
5
+ export declare const overlay: SlotRecipeRuntimeFn<"dialog" | "body", {
6
6
  fullscreen: {
7
7
  false: {
8
8
  dialog: {
@@ -5,7 +5,7 @@ import { Base } from '../../base';
5
5
  import { RelationshipDetailsTypes } from './_types';
6
6
  import { LayoutResult } from './layout';
7
7
  import { EdgeMarkerType, HandleType } from '@xyflow/system';
8
- import { ReactNode, CSSProperties } from 'react';
8
+ import { ReactNode, CSSProperties, AriaRole, SVGAttributes } from 'react';
9
9
  type XYFLowInstance = ReactFlowInstance<RelationshipDetailsTypes.Node, RelationshipDetailsTypes.Edge>;
10
10
  type XYStoreApi = ReturnType<typeof useStoreApi<RelationshipDetailsTypes.Node, RelationshipDetailsTypes.Edge>>;
11
11
  export type Input = ExclusiveUnion<{
@@ -619,6 +619,8 @@ export declare const relationshipDetailsLogic: StateMachine<Readonly<{
619
619
  className?: string;
620
620
  reconnectable?: boolean | HandleType;
621
621
  focusable?: boolean;
622
+ ariaRole?: AriaRole;
623
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
622
624
  type: "relationship";
623
625
  data: {
624
626
  hovered?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { EdgeId, Fqn, ViewId, RelationId, Color, RelationshipLineType, RichTextOrEmpty, BBox } from '@likec4/core';
2
2
  import { RelationshipDetailsActorRef, RelationshipDetailsSnapshot, Events } from './actor';
3
- import { Context, ReactNode, CSSProperties } from 'react';
3
+ import { Context, ReactNode, CSSProperties, AriaRole, SVGAttributes } from 'react';
4
4
  import { GeneralHelpers, ViewportHelperFunctions, ReactFlowState } from '@xyflow/react';
5
5
  import { EdgeMarkerType, HandleType } from '@xyflow/system';
6
6
  import { Dimmed } from '../../base/types.Base';
@@ -47,6 +47,8 @@ export declare function useRelationshipDetails(): {
47
47
  className?: string;
48
48
  reconnectable?: boolean | HandleType;
49
49
  focusable?: boolean;
50
+ ariaRole?: AriaRole;
51
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
50
52
  type: "relationship";
51
53
  data: {
52
54
  hovered?: boolean;
@@ -90,6 +92,8 @@ export declare function useRelationshipDetails(): {
90
92
  className?: string;
91
93
  reconnectable?: boolean | HandleType;
92
94
  focusable?: boolean;
95
+ ariaRole?: AriaRole;
96
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
93
97
  type: "relationship";
94
98
  data: {
95
99
  hovered?: boolean;
@@ -130,6 +134,8 @@ export declare function useRelationshipDetails(): {
130
134
  className?: string;
131
135
  reconnectable?: boolean | HandleType;
132
136
  focusable?: boolean;
137
+ ariaRole?: AriaRole;
138
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
133
139
  type: "relationship";
134
140
  data: {
135
141
  hovered?: boolean;
@@ -169,6 +175,8 @@ export declare function useRelationshipDetails(): {
169
175
  className?: string;
170
176
  reconnectable?: boolean | HandleType;
171
177
  focusable?: boolean;
178
+ ariaRole?: AriaRole;
179
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
172
180
  type: "relationship";
173
181
  data: {
174
182
  hovered?: boolean;
@@ -208,6 +216,8 @@ export declare function useRelationshipDetails(): {
208
216
  className?: string;
209
217
  reconnectable?: boolean | HandleType;
210
218
  focusable?: boolean;
219
+ ariaRole?: AriaRole;
220
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
211
221
  type: "relationship";
212
222
  data: {
213
223
  hovered?: boolean;
@@ -247,6 +257,8 @@ export declare function useRelationshipDetails(): {
247
257
  className?: string;
248
258
  reconnectable?: boolean | HandleType;
249
259
  focusable?: boolean;
260
+ ariaRole?: AriaRole;
261
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
250
262
  type: "relationship";
251
263
  data: {
252
264
  hovered?: boolean;
@@ -286,6 +298,8 @@ export declare function useRelationshipDetails(): {
286
298
  className?: string;
287
299
  reconnectable?: boolean | HandleType;
288
300
  focusable?: boolean;
301
+ ariaRole?: AriaRole;
302
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
289
303
  type: "relationship";
290
304
  data: {
291
305
  hovered?: boolean;
@@ -326,6 +340,8 @@ export declare function useRelationshipDetails(): {
326
340
  className?: string;
327
341
  reconnectable?: boolean | HandleType;
328
342
  focusable?: boolean;
343
+ ariaRole?: AriaRole;
344
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
329
345
  type: "relationship";
330
346
  data: {
331
347
  hovered?: boolean;
@@ -365,6 +381,8 @@ export declare function useRelationshipDetails(): {
365
381
  className?: string;
366
382
  reconnectable?: boolean | HandleType;
367
383
  focusable?: boolean;
384
+ ariaRole?: AriaRole;
385
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
368
386
  type: "relationship";
369
387
  data: {
370
388
  hovered?: boolean;
@@ -121,7 +121,6 @@ function layoutResultToXYFlow(layout) {
121
121
  target: ns + target,
122
122
  sourceHandle: edge.sourceHandle,
123
123
  targetHandle: edge.targetHandle,
124
- zIndex: ZIndexes.Edge,
125
124
  // selectable: selectable,
126
125
  // hidden: !visiblePredicate(edge),
127
126
  deletable: false,
@@ -1,7 +1,6 @@
1
1
  import { treeFromElements } from '@likec4/core/compute-view/relationships';
2
2
  import dagre from '@dagrejs/dagre';
3
- import { RichText, invariant } from '@likec4/core';
4
- import { ifind, DefaultMap } from '@likec4/core/utils';
3
+ import { ifind, RichText, DefaultMap, invariant } from '@likec4/core';
5
4
  import { pipe, filter, mapToObj, find, map, tap, reduce, sortBy, prop } from 'remeda';
6
5
 
7
6
  const Sizes = {
@@ -5,7 +5,7 @@ import { Base } from '../../base';
5
5
  import { RelationshipsBrowserTypes } from './_types';
6
6
  import { LayoutRelationshipsViewResult } from './layout';
7
7
  import { EdgeMarkerType, HandleType } from '@xyflow/system';
8
- import { ReactNode, CSSProperties } from 'react';
8
+ import { ReactNode, CSSProperties, AriaRole, SVGAttributes } from 'react';
9
9
  type XYFLowInstance = ReactFlowInstance<RelationshipsBrowserTypes.Node, RelationshipsBrowserTypes.Edge>;
10
10
  export type XYStoreApi = ReturnType<typeof useStoreApi<RelationshipsBrowserTypes.Node, RelationshipsBrowserTypes.Edge>>;
11
11
  export declare const layouter: PromiseActorLogic<{
@@ -202,6 +202,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
202
202
  className?: string;
203
203
  reconnectable?: boolean | HandleType;
204
204
  focusable?: boolean;
205
+ ariaRole?: AriaRole;
206
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
205
207
  type: "relationship";
206
208
  data: {
207
209
  hovered?: boolean;
@@ -255,6 +257,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
255
257
  className?: string;
256
258
  reconnectable?: boolean | HandleType;
257
259
  focusable?: boolean;
260
+ ariaRole?: AriaRole;
261
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
258
262
  type: "relationship";
259
263
  data: {
260
264
  hovered?: boolean;
@@ -315,6 +319,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
315
319
  className?: string;
316
320
  reconnectable?: boolean | HandleType;
317
321
  focusable?: boolean;
322
+ ariaRole?: AriaRole;
323
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
318
324
  type: "relationship";
319
325
  data: {
320
326
  hovered?: boolean;
@@ -352,7 +358,7 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
352
358
  }) => {
353
359
  subject: Fqn;
354
360
  viewId: ViewId | null;
355
- scope: "view" | "global";
361
+ scope: "global" | "view";
356
362
  closeable: boolean;
357
363
  enableSelectSubject: boolean;
358
364
  enableChangeScope: boolean;
@@ -800,6 +806,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
800
806
  className?: string;
801
807
  reconnectable?: boolean | HandleType;
802
808
  focusable?: boolean;
809
+ ariaRole?: AriaRole;
810
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
803
811
  type: "relationship";
804
812
  data: {
805
813
  hovered?: boolean;
@@ -844,6 +852,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
844
852
  className?: string;
845
853
  reconnectable?: boolean | HandleType;
846
854
  focusable?: boolean;
855
+ ariaRole?: AriaRole;
856
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
847
857
  type: "relationship";
848
858
  data: {
849
859
  hovered?: boolean;
@@ -885,6 +895,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
885
895
  className?: string;
886
896
  reconnectable?: boolean | HandleType;
887
897
  focusable?: boolean;
898
+ ariaRole?: AriaRole;
899
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
888
900
  type: "relationship";
889
901
  data: {
890
902
  hovered?: boolean;
@@ -925,6 +937,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
925
937
  className?: string;
926
938
  reconnectable?: boolean | HandleType;
927
939
  focusable?: boolean;
940
+ ariaRole?: AriaRole;
941
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
928
942
  type: "relationship";
929
943
  data: {
930
944
  hovered?: boolean;
@@ -965,6 +979,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
965
979
  className?: string;
966
980
  reconnectable?: boolean | HandleType;
967
981
  focusable?: boolean;
982
+ ariaRole?: AriaRole;
983
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
968
984
  type: "relationship";
969
985
  data: {
970
986
  hovered?: boolean;
@@ -1005,6 +1021,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
1005
1021
  className?: string;
1006
1022
  reconnectable?: boolean | HandleType;
1007
1023
  focusable?: boolean;
1024
+ ariaRole?: AriaRole;
1025
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
1008
1026
  type: "relationship";
1009
1027
  data: {
1010
1028
  hovered?: boolean;
@@ -1045,6 +1063,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
1045
1063
  className?: string;
1046
1064
  reconnectable?: boolean | HandleType;
1047
1065
  focusable?: boolean;
1066
+ ariaRole?: AriaRole;
1067
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
1048
1068
  type: "relationship";
1049
1069
  data: {
1050
1070
  hovered?: boolean;
@@ -1086,6 +1106,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
1086
1106
  className?: string;
1087
1107
  reconnectable?: boolean | HandleType;
1088
1108
  focusable?: boolean;
1109
+ ariaRole?: AriaRole;
1110
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
1089
1111
  type: "relationship";
1090
1112
  data: {
1091
1113
  hovered?: boolean;
@@ -1126,6 +1148,8 @@ export declare const relationshipsBrowserLogic: StateMachine<Context, Events, {
1126
1148
  className?: string;
1127
1149
  reconnectable?: boolean | HandleType;
1128
1150
  focusable?: boolean;
1151
+ ariaRole?: AriaRole;
1152
+ domAttributes?: Omit< SVGAttributes<SVGGElement>, "id" | "style" | "className" | "role" | "aria-label">;
1129
1153
  type: "relationship";
1130
1154
  data: {
1131
1155
  hovered?: boolean;
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ import { NodeProps } from '../../../base';
3
+ import { RelationshipsBrowserTypes } from '../_types';
4
+ type NodeTypes = {
5
+ element: FC<NodeProps<RelationshipsBrowserTypes.ElementNodeData>>;
6
+ compound: FC<NodeProps<RelationshipsBrowserTypes.CompoundNodeData>>;
7
+ empty: FC<NodeProps<RelationshipsBrowserTypes.EmptyNodeData>>;
8
+ };
9
+ export declare const ElementNode: NodeTypes['element'];
10
+ export declare const CompoundNode: NodeTypes['compound'];
11
+ export declare const EmptyNode: NodeTypes['empty'];
12
+ type ElementPortsProps = NodeProps<Pick<RelationshipsBrowserTypes.ElementNodeData, 'ports' | 'height'>>;
13
+ export declare const ElementPorts: ({ data: { ports, height: h } }: ElementPortsProps) => import("react/jsx-runtime").JSX.Element;
14
+ type CompoundPortsProps = NodeProps<Pick<RelationshipsBrowserTypes.CompoundNodeData, 'ports'>>;
15
+ export declare const CompoundPorts: ({ data }: CompoundPortsProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -5,9 +5,9 @@ import { useEnabledFeatures } from '../../../context/DiagramFeatures.js';
5
5
  import { useDiagram } from '../../../hooks/useDiagram.js';
6
6
  import { ElementActions } from './ElementActions.js';
7
7
  import { EmptyNode as EmptyNode$1 } from './EmptyNode.js';
8
- import { customNode } from '../../../base/primitives/customNode.js';
9
8
  import { CompoundNodeContainer } from '../../../base/primitives/compound/CompoundNodeContainer.js';
10
9
  import { CompoundTitle } from '../../../base/primitives/compound/CompoundTitle.js';
10
+ import { CompoundDetailsButton } from '../../../base/primitives/compound/CompoundDetailsButton.js';
11
11
  import { ElementNodeContainer } from '../../../base/primitives/element/ElementNodeContainer.js';
12
12
  import { ElementShape } from '../../../base/primitives/element/ElementShape.js';
13
13
  import { ElementTitle } from '../../../base/primitives/element/ElementTitle.js';
@@ -27,7 +27,7 @@ const ElementDetailsButtonWithHandler = (props) => {
27
27
  }
28
28
  );
29
29
  };
30
- const ElementNode = customNode((props) => {
30
+ const ElementNode = (props) => {
31
31
  const { enableElementTags } = useEnabledFeatures();
32
32
  return /* @__PURE__ */ jsxs(ElementNodeContainer, { layoutId: props.id, nodeProps: props, children: [
33
33
  /* @__PURE__ */ jsx(ElementShape, { ...props }),
@@ -37,17 +37,27 @@ const ElementNode = customNode((props) => {
37
37
  /* @__PURE__ */ jsx(ElementActions, { ...props }),
38
38
  /* @__PURE__ */ jsx(ElementPorts, { ...props })
39
39
  ] }, props.id);
40
- });
41
- const CompoundNode = customNode((props) => {
40
+ };
41
+ const CompoundNode = (props) => {
42
+ const diagram = useDiagram();
42
43
  return /* @__PURE__ */ jsxs(CompoundNodeContainer, { layoutId: props.id, nodeProps: props, children: [
43
- /* @__PURE__ */ jsx(ElementDetailsButtonWithHandler, { ...props }),
44
44
  /* @__PURE__ */ jsx(CompoundTitle, { ...props }),
45
+ /* @__PURE__ */ jsx(
46
+ CompoundDetailsButton,
47
+ {
48
+ ...props,
49
+ onClick: (e) => {
50
+ e.stopPropagation();
51
+ diagram.openElementDetails(props.data.fqn);
52
+ }
53
+ }
54
+ ),
45
55
  /* @__PURE__ */ jsx(CompoundPorts, { ...props })
46
56
  ] }, props.id);
47
- });
48
- const EmptyNode = customNode((props) => {
57
+ };
58
+ const EmptyNode = (props) => {
49
59
  return /* @__PURE__ */ jsx(EmptyNode$1, { ...props });
50
- });
60
+ };
51
61
  const ElementPorts = ({ data: { ports, height: h } }) => {
52
62
  return /* @__PURE__ */ jsxs(Fragment, { children: [
53
63
  ports.in.map((id, i) => /* @__PURE__ */ jsx(
@@ -137,7 +137,6 @@ function viewToNodesEdge(view) {
137
137
  target: ns + target,
138
138
  sourceHandle: edge.sourceHandle,
139
139
  targetHandle: edge.targetHandle,
140
- zIndex: ZIndexes.Edge,
141
140
  // selectable: selectable,
142
141
  // hidden: !visiblePredicate(edge),
143
142
  // deletable: false,
@@ -1,4 +1,4 @@
1
1
  import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '@likec4/styles/types';
2
2
  export declare const focusable = "likec4-focusable";
3
3
  export declare const emptyBoX: string;
4
- export declare const buttonsva: SlotRecipeRuntimeFn<"root" | "title" | "description" | "icon" | "descriptionColor", SlotRecipeVariantRecord<"root" | "title" | "description" | "icon" | "descriptionColor">>;
4
+ export declare const buttonsva: SlotRecipeRuntimeFn<"title" | "description" | "icon" | "root" | "descriptionColor", SlotRecipeVariantRecord<"title" | "description" | "icon" | "root" | "descriptionColor">>;
@@ -3,7 +3,7 @@ import { useCustomCompareEffect } from '@react-hookz/web';
3
3
  import { useActorRef, useSelector } from '@xstate/react';
4
4
  import { useStoreApi } from '@xyflow/react';
5
5
  import { shallowEqual, deepEqual } from 'fast-equals';
6
- import { useRef, useEffect, useState } from 'react';
6
+ import { useRef, useEffect } from 'react';
7
7
  import { ErrorBoundary } from '../components/ErrorFallback.js';
8
8
  import { useDiagramEventHandlers } from '../context/DiagramEventHandlers.js';
9
9
  import { useEnabledFeatures, DiagramFeatures } from '../context/DiagramFeatures.js';
@@ -96,24 +96,7 @@ function CurrentViewModelProvider({
96
96
  viewId
97
97
  }) {
98
98
  const likec4model = useLikeC4Model();
99
- const [viewmodel, setViewmodel] = useState(() => likec4model.findView(viewId));
100
- useEffect(() => {
101
- setViewmodel((current) => {
102
- const nextviewmodel = likec4model.findView(viewId);
103
- if (!nextviewmodel) {
104
- console.error(`View "${viewId}" not found in likec4model, current viewmodel: ${current?.id}`, {
105
- currentViewModel: current,
106
- likec4model
107
- });
108
- return current;
109
- }
110
- if (!nextviewmodel.isDiagram()) {
111
- console.warn(`View "${viewId}" is not diagram.
112
- Make sure you have LikeC4ModelProvider with layouted model.`);
113
- }
114
- return nextviewmodel;
115
- });
116
- }, [likec4model, viewId]);
99
+ const viewmodel = likec4model.findView(viewId);
117
100
  return /* @__PURE__ */ jsx(CurrentViewModelContext.Provider, { value: viewmodel, children });
118
101
  }
119
102
  function useActorEventHandlers(actorRef) {
@@ -237,22 +237,36 @@ function navigateForward({ context }) {
237
237
  }
238
238
  function updateNodeData({ context, event }) {
239
239
  assertEvent(event, "update.nodeData");
240
- const xynodes = context.xynodes.map(
241
- (node) => node.id !== event.nodeId ? node : {
242
- ...node,
243
- data: mergeDeep(node.data, event.data)
240
+ const xynodes = context.xynodes.map((node) => {
241
+ if (node.id !== event.nodeId) {
242
+ return node;
243
+ }
244
+ const data = mergeDeep(node.data, event.data);
245
+ if (deepEqual(data, node.data)) {
246
+ return node;
244
247
  }
245
- );
248
+ return {
249
+ ...node,
250
+ data
251
+ };
252
+ });
246
253
  return { xynodes };
247
254
  }
248
255
  function updateEdgeData({ context, event }) {
249
256
  assertEvent(event, "update.edgeData");
250
- const xyedges = context.xyedges.map(
251
- (edge) => edge.id !== event.edgeId ? edge : {
252
- ...edge,
253
- data: mergeDeep(edge.data, event.data)
257
+ const xyedges = context.xyedges.map((edge) => {
258
+ if (edge.id !== event.edgeId) {
259
+ return edge;
260
+ }
261
+ const data = mergeDeep(edge.data, event.data);
262
+ if (deepEqual(data, edge.data)) {
263
+ return edge;
254
264
  }
255
- );
265
+ return {
266
+ ...edge,
267
+ data
268
+ };
269
+ });
256
270
  return { xyedges };
257
271
  }
258
272
  function resetEdgeControlPoints({ context }) {