@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
package/bundle/custom.js CHANGED
@@ -1,73 +1,81 @@
1
- import { d5 as customNode, e8 as useLikeC4ViewModel } from "./chunk-DHvr-RGh.js";
2
- import { ea, ed, cB, ee, eb, ef, cC, eg, d6, d7, ec, eh, ei, cD, d3, ej, dc, ek, cE, d8, d9, cU, db, da, el, dD, dr, e2, cq, en, eo, ep, cV, dz, em, cA, cQ, c$, c3, c_, c2, cm, cl, cb, dN, c4, e9, be, cu, cw, dx, b8 } from "./chunk-DHvr-RGh.js";
1
+ import { dt as customNode, eh as useLikeC4ViewModel } from "./chunk-BZV0K82k.js";
2
+ import { el, en, cc, eo, d1, ep, cd, eq, c$, d0, em, er, es, ce, cZ, et, d8, eu, cf, d2, d3, cE, d5, d4, ev, dA, dl, e9, dq, ex, ey, ez, cF, dw, ew, cb, cy, cU, c5, cT, cl, ck, c6, ei, cQ, cL, ej, cK, dU, ct, dD, ek, be, c4, c7, du, b8 } from "./chunk-BZV0K82k.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  function customDiagramNode(Node) {
5
5
  return customNode((props) => {
6
- const viewModel = useLikeC4ViewModel(props.data.viewId);
6
+ const viewId = props.data.viewId, viewModel = useLikeC4ViewModel(viewId);
7
7
  if (!viewModel)
8
- return console.error(`View "${props.data.viewId}" not found in likec4model`, { props }), null;
9
- const model = viewModel.node(props.id);
10
- return /* @__PURE__ */ jsx(Node, { nodeProps: props, nodeModel: model });
8
+ return console.error(`View "${viewId}" not found, requested by customNode "${props.data.id}"`, { props }), null;
9
+ const model = viewModel.findNode(props.data.id);
10
+ return model ? jsx(Node, { nodeProps: props, nodeModel: model }) : (console.error(
11
+ `Node "${props.id}" not found in view "${viewId}", requested by customNode "${props.data.id}"`,
12
+ { props }
13
+ ), null);
11
14
  });
12
15
  }
13
16
  const elementNode = customDiagramNode, deploymentNode = customDiagramNode, compoundElementNode = customDiagramNode, compoundDeploymentNode = customDiagramNode, viewGroupNode = customDiagramNode;
14
17
  export {
15
- ea as CompoundActionButton,
16
- ed as CompoundActions,
17
- cB as CompoundDeploymentNode,
18
- ee as CompoundDeploymentToolbar,
19
- eb as CompoundDetailsButton,
20
- ef as CompoundDetailsButtonWithHandler,
21
- cC as CompoundElementNode,
22
- eg as CompoundElementToolbar,
23
- d6 as CompoundNodeContainer,
24
- d7 as CompoundTitle,
25
- ec as DefaultHandles,
26
- eh as DeploymentElementActions,
27
- ei as DeploymentElementToolbar,
28
- cD as DeploymentNode,
29
- d3 as ElementActionButtons,
30
- ej as ElementActions,
31
- dc as ElementDetailsButton,
32
- ek as ElementDetailsButtonWithHandler,
33
- cE as ElementNode,
34
- d8 as ElementNodeContainer,
35
- d9 as ElementShape,
36
- cU as ElementTag,
37
- db as ElementTags,
38
- da as ElementTitle,
39
- el as ElementToolbar,
40
- dD as IconOrShapeRenderer,
41
- dr as IconRenderer,
42
- e2 as IconRendererProvider,
43
- cq as IfEnabled,
44
- en as IfNotEnabled,
45
- eo as IfNotReadOnly,
46
- ep as IfReadOnly,
47
- cV as MarkdownBlock,
48
- dz as Overlay,
49
- em as Toolbar,
50
- cA as ViewGroupNode,
18
+ el as CompoundActionButton,
19
+ en as CompoundActions,
20
+ cc as CompoundDeploymentNode,
21
+ eo as CompoundDeploymentToolbar,
22
+ d1 as CompoundDetailsButton,
23
+ ep as CompoundDetailsButtonWithHandler,
24
+ cd as CompoundElementNode,
25
+ eq as CompoundElementToolbar,
26
+ c$ as CompoundNodeContainer,
27
+ d0 as CompoundTitle,
28
+ em as DefaultHandles,
29
+ er as DeploymentElementActions,
30
+ es as DeploymentElementToolbar,
31
+ ce as DeploymentNode,
32
+ cZ as ElementActionButtons,
33
+ et as ElementActions,
34
+ d8 as ElementDetailsButton,
35
+ eu as ElementDetailsButtonWithHandler,
36
+ cf as ElementNode,
37
+ d2 as ElementNodeContainer,
38
+ d3 as ElementShape,
39
+ cE as ElementTag,
40
+ d5 as ElementTags,
41
+ d4 as ElementTitle,
42
+ ev as ElementToolbar,
43
+ dA as IconOrShapeRenderer,
44
+ dl as IconRenderer,
45
+ e9 as IconRendererProvider,
46
+ dq as IfEnabled,
47
+ ex as IfNotEnabled,
48
+ ey as IfNotReadOnly,
49
+ ez as IfReadOnly,
50
+ cF as MarkdownBlock,
51
+ dw as Overlay,
52
+ ew as Toolbar,
53
+ cb as ViewGroupNode,
51
54
  compoundDeploymentNode,
52
55
  compoundElementNode,
53
56
  deploymentNode,
54
57
  elementNode,
55
- cQ as useCurrentViewId,
56
- c$ as useCurrentViewModel,
57
- c3 as useDiagram,
58
- c_ as useDiagramActorRef,
59
- c2 as useDiagramContext,
60
- cm as useDiagramEventHandlers,
61
- cl as useEnabledFeatures,
62
- cb as useLikeC4Model,
63
- dN as useLikeC4Specification,
58
+ cy as useCurrentViewId,
59
+ cU as useCurrentViewModel,
60
+ c5 as useDiagram,
61
+ cT as useDiagramActorRef,
62
+ cl as useDiagramContext,
63
+ ck as useDiagramEventHandlers,
64
+ c6 as useEnabledFeatures,
65
+ ei as useHasProjects,
66
+ cQ as useLikeC4Model,
67
+ cL as useLikeC4ProjectId,
68
+ ej as useLikeC4Projects,
69
+ cK as useLikeC4ProjectsContext,
70
+ dU as useLikeC4Specification,
64
71
  useLikeC4ViewModel,
65
- c4 as useMantinePortalProps,
66
- e9 as useSetState,
72
+ ct as useMantinePortalProps,
73
+ dD as useOnDiagramEvent,
74
+ ek as useSetState,
67
75
  be as useUpdateEffect,
68
- cu as useXYFlow,
69
- cw as useXYInternalNode,
70
- dx as useXYStore,
76
+ c4 as useXYFlow,
77
+ c7 as useXYInternalNode,
78
+ du as useXYStore,
71
79
  b8 as useXYStoreApi,
72
80
  viewGroupNode
73
81
  };